PageSourceSearch

https://edmnexus.ai/assets/index-C16o6Dy5.js

js edmnexus.ai collected 2026-10-05 14:06:19 UTC 1,967,799 bytes, 954 lines download raw bytes

vendor: 4,154 bytes, lines 1-9
1var _J=Object.defineProperty;var oO=e=>{throw TypeError(e)};var CJ=(e,t,n)=>t in e?_J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kJ=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Xe=(e,t,n)=>CJ(e,typeof t!="symbol"?t+"":t,n),wj=(e,t,n)=>t.has(e)||oO("Cannot "+n);var de=(e,t,n)=>(wj(e,t,"read from private field"),n?n.call(e):t.get(e)),kt=(e,t,n)=>t.has(e)?oO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Je=(e,t,n,r)=>(wj(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xr=(e,t,n)=>(wj(e,t,"access private method"),n);var Sv=(e,t,n,r)=>({set _(a){Je(e,t,a,n)},get _(){return de(e,t,r)}});var Pqe=kJ((Gqe,Yg)=>{function EJ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var xd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function AJ(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var P5={exports:{}},O0={},T5={exports:{}},ht={};/**
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 Sg=Symbol.for("react.element"),PJ=Symbol.for("react.portal"),TJ=Symbol.for("react.fragment"),OJ=Symbol.for("react.strict_mode"),MJ=Symbol.for("react.profiler"),IJ=Symbol.for("react.provider"),$J=Symbol.for("react.context"),DJ=Symbol.for("react.forward_ref"),RJ=Symbol.for("react.suspense"),LJ=Symbol.for("react.memo"),FJ=Symbol.for("react.lazy"),sO=Symbol.iterator;function BJ(e){return e===null||typeof e!="object"?null:(e=sO&&e[sO]||e["@@iterator"],typeof e=="function"?e:null)}var O5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M5=Object.assign,I5={};function sh(e,t,n){this.props=e,this.context=t,this.refs=I5,this.updater=n||O5}sh.prototype.isReactComponent={};sh.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};sh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $5(){}$5.prototype=sh.prototype;function $E(e,t,n){this.props=e,this.context=t,this.refs=I5,this.updater=n||O5}var DE=$E.prototype=new $5;DE.constructor=$E;M5(DE,sh.prototype);DE.isPureReactComponent=!0;var iO=Array.isArray,D5=Object.prototype.hasOwnProperty,RE={current:null},R5={key:!0,ref:!0,__self:!0,__source:!0};
vendor: 6,650 bytes, lines 9-25
9function L5(e,t,n){var r,a={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)D5.call(t,r)&&!R5.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Sg,type:e,key:s,ref:i,props:a,_owner:RE.current}}function zJ(e,t){return{$$typeof:Sg,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function LE(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sg}function UJ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lO=/\/+/g;function jj(e,t){return typeof e=="object"&&e!==null&&e.key!=null?UJ(""+e.key):t.toString(36)}function Wy(e,t,n,r,a){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Sg:case PJ:i=!0}}if(i)return i=e,a=a(i),e=r===""?"."+jj(i,0):r,iO(a)?(n="",e!=null&&(n=e.replace(lO,"$&/")+"/"),Wy(a,t,n,"",function(u){return u})):a!=null&&(LE(a)&&(a=zJ(a,n+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(lO,"$&/")+"/")+e)),t.push(a)),1;if(i=0,r=r===""?".":r+":",iO(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+jj(s,l);i+=Wy(s,t,n,c,a)}else if(c=BJ(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+jj(s,l++),i+=Wy(s,t,n,c,a);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Nv(e,t,n){if(e==null)return e;var r=[],a=0;return Wy(e,r,"","",function(s){return t.call(n,s,a++)}),r}function VJ(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qr={current:null},qy={transition:null},WJ={ReactCurrentDispatcher:qr,ReactCurrentBatchConfig:qy,ReactCurrentOwner:RE};function F5(){throw Error("act(...) is not supported in production builds of React.")}ht.Children={map:Nv,forEach:function(e,t,n){Nv(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nv(e,function(){t++}),t},toArray:function(e){return Nv(e,function(t){return t})||[]},only:function(e){if(!LE(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ht.Component=sh;ht.Fragment=TJ;ht.Profiler=MJ;ht.PureComponent=$E;ht.StrictMode=OJ;ht.Suspense=RJ;ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WJ;ht.act=F5;ht.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=M5({},e.props),a=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=RE.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)D5.call(t,c)&&!R5.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Sg,type:e.type,key:a,ref:s,props:r,_owner:i}};ht.createContext=function(e){return e={$$typeof:$J,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:IJ,_context:e},e.Consumer=e};ht.createElement=L5;ht.createFactory=function(e){var t=L5.bind(null,e);return t.type=e,t};ht.createRef=function(){return{current:null}};ht.forwardRef=function(e){return{$$typeof:DJ,render:e}};ht.isValidElement=LE;ht.lazy=function(e){return{$$typeof:FJ,_payload:{_status:-1,_result:e},_init:VJ}};ht.memo=function(e,t){return{$$typeof:LJ,type:e,compare:t===void 0?null:t}};ht.startTransition=function(e){var t=qy.transition;qy.transition={};try{e()}finally{qy.transition=t}};ht.unstable_act=F5;ht.useCallback=function(e,t){return qr.current.useCallback(e,t)};ht.useContext=function(e){return qr.current.useContext(e)};ht.useDebugValue=function(){};ht.useDeferredValue=function(e){return qr.current.useDeferredValue(e)};ht.useEffect=function(e,t){return qr.current.useEffect(e,t)};ht.useId=function(){return qr.current.useId()};ht.useImperativeHandle=function(e,t,n){return qr.current.useImperativeHandle(e,t,n)};ht.useInsertionEffect=function(e,t){return qr.current.useInsertionEffect(e,t)};ht.useLayoutEffect=function(e,t){return qr.current.useLayoutEffect(e,t)};ht.useMemo=function(e,t){return qr.current.useMemo(e,t)};ht.useReducer=function(e,t,n){return qr.current.useReducer(e,t,n)};ht.useRef=function(e){return qr.current.useRef(e)};ht.useState=function(e){return qr.current.useState(e)};ht.useSyncExternalStore=function(e,t,n){return qr.current.useSyncExternalStore(e,t,n)};ht.useTransition=function(){return qr.current.useTransition()};ht.version="18.3.1";T5.exports=ht;var p=T5.exports;const H=Dt(p),M0=EJ({__proto__:null,default:H},[p]);/**
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 qJ=p,HJ=Symbol.for("react.element"),GJ=Symbol.for("react.fragment"),YJ=Object.prototype.hasOwnProperty,KJ=qJ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,XJ={key:!0,ref:!0,__self:!0,__source:!0};function B5(e,t,n){var r,a={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)YJ.call(t,r)&&!XJ.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:HJ,type:e,key:s,ref:i,props:a,_owner:KJ.current}}O0.Fragment=GJ;O0.jsx=B5;O0.jsxs=B5;P5.exports=O0;var o=P5.exports,z5={exports:{}},Da={},U5={exports:{}},V5={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(M,B){var I=M.length;M.push(B);e:for(;0<I;){var R=I-1>>>1,F=M[R];if(0<a(F,B))M[R]=B,M[I]=F,I=R;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var B=M[0],I=M.pop();if(I!==B){M[0]=I;e:for(var R=0,F=M.length,j=F>>>1;R<j;
vendor: 9,541 bytes, lines 25-33
25){var C=2*(R+1)-1,A=M[C],D=C+1,V=M[D];if(0>a(A,I))D<F&&0>a(V,A)?(M[R]=V,M[D]=I,R=D):(M[R]=A,M[C]=I,R=C);else if(D<F&&0>a(V,I))M[R]=V,M[D]=I,R=D;else break e}}return B}function a(M,B){var I=M.sortIndex-B.sortIndex;return I!==0?I:M.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,v=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=M)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function N(M){if(g=!1,w(M),!v)if(n(c)!==null)v=!0,W(S);else{var B=n(u);B!==null&&L(N,B.startTime-M)}}function S(M,B){v=!1,g&&(g=!1,x(P),P=-1),m=!0;var I=h;try{for(w(B),f=n(c);f!==null&&(!(f.expirationTime>B)||M&&!T());){var R=f.callback;if(typeof R=="function"){f.callback=null,h=f.priorityLevel;var F=R(f.expirationTime<=B);B=e.unstable_now(),typeof F=="function"?f.callback=F:f===n(c)&&r(c),w(B)}else r(c);f=n(c)}if(f!==null)var j=!0;else{var C=n(u);C!==null&&L(N,C.startTime-B),j=!1}return j}finally{f=null,h=I,m=!1}}var _=!1,k=null,P=-1,O=5,$=-1;function T(){return!(e.unstable_now()-$<O)}function z(){if(k!==null){var M=e.unstable_now();$=M;var B=!0;try{B=k(!0,M)}finally{B?U():(_=!1,k=null)}}else _=!1}var U;if(typeof b=="function")U=function(){b(z)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,q=E.port2;E.port1.onmessage=z,U=function(){q.postMessage(null)}}else U=function(){y(z,0)};function W(M){k=M,_||(_=!0,U())}function L(M,B){P=y(function(){M(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,W(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var I=h;h=B;try{return M()}finally{h=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,B){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var I=h;h=M;try{return B()}finally{h=I}},e.unstable_scheduleCallback=function(M,B,I){var R=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?R+I:R):I=R,M){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=I+F,M={id:d++,callback:B,priorityLevel:M,startTime:I,expirationTime:F,sortIndex:-1},I>R?(M.sortIndex=I,t(u,M),n(c)===null&&M===n(u)&&(g?(x(P),P=-1):g=!0,L(N,I-R))):(M.sortIndex=F,t(c,M),v||m||(v=!0,W(S))),M},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(M){var B=h;return function(){var I=h;h=B;try{return M.apply(this,arguments)}finally{h=I}}}})(V5);U5.exports=V5;var JJ=U5.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 QJ=p,Pa=JJ;function ge(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W5=new Set,rp={};function Pu(e,t){hf(e,t),hf(e+"Capture",t)}function hf(e,t){for(rp[e]=t,e=0;e<t.length;e++)W5.add(t[e])}var ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),UN=Object.prototype.hasOwnProperty,ZJ=/^[: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]*$/,cO={},uO={};function eQ(e){return UN.call(uO,e)?!0:UN.call(cO,e)?!1:ZJ.test(e)?uO[e]=!0:(cO[e]=!0,!1)}function tQ(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nQ(e,t,n,r){if(t===null||typeof t>"u"||tQ(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Hr(e,t,n,r,a,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mr[e]=new Hr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mr[t]=new Hr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mr[e]=new Hr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mr[e]=new Hr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mr[e]=new Hr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mr[e]=new Hr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mr[e]=new Hr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mr[e]=new Hr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mr[e]=new Hr(e,5,!1,e.toLowerCase(),null,!1,!1)});var FE=/[\-:]([a-z])/g;function BE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(FE,BE);mr[t]=new Hr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(FE,BE);mr[t]=new Hr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(FE,BE);mr[t]=new Hr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mr[e]=new Hr(e,1,!1,e.toLowerCase(),null,!1,!1)});mr.xlinkHref=new Hr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mr[e]=new Hr(e,1,!1,e.toLowerCase(),null,!0,!0)});function zE(e,t,n,r){var a=mr.hasOwnProperty(t)?mr[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nQ(t,n,a,r)&&(n=null),r||a===null?eQ(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ui=QJ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_v=Symbol.for("react.element"),bd=Symbol.for("react.portal"),wd=Symbol.for("react.fragment"),UE=Symbol.for("react.strict_mode"),VN=Symbol.for("react.profiler"),q5=Symbol.for("react.provider"),H5=Symbol.for("react.context"),VE=Symbol.for("react.forward_ref"),WN=Symbol.for("react.suspense"),qN=Symbol.for("react.suspense_list"),WE=Symbol.for("react.memo"),
vendor: 4,611 bytes, lines 33-37
33cl=Symbol.for("react.lazy"),G5=Symbol.for("react.offscreen"),dO=Symbol.iterator;function Fh(e){return e===null||typeof e!="object"?null:(e=dO&&e[dO]||e["@@iterator"],typeof e=="function"?e:null)}var hn=Object.assign,Sj;function wm(e){if(Sj===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Sj=t&&t[1]||""}return`
34`+Sj+e}var Nj=!1;function _j(e,t){if(!e||Nj)return"";Nj=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
35`),s=r.stack.split(`
36`),i=a.length-1,l=s.length-1;1<=i&&0<=l&&a[i]!==s[l];)l--;for(;1<=i&&0<=l;i--,l--)if(a[i]!==s[l]){if(i!==1||l!==1)do if(i--,l--,0>l||a[i]!==s[l]){var c=`
37`+a[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{Nj=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wm(e):""}function rQ(e){switch(e.tag){case 5:return wm(e.type);case 16:return wm("Lazy");case 13:return wm("Suspense");case 19:return wm("SuspenseList");case 0:case 2:case 15:return e=_j(e.type,!1),e;case 11:return e=_j(e.type.render,!1),e;case 1:return e=_j(e.type,!0),e;default:return""}}function HN(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case wd:return"Fragment";case bd:return"Portal";case VN:return"Profiler";case UE:return"StrictMode";case WN:return"Suspense";case qN:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H5:return(e.displayName||"Context")+".Consumer";case q5:return(e._context.displayName||"Context")+".Provider";case VE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case WE:return t=e.displayName||null,t!==null?t:HN(e.type)||"Memo";case cl:t=e._payload,e=e._init;try{return HN(e(t))}catch{}}return null}function aQ(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return HN(t);case 8:return t===UE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Wl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Y5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oQ(e){var t=Y5(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cv(e){e._valueTracker||(e._valueTracker=oQ(e))}function K5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y5(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jx(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function GN(e,t){var n=t.checked;return hn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wl(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}
vendor: 4,658 bytes, line 37
37function X5(e,t){t=t.checked,t!=null&&zE(e,"checked",t,!1)}function YN(e,t){X5(e,t);var n=Wl(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?KN(e,t.type,n):t.hasOwnProperty("defaultValue")&&KN(e,t.type,Wl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hO(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function KN(e,t,n){(t!=="number"||jx(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jm=Array.isArray;function Fd(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Wl(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function XN(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ge(91));return hn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mO(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ge(92));if(jm(n)){if(1<n.length)throw Error(ge(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Wl(n)}}function J5(e,t){var n=Wl(t.value),r=Wl(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pO(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Q5(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function JN(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Q5(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kv,Z5=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(kv=kv||document.createElement("div"),kv.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ap(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lm={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},sQ=["Webkit","ms","Moz","O"];Object.keys(Lm).forEach(function(e){sQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lm[t]=Lm[e]})});function eF(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Lm.hasOwnProperty(e)&&Lm[e]?(""+t).trim():t+"px"}function tF(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=eF(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var iQ=hn({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 QN(e,t){if(t){if(iQ[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ge(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ge(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ge(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ge(62))}}function ZN(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var e_=null;function qE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var t_=null,Bd=null,zd=null;function gO(e){if(e=Cg(e)){if(typeof t_!="function")throw Error(ge(280));var t=e.stateNode;t&&(t=L0(t),t_(e.stateNode,e.type,t))}}function nF(e){Bd?zd?zd.push(e):zd=[e]:Bd=e}function rF(){if(Bd){var e=Bd,t=zd;if(zd=Bd=null,gO(e),t)for(e=0;e<t.length;e++)gO(t[e])}}function aF(e,t){return e(t)}function oF(){}var Cj=!1;function sF(e,t,n){if(Cj)return e(t,n);Cj=!0;try{return aF(e,t,n)}finally{Cj=!1,(Bd!==null||zd!==null)&&(oF(),rF())}}function op(e,t){var n=e.stateNode;if(n===null)return null;var r=L0(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ge(231,t,typeof n));return n}var n_=!1;if(ki)try{var Bh={};Object.defineProperty(Bh,"passive",{get:function(){n_=!0}}),window.addEventListener("test",Bh,Bh),window.removeEventListener("test",Bh,Bh)}catch{n_=!1}function lQ(e,t,n,r,a,s,i,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Fm=!1,Sx=null,Nx=!1,r_=null,cQ={onError:function(e){Fm=!0,Sx=e}};function uQ(e,t,n,r,a,s,i,l,c){Fm=!1,Sx=null,lQ.apply(cQ,arguments)}function dQ(e,t,n,r,a,s,i,l,c){if(uQ.apply(this,arguments),Fm){if(Fm){var u=Sx;Fm=!1,Sx=null}else throw Error(ge(198));Nx||(Nx=!0,r_=u)}}function Tu(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function iF(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vO(e){if(Tu(e)!==e)throw Error(ge(188))}function fQ(e){var t=e.alternate;if(!t){if(t=Tu(e),t===null)throw Error(ge(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return vO(a),e;if(s===r)return vO(a),t;s=s.sibling}throw Error(ge(188))}if(n.return!==r.return)n=a,r=s;else{for(var i=!1,l=a.child;l;){if(l===n){i=!0,n=a,r=s;break}if(l===r){i=!0,r=a,n=s;break}l=l.sibling}if(!i){for(l=s.child;l;){if(l===n){i=!0,n=s,r=a;break}if(l===r){i=!0,r=s,n=a;break}l=l.sibling}if(!i)throw Error(ge(189))}}if(n.alternate!==r)throw Error(ge(190))}if(n.tag!==3)throw Error(ge(188));return n.stateNode.current===n?e:t}function lF(e){return e=fQ(e),e!==null?cF(e):null}function cF(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cF(e);if(t!==null)return t;e=e.sibling}return null}var uF=Pa.unstable_scheduleCallback,yO=Pa.unstable_cancelCallback,hQ=Pa.unstable_shouldYield,mQ=Pa.unstable_requestPaint,Nn=Pa.unstable_now,pQ=Pa.unstable_getCurrentPriorityLevel,HE=Pa.unstable_ImmediatePriority,dF=Pa.unstable_UserBlockingPriority,_x=Pa.unstable_NormalPriority,gQ=Pa.unstable_LowPriority,fF=Pa.unstable_IdlePriority,I0=null,js=null;
vendor: 4,736 bytes, line 37
37function vQ(e){if(js&&typeof js.onCommitFiberRoot=="function")try{js.onCommitFiberRoot(I0,e,void 0,(e.current.flags&128)===128)}catch{}}var Fo=Math.clz32?Math.clz32:bQ,yQ=Math.log,xQ=Math.LN2;function bQ(e){return e>>>=0,e===0?32:31-(yQ(e)/xQ|0)|0}var Ev=64,Av=4194304;function Sm(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cx(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~a;l!==0?r=Sm(l):(s&=i,s!==0&&(r=Sm(s)))}else i=n&~a,i!==0?r=Sm(i):s!==0&&(r=Sm(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,s=t&-t,a>=s||a===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fo(t),a=1<<n,r|=e[n],t&=~a;return r}function wQ(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jQ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Fo(s),l=1<<i,c=a[i];c===-1?(!(l&n)||l&r)&&(a[i]=wQ(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function a_(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hF(){var e=Ev;return Ev<<=1,!(Ev&4194240)&&(Ev=64),e}function kj(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ng(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fo(t),e[t]=n}function SQ(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Fo(n),s=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~s}}function GE(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fo(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var It=0;function mF(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var pF,YE,gF,vF,yF,o_=!1,Pv=[],Al=null,Pl=null,Tl=null,sp=new Map,ip=new Map,ml=[],NQ="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 xO(e,t){switch(e){case"focusin":case"focusout":Al=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":sp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ip.delete(t.pointerId)}}function zh(e,t,n,r,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},t!==null&&(t=Cg(t),t!==null&&YE(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function _Q(e,t,n,r,a){switch(t){case"focusin":return Al=zh(Al,e,t,n,r,a),!0;case"dragenter":return Pl=zh(Pl,e,t,n,r,a),!0;case"mouseover":return Tl=zh(Tl,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return sp.set(s,zh(sp.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,ip.set(s,zh(ip.get(s)||null,e,t,n,r,a)),!0}return!1}function xF(e){var t=Ic(e.target);if(t!==null){var n=Tu(t);if(n!==null){if(t=n.tag,t===13){if(t=iF(n),t!==null){e.blockedOn=t,yF(e.priority,function(){gF(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hy(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=s_(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);e_=r,n.target.dispatchEvent(r),e_=null}else return t=Cg(n),t!==null&&YE(t),e.blockedOn=n,!1;t.shift()}return!0}function bO(e,t,n){Hy(e)&&n.delete(t)}function CQ(){o_=!1,Al!==null&&Hy(Al)&&(Al=null),Pl!==null&&Hy(Pl)&&(Pl=null),Tl!==null&&Hy(Tl)&&(Tl=null),sp.forEac
vendor: 11,841 bytes, line 37
37h(bO),ip.forEach(bO)}function Uh(e,t){e.blockedOn===t&&(e.blockedOn=null,o_||(o_=!0,Pa.unstable_scheduleCallback(Pa.unstable_NormalPriority,CQ)))}function lp(e){function t(a){return Uh(a,e)}if(0<Pv.length){Uh(Pv[0],e);for(var n=1;n<Pv.length;n++){var r=Pv[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Al!==null&&Uh(Al,e),Pl!==null&&Uh(Pl,e),Tl!==null&&Uh(Tl,e),sp.forEach(t),ip.forEach(t),n=0;n<ml.length;n++)r=ml[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ml.length&&(n=ml[0],n.blockedOn===null);)xF(n),n.blockedOn===null&&ml.shift()}var Ud=Ui.ReactCurrentBatchConfig,kx=!0;function kQ(e,t,n,r){var a=It,s=Ud.transition;Ud.transition=null;try{It=1,KE(e,t,n,r)}finally{It=a,Ud.transition=s}}function EQ(e,t,n,r){var a=It,s=Ud.transition;Ud.transition=null;try{It=4,KE(e,t,n,r)}finally{It=a,Ud.transition=s}}function KE(e,t,n,r){if(kx){var a=s_(e,t,n,r);if(a===null)Rj(e,t,r,Ex,n),xO(e,r);else if(_Q(a,e,t,n,r))r.stopPropagation();else if(xO(e,r),t&4&&-1<NQ.indexOf(e)){for(;a!==null;){var s=Cg(a);if(s!==null&&pF(s),s=s_(e,t,n,r),s===null&&Rj(e,t,r,Ex,n),s===a)break;a=s}a!==null&&r.stopPropagation()}else Rj(e,t,r,null,n)}}var Ex=null;function s_(e,t,n,r){if(Ex=null,e=qE(r),e=Ic(e),e!==null)if(t=Tu(e),t===null)e=null;else if(n=t.tag,n===13){if(e=iF(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ex=e,null}function bF(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pQ()){case HE:return 1;case dF:return 4;case _x:case gQ:return 16;case fF:return 536870912;default:return 16}default:return 16}}var Nl=null,XE=null,Gy=null;function wF(){if(Gy)return Gy;var e,t=XE,n=t.length,r,a="value"in Nl?Nl.value:Nl.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===a[s-r];r++);return Gy=a.slice(e,1<r?1-r:void 0)}function Yy(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tv(){return!0}function wO(){return!1}function Ra(e){function t(n,r,a,s,i){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Tv:wO,this.isPropagationStopped=wO,this}return hn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tv)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tv)},persist:function(){},isPersistent:Tv}),t}var ih={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},JE=Ra(ih),_g=hn({},ih,{view:0,detail:0}),AQ=Ra(_g),Ej,Aj,Vh,$0=hn({},_g,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:QE,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Vh&&(Vh&&e.type==="mousemove"?(Ej=e.screenX-Vh.screenX,Aj=e.screenY-Vh.screenY):Aj=Ej=0,Vh=e),Ej)},movementY:function(e){return"movementY"in e?e.movementY:Aj}}),jO=Ra($0),PQ=hn({},$0,{dataTransfer:0}),TQ=Ra(PQ),OQ=hn({},_g,{relatedTarget:0}),Pj=Ra(OQ),MQ=hn({},ih,{animationName:0,elapsedTime:0,pseudoElement:0}),IQ=Ra(MQ),$Q=hn({},ih,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DQ=Ra($Q),RQ=hn({},ih,{data:0}),SO=Ra(RQ),LQ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FQ={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"},BQ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zQ(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BQ[e])?!!t[e]:!1}function QE(){return zQ}var UQ=hn({},_g,{key:function(e){if(e.key){var t=LQ[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yy(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?FQ[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:QE,charCode:function(e){return e.type==="keypress"?Yy(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yy(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VQ=Ra(UQ),WQ=hn({},$0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NO=Ra(WQ),qQ=hn({},_g,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:QE}),HQ=Ra(qQ),GQ=hn({},ih,{propertyName:0,elapsedTime:0,pseudoElement:0}),YQ=Ra(GQ),KQ=hn({},$0,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),XQ=Ra(KQ),JQ=[9,13,27,32],ZE=ki&&"CompositionEvent"in window,Bm=null;ki&&"documentMode"in document&&(Bm=document.documentMode);var QQ=ki&&"TextEvent"in window&&!Bm,jF=ki&&(!ZE||Bm&&8<Bm&&11>=Bm),_O=" ",CO=!1;function SF(e,t){switch(e){case"keyup":return JQ.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NF(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jd=!1;function ZQ(e,t){switch(e){case"compositionend":return NF(t);case"keypress":return t.which!==32?null:(CO=!0,_O);case"textInput":return e=t.data,e===_O&&CO?null:e;default:return null}}function eZ(e,t){if(jd)return e==="compositionend"||!ZE&&SF(e,t)?(e=wF(),Gy=XE=Nl=null,jd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jF&&t.locale!=="ko"?null:t.data;default:return null}}var tZ={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 kO(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tZ[e.type]:t==="textarea"}function _F(e,t,n,r){nF(r),t=Ax(t,"onChange"),0<t.length&&(n=new JE("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var zm=null,cp=null;function nZ(e){DF(e,0)}function D0(e){var t=_d(e);if(K5(t))return e}function rZ(e,t){if(e==="change")return t}var CF=!1;if(ki){var Tj;if(ki){var Oj="oninput"in document;if(!Oj){var EO=document.createElement("div");EO.setAttribute("oninput","return;"),Oj=typeof EO.oninput=="function"}Tj=Oj}else Tj=!1;CF=Tj&&(!document.documentMode||9<document.documentMode)}function AO(){zm&&(zm.detachEvent("onpropertychange",kF),cp=zm=null)}function kF(e){if(e.propertyName==="value"&&D0(cp)){var t=[];_F(t,cp,e,qE(e)),sF(nZ,t)}}function aZ(e,t,n){e==="focusin"?(AO(),zm=t,cp=n,zm.attachEvent("onpropertychange",kF)):e==="focusout"&&AO()}function oZ(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return D0(cp)}function sZ(e,t){if(e==="click")return D0(t)}function iZ(e,t){if(e==="input"||e==="change")return D0(t)}function lZ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vo=typeof Object.is=="function"?Object.is:lZ;function up(e,t){if(Vo(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!UN.call(t,a)||!Vo(e[a],t[a]))return!1}return!0}function PO(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function TO(e,t){var n=PO(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=PO(n)}}function EF(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?EF(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function AF(){for(var e=window,t=jx();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jx(e.document)}return t}function e2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cZ(e){var t=AF(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&EF(n.ownerDocument.documentElement,n)){if(r!==null&&e2(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,s=Math.min(r.start,a);r=r.end===void 0?s:Math.min(r.end,a),!e.extend&&s>r&&(a=r,r=s,s=a),a=TO(n,s);var i=TO(n,r);a&&i&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uZ=ki&&"documentMode"in document&&11>=document.documentMode,Sd=null,i_=null,Um=null,l_=!1;function OO(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;l_||Sd==null||Sd!==jx(r)||(r=Sd,"selectionStart"in r&&e2(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),Um&&up(Um,r)||(Um=r,r=Ax(i_,"onSelect"),0<r.length&&(t=new JE("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sd)))}function Ov(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Nd={animationend:Ov("Animation","AnimationEnd"),animationiteration:Ov("Animation","AnimationIteration"),animationstart:Ov("Animation","AnimationStart"),transitionend:Ov("Transition","TransitionEnd")},Mj={},PF={};ki&&(PF=document.createElement("div").style,"AnimationEvent"in window||(delete Nd.animationend.animation,delete Nd.animationiteration.animation,delete Nd.animationstart.animation),"TransitionEvent"in window||delete Nd.transitionend.transition);function R0(e){if(Mj[e])return Mj[e];if(!Nd[e])return e;var t=Nd[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in PF)return Mj[e]=t[n];return e}var TF=R0("animationend"),OF=R0("animationiteration"),MF=R0("animationstart"),IF=R0("transitionend"),$F=new Map,MO="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 ec(e,t){$F.set(e,t),Pu(t,[e])}for(var Ij=0;Ij<MO.length;Ij++){var $j=MO[Ij],dZ=$j.toLowerCase(),fZ=$j[0].toUpperCase()+$j.slice(1);ec(dZ,"on"+fZ)}ec(TF,"onAnimationEnd");ec(OF,"onAnimationIteration");ec(MF,"onAnimationStart");ec("dblclick","onDoubleClick");ec("focusin","onFocus");ec("focusout","onBlur");ec(IF,"onTransitionEnd");hf("onMouseEnter",["mouseout","mouseover"]);hf("onMouseLeave",["mouseout","mouseover"]);hf("onPointerEnter",["pointerout","pointerover"]);hf("onPointerLeave",["pointerout","pointerover"]);Pu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pu("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nm="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(" "),hZ=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nm));function IO(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dQ(r,t,void 0,e),e.currentTarget=null}function DF(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&a.isPropagationStopped())break e;IO(a,l,u),s=c}else for(i=0;i<r.length;i++){if(l=r[i],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&a.isPropagationStopped())break e;IO(a,l,u),s=c}}}if(Nx)throw e=r_,Nx=!1,r_=null,e}function Qt(e,t){var n=t[h_];n===void 0&&(n=t[h_]=new Set);var r=e+"__bubble";n.has(r)||(RF(t,e,2,!1),n.add(r))}function Dj(e,t,n){var r=0;t&&(r|=4),RF(n,e,r,t)}var Mv="_reactListening"+Math.random().toString(36).slice(2);function dp(e){if(!e[Mv]){e[Mv]=!0,W5.forEach(function(n){n!=="selectionchange"&&(hZ.has(n)||Dj(n,!1,e),Dj(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mv]||(t[Mv]=!0,Dj("selectionchange",!1,t))}}function RF(e,t,n,r){switch(bF(t)){case 1:var a=kQ;break;case 4:a=EQ;break;default:a=KE}n=a.bind(null,t,n,e),a=void 0,!n_||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Rj(e,t,n,r,a){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===a||l.nodeType===8&&l.parentNode===a)break;if(i===4)for(i=r.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;i=i.return}for(;l!==null;){if(i=Ic(l),i===null)return;if(c=i.tag,c===5||c===6){r=s=i;continue e}l=l.parentNode}}r=r.return}sF(function(){var u=s,d=qE(n),f=[];e:{var h=$F.get(e);if(h!==void 0){var m=JE,v=e;switch(e){case"keypress":if(Yy(n)===0)break e;case"keydown":case"keyup":m=VQ;break;case"focusin":v="focus",m=Pj;break;case"focusout":v="blur",m=Pj;break;case"beforeblur":case"afterblur":m=Pj;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=jO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=TQ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=HQ;break;case TF:case OF:case MF:m=IQ;break;case IF:m=YQ;break;case"scroll":m=AQ;break;case"wheel":m=XQ;break;case"copy":case"cut":case"paste":m=DQ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=NO}var g=(t&4)!==0,y=!g&&e==="scroll",x=g?h!==null?h+"Capture":null:h;g=[];for(var b=u,w;b!==null;){w=b;var N=w.stateNode;if(w.tag===5&&N!==null&&(w=N,x!==null&&(N=op(b,x),N!=null&&g.push(fp(b,N,w)))),y)break;b=b.return}0<g.length&&(h=new m(h,v,null,n,d),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==e_&&(v=n.relatedTarget||n.fromElement)&&(Ic(v)||v[Ei]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=u,v=v?Ic(v):null,v!==null&&(y=Tu(v),v!==y||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=jO,N="onMouseLeave",x="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(g=NO,N="onPointerLeave",x="onPointerEnter",b="pointer"),y=m==null?h:_d(m),w=v==null?h:_d(v),h=new g(N,b+"leave",m,n,d),h.target=y,h.relatedTarget=w,N=null,Ic(d)===u&&(g=new g(x,b+"enter",v,n,d),g.target=w,g.relatedTarget=y,N=g),y=N,m&&v)t:{for(g=m,x=v,b=0,w=g;w;w=nd(w))b++;for(w=0,N=x;N;N=nd(N))w++;for(;0<b-w;)g=nd(g),b--;for(;0<w-b;)x=nd(x),w--;for(;b--;){if(g===x||x!==null&&g===x.alternate)break t;g=nd(g),x=nd(x)}g=null}else g=null;m!==null&&$O(f,h,m,g,!1),v!==null&&y!==null&&$O(f,y,v,g,!0)}}
vendor: 4,215 bytes, lines 37-38
37e:{if(h=u?_d(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var S=rZ;else if(kO(h))if(CF)S=iZ;else{S=oZ;var _=aZ}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=sZ);if(S&&(S=S(e,u))){_F(f,S,n,d);break e}_&&_(e,h,u),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&KN(h,"number",h.value)}switch(_=u?_d(u):window,e){case"focusin":(kO(_)||_.contentEditable==="true")&&(Sd=_,i_=u,Um=null);break;case"focusout":Um=i_=Sd=null;break;case"mousedown":l_=!0;break;case"contextmenu":case"mouseup":case"dragend":l_=!1,OO(f,n,d);break;case"selectionchange":if(uZ)break;case"keydown":case"keyup":OO(f,n,d)}var k;if(ZE)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else jd?SF(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(jF&&n.locale!=="ko"&&(jd||P!=="onCompositionStart"?P==="onCompositionEnd"&&jd&&(k=wF()):(Nl=d,XE="value"in Nl?Nl.value:Nl.textContent,jd=!0)),_=Ax(u,P),0<_.length&&(P=new SO(P,e,null,n,d),f.push({event:P,listeners:_}),k?P.data=k:(k=NF(n),k!==null&&(P.data=k)))),(k=QQ?ZQ(e,n):eZ(e,n))&&(u=Ax(u,"onBeforeInput"),0<u.length&&(d=new SO("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=k))}DF(f,t)})}function fp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ax(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,s=a.stateNode;a.tag===5&&s!==null&&(a=s,s=op(e,n),s!=null&&r.unshift(fp(e,s,a)),s=op(e,t),s!=null&&r.push(fp(e,s,a))),e=e.return}return r}function nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $O(e,t,n,r,a){for(var s=t._reactName,i=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=op(n,s),c!=null&&i.unshift(fp(n,c,l))):a||(c=op(n,s),c!=null&&i.push(fp(n,c,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var mZ=/\r\n?/g,pZ=/\u0000|\uFFFD/g;function DO(e){return(typeof e=="string"?e:""+e).replace(mZ,`
38`).replace(pZ,"")}function Iv(e,t,n){if(t=DO(t),DO(e)!==t&&n)throw Error(ge(425))}function Px(){}var c_=null,u_=null;function d_(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var f_=typeof setTimeout=="function"?setTimeout:void 0,gZ=typeof clearTimeout=="function"?clearTimeout:void 0,RO=typeof Promise=="function"?Promise:void 0,vZ=typeof queueMicrotask=="function"?queueMicrotask:typeof RO<"u"?function(e){return RO.resolve(null).then(e).catch(yZ)}:f_;function yZ(e){setTimeout(function(){throw e})}function Lj(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),lp(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);lp(t)}function Ol(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function LO(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var lh=Math.random().toString(36).slice(2),vs="__reactFiber$"+lh,hp="__reactProps$"+lh,Ei="__reactContainer$"+lh,h_="__reactEvents$"+lh,xZ="__reactListeners$"+lh,bZ="__reactHandles$"+lh;function Ic(e){var t=e[vs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[vs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=LO(e);e!==null;){if(n=e[vs])return n;e=LO(e)}return t}e=n,n=e.parentNode}return null}function Cg(e){return e=e[vs]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function _d(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ge(33))}function L0(e){return e[hp]||null}var m_=[],Cd=-1;function tc(e){return{current:e}}function tn(e){0>Cd||(e.current=m_[Cd],m_[Cd]=null,Cd--)}function Gt(e,t){Cd++,m_[Cd]=e.current,e.current=t}var ql={}
vendor: 15,528 bytes, line 38
38,Pr=tc(ql),ra=tc(!1),au=ql;function mf(e,t){var n=e.type.contextTypes;if(!n)return ql;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},s;for(s in n)a[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function aa(e){return e=e.childContextTypes,e!=null}function Tx(){tn(ra),tn(Pr)}function FO(e,t,n){if(Pr.current!==ql)throw Error(ge(168));Gt(Pr,t),Gt(ra,n)}function LF(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(ge(108,aQ(e)||"Unknown",a));return hn({},n,r)}function Ox(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ql,au=Pr.current,Gt(Pr,e),Gt(ra,ra.current),!0}function BO(e,t,n){var r=e.stateNode;if(!r)throw Error(ge(169));n?(e=LF(e,t,au),r.__reactInternalMemoizedMergedChildContext=e,tn(ra),tn(Pr),Gt(Pr,e)):tn(ra),Gt(ra,n)}var si=null,F0=!1,Fj=!1;function FF(e){si===null?si=[e]:si.push(e)}function wZ(e){F0=!0,FF(e)}function nc(){if(!Fj&&si!==null){Fj=!0;var e=0,t=It;try{var n=si;for(It=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}si=null,F0=!1}catch(a){throw si!==null&&(si=si.slice(e+1)),uF(HE,nc),a}finally{It=t,Fj=!1}}return null}var kd=[],Ed=0,Mx=null,Ix=0,Ha=[],Ga=0,ou=null,ci=1,ui="";function _c(e,t){kd[Ed++]=Ix,kd[Ed++]=Mx,Mx=e,Ix=t}function BF(e,t,n){Ha[Ga++]=ci,Ha[Ga++]=ui,Ha[Ga++]=ou,ou=e;var r=ci;e=ui;var a=32-Fo(r)-1;r&=~(1<<a),n+=1;var s=32-Fo(t)+a;if(30<s){var i=a-a%5;s=(r&(1<<i)-1).toString(32),r>>=i,a-=i,ci=1<<32-Fo(t)+a|n<<a|r,ui=s+e}else ci=1<<s|n<<a|r,ui=e}function t2(e){e.return!==null&&(_c(e,1),BF(e,1,0))}function n2(e){for(;e===Mx;)Mx=kd[--Ed],kd[Ed]=null,Ix=kd[--Ed],kd[Ed]=null;for(;e===ou;)ou=Ha[--Ga],Ha[Ga]=null,ui=Ha[--Ga],Ha[Ga]=null,ci=Ha[--Ga],Ha[Ga]=null}var Ea=null,Ca=null,on=!1,Io=null;function zF(e,t){var n=Xa(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function zO(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ea=e,Ca=Ol(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ea=e,Ca=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ou!==null?{id:ci,overflow:ui}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xa(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Ca=null,!0):!1;default:return!1}}function p_(e){return(e.mode&1)!==0&&(e.flags&128)===0}function g_(e){if(on){var t=Ca;if(t){var n=t;if(!zO(e,t)){if(p_(e))throw Error(ge(418));t=Ol(n.nextSibling);var r=Ea;t&&zO(e,t)?zF(r,n):(e.flags=e.flags&-4097|2,on=!1,Ea=e)}}else{if(p_(e))throw Error(ge(418));e.flags=e.flags&-4097|2,on=!1,Ea=e}}}function UO(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function $v(e){if(e!==Ea)return!1;if(!on)return UO(e),on=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!d_(e.type,e.memoizedProps)),t&&(t=Ca)){if(p_(e))throw UF(),Error(ge(418));for(;t;)zF(e,t),t=Ol(t.nextSibling)}if(UO(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ge(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ca=Ol(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ca=null}}else Ca=Ea?Ol(e.stateNode.nextSibling):null;return!0}function UF(){for(var e=Ca;e;)e=Ol(e.nextSibling)}function pf(){Ca=Ea=null,on=!1}function r2(e){Io===null?Io=[e]:Io.push(e)}var jZ=Ui.ReactCurrentBatchConfig;function Wh(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ge(309));var r=n.stateNode}if(!r)throw Error(ge(147,e));var a=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var l=a.refs;i===null?delete l[s]:l[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(ge(284));if(!n._owner)throw Error(ge(290,e))}return e}function Dv(e,t){throw e=Object.prototype.toString.call(t),Error(ge(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function VO(e){var t=e._init;return t(e._payload)}function VF(e){function t(x,b){if(e){var w=x.deletions;w===null?(x.deletions=[b],x.flags|=16):w.push(b)}}function n(x,b){if(!e)return null;for(;b!==null;)t(x,b),b=b.sibling;return null}function r(x,b){for(x=new Map;b!==null;)b.key!==null?x.set(b.key,b):x.set(b.index,b),b=b.sibling;return x}function a(x,b){return x=Dl(x,b),x.index=0,x.sibling=null,x}function s(x,b,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<b?(x.flags|=2,b):w):(x.flags|=2,b)):(x.flags|=1048576,b)}function i(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,b,w,N){return b===null||b.tag!==6?(b=Hj(w,x.mode,N),b.return=x,b):(b=a(b,w),b.return=x,b)}function c(x,b,w,N){var S=w.type;return S===wd?d(x,b,w.props.children,N,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cl&&VO(S)===b.type)?(N=a(b,w.props),N.ref=Wh(x,b,w),N.return=x,N):(N=tx(w.type,w.key,w.props,null,x.mode,N),N.ref=Wh(x,b,w),N.return=x,N)}function u(x,b,w,N){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Gj(w,x.mode,N),b.return=x,b):(b=a(b,w.children||[]),b.return=x,b)}function d(x,b,w,N,S){return b===null||b.tag!==7?(b=Xc(w,x.mode,N,S),b.return=x,b):(b=a(b,w),b.return=x,b)}function f(x,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Hj(""+b,x.mode,w),b.return=x,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case _v:return w=tx(b.type,b.key,b.props,null,x.mode,w),w.ref=Wh(x,null,b),w.return=x,w;case bd:return b=Gj(b,x.mode,w),b.return=x,b;case cl:var N=b._init;return f(x,N(b._payload),w)}if(jm(b)||Fh(b))return b=Xc(b,x.mode,w,null),b.return=x,b;Dv(x,b)}return null}function h(x,b,w,N){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(x,b,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case _v:return w.key===S?c(x,b,w,N):null;case bd:return w.key===S?u(x,b,w,N):null;case cl:return S=w._init,h(x,b,S(w._payload),N)}if(jm(w)||Fh(w))return S!==null?null:d(x,b,w,N,null);Dv(x,w)}return null}function m(x,b,w,N,S){if(typeof N=="string"&&N!==""||typeof N=="number")return x=x.get(w)||null,l(b,x,""+N,S);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case _v:return x=x.get(N.key===null?w:N.key)||null,c(b,x,N,S);case bd:return x=x.get(N.key===null?w:N.key)||null,u(b,x,N,S);case cl:var _=N._init;return m(x,b,w,_(N._payload),S)}if(jm(N)||Fh(N))return x=x.get(w)||null,d(b,x,N,S,null);Dv(b,N)}return null}function v(x,b,w,N){for(var S=null,_=null,k=b,P=b=0,O=null;k!==null&&P<w.length;P++){k.index>P?(O=k,k=null):O=k.sibling;var $=h(x,k,w[P],N);if($===null){k===null&&(k=O);break}e&&k&&$.alternate===null&&t(x,k),b=s($,b,P),_===null?S=$:_.sibling=$,_=$,k=O}if(P===w.length)return n(x,k),on&&_c(x,P),S;if(k===null){for(;P<w.length;P++)k=f(x,w[P],N),k!==null&&(b=s(k,b,P),_===null?S=k:_.sibling=k,_=k);return on&&_c(x,P),S}for(k=r(x,k);P<w.length;P++)O=m(k,x,P,w[P],N),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?P:O.key),b=s(O,b,P),_===null?S=O:_.sibling=O,_=O);return e&&k.forEach(function(T){return t(x,T)}),on&&_c(x,P),S}function g(x,b,w,N){var S=Fh(w);if(typeof S!="function")throw Error(ge(150));if(w=S.call(w),w==null)throw Error(ge(151));for(var _=S=null,k=b,P=b=0,O=null,$=w.next();k!==null&&!$.done;P++,$=w.next()){k.index>P?(O=k,k=null):O=k.sibling;var T=h(x,k,$.value,N);if(T===null){k===null&&(k=O);break}e&&k&&T.alternate===null&&t(x,k),b=s(T,b,P),_===null?S=T:_.sibling=T,_=T,k=O}if($.done)return n(x,k),on&&_c(x,P),S;if(k===null){for(;!$.done;P++,$=w.next())$=f(x,$.value,N),$!==null&&(b=s($,b,P),_===null?S=$:_.sibling=$,_=$);return on&&_c(x,P),S}for(k=r(x,k);!$.done;P++,$=w.next())$=m(k,x,P,$.value,N),$!==null&&(e&&$.alternate!==null&&k.delete($.key===null?P:$.key),b=s($,b,P),_===null?S=$:_.sibling=$,_=$);return e&&k.forEach(function(z){return t(x,z)}),on&&_c(x,P),S}function y(x,b,w,N){if(typeof w=="object"&&w!==null&&w.type===wd&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case _v:e:{for(var S=w.key,_=b;_!==null;){if(_.key===S){if(S=w.type,S===wd){if(_.tag===7){n(x,_.sibling),b=a(_,w.props.children),b.return=x,x=b;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cl&&VO(S)===_.type){n(x,_.sibling),b=a(_,w.props),b.ref=Wh(x,_,w),b.return=x,x=b;break e}n(x,_);break}else t(x,_);_=_.sibling}w.type===wd?(b=Xc(w.props.children,x.mode,N,w.key),b.return=x,x=b):(N=tx(w.type,w.key,w.props,null,x.mode,N),N.ref=Wh(x,b,w),N.return=x,x=N)}return i(x);case bd:e:{for(_=w.key;b!==null;){if(b.key===_)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(x,b.sibling),b=a(b,w.children||[]),b.return=x,x=b;break e}else{n(x,b);break}else t(x,b);b=b.sibling}b=Gj(w,x.mode,N),b.return=x,x=b}return i(x);case cl:return _=w._init,y(x,b,_(w._payload),N)}if(jm(w))return v(x,b,w,N);if(Fh(w))return g(x,b,w,N);Dv(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(x,b.sibling),b=a(b,w),b.return=x,x=b):(n(x,b),b=Hj(w,x.mode,N),b.return=x,x=b),i(x)):n(x,b)}return y}var gf=VF(!0),WF=VF(!1),$x=tc(null),Dx=null,Ad=null,a2=null;function o2(){a2=Ad=Dx=null}function s2(e){var t=$x.current;tn($x),e._currentValue=t}function v_(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vd(e,t){Dx=e,a2=Ad=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ea=!0),e.firstContext=null)}function so(e){var t=e._currentValue;if(a2!==e)if(e={context:e,memoizedValue:t,next:null},Ad===null){if(Dx===null)throw Error(ge(308));Ad=e,Dx.dependencies={lanes:0,firstContext:e}}else Ad=Ad.next=e;return t}var $c=null;function i2(e){$c===null?$c=[e]:$c.push(e)}function qF(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,i2(t)):(n.next=a.next,a.next=n),t.interleaved=n,Ai(e,r)}function Ai(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ul=!1;function l2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HF(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function vi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ml(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nt&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Ai(e,n)}return a=r.interleaved,a===null?(t.next=t,i2(r)):(t.next=a.next,a.next=t),r.interleaved=t,Ai(e,n)}function Ky(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,GE(e,n)}}function WO(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?a=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Rx(e,t,n,r){var a=e.updateQueue;ul=!1;var s=a.firstBaseUpdate,i=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?s=u:i.next=u,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==i&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=a.baseState;i=0,d=u=c=null,l=s;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){f=v.call(m,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,f,h):v,h==null)break e;f=hn({},f,h);break e;case 2:ul=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,i|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do i|=a.lane,a=a.next;while(a!==t)}else s===null&&(a.shared.lanes=0);iu|=i,e.lanes=i,e.memoizedState=f}}function qO(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(ge(191,a));a.call(r)}}}var kg={},Ss=tc(kg),mp=tc(kg),pp=tc(kg);function Dc(e){if(e===kg)throw Error(ge(174));return e}function c2(e,t){switch(Gt(pp,t),Gt(mp,e),Gt(Ss,kg),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:JN(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=JN(t,e)}tn(Ss),Gt(Ss,t)}function vf(){tn(Ss),tn(mp),tn(pp)}function GF(e){Dc(pp.current);var t=Dc(Ss.current),n=JN(t,e.type);t!==n&&(Gt(mp,e),Gt(Ss,n))}function u2(e){mp.current===e&&(tn(Ss),tn(mp))}var un=tc(0);function Lx(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Bj=[];function d2(){for(var e=0;e<Bj.length;e++)Bj[e]._workInProgressVersionPrimary=null;Bj.length=0}var Xy=Ui.ReactCurrentDispatcher,zj=Ui.ReactCurrentBatchConfig,su=0,dn=null,Ln=null,Kn=null,Fx=!1,Vm=!1,gp=0,SZ=0;function br(){throw Error(ge(321))}function f2(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vo(e[n],t[n]))return!1;return!0}function h2(e,t,n,r,a,s){if(su=s,dn=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xy.current=e===null||e.memoizedState===null?kZ:EZ,e=n(r,a),Vm){s=0;do{if(Vm=!1,gp=0,25<=s)throw Error(ge(301));s+=1,Kn=Ln=null,t.updateQueue=null,Xy.current=AZ,e=n(r,a)}while(Vm)}if(Xy.current=Bx,t=Ln!==null&&Ln.next!==null,su=0,Kn=Ln=dn=null,Fx=!1,t)throw Error(ge(300));return e}function m2(){var e=gp!==0;return gp=0,e}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?dn.memoizedState=Kn=e:Kn=Kn.next=e,Kn}function io(){if(Ln===null){var e=dn.alternate;e=e!==null?e.memoizedState:null}else e=Ln.next;var t=Kn===null?dn.memoizedState:Kn.next;
vendor: 4,351 bytes, line 38
38if(t!==null)Kn=t,Ln=e;else{if(e===null)throw Error(ge(310));Ln=e,e={memoizedState:Ln.memoizedState,baseState:Ln.baseState,baseQueue:Ln.baseQueue,queue:Ln.queue,next:null},Kn===null?dn.memoizedState=Kn=e:Kn=Kn.next=e}return Kn}function vp(e,t){return typeof t=="function"?t(e):t}function Uj(e){var t=io(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=Ln,a=r.baseQueue,s=n.pending;if(s!==null){if(a!==null){var i=a.next;a.next=s.next,s.next=i}r.baseQueue=a=s,n.pending=null}if(a!==null){s=a.next,r=r.baseState;var l=i=null,c=null,u=s;do{var d=u.lane;if((su&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,i=r):c=c.next=f,dn.lanes|=d,iu|=d}u=u.next}while(u!==null&&u!==s);c===null?i=r:c.next=l,Vo(r,t.memoizedState)||(ea=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do s=a.lane,dn.lanes|=s,iu|=s,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vj(e){var t=io(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var i=a=a.next;do s=e(s,i.action),i=i.next;while(i!==a);Vo(s,t.memoizedState)||(ea=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function YF(){}function KF(e,t){var n=dn,r=io(),a=t(),s=!Vo(r.memoizedState,a);if(s&&(r.memoizedState=a,ea=!0),r=r.queue,p2(QF.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Kn!==null&&Kn.memoizedState.tag&1){if(n.flags|=2048,yp(9,JF.bind(null,n,r,a,t),void 0,null),Qn===null)throw Error(ge(349));su&30||XF(n,t,a)}return a}function XF(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=dn.updateQueue,t===null?(t={lastEffect:null,stores:null},dn.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function JF(e,t,n,r){t.value=n,t.getSnapshot=r,ZF(t)&&e6(e)}function QF(e,t,n){return n(function(){ZF(t)&&e6(e)})}function ZF(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vo(e,n)}catch{return!0}}function e6(e){var t=Ai(e,1);t!==null&&Bo(t,e,1,-1)}function HO(e){var t=us();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vp,lastRenderedState:e},t.queue=e,e=e.dispatch=CZ.bind(null,dn,e),[t.memoizedState,e]}function yp(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=dn.updateQueue,t===null?(t={lastEffect:null,stores:null},dn.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function t6(){return io().memoizedState}function Jy(e,t,n,r){var a=us();dn.flags|=e,a.memoizedState=yp(1|t,n,void 0,r===void 0?null:r)}function B0(e,t,n,r){var a=io();r=r===void 0?null:r;var s=void 0;if(Ln!==null){var i=Ln.memoizedState;if(s=i.destroy,r!==null&&f2(r,i.deps)){a.memoizedState=yp(t,n,s,r);return}}dn.flags|=e,a.memoizedState=yp(1|t,n,s,r)}function GO(e,t){return Jy(8390656,8,e,t)}function p2(e,t){return B0(2048,8,e,t)}function n6(e,t){return B0(4,2,e,t)}function r6(e,t){return B0(4,4,e,t)}function a6(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function o6(e,t,n){return n=n!=null?n.concat([e]):null,B0(4,4,a6.bind(null,t,e),n)}function g2(){}function s6(e,t){var n=io();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&f2(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function i6(e,t){var n=io();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&f2(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function l6(e,t,n){return su&21?(Vo(n,t)||(n=hF(),dn.lanes|=n,iu|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ea=!0),e.memoizedState=n)}function NZ(e,t){var n=It;It=n!==0&&4>n?n:4,e(!0);var r=zj.transition;zj.transition={};try{e(!1),t()}finally{It=n,zj.transition=r}}function c6(){return io().memoizedState}function _Z(e,t,n){var r=$l(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},u6(e))d6(t,n);else if(n=qF(e,t,n,r),n!==null){var a=Wr();Bo(n,e,r,a),f6(n,t,r)}}
vendor: 6,421 bytes, lines 38-40
38function CZ(e,t,n){var r=$l(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(u6(e))d6(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(a.hasEagerState=!0,a.eagerState=l,Vo(l,i)){var c=t.interleaved;c===null?(a.next=a,i2(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=qF(e,t,a,r),n!==null&&(a=Wr(),Bo(n,e,r,a),f6(n,t,r))}}function u6(e){var t=e.alternate;return e===dn||t!==null&&t===dn}function d6(e,t){Vm=Fx=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function f6(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,GE(e,n)}}var Bx={readContext:so,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},kZ={readContext:so,useCallback:function(e,t){return us().memoizedState=[e,t===void 0?null:t],e},useContext:so,useEffect:GO,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Jy(4194308,4,a6.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Jy(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jy(4,2,e,t)},useMemo:function(e,t){var n=us();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=us();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_Z.bind(null,dn,e),[r.memoizedState,e]},useRef:function(e){var t=us();return e={current:e},t.memoizedState=e},useState:HO,useDebugValue:g2,useDeferredValue:function(e){return us().memoizedState=e},useTransition:function(){var e=HO(!1),t=e[0];return e=NZ.bind(null,e[1]),us().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=dn,a=us();if(on){if(n===void 0)throw Error(ge(407));n=n()}else{if(n=t(),Qn===null)throw Error(ge(349));su&30||XF(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,GO(QF.bind(null,r,s,e),[e]),r.flags|=2048,yp(9,JF.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=us(),t=Qn.identifierPrefix;if(on){var n=ui,r=ci;n=(r&~(1<<32-Fo(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gp++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=SZ++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},EZ={readContext:so,useCallback:s6,useContext:so,useEffect:p2,useImperativeHandle:o6,useInsertionEffect:n6,useLayoutEffect:r6,useMemo:i6,useReducer:Uj,useRef:t6,useState:function(){return Uj(vp)},useDebugValue:g2,useDeferredValue:function(e){var t=io();return l6(t,Ln.memoizedState,e)},useTransition:function(){var e=Uj(vp)[0],t=io().memoizedState;return[e,t]},useMutableSource:YF,useSyncExternalStore:KF,useId:c6,unstable_isNewReconciler:!1},AZ={readContext:so,useCallback:s6,useContext:so,useEffect:p2,useImperativeHandle:o6,useInsertionEffect:n6,useLayoutEffect:r6,useMemo:i6,useReducer:Vj,useRef:t6,useState:function(){return Vj(vp)},useDebugValue:g2,useDeferredValue:function(e){var t=io();return Ln===null?t.memoizedState=e:l6(t,Ln.memoizedState,e)},useTransition:function(){var e=Vj(vp)[0],t=io().memoizedState;return[e,t]},useMutableSource:YF,useSyncExternalStore:KF,useId:c6,unstable_isNewReconciler:!1};function _o(e,t){if(e&&e.defaultProps){t=hn({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function y_(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:hn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var z0={isMounted:function(e){return(e=e._reactInternals)?Tu(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Wr(),a=$l(e),s=vi(r,a);s.payload=t,n!=null&&(s.callback=n),t=Ml(e,s,a),t!==null&&(Bo(t,e,a,r),Ky(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Wr(),a=$l(e),s=vi(r,a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ml(e,s,a),t!==null&&(Bo(t,e,a,r),Ky(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wr(),r=$l(e),a=vi(n,r);a.tag=2,t!=null&&(a.callback=t),t=Ml(e,a,r),t!==null&&(Bo(t,e,r,n),Ky(t,e,r))}};function YO(e,t,n,r,a,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!up(n,r)||!up(a,s):!0}function h6(e,t,n){var r=!1,a=ql,s=t.contextType;return typeof s=="object"&&s!==null?s=so(s):(a=aa(t)?au:Pr.current,r=t.contextTypes,s=(r=r!=null)?mf(e,a):ql),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=z0,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function KO(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&z0.enqueueReplaceState(t,t.state,null)}function x_(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},l2(e);var s=t.contextType;typeof s=="object"&&s!==null?a.context=so(s):(s=aa(t)?au:Pr.current,a.context=mf(e,s)),a.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(y_(e,t,s,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&z0.enqueueReplaceState(a,a.state,null),Rx(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function yf(e,t){try{var n="",r=t;do n+=rQ(r),r=r.return;while(r);var a=n}catch(s){a=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:e,source:t,stack:a,digest:null}}function Wj(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function b_(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var PZ=typeof WeakMap=="function"?WeakMap:Map;function m6(e,t,n){n=vi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;
vendor: 10,904 bytes, line 40
40return n.callback=function(){Ux||(Ux=!0,P_=r),b_(e,t)},n}function p6(e,t,n){n=vi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){b_(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){b_(e,t),typeof r!="function"&&(Il===null?Il=new Set([this]):Il.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function XO(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new PZ;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=WZ.bind(null,e,t,n),t.then(e,e))}function JO(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function QO(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=vi(-1,1),t.tag=2,Ml(n,t,1))),n.lanes|=1),e)}var TZ=Ui.ReactCurrentOwner,ea=!1;function Lr(e,t,n,r){t.child=e===null?WF(t,null,n,r):gf(t,e.child,n,r)}function ZO(e,t,n,r,a){n=n.render;var s=t.ref;return Vd(t,a),r=h2(e,t,n,r,s,a),n=m2(),e!==null&&!ea?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pi(e,t,a)):(on&&n&&t2(t),t.flags|=1,Lr(e,t,r,a),t.child)}function eM(e,t,n,r,a){if(e===null){var s=n.type;return typeof s=="function"&&!N2(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,g6(e,t,s,r,a)):(e=tx(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&a)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:up,n(i,r)&&e.ref===t.ref)return Pi(e,t,a)}return t.flags|=1,e=Dl(s,r),e.ref=t.ref,e.return=t,t.child=e}function g6(e,t,n,r,a){if(e!==null){var s=e.memoizedProps;if(up(s,r)&&e.ref===t.ref)if(ea=!1,t.pendingProps=r=s,(e.lanes&a)!==0)e.flags&131072&&(ea=!0);else return t.lanes=e.lanes,Pi(e,t,a)}return w_(e,t,n,r,a)}function v6(e,t,n){var r=t.pendingProps,a=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gt(Td,ja),ja|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Gt(Td,ja),ja|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Gt(Td,ja),ja|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Gt(Td,ja),ja|=r;return Lr(e,t,a,n),t.child}function y6(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function w_(e,t,n,r,a){var s=aa(n)?au:Pr.current;return s=mf(t,s),Vd(t,a),n=h2(e,t,n,r,s,a),r=m2(),e!==null&&!ea?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pi(e,t,a)):(on&&r&&t2(t),t.flags|=1,Lr(e,t,n,a),t.child)}function tM(e,t,n,r,a){if(aa(n)){var s=!0;Ox(t)}else s=!1;if(Vd(t,a),t.stateNode===null)Qy(e,t),h6(t,n,r),x_(t,n,r,a),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=so(u):(u=aa(n)?au:Pr.current,u=mf(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||c!==u)&&KO(t,i,r,u),ul=!1;var h=t.memoizedState;i.state=h,Rx(t,r,i,a),c=t.memoizedState,l!==r||h!==c||ra.current||ul?(typeof d=="function"&&(y_(t,n,d,r),c=t.memoizedState),(l=ul||YO(t,n,l,r,h,c,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=u,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,HF(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:_o(t.type,l),i.props=u,f=t.pendingProps,h=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=so(c):(c=aa(n)?au:Pr.current,c=mf(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||h!==c)&&KO(t,i,r,c),ul=!1,h=t.memoizedState,i.state=h,Rx(t,r,i,a);var v=t.memoizedState;l!==f||h!==v||ra.current||ul?(typeof m=="function"&&(y_(t,n,m,r),v=t.memoizedState),(u=ul||YO(t,n,u,r,h,v,c)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,v,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,v,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),i.props=r,i.state=v,i.context=c,r=u):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return j_(e,t,n,r,s,a)}function j_(e,t,n,r,a,s){y6(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return a&&BO(t,n,!1),Pi(e,t,s);r=t.stateNode,TZ.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=gf(t,e.child,null,s),t.child=gf(t,null,l,s)):Lr(e,t,l,s),t.memoizedState=r.state,a&&BO(t,n,!0),t.child}function x6(e){var t=e.stateNode;t.pendingContext?FO(e,t.pendingContext,t.pendingContext!==t.context):t.context&&FO(e,t.context,!1),c2(e,t.containerInfo)}function nM(e,t,n,r,a){return pf(),r2(a),t.flags|=256,Lr(e,t,n,r),t.child}var S_={dehydrated:null,treeContext:null,retryLane:0};function N_(e){return{baseLanes:e,cachePool:null,transitions:null}}function b6(e,t,n){var r=t.pendingProps,a=un.current,s=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Gt(un,a&1),e===null)return g_(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=W0(i,r,0,null),e=Xc(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=N_(n),t.memoizedState=S_,e):v2(t,i));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return OZ(e,t,i,r,l,a,n);if(s){s=r.fallback,i=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(i&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Dl(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?s=Dl(l,s):(s=Xc(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?N_(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=S_,r}return s=e.child,e=s.sibling,r=Dl(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function v2(e,t){return t=W0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rv(e,t,n,r){return r!==null&&r2(r),gf(t,e.child,null,n),e=v2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function OZ(e,t,n,r,a,s,i){if(n)return t.flags&256?(t.flags&=-257,r=Wj(Error(ge(422))),Rv(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,a=t.mode,r=W0({mode:"visible",children:r.children},a,0,null),s=Xc(s,a,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&gf(t,e.child,null,i),t.child.memoizedState=N_(i),t.memoizedState=S_,s);if(!(t.mode&1))return Rv(e,t,i,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(ge(419)),r=Wj(s,r,void 0),Rv(e,t,i,r)}if(l=(i&e.childLanes)!==0,ea||l){if(r=Qn,r!==null){switch(i&-i){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|i)?0:a,a!==0&&a!==s.retryLane&&(s.retryLane=a,Ai(e,a),Bo(r,e,a,-1))}return S2(),r=Wj(Error(ge(421))),Rv(e,t,i,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=qZ.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,Ca=Ol(a.nextSibling),Ea=t,on=!0,Io=null,e!==null&&(Ha[Ga++]=ci,Ha[Ga++]=ui,Ha[Ga++]=ou,ci=e.id,ui=e.overflow,ou=t),t=v2(t,r.children),t.flags|=4096,t)}function rM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),v_(e.return,t,n)}function qj(e,t,n,r,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function w6(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(Lr(e,t,r.children,n),r=un.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rM(e,n,t);else if(e.tag===19)rM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Gt(un,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Lx(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),qj(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Lx(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}qj(t,!0,n,null,s);break;case"together":qj(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qy(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),iu|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ge(153));
vendor: 5,452 bytes, line 40
40if(t.child!==null){for(e=t.child,n=Dl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function MZ(e,t,n){switch(t.tag){case 3:x6(t),pf();break;case 5:GF(t);break;case 1:aa(t.type)&&Ox(t);break;case 4:c2(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Gt($x,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Gt(un,un.current&1),t.flags|=128,null):n&t.child.childLanes?b6(e,t,n):(Gt(un,un.current&1),e=Pi(e,t,n),e!==null?e.sibling:null);Gt(un,un.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return w6(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Gt(un,un.current),r)break;return null;case 22:case 23:return t.lanes=0,v6(e,t,n)}return Pi(e,t,n)}var j6,__,S6,N6;j6=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};__=function(){};S6=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Dc(Ss.current);var s=null;switch(n){case"input":a=GN(e,a),r=GN(e,r),s=[];break;case"select":a=hn({},a,{value:void 0}),r=hn({},r,{value:void 0}),s=[];break;case"textarea":a=XN(e,a),r=XN(e,r),s=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Px)}QN(n,r);var i;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(rp.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(rp.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Qt("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};N6=function(e,t,n,r){n!==r&&(t.flags|=4)};function qh(e,t){if(!on)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function wr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function IZ(e,t,n){var r=t.pendingProps;switch(n2(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wr(t),null;case 1:return aa(t.type)&&Tx(),wr(t),null;case 3:return r=t.stateNode,vf(),tn(ra),tn(Pr),d2(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&($v(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Io!==null&&(M_(Io),Io=null))),__(e,t),wr(t),null;case 5:u2(t);var a=Dc(pp.current);if(n=t.type,e!==null&&t.stateNode!=null)S6(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ge(166));return wr(t),null}if(e=Dc(Ss.current),$v(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[vs]=t,r[hp]=s,e=(t.mode&1)!==0,n){case"dialog":Qt("cancel",r),Qt("close",r);break;case"iframe":case"object":case"embed":Qt("load",r);break;case"video":case"audio":for(a=0;a<Nm.length;a++)Qt(Nm[a],r);break;case"source":Qt("error",r);break;case"img":case"image":case"link":Qt("error",r),Qt("load",r);break;case"details":Qt("toggle",r);break;case"input":fO(r,s),Qt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Qt("invalid",r);break;case"textarea":mO(r,s),Qt("invalid",r)}QN(n,s),a=null;for(var i in s)if(s.hasOwnProperty(i)){var l=s[i];i==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Iv(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Iv(r.textContent,l,e),a=["children",""+l]):rp.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Qt("scroll",r)}switch(n){case"input":Cv(r),hO(r,s,!0);break;case"textarea":Cv(r),pO(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Px)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Q5(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[vs]=t,e[hp]=r,j6(e,t,!1,!1),t.stateNode=e;e:{switch(i=ZN(n,r),n){case"dialog":Qt("cancel",e),Qt("close",e),a=r;break;case"iframe":case"object":case"embed":Qt("load",e),a=r;break;case"video":case"audio":for(a=0;a<Nm.length;a++)Qt(Nm[a],e);a=r;break;case"source":Qt("error",e),a=r;break;case"img":case"image":case"link":Qt("error",e),Qt("load",e),a=r;break;case"details":Qt("toggle",e),a=r;break;case"input":fO(e,r),a=GN(e,r),Qt("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=hn({},r,{value:void 0}),Qt("invalid",e);break;case"textarea":mO(e,r),a=XN(e,r),Qt("invalid",e);break;default:a=r}QN(n,a),l=a;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?tF(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Z5(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ap(e,c):typeof c=="number"&&ap(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(rp.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Qt("scroll",e):c!=null&&zE(e,s,c,i))}switch(n){case"input":Cv(e),hO(e,r,!1);break;case"textarea":Cv(e),pO(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Wl(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Fd(e,!!r.multiple,s,!1):r.defaultValue!=null&&Fd(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Px)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return wr(t),null;case 6:if(e&&t.stateNode!=null)N6(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ge(166));if(n=Dc(pp.current),Dc(Ss.current),$v(t)){if(r=t.stateNode,n=t.memoizedProps,r[vs]=t,(s=r.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:Iv(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Iv(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vs]=t,t.stateNode=r}return wr(t),null;case 13:if(tn(un),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(on&&Ca!==null&&t.mode&1&&!(t.flags&128))UF(),pf(),t.flags|=98560,s=!1;else if(s=$v(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(ge(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ge(317));s[vs]=t}else pf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wr(t),s=!1}else Io!==null&&(M_(Io),Io=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||un.current&1?Fn===0&&(Fn=3):S2())),t.updateQueue!==null&&(t.flags|=4),wr(t),null);case 4:return vf(),__(e,t),e===null&&dp(t.stateNode.containerInfo),wr(t),null;case 10:return s2(t.type._context),wr(t),null;case 17:return aa(t.type)&&Tx(),wr(t),null;case 19:if(tn(un),s=t.memoizedState,s===null)return wr(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)qh(s,!1);else{if(Fn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Lx(e),i!==null){for(t.flags|=128,qh(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Gt(un,un.current&1|2),t.child}e=e.sibling}s.tail!==null&&Nn()>xf&&(t.flags|=128,r=!0,qh(s,!1),t.lanes=4194304)}else{if(!r)if(e=Lx(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!on)return wr(t),null}else 2*Nn()-s.renderingStartTime>xf&&n!==1073741824&&(t.flags|=128,r=!0,qh(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Nn(),t.sibling=null,n=un.current,Gt(un,r?n&1|2:n&1),t):(wr(t),null);case 22:case 23:return j2(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ja&1073741824&&(wr(t),t.subtreeFlags&6&&(t.flags|=8192)):wr(t),null;case 24:return null;case 25:return null}throw Error(ge(156,t.tag))}function $Z(e,t){switch(n2(t),t.tag){case 1:return aa(t.type)&&Tx(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 23,232 bytes, line 40
40case 3:return vf(),tn(ra),tn(Pr),d2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return u2(t),null;case 13:if(tn(un),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ge(340));pf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tn(un),null;case 4:return vf(),null;case 10:return s2(t.type._context),null;case 22:case 23:return j2(),null;case 24:return null;default:return null}}var Lv=!1,_r=!1,DZ=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Pd(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){gn(e,t,r)}else n.current=null}function C_(e,t,n){try{n()}catch(r){gn(e,t,r)}}var aM=!1;function RZ(e,t){if(c_=kx,e=AF(),e2(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(l=i+a),f!==s||r!==0&&f.nodeType!==3||(c=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=i),h===s&&++d===r&&(c=i),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(u_={focusedElem:e,selectionRange:n},kx=!1,Oe=t;Oe!==null;)if(t=Oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Oe=e;else for(;Oe!==null;){t=Oe;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,y=v.memoizedState,x=t.stateNode,b=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:_o(t.type,g),y);x.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ge(163))}}catch(N){gn(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,Oe=e;break}Oe=t.return}return v=aM,aM=!1,v}function Wm(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,s!==void 0&&C_(t,n,s)}a=a.next}while(a!==r)}}function U0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function k_(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _6(e){var t=e.alternate;t!==null&&(e.alternate=null,_6(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vs],delete t[hp],delete t[h_],delete t[xZ],delete t[bZ])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function C6(e){return e.tag===5||e.tag===3||e.tag===4}function oM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||C6(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function E_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Px));else if(r!==4&&(e=e.child,e!==null))for(E_(e,t,n),e=e.sibling;e!==null;)E_(e,t,n),e=e.sibling}function A_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(A_(e,t,n),e=e.sibling;e!==null;)A_(e,t,n),e=e.sibling}var cr=null,Po=!1;function Qi(e,t,n){for(n=n.child;n!==null;)k6(e,t,n),n=n.sibling}function k6(e,t,n){if(js&&typeof js.onCommitFiberUnmount=="function")try{js.onCommitFiberUnmount(I0,n)}catch{}switch(n.tag){case 5:_r||Pd(n,t);case 6:var r=cr,a=Po;cr=null,Qi(e,t,n),cr=r,Po=a,cr!==null&&(Po?(e=cr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cr.removeChild(n.stateNode));break;case 18:cr!==null&&(Po?(e=cr,n=n.stateNode,e.nodeType===8?Lj(e.parentNode,n):e.nodeType===1&&Lj(e,n),lp(e)):Lj(cr,n.stateNode));break;case 4:r=cr,a=Po,cr=n.stateNode.containerInfo,Po=!0,Qi(e,t,n),cr=r,Po=a;break;case 0:case 11:case 14:case 15:if(!_r&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var s=a,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&C_(n,t,i),a=a.next}while(a!==r)}Qi(e,t,n);break;case 1:if(!_r&&(Pd(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){gn(n,t,l)}Qi(e,t,n);break;case 21:Qi(e,t,n);break;case 22:n.mode&1?(_r=(r=_r)||n.memoizedState!==null,Qi(e,t,n),_r=r):Qi(e,t,n);break;default:Qi(e,t,n)}}function sM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new DZ),t.forEach(function(r){var a=HZ.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function xo(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var s=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:cr=l.stateNode,Po=!1;break e;case 3:cr=l.stateNode.containerInfo,Po=!0;break e;case 4:cr=l.stateNode.containerInfo,Po=!0;break e}l=l.return}if(cr===null)throw Error(ge(160));k6(s,i,a),cr=null,Po=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){gn(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)E6(t,e),t=t.sibling}function E6(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xo(t,e),cs(e),r&4){try{Wm(3,e,e.return),U0(3,e)}catch(g){gn(e,e.return,g)}try{Wm(5,e,e.return)}catch(g){gn(e,e.return,g)}}break;case 1:xo(t,e),cs(e),r&512&&n!==null&&Pd(n,n.return);break;case 5:if(xo(t,e),cs(e),r&512&&n!==null&&Pd(n,n.return),e.flags&32){var a=e.stateNode;try{ap(a,"")}catch(g){gn(e,e.return,g)}}if(r&4&&(a=e.stateNode,a!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&X5(a,s),ZN(l,i);var u=ZN(l,s);for(i=0;i<c.length;i+=2){var d=c[i],f=c[i+1];d==="style"?tF(a,f):d==="dangerouslySetInnerHTML"?Z5(a,f):d==="children"?ap(a,f):zE(a,d,f,u)}switch(l){case"input":YN(a,s);break;case"textarea":J5(a,s);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?Fd(a,!!s.multiple,m,!1):h!==!!s.multiple&&(s.defaultValue!=null?Fd(a,!!s.multiple,s.defaultValue,!0):Fd(a,!!s.multiple,s.multiple?[]:"",!1))}a[hp]=s}catch(g){gn(e,e.return,g)}}break;case 6:if(xo(t,e),cs(e),r&4){if(e.stateNode===null)throw Error(ge(162));a=e.stateNode,s=e.memoizedProps;try{a.nodeValue=s}catch(g){gn(e,e.return,g)}}break;case 3:if(xo(t,e),cs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{lp(t.containerInfo)}catch(g){gn(e,e.return,g)}break;case 4:xo(t,e),cs(e);break;case 13:xo(t,e),cs(e),a=e.child,a.flags&8192&&(s=a.memoizedState!==null,a.stateNode.isHidden=s,!s||a.alternate!==null&&a.alternate.memoizedState!==null||(b2=Nn())),r&4&&sM(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(_r=(u=_r)||d,xo(t,e),_r=u):xo(t,e),cs(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Oe=e,d=e.child;d!==null;){for(f=Oe=d;Oe!==null;){switch(h=Oe,m=h.child,h.tag){case 0:case 11:case 14:case 15:Wm(4,h,h.return);break;case 1:Pd(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){gn(r,n,g)}}break;case 5:Pd(h,h.return);break;case 22:if(h.memoizedState!==null){lM(f);continue}}m!==null?(m.return=h,Oe=m):lM(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,c=f.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=eF("display",i))}catch(g){gn(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){gn(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:xo(t,e),cs(e),r&4&&sM(e);break;case 21:break;default:xo(t,e),cs(e)}}function cs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(C6(n)){var r=n;break e}n=n.return}throw Error(ge(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(ap(a,""),r.flags&=-33);var s=oM(e);A_(e,s,a);break;case 3:case 4:var i=r.stateNode.containerInfo,l=oM(e);E_(e,l,i);break;default:throw Error(ge(161))}}catch(c){gn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function LZ(e,t,n){Oe=e,A6(e)}function A6(e,t,n){for(var r=(e.mode&1)!==0;Oe!==null;){var a=Oe,s=a.child;if(a.tag===22&&r){var i=a.memoizedState!==null||Lv;if(!i){var l=a.alternate,c=l!==null&&l.memoizedState!==null||_r;l=Lv;var u=_r;if(Lv=i,(_r=c)&&!u)for(Oe=a;Oe!==null;)i=Oe,c=i.child,i.tag===22&&i.memoizedState!==null?cM(a):c!==null?(c.return=i,Oe=c):cM(a);for(;s!==null;)Oe=s,A6(s),s=s.sibling;Oe=a,Lv=l,_r=u}iM(e)}else a.subtreeFlags&8772&&s!==null?(s.return=a,Oe=s):iM(e)}}function iM(e){for(;Oe!==null;){var t=Oe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_r||U0(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!_r)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:_o(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&qO(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qO(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&lp(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ge(163))}_r||t.flags&512&&k_(t)}catch(h){gn(t,t.return,h)}}if(t===e){Oe=null;break}if(n=t.sibling,n!==null){n.return=t.return,Oe=n;break}Oe=t.return}}function lM(e){for(;Oe!==null;){var t=Oe;if(t===e){Oe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Oe=n;break}Oe=t.return}}function cM(e){for(;Oe!==null;){var t=Oe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{U0(4,t)}catch(c){gn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){gn(t,a,c)}}var s=t.return;try{k_(t)}catch(c){gn(t,s,c)}break;case 5:var i=t.return;try{k_(t)}catch(c){gn(t,i,c)}}}catch(c){gn(t,t.return,c)}if(t===e){Oe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Oe=l;break}Oe=t.return}}var FZ=Math.ceil,zx=Ui.ReactCurrentDispatcher,y2=Ui.ReactCurrentOwner,eo=Ui.ReactCurrentBatchConfig,Nt=0,Qn=null,On=null,hr=0,ja=0,Td=tc(0),Fn=0,xp=null,iu=0,V0=0,x2=0,qm=null,Zr=null,b2=0,xf=1/0,ri=null,Ux=!1,P_=null,Il=null,Fv=!1,_l=null,Vx=0,Hm=0,T_=null,Zy=-1,ex=0;function Wr(){return Nt&6?Nn():Zy!==-1?Zy:Zy=Nn()}function $l(e){return e.mode&1?Nt&2&&hr!==0?hr&-hr:jZ.transition!==null?(ex===0&&(ex=hF()),ex):(e=It,e!==0||(e=window.event,e=e===void 0?16:bF(e.type)),e):1}function Bo(e,t,n,r){if(50<Hm)throw Hm=0,T_=null,Error(ge(185));Ng(e,n,r),(!(Nt&2)||e!==Qn)&&(e===Qn&&(!(Nt&2)&&(V0|=n),Fn===4&&pl(e,hr)),oa(e,r),n===1&&Nt===0&&!(t.mode&1)&&(xf=Nn()+500,F0&&nc()))}function oa(e,t){var n=e.callbackNode;jQ(e,t);var r=Cx(e,e===Qn?hr:0);if(r===0)n!==null&&yO(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yO(n),t===1)e.tag===0?wZ(uM.bind(null,e)):FF(uM.bind(null,e)),vZ(function(){!(Nt&6)&&nc()}),n=null;else{switch(mF(r)){case 1:n=HE;break;case 4:n=dF;break;case 16:n=_x;break;case 536870912:n=fF;break;default:n=_x}n=R6(n,P6.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function P6(e,t){if(Zy=-1,ex=0,Nt&6)throw Error(ge(327));var n=e.callbackNode;if(Wd()&&e.callbackNode!==n)return null;var r=Cx(e,e===Qn?hr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wx(e,r);else{t=r;var a=Nt;Nt|=2;var s=O6();(Qn!==e||hr!==t)&&(ri=null,xf=Nn()+500,Kc(e,t));do try{UZ();break}catch(l){T6(e,l)}while(!0);o2(),zx.current=s,Nt=a,On!==null?t=0:(Qn=null,hr=0,t=Fn)}if(t!==0){if(t===2&&(a=a_(e),a!==0&&(r=a,t=O_(e,a))),t===1)throw n=xp,Kc(e,0),pl(e,r),oa(e,Nn()),n;if(t===6)pl(e,r);else{if(a=e.current.alternate,!(r&30)&&!BZ(a)&&(t=Wx(e,r),t===2&&(s=a_(e),s!==0&&(r=s,t=O_(e,s))),t===1))throw n=xp,Kc(e,0),pl(e,r),oa(e,Nn()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(ge(345));case 2:Cc(e,Zr,ri);break;case 3:if(pl(e,r),(r&130023424)===r&&(t=b2+500-Nn(),10<t)){if(Cx(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Wr(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=f_(Cc.bind(null,e,Zr,ri),t);break}Cc(e,Zr,ri);break;case 4:if(pl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var i=31-Fo(r);s=1<<i,i=t[i],i>a&&(a=i),r&=~s}if(r=a,r=Nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*FZ(r/1960))-r,10<r){e.timeoutHandle=f_(Cc.bind(null,e,Zr,ri),r);break}Cc(e,Zr,ri);break;case 5:Cc(e,Zr,ri);break;default:throw Error(ge(329))}}}return oa(e,Nn()),e.callbackNode===n?P6.bind(null,e):null}function O_(e,t){var n=qm;return e.current.memoizedState.isDehydrated&&(Kc(e,t).flags|=256),e=Wx(e,t),e!==2&&(t=Zr,Zr=n,t!==null&&M_(t)),e}function M_(e){Zr===null?Zr=e:Zr.push.apply(Zr,e)}function BZ(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],s=a.getSnapshot;a=a.value;try{if(!Vo(s(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function pl(e,t){for(t&=~x2,t&=~V0,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fo(t),r=1<<n;e[n]=-1,t&=~r}}function uM(e){if(Nt&6)throw Error(ge(327));Wd();var t=Cx(e,0);if(!(t&1))return oa(e,Nn()),null;var n=Wx(e,t);if(e.tag!==0&&n===2){var r=a_(e);r!==0&&(t=r,n=O_(e,r))}if(n===1)throw n=xp,Kc(e,0),pl(e,t),oa(e,Nn()),n;if(n===6)throw Error(ge(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Cc(e,Zr,ri),oa(e,Nn()),null}function w2(e,t){var n=Nt;Nt|=1;try{return e(t)}finally{Nt=n,Nt===0&&(xf=Nn()+500,F0&&nc())}}function lu(e){_l!==null&&_l.tag===0&&!(Nt&6)&&Wd();var t=Nt;Nt|=1;var n=eo.transition,r=It;try{if(eo.transition=null,It=1,e)return e()}finally{It=r,eo.transition=n,Nt=t,!(Nt&6)&&nc()}}function j2(){ja=Td.current,tn(Td)}function Kc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gZ(n)),On!==null)for(n=On.return;n!==null;){var r=n;switch(n2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tx();break;case 3:vf(),tn(ra),tn(Pr),d2();break;case 5:u2(r);break;case 4:vf();break;case 13:tn(un);break;case 19:tn(un);break;case 10:s2(r.type._context);break;case 22:case 23:j2()}n=n.return}if(Qn=e,On=e=Dl(e.current,null),hr=ja=t,Fn=0,xp=null,x2=V0=iu=0,Zr=qm=null,$c!==null){for(t=0;t<$c.length;t++)if(n=$c[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=a,r.next=i}n.pending=r}$c=null}return e}function T6(e,t){do{var n=On;try{if(o2(),Xy.current=Bx,Fx){for(var r=dn.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Fx=!1}if(su=0,Kn=Ln=dn=null,Vm=!1,gp=0,y2.current=null,n===null||n.return===null){Fn=1,xp=t,On=null;break}e:{var s=e,i=n.return,l=n,c=t;if(t=hr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=JO(i);if(m!==null){m.flags&=-257,QO(m,i,l,s,t),m.mode&1&&XO(s,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){XO(s,u,t),S2();break e}c=Error(ge(426))}}else if(on&&l.mode&1){var y=JO(i);if(y!==null){!(y.flags&65536)&&(y.flags|=256),QO(y,i,l,s,t),r2(yf(c,l));break e}}s=c=yf(c,l),Fn!==4&&(Fn=2),qm===null?qm=[s]:qm.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=m6(s,c,t);WO(s,x);break e;case 1:l=c;var b=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Il===null||!Il.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var N=p6(s,l,t);WO(s,N);break e}}s=s.return}while(s!==null)}I6(n)}catch(S){t=S,On===n&&n!==null&&(On=n=n.return);continue}break}while(!0)}function O6(){var e=zx.current;return zx.current=Bx,e===null?Bx:e}function S2(){(Fn===0||Fn===3||Fn===2)&&(Fn=4),Qn===null||!(iu&268435455)&&!(V0&268435455)||pl(Qn,hr)}function Wx(e,t){var n=Nt;Nt|=2;var r=O6();(Qn!==e||hr!==t)&&(ri=null,Kc(e,t));do try{zZ();break}catch(a){T6(e,a)}while(!0);if(o2(),Nt=n,zx.current=r,On!==null)throw Error(ge(261));return Qn=null,hr=0,Fn}function zZ(){for(;On!==null;)M6(On)}function UZ(){for(;On!==null&&!hQ();)M6(On)}function M6(e){var t=D6(e.alternate,e,ja);e.memoizedProps=e.pendingProps,t===null?I6(e):On=t,y2.current=null}function I6(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$Z(n,t),n!==null){n.flags&=32767,On=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fn=6,On=null;return}}else if(n=IZ(n,t,ja),n!==null){On=n;return}if(t=t.sibling,t!==null){On=t;return}On=t=e}while(t!==null);Fn===0&&(Fn=5)}function Cc(e,t,n){var r=It,a=eo.transition;try{eo.transition=null,It=1,VZ(e,t,n,r)}finally{eo.transition=a,It=r}return null}function VZ(e,t,n,r){do Wd();while(_l!==null);if(Nt&6)throw Error(ge(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ge(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(SQ(e,s),e===Qn&&(On=Qn=null,hr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fv||(Fv=!0,R6(_x,function(){return Wd(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=eo.transition,eo.transition=null;var i=It;It=1;var l=Nt;Nt|=4,y2.current=null,RZ(e,n),E6(n,e),cZ(u_),kx=!!c_,u_=c_=null,e.current=n,LZ(n),mQ(),Nt=l,It=i,eo.transition=s}else e.current=n;if(Fv&&(Fv=!1,_l=e,Vx=a),s=e.pendingLanes,s===0&&(Il=null),vQ(n.stateNode),oa(e,Nn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Ux)throw Ux=!1,e=P_,P_=null,e;return Vx&1&&e.tag!==0&&Wd(),s=e.pendingLanes,s&1?e===T_?Hm++:(Hm=0,T_=e):Hm=0,nc(),null}function Wd(){if(_l!==null){var e=mF(Vx),t=eo.transition,n=It;try{if(eo.transition=null,It=16>e?16:e,_l===null)var r=!1;else{if(e=_l,_l=null,Vx=0,Nt&6)throw Error(ge(331));var a=Nt;for(Nt|=4,Oe=e.current;Oe!==null;){var s=Oe,i=s.child;if(Oe.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Oe=u;Oe!==null;){var d=Oe;switch(d.tag){case 0:case 11:case 15:Wm(8,d,s)}var f=d.child;if(f!==null)f.return=d,Oe=f;else for(;Oe!==null;){d=Oe;var h=d.sibling,m=d.return;if(_6(d),d===u){Oe=null;break}if(h!==null){h.return=m,Oe=h;break}Oe=m}}}var v=s.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}Oe=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,Oe=i;else e:for(;Oe!==null;){if(s=Oe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Wm(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,Oe=x;break e}Oe=s.return}}var b=e.current;for(Oe=b;Oe!==null;){i=Oe;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,Oe=w;else e:for(i=b;Oe!==null;){if(l=Oe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:U0(9,l)}}catch(S){gn(l,l.return,S)}if(l===i){Oe=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,Oe=N;break e}Oe=l.return}}if(Nt=a,nc(),js&&typeof js.onPostCommitFiberRoot=="function")try{js.onPostCommitFiberRoot(I0,e)}catch{}r=!0}return r}finally{It=n,eo.transition=t}}return!1}function dM(e,t,n){t=yf(n,t),t=m6(e,t,1),e=Ml(e,t,1),t=Wr(),e!==null&&(Ng(e,1,t),oa(e,t))}function gn(e,t,n){if(e.tag===3)dM(e,e,n);else for(;t!==null;){if(t.tag===3){dM(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Il===null||!Il.has(r))){e=yf(n,e),e=p6(t,e,1),t=Ml(t,e,1),e=Wr(),t!==null&&(Ng(t,1,e),oa(t,e));break}}t=t.return}}function WZ(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Wr(),e.pingedLanes|=e.suspendedLanes&n,Qn===e&&(hr&n)===n&&(Fn===4||Fn===3&&(hr&130023424)===hr&&500>Nn()-b2?Kc(e,0):x2|=n),oa(e,t)}function $6(e,t){t===0&&(e.mode&1?(t=Av,Av<<=1,!(Av&130023424)&&(Av=4194304)):t=1);var n=Wr();e=Ai(e,t),e!==null&&(Ng(e,t,n),oa(e,n))}function qZ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$6(e,n)}function HZ(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ge(314))}r!==null&&r.delete(t),$6(e,n)}var D6;D6=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ra.current)ea=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ea=!1,MZ(e,t,n);ea=!!(e.flags&131072)}else ea=!1,on&&t.flags&1048576&&BF(t,Ix,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qy(e,t),e=t.pendingProps;var a=mf(t,Pr.current);Vd(t,n),a=h2(null,t,r,e,a,n);var s=m2();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,aa(r)?(s=!0,Ox(t)):s=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,l2(t),a.updater=z0,t.stateNode=a,a._reactInternals=t,x_(t,r,e,n),t=j_(null,t,r,!0,s,n)):(t.tag=0,on&&s&&t2(t),Lr(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qy(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=YZ(r),e=_o(r,e),a){case 0:t=w_(null,t,r,e,n);break e;case 1:t=tM(null,t,r,e,n);break e;case 11:t=ZO(null,t,r,e,n);break e;case 14:t=eM(null,t,r,_o(r.type,e),n);break e}throw Error(ge(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:_o(r,a),w_(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:_o(r,a),tM(e,t,r,a,n);case 3:e:{if(x6(t),e===null)throw Error(ge(387));
vendor: 5,694 bytes, line 40
40r=t.pendingProps,s=t.memoizedState,a=s.element,HF(e,t),Rx(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){a=yf(Error(ge(423)),t),t=nM(e,t,r,n,a);break e}else if(r!==a){a=yf(Error(ge(424)),t),t=nM(e,t,r,n,a);break e}else for(Ca=Ol(t.stateNode.containerInfo.firstChild),Ea=t,on=!0,Io=null,n=WF(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pf(),r===a){t=Pi(e,t,n);break e}Lr(e,t,r,n)}t=t.child}return t;case 5:return GF(t),e===null&&g_(t),r=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,i=a.children,d_(r,a)?i=null:s!==null&&d_(r,s)&&(t.flags|=32),y6(e,t),Lr(e,t,i,n),t.child;case 6:return e===null&&g_(t),null;case 13:return b6(e,t,n);case 4:return c2(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gf(t,null,r,n):Lr(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:_o(r,a),ZO(e,t,r,a,n);case 7:return Lr(e,t,t.pendingProps,n),t.child;case 8:return Lr(e,t,t.pendingProps.children,n),t.child;case 12:return Lr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,s=t.memoizedProps,i=a.value,Gt($x,r._currentValue),r._currentValue=i,s!==null)if(Vo(s.value,i)){if(s.children===a.children&&!ra.current){t=Pi(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=vi(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),v_(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(ge(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),v_(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}Lr(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Vd(t,n),a=so(a),r=r(a),t.flags|=1,Lr(e,t,r,n),t.child;case 14:return r=t.type,a=_o(r,t.pendingProps),a=_o(r.type,a),eM(e,t,r,a,n);case 15:return g6(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:_o(r,a),Qy(e,t),t.tag=1,aa(r)?(e=!0,Ox(t)):e=!1,Vd(t,n),h6(t,r,a),x_(t,r,a,n),j_(null,t,r,!0,e,n);case 19:return w6(e,t,n);case 22:return v6(e,t,n)}throw Error(ge(156,t.tag))};function R6(e,t){return uF(e,t)}function GZ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xa(e,t,n,r){return new GZ(e,t,n,r)}function N2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YZ(e){if(typeof e=="function")return N2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===VE)return 11;if(e===WE)return 14}return 2}function Dl(e,t){var n=e.alternate;return n===null?(n=Xa(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tx(e,t,n,r,a,s){var i=2;if(r=e,typeof e=="function")N2(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case wd:return Xc(n.children,a,s,t);case UE:i=8,a|=8;break;case VN:return e=Xa(12,n,t,a|2),e.elementType=VN,e.lanes=s,e;case WN:return e=Xa(13,n,t,a),e.elementType=WN,e.lanes=s,e;case qN:return e=Xa(19,n,t,a),e.elementType=qN,e.lanes=s,e;case G5:return W0(n,a,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q5:i=10;break e;case H5:i=9;break e;case VE:i=11;break e;case WE:i=14;break e;case cl:i=16,r=null;break e}throw Error(ge(130,e==null?e:typeof e,""))}return t=Xa(i,n,t,a),t.elementType=e,t.type=r,t.lanes=s,t}function Xc(e,t,n,r){return e=Xa(7,e,r,t),e.lanes=n,e}function W0(e,t,n,r){return e=Xa(22,e,r,t),e.elementType=G5,e.lanes=n,e.stateNode={isHidden:!1},e}function Hj(e,t,n){return e=Xa(6,e,null,t),e.lanes=n,e}function Gj(e,t,n){return t=Xa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KZ(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kj(0),this.expirationTimes=kj(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kj(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function _2(e,t,n,r,a,s,i,l,c){return e=new KZ(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Xa(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},l2(s),e}
vendor: 4,681 bytes, line 40
40function XZ(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bd,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function L6(e){if(!e)return ql;e=e._reactInternals;e:{if(Tu(e)!==e||e.tag!==1)throw Error(ge(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(aa(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ge(171))}if(e.tag===1){var n=e.type;if(aa(n))return LF(e,n,t)}return t}function F6(e,t,n,r,a,s,i,l,c){return e=_2(n,r,!0,e,a,s,i,l,c),e.context=L6(null),n=e.current,r=Wr(),a=$l(n),s=vi(r,a),s.callback=t??null,Ml(n,s,a),e.current.lanes=a,Ng(e,a,r),oa(e,r),e}function q0(e,t,n,r){var a=t.current,s=Wr(),i=$l(a);return n=L6(n),t.context===null?t.context=n:t.pendingContext=n,t=vi(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ml(a,t,i),e!==null&&(Bo(e,a,i,s),Ky(e,a,i)),i}function qx(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fM(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function C2(e,t){fM(e,t),(e=e.alternate)&&fM(e,t)}function JZ(){return null}var B6=typeof reportError=="function"?reportError:function(e){console.error(e)};function k2(e){this._internalRoot=e}H0.prototype.render=k2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ge(409));q0(e,t,null,null)};H0.prototype.unmount=k2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lu(function(){q0(null,e,null,null)}),t[Ei]=null}};function H0(e){this._internalRoot=e}H0.prototype.unstable_scheduleHydration=function(e){if(e){var t=vF();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ml.length&&t!==0&&t<ml[n].priority;n++);ml.splice(n,0,e),n===0&&xF(e)}};function E2(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function G0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hM(){}function QZ(e,t,n,r,a){if(a){if(typeof r=="function"){var s=r;r=function(){var u=qx(i);s.call(u)}}var i=F6(t,r,e,0,null,!1,!1,"",hM);return e._reactRootContainer=i,e[Ei]=i.current,dp(e.nodeType===8?e.parentNode:e),lu(),i}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=qx(c);l.call(u)}}var c=_2(e,0,!1,null,null,!1,!1,"",hM);return e._reactRootContainer=c,e[Ei]=c.current,dp(e.nodeType===8?e.parentNode:e),lu(function(){q0(t,c,n,r)}),c}function Y0(e,t,n,r,a){var s=n._reactRootContainer;if(s){var i=s;if(typeof a=="function"){var l=a;a=function(){var c=qx(i);l.call(c)}}q0(t,i,e,a)}else i=QZ(n,t,e,a,r);return qx(i)}pF=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Sm(t.pendingLanes);n!==0&&(GE(t,n|1),oa(t,Nn()),!(Nt&6)&&(xf=Nn()+500,nc()))}break;case 13:lu(function(){var r=Ai(e,1);if(r!==null){var a=Wr();Bo(r,e,1,a)}}),C2(e,1)}};YE=function(e){if(e.tag===13){var t=Ai(e,134217728);if(t!==null){var n=Wr();Bo(t,e,134217728,n)}C2(e,134217728)}};gF=function(e){if(e.tag===13){var t=$l(e),n=Ai(e,t);if(n!==null){var r=Wr();Bo(n,e,t,r)}C2(e,t)}};vF=function(){return It};yF=function(e,t){var n=It;try{return It=e,t()}finally{It=n}};t_=function(e,t,n){switch(t){case"input":if(YN(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=L0(r);if(!a)throw Error(ge(90));K5(r),YN(r,a)}}}break;case"textarea":J5(e,n);break;case"select":t=n.value,t!=null&&Fd(e,!!n.multiple,t,!1)}};aF=w2;oF=lu;var ZZ={usingClientEntryPoint:!1,Events:[Cg,_d,L0,nF,rF,w2]},Hh={findFiberByHostInstance:Ic,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},eee={bundleType:Hh.bundleType,version:Hh.version,rendererPackageName:Hh.rendererPackageName,rendererConfig:Hh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=lF(e),e===null?null:e.stateNode},findFiberByHostInstance:Hh.findFiberByHostInstance||JZ,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 Bv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bv.isDisabled&&Bv.supportsFiber)try{I0=Bv.inject(eee),js=Bv}catch{}}Da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZZ;Da.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!E2(t))throw Error(ge(200));return XZ(e,t,null,n)};Da.createRoot=function(e,t){if(!E2(e))throw Error(ge(299));var n=!1,r="",a=B6;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=_2(e,1,!1,null,null,n,!1,r,a),e[Ei]=t.current,dp(e.nodeType===8?e.parentNode:e),new k2(t)};Da.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ge(188)):(e=Object.keys(e).join(","),Error(ge(268,e)));return e=lF(t),e=e===null?null:e.stateNode,e};Da.flushSync=function(e){return lu(e)};Da.hydrate=function(e,t,n){if(!G0(t))throw Error(ge(200));return Y0(null,e,t,!0,n)};Da.hydrateRoot=function(e,t,n){if(!E2(e))throw Error(ge(405));var r=n!=null&&n.hydratedSources||null,a=!1,s="",i=B6;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=F6(t,null,e,1,n??null,a,!1,s,i),e[Ei]=t.current,dp(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new H0(t)};Da.render=function(e,t,n){if(!G0(t))throw Error(ge(200));return Y0(null,e,t,!1,n)};Da.unmountComponentAtNode=function(e){if(!G0(e))throw Error(ge(40));return e._reactRootContainer?(lu(function(){Y0(null,null,e,!1,function(){e._reactRootContainer=null,e[Ei]=null})}),!0):!1};Da.unstable_batchedUpdates=w2;Da.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!G0(n))throw Error(ge(200));if(e==null||e._reactInternals===void 0)throw Error(ge(38));return Y0(e,t,n,!1,r)};Da.version="18.3.1-next-f1338f8080-20240426";function z6(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z6)}catch(e){console.error(e)}}z6(),z5.exports=Da;var Ou=z5.exports;const U6=Dt(Ou);var V6,mM=Ou;V6=mM.createRoot,mM.hydrateRoot;var K0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},X0=typeof window>"u"||"Deno"in globalThis;function Co(){}function tee(e,t){return typeof e=="function"?e(t):e}function nee(e){return typeof e=="number"&&e>=0&&e!==1/0}function ree(e,t){return Math.max(e+(t||0)-Date.now(),0)}function I_(e,t){return typeof e=="function"?e(t):e}function aee(e,t){return typeof e=="function"?e(t):e}function pM(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:s,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==A2(i,t.options))return!1}else if(!wp(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||s&&!s(t))}function gM(e,t){const{exact:n,status:r,predicate:a,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(bp(t.options.mutationKey)!==bp(s))return!1}else if(!wp(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function A2(e,t){return((t==null?void 0:t.queryKeyHashFn)||bp)(e)}function bp(e){return JSON.stringify(e,(t,n)=>$_(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function wp(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>wp(e[n],t[n])):!1}function W6(e,t){if(e===t)return e;const n=vM(e)&&vM(t);if(n||$_(e)&&$_(t)){const r=n?e:Object.keys(e),a=r.length,s=n?t:Object.keys(t),i=s.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<i;d++){const f=n?d:s[d];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=W6(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===i&&u===a?e:l}return t}function vM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $_(e){if(!yM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yM(e){return Object.prototype.toString.call(e)==="[object Object]"}function oee(e){return new Promise(t=>{setTimeout(t,e)})}function see(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?W6(e,t):t}function iee(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lee(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var P2=Symbol();function q6(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===P2?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vc,xl,af,j5,cee=(j5=class extends K0{constructor(){super();kt(this,Vc);kt(this,xl);kt(this,af);Je(this,af,t=>{if(!X0&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){de(this,xl)||this.setEventListener(de(this,af))}onUnsubscribe(){var t;this.hasListeners()||((t=de(this,xl))==null||t.call(this),Je(this,xl,void 0))}setEventListener(t){var n;Je(this,af,t),(n=de(this,xl))==null||n.call(this),Je(this,xl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){de(this,Vc)!==t&&(Je(this,Vc,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,959 bytes, line 40
40this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof de(this,Vc)=="boolean"?de(this,Vc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vc=new WeakMap,xl=new WeakMap,af=new WeakMap,j5),H6=new cee,of,bl,sf,S5,uee=(S5=class extends K0{constructor(){super();kt(this,of,!0);kt(this,bl);kt(this,sf);Je(this,sf,t=>{if(!X0&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,bl)||this.setEventListener(de(this,sf))}onUnsubscribe(){var t;this.hasListeners()||((t=de(this,bl))==null||t.call(this),Je(this,bl,void 0))}setEventListener(t){var n;Je(this,sf,t),(n=de(this,bl))==null||n.call(this),Je(this,bl,t(this.setOnline.bind(this)))}setOnline(t){de(this,of)!==t&&(Je(this,of,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return de(this,of)}},of=new WeakMap,bl=new WeakMap,sf=new WeakMap,S5),Hx=new uee;function dee(){let e,t;const n=new Promise((a,s)=>{e=a,t=s});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function fee(e){return Math.min(1e3*2**e,3e4)}function G6(e){return(e??"online")==="online"?Hx.isOnline():!0}var Y6=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Yj(e){return e instanceof Y6}function K6(e){let t=!1,n=0,r=!1,a;const s=dee(),i=g=>{var y;r||(h(new Y6(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>H6.isFocused()&&(e.networkMode==="always"||Hx.isOnline())&&e.canRun(),d=()=>G6(e.networkMode)&&e.canRun(),f=g=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,g),a==null||a(),s.resolve(g))},h=g=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,g),a==null||a(),s.reject(g))},m=()=>new Promise(g=>{var y;a=x=>{(r||u())&&g(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;a=void 0,r||(g=e.onContinue)==null||g.call(e)}),v=()=>{if(r)return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{var _;if(r)return;const b=e.retry??(X0?0:3),w=e.retryDelay??fee,N=typeof w=="function"?w(n,x):w,S=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,x);if(t||!S){h(x);return}n++,(_=e.onFail)==null||_.call(e,n,x),oee(N).then(()=>u()?void 0:m()).then(()=>{t?h(x):v()})})};return{promise:s,cancel:i,continue:()=>(a==null||a(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?v():m().then(v),s)}}var hee=e=>setTimeout(e,0);function mee(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=hee;const s=l=>{t?e.push(l):a(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&a(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{a=l}}}var zr=mee(),Wc,N5,X6=(N5=class{constructor(){kt(this,Wc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nee(this.gcTime)&&Je(this,Wc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(X0?1/0:5*60*1e3))}clearGcTimeout(){de(this,Wc)&&(clearTimeout(de(this,Wc)),Je(this,Wc,void 0))}},Wc=new WeakMap,N5),lf,qc,qa,Hc,Sr,wg,Gc,Eo,ti,_5,pee=(_5=class extends X6{constructor(t){super();kt(this,Eo);kt(this,lf);kt(this,qc);kt(this,qa);kt(this,Hc);kt(this,Sr);kt(this,wg);kt(this,Gc);Je(this,Gc,!1),Je(this,wg,t.defaultOptions),this.setOptions(t.options),this.observers=[],Je(this,Hc,t.client),Je(this,qa,de(this,Hc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Je(this,lf,vee(this.options)),this.state=t.state??de(this,lf),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=de(this,Sr))==null?void 0:t.promise}setOptions(t){this.options={...de(this,wg),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,qa).remove(this)}setData(t,n){const r=see(this.state.data,t,this.options);return xr(this,Eo,ti).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xr(this,Eo,ti).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=de(this,Sr))==null?void 0:r.promise;return(a=de(this,Sr))==null||a.cancel(t),n?n.then(Co).catch(Co):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(de(this,lf))}isActive(){return this.observers.some(t=>aee(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P2||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 1,283 bytes, line 40
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>I_(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ree(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=de(this,Sr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=de(this,Sr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),de(this,qa).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(de(this,Sr)&&(de(this,Gc)?de(this,Sr).cancel({revert:!0}):de(this,Sr).cancelRetry()),this.scheduleGc()),de(this,qa).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xr(this,Eo,ti).call(this,{type:"invalidate"})}
vendor: 13,822 bytes, line 40
40fetch(t,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(de(this,Sr))return de(this,Sr).continueRetry(),de(this,Sr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Je(this,Gc,!0),r.signal)})},s=()=>{const h=q6(this.options,n),v=(()=>{const g={client:de(this,Hc),queryKey:this.queryKey,meta:this.meta};return a(g),g})();return Je(this,Gc,!1),this.options.persister?this.options.persister(h,v,this):h(v)},l=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:de(this,Hc),state:this.state,fetchFn:s};return a(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),Je(this,qc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&xr(this,Eo,ti).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var m,v,g,y;Yj(h)&&h.silent||xr(this,Eo,ti).call(this,{type:"error",error:h}),Yj(h)||((v=(m=de(this,qa).config).onError)==null||v.call(m,h,this),(y=(g=de(this,qa).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return Je(this,Sr,K6({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var m,v,g,y;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(x){c(x);return}(v=(m=de(this,qa).config).onSuccess)==null||v.call(m,h,this),(y=(g=de(this,qa).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{xr(this,Eo,ti).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{xr(this,Eo,ti).call(this,{type:"pause"})},onContinue:()=>{xr(this,Eo,ti).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),de(this,Sr).start()}},lf=new WeakMap,qc=new WeakMap,qa=new WeakMap,Hc=new WeakMap,Sr=new WeakMap,wg=new WeakMap,Gc=new WeakMap,Eo=new WeakSet,ti=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gee(r.data,this.options),fetchMeta:t.meta??null};case"success":return Je(this,qc,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Yj(a)&&a.revert&&de(this,qc)?{...de(this,qc),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),de(this,qa).notify({query:this,type:"updated",action:t})})},_5);function gee(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G6(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vee(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hs,C5,yee=(C5=class extends K0{constructor(t={}){super();kt(this,hs);this.config=t,Je(this,hs,new Map)}build(t,n,r){const a=n.queryKey,s=n.queryHash??A2(a,n);let i=this.get(s);return i||(i=new pee({client:t,queryKey:a,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(i)),i}add(t){de(this,hs).has(t.queryHash)||(de(this,hs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=de(this,hs).get(t.queryHash);n&&(t.destroy(),n===t&&de(this,hs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return de(this,hs).get(t)}getAll(){return[...de(this,hs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>pM(t,r)):n}notify(t){zr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hs=new WeakMap,C5),ms,Rr,Yc,ps,ol,k5,xee=(k5=class extends X6{constructor(t){super();kt(this,ps);kt(this,ms);kt(this,Rr);kt(this,Yc);this.mutationId=t.mutationId,Je(this,Rr,t.mutationCache),Je(this,ms,[]),this.state=t.state||bee(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){de(this,ms).includes(t)||(de(this,ms).push(t),this.clearGcTimeout(),de(this,Rr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Je(this,ms,de(this,ms).filter(n=>n!==t)),this.scheduleGc(),de(this,Rr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){de(this,ms).length||(this.state.status==="pending"?this.scheduleGc():de(this,Rr).remove(this))}continue(){var t;return((t=de(this,Yc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,l,c,u,d,f,h,m,v,g,y,x,b,w,N,S,_,k,P;const n=()=>{xr(this,ps,ol).call(this,{type:"continue"})};Je(this,Yc,K6({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(O,$)=>{xr(this,ps,ol).call(this,{type:"failed",failureCount:O,error:$})},onPause:()=>{xr(this,ps,ol).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,Rr).canRun(this)}));const r=this.state.status==="pending",a=!de(this,Yc).canStart();try{if(r)n();else{xr(this,ps,ol).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(s=de(this,Rr).config).onMutate)==null?void 0:i.call(s,t,this));const $=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));$!==this.state.context&&xr(this,ps,ol).call(this,{type:"pending",context:$,variables:t,isPaused:a})}const O=await de(this,Yc).start();return await((d=(u=de(this,Rr).config).onSuccess)==null?void 0:d.call(u,O,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,O,t,this.state.context)),await((v=(m=de(this,Rr).config).onSettled)==null?void 0:v.call(m,O,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,O,null,t,this.state.context)),xr(this,ps,ol).call(this,{type:"success",data:O}),O}catch(O){try{throw await((b=(x=de(this,Rr).config).onError)==null?void 0:b.call(x,O,t,this.state.context,this)),await((N=(w=this.options).onError)==null?void 0:N.call(w,O,t,this.state.context)),await((_=(S=de(this,Rr).config).onSettled)==null?void 0:_.call(S,void 0,O,this.state.variables,this.state.context,this)),await((P=(k=this.options).onSettled)==null?void 0:P.call(k,void 0,O,t,this.state.context)),O}finally{xr(this,ps,ol).call(this,{type:"error",error:O})}}finally{de(this,Rr).runNext(this)}}},ms=new WeakMap,Rr=new WeakMap,Yc=new WeakMap,ps=new WeakSet,ol=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zr.batch(()=>{de(this,ms).forEach(r=>{r.onMutationUpdate(t)}),de(this,Rr).notify({mutation:this,type:"updated",action:t})})},k5);function bee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ii,Ao,jg,E5,wee=(E5=class extends K0{constructor(t={}){super();kt(this,ii);kt(this,Ao);kt(this,jg);this.config=t,Je(this,ii,new Set),Je(this,Ao,new Map),Je(this,jg,0)}build(t,n,r){const a=new xee({mutationCache:this,mutationId:++Sv(this,jg)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){de(this,ii).add(t);const n=zv(t);if(typeof n=="string"){const r=de(this,Ao).get(n);r?r.push(t):de(this,Ao).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(de(this,ii).delete(t)){const n=zv(t);if(typeof n=="string"){const r=de(this,Ao).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&de(this,Ao).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=zv(t);if(typeof n=="string"){const r=de(this,Ao).get(n),a=r==null?void 0:r.find(s=>s.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=zv(t);if(typeof n=="string"){const a=(r=de(this,Ao).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{de(this,ii).forEach(t=>{this.notify({type:"removed",mutation:t})}),de(this,ii).clear(),de(this,Ao).clear()})}getAll(){return Array.from(de(this,ii))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>gM(n,r))}findAll(t={}){return this.getAll().filter(n=>gM(t,n))}notify(t){zr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Co))))}},ii=new WeakMap,Ao=new WeakMap,jg=new WeakMap,E5);function zv(e){var t;return(t=e.options.scope)==null?void 0:t.id}function xM(e){return{onFetch:(t,n)=>{var d,f,h,m,v;const r=t.options,a=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=q6(t.options,t.fetchOptions),b=async(w,N,S)=>{if(g)return Promise.reject();if(N==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:N,direction:S?"backward":"forward",meta:t.options.meta};return y(T),T})(),P=await x(k),{maxPages:O}=t.options,$=S?lee:iee;return{pages:$(w.pages,P,O),pageParams:$(w.pageParams,N,O)}};if(a&&s.length){const w=a==="backward",N=w?jee:bM,S={pages:s,pageParams:i},_=N(r,S);l=await b(S,_,w)}else{const w=e??s.length;do{const N=c===0?i[0]??r.initialPageParam:bM(r,l);if(c>0&&N==null)break;l=await b(l,N),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function bM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function jee(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var mn,wl,jl,cf,uf,Sl,df,ff,A5,See=(A5=class{constructor(e={}){kt(this,mn);kt(this,wl);kt(this,jl);kt(this,cf);kt(this,uf);kt(this,Sl);kt(this,df);kt(this,ff);Je(this,mn,e.queryCache||new yee),Je(this,wl,e.mutationCache||new wee),Je(this,jl,e.defaultOptions||{}),Je(this,cf,new Map),Je(this,uf,new Map),Je(this,Sl,0)}mount(){Sv(this,Sl)._++,de(this,Sl)===1&&(Je(this,df,H6.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,mn).onFocus())})),Je(this,ff,Hx.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,mn).onOnline())})))}unmount(){var e,t;Sv(this,Sl)._--,de(this,Sl)===0&&((e=de(this,df))==null||e.call(this),Je(this,df,void 0),(t=de(this,ff))==null||t.call(this),Je(this,ff,void 0))}isFetching(e){return de(this,mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,wl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=de(this,mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=de(this,mn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(I_(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return de(this,mn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=de(this,mn).get(r.queryHash),s=a==null?void 0:a.state.data,i=tee(t,s);if(i!==void 0)return de(this,mn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return zr.batch(()=>de(this,mn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=de(this,mn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=de(this,mn);zr.batch(()=>
40{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=de(this,mn);return zr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zr.batch(()=>de(this,mn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Co).catch(Co)}invalidateQueries(e,t={}){return zr.batch(()=>(de(this,mn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=zr.batch(()=>de(this,mn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,n);return n.throwOnError||(s=s.catch(Co)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Co)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=de(this,mn).build(this,t);return n.isStaleByTime(I_(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Co).catch(Co)}fetchInfiniteQuery(e){return e.behavior=xM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Co).catch(Co)}ensureInfiniteQueryData(e){return e.behavior=xM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hx.isOnline()?de(this,wl).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,mn)}getMutationCache(){return de(this,wl)}getDefaultOptions(){return de(this,jl)}setDefaultOptions(e){Je(this,jl,e)}setQueryDefaults(e,t){de(this,cf).set(bp(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...de(this,cf).values()],n={};return t.forEach(r=>{wp(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){de(this,uf).set(bp(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...de(this,uf).values()],n={};return t.forEach(r=>{wp(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...de(this,jl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=A2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===P2&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,jl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,mn).clear(),de(this,wl).clear()}},mn=new WeakMap,wl=new WeakMap,jl=new WeakMap,cf=new WeakMap,uf=new WeakMap,Sl=new WeakMap,df=new WeakMap,ff=new WeakMap,A5),Nee=p.createContext(void 0),_ee=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(Nee.Provider,{value:e,children:t}));/**
41 * @remix-run/router v1.23.0
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 jp(){return jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jp.apply(this,arguments)}var Cl;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cl||(Cl={}));const wM="popstate";function Cee(e){e===void 0&&(e={});function t(r,a){let{pathname:s,search:i,hash:l}=r.location;return D_("",{pathname:s,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Gx(a)}return Eee(t,n,null,e)}function fn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function J6(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kee(){return Math.random().toString(36).substr(2,8)}function jM(e,t){return{usr:e.state,key:e.key,idx:t}}function D_(e,t,n,r){return n===void 0&&(n=null),jp({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ch(t):t,{state:n,key:t&&t.key||r||kee()})}function Gx(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ch(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Eee(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:s=!1}=r,i=a.history,l=Cl.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(jp({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){l=Cl.Pop;let y=d(),x=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:x})}function h(y,x){l=Cl.Push;let b=D_(g.location,y,x);u=d()+1;let w=jM(b,u),N=g.createHref(b);try{i.pushState(w,"",N)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(N)}s&&c&&c({action:l,location:g.location,delta:1})}function m(y,x){l=Cl.Replace;let b=D_(g.location,y,x);u=d();let w=jM(b,u),N=g.createHref(b);i.replaceState(w,"",N),s&&c&&c({action:l,location:g.location,delta:0})}function v(y){let x=a.location.origin!=="null"?a.location.origin:a.location.href,b=typeof y=="string"?y:Gx(y);return b=b.replace(/ $/,"%20"),fn(x,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,x)}let g={get action(){return l},get location(){return e(a,i)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(wM,f),c=y,()=>{a.removeEventListener(wM,f),c=null}},createHref(y){return t(a,y)},createURL:v,encodeLocation(y){let x=v(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:m,go(y){return i.go(y)}};return g}var SM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(SM||(SM={}));function Aee(e,t,n){return n===void 0&&(n="/"),Pee(e,t,n,!1)}function Pee(e,t,n,r){let a=typeof t=="string"?ch(t):t,s=bf(a.pathname||"/",n);if(s==null)return null;let i=Q6(e);Tee(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let u=Uee(s);l=Bee(i[c],u,r)}return l}function Q6(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(s,i,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};c.relativePath.startsWith("/")&&(fn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Rl([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(fn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Q6(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Lee(u,s.index),routesMeta:d})};return e.forEach((s,i)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))a(s,i);else for(let c of Z6(s.path))a(s,i,c)}),t}function Z6(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let i=Z6(r.join("/")),l=[];return l.push(...i.map(c=>c===""?s:[s,c].join("/"))),a&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Tee(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Fee(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Oee=/^:[\w-]+$/,Mee=3,Iee=2,$ee=1,Dee=10,Ree=-2,NM=e=>e==="*";function Lee(e,t){let n=e.split("/"),r=n.length;return n.some(NM)&&(r+=Ree),t&&(r+=Iee),n.filter(a=>!NM(a)).reduce((a,s)=>a+(Oee.test(s)?Mee:s===""?$ee:Dee),r)}function Fee(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Bee(e,t,n){let{routesMeta:r}=e,a={},s="/",i=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",f=Yx({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Yx({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 7,078 bytes, lines 49-58
49Object.assign(a,f.params),i.push({params:a,pathname:Rl([s,f.pathname]),pathnameBase:Hee(Rl([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=Rl([s,f.pathnameBase]))}return i}function Yx(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zee(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],i=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let g=l[f]||"";i=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const v=l[f];return m&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function zee(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),J6(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Uee(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return J6(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function bf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Vee(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ch(e):e;return{pathname:n?n.startsWith("/")?n:Wee(n,t):t,search:Gee(r),hash:Yee(a)}}function Wee(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Kj(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function qee(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function T2(e,t){let n=qee(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function O2(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=ch(e):(a=jp({},e),fn(!a.pathname||!a.pathname.includes("?"),Kj("?","pathname","search",a)),fn(!a.pathname||!a.pathname.includes("#"),Kj("#","pathname","hash",a)),fn(!a.search||!a.search.includes("#"),Kj("#","search","hash",a)));let s=e===""||a.pathname==="",i=s?"/":a.pathname,l;if(i==null)l=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=Vee(a,l),u=i&&i!=="/"&&i.endsWith("/"),d=(s||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Rl=e=>e.join("/").replace(/\/\/+/g,"/"),Hee=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gee=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Yee=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Kee(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const eB=["post","put","patch","delete"];new Set(eB);const Xee=["get",...eB];new Set(Xee);/**
50 * React Router v6.30.1
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 Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sp.apply(this,arguments)}const J0=p.createContext(null),tB=p.createContext(null),Vi=p.createContext(null),Q0=p.createContext(null),Rs=p.createContext({outlet:null,matches:[],isDataRoute:!1}),nB=p.createContext(null);function Jee(e,t){let{relative:n}=t===void 0?{}:t;uh()||fn(!1);let{basename:r,navigator:a}=p.useContext(Vi),{hash:s,pathname:i,search:l}=Z0(e,{relative:n}),c=i;return r!=="/"&&(c=i==="/"?r:Rl([r,i])),a.createHref({pathname:c,search:l,hash:s})}function uh(){return p.useContext(Q0)!=null}function mo(){return uh()||fn(!1),p.useContext(Q0).location}function rB(e){p.useContext(Vi).static||p.useLayoutEffect(e)}function ua(){let{isDataRoute:e}=p.useContext(Rs);return e?hte():Qee()}function Qee(){uh()||fn(!1);let e=p.useContext(J0),{basename:t,future:n,navigator:r}=p.useContext(Vi),{matches:a}=p.useContext(Rs),{pathname:s}=mo(),i=JSON.stringify(T2(a,n.v7_relativeSplatPath)),l=p.useRef(!1);return rB(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=O2(u,JSON.parse(i),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Rl([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,s,e])}const Zee=p.createContext(null);function ete(e){let t=p.useContext(Rs).outlet;return t&&p.createElement(Zee.Provider,{value:e},t)}function tte(){let{matches:e}=p.useContext(Rs),t=e[e.length-1];return t?t.params:{}}function Z0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Vi),{matches:a}=p.useContext(Rs),{pathname:s}=mo(),i=JSON.stringify(T2(a,r.v7_relativeSplatPath));return p.useMemo(()=>O2(e,JSON.parse(i),s,n==="path"),[e,i,s,n])}function nte(e,t){return rte(e,t)}function rte(e,t,n,r){uh()||fn(!1);let{navigator:a}=p.useContext(Vi),{matches:s}=p.useContext(Rs),i=s[s.length-1],l=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let u=mo(),d;if(t){var f;let y=typeof t=="string"?ch(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||fn(!1),d=y}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=Aee(e,{pathname:m}),g=lte(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Rl([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Rl([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&g?p.createElement(Q0.Provider,{value:{location:Sp({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Cl.Pop}},g):g}function ate(){let e=fte(),t=Kee(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application 
58Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:a},n):null,null)}const ote=p.createElement(ate,null);class ste extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Rs.Provider,{value:this.props.routeContext},p.createElement(nB.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ite(e){let{routeContext:t,match:n,children:r}=e,a=p.useContext(J0);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Rs.Provider,{value:t},r)}function lte(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=i.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||fn(!1),i=i.slice(0,Math.min(i.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<i.length;d++){let f=i[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,v=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,h)=>{let m,v=!1,g=null,y=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||ote,c&&(u<0&&h===0?(v=!0,y=null):u===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,h+1)),b=()=>{let w;return m?w=g:v?w=y:f.route.Component?w=p.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,p.createElement(ite,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(ste,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:b(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):b()},null)}var aB=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(aB||{}),Kx=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Kx||{});function cte(e){let t=p.useContext(J0);return t||fn(!1),t}function ute(e){let t=p.useContext(tB);return t||fn(!1),t}function dte(e){let t=p.useContext(Rs);return t||fn(!1),t}function oB(e){let t=dte(),n=t.matches[t.matches.length-1];return n.route.id||fn(!1),n.route.id}function fte(){var e;let t=p.useContext(nB),n=ute(Kx.UseRouteError),r=oB(Kx.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function hte(){let{router:e}=cte(aB.UseNavigateStable),t=oB(Kx.UseNavigateStable),n=p.useRef(!1);return rB(()=>{n.current=!0}),p.useCallback(function(a,s){s===void 0&&(s={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Sp({fromRouteId:t},s)))},[e,t])}function mte(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function R_(e){let{to:t,replace:n,state:r,relative:a}=e;uh()||fn(!1);let{future:s,static:i}=p.useContext(Vi),{matches:l}=p.useContext(Rs),{pathname:c}=mo(),u=ua(),d=O2(t,T2(l,s.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function M2(e){return ete(e.context)}function Ue(e){fn(!1)}function pte(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Cl.Pop,navigator:s,static:i=!1,future:l}=e;uh()&&fn(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:s,static:i,future:Sp({v7_relativeSplatPath:!1},l)}),[c,l,s,i]);typeof r=="string"&&(r=ch(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:v="default"}=r,g=p.useMemo(()=>{let y=bf(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:m,ke
58y:v},navigationType:a}},[c,d,f,h,m,v,a]);return g==null?null:p.createElement(Vi.Provider,{value:u},p.createElement(Q0.Provider,{children:n,value:g}))}function _M(e){let{children:t,location:n}=e;return nte(L_(t),n)}new Promise(()=>{});function L_(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,a)=>{if(!p.isValidElement(r))return;let s=[...t,a];if(r.type===p.Fragment){n.push.apply(n,L_(r.props.children,s));return}r.type!==Ue&&fn(!1),!r.props.index||!r.props.children||fn(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=L_(r.props.children,s)),n.push(i)}),n}/**
59 * React Router DOM v6.30.1
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 Xx(){return Xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xx.apply(this,arguments)}function sB(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function gte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vte(e,t){return e.button===0&&(!t||t==="_self")&&!gte(e)}function F_(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function yte(e,t){let n=F_(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(s=>{n.append(a,s)})}),n}const xte=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],bte=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],wte="6";try{window.__reactRouterVersion=wte}catch{}const jte=p.createContext({isTransitioning:!1}),Ste="startTransition",CM=M0[Ste];function Nte(e){let{basename:t,children:n,future:r,window:a}=e,s=p.useRef();s.current==null&&(s.current=Cee({window:a,v5Compat:!0}));let i=s.current,[l,c]=p.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},d=p.useCallback(f=>{u&&CM?CM(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>i.listen(d),[i,d]),p.useEffect(()=>mte(r),[r]),p.createElement(pte,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:i,future:r})}const _te=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Cte=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jt=p.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:s,replace:i,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=sB(t,xte),{basename:m}=p.useContext(Vi),v,g=!1;if(typeof u=="string"&&Cte.test(u)&&(v=u,_te))try{let w=new URL(window.location.href),N=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=bf(N.pathname,m);N.origin===w.origin&&S!=null?u=S+N.search+N.hash:g=!0}catch{}let y=Jee(u,{relative:a}),x=Ete(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||x(w)}return p.createElement("a",Xx({},h,{href:v||y,onClick:g||s?r:b,ref:n,target:c}))}),Jx=p.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:s="",end:i=!1,style:l,to:c,viewTransition:u,children:d}=t,f=sB(t,bte),h=Z0(c,{relative:f.relative}),m=mo(),v=p.useContext(tB),{navigator:g,basename:y}=p.useContext(Vi),x=v!=null&&Ate(h)&&u===!0,b=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,w=m.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(w=w.toLowerCase(),N=N?N.toLowerCase():null,b=b.toLowerCase()),N&&y&&(N=bf(N,y)||N);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let _=w===b||!i&&w.startsWith(b)&&w.charAt(S)==="/",k=N!=null&&(N===b||!i&&N.startsWith(b)&&N.charAt(b.length)==="/"),P={isActive:_,isPending:k,isTransitioning:x},O=_?r:void 0,$;typeof s=="function"?$=s(P):$=[s,_?"active":null,k?"pending":null,x?"transitioning":null].filter(
67Boolean).join(" ");let T=typeof l=="function"?l(P):l;return p.createElement(jt,Xx({},f,{"aria-current":O,className:$,ref:n,style:T,to:c,viewTransition:u}),typeof d=="function"?d(P):d)});var B_;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(B_||(B_={}));var kM;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kM||(kM={}));function kte(e){let t=p.useContext(J0);return t||fn(!1),t}function Ete(e,t){let{target:n,replace:r,state:a,preventScrollReset:s,relative:i,viewTransition:l}=t===void 0?{}:t,c=ua(),u=mo(),d=Z0(e,{relative:i});return p.useCallback(f=>{if(vte(f,n)){f.preventDefault();let h=r!==void 0?r:Gx(u)===Gx(d);c(e,{replace:h,state:a,preventScrollReset:s,relative:i,viewTransition:l})}},[u,c,d,r,a,n,e,s,i,l])}function Eg(e){let t=p.useRef(F_(e)),n=p.useRef(!1),r=mo(),a=p.useMemo(()=>yte(r.search,n.current?null:t.current),[r.search]),s=ua(),i=p.useCallback((l,c)=>{const u=F_(typeof l=="function"?l(a):l);n.current=!0,s("?"+u,c)},[s,a]);return[a,i]}function Ate(e,t){t===void 0&&(t={});let n=p.useContext(jte);n==null&&fn(!1);let{basename:r}=kte(B_.useViewTransitionState),a=Z0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=bf(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=bf(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Yx(a.pathname,i)!=null||Yx(a.pathname,s)!=null}var Qx=["light","dark"],I2="(prefers-color-scheme: dark)",Pte=typeof window>"u",$2=p.createContext(void 0),Tte={setTheme:e=>{},themes:[]},ew=()=>{var e;return(e=p.useContext($2))!=null?e:Tte},Ote=e=>p.useContext($2)?e.children:p.createElement(Ite,{...e}),Mte=["light","dark"],Ite=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a="theme",themes:s=Mte,defaultTheme:i=n?"system":"light",attribute:l="data-theme",value:c,children:u,nonce:d})=>{let[f,h]=p.useState(()=>EM(a,i)),[m,v]=p.useState(()=>EM(a)),g=c?Object.values(c):s,y=p.useCallback(N=>{let S=N;if(!S)return;N==="system"&&n&&(S=AM());let _=c?c[S]:S,k=t?Dte():null,P=document.documentElement;if(l==="class"?(P.classList.remove(...g),_&&P.classList.add(_)):_?P.setAttribute(l,_):P.removeAttribute(l),r){let O=Qx.includes(i)?i:null,$=Qx.includes(S)?S:O;P.style.colorScheme=$}k==null||k()},[]),x=p.useCallback(N=>{let S=typeof N=="function"?N(N):N;h(S);try{localStorage.setItem(a,S)}catch{}},[e]),b=p.useCallback(N=>{let S=AM(N);v(S),f==="system"&&n&&!e&&y("system")},[f,e]);p.useEffect(()=>{let N=window.matchMedia(I2);return N.addListener(b),b(N),()=>N.removeListener(b)},[b]),p.useEffect(()=>{let N=S=>{if(S.key!==a)return;let _=S.newValue||i;x(_)};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[x]),p.useEffect(()=>{y(e??f)},[e,f]);let w=p.useMemo(()=>({theme:f,setTheme:x,forcedTheme:e,resolvedTheme:f==="system"?m:f,themes:n?[...s,"system"]:s,systemTheme:n?m:void 0}),[f,x,e,m,n,s]);return p.createElement($2.Provider,{value:w},p.createElement($te,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:a,themes:s,defaultTheme:i,attribute:l,value:c,children:u,attrs:g,nonce:d}),u)},$te=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:s,value:i,attrs:l,nonce:c})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=a?Qx.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,g=!1,y=!0)=>{let x=i?i[v]:v,b=g?v+"|| ''":`'${x}'`,w="";return a&&y&&!g&&Qx.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),n==="class"?g||x?w+=`c.add(${b})`:w+="null":x&&(w+=`d[s](n,${b})`),w},m=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${I2}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${f}}catch(t){}}();`;return p.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})}),EM=(e,t)=>{if(Pte)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Dte=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},AM=e=>
67(e||(e=window.matchMedia(I2)),e.matches?"dark":"light"),Rte=e=>{switch(e){case"success":return Bte;case"info":return Ute;case"warning":return zte;case"error":return Vte;default:return null}},Lte=Array(12).fill(0),Fte=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},Lte.map((n,r)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Bte=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),zte=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.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"})),Ute=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),Vte=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),Wte=H.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"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qte=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},z_=1,Hte=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...a}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:z_++,i=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:l,title:r}):c):this.addToast({title:r,...a,dismissible:l,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let a=t instanceof Promise?t:t(),s=r!==void 0,i,l=a.then(async u=>{if(i=["resolve",u],H.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(Yte(u)&&!u.ok){s=!1;let d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description;this.create({id:r,type:"error",message:d,description:f})}else if(n.success!==void 0){s=!1;let d=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"success",message:d,description:f})}}).catch(async u=>
67{if(i=["reject",u],n.error!==void 0){s=!1;let d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"error",message:d,description:f})}}).finally(()=>{var u;s&&(this.dismiss(r),r=void 0),(u=n.finally)==null||u.call(n)}),c=()=>new Promise((u,d)=>l.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||z_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Jr=new Hte,Gte=(e,t)=>{let n=(t==null?void 0:t.id)||z_++;return Jr.addToast({title:e,...t,id:n}),n},Yte=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Kte=Gte,Xte=()=>Jr.toasts,Jte=()=>Jr.getActiveToasts(),X=Object.assign(Kte,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:Xte,getToasts:Jte});function Qte(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Qte(`: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;
67left: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}
67: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%);
67--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%)}
68`);function Uv(e){return e.label!==void 0}var Zte=3,ene="32px",tne="16px",PM=4e3,nne=356,rne=14,ane=20,one=200;function bo(...e){return e.filter(Boolean).join(" ")}function sne(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var ine=e=>{var t,n,r,a,s,i,l,c,u,d,f;let{invert:h,toast:m,unstyled:v,interacting:g,setHeights:y,visibleToasts:x,heights:b,index:w,toasts:N,expanded:S,removeToast:_,defaultRichColors:k,closeButton:P,style:O,cancelButtonStyle:$,actionButtonStyle:T,className:z="",descriptionClassName:U="",duration:E,position:q,gap:W,loadingIcon:L,expandByDefault:M,classNames:B,icons:I,closeButtonAriaLabel:R="Close toast",pauseWhenPageIsHidden:F}=e,[j,C]=H.useState(null),[A,D]=H.useState(null),[V,Y]=H.useState(!1),[G,K]=H.useState(!1),[Z,J]=H.useState(!1),[ce,ue]=H.useState(!1),[be,Ne]=H.useState(!1),[te,re]=H.useState(0),[pe,Ee]=H.useState(0),Fe=H.useRef(m.duration||E||PM),Be=H.useRef(null),st=H.useRef(null),Pt=w===0,kn=w+1<=x,Tt=m.type,an=m.dismissible!==!1,Kr=m.className||"",Tr=m.descriptionClassName||"",me=H.useMemo(()=>b.findIndex(He=>He.toastId===m.id)||0,[b,m.id]),Se=H.useMemo(()=>{var He;return(He=m.closeButton)!=null?He:P},[m.closeButton,P]),it=H.useMemo(()=>m.duration||E||PM,[m.duration,E]),Lt=H.useRef(0),In=H.useRef(0),Or=H.useRef(0),bt=H.useRef(null),[qn,is]=q.split("-"),Vs=H.useMemo(()=>b.reduce((He,mt,Ot)=>Ot>=me?He:He+mt.height,0),[b,me]),Xr=qte(),pc=m.invert||h,Ws=Tt==="loading";In.current=H.useMemo(()=>me*W+Vs,[me,Vs]),H.useEffect(()=>{Fe.current=it},[it]),H.useEffect(()=>{Y(!0)},[]),H.useEffect(()=>{let He=st.current;if(He){let mt=He.getBoundingClientRect().height;return Ee(mt),y(Ot=>[{toastId:m.id,height:mt,position:m.position},...Ot]),()=>y(Ot=>Ot.filter(Mr=>Mr.toastId!==m.id))}},[y,m.id]),H.useLayoutEffect(()=>{if(!V)return;let He=st.current,mt=He.style.height;He.style.height="auto";let Ot=He.getBoundingClientRect().height;He.style.height=mt,Ee(Ot),y(Mr=>Mr.find(gr=>gr.toastId===m.id)?Mr.map(gr=>gr.toastId===m.id?{...gr,height:Ot}:gr):[{toastId:m.id,height:Ot,position:m.position},...Mr])},[V,m.title,m.description,y,m.id]);let Hn=H.useCallback(()=>{K(!0),re(In.current),y(He=>He.filter(mt=>mt.toastId!==m.id)),setTimeout(()=>{_(m)},one)},[m,_,y,In]);H.useEffect(()=>{if(m.promise&&Tt==="loading"||m.duration===1/0||m.type==="loading")return;let He;return S||g||F&&Xr?(()=>{if(Or.current<Lt.current){let mt=new Date().getTime()-Lt.current;Fe.current=Fe.current-mt}
68Or.current=new Date().getTime()})():Fe.current!==1/0&&(Lt.current=new Date().getTime(),He=setTimeout(()=>{var mt;(mt=m.onAutoClose)==null||mt.call(m,m),Hn()},Fe.current)),()=>clearTimeout(He)},[S,g,m,Tt,F,Xr,Hn]),H.useEffect(()=>{m.delete&&Hn()},[Hn,m.delete]);function ma(){var He,mt,Ot;return I!=null&&I.loading?H.createElement("div",{className:bo(B==null?void 0:B.loader,(He=m==null?void 0:m.classNames)==null?void 0:He.loader,"sonner-loader"),"data-visible":Tt==="loading"},I.loading):L?H.createElement("div",{className:bo(B==null?void 0:B.loader,(mt=m==null?void 0:m.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":Tt==="loading"},L):H.createElement(Fte,{className:bo(B==null?void 0:B.loader,(Ot=m==null?void 0:m.classNames)==null?void 0:Ot.loader),visible:Tt==="loading"})}return H.createElement("li",{tabIndex:0,ref:st,className:bo(z,Kr,B==null?void 0:B.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[Tt],(n=m==null?void 0:m.classNames)==null?void 0:n[Tt]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:k,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":V,"data-promise":!!m.promise,"data-swiped":be,"data-removed":G,"data-visible":kn,"data-y-position":qn,"data-x-position":is,"data-index":w,"data-front":Pt,"data-swiping":Z,"data-dismissible":an,"data-type":Tt,"data-invert":pc,"data-swipe-out":ce,"data-swipe-direction":A,"data-expanded":!!(S||M&&V),style:{"--index":w,"--toasts-before":w,"--z-index":N.length-w,"--offset":`${G?te:In.current}px`,"--initial-height":M?"auto":`${pe}px`,...O,...m.style},onDragEnd:()=>{J(!1),C(null),bt.current=null},onPointerDown:He=>{Ws||!an||(Be.current=new Date,re(In.current),He.target.setPointerCapture(He.pointerId),He.target.tagName!=="BUTTON"&&(J(!0),bt.current={x:He.clientX,y:He.clientY}))},onPointerUp:()=>{var He,mt,Ot,Mr;if(ce||!an)return;bt.current=null;let gr=Number(((He=st.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((mt=st.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vo=new Date().getTime()-((Ot=Be.current)==null?void 0:Ot.getTime()),En=j==="x"?gr:Ir,Ba=Math.abs(En)/vo;if(Math.abs(En)>=ane||Ba>.11){re(In.current),(Mr=m.onDismiss)==null||Mr.call(m,m),D(j==="x"?gr>0?"right":"left":Ir>0?"down":"up"),Hn(),ue(!0),Ne(!1);return}J(!1),C(null)},onPointerMove:He=>{var mt,Ot,Mr,gr;if(!bt.current||!an||((mt=window.getSelection())==null?void 0:mt.toString().length)>0)return;let Ir=He.clientY-bt.current.y,vo=He.clientX-bt.current.x,En=(Ot=e.swipeDirections)!=null?Ot:sne(q);!j&&(Math.abs(vo)>1||Math.abs(Ir)>1)&&C(Math.abs(vo)>Math.abs(Ir)?"x":"y");let Ba={x:0,y:0};j==="y"?(En.includes("top")||En.includes("bottom"))&&(En.includes("top")&&Ir<0||En.includes("bottom")&&Ir>0)&&(Ba.y=Ir):j==="x"&&(En.includes("left")||En.includes("right"))&&(En.includes("left")&&vo<0||En.includes("right")&&vo>0)&&(Ba.x=vo),(Math.abs(Ba.x)>0||Math.abs(Ba.y)>0)&&Ne(!0),(Mr=st.current)==null||Mr.style.setProperty("--swipe-amount-x",`${Ba.x}px`),(gr=st.current)==null||gr.style.setProperty("--swipe-amount-y",`${Ba.y}px`)}},Se&&!m.jsx?H.createElement("button",{"aria-label":R,"data-disabled":Ws,"data-close-button":!0,onClick:Ws||!an?()=>{}:()=>{var He;Hn(),(He=m.onDismiss)==null||He.call(m,m)},className:bo(B==null?void 0:B.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(s=I==null?void 0:I.close)!=null?s:Wte):null,m.jsx||p.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:H.createElement(H.Fragment,null,Tt||m.icon||m.promise?H.createElement("div",{"data-icon":"",className:bo(B==null?void 0:B.icon,(i=m==null?void 0:m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ma():null,m.type!=="loading"?m.
68icon||(I==null?void 0:I[Tt])||Rte(Tt):null):null,H.createElement("div",{"data-content":"",className:bo(B==null?void 0:B.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},H.createElement("div",{"data-title":"",className:bo(B==null?void 0:B.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?H.createElement("div",{"data-description":"",className:bo(U,Tr,B==null?void 0:B.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),p.isValidElement(m.cancel)?m.cancel:m.cancel&&Uv(m.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||$,onClick:He=>{var mt,Ot;Uv(m.cancel)&&an&&((Ot=(mt=m.cancel).onClick)==null||Ot.call(mt,He),Hn())},className:bo(B==null?void 0:B.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,p.isValidElement(m.action)?m.action:m.action&&Uv(m.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:He=>{var mt,Ot;Uv(m.action)&&((Ot=(mt=m.action).onClick)==null||Ot.call(mt,He),!He.defaultPrevented&&Hn())},className:bo(B==null?void 0:B.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function TM(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function lne(e,t){let n={};return[e,t].forEach((r,a)=>{let s=a===1,i=s?"--mobile-offset":"--offset",l=s?tne:ene;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=l:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var cne=p.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:s,closeButton:i,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:m,visibleToasts:v=Zte,toastOptions:g,dir:y=TM(),gap:x=rne,loadingIcon:b,icons:w,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:S}=e,[_,k]=H.useState([]),P=H.useMemo(()=>Array.from(new Set([r].concat(_.filter(F=>F.position).map(F=>F.position)))),[_,r]),[O,$]=H.useState([]),[T,z]=H.useState(!1),[U,E]=H.useState(!1),[q,W]=H.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=H.useRef(null),M=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=H.useRef(null),I=H.useRef(!1),R=H.useCallback(F=>{k(j=>{var C;return(C=j.find(A=>A.id===F.id))!=null&&C.delete||Jr.dismiss(F.id),j.filter(({id:A})=>A!==F.id)})},[]);return H.useEffect(()=>Jr.subscribe(F=>{if(F.dismiss){k(j=>j.map(C=>C.id===F.id?{...C,delete:!0}:C));return}setTimeout(()=>{U6.flushSync(()=>{k(j=>{let C=j.findIndex(A=>A.id===F.id);return C!==-1?[...j.slice(0,C),{...j[C],...F},...j.slice(C+1)]:[F,...j]})})})}),[]),H.useEffect(()=>{if(d!=="system"){W(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:j})=>{W(j?"dark":"light")})}catch{F.addListener(({matches:C})=>{try{W(C?"dark":"light")}catch(A){console.error(A)}})}},[d]),H.useEffect(()=>{_.length<=1&&z(!1)},[_]),H.useEffect(()=>{let F=j=>{var C,A;a.every(D=>j[D]||j.code===D)&&(z(!0),(C=L.current)==null||C.focus()),j.code==="Escape"&&(document.activeElement===L.current||(A=L.current)!=null&&A.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[a]),H.useEffect(()=>{if(L.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,I.current=!1)}},[L.current]),H.createElement("section",{ref:t,"aria-label":`${N} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((F,j)=>{var C;let[A,D]=F.split("-");return _.length?H.createElement("ol",{key:F,dir:y==="auto"?TM():y,tabIndex:-1,ref:L,className:l,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":A,"data-lifted":T&&_.length>1&&!s,"data-x-position":D,style:{"--front-toast-height":`${((C=O[0])==null?void 0:C.height)||0}px`,"--width":`${nne}px`,"--gap":`${x}px`,...m,...lne(c,u)},onBlur:V=>{I.current&&!V.currentTarget.contains(V.relatedTarget)&&(I.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||I.current||(I.current=!0,B.current=V.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{U||z(!1)},onDragEnd:()=>z(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},_.filter(V=>!V.position&&j===0||V.position===F).map((V,Y)=>{var G,K;return H.createElement(ine,{key:V.id,icons:w,index:Y,toast:V,defaultRichColors:f,duration:(G=g==null?void 0:g.duration)!=null?G:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(K=g==null?void 0:g.closeButton)!=null?K:i,interacting:U,position:F,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:R,toasts:_.filter(Z=>Z.position==V.position),heights:O.filter(Z=>Z.position==V.position),setHeights:$,expandByDefault:s,gap:x,loadingIcon:b,expanded:T,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const une=({...e})=>{const{theme:t="system"}=ew();return o.jsx(cne,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},dne=1,fne=1e6;let Xj=0;function hne(){return Xj=(Xj+1)%Number.MAX_SAFE_INTEGER,Xj.toString()}const Jj=new Map,OM=e=>{if(Jj.has(e))return;const t=setTimeout(()=>{Jj.delete(e),Gm({type:"REMOVE_TOAST",toastId:e})},fne);Jj.set(e,t)},mne=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,dne)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;
68return n?OM(n):e.toasts.forEach(r=>{OM(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},nx=[];let rx={toasts:[]};function Gm(e){rx=mne(rx,e),nx.forEach(t=>{t(rx)})}function pne({...e}){const t=hne(),n=a=>Gm({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Gm({type:"DISMISS_TOAST",toastId:t});return Gm({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Ag(){const[e,t]=p.useState(rx);return p.useEffect(()=>(nx.push(t),()=>{const n=nx.indexOf(t);n>-1&&nx.splice(n,1)}),[e]),{...e,toast:pne,dismiss:n=>Gm({type:"DISMISS_TOAST",toastId:n})}}function xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function MM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ti(...e){return t=>{let n=!1;const r=e.map(a=>{const s=MM(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<r.length;a++){const s=r[a];typeof s=="function"?s():MM(e[a],null)}}}}function at(...e){return p.useCallback(Ti(...e),e)}function gne(e,t){const n=p.createContext(t),r=s=>{const{children:i,...l}=s,c=p.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function a(s){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,a]}function Gr(e,t=[]){let n=[];function r(s,i){const l=p.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:m,...v}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||l,y=p.useMemo(()=>v,Object.values(v));return o.jsx(g.Provider,{value:y,children:m})};u.displayName=s+"Provider";function d(f,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[c])||l,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const a=()=>{const s=n.map(i=>p.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,vne(a,...t)]}function vne(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const i=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Hl(e){const t=xne(e),n=p.forwardRef((r,a)=>{const{children:s,...i}=r,l=p.Children.toArray(s),c=l.find(bne);if(c){const u=c.props.children,d=l.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:a,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return o.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}var yne=Hl("Slot");function xne(e){const t=p.forwardRef((n,r)=>{const{children:a,...s}=n;if(p.isValidElement(a)){const i=jne(a),l=wne(s,a.props);return a.type!==p.Fragment&&(l.ref=r?Ti(r,i):i),p.cloneElement(a,l)}return p.Children.count(a)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iB=Symbol("radix.slottable");function lB(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=iB,t}function bne(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iB}function wne(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const c=s(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function jne(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pg(e){const t=e+"CollectionProvider",[n,r]=Gr(t),[a,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:x}=g,b=H.useRef(null),w=H.useRef(new Map).current;return o.jsx(a,{scope:y,itemMap:w,collectionRef:b,children:x})};i.displayName=t;const l=e+"CollectionSlot",c=Hl(l),u=H.forwardRef((g,y)=>{const{scope:x,children:b}=g,w=s(l,x),N=at(y,w.collectionRef);return o.jsx(c,{ref:N,children:b})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Hl(d),m=H.forwardRef((g,y)=>{const{scope:x,children:b,...w}=g,N=H.useRef(null),S=at(y,N),_=s(d,x);return H.useEffect(()=>(_.itemMap.set(N,{ref:N,...w}),()=>
vendor: 9,205 bytes, line 68
68void _.itemMap.delete(N))),o.jsx(h,{[f]:"",ref:S,children:b})});m.displayName=d;function v(g){const y=s(e+"CollectionConsumer",g);return H.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((_,k)=>w.indexOf(_.ref.current)-w.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:m},v,r]}var Sne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=Sne.reduce((e,t)=>{const n=Hl(`Primitive.${t}`),r=p.forwardRef((a,s)=>{const{asChild:i,...l}=a,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function D2(e,t){e&&Ou.flushSync(()=>e.dispatchEvent(t))}function ca(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Nne(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e);p.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _ne="DismissableLayer",U_="dismissableLayer.update",Cne="dismissableLayer.pointerDownOutside",kne="dismissableLayer.focusOutside",IM,cB=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mu=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,u=p.useContext(cB),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),v=at(t,k=>f(k)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,N=b>=x,S=Ane(k=>{const P=k.target,O=[...u.branches].some($=>$.contains(P));!N||O||(a==null||a(k),i==null||i(k),k.defaultPrevented||l==null||l())},h),_=Pne(k=>{const P=k.target;[...u.branches].some($=>$.contains(P))||(s==null||s(k),i==null||i(k),k.defaultPrevented||l==null||l())},h);return Nne(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(IM=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),$M(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=IM)}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),$M())},[d,u]),p.useEffect(()=>{const k=()=>m({});return document.addEventListener(U_,k),()=>document.removeEventListener(U_,k)},[]),o.jsx(Ie.div,{...c,ref:v,style:{pointerEvents:w?N?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,S.onPointerDownCapture)})});Mu.displayName=_ne;var Ene="DismissableLayerBranch",uB=p.forwardRef((e,t)=>{const n=p.useContext(cB),r=p.useRef(null),a=at(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),o.jsx(Ie.div,{...e,ref:a})});uB.displayName=Ene;function Ane(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),r=p.useRef(!1),a=p.useRef(()=>{});return p.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){dB(Cne,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Pne(e,t=globalThis==null?void 0:globalThis.document){const n=ca(e),r=p.useRef(!1);return p.useEffect(()=>{const a=s=>{s.target&&!r.current&&dB(kne,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $M(){const e=new CustomEvent(U_);document.dispatchEvent(e)}function dB(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?D2(a,s):a.dispatchEvent(s)}var Tne=Mu,One=uB,er=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Mne="Portal",dh=p.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,s]=p.useState(!1);er(()=>s(!0),[]);const i=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?U6.createPortal(o.jsx(Ie.div,{...r,ref:t}),i):null});dh.displayName=Mne;function Ine(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var da=e=>{const{present:t,children:n}=e,r=$ne(t),a=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=at(r.ref,Dne(a));return typeof n=="function"||r.isPresent?p.cloneElement(a,{ref:s}):null};da.displayName="Presence";function $ne(e){const[t,n]=p.useState(),r=p.useRef(null),a=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[l,c]=Ine(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Vv(r.current);s.current=l==="mounted"?u:"none"},[l]),er(()=>{const u=r.current,d=a.current;if(d!==e){const h=s.current,m=Vv(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),er(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const g=Vv(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=m=>{m.target===t&&(s.current=Vv(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Vv(e){return(e==null?void 0:e.animationName)||"none"}function Dne(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rne=M0[" useInsertionEffect ".trim().toString()]||er;function lo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,s,i]=Lne({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=p.useCallback(d=>{var f;if(l){const h=Fne(d)?d(e):d;h!==e&&((f=i.current)==null||f.call(i,h))}else s(d)},[l,e,s,i]);return[c,u]}function Lne({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),a=p.useRef(n),s=p.useRef(t);return Rne(()=>{s.current=t},[t]),p.useEffect(()=>{var i;a.current!==n&&((i=s.current)==null||i.call(s,n),a.current=n)},[n,a]),[n,r,s]}function Fne(e){return typeof e=="function"}var Bne=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"}),zne="VisuallyHidden",R2=p.forwardRef((e,t)=>o.jsx(Ie.span,{...e,ref:t,style:{...Bne,...e.style}}));R2.displayName=zne;var L2="ToastProvider",[F2,Une,Vne]=Pg("Toast"),[fB,Mqe]=Gr("Toast",[Vne]),[Wne,tw]=fB(L2),hB=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:i}=e,[l,c]=p.useState(null),[u,d]=p.useState(0),f=p.useRef(!1),h=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${L2}\`. Expected non-empty \`string\`.`),o.jsx(F2.Provider,{scope:t,children:o.jsx(Wne,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:s,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:p.useCallback(()=>d(m=>m+1),[]),onToastRemove:p.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:i})})};hB.displayName=L2;var mB="ToastViewport",qne=["F8"],V_="toast.viewportPause",W_="toast.viewportResume",pB=p.forwardRef((e,t)=>
68{const{__scopeToast:n,hotkey:r=qne,label:a="Notifications ({hotkey})",...s}=e,i=tw(mB,n),l=Une(n),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),f=p.useRef(null),h=at(t,f,i.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;p.useEffect(()=>{const y=x=>{var w;r.length!==0&&r.every(N=>x[N]||x.code===N)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),p.useEffect(()=>{const y=c.current,x=f.current;if(v&&y&&x){const b=()=>{if(!i.isClosePausedRef.current){const _=new CustomEvent(V_);x.dispatchEvent(_),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const _=new CustomEvent(W_);x.dispatchEvent(_),i.isClosePausedRef.current=!1}},N=_=>{!y.contains(_.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",b),y.addEventListener("focusout",N),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",N),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[v,i.isClosePausedRef]);const g=p.useCallback(({tabbingDirection:y})=>{const b=l().map(w=>{const N=w.ref.current,S=[N,...are(N)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?b.reverse():b).flat()},[l]);return p.useEffect(()=>{const y=f.current;if(y){const x=b=>{var S,_,k;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const P=document.activeElement,O=b.shiftKey;if(b.target===y&&O){(S=u.current)==null||S.focus();return}const z=g({tabbingDirection:O?"backwards":"forwards"}),U=z.findIndex(E=>E===P);Qj(z.slice(U+1))?b.preventDefault():O?(_=u.current)==null||_.focus():(k=d.current)==null||k.focus()}};return y.addEventListener("keydown",x),()=>y.removeEventListener("keydown",x)}},[l,g]),o.jsxs(One,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&o.jsx(q_,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});Qj(y)}}),o.jsx(F2.Slot,{scope:n,children:o.jsx(Ie.ol,{tabIndex:-1,...s,ref:h})}),v&&o.jsx(q_,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});Qj(y)}})]})});pB.displayName=mB;var gB="ToastFocusProxy",q_=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,s=tw(gB,n);return o.jsx(R2,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(l))&&r()}})});q_.displayName=gB;var Tg="Toast",Hne="toast.swipeStart",Gne="toast.swipeMove",Yne="toast.swipeCancel",Kne="toast.swipeEnd",vB=p.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:s,...i}=e,[l,c]=lo({prop:r,defaultProp:a??!0,onChange:s,caller:Tg});return o.jsx(da,{present:n||l,children:o.jsx(Qne,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:ca(e.onPause),onResume:ca(e.onResume),onSwipeStart:xe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:xe(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:xe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:xe(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});vB.displayName=Tg;var[Xne,Jne]=fB(Tg,{onClose(){}}),Qne=p.forwardRef((e,t)=>
68{const{__scopeToast:n,type:r="foreground",duration:a,open:s,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...v}=e,g=tw(Tg,n),[y,x]=p.useState(null),b=at(t,E=>x(E)),w=p.useRef(null),N=p.useRef(null),S=a||g.duration,_=p.useRef(0),k=p.useRef(S),P=p.useRef(0),{onToastAdd:O,onToastRemove:$}=g,T=ca(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=g.viewport)==null||q.focus()),i()}),z=p.useCallback(E=>{!E||E===1/0||(window.clearTimeout(P.current),_.current=new Date().getTime(),P.current=window.setTimeout(T,E))},[T]);p.useEffect(()=>{const E=g.viewport;if(E){const q=()=>{z(k.current),u==null||u()},W=()=>{const L=new Date().getTime()-_.current;k.current=k.current-L,window.clearTimeout(P.current),c==null||c()};return E.addEventListener(V_,W),E.addEventListener(W_,q),()=>{E.removeEventListener(V_,W),E.removeEventListener(W_,q)}}},[g.viewport,S,c,u,z]),p.useEffect(()=>{s&&!g.isClosePausedRef.current&&z(S)},[s,S,g.isClosePausedRef,z]),p.useEffect(()=>(O(),()=>$()),[O,$]);const U=p.useMemo(()=>y?NB(y):null,[y]);return g.viewport?o.jsxs(o.Fragment,{children:[U&&o.jsx(Zne,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),o.jsx(Xne,{scope:n,onClose:T,children:Ou.createPortal(o.jsx(F2.ItemSlot,{scope:n,children:o.jsx(Tne,{asChild:!0,onEscapeKeyDown:xe(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||T(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Ie.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:xe(e.onKeyDown,E=>{E.key==="Escape"&&(l==null||l(E.nativeEvent),E.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,T()))}),onPointerDown:xe(e.onPointerDown,E=>{E.button===0&&(w.current={x:E.clientX,y:E.clientY})}),onPointerMove:xe(e.onPointerMove,E=>{if(!w.current)return;const q=E.clientX-w.current.x,W=E.clientY-w.current.y,L=!!N.current,M=["left","right"].includes(g.swipeDirection),B=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,I=M?B(0,q):0,R=M?0:B(0,W),F=E.pointerType==="touch"?10:2,j={x:I,y:R},C={originalEvent:E,delta:j};L?(N.current=j,Wv(Gne,f,C,{discrete:!1})):DM(j,g.swipeDirection,F)?(N.current=j,Wv(Hne,d,C,{discrete:!1}),E.target.setPointerCapture(E.pointerId)):(Math.abs(q)>F||Math.abs(W)>F)&&(w.current=null)}),onPointerUp:xe(e.onPointerUp,E=>{const q=N.current,W=E.target;if(W.hasPointerCapture(E.pointerId)&&W.releasePointerCapture(E.pointerId),N.current=null,w.current=null,q){const L=E.currentTarget,M={originalEvent:E,delta:q};DM(q,g.swipeDirection,g.swipeThreshold)?Wv(Kne,m,M,{discrete:!0}):Wv(Yne,h,M,{discrete:!0}),L.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}
68),Zne=e=>{const{__scopeToast:t,children:n,...r}=e,a=tw(Tg,t),[s,i]=p.useState(!1),[l,c]=p.useState(!1);return nre(()=>i(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:o.jsx(dh,{asChild:!0,children:o.jsx(R2,{...r,children:s&&o.jsxs(o.Fragment,{children:[a.label," ",n]})})})},ere="ToastTitle",yB=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Ie.div,{...r,ref:t})});yB.displayName=ere;var tre="ToastDescription",xB=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Ie.div,{...r,ref:t})});xB.displayName=tre;var bB="ToastAction",wB=p.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?o.jsx(SB,{altText:n,asChild:!0,children:o.jsx(B2,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${bB}\`. Expected non-empty \`string\`.`),null)});wB.displayName=bB;var jB="ToastClose",B2=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=Jne(jB,n);return o.jsx(SB,{asChild:!0,children:o.jsx(Ie.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,a.onClose)})})});B2.displayName=jB;var SB=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return o.jsx(Ie.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function NB(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),rre(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...NB(r))}}),t}function Wv(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?D2(a,s):a.dispatchEvent(s)}var DM=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),s=r>a;return t==="left"||t==="right"?s&&r>n:!s&&a>n};function nre(e=()=>{}){const t=ca(e);er(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function rre(e){return e.nodeType===e.ELEMENT_NODE}function are(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qj(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var ore=hB,_B=pB,CB=vB,kB=yB,EB=xB,AB=wB,PB=B2;function TB(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=TB(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=TB(e))&&(r&&(r+=" "),r+=t);return r}const RM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,LM=yt,nw=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return LM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const h=RM(d)||RM(f);return a[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...m}=d;return Object.entries(m).every(v=>{let[g,y]=v;return Array.isArray(y)?y.includes({...s,...l}[g]):{...s,...l}[g]===y})?[...u,f,h]:u},[]);return LM(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
69 * @license lucide-react v0.462.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const sre=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OB=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
74 * @license lucide-react v0.462.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */var ire={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"};/**
79 * @license lucide-react v0.462.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const lre=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:i,...l},c)=>p.createElement("svg",{ref:c,...ire,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OB("lucide",a),...l},[...i.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
84 * @license lucide-react v0.462.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const oe=(e,t)=>{const n=p.forwardRef(({className:r,...a},s)=>p.createElement(lre,{ref:s,iconNode:t,className:OB(`lucide-${sre(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
89 * @license lucide-react v0.462.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const cre=oe("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
93-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
94 * @license lucide-react v0.462.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const MB=oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
99 * @license lucide-react v0.462.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const z2=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
104 * @license lucide-react v0.462.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const Wi=oe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
109 * @license lucide-react v0.462.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const IB=oe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const $B=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const U2=oe("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const ure=oe("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const Zx=oe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const rw=oe("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"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const zn=oe("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"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const dre=oe("BrainCircuit",[["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:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["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:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}
148],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const V2=oe("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const fre=oe("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"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const hre=oe("CalendarCheck",[["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:"m9 16 2 2 4-4",key:"19s6y9"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const mre=oe("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"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const pre=oe("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"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const W2=oe("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"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const DB=oe("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const cu=oe("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"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const gre=oe("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const Ta=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const Iu=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const RB=oe("ChevronFirst",[["path",{d:"m17 18-6-6 6-6",key:"1yerx2"}],["path",{d:"M7 6v12",key:"1p53r6"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const LB=oe("ChevronLast",[["path",{d:"m7 18 6-6-6-6",key:"lwmzdw"}],["path",{d:"M17 6v12",key:"1o0aio"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const fh=oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const zo=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const vre=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const FB=oe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const tr=oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const As=oe("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const Og=oe("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"}]]);/**
249 * @license lucide-react v0.462.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const BB=oe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
254 * @license lucide-react v0.462.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const zB=oe("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
259 * @license lucide-react v0.462.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const UB=oe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
264 * @license lucide-react v0.462.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const yre=oe("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
269 * @license lucide-react v0.462.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const aw=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
274 * @license lucide-react v0.462.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const ow=oe("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"}]]);/**
279 * @license lucide-react v0.462.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const uu=oe("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"}]]);/**
284 * @license lucide-react v0.462.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const xre=oe("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"}]]);/**
289 * @license lucide-react v0.462.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const bre=oe("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/**
294 * @license lucide-react v0.462.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const q2=oe("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"}]]);/**
299 * @license lucide-react v0.462.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const wre=oe("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"}]]);/**
304 * @license lucide-react v0.462.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const jre=oe("Ear",[["path",{d:"M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0",key:"1dfaln"}],["path",{d:"M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4",key:"1qnva7"}]]);/**
309 * @license lucide-react v0.462.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const VB=oe("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"}]]);/**
314 * @license lucide-react v0.462.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const sw=oe("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"}]]);/**
319 * @license lucide-react v0.462.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const Ls=oe("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"}]]);/**
324 * @license lucide-react v0.462.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const rc=oe("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"}]]);/**
329 * @license lucide-react v0.462.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const qi=oe("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"}]]);/**
334 * @license lucide-react v0.462.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const WB=oe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
339 * @license lucide-react v0.462.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const qB=oe("Gavel",[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]]);/**
344 * @license lucide-react v0.462.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const HB=oe("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
349 * @license lucide-react v0.462.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const Sre=oe("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"}]]);/**
354 * @license lucide-react v0.462.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const GB=oe("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"}]]);/**
359 * @license lucide-react v0.462.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const YB=oe("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
364 * @license lucide-react v0.462.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const KB=oe("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/**
369 * @license lucide-react v0.462.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const XB=oe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
374 * @license lucide-react v0.462.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const JB=oe("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/**
379 * @license lucide-react v0.462.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const QB=oe("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
384 * @license lucide-react v0.462.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const ZB=oe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
389 * @license lucide-react v0.462.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const e8=oe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
394 * @license lucide-react v0.462.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const Nre=oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
399 * @license lucide-react v0.462.0 - ISC
400 *
401 * This source code is licensed under the ISC license.
402 * See the LICENSE file in the root directory of this source tree.
403 */const _re=oe("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"}]]);/**
404 * @license lucide-react v0.462.0 - ISC
405 *
406 * This source code is licensed under the ISC license.
407 * See the LICENSE file in the root directory of this source tree.
408 */const t8=oe("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/**
409 * @license lucide-react v0.462.0 - ISC
410 *
411 * This source code is licensed under the ISC license.
412 * See the LICENSE file in the root directory of this source tree.
413 */const iw=oe("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
414 * @license lucide-react v0.462.0 - ISC
415 *
416 * This source code is licensed under the ISC license.
417 * See the LICENSE file in the root directory of this source tree.
418 */const H2=oe("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"}]]);/**
419 * @license lucide-react v0.462.0 - ISC
420 *
421 * This source code is licensed under the ISC license.
422 * See the LICENSE file in the root directory of this source tree.
423 */const n8=oe("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
424 * @license lucide-react v0.462.0 - ISC
425 *
426 * This source code is licensed under the ISC license.
427 * See the LICENSE file in the root directory of this source tree.
428 */const Cre=oe("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
429 * @license lucide-react v0.462.0 - ISC
430 *
431 * This source code is licensed under the ISC license.
432 * See the LICENSE file in the root directory of this source tree.
433 */const G2=oe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
434 * @license lucide-react v0.462.0 - ISC
435 *
436 * This source code is licensed under the ISC license.
437 * See the LICENSE file in the root directory of this source tree.
438 */const Te=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
439 * @license lucide-react v0.462.0 - ISC
440 *
441 * This source code is licensed under the ISC license.
442 * See the LICENSE file in the root directory of this source tree.
443 */const r8=oe("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"}]]);/**
444 * @license lucide-react v0.462.0 - ISC
445 *
446 * This source code is licensed under the ISC license.
447 * See the LICENSE file in the root directory of this source tree.
448 */const Y2=oe("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"}]]);/**
449 * @license lucide-react v0.462.0 - ISC
450 *
451 * This source code is licensed under the ISC license.
452 * See the LICENSE file in the root directory of this source tree.
453 */const kre=oe("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);/**
454 * @license lucide-react v0.462.0 - ISC
455 *
456 * This source code is licensed under the ISC license.
457 * See the LICENSE file in the root directory of this source tree.
458 */const hh=oe("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"}]]);/**
459 * @license lucide-react v0.462.0 - ISC
460 *
461 * This source code is licensed under the ISC license.
462 * See the LICENSE file in the root directory of this source tree.
463 */const Ere=oe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
464 * @license lucide-react v0.462.0 - ISC
465 *
466 * This source code is licensed under the ISC license.
467 * See the LICENSE file in the root directory of this source tree.
468 */const a8=oe("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"}]]);/**
469 * @license lucide-react v0.462.0 - ISC
470 *
471 * This source code is licensed under the ISC license.
472 * See the LICENSE file in the root directory of this source tree.
473 */const o8=oe("MessageSquareText",[["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"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
474 * @license lucide-react v0.462.0 - ISC
475 *
476 * This source code is licensed under the ISC license.
477 * See the LICENSE file in the root directory of this source tree.
478 */const K2=oe("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"}]]);/**
479 * @license lucide-react v0.462.0 - ISC
480 *
481 * This source code is licensed under the ISC license.
482 * See the LICENSE file in the root directory of this source tree.
483 */const Are=oe("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
484 * @license lucide-react v0.462.0 - ISC
485 *
486 * This source code is licensed under the ISC license.
487 * See the LICENSE file in the root directory of this source tree.
488 */const Pre=oe("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
489 * @license lucide-react v0.462.0 - ISC
490 *
491 * This source code is licensed under the ISC license.
492 * See the LICENSE file in the root directory of this source tree.
493 */const Oi=oe("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"}]]);/**
494 * @license lucide-react v0.462.0 - ISC
495 *
496 * This source code is licensed under the ISC license.
497 * See the LICENSE file in the root directory of this source tree.
498 */const s8=oe("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/**
499 * @license lucide-react v0.462.0 - ISC
500 *
501 * This source code is licensed under the ISC license.
502 * See the LICENSE file in the root directory of this source tree.
503 */const Tre=oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
504 * @license lucide-react v0.462.0 - ISC
505 *
506 * This source code is licensed under the ISC license.
507 * See the LICENSE file in the root directory of this source tree.
508 */const Ore=oe("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
509 * @license lucide-react v0.462.0 - ISC
510 *
511 * This source code is licensed under the ISC license.
512 * See the LICENSE file in the root directory of this source tree.
513 */const Mg=oe("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"}]]);/**
514 * @license lucide-react v0.462.0 - ISC
515 *
516 * This source code is licensed under the ISC license.
517 * See the LICENSE file in the root directory of this source tree.
518 */const lw=oe("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"}]]);/**
519 * @license lucide-react v0.462.0 - ISC
520 *
521 * This source code is licensed under the ISC license.
522 * See the LICENSE file in the root directory of this source tree.
523 */const wf=oe("PhoneCall",[["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"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
524 * @license lucide-react v0.462.0 - ISC
525 *
526 * This source code is licensed under the ISC license.
527 * See the LICENSE file in the root directory of this source tree.
528 */const cw=oe("PhoneForwarded",[["polyline",{points:"18 2 22 6 18 10",key:"6vjanh"}],["line",{x1:"14",x2:"22",y1:"6",y2:"6",key:"1jsywh"}],["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"}]]);/**
529 * @license lucide-react v0.462.0 - ISC
530 *
531 * This source code is licensed under the ISC license.
532 * See the LICENSE file in the root directory of this source tree.
533 */const ta=oe("PhoneIncoming",[["polyline",{points:"16 2 16 8 22 8",key:"1ygljm"}],["line",{x1:"22",x2:"16",y1:"2",y2:"8",key:"1xzwqn"}],["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"}]]);/**
534 * @license lucide-react v0.462.0 - ISC
535 *
536 * This source code is licensed under the ISC license.
537 * See the LICENSE file in the root directory of this source tree.
538 */const i8=oe("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m
538-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 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.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/**
539 * @license lucide-react v0.462.0 - ISC
540 *
541 * This source code is licensed under the ISC license.
542 * See the LICENSE file in the root directory of this source tree.
543 */const Wo=oe("PhoneOutgoing",[["polyline",{points:"22 8 22 2 16 2",key:"1g204g"}],["line",{x1:"16",x2:"22",y1:"8",y2:"2",key:"1ggias"}],["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"}]]);/**
544 * @license lucide-react v0.462.0 - ISC
545 *
546 * This source code is licensed under the ISC license.
547 * See the LICENSE file in the root directory of this source tree.
548 */const Un=oe("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"}]]);/**
549 * @license lucide-react v0.462.0 - ISC
550 *
551 * This source code is licensed under the ISC license.
552 * See the LICENSE file in the root directory of this source tree.
553 */const l8=oe("Plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);/**
554 * @license lucide-react v0.462.0 - ISC
555 *
556 * This source code is licensed under the ISC license.
557 * See the LICENSE file in the root directory of this source tree.
558 */const Gl=oe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
559 * @license lucide-react v0.462.0 - ISC
560 *
561 * This source code is licensed under the ISC license.
562 * See the LICENSE file in the root directory of this source tree.
563 */const Mre=oe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
564 * @license lucide-react v0.462.0 - ISC
565 *
566 * This source code is licensed under the ISC license.
567 * See the LICENSE file in the root directory of this source tree.
568 */const nn=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
569 * @license lucide-react v0.462.0 - ISC
570 *
571 * This source code is licensed under the ISC license.
572 * See the LICENSE file in the root directory of this source tree.
573 */const Ire=oe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
574 * @license lucide-react v0.462.0 - ISC
575 *
576 * This source code is licensed under the ISC license.
577 * See the LICENSE file in the root directory of this source tree.
578 */const c8=oe("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
579 * @license lucide-react v0.462.0 - ISC
580 *
581 * This source code is licensed under the ISC license.
582 * See the LICENSE file in the root directory of this source tree.
583 */const $u=oe("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"}]]);/**
584 * @license lucide-react v0.462.0 - ISC
585 *
586 * This source code is licensed under the ISC license.
587 * See the LICENSE file in the root directory of this source tree.
588 */const u8=oe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
589 * @license lucide-react v0.462.0 - ISC
590 *
591 * This source code is licensed under the ISC license.
592 * See the LICENSE file in the root directory of this source tree.
593 */const Np=oe("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:"m3
593kijz"}],["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"}]]);/**
594 * @license lucide-react v0.462.0 - ISC
595 *
596 * This source code is licensed under the ISC license.
597 * See the LICENSE file in the root directory of this source tree.
598 */const X2=oe("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"}]]);/**
599 * @license lucide-react v0.462.0 - ISC
600 *
601 * This source code is licensed under the ISC license.
602 * See the LICENSE file in the root directory of this source tree.
603 */const du=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
604 * @license lucide-react v0.462.0 - ISC
605 *
606 * This source code is licensed under the ISC license.
607 * See the LICENSE file in the root directory of this source tree.
608 */const Ps=oe("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"}]]);/**
609 * @license lucide-react v0.462.0 - ISC
610 *
611 * This source code is licensed under the ISC license.
612 * See the LICENSE file in the root directory of this source tree.
613 */const d8=oe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
614 * @license lucide-react v0.462.0 - ISC
615 *
616 * This source code is licensed under the ISC license.
617 * See the LICENSE file in the root directory of this source tree.
618 */const FM=oe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
619 * @license lucide-react v0.462.0 - ISC
620 *
621 * This source code is licensed under the ISC license.
622 * See the LICENSE file in the root directory of this source tree.
623 */const ac=oe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
624 * @license lucide-react v0.462.0 - ISC
625 *
626 * This source code is licensed under the ISC license.
627 * See the LICENSE file in the root directory of this source tree.
628 */const J2=oe("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"}]]);/**
629 * @license lucide-react v0.462.0 - ISC
630 *
631 * This source code is licensed under the ISC license.
632 * See the LICENSE file in the root directory of this source tree.
633 */const f8=oe("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
634 * @license lucide-react v0.462.0 - ISC
635 *
636 * This source code is licensed under the ISC license.
637 * See the LICENSE file in the root directory of this source tree.
638 */const $re=oe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
639 * @license lucide-react v0.462.0 - ISC
640 *
641 * This source code is licensed under the ISC license.
642 * See the LICENSE file in the root directory of this source tree.
643 */const Mi=oe("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"}]]);/**
644 * @license lucide-react v0.462.0 - ISC
645 *
646 * This source code is licensed under the ISC license.
647 * See the LICENSE file in the root directory of this source tree.
648 */const Dre=oe("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/**
649 * @license lucide-react v0.462.0 - ISC
650 *
651 * This source code is licensed under the ISC license.
652 * See the LICENSE file in the root directory of this source tree.
653 */const h8=oe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
654 * @license lucide-react v0.462.0 - ISC
655 *
656 * This source code is licensed under the ISC license.
657 * See the LICENSE file in the root directory of this source tree.
658 */const Rre=oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
659 * @license lucide-react v0.462.0 - ISC
660 *
661 * This source code is licensed under the ISC license.
662 * See the LICENSE file in the root directory of this source tree.
663 */const Lre=oe("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"}]]);/**
664 * @license lucide-react v0.462.0 - ISC
665 *
666 * This source code is licensed under the ISC license.
667 * See the LICENSE file in the root directory of this source tree.
668 */const Fre=oe("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/**
669 * @license lucide-react v0.462.0 - ISC
670 *
671 * This source code is licensed under the ISC license.
672 * See the LICENSE file in the root directory of this source tree.
673 */const Bre=oe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
674 * @license lucide-react v0.462.0 - ISC
675 *
676 * This source code is licensed under the ISC license.
677 * See the LICENSE file in the root directory of this source tree.
678 */const zre=oe("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
679 * @license lucide-react v0.462.0 - ISC
680 *
681 * This source code is licensed under the ISC license.
682 * See the LICENSE file in the root directory of this source tree.
683 */const Ure=oe("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/**
684 * @license lucide-react v0.462.0 - ISC
685 *
686 * This source code is licensed under the ISC license.
687 * See the LICENSE file in the root directory of this source tree.
688 */const Oa=oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
689 * @license lucide-react v0.462.0 - ISC
690 *
691 * This source code is licensed under the ISC license.
692 * See the LICENSE file in the root directory of this source tree.
693 */const Vre=oe("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"}]]);/**
694 * @license lucide-react v0.462.0 - ISC
695 *
696 * This source code is licensed under the ISC license.
697 * See the LICENSE file in the root directory of this source tree.
698 */const co=oe("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"}]]);/**
699 * @license lucide-react v0.462.0 - ISC
700 *
701 * This source code is licensed under the ISC license.
702 * See the LICENSE file in the root directory of this source tree.
703 */const H_=oe("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"}]]);/**
704 * @license lucide-react v0.462.0 - ISC
705 *
706 * This source code is licensed under the ISC license.
707 * See the LICENSE file in the root directory of this source tree.
708 */const Wre=oe("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
709 * @license lucide-react v0.462.0 - ISC
710 *
711 * This source code is licensed under the ISC license.
712 * See the LICENSE file in the root directory of this source tree.
713 */const Q2=oe("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"}]]);/**
714 * @license lucide-react v0.462.0 - ISC
715 *
716 * This source code is licensed under the ISC license.
717 * See the LICENSE file in the root directory of this source tree.
718 */const uw=oe("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"}]]);/**
719 * @license lucide-react v0.462.0 - ISC
720 *
721 * This source code is licensed under the ISC license.
722 * See the LICENSE file in the root directory of this source tree.
723 */const eb=oe("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"}]]);/**
724 * @license lucide-react v0.462.0 - ISC
725 *
726 * This source code is licensed under the ISC license.
727 * See the LICENSE file in the root directory of this source tree.
728 */const qre=oe("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
729 * @license lucide-react v0.462.0 - ISC
730 *
731 * This source code is licensed under the ISC license.
732 * See the LICENSE file in the root directory of this source tree.
733 */const Fs=oe("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"}]]);/**
734 * @license lucide-react v0.462.0 - ISC
735 *
736 * This source code is licensed under the ISC license.
737 * See the LICENSE file in the root directory of this source tree.
738 */const oc=oe("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
739 * @license lucide-react v0.462.0 - ISC
740 *
741 * This source code is licensed under the ISC license.
742 * See the LICENSE file in the root directory of this source tree.
743 */const Z2=oe("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
744 * @license lucide-react v0.462.0 - ISC
745 *
746 * This source code is licensed under the ISC license.
747 * See the LICENSE file in the root directory of this source tree.
748 */const m8=oe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}
vendor: 9,072 bytes, lines 748-768
748],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
749 * @license lucide-react v0.462.0 - ISC
750 *
751 * This source code is licensed under the ISC license.
752 * See the LICENSE file in the root directory of this source tree.
753 */const Ig=oe("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
754 * @license lucide-react v0.462.0 - ISC
755 *
756 * This source code is licensed under the ISC license.
757 * See the LICENSE file in the root directory of this source tree.
758 */const Hre=oe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
759 * @license lucide-react v0.462.0 - ISC
760 *
761 * This source code is licensed under the ISC license.
762 * See the LICENSE file in the root directory of this source tree.
763 */const rn=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
764 * @license lucide-react v0.462.0 - ISC
765 *
766 * This source code is licensed under the ISC license.
767 * See the LICENSE file in the root directory of this source tree.
768 */const $g=oe("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"}]]),eA="-",Gre=e=>{const t=Kre(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(eA);return l[0]===""&&l.length!==1&&l.shift(),p8(l,t)||Yre(i)},getConflictingClassGroupIds:(i,l)=>{const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}}},p8=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?p8(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(eA);return(i=t.validators.find(({validator:l})=>l(s)))==null?void 0:i.classGroupId},BM=/^\[(.+)\]$/,Yre=e=>{if(BM.test(e)){const t=BM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Kre=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Jre(Object.entries(e.classGroups),n).forEach(([s,i])=>{G_(i,r,s,t)}),r},G_=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:zM(t,a);s.classGroupId=n;return}if(typeof a=="function"){if(Xre(a)){G_(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([s,i])=>{G_(i,zM(t,s),n,r)})})},zM=(e,t)=>{let n=e;return t.split(eA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Xre=e=>e.isThemeGetter,Jre=(e,t)=>t?e.map(([n,r])=>{const a=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[t+i,l])):s);return[n,a]}):e,Qre=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return a(s,i),i},set(s,i){n.has(s)?n.set(s,i):a(s,i)}}},g8="!",Zre=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],s=t.length,i=l=>{const c=[];let u=0,d=0,f;for(let y=0;y<l.length;y++){let x=l[y];if(u===0){if(x===a&&(r||l.slice(y,y+s)===t)){c.push(l.slice(d,y)),d=y+s;continue}if(x==="/"){f=y;continue}}x==="["?u++:x==="]"&&u--}const h=c.length===0?l:l.substring(d),m=h.startsWith(g8),v=m?h.substring(1):h,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:i}):i},eae=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},tae=e=>({cache:Qre(e.cacheSize),parseClassName:Zre(e),...Gre(e)}),nae=/\s+/,rae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,s=[],i=e.trim().split(nae);let l="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(u);let v=!!m,g=r(v?h.substring(0,m):h);if(!g){if(!v){l=u+(l.length>0?" "+l:l);continue}if(g=r(h),!g){l=u+(l.length>0?" "+l:l);continue}v=!1}const y=eae(d).join(":"),x=f?y+g8:y,b=x+g;if(s.includes(b))continue;s.push(b);const w=a(g,v);for(let N=0;N<w.length;++N){const S=w[N];s.push(x+S)}l=u+(l.length>0?" "+l:l)}return l};function aae(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=v8(t))&&(r&&(r+=" "),r+=n);return r}const v8=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v8(e[r]))&&(n&&(n+=" "),n+=t);return n};function oae(e,...t){let n,r,a,s=i;function i(c){const u=t.reduce((d,f)=>f(d),e());return n=tae(u),r=n.cache.get,a=n.cache.set,s=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=rae(c,n);return a(c,d),d}return function(){return s(aae.apply(null,arguments))}}const Jt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},y8=/^\[(?:([a-z-]+):)?(.+)\]$/i,sae=/^\d+\/\d+$/,iae=new Set(["px","full","screen"]),lae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cae=/\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$/,uae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Js=e=>qd(e)||iae.has(e)||sae.test(e),Zi=e=>mh(e,"length",bae),qd=e=>!!e&&!Number.isNaN(Number(e)),Zj=e=>mh(e,"number",qd),Gh=e=>!!e&&Number.isInteger(Number(e)),hae=e=>e.endsWith("%")&&qd(e.slice(0,-1)),tt=e=>y8.test(e),el=e=>lae.test(e),mae=new Set(["length","size","percentage"]),pae=e=>mh(e,mae,x8),gae=e=>mh(e,"position",x8),vae=new Set(["image","url"]),yae=e=>mh(e,vae,jae),xae=e=>mh(e,"",wae),Yh=()=>!0,mh=(e,t,n)=>{const r=y8.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},bae=e=>cae.test(e)&&!uae.test(e),x8=()=>!1,wae=e=>dae.test(e),jae=e=>fae.test(e),Sae=()=>{const e=Jt("colors"),t=Jt("spacing"),n=Jt("blur"),r=Jt("brightness"),a=Jt("borderColor"),s=Jt("borderRadius"),i=Jt("borderSpacing"),l=Jt("borderWidth"),c=Jt("contrast"),u=Jt("grayscale"),d=Jt("hueRotate"),f=Jt("invert"),h=Jt("gap"),m=Jt("gradientColorStops"),v=Jt("gradientColorStopPositions"),g=Jt("inset"),y=Jt("margin"),x=Jt("opacity"),b=Jt("padding"),w=Jt("saturate"),N=Jt("scale"),S=Jt("sepia"),_=Jt("skew"),k=Jt("space"),P=Jt("translate"),O=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",tt,t],z=()=>[tt,t],U=()=>["",Js,Zi],E=()=>["auto",qd,tt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",tt],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>[qd,tt];return{cacheSize:500,separator:":",theme:{colors:[Yh],spacing:[Js,Zi],blur:["none","",el,tt],brightness:R(),borderColor:[e],borderRadius:["none","","full",el,tt],borderSpacing:z(),borderWidth:U(),contrast:R(),grayscale:B(),hueRotate:R(),invert:B(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[hae,Zi],inset:T(),margin:T(),opacity:R(),padding:z(),saturate:R(),scale:R(),sepia:B(),skew:R(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",tt]}],container:["container"],columns:[{columns:[el]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:[...q(),tt]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}
vendor: 9,951 bytes, line 768
768],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Gh,tt]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",tt]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Gh,tt]}],"grid-cols":[{"grid-cols":[Yh]}],"col-start-end":[{col:["auto",{span:["full",Gh,tt]},tt]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Yh]}],"row-start-end":[{row:["auto",{span:[Gh,tt]},tt]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",tt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",tt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",tt,t]}],"min-w":[{"min-w":[tt,t,"min","max","fit"]}],"max-w":[{"max-w":[tt,t,"none","full","min","max","fit","prose",{screen:[el]},el]}],h:[{h:[tt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[tt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[tt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[tt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",el,Zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zj]}],"font-family":[{font:[Yh]}],"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",tt]}],"line-clamp":[{"line-clamp":["none",qd,Zj]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Js,tt]}],"list-image":[{"list-image":["none",tt]}],"list-style-type":[{list:["none","disc","decimal",tt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Js,Zi]}],"underline-offset":[{"underline-offset":["auto",Js,tt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt]}],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",tt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),gae]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pae]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yae]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[x]}],"border-style":[{border:[...W(),"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":[x]}],"divide-style":[{divide:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[Js,tt]}],"outline-w":[{outline:[Js,Zi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Js,Zi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",el,xae]}],"shadow-color":[{shadow:[Yh]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",el,tt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",tt]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",tt]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",tt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Gh,tt]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",tt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt]}],"caret-color":[{caret:[e]}],"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"]}
vendor: 4,553 bytes, line 768
768],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",tt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Js,Zi,Zj]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nae=oae(Sae);function he(...e){return Nae(yt(e))}function b8(e){return/^\+[1-9]\d{6,14}$/.test(e.trim())}const _ae=ore,w8=p.forwardRef(({className:e,...t},n)=>o.jsx(_B,{ref:n,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));w8.displayName=_B.displayName;const Cae=nw("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),j8=p.forwardRef(({className:e,variant:t,...n},r)=>o.jsx(CB,{ref:r,className:he(Cae({variant:t}),e),...n}));j8.displayName=CB.displayName;const kae=p.forwardRef(({className:e,...t},n)=>o.jsx(AB,{ref:n,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));
vendor: 4,374 bytes, line 768
768kae.displayName=AB.displayName;const S8=p.forwardRef(({className:e,...t},n)=>o.jsx(PB,{ref:n,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(rn,{className:"h-4 w-4"})}));S8.displayName=PB.displayName;const N8=p.forwardRef(({className:e,...t},n)=>o.jsx(kB,{ref:n,className:he("text-sm font-semibold",e),...t}));N8.displayName=kB.displayName;const _8=p.forwardRef(({className:e,...t},n)=>o.jsx(EB,{ref:n,className:he("text-sm opacity-90",e),...t}));_8.displayName=EB.displayName;function Eae(){const{toasts:e}=Ag();return o.jsxs(_ae,{children:[e.map(function({id:t,title:n,description:r,action:a,...s}){return o.jsxs(j8,{...s,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(N8,{children:n}),r&&o.jsx(_8,{children:r})]}),a,o.jsx(S8,{})]},t)}),o.jsx(w8,{})]})}var Aae=M0[" useId ".trim().toString()]||(()=>{}),Pae=0;function Zn(e){const[t,n]=p.useState(Aae());return er(()=>{n(r=>r??String(Pae++))},[e]),t?`radix-${t}`:""}const Tae=["top","right","bottom","left"],Yl=Math.min,Na=Math.max,tb=Math.round,qv=Math.floor,Ns=e=>({x:e,y:e}),Oae={left:"right",right:"left",bottom:"top",top:"bottom"},Mae={start:"end",end:"start"};function Y_(e,t,n){return Na(e,Yl(t,n))}function Ii(e,t){return typeof e=="function"?e(t):e}function $i(e){return e.split("-")[0]}function ph(e){return e.split("-")[1]}function tA(e){return e==="x"?"y":"x"}function nA(e){return e==="y"?"height":"width"}const Iae=new Set(["top","bottom"]);function xs(e){return Iae.has($i(e))?"y":"x"}function rA(e){return tA(xs(e))}function $ae(e,t,n){n===void 0&&(n=!1);const r=ph(e),a=rA(e),s=nA(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=nb(i)),[i,nb(i)]}function Dae(e){const t=nb(e);return[K_(e),t,K_(t)]}function K_(e){return e.replace(/start|end/g,t=>Mae[t])}const UM=["left","right"],VM=["right","left"],Rae=["top","bottom"],Lae=["bottom","top"];function Fae(e,t,n){switch(e){case"top":case"bottom":return n?t?VM:UM:t?UM:VM;case"left":case"right":return t?Rae:Lae;default:return[]}}function Bae(e,t,n,r){const a=ph(e);let s=Fae($i(e),n==="start",r);return a&&(s=s.map(i=>i+"-"+a),t&&(s=s.concat(s.map(K_)))),s}function nb(e){return e.replace(/left|right|bottom|top/g,t=>Oae[t])}function zae(e){return{top:0,right:0,bottom:0,left:0,...e}}function C8(e){return typeof e!="number"?zae(e):{top:e,right:e,bottom:e,left:e}}function rb(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function WM(e,t,n){let{reference:r,floating:a}=e;const s=xs(t),i=rA(t),l=nA(i),c=$i(t),u=s==="y",d=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-a.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(ph(t)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}const Uae=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=WM(u,r,c),h=r,m={},v=0;for(let g=0;g<l.length;g++){const{name:y,fn:x}=l[g],{x:b,y:w,data:N,reset:S}=await x({x:d,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:m,rects:u,platform:i,elements:{reference:e,floating:t}});d=b??d,f=w??f,m={...m,[y]:{...m[y],...N}},S&&v<=50&&(v++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):S.rects),{x:d,y:f}=WM(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:a,middlewareData:m}};async function _p(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Ii(t,e),v=C8(m),y=l[h?f==="floating"?"reference":"floating":f],x=rb(await s.getClippingRect
vendor: 16,435 bytes, line 768
768({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},S=rb(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(x.top-S.top+v.top)/N.y,bottom:(S.bottom-x.bottom+v.bottom)/N.y,left:(x.left-S.left+v.left)/N.x,right:(S.right-x.right+v.right)/N.x}}const Vae=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ii(e,t)||{};if(u==null)return{};const f=C8(d),h={x:n,y:r},m=rA(a),v=nA(m),g=await i.getDimensions(u),y=m==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",N=s.reference[v]+s.reference[m]-h[m]-s.floating[v],S=h[m]-s.reference[m],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let k=_?_[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(_)))&&(k=l.floating[w]||s.floating[v]);const P=N/2-S/2,O=k/2-g[v]/2-1,$=Yl(f[x],O),T=Yl(f[b],O),z=$,U=k-g[v]-T,E=k/2-g[v]/2+P,q=Y_(z,E,U),W=!c.arrow&&ph(a)!=null&&E!==q&&s.reference[v]/2-(E<z?$:T)-g[v]/2<0,L=W?E<z?E-z:E-U:0;return{[m]:h[m]+L,data:{[m]:q,centerOffset:E-q-L,...W&&{alignmentOffset:L}},reset:W}}}),Wae=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...y}=Ii(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=$i(a),b=xs(l),w=$i(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=h||(w||!g?[nb(l)]:Dae(l)),_=v!=="none";!h&&_&&S.push(...Bae(l,g,v,N));const k=[l,...S],P=await _p(t,y),O=[];let $=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&O.push(P[x]),f){const E=$ae(a,i,N);O.push(P[E[0]],P[E[1]])}if($=[...$,{placement:a,overflows:O}],!O.every(E=>E<=0)){var T,z;const E=(((T=s.flip)==null?void 0:T.index)||0)+1,q=k[E];if(q&&(!(f==="alignment"?b!==xs(q):!1)||$.every(M=>M.overflows[0]>0&&xs(M.placement)===b)))return{data:{index:E,overflows:$},reset:{placement:q}};let W=(z=$.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!W)switch(m){case"bestFit":{var U;const L=(U=$.filter(M=>{if(_){const B=xs(M.placement);return B===b||B==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(B=>B>0).reduce((B,I)=>B+I,0)]).sort((M,B)=>M[1]-B[1])[0])==null?void 0:U[0];L&&(W=L);break}case"initialPlacement":W=l;break}if(a!==W)return{reset:{placement:W}}}return{}}}};function qM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HM(e){return Tae.some(t=>e[t]>=0)}const qae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ii(e,t);switch(r){case"referenceHidden":{const s=await _p(t,{...a,elementContext:"reference"}),i=qM(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:HM(i)}}}case"escaped":{const s=await _p(t,{...a,altBoundary:!0}),i=qM(s,n.floating);return{data:{escapedOffsets:i,escaped:HM(i)}}}default:return{}}}}},k8=new Set(["left","top"]);async function Hae(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=$i(n),l=ph(n),c=xs(n)==="y",u=k8.has(i)?-1:1,d=s&&c?-1:1,f=Ii(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Gae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:i,middlewareData:l}=t,c=await Hae(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Yae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...c}=Ii(e,t),u={x:n,y:r},d=await _p(t,c),f=xs($i(a)),h=tA(f);let m=u[h],v=u[f];if(s){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=m+d[y],w=m-d[x];m=Y_(b,m,w)}if(i){const y=f==="y"?"top":"left",x=f==="y"?"bottom":"right",b=v+d[y],w=v-d[x];v=Y_(b,v,w)}const g=l.fn({...t,[h]:m,[f]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:s,[f]:i}}}}}},Kae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ii(e,t),d={x:n,y:r},f=xs(a),h=tA(f);let m=d[h],v=d[f];const g=Ii(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=h==="y"?"height":"width",N=s.reference[h]-s.floating[w]+y.mainAxis,S=s.reference[h]+s.reference[w]-y.mainAxis;m<N?m=N:m>S&&(m=S)}if(u){var x,b;const w=h==="y"?"width":"height",N=k8.has($i(a)),S=s.reference[f]-s.floating[w]+(N&&((x=i.offset)==null?void 0:x[f])||0)+(N?0:y.crossAxis),_=s.reference[f]+s.reference[w]+(N?0:((b=i.offset)==null?void 0:b[f])||0)-(N?y.crossAxis:0);v<S?v=S:v>_&&(v=_)}return{[h]:m,[f]:v}}}},Xae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...u}=Ii(e,t),d=await _p(t,u),f=$i(a),h=ph(a),m=xs(a)==="y",{width:v,height:g}=s.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,y=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,w=v-d.left-d.right,N=Yl(g-d[y],b),S=Yl(v-d[x],w),_=!t.middlewareData.shift;let k=N,P=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),_&&!h){const $=Na(d.left,0),T=Na(d.right,0),z=Na(d.top,0),U=Na(d.bottom,0);m?P=v-2*($!==0||T!==0?$+T:Na(d.left,d.right)):k=g-2*(z!==0||U!==0?z+U:Na(d.top,d.bottom))}await c({...t,availableWidth:P,availableHeight:k});const O=await i.getDimensions(l.floating);return v!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function dw(){return typeof window<"u"}function gh(e){return E8(e)?(e.nodeName||"").toLowerCase():"#document"}function Aa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bs(e){var t;return(t=(E8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function E8(e){return dw()?e instanceof Node||e instanceof Aa(e).Node:!1}function qo(e){return dw()?e instanceof Element||e instanceof Aa(e).Element:!1}function Ts(e){return dw()?e instanceof HTMLElement||e instanceof Aa(e).HTMLElement:!1}function GM(e){return!dw()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Aa(e).ShadowRoot}const Jae=new Set(["inline","contents"]);function Dg(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ho(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Jae.has(a)}const Qae=new Set(["table","td","th"]);function Zae(e){return Qae.has(gh(e))}const eoe=[":popover-open",":modal"];function fw(e){return eoe.some(t=>{try{return e.matches(t)}catch{return!1}})}const toe=["transform","translate","scale","rotate","perspective"],noe=["transform","translate","scale","rotate","perspective","filter"],roe=["paint","layout","strict","content"];function aA(e){const t=oA(),n=qo(e)?Ho(e):e;return toe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||noe.some(r=>(n.willChange||"").includes(r))||roe.some(r=>(n.contain||"").includes(r))}function aoe(e){let t=Kl(e);for(;Ts(t)&&!jf(t);){if(aA(t))return t;if(fw(t))return null;t=Kl(t)}return null}function oA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ooe=new Set(["html","body","#document"]);function jf(e){return ooe.has(gh(e))}function Ho(e){return Aa(e).getComputedStyle(e)}function hw(e){return qo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kl(e){if(gh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||GM(e)&&e.host||Bs(e);return GM(t)?t.host:t}function A8(e){const t=Kl(e);return jf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ts(t)&&Dg(t)?t:A8(t)}function Cp(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=A8(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),i=Aa(a);if(s){const l=X_(i);return t.concat(i,i.visualViewport||[],Dg(a)?a:[],l&&n?Cp(l):[])}return t.concat(a,Cp(a,[],n))}function X_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P8(e){const t=Ho(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ts(e),s=a?e.offsetWidth:n,i=a?e.offsetHeight:r,l=tb(n)!==s||tb(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function sA(e){return qo(e)?e:e.contextElement}function Hd(e){const t=sA(e);if(!Ts(t))return Ns(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=P8(t);let i=(s?tb(n.width):n.width)/r,l=(s?tb(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const soe=Ns(0);function T8(e){const t=Aa(e);return!oA()||!t.visualViewport?soe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ioe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Aa(e)?!1:t}function fu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=sA(e);let i=Ns(1);t&&(r?qo(r)&&(i=Hd(r)):i=Hd(e));const l=ioe(s,n,r)?T8(s):Ns(0);let c=(a.left+l.x)/i.x,u=(a.top+l.y)/i.y,d=a.width/i.x,f=a.height/i.y;if(s){const h=Aa(s),m=r&&qo(r)?Aa(r):r;let v=h,g=X_(v);for(;g&&r&&m!==v;){const y=Hd(g),x=g.getBoundingClientRect(),b=Ho(g),w=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,N=x.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=w,u+=N,v=Aa(g),g=X_(v)}}return rb({width:d,height:f,x:c,y:u})}function iA(e,t){const n=hw(e).scrollLeft;return t?t.left+n:fu(Bs(e)).left+n}function O8(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:iA(e,r)),s=r.top+t.scrollTop;return{x:a,y:s}}function loe(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",i=Bs(r),l=t?fw(t.floating):!1;if(r===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Ns(1);const d=Ns(0),f=Ts(r);if((f||!f&&!s)&&((gh(r)!=="body"||Dg(i))&&(c=hw(r)),Ts(r))){const m=fu(r);u=Hd(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?O8(i,c,!0):Ns(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function coe(e){return Array.from(e.getClientRects())}function uoe(e){const t=Bs(e),n=hw(e),r=e.ownerDocument.body,a=Na(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Na(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+iA(e);const l=-n.scrollTop;return Ho(r).direction==="rtl"&&(i+=Na(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}function doe(e,t){const n=Aa(e),r=Bs(e),a=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=oA();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:s,height:i,x:l,y:c}}const foe=new Set(["absolute","fixed"]);function hoe(e,t){const n=fu(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=Ts(e)?Hd(e):Ns(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=a*s.x,u=r*s.y;return{width:i,height:l,x:c,y:u}}function YM(e,t,n){let r;if(t==="viewport")r=doe(e,n);else if(t==="document")r=uoe(Bs(e));else if(qo(t))r=hoe(t,n);else{const a=T8(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return rb(r)}function M8(e,t){const n=Kl(e);return n===t||!qo(n)||jf(n)?!1:Ho(n).position==="fixed"||M8(n,t)}function moe(e,t){const n=t.get(e);if(n)return n;let r=Cp(e,[],!1).filter(l=>qo(l)&&gh(l)!=="body"),a=null;const s=Ho(e).position==="fixed";let i=s?Kl(e):e;for(;qo(i)&&!jf(i);){const l=Ho(i),c=aA(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&foe.has(a.position)||Dg(i)&&!c&&M8(e,i))?r=r.filter(d=>d!==i):a=l,i=Kl(i)}return t.set(e,r),r}function poe(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const i=[...n==="clippingAncestors"?fw(t)?[]:moe(t,this._c):[].concat(n),r],l=i[0],c=i.reduce((u,d)=>{const f=YM(t,d,a);return u.top=Na(f.top,u.top),u.right=Yl(f.right,u.right),u.bottom=Yl(f.bottom,u.bottom),u.left=Na(f.left,u.left),u},YM(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function goe(e){const{width:t,height:n}=P8(e);return{width:t,height:n}}function voe(e,t,n){const r=Ts(t),a=Bs(t),s=n==="fixed",i=fu(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Ns(0);function u(){c.x=iA(a)}if(r||!r&&!s)if((gh(t)!=="body"||Dg(a))&&(l=hw(t)),r){const m=fu(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else a&&u();s&&!r&&a&&u();const d=a&&!r&&!s?O8(a,l):Ns(0),f=i.left+l.scrollLeft-c.x-d.x,h=i.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function eS(e){return Ho(e).position==="static"}function KM(e,t){if(!Ts(e)||Ho(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bs(e)===n&&(n=n.ownerDocument.body),n}function I8(e,t){const n=Aa(e);if(fw(e))return n;if(!Ts(e)){let a=Kl(e);for(;a&&!jf(a);){if(qo(a)&&!eS(a))return a;a=Kl(a)}return n}let r=KM(e,t);for(;r&&Zae(r)&&eS(r);)r=KM(r,t);return r&&jf(r)&&eS(r)&&!aA(r)?n:r||aoe(e)||n}const yoe=async function(e){const t=this.getOffsetParent||I8,n=this.getDimensions,r=await n(e.floating);return{reference:voe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xoe(e){return Ho(e).direction==="rtl"}const boe={convertOffsetParentRelativeRectToViewportRelativeRect:loe,getDocumentElement:Bs,getClippingRect:poe,getOffsetParent:I8,getElementRects:yoe,getClientRects:coe,getDimensions:goe,getScale:Hd,isElement:qo,isRTL:xoe};function $8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function woe(e,t){let n=null,r;const a=Bs(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(l||t(),!h||!m)return;const v=qv(f),g=qv(a.clientWidth-(d+h)),y=qv(a.clientHeight-(f+m)),x=qv(d),w={rootMargin:-v+"px "+-g+"px "+-y+"px "+-x+"px",threshold:Na(0,Yl(1,c))||1};let N=!0;function S(_){const k=_[0].intersectionRatio;if(k!==c){if(!N)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!$8(u,e.getBoundingClientRect())&&i(),N=!1}try{n=new IntersectionObserver(S,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return i(!0),s}function joe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=sA(e),d=a||s?[...u?Cp(u):[],...Cp(t)]:[];d.forEach(x=>{a&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&l?woe(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?fu(e):null;c&&y();function y(){const x=fu(e);g&&!$8(g,x)&&n(),g=x,v=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(b=>{a&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const Soe=Gae,Noe=Yae,_oe=Wae,Coe=Xae,koe=qae,XM=Vae,Eoe=Kae,Aoe=(e,t,n)=>{const r=new Map,a={platform:boe,...n},s={...a.platform,_c:r};return Uae(e,t,{...a,platform:s})};var Poe=typeof document<"u",Toe=function(){},ax=Poe?p.useLayoutEffect:Toe;function ab(e,t){if(e===t)return!0;
vendor: 4,167 bytes, line 768
768if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ab(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!ab(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function D8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function JM(e,t){const n=D8(e);return Math.round(t*n)/n}function tS(e){const t=p.useRef(e);return ax(()=>{t.current=e}),t}function Ooe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);ab(h,r)||m(r);const[v,g]=p.useState(null),[y,x]=p.useState(null),b=p.useCallback(M=>{M!==_.current&&(_.current=M,g(M))},[]),w=p.useCallback(M=>{M!==k.current&&(k.current=M,x(M))},[]),N=s||v,S=i||y,_=p.useRef(null),k=p.useRef(null),P=p.useRef(d),O=c!=null,$=tS(c),T=tS(a),z=tS(u),U=p.useCallback(()=>{if(!_.current||!k.current)return;const M={placement:t,strategy:n,middleware:h};T.current&&(M.platform=T.current),Aoe(_.current,k.current,M).then(B=>{const I={...B,isPositioned:z.current!==!1};E.current&&!ab(P.current,I)&&(P.current=I,Ou.flushSync(()=>{f(I)}))})},[h,t,n,T,z]);ax(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const E=p.useRef(!1);ax(()=>(E.current=!0,()=>{E.current=!1}),[]),ax(()=>{if(N&&(_.current=N),S&&(k.current=S),N&&S){if($.current)return $.current(N,S,U);U()}},[N,S,U,$,O]);const q=p.useMemo(()=>({reference:_,floating:k,setReference:b,setFloating:w}),[b,w]),W=p.useMemo(()=>({reference:N,floating:S}),[N,S]),L=p.useMemo(()=>{const M={position:n,left:0,top:0};if(!W.floating)return M;const B=JM(W.floating,d.x),I=JM(W.floating,d.y);return l?{...M,transform:"translate("+B+"px, "+I+"px)",...D8(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:I}},[n,l,W.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:U,refs:q,elements:W,floatingStyles:L}),[d,U,q,W,L])}const Moe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?XM({element:r.current,padding:a}).fn(n):{}:r?XM({element:r,padding:a}).fn(n):{}}}},Ioe=(e,t)=>({...Soe(e),options:[e,t]}),$oe=(e,t)=>({...Noe(e),options:[e,t]}),Doe=(e,t)=>({...Eoe(e),options:[e,t]}),Roe=(e,t)=>({..._oe(e),options:[e,t]}),Loe=(e,t)=>({...Coe(e),options:[e,t]}),Foe=(e,t)=>({...koe(e),options:[e,t]}),Boe=(e,t)=>({...Moe(e),options:[e,t]});var zoe="Arrow",R8=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...s}=e;return o.jsx(Ie.svg,{...s,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});R8.displayName=zoe;var Uoe=R8;function lA(e){const[t,n]=p.useState(void 0);return er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var cA="Popper",[L8,sc]=Gr(cA),[Voe,F8]=L8(cA),B8=e=>{const{__scopePopper:t,children:n}=e,[r,a]=p.useState(null);return o.jsx(Voe,{scope:t,anchor:r,onAnchorChange:a,children:n})};B8.displayName=cA;var z8="PopperAnchor",U8=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,s=F8(z8,n),i=p.useRef(null),l=at(t,i);return p.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:o.jsx(Ie.div,{...a,ref:l})});U8.displayName=z8;var uA="PopperContent",[Woe,qoe]=L8(uA),V8=p.forwardRef((e,t)=>
vendor: 4,752 bytes, line 768
768{var V,Y,G,K,Z,J;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,y=F8(uA,n),[x,b]=p.useState(null),w=at(t,ce=>b(ce)),[N,S]=p.useState(null),_=lA(N),k=(_==null?void 0:_.width)??0,P=(_==null?void 0:_.height)??0,O=r+(s!=="center"?"-"+s:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],z=T.length>0,U={padding:$,boundary:T.filter(Goe),altBoundary:z},{refs:E,floatingStyles:q,placement:W,isPositioned:L,middlewareData:M}=Ooe({strategy:"fixed",placement:O,whileElementsMounted:(...ce)=>joe(...ce,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Ioe({mainAxis:a+P,alignmentAxis:i}),c&&$oe({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Doe():void 0,...U}),c&&Roe({...U}),Loe({...U,apply:({elements:ce,rects:ue,availableWidth:be,availableHeight:Ne})=>{const{width:te,height:re}=ue.reference,pe=ce.floating.style;pe.setProperty("--radix-popper-available-width",`${be}px`),pe.setProperty("--radix-popper-available-height",`${Ne}px`),pe.setProperty("--radix-popper-anchor-width",`${te}px`),pe.setProperty("--radix-popper-anchor-height",`${re}px`)}}),N&&Boe({element:N,padding:l}),Yoe({arrowWidth:k,arrowHeight:P}),h&&Foe({strategy:"referenceHidden",...U})]}),[B,I]=H8(W),R=ca(v);er(()=>{L&&(R==null||R())},[L,R]);const F=(V=M.arrow)==null?void 0:V.x,j=(Y=M.arrow)==null?void 0:Y.y,C=((G=M.arrow)==null?void 0:G.centerOffset)!==0,[A,D]=p.useState();return er(()=>{x&&D(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:L?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:A,"--radix-popper-transform-origin":[(K=M.transformOrigin)==null?void 0:K.x,(Z=M.transformOrigin)==null?void 0:Z.y].join(" "),...((J=M.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Woe,{scope:n,placedSide:B,onArrowChange:S,arrowX:F,arrowY:j,shouldHideArrow:C,children:o.jsx(Ie.div,{"data-side":B,"data-align":I,...g,ref:w,style:{...g.style,animation:L?void 0:"none"}})})})});V8.displayName=uA;var W8="PopperArrow",Hoe={top:"bottom",right:"left",bottom:"top",left:"right"},q8=p.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,s=qoe(W8,r),i=Hoe[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(Uoe,{...a,ref:n,style:{...a.style,display:"block"}})})});q8.displayName=W8;function Goe(e){return e!==null}var Yoe=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:n,rects:r,middlewareData:a}=t,i=((y=a.arrow)==null?void 0:y.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=H8(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=a.arrow)==null?void 0:x.x)??0)+l/2,m=(((b=a.arrow)==null?void 0:b.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?f:`${h}px`,g=`${-c}px`):u==="top"?(v=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?f:`${m}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?f:`${m}px`),{data:{x:v,y:g}}}});function H8(e){const[t,n="center"]=e.split("-");return[t,n]}var dA=B8,Rg=U8,mw=V8,pw=q8,Koe=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"}),Xoe="VisuallyHidden",G8=p.forwardRef((e,t)=>o.jsx(Ie.span,{...e,ref:t,style:{...Koe,...e.style}}));G8.displayName=Xoe;var Joe=G8,[gw,Iqe]=Gr("Tooltip",[sc]),fA=sc(),Y8="TooltipProvider",Qoe=700,QM="tooltip.open",[Zoe,K8]=gw(Y8),X8=e=>{const{__scopeTooltip:t,delayDuration:n=Qoe,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:s}=e,i=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(Zoe,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:s})};X8.displayName=Y8;var J8="Tooltip",[$qe,vw]=gw(J8),J_="TooltipTrigger",ese=p.forwardRef((e,t)=>
vendor: 5,259 bytes, line 768
768{const{__scopeTooltip:n,...r}=e,a=vw(J_,n),s=K8(J_,n),i=fA(n),l=p.useRef(null),c=at(t,l,a.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),f=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(Rg,{asChild:!0,...i,children:o.jsx(Ie.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:xe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:xe(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:xe(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:xe(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:xe(e.onBlur,a.onClose),onClick:xe(e.onClick,a.onClose)})})});ese.displayName=J_;var tse="TooltipPortal",[Dqe,nse]=gw(tse,{forceMount:void 0}),Sf="TooltipContent",Q8=p.forwardRef((e,t)=>{const n=nse(Sf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...s}=e,i=vw(Sf,e.__scopeTooltip);return o.jsx(da,{present:r||i.open,children:i.disableHoverableContent?o.jsx(Z8,{side:a,...s,ref:t}):o.jsx(rse,{side:a,...s,ref:t})})}),rse=p.forwardRef((e,t)=>{const n=vw(Sf,e.__scopeTooltip),r=K8(Sf,e.__scopeTooltip),a=p.useRef(null),s=at(t,a),[i,l]=p.useState(null),{trigger:c,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=r,h=p.useCallback(()=>{l(null),f(!1)},[f]),m=p.useCallback((v,g)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=lse(x,y.getBoundingClientRect()),w=cse(x,b),N=use(g.getBoundingClientRect()),S=fse([...w,...N]);l(S),f(!0)},[f]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&d){const v=y=>m(y,d),g=y=>m(y,c);return c.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[c,d,m,h]),p.useEffect(()=>{if(i){const v=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),w=!dse(x,i);b?h():w&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,d,i,u,h]),o.jsx(Z8,{...e,ref:s})}),[ase,ose]=gw(J8,{isInside:!1}),sse=lB("TooltipContent"),Z8=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=vw(Sf,n),u=fA(n),{onClose:d}=c;return p.useEffect(()=>(document.addEventListener(QM,d),()=>document.removeEventListener(QM,d)),[d]),p.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),o.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:o.jsxs(mw,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(sse,{children:r}),o.jsx(ase,{scope:n,isInside:!0,children:o.jsx(Joe,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Q8.displayName=Sf;var ez="TooltipArrow",ise=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=fA(n);return ose(ez,n).isInside?null:o.jsx(pw,{...a,...r,ref:t})});ise.displayName=ez;function lse(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,a,s)){case s:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function cse(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function use(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function dse(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(a=!a)}return a}function fse(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),hse(t)}function hse(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mse=X8,tz=Q8;const pse=mse,gse=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
768o.jsx(tz,{ref:r,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));gse.displayName=tz.displayName;const nz="/api",Q_="nexus_token";function rz(){return localStorage.getItem(Q_)}function Od(e){e?localStorage.setItem(Q_,e):localStorage.removeItem(Q_)}async function az(){return rz()}async function _s(e,t={}){const n=await az(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);try{const a=await fetch(`${nz}${e}`,{...t,headers:r});if(!a.ok)return{data:null,error:(await a.json().catch(()=>({}))).detail||`Error ${a.status}`};const s=await a.json();return{data:s.data??s,error:s.error??null,meta:s.meta,warnings:s.warnings}}catch(a){return{data:null,error:a.message||"Network error"}}}function ze(e){return _s(e)}function Qe(e,t){return _s(e,{method:"POST",body:t?JSON.stringify(t):void 0})}function or(e,t){return _s(e,{method:"PATCH",body:JSON.stringify(t)})}function sr(e){return _s(e,{method:"DELETE"})}const _m="nexus_admin_token";function kp(){const e=sessionStorage.getItem(_m);return e?{"X-Admin-Auth":e}:{}}function va(e){return _s(e,{headers:kp()})}function Kh(e,t){return _s(e,{method:"POST",body:t?JSON.stringify(t):void 0,headers:kp()})}function nS(e,t){return _s(e,{method:"PATCH",body:JSON.stringify(t),headers:kp()})}const ee={register:e=>Qe("/auth/register",e),login:e=>Qe("/auth/login",e),verifyEmail:e=>Qe("/auth/verify-email",{token:e}),resendVerification:(e,t)=>Qe("/auth/resend-verification",{email:e,app_url:t}),getMe:()=>ze("/auth/me"),getAgents:()=>ze("/agents"),getAgent:e=>ze(`/agents/${e}`),createAgent:e=>Qe("/agents",e),testAgent:e=>Qe("/agents/test",e),startVoiceTest:e=>Qe("/agents/test-voice/start",e),endVoiceTest:e=>sr(`/agents/test-voice/${e}`),analyzeAgentWebsite:e=>Qe("/agents/analyze-website",{url:e}),updateAgent:(e,t)=>or(`/agents/${e}`,t),getAgentEvents:e=>ze(`/agents/${e}/events`),getToolPresets:()=>ze("/agents/tool-presets"),getCalendarStatus:()=>ze("/calendar/status"),getCalendarConnectUrl:e=>ze(`/calendar/google/connect-url?tz=${encodeURIComponent(e)}`),updateCalendarSettings:e=>or("/calendar/settings",e),disconnectCalendar:()=>sr("/calendar/google"),getCallbacks:e=>ze(`/callbacks${e?`?status=${encodeURIComponent(e)}`:""}`),updateCallback:(e,t)=>or(`/callbacks/${e}`,t),getCallbackSettings:()=>ze("/callbacks/settings"),updateCallbackSettings:e=>or("/callbacks/settings",e),getCallEvents:()=>ze("/call-events"),createCallEvent:e=>Qe("/call-events",e),updateCallEvent:(e,t)=>or(`/call-events/${e}`,t),deleteCallEvent:e=>sr(`/call-events/${e}`),deleteAgent:e=>sr(`/agents/${e}`),syncAgentVapi:e=>Qe(`/agents/${e}/sync-vapi`),uploadAgentKnowledge:async(e,t)=>{const n=await az(),r=new FormData;r.append("file",t);try{const a=await fetch(`${nz}/agents/${e}/knowledge`,{method:"POST",headers:n?{Authorization:`Bearer ${n}`}:{},body:r});if(!a.ok)return{data:null,error:(await a.json().catch(()=>({}))).detail||`Error ${a.status}`};const s=await a.json();return{data:s.data??s,error:s.error??null}}catch(a){return{data:null,error:a.message||"Network error"}}},getContacts:()=>ze("/contacts"),createContact:e=>Qe("/contacts",e),updateContact:(e,t)=>
768or(`/contacts/${e}`,t),deleteContact:e=>sr(`/contacts/${e}`),getLists:()=>ze("/lists"),createList:e=>Qe("/lists",e),updateList:(e,t)=>or(`/lists/${e}`,t),deleteList:e=>sr(`/lists/${e}`),getTools:()=>ze("/tools"),createTool:e=>Qe("/tools",e),updateTool:(e,t)=>or(`/tools/${e}`,t),deleteTool:e=>sr(`/tools/${e}`),testTool:e=>Qe(`/tools/${e}/test`),getConversations:e=>ze(`/conversations${e?`?${e}`:""}`),getConversation:e=>ze(`/conversations/${e}`),getConversationEvents:e=>ze(`/conversations/${e}/events`),getConversationTranscript:e=>ze(`/conversations/${e}/transcript`),getConversationRecordingUrl:e=>ze(`/conversations/${e}/recording-url`),getConversationStats:e=>ze(`/conversations/stats${e?`?${e}`:""}`),syncConversationsFromVapi:()=>Qe("/conversations/sync-from-vapi"),deleteConversation:e=>sr(`/conversations/${e}`),getPhoneNumbers:()=>ze("/telephony/phone-numbers"),createPhoneNumber:e=>Qe("/telephony/phone-numbers",{...e,success_url:`${window.location.origin}/dashboard/telephony/phone-numbers`}),confirmPhonePurchase:e=>Qe("/telephony/phone-numbers/confirm",{session_id:e}),updatePhoneNumber:(e,t)=>or(`/telephony/phone-numbers/${e}`,t),deletePhoneNumber:e=>sr(`/telephony/phone-numbers/${e}`),getTwilioCredentials:()=>
768ze("/telephony/twilio-credentials"),createTwilioCredential:e=>Qe("/telephony/twilio-credentials",e),updateTwilioCredential:(e,t)=>or(`/telephony/twilio-credentials/${e}`,t),deleteTwilioCredential:e=>sr(`/telephony/twilio-credentials/${e}`),createByotPhoneNumber:e=>Qe("/telephony/phone-numbers/byot",e),getCampaigns:()=>ze("/telephony/campaigns"),createCampaign:e=>Qe("/telephony/campaigns",e),getCampaign:e=>ze(`/telephony/campaigns/${e}`),updateCampaign:(e,t)=>or(`/telephony/campaigns/${e}`,t),deleteCampaign:e=>sr(`/telephony/campaigns/${e}`),startCampaign:e=>Qe(`/telephony/campaigns/${e}/start`),pauseCampaign:e=>Qe(`/telephony/campaigns/${e}/pause`),resumeCampaign:e=>Qe(`/telephony/campaigns/${e}/resume`),makeCall:e=>Qe("/telephony/call",e),getCallStatus:e=>ze(`/telephony/call/${e}/status`),getInboundQueues:()=>ze("/telephony/inbound"),createInboundQueue:e=>Qe("/telephony/inbound",e),updateInboundQueue:(e,t)=>or(`/telephony/inbound/${e}`,t),deleteInboundQueue:e=>sr(`/telephony/inbound/${e}`),getVoiceWidgets:()=>ze("/voice-widgets"),createVoiceWidget:e=>Qe("/voice-widgets",e),updateVoiceWidget:(e,t)=>or(`/voice-widgets/${e}`,t),deleteVoiceWidget:e=>sr(`/voice-widgets/${e}`),getIntegrations:()=>ze("/integrations"),createIntegration:e=>Qe("/integrations",e),updateIntegration:(e,t)=>or(`/integrations/${e}`,t),deleteIntegration:e=>sr(`/integrations/${e}`),testIntegration:e=>Qe(`/integrations/${e}/test`),getDncStatus:()=>ze("/integrations/dnc-status"),getAnalyticsOverview:()=>ze("/analytics/overview"),getAnalyticsChannel:()=>ze("/analytics/channel"),getAnalyticsCampaign:()=>ze("/analytics/campaign"),getAnalyticsAgent:()=>ze("/analytics/agent"),getAnalyticsTimeseries:(e=14)=>ze(`/analytics/timeseries?days=${e}`),getFlows:()=>ze("/automation/flows"),createFlow:e=>Qe("/automation/flows",e),getFlow:e=>ze(`/automation/flows/${e}`),updateFlow:(e,t)=>or(`/automation/flows/${e}`,t),deleteFlow:e=>sr(`/automation/flows/${e}`),getFlowVersions:e=>ze(`/automation/flows/${e}/versions`),getFlowVersion:(e,t)=>ze(`/automation/flows/${e}/versions/${t}`),restoreFlowVersion:(e,t)=>Qe(`/automation/flows/${e}/versions/${t}/restore`),runFlowNow:e=>Qe(`/automation/flows/${e}/run`),getRuns:e=>ze(`/automation/runs${e?`?${e}`:""}`),getRunsStats:()=>ze("/automation/runs/stats"),getTeam:()=>ze("/team"),getMyRole:()=>ze("/team/me"),inviteTeamMember:e=>Qe("/team/invite",{...e,app_url:window.location.origin}),updateTeamMember:(e,t)=>or(`/team/${e}`,t),removeTeamMember:e=>sr(`/team/${e}`),getInvite:e=>ze(`/team/invite/${e}`),acceptInvite:e=>Qe("/team/accept-invite",e),getProfile:()=>ze("/profile"),updateProfile:e=>or("/profile",e),getBillingStatus:()=>ze("/billing/status"),getBillingInvoices:()=>ze("/billing/invoices"),getBillingCallCosts:()=>ze("/billing/call-costs"),topupCheckout:e=>Qe("/billing/topup/checkout",{amount:e,success_url:`${window.location.origin}/dashboard/billing`,cancel_url:`${window.location.origin}/dashboard/billing`}),topupConfirm:e=>Qe("/billing/topup/confirm",{session_id:e}),getWalletTransactions:()=>ze("/billing/transactions"),getStripeConfig:()=>ze("/billing/config"),getPaymentMethods:()=>ze("/billing/payment-methods"),createSetupIntent:()=>Qe("/billing/payment-methods/setup-intent"),setDefaultPaymentMethod:e=>Qe(`/billing/payment-methods/${e}/default`),deletePaymentMethod:e=>sr(`/billing/payment-methods/${e}`),updateAutoRecharge:e=>_s("/billing/auto-recharge",{method:"PUT",body:JSON.stringify(e)}),getPromotions:()=>ze("/billing/promotions"),redeemPromoCode:e=>Qe("/billing/promotions/redeem",{code:e}),getMyReferrals:()=>ze("/referrals/me"),getNotifications:()=>ze("/notifications"),markNotificationsRead:e=>Qe("/notifications/read",e?{id:e}:{}),adminLogin:(e,t)=>Qe("/admin/login",{username:e,password:t}),getAdminStats:()=>va("/admin/stats"),getAdminUsers:()=>va("/admin/users"),createAdminUser:e=>Kh("/admin/users",e),getAdminAgents:()=>va("/admin/agents"),getAdminPhoneNumbers:()=>va("/admin/phone-numbers"),getAdminReferrals:()=>va("/admin/referrals"),getAdminPayments:()=>va("/admin/payments"),getAdminRevenue:()=>va("/admin/revenue"),getAdminAgentsReport:()=>va("/admin/agents-report"),getAdminUsersReport:()=>va("/admin/users-report"),getAdminSettings:()=>va("/admin/settings"),updateAdminSettings:e=>nS("/admin/settings",e),getAdminPromoKpis:()=>va("/admin/promo-kpis"),getAdminPromoCodes:()=>va("/admin/promo-codes"),createAdminPromoCode:e=>Kh("/admin/promo-codes",e),updateAdminPromoCode:(e,t)=>nS(`/admin/promo-codes/${e}`,t),deleteAdminPromoCode:e=>_s(`/admin/promo-codes/${e}`,{method:"DELETE",headers:kp()}),getAdminUser:e=>va(`/admin/users/${e}`),updateAdminUser:(e,t)=>nS(`/admin/users/${e}`,t),deleteAdminUser:e=>_s(`/admin/users/${e}`,{method:"DELETE",headers:kp()}),impersonateUser:e=>Kh(`/admin/users/${e}/impersonate`),adjustUserBalance:(e,t,n)=>Kh(`/admin/users/${e}/balance`,{amount:t,reason:n}),toggleAccess:e=>Kh(`/admin/users/${e}/toggle-access`),getHealth:()=>ze("/health"),forgotPassword:e=>Qe("/auth/forgot-password",{email:e}),resetPassword:(e,t)=>Qe("/auth/reset-password",{token:e,new_password:t}),changePassword:(e,t)=>Qe("/auth/change-password",{current_password:e,new_password:t})},Ep="admin.";function vse(){return typeof window>"u"?!1:window.location.hostname.startsWith(Ep)?!0:new URLSearchParams(window.location.search).get("admin")==="1"}function yse(){const e=window.location.hostname;return e.startsWith(Ep)?`${window.location.protocol}//${e.slice(Ep.length)}`:window.location.origin}function xse(){const e=window.location.hostname;return e.startsWith(Ep)?window.location.origin:`${window.location.protocol}//${Ep}${e}`}const bse="nexus_token",yw="nexus_impersonating";function oz(e,t){const n=new URLSearchParams({impersonate_token:e,impersonate_email:t});return`${yse()}/dashboard/quick-setup?${n.toString()}`}function wse(e,t,n){e.location.href=oz(t,n)}function jse(e,t){window.location.href=oz(e,t)}function Sse(e){localStorage.setItem(yw,e)}function rS(){localStorage.removeItem(yw)}function Nse(){return localStorage.getItem(yw)}function _se(){localStorage.removeItem(bse),localStorage.removeItem(yw),window.location.href=xse()}const sz=p.createContext({user:null,session:null,loading:!0,signIn:async()=>({error:"not ready"}),signUp:async()=>({error:"not ready"}),signOut:async()=>{}}),vh=()=>p.useContext(sz),Cse=({children:e})=>{const[t,n]=p.useState(null),[r,a]=p.useState(null),[s,i]=p.useState(!0);p.useEffect(()=>{const d=new URLSearchParams(window.location.search),f=d.get("impersonate_token"),h=d.get("impersonate_email");f&&h&&(Od(f),Sse(h),window.history.replaceState({},"",window.location.pathname));const m=rz();if(!m){i(!1);return}a({access_token:m}),ee.getMe().then(({data:v,error:g})=>{var y;v&&!g?n({id:v.id,email:v.email,user_metadata:{full_name:(y=v.profile)==null?void 0:y.full_name}}):(Od(null),a(null),rS()),i(!1)})},[]);const l=async(d,f)=>{var g,y,x;const{data:h,error:m}=await ee.login({email:d,password:f});if(m||!(h!=null&&h.access_token))return{error:m||"Login failed"};rS(),Od(h.access_token),a({access_token:h.access_token});const v=await ee.getMe();return v.data&&!v.error?n({id:v.data.id,email:v.data.email,user_metadata:{full_name:(g=v.data.profile)==null?void 0:g.full_name}}):n({id:((y=h.user)==null?void 0:y.id)??"",email:((x=h.user)==null?void 0:x.email)??d,user_metadata:{}}),{error:null}},c=async(d,f,h,m,v)=>{const{data:g,error:y}=await ee.register({email:d,password:f,full_name:h,app_url:window.location.origin,recaptcha_token:m,referral_code:v});return y?{error:y}:{error:null,pending:!0,devVerifyUrl:g==null?void 0:g.dev_verify_url}},u=async()=>{Od(null),a(null),n(null),rS()};return o.jsx(sz.Provider,{value:{user:t,session:r,loading:s,signIn:l,signUp:c,signOut:u},children:e})},Ap=nw("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"}}),ne=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},s)=>{const i=r?yne:"button";return o.jsx(i,{className:he(Ap({variant:t,size:n,className:e})),ref:s,...a})});
768ne.displayName="Button";const ZM=["Outbound Campaigns","Inbound Reception","Lead Qualification","After-Hours Answering","Follow-Up Calls"],kse=[{icon:Wo,label:"Outbound Campaigns"},{icon:ta,label:"AI Receptionist"},{icon:rc,label:"Recordings & Transcripts"},{icon:u8,label:"Live Call Transfer"},{icon:Fs,label:"Contacts & Lists"},{icon:WB,label:"Per-Minute Billing"}],Ese=()=>{const[e,t]=p.useState(0);return p.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%ZM.length)},2500);return()=>clearInterval(n)},[]),o.jsxs("section",{className:"relative min-h-screen flex flex-col items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-30 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 right-1/4 w-[400px] h-[400px] rounded-full bg-accent/5 blur-[120px] pointer-events-none"}),o.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[300px] h-[300px] pointer-events-none opacity-20",children:o.jsx("div",{className:"animate-orbit absolute top-1/2 left-1/2 w-3 h-3 rounded-full bg-primary"})}),o.jsxs("div",{className:"container mx-auto px-4 text-center relative z-10",children:[o.jsxs("div",{className:"badge-pill mx-auto mb-8 animate-slide-up",children:[o.jsx("span",{className:"w-2 h-2 rounded-full bg-primary animate-pulse-glow"}),"AI VOICE AGENTS FOR SALES & SUPPORT"]}),o.jsxs("h1",{className:"text-5xl sm:text-6xl md:text-7xl lg:text-8xl font-black tracking-tight mb-4 animate-slide-up",style:{animationDelay:"0.1s"},children:["AI AGENTS THAT",o.jsx("br",{}),o.jsx("span",{className:"text-gradient",children:"WORK THE PHONES"})]}),o.jsxs("div",{className:"text-xl md:text-2xl font-medium mb-6 animate-slide-up",style:{animationDelay:"0.2s"},children:["Built for"," ",o.jsx("span",{className:"text-gradient font-bold",children:ZM[e]},e)]}),o.jsxs("p",{className:"max-w-2xl mx-auto text-muted-foreground text-base md:text-lg mb-10 animate-slide-up",style:{animationDelay:"0.3s"},children:["Build a voice agent, give it a phone number, and it starts"," ",o.jsx("strong",{className:"text-foreground",children:"making and answering real calls"}),". Every call is recorded and transcribed, and qualified callers can be transferred straight to your team."," ",o.jsx("strong",{className:"text-foreground",children:"Around $0.35 a minute, with no subscription."})]}),o.jsx("div",{className:"flex flex-wrap justify-center gap-3 mb-10 animate-slide-up",style:{animationDelay:"0.4s"},children:kse.map(({icon:n,label:r})=>o.jsxs("span",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium bg-secondary text-secondary-foreground border border-border",children:[o.jsx(n,{size:14,className:"text-primary"}),r]},r))}),o.jsx("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 animate-slide-up",style:{animationDelay:"0.5s"},children:o.jsx(jt,{to:"/register",children:o.jsxs(ne,{size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 px-8 gap-2 text-base",children:["Start with $20 free credit ",o.jsx(Wi,{size:18})]})})}),o.jsx("p",{className:"mt-5 text-xs text-muted-foreground animate-slide-up",style:{animationDelay:"0.6s"},children:"No card required to sign up · Pay only for the minutes you use"})]}),o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-32 bg-gradient-to-t from-background to-transparent pointer-events-none"})]})},Ase=["Elliot","Savannah","Rohan","Emma","Clara","Nico","Kai","Sagar","Godfrey","Neil","Layla","Sid","Naina"],Pse=["Zara","Ali"],iz=[...Ase,...Pse],Z_=[{label:"Retail & E-commerce",icon:f8,color:"bg-orange-500/15 text-orange-400"},{label:"Healthcare & Medical",icon:QB,color:"bg-rose-500/15 text-rose-400"},{label:"Finance & Banking",icon:t8,color:"bg-emerald-500/15 text-emerald-400"},{label:"Real Estate",icon:e8,color:"bg-amber-500/15 text-amber-400"},{label:"Education",icon:YB,color:"bg-blue-500/15 text-blue-400"}
768,{label:"Travel & Hospitality",icon:l8,color:"bg-cyan-500/15 text-cyan-400"},{label:"SaaS & Technology",icon:V2,color:"bg-violet-500/15 text-violet-400"},{label:"Automotive Industry",icon:DB,color:"bg-red-500/15 text-red-400"},{label:"Insurance",icon:J2,color:"bg-teal-500/15 text-teal-400"},{label:"Debt & Credit Services",icon:oc,color:"bg-amber-500/15 text-amber-400"},{label:"Home Services & Contracting",icon:UB,color:"bg-slate-500/15 text-slate-400"},{label:"Legal Services",icon:qB,color:"bg-gray-500/15 text-gray-400"},{label:"Telecommunications & Internet",icon:m8,color:"bg-sky-500/15 text-sky-400"},{label:"Marketing & Professional Services",icon:KB,color:"bg-orange-500/15 text-orange-400"}],uo=iz.length,Lg=Z_.length,Du=["English","Urdu","Multilingual (auto-detect)"],xw="$0.35",Pp="$3",bw="$20",Tse=60,Ose="$20",Mse="$1,000",hA=20,Ise=[{icon:zn,tag:"Build in minutes",title:"AI Voice Agents",description:"A guided setup walks you through the agent's goal, industry, voice and knowledge, then lets you talk to it in your browser before it ever dials out.",features:["Website auto-fill","Prompt studio","English & Urdu","Live test call"],stat:String(uo),statLabel:"production voices"},{icon:Wo,tag:"Dial at scale",title:"Outbound Campaigns",description:"Import a contact list from CSV, point an agent at it and launch. Calls go out in concurrent batches, with optional do-not-call screening.",features:["CSV contact import","DNC screening","Campaign analytics","Full call logs"],stat:String(hA),statLabel:"calls at a time"},{icon:ta,tag:"Never miss a call",title:"AI Receptionist",description:"Assign an agent to your number and it answers inbound calls, qualifies the caller, and transfers to a human when it matters.",features:["Inbound call logs","Agent per number","Live transfer","After-hours cover"],stat:"24/7",statLabel:"always answering"},{icon:rc,tag:"Full call history",title:"Recordings & Transcripts",description:"Every call is recorded and transcribed with speaker labels, plus an AI summary. All of it is pulled into your dashboard automatically.",features:["Audio playback","Speaker transcript","Call summary","Automatic sync"],stat:"Every",statLabel:"call recorded"},{icon:Ig,tag:"Hands-free follow-up",title:"Post-Call Automation",description:"Drag-and-drop flows that run the moment a call ends: text the caller, have an agent call back, update the contact, or post to a webhook.",features:["SMS follow-up","Call-back action","Webhooks","Version history"],stat:"0",statLabel:"code required"},{icon:uu,tag:"Pay as you go",title:"Numbers & Billing",description:"Provision a phone number, top up a balance, and see the exact cost of every single call. No plans, no monthly commitment.",features:["Phone numbers","Wallet balance","Auto recharge","Per-call costs"],stat:`~${xw}`,statLabel:"per minute"}],$se=()=>o.jsx("section",{id:"features",className:"py-24 relative",children:o.jsxs("div",{className:"container mx-auto px-4",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("span",{className:"badge-pill mb-4",children:"THE PLATFORM"}),o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold mt-4",children:["Everything you need to ",o.jsx("span",{className:"text-gradient",children:"run AI phone calls"})]}),o.jsx("p",{className:"text-muted-foreground mt-4 max-w-xl mx-auto",children:"Six parts of the platform, all in one dashboard, from building the agent to seeing what each call cost."})]}),o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:Ise.map(e=>o.jsxs("div",{className:"surface-card p-6 flex flex-col gap-4 group",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:o.jsx(e.icon,{size:20,className:"text-primary"})}),o.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e.tag})]}),o.jsx("h3",{className:"text-xl font-bold text-foreground",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),o.jsx("div",{className:"flex flex-wrap gap-2 mt-auto",children:e.features.map(t=>o.jsx("span",{className:"text-xs px-2.5 py-1 rounded-md bg-secondary text-secondary-foreground",children:t},t))}),o.jsxs("div",{className:"pt-4 border-t border-border flex items-baseline gap-2",children:[o.jsx("span",{className:"text-3xl font-black text-gradient",children:e.stat}),o.jsx("span",{className:"text-sm text-muted-foreground",children:e.statLabel})]})]},e.title))})]})}),Dse=[{label:"Production voices",value:String(uo),icon:Oi},{label:"Language modes",value:String(Du.length),icon:iw}
768,{label:"Always answering",value:"24/7",icon:aw},{label:"Call recorded",value:"Every",icon:rc}],Rse=[{name:"Elliot",accent:"Canadian",note:"Friendly, professional"},{name:"Savannah",accent:"American (Southern)",note:"Warm, straightforward"},{name:"Clara",accent:"American",note:"Warm, professional"},{name:"Kai",accent:"American",note:"Friendly, relaxed"},{name:"Layla",accent:"American",note:"Bright, cheerful"},{name:"Nico",accent:"American",note:"Young, casual"},{name:"Sid",accent:"American",note:"Laid-back, deep-toned"},{name:"Godfrey",accent:"American",note:"Young, energetic"},{name:"Emma",accent:"Asian American",note:"Warm, conversational"},{name:"Rohan",accent:"Indian American",note:"Bright, energetic"},{name:"Sagar",accent:"Indian American",note:"Steady, professional"},{name:"Neil",accent:"Indian American",note:"Clear, professional"},{name:"Naina",accent:"Indian American",note:"Calm, collected"},{name:"Zara",accent:"Pakistani (Urdu)",note:"Warm, professional"},{name:"Ali",accent:"Pakistani (Urdu)",note:"Steady, professional"}],Lse=[{name:"English",note:"Every voice, every accent"},{name:"Urdu",note:"Replies in Roman Urdu"},{name:"Multilingual",note:"Detects the caller's language and answers in kind"}],Fse=["Call recording on every call","Speaker-labelled transcript","AI summary of what was said","Transfer to a human mid-call"],Bse=()=>o.jsxs("section",{id:"technology",className:"py-24 relative overflow-hidden",children:[o.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[400px] rounded-full bg-primary/3 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("span",{className:"badge-pill mb-4",children:"Voices & Languages"}),o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold mt-4",children:["Pick a voice that ",o.jsx("span",{className:"text-gradient",children:"sounds human"})]}),o.jsxs("p",{className:"text-muted-foreground mt-4 max-w-2xl mx-auto",children:[uo," production voices across American, Canadian, Indian-American and Asian-American English, plus Pakistani Urdu. Preview any of them in the dashboard before you assign one to an agent."]})]}),o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-12",children:Dse.map(e=>o.jsxs("div",{className:"surface-card p-5 text-center",children:[o.jsx(e.icon,{size:20,className:"text-primary mx-auto mb-2"}),o.jsx("div",{className:"text-2xl font-black text-gradient",children:e.value}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.label})]},e.label))}),o.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 mb-12",children:[o.jsxs("div",{className:"surface-card p-6 min-w-0",children:[o.jsx("h3",{className:"text-lg font-bold mb-4 text-foreground",children:"Voice roster"}),o.jsx("div",{className:"space-y-2 max-h-[340px] overflow-y-auto pr-1",children:Rse.map(e=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-secondary/50",children:[o.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Oi,{size:14,className:"text-primary"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-semibold text-sm text-foreground",children:e.name}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:e.note})]}),o.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.accent})]},e.name))})]}),o.jsxs("div",{className:"flex flex-col gap-6",children:[o.jsxs("div",{className:"surface-card p-6 min-w-0",children:[o.jsx("h3",{className:"text-lg font-bold mb-4 text-foreground",children:"Languages"}),o.jsx("div",{className:"space-y-2",children:Lse.map(e=>o.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg bg-secondary/50 px-3 py-2.5",children:[o.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),o.jsx("span",{className:"text-xs text-muted-foreground text-right",children:e.note})]},e.name))}),o.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"Set per agent: the transcriber and voice both follow the language you choose."})]}),o.jsxs("div",{className:"surface-card p-6 flex-1",children:[o.jsx("h3",{className:"text-lg font-bold mb-4 text-foreground",children:"Included on every agent"}),o.jsx("ul",{className:"space-y-2.5",children:Fse.map(e=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),e]},e))})]})]})]}),o.jsx("div",{className:"text-center",children:o.jsx(jt,{to:"/register",children:o.jsx(ne,{size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 px-8 gap-2",children:"Create your first agent"})})})]})]}),zse=[{step:"Step 1",title:"Create your account",desc:"Sign up and confirm your email. We drop $20 of free credit into your balance so you can test properly before spending anything.",icon:uw},{step:"Step 2",title:"Build your agent",desc:"A guided setup asks what the agent should achieve, which industry it's for, and which voice to use. Paste your website to auto-fill its goal, add your FAQs as knowledge, then talk to it live in your browser.",icon:zn},{step:"Step 3",title:"Get a phone number",desc:"Buy a US local number from the dashboard, then assign your agent to it. $3 per month, charged from your balance.",icon:Un},{step:"Step 4",title:"Go live",desc:"For outbound, point the agent at a contact list and launch a campaign. For inbound, it simply starts answering, including outside business hours.",icon:Np},{step:"Step 5",title:"Review every call",desc:"Listen to the recording, read the transcript, check the AI summary, and see exactly what that call cost you.",icon:cu}],Use=()=>o.jsx("section",{className:"py-24",children:o.jsxs("div",{className:"container mx-auto px-4",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("span",{className:"badge-pill mb-4",children:"GETTING STARTED"}),o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold mt-4",children:["From sign-up to your ",o.jsx("span",{className:"text-gradient",children:"first call"})]}),o.jsx("p",{className:"text-muted-foreground mt-4 max-w-xl mx-auto",children:"It's self-serve. You don't need a sales call or an onboarding project to get an agent on the phone."})]}),o.jsxs("div",{className:"relative max-w-4xl mx-auto",children:[o.jsx("div",{className:"hidden md:block absolute left-8 top-0 bottom-0 w-px bg-gradient-to-b from-primary/50 via-primary/20 to-transparent"}),o.jsx("div",{className:"space-y-8",children:zse.map(e=>o.jsxs("div",{className:"flex gap-6 items-start group",children:[o.jsx("div",{className:"hidden md:flex flex-col items-center",children:o.jsx("div",{className:"w-16 h-16 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center group-hover:bg-primary/20 transition-colors",children:o.jsx(e.icon,{size:24,className:"text-primary"})})}),o.jsxs("div",{className:"surface-card p-6 flex-1",children:[o.jsx("span",{className:"text-xs font-bold text-primary uppercase tracking-wider",children:e.step}),o.jsx("h3",{className:"text-lg font-bold text-foreground mt-1",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:e.desc})]})]},e.title))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-16 text-center",children:[o.jsxs("div",{children:[o.jsx("div",{className:"stat-number",children:"$20"}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Free credit to start"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"stat-number",children:"5"}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Steps to your first call"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"stat-number",children:"$0"}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Monthly platform fee"})]})]}),o.jsx("div",{className:"text-center mt-12",children:o.jsx(jt,{to:"/register",children:o.jsx(ne,{size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 px-8",children:"Create your account"})})})]})}),Vse=[{icon:rc,title:"The recording",desc:"Play back the full call straight from the conversation list."},{icon:qi,title:"The transcript",desc:"Speaker-labelled, so you can see who said what and when."},{icon:Mi,title:"An AI summary",desc:"A short write-up of what happened, generated automatically."},{icon:c8,title:"What it cost",desc:"The duration and the actual charge for that specific call, itemised."},{icon:cw,title:"Transfer outcome",desc:"Whether the agent handed the caller off to a human, and to which number."},{icon:Zx,title:"Balance alerts",desc:"Get notified as your credit runs low, before calls start failing."}],Wse=[{label:"Call duration",value:"2 min 30 sec"},{label:"Typical rate",value:"~$0.35 / min"},{label:"Charged to balance",value:"~$0.88",strong:!0}],qse=()=>o.jsxs("section",{className:"py-24 relative overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-primary/[0.02] via-trans
768parent to-transparent pointer-events-none"}),o.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("span",{className:"badge-pill mb-4",children:"Full Visibility"}),o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold mt-4",children:["Know exactly what happened ",o.jsx("span",{className:"text-gradient",children:"on every call"})]}),o.jsx("p",{className:"text-muted-foreground mt-4 max-w-xl mx-auto",children:"Nothing is a black box. Each completed call lands in your dashboard with the audio, the transcript and its cost attached."})]}),o.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-10",children:Vse.map(e=>o.jsxs("div",{className:"surface-card p-5",children:[o.jsx(e.icon,{size:18,className:"text-primary mb-3"}),o.jsx("div",{className:"text-sm font-semibold text-foreground",children:e.title}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.desc})]},e.title))}),o.jsxs("div",{className:"surface-card p-6 max-w-md mx-auto",children:[o.jsx("h3",{className:"text-sm font-bold text-foreground mb-1",children:"How a call is billed"}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"An example, so there are no surprises on your balance."}),o.jsx("div",{className:"space-y-2",children:Wse.map(e=>o.jsxs("div",{className:`flex items-center justify-between rounded-lg px-3 py-2.5 text-sm ${e.strong?"bg-primary/10 font-semibold text-foreground":"bg-secondary/50 text-muted-foreground"}`,children:[o.jsx("span",{children:e.label}),o.jsx("span",{className:e.strong?"text-primary":"text-foreground",children:e.value})]},e.label))}),o.jsx("p",{className:"mt-4 pt-4 border-t border-border text-xs text-muted-foreground",children:"You're only charged for connected minutes, and each call is billed at its actual cost, so the real figure varies slightly per call. Phone numbers are billed separately at $3 per month."})]})]})]}),Hse=[{icon:Wre,title:"Lead qualification",desc:"Call new enquiries, ask your qualifying questions, and transfer the promising ones to a salesperson while they're still on the line.",tag:"Outbound campaign + live transfer"},{icon:s8,title:"After-hours reception",desc:"Let an agent answer when your office is closed, so evening and weekend callers get a real conversation instead of voicemail.",tag:"Inbound agent on your number"},{icon:hre,title:"Appointment reminders",desc:"Ring through a list of upcoming bookings to confirm, reschedule, or flag the no-shows before they happen.",tag:"Outbound campaign + contact list"},{icon:u8,title:"Re-engaging old leads",desc:"Work back through a list that went cold and find out who's still interested, without tying up your team for days.",tag:"Outbound campaign"},{icon:XB,title:"Support triage",desc:"Answer the questions that come up constantly from the knowledge you give the agent, and pass anything unusual to a human.",tag:"Inbound agent + knowledge + live transfer"},{icon:Ore,title:"Status and follow-up calls",desc:"Place routine update calls such as order status, document chasing, and post-service check-ins, then send a follow-up text or update the contact automatically.",tag:"Outbound campaign + automation"}],Gse=()=>o.jsx("section",{className:"py-24",children:o.jsxs("div",{className:"container mx-auto px-4",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold",children:["What people ",o.jsx("span",{className:"text-gradient",children:"build with it"})]}),o.jsx("p",{className:"text-muted-foreground mt-4 max-w-xl mx-auto",children:"Every setup below is the same three ingredients: an agent, a phone number, and optionally a contact list."})]}),o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:Hse.map(e=>o.jsxs("div",{className:"surface-card p-6 flex flex-col gap-3",children:[o.jsx(e.icon,{size:20,className:"text-primary"}),o.jsx("h3",{className:"text-lg font-bold text-foreground",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc}),o.jsx("div",{className:"mt-auto pt-3 border-t border-border",children:o.jsx("span",{className:"text-xs font-medium text-primary",children:e.tag})})]},e.title))})]})}),Yse=[{label:"Availability",trad:"Business hours",edm:"Any hour",desc:"An agent picks up at 2am and on weekends without a night shift."},{label:"Time to ramp up",trad:"Recruit & train",edm:"Configure & test",desc:"Set the goal, voice and knowledge, then test it in the same sitting."},{label:"Cost when idle",trad:"Paid regardless",edm:"Nothing",desc:"You're billed per connected minute, so quiet days cost you nothing."}],Kse=["Answers outside business hours","Follows the same script every call","Records and transcribes every call","Handles several calls at once","Costs nothing while idle"],Xse=()=>o.jsx("section",{id:"advertisers",className:"py-24",children:o.jsxs("div",{className:"container mx-auto px-4",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("span",{className:"badge-pill mb-4",children:"Why AI agents"}),o.jsxs("h2",{className:"text-3xl md:text-5xl font-bold mt-4",children:["How it compares to ",o.jsx("span",{className:"text-gradient",children:"an in-house calling team"})]})]}),o.jsx("div",{className:"grid md:grid-cols-3 gap-6 mb-16 max-w-4xl mx-auto",children:Yse.map(e=>o.jsxs("div",{className:"surface-card p-6 text-center",children:[o.jsx("h3",{className:"text-sm font-bold text-muted-foreground uppercase tracking-wider mb-4",children:e.label}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-secondary/60",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"In-house team"}),o.jsx("span",{className:"text-sm font-bold text-foreground",children:e.trad})]}),o.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-primary/10",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"EDM Nexus"}),o.jsx("span",{className:"text-sm font-bold text-primary",children:e.edm})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:e.desc})]},e.label))}),o.jsxs("div",{className:"surface-card p-6 max-w-2xl mx-auto",children:[o.jsx("h3",{className:"text-lg font-bold text-foreground mb-6 text-center",children:"What an AI agent does differently"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-3 text-xs font-bold text-muted-foreground uppercase tracking-wider pb-3 border-b border-border",children:[o.jsx("span",{children:"Capability"}),o.jsx("span",{className:"text-center",children:"In-house team"}),o.jsx("span",{className:"text-center",children:"EDM Nexus"})]}),Kse.map(e=>o.jsxs("div",{className:"grid grid-cols-3 items-center py-2",children:[o.jsx("span",{className:"text-sm text-foreground",children:e}),o.jsx("span",{className:"flex justify-center",children:o.jsx(rn,{size:16,className:"text-muted-foreground
768/60"})}),o.jsx("span",{className:"flex justify-center",children:o.jsx(Ta,{size:16,className:"text-primary"})})]},e))]}),o.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:"AI agents aren't a replacement for a good sales team. They cover the calls that would otherwise go unanswered, and hand the promising ones straight over to a person."})]}),o.jsx("div",{className:"text-center mt-10",children:o.jsx(jt,{to:"/register",children:o.jsx(ne,{size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 px-8",children:"Try it with $20 free credit"})})})]})}),Os=({size:e="sm",linked:t=!0,className:n=""})=>{const r=e==="lg"?"h-11":"h-9",{resolvedTheme:a}=ew(),[s,i]=p.useState(!1);p.useEffect(()=>i(!0),[]);const l=s&&a==="light"?"/logo-light.svg":"/logo.svg",c=o.jsx("img",{src:l,alt:"EDM Nexus",className:`${r} w-auto object-contain ${n}`});return t?o.jsx(jt,{to:"/",className:"inline-flex items-center",children:c}):c},ob=({className:e})=>{const{resolvedTheme:t,setTheme:n}=ew(),[r,a]=p.useState(!1);p.useEffect(()=>a(!0),[]);const s=t==="dark";return o.jsx("button",{type:"button",onClick:()=>n(s?"light":"dark"),className:he("relative rounded-md p-2 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",e),"aria-label":s?"Switch to light mode":"Switch to dark mode",title:s?"Switch to light mode":"Switch to dark mode",children:r&&s?o.jsx(Rre,{className:"h-5 w-5"}):o.jsx(Tre,{className:"h-5 w-5"})})},eI=[{label:"Features",href:"/features"},{label:"Technology",href:"/technology"},{label:"Agencies",href:"/advertisers"},{label:"Inbound Teams",href:"/publishers"},{label:"Use Cases",href:"/use-cases"},{label:"Pricing",href:"/pricing"},{label:"About",href:"/about"},{label:"Privacy",href:"/privacy"}],Ms=()=>{const[e,t]=p.useState(!1),n=mo(),{user:r}=vh();return o.jsxs("nav",{className:"fixed top-0 left-0 right-0 z-50 border-b border-border/50 backdrop-blur-xl bg-background/80",children:[o.jsxs("div",{className:"container mx-auto flex items-center justify-between h-16 px-4",children:[o.jsx(Os,{}),o.jsx("div",{className:"hidden lg:flex items-center gap-6",children:eI.map(a=>o.jsx(jt,{to:a.href,className:`text-sm transition-colors ${n.pathname===a.href?"text-primary font-medium":"text-muted-foreground hover:text-foreground"}`,children:a.label},a.label))}),o.jsxs("div",{className:"hidden lg:flex items-center gap-3",children:[o.jsx(ob,{}),r?o.jsx(jt,{to:"/dashboard",children:o.jsxs(ne,{size:"sm",className:"bg-primary text-primary-foreground hover:bg-primary/90 gap-1.5",children:[o.jsx(H2,{size:14})," Dashboard"]})}):o.jsxs(o.Fragment,{children:[o.jsx(jt,{to:"/login",children:o.jsx(ne,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground",children:"Login"})}),o.jsx(jt,{to:"/register",children:o.jsxs(ne,{size:"sm",className:"bg-primary text-primary-foreground hover:bg-primary/90 gap-1.5",children:[o.jsx(uw,{size:14})," Sign Up"]})})]})]}),o.jsx("button",{className:"lg:hidden text-foreground",onClick:()=>t(!e),children:e?o.jsx(rn,{size:24}):o.jsx(a8,{size:24})})]}),e&&o.jsx("div",{className:"lg:hidden border-t border-border bg-background/95 backdrop-blur-xl",children:o.jsxs("div",{className:"container mx-auto px-4 py-4 flex flex-col gap-3",children:[eI.map(a=>o.jsx(jt,{to:a.href,className:`text-sm py-2 ${n.pathname===a.href?"text-primary font-medium":"text-muted-foreground hover:text-foreground"}`,onClick:()=>t(!1),children:a.label},a.label)),o.jsxs("div",{className:"flex gap-3 pt-3 border-t border-border",children:[o.jsx(jt,{to:"/login",onClick:()=>t(!1),children:o.jsx(ne,{variant:"ghost",size:"sm",className:"text-muted-foreground",children:"Login"})}),o.jsx(jt,{to:"/register",onClick:()=>t(!1),children:o.jsx(ne,{size:"sm",className:"bg-primary text-primary-foreground",children:"Sign Up"})})]})]})})]})},Jse=[{label:"Agent Builder",to:"/features#build"},{label:"Campaigns & Receptionist",to:"/features#call"},{label:"Recordings & Transcripts",to:"/features#review"},{label:"Post-Call Automation",to:"/features#automate"},{label:"How It Works",to:"/technology"},{label:"Pricing",to:"/pricing"}],Qse=[{label:"About",to:"/about"},{label:"Use Cases",to:"/use-cases"},{label:"For Agencies",to:"/advertisers"},{label:"For Inbound Teams",to:"/publishers"}],Zse=[{label:"Privacy Policy",to:"/privacy"}],eie=()=>o.jsx("footer",{className:"border-t border-border py-16",children:o.jsxs("div",{className:"container mx-auto px-4",children:[o.jsxs("div",{className:"grid md:grid-cols-4 gap-10",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-4",children:o.jsx(Os,{linked:!1})}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"AI voice agents that make and answer your calls, billed by the minute."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-bold text-foreground mb-4",children:"Platform"}),o.jsx("div",{className:"space-y-2",children:Jse.map(e=>o.jsx(jt,{to:e.to,className:"block text-sm text-muted-foreground hover:text-foreground transition-colors",children:e.label},e.label))})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-bold text-foreground mb-4",children:"Company"}),o.jsx("div",{className:"space-y-2",children:Qse.map(e=>o.jsx(jt,{to:e.to,className:"block text-sm text-muted-foreground hover:text-foreground transition-colors",children:e.label},e.label))})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-bold text-foreground mb-4",children:"Contact"}),o.jsx("div",{className:"space-y-3",children:o.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(hh,{size:14,className:"text-primary"})," [email protected]"]})})]})]}),o.jsxs("div",{className:"border-t border-border mt-12 pt-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[o.jsxs("p",{className:"text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," EDM Nexus. All rights reserved."]}),o.jsx("div",{className:"flex gap-6",children:Zse.map(e=>o.jsx(jt,{to:e.to,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:e.label},e.label))})]})]})}),tie=()=>{const{pathname:e,hash:t}=mo();p.useEffect(()=>{if(t){const n=document.getElementById(decodeURIComponent(t.slice(1)));if(n){n.scrollIntoView();return}}window.scrollTo(0,0)},[e,t])},Hi=({children:e})=>(tie(),o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsx("main",{children:e}),o.jsx(eie,{})]})),Ru=({eyebrow:e,title:t,highlight:n,description:r,children:a})=>o.jsxs("section",{className:"relative pt-32 pb-16 md:pb-20 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 w-[600px] max-w-full h-[600px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"container mx-auto px-4 relative z-10 text-center",children:[o.jsxs("div",{className:"badge-pill mx-auto mb-6 animate-slide-up",children:[o.jsx("span",{className:"w-2 h-2 rounded-full bg-primary animate-pulse-glow"}),e]}),o.jsxs("h1",{className:"text-4xl md:text-6xl font-black tracking-tight mb-5 animate-slide-up",style:{animationDelay:"0.1s"},children:[t," ",o.jsx("span",{className:"text-gradient",children:n})]}),o.jsx("p",{className:"text-muted-foreground text-base md:text-lg max-w-2xl mx-auto animate-slide-up",style:{animationDelay:"0.2s"},children:r}),a&&o.jsx("div",{className:"mt-10 animate-slide-up",style:{animationDelay:"0.3s"},children:a})]})]}),sa=({id:e,eyebrow:t,title:n,highlight:r,description:a,children:s,className:i=""})=>o.jsx("section",{id:e,className:`py-14 md:py-20 scroll-mt-20 ${i}`,children:o.jsxs("div",{className:"container mx-auto px-4",children:[(t||n)&&o.jsxs("div",{className:"text-center mb-10 md:mb-14",children:[t&&o.jsx("span",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary",children:t}),n&&o.jsxs("h2",{className:"text-3xl md:text-4xl font-bold mt-3",children:[n," ",r&&o.jsx("span",{className:"text-gradient",children:r})]}),a&&o.jsx("p",{className:"text-muted-foreground mt-4 max-w-2xl mx-auto",children:a})]}),s]})}),ww=({icon:e,title:t,desc:n,badge:r,points:a})=>o.jsxs("div",{className:"surface-card p-6 flex flex-col group h-full",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[o.jsx("div",{className:"w-11 h-11 shrink-0 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center group-hover:bg-primary/20 transition-colors",children:o.jsx(e,{size:20,className:"text-primary"})}),r&&o.jsx("span",{className:"text-[11px] font-mono text-primary bg-primary/10 px-2 py-1 rounded-md text-right",children:r})]}),o.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n}),a&&a.length>0&&o.jsx("ul",{className:"mt-4 pt-4 border-t border-border space-y-1.5",children:a.map(s=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1 w-1 shrink-0 rounded-full bg-primary"}),s]},s))})]}),mA=({stats:e})=>o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4 max-w-4xl mx-auto",children:e.map(t=>o.jsxs("div",{className:"text-center p-4 md:p-5 rounded-xl border border-border bg-card",children:[o.jsx("div",{className:"text-2xl md:text-3xl font-black text-gradient mb-1",children:t.value}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t.label})]},t.label))}),lz=({steps:e})=>o.jsx("ol",{className:`grid gap-4 md:gap-6 sm:grid-cols-2 ${e.length>=4?"lg:grid-cols-4":"lg:grid-cols-3"}`,children:e.map((t,n)=>o.jsxs("li",{className:"surface-card p-6 relative",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground text-sm font-bold",children:n+1}),o.jsx(t.icon,{size:18,className:"text-primary"})]}),o.jsx("h3",{className:"font-bold text-foreground mb-1.5",children:t.title}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.desc})]},t.title))}),jw=({label:e=`Start with ${bw} free credit`})=>o.jsx(jt,{to:"/register",children:o.jsxs(ne,{size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 px-8 gap-2 text-base",children:[e," ",o.jsx(Wi,{size:18})]})}),Lu=({title:e="Put your first agent on the phone today",description:t=`Sign up, verify your email, and ${bw} of free credit lands in your balance. No card, no subscription, no sales call.`})=>o.jsx("section",{className:"py-16 md:py-24",children:o.jsx("div",{className:"container mx-auto px-4",children:o.jsxs("div",{className:"glow-border relative overflow-hidden rounded-2xl bg-card px-6 py-12 md:px-12 md:py-16 text-center",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsxs("div",{className:"relative",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-foreground",children:e}),o.jsx("p",{className:"text-muted-foreground mt-4 max-w-xl mx-auto",children:t}),o.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-center gap-3",children:[o.jsx(jw,{}),o.jsx(jt,{to:"/pricing",children:o.jsx(ne,{size:"lg",variant:"outline",className:"px-8",children:"See how pricing works"})})]})]})]})})}),nie=()=>o.jsxs(Hi,{children:[o.jsx(Ese,{}),o.jsx($se,{}),o.jsx(Bse,{}),o.jsx(Use,{}),o.jsx(qse,{}),o.jsx(Gse,{}),o.jsx(Xse,{})]}),tI=[{id:"build",eyebrow:"01 · Build",title:"Build an agent",highlight:"in one sitting",description:"A guided four-step builder takes you from a blank page to an agent you've already talked to.",features:[{icon:zn,title:"Guided agent builder",desc:"Setup, Knowledge, Prompt Studio and Testing, in that order. Name the agent, give it a goal, pick an industry and voice, and you're most of the way there.",badge:"No code",points:["Unlimited agents per account","Duplicate an agent to reuse a setup","Edit voice, prompt or transfer number any time"]},{icon:GB,title:"Start from your website",desc:"Paste your site's URL and hit Analyze. The builder reads the page and suggests the agent's main goal for you to accept or edit.",badge:"Auto-fill"},{icon:rw,title:"Knowledge & Prompt Studio",desc:"Paste your FAQs, pricing or policies as the agent's knowledge, then fine-tune the system prompt and the greeting it opens every call with.",badge:"8,000 chars"},{icon:G2,title:`${Lg} industries`,desc:"Tag each agent with its industry, from insurance and real estate to legal, healthcare, debt services and telecom, so your roster stays organized.",badge:"Searchable"},{icon:Oi,title:`${uo} production voices`,desc:"American, Canadian, Indian-American and Asian-American English voices, plus two Pakistani Urdu voices. Preview any of them with your own sample line.",badge:`${uo} voices`},{icon:iw,title:"English, Urdu or multilingual",desc:"Pick a language per agent. Urdu agents reply in Roman Urdu, and multilingual agents detect the caller's language and answer in kind.",badge:`${Du.length} modes`},{icon:As,title:"Test before it dials",desc:"Talk to your agent in the browser with a live voice call, or chat with it in text, before it ever touches a real phone line.",badge:"Live voice test"}]},{id:"call",eyebrow:"02 · Call",title:"Make and answer",highlight:"real phone calls",description:"Put an agent on a number and it starts working, outbound, inbound, or both.",features:[{icon:Wo,title:"Outbound campaigns",desc:"Pick an agent, a contact list and a number to call from, then launch. A pre-launch check confirms everything is ready before the first dial.",badge:`${hA} at a time`,points:["Calls placed in concurrent batches","Live progress and completion tracking","Pause or resume from the campaign list"]},{icon:ta,title:"AI receptionist",desc:"Assign an agent to a number and every inbound call gets answered, including evenings, weekends and holidays.",badge:"24/7"},{icon:cw,title:"Live call transfer",desc:"Give the agent a transfer number and it hands qualified or complicated callers to your team mid-call instead of hanging up.",badge:"Warm handoff"},{icon:Un,title:"Phone numbers",desc:"Buy a US local number from the dashboard, set it for inbound, outbound or both, assign an agent, and place a test call to hear it working.",badge:`${Pp}/month`},{icon:ac,title:"Do-not-call screening",desc:"Turn on DNC screening for a campaign and numbers on do-not-call or known-litigator lists are skipped automatically, with a notification for each one.",badge:"Optional"}]},{id:"review",eyebrow:"03 · Review",title:"See exactly what happened",highlight:"on every call",description:"Nothing disappears into a black box. Each call comes back with its audio, words and outcome attached.",features:[{icon:rc,title:"Call recordings",desc:"Every call is recorded. Play it back at 1×, 1.5× or 2×, or download the audio.",badge:"Every call"},{icon:qi,title:"Speaker-labelled transcripts",desc:"See who said what. Click any line of the transcript to jump straight to that moment in the recording.",badge:"Click to seek"},{icon:Mi,title:"AI call summaries",desc:"A few bullet points on what was discussed, the next steps and the caller's sentiment, written as soon as the call ends.",badge:"Auto-generated"},{icon:Are,title:"All conversations in one place",desc:"Filter every call by agent, contact, status, direction, qualification or date, with separate inbound and outbound call logs.",badge:"Filterable"},{icon:cu,title:"Analytics",desc:"Call volume, completion and qualification at a glance, a 14-day trend, and breakdowns by campaign and by agent.",badge:"3 views"}]},{id:"automate",eyebrow:"04 · Automate",title:"Follow up",highlight:"without lifting a finger",description:"Drag-and-drop flows that run the moment a call ends, so the next step happens automatically.",features:[{icon:Ig,title:"Visual flow builder",desc:"Chain triggers, logic and actions on a canvas. Flows fire when an inbou
768nd or web call ends.",badge:"Drag & drop",points:["Condition, Delay and Split operators","Personalize with {{contact_name}}, {{duration}} and more"]},{icon:o8,title:"SMS and call-back actions",desc:"Text the caller from your own number, or have an agent call them back, based on how the call went.",badge:"Actions"},{icon:Z2,title:"Webhooks & contact updates",desc:"Push call results to your CRM or any system with a webhook, and update the contact's status automatically.",badge:"Connect anything"},{icon:ZB,title:"Versions and run history",desc:"Every saved flow keeps its version history so you can roll back, and every run is logged so you can see what fired.",badge:"Audit trail"}]},{id:"manage",eyebrow:"05 · Manage",title:"Run the whole account",highlight:"from one dashboard",description:"Contacts, teammates and money, all without leaving the dashboard.",features:[{icon:Fs,title:"Contacts & lists",desc:"Import contacts from CSV straight into a new or existing list, or add them one by one, then target a list with a campaign.",badge:"CSV import"},{icon:Q2,title:"Team roles",desc:"Invite teammates by email as a Member who can build and edit, or a Viewer with read-only access. Only the owner can delete.",badge:"Owner · Member · Viewer"},{icon:du,title:"Global search & quick setup",desc:"Jump to any agent, contact, number or campaign from one search box, and follow a guided checklist from sign-up to your first campaign.",badge:"Get started fast"},{icon:oc,title:"Prepaid wallet & itemized costs",desc:"Top up a balance, save a card, redeem promo codes, and see the duration and charge of every single call.",badge:"Pay as you go"},{icon:Zx,title:"Alerts & auto recharge",desc:"Get notified as your balance runs low, or let a saved card top it up automatically so campaigns and inbound lines never stop.",badge:"Never run dry"}]}],rie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"PLATFORM CAPABILITIES",title:"Everything to put an agent",highlight:"on the phone",description:"Build the agent, give it a number, let it call, and review every conversation. It all happens in one dashboard, billed by the minute.",children:o.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:tI.map(e=>o.jsx("a",{href:`#${e.id}`,className:"px-4 py-2 rounded-full text-sm font-medium bg-secondary text-secondary-foreground border border-border hover:border-primary/40 hover:text-foreground transition-colors",children:e.eyebrow.split("· ")[1]},e.id))})}),o.jsx("div",{className:"container mx-auto px-4",children:o.jsx(mA,{stats:[{value:String(uo),label:"Production voices"},{value:String(Du.length),label:"Language modes"},{value:String(Lg),label:"Industries"},{value:"24/7",label:"Inbound answering"}]})}),tI.map((e,t)=>o.jsx(sa,{id:e.id,eyebrow:e.eyebrow,title:e.title,highlight:e.highlight,description:e.description,className:t%2===1?"bg-secondary/20":"",children:o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:e.features.map(n=>o.jsx(ww,{...n},n.title))})},e.id)),o.jsx(Lu,{})]}),nI=[{icon:wf,title:"Connect",desc:"A caller rings your number, or a campaign dials a contact from your list."},{icon:jre,title:"Listen",desc:"The caller's speech is transcribed to text in real time, as they talk."},{icon:dre,title:"Think",desc:"A language model decides the reply from your prompt, knowledge and goal, or transfers the call."},{icon:U2,title:"Speak",desc:"The reply is spoken in the agent's voice, in a continuous back-and-forth."},{icon:zB,title:"Wrap up",desc:"Recording, transcript, summary and cost are saved, and your automations fire."}],aie=[{icon:iw,title:"Language-aware speech",desc:"Each agent's transcriber and voice follow the language you pick. Urdu and multilingual agents use a speech model built for mixed-language callers.",badge:Du.join(" · ")},{icon:U2,title:"Natural voice output",desc:`${uo} production voices across English accents and Pakistani Urdu, each previewable in the dashboard before you assign it.`,badge:`${uo} voices`},{icon:cw,title:"Built-in transfer tool",desc:"When you add a transfer number, the agent gets a transfer tool it can use mid-conversation, telling the caller to hold while it connects them.",badge:"Mid-call"},{icon:$u,title:"Automatic call sync",desc:"Call results stream into your dashboard as calls end, and a background sync keeps pulling in anything that arrived late, so no call goes missing.",badge:"Self
768-healing"},{icon:Ig,title:"Post-call automation engine",desc:"The moment a call ends, matching flows run their conditions and actions: texts, call-backs, webhooks and contact updates.",badge:"Event-driven"},{icon:oc,title:"Per-call cost metering",desc:"Each call's real voice and carrier cost is metered and deducted from your balance individually, so every charge is itemized.",badge:"Metered"}],oie=[{icon:r8,title:"Encrypted in transit",desc:"Traffic between your browser, our servers and our providers is encrypted."},{icon:_re,title:"Hashed passwords, verified emails",desc:"Passwords are stored only as one-way hashes, and accounts must verify their email before signing in."},{icon:Q2,title:"Server-enforced roles",desc:"Owner, Member and Viewer permissions are checked on every request, not just hidden in the UI."},{icon:uu,title:"Cards never touch our servers",desc:"Card details go straight to our payment processor. We only keep the brand and last four digits."},{icon:ac,title:"Fail-safe DNC screening",desc:"With screening on, a number that can't be checked is skipped rather than dialed."},{icon:oc,title:"Balance protection",desc:"Outbound calls need a positive balance, so a campaign can't quietly run up a bill you didn't fund."}],sie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"HOW IT WORKS",title:"What happens on",highlight:"every call",description:"A plain look at the pipeline behind each call your agent makes or answers, and what we do to keep it reliable."}),o.jsx("section",{className:"pb-6",children:o.jsx("div",{className:"container mx-auto px-4",children:o.jsx("div",{className:"glow-border rounded-2xl p-6 md:p-10 bg-card",children:o.jsx("ol",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-5",children:nI.map((e,t)=>o.jsxs("li",{className:"relative text-center",children:[t<nI.length-1&&o.jsx("div",{className:"hidden lg:block absolute top-7 left-[calc(50%+2.25rem)] right-[calc(-50%+2.25rem)] h-px bg-gradient-to-r from-primary/50 to-primary/10"}),o.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center mx-auto mb-4",children:o.jsx(e.icon,{size:24,className:"text-primary"})}),o.jsxs("div",{className:"text-[11px] font-mono text-primary mb-1",children:["STEP ",t+1]}),o.jsx("h3",{className:"font-bold text-foreground mb-2",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]},e.title))})})})}),o.jsx(sa,{eyebrow:"Under the hood",title:"The parts that",highlight:"make it work",description:"Speech in, reasoning, speech out, then everything that happens after the caller hangs up.",children:o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:aie.map(e=>o.jsx(ww,{...e},e.title))})}),o.jsxs(sa,{eyebrow:"Security & safeguards",title:"Built to be",highlight:"trusted with your calls",className:"bg-secondary/20",children:[o.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:oie.map(e=>o.jsxs("div",{className:"flex gap-4 rounded-xl border border-border bg-card p-5",children:[o.jsx(e.icon,{size:20,className:"text-primary shrink-0 mt-0.5"}),o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold text-foreground text-sm",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.desc})]})]},e.title))}),o.jsx("p",{className:"text-xs text-muted-foreground text-center mt-8 max-w-2xl mx-auto",children:"We don't currently hold SOC 2, ISO 27001 or HIPAA certification, and the platform isn't intended for protected health information. See our privacy policy for details."})]}),o.jsx(sa,{children:o.jsx(mA,{stats:[{value:String(uo),label:"Production voices"},{value:String(Du.length),label:"Language modes"},{value:"Every",label:"Call recorded"},{value:"24/7",label:"Inbound availability"}]})}),o.jsx(Lu,{})]}),iie=[{icon:zn,title:"A dedicated agent per client",desc:`Give each client their own agent with its own goal, voice, knowledge and transfer number. Tag it with one of ${Lg} industries and duplicate a winning setup for the next client.`,badge:"Unlimited agents"},{icon:G2,title:"Client lists kept separate",desc:"Import each client's contacts from CSV into their own list, so a campaign only ever dials the people it's meant to.",badge:"CSV import"},{icon:Np,title:"Launch in minutes",desc:`A three-step campaign wizard and a pre-launch check, then calls go out ${hA} at a time. No dialer to configure, no callers to hire.`,badge:"Self
768-serve"},{icon:ac,title:"DNC screening per campaign",desc:"Switch on do-not-call screening for any campaign and numbers on DNC or known-litigator lists are skipped before they're dialed.",badge:"Compliance aid"},{icon:rc,title:"Proof of work on every call",desc:"Recordings, speaker-labelled transcripts and AI summaries for every call you made on a client's behalf. Play them back or download the audio.",badge:"Every call"},{icon:c8,title:"Know your margin",desc:"Every call's duration and exact charge is itemized, so you know your cost per campaign before you invoice the client.",badge:"Itemized"},{icon:cu,title:"Campaign reporting",desc:"Contacts, completed calls, qualified leads and progress for each campaign, plus a by-agent breakdown for side-by-side comparisons.",badge:"Per campaign"},{icon:Z2,title:"Results into their CRM",desc:"Automation flows can post call results to any webhook, text the lead, or update the contact the moment a call ends.",badge:"Automation"},{icon:Fs,title:"Bring your team",desc:"Invite account managers as Members to build and run campaigns, or as Viewers with read-only access. No seat fees.",badge:"No seat limit"}],lie=[{icon:uw,title:"Sign up once",desc:"One account for your agency. Verify your email and $20 of credit is added."},{icon:zn,title:"Build per client",desc:`Create an agent for each client and pick from ${uo} voices. Test it live in the browser.`},{icon:Un,title:"Add numbers & lists",desc:"Buy a number for each client's campaign and import their contact list."},{icon:zB,title:"Launch & report",desc:"Run the campaign, then hand back recordings, transcripts and results."}],cie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"FOR AGENCIES",title:"Run calling campaigns",highlight:"for every client",description:"Build a dedicated AI voice agent for each client, launch their outbound campaigns, and hand back a recording and transcript of every call you made on their behalf.",children:o.jsx(jw,{})}),o.jsx(sa,{eyebrow:"Why agencies use it",title:"One account,",highlight:"many clients",children:o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:iie.map(e=>o.jsx(ww,{...e},e.title))})}),o.jsx(sa,{eyebrow:"How it works",title:"From new client to",highlight:"first campaign",className:"bg-secondary/20",children:o.jsx(lz,{steps:lie})}),o.jsx(Lu,{title:"Take on more calling work without more callers",description:"Pay only for the minutes each client's campaign uses. No subscriptions, seat licenses or annual contracts."})]}),uie=[{icon:ta,title:"Never miss an inbound call",desc:"Every call to your number gets answered right away, whether it's the first call of the day or several at once.",badge:"Instant pickup"},{icon:s8,title:"Cover the hours you can't",desc:"Evenings, weekends and holidays are covered without a night shift. The agent answers exactly as it would at 10am on a Tuesday.",badge:"24/7"},{icon:cw,title:"Hand off the calls that matter",desc:"The agent qualifies the caller and transfers them to your team the moment a call needs a real person. Transferred calls are flagged as qualified.",badge:"Live transfer"},{icon:iw,title:"Speak your callers' language",desc:"Run an English or Urdu receptionist, or a multilingual one that detects the caller's language and replies in kind.",badge:"Multilingual"},{icon:o8,title:"Automatic follow-up",desc:"When a call ends, an automation flow can text the caller, have an agent call them back, or push the lead to your CRM by webhook.",badge:"Automation"},{icon:rc,title:"A record of every conversation",desc:"Recordings, transcripts and AI summaries land in your inbound call log automatically, so nothing a caller said gets lost.",badge:"Every call"},{icon:WB,title:"Only pay for connected minutes",desc:"No seat cost for an agent sitting idle between calls. You're billed per minute of actual call time.",badge:"No idle cost"},{icon:ure,title:"Keep the line open",desc:"Low-balance alerts and auto recharge top up your wallet before it runs out, so your receptionist never goes quiet.",badge:"Auto recharge"}],die=[{icon:zn,title:"Build your receptionist",desc:"Tell it what your business does, paste your FAQs, and choose a voice and greeting."},{icon:Un,title:"Give it a number",desc:`Buy a US local number for ${Pp}/month and assign it to the agent.`},{icon:JB,title:"Add a transfer number",desc:"Give the agent a number to hand qualified callers to your team."},{icon:Mi,title:"Review and improve",desc:"Read the transcripts, spot what callers ask most, and refine the agent's knowledge."}],fie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"FOR INBOUND TEAMS",title:"Every inbound call,",highlight:"answered instantly",description:"If your business gets a steady stream of inbound calls from ads, listings or word of mouth, an AI receptionist means none of them go to voicemail.",children:o.jsx(jw,{})}
768),o.jsx(sa,{eyebrow:"Why inbound teams use it",title:"A receptionist that",highlight:"never clocks out",children:o.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-5",children:uie.map(e=>o.jsx(ww,{...e},e.title))})}),o.jsx(sa,{eyebrow:"Set up",title:"Live on your number",highlight:"in four steps",className:"bg-secondary/20",children:o.jsx(lz,{steps:die})}),o.jsx(Lu,{title:"Stop sending callers to voicemail",description:"Set up an AI receptionist in minutes and pay only for the time it spends on the phone."})]}),rI=[{icon:J2,vertical:"Insurance",title:"Renewal reminders and policy check-ins",description:"Call policyholders ahead of renewal, confirm their details, and transfer anyone who wants to talk to a licensed agent before their policy lapses.",direction:"Outbound",tags:["Outbound campaign","Live transfer","DNC screening"]},{icon:e8,vertical:"Real Estate",title:"Buyer and seller lead follow-up",description:"Work through your list of new buyer and seller leads, ask about budget, timeline and area, and pass the serious ones straight to an agent while they're still on the line.",direction:"Outbound",tags:["Outbound campaign","Live transfer","Qualified flag"]},{icon:qB,vertical:"Legal Services",title:"Intake screening for new enquiries",description:"Answer calls from prospective clients, work through your intake questions, and transfer qualified callers to an attorney immediately.",direction:"Inbound",tags:["AI receptionist","Live transfer","Transcripts"]},{icon:UB,vertical:"Home Services & Contracting",title:"Quote requests and job intake",description:"Pick up every homeowner's call, capture the job details, and text them a confirmation automatically once the call ends.",direction:"Inbound",tags:["AI receptionist","SMS follow-up","AI summary"]},{icon:QB,vertical:"Healthcare & Medical",title:"Appointment reminders and rescheduling",description:"Call ahead of upcoming appointments to confirm, reschedule or flag likely no-shows. Not intended for handling protected health information.",direction:"Outbound",tags:["Outbound campaign","Contact list"]},{icon:oc,vertical:"Debt & Credit Services",title:"Payment reminders and hardship triage",description:"Place routine reminder calls with DNC screening switched on, and transfer anyone asking about a plan to your team, with a transcript of every call kept.",direction:"Outbound",tags:["DNC screening","Live transfer","Transcripts"]}
768,{icon:t8,vertical:"Finance & Banking",title:"Application status and document chasing",description:"Call applicants who haven't sent their paperwork, explain what's missing, and update their contact status automatically after the call.",direction:"Outbound",tags:["Outbound campaign","Automation","Contact updates"]},{icon:DB,vertical:"Automotive Industry",title:"Service reminders and post-visit check-ins",description:"Remind customers when a vehicle is due for service, and follow up after a visit to make sure they were happy with the work.",direction:"Outbound",tags:["Outbound campaign","AI summary"]},{icon:YB,vertical:"Education",title:"Enrollment follow-ups",description:"Call prospective students who started an application but didn't finish, answer common questions, and connect them with admissions.",direction:"Outbound",tags:["Outbound campaign","Live transfer"]},{icon:l8,vertical:"Travel & Hospitality",title:"Reservations line and after-hours desk",description:"Answer booking and availability questions around the clock from your knowledge base, and transfer group or special requests to staff.",direction:"Inbound",tags:["AI receptionist","24/7","Knowledge"]},{icon:f8,vertical:"Retail & E-commerce",title:"Order questions and support triage",description:"Handle the questions that come up constantly, like shipping, returns and store hours, and pass anything unusual to a person.",direction:"Inbound",tags:["AI receptionist","Live transfer","Knowledge"]},{icon:m8,vertical:"Telecommunications & Internet",title:"Multilingual customer lines",description:"Serve English and Urdu-speaking customers from the same number with a multilingual agent that answers in the caller's language.",direction:"Inbound",tags:["Multilingual","AI receptionist","Urdu voices"]},{icon:V2,vertical:"SaaS & Technology",title:"Trial and demo follow-up",description:"Call trial sign-ups who went quiet, find out what's blocking them, and send the interested ones to sales by webhook.",direction:"Outbound",tags:["Outbound campaign","Webhook","Automation"]},{icon:KB,vertical:"Marketing & Professional Services",title:"Re-engaging cold leads",description:"Work back through a list of leads that went quiet and find out who's still interested, without tying up your team for days.",direction:"Outbound",tags:["Outbound campaign","Contact list","Analytics"]}],hie=["All","Inbound","Outbound"],mie=()=>{const[e,t]=p.useState("All"),n=e==="All"?rI:rI.filter(r=>r.direction===e);return o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"USE CASES",title:"The same platform,",highlight:"any industry",description:`Every example below is built from the same pieces: an agent, a phone number, and optionally a contact list and an automation. Agents can be tagged with any of ${Lg} industries.`}),o.jsxs(sa,{className:"pt-0 md:pt-0",children:[o.jsx("div",{className:"flex justify-center mb-10",children:o.jsx("div",{className:"inline-flex rounded-full border border-border bg-card p-1",role:"tablist","aria-label":"Filter use cases",children:hie.map(r=>o.jsx("button",{role:"tab","aria-selected":e===r,onClick:()=>t(r),className:`px-4 sm:px-5 py-2 rounded-full text-sm font-medium transition-colors ${e===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:r},r))})}),o.jsx("div",{className:"grid md:grid-cols-2 gap-5",children:n.map(r=>{const a=r.direction==="Inbound"?ta:Wo;return o.jsxs("div",{className:"surface-card p-6 flex flex-col",children:[o.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[o.jsx("div",{className:"w-12 h-12 shrink-0 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center",children:o.jsx(r.icon,{size:22,className:"text-primary"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[o.jsx("span",{className:"text-xs font-mono text-primary",children:r.vertical}),o.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[o.jsx(a,{size:12})," ",r.direction]})]}),o.jsx("h3",{className:"text-lg font-bold text-foreground",children:r.title})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4",children:r.description}),o.jsx("div",{className:"flex flex-wrap gap-2 mt-auto",children:r.tags.map(s=>o.jsx("span",{className:"text-xs font-mono px-2 py-1 rounded-md bg-primary/10 text-primary border border-primary/20",children:s},s))})]},r.vertical)})})]}),o.jsx(Lu,{title:"Your use case not listed?",description:"If it happens on a phone call, an agent can probably handle it. Build one and test it live in the browser before it calls anyone."})]})};var Sw="Collapsible",[pie,cz]=Gr(Sw),[gie,pA]=pie(Sw),uz=p.forwardRef((e,t)=>
vendor: 4,214 bytes, line 768
768{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:s,onOpenChange:i,...l}=e,[c,u]=lo({prop:r,defaultProp:a??!1,onChange:i,caller:Sw});return o.jsx(gie,{scope:n,disabled:s,contentId:Zn(),open:c,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),children:o.jsx(Ie.div,{"data-state":vA(c),"data-disabled":s?"":void 0,...l,ref:t})})});uz.displayName=Sw;var dz="CollapsibleTrigger",fz=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=pA(dz,n);return o.jsx(Ie.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":vA(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:xe(e.onClick,a.onOpenToggle)})});fz.displayName=dz;var gA="CollapsibleContent",hz=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=pA(gA,e.__scopeCollapsible);return o.jsx(da,{present:n||a.open,children:({present:s})=>o.jsx(vie,{...r,ref:t,present:s})})});hz.displayName=gA;var vie=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...s}=e,i=pA(gA,n),[l,c]=p.useState(r),u=p.useRef(null),d=at(t,u),f=p.useRef(0),h=f.current,m=p.useRef(0),v=m.current,g=i.open||l,y=p.useRef(g),x=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),er(()=>{const b=u.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();f.current=w.height,m.current=w.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(r)}},[i.open,r]),o.jsx(Ie.div,{"data-state":vA(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&a})});function vA(e){return e?"open":"closed"}var yie=uz,xie=fz,bie=hz,wie=p.createContext(void 0);function Nw(e){const t=p.useContext(wie);return e||t||"ltr"}var rs="Accordion",jie=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[yA,Sie,Nie]=Pg(rs),[_w,Rqe]=Gr(rs,[Nie,cz]),xA=cz(),mz=H.forwardRef((e,t)=>{const{type:n,...r}=e,a=r,s=r;return o.jsx(yA.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(Eie,{...s,ref:t}):o.jsx(kie,{...a,ref:t})})});mz.displayName=rs;var[pz,_ie]=_w(rs),[gz,Cie]=_w(rs,{collapsible:!1}),kie=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:s=!1,...i}=e,[l,c]=lo({prop:n,defaultProp:r??"",onChange:a,caller:rs});return o.jsx(pz,{scope:e.__scopeAccordion,value:H.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:H.useCallback(()=>s&&c(""),[s,c]),children:o.jsx(gz,{scope:e.__scopeAccordion,collapsible:s,children:o.jsx(vz,{...i,ref:t})})})}),Eie=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...s}=e,[i,l]=lo({prop:n,defaultProp:r??[],onChange:a,caller:rs}),c=H.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=H.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return o.jsx(pz,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:o.jsx(gz,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(vz,{...s,ref:t})})})}),[Aie,Cw]=_w(rs),vz=H.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:s="vertical",...i}=e,l=H.useRef(null),c=at(l,t),u=Sie(n),f=Nw(a)==="ltr",h=xe(e.onKeyDown,m=>{var P;if(!jie.includes(m.key))return;const v=m.target,g=u().filter(O=>{var $;return!(($=O.ref.current)!=null&&$.disabled)}),y=g.findIndex(O=>O.ref.current===v),x=g.length;if(y===-1)return;m.preventDefault();let b=y;const w=0,N=x-1,S=()=>{b=y+1,b>N&&(b=w)},_=()=>{b=y-1,b<w&&(b=N)};switch(m.key){case"Home":b=w;break;case"End":b=N;break;case"ArrowRight":s==="horizontal"&&(f?S():_());break;case"ArrowDown":s==="vertical"&&S();break;case"ArrowLeft":s==="horizontal"&&(f?_():S());break;case"ArrowUp":s==="vertical"&&_();break}const k=b%x;(P=g[k].ref.current)==null||P.focus()});return o.jsx(Aie,{scope:n,disabled:r,direction:a,orientation:s,children:o.jsx(yA.Slot,{scope:n,children:o.jsx(Ie.div,{...i,"data-orientation":s,ref:c,onKeyDown:r?void 0:h})})})}
768),sb="AccordionItem",[Pie,bA]=_w(sb),yz=H.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...a}=e,s=Cw(sb,n),i=_ie(sb,n),l=xA(n),c=Zn(),u=r&&i.value.includes(r)||!1,d=s.disabled||e.disabled;return o.jsx(Pie,{scope:n,open:u,disabled:d,triggerId:c,children:o.jsx(yie,{"data-orientation":s.orientation,"data-state":Nz(u),...l,...a,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});yz.displayName=sb;var xz="AccordionHeader",bz=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=Cw(rs,n),s=bA(xz,n);return o.jsx(Ie.h3,{"data-orientation":a.orientation,"data-state":Nz(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});bz.displayName=xz;var eC="AccordionTrigger",wz=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=Cw(rs,n),s=bA(eC,n),i=Cie(eC,n),l=xA(n);return o.jsx(yA.ItemSlot,{scope:n,children:o.jsx(xie,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...l,...r,ref:t})})});wz.displayName=eC;var jz="AccordionContent",Sz=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=Cw(rs,n),s=bA(jz,n),i=xA(n);return o.jsx(bie,{role:"region","aria-labelledby":s.triggerId,"data-orientation":a.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Sz.displayName=jz;function Nz(e){return e?"open":"closed"}var Tie=mz,Oie=yz,Mie=bz,_z=wz,Cz=Sz;const kz=Tie,wA=p.forwardRef(({className:e,...t},n)=>o.jsx(Oie,{ref:n,className:he("border-b",e),...t}));wA.displayName="AccordionItem";const jA=p.forwardRef(({className:e,children:t,...n},r)=>o.jsx(Mie,{className:"flex",children:o.jsxs(_z,{ref:r,className:he("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,o.jsx(Iu,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));jA.displayName=_z.displayName;const SA=p.forwardRef(({className:e,children:t,...n},r)=>o.jsx(Cz,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:o.jsx("div",{className:he("pb-4 pt-0",e),children:t})}));SA.displayName=Cz.displayName;const Iie=["Unlimited AI agents",`${uo} production voices, English, Urdu & multilingual`,"Outbound campaigns with CSV import and DNC screening","24/7 AI receptionist for inbound calls","Recording, transcript and AI summary on every call","Live transfer to your team","Post-call automation: SMS, call-backs, webhooks","Analytics, team roles and unlimited teammates"],$ie=[{icon:Un,title:"Phone numbers",value:`${Pp}/mo`,desc:"Per US local number, renewed monthly from your balance."},{icon:oc,title:"Add funds",value:`${Ose}–${Mse}`,desc:"Top up by card whenever you like, straight from the dashboard."},{icon:$u,title:"Auto recharge",value:"Optional",desc:"Pick a threshold and amount, and a saved card tops you up automatically."},{icon:Fre,title:"Promo codes",value:"Redeemable",desc:"Have a code? Redeem it from the Billing page for extra credit."}],Die=["Monthly subscription","Per-seat licenses","Setup or onboarding fees","Agents sitting idle","Annual contracts"],Rie=[{label:"Call duration",value:"2 min 30 sec"},{label:"Typical rate",value:`~${xw} / min`},{label:"Charged to balance",value:"~$0.88",strong:!0}
768],Lie=[{q:"How is the per-minute cost worked out?",a:`Each call is charged at its actual cost: the voice AI and phone carrier cost of that specific call, times a flat platform rate. For most calls this comes to about ${xw} a minute. The exact charge for every call is itemized on your Billing page under Call Costs.`},{q:"What do I get when I sign up?",a:`Every new account gets ${bw} of free credit as soon as you verify your email address. It's valid for ${Tse} days and it's spent before any funds you add yourself. No card is needed to sign up.`},{q:"Do I pay anything when my agents aren't on a call?",a:`No. Agents, teammates, analytics and automations cost nothing on their own. The only recurring charge is ${Pp} per month for each phone number you keep.`},{q:"What happens if my balance runs out?",a:"You'll get alerts as your balance drops to $10, $5 and $1. At $0, new outbound calls can't start, and your inbound numbers play a short 'temporarily unavailable' message instead of the agent. Everything restores automatically as soon as you top up, and auto recharge prevents it from happening at all."},{q:"How are phone numbers billed?",a:`Each number costs ${Pp} a month. The first month is taken from your balance, or through card checkout if your balance is too low, and it renews monthly from your balance after that. Release a number any time to stop paying for it.`},{q:"Is there a discount for high volume?",a:"Yes, we can set a custom rate for accounts running a lot of calls. Get in touch and tell us about your volume."}],Fie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"PRICING",title:"One rate.",highlight:"No plans to pick.",description:"Every feature is available to every account from day one. You top up a balance and only pay for the minutes your agents actually spend on calls."}),o.jsx("section",{className:"pb-8",children:o.jsx("div",{className:"container mx-auto px-4",children:o.jsxs("div",{className:"grid lg:grid-cols-5 gap-6 max-w-6xl mx-auto",children:[o.jsxs("div",{className:"lg:col-span-3 glow-border rounded-2xl p-6 md:p-8 bg-card",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-6",children:o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary mb-2",children:"Pay as you go"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsxs("span",{className:"text-5xl md:text-6xl font-black text-gradient",children:["~",xw]}),o.jsx("span",{className:"text-muted-foreground",children:"/ minute"})]}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Billed at each call's actual cost. Connected minutes only."})]})}),o.jsxs("div",{className:"flex items-center gap-2 mb-6 px-4 py-2.5 rounded-lg bg-primary/10 text-sm text-primary",children:[o.jsx(HB,{size:16,className:"shrink-0"})," ",bw," free credit when you verify your email"]}),o.jsx("ul",{className:"grid sm:grid-cols-2 gap-x-6 gap-y-3 mb-8",children:Iie.map(e=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[o.jsx(Ta,{size:16,className:"text-primary mt-0.5 shrink-0"}),e]},e))}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[o.jsx(jw,{}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"No card required to sign up."})]})]}),o.jsx("div",{className:"lg:col-span-2 grid sm:grid-cols-2 lg:grid-cols-1 gap-4",children:$ie.map(e=>o.jsxs("div",{className:"surface-card p-5 flex items-start gap-4",children:[o.jsx("div",{className:"w-10 h-10 shrink-0 rounded-lg bg-primary/10 border border-primary/20 flex items-center justify-center",children:o.jsx(e.icon,{size:18,className:"text-primary"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[o.jsx("span",{className:"font-semibold text-foreground",children:e.title}),o.jsx("span",{className:"text-sm font-bold text-primary",children:e.value})]}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.desc})]})]},e.title))})]})})}),o.jsx(sa,{eyebrow:"No surprises",title:"What a call",highlight:"actually costs",children:o.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[o.jsxs("div",{className:"surface-card p-6",children:[o.jsx("h3",{className:"font-bold text-foreground mb-1",children:"Worked example"}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"A typical two-and-a-half minute call."}),o.jsx("div",{className:"space-y-2",children:Rie.map(e=>o.jsxs("div",{className:`flex items-center justify-between rounded-lg px-3 py-2.5 text-sm ${e.strong?"bg-primary/10 font-semibold text-foreground":"bg-secondary/50 text-muted-foreground"}`,children:[o.jsx("span",{children:e.label}),o.jsx("span",{className:e.strong?"text-primary":"text-foreground",children:e.value})]},e.label))}),o.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"The exact figure varies slightly per call, and you can see every charge in Call Costs."})]}),o.jsxs("div",{className:"surface-card p-6",children:[o.jsx("h3",{className:"font-bold text-foreground mb-4",children:"What you'll never pay for"}),o.jsx("ul",{className:"space-y-3",children:Die.map(e=>o.jsxs("li",{className:"flex items-center gap-3 text-sm text-foreground",children:[o.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-secondary",children:o.jsx(rn,{size:13,className:"text-muted-foreground"})}),e]},e))}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-5 pt-4 border-t border-border",children:["Supports ",Du.length," language modes at the same rate. No premium surcharge for Urdu or multilingual agents."]})]})]})}),o.jsx(sa,{eyebrow:"FAQ",title:"Billing",highlight:"questions",className:"bg-secondary/20",children:o.jsxs("div",{className:"max-w-3xl mx-auto",children:[o.jsx(kz,{type:"single",collapsible:!0,className:"space-y-3",children:Lie.map((e,t)=>o.jsxs(wA,{value:`faq-${t}`,className:"rounded-xl border border-border bg-card px-5",children:[o.jsx(jA,{className:"text-left text-sm md:text-base font-semibold hover:no-underline",children:e.q}),o.jsx(SA,{className:"text-sm text-muted-foreground leading-relaxed",children:e.a})]},e.q))}),o.jsxs("p",{className:"text-sm text-muted-foreground text-center mt-8",children:["Running a high volume of calls?"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"Email us"})," about a custom rate."]})]})}),o.jsx(Lu,{})]}),Bie=[{icon:JB,title:"Built for real calls",desc:"Every feature exists because a call needed to be answered, transferred or followed up, not because it looked good on a roadmap."},{icon:Mi,title:"No black boxes",desc:"Every call comes back with its recording, transcript and summary attached. You should never have to wonder what was said."},{icon:oc,title:"Pay for what you use",desc:"No seat licenses, tiered plans or annual contracts. You top up a balance and calls draw it down, minute by minute."},{icon:ac,title:"You stay in control",desc:"You decide who your agents call, what they s
768ay and when they hand off. We give you the tools, and the judgment calls stay with you."}],zie=[{icon:zn,title:"Build",desc:"A guided builder, website auto-fill, prompt studio and a live test call in the browser."},{icon:Un,title:"Call",desc:"Outbound campaigns, an AI receptionist, live transfer, DNC screening and phone numbers."},{icon:rc,title:"Review",desc:"Recordings, speaker-labelled transcripts, AI summaries, call logs and analytics."},{icon:Ig,title:"Automate",desc:"Post-call flows that text, call back, update contacts and fire webhooks."}],Uie=()=>o.jsxs(Hi,{children:[o.jsx(Ru,{eyebrow:"ABOUT EDM NEXUS",title:"An AI agent for",highlight:"your phone line",description:"EDM Nexus lets any business build an AI voice agent, put it on a real phone number, and have it make or answer calls, with every call recorded, transcribed and billed by the minute."}),o.jsx("section",{className:"pb-6",children:o.jsx("div",{className:"container mx-auto px-4",children:o.jsxs("div",{className:"glow-border rounded-2xl p-8 md:p-12 text-center bg-card",children:[o.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-4",children:"Why we built this"}),o.jsx("p",{className:"text-muted-foreground text-base md:text-lg max-w-3xl mx-auto leading-relaxed",children:"Most of the calls that matter to a small or mid-size business never get made: the after-hours enquiry, the appointment reminder, the lead that went cold. There's simply no one free to make them. We built EDM Nexus so a team can put an AI agent on the phone in minutes, without hiring, scripting a call center or signing a contract, and still see exactly what happened on every call."})]})})}),o.jsx(sa,{eyebrow:"What we believe",title:"The principles",highlight:"behind the product",children:o.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
7685",children:Bie.map(e=>o.jsxs("div",{className:"surface-card p-6 text-center",children:[o.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center mx-auto mb-4",children:o.jsx(e.icon,{size:22,className:"text-primary"})}),o.jsx("h3",{className:"font-bold text-foreground mb-2",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]},e.title))})}),o.jsxs(sa,{eyebrow:"The platform today",title:"One dashboard,",highlight:"the whole call",className:"bg-secondary/20",children:[o.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-5 mb-10",children:zie.map(e=>o.jsxs("div",{className:"surface-card p-6",children:[o.jsx(e.icon,{size:20,className:"text-primary mb-3"}),o.jsx("h3",{className:"font-bold text-foreground mb-1.5",children:e.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]},e.title))}),o.jsx(mA,{stats:[{value:String(uo),label:"Production voices"},{value:String(Du.length),label:"Language modes"},{value:String(Lg),label:"Industries"},{value:"$0",label:"Monthly platform fee"}]})]}),o.jsx(sa,{eyebrow:"Get in touch",title:"Talk to",highlight:"a person",children:o.jsxs("div",{className:"max-w-xl mx-auto text-center",children:[o.jsx("p",{className:"text-muted-foreground mb-6",children:"Questions about the product, a custom rate or your account? Email us and a member of the team will get back to you."}),o.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-5 py-3 text-sm font-medium text-foreground hover:border-primary/40 transition-colors",children:[o.jsx(hh,{size:16,className:"text-primary"})," [email protected]"]})]})}),o.jsx(Lu,{})]}),ve=p.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));ve.displayName="Input";const Vie=()=>{const[e,t]=p.useState(""),[n,r]=p.useState(""),[a,s]=p.useState(!1),[i,l]=p.useState(!1),[c,u]=p.useState(!1),[d,f]=p.useState(!1),{toast:h}=Ag(),m=ua(),{user:v,signIn:g}=vh();p.useEffect(()=>{v&&m("/dashboard")},[v,m]);const y=async w=>{w.preventDefault(),l(!0),u(!1);const{error:N}=await g(e,n);l(!1),N?(/verify your email/i.test(N)&&u(!0),h({title:"Sign in failed",description:N,variant:"destructive"})):m("/dashboard")},x=async()=>{f(!0);const{data:w}=await ee.resendVerification(e,window.location.origin);if(f(!1),(w==null?void 0:w.email_sent)===!1&&(w!=null&&w.dev_verify_url)){h({title:"Email could not be sent",description:`Dev link: ${w.dev_verify_url}`,variant:"destructive"});return}h({title:"Verification email sent",description:`We sent a fresh link to ${e}.`})},b=async()=>{h({title:"Password reset",description:"Please contact your administrator to reset your password."})};return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Os,{linked:!1,size:"lg"})}),o.jsx("h1",{className:"text-3xl font-black text-foreground mb-2",children:"Welcome Back"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Sign in to your EDM Nexus dashboard"})]}),o.jsxs("div",{className:"surface-card p-6",children:[o.jsxs("form",{className:"space-y-4",onSubmit:y,children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Email"}),o.jsx(ve,{type:"email",placeholder:"[email protected]",value:e,onCh
768ange:w=>t(w.target.value),className:"bg-background border-border",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Password"}),o.jsxs("div",{className:"relative",children:[o.jsx(ve,{type:a?"text":"password",placeholder:"••••••••",value:n,onChange:w=>r(w.target.value),className:"bg-background border-border pr-10",required:!0}),o.jsx("button",{type:"button",onClick:()=>s(w=>!w),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":a?"Hide password":"Show password",children:a?o.jsx(sw,{size:16}):o.jsx(Ls,{size:16})})]})]}),o.jsx("div",{className:"flex items-center justify-end text-sm",children:o.jsx("button",{type:"button",onClick:b,className:"text-primary hover:underline",children:"Forgot password?"})}),o.jsxs(ne,{type:"submit",disabled:i,className:"w-full bg-primary text-primary-foreground hover:bg-primary/90 gap-2",children:[i?o.jsx(Te,{size:16,className:"animate-spin"}):null,"Sign In ",o.jsx(Wi,{size:16})]})]}),c&&o.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-center",children:[o.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Your email isn't verified yet. Check your inbox, or resend the link."}),o.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:x,disabled:d,className:"gap-2",children:[d?o.jsx(Te,{size:14,className:"animate-spin"}):null,"Resend verification email"]})]}),o.jsx("div",{className:"mt-6 pt-6 border-t border-border text-center space-y-3",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Don't have an account?"," ",o.jsx(jt,{to:"/register",className:"text-primary hover:underline font-medium",children:"Create Account"})]})})]})]})]})]})},Xh="6LfHXbstAAAAAC94tlxSpVPxlj79ErtbX1u61ncc".trim(),Wie=()=>{const[e,t]=p.useState(""),[n,r]=p.useState(""),[a,s]=p.useState(""),[i,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(void 0),[v,g]=p.useState(!1),{toast:y}=Ag(),{signUp:x}=vh(),[b]=Eg(),w=b.get("ref")??void 0,N=p.useRef(null),S=p.useRef(null);p.useEffect(()=>{var $;if(!Xh)return;const P=()=>{var T;S.current===null&&(!N.current||!((T=window.grecaptcha)!=null&&T.render)||(S.current=window.grecaptcha.render(N.current,{sitekey:Xh})))};if(($=window.grecaptcha)!=null&&$.render){P();return}if(window.__onRecaptchaLoad=P,document.getElementById("recaptcha-script"))return;const O=document.createElement("script");O.id="recaptcha-script",O.src="https://www.google.com/recaptcha/api.js?onload=__onRecaptchaLoad&render=explicit",O.async=!0,O.defer=!0,document.body.appendChild(O)},[]);const _=async P=>{var U,E;if(P.preventDefault(),!e||!n||!a){y({title:"Please fill in all required fields",variant:"destructive"});return}const O=Xh?(U=window.grecaptcha)==null?void 0:U.getResponse(S.current??void 0):void 0;if(Xh&&!O){y({title:"Please complete the reCAPTCHA",variant:"destructive"});return}u(!0);const{error:$,pending:T,devVerifyUrl:z}=await x(n,a,e,O,w);u(!1),$?(y({title:"Registration failed",description:$,variant:"destructive"}),(E=window.grecaptcha)==null||E.reset(S.current??void 0)):T&&(m(z),f(!0))},k=async()=>{g(!0);const{data:P}=await ee.resendVerification(n,window.location.origin);if(g(!1),P!=null&&P.dev_verify_url&&m(P.dev_verify_url),(P==null?void 0:P.email_sent)===!1){y({title:"Email could not be sent",description:"SMTP is not configured. Use the dev verification link below.",variant:"destructive"});return}y({title:"Verification email sent",description:`We re-sent the link to ${n}.`})};return d?o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsx("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:o.jsxs("div",{className:"surface-card p-8 text-center",children:[o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx("div",{className:"w-14 h-14 roun
768ded-full bg-primary/10 flex items-center justify-center",children:o.jsx(kre,{className:"text-primary",size:28})})}),o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"Check your email"}),o.jsxs("p",{className:"text-muted-foreground text-sm mb-6",children:["We sent a verification link to ",o.jsx("span",{className:"text-foreground font-medium",children:n}),". Click it to activate your account and unlock your welcome credit. You won't be able to log in until your email is verified."]}),h&&o.jsxs("div",{className:"mb-6 rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-left",children:[o.jsx("p",{className:"text-xs text-amber-500 font-medium mb-1",children:"Email could not be sent. Use this link instead"}),o.jsx("a",{href:h,className:"text-xs text-primary break-all hover:underline",children:h})]}),o.jsxs(ne,{variant:"outline",onClick:k,disabled:v,className:"w-full gap-2 mb-3",children:[v?o.jsx(Te,{size:16,className:"animate-spin"}):null,"Resend verification email"]}),o.jsx(jt,{to:"/login",className:"text-sm text-primary hover:underline font-medium",children:"Back to Sign In"})]})})]})]}):o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Os,{linked:!1,size:"lg"})}),o.jsx("h1",{className:"text-3xl font-black text-foreground mb-2",children:"Create Account"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Join EDM Nexus and start growing"})]}),o.jsxs("div",{className:"surface-card p-6",children:[o.jsxs("form",{className:"space-y-4",onSubmit:_,children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Full Name *"}),o.jsx(ve,{type:"text",placeholder:"John Doe",value:e,onChange:P=>t(P.target.value),className:"bg-background border-border",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Company Name"}),o.jsx(ve,{type:"text",placeholder:"Acme Inc.",value:i,onChange:P=>l(P.target.value),className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Email *"}),o.jsx(ve,{type:"email",placeholder:"[email protected]",value:n,onChange:P=>r(P.target.value),className:"bg-background border-border",required:!0})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Password *"}),o.jsx(ve,{type:"password",placeholder:"••••••••",value:a,onChange:P=>s(P.target.value),className:"bg-background border-border",minLength:6,required:!0})]}),Xh&&o.jsx("div",{ref:N,className:"flex justify-center"}),o.jsxs(ne,{type:"submit",disabled:c,className:"w-full bg-primary text-primary-foreground hover:bg-primary/90 gap-2",children:[c?o.jsx(Te,{size:16,className:"animate-spin"}):null,"Create Account ",o.jsx(Wi,{size:16})]})]}),o.jsx("div",{className:"mt-6 pt-6 border-t border-border text-center",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Already have an account?"," ",o.jsx(jt,{to:"/login",className:"text-primary hover:underline font-medium",children:"Sign In"})]})})]})]})]})]})},qie=()=>{const[e]=Eg(),t=ua(),n=e.get("token")||"",[r,a]=p.useState("verifying"),[s,i]=p.useState(""),l=p.useRef(!1);return p.useEffect(()=>{if(!l.current){if(l.current=!0,!n){a("error"),i("This verification link is missing its token.");return}ee.verifyEmail(n).then(({data:c,error:u})=>{if(u||!(c!=null&&c.access_token)){a("error"),i(u||"We couldn't verify your email.");return}Od(c.access_token),a("success"),i("Your email is verified and your welcome credit has been added."),setTimeout(()=>{window.location.href="/dashboard"},1600)})}},[n]),o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:[o.jsx("div",{className:"text-center mb-8",children:o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Os,{linked:!1,size:"lg"})})}),o.jsxs("div",{className:"surface-card p-8 text-center",children:[r==="verifying"&&o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mx-auto mb-4 text-primary animate-spin",size:40}),o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"Verifying your email…"}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Hang tight, this only takes a second."})]}),r==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(tr,{className:"mx-auto mb-4 text-primary",size:44}),o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"Email verified 🎉"}),o.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:s}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Taking you to your dashboard…"})]}),r==="error"&&o.jsxs(o.Fragment,{children:[o.jsx(Og,{className:"mx-auto mb-4 text-destructive",size:44}),o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"Verification failed"}),o.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:s}),o.jsx(ne,{onClick:()=>t("/register"),className:"w-full mb-3",children:"Create a new account"}),o.jsx(jt,{to:"/login",className:"text-sm text-primary hover:underline font-medium",children:"Back to Sign In"})]})]})]})]})]})},Hie=()=>{const[e]=Eg();ua();const{toast:t}=Ag(),n=e.get("token")||"",[r,a]=p.useState(""),[s,i]=p.useState(null),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!1);p.useEffect(()=>{if(!n){a("This invite link is missing its token.");return}ee.getInvite(n).then(({data:v,error:g})=>
768{if(g||!v){a(g||"This invite link is invalid or has expired.");return}i(v)})},[n]);const m=async v=>{v.preventDefault(),h(!0);const{data:g,error:y}=await ee.acceptInvite({token:n,password:u,full_name:l||void 0});if(h(!1),y||!(g!=null&&g.access_token)){t({title:"Couldn't accept invite",description:y||"Something went wrong.",variant:"destructive"});return}Od(g.access_token),t({title:"Welcome aboard!",description:"Your account is set up."}),window.location.href="/dashboard"};return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsxs("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:[o.jsx("div",{className:"text-center mb-8",children:o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Os,{linked:!1,size:"lg"})})}),o.jsxs("div",{className:"surface-card p-8",children:[r&&o.jsxs("div",{className:"text-center",children:[o.jsx(Og,{className:"mx-auto mb-4 text-destructive",size:44}),o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"Invite not available"}),o.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:r}),o.jsx(jt,{to:"/login",className:"text-sm text-primary hover:underline font-medium",children:"Back to Sign In"})]}),!r&&!s&&o.jsxs("div",{className:"text-center",children:[o.jsx(Te,{className:"mx-auto mb-4 text-primary animate-spin",size:40}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading your invite…"})]}),!r&&s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-center mb-6",children:[o.jsx("h1",{className:"text-2xl font-black text-foreground mb-2",children:"You're invited!"}),o.jsxs("p",{className:"text-muted-foreground text-sm",children:[o.jsx("b",{children:s.owner_name})," invited ",o.jsx("b",{children:s.email})," to join their team as a"," ",o.jsx("span",{className:"capitalize",children:s.role}),". Set a password to finish joining."]})]}),o.jsxs("form",{className:"space-y-4",onSubmit:m,children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Full name"}),o.jsx(ve,{type:"text",placeholder:"Jane Doe",value:l,onChange:v=>c(v.target.value),className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Password"}),o.jsx(ve,{type:"password",placeholder:"••••••••",value:u,onChange:v=>d(v.target.value),className:"bg-background border-border",minLength:6,required:!0})]}),o.jsxs(ne,{type:"submit",disabled:f,className:"w-full bg-primary text-primary-foreground hover:bg-primary/90 gap-2",children:[f?o.jsx(Te,{size:16,className:"animate-spin"}):null,"Accept invite & continue ",o.jsx(Wi,{size:16})]})]})]})]})]})]})]})},Gie=()=>{const[e,t]=p.useState(""),[n,r]=p.useState(!1),[a,s]=p.useState(null),{toast:i}=Ag();ua(),p.useEffect(()=>{const u=new URLSearchParams(window.location.search).get("token");u&&s(u)},[]);const l=async c=>{c.preventDefault(),i({title:"Password reset unavailable",description:"Please contact your administrator to reset your password."})};return a?o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsxs("div",{className:"w-full max-w-md mx-auto px-4 relative z-10",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Os,{linked:!1,size:"lg"})}),o.jsx("h1",{className:"text-3xl font-black text-foreground mb-2",children:"Set New Password"})]}),o.jsx("div",{className:"surface-card p-6",children:o.jsxs("form",{className:"space-y-4",onSubmit:l,children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"New Password"}),o.jsx(ve,{type:"password",placeholder:"••••••••",value:e,onCh
768ange:c=>t(c.target.value),className:"bg-background border-border",minLength:6,required:!0})]}),o.jsxs(ne,{type:"submit",disabled:n,className:"w-full bg-primary text-primary-foreground hover:bg-primary/90 gap-2",children:[n?o.jsx(Te,{size:16,className:"animate-spin"}):null,"Update Password ",o.jsx(Wi,{size:16})]})]})})]})]})]}):o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsx("section",{className:"min-h-screen flex items-center justify-center pt-16",children:o.jsx("p",{className:"text-muted-foreground",children:"Invalid or expired reset link."})})]})},Yie=["AI voice agents for outbound and inbound calls","Every call recorded, transcribed, and summarized","Itemized cost on every single call","Custom rate available for high call volume","No monthly platform fee"],Kie=()=>{const[e,t]=p.useState(!1);return e?o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsxs("div",{className:"text-center px-4 relative z-10",children:[o.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center mx-auto mb-6",children:o.jsx(tr,{size:32,className:"text-primary"})}),o.jsx("h1",{className:"text-3xl font-black text-foreground mb-3",children:"Request Received"}),o.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Thank you for your interest in EDM Nexus. Our team will review your application and reach out within 24 hours."})]})]})]}):o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(Ms,{}),o.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-16 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 w-[500px] h-[500px] rounded-full bg-primary/5 blur-[150px] pointer-events-none"}),o.jsx("div",{className:"container mx-auto px-4 relative z-10",children:o.jsxs("div",{className:"grid md:grid-cols-2 gap-12 max-w-4xl mx-auto items-center",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"badge-pill mb-6",children:[o.jsx("span",{className:"w-2 h-2 rounded-full bg-primary animate-pulse-glow"}),"GET STARTED"]}),o.jsxs("h1",{className:"text-3xl md:text-4xl font-black text-foreground mb-4",children:["Talk to ",o.jsx("span",{className:"text-gradient",children:"our team"})]}),o.jsx("p",{className:"text-muted-foreground mb-8",children:"Tell us about your call volume and what you're trying to do. We'll follow up about getting you set up, including a custom rate if you need one."}),o.jsx("ul",{className:"space-y-3",children:Yie.map(n=>o.jsxs("li",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(tr,{size:16,className:"text-primary shrink-0"}),n]},n))})]}),o.jsx("div",{className:"surface-card p-6",children:o.jsxs("form",{className:"space-y-4",onSubmit:n=>{n.preventDefault(),t(!0)},children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"First Name"}),o.jsx(ve,{placeholder:"John",className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Last Name"}),o.jsx(ve,{placeholder:"Smith",className:"bg-background border-border"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Work Email"}),o.jsx(ve,{type:"email",placeholder:"[email protected]",className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Company"}),o.jsx(ve,{placeholder:"Company name",className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Phone"}),o.jsx(ve,{type:"tel",placeholder:"(555) 000-0000",className:"bg-background border-border"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"I am a..."}),o.jsxs("select",{className:"w-full h-10 rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground",children:[o.jsx("option",{value:"",children:"Select one"}),o.jsx("option",{value:"business",children:"Business, using it directly"}),o.jsx("option",{value:"agency",children:"Agency, running campaigns for clients"}),o.jsx("option",{value:"other",children:"Other"})]})]}),o.jsxs(ne,{className:"w-full bg-primary text-primary-foreground hover:bg-primary/90 gap-2",type:"submit",children:[o.jsx(Mi,{size:16})," Submit Request ",o.jsx(Wi,{size:16})]}),o.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["By submitting, you agree to our"," ",o.jsx(jt,{to:"/privacy",className:"text-primary hover:underline",children:"privacy policy"}),"."]})]})})]})})]})]})};function za({id:e,title:t,children:n}){return o.jsxs("section",{id:e,className:"scroll-mt-24",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground",children:t}),o.jsx("div",{className:"mt-3 space-y-3 text-sm leading-relaxed text-muted-foreground",children:n})]})}const Xie=[{id:"intro",title:"Introduction and Scope"},{id:"collect",title:"Information We Collect"},{id:"recording",title:"Call Recording and Transcription"},{id:"use",title:"How We Use Information"},{id:"subprocessors",title:"Disclosure to Service Providers"},{id:"retention",title:"Data Retention"},{id:"rights",title:"Your Rights and Choices"},{id:"security",title:"Data Security"}
768,{id:"cookies",title:"Cookies and Local Storage"},{id:"children",title:"Children's Privacy"},{id:"contact",title:"Contact Information"},{id:"changes",title:"Changes to This Policy"}],Jie=()=>o.jsx(Hi,{children:o.jsxs("section",{className:"relative pt-32 pb-20 overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 grid-pattern opacity-20 pointer-events-none"}),o.jsxs("div",{className:"container mx-auto px-4 relative z-10 max-w-3xl",children:[o.jsxs("div",{className:"badge-pill mb-6",children:[o.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),"LEGAL"]}),o.jsx("h1",{className:"text-4xl md:text-5xl font-bold",children:"Privacy Policy"}),o.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Last updated: September 28, 2026"}),o.jsxs("nav",{"aria-label":"Contents",className:"mt-10 rounded-xl border border-border bg-card p-5 md:p-6",children:[o.jsx("div",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary mb-3",children:"Contents"}),o.jsx("ol",{className:"grid sm:grid-cols-2 gap-x-6 gap-y-2 text-sm",children:Xie.map((e,t)=>o.jsx("li",{children:o.jsxs("a",{href:`#${e.id}`,className:"text-muted-foreground hover:text-foreground transition-colors",children:[t+1,". ",e.title]})},e.id))})]}),o.jsxs("div",{className:"mt-12 space-y-10",children:[o.jsxs(za,{id:"intro",title:"1. Introduction and Scope",children:[o.jsx("p",{children:'This Privacy Policy (the "Policy") describes how EDM Nexus ("the Company," "we," "us," or "our") collects, uses, discloses, and safeguards information in connection with its AI voice calling platform, accessible at edmnexus.ai, including the dashboard, the AI voice agents configured through it, and associated websites (collectively, the "Service").'}),o.jsx("p",{children:`This Policy distinguishes between two categories of information. Information relating to a registered user of the Service (a "Customer") and their account is processed by the Company as a controller. Information relating to a Customer's own contacts and the individuals reached or answered by a Customer's AI voice agents ("Call Data" and "Contact Data") is processed by the Company as a processor, strictly on the Customer's instructions and for the purposes the Customer configures. The Customer remains responsible for the lawfulness of that processing, as described further in Section 3.`})]}),o.jsxs(za,{id:"collect",title:"2. Information We Collect",children:[o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Account Information."})," Name, email address, company name, and password. Passwords are stored only as an irreversible cryptographic hash and are never retained in plain text."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Billing Information."})," Wallet balance, top-up history, promotional credit, and per-call charges. Payment card details are submitted directly to the Company's payment processor and are never transmitted to or stored on Company servers. The Company retains only a reference identifier together with the card brand, last four digits, and expiration date for display purposes."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Contact Data."})," Names, telephone numbers, email addresses, list assignments, and contact status, as uploaded or entered by the Customer, together with any updates made by automations the Customer configures."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Agent Configuration."})," The instructions, greeting, knowledge text, and files a Customer provides for an AI voice agent, the transfer number it is given, and any website address the Customer submits for the Service to analyze when suggesting an agent's setup."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Team and Referral Information."})," The names and email addresses of teammates a Customer invites, and the role assigned to each. Where a person signs up through a Customer's referral link, the Company records that referral and whether the referred account has been verified."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Call Data."})," For each call placed or received by a Customer's AI voice agent, the Company records the telep
768hone numbers involved, the time and duration of the call, its outcome, whether it was transferred and to which number, its cost, an"," ",o.jsx("strong",{className:"text-foreground",children:"audio recording"}),", a"," ",o.jsx("strong",{className:"text-foreground",children:"written transcript"}),", and an AI-generated summary. See Section 3."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Technical Information."})," Server logs, including IP address and request metadata, retained for security monitoring and diagnostic purposes."]})]}),o.jsxs(za,{id:"recording",title:"3. Call Recording and Transcription",children:[o.jsx("p",{className:"text-foreground",children:"Every call placed or answered by an AI voice agent on the Service is recorded and transcribed by default."}),o.jsx("p",{children:'The recording of telephone calls is subject to regulation that varies by jurisdiction. Certain jurisdictions, including a number of U.S. states, require the consent of all parties to a call prior to recording. Automated and prerecorded outbound calls are separately regulated in the United States under the Telephone Consumer Protection Act ("TCPA"), and certain jurisdictions additionally require disclosure that a caller is an automated system rather than a natural person.'}),o.jsx("p",{children:"As the Customer determines who its agents contact and what those agents communicate, the Customer is solely responsible for compliance with all applicable recording-consent, telemarketing, and AI-disclosure laws, including obtaining any consent required, honoring do-not-call requests, observing permitted calling hours, and disclosing the use of recording and artificial intelligence where legally required. Configuring the agent to make such disclosures in its opening statement is one practical means of satisfying this obligation."}),o.jsx("p",{children:"The Service offers optional do-not-call and litigation screening for outbound calls. Screening is provided as an aid only and does not relieve the Customer of its own compliance obligations."}),o.jsx("p",{children:"Customers may review individual call records, recordings, and transcripts from the dashboard at any time, and may request deletion of call records using the contact details in Section 11."})]}),o.jsxs(za,{id:"use",title:"4. How We Use Information",children:[o.jsx("p",{children:"The Company uses the information described above to: operate Customer accounts and place and receive calls; generate recordings, transcripts, and summaries for Customer review; screen telephone numbers against do-not-call and litigation lists where the Customer enables screening; run the automations a Customer configures, such as sending SMS messages, placing follow-up calls, and delivering webhooks; calculate call costs and process billing; deliver service communications, including email verification and low-balance notifications; provide customer support; detect and prevent misuse of the Service; and comply with applicable legal obligations."}),o.jsx("p",{children:"The Company does not sell personal information and does not use call recordings, transcripts, or Contact Data to advertise to Customers or the individuals they contact."})]}),o.jsxs(za,{id:"subprocessors",title:"5. Disclosure to Service Providers",children:[o.jsx("p",{children:"The Company engages a limited number of trusted third-party service providers to operate the Service, including providers of voice and telephony infrastructure, SMS delivery, speech transcription and voice synthesis, AI language models (used to conduct agent conversations, analyze submitted websites, and summarize calls), do-not-call and litigation screening, cloud computing and hosting, payment processing, and transactional email delivery. These providers receive only the information necessary to perform their function and are contractually bound to use it solely for that purpose."}),o.jsx("p",{children:"Payment card information is collected and stored exclusively by the Company's payment processor and is never transmitted to or held on Company servers."}),o.jsx("p",{children:"Where a Customer configures an automation to send data to a webhook or other destination of its choosing, the Company transmits that data on the Customer's instruction. The handling of data at that destination is governed by the Customer and the destination's operator, not by the C
768ompany."}),o.jsx("p",{children:"Each provider processes data under its own terms of service and privacy policy and may process data outside the Customer's country of residence. The Company may also disclose information where required by law, legal process, or governmental request, or where necessary to protect the rights, property, or safety of the Company, its users, or the public."})]}),o.jsxs(za,{id:"retention",title:"6. Data Retention",children:[o.jsx("p",{children:"Account, billing, and call records are retained for as long as the associated account remains active, for the Customer's own reference and for the Company's tax and accounting purposes. Customers may delete contacts and lists at any time through the dashboard, and may request deletion of call records as described in Section 3."}),o.jsx("p",{children:"Upon account closure, the Company deletes Customer data except where retention of transaction records is required by applicable law or accounting standards."})]}),o.jsxs(za,{id:"rights",title:"7. Your Rights and Choices",children:[o.jsx("p",{children:"Customers may access and correct their account information through the dashboard, and may request deletion of their account and associated data at any time."}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"California Residents."})," Under the California Consumer Privacy Act and California Privacy Rights Act, California residents may request access to, deletion of, or correction of the personal information the Company holds about them, and may request disclosure of the categories of information collected and shared. The Company does not sell personal information and does not share personal information for cross-context behavioral advertising. The Company will not discriminate against any individual for exercising these rights."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"text-foreground",children:"Users in the United Kingdom and European Economic Area."})," Where the General Data Protection Regulation applies, data subjects additionally have the right to object to or restrict processing, the right to data portability, and the right to lodge a complaint with their local supervisory authority. The Company's processing is based on the performance of its contract with the Customer, its legitimate interests in maintaining the security and integrity of the Service, and consent where consent is obtained."]}),o.jsx("p",{children:"Requests may be submitted using the contact details in Section 11."})]}),o.jsxs(za,{id:"security",title:"8. Data Security",children:[o.jsx("p",{children:"Data transmitted to and from the Service is encrypted in transit. Passwords are stored only as cryptographic hashes, access to account data requires authentication, and payment card details are handled exclusively by the Company's payment processor and are never transmitted to or stored on Company infrastructure."}),o.jsx("p",{children:"The Company does not currently hold a SOC 2, ISO 27001, or HIPAA attestation, and the Service is not intended for the collection or processing of protected health information. No method of transmission or storage is guaranteed to be entirely secure, and the Company cannot warrant absolute security."})]}),o.jsxs(za,{id:"cookies",title:"9. Cookies and Local Storage",children:[o.jsx("p",{children:"The Service uses browser local storage to retain an authentication token, which is strictly necessary for the Service to function, and interface preferences such as the display theme and favorited voices. The Company does not use advertising or cross-site tracking cookies."}),o.jsx("p",{children:"The registration page may use Google reCAPTCHA to protect against automated sign-ups. reCAPTCHA is subject to Google's own privacy policy and terms and may set its own cookies."})]}),o.jsx(za,{id:"children",title:"10. Children's Privacy",children:o.jsx("p",{children:"The Service is intended for business use and is not directed to, nor intended for use by, individuals under the age of 18. The Company does not knowingly collect personal information from children. Any person who becomes aware that a child has provided personal information to the Company should contact us, and the information will be deleted."})}),o.jsxs(za,{id:"contact",title:"11. Contact Information",children:[o.jsx("p",{children:"Questions regarding this Policy, or requests to exercise the rights described herein, including access and deletion requests, may be directed to:"}),o.jsxs("p",{className:"text-foreground",children:["Email:"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}
vendor: 9,267 bytes, line 768
768),o.jsx("p",{className:"text-xs text-muted-foreground/80 italic",children:"The registered legal entity name, principal place of business, and governing jurisdiction of the Company will be included here upon finalization of the Company's corporate registration details."})]}),o.jsx(za,{id:"changes",title:"12. Changes to This Policy",children:o.jsx("p",{children:"The Company may revise this Policy from time to time. Where a revision materially affects the manner in which Customer information is handled, the Company will provide direct notice to affected Customers in advance of the change taking effect."})})]}),o.jsxs("div",{className:"mt-14 border-t border-border pt-6 text-sm text-muted-foreground",children:["Questions about the product instead?"," ",o.jsx(jt,{to:"/about",className:"text-primary hover:underline",children:"Get in touch"}),"."]})]})]})}),Qie=()=>{const e=mo();return p.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),o.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};var aS=0;function kw(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??aI()),document.body.insertAdjacentElement("beforeend",e[1]??aI()),aS++,()=>{aS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),aS--}},[])}function aI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var oS="focusScope.autoFocusOnMount",sS="focusScope.autoFocusOnUnmount",oI={bubbles:!1,cancelable:!0},Zie="FocusScope",Fg=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...i}=e,[l,c]=p.useState(null),u=ca(a),d=ca(s),f=p.useRef(null),h=at(t,g=>c(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(w){if(m.paused||!l)return;const N=w.target;l.contains(N)?f.current=N:sl(f.current,{select:!0})},y=function(w){if(m.paused||!l)return;const N=w.relatedTarget;N!==null&&(l.contains(N)||sl(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&sl(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(x);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,l,m.paused]),p.useEffect(()=>{if(l){iI.add(m);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(oS,oI);l.addEventListener(oS,u),l.dispatchEvent(x),x.defaultPrevented||(ele(ole(Ez(l)),{select:!0}),document.activeElement===g&&sl(l))}return()=>{l.removeEventListener(oS,u),setTimeout(()=>{const x=new CustomEvent(sS,oI);l.addEventListener(sS,d),l.dispatchEvent(x),x.defaultPrevented||sl(g??document.body,{select:!0}),l.removeEventListener(sS,d),iI.remove(m)},0)}}},[l,u,d,m]);const v=p.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const b=g.currentTarget,[w,N]=tle(b);w&&N?!g.shiftKey&&x===N?(g.preventDefault(),n&&sl(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&sl(N,{select:!0})):x===b&&g.preventDefault()}},[n,r,m.paused]);return o.jsx(Ie.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});Fg.displayName=Zie;function ele(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(sl(r,{select:t}),document.activeElement!==n)return}function tle(e){const t=Ez(e),n=sI(t,e),r=sI(t.reverse(),e);return[n,r]}function Ez(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function sI(e,t){for(const n of e)if(!nle(n,{upTo:t}))return n}function nle(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rle(e){return e instanceof HTMLInputElement&&"select"in e}function sl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rle(e)&&t&&e.select()}}var iI=ale();function ale(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lI(e,t),e.unshift(t)},remove(t){var n;e=lI(e,t),(n=e[0])==null||n.resume()}}}function lI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ole(e){return e.filter(t=>t.tagName!=="A")}var sle=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rd=new WeakMap,Hv=new WeakMap,Gv={},iS=0,Az=function(e){return e&&(e.host||Az(e.parentNode))},ile=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Az(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},lle=function(e,t,n,r){var a=ile(t,Array.isArray(e)?e:[e]);Gv[n]||(Gv[n]=new WeakMap);var s=Gv[n],i=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(r),v=m!==null&&m!=="false",g=(rd.get(h)||0)+1,y=(s.get(h)||0)+1;rd.set(h,g),s.set(h,y),i.push(h),g===1&&v&&Hv.set(h,!0),y===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),l.clear(),iS++,function(){i.forEach(function(f){var h=rd.get(f)-1,m=s.get(f)-1;rd.set(f,h),s.set(f,m),h||(Hv.has(f)||f.removeAttribute(r),Hv.delete(f)),m||f.removeAttribute(n)}),iS--,iS||(rd=new WeakMap,rd=new WeakMap,Hv=new WeakMap,Gv={})}},Ew=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=sle(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),lle(r,a,n,"aria-hidden")):function(){return null}},ys=function(){return ys=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ys.apply(this,arguments)};function Pz(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function cle(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,s;r<a;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var ox="right-scroll-bar-position",sx="width-before-scroll-bar",ule="with-scroll-bars-hidden",dle="--removed-body-scroll-bar-size";function lS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fle(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var hle=typeof window<"u"?p.useLayoutEffect:p.useEffect,cI=new WeakMap;function mle(e,t){var n=fle(null,function(r){return e.forEach(function(a){return lS(a,r)})});return hle(function(){var r=cI.get(n);if(r){var a=new Set(r),s=new Set(e),i=n.current;a.forEach(function(l){s.has(l)||lS(l,null)}),s.forEach(function(l){a.has(l)||lS(l,i)})}cI.set(n,e)},[e]),n}function ple(e){return e}function gle(e,t){t===void 0&&(t=ple);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return a}function vle(e){e===void 0&&(e={});var t=gle(null);return t.options=ys({async:!0,ssr:!1},e),t}var Tz=function(e){var t=e.sideCar,n=Pz(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,ys({},n))};
vendor: 5,104 bytes, lines 768-805
768Tz.isSideCarExport=!0;function yle(e,t){return e.useMedium(t),Tz}var Oz=vle(),cS=function(){},Aw=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:cS,onWheelCapture:cS,onTouchMoveCapture:cS}),a=r[0],s=r[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,v=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,N=Pz(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,_=mle([n,t]),k=ys(ys({},N),a);return p.createElement(p.Fragment,null,d&&p.createElement(S,{sideCar:Oz,removeScrollBar:u,shards:f,noRelative:m,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:w}),i?p.cloneElement(p.Children.only(l),ys(ys({},k),{ref:_})):p.createElement(b,ys({},k,{className:c,ref:_}),l))});Aw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Aw.classNames={fullWidth:sx,zeroRight:ox};var xle=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ble(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xle();return t&&e.setAttribute("nonce",t),e}function wle(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jle(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sle=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ble())&&(wle(t,n),jle(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Nle=function(){var e=Sle();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mz=function(){var e=Nle(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},_le={left:0,top:0,right:0,gap:0},uS=function(e){return parseInt(e||"",10)||0},Cle=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[uS(n),uS(r),uS(a)]},kle=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _le;var t=Cle(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ele=Mz(),Gd="data-scroll-locked",Ale=function(e,t,n,r){var a=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
769  .`.concat(ule,` {
770   overflow: hidden `).concat(r,`;
771   padding-right: `).concat(l,"px ").concat(r,`;
772  }
773  body[`).concat(Gd,`] {
774    overflow: hidden `).concat(r,`;
775    overscroll-behavior: contain;
776    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
777    padding-left: `.concat(a,`px;
778    padding-top: `).concat(s,`px;
779    padding-right: `).concat(i,`px;
780    margin-left:0;
781    margin-top:0;
782    margin-right: `).concat(l,"px ").concat(r,`;
783    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
784  }
785  
786  .`).concat(ox,` {
787    right: `).concat(l,"px ").concat(r,`;
788  }
789  
790  .`).concat(sx,` {
791    margin-right: `).concat(l,"px ").concat(r,`;
792  }
793  
794  .`).concat(ox," .").concat(ox,` {
795    right: 0 `).concat(r,`;
796  }
797  
798  .`).concat(sx," .").concat(sx,` {
799    margin-right: 0 `).concat(r,`;
800  }
801  
802  body[`).concat(Gd,`] {
803    `).concat(dle,": ").concat(l,`px;
804  }
805`)},uI=function(){var e=parseInt(document.body.getAttribute(Gd)||"0",10);return isFinite(e)?e:0},Ple=function(){p.useEffect(function(){return document.body.setAttribute(Gd,(uI()+1).toString()),function(){var e=uI()-1;e<=0?document.body.removeAttribute(Gd):document.body.setAttribute(Gd,e.toString())}},[])},Tle=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Ple();var s=p.useMemo(function(){return kle(a)},[a]);return p.createElement(Ele,{styles:Ale(s,!t,a,n?"":"!important")})},tC=!1;if(typeof window<"u")try{var Yv=Object.defineProperty({},"passive",{get:function(){return tC=!0,!0}});window.addEventListener("test",Yv,Yv),window.removeEventListener("test",Yv,Yv)}catch{tC=!1}var ad=tC?{passive:!1}:!1,Ole=function(e){return e.tagName==="TEXTAREA"},Iz=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ole(e)&&n[t]==="visible")},Mle=function(e){return Iz(e,"overflowY")},Ile=function(e){return Iz(e,"overflowX")},dI=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=$z(e,r);if(a){var s=Dz(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$le=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Dle=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$z=function(e,t){return e==="v"?Mle(t):Ile(t)},Dz=function(e,t){return e==="v"?$le(t):Dle(t)},Rle=function(e,t){return e==="h"&&t==="rtl"?-1:1},Lle=function(e,t,n,r,a){var s=Rle(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,c=t.contains(l),u=!1,d=i>0,f=0,h=0;
vendor: 4,249 bytes, lines 805-808
805do{if(!l)break;var m=Dz(e,l),v=m[0],g=m[1],y=m[2],x=g-y-s*v;(v||x)&&$z(e,l)&&(f+=x,h+=v);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!a)||!d&&(Math.abs(h)<1||!a))&&(u=!0),u},Kv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fI=function(e){return[e.deltaX,e.deltaY]},hI=function(e){return e&&"current"in e?e.current:e},Fle=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ble=function(e){return`
806  .block-interactivity-`.concat(e,` {pointer-events: none;}
807  .allow-interactivity-`).concat(e,` {pointer-events: all;}
808`)},zle=0,od=[];function Ule(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),a=p.useState(zle++)[0],s=p.useState(Mz)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=cle([e.lockRef.current],(e.shards||[]).map(hI),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=Kv(g),b=n.current,w="deltaX"in g?g.deltaX:b[0]-x[0],N="deltaY"in g?g.deltaY:b[1]-x[1],S,_=g.target,k=Math.abs(w)>Math.abs(N)?"h":"v";if("touches"in g&&k==="h"&&_.type==="range")return!1;var P=dI(k,_);if(!P)return!0;if(P?S=k:(S=k==="v"?"h":"v",P=dI(k,_)),!P)return!1;if(!r.current&&"changedTouches"in g&&(w||N)&&(r.current=S),!S)return!0;var O=r.current||S;return Lle(O,y,g,O==="h"?w:N,!0)},[]),c=p.useCallback(function(g){var y=g;if(!(!od.length||od[od.length-1]!==s)){var x="deltaY"in y?fI(y):Kv(y),b=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&Fle(S.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(hI).filter(Boolean).filter(function(S){return S.contains(y.target)}),N=w.length>0?l(y,w[0]):!i.current.noIsolation;N&&y.cancelable&&y.preventDefault()}}},[]),u=p.useCallback(function(g,y,x,b){var w={name:g,delta:y,target:x,should:b,shadowParent:Vle(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(N){return N!==w})},1)},[]),d=p.useCallback(function(g){n.current=Kv(g),r.current=void 0},[]),f=p.useCallback(function(g){u(g.type,fI(g),g.target,l(g,e.lockRef.current))},[]),h=p.useCallback(function(g){u(g.type,Kv(g),g.target,l(g,e.lockRef.current))},[]);p.useEffect(function(){return od.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ad),document.addEventListener("touchmove",c,ad),document.addEventListener("touchstart",d,ad),function(){od=od.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,ad),document.removeEventListener("touchmove",c,ad),document.removeEventListener("touchstart",d,ad)}},[]);var m=e.removeScrollBar,v=e.inert;return p.createElement(p.Fragment,null,v?p.createElement(s,{styles:Ble(a)}):null,m?p.createElement(Tle,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vle(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Wle=yle(Oz,Ule);var Bg=p.forwardRef(function(e,t){return p.createElement(Aw,ys({},e,{ref:t,sideCar:Wle}))});Bg.classNames=Aw.classNames;var Pw="Popover",[Rz,Lqe]=Gr(Pw,[sc]),zg=sc(),[qle,ic]=Rz(Pw),Lz=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!1}=e,l=zg(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=lo({prop:r,defaultProp:a??!1,onChange:s,caller:Pw});return o.jsx(dA,{...l,children:o.jsx(qle,{scope:t,contentId:Zn(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})};Lz.displayName=Pw;var Fz="PopoverAnchor",Hle=p.forwardRef((e,t)=>
vendor: 4,472 bytes, line 808
808{const{__scopePopover:n,...r}=e,a=ic(Fz,n),s=zg(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=a;return p.useEffect(()=>(i(),()=>l()),[i,l]),o.jsx(Rg,{...s,...r,ref:t})});Hle.displayName=Fz;var Bz="PopoverTrigger",zz=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ic(Bz,n),s=zg(n),i=at(t,a.triggerRef),l=o.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Hz(a.open),...r,ref:i,onClick:xe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:o.jsx(Rg,{asChild:!0,...s,children:l})});zz.displayName=Bz;var NA="PopoverPortal",[Gle,Yle]=Rz(NA,{forceMount:void 0}),Uz=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,s=ic(NA,t);return o.jsx(Gle,{scope:t,forceMount:n,children:o.jsx(da,{present:n||s.open,children:o.jsx(dh,{asChild:!0,container:a,children:r})})})};Uz.displayName=NA;var Nf="PopoverContent",Vz=p.forwardRef((e,t)=>{const n=Yle(Nf,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,s=ic(Nf,e.__scopePopover);return o.jsx(da,{present:r||s.open,children:s.modal?o.jsx(Xle,{...a,ref:t}):o.jsx(Jle,{...a,ref:t})})});Vz.displayName=Nf;var Kle=Hl("PopoverContent.RemoveScroll"),Xle=p.forwardRef((e,t)=>{const n=ic(Nf,e.__scopePopover),r=p.useRef(null),a=at(t,r),s=p.useRef(!1);return p.useEffect(()=>{const i=r.current;if(i)return Ew(i)},[]),o.jsx(Bg,{as:Kle,allowPinchZoom:!0,children:o.jsx(Wz,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:xe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jle=p.forwardRef((e,t)=>{const n=ic(Nf,e.__scopePopover),r=p.useRef(!1),a=p.useRef(!1);return o.jsx(Wz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),Wz=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=ic(Nf,n),m=zg(n);return kw(),o.jsx(Fg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:o.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:o.jsx(mw,{"data-state":Hz(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),qz="PopoverClose",Qle=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ic(qz,n);return o.jsx(Ie.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});Qle.displayName=qz;var Zle="PopoverArrow",ece=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=zg(n);return o.jsx(pw,{...a,...r,ref:t})});ece.displayName=Zle;function Hz(e){return e?"open":"closed"}var tce=Lz,nce=zz,rce=Uz,Gz=Vz;const yh=tce,xh=nce,Fu=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>o.jsx(rce,{children:o.jsx(Gz,{ref:a,align:t,sideOffset:n,className:he("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
808de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Fu.displayName=Gz.displayName;function mI(e){if(!e)return"";const t=new Date(e).getTime();if(Number.isNaN(t))return"";const n=Math.floor((Date.now()-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}const ace=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(0),[a,s]=p.useState([]),i=ua(),l=async()=>{const[u,d]=await Promise.all([ee.getNotifications(),ee.getConversations()]),f=u.data||{};t(Array.isArray(f.notifications)?f.notifications:[]),r(f.unread??0);const h=Array.isArray(d.data)?d.data:[];h.sort((m,v)=>new Date(v.call_time||0).getTime()-new Date(m.call_time||0).getTime()),s(h.slice(0,6))};p.useEffect(()=>{l();const u=setInterval(l,3e4);return()=>clearInterval(u)},[]);const c=u=>{u&&(l(),n>0&&ee.markNotificationsRead().then(()=>r(0)))};return o.jsxs(yh,{onOpenChange:c,children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{className:"relative rounded-md p-2 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Notifications",children:[o.jsx(Zx,{className:"h-5 w-5"}),n>0&&o.jsx("span",{className:"absolute right-0.5 top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold leading-none text-primary-foreground",children:n>9?"9+":n})]})}),o.jsxs(Fu,{align:"end",className:"ml-4 w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)] p-0 sm:w-80",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[o.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Notifications"}),o.jsx("button",{onClick:()=>i("/dashboard/billing"),className:"text-xs font-medium text-primary hover:underline",children:"Billing"})]}),e.length===0&&a.length===0?o.jsxs("div",{className:"px-4 py-10 text-center",children:[o.jsx(Zx,{className:"mx-auto h-8 w-8 text-muted-foreground/40"}),o.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"You're all caught up"})]}):o.jsxs("ul",{className:"max-h-96 overflow-y-auto",children:[e.map(u=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>i("/dashboard/billing"),className:`flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50 ${u.read?"":"bg-primary/5"}`,children:[o.jsx("span",{className:"mt-0.5 rounded-full bg-yellow-500/15 p-1.5 text-yellow-500",children:o.jsx(co,{className:"h-4 w-4"})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-sm font-medium text-foreground",children:u.title}),u.body&&o.jsx("span",{className:"block text-xs text-muted-foreground",children:u.body}),o.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:mI(u.created_at)})]})]})},u.id)),a.length>0&&o.jsx("li",{className:"border-t border-border px-4 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:"Recent calls"}),a.map(u=>{const d=(u.direction||"").toLowerCase()==="inbound",f=d?ta:Wo;return o.jsx("li",{children:o.jsxs("button",{onClick:()=>i("/dashboard/conversations"),className:"flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50",children:[o.jsx("span",{className:"mt-0.5 rounded-full bg-primary/10 p-1.5 text-primary",children:o.jsx(f,{className:"h-4 w-4"})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsxs("span",{className:"block truncate text-sm text-foreground",children:[d?"Inbound":"Outbound"," call: ",u.contact_name||u.phone||"Unknown"]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.status||"—"," · ",mI(u.call_time)]})]})]})},u.id)})]})]})]})},oce=()=>{const[e,t]=p.useState(null);if(p.useEffect(()=>{let r=!0;const a=()=>ee.getBillingStatus().then(({data:i})=>{r&&i&&t(Number(i.balance??0))});a();const s=setInterval(a,3e4);return()=>{r=!1,clearInterval(s)}},[]),e===null||e>10)return null;const n=e<=0;return o.jsxs("div",{className:`mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm ${n?"border-destructive/40 bg-destructive/10 text-destructive":"border-yellow-500/40 bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(co,{className:"h-4 w-4 shrink-0"}),o.jsxs("span",{children:[n?"Your credit is used up.":`Low balance: $${e.toFixed(2)} left.`," ","Add funds to keep making calls without interruption."]})]}),o.jsx(jt,{to:"/dashboard/billing",className:"shrink-0 rounded-md bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground hover:opacity-90",children:"Add Funds"})]})},sce=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>{let n=!0;return ee.getMyRole().then(({data:r})=>{n&&r&&!r.is_owner&&r.role==="viewer"&&t(!0)}),()=>{n=!1}},[]),e?o.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground",children:[o.jsx(Ls,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{children:"You have read-only (Viewer) access on this account. Creating, editing, and deleting are disabled."})]}):null};function ice(){const e=Nse();return e?o.jsxs("div",{className:"fixed inset-x-4 bottom-4 z-[60] mx-auto flex w-fit max-w-[calc(100vw-2rem)] flex-wrap items-center justify-center gap-2 rounded-full border border-amber-600 bg-amber-500 px-3 py-2 text-xs font-medium text-black shadow-lg sm:gap-3 sm:px-4 sm:text-sm",children:[o.jsx(Ls,{className:"h-4 w-4 shrink-0"}),o.jsxs("span",{className:"min-w-0 break-words",children:["Viewing as ",o.jsx("strong",{className:"break-all",children:e})," ",o.jsx("span",{className:"opacity-70",children:"(admin)"})]}),o.jsx("button",{onClick:_se,className:"shrink-0 rounded-full bg-black/20 px-3 py-0.5 text-xs font-semibold transition hover:bg-black/30",children:"Exit admin view"})]}):null}const lce=[{label:"Quick Setup",to:"/dashboard/quick-setup"},{label:"AI Agents",to:"/dashboard/ai-agents"},{label:"AI Voices",to:"/dashboard/ai-voices"},{label:"Contacts",to:"/dashboard/database/contacts"},{label:"Lists",to:"/dashboard/database/lists"},{label:"Phone Numbers",to:"/dashboard/telephony/phone-numbers"},{label:"Campaigns",to:"/dashboard/telephony/campaigns"},{label:"Outbound Call Logs",to:"/dashboard/telephony/outbound-logs"},{label:"AI Receptionist",to:"/dashboard/telephony/inbound"},{label:"Inbound Call Logs",to:"/dashboard/telephony/inbound-logs"},{label:"All Conversations",to:"/dashboard/conversations"},{label:"Analytics — Channel",to:"/dashboard/analytics/channel"},{label:"Analytics — Campaign",to:"/dashboard/analytics/campaign"},{label:"Analytics — Scenario",to:"/dashboard/analytics/scenario"},{label:"Call Events",to:"/dashboard/call-events"},{label:"Call Events — Callbacks",to:"/dashboard/call-events/callbacks"},{label:"Automation",to:"/dashboard/automation"},{label:"Integrations",to:"/dashboard/integrations"},{label:"Billing",to:"/dashboard/billing"},{label:"Billing — Transactions",to:"/dashboard/billing/transactions"},{label:"Billing — Call Costs",to:"/dashboard/billing/call-costs"},{label:"Referrals",to:"/dashboard/referrals"},{label:"Profile & Teams",to:"/dashboard/profile"},{label:"Support",to:"/dashboard/support"}];function cce(){const e=ua(),[t,n]=p.useState(""),[r,a]=p.useState(!1),[s,i]=p.useState(0),[l,c]=p.useState(!1),[u,d]=p.useState({agents:[],contacts:[],phoneNumbers:[],campaigns:[]}),f=p.useRef(null),h=p.useRef(!1);p.useEffect(()=>{const w=N=>
808{f.current&&!f.current.contains(N.target)&&a(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]);const m=async()=>{if(h.current)return;h.current=!0,c(!0);const[w,N,S,_]=await Promise.all([ee.getAgents(),ee.getContacts(),ee.getPhoneNumbers(),ee.getCampaigns()]);d({agents:w.data??[],contacts:N.data??[],phoneNumbers:S.data??[],campaigns:_.data??[]}),c(!1)},v=p.useMemo(()=>{const w=t.trim().toLowerCase();if(!w)return[];const N=lce.filter(O=>O.label.toLowerCase().includes(w)).map(O=>({id:O.to,label:O.label,to:O.to,group:"Pages",icon:du})),S=u.agents.filter(O=>{var $;return($=O.name)==null?void 0:$.toLowerCase().includes(w)}).map(O=>({id:O.id,label:O.name,sublabel:O.category??void 0,to:"/dashboard/ai-agents",group:"AI Agents",icon:zn})),_=u.contacts.filter(O=>{var $,T,z;return(($=O.name)==null?void 0:$.toLowerCase().includes(w))||((T=O.phone)==null?void 0:T.toLowerCase().includes(w))||((z=O.email)==null?void 0:z.toLowerCase().includes(w))}).map(O=>({id:O.id,label:O.name,sublabel:O.phone||O.email,to:"/dashboard/database/contacts",group:"Contacts",icon:Fs})),k=u.phoneNumbers.filter(O=>{var $;return($=O.number)==null?void 0:$.toLowerCase().includes(w)}).map(O=>({id:O.id,label:O.number,sublabel:O.status??void 0,to:"/dashboard/telephony/phone-numbers",group:"Phone Numbers",icon:Un})),P=u.campaigns.filter(O=>{var $;return($=O.name)==null?void 0:$.toLowerCase().includes(w)}).map(O=>({id:O.id,label:O.name,sublabel:O.status??void 0,to:"/dashboard/telephony/campaigns",group:"Campaigns",icon:Wo}));return[...N,...S,..._,...k,...P].slice(0,30)},[t,u]),g=p.useMemo(()=>{const w=new Map;for(const N of v){const S=w.get(N.group)??[];S.push(N),w.set(N.group,S)}return w},[v]);p.useEffect(()=>{i(0)},[t]);const y=w=>{e(w.to),a(!1),n("")},x=w=>{if(!(!r||v.length===0))if(w.key==="ArrowDown")w.preventDefault(),i(N=>Math.min(N+1,v.length-1));else if(w.key==="ArrowUp")w.preventDefault(),i(N=>Math.max(N-1,0));else if(w.key==="Enter"){w.preventDefault();const N=v[s];N&&y(N)}else w.key==="Escape"&&a(!1)};let b=-1;return o.jsxs("div",{ref:f,className:"relative hidden flex-1 max-w-md md:block",children:[o.jsx(du,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{value:t,onChange:w=>{n(w.target.value),a(!0)},onFocus:()=>{a(!0),m()},onKeyDown:x,placeholder:"Search agents, contacts, numbers, pages…",className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-8 text-sm outline-none focus:ring-2 focus:ring-ring"}),t&&o.jsx("button",{onClick:()=>{n(""),a(!1)},"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:o.jsx(rn,{className:"h-4 w-4"})}),r&&t.trim()&&o.jsx("div",{className:"absolute left-0 right-0 top-11 z-50 max-h-96 overflow-y-auto rounded-md border border-border bg-popover shadow-lg",children:l&&u.agents.length===0&&u.contacts.length===0?o.jsx("div",{className:"px-3 py-4 text-sm text-muted-foreground",children:"Searching…"}):v.length===0?o.jsxs("div",{className:"px-3 py-4 text-sm text-muted-foreground",children:['No results for "',t,'"']}):Array.from(g.entries()).map(([w,N])=>o.jsxs("div",{className:"py-1",children:[o.jsx("div",{className:"px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:w}),N.map(S=>{b+=1;const _=b,k=S.icon;return o.jsxs("button",{onClick:()=>y(S),onMouseEnter:()=>i(_),className:he("flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",_===s?"bg-muted":"hover:bg-muted"),children:[o.jsx(k,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),o.jsx("span",{className:"flex-1 truncate",children:S.label}),S.sublabel&&o.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:S.sublabel})]},`${S.group}-${S.id}`)})]},w))})]})}var dS="rovingFocusGroup.onEntryFocus",uce={bubbles:!1,cancelable:!0},Ug="RovingFocusGroup",[nC,Yz,dce]=Pg(Ug),[fce,Kz]=Gr(Ug,[dce]),[hce,mce]=fce(Ug),Xz=p.forwardRef((e,t)=>o.jsx(nC.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(nC.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(pce,{...e,ref:t})})}));Xz.displayName=Ug;var pce=p.forwardRef((e,t)=>
vendor: 18,070 bytes, line 808
808{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=p.useRef(null),m=at(t,h),v=Nw(s),[g,y]=lo({prop:i,defaultProp:l??null,onChange:c,caller:Ug}),[x,b]=p.useState(!1),w=ca(u),N=Yz(n),S=p.useRef(!1),[_,k]=p.useState(0);return p.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(dS,w),()=>P.removeEventListener(dS,w)},[w]),o.jsx(hce,{scope:n,orientation:r,dir:v,loop:a,currentTabStopId:g,onItemFocus:p.useCallback(P=>y(P),[y]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:p.useCallback(()=>k(P=>P-1),[]),children:o.jsx(Ie.div,{tabIndex:x||_===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:xe(e.onMouseDown,()=>{S.current=!0}),onFocus:xe(e.onFocus,P=>{const O=!S.current;if(P.target===P.currentTarget&&O&&!x){const $=new CustomEvent(dS,uce);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const T=N().filter(W=>W.focusable),z=T.find(W=>W.active),U=T.find(W=>W.id===g),q=[z,U,...T].filter(Boolean).map(W=>W.ref.current);Zz(q,d)}}S.current=!1}),onBlur:xe(e.onBlur,()=>b(!1))})})}),Jz="RovingFocusGroupItem",Qz=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:i,...l}=e,c=Zn(),u=s||c,d=mce(Jz,n),f=d.currentTabStopId===u,h=Yz(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:g}=d;return p.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),o.jsx(nC.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:o.jsx(Ie.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:xe(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:xe(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:xe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=yce(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=h().filter(N=>N.focusable).map(N=>N.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const N=w.indexOf(y.currentTarget);w=d.loop?xce(w,N+1):w.slice(N+1)}setTimeout(()=>Zz(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Qz.displayName=Jz;var gce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vce(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yce(e,t,n){const r=vce(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gce[r]}function Zz(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bce=Xz,wce=Qz,rC=["Enter"," "],jce=["ArrowDown","PageUp","Home"],eU=["ArrowUp","PageDown","End"],Sce=[...jce,...eU],Nce={ltr:[...rC,"ArrowRight"],rtl:[...rC,"ArrowLeft"]},_ce={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vg="Menu",[Tp,Cce,kce]=Pg(Vg),[Bu,tU]=Gr(Vg,[kce,sc,Kz]),Tw=sc(),nU=Kz(),[Ece,zu]=Bu(Vg),[Ace,Wg]=Bu(Vg),rU=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:s,modal:i=!0}=e,l=Tw(t),[c,u]=p.useState(null),d=p.useRef(!1),f=ca(s),h=Nw(a);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),o.jsx(dA,{...l,children:o.jsx(Ece,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(Ace,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};rU.displayName=Vg;var Pce="MenuAnchor",_A=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Tw(n);return o.jsx(Rg,{...a,...r,ref:t})});_A.displayName=Pce;var CA="MenuPortal",[Tce,aU]=Bu(CA,{forceMount:void 0}),oU=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,s=zu(CA,t);return o.jsx(Tce,{scope:t,forceMount:n,children:o.jsx(da,{present:n||s.open,children:o.jsx(dh,{asChild:!0,container:a,children:r})})})};oU.displayName=CA;var to="MenuContent",[Oce,kA]=Bu(to),sU=p.forwardRef((e,t)=>{const n=aU(to,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,s=zu(to,e.__scopeMenu),i=Wg(to,e.__scopeMenu);return o.jsx(Tp.Provider,{scope:e.__scopeMenu,children:o.jsx(da,{present:r||s.open,children:o.jsx(Tp.Slot,{scope:e.__scopeMenu,children:i.modal?o.jsx(Mce,{...a,ref:t}):o.jsx(Ice,{...a,ref:t})})})})}),Mce=p.forwardRef((e,t)=>{const n=zu(to,e.__scopeMenu),r=p.useRef(null),a=at(t,r);return p.useEffect(()=>{const s=r.current;if(s)return Ew(s)},[]),o.jsx(EA,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:xe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ice=p.forwardRef((e,t)=>{const n=zu(to,e.__scopeMenu);return o.jsx(EA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$ce=Hl("MenuContent.ScrollLock"),EA=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...g}=e,y=zu(to,n),x=Wg(to,n),b=Tw(n),w=nU(n),N=Cce(n),[S,_]=p.useState(null),k=p.useRef(null),P=at(t,k,y.onContentChange),O=p.useRef(0),$=p.useRef(""),T=p.useRef(0),z=p.useRef(null),U=p.useRef("right"),E=p.useRef(0),q=v?Bg:p.Fragment,W=v?{as:$ce,allowPinchZoom:!0}:void 0,L=B=>{var V,Y;const I=$.current+B,R=N().filter(G=>!G.disabled),F=document.activeElement,j=(V=R.find(G=>G.ref.current===F))==null?void 0:V.textValue,C=R.map(G=>G.textValue),A=Gce(C,I,j),D=(Y=R.find(G=>G.textValue===A))==null?void 0:Y.ref.current;(function G(K){$.current=K,window.clearTimeout(O.current),K!==""&&(O.current=window.setTimeout(()=>G(""),1e3))})(I),D&&setTimeout(()=>D.focus())};p.useEffect(()=>()=>window.clearTimeout(O.current),[]),kw();const M=p.useCallback(B=>{var R,F;return U.current===((R=z.current)==null?void 0:R.side)&&Kce(B,(F=z.current)==null?void 0:F.area)},[]);return o.jsx(Oce,{scope:n,searchRef:$,onItemEnter:p.useCallback(B=>{M(B)&&B.preventDefault()},[M]),onItemLeave:p.useCallback(B=>{var I;M(B)||((I=k.current)==null||I.focus(),_(null))},[M]),onTriggerLeave:p.useCallback(B=>{M(B)&&B.preventDefault()},[M]),pointerGraceTimerRef:T,onPointerGraceIntentChange:p.useCallback(B=>{z.current=B},[]),children:o.jsx(q,{...W,children:o.jsx(Fg,{asChild:!0,trapped:a,onMountAutoFocus:xe(s,B=>{var I;B.preventDefault(),(I=k.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:o.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:o.jsx(bce,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:_,onEntryFocus:xe(c,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(mw,{role:"menu","aria-orientation":"vertical","data-state":jU(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:xe(g.onKeyDown,B=>{const R=B.target.closest("[data-radix-menu-content]")===B.currentTarget,F=B.ctrlKey||B.altKey||B.metaKey,j=B.key.length===1;R&&(B.key==="Tab"&&B.preventDefault(),!F&&j&&L(B.key));const C=k.current;if(B.target!==C||!Sce.includes(B.key))return;B.preventDefault();const D=N().filter(V=>!V.disabled).map(V=>V.ref.current);eU.includes(B.key)&&D.reverse(),qce(D)}),onBlur:xe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(O.current),$.current="")}),onPointerMove:xe(e.onPointerMove,Op(B=>{const I=B.target,R=E.current!==B.clientX;if(B.currentTarget.contains(I)&&R){const F=B.clientX>E.current?"right":"left";U.current=F,E.current=B.clientX}}))})})})})})})});sU.displayName=to;var Dce="MenuGroup",AA=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ie.div,{role:"group",...r,ref:t})});AA.displayName=Dce;var Rce="MenuLabel",iU=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ie.div,{...r,ref:t})});iU.displayName=Rce;var ib="MenuItem",pI="menu.itemSelect",Ow=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,s=p.useRef(null),i=Wg(ib,e.__scopeMenu),l=kA(ib,e.__scopeMenu),c=at(t,s),u=p.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(pI,{bubbles:!0,cancelable:!0});f.addEventListener(pI,m=>r==null?void 0:r(m),{once:!0}),D2(f,h),h.defaultPrevented?u.current=!1:i.onClose()}};return o.jsx(lU,{...a,ref:c,disabled:n,onClick:xe(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:xe(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:xe(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||rC.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ow.displayName=ib;var lU=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...s}=e,i=kA(ib,n),l=nU(n),c=p.useRef(null),u=at(t,c),[d,f]=p.useState(!1),[h,m]=p.useState("");return p.useEffect(()=>{const v=c.current;v&&m((v.textContent??"").trim())},[s.children]),o.jsx(Tp.ItemSlot,{scope:n,disabled:r,textValue:a??h,children:o.jsx(wce,{asChild:!0,...l,focusable:!r,children:o.jsx(Ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:xe(e.onPointerMove,Op(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(e.onPointerLeave,Op(v=>i.onItemLeave(v))),onFocus:xe(e.onFocus,()=>f(!0)),onBlur:xe(e.onBlur,()=>f(!1))})})})}),Lce="MenuCheckboxItem",cU=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return o.jsx(mU,{scope:e.__scopeMenu,checked:n,children:o.jsx(Ow,{role:"menuitemcheckbox","aria-checked":lb(n)?"mixed":n,...a,ref:t,"data-state":TA(n),onSelect:xe(a.onSelect,()=>r==null?void 0:r(lb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cU.displayName=Lce;var uU="MenuRadioGroup",[Fce,Bce]=Bu(uU,{value:void 0,onValueChange:()=>{}}),dU=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,s=ca(r);return o.jsx(Fce,{scope:e.__scopeMenu,value:n,onValueChange:s,children:o.jsx(AA,{...a,ref:t})})});dU.displayName=uU;var fU="MenuRadioItem",hU=p.forwardRef((e,t)=>{const{value:n,...r}=e,a=Bce(fU,e.__scopeMenu),s=n===a.value;return o.jsx(mU,{scope:e.__scopeMenu,checked:s,children:o.jsx(Ow,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":TA(s),onSelect:xe(r.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,n)},{checkForDefaultPrevented:!1})})})});hU.displayName=fU;var PA="MenuItemIndicator",[mU,zce]=Bu(PA,{checked:!1}),pU=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,s=zce(PA,n);return o.jsx(da,{present:r||lb(s.checked)||s.checked===!0,children:o.jsx(Ie.span,{...a,ref:t,"data-state":TA(s.checked)})})});pU.displayName=PA;var Uce="MenuSeparator",gU=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});gU.displayName=Uce;var Vce="MenuArrow",vU=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Tw(n);return o.jsx(pw,{...a,...r,ref:t})});vU.displayName=Vce;var Wce="MenuSub",[Fqe,yU]=Bu(Wce),Cm="MenuSubTrigger",xU=p.forwardRef((e,t)=>{const n=zu(Cm,e.__scopeMenu),r=Wg(Cm,e.__scopeMenu),a=yU(Cm,e.__scopeMenu),s=kA(Cm,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),o.jsx(_A,{asChild:!0,...u,children:o.jsx(lU,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":jU(n.open),...e,ref:Ti(t,a.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:xe(e.onPointerMove,Op(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:xe(e.onPointerLeave,Op(f=>{var m,v;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(v=n.content)==null?void 0:v.dataset.side,y=g==="right",x=y?-5:5,b=h[y?"left":"right"],w=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:b,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:xe(e.onKeyDown,f=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||Nce[r.dir].includes(f.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),f.preventDefault())})})})});xU.displayName=Cm;var bU="MenuSubContent",wU=p.forwardRef((e,t)=>{const n=aU(to,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,s=zu(to,e.__scopeMenu),i=Wg(to,e.__scopeMenu),l=yU(bU,e.__scopeMenu),c=p.useRef(null),u=at(t,c);return o.jsx(Tp.Provider,{scope:e.__scopeMenu,children:o.jsx(da,{present:r||s.open,children:o.jsx(Tp.Slot,{scope:e.__scopeMenu,children:o.jsx(EA,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:xe(e.onFocusOutside,d=>{d.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:xe(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:xe(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),h=_ce[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(m=l.trigger)==null||m.focus(),d.preventDefault())})})})})})});wU.displayName=bU;function jU(e){return e?"open":"closed"}function lb(e){return e==="indeterminate"}function TA(e){return lb(e)?"indeterminate":e?"checked":"unchecked"}function qce(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Hce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Gce(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Hce(e,Math.max(s,0));a.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function Yce(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(a=!a)}return a}function Kce(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yce(n,t)}function Op(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Xce=rU,Jce=_A,Qce=oU,Zce=sU,eue=AA,tue=iU,nue=Ow,rue=cU,aue=dU,oue=hU,sue=pU,iue=gU,lue=vU,cue=xU,uue=wU,Mw="DropdownMenu",[due,Bqe]=Gr(Mw,[tU]),Yr=tU(),[fue,SU]=due(Mw),NU=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=Yr(t),u=p.useRef(null),[d,f]=lo({prop:a,defaultProp:s??!1,onChange:i,caller:Mw});return o.jsx(fue,{scope:t,triggerId:Zn(),triggerRef:u,contentId:Zn(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(Xce,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};NU.displayName=Mw;var _U="DropdownMenuTrigger",CU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,s=SU(_U,n),i=Yr(n);return o.jsx(Jce,{asChild:!0,...i,children:o.jsx(Ie.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Ti(t,s.triggerRef),onPointerDown:xe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:xe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});CU.displayName=_U;var hue="DropdownMenuPortal",kU=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yr(t);return o.jsx(Qce,{...r,...n})};kU.displayName=hue;var EU="DropdownMenuContent",AU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=SU(EU,n),s=Yr(n),i=p.useRef(!1);return o.jsx(Zce,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...r,ref:t,onCloseAutoFocus:xe(e.onCloseAutoFocus,l=>{var c;i.current||(c=a.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:xe(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!a.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AU.displayName=EU;var mue="DropdownMenuGroup",pue=p.forwardRef((e,t)=>
808{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(eue,{...a,...r,ref:t})});pue.displayName=mue;var gue="DropdownMenuLabel",PU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(tue,{...a,...r,ref:t})});PU.displayName=gue;var vue="DropdownMenuItem",TU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(nue,{...a,...r,ref:t})});TU.displayName=vue;var yue="DropdownMenuCheckboxItem",OU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(rue,{...a,...r,ref:t})});OU.displayName=yue;var xue="DropdownMenuRadioGroup",bue=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(aue,{...a,...r,ref:t})});bue.displayName=xue;var wue="DropdownMenuRadioItem",MU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(oue,{...a,...r,ref:t})});MU.displayName=wue;var jue="DropdownMenuItemIndicator",IU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(sue,{...a,...r,ref:t})});IU.displayName=jue;var Sue="DropdownMenuSeparator",$U=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(iue,{...a,...r,ref:t})});$U.displayName=Sue;var Nue="DropdownMenuArrow",_ue=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(lue,{...a,...r,ref:t})});_ue.displayName=Nue;var Cue="DropdownMenuSubTrigger",DU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(cue,{...a,...r,ref:t})});DU.displayName=Cue;var kue="DropdownMenuSubContent",RU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yr(n);return o.jsx(uue,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});RU.displayName=kue;var Eue=NU,Aue=CU,Pue=kU,LU=AU,FU=PU,BU=TU,zU=OU,UU=MU,VU=IU,WU=$U,qU=DU,HU=RU;const Tue=Eue,Oue=Aue,Mue=p.forwardRef(({className:e,inset:t,children:n,...r},a)=>o.jsxs(qU,{ref:a,className:he("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,o.jsx(zo,{className:"ml-auto h-4 w-4"})]}));Mue.displayName=qU.displayName;const Iue=p.forwardRef(({className:e,...t},n)=>o.jsx(HU,{ref:n,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Iue.displayName=HU.displayName;const GU=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(Pue,{children:o.jsx(LU,{ref:r,sideOffset:t,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));GU.displayName=LU.displayName;const ix=p.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(BU,{ref:r,className:he("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));ix.displayName=BU.displayName;const $ue=p.forwardRef(({className:e,children:t,checked:n,...r},a)=>o.jsxs(zU,{ref:a,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(VU,{children:o.jsx(Ta,{className:"h-4 w-4"})})}),t]}));$ue.displayName=zU.displayName;const Due=p.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(UU,{ref:r,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(VU,{children:o.jsx(BB,{className:"h-2 w-2 fill-current"})})}),t]}));Due.displayName=UU.displayName;const YU=p.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(FU,{ref:r,className:he("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));YU.displayName=FU.displayName;const aC=p.forwardRef(({className:e,...t},n)=>o.jsx(WU,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));aC.displayName=WU.displayName;const gI=[{label:"Quick Setup",to:"/dashboard/quick-setup",icon:H2},{label:"AI Agents",to:"/dashboard/ai-agents",icon:zn},{label:"AI Voices",to:"/dashboard/ai-voices",icon:Oi},{label:"Database",icon:xre,children:[{label:"Contacts",to:"/dashboard/database/contacts"},{label:"Lists",to:"/dashboard/database/lists"}]},{label:"Phone Numbers",to:"/dashboard/telephony/phone-numbers",
808icon:Un},{label:"Inbound",icon:ta,children:[{label:"AI Receptionist",to:"/dashboard/telephony/inbound"},{label:"Call Logs",to:"/dashboard/telephony/inbound-logs"}]},{label:"Outbound",icon:Wo,children:[{label:"Campaigns",to:"/dashboard/telephony/campaigns"},{label:"Call Logs",to:"/dashboard/telephony/outbound-logs"}]},{label:"All Conversations",to:"/dashboard/conversations",icon:K2},{label:"Analytics",icon:cu,children:[{label:"Channel",to:"/dashboard/analytics/channel"},{label:"Campaign",to:"/dashboard/analytics/campaign"},{label:"Scenario",to:"/dashboard/analytics/scenario"}]},{label:"Call Events",to:"/dashboard/call-events",icon:$g},{label:"Automation",to:"/dashboard/automation",icon:Ig},{label:"Integrations",to:"/dashboard/integrations",icon:Mre},{label:"Billing",to:"/dashboard/billing",icon:uu},{label:"Referrals",to:"/dashboard/referrals",icon:d8},{label:"Profile & Teams",to:"/dashboard/profile",icon:Fs},{label:"Support",to:"/dashboard/support",icon:n8}],Rue=()=>{var m;const[e,t]=p.useState(!1),n=ua(),{user:r,loading:a,signOut:s}=vh(),[i,l]=p.useState("Account Owner");p.useEffect(()=>{!a&&!r&&n("/login")},[r,a,n]);const c=p.useRef(!1);if(p.useEffect(()=>{if(!r)return;const v=()=>{ee.getMyRole().then(({data:y})=>{y&&(l(y.is_owner?"Account Owner":y.role==="viewer"?"Viewer":"Member"),y.is_owner?c.current&&(X.error("You've been removed from this team by the account owner."),s().then(()=>n("/login"))):c.current=!0)})};v();const g=setInterval(v,2e4);return()=>clearInterval(g)},[r,s,n]),a||!r)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted/30",children:o.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading…"})});const u=((m=r.user_metadata)==null?void 0:m.full_name)||r.email||"User",d=u.split(" ").map(v=>v[0]).filter(Boolean).slice(0,2).join("").toUpperCase(),f={name:u,email:r.email??"",avatar:d,role:i},h=async()=>{await s(),X.success("Signed out"),n("/login")};return o.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[o.jsx(ice,{}),e&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>t(!1)}),o.jsx(Lue,{mobileOpen:e,onClose:()=>t(!1),profile:f,onSignOut:h}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col lg:pl-72",children:[o.jsxs("header",{className:"sticky top-0 z-30 flex h-16 items-center gap-3 border-b border-border bg-background/95 px-4 backdrop-blur sm:px-6",children:[o.jsx("button",{onClick:()=>t(!0),className:"rounded-md p-2 hover:bg-muted lg:hidden","aria-label":"Open menu",children:o.jsx(a8,{className:"h-5 w-5"})}),o.jsx(cce,{}),o.jsxs("div",{className:"flex flex-1 items-center justify-end gap-3",children:[o.jsx(ob,{}),o.jsx(ace,{}),o.jsxs(Tue,{children:[o.jsx(Oue,{asChild:!0,children:o.jsxs("button",{className:"flex min-w-0 items-center gap-2 rounded-md p-1 pr-2 outline-none transition-colors hover:bg-muted",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/15 text-xs font-semibold text-primary",children:f.avatar}),o.jsxs("div",{className:"hidden min-w-0 text-left text-sm leading-tight sm:block",children:[o.jsx("div",{className:"truncate font-medium text-foreground md:max-w-[10rem] lg:max-w-[14rem]",children:f.name}),o.jsx("div",{className:"truncate text-xs text-muted-foreground",children:f.role})]}),o.jsx(Iu,{className:"hidden h-4 w-4 shrink-0 text-muted-foreground sm:block"})]})}),o.jsxs(GU,{align:"end",className:"w-56",children:[o.jsxs(YU,{children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:f.name}),o.jsx("div",{className:"truncate text-xs font-normal text-muted-foreground",children:f.email})]}),o.jsx(aC,{}),o.jsxs(ix,{onClick:()=>n("/dashboard/profile"),children:[o.jsx(Fs,{className:"mr-2 h-4 w-4"}),"Profile & Teams"]}),o.jsxs(ix,{onClick:()=>n("/dashboard/billing"),children:[o.jsx(uu,{className:"mr-2 h-4 w-4"}),"Billing"]}),o.jsx(aC,{}),o.jsxs(ix,{onClick:h,className:"text-destructive focus:text-destructive",children:[o.jsx(Y2,{className:"mr-2 h-4 w-4"}),"Sign Out"]})]})]})]})]}),o.jsxs("main",{className:"flex-1 px-4 py-6 sm:px-6 lg:px-8",children:[o.jsx(sce,{}),o.jsx(oce,{}),o.jsx(M2,{})]})]})]})};function Lue({mobileOpen:e,onClose:t,profile:n,onSignOut:r}){const s=mo().pathname,i=gI.reduce((d,f)=>(f.children&&(d[f.label]=f.children.some(h=>
808s.startsWith(h.to))),d),{}),[l,c]=p.useState(i),u=d=>d?s===d||s.startsWith(d+"/"):!1;return o.jsxs("aside",{className:he("fixed inset-y-0 left-0 z-50 flex w-72 flex-col sidebar-ambient text-sidebar-foreground transition-transform duration-200 lg:translate-x-0",e?"translate-x-0":"-translate-x-full"),children:[o.jsxs("div",{className:"flex h-16 items-center justify-between border-b border-sidebar-border px-5",children:[o.jsx(jt,{to:"/dashboard/quick-setup",className:"flex items-center",children:o.jsx(Os,{linked:!1})}),o.jsx("button",{onClick:t,className:"rounded-md p-1.5 text-sidebar-muted hover:bg-sidebar-accent lg:hidden","aria-label":"Close menu",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsx("div",{className:"mx-3 mt-4 rounded-xl border border-sidebar-border bg-sidebar-accent/40 p-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground",children:n.avatar}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:n.name}),o.jsx("div",{className:"truncate text-xs text-sidebar-muted",children:n.email})]})]})}),o.jsx("nav",{className:"mt-4 flex-1 overflow-y-auto px-2 pb-4",children:o.jsx("ul",{className:"space-y-0.5",children:gI.map(d=>{if(d.children){const f=l[d.label],h=d.children.some(m=>u(m.to));return o.jsxs("li",{children:[o.jsxs("button",{onClick:()=>c(m=>({...m,[d.label]:!m[d.label]})),className:he("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm transition",h?"bg-primary/15 text-foreground":"text-sidebar-foreground hover:bg-sidebar-accent"),children:[o.jsx(d.icon,{className:he("h-4 w-4",h?"text-primary":"text-sidebar-muted")}),o.jsx("span",{className:"flex-1 text-left",children:d.label}),f?o.jsx(Iu,{className:"h-4 w-4"}):o.jsx(zo,{className:"h-4 w-4"})]}),f&&o.jsx("ul",{className:"ml-4 mt-1 space-y-0.5 border-l border-sidebar-border pl-3",children:d.children.map(m=>o.jsx("li",{children:o.jsx(Jx,{to:m.to,onClick:t,className:({isActive:v})=>he("block rounded-md px-3 py-1.5 text-sm transition",v?"bg-primary text-primary-foreground font-medium":"text-sidebar-foreground hover:bg-sidebar-accent"),children:m.label})},m.to))})]},d.label)}return o.jsx("li",{children:o.jsxs(Jx,{to:d.to,onClick:t,end:d.to==="/dashboard",className:({isActive:f})=>he("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition",f?"bg-primary text-primary-foreground font-semibold":"text-sidebar-foreground hover:bg-sidebar-accent"),children:[o.jsx(d.icon,{className:"h-4 w-4"}),o.jsx("span",{children:d.label})]})},d.label)})})}),o.jsx("div",{className:"border-t border-sidebar-border p-3",children:o.jsxs("button",{onClick:r,className:"flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm text-destructive transition hover:bg-destructive/10",children:[o.jsx(Y2,{className:"h-4 w-4"}),"Sign Out"]})})]})}const Fue=()=>o.jsx(R_,{to:"/dashboard/quick-setup",replace:!0}),Bue={Bot:zn,Phone:Un,Rocket:Np,Users:Fs,PhoneIncoming:ta,BarChart3:cu},fS=[{key:"agent",title:"Create your first AI Agent",description:"Configure an agent for lead qualification",time:"5 min",icon:"Bot",href:"/dashboard/ai-agents/create"},{key:"phone",title:"Get a phone number",description:"Provision a number for inbound or outbound calls",time:"2 min",icon:"Phone",href:"/dashboard/telephony/phone-numbers"},{key:"contacts",title:"Add your contacts",description:"Import or add contacts to call",time:"3 min",icon:"Users",href:"/dashboard/database/contacts"},{key:"campaign",title:"Launch your first campaign",description:"Start a dialer campaign with your agent",time:"10 min",icon:"Rocket",href:"/dashboard/telephony/campaigns"},{key:"inbound",title:"Set up an inbound receptionist",description:"Let an AI agent answer incoming calls",time:"5 min",icon:"PhoneIncoming",href:"/dashboard/telephony/inbound"},{key:"analytics",title:"Review your analytics",description:"Track KPIs across channels and campaigns",time:"3 min",icon:"BarChart3",href:"/dashboard/analytics/channel"}],zue=()=>{var d,f,h;const{user:e}=vh(),[t,n]=p.useState({agent:!1,phone:!1,contacts:!1,campaign:!1,inbound:!1,analytics:!1}),[r,a]=p.useState(!0);p.useEffect(()=>{(async()=>{var w,N,S,_,k,P;const[m,v,g,y,x,b]=await Promise.all([ee.getAgents(),ee.getPhoneNumbers(),ee.getContacts(),ee.getCampaigns(),ee.getInboundQueues(),ee.getConversations()]);n({agent:(((w=m.data)==null?void 0:w.length)??0)>0,phone:(((N=v.data)==null?void 0:N.length)??0)>0,contacts:(((S=g.data)==null?void 0:S.length)??0)>0,campaign:(((_=y.data)==null?void 0:_.length)??0)>0,inbound:(((k=x.data)==null?void 0:k.length)??0)>0,analytics:(((P=b.data)==null?void 0:P.length)??0)>0}
808),a(!1)})()},[]);const s=Object.values(t).filter(Boolean).length,i=Math.round(s/fS.length*100),l=[0,20,40,60,80,100],c=(f=(d=e==null?void 0:e.user_metadata)==null?void 0:d.full_name)==null?void 0:f.trim(),u=c?c.split(" ")[0]:((h=e==null?void 0:e.email)==null?void 0:h.split("@")[0])||"there";return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-gradient-to-br from-primary/10 via-background to-background p-6 sm:p-8",children:[o.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:["Welcome to EDM Nexus, ",u]}),o.jsx("p",{className:"mt-1 text-muted-foreground",children:s===fS.length?"Setup complete you're all set.":"Let's get you up and running in minutes."})]}),o.jsx(Uue,{percent:r?0:i})]}),o.jsxs("div",{className:"mt-6",children:[o.jsxs("div",{className:"mb-2 flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"Quick Setup Progress"}),o.jsx("span",{className:"font-medium text-foreground",children:r?"…":`${i}%`})]}),o.jsxs("div",{className:"relative h-2 rounded-full bg-muted",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-primary transition-all",style:{width:`${r?0:i}%`}}),l.map(m=>o.jsx("div",{className:"absolute -top-1 h-4 w-4 -translate-x-1/2 rounded-full border-2 border-background",style:{left:`${m}%`,backgroundColor:i>=m?"hsl(var(--primary))":"hsl(var(--muted))"}},m))]}),o.jsx("div",{className:"mt-2 flex justify-between text-xs text-muted-foreground",children:l.map(m=>o.jsxs("span",{children:[m,"%"]},m))})]})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"Setup Checklist"}),r?o.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Checking your progress…"]}):o.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:fS.map(m=>{const v=Bue[m.icon],g=t[m.key];return o.jsxs(jt,{to:m.href,className:"group block rounded-xl border border-border bg-card p-5 card-interactive",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(v,{className:"h-5 w-5"})}),g?o.jsx(tr,{className:"h-5 w-5 text-primary"}):o.jsx(BB,{className:"h-5 w-5 text-muted-foreground"})]}),o.jsx("h3",{className:"mt-4 font-semibold text-foreground",children:m.title}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:m.description}),o.jsxs("div",{className:"mt-4 flex items-center justify-between text-xs",children:[o.jsxs("span",{className:"text-muted-foreground",children:["⏱ ",m.time]}),g?o.jsx("span",{className:"rounded-full bg-success/15 px-2 py-0.5 font-medium text-success",children:"✓ Done"}):o.jsx("span",{className:"font-medium text-primary group-hover:underline",children:"Start →"})]})]},m.key)})})]})]})};function Uue({percent:e}){const n=2*Math.PI*32,r=n-e/100*n;return o.jsxs("div",{className:"relative flex h-24 w-24 items-center justify-center",children:[o.jsxs("svg",{viewBox:"0 0 80 80",className:"h-24 w-24 -rotate-90",children:[o.jsx("circle",{cx:"40",cy:"40",r:32,stroke:"hsl(var(--muted))",strokeWidth:"6",fill:"none"}),o.jsx("circle",{cx:"40",cy:"40",r:32,stroke:"hsl(var(--primary))",strokeWidth:"6",fill:"none",strokeDasharray:n,strokeDashoffset:r,strokeLinecap:"round"})]}),o.jsxs("div",{className:"absolute text-center",children:[o.jsxs("div",{className:"text-xl font-bold text-foreground",children:[e,"%"]}),o.jsx("div",{className:"text-[10px] uppercase text-muted-foreground",children:"complete"})]})]})}var KU={};function vI(e,t){if(e==null)return{};var n,r,a=function(i,l){if(i==null)return{};var c={};for(var u in i)if({}.hasOwnProperty.call(i,u)){if(l.indexOf(u)!==-1)continue;c[u]=i[u]}return c}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function La(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(e){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function XU(e){var t=function(n,r){if(St(n)!="object"||!n)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var s=a.call(n,r||"default");if(St(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return St(t)=="symbol"?t:t+""}function yI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XU(r.key),r)}}
vendor: 7,196 bytes, lines 808-809
808function Fa(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iw(e,t){if(t&&(St(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(e)}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Go(e)}function Mp(e,t){return Mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Mp(e,t)}function $w(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mp(e,t)}function gs(e,t,n){return(t=XU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xI(e,t,n,r,a,s,i){try{var l=e[s](i),c=l.value}catch(u){return void n(u)}l.done?t(c):Promise.resolve(c).then(r,a)}function Ge(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var s=e.apply(t,n);function i(c){xI(s,r,a,i,l,"next",c)}function l(c){xI(s,r,a,i,l,"throw",c)}i(void 0)})}}function bI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ar(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var s,i,l,c,u=[],d=!0,f=!1;try{if(l=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;d=!1}else for(;!(d=(s=l.call(a)).done)&&(u.push(s.value),u.length!==r);d=!0);}catch(h){f=!0,i=h}finally{try{if(!d&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(f)throw i}}return u}}(e,t)||function(n,r){if(n){if(typeof n=="string")return bI(n,r);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?bI(n,r):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
809In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Vue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wI,Xv={exports:{}},oC=function(){if(wI)return Xv.exports;wI=1;var e,t=typeof Reflect=="object"?Reflect:null,n=t&&typeof t.apply=="function"?t.apply:function(g,y,x){return Function.prototype.apply.call(g,y,x)};e=t&&typeof t.ownKeys=="function"?t.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var r=Number.isNaN||function(g){return g!=g};function a(){a.init.call(this)}Xv.exports=a,Xv.exports.once=function(g,y){return new Promise(function(x,b){function w(S){g.removeListener(y,N),b(S)}function N(){typeof g.removeListener=="function"&&g.removeListener("error",w),x([].slice.call(arguments))}v(g,y,N,{once:!0}),y!=="error"&&function(S,_,k){typeof S.on=="function"&&v(S,"error",_,k)}(g,w,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function i(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function l(g){return g._maxListeners===void 0?a.defaultMaxListeners:g._maxListeners}function c(g,y,x,b){var w,N,S,_;if(i(x),(N=g._events)===void 0?(N=g._events=Object.create(null),g._eventsCount=0):(N.newListener!==void 0&&(g.emit("newListener",y,x.listener?x.listener:x),N=g._events),S=N[y]),S===void 0)S=N[y]=x,++g._eventsCount;else if(typeof S=="function"?S=N[y]=b?[x,S]:[S,x]:b?S.unshift(x):S.push(x),(w=l(g))>0&&S.length>w&&!S.warned){S.warned=!0;var k=new Error("Possible EventEmitter memory leak detected. "+S.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");k.name="MaxListenersExceededWarning",k.emitter=g,k.type=y,k.count=S.length,_=k,console&&console.warn&&console.warn(_)}return g}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(g,y,x){var b={fired:!1,wrapFn:void 0,target:g,type:y,listener:x},w=u.bind(b);return w.listener=x,b.wrapFn=w,w}function f(g,y,x){var b=g._events;if(b===void 0)return[];var w=b[y];return w===void 0?[]:typeof w=="function"?x?[w.listener||w]:[w]:x?function(N){for(var S=new Array(N.length),_=0;_<S.length;++_)S[_]=N[_].listener||N[_];return S}(w):m(w,w.length)}function h(g){var y=this._events;if(y!==void 0){var x=y[g];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}function m(g,y){for(var x=new Array(y),b=0;b<y;++b)x[b]=g[b];return x}function v(g,y,x,b){if(typeof g.on=="function")b.once?g.once(y,x):g.on(y,x);else{if(typeof g.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof g);g.addEventListener(y,function w(N){b.once&&g.removeEventListener(y,w),x(N)})}}return Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(g){if(typeof g!="number"||g<0||r(g))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+g+".");s=g}}),a.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(g){if(typeof g!="number"||g<0||r(g))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+g+".");return this._maxListeners=g,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(g){for(var y=[],x=1;x<arguments.length;x++)y.push(arguments[x]);var b=g==="error",w=this._events;if(w!==void 0)b=b&&w.error===void 0;else if(!b)return!1;if(b){var N;if(y.length>0&&(N=y[0]),N instanceof Error)throw N;var S=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw S.context=N,S}var _=w[g];if(_===void 0)return!1;if(typeof _=="function")n(_,this,y);else{var k=_.length,P=m(_,k);for(x=0;x<k;++x)n(P[x],this,y)}return!0},a.prototype.addListener=function(g,y){return c(this,g,y,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(g,y){return c(this,g,y,!0)},a.prototype.once=function(g,y){return i(y),this.on(g,d(this,g,y)),this},a.prototype.prependOnceListener=function(g,y){return i(y),this.prependListener(g,d(this,g,y)),this},a.prototype.removeListener=function(g,y){var x,b,w,N,S;if(i(y),(b=this._events)===void 0)return this;if((x=b[g])===void 0)return this;if(x===y||x.listener===y)--this._eventsCount==0?this._events=Object.create(null):(delete b[g],b.removeListener&&this.emit
809("removeListener",g,x.listener||y));else if(typeof x!="function"){for(w=-1,N=x.length-1;N>=0;N--)if(x[N]===y||x[N].listener===y){S=x[N].listener,w=N;break}if(w<0)return this;w===0?x.shift():function(_,k){for(;k+1<_.length;k++)_[k]=_[k+1];_.pop()}(x,w),x.length===1&&(b[g]=x[0]),b.removeListener!==void 0&&this.emit("removeListener",g,S||y)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(g){var y,x,b;if((x=this._events)===void 0)return this;if(x.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):x[g]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete x[g]),this;if(arguments.length===0){var w,N=Object.keys(x);for(b=0;b<N.length;++b)(w=N[b])!=="removeListener"&&this.removeAllListeners(w);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(y=x[g])=="function")this.removeListener(g,y);else if(y!==void 0)for(b=y.length-1;b>=0;b--)this.removeListener(g,y[b]);return this},a.prototype.listeners=function(g){return f(this,g,!0)},a.prototype.rawListeners=function(g){return f(this,g,!1)},a.listenerCount=function(g,y){return typeof g.listenerCount=="function"?g.listenerCount(y):h.call(g,y)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},Xv.exports}(),Jv=Vue(oC),jI=Object.prototype.hasOwnProperty;function SI(e,t,n){for(n of e.keys())if(Fr(n,t))return n}function Fr(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Fr(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if((a=r)&&typeof a=="object"&&!(a=SI(t,a))||!t.has(a))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if((a=r[0])&&typeof a=="object"&&!(a=SI(t,a))||!Fr(r[1],t.get(a)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(jI.call(e,n)&&++r&&!jI.call(t,n)||!(n in t)||!Fr(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Wue={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},JU={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Sn={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Dr={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},il={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class fe{static getFirstMatch(t,n){const r=n.match(t);return r&&r.length>0&&r[1]||""}static getSecondMatch(t,n){const r=n.match(t);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(t,n,r){if(t.test(n))return r}
809static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,n,r=!1){const a=fe.getVersionPrecision(t),s=fe.getVersionPrecision(n);let i=Math.max(a,s),l=0;const c=fe.map([t,n],u=>{const d=i-fe.getVersionPrecision(u),f=u+new Array(d+1).join(".0");return fe.map(f.split("."),h=>new Array(20-h.length).join("0")+h).reverse()});for(r&&(l=i-Math.min(a,s)),i-=1;i>=l;){if(c[0][i]>c[1][i])return 1;if(c[0][i]===c[1][i]){if(i===l)return 0;i-=1}else if(c[0][i]<c[1][i])return-1}}static map(t,n){const r=[];let a;if(Array.prototype.map)return Array.prototype.map.call(t,n);for(a=0;a<t.length;a+=1)r.push(n(t[a]));return r}static find(t,n){let r,a;if(Array.prototype.find)return Array.prototype.find.call(t,n);for(r=0,a=t.length;r<a;r+=1){const s=t[r];if(n(s,r))return s}}static assign(t,...n){const r=t;let a,s;if(Object.assign)return Object.assign(t,...n);for(a=0,s=n.length;a<s;a+=1){const i=n[a];
vendor: 9,161 bytes, line 809
809typeof i=="object"&&i!==null&&Object.keys(i).forEach(l=>{r[l]=i[l]})}return t}static getBrowserAlias(t){return Wue[t]}static getBrowserTypeByAlias(t){return JU[t]||""}}const zt=/version\/(\d+(\.?_?\d+)+)/i,que=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=fe.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=fe.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=fe.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=fe.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=fe.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=fe.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=fe.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=fe.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=fe.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=fe.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=fe.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=fe.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=fe.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=fe.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=fe.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=fe.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=fe.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=fe.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=fe.getFirstMatch(zt,e)||fe.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=fe.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=fe.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=fe.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=fe.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=fe.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=fe.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=fe.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=fe.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=fe.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=fe.getFirstMatch(zt,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=e.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:fe.getFirstMatch(t,e),version:fe.getSecondMatch(t,e)}}}];var Hue=[{test:[/Roku\/DVP/],describe(e){const t=fe.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Dr.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=fe.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Dr.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=fe.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=fe.getWindowsVersionName(t);return{name:Dr.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Dr.iOS},n=fe.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=fe.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=fe.getMacOSVersionName(t),r={name:Dr.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=fe.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Dr.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=fe.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=fe.getAndroidVersionName(t),r={name:Dr.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=fe.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Dr.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=fe.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||fe.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||fe.getFirstMatch(/\bbb(\d+)/i,e);return{name:Dr.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=fe.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Dr.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=fe.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Dr.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Dr.Linux})},{test:[/CrOS/],describe:()=>({name:Dr.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=fe.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);
809return{name:Dr.PlayStation4,version:t}}}],Gue=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=fe.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Sn.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Sn.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Sn.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Sn.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Sn.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Sn.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Sn.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=fe.getFirstMatch(/(ipod|iphone)/i,e);return{type:Sn.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Sn.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Sn.mobile})},{test:e=>e.getBrowserName(!0)==="blackberry",describe:()=>({type:Sn.mobile,vendor:"BlackBerry"})},{test:e=>e.getBrowserName(!0)==="bada",describe:()=>({type:Sn.mobile})},{test:e=>e.getBrowserName()==="windows phone",describe:()=>({type:Sn.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe:()=>({type:Sn.tablet})},{test:e=>e.getOSName(!0)==="android",describe:()=>({type:Sn.mobile})},{test:e=>e.getOSName(!0)==="macos",describe:()=>({type:Sn.desktop,vendor:"Apple"})},{test:e=>e.getOSName(!0)==="windows",describe:()=>({type:Sn.desktop})},{test:e=>e.getOSName(!0)==="linux",describe:()=>({type:Sn.desktop})},{test:e=>e.getOSName(!0)==="playstation 4",describe:()=>({type:Sn.tv})},{test:e=>e.getOSName(!0)==="roku",describe:()=>({type:Sn.tv})}],Yue=[{test:e=>e.getBrowserName(!0)==="microsoft edge",describe(e){if(/\sedg\//i.test(e))return{name:il.Blink};const t=fe.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:il.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:il.Trident},n=fe.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:il.Presto},n=fe.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:il.Gecko},n=fe.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:il.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:il.WebKit},n=fe.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];
809let NI=class{constructor(t,n=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=fe.find(que,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=fe.find(Hue,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:n}=this.getOS();return t?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:n}=this.getPlatform();return t?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const t=fe.find(Gue,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=fe.find(Yue,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return fe.assign({},this.parsedResult)}satisfies(t){const n={};let r=0;const a={};let s=0;if(Object.keys(t).forEach(i=>{const l=t[i];typeof l=="string"?(a[i]=l,s+=1):typeof l=="object"&&(n[i]=l,r+=1)}),r>0){const i=Object.keys(n),l=fe.find(i,u=>this.isOS(u));if(l){const u=this.satisfies(n[l]);if(u!==void 0)return u}const c=fe.find(i,u=>this.isPlatform(u));if(c){const u=this.satisfies(n[c]);if(u!==void 0)return u}}if(s>0){const i=Object.keys(a),l=fe.find(i,c=>this.isBrowser(c,!0));if(l!==void 0)return this.compareVersion(a[l])}}isBrowser(t,n=!1){const r=this.getBrowserName().toLowerCase();let a=t.toLowerCase();const s=fe.getBrowserTypeByAlias(a);return n&&s&&(a=s.toLowerCase()),a===r}compareVersion(t){let n=[0],r=t,a=!1;const s=this.getBrowserVersion();if(typeof s=="string")return t[0]===">"||t[0]==="<"?(r=t.substr(1),t[1]==="="?(a=!0,r=t.substr(2)):n=[],t[0]===">"?n.push(1):n.push(-1)):t[0]==="="?r=t.substr(1):t[0]==="~"&&(a=!0,r=t.substr(1)),n.indexOf(fe.compareVersions(s,r,a))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,n=!1){return this.isBrowser(t,n)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(n=>this.is(n))}};/*!
810 * Bowser - a browser detector
811 * https://github.com/lancedikson/bowser
812 * MIT License | (c) Dustin Diaz 2012-2015
813 * MIT License | (c) Denis Demchenko 2015-2019
814 */let Kue=class{static getParser(t,n=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new NI(t,n)}static parse(t){return new NI(t).getResult()}static get BROWSER_MAP(){return JU}static get ENGINE_MAP(){return il}static get OS_MAP(){return Dr}static get PLATFORMS_MAP(){return Sn}};function Dw(){return Date.now()+Math.random().toString()}function Jh(){throw new Error("Method must be implemented in subclass")}function QU(e,t){return t!=null&&t.proxyUrl?t.proxyUrl+(t.proxyUrl.slice(-1)==="/"?"":"/")+e.substring(8):e}function cb(e){return e!=null&&e.callObjectBundleUrlOverride?e.callObjectBundleUrlOverride:QU("https://c.daily.co/call-machine/versioned/".concat("0.85.0","/static/call-machine-object-bundle.js"),e)}function ub(e){try{new URL(e)}catch{return!1}return!0}const qt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Jc="8.55.0",At=globalThis;function db(e,t,n){const r=At,a=r.__SENTRY__=r.__SENTRY__||{},s=a[Jc]=a[Jc]||{};return s[e]||(s[e]=t())}const Uu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sC=["debug","info","warn","error","log","assert","trace"],fb={};function qg(e){if(!("console"in At))return e();const t=At.console,n={},r=Object.keys(fb);r.forEach(a=>{const s=fb[a];n[a]=t[a],t[a]=s});try{return e()}finally{r.forEach(a=>{t[a]=n[a]})}}const Ke=db("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Uu?sC.forEach(n=>{t[n]=(...r)=>{e&&qg(()=>{At.console[n](`Sentry Logger [${n}]:`,...r)})}}):sC.forEach(n=>{t[n]=()=>{}}),t}),Rc="?",_I=/\(error: (.*)\)/,CI=/captureMessage|captureException/;function Qv(e){return e[e.length-1]||{}}const kI="<anonymous>";function Xl(e){try{return e&&typeof e=="function"&&e.name||kI}catch{return kI}}function EI(e){const t=e.exception;if(t){const n=[];
814try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const lx={},AI={};function Qc(e,t){lx[e]=lx[e]||[],lx[e].push(t)}function Zc(e,t){if(!AI[e]){AI[e]=!0;try{t()}catch(n){Uu&&Ke.error(`Error while instrumenting ${e}`,n)}}}function Uo(e,t){const n=e&&lx[e];if(n)for(const r of n)try{r(t)}catch(a){Uu&&Ke.error(`Error while triggering instrumentation handler.
815Type: ${e}
816Name: ${Xl(r)}
817Error:`,a)}}let hS=null;function Xue(){hS=At.onerror,At.onerror=function(e,t,n,r,a){return Uo("error",{column:r,error:a,line:n,msg:e,url:t}),!!hS&&hS.apply(this,arguments)},At.onerror.__SENTRY_INSTRUMENTED__=!0}let mS=null;function Jue(){mS=At.onunhandledrejection,At.onunhandledrejection=function(e){return Uo("unhandledrejection",e),!mS||mS.apply(this,arguments)},At.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Rw(){return OA(At),At}function OA(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Jc,t[Jc]=t[Jc]||{}}const ZU=Object.prototype.toString;function MA(e){switch(ZU.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return hu(e,Error)}}function bh(e,t){return ZU.call(e)===`[object ${t}]`}function eV(e){return bh(e,"ErrorEvent")}function PI(e){return bh(e,"DOMError")}function di(e){return bh(e,"String")}function IA(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function iC(e){return e===null||IA(e)||typeof e!="object"&&typeof e!="function"}function _f(e){return bh(e,"Object")}function Lw(e){return typeof Event<"u"&&hu(e,Event)}function Fw(e){return!!(e&&e.then&&typeof e.then=="function")}function hu(e,t){try{return e instanceof t}catch{return!1}}function tV(e){return!(typeof e!="object"||e===null||!e.__isVue&&!e._isVue)}const $A=At;function nV(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,a=[];let s=0,i=0;const l=" > ",c=l.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&s++<r&&(u=Que(n,d),!(u==="html"||s>1&&i+a.length*c+u.length>=f));)a.push(u),i+=u.length,n=n.parentNode;return a.reverse().join(l)}catch{return"<unknown>"}}function Que(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if($A.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const a=t&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(a&&a.length)a.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&di(i)){const l=i.split(/\s+/);for(const c of l)r.push(`.${c}`)}}const s=["aria-label","type","name","title","alt"];for(const i of s){const l=n.getAttribute(i);l&&r.push(`[${i}="${l}"]`)}return r.join("")}function Yd(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function TI(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const a=e[r];try{tV(a)?n.push("[VueViewModel]"):n.push(String(a))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Zue(e,t,n=!1){return!!di(e)&&(bh(t,"RegExp")?t.test(e):!!di(t)&&(n?e===t:e.includes(t)))}function Zv(e,t=[],n=!1){return t.some(r=>Zue(e,r,n))}function ka(e,t,n){if(!(t in e))return;const r=e[t],a=n(r);typeof a=="function"&&rV(a,r);try{e[t]=a}catch{Uu&&Ke.log(`Failed to replace method "${t}" in object`,e)}}function mu(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Uu&&Ke.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function rV(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,mu(e,"__sentry_original__",t)}catch{}}function DA(e){return e.__sentry_original__}function aV(e){if(MA(e))return{message:e.message,name:e.name,stack:e.stack,...MI(e)};if(Lw(e)){const t={type:e.type,target:OI(e.target),currentTarget:OI(e.currentTarget),...MI(e)};return typeof CustomEvent<"u"&&hu(e,CustomEvent)&&(t.detail=e.detail),t}return e}function OI(e){try{return t=e,typeof Element<"u"&&hu(t,Element)?nV(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}var t}function MI(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ja(e){return lC(e,new Map)}function lC(e,t){if(function(n){if(!_f(n))return!1;try{const r=Object.getPrototypeOf(n).constructor.name;return!r||r==="Object"}catch{return!0}}(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const a of Object.getOwnPropertyNames(e))e[a]!==void 0&&(r[a]=lC(e[a],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(a=>{r.push(lC(a,t))}),r}return e}function Hg(){return Date.now()/1e3}const yi=function(){const{performance:e}=At;if(!e||!e.now)return Hg;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function no(){const e=At,t=e.crypto||e.msCrypto;let n=()=>
vendor: 3,078 bytes, line 817
81716*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function oV(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function dl(e){const{message:t,event_id:n}=e;if(t)return t;const r=oV(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function cC(e,t,n){const r=e.exception=e.exception||{},a=r.values=r.values||[],s=a[0]=a[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Cf(e,t){const n=oV(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const a={...r&&r.data,...t.data};n.mechanism.data=a}}function II(e){if(function(t){try{return t.__sentry_captured__}catch{}}(e))return!0;try{mu(e,"__sentry_captured__",!0)}catch{}return!1}var ai;function pu(e){return new Ya(t=>{t(e)})}function hb(e){return new Ya((t,n)=>{n(e)})}(()=>{const{performance:e}=At;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,s=a<t,i=e.timing&&e.timing.navigationStart,l=typeof i=="number"?Math.abs(i+n-r):t;(s||l<t)&&a<=l&&e.timeOrigin})(),function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(ai||(ai={}));class Ya{constructor(t){Ya.prototype.__init.call(this),Ya.prototype.__init2.call(this),Ya.prototype.__init3.call(this),Ya.prototype.__init4.call(this),this._state=ai.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new Ya((r,a)=>{this._handlers.push([!1,s=>{if(t)try{r(t(s))}catch(i){a(i)}else r(s)},s=>{if(n)try{r(n(s))}catch(i){a(i)}else a(s)}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Ya((n,r)=>{let a,s;return this.then(i=>{s=!1,a=i,t&&t()},i=>{s=!0,a=i,t&&t()}).then(()=>{s?r(a):n(a)})})}__init(){this._resolve=t=>{this._setResult(ai.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(ai.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{this._state===ai.PENDING&&(Fw(n)?n.then(this._resolve,this._reject):(this._state=t,this._value=n,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===ai.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===ai.RESOLVED&&n[1](this._value),this._state===ai.REJECTED&&n[2](this._value),n[0]=!0)})}}}function ede(e){const t=yi(),n={sid:no(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return Ja({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};
vendor: 4,531 bytes, line 817
817return e&&kf(n,e),n}function kf(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||yi(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:no()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function $I(){return no()}function uC(){return no().substring(16)}function Bw(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&t&&Object.keys(t).length===0)return e;const r={...e};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=Bw(r[a],t[a],n-1));return r}const dC="_sentrySpan";function DI(e,t){t?mu(e,dC,t):delete e[dC]}function RI(e){return e[dC]}class RA{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:$I(),spanId:uC()}}clone(){const t=new RA;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,DI(t,RI(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&kf(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,[r,a]=n instanceof Jl?[n.getScopeData(),n.getRequestSession()]:_f(n)?[t,t.requestSession]:[],{tags:s,extra:i,user:l,contexts:c,level:u,fingerprint:d=[],propagationContext:f}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},l&&Object.keys(l).length&&(this._user=l),u&&(this._level=u),d.length&&(this._fingerprint=d),f&&(this._propagationContext=f),a&&(this._requestSession=a),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,DI(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$I()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:100;if(r<=0)return this;
vendor: 4,283 bytes, line 817
817const a={timestamp:Hg(),...t};return this._breadcrumbs.push(a),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:RI(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Bw(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:uC(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:no();if(!this._client)return Ke.warn("No client configured on scope - will not capture exception!"),r;const a=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:a,...n,event_id:r},this),r}captureMessage(t,n,r){const a=r&&r.event_id?r.event_id:no();if(!this._client)return Ke.warn("No client configured on scope - will not capture message!"),a;const s=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:a},this),a}captureEvent(t,n){const r=n&&n.event_id?n.event_id:no();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Ke.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}const Jl=RA;class tde{constructor(t,n){let r,a;r=t||new Jl,a=n||new Jl,this._stack=[{scope:r}],this._isolationScope=a}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(a){throw this._popScope(),a}return Fw(r)?r.then(a=>(this._popScope(),a),a=>{throw this._popScope(),a}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function Ef(){const e=OA(Rw());return e.stack=e.stack||new tde(db("defaultCurrentScope",()=>new Jl),db("defaultIsolationScope",()=>new Jl))}function nde(e){return Ef().withScope(e)}function rde(e,t){const n=Ef();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function LI(e){return Ef().withScope(()=>e(Ef().getIsolationScope()))}function LA(e){const t=OA(e);return t.acs?t.acs:{withIsolationScope:LI,withScope:nde,withSetScope:rde,withSetIsolationScope:(n,r)=>LI(r),getCurrentScope:()=>Ef().getScope(),getIsolationScope:()=>Ef().getIsolationScope()}}function Vu(){return LA(Rw()).getCurrentScope()}function Gg(){return LA(Rw()).getIsolationScope()}function Cr(){return Vu().getClient()}function ade(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:a}=t;return Ja({trace_id:n,span_id:r,parent_span_id:a})}function ode(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[r,a]]of t)(n[r]||(n[r]=[])).push(Ja(a));return n}const sde=/^sentry-/;function ide(e){const t=function(r){if(!(!r||!di(r)&&!Array.isArray(r)))return Array.isArray(r)?r.reduce((a,s)=>{const i=FI(s);return Object.entries(i).forEach(([l,c])=>{a[l]=c}),a},{}):FI(r)}(e);if(!t)return;const n=Object.entries(t).reduce((r,[a,s])=>(a.match(sde)&&(r[a.slice(7)]=s),r),{});return Object.keys(n).length>0?n:void 0}function FI(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}let BI=!1;function lde(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext();
817return Ja({parent_span_id:r?t:FA(e).parent_span_id,span_id:r?uC():t,trace_id:n})}function zI(e){return typeof e=="number"?UI(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?UI(e.getTime()):yi()}function UI(e){return e>9999999999?e/1e3:e}function FA(e){if(function(t){return typeof t.getSpanJSON=="function"}(e))return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(function(r){const a=r;return!!(a.attributes&&a.startTime&&a.name&&a.endTime&&a.status)}(e)){const{attributes:r,startTime:a,name:s,endTime:i,parentSpanId:l,status:c}=e;return Ja({span_id:t,trace_id:n,data:r,description:s,parent_span_id:l,start_timestamp:zI(a),timestamp:zI(i)||void 0,status:cde(c),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:ode(e)})}return{span_id:t,trace_id:n}}catch{return{}}}function cde(e){if(e&&e.code!==0)return e.code===1?"ok":e.message||"unknown_error"}function sV(e){return e._sentryRootSpan||e}function ude(){BI||(qg(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),BI=!0)}const BA="production";function iV(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},a=Ja({environment:n.environment||BA,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",a),a}function dde(e){const t=Cr();if(!t)return{};const n=sV(e),r=n._frozenDsc;if(r)return r;const a=n.spanContext().traceState,s=a&&a.get("sentry.dsc"),i=s&&ide(s);if(i)return i;const l=iV(e.spanContext().traceId,t),c=FA(n),u=c.data||{},d=u["sentry.sample_rate"];d!=null&&(l.sample_rate=`${d}`);const f=u["sentry.source"],h=c.description;return f!=="url"&&h&&(l.transaction=h),function(m){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const v=Cr(),g=v&&v.getOptions();return!!g&&(g.enableTracing||"tracesSampleRate"in g||"tracesSampler"in g)}()&&(l.sampled=String(function(m){const{traceFlags:v}=m.spanContext();return v===1}(n))),t.emit("createDsc",l,n),l}const fde=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function mb(e,t=!1){const{host:n,path:r,pass:a,port:s,projectId:i,protocol:l,publicKey:c}=e;return`${l}://${c}${t&&a?`:${a}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function VI(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function hde(e){const t=typeof e=="string"?function(n){const r=fde.exec(n);if(!r)return void qg(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});const[a,s,i="",l="",c="",u=""]=r.slice(1);let d="",f=u;const h=f.split("/");if(h.length>1&&(d=h.slice(0,-1).join("/"),f=h.pop()),f){const m=f.match(/^\d+/);m&&(f=m[0])}return VI({host:l,pass:i,path:d,projectId:f,port:c,protocol:a,publicKey:s})}(e):VI(e);if(t&&function(n){if(!Uu)return!0;const{port:r,projectId:a,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(i=>!n[i]&&(Ke.error(`Invalid Sentry Dsn: ${i} missing`),!0))||(a.match(/^\d+$/)?function(i){return i==="http"||i==="https"}(s)?r&&isNaN(parseInt(r,10))&&(Ke.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(Ke.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(Ke.error(`Invalid Sentry Dsn: Invalid projectId ${a}`),1)))}(t))return t}function oi(e,t=100,n=1/0){try{return fC("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function lV(e,t=3,n=102400){const r=oi(e,t);return a=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(a))>n?lV(e,t-1,n):r;var a}function fC(e,t,n=1/0,r=1/0,a=function(){const s=typeof WeakSet=="function",i=s?new WeakSet:[];return[function(l){if(s)return!!i.has(l)||(i.add(l),!1);for(let c=0;c<i.length;c++)if(i[c]===l)return!0;return i.push(l),!1},function(l){if(s)i.delete(l);else for(let c=0;c<i.length;c++)if(i[c]===l){i.splice(c,1);break}}]}()){const[s,i]=a;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const l=function(m,v){try{if(m==="domain"&&v&&typeof v=="object"&&v._events)return"[Domain]";if(m==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&v===global)return"[Global]";if(typeof window<"u"&&v===window)return"[Window]";if(typeof document<"u"&&v===document)return"[Document]";if(tV(v))return"[VueViewModel]";if(_f(g=v)&&"nativeEvent"in g&&"preventDefault"in g&&"stopPropagation"in g)return"[SyntheticEvent]";if(typeof v=="number"&&!Number.isFinite(v))return`[${v}
817]`;if(typeof v=="function")return`[Function: ${Xl(v)}]`;if(typeof v=="symbol")return`[${String(v)}]`;if(typeof v=="bigint")return`[BigInt: ${String(v)}]`;const y=function(x){const b=Object.getPrototypeOf(x);return b?b.constructor.name:"null prototype"}(v);return/^HTML(\w*)Element$/.test(y)?`[HTMLElement: ${y}]`:`[object ${y}]`}catch(y){return`**non-serializable** (${y})`}var g}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return l.replace("object ","");if(s(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{return fC("",u.toJSON(),c-1,r,a)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const h=aV(t);for(const m in h){if(!Object.prototype.hasOwnProperty.call(h,m))continue;if(f>=r){d[m]="[MaxProperties ~]";break}const v=h[m];d[m]=fC(m,v,c-1,r,a),f++}return i(t),d}function Ip(e,t=[]){return[e,t]}function mde(e,t){const[n,r]=e;return[n,[...r,t]]}function WI(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function hC(e){return At.__SENTRY__&&At.__SENTRY__.encodePolyfill?At.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function pde(e){const[t,n]=e;let r=JSON.stringify(t);function a(s){typeof r=="string"?r=typeof s=="string"?r+s:[hC(r),s]:r.push(typeof s=="string"?hC(s):s)}for(const s of n){const[i,l]=s;if(a(`
818${JSON.stringify(i)}
819`),typeof l=="string"||l instanceof Uint8Array)a(l);else{let c;try{c=JSON.stringify(l)}catch{c=JSON.stringify(oi(l))}a(c)}}return typeof r=="string"?r:function(s){const i=s.reduce((u,d)=>u+d.length,0),l=new Uint8Array(i);let c=0;for(const u of s)l.set(u,c),c+=u.length;return l}(r)}function gde(e){const t=typeof e.data=="string"?hC(e.data):e.data;return[Ja({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const vde={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function qI(e){return vde[e]}function cV(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function yde(e,t,n,r){const a=cV(n),s=e.type&&e.type!=="replay_event"?e.type:"event";(function(l,c){c&&(l.sdk=l.sdk||{},l.sdk.name=l.sdk.name||c.name,l.sdk.version=l.sdk.version||c.version,l.sdk.integrations=[...l.sdk.integrations||[],...c.integrations||[]],l.sdk.packages=[...l.sdk.packages||[],...c.packages||[]])})(e,n&&n.sdk);const i=function(l,c,u,d){const f=l.sdkProcessingMetadata&&l.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:l.event_id,sent_at:new Date().toISOString(),...c&&{sdk:c},...!!u&&d&&{dsn:mb(d)},...f&&{trace:Ja({...f})}}}(e,a,r,t);return delete e.sdkProcessingMetadata,Ip(i,[[{type:s},e]])}function mC(e,t,n,r=0){return new Ya((a,s)=>{const i=e[r];if(t===null||typeof i!="function")a(t);else{const l=i({...t},n);qt&&i.id&&l===null&&Ke.log(`Event processor "${i.id}" dropped event`),Fw(l)?l.then(c=>mC(e,c,n,r+1).then(a)).then(null,s):mC(e,l,n,r+1).then(a).then(null,s)}})}let ey,HI,pS;function xde(e,t){const{fingerprint:n,span:r,breadcrumbs:a,sdkProcessingMetadata:s}=t;(function(i,l){const{extra:c,tags:u,user:d,contexts:f,level:h,transactionName:m}=l,v=Ja(c);v&&Object.keys(v).length&&(i.extra={...v,...i.extra});const g=Ja(u);g&&Object.keys(g).length&&(i.tags={...g,...i.tags});const y=Ja(d);y&&Object.keys(y).length&&(i.user={...y,...i.user});const x=Ja(f);x&&Object.keys(x).length&&(i.contexts={...x,...i.contexts}),h&&(i.level=h),m&&i.type!=="transaction"&&(i.transaction=m)})(e,t),r&&function(i,l){i.contexts={trace:lde(l),...i.contexts},i.sdkProcessingMetadata={dynamicSamplingContext:dde(l),...i.sdkProcessingMetadata};const c=sV(l),u=FA(c).description;u&&!i.transaction&&i.type==="transaction"&&(i.transaction=u)}(e,r),function(i,l){i.fingerprint=i.fingerprint?Array.isArray(i.fingerprint)?i.fingerprint:[i.fingerprint]:[],l&&(i.fingerprint=i.fingerprint.concat(l)),i.fingerprint&&!i.fingerprint.length&&delete i.fingerprint}(e,n),function(i,l){const c=[...i.breadcrumbs||[],...l];i.breadcrumbs=c.length?c:void 0}(e,a),function(i,l){i.sdkProcessingMetadata={...i.sdkProcessingMetadata,...l}}(e,s)}function GI(e,t){const{extra:n,tags:r,user:a,contexts:s,level:i,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:h,transactionName:m,span:v}=t;ty(e,"extra",n),ty(e,"tags",r),ty(e,"user",a),ty(e,"contexts",s),e.sdkProcessingMetadata=Bw(e.sdkProcessingMetadata,l,2),i&&(e.level=i),m&&(e.transactionName=m),v&&(e.span=v),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...h}}function ty(e,t,n){e[t]=Bw(e[t],n,1)}function bde(e,t,n,r,a,s){const{normalizeDepth:i=3,normalizeMaxBreadth:l=1e3}=e,c={...t,event_id:t.event_id||n.event_id||no(),timestamp:t.timestamp||Hg()},u=n.integrations||e.integrations.map(v=>
819v.name);(function(v,g){const{environment:y,release:x,dist:b,maxValueLength:w=250}=g;v.environment=v.environment||y||BA,!v.release&&x&&(v.release=x),!v.dist&&b&&(v.dist=b),v.message&&(v.message=Yd(v.message,w));const N=v.exception&&v.exception.values&&v.exception.values[0];N&&N.value&&(N.value=Yd(N.value,w));const S=v.request;S&&S.url&&(S.url=Yd(S.url,w))})(c,e),function(v,g){g.length>0&&(v.sdk=v.sdk||{},v.sdk.integrations=[...v.sdk.integrations||[],...g])}(c,u),a&&a.emit("applyFrameMetadata",t),t.type===void 0&&function(v,g){const y=function(x){const b=At._sentryDebugIds;if(!b)return{};const w=Object.keys(b);return pS&&w.length===HI||(HI=w.length,pS=w.reduce((N,S)=>{ey||(ey={});const _=ey[S];if(_)N[_[0]]=_[1];else{const k=x(S);for(let P=k.length-1;P>=0;P--){const O=k[P],$=O&&O.filename,T=b[S];if($&&T){N[$]=T,ey[S]=[$,T];break}}}return N},{})),pS}(g);try{v.exception.values.forEach(x=>{x.stacktrace.frames.forEach(b=>{y&&b.filename&&(b.debug_id=y[b.filename])})})}catch{}}(c,e.stackParser);const d=function(v,g){if(!g)return v;const y=v?v.clone():new Jl;return y.update(g),y}(r,n.captureContext);n.mechanism&&Cf(c,n.mechanism);const f=a?a.getEventProcessors():[],h=db("globalScope",()=>new Jl).getScopeData();s&&GI(h,s.getScopeData()),d&&GI(h,d.getScopeData());const m=[...n.attachments||[],...h.attachments];return m.length&&(n.attachments=m),xde(c,h),mC([...f,...h.eventProcessors],c,n).then(v=>(v&&function(g){const y={};try{g.exception.values.forEach(b=>{b.stacktrace.frames.forEach(w=>{w.debug_id&&(w.abs_path?y[w.abs_path]=w.debug_id:w.filename&&(y[w.filename]=w.debug_id),delete w.debug_id)})})}catch{}if(Object.keys(y).length===0)return;g.debug_meta=g.debug_meta||{},g.debug_meta.images=g.debug_meta.images||[];const x=g.debug_meta.images;Object.entries(y).forEach(([b,w])=>{x.push({type:"sourcemap",code_file:b,debug_id:w})})}(v),typeof i=="number"&&i>0?function(g,y,x){if(!g)return null;const b={...g,...g.breadcrumbs&&{breadcrumbs:g.breadcrumbs.map(w=>({...w,...w.data&&{data:oi(w.data,y,x)}}))},...g.user&&{user:oi(g.user,y,x)},...g.contexts&&{contexts:oi(g.contexts,y,x)},...g.extra&&{extra:oi(g.extra,y,x)}};return g.contexts&&g.contexts.trace&&b.contexts&&(b.contexts.trace=g.contexts.trace,g.contexts.trace.data&&(b.contexts.trace.data=oi(g.contexts.trace.data,y,x))),g.spans&&(b.spans=g.spans.map(w=>({...w,...w.data&&{data:oi(w.data,y,x)}}))),g.contexts&&g.contexts.flags&&b.contexts&&(b.contexts.flags=oi(g.contexts.flags,3,x)),b}(v,i,l):v))}function YI(e,t){return Vu().captureEvent(e,t)}function KI(e){const t=Cr(),n=Gg(),r=Vu(),{release:a,environment:s=BA}=t&&t.getOptions()||{},{userAgent:i}=At.navigator||{},l=ede({release:a,environment:s,user:r.getUser()||n.getUser(),...i&&{userAgent:i},...e}),c=n.getSession();return c&&c.status==="ok"&&kf(c,{status:"exited"}),uV(),n.setSession(l),r.setSession(l),l}function uV(){const e=Gg(),t=Vu(),n=t.getSession()||e.getSession();n&&function(r,a){let s={};r.status==="ok"&&(s={status:"exited"}),kf(r,s)}(n),dV(),e.setSession(),t.setSession()}function dV(){const e=Gg(),t=Vu(),n=Cr(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function XI(e=!1){e?uV():dV()}function wde(e,t,n){return t||`${function(r){return`${function(a){const s=a.protocol?`${a.protocol}:`:"",i=a.port?`:${a.port}`:"";return`${s}//${a.host}${i}${a.path?`/${a.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}(e)}?${function(r,a){const s={sentry_version:"7"};return r.publicKey&&(s.sentry_key=r.publicKey),a&&(s.sentry_client=`${a.name}/${a.version}`),new URLSearchParams(s).toString()}(e,n)}`}const JI=[];function QI(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function ZI(e,t,n){if(n[t.name])qt&&Ke.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,JI.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),JI.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(a,s)=>r(a,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),a=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(a)}qt&&Ke.log(`Integration installed: ${t.name}`)}}
vendor: 10,372 bytes, lines 819-820
819class So extends Error{constructor(t,n="warn"){super(t),this.message=t,this.logLevel=n}}const e$="Not capturing exception because it's already been captured.";class jde{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=hde(t.dsn):qt&&Ke.warn("No DSN provided, client will not send events."),this._dsn){const r=wde(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}const n=["enableTracing","tracesSampleRate","tracesSampler"].find(r=>r in t&&t[r]==null);n&&qg(()=>{console.warn(`[Sentry] Deprecation warning: \`${n}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(t,n,r){const a=no();if(II(t))return qt&&Ke.log(e$),a;const s={event_id:a,...n};return this._process(this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r))),s.event_id}captureMessage(t,n,r,a){const s={event_id:no(),...r},i=IA(t)?t:String(t),l=iC(t)?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(l.then(c=>this._captureEvent(c,s,a))),s.event_id}captureEvent(t,n,r){const a=no();if(n&&n.originalException&&II(n.originalException))return qt&&Ke.log(e$),a;const s={event_id:a,...n},i=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(t,s,i||r)),s.event_id}captureSession(t){typeof t.release!="string"?qt&&Ke.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),kf(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(t).then(r=>n.flush(t).then(a=>r&&a))):pu(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];ZI(this,t,this._integrations),n||QI(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=yde(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=mde(r,gde(s));const a=this.sendEnvelope(r);a&&a.then(s=>this.emit("afterSendEvent",t,s),null)}sendSession(t){const n=function(r,a,s,i){const l=cV(s);return Ip({sent_at:new Date().toISOString(),...l&&{sdk:l},...!!i&&a&&{dsn:mb(a)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){const a=typeof r=="number"?r:1,s=`${t}:${n}`;qt&&Ke.log(`Recording outcome: "${s}"${a>1?` (${a} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+a}}on(t,n){const r=this._hooks[t]=this._hooks[t]||[];return r.push(n),()=>{const a=r.indexOf(n);a>-1&&r.splice(a,1)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(a=>a(...n))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,n=>(qt&&Ke.error("Error while sending envelope:",n),n)):(qt&&Ke.error("Transport disabled"),pu({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=function(n,r){const a={};return r.forEach(s=>{s&&ZI(n,s,a)}),a}(this,t),QI(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",a=!1;const s=n.exception&&n.exception.values;if(s){a=!0;for(const l of s){const c=l.mechanism;if(c&&c.handled===!1){r=!0;break}}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(kf(t,{...r&&{status:"crashed"},errors:t.errors||Number(a||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Ya(n=>{let r=0;const a=setInterval(()=>{this._numProcessing==0?(clearInterval(a),n(!0)):(r+=1,t&&r>=t&&(clearInterval(a),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r=Vu(),a=Gg()){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||a.setLastEventId(t.event_id||n.event_id),bde(s,t,n,r,this,a).then(l=>{if(l===null)return l;l.contexts={trace:ade(r),...l.contexts};const c=function(u,d){const f=d.getPropagationContext();return f.dsc||iV(f.traceId,u)}(this,r);return l.sdkProcessingMetadata={dynamicSamplingContext:c,...l.sdkProcessingMetadata},l})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(a=>a.event_id,a=>{qt&&(a instanceof So&&a.logLevel==="log"?Ke.log(a.message):Ke.warn(a))})}_processEvent(t,n,r){const a=this.getOptions(),{sampleRate:s}=a,i=n$(t),l=t$(t),c=t.type||"error",u=`before send for type \`${c}\``,d=s===void 0?void 0:function(m){if(typeof m=="boolean")return Number(m);const v=typeof m=="string"?parseFloat(m):m;if(!(typeof v!="number"||isNaN(v)||v<0||v>1))return v;qt&&Ke.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(m)} of type ${JSON.stringify(typeof m)}.`)}(s);if(l&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",t),hb(new So(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const f=c==="replay_event"?"replay":c,h=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(t,n,r,h).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",f,t),new So("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return m;const v=function(g,y,x,b){const{beforeSend:w,beforeSendTransaction:N,beforeSendSpan:S}=y;if(t$(x)&&w)return w(x,b);if(n$(x)){if(x.spans&&S){const _=[];for(const k of x.spans){const P=S(k);P?_.push(P):(ude(),g.recordDroppedEvent("before_send","span"))}x.spans=_}if(N){if(x.spans){const _=x.spans.length;x.sdkProcessingMetadata={...x.sdkProcessingMetadata,spanCountBeforeProcessing:_}}return N(x,b)}}return x}(this,a,m,n);return function(g,y){const x=`${y} must return \`null\` or a valid event.`;if(Fw(g))return g.then(b=>{if(!_f(b)&&b!==null)throw new So(x);return b},b=>{throw new So(`${y} rejected with ${b}`)});if(!_f(g)&&g!==null)throw new So(x);return g}(v,u)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",f,t),i){const y=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new So(`${u} returned \`null\`, will not send event.`,"log")}const v=r&&r.getSession();if(!i&&v&&this._updateSessionFromEvent(v,m),i){const y=(m.sdkProcessingMetadata&&m.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(m.spans?m.spans.length:0);y>0&&this.recordDroppedEvent("before_send","span",y)}const g=m.transaction_info;if(i&&g&&m.transaction!==t.transaction){const y="custom";m.transaction_info={...g,source:y}}return this.sendEvent(m,n),m}).then(null,m=>{throw m instanceof So?m:(this.captureException(m,{data:{__sentry__:!0},originalException:m}),new So(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
820Reason: ${m}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[a,s]=n.split(":");return{reason:a,category:s,quantity:r}})}_flushOutcomes(){qt&&Ke.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0)return void(qt&&Ke.log("No outcomes to send"));if(!this._dsn)return void(qt&&Ke.log("No dsn provided, will not send outcomes"));qt&&Ke.log("Sending outcomes:",t);const n=(r=t,Ip((a=this._options.tunnel&&mb(this._dsn))?{dsn:a}:{},[[{type:"client_report"},{timestamp:s||Hg(),discarded_events:r}]]));var r,a,s;this.sendEnvelope(n)}}function t$(e){return e.type===void 0}function n$(e){return e.type==="transaction"}function Sde(e){const t=[];function n(r){return t.splice(t.indexOf(r),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(e===void 0||t.length<e))return hb(new So("Not adding Promise because buffer limit was reached."));const a=r();return t.indexOf(a)===-1&&t.push(a),a.then(()=>n(a)).then(null,()=>n(a).then(null,()=>{})),a},drain:function(r){return new Ya((a,s)=>{let i=t.length;if(!i)return a(!0);const l=setTimeout(()=>{r&&r>0&&a(!1)},r);t.forEach(c=>{pu(c).then(()=>{--i||(clearTimeout(l),a(!0))},s)})})}}}function Nde(e,{statusCode:t,headers:n},r=Date.now()){const a={...e},s=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(s)for(const l of s.trim().split(",")){const[c,u,,,d]=l.split(":",5),f=parseInt(c,10),h=1e3*(isNaN(f)?60:f);if(u)for(const m of u.split(";"))m==="metric_bucket"&&d&&!d.split(";").includes("custom")||(a[m]=r+h);else a.all=r+h}else i?a.all=r+function(l,c=Date.now()){const u=parseInt(`${l}`,10);if(!isNaN(u))return 1e3*u;const d=Date.parse(`${l}`);return isNaN(d)?6e4:d-c}(i,r):t===429&&(a.all=r+6e4);return a}function _de(e,t,n=Sde(e.bufferSize||64)){let r={};return{send:function(a){const s=[];if(WI(a,(c,u)=>{const d=qI(u);if(function(f,h,m=Date.now()){return function(v,g){return v[g]||v.all||0}(f,h)>m}(r,d)){const f=r$(c,u);e.recordDroppedEvent("ratelimit_backoff",d,f)}else s.push(c)}),s.length===0)return pu({});const i=Ip(a[0],s),l=c=>{WI(i,(u,d)=>{const f=r$(u,d);e.recordDroppedEvent(c,qI(d),f)})};return n.add(()=>t({body:pde(i)}).then(c=>(c.statusCode!==void 0&&(c.statusCode<200||c.statusCode>=300)&&qt&&Ke.warn(`Sentry responded with status code ${c.statusCode} to sent event.`),r=Nde(r,c),c),c=>{throw l("network_error"),c})).then(c=>c,c=>{if(c instanceof So)return qt&&Ke.error("Skipped sending event because buffer is full."),l("queue_overflow"),pu({});throw c})},flush:a=>n.drain(a)}}function r$(e,t){if(t==="event"||t==="transaction")return Array.isArray(e)?e[1]:void 0}const Cde=100;function bc(e,t){const n=Cr(),r=Gg();if(!n)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:s=Cde}=n.getOptions();if(s<=0)return;
820const i={timestamp:Hg(),...e},l=a?qg(()=>a(i,t)):i;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let a$;const o$=new WeakMap,kde=()=>({name:"FunctionToString",setupOnce(){a$=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=DA(this),n=o$.has(Cr())&&t!==void 0?t:this;return a$.apply(n,e)}}catch{}},setup(e){o$.set(e,!0)}}),Ede=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],Ade=(e={})=>({name:"InboundFilters",processEvent(t,n,r){const a=r.getOptions(),s=function(i={},l={}){return{allowUrls:[...i.allowUrls||[],...l.allowUrls||[]],denyUrls:[...i.denyUrls||[],...l.denyUrls||[]],ignoreErrors:[...i.ignoreErrors||[],...l.ignoreErrors||[],...i.disableErrorDefaults?[]:Ede],ignoreTransactions:[...i.ignoreTransactions||[],...l.ignoreTransactions||[]],ignoreInternal:i.ignoreInternal===void 0||i.ignoreInternal}}(e,a);return function(i,l){return l.ignoreInternal&&function(c){try{return c.exception.values[0].type==="SentryError"}catch{}return!1}(i)?(qt&&Ke.warn(`Event dropped due to being internal Sentry Error.
821Event: ${dl(i)}`),!0):function(c,u){return c.type||!u||!u.length?!1:function(d){const f=[];d.message&&f.push(d.message);let h;try{h=d.exception.values[d.exception.values.length-1]}catch{}return h&&h.value&&(f.push(h.value),h.type&&f.push(`${h.type}: ${h.value}`)),f}(c).some(d=>Zv(d,u))}(i,l.ignoreErrors)?(qt&&Ke.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
822Event: ${dl(i)}`),!0):function(c){return c.type||!c.exception||!c.exception.values||c.exception.values.length===0?!1:!c.message&&!c.exception.values.some(u=>u.stacktrace||u.type&&u.type!=="Error"||u.value)}(i)?(qt&&Ke.warn(`Event dropped due to not having an error message, error type or stacktrace.
823Event: ${dl(i)}`),!0):function(c,u){if(c.type!=="transaction"||!u||!u.length)return!1;const d=c.transaction;return!!d&&Zv(d,u)}(i,l.ignoreTransactions)?(qt&&Ke.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
824Event: ${dl(i)}`),!0):function(c,u){if(!u||!u.length)return!1;const d=ny(c);return!!d&&Zv(d,u)}(i,l.denyUrls)?(qt&&Ke.warn(`Event dropped due to being matched by \`denyUrls\` option.
825Event: ${dl(i)}.
826Url: ${ny(i)}`),!0):function(c,u){if(!u||!u.length)return!0;const d=ny(c);return!d||Zv(d,u)}(i,l.allowUrls)?!1:(qt&&Ke.warn(`Event dropped due to not being matched by \`allowUrls\` option.
827Event: ${dl(i)}.
828Url: ${ny(i)}`),!0)}(t,s)?null:t}});function ny(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(n=[]){for(let r=n.length-1;r>=0;r--){const a=n[r];if(a&&a.filename!=="<anonymous>"&&a.filename!=="[native code]")return a.filename||null}return null}(t):null}catch{return qt&&Ke.error(`Cannot extract url for event ${dl(e)}`),null}}function Pde(e,t,n=250,r,a,s,i){if(!(s.exception&&s.exception.values&&i&&hu(i.originalException,Error)))return;const l=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var c,u;l&&(s.exception.values=(c=pC(e,t,a,i.originalException,r,s.exception.values,l,0),u=n,c.map(d=>(d.value&&(d.value=Yd(d.value,u)),d))))}function pC(e,t,n,r,a,s,i,l){if(s.length>=n+1)return s;let c=[...s];if(hu(r[a],Error)){s$(i,l);const u=e(t,r[a]),d=c.length;i$(u,a,d,l),c=pC(e,t,n,r[a],a,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(hu(u,Error)){s$(i,l);const f=e(t,u),h=c.length;i$(f,`errors[${d}]`,h,l),c=pC(e,t,n,u,a,[f,...c],f,h)}}),c}function s$(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0}
828,exception_id:t}}function i$(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function gS(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Tde(){"console"in At&&sC.forEach(function(e){e in At.console&&ka(At.console,e,function(t){return fb[e]=t,function(...n){Uo("console",{args:n,level:e});const r=fb[e];r&&r.apply(At.console,n)}})})}function Ode(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Mde=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(n,r){return r?!!(function(a,s){const i=a.message,l=s.message;return!(!i&&!l||i&&!l||!i&&l||i!==l||!c$(a,s)||!l$(a,s))}(n,r)||function(a,s){const i=u$(s),l=u$(a);return!(!i||!l||i.type!==l.type||i.value!==l.value||!c$(a,s)||!l$(a,s))}(n,r)):!1}(t,e))return qt&&Ke.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function l$(e,t){let n=EI(e),r=EI(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const s=r[a],i=n[a];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function c$(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function u$(e){return e.exception&&e.exception.values&&e.exception.values[0]}function d$(e){return e===void 0?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const vS=At;function gC(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ide(){if(typeof EdgeRuntime=="string")return!0;if(!function(){if(!("fetch"in vS))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(gC(vS.fetch))return!0;let e=!1;const t=vS.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");
828n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=gC(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Uu&&Ke.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function $de(e,t){const n="fetch";Qc(n,e),Zc(n,()=>function(r,a=!1){a&&!Ide()||ka(At,"fetch",function(s){return function(...i){const l=new Error,{method:c,url:u}=function(f){if(f.length===0)return{method:"GET",url:""};if(f.length===2){const[m,v]=f;return{url:f$(m),method:vC(v,"method")?String(v.method).toUpperCase():"GET"}}const h=f[0];return{url:f$(h),method:vC(h,"method")?String(h.method).toUpperCase():"GET"}}(i),d={args:i,fetchData:{method:c,url:u},startTimestamp:1e3*yi(),virtualError:l};return r||Uo("fetch",{...d}),s.apply(At,i).then(async f=>(r?r(f):Uo("fetch",{...d,endTimestamp:1e3*yi(),response:f}),f),f=>{throw Uo("fetch",{...d,endTimestamp:1e3*yi(),error:f}),MA(f)&&f.stack===void 0&&(f.stack=l.stack,mu(f,"framesToPop",1)),f})}})}(void 0,t))}function vC(e,t){return!!e&&typeof e=="object"&&!!e[t]}function f$(e){return typeof e=="string"?e:e?vC(e,"url")?e.url:e.toString?e.toString():"":""}const ry=At,Xn=At;let yC=0;function h$(){return yC>0}function Af(e,t={}){if(!function(r){return typeof r=="function"}(e))return e;try{const r=e.__sentry_wrapped__;if(r)return typeof r=="function"?r:e;if(DA(e))return e}catch{return e}const n=function(...r){try{const a=r.map(s=>Af(s,t));return e.apply(this,a)}catch(a){throw yC++,setTimeout(()=>{yC--}),function(...s){const i=LA(Rw());if(s.length===2){const[l,c]=s;return l?i.withSetScope(l,c):i.withScope(c)}i.withScope(s[0])}(s=>{var i;s.addEventProcessor(l=>(t.mechanism&&(cC(l,void 0),Cf(l,t.mechanism)),l.extra={...l.extra,arguments:r},l)),i=a,Vu().captureException(i,void 0)}),a}};try{for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}catch{}rV(n,e),mu(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const zw=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function zA(e,t){const n=UA(e,t),r={type:Lde(t),value:Fde(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Dde(e,t,n,r){const a=Cr(),s=a&&a.getOptions().normalizeDepth,i=function(u){for(const d in u)if(Object.prototype.hasOwnProperty.call(u,d)){const f=u[d];if(f instanceof Error)return f}}(t),l={__serialized__:lV(t,s)};if(i)return{exception:{values:[zA(e,i)]},extra:l};const c={exception:{values:[{type:Lw(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Bde(t,{isUnhandledRejection:r})}]},extra:l};if(n){const u=UA(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function yS(e,t){return{exception:{values:[zA(e,t)]}}}function UA(e,t){const n=t.stacktrace||t.stack||"",r=function(s){return s&&Rde.test(s.message)?1:0}(t),a=function(s){return typeof s.framesToPop=="number"?s.framesToPop:0}(t);try{return e(n,r,a)}catch{}return[]}const Rde=/Minified React error #\d+;/i;function fV(e){return typeof WebAssembly<"u"&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function Lde(e){const t=e&&e.name;return!t&&fV(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Fde(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:fV(e)&&Array.isArray(e.message)&&e.message.length==2?e.message[1]:t:"No error message"}function xC(e,t,n,r,a){let s;if(eV(t)&&t.error)return yS(e,t.error);if(PI(t)||bh(t,"DOMException")){const i=t;if("stack"in t)s=yS(e,t);else{const l=i.name||(PI(i)?"DOMError":"DOMException"),c=i.message?`${l}: ${i.message}`:l;s=bC(e,c,n,r),cC(s,c)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return MA(t)?yS(e,t):_f(t)||Lw(t)?(s=Dde(e,t,n,a),Cf(s,{synthetic:!0}),s):(s=bC(e,t,n,r),cC(s,`${t}`),Cf(s,{synthetic:!0}),s)}function bC(e,t,n,r){const a={};if(r&&n){const s=UA(e,n);s.length&&(a.exception={values:[{value:t,stacktrace:{frames:s}}]}),Cf(a,{synthetic:!0})}
828if(IA(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return a.logentry={message:s,params:i},a}return a.message=t,a}function Bde(e,{isUnhandledRejection:t}){const n=function(a,s=40){const i=Object.keys(aV(a));i.sort();const l=i[0];if(!l)return"[object has no keys]";if(l.length>=s)return Yd(l,s);for(let c=i.length;c>0;c--){const u=i.slice(0,c).join(", ");if(!(u.length>s))return c===i.length?u:Yd(u,s)}return""}(e),r=t?"promise rejection":"exception";return eV(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Lw(e)?`Event \`${function(a){try{const s=Object.getPrototypeOf(a);return s?s.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class zde extends jde{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t};(function(r,a,s=[a],i="npm"){const l=r._metadata||{};l.sdk||(l.sdk={name:`sentry.javascript.${a}`,packages:s.map(c=>({name:`${i}:@sentry/${c}`,version:Jc})),version:Jc}),r._metadata=l})(n,"browser",["browser"],Xn.SENTRY_SDK_SOURCE||"npm"),super(n),n.sendClientReports&&Xn.document&&Xn.document.addEventListener("visibilitychange",()=>{Xn.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return function(r,a,s,i){const l=xC(r,a,s&&s.syntheticException||void 0,i);return Cf(l),l.level="error",s&&s.event_id&&(l.event_id=s.event_id),pu(l)}(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return function(a,s,i="info",l,c){const u=bC(a,s,l&&l.syntheticException||void 0,c);return u.level=i,l&&l.event_id&&(u.event_id=l.event_id),pu(u)}(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled())return void(zw&&Ke.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:a,tunnel:s,dsn:i}){const l={event_id:r.event_id,sent_at:new Date().toISOString(),...a&&a.sdk&&{sdk:{name:a.sdk.name,version:a.sdk.version}},...!!s&&!!i&&{dsn:mb(i)}};return Ip(l,[function(u){return[{type:"user_report"},u]}(r)])}(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const Ude=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ur=At;let m$,xS,bS,ay;function Vde(){if(!Ur.document)return;const e=Uo.bind(null,"dom"),t=p$(e,!0);Ur.document.addEventListener("click",t,!1),Ur.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const r=Ur[n],a=r&&r.prototype;a&&a.hasOwnProperty&&a.hasOwnProperty("addEventListener")&&(ka(a,"addEventListener",function(s){return function(i,l,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const f=p$(e);d.handler=f,s.call(this,i,f,c)}d.refCount++}catch{}return s.call(this,i,l,c)}}),ka(a,"removeEventListener",function(s){return function(i,l,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,c),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,l,c)}}))})}function p$(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(s){try{return s.target}catch{return null}}(n);if(function(s,i){return s==="keypress"&&(!i||!i.tagName||i.tagName!=="INPUT"&&i.tagName!=="TEXTAREA"&&!i.isContentEditable)}(n.type,r))return;mu(n,"_sentryCaptured",!0),r&&!r._sentryId&&mu(r,"_sentryId",no());const a=n.type==="keypress"?"input":n.type;(function(s){if(s.type!==xS)return!1;try{if(!s.target||s.target._sentryId!==bS)return!1}catch{}return!0})(n)||(e({event:n,name:a,global:t}),xS=n.type,bS=r?r._sentryId:void 0),clearTimeout(m$),m$=Ur.setTimeout(()=>{bS=void 0,xS=void 0},1e3)}}function hV(e){const t="history";Qc(t,e),Zc(t,Wde)}function Wde(){if(!function(){const n=ry.chrome,r=n&&n.app&&n.app.runtime,a="history"in ry&&!!ry.history.pushState&&!!ry.history.replaceState;return!r&&a}())return;const e=Ur.onpopstate;function t(n){return function(...r){const a=r.length>2?r[2]:void 0;if(a){const s=ay,i=String(a);ay=i,Uo("history",{from:s,to:i})}return n.apply(this,r)}}Ur.onpopstate=function(...n){const r=Ur.location.href,a=ay;if(ay=r,Uo("history",{from:a,to:r}),e)try{return e.apply(this,n)}catch{}},ka(Ur.history,"pushState",t),ka(Ur.history,"replaceState",t)}const cx={};function g$(e){cx[e]=void 0}const km="__sentry_xhr_v3__";function qde(){if(!Ur.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const a=new Error,s=1e3*yi(),i=di(r[0])?r[0].toUpperCase():void 0,l=function(u){if(di(u))return u;try{return u.toString()}catch{}}(r[1]);if(!i||!l)return t.apply(n,r);
828n[km]={method:i,url:l,request_headers:{}},i==="POST"&&l.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[km];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}Uo("xhr",{endTimestamp:1e3*yi(),startTimestamp:s,xhr:n,virtualError:a})}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(u,d,f)=>(c(),u.apply(d,f))}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,f){const[h,m]=f,v=d[km];return v&&di(h)&&di(m)&&(v.request_headers[h.toLowerCase()]=m),u.apply(d,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const a=n[km];return a?(r[0]!==void 0&&(a.body=r[0]),Uo("xhr",{startTimestamp:1e3*yi(),xhr:n}),t.apply(n,r)):t.apply(n,r)}})}function Hde(e,t=function(n){const r=cx[n];if(r)return r;let a=Ur[n];if(gC(a))return cx[n]=a.bind(Ur);const s=Ur.document;if(s&&typeof s.createElement=="function")try{const i=s.createElement("iframe");i.hidden=!0,s.head.appendChild(i);const l=i.contentWindow;l&&l[n]&&(a=l[n]),s.head.removeChild(i)}catch(i){Ude&&Ke.warn(`Could not create sandbox iframe for ${n} check, bailing to window.${n}: `,i)}return a&&(cx[n]=a.bind(Ur))}("fetch")){let n=0,r=0;return _de(e,function(a){const s=a.body.length;n+=s,r++;const i={body:a.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return g$("fetch"),hb("No fetch implementation available");try{return t(e.url,i).then(l=>(n-=s,r--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return g$("fetch"),n-=s,r--,hb(l)}})}function wS(e,t,n,r){const a={filename:e,function:t==="<anonymous>"?Rc:t,in_app:!0};return n!==void 0&&(a.lineno=n),r!==void 0&&(a.colno=r),a}const Gde=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Yde=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kde=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xde=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Jde=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qde=function(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,a=0)=>{const s=[],i=n.split(`
829`);for(let l=r;l<i.length;l++){const c=i[l];if(c.length>1024)continue;const u=_I.test(c)?c.replace(_I,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of t){const f=d(u);if(f){s.push(f);break}}if(s.length>=50+a)break}}return function(l){if(!l.length)return[];const c=Array.from(l);return/sentryWrapped/.test(Qv(c).function||"")&&c.pop(),c.reverse(),CI.test(Qv(c).function||"")&&(c.pop(),CI.test(Qv(c).function||"")&&c.pop()),c.slice(0,50).map(u=>({...u,filename:u.filename||Qv(c).filename,function:u.function||Rc}))}(s.slice(a))}}([30,e=>{const t=Gde.exec(e);if(t){const[,r,a,s]=t;return wS(r,Rc,+a,+s)}const n=Yde.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){const s=Kde.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}const[r,a]=v$(n[1]||Rc,n[2]);return wS(a,r,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=Xde.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=Jde.exec(t[3]);a&&(t[1]=t[1]||"eval",t[3]=a[1],t[4]=a[2],t[5]="")}let n=t[3],r=t[1]||Rc;return[r,n]=v$(r,n),wS(n,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),v$=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Rc,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},y$=1024,Zde=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(n){var r;t.console&&function(a){const s="console";Qc(s,a),Zc(s,Tde)}(function(a){return function(s){if(Cr()!==a)return;const i={category:"console",data:{arguments:s.args,logger:"console"},level:Ode(s.level),message:TI(s.args," ")};if(s.level==="assert"){if(s.args[0]!==!1)return;i.message=`Assertion failed: ${TI(s.args.slice(1)," ")||"console.assert"}`,i.data.arguments=s.args.slice(1)}bc(i,{input:s.args,level:s.level})}}(n)),t.dom&&(r=function(a,s){return function(i){if(Cr()!==a)return;let l,c,u=typeof s=="object"?s.serializeAttribute:void 0,d=typeof s=="object"&&typeof s.maxStringLength=="number"?s.maxStringLength:void 0;d&&d>y$&&(zw&&Ke.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${d} was configured. Sentry will use 1024 instead.`),d=y$),typeof u=="string"&&(u=[u]);try{const h=i.event,m=function(v){return!!v&&!!v.target}(h)?h.target:h;l=nV(m,{keyAttrs:u,maxStringLength:d}),c=function(v){if(!$A.HTMLElement)return null;let g=v;for(let y=0;y<5;y++){if(!g)return null;if(g instanceof HTMLElement){if(g.dataset.sentryComponent)return g.dataset.sentryComponent;if(g.dataset.sentryElement)return g.dataset.sentryElement}g=g.parentNode}return null}(m)}catch{l="<unknown>"}if(l.length===0)return;const f={category:`ui.${i.name}`,message:l};c&&(f.data={"ui.component_name":c}),bc(f,{event:i.event,name:i.name,global:i.global})}}(n,t.dom),Qc("dom",r),Zc("dom",Vde)),t.xhr&&function(a){Qc("xhr",a),Zc("xhr",qde)}(function(a){return function(s){if(Cr()!==a)return;const{startTimestamp:i,endTimestamp:l}=s,c=s.xhr[km];if(!i||!l||!c)return;const{method:u,url:d,status_code:f,body:h}=c,m={method:u,url:d,status_code:f},v={xhr:s.xhr,input:h,startTimestamp:i,endTimestamp:l};bc({category:"xhr",data:m,type:"http",level:d$(f)},v)}}(n)),t.fetch&&$de(function(a){return function(s){if(Cr()!==a)return;const{startTimestamp:i,endTimestamp:l}=s;
829if(l&&(!s.fetchData.url.match(/sentry_key/)||s.fetchData.method!=="POST"))if(s.error)bc({category:"fetch",data:s.fetchData,level:"error",type:"http"},{data:s.error,input:s.args,startTimestamp:i,endTimestamp:l});else{const c=s.response,u={...s.fetchData,status_code:c&&c.status},d={input:s.args,response:c,startTimestamp:i,endTimestamp:l};bc({category:"fetch",data:u,type:"http",level:d$(u.status_code)},d)}}}(n)),t.history&&hV(function(a){return function(s){if(Cr()!==a)return;let i=s.from,l=s.to;const c=gS(Xn.location.href);let u=i?gS(i):void 0;const d=gS(l);u&&u.path||(u=c),c.protocol===d.protocol&&c.host===d.host&&(l=d.relative),c.protocol===u.protocol&&c.host===u.host&&(i=u.relative),bc({category:"navigation",data:{from:i,to:l}})}}(n)),t.sentry&&n.on("beforeSendEvent",function(a){return function(s){Cr()===a&&bc({category:"sentry."+(s.type==="transaction"?"transaction":"event"),event_id:s.event_id,level:s.level,message:dl(s)},{event:s})}}(n))}}},efe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],tfe=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&ka(Xn,"setTimeout",x$),t.setInterval&&ka(Xn,"setInterval",x$),t.requestAnimationFrame&&ka(Xn,"requestAnimationFrame",nfe),t.XMLHttpRequest&&"XMLHttpRequest"in Xn&&ka(XMLHttpRequest.prototype,"send",rfe);const n=t.eventTarget;n&&(Array.isArray(n)?n:efe).forEach(afe)}}};function x$(e){return function(...t){const n=t[0];return t[0]=Af(n,{mechanism:{data:{function:Xl(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function nfe(e){return function(t){return e.apply(this,[Af(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Xl(e)},handled:!1,type:"instrument"}})])}}function rfe(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&ka(n,r,function(a){const s={mechanism:{data:{function:r,handler:Xl(a)},handled:!1,type:"instrument"}},i=DA(a);return i&&(s.mechanism.data.handler=Xl(i)),Af(a,s)})}),e.apply(this,t)}}function afe(e){const t=Xn[e],n=t&&t.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ka(n,"addEventListener",function(r){return function(a,s,i){try{typeof s.handleEvent=="function"&&(s.handleEvent=Af(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Xl(s),target:e},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[a,Af(s,{mechanism:{data:{function:"addEventListener",handler:Xl(s),target:e},handled:!1,type:"instrument"}}),i])}}),ka(n,"removeEventListener",function(r){return function(a,s,i){try{const l=s.__sentry_wrapped__;l&&r.call(this,a,l,i)}catch{}return r.call(this,a,s,i)}}))}const ofe=()=>({name:"BrowserSession",setupOnce(){Xn.document!==void 0?(KI({ignoreDuration:!0}),XI(),hV(({from:e,to:t})=>{e!==void 0&&e!==t&&(KI({ignoreDuration:!0}),XI())})):zw&&Ke.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),sfe=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(function(r){(function(a){const s="error";Qc(s,a),Zc(s,Xue)})(a=>{const{stackParser:s,attachStacktrace:i}=w$();if(Cr()!==r||h$())return;const{msg:l,url:c,line:u,column:d,error:f}=a,h=function(m,v,g,y){const x=m.exception=m.exception||{},b=x.values=x.values||[],w=b[0]=b[0]||{},N=w.stacktrace=w.stacktrace||{},S=N.frames=N.frames||[],_=y,k=g,P=di(v)&&v.length>0?v:function(){try{return $A.document.location.href}catch{return""}}();return S.length===0&&S.push({colno:_,filename:P,function:Rc,in_app:!0,lineno:k}),m}(xC(s,f||l,void 0,i,!1),c,u,d);h.level="error",YI(h,{originalException:f,mechanism:{handled:!1,type:"onerror"}})})}(n),b$("onerror")),t.onunhandledrejection&&(function(r){(function(a){const s="unhandledrejection";Qc(s,a),Zc(s,Jue)})(a=>{const{stackParser:s,attachStacktrace:i}
vendor: 4,386 bytes, line 829
829=w$();if(Cr()!==r||h$())return;const l=function(u){if(iC(u))return u;try{if("reason"in u)return u.reason;if("detail"in u&&"reason"in u.detail)return u.detail.reason}catch{}return u}(a),c=iC(l)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(l)}`}]}}:xC(s,l,void 0,i,!0);c.level="error",YI(c,{originalException:l,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(n),b$("onunhandledrejection"))}}};function b$(e){zw&&Ke.log(`Global Handler attached: ${e}`)}function w$(){const e=Cr();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const ife=()=>({name:"HttpContext",preprocessEvent(e){if(!Xn.navigator&&!Xn.location&&!Xn.document)return;const t=e.request&&e.request.url||Xn.location&&Xn.location.href,{referrer:n}=Xn.document||{},{userAgent:r}=Xn.navigator||{},a={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...e.request,...t&&{url:t},headers:a};e.request=s}}),lfe=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(r,a,s){const i=s.getOptions();Pde(zA,i.stackParser,i.maxValueLength,n,t,r,a)}}};var wC="new",j$="loading",S$="loaded",pb="joining-meeting",gl="joined-meeting",ll="left-meeting",ni="error",cfe="blocked",ufe="off",dfe="sendable",ffe="loading",hfe="interrupted",mV="playable",ux="unknown",pV="full",mfe="lobby",pfe="none",gV="base",gfe="*",vfe="ejected",yfe="nbf-room",xfe="nbf-token",bfe="exp-room",wfe="exp-token",jC="no-room",jfe="meeting-full",vV="end-of-life",Sfe="not-allowed",yV="connection-error",Nfe="cam-in-use",_fe="mic-in-use",Cfe="cam-mic-in-use",kfe="permissions",Efe="undefined-mediadevices",Afe="not-found",Pfe="constraints",Tfe="unknown",xV="iframe-ready-for-launch-config",bV="iframe-launch-config",wV="theme-updated",jV="loading",SV="load-attempt-failed",SC="loaded",NV="started-camera",_V="camera-error",CV="joining-meeting",kV="joined-meeting",EV="left-meeting",AV="participant-joined",PV="participant-updated",TV="participant-left",OV="participant-counts-updated",MV="access-state-updated",IV="meeting-session-summary-updated",$V="meeting-session-state-updated",Ofe="meeting-session-data-error",DV="waiting-participant-added",RV="waiting-participant-updated",LV="waiting-participant-removed",FV="track-started",BV="track-stopped",zV="transcription-started",UV="transcription-stopped",VV="transcription-error",NC="recording-started",_C="recording-stopped",WV="recording-stats",qV="recording-error",HV="recording-upload-completed",GV="recording-data",YV="app-message",KV="transcription-message",XV="remote-media-player-started",JV="remote-media-player-updated",QV="remote-media-player-stopped",ZV="local-screen-share-started",e9="local-screen-share-stopped",t9="local-screen-share-canceled",n9="active-speaker-change",r9="active-speaker-mode-change",a9="network-quality-change",o9="network-connection",s9="cpu-load-change",i9="face-counts-updated",Em="fullscreen",Am="exited-fullscreen",l9="live-streaming-started",c9="live-streaming-updated",u9="live-streaming-stopped",d9="live-streaming-error",f9="lang-updated",h9="receive-settings-updated",CC="input-settings-updated",kC="nonfatal-error",EC="error",jS=4096,N$=102400,SS="iframe-call-message",_$="local-screen-start",C$="daily-method-update-live-streaming-endpoints",oy="transmit-log",fi="daily-custom-track",dx={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},m9={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},AC={PLAY:"play",PAUSE:"pause"},NS=["jpg","png","jpeg"],Mfe="add-endpoints",Ife="remove-endpoints",k$="sip-call-transfer";function fo(){return!gt()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function gt(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function p9(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function $fe(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(t.major===13&&t.minor===0&&t.point===0);case"Firefox":return t.major>=67}return!0}(gu(),gb())||gt())}function E$(){if(gt()||!document)return!1;var e=document.createElement("iframe");
829return!!e.requestFullscreen||!!e.webkitRequestFullscreen}var PC="none",Dfe="software",Rfe="hardware",Lfe=function(){try{var e,t=document.createElement("canvas"),n=!1;(e=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,e=t.getContext("webgl2"));var r=e!=null;return t.remove(),r?n?Dfe:Rfe:PC}catch{return PC}}();function g9(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!gt()&&Lfe!==PC&&(e?function(){return A$()?!1:["Chrome","Firefox"].includes(gu())}():function(){if(A$())return!1;var t=gu();if(t==="Safari"){var n=WA();if(n.major<15||n.major===15&&n.minor<4)return!1}return t==="Chrome"?VA().major>=77:t==="Firefox"?qA().major>=97:["Chrome","Firefox","Safari"].includes(t)}())}function v9(){if(gt()||y9()||typeof AudioWorkletNode>"u")return!1;switch(gu()){case"Chrome":case"Firefox":return!0;case"Safari":var e=gb();return e.major>17||e.major===17&&e.minor>=4}return!1}function _S(){return p9()&&typeof MediaStreamTrack<"u"&&!function(){var e,t=gu();if(!fo())return!0;switch(t){case"Chrome":return(e=VA()).major&&e.major>0&&e.major<75;case"Firefox":return(e=qA()).major<91;case"Safari":return(e=WA()).major<13||e.major===13&&e.minor<1;default:return!0}}()}function y9(){return fo().match(/Linux; Android/)}function A$(){var e,t=fo(),n=t.match(/Mac/)&&(!gt()&&typeof window<"u"&&(e=window)!==null&&e!==void 0&&(e=e.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(t.match(/Mobi/)||t.match(/Android/)||n)||!!fo().match(/DailyAnd\//)||void 0}function gu(){if(typeof window<"u"){var e=fo();return x9()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1||b9()?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function gb(){switch(gu()){case"Chrome":return VA();case"Safari":return WA();case"Firefox":return qA();case"Edge":return function(){var e=0,t=0;if(typeof window<"u"){var n=fo().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch{}}return{major:e,minor:t}}()}}function VA(){var e=0,t=0,n=0,r=0,a=!1;if(typeof window<"u"){var s=fo(),i=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(i)try{e=parseInt(i[1]),t=parseInt(i[2]),n=parseInt(i[3]),r=parseInt(i[4]),a=s.indexOf("OPR/")>-1}catch{}}return{major:e,minor:t,build:n,patch:r,opera:a}}function x9(){return!!fo().match(/iPad|iPhone|iPod/i)&&p9()}function b9(){return fo().indexOf("AppleWebKit/605.1.15")>-1}function WA(){var e=0,t=0,n=0;if(typeof window<"u"){var r=fo().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch{}else(x9()||b9())&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function qA(){var e=0,t=0;if(typeof window<"u"){var n=fo().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch{}}return{major:e,minor:t}}var w9=function(){return Fa(function e(){La(this,e)},[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Jh()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Jh()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Jh()}},{key:"sendMessageToDailyJs",value:function(e,t){Jh()}},{key:"removeListener",value:function(e){Jh()}}])}();function P$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function CS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P$(Object(n),!0).forEach(function(r){gs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(j9=function(){return!!e})()}var Ffe=function(){function e(){var t,n,r,a;return La(this,e),n=this,r=Go(r=e),(t=Iw(n,j9()?Reflect.construct(r,[],Go(n).constructor):r.apply(n,a)))._wrappedListeners={},t._messageCallbacks={},t}return $w(e,w9),Fa(e,[{key:"addListenerForMessagesFromCallMachine",value:function(t,n,r){var a=this,s=function(i){if(i.data&&i.data.what==="iframe-call-message"&&(!i.data.callClientId||i.data.callClientId===n)&&(!i.data.from||i.data.from!=="module")){var l=CS({},i.data);if(delete l.from,l.callbackStamp&&a._messageCallbacks[l.callbackStamp]){var c=l.callbackStamp;a._messageCallbacks[c].call(r,l),delete a._messageCallbacks[c]}delete l.what,delete l.callbackStamp,t.call(r,l)}};this._wrappedListeners[t]=s,window.addEventListener("message",s)}},{key:"addListenerForMessagesFromDailyJs",value:function(t,n,r){var a=function(s){var i;if(!(!s.data||s.data.what!==SS||!s.data.action||s.data.from&&s.data.from!=="module"||s.data.callClientId&&n&&s.data.callClientId!==n||s!=null&&(i=s.data)!==null&&i!==void 0&&i.callFrameId)){var l=s.data;t.call(r,l)}};this._wrappedListeners[t]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(t,n,r,a){if(!r)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var s=CS({},t);if(s.what=SS,s.from="module",s.callClientId=r,n){var i=Dw();this._messageCallbacks[i]=n,s.callbackStamp=i}var l=a?a.contentWindow:window,c=this._callMachineTargetOrigin(a);c&&l.postMessage(s,c)}},{key:"sendMessageToDailyJs",value:function(t,n){t.what=SS,t.callClientId=n,t.from="embedded",window.postMessage(t,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(t){var n=this._wrappedListeners[t];
829n&&(window.removeEventListener("message",n),delete this._wrappedListeners[t])}},{key:"forwardPackagedMessageToCallMachine",value:function(t,n,r){var a=CS({},t);a.callClientId=r;var s=n?n.contentWindow:window,i=this._callMachineTargetOrigin(n);i&&s.postMessage(a,i)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(t,n){var r=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===n)&&(!a.data.from||a.data.from!=="module")){var s=a.data;t(s)}};return this._wrappedListeners[t]=r,window.addEventListener("message",r),t}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(t){var n=this._wrappedListeners[t];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[t])}},{key:"_callMachineTargetOrigin",value:function(t){return t?t.src?new URL(t.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}])}();function T$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function S9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S9=function(){return!!e})()}var Bfe=function(){function e(){var t,n,r,a;return La(this,e),n=this,r=Go(r=e),t=Iw(n,S9()?Reflect.construct(r,[],Go(n).constructor):r.apply(n,a)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new oC.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new oC.EventEmitter,t._wrappedListeners={},t._messageCallbacks={},t}return $w(e,w9),Fa(e,[{key:"addListenerForMessagesFromCallMachine",value:function(t,n,r){this._addListener(t,global.callMachineToDailyJsEmitter,n,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(t,n,r){this._addListener(t,global.dailyJsToCallMachineEmitter,n,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(t,n,r){this._sendMessage(t,global.dailyJsToCallMachineEmitter,r,n,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(t,n){this._sendMessage(t,global.callMachineToDailyJsEmitter,n,null,"sending message to daily-js")}},{key:"removeListener",value:function(t){var n=this._wrappedListeners[t];n&&(global.callMachineToDailyJsEmitter.removeListener("message",n),global.dailyJsToCallMachineEmitter.removeListener("message",n),delete this._wrappedListeners[t])}},{key:"_addListener",value:function(t,n,r,a,s){var i=this,l=function(c){if(c.callClientId===r){if(c.callbackStamp&&i._messageCallbacks[c.callbackStamp]){var u=c.callbackStamp;i._messageCallbacks[u].call(a,c),delete i._messageCallbacks[u]}t.call(a,c)}};this._wrappedListeners[t]=l,n.addListener("message",l)}},{key:"_sendMessage",value:function(t,n,r,a,s){var i=function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?T$(Object(d),!0).forEach(function(f){gs(c,f,d[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):T$(Object(d)).forEach(function(f){Object.defineProperty(c,f,Object.getOwnPropertyDescriptor(d,f))})}return c}({},t);if(i.callClientId=r,a){var l=Dw();this._messageCallbacks[l]=a,i.callbackStamp=l}n.emit("message",i)}}])}(),TC="replace",OC="shallow-merge",O$=[TC,OC],zfe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.data,r=t.mergeStrategy,a=r===void 0?TC:r;La(this,e),e._validateMergeStrategy(a),e._validateData(n,a),this.mergeStrategy=a,this.data=n}return Fa(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(t,n){return Object.keys(t).length===0&&n===OC}},{key:"_validateMergeStrategy",value:function(t){if(!O$.includes(t))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(O$,"]"))}},{key:"_validateData",value:function(t,n){if(!function(l){if(l==null||St(l)!=="object")return!1;var c=Object.getPrototypeOf(l);return c==null||c===Object.prototype}(t))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(t),n===TC){var a=JSON.parse(r);Fr(a,t)||console.warn("The meeting session data provided will be modified when serialized.",a,t)}else if(n===OC){for(var s in t)if(Object.hasOwnProperty.call(t,s)&&t[s]!==void 0){var i=JSON.parse(JSON.stringify(t[s]));Fr(t[s],i)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",i,t[s])}}}catch(l){throw Error("Meeting session data must be serializable to JSON: ".concat(l))}if(r.length>N$)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(N$,"."))}}])}();function N9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N9=function(){return!!e})()}function MC(e){var t=typeof Map=="function"?new Map:void 0;return MC=function(n){if(n===null||!function(a){try{return Function.toString.call(a).indexOf("[native code]")!==-1}catch{return typeof a=="function"}}(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,r)}function r(){return function(a,s,i){if(N9())return Reflect.construct.apply(null,arguments);var l=[null];l.push.apply(l,s);var c=new(a.bind.apply(a,l));return i&&Mp(c,i.prototype),c}(n,arguments,Go(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Mp(r,n)},MC(e)}function _9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_9=function(){return!!e})()}function M$(e){var t,n=(t=window._daily)===null||t===void 0?void 0:t.pendings;if(n){var r=n.indexOf(e);r!==-1&&n.splice(r,1)}}var Ufe=function(){return Fa(function e(t){La(this,e),this._currentLoad=null,this._callClientId=t},[{key:"load",value:function(){var e,t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new Vfe(n,function(){r(!1)},function(s,i){i||M$(t._callClientId),a(s,i)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),M$(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}])}(),Vfe=function(){return Fa(function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;La(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var e=this;if(!this._currentAttempt){var t=function(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new I$(e._dailyConfig,e._successCallback,t),e._currentAttempt.start())},3e3))};this._currentAttempt=new I$(this._dailyConfig,this._successCallback,t),this._currentAttempt.start()}}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}])}(),kS=function(){function e(){return La(this,e),t=this,r=arguments,n=Go(n=e),Iw(t,_9()?Reflect.construct(n,r||[],Go(t).constructor):n.apply(t,r));var t,n,r}return $w(e,MC(Error)),Fa(e)}(),vb=2e4,I$=function(){return Fa(function t(n,r,a){La(this,t),this._loadAttemptImpl=gt()||!n.avoidEval?new Wfe(n,r,a):new qfe(n,r,a)},[{key:"start",value:(e=Ge(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var e}(),Wfe=function(){return Fa(function a(s,i,l){La(this,a),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=i,this._failureCallback=l},[{key:"start",value:(r=Ge(function*(){var a=cb(this._dailyConfig);!(yield this._tryLoadFromIOSCache(a))&&this._loadFromNetwork(a)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=Ge(function*(a){if(!this._iosCache)return!1;try{var s=yield this._iosCache.get(a);return!!this.cancelled||!!s&&(s.code?(Function('"use strict";'+s.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=s.refetchHeaders,!1))}catch{return!1}}),function(a){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(t=Ge(function*(a){var s=this;this._networkTimeout=setTimeout(function(){s._networkTimedOut=!0,s._failureCallback({msg:"Timed out (>
829".concat(vb," ms) when loading call object bundle ").concat(a),type:"timeout"})},vb);try{var i=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(a,i);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new kS;var c=yield this._getBundleCodeFromResponse(a,l);if(this.cancelled)throw new kS;Function('"use strict";'+c)(),this._iosCache&&this._iosCache.set(a,c,l.headers),this.succeeded=!0,this._successCallback()}catch(u){if(clearTimeout(this._networkTimeout),u instanceof kS||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(a,": ").concat(u),type:u.message})}}),function(a){return t.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=Ge(function*(a,s){if(s.ok)return yield s.text();if(this._iosCache&&s.status===304)return(yield this._iosCache.renew(a,s.headers)).code;throw new Error("Received ".concat(s.status," response"))}),function(a,s){return e.apply(this,arguments)})}]);var e,t,n,r}(),qfe=function(){return Fa(function e(t,n,r){La(this,e),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r,this._attemptId=Dw(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=cb(this._dailyConfig);(typeof document>"u"?"undefined":St(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){t._stopLoading(),t._failureCallback({msg:"Timed out (>".concat(vb," ms) when loading call object bundle ").concat(e),type:"timeout"})},vb);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){t._stopLoading(),t.succeeded=!0,t._successCallback()},r.onerror=function(a){t._stopLoading(),t._failureCallback({msg:"Failed to load call object bundle ".concat(a.target.src),type:a.message})},r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}])}(),sy=function(e,t,n){return Gfe(e.local,t,n)===!0},Hfe=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Md=function(e,t,n,r){var a=Yfe(e,t,n,r);return a&&a.pendingTrack},Gfe=function(e,t,n){if(!e)return!1;var r=function(s){switch(s){case"avatar":return!0;case"staged":return s;default:return!!s}},a=e.public.subscribedTracks;return a&&a[t]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)===-1&&a[t].custom?[!0,"staged"].includes(a[t].custom)?r(a[t].custom):r(a[t].custom[n]):r(a[t][n]):!a||r(a.ALL)},Yfe=function(e,t,n,r){var a=Object.values(e.streams||{}).filter(function(s){return s.participantId===t&&s.type===n&&s.pendingTrack&&s.pendingTrack.kind===r}).sort(function(s,i){return new Date(i.starttime)-new Date(s.starttime)});return a&&a[0]},Kfe=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function $$(e,t){for(var n=t.getState(),r=0,a=["cam","screen"];r<a.length;r++)for(var s=a[r],i=0,l=["video","audio"];i<l.length;i++){var c=l[i],u=s==="cam"?c:"screen".concat(c.charAt(0).toUpperCase()+c.slice(1)),d=e.tracks[u];if(d){var f=e.local?Hfe(n,s,c):Md(n,e.session_id,s,c);d.state==="playable"&&(d.track=f),d.persistentTrack=f}}}function D$(e,t){try{var n=t.getState();for(var r in e.tracks)if(!Xfe(r)){var a=e.tracks[r].kind;if(a){var s=e.tracks[r];if(s){var i=e.local?Kfe(n,r):Md(n,e.session_id,r,a);s.state==="playable"&&(e.tracks[r].track=i),s.persistentTrack=i}}else console.error("unknown type for custom track")}}catch(l){console.error(l)}}function Xfe(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function R$(e,t,n){var r=n.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch{}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch{}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch{}}else{var a=!0;try{var s=r.participants[e.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(a=!1)}catch(d){console.error(d)}if(!a)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(r.streams,e.audio&&sy(r,e.session_id,"cam-audio")){var i=Md(r,e.session_id,"cam","audio");i&&(t&&t.audioTrack&&t.audioTrack.id===i.id?e.audioTrack=i:i.muted||(e.audioTrack=i)),e.audioTrack||(e.audio=!1)}
829if(e.video&&sy(r,e.session_id,"cam-video")){var l=Md(r,e.session_id,"cam","video");l&&(t&&t.videoTrack&&t.videoTrack.id===l.id?e.videoTrack=l:l.muted||(e.videoTrack=l)),e.videoTrack||(e.video=!1)}if(e.screen&&sy(r,e.session_id,"screen-audio")){var c=Md(r,e.session_id,"screen","audio");c&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===c.id?e.screenAudioTrack=c:c.muted||(e.screenAudioTrack=c))}if(e.screen&&sy(r,e.session_id,"screen-video")){var u=Md(r,e.session_id,"screen","video");u&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===u.id?e.screenVideoTrack=u:u.muted||(e.screenVideoTrack=u))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(d){console.error("unexpected error matching up tracks",d)}}}function Jfe(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(c,u){if(c){if(typeof c=="string")return L$(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?L$(c,u):void 0}}(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
830In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return i=c.done,c},e:function(c){l=!0,s=c},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function L$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ds=new Map,Kd=null;function Qfe(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(c,u){if(c){if(typeof c=="string")return F$(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?F$(c,u):void 0}}(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
831In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return i=c.done,c},e:function(c){l=!0,s=c},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function F$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var fs=new Map,Ym=null;function Zfe(e){C9()?function(t){ds.has(t)||(ds.set(t,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ds.has(t)&&(ds.get(t).lastDevicesString=JSON.stringify(n),Kd||(Kd=function(){var r=Ge(function*(){var a,s=yield navigator.mediaDevices.enumerateDevices(),i=Jfe(ds.keys());try{for(i.s();!(a=i.n()).done;){var l=a.value,c=JSON.stringify(s);c!==ds.get(l).lastDevicesString&&(ds.get(l).lastDevicesString=c,l(s))}}catch(u){i.e(u)}finally{i.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",Kd)))}).catch(function(){}))}(e):function(t){fs.has(t)||(fs.set(t,{}),navigator.mediaDevices.enumerateDevices().then(function(n){fs.has(t)&&(fs.get(t).lastDevicesString=JSON.stringify(n),Ym||(Ym=setInterval(Ge(function*(){var r,a=yield navigator.mediaDevices.enumerateDevices(),s=Qfe(fs.keys());try{for(s.s();!(r=s.n()).done;){var i=r.value,l=JSON.stringify(a);l!==fs.get(i).lastDevicesString&&(fs.get(i).lastDevicesString=l,i(a))}}catch(c){s.e(c)}finally{s.f()}}),3e3)))}))}(e)}function ehe(e){C9()?function(t){ds.has(t)&&(ds.delete(t),ds.size===0&&Kd&&(navigator.mediaDevices.removeEventListener("devicechange",Kd),Kd=null))}(e):function(t){fs.has(t)&&(fs.delete(t),fs.size===0&&Ym&&(clearInterval(Ym),Ym=null))}(e)}function C9(){var e;return gt()||((e=navigator.mediaDevices)===null||e===void 0?void 0:e.ondevicechange)!==void 0}var the=new Set;function nhe(e,t){return e&&e.readyState==="live"&&!function(n,r){return n.muted&&!the.has(n.id)}(e)}function B$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
831t%2?B$(Object(n),!0).forEach(function(r){gs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Pm=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),rhe=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),Km=Object.values(Pm),z$=["v","a","sv","sa","cv","ca"];Object.freeze(Km.reduce(function(e,t,n){return e[t]=z$[n],e},{})),Object.freeze(z$.reduce(function(e,t,n){return e[t]=Km[n],e},{}));var ahe=[Pm.VIDEO,Pm.AUDIO,Pm.SCREEN_VIDEO,Pm.SCREEN_AUDIO],U$=Object.values(rhe),V$=["p","s","t"];Object.freeze(U$.reduce(function(e,t,n){return e[t]=V$[n],e},{})),Object.freeze(V$.reduce(function(e,t,n){return e[t]=U$[n],e},{}));var k9=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.base,r=t.byUserId,a=t.byParticipantId;La(this,e),this.base=n,this.byUserId=r,this.byParticipantId=a}return Fa(e,[{key:"clone",value:function(){var t=new e;if(this.base instanceof ir?t.base=this.base.clone():t.base=this.base,this.byUserId!==void 0)for(var n in t.byUserId={},this.byUserId){var r=this.byUserId[n];t.byUserId[n]=r instanceof ir?r.clone():r}if(this.byParticipantId!==void 0)for(var a in t.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[a];t.byParticipantId[a]=s instanceof ir?s.clone():s}return t}},{key:"toJSONObject",value:function(){var t={};if(typeof this.base=="boolean"?t.base=this.base:this.base instanceof ir&&(t.base=this.base.toJSONObject()),this.byUserId!==void 0)for(var n in t.byUserId={},this.byUserId){var r=this.byUserId[n];t.byUserId[n]=r instanceof ir?r.toJSONObject():r}if(this.byParticipantId!==void 0)for(var a in t.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[a];t.byParticipantId[a]=s instanceof ir?s.toJSONObject():s}return t}},{key:"toMinifiedJSONObject",value:function(){var t={};if(this.base!==void 0&&(typeof this.base=="boolean"?t.b=this.base:t.b=this.base.toMinifiedJSONObject()),this.byUserId!==void 0)for(var n in t.u={},this.byUserId){var r=this.byUserId[n];t.u[n]=typeof r=="boolean"?r:r.toMinifiedJSONObject()}if(this.byParticipantId!==void 0)for(var a in t.p={},this.byParticipantId){var s=this.byParticipantId[a];t.p[a]=typeof s=="boolean"?s:s.toMinifiedJSONObject()}return t}},{key:"normalize",value:function(){return this.base instanceof ir&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(t){var n=Ar(t,2),r=n[0],a=n[1];return[r,a instanceof ir?a.normalize():a]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(t){var n=Ar(t,2),r=n[0],a=n[1];return[r,a instanceof ir?a.normalize():a]}))),this}}],[{key:"fromJSONObject",value:function(t){var n,r,a;if(t.base!==void 0&&(n=typeof t.base=="boolean"?t.base:ir.fromJSONObject(t.base)),t.byUserId!==void 0)for(var s in r={},t.byUserId){var i=t.byUserId[s];r[s]=typeof i=="boolean"?i:ir.fromJSONObject(i)}if(t.byParticipantId!==void 0)for(var l in a={},t.byParticipantId){var c=t.byParticipantId[l];a[l]=typeof c=="boolean"?c:ir.fromJSONObject(c)}return new e({base:n,byUserId:r,byParticipantId:a})}},{key:"fromMinifiedJSONObject",value:function(t){var n,r,a;if(t.b!==void 0&&(n=typeof t.b=="boolean"?t.b:ir.fromMinifiedJSONObject(t.b)),t.u!==void 0)for(var s in r={},t.u){var i=t.u[s];r[s]=typeof i=="boolean"?i:ir.fromMinifiedJSONObject(i)}if(t.p!==void 0)for(var l in a={},t.p){var c=t.p[l];a[l]=typeof c=="boolean"?c:ir.fromMinifiedJSONObject(c)}return new e({base:n,byUserId:r,byParticipantId:a})}},{key:"validateJSONObject",value:function(t){if(St(t)!=="object")return[!1,"canReceive must be an object"];for(var n=["base","byUserId","byParticipantId"],r=0,a=Object.keys(t);r<a.length;r++){var s=a[r];if(!n.includes(s))return[!1,"canReceive can only contain keys (".concat(n.join(", "),")")];if(s==="base"){var i=Ar(ir.validateJSONObject(t.base,!0),2),l=i[0],c=i[1];if(!l)return[!1,c]}else{if(St(t[s])!=="object")return[!1,"invalid (non-object) value for field '".concat(s,"' in canReceive")];for(var u=0,d=Object.values(t[s]);u<d.length;u++){var f=d[u],h=Ar(ir.validateJSONObject(f),2),m=h[0],v=h[1];if(!m)return[!1,v]}}}return[!0]}}])}(),ir=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.video,r=t.audio,a=t.screenVideo,s=t.screenAudio,i=t.customVideo,l=t.customAudio;La(this,e),this.video=n,this.audio=r,this.screenVideo=a,this.screenAudio=s,this.customVideo=i,this.customAudio=l}return Fa(e,[{key:"clone",value:function(){var t=new e;return this.video!==void 0&&(t.video=this.video),this.audio!==void 0&&(t.audio=this.audio),this.screenVideo!==void 0&&(t.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(t.screenAudio=this.screenAudio),this.customVideo!==void 0&&(t.customVideo=tl({},this.customVideo)),this.customAudio!==void 0&&(t.customAudio=tl({},this.customAudio)),t}}
831,{key:"toJSONObject",value:function(){var t={};return this.video!==void 0&&(t.video=this.video),this.audio!==void 0&&(t.audio=this.audio),this.screenVideo!==void 0&&(t.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(t.screenAudio=this.screenAudio),this.customVideo!==void 0&&(t.customVideo=tl({},this.customVideo)),this.customAudio!==void 0&&(t.customAudio=tl({},this.customAudio)),t}},{key:"toMinifiedJSONObject",value:function(){var t={};return this.video!==void 0&&(t.v=this.video),this.audio!==void 0&&(t.a=this.audio),this.screenVideo!==void 0&&(t.sv=this.screenVideo),this.screenAudio!==void 0&&(t.sa=this.screenAudio),this.customVideo!==void 0&&(t.cv=tl({},this.customVideo)),this.customAudio!==void 0&&(t.ca=tl({},this.customAudio)),t}},{key:"normalize",value:function(){function t(n,r){return n&&Object.keys(n).length===1&&n["*"]===r}return!(this.video!==!0||this.audio!==!0||this.screenVideo!==!0||this.screenAudio!==!0||!t(this.customVideo,!0)||!t(this.customAudio,!0))||(this.video!==!1||this.audio!==!1||this.screenVideo!==!1||this.screenAudio!==!1||!t(this.customVideo,!1)||!t(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(t){return new e({video:t,audio:t,screenVideo:t,screenAudio:t,customVideo:{"*":t},customAudio:{"*":t}})}},{key:"fromJSONObject",value:function(t){return new e({video:t.video,audio:t.audio,screenVideo:t.screenVideo,screenAudio:t.screenAudio,customVideo:t.customVideo!==void 0?tl({},t.customVideo):void 0,customAudio:t.customAudio!==void 0?tl({},t.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(t){return new e({video:t.v,audio:t.a,screenVideo:t.sv,screenAudio:t.sa,customVideo:t.cv,customAudio:t.ca})}},{key:"validateJSONObject",value:function(t,n){if(typeof t=="boolean")return[!0];if(St(t)!=="object")return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var r=Object.keys(t),a=0,s=r;a<s.length;a++){var i=s[a];if(!Km.includes(i))return[!1,"invalid media type '".concat(i,"' in canReceive")];if(ahe.includes(i)){if(typeof t[i]!="boolean")return[!1,"invalid (non-boolean) value for media type '".concat(i,"' in canReceive")]}else{if(St(t[i])!=="object")return[!1,"invalid (non-object) value for media type '".concat(i,"' in canReceive")];for(var l=0,c=Object.values(t[i]);l<c.length;l++)if(typeof c[l]!="boolean")return[!1,"invalid (non-boolean) value for entry within '".concat(i,"' in canReceive")];if(n&&t[i]["*"]===void 0)return[!1,`canReceive "base" permission must specify "*" as an entry within '`.concat(i,"'")]}}return n&&r.length!==Km.length?[!1,'canReceive "base" permission must specify all media types: '.concat(Km.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),ohe=["result"],she=["preserveIframe"];function W$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W$(Object(n),!0).forEach(function(r){gs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E9=function(){return!!e})()}function q$(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(c,u){if(c){if(typeof c=="string")return H$(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?H$(c,u):void 0}}(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
832In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return i=c.done,c},e:function(c){l=!0,s=c},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function H$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var wc={}
vendor: 9,433 bytes, line 832
832,G$="video",ihe="voice",Y$=gt()?{data:{}}:{data:{},topology:"none"},K$={present:0,hidden:0},A9={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},ES=Object.keys(A9),X$=["state","volume","simulcastEncodings"],J$={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},yb={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},IC={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},jc={customIntegrations:{validate:R9,help:$9()},customTrayButtons:{validate:D9,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(yb))},url:{validate:function(e){return typeof e=="string"},help:"url should be a string"},baseUrl:{validate:function(e){return typeof e=="string"},help:"baseUrl should be a string"},token:{validate:function(e){return typeof e=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return L9(e,J$)},help:"reactNativeConfig should look like ".concat(JSON.stringify(J$),", all fields optional")},lang:{validate:function(e){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return P9(e),!0}catch(t){return console.error(t),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){if(typeof e=="boolean")return t._preloadCache.allowLocalVideo=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.videoTrack=e,n={customTrack:fi};else{if(delete t._sharedTracks.videoTrack,typeof e!="string")return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(e,t){if(typeof e=="boolean")return t._preloadCache.allowLocalAudio=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.audioTrack=e,n={customTrack:fi};else{if(delete t._sharedTracks.audioTrack,typeof e!="string")return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var a=0,s=Object.keys(r);a<s.length;a++){var i=s[a];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!r[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(r[i],'"')),!1}return!0};return St(e)==="object"&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(e){return T9(e,{allowAllParticipantsKey:!1})},help:I9({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(a){return console.error("Failed to validate send settings",a),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){var n;return!!O9(e)&&(t._inputSettings||(t._inputSettings={}),M9(e,(n=t.properties)===null||n===void 0?void 0:n.dailyConfig,t._sharedTracks),t._updatePreloadCacheInputSettings(e,!0),!0)},help:$C()},layout:{validate:function(e){return e==="custom-v1"||e==="browser"||e==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},iy={styles:{validate:function(e){for(var t in e)if(t!=="cam"&&t!=="screen")return!1;if(e.cam){for(var n in e.cam)if(n!=="div"&&n!=="video")return!1}if(e.screen){for(var r in e.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!gt()&&e==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],a=function(s){var i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var l in s)if(l==="custom"){if(!n.includes(s[l])&&!a(s[l],!0))return!1}else{var c=!i&&!r.includes(l),u=!n.includes(s[l]);if(c||u)return!1}return!0};return a(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(gt()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(e){return e===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=Ar(n[t],2),a=r[0],s=r[1];switch(a){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var i,l=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],c=q$(s);try{for(c.s();!(i=c.n()).done;){var u=i.value;if(!l.includes(u))return!1}}catch(x){c.e(x)}finally{c.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(e.canSend=new Set(s));break;case"canReceive":var d=Ar(k9.validateJSONObject(s),2),f=d[0],h=d[1];if(!f)return console.error(h),!1;break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var m,v=["participants","streaming","transcription"],g=q$(s);try{for(g.s();!(m=g.n()).done;){var y=m.value;if(!v.includes(y))return!1}}catch(x){g.e(x)}finally{g.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(e.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var e=Ge(function*(t){return new Promise(function(n,r){var a=[];t.forEach(function(s){return Promise.resolve(s).then(function(i){n(i)}).catch(function(i){a.push(i),a.length===t.length&&r(a)})})})});return function(t){return e.apply(this,arguments)}}());
vendor: 7,587 bytes, line 832
832var lhe=function(){function e(j){var C,A,D,V,Y,G,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(La(this,e),D=this,V=Go(V=e),gs(A=Iw(D,E9()?Reflect.construct(V,[],Go(D).constructor):V.apply(D,Y)),"startListeningForDeviceChanges",function(){Zfe(A.handleDeviceChange)}),gs(A,"stopListeningForDeviceChanges",function(){ehe(A.handleDeviceChange)}),gs(A,"handleDeviceChange",function(J){J=J.map(function(ce){return JSON.parse(JSON.stringify(ce))}),A.emitDailyJSEvent({action:"available-devices-updated",availableDevices:J})}),gs(A,"handleNativeAppStateChange",function(){var J=Ge(function*(ce){if(ce==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield A.destroy());var ue=ce==="active";A.disableReactNativeAutoDeviceManagement("video")||(ue?A.camUnmutedBeforeLosingNativeActiveState&&A.setLocalVideo(!0):(A.camUnmutedBeforeLosingNativeActiveState=A.localVideo(),A.camUnmutedBeforeLosingNativeActiveState&&A.setLocalVideo(!1)))});return function(ce){return J.apply(this,arguments)}}()),gs(A,"handleNativeAudioFocusChange",function(J){A.disableReactNativeAutoDeviceManagement("audio")||(A._hasNativeAudioFocus=J,A.toggleParticipantAudioBasedOnNativeAudioFocus(),A._hasNativeAudioFocus?A.micUnmutedBeforeLosingNativeAudioFocus&&A.setLocalAudio(!0):(A.micUnmutedBeforeLosingNativeAudioFocus=A.localAudio(),A.setLocalAudio(!1)))}),gs(A,"handleNativeSystemScreenCaptureStop",function(){A.stopScreenShare()}),!_S()&&!gt())throw new Error("WebRTC not supported or suppressed");if(A.strictMode=K.strictMode===void 0||K.strictMode,A.allowMultipleCallInstances=(C=K.allowMultipleCallInstances)!==null&&C!==void 0&&C,Object.keys(wc).length&&(A._logDuplicateInstanceAttempt(),!A.allowMultipleCallInstances)){if(A.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),A.callClientId=Dw(),wc[(G=A).callClientId]=G,window._daily.instances[A.callClientId]={},A._sharedTracks={},window._daily.instances[A.callClientId].tracks=A._sharedTracks,K.dailyJsVersion=e.version(),A._iframe=j,A._callObjectMode=K.layout==="none"&&!A._iframe,A._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},K.showLocalVideo!==void 0?A._callObjectMode?console.error("showLocalVideo is not available in call object mode"):A._showLocalVideo=!!K.showLocalVideo:A._showLocalVideo=!0,K.showParticipantsBar!==void 0?A._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):A._showParticipantsBar=!!K.showParticipantsBar:A._showParticipantsBar=!0,K.customIntegrations!==void 0?A._callObjectMode?console.error("customIntegrations is not available in call object mode"):A._customIntegrations=K.customIntegrations:A._customIntegrations={},K.customTrayButtons!==void 0?A._callObjectMode?console.error("customTrayButtons is not available in call object mode"):A._customTrayButtons=K.customTrayButtons:A._customTrayButtons={},K.activeSpeakerMode!==void 0?A._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):A._activeSpeakerMode=!!K.activeSpeakerMode:A._activeSpeakerMode=!1,K.receiveSettings?A._callObjectMode?A._receiveSettings=K.receiveSettings:console.error("receiveSettings is only available in call object mode"):A._receiveSettings={},A.validateProperties(K),A.properties=Le({},K),A._inputSettings||(A._inputSettings={}),A._callObjectLoader=A._callObjectMode?new Ufe(A.callClientId):null,A._callState=wC,A._isPreparingToJoin=!1,A._accessState={access:ux},A._meetingSessionSummary={},A._finalSummaryOfPrevSession={},A._meetingSessionState=TS(Y$,A._callObjectMode),A._nativeInCallAudioMode=G$,A._participants={},A._isScreenSharing=!1,A._participantCounts=K$,A._rmpPlayerState={},A._waitingParticipants={},A._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},A._activeSpeaker={},A._localAudioLevel=0,A._isLocalAudioLevelObserverRunning=!1,A._remoteParticipantsAudioLevel={},A._isRemoteParticipantsAudioLevelObserverRunning=!1,A._maxAppMessageSize=jS,A._messageChannel=gt()?new Bfe:new Ffe,A._iframe&&(A._iframe.requestFullscreen?A._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===A._iframe?(A.emitDailyJSEvent({action:Em}),A.sendMessageToCallMachine({action:Em})):(A.emitDailyJSEvent({action:Am}),A.sendMessageToCallMachine({action:Am}))}):A._iframe.webkitRequestFullscreen&&A._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===A._iframe?(A.emitDailyJSEvent({action:Em}),A.sendMessageToCallMachine({action:Em})):(A.emitDailyJSEvent({action:Am}),A.sendMessageToCallMachine({action:Am}))})),gt()){var Z=A.nativeUtils();Z.addAudioFocusChangeListener&&Z.removeAudioFocusChangeListener&&Z.addAppStateChangeListener&&Z.removeAppStateChangeListener&&Z.addSystemScreenCaptureStopListener&&Z.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),A._hasNativeAudioFocus=!0,Z.addAudioFocusChangeListener(A.handleNativeAudioFocusChange),Z.addAppStateChangeListener(A.handleNativeAppStateChange),Z.addSystemScreenCaptureStopListener(A.handleNativeSystemScreenCaptureStop)}return A._callObjectMode&&A.startListeningForDeviceChanges(),A._messageChannel.addListenerForMessagesFromCallMachine(A.handleMessageFromCallMachine,A.callClientId,A),A}return $w(e,Jv),Fa(e,[{key:"destroy",value:(F=Ge(function*(){var j;try{yield this.leave()}catch{}var C=this._iframe;if(C){var A=C.parentElement;A&&A.removeChild(C)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),gt()){var D=this.nativeUtils();D.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),D.removeAppStateChangeListener(this.handleNativeAppStateChange),D.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete wc[this.callClientId],!((j=window)===null||j===void 0||(j=j._daily)===null||j===void 0)&&j.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return F.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(j){var C=j.bodyClass,A=j.cssFile,D=j.cssText;return pt(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(A),bodyClass:C,cssText:D}),this}},{key:"iframe",value:function(){return pt(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return wo(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return wo(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(j,C){for(var A in C){if(!iy[A])throw new Error("unrecognized updateParticipant property ".concat(A));if(iy[A].validate&&!iy[A].validate(C[A],this,this._participants[j])
vendor: 6,838 bytes, line 832
832)throw new Error(iy[A].help)}}},{key:"updateParticipant",value:function(j,C){return this._participants.local&&this._participants.local.session_id===j&&(j="local"),j&&C&&(this.validateParticipantProperties(j,C),this.sendMessageToCallMachine({action:"update-participant",id:j,properties:C})),this}},{key:"updateParticipants",value:function(j){var C=this._participants.local&&this._participants.local.session_id;for(var A in j)A===C&&(A="local"),A&&j[A]&&this.validateParticipantProperties(A,j[A]);return this.sendMessageToCallMachine({action:"update-participants",participants:j}),this}},{key:"updateWaitingParticipant",value:(R=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(wo(this._callObjectMode,"updateWaitingParticipant()"),Ut(this._callState,"updateWaitingParticipant()"),typeof C!="string"||St(A)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(D,V){j.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:C,updates:A},function(Y){Y.error&&V(Y.error),Y.id||V(new Error("unknown error in updateWaitingParticipant()")),D({id:Y.id})})})}),function(){return R.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(I=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wo(this._callObjectMode,"updateWaitingParticipants()"),Ut(this._callState,"updateWaitingParticipants()"),St(C)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(A,D){j.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:C},function(V){V.error&&D(V.error),V.ids||D(new Error("unknown error in updateWaitingParticipants()")),A({ids:V.ids})})})}),function(){return I.apply(this,arguments)})},{key:"requestAccess",value:(B=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},A=C.access,D=A===void 0?{level:pV}:A,V=C.name,Y=V===void 0?"":V;return wo(this._callObjectMode,"requestAccess()"),Ut(this._callState,"requestAccess()"),new Promise(function(G,K){j.sendMessageToCallMachine({action:"daily-method-request-access",access:D,name:Y},function(Z){Z.error&&K(Z.error),Z.access||K(new Error("unknown error in requestAccess()")),G({access:Z.access,granted:Z.granted})})})}),function(){return B.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in C&&(gt()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),C={}):j&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),C={})),this.sendMessageToCallMachine({action:"local-audio",state:j,options:C}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(j){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:j}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(j){return this.sendMessageToCallMachine({action:"local-video",state:j}),this}},{key:"_setAllowLocalAudio",value:function(j){if(this._preloadCache.allowLocalAudio=j,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:j}),this}},{key:"_setAllowLocalVideo",value:function(j){if(this._preloadCache.allowLocalVideo=j,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:j}),this}},{key:"getReceiveSettings",value:(M=Ge(function*(j){var C=this,A=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,D=A!==void 0&&A;if(wo(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(St(j)){case"string":return new Promise(function(V){C.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:j,showInheritedValues:D},function(Y){V(Y.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(j){return M.apply(this,arguments)})},{key:"updateReceiveSettings",value:(L=Ge(function*(j){var C=this;if(wo(this._callObjectMode,"updateReceiveSettings()"),!T9(j,{allowAllParticipantsKey:!0}))throw new Error(I9({allowAllParticipantsKey:!0}));return Ut(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(A){C.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:j},function(D){A({receiveSettings:D.receiveSettings})})})}),function(j){return L.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(j,C){if(j){var A={};if(j.audio){var D,V,Y;j.audio.settings&&(!Object.keys(j.audio.settings).length&&C||(A.audio={settings:Le({},j.audio.settings)})),C&&(D=A.audio)!==null&&D!==void 0&&(D=D.settings)!==null&&D!==void 0&&D.customTrack&&(A.audio.settings={customTrack:this._sharedTracks.audioTrack});var G=((V=j.audio.processor)===null||V===void 0?void 0:V.type)==="none"&&((Y=j.audio.processor)===null||Y===void 0?void 0:Y._isDefaultWhenNone);if(j.audio.processor&&!G){var K=Le({},j.audio.processor);delete K._isDefaultWhenNone,A.audio=Le(Le({},A.audio),{},{processor:K})}}if(j.video){var Z,J,ce;j.video.settings&&(!Object.keys(j.video.settings).length&&C||(A.video={settings:Le({},j.video.settings)})),C&&(Z=A.video)!==null&&Z!==void 0&&(Z=Z.settings)!==null&&Z!==void 0&&Z.customTrack&&(A.video.settings={customTrack:this._sharedTracks.videoTrack});var ue=((J=j.video.processor)===null||J===void 0?void 0:J.type)==="none"&&((ce=j.video.processor)===null||ce===void 0?void 0:ce._isDefaultWhenNone);if(j.video.processor&&!ue){var be=Le({},j.video.processor);delete be._isDefaultWhenNone,A.video=Le(Le({},A.video),{},{processor:be})}}return A}}},{key:"getInputSettings",value:function(){var j=this;return pt(),new Promise(function(C){C(j._getInputSettings())})}}
832,{key:"_getInputSettings",value:function(){var j,C,A,D,V,Y,G={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(j=((A=this._inputSettings)===null||A===void 0?void 0:A.video)||G,C=((D=this._inputSettings)===null||D===void 0?void 0:D.audio)||G):(j=((V=this._preloadCache)===null||V===void 0||(V=V.inputSettings)===null||V===void 0?void 0:V.video)||G,C=((Y=this._preloadCache)===null||Y===void 0||(Y=Y.inputSettings)===null||Y===void 0?void 0:Y.audio)||G);var K={audio:C,video:j};return this._prepInputSettingsForSharing(K,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(j,C){var A=this._inputSettings||{},D={};if(j.video){var V,Y,G;D.video={},j.video.settings?(D.video.settings={},C||j.video.settings.customTrack||(G=A.video)===null||G===void 0||!G.settings?D.video.settings=j.video.settings:D.video.settings=Le(Le({},A.video.settings),j.video.settings),Object.keys(D.video.settings).length||delete D.video.settings):(V=A.video)!==null&&V!==void 0&&V.settings&&(D.video.settings=A.video.settings),j.video.processor?D.video.processor=j.video.processor:(Y=A.video)!==null&&Y!==void 0&&Y.processor&&(D.video.processor=A.video.processor)}else A.video&&(D.video=A.video);if(j.audio){var K,Z,J;D.audio={},j.audio.settings?(D.audio.settings={},C||j.audio.settings.customTrack||(J=A.audio)===null||J===void 0||!J.settings?D.audio.settings=j.audio.settings:D.audio.settings=Le(Le({},A.audio.settings),j.audio.settings),Object.keys(D.audio.settings).length||delete D.audio.settings):(K=A.audio)!==null&&K!==void 0&&K.settings&&(D.audio.settings=A.audio.settings),j.audio.processor?D.audio.processor=j.audio.processor:(Z=A.audio)!==null&&Z!==void 0&&Z.processor&&(D.audio.processor=A.audio.processor)}else A.audio&&(D.audio=A.audio);this._maybeUpdateInputSettings(D)}},{key:"_devicesFromInputSettings",value:function(j){var C,A,D=(j==null||(C=j.video)===null||C===void 0||(C=C.settings)===null||C===void 0?void 0:C.deviceId)||null,V=(j==null||(A=j.audio)===null||A===void 0||(A=A.settings)===null||A===void 0?void 0:A.deviceId)||null,Y=this._preloadCache.outputDeviceId||null;return{camera:D?{deviceId:D}:{},mic:V?{deviceId:V}:{},speaker:Y?{deviceId:Y}:{}}}},{key:"updateInputSettings",value:(W=Ge(function*(j){var C=this;return pt(),O9(j)?j.video||j.audio?(M9(j,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(j,!0),this._getInputSettings()):new Promise(function(A,D){C.sendMessageToCallMachine({action:"update-input-settings",inputSettings:j},function(V){if(V.error)D(V.error);else{if(V.returnPreloadCache)return C._updatePreloadCacheInputSettings(j,!0),void A(C._getInputSettings());C._maybeUpdateInputSettings(V.inputSettings),A(C._prepInputSettingsForSharing(V.inputSettings,!0))}})})):this._getInputSettings():(console.error($C()),Promise.reject($C()))}),function(j){return W.apply(this,arguments)})},{key:"setBandwidth",value:function(j){var C=j.kbs,A=j.trackConstraints;if(pt(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:C,trackConstraints:A}),this}},{key:"getDailyLang",value:function(){var j=this;if(pt(),this._callMachineInitialized)return new Promise(function(C){j.sendMessageToCallMachine({action:"get-daily-lang"},function(A){delete A.action,delete A.callbackStamp,C(A)})})}},{key:"setDailyLang",value:function(j){return pt(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:j}),this}},{key:"setProxyUrl",value:function(j){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:j}),this}},{key:"setIceConfig",value:function(j){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:j}),this}},{key:"meetingSessionSummary",value:function(){return[ll,ni].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(q=Ge(function*(){var j=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Ut(this._callState,"getMeetingSession()"),new Promise(function(C){j.sendMessageToCallMachine({action:"get-meeting-session"},function(A){delete A.action,delete A.callbackStamp,C(A)})})}),function(){return q.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Ut(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";wo(this._callObjectMode,"setMeetingSessionData()"),Ut(this._callState,"setMeetingSessionData");try{(function(A,D){new zfe({data:A,mergeStrategy:D})})(j,C)}catch(A){throw console.error(A),A}try{this.sendMessageToCallMachine({action:"set-session-data",data:j,mergeStrategy:C})}catch(A){throw new Error("Error setting meeting session data: ".concat(A))}}},{key:"setUserName",value:function(j,C){var A=this;return this.properties.userName=j,new Promise(function(D){A.sendMessageToCallMachine({action:"set-user-name",name:j??"",thisMeetingOnly:gt()||!!C&&!!C.thisMeetingOnly},function(V){delete V.action,delete V.callbackStamp,D(V)})})}},{key:"setUserData",value:(E=Ge(function*(j){var C=this;try{P9(j)}catch(A){throw console.error(A),A}if(this.properties.userData=j,this._callMachineInitialized)return new Promise(function(A){try{C.sendMessageToCallMachine({action:"set-user-data",userData:j},function(D){delete D.action,delete D.callbackStamp,A(D)})}catch(D){throw new Error("Error setting user data: ".concat(D))}})}),function(j){return E.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(j){if(j&&(j<100||typeof j!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(j){var C=this;if(typeof AudioWorkletNode>"u"&&!gt())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(j),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(A,D){C.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:j},function(V){C._isLocalAudioLevelObserverRunning=!V.error,V.error?D({error:V.error}):A()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:j}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(j){var C=this;if(this.validateAudioLevelInterval(j),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(A,D){C.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:j},function(V){C._isRemoteParticipantsAudioLevelObserverRunning=!V.error,V.error?D({error:V.error}):A()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:j}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(U=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wo(this._callObjectMode,"startCamera()"),AS(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or set
832LocalVideo() instead?"),this.needsLoad())try{yield this.load(C)}catch(A){return Promise.reject(A)}else{if(this._didPreAuth){if(C.url&&C.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(C.token&&C.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(C),this.properties=Le(Le({},this.properties),C)}return new Promise(function(A){j._preloadCache.inputSettings=j._prepInputSettingsForSharing(j._inputSettings,!1),j.sendMessageToCallMachine({action:"start-camera",properties:sd(j.properties,j.callClientId),preloadCache:sd(j._preloadCache,j.callClientId)},function(D){A({camera:D.camera,mic:D.mic,speaker:D.speaker})})})}),function(){return U.apply(this,arguments)})},{key:"validateCustomTrack",value:function(j,C,A){if(A&&A.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(C&&C!=="music"&&C!=="speech"&&!(C instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(A&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(A))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(j instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName,ignoreAudioLevel};return pt(),Ut(this._callState,"startCustomTrack()"),this.validateCustomTrack(C.track,C.mode,C.trackName),new Promise(function(A,D){j._sharedTracks.customTrack=C.track,C.track=fi,j.sendMessageToCallMachine({action:"start-custom-track",properties:C},function(V){V.error?D({error:V.error}):A(V.mediaTag)})})}},{key:"stopCustomTrack",value:function(j){var C=this;return pt(),Ut(this._callState,"stopCustomTrack()"),new Promise(function(A){C.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:j},function(D){A(D.mediaTag)})})}},{key:"setCamera",value:function(j){var C=this;return Qh(),ly(this._callMachineInitialized,"setCamera()"),new Promise(function(A){C.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:j},function(D){A({device:D.device})})})}},{key:"setAudioDevice",value:(z=Ge(function*(j){return Qh(),this.nativeUtils().setAudioDevice(j),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(j){return z.apply(this,arguments)})},{key:"cycleCamera",value:function(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(A){j.sendMessageToCallMachine({action:"cycle-camera",properties:C},function(D){A({device:D.device})})})}},{key:"cycleMic",value:function(){var j=this;return pt(),new Promise(function(C){j.sendMessageToCallMachine({action:"cycle-mic"},function(A){C({device:A.device})})})}},{key:"getCameraFacingMode",value:function(){var j=this;return Qh(),new Promise(function(C){j.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(A){C(A.facingMode)})})}},{key:"setInputDevicesAsync",value:(T=Ge(function*(j){var C=this,A=j.audioDeviceId,D=j.videoDeviceId,V=j.audioSource,Y=j.videoSource;if(pt(),V!==void 0&&(A=V),Y!==void 0&&(D=Y),typeof A=="boolean"&&(this._setAllowLocalAudio(A),A=void 0),typeof D=="boolean"&&(this._setAllowLocalVideo(D),D=void 0),!A&&!D)return yield this.getInputDevices();var G={};return A&&(A instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=A,A=fi,G.audio={settings:{customTrack:A}}):(delete this._sharedTracks.audioTrack,G.audio={settings:{deviceId:A}})),D&&(D instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=D,D=fi,G.video={settings:{customTrack:D}}):(delete this._sharedTracks.videoTrack,G.video={settings:{deviceId:D}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(G,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(K){C.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:A,videoDeviceId:D},function(Z){if(delete Z.action,delete Z.callbackStamp,Z.returnPreloadCache)return C._updatePreloadCacheInputSettings(G,!1),void K(C._devicesFromInputSettings(C._inputSettings));K(Z)})})}),function(j){return T.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:($=Ge(function*(j){var C=this,A=j.outputDeviceId;if(pt(),!A||typeof A!="string")throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=A,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(D,V){C.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:A},function(Y){if(delete Y.action,delete Y.callbackStamp,Y.error){var G=new Error(Y.error.message);return G.type=Y.error.type,void V(G)}Y.returnPreloadCache?D(C._devicesFromInputSettings(C._inputSettings)):D(Y)})})}),function(j){return $.apply(this,arguments)})},{key:"getInputDevices",value:(O=Ge(function*(){var j=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(C){j.sendMessageToCallMachine({action:"get-input-devices"},function(A){A.returnPreloadCache?C(j._devicesFromInputSettings(j._inputSettings)):C({camera:A.camera,mic:A.mic,speaker:A.speaker})})})}),function(){return O.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Qh(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(j){if(Qh(),[G$,ihe].includes(j)){if(j!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=j,!this.disableReactNativeAutoDeviceManagement("audio")&&fx(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMo
vendor: 5,258 bytes, line 832
832de(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",j)}},{key:"preAuth",value:(P=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wo(this._callObjectMode,"preAuth()"),AS(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(C)),!C.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(C),this.properties=Le(Le({},this.properties),C),new Promise(function(A,D){j._preloadCache.inputSettings=j._prepInputSettingsForSharing(j._inputSettings,!1),j.sendMessageToCallMachine({action:"daily-method-preauth",properties:sd(j.properties,j.callClientId),preloadCache:sd(j._preloadCache,j.callClientId)},function(V){return V.error?D(V.error):V.access?(j._didPreAuth=!0,void A({access:V.access})):D(new Error("unknown error in preAuth()"))})})}),function(){return P.apply(this,arguments)})},{key:"load",value:(k=Ge(function*(j){var C=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(j&&(this.validateProperties(j),this.properties=Le(Le({},this.properties),j)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(j$),this.emitDailyJSEvent({action:jV}),this._callObjectMode?new Promise(function(A,D){C._callObjectLoader.cancel();var V=Date.now();C._callObjectLoader.load(C.properties.dailyConfig,function(Y){C._bundleLoadTime=Y?"no-op":Date.now()-V,C._updateCallState(S$),Y&&C.emitDailyJSEvent({action:SC}),A()},function(Y,G){if(C.emitDailyJSEvent({action:SV}),!G){C._updateCallState(ni),C.resetMeetingDependentVars();var K={action:EC,errorMsg:Y.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:Y,bundleUrl:cb(C.properties.dailyConfig)}}};C._maybeSendToSentry(K),C.emitDailyJSEvent(K),D(Y.msg)}})}):(this._iframe.src=QU(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(A,D){C._loadedCallback=function(V){C._callState!==ni?(C._updateCallState(S$),(C.properties.cssFile||C.properties.cssText)&&C.loadCss(C.properties),A()):D(V)}}))}}),function(j){return k.apply(this,arguments)})},{key:"join",value:(_=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var A=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(C)}catch(D){return this.updateIsPreparingToJoin(!1),Promise.reject(D)}}else{if(A=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(C.url&&C.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(C.token&&C.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(C.url&&!this._callObjectMode&&C.url&&C.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(C.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(C),this.properties=Le(Le({},this.properties),C)}return C.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!C.showLocalVideo),C.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!C.showParticipantsBar),this._callState===gl||this._callState===pb?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(pb,!1),this.emitDailyJSEvent({action:CV}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:sd(this.properties,this.callClientId),preloadCache:sd(this._preloadCache,this.callClientId)}),new Promise(function(D,V){j._joinedCallback=function(Y,G){if(j._callState!==ni){if(j._updateCallState(gl),Y)for(var K in Y){if(j._callObjectMode){var Z=j._callMachine().store;$$(Y[K],Z),D$(Y[K],Z),R$(Y[K],j._participants[K],Z)}j._participants[K]=Le({},Y[K]),j.toggleParticipantAudioBasedOnNativeAudioFocus()}A&&j.loadCss(j.properties),D(Y)}else V(G)}}))}),function(){return _.apply(this,arguments)})},{key:"leave",value:(S=Ge(function*(){var j=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(C){j._callState===ll||j._callState===ni?C():j._callObjectLoader&&!j._callObjectLoader.loaded?(j._callObjectLoader.cancel(),j._updateCallState(ll),j.resetMeetingDependentVars(),j.emitDailyJSEvent({action:ll}),C()):(j._resolveLeave=C,j.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return S.apply(this,arguments)})},{key:"startScreenShare",value:(N=Ge(function*(){var j=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ly(this._callMachineInitialized,"startScreenShare()"),C.screenVideoSendSettings&&this._val
832idateVideoSendSettings("screenVideo",C.screenVideoSendSettings),C.mediaStream&&(this._sharedTracks.screenMediaStream=C.mediaStream,C.mediaStream=fi),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var A=this.nativeUtils();if(yield A.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:kC,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});A.setSystemScreenCaptureStartCallback(function(){A.setSystemScreenCaptureStartCallback(null),j.sendMessageToCallMachine({action:_$,captureOptions:C})}),A.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:_$,captureOptions:C})}),function(){return N.apply(this,arguments)})},{key:"stopScreenShare",value:function(){ly(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},C=j.type;if(C&&C!=="cloud"&&C!=="raw-tracks"&&C!=="local")throw new Error("invalid type: ".concat(C,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(Le({action:"local-recording-start"},j))}},{key:"updateRecording",value:function(j){var C=j.layout,A=C===void 0?{preset:"default"}:C,D=j.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:A,instanceId:D})}},{key:"stopRecording",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(Le({action:"local-recording-stop"},j))}},{key:"startLiveStreaming",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(Le({action:"daily-method-start-live-streaming"},j))}},{key:"updateLiveStreaming",value:function(j){var C=j.layout,A=C===void 0?{preset:"default"}:C,D=j.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:A,instanceId:D})}},{key:"addLiveStreamingEndpoints",value:function(j){var C=j.endpoints,A=j.instanceId;this.sendMessageToCallMachine({action:C$,endpointsOp:Mfe,endpoints:C,instanceId:A})}},{key:"removeLiveStreamingEndpoints",value:function(j){var C=j.endpoints,A=j.instanceId;this.sendMessageToCallMachine({action:C$,endpointsOp:Ife,endpoints:C,instanceId:A})}},{key:"stopLiveStreaming",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};
832this.sendMessageToCallMachine(Le({action:"daily-method-stop-live-streaming"},j))}},{key:"validateDailyConfig",value:function(j){j.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(j.camSimulcastEncodings)),j.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),y9()&&j.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,A=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(j){if(!(j instanceof Array||Array.isArray(j)))throw new Error("encodings must be an Array");if(!nD(j.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var D=0;D<j.length;D++){var V=j[D];for(var Y in this._validateEncodingLayerHasValidProperties(V),V)if(ES.includes(Y)){if(typeof V[Y]!="number")throw new Error("".concat(Y," must be a number"));if(C){var G=C[Y],K=G.min,Z=G.max;if(!nD(V[Y],K,Z))throw new Error("".concat(Y," value not in range. valid range: ").concat(K," to ").concat(Z))}}else if(!["active","scalabilityMode"].includes(Y))throw new Error("Invalid key ".concat(Y,", valid keys are:")+Object.values(ES));if(A&&!V.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(w=Ge(function*(j){var C=this,A=j.url,D=j.settings,V=D===void 0?{state:AC.PLAY}:D;try{(function(Y){if(typeof Y!="string")throw new Error('url parameter must be "string" type')})(A),tD(V),function(Y){for(var G in Y)if(!X$.includes(G))throw new Error("Invalid key ".concat(G,", valid keys are: ").concat(X$));Y.simulcastEncodings&&this.validateSimulcastEncodings(Y.simulcastEncodings,A9,!0)}(V)}catch(Y){throw console.error("invalid argument Error: ".concat(Y)),console.error(`startRemoteMediaPlayer arguments must be of the form:
833  { url: "playback url",
834  settings?:
835  {state: "play"|"pause", simulcastEncodings?: [{}] } }`),Y}return new Promise(function(Y,G){C.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:A,settings:V},function(K){K.error?G({error:K.error,errorMsg:K.errorMsg}):Y({session_id:K.session_id,remoteMediaPlayerState:{state:K.state,settings:K.settings}})})})}),function(j){return w.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(b=Ge(function*(j){var C=this;if(typeof j!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(A,D){C.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:j},function(V){V.error?D({error:V.error,errorMsg:V.errorMsg}):A()})})}),function(j){return b.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(x=Ge(function*(j){var C=this,A=j.session_id,D=j.settings;try{tD(D)}catch(V){throw console.error("invalid argument Error: ".concat(V)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
836  session_id: "participant session",
837  { settings?: {state: "play"|"pause"} }`),V}return new Promise(function(V,Y){C.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:A,settings:D},function(G){G.error?Y({error:G.error,errorMsg:G.errorMsg}):V({session_id:G.session_id,remoteMediaPlayerState:{state:G.state,settings:G.settings}})})})}),function(j){return x.apply(this,arguments)})},{key:"startTranscription",value:function(j){Ut(this._callState,"startTranscription()"),this.sendMessageToCallMachine(Le({action:"daily-method-start-transcription"},j))}},{key:"updateTranscription",value:function(j){if(Ut(this._callState,"updateTranscription()"),!j)throw new Error("updateTranscription Error: options is mandatory");if(St(j)!=="object")throw new Error("updateTranscription Error: options must be object type");if(j.participants&&!Array.isArray(j.participants))throw new Error("updateTranscription 
837Error: participants must be an array");this.sendMessageToCallMachine(Le({action:"daily-method-update-transcription"},j))}},{key:"stopTranscription",value:function(j){if(Ut(this._callState,"stopTranscription()"),j&&St(j)!=="object")throw new Error("stopTranscription Error: options must be object type");if(j&&!j.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(Le({action:"daily-method-stop-transcription"},j))}},{key:"startDialOut",value:(y=Ge(function*(j){var C=this;Ut(this._callState,"startDialOut()");var A=function(G){if(G){if(!Array.isArray(G))throw new Error("Error starting dial out: audio codec must be an array");if(G.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");G.forEach(function(K){if(typeof K!="string")throw new Error("Error starting dial out: audio codec must be a string");if(K!=="OPUS"&&K!=="PCMU"&&K!=="PCMA"&&K!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!j.sipUri&&!j.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(j.sipUri&&j.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");
837if(j.sipUri){if(typeof j.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!j.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(j.video&&typeof j.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(G){if(G&&(A(G.audio),G.video)){if(!Array.isArray(G.video))throw new Error("Error starting dial out: video codec must be an array");if(G.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");G.video.forEach(function(K){if(typeof K!="string")throw new Error("Error starting dial out: video codec must be a string");if(K!=="H264"&&K!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(j.codecs)}if(j.phoneNumber){if(typeof j.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(j.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");j.codecs&&A(j.codecs.audio)}if(j.callerId){if(typeof j.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(j.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(j.displayName){if(typeof j.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(j.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(j.userId){if(typeof j.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(j.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(Q$(j),j.permissions&&j.permissions.canReceive){var D=Ar(k9.validateJSONObject(j.permissions.canReceive),2),V=D[0],Y=D[1];if(!V)throw new Error(Y)}if(j.provider){if(j.provider!=="daily")throw new Error("Error: provider can be set only to 'daily', got: ".concat(j.provider));if(j.phoneNumber)throw new Error("Error starting dial out: provider valid only for sipUri, not phoneNumber");console.warn("(pre-beta) provider=daily is currently in pre-beta, things might break!")}return new Promise(function(G,K){C.sendMessageToCallMachine(Le({action:"dialout-start"},j),function(Z){Z.error?K(Z.error):G(Z)})})}),function(j){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(j){var C=this;return Ut(this._callState,"stopDialOut()"),new Promise(function(A,D){C.sendMessageToCallMachine(Le({action:"dialout-stop"},j),function(V){V.error?D(V.error):A(V)})})}},{key:"sipCallTransfer",value:(g=Ge(function*(j){var C=this;if(Ut(this._callState,"sipCallTransfer()"),!j)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return j.useSipRefer=!1,eD(j,"sipCallTransfer"),Q$(j),new Promise(function(A,D){C.sendMessageToCallMachine(Le({action:k$},j),function(V){V.error?D(V.error):A(V)})})}),function(j){return g.apply(this,arguments)})},{key:"sipRefer",value:(v=Ge(function*(j){var C=this;if(Ut(this._callState,"sipRefer()"),!j)throw new Error("sessionId and toEndPoint are mandatory parameter");return j.useSipRefer=!0,eD(j,"sipRefer"),new Promise(function(A,D){C.sendMessageToCallMachine(Le({action:k$},j),function(V){V.error?D(V.error):A(V)})})}),function(j){return v.apply(this,arguments)})},{key:"sendDTMF",value:(m=Ge(function*(j){var C=this;return Ut(this._callState,"sendDTMF()"),function(A){var D=A.sessionId,V=A.tones;if(!D||!V)throw new Error("sessionId and tones are mandatory parameter");if(typeof D!="string"||typeof V!="string")throw new Error("sessionId and tones should be of string type");if(V.length>20)throw new Error("tones string must be upto 20 characters");var Y=/[^0-9A-D*#]/g,G=V.match(Y);if(G&&G[0])throw new Error("".concat(G[0]," is not valid DTMF tone"))}(j),new Promise(function(A,D){C.sendMessageToCallMachine(Le({action:"send-dtmf"},j),function(V){V.error?D(V.error):A(V)})})}),function(j){return m.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var j=this;return this._callState!==gl?Promise.resolve(Le({stats:{latest:{}}},this._network)):new Promise(function(C){j.sendMessageToCallMachine({action:"get-calc-stats"},function(A){C(Le(Le({},j._network),{},{stats:A.stats}))})})}},{key:"testWebsocketConnectivity",value:(h=Ge(function*(){var j=this;if(PS(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(C){return Promise.reject(C)}return new Promise(function(C,A){j.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(D){D.error?A(D.error):C(D.results)})})}),function(){return h.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(j){return j?j instanceof MediaStreamTrack?!!nhe(j)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=Ge(function*(){var j=this;pt(),wo(this._callObjectMode,"testCallQuality()"),ly(this._callMachineInitialized,"testCallQuality()",null,!0),AS(this._callState,this._isPreparingToJoin,"testCallQuality()");var C=this._testCallAlreadyInProgress,A=function(V){C||(j._testCallInProgress=V)};if(A(!0),this.needsLoad())try{var D=this._callState;yield this.load(),this._callState=D}catch(V){return A(!1),Promise.reject(V)}return new Promise(function(V){j.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:j.properties.dailyJsVersion},function(Y){var G=Y.results,K=G.result,Z=vI(G,ohe);
837if(K==="failed"){var J,ce=Le({},Z);(J=Z.error)!==null&&J!==void 0&&J.details?(Z.error.details=JSON.parse(Z.error.details),ce.error=Le(Le({},ce.error),{},{details:Le({},ce.error.details)}),ce.error.details.duringTest="testCallQuality"):(ce.error=ce.error?Le({},ce.error):{},ce.error.details={duringTest:"testCallQuality"}),j._maybeSendToSentry(ce)}A(!1),V(Le({result:K},Z))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(d=Ge(function*(j){var C;gt()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),C=yield this.testPeerToPeerCallQuality(j)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),C=yield this.testCallQuality());var A={result:C.result,secondsElapsed:C.secondsElapsed};return C.data&&(A.data={maxRTT:C.data.maxRoundTripTime,packetLoss:C.data.avgRecvPacketLoss}),A}),function(j){return d.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(u=Ge(function*(j){var C=this;if(PS(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(V){return Promise.reject(V)}var A=j.videoTrack,D=j.duration;if(!this._validateVideoTrackForNetworkTests(A))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=A,new Promise(function(V,Y){C.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:D},function(G){G.error?Y(G.error):V(G.results)})})}),function(j){return u.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){gt()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(c=Ge(function*(j){var C=this;if(PS(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(A){return Promise.reject(A)}if(!this._validateVideoTrackForNetworkTests(j))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=j,new Promise(function(A,D){C.sendMessageToCallMachine({action:"test-network-connectivity"},function(V){V.error?D(V.error):A(V.results)})})}),function(j){return c.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var j=this;return new Promise(function(C){j._callState===gl?j.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(A){C(A.cpuStats)}):C({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(j){var C;if(!(((C=Object.keys(j))===null||C===void 0?void 0:C.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(ES))}},{key:"_validateVideoSendSettings",value:function(j,C){var A=j==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],D="Video send settings should be either an object or one of the supported presets: ".concat(A.join());if(typeof C=="string"){if(!A.includes(C))throw new Error(D)}else{if(St(C)!=="object")throw new Error(D);if(!C.maxQuality&&!C.encodings&&C.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(C.maxQuality&&["low","medium","high"].indexOf(C.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(C.encodings){var V=!1;switch(Object.keys(C.encodings).length){case 1:V=!C.encodings.low;break;case 2:V=!C.encodings.low||!C.encodings.medium;break;case 3:V=!C.encodings.low||!C.encodings.medium||!C.encodings.high;break;default:V=!0}if(V)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");
837C.encodings.low&&this._validateEncodingLayerHasValidProperties(C.encodings.low),C.encodings.medium&&this._validateEncodingLayerHasValidProperties(C.encodings.medium),C.encodings.high&&this._validateEncodingLayerHasValidProperties(C.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(j){var C=this;if(!j||Object.keys(j).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(j).forEach(function(A){var D=Ar(A,2),V=D[0],Y=D[1];C._validateVideoSendSettings(V,Y)})}},{key:"updateSendSettings",value:function(j){var C=this;return this.validateUpdateSendSettings(j),this.needsLoad()?(this._preloadCache.sendSettings=j,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(A,D){C.sendMessageToCallMachine({action:"update-send-settings",sendSettings:j},function(V){V.error?D(V.error):A(V.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return pt(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(j){return pt(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:j}),this}},{key:"activeSpeakerMode",value:function(){return pt(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(j){return Ut(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=j,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:j}),this}},{key:"enumerateDevices",value:(l=Ge(function*(){var j=this;if(this._callObjectMode){var C=yield navigator.mediaDevices.enumerateDevices();return gu()==="Firefox"&&gb().major>115&&gb().major<123&&(C=C.filter(function(A){return A.kind!=="audiooutput"})),{devices:C.map(function(A){var D=JSON.parse(JSON.stringify(A));if(!gt()&&A.kind==="videoinput"&&A.getCapabilities){var V,Y=A.getCapabilities();D.facing=(Y==null||(V=Y.facingMode)===null||V===void 0?void 0:V.length)>=1?Y.facingMode[0]:void 0}return D})}}return new Promise(function(A){j.sendMessageToCallMachine({action:"enumerate-devices"},function(D){A({devices:D.devices})})})}),function(){return l.apply(this,arguments)})},{key:"sendAppMessage",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(Ut(this._callState,"sendAppMessage()"),JSON.stringify(j).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:j,to:C}),this}},{key:"addFakeParticipant",value:function(j){return pt(),Ut(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(Le({action:"add-fake-participant"},j)),this}},{key:"setShowNamesMode",value:function(j){return ya(this._callObjectMode,"setShowNamesMode()"),pt(),j&&j!=="always"&&j!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:j}),this)}},{key:"setShowLocalVideo",value:function(){var j=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ya(this._callObjectMode,"setShowLocalVideo()"),pt(),Ut(this._callState,"setShowLocalVideo()"),typeof j!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:j}),this._showLocalVideo=j,this)}},{key:"showLocalVideo",value:function(){return ya(this._callObjectMode,"showLocalVideo()"),pt(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var j=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ya(this._callObjectMode,"setShowParticipantsBar()"),pt(),Ut(this._callState,"setShowParticipantsBar()"),typeof j!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:j}),this._showParticipantsBar=j,this)}},{key:"showParticipantsBar",value:function(){return ya(this._callObjectMode,"showParticipantsBar()"),pt(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return pt(),ya(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(j){return pt(),ya(this._callObjectMode,"setCustomIntegrations()"),Ut(this._callState,"setCustomIntegrations()"),R9(j)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:j}),this._customIntegrations=j,this):this}},{key:"startCustomIntegrations",value:function(j){var C=this;if(pt(),ya(this._callObjectMode,"startCustomIntegrations()"),Ut(this._callState,"startCustomIntegrations()"),Array.isArray(j)&&j.some(function(V){return typeof V!="string"}
837)||!Array.isArray(j)&&typeof j!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var A=typeof j=="string"?[j]:j,D=A.filter(function(V){return!(V in C._customIntegrations)});return D.length?(console.error(`Can't find custom integration(s): "`.concat(D.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:A}),this)}},{key:"stopCustomIntegrations",value:function(j){var C=this;if(pt(),ya(this._callObjectMode,"stopCustomIntegrations()"),Ut(this._callState,"stopCustomIntegrations()"),Array.isArray(j)&&j.some(function(V){return typeof V!="string"})||!Array.isArray(j)&&typeof j!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var A=typeof j=="string"?[j]:j,D=A.filter(function(V){return!(V in C._customIntegrations)});return D.length?(console.error(`Can't find custom integration(s): "`.concat(D.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:A}),this)}},{key:"customTrayButtons",value:function(){return ya(this._callObjectMode,"customTrayButtons()"),pt(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(j){return ya(this._callObjectMode,"updateCustomTrayButtons()"),pt(),Ut(this._callState,"updateCustomTrayButtons()"),D9(j)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:j}),this._customTrayButtons=j,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(yb))),this)}},{key:"theme",value:function(){return ya(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(j){var C=this;return ya(this._callObjectMode,"setTheme()"),new Promise(function(A,D){try{C.validateProperties({theme:j}),C.properties.theme=Le({},j),C.sendMessageToCallMachine({action:"set-theme",theme:C.properties.theme});try{C.emitDailyJSEvent({action:wV,theme:C.properties.theme})}catch(V){console.log("could not emit 'theme-updated'",V)}A(C.properties.theme)}catch(V){D(V)}})}},{key:"requestFullscreen",value:(i=Ge(function*(){if(pt(),this._iframe&&!document.fullscreenElement&&E$())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(j){console.log("could not make video call fullscreen",j)}}),function(){return i.apply(this,arguments)})},{key:"exitFullscreen",value:function(){pt(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=Ge(function*(){var j=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(C){j.sendMessageToCallMachine({action:"get-sidebar-view"},function(A){C(A.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(j){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:j}),this)}},{key:"room",value:(a=Ge(function*(){var j=this,C=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,A=C===void 0||C;return this._accessState.access===ux||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(D){j.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:A},function(V){delete V.action,delete V.callbackStamp,D(V)})})}),function(){return a.apply(this,arguments)})},{key:"geo",value:(r=Ge(function*(){try{var j=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield j.json()).geo}}catch(C){return console.error("geo lookup failed",C),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=Ge(function*(j){var C=this;return pt(),Ut(this._callState,"setNetworkTopology()"),new Promise(function(A,D){C.sendMessageToCallMachine({action:"set-network-topology",opts:j},function(V){V.error?D({error:V.error}):A({workerId:V.workerId})})})}),function(j){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=Ge(function*(){var j=this;return new Promise(function(C,A){j.needsLoad()&&C({topology:"none"}),j.sendMessageToCallMachine({action:"get-network-topology"},function(D){D.error?A({error:D.error}):C({topology:D.topology})})})}),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(j){if(pt(),typeof j!="number"&&j!==!0&&j!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(j));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:j})}},{key:"on",value:function(j,C){return Jv.prototype.on.call(this,j,C)}},{key:"once",value:function(j,C){return Jv.prototype.once.call(this,j,C)}},{key:"off",value:function(j,C){return Jv.prototype.off.call(this,j,C)}},{key:"validateProperties",value:function(j){var C,A;if(j!=null&&(C=j.dailyConfig)!==null&&C!==void 0&&C.userMediaAudioConstraints){var D,V;gt()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var Y=j.inputSettings||{};Y.audio=((D=j.inputSettings)===null||D===void 0?void 0:D.audio)||{},Y.audio.settings=((V=j.inputSettings)===null||V===void 0||(V=V.audio)===null||V===void 0?void 0:V.settings)||{},Y.audio.settings=Le(Le({},Y.audio.settings),j.dailyConfig.userMediaAudioConstraints),j.inputSettings=Y,delete j.dailyConfig.userMediaAudioConstraints}if(j!=null&&(A=j.dailyConfig)!==null&&A!==void 0&&A.userMediaVideoConstraints){var G,K;gt()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var Z=j.inputSettings||{};Z.video=((G=j.inputSettings)===null||G===void 0?void 0:G.video)||{},Z.video.settings=((K=j.inputSettings)===null||K===void 0||(K=K.video)===null||K===void 0?void 0:K.settings)||{},Z.video.settings=Le(Le({},Z.video.settings),j.dailyConfig.userMediaVideoConstraints),j.inputSettings=Z,delete j.dailyConfig.userMediaVideoConstraints}for(var J in j)if(jc[J]){if(jc[J].validate&&!jc[J].validate(j[J],this))throw new Error("property '".concat(J,"': ").concat(jc[J].help))}else console.warn("Ignoring unrecognized property '".concat(J,"'")),delete j[J]}},{key:"assembleMeetingUrl",value:function(){var j,C,A=Le(Le({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(j=this.properties.dailyConfig)!==null&&j!==void 0&&j.proxyUrl?encodeURIComponent((C=this.properties.dailyConfig)===null||C===void 0?void 0:C.proxyUrl):void 0}),D=A.url.match(/\?/)?"&":"?";return A.url+D+Object.keys(jc).filter(function(V){return jc[V].queryString&&A[V]!==void 0}
vendor: 6,937 bytes, line 837
837).map(function(V){return"".concat(jc[V].queryString,"=").concat(A[V])}).join("&")}},{key:"needsLoad",value:function(){return[wC,j$,ll,ni].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(j,C){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(j,C,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(j){this._messageChannel.forwardPackagedMessageToCallMachine(j,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(j){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(j,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(j){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(j)}},{key:"handleMessageFromCallMachine",value:function(j){switch(j.action){case xV:this.sendMessageToCallMachine(Le({action:bV},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var C={action:oy,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:cb(this.properties.dailyConfig)}};this.sendMessageToCallMachine(C),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case SC:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(j);break;case kV:var A,D=Le({},j);delete D.internal,this._maxAppMessageSize=((A=j.internal)===null||A===void 0?void 0:A._maxAppMessageSize)||jS,this._joinedCallback&&(this._joinedCallback(j.participants),this._joinedCallback=null),this.emitDailyJSEvent(D);break;case AV:case PV:if(this._callState===ll)return;if(j.participant&&j.participant.session_id){var V=j.participant.local?"local":j.participant.session_id;if(this._callObjectMode){var Y=this._callMachine().store;$$(j.participant,Y),D$(j.participant,Y),R$(j.participant,this._participants[V],Y)}try{this.maybeParticipantTracksStopped(this._participants[V],j.participant),this.maybeParticipantTracksStarted(this._participants[V],j.participant),this.maybeEventRecordingStopped(this._participants[V],j.participant),this.maybeEventRecordingStarted(this._participants[V],j.participant)}catch(Tt){console.error("track events error",Tt)}this.compareEqualForParticipantUpdateEvent(j.participant,this._participants[V])||(this._participants[V]=Le({},j.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(j))}break;case TV:if(j.participant&&j.participant.session_id){var G=this._participants[j.participant.session_id];G&&this.maybeParticipantTracksStopped(G,null),delete this._participants[j.participant.session_id],this.emitDailyJSEvent(j)}break;case OV:Fr(this._participantCounts,j.participantCounts)||(this._participantCounts=j.participantCounts,this.emitDailyJSEvent(j));break;case MV:var K={access:j.access};j.awaitingAccess&&(K.awaitingAccess=j.awaitingAccess),Fr(this._accessState,K)||(this._accessState=K,this.emitDailyJSEvent(j));break;case IV:if(j.meetingSession){this._meetingSessionSummary=j.meetingSession,this.emitDailyJSEvent(j);var Z=Le(Le({},j),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(Z)}break;case EC:var J;this._iframe&&!j.preserveIframe&&(this._iframe.src=""),this._updateCallState(ni),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(j.errorMsg),this._loadedCallback=null),j.preserveIframe;var ce=vI(j,she);ce!=null&&(J=ce.error)!==null&&J!==void 0&&J.details&&(ce.error.details=JSON.parse(ce.error.details)),this._maybeSendToSentry(j),this._joinedCallback&&(this._joinedCallback(null,ce),this._joinedCallback=null),this.emitDailyJSEvent(ce);break;case EV:this._callState!==ni&&this._updateCallState(ll),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(j);break;case"selected-devices-updated":j.devices&&this.emitDailyJSEvent(j);break;case a9:var ue=j.state,be=j.threshold,Ne=j.quality,te=ue.state,re=ue.reasons;te===this._network.networkState&&Fr(re,this._network.networkStateReasons)&&be===this._network.threshold&&Ne===this._network.quality||(this._network.networkState=te,this._network.networkStateReasons=re,this._network.quality=Ne,this._network.threshold=be,j.networkState=te,re.length&&(j.networkStateReasons=re),delete j.state,this.emitDailyJSEvent(j));break;case s9:j&&j.cpuLoadState&&this.emitDailyJSEvent(j);break;case i9:j&&j.faceCounts!==void 0&&this.emitDailyJSEvent(j);break;case n9:var pe=j.activeSpeaker;this._activeSpeaker.peerId!==pe.peerId&&(this._activeSpeaker.peerId=pe.peerId,this.emitDailyJSEvent({action:j.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Ee=j.show;this._showLocalVideo=Ee,this.emitDailyJSEvent({action:j.action,show:Ee});break;case r9:var Fe=j.enabled;this._activeSpeakerMode!==Fe&&(this._activeSpeakerMode=Fe,this.emitDailyJSEvent({action:j.action,enabled:this._activeSpeakerMode}));break;case DV:case RV:case LV:this._waitingParticipants=j.allWaitingParticipants,this.emitDailyJSEvent({action:j.action,participant:j.participant});break;case h9:Fr(this._receiveSettings,j.receiveSettings)||(this._receiveSettings=j.receiveSettings,this.emitDailyJSEvent({action:j.action,receiveSettings:j.receiveSettings}));break;case CC:this._maybeUpdateInputSettings(j.inputSettings);break;case"send-settings-updated":Fr(this._sendSettings,j.sendSettings)||(this._sendSettings=j.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:j.action,sendSettings:j.sendSettings}));break;case"local-audio-level":this._localAudioLevel=j.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(j);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=j.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(j);break;case XV:var Be=j.session_id;this._rmpPlayerState[Be]=j.playerState,this.emitDailyJSEvent(j);break;case QV:delete this._rmpPlayerState[j.session_id],this.emitDailyJSEvent(j);break;case JV:var st=j.session_id,Pt=this._rmpPlayerState[st];Pt&&this.compareEqualForRMPUpdateEvent(Pt,j.remoteMediaPlayerState)||(this._rmpPlayerState[st]=j.remoteMediaPlayerState,this.emitDailyJSEvent(j));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(j);break;case $V:var kn=this._meetingSessionState.topology!==(j.meetingSessionState&&j.meetingSessionState.topology);this._meetingSessionState=TS(j.meetingSessionState,this._callObjectMode),(this._callObjectMode||kn)&&this.emitDailyJSEvent(j);break;case ZV:this._isScreenSharing=!0,this.emitDailyJSEvent(j);break;case e9:case t9:this._isScreenSharing=!1,this.emitDailyJSEvent(j);break;
837case NC:case _C:case WV:case qV:case HV:case zV:case UV:case VV:case NV:case _V:case YV:case KV:case"test-completed":case o9:case GV:case l9:case c9:case u9:case d9:case kC:case f9:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(j);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(j,C){var A="record";j&&(C.local||C[A]!==!1||j[A]===C[A]||this.emitDailyJSEvent({action:_C}))}},{key:"maybeEventRecordingStarted",value:function(j,C){var A="record";j&&(C.local||C[A]!==!0||j[A]===C[A]||this.emitDailyJSEvent({action:NC}))}},{key:"_trackStatePlayable",value:function(j){return!(!j||j.state!==mV)}},{key:"_trackChanged",value:function(j,C){return(j==null?void 0:j.id)!==(C==null?void 0:C.id)}},{key:"maybeEventTrackStopped",value:function(j,C,A){var D,V,Y=(D=C==null?void 0:C.tracks[j])!==null&&D!==void 0?D:null,G=(V=A==null?void 0:A.tracks[j])!==null&&V!==void 0?V:null,K=Y==null?void 0:Y.track;if(K){var Z=this._trackStatePlayable(Y),J=this._trackStatePlayable(G),ce=this._trackChanged(K,G==null?void 0:G.track);Z&&(J&&!ce||this.emitDailyJSEvent({action:BV,track:K,participant:A??C,type:j}))}}},{key:"maybeEventTrackStarted",value:function(j,C,A){var D,V,Y=(D=C==null?void 0:C.tracks[j])!==null&&D!==void 0?D:null,G=(V=A==null?void 0:A.tracks[j])!==null&&V!==void 0?V:null,K=G==null?void 0:G.track;if(K){var Z=this._trackStatePlayable(Y),J=this._trackStatePlayable(G),ce=this._trackChanged(Y==null?void 0:Y.track,K);J&&(Z&&!ce||this.emitDailyJSEvent({action:FV,track:K,participant:A,type:j}))}}},{key:"maybeParticipantTracksStopped",value:function(j,C){if(j)for(var A in j.tracks)this.maybeEventTrackStopped(A,j,C)}},{key:"maybeParticipantTracksStarted",value:function(j,C){if(C)for(var A in C.tracks)this.maybeEventTrackStarted(A,j,C)}},{key:"compareEqualForRMPUpdateEvent",value:function(j,C){var A,D;return j.state===C.state&&((A=j.settings)===null||A===void 0?void 0:A.volume)===((D=C.settings)===null||D===void 0?void 0:D.volume)}},{key:"emitDailyJSEvent",value:function(j){try{j.callClientId=this.callClientId,this.emit(j.action,j)}catch(C){console.log("could not emit",j,C)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(j,C){return!!Fr(j,C)&&(!j.videoTrack||!C.videoTrack||j.videoTrack.id===C.videoTrack.id&&j.videoTrack.muted===C.videoTrack.muted&&j.videoTrack.enabled===C.videoTrack.enabled)&&(!j.audioTrack||!C.audioTrack||j.audioTrack.id===C.audioTrack.id&&j.audioTrack.muted===C.audioTrack.muted&&j.audioTrack.enabled===C.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return gt()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(j){this._updateCallState(this._callState,j)}},{key:"_updateCallState",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(j!==this._callState||C!==this._isPreparingToJoin){var A=this._callState,D=this._isPreparingToJoin;this._callState=j,this._isPreparingToJoin=C;var V=this._callState===gl;this.updateShowAndroidOngoingMeetingNotification(V);var Y=fx(A,D),G=fx(this._callState,this._isPreparingToJoin);Y!==G&&(this.updateKeepDeviceAwake(G),this.updateDeviceAudioMode(G),this.updateNoOpRecordingEnsuringBackgroun
vendor: 1,530 bytes, line 837
837dContinuity(G))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=K$,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:ux},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=TS(Y$,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._maxAppMessageSize=jS,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(j){gt()&&this.nativeUtils().setKeepDeviceAwake(j,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(j){if(gt()&&!this.disableReactNativeAutoDeviceManagement("audio")){var C=j?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(C)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(j){if(gt()&&this.nativeUtils().setShowOngoingMeetingNotification){var C,A,D,V;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var Y=this.properties.reactNativeConfig.androidInCallNotification;C=Y.title,A=Y.subtitle,D=Y.iconName,V=Y.disableForCustomOverride}V&&(j=!1),this.nativeUtils().setShowOngoingMeetingNotification(j,C,A,D,this.callClientId)}}}
837,{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(j){gt()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(j)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var j;if(gt()){var C=(j=this._callMachine())===null||j===void 0||(j=j.store)===null||j===void 0?void 0:j.getState();for(var A in C==null?void 0:C.streams){var D=C.streams[A];D&&D.pendingTrack&&D.pendingTrack.kind==="audio"&&(D.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(j){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[j]}},{key:"absoluteUrl",value:function(j){if(j!==void 0){var C=document.createElement("a");return C.href=j,C.href}}},{key:"sayHello",value:function(){var j="hello, world.";return console.log(j),j}},{key:"_logUseAfterDestroy",value:function(){var j=Object.values(wc)[0];if(this.needsLoad())if(j&&!j.needsLoad()){var C={action:oy,level:"error",code:this.strictMode?9995:9997};j.sendMessageToCallMachine(C)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var A={action:oy,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(A,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var j=0,C=Object.values(wc);j<C.length;j++){var A=C[j];A._callMachineInitialized?(A.sendMessageToCallMachine({action:oy,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),A._delayDuplicateInstanceLog=!1):A._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(j){var C,A,D,V;if(!((C=j.error)!==null&&C!==void 0&&C.type&&(![yV,vV,jC].includes(j.error.type)||j.error.type===jC&&j.error.msg.includes("deleted")))){var Y=(A=this.properties)!==null&&A!==void 0&&A.url?new URL(this.properties.url):void 0,G="production";Y&&Y.host.includes(".staging.daily")&&(G="staging");var K,Z,J,ce,ue,be=function(Be){const st=[Ade(),kde(),tfe(),Zde(),sfe(),lfe(),Mde(),ife()];return Be.autoSessionTracking!==!1&&st.push(ofe()),st}({}).filter(function(Be){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(Be.name)}),Ne=new zde({dsn:"https://[email protected]/168844",transport:Hde,stackParser:Qde,integrations:be,environment:G}),te=new Jl;if(te.setClient(Ne),Ne.init(),this.session_id&&te.setExtra("sessionId",this.session_id),this.properties){var re=Le({},this.properties);re.userName=re.userName?"[Filtered]":void 0,re.userData=re.userData?"[Filtered]":void 0,re.token=re.token?"[Filtered]":void 0,te.setExtra("properties",re)}if(Y){var pe=Y.searchParams.get("domain");if(!pe){var Ee=Y.host.match(/(.*?)\./);pe=Ee&&Ee[1]||""}pe&&te.setTag("domain",pe)}j.error&&(te.setTag("fatalErrorType",j.error.type),te.setExtra("errorDetails",j.error.details),!((K=j.error.details)===null||K===void 0)&&K.uri&&te.setTag("serverAddress",j.error.details.uri),!((Z=j.error.details)===null||Z===void 0)&&Z.workerGroup&&te.setTag("workerGroup",j.error.details.workerGroup),!((J=j.error.details)===null||J===void 0)&&J.geoGroup&&te.setTag("geoGroup",j.error.details.geoGroup),!((ce=j.error.details)===null||ce===void 0)&&ce.on&&te.setTag("connectionAttempt",j.error.details.on),(ue=j.error.details)!==null&&ue!==void 0&&ue.bundleUrl&&(te.setTag("bundleUrl",j.error.details.bundleUrl),te.setTag("bundleError",j.error.details.sourceError.type))),te.setTags({callMode:this._callObjectMode?gt()?"reactNative":(D=this.properties)!==null&&D!==void 0&&(D=D.dailyConfig)!==null&&D!==void 0&&(D=D.callMode)!==null&&D!==void 0&&D.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:e.version()});var Fe=((V=j.error)===null||V===void 0?void 0:V.msg)||j.errorMsg;te.captureException(new Error(Fe))}}},{key:"_callMachine",value:function(){var j;return(j=window._daily)===null||j===void 0||(j=j.instances)===null||j===void 0||(j=j[this.callClientId])===null||j===void 0?void 0:j.callMachine}},{key:"_maybeUpdateInputSettings",value:function(j){if(!Fr(this._inputSettings,j)){var C=this._getInputSettings();this._inputSettings=j;var A=this._getInputSettings();Fr(C,A)||this.emitDailyJSEvent({action:CC,inputSettings:A})}}}],[{key:"supportedBrowser",value:function(){if(gt())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var j=Kue.getParser(fo());return{supported:!!_S(),mobile:j.getPlatformType()==="mobile",name:j.getBrowserName(),version:j.getBrowserVersion(),supportsFullscreen:!!E$(),supportsScreenShare:!!$fe(),supportsSfu:!!_S(),supportsVideoProcessing:g9(),supportsAudioProcessing:v9()}}},{key:"version",value:function(){return"0.85.0"}},{key:"createCallObject",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return j.layout="none",new e(null,j)}},{key:"wrap",value:function(j){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pt(),!j||!j.contentWindow||typeof j.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return C.layout||(C.customLayout?C.layout="custom-v1":C.layout="browser"),new e(j,C)}},{key:"createFrame",value:function(j,C){var A,D;pt(),j&&C?(A=j,D=C):j&&j.append?(A=j,D={}):(A=document.body,D=j||{});var V=D.iframeStyle;V||(V=A===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var Y=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?Y.allow="microphone, camera":Y.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",Y.style.visibility="hidden",A.appendChild(Y),Y.style.visibility=null,Object.keys(V).forEac
vendor: 4,092 bytes, lines 837-845
837h(function(G){return Y.style[G]=V[G]}),D.layout||(D.customLayout?D.layout="custom-v1":D.layout="browser");try{return new e(Y,D)}catch(G){throw A.removeChild(Y),G}}},{key:"createTransparentFrame",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt();var C=document.createElement("iframe");return C.allow="microphone; camera; autoplay",C.style.cssText=`
838      position: fixed;
839      top: 0;
840      left: 0;
841      width: 100%;
842      height: 100%;
843      border: 0;
844      pointer-events: none;
845    `,document.body.appendChild(C),j.layout||(j.layout="custom-v1"),e.wrap(C,j)}},{key:"getCallInstance",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return j?wc[j]:Object.values(wc)[0]}}]);var t,n,r,a,s,i,l,c,u,d,f,h,m,v,g,y,x,b,w,N,S,_,k,P,O,$,T,z,U,E,q,W,L,M,B,I,R,F}();function Q$(e){if(e.extension){if(typeof e.extension!="string")throw new Error("Error starting dial out: extension must be a string");if(e.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(e.waitBeforeExtensionDialSec){if(typeof e.waitBeforeExtensionDialSec!="number")throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(e.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!e.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function sd(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=fi;else if(r==="dailyConfig"){if(e[r].modifyLocalSdpHook){var a=window._daily.instances[t].customCallbacks||{};a.modifyLocalSdpHook=e[r].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=a,delete e[r].modifyLocalSdpHook}if(e[r].modifyRemoteSdpHook){var s=window._daily.instances[t].customCallbacks||{};s.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=s,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Ut(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==gl){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function fx(e,t){return[pb,gl].includes(e)||t}function AS(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(fx(e,t)){var a="".concat(n," not supported after joining a meeting.");throw r&&(a+=" ".concat(r)),console.error(a),new Error(a)}}function ly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!e){var r="".concat(t,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function PS(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(t),new Error(t)}}function wo(e){if(!e){var t="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function ya(e){if(e){var t="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function pt(){if(gt())throw new Error("This daily-js method is not currently supported in React Native")}function Qh(){if(!gt())throw new Error("This daily-js method is only supported in React Native")}function P9(e){if(e===void 0)return!0;var t;if(typeof e=="string")t=e;
845else try{t=JSON.stringify(e),Fr(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function T9(e,t){for(var n=t.allowAllParticipantsKey,r=function(f){var h=["local"];return n||h.push("*"),f&&!h.includes(f)},a=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!a(f.video))&&!(f.screenVideo&&!a(f.screenVideo))},i=0,l=Object.entries(e);i<l.length;i++){var c=Ar(l[i],2),u=c[0],d=c[1];if(!r(u)||!s(d))return!1}return!0}function O9(e){if(St(e)!=="object")return!1;for(var t=0,n=Object.entries(e);t<n.length;t++){var r=Ar(n[t],2),a=r[0],s=r[1];switch(a){case"video":if(St(s)!=="object")return!1;for(var i=0,l=Object.entries(s);i<l.length;i++){var c=Ar(l[i],2),u=c[0],d=c[1];switch(u){case"processor":if(!uhe(d))return!1;break;case"settings":if(!Z$(d))return!1;break;default:return!1}}break;case"audio":if(St(s)!=="object")return!1;for(var f=0,h=Object.entries(s);f<h.length;f++){var m=Ar(h[f],2),v=m[0],g=m[1];switch(v){case"processor":if(!che(g))return!1;break;case"settings":if(!Z$(g))return!1;break;default:return!1}}break;default:return!1}}return!0}function M9(e,t,n){var r,a=[];e.video&&e.video.processor&&(g9((r=t==null?void 0:t.useLegacyVideoProcessor)!==null&&r!==void 0&&r)||(e.video.settings?delete e.video.processor:delete e.video,a.push("video"))),e.audio&&e.audio.processor&&(v9()||(e.audio.settings?delete e.audio.processor:delete e.audio,a.push("audio"))),a.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(a.join(", "))),e.audio&&e.audio.settings&&(e.audio.settings.customTrack?(n.audioTrack=e.audio.settings.customTrack,e.audio.settings={customTrack:fi}):delete n.audioTrack),e.video&&e.video.settings&&(e.video.settings.customTrack?(n.videoTrack=e.video.settings.customTrack,e.video.settings={customTrack:fi}):delete n.videoTrack)}function che(e){if(gt())return console.warn("Video processing is not yet supported in React Native"),!1;var t=["type"];return!!e&&St(e)==="object"&&(Object.keys(e).filter(function(n){return!t.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> audio -> processor : ".concat(n)),delete e[n]}),!!function(n){return typeof n!="string"?!1:Object.values(m9).includes(n)?!0:(console.error("inputSettings audio processor type invalid"),!1)}(e.type))}function uhe(e){if(gt())return console.warn("Video processing is not yet supported in React Native"),!1;var t=["type","config"];return!e||St(e)!=="object"||!function(n){return typeof n!="string"?!1:Object.values(dx).includes(n)?!0:(console.error("inputSettings video processor type invalid"),!1)}(e.type)||e.config&&(St(e.config)!=="object"||!function(n,r){var a=Object.keys(r);if(a.length===0)return!0;var s="invalid object in inputSettings -> video -> processor -> config";switch(n){case dx.BGBLUR:return a.length>1||a[0]!=="strength"?(console.error(s),!1):!(typeof r.strength!="number"||r.strength<=0||r.strength>1||isNaN(r.strength))||(console.error("".concat(s,"; expected: {0 < strength <= 1}, got: ").concat(r.strength)),!1);case dx.BGIMAGE:return!(r.source!==void 0&&!function(i){if(i.source==="default")return i.type="default",!0;if(i.source instanceof ArrayBuffer)return!0;if(ub(i.source))return i.type="url",!!function(u){var d=new URL(u),f=d.pathname;if(d.protocol==="data:")try{var h=f.substring(f.indexOf(":")+1,f.indexOf(";")).split("/")[1];return NS.includes(h)}catch(v){return console.error("failed to deduce blob content type",v),!1}var m=f.split(".").at(-1).toLowerCase().trim();return NS.includes(m)}(i.source)||(console.error("invalid image type; supported types: [".concat(NS.join(", "),"]")),!1);return l=i.source,c=Number(l),isNaN(c)||!Number.isInteger(c)||c<=0||c>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(i.type="daily-preselect",!0);var l,c}(r));default:return!0}}(e.type,e.config))?!1:(Object.keys(e).filter(function(n){return!t.includes(n)}
845).forEach(function(n){console.warn("invalid key inputSettings -> video -> processor : ".concat(n)),delete e[n]}),!0)}function Z$(e){return St(e)==="object"&&(!e.customTrack||e.customTrack instanceof MediaStreamTrack)}function $C(){var e=Object.values(dx).join(" | "),t=Object.values(m9).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function I9(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(gV).concat(t?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function $9(){return"customIntegrations should be an object of type ".concat(JSON.stringify(IC),".")}function D9(e){if(e&&St(e)!=="object"||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(yb),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=Ar(n[t],1)[0],a=0,s=Object.entries(e[r]);a<s.length;a++){var i=Ar(s[a],2),l=i[0],c=i[1],u=yb.id[l];if(!u)return console.error("customTrayButton does not support key ".concat(l)),!1;switch(l){case"iconPath":case"iconPathDarkMode":if(!ub(c))return console.error("customTrayButton ".concat(l," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(c))return console.error("customTrayButton ".concat(l," should be ").concat(u,". Got: ").concat(c)),!1;break;default:if(St(c)!==u)return console.error("customTrayButton ".concat(l," should be a ").concat(u,".")),!1}}return!0}function R9(e){if(!e||e&&St(e)!=="object"||Array.isArray(e))return console.error($9()),!1;for(var t=function(f){return"".concat(f," should be ").concat(IC.id[f])},n=function(f,h){return console.error("customIntegration ".concat(f,": ").concat(h))},r=0,a=Object.entries(e);r<a.length;r++){var s=Ar(a[r],1)[0];if(!("label"in e[s]))return n(s,"label is required"),!1;if(!("location"in e[s]))return n(s,"location is required"),!1;if(!("src"in e[s])&&!("srcdoc"in e[s]))return n(s,"src or srcdoc is required"),!1;for(var i=0,l=Object.entries(e[s]);i<l.length;i++){var c=Ar(l[i],2),u=c[0],d=c[1];switch(u){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof d!="string")return n(s,t(u)),!1;break;case"iconURL":if(!ub(d))return n(s,"".concat(u," should be a url")),!1;break;case"src":if("srcdoc"in e[s])return n(s,"cannot have both src and srcdoc"),!1;if(!ub(d))return n(s,'src "'.concat(d,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof d!="string")return n(s,t(u)),!1;break;case"location":if(!["main","sidebar"].includes(d))return n(s,t(u)),!1;break;case"controlledBy":if(d!=="*"&&d!=="owners"&&(!Array.isArray(d)||d.some(function(f){return typeof f!="string"})))return n(s,t(u)),!1;break;case"shared":if((!Array.isArray(d)||d.some(function(f){return typeof f!="string"}))&&d!=="owners"&&typeof d!="boolean")return n(s,t(u)),!1;break;default:if(!IC.id[u])return console.error("customIntegration does not support key ".concat(u)),!1}}}return!0}function L9(e,t){if(t===void 0)return!1;switch(St(t)){case"string":return St(e)===t;case"object":if(St(e)!=="object")return!1;for(var n in e)if(!L9(e[n],t[n]))return!1;return!0;default:return!1}}function eD(e,t){var n=e.sessionId,r=e.toEndPoint,a=e.callerId,s=e.useSipRefer;if(!n||!r)throw new Error("".concat(t,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(s&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(a&&typeof a!="string")throw new Error("callerId must be of type string");if(a&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function tD(e){if(St(e)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(AC).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(AC));if(e.volume){if(typeof e.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function nD(e,t,n){return!(typeof e!="number"||e<t||e>n)}function TS(e,t){return e&&!t&&delete e.data,e}const dhe=Object.freeze(Object.defineProperty({__proto__:null,DAILY_ACCESS_LEVEL_FULL:pV,DAILY_ACCESS_LEVEL_LOBBY:mfe,DAILY_ACCESS_LEVEL_NONE:pfe,DAILY_ACCESS_UNKNOWN:ux,DAILY_CAMERA_ERROR_CAM_AND_MIC_IN_USE:Cfe,DAILY_CAMERA_ERROR_CAM_IN_USE:Nfe,DAILY_CAMERA_ERROR_CONSTRAINTS:Pfe,DAILY_CAMERA_ERROR_MIC_IN_USE:_fe,DAILY_CAMERA_ERROR_NOT_FOUND:Afe,DAILY_CAMERA_ERROR_PERMISSIONS:kfe,DAILY_CAMERA_ERROR_UNDEF_MEDIADEVICES:Efe,DAILY_CAMERA_ERROR_UNKNOWN:Tfe,DAILY_EVENT_ACCESS_STATE_UPDATED:MV,DAILY_EVENT_ACTIVE_SPEAKER_CHANGE:n9,DAILY_EVENT_ACTIVE_SPEAKER_MODE_CHANGE:r9,DAILY_EVENT_APP_MSG:YV,DAILY_EVENT_CAMERA_ERROR:_V,DAILY_EVENT_CPU_LOAD_CHANGE:s9,DAILY_EVENT_ERROR:EC,DAILY_EVENT_EXIT_FULLSCREEN:Am,DAILY_EVENT_FACE_COUNTS_UPDATED:i9,DAILY_EVENT_FULLSCREEN:Em,DAILY_EVENT_IFRAME_LAUNCH_CONFIG:bV,DAILY_EVENT_IFRAME_READY_FOR_LAUNCH_CONFIG:xV,DAILY_EVENT_INPUT_SETTINGS_UPDATED:CC,DAILY_EVENT_JOINED_MEETING:kV,DAILY_EVENT_JOINING_MEETING:CV,DAILY_EVENT_LANG_UPDATED:f9,DAILY_EVENT_LEFT_MEETING:EV,DAILY_EVENT_LIVE_STREAMING_ERROR:d9,DAILY_EVENT_LIVE_STREAMING_STARTED:l9,DAILY_EVENT_LIVE_STREAMING_STOPPED:u9,DAILY_EVENT_LIVE_STREAMING_UPDATED:c9,DAILY_EVENT_LOADED:SC,DAILY_EVENT_LOADING:jV,DAILY_EVENT_LOAD_ATTEMPT_FAILED:SV,DAILY_EVENT_LOCAL_SCREEN_SHARE_CANCELED:t9,DAILY_EVENT_LOCAL_SCREEN_SHARE_STARTED:ZV,DAILY_EVENT_LOCAL_SCREEN_SHARE_STOPPED:e9,DAILY_EVENT_MEETING_SESSION_DATA_ERROR:Ofe,DAILY_EVENT_MEETING_SESSION_STATE_UPDATED:$V,DAILY_EVENT_MEETING_SESSION_SUMMARY_UPDATED:IV,DAILY_EVENT_NETWORK_CONNECTION:o9,DAILY_EVENT_NETWORK_QUALITY_CHANGE:a9,DAILY_EVENT_NONFATAL_ERROR:kC,DAILY_EVENT_PARTICIPANT_COUNTS_UPDATED:OV,DAILY_EVENT_PARTICIPANT_JOINED:AV,DAILY_EVENT_PARTICIPANT_LEFT:TV,DAILY_EVENT_PARTICIPANT_UPDATED:PV,DAILY_EVENT_RECEIVE_SETTINGS_UPDATED:h9,DAILY_EVENT_RECORDING_DATA:GV,DAILY_EVENT_RECORDING_ERROR:qV,DAILY_EVENT_RECORDING_STARTED:NC,DAILY_EVENT_RECORDING_STATS:WV,DAILY_EVENT_RECORDING_STOPPED:_C,DAILY_EVENT_RECORDING_UPLOAD_COMPLETED:HV,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STARTED:XV,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STOPPED:QV,DAILY_EVENT_REMOTE_MEDIA_PLAYER_UPDATED:JV,DAILY_EVENT_STARTED_CAMERA:NV,DAILY_EVENT_THEME_UPDATED:wV,DAILY_EVENT_TRACK_STARTED:FV,DAILY_EVENT_TRACK_STOPPED:BV,DAILY_EVENT_TRANSCRIPTION_ERROR:VV,DAILY_EVENT_TRANSCRIPTION_MSG:KV,DAILY_EVENT_TRANSCRIPTION_STARTED:zV,DAILY_EVENT_TRANSCRIPTION_STOPPED:UV,DAILY_EVENT_WAITING_PARTICIPANT_ADDED:DV,DAILY_EVENT_WAITING_PARTICIPANT_REMOVED:LV,DAILY_EVENT_WAITING_PARTICIPANT_UPDATED:RV,DAILY_FATAL_ERROR_CONNECTION:yV,DAILY_FATAL_ERROR_EJECTED:vfe,DAILY_FATAL_ERROR_EOL:vV,DAILY_FATAL_ERROR_EXP_ROOM:bfe,DAILY_FATAL_ERROR_EXP_TOKEN:wfe,DAILY_FATAL_ERROR_MEETING_FULL:jfe,DAILY_FATAL_ERROR_NBF_ROOM:yfe,DAILY_FATAL_ERROR_NBF_TOKEN:xfe,DAILY_FATAL_ERROR_NOT_ALLOWED:Sfe,DAILY_FATAL_ERROR_NO_ROOM:jC,DAILY_RECEIVE_SETTINGS_ALL_PARTICIPANTS_KEY:gfe,DAILY_RECEIVE_SETTINGS_BASE_KEY:gV,DAILY_STATE_ERROR:ni,DAILY_STATE_JOINED:gl,DAILY_STATE_JOINING:pb,DAILY_STATE_LEFT:ll,DAILY_STATE_NEW:wC,DAILY_TRACK_STATE_BLOCKED:cfe,DAILY_TRACK_STATE_INTERRUPTED:hfe,DAILY_TRACK_STATE_LOADING:ffe,DAILY_TRACK_STATE_OFF:ufe,DAILY_TRACK_STATE_PLAYABLE:mV,DAILY_TRACK_STATE_SENDABLE:dfe,default:lhe},Symbol.toStringTag,{value:"Module"})),fhe=AJ(dhe);var HA={exports:{}},Xd=typeof Reflect=="object"?Reflect:null,rD=Xd&&typeof Xd.apply=="function"?Xd.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},hx;Xd&&typeof Xd.ownKeys=="function"?hx=Xd.ownKeys:Object.getOwnPropertySymbols?hx=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:hx=function(t){return Object.getOwnPropertyNames(t)};function hhe(e){console&&console.warn&&console.warn(e)}var F9=Number.isNaN||function(t){return t!==t};function Bt(){Bt.init.call(this)}HA.exports=Bt;HA.exports.once=vhe;Bt.EventEmitter=Bt;Bt.prototype._events=void 0;Bt.prototype._eventsCount=0;Bt.prototype._maxListeners=void 0;var aD=10;function Uw(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Bt,"defaultMaxListeners",{enumerable:!0,get:function(){return aD},set:function(e){if(typeof e!="number"||e<0||F9(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");aD=e}});Bt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Bt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||F9(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function B9(e){return e._maxListeners===void 0?Bt.defaultMaxListeners:e._maxListeners}Bt.prototype.getMaxListeners=function(){return B9(this)};Bt.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var a=t==="error",s=this._events;if(s!==void 0)a=a&&s.error===void 0;else if(!a)return!1;if(a){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var l=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw l.context=i,l}var c=s[t];if(c===void 0)return!1;if(typeof c=="function")rD(c,this,n);else for(var u=c.length,d=q9(c,u),r=0;r<u;++r)rD(d[r],this,n);return!0};function z9(e,t,n,r){var a,s,i;if(Uw(n),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),i=s[t]),i===void 0)i=s[t]=n,++e._eventsCount;else if(typeof i=="function"?i=s[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),a=B9(e),a>0&&i.length>a&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,hhe(l)}return e}Bt.prototype.addListener=function(t,n){return z9(this,t,n,!1)};Bt.prototype.on=Bt.prototype.addListener;Bt.prototype.prependListener=function(t,n){return z9(this,t,n,!0)};function mhe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function U9(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=mhe.bind(r);return a.listener=n,r.wrapFn=a,a}Bt.prototype.once=function(t,n){return Uw(n),this.on(t,U9(this,t,n)),this};Bt.prototype.prependOnceListener=function(t,n){return Uw(n),this.prependListener(t,U9(this,t,n)),this};Bt.prototype.removeListener=function(t,n){var r,a,s,i,l;if(Uw(n),a=this._events,a===void 0)return this;if(r=a[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit
845("removeListener",t,r.listener||n));else if(typeof r!="function"){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){l=r[i].listener,s=i;break}if(s<0)return this;s===0?r.shift():phe(r,s),r.length===1&&(a[t]=r[0]),a.removeListener!==void 0&&this.emit("removeListener",t,l||n)}return this};Bt.prototype.off=Bt.prototype.removeListener;Bt.prototype.removeAllListeners=function(t){var n,r,a;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var s=Object.keys(r),i;for(a=0;a<s.length;++a)i=s[a],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(a=n.length-1;a>=0;a--)this.removeListener(t,n[a]);return this};function V9(e,t,n){var r=e._events;if(r===void 0)return[];var a=r[t];return a===void 0?[]:typeof a=="function"?n?[a.listener||a]:[a]:n?ghe(a):q9(a,a.length)}Bt.prototype.listeners=function(t){return V9(this,t,!0)};Bt.prototype.rawListeners=function(t){return V9(this,t,!1)};Bt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):W9.call(e,t)};Bt.prototype.listenerCount=W9;function W9(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Bt.prototype.eventNames=function(){return this._eventsCount>0?hx(this._events):[]};function q9(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function phe(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ghe(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function vhe(e,t){return new Promise(function(n,r){function a(i){e.removeListener(t,s),r(i)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",a),n([].slice.call(arguments))}H9(e,t,s,{once:!0}),t!=="error"&&yhe(e,a,{once:!0})})}function yhe(e,t,n){typeof e.on=="function"&&H9(e,"error",t,n)}function H9(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function a(s){r.once&&e.removeEventListener(t,a),n(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var xhe=HA.exports,Vw={},Ll={};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.Api=Ll.HttpClient=Ll.ContentType=void 0;var _e;(function(e){e.Json="application/json",e.JsonApi="application/vnd.api+json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain"})(_e||(Ll.ContentType=_e={}));class G9{constructor(t={}){Xe(this,"baseUrl","https://api.vapi.ai");Xe(this,"securityData",null);Xe(this,"securityWorker");Xe(this,"abortControllers",new Map);Xe(this,"customFetch",(...t)=>fetch(...t));Xe(this,"baseApiParams",{credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"});Xe(this,"setSecurityData",t=>{this.securityData=t});Xe(this,"contentFormatters",{[_e.Json]:t=>t!==null&&(typeof t=="object"||typeof t=="string")?JSON.stringify(t):t,[_e.JsonApi]:t=>t!==null&&(typeof t=="object"||typeof t=="string")?JSON.stringify(t):t,[_e.Text]:t=>t!==null&&typeof t!="string"?JSON.stringify(t):t,[_e.FormData]:t=>t instanceof FormData?t:Object.keys(t||{}).reduce((n,r)=>{const a=t[r];return n.append(r,a instanceof Blob?a:typeof a=="object"&&a!==null?JSON.stringify(a):`${a}`),n},new FormData),[_e.UrlEncoded]:t=>this.toQueryString(t)});Xe(this,"createAbortSignal",t=>{if(this.abortControllers.has(t)){const r=this.abortControllers.get(t);return r?r.signal:void 0}const n=new AbortController;return this.abortControllers.set(t,n),n.signal});Xe(this,"abortRequest",t=>{const n=this.abortControllers.get(t);n&&(n.abort(),this.abortControllers.delete(t))});Xe(this,"request",async({body:t,secure:n,path:r,type:a,query:s,format:i,baseUrl:l,cancelToken:c,...u})=>{const d=(typeof n=="boolean"?n:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{}
845,f=this.mergeRequestParams(u,d),h=s&&this.toQueryString(s),m=this.contentFormatters[a||_e.Json],v=i||f.format;return this.customFetch(`${l||this.baseUrl||""}${r}${h?`?${h}`:""}`,{...f,headers:{...f.headers||{},...a&&a!==_e.FormData?{"Content-Type":a}:{}},signal:(c?this.createAbortSignal(c):f.signal)||null,body:typeof t>"u"||t===null?null:m(t)}).then(async g=>{const y=g;y.data=null,y.error=null;const x=v?g.clone():g,b=v?await x[v]().then(w=>(y.ok?y.data=w:y.error=w,y)).catch(w=>(y.error=w,y)):y;if(c&&this.abortControllers.delete(c),!g.ok)throw b;return b})});Object.assign(this,t)}encodeQueryParam(t,n){return`${encodeURIComponent(t)}=${encodeURIComponent(typeof n=="number"?n:`${n}`)}`}addQueryParam(t,n){return this.encodeQueryParam(n,t[n])}addArrayQueryParam(t,n){return t[n].map(a=>this.encodeQueryParam(n,a)).join("&")}toQueryString(t){const n=t||{};return Object.keys(n).filter(a=>typeof n[a]<"u").map(a=>Array.isArray(n[a])?this.addArrayQueryParam(n,a):this.addQueryParam(n,a)).join("&")}addQueryParams(t){const n=this.toQueryString(t);return n?`?${n}`:""}
845mergeRequestParams(t,n){return{...this.baseApiParams,...t,...n||{},headers:{...this.baseApiParams.headers||{},...t.headers||{},...n&&n.headers||{}}}}}Ll.HttpClient=G9;class bhe extends G9{constructor(){super(...arguments);Xe(this,"assistant",{assistantControllerCreate:(n,r={})=>this.request({path:"/assistant",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),assistantControllerFindAll:(n,r={})=>this.request({path:"/assistant",method:"GET",query:n,secure:!0,format:"json",...r}),assistantControllerFindOne:(n,r={})=>this.request({path:`/assistant/${n}`,method:"GET",secure:!0,format:"json",...r}),assistantControllerUpdate:(n,r,a={})=>this.request({path:`/assistant/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),assistantControllerReplace:(n,r,a={})=>this.request({path:`/assistant/${n}`,method:"PUT",body:r,secure:!0,type:_e.Json,format:"json",...a}),assistantControllerRemove:(n,r={})=>this.request({path:`/assistant/${n}`,method:"DELETE",secure:!0,format:"json",...r}),assistantControllerFindVersions:(n,r,a={})=>this.request({path:`/assistant/${n}/version`,method:"GET",query:r,secure:!0,format:"json",...a})});Xe(this,"v2",{assistantControllerFindAllPaginated:(n,r={})=>this.request({path:"/v2/assistant",method:"GET",query:n,secure:!0,format:"json",...r}),callControllerCallsExport:(n,r={})=>this.request({path:"/v2/call/export",method:"GET",query:n,secure:!0,...r}),callControllerFindAllPaginated:(n,r={})=>this.request({path:"/v2/call",method:"GET",query:n,secure:!0,format:"json",...r}),callControllerFindAllMetadataPaginated:(n,r={})=>this.request({path:"/v2/call/metadata",method:"GET",query:n,secure:!0,format:"json",...r}),phoneNumberControllerFindAllPaginated:(n,r={})=>this.request({path:"/v2/phone-number",method:"GET",query:n,secure:!0,format:"json",...r})});Xe(this,"squad",{squadControllerCreate:(n,r={})=>this.request({path:"/squad",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),squadControllerFindAll:(n,r={})=>this.request({path:"/squad",method:"GET",query:n,secure:!0,format:"json",...r}),squadControllerFindOne:(n,r={})=>this.request({path:`/squad/${n}`,method:"GET",secure:!0,format:"json",...r}),squadControllerUpdate:(n,r,a={})=>this.request({path:`/squad/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),squadControllerRemove:(n,r={})=>this.request({path:`/squad/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"workflow",{workflowControllerFindAll:(n={})=>this.request({path:"/workflow",method:"GET",secure:!0,format:"json",...n}),workflowControllerCreate:(n,r={})=>this.request({path:"/workflow",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),workflowControllerFindOne:(n,r={})=>this.request({path:`/workflow/${n}`,method:"GET",secure:!0,format:"json",...r}),workflowControllerDelete:(n,r={})=>this.request({path:`/workflow/${n}`,method:"DELETE",secure:!0,format:"json",...r}),workflowControllerUpdate:(n,r,a={})=>this.request({path:`/workflow/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a})});Xe(this,"call",{callControllerCreate:(n,r={})=>this.request({path:"/call",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),callControllerFindAll:(n,r={})=>this.request({path:"/call",method:"GET",query:n,secure:!0,format:"json",...r}),callControllerFindOne:(n,r={})=>this.request({path:`/call/${n}`,method:"GET",secure:!0,format:"json",...r}),callControllerUpdate:(n,r,a={})=>this.request({path:`/call/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),callControllerDeleteCallData:(n,r,a={})=>this.request({path:`/call/${n}`,method:"DELETE",body:r,secure:!0,type:_e.Json,format:"json",...a}),callControllerCreatePhoneCall:(n,r={})=>this.request({path:"/call/phone",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),callControllerCreateWebCall:(n,r={})=>this.request({path:"/call/web",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})});Xe(this,"chat",{chatControllerListChats:(n,r={})=>this.request({path:"/chat",method:"GET",query:n,secure:!0,format:"json",...r}),chatControllerCreateChat:(n,r={})=>this.request({path:"/chat",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),chatControllerGetChat:(n,r={})=>this.request({path:`/chat/${n}`,method:"GET",secure:!0,format:"json",...r}),chatControllerDeleteChat:(n,r={})=>this.request({path:`/chat/${n}`,method:"DELETE",secure:!0,format:"json",...r}),chatControllerCreateOpenAiChat:(n,r={})=>this.request({path:"/chat/responses",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),chatControllerCreateWebChat:(n,r={})=>this.request({path:"/chat/web",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),chatControllerCreateOpenAiWebChat:(n,r={})=>this.request({path:"/chat/web/responses",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})});Xe(this,"campaign",{campaignControllerCreate:(n,r={})=>this.request({path:"/campaign",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),campaignControllerFindAll:(n,r={})=>this.request({path:"/campaign",method:"GET",query:n,secure:!0,format:"json",...r}),campaignControllerFindOne:(n,r={})=>this.request({path:`/campaign/${n}`,method:"GET",secure:!0,format:"json",...r}),campaignControllerUpdate:(n,r,a={})=>this.request({path:`/campaign/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),campaignControllerRemove:(n,r={})=>this.request({path:`/campaign/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"session",{sessionControllerCreate:(n,r={})=>this.request({path:"/session",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),sessionControllerFindAllPaginated:(n,r={})=>this.request({path:"/session",method:"GET",query:n,secure:!0,format:"json",...r}),sessionControllerFindOne:(n,r={})=>this.request({path:`/session/${n}`,method:"GET",secure:!0,format:"json",...r}),sessionControllerUpdate:(n,r,a={})=>this.request({path:`/session/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),sessionControllerRemove:(n,r={})=>this.request({path:`/session/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"phoneNumber",{phoneNumberControllerImportTwilio:(n,r={})=>this.request({path:"/phone-number/import/twilio",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),phoneNumberControllerImportVonage:(n,r={})=>this.request({path:"/phone-number/import/vonage",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),phoneNumberControllerCreate:(n,r={})=>this.request({path:"/phone-number",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),phoneNumberControllerFindAll:(n,r={})=>this.request({path:"/phone-number",method:"GET",query:n,secure:!0,format:"json",...r}),phoneNumberControllerFindOne:(n,r={})=>this.request({path:`/phone-number/${n}`,method:"GET",secure:!0,format:"json",...r}),phoneNumberControllerUpdate:(n,r,a={})=>this.request({path:`/phone-number/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),phoneNumberControllerRemove:(n,r={})=>this.request({path:`/phone-number/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"tool",{toolControllerCreate:(n,r={})=>this.request({path:"/tool",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),toolControllerFindAll:(n,r={})=>this.request({path:"/tool",method:"GET",query:n,secure:!0,format:"json",...r}),toolControllerFindOne:(n,r={})=>this.request({path:`/tool/${n}`,method:"GET",secure:!0,format:"json",...r}),toolControllerUpdate:(n,r,a={})=>this.request({path:`/tool/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),toolControllerRemove:(n,r={})=>this.request({path:`/tool/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"file",{fileControllerCreateDeprecated:(n,r={})=>this.request({path:"/file/upload",method:"POST",body:n,secure:!0,type:_e.FormData,format:"json",...r}),fileControllerCreate:(n,r={})=>this.request({path:"/file",method:"POST",body:n,secure:!0,type:_e.FormData,format:"json",...r}),fileControllerFindAll:(n={})=>this.request({path:"/file",method:"GET",secure:!0,format:"json",...n}),fileControllerFindOne:(n,r={})=>this.request({path:`/file/${n}`,method:"GET",secure:!0,format:"json",...r}),fileControllerUpdate:(n,r,a={})=>this.request({path:`/file/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),fileControllerRemove:(n,r={})=>this.request({path:`/file/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"knowledgeBase",{knowledgeBaseControllerCreate:(n,r={})=>this.request({path:"/knowledge-base",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),knowledgeBaseControllerFindAll:(n,r={})=>this.request({path:"/knowledge-base",method:"GET",query:n,secure:!0,format:"json",...r}),knowledgeBaseControllerFindOne:(n,r={})=>this.request({path:`/knowledge-base/${n}`,method:"GET",secure:!0,format:"json",...r}),knowledgeBaseControllerUpdate:(n,r,a={})=>this.request({path:`/knowledge-base/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),knowledgeBaseControllerRemove:(n,r={})=>this.request({path:`/knowledge-base/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"structuredOutput",{structuredOutputControllerFindAll:(n,r={})=>this.request({path:"/structured-output",method:"GET",query:n,secure:!0,format:"json",...r}),structuredOutputControllerCreate:(n,r={})=>this.request({path:"/structured-output",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),structuredOutputControllerFindOne:(n,r={})=>this.request({path:`/structured-output/${n}`,method:"GET",secure:!0,format:"json",...r}),structuredOutputControllerUpdate:(n,r,a,s={})=>this.request({path:`/structured-output/${n}`,method:"PATCH",query:r,body:a,secure:!0,type:_e.Json,format:"json",...s}),structuredOutputControllerRemove:(n,r={})=>this.request({path:`/structured-output/${n}`,method:"DELETE",secure:!0,format:"json",...r}),structuredOutputControllerRun:(n,r={})=>this.request({path:"/structured-output/run",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})});Xe(this,"testSuite",{testSuiteControllerFindAllPaginated:(n,r={})=>this.request({path:"/test-suite",method:"GET",query:n,secure:!0,format:"json",...r}),testSuiteControllerCreate:(n,r={})=>this.request({path:"/test-suite",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),testSuiteControllerFindOne:(n,r={})=>this.request({path:`/test-suite/${n}`,method:"GET",secure:!0,format:"json",...r}),testSuiteControllerUpdate:(n,r,a={})=>this.request({path:`/test-suite/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),testSuiteControllerRemove:(n,r={})=>this.request({path:`/test-suite/${n}`,method:"DELETE",secure:!0,format:"json",...r}),testSuiteTestControllerFindAllPaginated:(n,r,a={})=>this.request({path:`/test-suite/${n}/test`,method:"GET",query:r,secure:!0,format:"json",...a}),testSuiteTestControllerCreate:(n,r,a={})=>this.request({path:`/test-suite/${n}/test`,method:"POST",body:r,secure:!0,type:_e.Json,format:"json",...a}),testSuiteTestControllerFindOne:(n,r,a={})=>this.request({path:`/test-suite/${n}/test/${r}`,method:"GET",secure:!0,format:"json",...a}),testSuiteTestControllerUpdate:(n,r,a,s={})=>this.request({path:`/test-suite/${n}/test/${r}`,method:"PATCH",body:a,secure:!0,type:_e.Json,format:"json",...s}),testSuiteTestControllerRemove:(n,r,a={})=>this.request({path:`/test-suite/${n}/test/${r}`,method:"DELETE",secure:!0,format:"json",...a}),testSuiteRunControllerFindAllPaginated:(n,r,a={})=>this.request({path:`/test-suite/${n}/run`,method:"GET",query:r,secure:!0,format:"json",...a}),testSuiteRunControllerCreate:(n,r,a={})=>this.request({path:`/test-suite/${n}/run`,method:"POST",body:r,secure:!0,type:_e.Json,format:"json",...a}),testSuiteRunControllerFindOne:(n,r,a={})=>this.request({path:`/test-suite/${n}/run/${r}`,method:"GET",secure:!0,format:"json",...a}),testSuiteRunControllerUpdate:(n,r,a,s={})=>this.request({path:`/test-suite/${n}/run/${r}`,method:"PATCH",body:a,secure:!0,type:_e.Json,format:"json",...s}),testSuiteRunControllerRemove:(n,r,a={})=>this.request({path:`/test-suite/${n}/run/${r}`,method:"DELETE",secure:!0,format:"json",...a})});Xe(this,"reporting",{insightControllerCreate:(n,r={})=>this.request({path:"/reporting/insight",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),insightControllerFindAll:(n,r={})=>this.request({path:"/reporting/insight",method:"GET",query:n,secure:!0,format:"json",...r}),insightControllerUpdate:(n,r,a={})=>this.request({path:`/reporting/insight/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),insightControllerFindOne:(n,r={})=>this.request({path:`/reporting/insight/${n}`,method:"GET",secure:!0,format:"json",...r}),insightControllerRemove:(n,r={})=>this.request({path:`/reporting/insight/${n}`,method:"DELETE",secure:!0,format:"json",...r}),insightControllerRun:(n,r,a={})=>this.request({path:`/reporting/insight/${n}/run`,method:"POST",body:r,secure:!0,type:_e.Json,format:"json",...a}),insightControllerPreview:(n,r={})=>this.request({path:"/reporting/insight/preview",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})});Xe(this,"eval",{evalControllerCreate:(n,r={})=>this.request({path:"/eval",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),evalControllerGetPaginated:(n,r={})=>this.request({path:"/eval",method:"GET",query:n,secure:!0,format:"json",...r}),evalControllerUpdate:(n,r,a={})=>this.request({path:`/eval/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),evalControllerRemove:(n,r={})=>this.request({path:`/eval/${n}`,method:"DELETE",secure:!0,format:"json",...r}),evalControllerGet:(n,r={})=>this.request({path:`/eval/${n}`,method:"GET",secure:!0,format:"json",...r}),evalControllerRemoveRun:(n,r={})=>this.request({path:`/eval/run/${n}`,method:"DELETE",secure:!0,format:"json",...r}),evalControllerGetRun:(n,r={})=>this.request({path:`/eval/run/${n}`,method:"GET",secure:!0,format:"json",...r}),evalControllerRun:(n,r={})=>this.request({path:"/eval/run",method:"POST",body:n,secure:!0,type:_e.Json,...r}),evalControllerGetRunsPaginated:(n,r={})=>this.request({path:"/eval/run",method:"GET",query:n,secure:!0,format:"json",...r})});Xe(this,"observability",{scorecardControllerGet:(n,r={})=>this.request({path:`/observability/scorecard/${n}`,method:"GET",secure:!0,format:"json",...r}),scorecardControllerUpdate:(n,r,a={})=>this.request({path:`/observability/scorecard/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),scorecardControllerRemove:(n,r={})=>this.request({path:`/observability/scorecard/${n}`,method:"DELETE",secure:!0,format:"json",...r}),scorecardControllerGetPaginated:(n,r={})=>this.request({path:"/observability/scorecard",method:"GET",query:n,secure:!0,format:"json",...r}),scorecardControllerCreate:(n,r={})=>this.request({path:"/observability/scorecard",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})});Xe(this,"org",{orgControllerCreate:(n,r={})=>this.request({path:"/org",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),orgControllerFindAll:(n={})=>this.request({path:"/org",method:"GET",secure:!0,format:"json",...n}),orgControllerFeatureFlagEnabled:(n,r={})=>this.request({path:"/org/feature-flag",method:"GET",query:n,secure:!0,format:"json",...r}),orgControllerFindOne:(n,r={})=>this.request({path:`/org/${n}`,method:"GET",secure:!0,format:"json",...r}),orgControllerUpdate:(n,r,a={})=>this.request({path:`/org/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),orgControllerDeleteOrg:(n,r={})=>this.request({path:`/org/${n}`,method:"DELETE",secure:!0,...r}),orgControllerFindAllUsers:(n,r={})=>this.request({path:`/org/${n}/user`,method:"GET",secure:!0,format:"json",...r}),orgControllerOrgLeave:(n,r={})=>this.request({path:`/org/${n}/leave`,method:"DELETE",secure:!0,...r}),orgControllerOrgRemoveUser:(n,r,a={})=>this.request({path:`/org/${n}/member/${r}/leave`,method:"DELETE",secure:!0,...a}),orgControllerUsersInvite:(n,r,a={})=>this.request({path:`/org/${n}/invite`,method:"POST",body:r,secure:!0,type:_e.Json,...a}),orgControllerUserUpdate:(n,r,a={})=>this.request({path:`/org/${n}/role`,method:"PATCH",body:r,secure:!0,type:_e.Json,...a}),orgControllerOrgToken:(n,r={})=>this.request({path:`/org/${n}/auth`,method:"GET",secure:!0,format:"
845json",...r})});Xe(this,"token",{tokenControllerCreate:(n,r={})=>this.request({path:"/token",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),tokenControllerFindAll:(n,r={})=>this.request({path:"/token",method:"GET",query:n,secure:!0,format:"json",...r}),tokenControllerFindOne:(n,r={})=>this.request({path:`/token/${n}`,method:"GET",secure:!0,format:"json",...r}),tokenControllerUpdate:(n,r,a={})=>this.request({path:`/token/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),tokenControllerRemove:(n,r={})=>this.request({path:`/token/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"credential",{credentialControllerCreate:(n,r={})=>this.request({path:"/credential",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),credentialControllerFindAll:(n,r={})=>this.request({path:"/credential",method:"GET",query:n,secure:!0,format:"json",...r}),credentialControllerFindOne:(n,r={})=>this.request({path:`/credential/${n}`,method:"GET",secure:!0,format:"json",...r}),credentialControllerUpdate:(n,r,a={})=>this.request({path:`/credential/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),credentialControllerRemove:(n,r={})=>this.request({path:`/credential/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"template",{templateControllerCreate:(n,r={})=>this.request({path:"/template",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),templateControllerFindAll:(n,r={})=>this.request({path:"/template",method:"GET",query:n,secure:!0,format:"json",...r}),templateControllerFindAllPinned:(n={})=>this.request({path:"/template/pinned",method:"GET",secure:!0,format:"json",...n}),templateControllerFindOne:(n,r={})=>this.request({path:`/template/${n}`,method:"GET",secure:!0,format:"json",...r}),templateControllerUpdate:(n,r,a={})=>this.request({path:`/template/${n}`,method:"PATCH",body:r,secure:!0,type:_e.Json,format:"json",...a}),templateControllerRemove:(n,r={})=>this.request({path:`/template/${n}`,method:"DELETE",secure:!0,format:"json",...r})});Xe(this,"voiceLibrary",{voiceLibraryControllerVoiceGetByProvider:(n,r,a={})=>this.request({path:`/voice-library/${n}`,method:"GET",query:r,secure:!0,format:"json",...a}),voiceLibraryControllerVoiceGetAccentsByProvider:(n,r={})=>this.request({path:`/voice-library/${n}/accents`,method:"GET",secure:!0,format:"json",...r}),voiceLibraryControllerVoiceLibrarySyncByProvider:(n,r={})=>this.request({path:`/voice-library/sync/${n}`,method:"POST",secure:!0,format:"json",...r}),voiceLibraryControllerVoiceLibrarySyncDefaultVoices:(n,r={})=>this.request({path:"/voice-library/sync",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r}),voiceLibraryControllerVoiceLibraryCreateSesameVoice:(n,r={})=>this.request({path:"/voice-library/create-sesame-voice",method:"POST",body:n,secure:!0,type:_e.Json,...r})});Xe(this,"provider",{providerResourceControllerCreateProviderResource:(n,r,a={})=>this.request({path:`/provider/${n}/${r}`,method:"POST",secure:!0,format:"json",...a}),providerResourceControllerGetProviderResourcesPaginated:(n,r,a,s={})=>this.request({path:`/provider/${n}/${r}`,method:"GET",query:a,secure:!0,format:"json",...s}),providerResourceControllerGetProviderResource:(n,r,a,s={})=>this.request({path:`/provider/${n}/${r}/${a}`,method:"GET",secure:!0,format:"json",...s}),providerResourceControllerDeleteProviderResource:(n,r,a,s={})=>this.request({path:`/provider/${n}/${r}/${a}`,method:"DELETE",secure:!0,format:"json",...s}),providerResourceControllerUpdateProviderResource:(n,r,a,s={})=>this.request({path:`/provider/${n}/${r}/${a}`,method:"PATCH",secure:!0,format:"json",...s}),providerControllerGetWorkflows:(n,r,a={})=>this.request({path:`/${n}/workflows`,method:"GET",query:r,secure:!0,format:"json",...a}),providerControllerGetWorkflowTriggerHook:(n,r,a={})=>this.request({path:`/${n}/workflows/${r}/hooks`,method:"GET",secure:!0,format:"json",...a}),providerControllerGetLocations:(n,r={})=>this.request({path:`/${n}/locations`,method:"GET",secure:!0,format:"json",...r}),voiceProviderControllerSearchVoices:(n,r,a={})=>this.request({path:`/${n}/voices/search`,method:"GET",query:r,secure:!0,format:"json",...a}),voiceProviderControllerSearchVoice:(n,r,a={})=>this.request({path:`/${n}/voice/search`,method:"GET",query:r,secure:!0,format:"json",...a}),voiceProviderControllerAddVoices:(n,r,a={})=>this.request({path:`/${n}/voices/add`,method:"POST",body:r,secure:!0,type:_e.Json,format:"json",...a}),voiceProviderControllerAddVoice:(n,r,a={})=>this.request({path:`/${n}/voice/add`,method:"POST",body:r,secure:!0,type:_e.Json,format:"json",...a})});Xe(this,"v11Labs",{voiceProviderControllerCloneVoices:(n,r={})=>this.request({path:"/11labs/voice/clone",method:"POST",body:n,secure:!0,type:_e.FormData,...r})});Xe(this,"analytics",{analyticsControllerQuery:(n,r={})=>this.request({path:"/analytics",method:"POST",body:n,secure:!0,type:_e.Json,format:"json",...r})})}}Ll.Api=bhe;Object.defineProperty(Vw,"__esModule",{value:!0});Vw.client=void 0;const whe=Ll,jhe=new whe.Api({baseUrl:"https://api.vapi.ai",baseApiParams:{secure:!0},securityWorker:async e=>{if(e)return{headers:{Authorization:`Bearer ${e}`}}}});Vw.client=jhe;var wh={};Object.defineProperty(wh,"__esModule",{value:!0});wh.createSafeDailyConfig=She;wh.safeSetLocalAudio=Nhe;wh.safeSetInputDevicesAsync=_he;wh.createSafeDailyFactoryOptions=Che;function She(e){if(!e)return{};const{alwaysIncludeMicInPermissionPrompt:t,...n}=e;return t===!1?(console.warn("[Vapi] alwaysIncludeMicInPermissionPrompt:false detected. This can cause Chrome 140+ issues. Removing the property."),n):e}function Nhe(e,t){if(!e)throw new Error("Call object is not available.");e.setLocalAudio(t)}async function _he(e,t){if(!e)throw new Error("Call object is not available.");if("audioSource"in t&&t.audioSource===!1){console.warn("[Vapi] setInputDevicesAsync with audioSource:false detected. This can cause Chrome 140+ issues. Using default device instead.");const{audioSource:n,...r}=t;await e.setInputDevicesAsync(r);return}await e.setInputDevicesAsync(t)}function Che(e){return e?e.audioSource===!1?(console.warn("[Vapi] audioSource:false detected in factory options. This can cause Chrome 140+ issues. Defaulting to true."),{...e,audioSource:!0}):e:{}}
845var Y9=xd&&xd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(KU,"__esModule",{value:!0});const OS=Y9(fhe),khe=Y9(xhe),MS=Vw,Sc=wh;function $r(e){if(e==null)return{message:"Unknown error (null or undefined)"};if(e instanceof Error){const t={message:e.message,name:e.name,stack:e.stack},n=e;return n.code!==void 0&&(t.code=n.code),n.cause!==void 0&&(t.cause=String(n.cause)),n.reason!==void 0&&(t.reason=n.reason),n.details!==void 0&&(t.details=n.details),n.errorMsg!==void 0&&(t.errorMsg=n.errorMsg),n.error!==void 0&&typeof n.error=="string"&&(t.errorDetail=n.error),t}if(typeof e=="string")return{message:e};if(typeof e=="object"){const t=e;return{message:t.message||t.error||JSON.stringify(e),...t}}return{message:String(e)}}async function Ehe(e,t){e.muted=!1,e.autoplay=!0,t!=null&&(e.srcObject=new MediaStream([t]),await e.play())}async function oD(e,t){const n=document.createElement("audio");return n.dataset.participantId=t,document.body.appendChild(n),await Ehe(n,e),n}function sD(e){const t=document.querySelector(`audio[data-participant-id="${e}"]`);t==null||t.remove()}function iD(e,t,n,r){e.participant.local||t.updateParticipant(e.participant.session_id,{setSubscribedTracks:{audio:!0,video:n||r}})}class Ahe extends khe.default{on(t,n){return super.on(t,n),this}once(t,n){return super.once(t,n),this}emit(t,...n){return super.emit(t,...n)}removeListener(t,n){return super.removeListener(t,n),this}removeAllListeners(t){return super.removeAllListeners(t),this}}class Phe extends Ahe{constructor(n,r,a,s){super();Xe(this,"started",!1);Xe(this,"call",null);Xe(this,"speakingTimeout",null);Xe(this,"dailyCallConfig",{});Xe(this,"dailyCallObject",{});Xe(this,"hasEmittedCallEndedStatus",!1);MS.client.baseUrl=r??"https://api.vapi.ai",MS.client.setSecurityData(n),this.dailyCallConfig=(0,Sc.createSafeDailyConfig)(a),this.dailyCallObject=(0,Sc.createSafeDailyFactoryOptions)(s)}async cleanup(){this.started=!1,this.hasEmittedCallEndedStatus=!1,this.call&&(await this.call.destroy(),this.call=null),this.speakingTimeout=null}isMobileDevice(){if(typeof navigator>"u")return!1;const n=navigator.userAgent;return/android|iphone|ipad|ipod|iemobile|blackberry|bada/i.test(n.toLowerCase())}async sleep(n){return new Promise(r=>setTimeout(r,n))}async start(n,r,a,s,i,l){var u,d,f,h,m,v,g;const c=Date.now();if(!n&&!a&&!s){const y=new Error("Assistant or Squad or Workflow must be provided.");throw this.emit("error",{type:"validation-error",stage:"input-validation",error:$r(y),timestamp:new Date().toISOString()}),y}if(this.started)return this.emit("call-start-progress",{stage:"validation",status:"failed",timestamp:new Date().toISOString(),metadata:{reason:"already-started"}}),null;this.emit("call-start-progress",{stage:"initialization",status:"started",timestamp:new Date().toISOString(),metadata:{hasAssistant:!!n,hasSquad:!!a,hasWorkflow:!!s}}),this.started=!0;try{this.emit("call-start-progress",{stage:"web-call-creation",status:"started",timestamp:new Date().toISOString()});const y=Date.now(),x=(await MS.client.call.callControllerCreateWebCall({assistant:typeof n=="string"?void 0:n,assistantId:typeof n=="string"?n:void 0,assistantOverrides:r,squad:typeof a=="string"?void 0:a,squadId:typeof a=="string"?a:void 0,workflow:typeof s=="string"?void 0:s,workflowId:typeof s=="string"?s:void 0,workflowOverrides:i,roomDeleteOnUserLeaveEnabled:l==null?void 0:l.roomDeleteOnUserLeaveEnabled})).data,b=Date.now()-y;this.emit("call-start-progress",{stage:"web-call-creation",status:"completed",duration:b,timestamp:new Date().toISOString(),metadata:{callId:(x==null?void 0:x.id)||"unknown",videoRecordingEnabled:((u=x==null?void 0:x.artifactPlan)==null?void 0:u.videoRecordingEnabled)??!1,voiceProvider:((f=(d=x==null?void 0:x.assistant)==null?void 0:d.voice)==null?void 0:f.provider)||"unknown"}}
845),this.call&&(this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{action:"cleanup-existing"}}),await this.cleanup());const w=((h=x==null?void 0:x.artifactPlan)==null?void 0:h.videoRecordingEnabled)??!1,N=((v=(m=x==null?void 0:x.assistant)==null?void 0:m.voice)==null?void 0:v.provider)==="tavus";this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??w,isVideoRecordingEnabled:w,isVideoEnabled:N}});const S=Date.now();try{this.call=OS.default.createCallObject({audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??w,dailyConfig:this.dailyCallConfig});const T=Date.now()-S;this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-S,U=$r(T);throw this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}}),this.emit("error",{type:"daily-call-object-creation-error",stage:"daily-call-object-creation",error:U,timestamp:new Date().toISOString()}),T}(g=this.call.iframe())==null||g.style.setProperty("display","none"),this.call.on("left-meeting",()=>{var T;this.emit("call-end"),this.hasEmittedCallEndedStatus||(this.emit("message",{type:"status-update",status:"ended",endedReason:"customer-ended-call"}),this.hasEmittedCallEndedStatus=!0),w&&((T=this.call)==null||T.stopRecording()),this.cleanup().catch(console.error)}),this.call.on("error",T=>{var z;this.emit("error",{type:"daily-error",error:$r(T),timestamp:new Date().toISOString()}),w&&((z=this.call)==null||z.stopRecording())}),this.call.on("camera-error",T=>{this.emit("camera-error",{type:"camera-error",error:$r(T),timestamp:new Date().toISOString()})}),this.call.on("network-quality-change",T=>{this.emit("network-quality-change",T)}),this.call.on("network-connection",T=>{this.emit("network-connection",T)}),this.call.on("track-started",async T=>{var z,U,E;!T||!T.participant||(z=T.participant)!=null&&z.local||((U=T.participant)==null?void 0:U.user_name)==="Vapi Speaker"&&(T.track.kind==="video"&&this.emit("video",T.track),T.track.kind==="audio"&&await oD(T.track,T.participant.session_id),(E=this.call)==null||E.sendAppMessage("playable"))}),this.call.on("participant-joined",T=>{!T||!this.call||iD(T,this.call,w,N)}),this.call.on("participant-updated",T=>{T&&this.emit("daily-participant-updated",T.participant)}),this.call.on("participant-left",T=>{T&&sD(T.participant.session_id)});const _=this.isMobileDevice();if(this.emit("call-start-progress",{stage:"mobile-permissions",status:"started",timestamp:new Date().toISOString(),metadata:{isMobile:_}}),_){const T=Date.now();await this.sleep(1e3);const z=Date.now()-T;this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",duration:z,timestamp:new Date().toISOString(),metadata:{action:"permissions-wait"}})}else this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-mobile"}});this.emit("call-start-progress",{stage:"daily-call-join",status:"started",timestamp:new Date().toISOString()});const k=Date.now();try{await this.call.join({url:x.webCallUrl,subscribeToTracksAutomatically:!1});const T=Date.now()-k;this.emit("call-start-progress",{stage:"daily-call-join",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-k,U=$r(T);throw this.emit("call-start-progress",{stage:"daily-call-join",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}}),this.emit("error",{type:"daily-call-join-error",stage:"daily-call-join",error:U,duration:z,timestamp:new Date().toISOString()}),T}if(w){this.emit("call-start-progress",{stage:"video-recording-setup",status:"started",timestamp:new Date().toISOString()});const T=new Date().getTime(),z=Date.now();try{this.call.startRecording({width:1280,height:720,backgroundColor:"#FF1F2D3D",layout:{preset:"default"}});const U=Date.now()-z;
845this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",duration:U,timestamp:new Date().toISOString()}),this.call.on("recording-started",()=>{const E=(new Date().getTime()-T)/1e3;this.emit("call-start-progress",{stage:"video-recording-started",status:"completed",timestamp:new Date().toISOString(),metadata:{delaySeconds:E}}),this.send({type:"control",control:"say-first-message",videoRecordingStartDelaySeconds:E})})}catch(U){const E=Date.now()-z,q=$r(U);this.emit("call-start-progress",{stage:"video-recording-setup",status:"failed",duration:E,timestamp:new Date().toISOString(),metadata:{error:q.message}}),this.emit("error",{type:"video-recording-setup-error",stage:"video-recording-setup",error:q,timestamp:new Date().toISOString()})}}else this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-enabled"}});this.emit("call-start-progress",{stage:"audio-observer-setup",status:"started",timestamp:new Date().toISOString()});const P=Date.now();try{this.call.startRemoteParticipantsAudioLevelObserver(100);const T=Date.now()-P;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-P,U=$r(T);this.emit("call-start-progress",{stage:"audio-observer-setup",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}}),this.emit("error",{type:"audio-observer-setup-error",stage:"audio-observer-setup",error:U,timestamp:new Date().toISOString()})}this.call.on("remote-participants-audio-level",T=>{T&&this.handleRemoteParticipantsAudioLevel(T)}),this.call.on("app-message",T=>this.onAppMessage(T)),this.call.on("nonfatal-error",T=>{var z;(T==null?void 0:T.type)==="audio-processor-error"&&((z=this.call)==null||z.updateInputSettings({audio:{processor:{type:"none"}}}).then(()=>{(0,Sc.safeSetLocalAudio)(this.call,!0)}))}),this.emit("call-start-progress",{stage:"audio-processing-setup",status:"started",timestamp:new Date().toISOString()});const O=Date.now();try{this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}});const T=Date.now()-O;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-O,U=$r(T);this.emit("call-start-progress",{stage:"audio-processing-setup",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}}),this.emit("error",{type:"audio-processing-setup-error",stage:"audio-processing-setup",error:U,timestamp:new Date().toISOString()})}const $=Date.now()-c;return this.emit("call-start-success",{totalDuration:$,callId:(x==null?void 0:x.id)||"unknown",timestamp:new Date().toISOString()}),x}catch(y){const x=Date.now()-c,b=$r(y);return this.emit("call-start-failed",{stage:"unknown",totalDuration:x,error:b.message,errorStack:b.stack||"No stack trace available",timestamp:new Date().toISOString(),context:{hasAssistant:!!n,hasSquad:!!a,hasWorkflow:!!s,isMobile:this.isMobileDevice()}}),this.emit("error",{type:"start-method-error",stage:"unknown",error:b,totalDuration:x,timestamp:new Date().toISOString(),context:{hasAssistant:!!n,hasSquad:!!a,hasWorkflow:!!s,isMobile:this.isMobileDevice()}}),await this.cleanup(),null}}onAppMessage(n){if(n)try{if(n.data==="listening")return this.emit("call-start");try{const r=JSON.parse(n.data);this.emit("message",r),r&&"type"in r&&"status"in r&&r.type==="status-update"&&r.status==="ended"&&(this.hasEmittedCallEndedStatus=!0)}catch(r){console.log("Error parsing message data: ",r)}}catch(r){console.error(r)}}handleRemoteParticipantsAudioLevel(n){const r=Object.values(n.participantsAudioLevel).reduce((s,i)=>s+i,0);this.emit("volume-level",Math.min(1,r/.15)),r>.01&&(this.speakingTimeout?(clearTimeout(this.speakingTimeout),this.speakingTimeout=null):this.emit("speech-start"),this.speakingTimeout=setTimeout(()=>{this.emit("speech-end"),this.speakingTimeout=null},1e3))}async stop(){this.started=!1,this.call&&(await this.call.destroy(),this.call=null),this.speakingTimeout=null}send(n){var r;(r=this.call)==null||r.sendAppMessage(JSON.stringify(n))}setMuted(n){(0,Sc.safeSetLocalAudio)(this.call,!n)}isMuted(){return this.call?this.call.localAudio()===!1:!1}say(n,r,a,s){this.send({type:"say",message:n,endCallAfterSpoken:r,interruptionsEnabled:a??!1,interruptAssistantEnabled:s??!1})}end(){this.send({type:"end-call"}),this.stop()}setInputDevicesAsync(n){return(0,Sc.safeSetInputDevicesAsync)(this.call,n)}async increaseMicLevel(n){if(!this.call)throw new Error("Call object is not available.");try{const r=await navigator.mediaDevices.getUserMedia({audio:!0}),a=new AudioContext,s=a.createMediaStreamSource(r),i=a.createGain();
845i.gain.value=n,s.connect(i);const l=a.createMediaStreamDestination();i.connect(l);const[c]=l.stream.getAudioTracks();await(0,Sc.safeSetInputDevicesAsync)(this.call,{audioSource:c})}catch(r){console.error("Error adjusting microphone level:",r)}}setOutputDeviceAsync(n){var r;(r=this.call)==null||r.setOutputDeviceAsync(n)}getDailyCallObject(){return this.call}startScreenSharing(n,r){var a;(a=this.call)==null||a.startScreenShare({displayMediaOptions:n,screenVideoSendSettings:r})}stopScreenSharing(){var n;(n=this.call)==null||n.stopScreenShare()}async reconnect(n){var a,s,i,l,c,u,d,f,h,m,v,g,y;const r=Date.now();if(this.started)throw new Error("Cannot reconnect while a call is already in progress. Call stop() first.");if(!n.webCallUrl)throw new Error("webCallUrl is required for reconnection.");this.emit("call-start-progress",{stage:"reconnect-initialization",status:"started",timestamp:new Date().toISOString(),metadata:{callId:n.id||"unknown",hasVideoRecording:!!((a=n==null?void 0:n.artifactPlan)!=null&&a.videoRecordingEnabled),voiceProvider:((i=(s=n==null?void 0:n.assistant)==null?void 0:s.voice)==null?void 0:i.provider)||"unknown"}}),this.started=!0;
845try{this.call&&(this.emit("call-start-progress",{stage:"cleanup-existing-call",status:"started",timestamp:new Date().toISOString()}),await this.cleanup(),this.emit("call-start-progress",{stage:"cleanup-existing-call",status:"completed",timestamp:new Date().toISOString()}));const x=((l=n==null?void 0:n.artifactPlan)==null?void 0:l.videoRecordingEnabled)??!1,b=((u=(c=n==null?void 0:n.assistant)==null?void 0:c.voice)==null?void 0:u.provider)==="tavus";this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??x,isVideoRecordingEnabled:x,isVideoEnabled:b}});const w=Date.now();this.call=OS.default.createCallObject({audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??x,dailyConfig:this.dailyCallConfig});const N=Date.now()-w;this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"completed",duration:N,timestamp:new Date().toISOString()}),(d=this.call.iframe())==null||d.style.setProperty("display","none"),this.call.on("left-meeting",()=>{var T;this.emit("call-end"),this.hasEmittedCallEndedStatus||(this.emit("message",{type:"status-update",status:"ended",endedReason:"customer-ended-call"}),this.hasEmittedCallEndedStatus=!0),x&&((T=this.call)==null||T.stopRecording()),this.cleanup().catch(console.error)}),this.call.on("error",T=>{var z;this.emit("error",{type:"daily-error",error:$r(T),timestamp:new Date().toISOString()}),x&&((z=this.call)==null||z.stopRecording())}),this.call.on("camera-error",T=>{this.emit("camera-error",{type:"camera-error",error:$r(T),timestamp:new Date().toISOString()})}),this.call.on("network-quality-change",T=>{this.emit("network-quality-change",T)}),this.call.on("network-connection",T=>{this.emit("network-connection",T)}),this.call.on("track-started",async T=>{var z,U,E;!T||!T.participant||(z=T.participant)!=null&&z.local||((U=T.participant)==null?void 0:U.user_name)==="Vapi Speaker"&&(T.track.kind==="video"&&this.emit("video",T.track),T.track.kind==="audio"&&await oD(T.track,T.participant.session_id),(E=this.call)==null||E.sendAppMessage("playable"))}),this.call.on("participant-joined",T=>{!T||!this.call||iD(T,this.call,x,b)}),this.call.on("participant-updated",T=>{T&&this.emit("daily-participant-updated",T.participant)}),this.call.on("participant-left",T=>{T&&sD(T.participant.session_id)}),this.call.on("remote-participants-audio-level",T=>{T&&this.handleRemoteParticipantsAudioLevel(T)}),this.call.on("app-message",T=>this.onAppMessage(T)),this.call.on("nonfatal-error",T=>{var z;(T==null?void 0:T.type)==="audio-processor-error"&&((z=this.call)==null||z.updateInputSettings({audio:{processor:{type:"none"}}}).then(()=>{(0,Sc.safeSetLocalAudio)(this.call,!0)}))});const S=this.isMobileDevice();if(this.emit("call-start-progress",{stage:"mobile-permissions",status:"started",timestamp:new Date().toISOString(),metadata:{isMobile:S}}),S){const T=Date.now();await this.sleep(1e3);const z=Date.now()-T;this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",duration:z,timestamp:new Date().toISOString(),metadata:{action:"permissions-wait"}})}else this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-mobile"}});this.emit("call-start-progress",{stage:"daily-call-join",status:"started",timestamp:new Date().toISOString()});const _=Date.now();await this.call.join({url:n.webCallUrl,subscribeToTracksAutomatically:!1});const k=Date.now()-_;if(this.emit("call-start-progress",{stage:"daily-call-join",status:"completed",duration:k,timestamp:new Date().toISOString()}),x){this.emit("call-start-progress",{stage:"video-recording-setup",status:"started",timestamp:new Date().toISOString()});const T=Date.now(),z=new Date().getTime();try{this.call.startRecording({width:1280,height:720,backgroundColor:"#FF1F2D3D",layout:{preset:"default"}});const U=Date.now()-T;this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",duration:U,timestamp:new Date().toISOString()}),this.call.on("recording-started",()=>{const E=(new Date().getTime()-z)/1e3;
845this.emit("call-start-progress",{stage:"video-recording-started",status:"completed",timestamp:new Date().toISOString(),metadata:{delaySeconds:E}}),this.send({type:"control",control:"say-first-message",videoRecordingStartDelaySeconds:E})})}catch(U){const E=Date.now()-T,q=$r(U);this.emit("call-start-progress",{stage:"video-recording-setup",status:"failed",duration:E,timestamp:new Date().toISOString(),metadata:{error:q.message}})}}else this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-enabled"}});this.emit("call-start-progress",{stage:"audio-observer-setup",status:"started",timestamp:new Date().toISOString()});const P=Date.now();try{this.call.startRemoteParticipantsAudioLevelObserver(100);const T=Date.now()-P;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-P,U=$r(T);this.emit("call-start-progress",{stage:"audio-observer-setup",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}})}this.emit("call-start-progress",{stage:"audio-processing-setup",status:"started",timestamp:new Date().toISOString()});const O=Date.now();try{this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}});const T=Date.now()-O;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"completed",duration:T,timestamp:new Date().toISOString()})}catch(T){const z=Date.now()-O,U=$r(T);this.emit("call-start-progress",{stage:"audio-processing-setup",status:"failed",duration:z,timestamp:new Date().toISOString(),metadata:{error:U.message}})}const $=Date.now()-r;this.emit("call-start-success",{totalDuration:$,callId:(n==null?void 0:n.id)||"unknown",timestamp:new Date().toISOString()}),this.emit("call-start")}catch(x){const b=Date.now()-r,w=$r(x);throw this.emit("call-start-failed",{stage:"reconnect",totalDuration:b,error:w.message,errorStack:w.stack||"No stack trace available",timestamp:new Date().toISOString(),context:{isReconnect:!0,callId:(n==null?void 0:n.id)||"unknown",hasVideoRecording:!!((f=n==null?void 0:n.artifactPlan)!=null&&f.videoRecordingEnabled),voiceProvider:((m=(h=n==null?void 0:n.assistant)==null?void 0:h.voice)==null?void 0:m.provider)||"unknown",isMobile:this.isMobileDevice()}}),this.emit("error",{type:"reconnect-error",error:w,totalDuration:b,timestamp:new Date().toISOString(),context:{isReconnect:!0,callId:(n==null?void 0:n.id)||"unknown",hasVideoRecording:!!((v=n==null?void 0:n.artifactPlan)!=null&&v.videoRecordingEnabled),voiceProvider:((y=(g=n==null?void 0:n.assistant)==null?void 0:g.voice)==null?void 0:y.provider)||"unknown",isMobile:this.isMobileDevice()}}),await this.cleanup(),x}}static async runNetworkTestsStandalone(){console.log("Starting standalone network connectivity tests...");const n={};let r=null;try{console.log("Creating temporary call object for testing..."),r=OS.default.createCallObject({audioSource:!0,videoSource:!0}),console.log(`
8461. Testing network connectivity (TURN server)...`);let a=null;try{a=(await navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0];const i=await r.testNetworkConnectivity(a);n.networkConnectivity=i,console.log("Network connectivity test result:",i)}catch(s){n.networkConnectivity={result:"error",error:s==null?void 0:s.toString()},console.error("Network connectivity test error:",s)}finally{a&&a.stop()}console.log(`
8472. Testing websocket connectivity...`);try{const s=await r.testWebsocketConnectivity();n.websocketConnectivity=s,console.log("Websocket connectivity test result:",s)}catch(s){n.websocketConnectivity={result:"error",error:s==null?void 0:s.toString()},console.error("Websocket connectivity test error:",s)}console.log(`
8483. Testing call quality...`);try{if(typeof r.testCallQuality=="function")try{console.log("Initializing call state with startCamera..."),await r.startCamera();const s=await r.testCallQuality();n.callQuality=s,console.log("Call quality test result:",s)}catch(s){console.error("Failed to start camera for call quality test:",s),n.callQuality={result:"error",error:s==null?void 0:s.toString(),message:"Failed to initialize camera for call quality test. Check camera permissions."}}else n.callQuality={result:"not-available",message:"testCallQuality method not available"},console.log("Call quality test not available in current Daily.co version")}catch(s){n.callQuality={result:"error",error:s==null?void 0:s.toString()},console.error("Call quality test error:",s)}}catch(a){console.error("Failed to create temporary call object:",a),n.error=a==null?void 0:a.toString()}finally{if(r)try{console.log("Cleaning up temporary call object..."),await r.destroy()}catch(a){console.error("Error destroying temporary call object:",a)}}return console.log(`
849=== Network Test Summary ===`),console.log("Results:",JSON.stringify(n,null,2)),n}}var K9=KU.default=Phe;const The=/[ऀ-ॿ]/,Ohe={अ:"ا",आ:"Ø¢",इ:"اِ",ई:"ای",उ:"اُ",ऊ:"اُو",ए:"اے",ऐ:"اَے",ओ:"او",औ:"اَو"},Mhe={क:"Ú©",ख:"Ú©Ú¾",ग:"Ú¯",घ:"Ú¯Ú¾",ङ:"نگ",च:"چ",छ:"چھ",ज:"ج",à
vendor: 6,927 bytes, lines 849-853
849¤:"جھ",ञ:"ن",ट:"Ù¹",ठ:"Ù¹Ú¾",ड:"ڈ",ढ:"ڈھ",ण:"ن",त:"ت",थ:"تھ",द:"د",ध:"دھ",न:"ن",प:"Ù¾",फ:"Ù¾Ú¾",ब:"ب",भ:"بھ",म:"م",य:"ی",र:"ر",ल:"ل",व:"و",श:"Ø´",ष:"Ø´",स:"س",ह:"ہ",क़:"ق",ख़:"Ø®",ग़:"غ",ज़:"ز",ड़:"ڑ",ढ़:"ڑھ",फ़:"ف"},Ihe={"ा":"ا","ी":"ی","ू":"و","े":"ے","ै":"َے","ो":"و","ौ":"َو","ि":"","ु":"","्":""},$he={"ं":"Úº","ँ":"Úº","ः":"ہ","०":"Û°","१":"Û±","२":"Û²","३":"Û³","४":"Û´","५":"Ûµ","६":"Û¶","७":"Û·","८":"Û¸","९":"Û¹","।":"۔"},Dhe={...Ohe,...Mhe,...Ihe,...$he};function Rhe(e){return The.test(e)}function Lhe(e){let t="";for(const n of e)t+=Dhe[n]??n;return t}function Fhe(e){return Rhe(e)?Lhe(e):e}var Ww="Dialog",[X9,J9]=Gr(Ww),[Bhe,as]=X9(Ww),Q9=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,l=p.useRef(null),c=p.useRef(null),[u,d]=lo({prop:r,defaultProp:a??!1,onChange:s,caller:Ww});return o.jsx(Bhe,{scope:t,triggerRef:l,contentRef:c,contentId:Zn(),titleId:Zn(),descriptionId:Zn(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};Q9.displayName=Ww;var Z9="DialogTrigger",e7=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=as(Z9,n),s=at(t,a.triggerRef);return o.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":KA(a.open),...r,ref:s,onClick:xe(e.onClick,a.onOpenToggle)})});e7.displayName=Z9;var GA="DialogPortal",[zhe,t7]=X9(GA,{forceMount:void 0}),n7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,s=as(GA,t);return o.jsx(zhe,{scope:t,forceMount:n,children:p.Children.map(r,i=>o.jsx(da,{present:n||s.open,children:o.jsx(dh,{asChild:!0,container:a,children:i})}))})};n7.displayName=GA;var xb="DialogOverlay",r7=p.forwardRef((e,t)=>{const n=t7(xb,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,s=as(xb,e.__scopeDialog);return s.modal?o.jsx(da,{present:r||s.open,children:o.jsx(Vhe,{...a,ref:t})}):null});r7.displayName=xb;var Uhe=Hl("DialogOverlay.RemoveScroll"),Vhe=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=as(xb,n);return o.jsx(Bg,{as:Uhe,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx(Ie.div,{"data-state":KA(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vu="DialogContent",a7=p.forwardRef((e,t)=>{const n=t7(vu,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,s=as(vu,e.__scopeDialog);return o.jsx(da,{present:r||s.open,children:s.modal?o.jsx(Whe,{...a,ref:t}):o.jsx(qhe,{...a,ref:t})})});a7.displayName=vu;var Whe=p.forwardRef((e,t)=>{const n=as(vu,e.__scopeDialog),r=p.useRef(null),a=at(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return Ew(s)},[]),o.jsx(o7,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:xe(e.onFocusOutside,s=>s.preventDefault())})}),qhe=p.forwardRef((e,t)=>{const n=as(vu,e.__scopeDialog),r=p.useRef(!1),a=p.useRef(!1);return o.jsx(o7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),o7=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...i}=e,l=as(vu,n),c=p.useRef(null),u=at(t,c);return kw(),o.jsxs(o.Fragment,{children:[o.jsx(Fg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:o.jsx(Mu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":KA(l.open),...i,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(Ghe,{titleId:l.titleId}),o.jsx(Khe,{contentRef:c,descriptionId:l.descriptionId})]})]})}),YA="DialogTitle",s7=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=as(YA,n);return o.jsx(Ie.h2,{id:a.titleId,...r,ref:t})});s7.displayName=YA;var i7="DialogDescription",l7=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=as(i7,n);return o.jsx(Ie.p,{id:a.descriptionId,...r,ref:t})});l7.displayName=i7;var c7="DialogClose",u7=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=as(c7,n);return o.jsx(Ie.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>a.onOpenChange(!1))})});u7.displayName=c7;function KA(e){return e?"open":"closed"}var d7="DialogTitleWarning",[Hhe,f7]=gne(d7,{contentName:vu,titleName:YA,docsSlug:"dialog"}),Ghe=({titleId:e})=>{const t=f7(d7),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
850
851If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
852
853For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Yhe="DialogDescriptionWarning",Khe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${f7(Yhe).contentName}}.`;return p.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},XA=Q9,Xhe=e7,JA=n7,qw=r7,Hw=a7,QA=s7,ZA=l7,eP=u7;const ft=XA,Jhe=JA,h7=p.forwardRef(({className:e,...t},n)=>o.jsx(qw,{ref:n,className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));h7.displayName=qw.displayName;const ct=p.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Jhe,{children:[o.jsx(h7,{}),o.jsxs(Hw,{ref:r,className:he("fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100vh-2rem)] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto border bg-background p-4 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 sm:p-6",e),...n,children:[t,o.jsxs(eP,{className:"absolute right-4 top-4 roun
853ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[o.jsx(rn,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ct.displayName=Hw.displayName;const $t=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$t.displayName="DialogHeader";const Wt=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wt.displayName="DialogFooter";const xt=p.forwardRef(({className:e,...t},n)=>o.jsx(QA,{ref:n,className:he("text-lg font-semibold leading-none tracking-tight",e),...t}));xt.displayName=QA.displayName;const wt=p.forwardRef(({className:e,...t},n)=>o.jsx(ZA,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));wt.displayName=ZA.displayName;const lD="80eb288d-0508-4459-8e24-fb76da4ebdf1".trim();function m7({agent:e,open:t,onOpenChange:n,onAgentSynced:r}){const[a,s]=p.useState([]),[i,l]=p.useState("idle"),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState(!1),[v,g]=p.useState(null),y=p.useRef(null),x=p.useRef(null),b=()=>{var T;try{(T=y.current)==null||T.stop()}catch{}y.current=null},w=async T=>{if(!e)return;if(!lD){f("Voice calling is not configured. Please contact support."),l("error");return}const z=T??v??e.vapi_assistant_id;if(!z){f("This agent isn't set up for voice calls yet. It was likely created before voice calling was configured use the Sync button below to fix this."),l("error");return}l("connecting"),f(null),s([]);try{const U=new K9(lD);y.current=U,U.on("call-start",()=>l("in-call")),U.on("call-end",()=>l("ended")),U.on("speech-start",()=>{}),U.on("speech-end",()=>{}),U.on("message",E=>{if((E==null?void 0:E.type)==="transcript"&&(E==null?void 0:E.transcriptType)==="final"){const q=E.role==="user"?"user":"assistant",W=Fhe(E.transcript??"");W.trim()&&s(L=>[...L,{role:q,content:W}])}}),U.on("error",E=>{var W;const q=((W=E==null?void 0:E.error)==null?void 0:W.message)??(E==null?void 0:E.message)??"Call error";f(q),l("error")}),await U.start(z)}catch(U){f((U==null?void 0:U.message)??"Failed to start call"),l("error"),b()}},N=async()=>{var U;if(!e)return;m(!0),f(null);const T=await ee.syncAgentVapi(e.id);if(m(!1),T.error||!((U=T.data)!=null&&U.vapi_assistant_id)){f(T.error??"Sync failed no assistant ID returned. Please try again."),l("error");return}const z=T.data.vapi_assistant_id;g(z),r==null||r(e.id,z),X.success("Agent synced starting call…"),await w(z)},S=()=>{b(),l("ended")},_=()=>{const T=y.current;if(T)try{const z=!c;T.setMuted(z),u(z)}catch{}};p.useEffect(()=>{if(!t){b(),l("idle"),s([]),u(!1),f(null),g(null);return}return w(),()=>{b()}},[t,e==null?void 0:e.id]),p.useEffect(()=>{var T;(T=x.current)==null||T.scrollTo({top:x.current.scrollHeight,behavior:"smooth"})},[a]);const k={idle:"Ready",connecting:"Connecting to agent…",ringing:"Ringing…","in-call":"In call just talk.",ended:"Call ended",error:d??"Something went wrong"},P=i==="in-call",O=i==="connecting"||i==="ringing",$=i==="error"&&!(e!=null&&e.vapi_assistant_id)&&!v;return o.jsx(ft,{open:t,onOpenChange:T=>{T||b(),n(T)},children:o.jsxs(ct,{className:"max-w-2xl",children:[o.jsxs($t,{children:[o.jsxs(xt,{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[o.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${P?"animate-ping bg-primary/70":"bg-muted"}`}),o.jsx("span",{className:`relative inline-flex h-2.5 w-2.5 rounded-full ${P?"bg-primary":i==="error"?"bg-destructive":"bg-muted-foreground"}`})]}),"Talk to ",e==null?void 0:e.name]}),o.jsx(wt,{children:k[i]})]}),e?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 gap-3 rounded-lg border border-border bg-muted/30 p-3 text-sm sm:grid-cols-3",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Voice: "}),o.jsx("span",{className:"font-medium",children:e.voice??" "})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Language: "}),o.jsx("span",{className:"font-medium",children:e.language??" "})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Status: "}),o.jsx("span",{className:"font-medium",children:e.status??" "})]})]}),i==="error"&&o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(co,{className:"mt-0.5 h-4 w-4 shrink-0"}),o.jsx("span",{children:d})]}),$&&o.jsxs(ne,{size:"sm",variant:"outline",onClick:N,disabled:h,className:"self-start border-destructive/40 text-destructive hover:bg-destructive/10",children:[h?o.jsx(Te,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):o.jsx($u,{className:"mr-2 h-3.5 w-3.5"}),h?"Syncing…":"Sync agent"]})]}),o.jsxs("div",{ref:x,className:"h-72 overflow-y-auto rounded-lg border border-border bg-background p-3 space-y-3",children:[a.length===0&&i==="in-call"&&o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Listening… say hello to start the conversation."}),a.length===0&&O&&o.jsxs("div",{className:"flex items-center justify-center gap-2 py-12 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," ",k[i]]}),a.map((T,z)=>o.jsxs("div",{className:`flex gap-2 ${T.role==="user"?"justify-end":"justify-start"}`,children:[T.role==="assistant"&&o.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(zn,{className:"h-4 w-4"})}),o.jsx("div",{className:`max-w-[75%] rounded-lg px-3 py-2 text-sm ${T.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:T.content}),T.role==="user"&&o.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:o.jsx(eb,{className:"h-4 w-4"})})]},z))]}),o.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2",children:[(i==="idle"||i==="ended"||i==="error"&&!$)&&o.jsxs(ne,{size:"lg",onClick:()=>
vendor: 5,226 bytes, line 853
853w(),className:"h-14 rounded-full bg-primary px-6 hover:bg-primary/90",title:"Start call",children:[o.jsx(wf,{className:"mr-2 h-5 w-5"}),i==="ended"||i==="error"?"Call again":"Start call"]}),P&&o.jsxs(o.Fragment,{children:[o.jsx(ne,{size:"lg",onClick:_,variant:c?"default":"outline",className:"h-14 w-14 rounded-full p-0",title:c?"Unmute":"Mute",children:c?o.jsx(Pre,{className:"h-6 w-6"}):o.jsx(Oi,{className:"h-6 w-6"})}),o.jsx(ne,{size:"lg",variant:"destructive",onClick:S,className:"h-14 w-14 rounded-full p-0",title:"End call",children:o.jsx(i8,{className:"h-6 w-6"})})]}),O&&o.jsx(ne,{size:"lg",variant:"outline",onClick:S,className:"h-14 rounded-full px-6",children:"Cancel"})]}),o.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Live web call. Uses your agent's real voice, model, and tools no phone number needed."})]}):null]})})}function tP(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Gw="Switch",[Qhe,Vqe]=Gr(Gw),[Zhe,eme]=Qhe(Gw),p7=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:s,required:i,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,m]=p.useState(null),v=at(t,w=>m(w)),g=p.useRef(!1),y=h?d||!!h.closest("form"):!0,[x,b]=lo({prop:a,defaultProp:s??!1,onChange:u,caller:Gw});return o.jsxs(Zhe,{scope:n,checked:x,disabled:l,children:[o.jsx(Ie.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":x7(x),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:v,onClick:xe(e.onClick,w=>{b(N=>!N),y&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),y&&o.jsx(y7,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});p7.displayName=Gw;var g7="SwitchThumb",v7=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=eme(g7,n);return o.jsx(Ie.span,{"data-state":x7(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});v7.displayName=g7;var tme="SwitchBubbleInput",y7=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},s)=>{const i=p.useRef(null),l=at(i,s),c=tP(n),u=lA(t);return p.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const v=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(v)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});y7.displayName=tme;function x7(e){return e?"checked":"unchecked"}var b7=p7,nme=v7;const jh=p.forwardRef(({className:e,...t},n)=>o.jsx(b7,{className:he("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:o.jsx(nme,{className:he("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));jh.displayName=b7.displayName;function cD(e,[t,n]){return Math.min(n,Math.max(t,e))}var w7=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"}),rme="VisuallyHidden",ame=p.forwardRef((e,t)=>o.jsx(Ie.span,{...e,ref:t,style:{...w7,...e.style}}));ame.displayName=rme;var ome=[" ","Enter","ArrowUp","ArrowDown"],sme=[" ","Enter"],yu="Select",[Yw,Kw,ime]=Pg(yu),[Sh,Wqe]=Gr(yu,[ime,sc]),Xw=sc(),[lme,lc]=Sh(yu),[cme,ume]=Sh(yu),j7=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:v}=e,g=Xw(t),[y,x]=p.useState(null),[b,w]=p.useState(null),[N,S]=p.useState(!1),_=Nw(u),[k,P]=lo({prop:r,defaultProp:a??!1,onChange:s,caller:yu}),[O,$]=lo({prop:i,defaultProp:l,onChange:c,caller:yu}),T=p.useRef(null),z=y?v||!!y.closest("form"):!0,[U,E]=p.useState(new Set),q=Array.from(U).map(W=>W.props.value).join(";");return o.jsx(dA,{...g,children:o.jsxs(lme,{required:m,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:N,onValueNodeHasChildrenChange:S,contentId:Zn(),value:O,onValueChange:$,open:k,onOpenChange:P,dir:_,triggerPointerDownPosRef:T,disabled:h,children:[o.jsx(Yw.Provider,{scope:t,children:o.jsx(cme,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(W=>{E(L=>new Set(L).add(W))},[]),onNativeOptionRemove:p.useCallback(W=>{E(L=>{const M=new Set(L);return M.delete(W),M})},[]),children:n})}),z?o.jsxs(H7,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:W=>$(W.target.value),disabled:h,form:v,children:[O===void 0?o.jsx("option",{value:""}):null,Array.from(U)]},q):null]})})};j7.displayName=yu;var S7="SelectTrigger",N7=p.forwardRef((e,t)=>
vendor: 16,737 bytes, line 853
853{const{__scopeSelect:n,disabled:r=!1,...a}=e,s=Xw(n),i=lc(S7,n),l=i.disabled||r,c=at(t,i.onTriggerChange),u=Kw(n),d=p.useRef("touch"),[f,h,m]=Y7(g=>{const y=u().filter(w=>!w.disabled),x=y.find(w=>w.value===i.value),b=K7(y,g,x);b!==void 0&&i.onValueChange(b.value)}),v=g=>{l||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return o.jsx(Rg,{asChild:!0,...s,children:o.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":G7(i.value)?"":void 0,...a,ref:c,onClick:xe(a.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&v(g)}),onPointerDown:xe(a.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:xe(a.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&ome.includes(g.key)&&(v(),g.preventDefault())})})})});N7.displayName=S7;var _7="SelectValue",C7=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:s,placeholder:i="",...l}=e,c=lc(_7,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=at(t,c.onValueNodeChange);return er(()=>{u(d)},[u,d]),o.jsx(Ie.span,{...l,ref:f,style:{pointerEvents:"none"},children:G7(c.value)?o.jsx(o.Fragment,{children:i}):s})});C7.displayName=_7;var dme="SelectIcon",k7=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return o.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});k7.displayName=dme;var fme="SelectPortal",E7=e=>o.jsx(dh,{asChild:!0,...e});E7.displayName=fme;var xu="SelectContent",A7=p.forwardRef((e,t)=>{const n=lc(xu,e.__scopeSelect),[r,a]=p.useState();if(er(()=>{a(new DocumentFragment)},[]),!n.open){const s=r;return s?Ou.createPortal(o.jsx(P7,{scope:e.__scopeSelect,children:o.jsx(Yw.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),s):null}return o.jsx(T7,{...e,ref:t})});A7.displayName=xu;var No=10,[P7,cc]=Sh(xu),hme="SelectContentImpl",mme=Hl("SelectContent.RemoveScroll"),T7=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y,...x}=e,b=lc(xu,n),[w,N]=p.useState(null),[S,_]=p.useState(null),k=at(t,V=>N(V)),[P,O]=p.useState(null),[$,T]=p.useState(null),z=Kw(n),[U,E]=p.useState(!1),q=p.useRef(!1);p.useEffect(()=>{if(w)return Ew(w)},[w]),kw();const W=p.useCallback(V=>{const[Y,...G]=z().map(J=>J.ref.current),[K]=G.slice(-1),Z=document.activeElement;for(const J of V)if(J===Z||(J==null||J.scrollIntoView({block:"nearest"}),J===Y&&S&&(S.scrollTop=0),J===K&&S&&(S.scrollTop=S.scrollHeight),J==null||J.focus(),document.activeElement!==Z))return},[z,S]),L=p.useCallback(()=>W([P,w]),[W,P,w]);p.useEffect(()=>{U&&L()},[U,L]);const{onOpenChange:M,triggerPointerDownPosRef:B}=b;p.useEffect(()=>{if(w){let V={x:0,y:0};const Y=K=>{var Z,J;V={x:Math.abs(Math.round(K.pageX)-(((Z=B.current)==null?void 0:Z.x)??0)),y:Math.abs(Math.round(K.pageY)-(((J=B.current)==null?void 0:J.y)??0))}},G=K=>{V.x<=10&&V.y<=10?K.preventDefault():w.contains(K.target)||M(!1),document.removeEventListener("pointermove",Y),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",G,{capture:!0})}}},[w,M,B]),p.useEffect(()=>{const V=()=>M(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[M]);const[I,R]=Y7(V=>{const Y=z().filter(Z=>!Z.disabled),G=Y.find(Z=>Z.ref.current===document.activeElement),K=K7(Y,V,G);K&&setTimeout(()=>K.ref.current.focus())}),F=p.useCallback((V,Y,G)=>{const K=!q.current&&!G;(b.value!==void 0&&b.value===Y||K)&&(O(V),K&&(q.current=!0))},[b.value]),j=p.useCallback(()=>w==null?void 0:w.focus(),[w]),C=p.useCallback((V,Y,G)=>{const K=!q.current&&!G;(b.value!==void 0&&b.value===Y||K)&&T(V)},[b.value]),A=r==="popper"?DC:O7,D=A===DC?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return o.jsx(P7,{scope:n,content:w,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:P,onItemLeave:j,itemTextRefCallback:C,focusSelectedItem:L,selectedItemText:$,position:r,isPositioned:U,searchRef:I,children:o.jsx(Bg,{as:mme,allowPinchZoom:!0,children:o.jsx(Fg,{asChild:!0,trapped:b.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:xe(a,V=>{var Y;(Y=b.trigger)==null||Y.focus({preventScroll:!0}),V.preventDefault()}),children:o.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:o.jsx(A,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:V=>V.preventDefault(),...x,...D,onPlaced:()=>E(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:xe(x.onKeyDown,V=>{const Y=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!Y&&V.key.length===1&&R(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let K=z().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);if(["ArrowUp","End"].includes(V.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const Z=V.target,J=K.indexOf(Z);K=K.slice(J+1)}setTimeout(()=>W(K)),V.preventDefault()}})})})})})})});T7.displayName=hme;var pme="SelectItemAlignedPosition",O7=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,s=lc(xu,n),i=cc(xu,n),[l,c]=p.useState(null),[u,d]=p.useState(null),f=at(t,k=>d(k)),h=Kw(n),m=p.useRef(!1),v=p.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=i,w=p.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&g&&y&&x){const k=s.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),O=s.valueNode.getBoundingClientRect(),$=x.getBoundingClientRect();if(s.dir!=="rtl"){const Z=$.left-P.left,J=O.left-Z,ce=k.left-J,ue=k.width+ce,be=Math.max(ue,P.width),Ne=window.innerWidth-No,te=cD(J,[No,Math.max(No,Ne-be)]);l.style.minWidth=ue+"px",l.style.left=te+"px"}else{const Z=P.right-$.right,J=window.innerWidth-O.right-Z,ce=window.innerWidth-k.right-J,ue=k.width+ce,be=Math.max(ue,P.width),Ne=window.innerWidth-No,te=cD(J,[No,Math.max(No,Ne-be)]);l.style.minWidth=ue+"px",l.style.right=te+"px"}const T=h(),z=window.innerHeight-No*2,U=g.scrollHeight,E=window.getComputedStyle(u),q=parseInt(E.borderTopWidth,10),W=parseInt(E.paddingTop,10),L=parseInt(E.borderBottomWidth,10),M=parseInt(E.paddingBottom,10),B=q+W+U+M+L,I=Math.min(y.offsetHeight*5,B),R=window.getComputedStyle(g),F=parseInt(R.paddingTop,10),j=parseInt(R.paddingBottom,10),C=k.top+k.height/2-No,A=z-C,D=y.offsetHeight/2,V=y.offsetTop+D,Y=q+W+V,G=B-Y;if(Y<=C){const Z=T.length>0&&y===T[T.length-1].ref.current;l.style.bottom="0px";const J=u.clientHeight-g.offsetTop-g.offsetHeight,ce=Math.max(A,D+(Z?j:0)+J+L),ue=Y+ce;l.style.height=ue+"px"}else{const Z=T.length>0&&y===T[0].ref.current;l.style.top="0px";const ce=Math.max(C,q+g.offsetTop+(Z?F:0)+D)+G;l.style.height=ce+"px",g.scrollTop=Y-C+g.offsetTop}l.style.margin=`${No}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,l,u,g,y,x,s.dir,r]);er(()=>w(),[w]);const[N,S]=p.useState();er(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=p.useCallback(k=>{k&&v.current===!0&&(w(),b==null||b(),v.current=!1)},[w,b]);return o.jsx(vme,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:o.jsx(Ie.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});O7.displayName=pme;var gme="SelectPopperPosition",DC=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=No,...s}=e,i=Xw(n);return o.jsx(mw,{...i,...s,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...s.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)"}})});DC.displayName=gme;var[vme,nP]=Sh(xu,{}),RC="SelectViewport",M7=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,s=cc(RC,n),i=nP(RC,n),l=at(t,s.onViewportChange),c=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(Yw.Slot,{scope:n,children:o.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:xe(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const v=window.innerHeight-No*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(g,y);if(x<v){const b=x+m,w=Math.min(v,b),N=b-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=N>0?N:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});M7.displayName=RC;var I7="SelectGroup",[yme,xme]=Sh(I7),bme=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Zn();return o.jsx(yme,{scope:n,id:a,children:o.jsx(Ie.div,{role:"group","aria-labelledby":a,...r,ref:t})})});bme.displayName=I7;var $7="SelectLabel",D7=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=xme($7,n);return o.jsx(Ie.div,{id:a.id,...r,ref:t})});D7.displayName=$7;var bb="SelectItem",[wme,R7]=Sh(bb),L7=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:s,...i}=e,l=lc(bb,n),c=cc(bb,n),u=l.value===r,[d,f]=p.useState(s??""),[h,m]=p.useState(!1),v=at(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,a)}),g=Zn(),y=p.useRef("touch"),x=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(wme,{scope:n,value:r,disabled:a,textId:g,isSelected:u,onItemTextChange:p.useCallback(b=>{f(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:o.jsx(Yw.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:o.jsx(Ie.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:v,onFocus:xe(i.onFocus,()=>m(!0)),onBlur:xe(i.onBlur,()=>m(!1)),onClick:xe(i.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:xe(i.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:xe(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:xe(i.onPointerMove,b=>{var w;y.current=b.pointerType,a?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(i.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:xe(i.onKeyDown,b=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&b.key===" "||(sme.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});L7.displayName=bb;var Tm="SelectItemText",F7=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...s}=e,i=lc(Tm,n),l=cc(Tm,n),c=R7(Tm,n),u=ume(Tm,n),[d,f]=p.useState(null),h=at(t,x=>f(x),c.onItemTextChange,x=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,x,c.value,c.disabled)}),m=d==null?void 0:d.textContent,v=p.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return er(()=>(g(v),()=>y(v)),[g,y,v]),o.jsxs(o.Fragment,{children:[o.jsx(Ie.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ou.createPortal(s.children,i.valueNode):null]})});F7.displayName=Tm;var B7="SelectItemIndicator",z7=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return R7(B7,n).isSelected?o.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});z7.displayName=B7;var LC="SelectScrollUpButton",U7=p.forwardRef((e,t)=>{const n=cc(LC,e.__scopeSelect),r=nP(LC,e.__scopeSelect),[a,s]=p.useState(!1),i=at(t,r.onScrollButtonChange);return er(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?o.jsx(W7,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});U7.displayName=LC;var FC="SelectScrollDownButton",V7=p.forwardRef((e,t)=>{const n=cc(FC,e.__scopeSelect),r=nP(FC,e.__scopeSelect),[a,s]=p.useState(!1),i=at(t,r.onScrollButtonChange);return er(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?o.jsx(W7,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});V7.displayName=FC;var W7=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,s=cc("SelectScrollButton",n),i=p.useRef(null),l=Kw(n),c=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>c(),[c]),er(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),o.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:xe(a.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:xe(a.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:xe(a.onPointerLeave,()=>{c()})})}),jme="SelectSeparator",q7=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});q7.displayName=jme;var BC="SelectArrow",Sme=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Xw(n),s=lc(BC,n),i=cc(BC,n);return s.open&&i.position==="popper"?o.jsx(pw,{...a,...r,ref:t}):null});Sme.displayName=BC;var Nme="SelectBubbleInput",H7=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=p.useRef(null),s=at(r,a),i=tP(t);return p.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[i,t]),o.jsx(Ie.select,{...n,style:{...w7,...n.style},ref:s,defaultValue:t})});H7.displayName=Nme;function G7(e){return e===""||e===void 0}function Y7(e){const t=ca(e),n=p.useRef(""),r=p.useRef(0),a=p.useCallback(i=>{const l=n.current+i;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,s]}function K7(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=_me(e,Math.max(s,0));a.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function _me(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cme=j7,X7=N7,kme=C7,Eme=k7,Ame=E7,J7=A7,Pme=M7,Q7=D7,Z7=L7,Tme=F7,Ome=z7,eW=U7,tW=V7,nW=q7;const nt=Cme,rt=kme,Ze=p.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(X7,{ref:r,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
853ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx(Eme,{asChild:!0,children:o.jsx(Iu,{className:"h-4 w-4 opacity-50"})})]}));Ze.displayName=X7.displayName;const rW=p.forwardRef(({className:e,...t},n)=>o.jsx(eW,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(vre,{className:"h-4 w-4"})}));rW.displayName=eW.displayName;const aW=p.forwardRef(({className:e,...t},n)=>o.jsx(tW,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Iu,{className:"h-4 w-4"})}));aW.displayName=tW.displayName;const et=p.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>o.jsx(Ame,{children:o.jsxs(J7,{ref:a,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(rW,{}),o.jsx(Pme,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(aW,{})]})}));et.displayName=J7.displayName;const Mme=p.forwardRef(({className:e,...t},n)=>o.jsx(Q7,{ref:n,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Mme.displayName=Q7.displayName;const we=p.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Z7,{ref:r,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Ome,{children:o.jsx(Ta,{className:"h-4 w-4"})})}),o.jsx(Tme,{children:t})]}));we.displayName=Z7.displayName;const Ime=p.forwardRef(({className:e,...t},n)=>o.jsx(nW,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));Ime.displayName=nW.displayName;var Yg={};(function e(t,n,r,a){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;try{var I=new OffscreenCanvas(1,1),R=I.getContext("2d");R.fillRect(0,0,1,1);var F=I.transferToImageBitmap();R.createPattern(F,"no-repeat")}catch{return!1}return!0}();function c(){}function u(I){var R=n.exports.Promise,F=R!==void 0?R:t.Promise;return typeof F=="function"?new F(I):(I(c,c),null)}var d=function(I,R){return{transform:function(F){if(I)return F;if(R.has(F))return R.get(F);var j=new OffscreenCanvas(F.width,F.height),C=j.getContext("2d");return C.drawImage(F,0,0),R.set(F,j),j},clear:function(){R.clear()}}}(l,new Map),f=function(){var I=Math.floor(16.666666666666668),R,F,j={},C=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(R=function(A){var D=Math.random();return j[D]=requestAnimationFrame(function V(Y){C===Y||C+I-1<Y?(C=Y,delete j[D],A()):j[D]=requestAnimationFrame(V)}),D},F=function(A){j[A]&&cancelAnimationFrame(j[A])}):(R=function(A){return setTimeout(A,I)},F=function(A){return clearTimeout(A)}),{frame:R,cancel:F}}(),h=function(){var I,R,F={};function j(C){function A(D,V){C.postMessage({options:D||{},callback:V})}C.init=function(V){var Y=V.transferControlToOffscreen();C.postMessage({canvas:Y},[Y])},C.fire=function(V,Y,G){if(R)return A(V,null),R;var K=Math.random().toString(36).slice(2);return R=u(function(Z){function J(ce){ce.data.callback===K&&(delete F[K],C.removeEventListener("message",J),R=null,d.clear(),G(),Z())}C.addEventListener("message",J),A(V,K),F[K]=J.bind(null,{data:{callback:K}})}),R},C.reset=function(){C.postMessage({reset:!0});for(var V in F)F[V](),delete F[V]}}return function(){if(I)return I;
vendor: 4,870 bytes, lines 853-854
853if(!r&&s){var C=["var CONFETTI, SIZE = {}, module = {};","("+e.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(`
854`);try{I=new Worker(URL.createObjectURL(new Blob([C])))}catch(A){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",A),null}j(I)}return I}}(),m={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};function v(I,R){return R?R(I):I}function g(I){return I!=null}function y(I,R,F){return v(I&&g(I[R])?I[R]:m[R],F)}function x(I){return I<0?0:Math.floor(I)}function b(I,R){return Math.floor(Math.random()*(R-I))+I}function w(I){return parseInt(I,16)}function N(I){return I.map(S)}function S(I){var R=String(I).replace(/[^0-9a-f]/gi,"");return R.length<6&&(R=R[0]+R[0]+R[1]+R[1]+R[2]+R[2]),{r:w(R.substring(0,2)),g:w(R.substring(2,4)),b:w(R.substring(4,6))}}function _(I){var R=y(I,"origin",Object);return R.x=y(R,"x",Number),R.y=y(R,"y",Number),R}function k(I){I.width=document.documentElement.clientWidth,I.height=document.documentElement.clientHeight}function P(I){var R=I.getBoundingClientRect();I.width=R.width,I.height=R.height}function O(I){var R=document.createElement("canvas");return R.style.position="fixed",R.style.top="0px",R.style.left="0px",R.style.pointerEvents="none",R.style.zIndex=I,R}function $(I,R,F,j,C,A,D,V,Y){I.save(),I.translate(R,F),I.rotate(A),I.scale(j,C),I.arc(0,0,1,D,V,Y),I.restore()}function T(I){var R=I.angle*(Math.PI/180),F=I.spread*(Math.PI/180);return{x:I.x,y:I.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:I.startVelocity*.5+Math.random()*I.startVelocity,angle2D:-R+(.5*F-Math.random()*F),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:I.color,shape:I.shape,tick:0,totalTicks:I.ticks,decay:I.decay,drift:I.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:I.gravity*3,ovalScalar:.6,scalar:I.scalar,flat:I.flat}}function z(I,R){R.x+=Math.cos(R.angle2D)*R.velocity+R.drift,R.y+=Math.sin(R.angle2D)*R.velocity+R.gravity,R.velocity*=R.decay,R.flat?(R.wobble=0,R.wobbleX=R.x+10*R.scalar,R.wobbleY=R.y+10*R.scalar,R.tiltSin=0,R.tiltCos=0,R.random=1):(R.wobble+=R.wobbleSpeed,R.wobbleX=R.x+10*R.scalar*Math.cos(R.wobble),R.wobbleY=R.y+10*R.scalar*Math.sin(R.wobble),R.tiltAngle+=.1,R.tiltSin=Math.sin(R.tiltAngle),R.tiltCos=Math.cos(R.tiltAngle),R.random=Math.random()+2);var F=R.tick++/R.totalTicks,j=R.x+R.random*R.tiltCos,C=R.y+R.random*R.tiltSin,A=R.wobbleX+R.random*R.tiltCos,D=R.wobbleY+R.random*R.tiltSin;if(I.fillStyle="rgba("+R.color.r+", "+R.color.g+", "+R.color.b+", "+(1-F)+")",I.beginPath(),i&&R.shape.type==="path"&&typeof R.shape.path=="string"&&Array.isArray(R.shape.matrix))I.fill(L(R.shape.path,R.shape.matrix,R.x,R.y,Math.abs(A-j)*.1,Math.abs(D-C)*.1,Math.PI/10*R.wobble));else if(R.shape.type==="bitmap"){var V=Math.PI/10*R.wobble,Y=Math.abs(A-j)*.1,G=Math.abs(D-C)*.1,K=R.shape.bitmap.width*R.scalar,Z=R.shape.bitmap.height*R.scalar,J=new DOMMatrix([Math.cos(V)*Y,Math.sin(V)*Y,-Math.sin(V)*G,Math.cos(V)*G,R.x,R.y]);J.multiplySelf(new DOMMatrix(R.shape.matrix));var ce=I.createPattern(d.transform(R.shape.bitmap),"no-repeat");ce.setTransform(J),I.globalAlpha=1-F,I.fillStyle=ce,I.fillRect(R.x-K/2,R.y-Z/2,K,Z),I.globalAlpha=1}else if(R.shape==="circle")I.ellipse?I.ellipse(R.x,R.y,Math.abs(A-j)*R.ovalScalar,Math.abs(D-C)*R.ovalScalar,Math.PI/10*R.wobble,0,2*Math.PI):$(I,R.x,R.y,Math.abs(A-j)*R.ovalScalar,Math.abs(D-C)*R.ovalScalar,Math.PI/10*R.wobble,0,2*Math.PI);else if(R.shape==="star")for(var ue=Math.PI/2*3,be=4*R.scalar,Ne=8*R.scalar,te=R.x,re=R.y,pe=5,Ee=Math.PI/pe;pe--;)te=R.x+Math.cos(ue)*Ne,re=R.y+Math.sin(ue)*Ne,I.lineTo(te,re),ue+=Ee,te=R.x+Math.cos(ue)*be,re=R.y+Math.sin(ue)*be,I.lineTo(te,re),ue+=Ee;else I.moveTo(Math.floor(R.x),Math.floor(R.y)),I.lineTo(Math.floor(R.wobbleX),Math.floor(C)),I.lineTo(Math.floor(A),Math.floor(D)),I.lineTo(Math.floor(j),Math.floor(R.wobbleY));return I.closePath(),I.fill(),R.tick<R.totalTicks}function U(I,R,F,j,C){var A=R.slice(),D=I.getContext("2d"),V,Y,G=u(function(K){function Z(){V=Y=null,D.clearRect(0,0,j.width,j.height),d.clear(),
vendor: 1,393 bytes, line 854
854C(),K()}function J(){r&&!(j.width===a.width&&j.height===a.height)&&(j.width=I.width=a.width,j.height=I.height=a.height),!j.width&&!j.height&&(F(I),j.width=I.width,j.height=I.height),D.clearRect(0,0,j.width,j.height),A=A.filter(function(ce){return z(D,ce)}),A.length?V=f.frame(J):Z()}V=f.frame(J),Y=Z});return{addFettis:function(K){return A=A.concat(K),G},canvas:I,promise:G,reset:function(){V&&f.cancel(V),Y&&Y()}}}function E(I,R){var F=!I,j=!!y(R||{},"resize"),C=!1,A=y(R,"disableForReducedMotion",Boolean),D=s&&!!y(R||{},"useWorker"),V=D?h():null,Y=F?k:P,G=I&&V?!!I.__confetti_initialized:!1,K=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Z;function J(ue,be,Ne){for(var te=y(ue,"particleCount",x),re=y(ue,"angle",Number),pe=y(ue,"spread",Number),Ee=y(ue,"startVelocity",Number),Fe=y(ue,"decay",Number),Be=y(ue,"gravity",Number),st=y(ue,"drift",Number),Pt=y(ue,"colors",N),kn=y(ue,"ticks",Number),Tt=y(ue,"shapes"),an=y(ue,"scalar"),Kr=!!y(ue,"flat"),Tr=_(ue),me=te,Se=[],it=I.width*Tr.x,Lt=I.height*Tr.y;me--;)Se.push(T({x:it,y:Lt,angle:re,spread:pe,startVelocity:Ee,color:Pt[me%Pt.length],shape:Tt[b(0,Tt.length)],ticks:kn,decay:Fe,gravity:Be,drift:st,scalar:an,flat:Kr}));return Z?Z.addFettis(Se):(Z=U(I,Se,Y,be,Ne),Z.promise)}function ce(ue){var be=A||y(ue,"disableForReducedMotion",Boolean),Ne=y(ue,"zIndex",Number);if(be&&K)return u(function(Ee){Ee()});
854F&&Z?I=Z.canvas:F&&!I&&(I=O(Ne),document.body.appendChild(I)),j&&!G&&Y(I);var te={width:I.width,height:I.height};V&&!G&&V.init(I),G=!0,V&&(I.__confetti_initialized=!0);function re(){if(V){var Ee={getBoundingClientRect:function(){if(!F)return I.getBoundingClientRect()}};Y(Ee),V.postMessage({resize:{width:Ee.width,height:Ee.height}});return}te.width=te.height=null}function pe(){Z=null,j&&(C=!1,t.removeEventListener("resize",re)),F&&I&&(document.body.contains(I)&&document.body.removeChild(I),I=null,G=!1)}return j&&!C&&(C=!0,t.addEventListener("resize",re,!1)),V?V.fire(ue,te,pe):J(ue,te,pe)}return ce.reset=function(){V&&V.reset(),Z&&Z.reset()},ce}var q;function W(){return q||(q=E(null,{useWorker:!0,resize:!0})),q}function L(I,R,F,j,C,A,D){var V=new Path2D(I),Y=new Path2D;Y.addPath(V,new DOMMatrix(R));var G=new Path2D;return G.addPath(Y,new DOMMatrix([Math.cos(D)*C,Math.sin(D)*C,-Math.sin(D)*A,Math.cos(D)*A,F,j])),G}function M(I){if(!i)throw new Error("path confetti are not supported in this browser");var R,F;typeof I=="string"?R=I:(R=I.path,F=I.matrix);var j=new Path2D(R),C=document.createElement("canvas"),A=C.getContext("2d");if(!F){for(var D=1e3,V=D,Y=D,G=0,K=0,Z,J,ce=0;ce<D;ce+=2)for(var ue=0;ue<D;ue+=2)A.isPointInPath(j,ce,ue,"nonzero")&&(V=Math.min(V,ce),Y=Math.min(Y,ue),G=Math.max(G,ce),K=Math.max(K,ue));Z=G-V,J=K-Y;var be=10,Ne=Math.min(be/Z,be/J);F=[Ne,0,0,Ne,-Math.round(Z/2+V)*Ne,-Math.round(J/2+Y)*Ne]}return{type:"path",path:R,matrix:F}}function B(I){var R,F=1,j="#000000",C='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof I=="string"?R=I:(R=I.text,F="scalar"in I?I.scalar:F,C="fontFamily"in I?I.fontFamily:C,j="color"in I?I.color:j);var A=10*F,D=""+A+"px "+C,V=new OffscreenCanvas(A,A),Y=V.getContext("2d");Y.font=D;var G=Y.measureText(R),K=Math.ceil(G.actualBoundingBoxRight+G.actualBoundingBoxLeft),Z=Math.ceil(G.actualBoundingBoxAscent+G.actualBoundingBoxDescent),J=2,ce=G.actualBoundingBoxLeft+J,ue=G.actualBoundingBoxAscent+J;K+=J+J,Z+=J+J,V=new OffscreenCanvas(K,Z),Y=V.getContext("2d"),Y.font=D,Y.fillStyle=j,Y.fillText(R,ce,ue);var be=1/F;return{type:"bitmap",bitmap:V.transferToImageBitmap(),matrix:[be,0,0,be,-K*be/2,-Z*be/2]}}n.exports=function(){return W().apply(this,arguments)},n.exports.reset=function(){W().reset()},n.exports.create=E,n.exports.shapeFromPath=M,n.exports.shapeFromText=B})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Yg,!1);const IS=Yg.exports;Yg.exports.create;function $me({open:e,agentName:t,onClose:n}){return p.useEffect(()=>{if(!e)return;const a=Date.now()+3e3,s=["#9BE3BF","#649684","#507F70","#22A655","#ADADAD","#ffffff"];IS({particleCount:120,spread:90,startVelocity:45,origin:{y:.6},colors:s});const i=window.setInterval(()=>{if(Date.now()>a){window.clearInterval(i);return}IS({particleCount:40,angle:60,spread:60,origin:{x:0,y:.7},colors:s}),IS({particleCount:40,angle:120,spread:60,origin:{x:1,y:.7},colors:s})},250);return()=>window.clearInterval(i)},[e]),e?o.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"agent-success-title",className:"fixed inset-0 z-[100] flex items-center justify-center p-4 animate-in fade-in-0 duration-300",children:[o.jsx("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-md"}),o.jsxs("div",{className:"relative w-full max-w-lg rounded-2xl border border-primary/20 bg-card p-8 shadow-2xl animate-in zoom-in-95 fade-in-0 duration-500",children:[o.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-2xl bg-gradient-to-br from-primary/20 via-transparent to-primary/10 opacity-60 blur-xl"}),o.jsxs("div",{className:"relative flex flex-col items-center text-center",children:[o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"absolute inset-0 -z-10 animate-ping rounded-full bg-primary/30"}),o.jsx("div",{className:"flex h-24 w-24 items-center justify-center rounded-full bg-gradient-to-br from-primary to-primary/70 shadow-[0_0_40px_hsl(var(--primary)/0.6)] animate-in zoom-in-50 duration-700",style:{animationTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)"},children:o.jsx(Ta,{className:"h-12 w-12 text-primary-foreground animate-in zoom-in-0 duration-500",strokeWidth:3,style:{animationDelay:"200ms",animationFillMode:"both"}})})]}),o.jsx("h2",{id:"agent-success-title",className:"mt-6 text-2xl font-bold tracking-tight sm:text-3xl",children:"🎉 Your AI Agent Has Been Created!"}),t&&o.jsxs("p",{className:"mt-2 inline-flex max-w-full items-center gap-1.5 break-words rounded-full border border-primary/30 bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:[o.jsx(Mi,{className:"h-3.5 w-3.5 shrink-0"}),t]}),o.jsxs("p",{className:"mt-4 max-w-md text-sm leading-relaxed text-muted-foreground sm:text-base",children:["Your agent is live and ready to take calls. Use"," ",o.jsx("span",{className:"font-semibold text-foreground",children:"Talk to Agent"})," ","on the My Agents page to try it out."]}),o.jsxs("div",{className:"mt-8 flex w-full flex-col gap-2 sm:flex-row sm:justify-center",children:[o.jsx(ne,{asChild:!0,size:"lg",className:"bg-primary text-primary-foreground",children:o.jsx(jt,{to:"/dashboard/ai-agents",onClick:n,children:"Go to My Agents"})}),o.jsx(ne,{variant:"outline",size:"lg",onClick:n,children:"Close"})]})]})]})]}):null}var uD=1,Dme=.9,Rme=.8,Lme=.17,$S=.1,DS=.999,Fme=.9999,Bme=.99,zme=/[\\\/_+.#"@\[\(\{&]/,Ume=/[\\\/_+.#"@\[\(\{&]/g,Vme=/[\s-]/,oW=/[\s-]/g;function zC(e,t,n,r,a,s,i){if(s===t.length)return a===e.length?uD:Bme;var l=`${a},${s}`;if(i[l]!==void 0)return i[l];for(var c=r.charAt(s),u=n.indexOf(c,a),d=0,f,h,m,v;u>=0;)f=zC(e,t,n,r,u+1,s+1,i),f>d&&(u===a?f*=uD:zme.test(e.charAt(u-1))?(f*=Rme,m=e.slice(a,u-1).match(Ume),m&&a>0&&(f*=Math.pow(DS,m.length))):Vme.test(e.charAt(u-1))?(f*=Dme,v=e.slice(a,u-1).match(oW),v&&a>0&&(f*=Math.pow(DS,v.length))):(f*=Lme,a>0&&(f*=Math.pow(DS,u-a))),e.charAt(u)!==t.charAt(s)&&(f*=Fme)),(f<$S&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=zC(e,t,n,r,u+1,s+2,i),h*$S>f&&(f=h*$S)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[l]=d,d}function dD(e){return e.toLowerCase().replace(oW," ")}function Wme(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,zC(e,t,dD(e),dD(t),0,0,{})}var Zh='[cmdk-group=""]',RS='[cmdk-group-items=""]',qme='[cmdk-group-heading=""]',sW='[cmdk-item=""]',fD=`${sW}:not([aria-disabled="true"])`,UC="cmdk-item-select",vd="data-value",Hme=(e,t,n
vendor: 14,817 bytes, line 854
854)=>Wme(e,t,n),iW=p.createContext(void 0),Kg=()=>p.useContext(iW),lW=p.createContext(void 0),rP=()=>p.useContext(lW),cW=p.createContext(void 0),uW=p.forwardRef((e,t)=>{let n=yd(()=>{var F,j;return{search:"",value:(j=(F=e.value)!=null?F:e.defaultValue)!=null?j:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=yd(()=>new Set),a=yd(()=>new Map),s=yd(()=>new Map),i=yd(()=>new Set),l=dW(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:v,disablePointerSelection:g=!1,vimBindings:y=!0,...x}=e,b=Zn(),w=Zn(),N=Zn(),S=p.useRef(null),_=rpe();bu(()=>{if(d!==void 0){let F=d.trim();n.current.value=F,k.emit()}},[d]),bu(()=>{_(6,U)},[]);let k=p.useMemo(()=>({subscribe:F=>(i.current.add(F),()=>i.current.delete(F)),snapshot:()=>n.current,setState:(F,j,C)=>{var A,D,V,Y;if(!Object.is(n.current[F],j)){if(n.current[F]=j,F==="search")z(),$(),_(1,T);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let G=document.getElementById(N);G?G.focus():(A=document.getElementById(b))==null||A.focus()}if(_(7,()=>{var G;n.current.selectedItemId=(G=E())==null?void 0:G.id,k.emit()}),C||_(5,U),((D=l.current)==null?void 0:D.value)!==void 0){let G=j??"";(Y=(V=l.current).onValueChange)==null||Y.call(V,G);return}}k.emit()}},emit:()=>{i.current.forEach(F=>F())}}),[]),P=p.useMemo(()=>({value:(F,j,C)=>{var A;j!==((A=s.current.get(F))==null?void 0:A.value)&&(s.current.set(F,{value:j,keywords:C}),n.current.filtered.items.set(F,O(j,C)),_(2,()=>{$(),k.emit()}))},item:(F,j)=>(r.current.add(F),j&&(a.current.has(j)?a.current.get(j).add(F):a.current.set(j,new Set([F]))),_(3,()=>{z(),$(),n.current.value||T(),k.emit()}),()=>{s.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let C=E();_(4,()=>{z(),(C==null?void 0:C.getAttribute("id"))===F&&T(),k.emit()})}),group:F=>(a.current.has(F)||a.current.set(F,new Set),()=>{s.current.delete(F),a.current.delete(F)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:N,labelId:w,listInnerRef:S}),[]);function O(F,j){var C,A;let D=(A=(C=l.current)==null?void 0:C.filter)!=null?A:Hme;return F?D(F,n.current.search,j):0}function $(){if(!n.current.search||l.current.shouldFilter===!1)return;let F=n.current.filtered.items,j=[];n.current.filtered.groups.forEach(A=>{let D=a.current.get(A),V=0;D.forEach(Y=>{let G=F.get(Y);V=Math.max(G,V)}),j.push([A,V])});let C=S.current;q().sort((A,D)=>{var V,Y;let G=A.getAttribute("id"),K=D.getAttribute("id");return((V=F.get(K))!=null?V:0)-((Y=F.get(G))!=null?Y:0)}).forEach(A=>{let D=A.closest(RS);D?D.appendChild(A.parentElement===D?A:A.closest(`${RS} > *`)):C.appendChild(A.parentElement===C?A:A.closest(`${RS} > *`))}),j.sort((A,D)=>D[1]-A[1]).forEach(A=>{var D;let V=(D=S.current)==null?void 0:D.querySelector(`${Zh}[${vd}="${encodeURIComponent(A[0])}"]`);V==null||V.parentElement.appendChild(V)})}function T(){let F=q().find(C=>C.getAttribute("aria-disabled")!=="true"),j=F==null?void 0:F.getAttribute(vd);k.setState("value",j||void 0)}function z(){var F,j,C,A;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let D=0;for(let V of r.current){let Y=(j=(F=s.current.get(V))==null?void 0:F.value)!=null?j:"",G=(A=(C=s.current.get(V))==null?void 0:C.keywords)!=null?A:[],K=O(Y,G);n.current.filtered.items.set(V,K),K>0&&D++}for(let[V,Y]of a.current)for(let G of Y)if(n.current.filtered.items.get(G)>0){n.current.filtered.groups.add(V);break}n.current.filtered.count=D}function U(){var F,j,C;let A=E();A&&(((F=A.parentElement)==null?void 0:F.firstChild)===A&&((C=(j=A.closest(Zh))==null?void 0:j.querySelector(qme))==null||C.scrollIntoView({block:"nearest"})),A.scrollIntoView({block:"nearest"}))}function E(){var F;return(F=S.current)==null?void 0:F.querySelector(`${sW}[aria-selected="true"]`)}function q(){var F;return Array.from(((F=S.current)==null?void 0:F.querySelectorAll(fD))||[])}function W(F){let j=q()[F];j&&k.setState("value",j.getAttribute(vd))}function L(F){var j;let C=E(),A=q(),D=A.findIndex(Y=>Y===C),V=A[D+F];(j=l.current)!=null&&j.loop&&(V=D+F<0?A[A.length-1]:D+F===A.length?A[0]:A[D+F]),V&&k.setState("value",V.getAttribute(vd))}function M(F){let j=E(),C=j==null?void 0:j.closest(Zh),A;for(;C&&!A;)C=F>0?tpe(C,Zh):npe(C,Zh),A=C==null?void 0:C.querySelector(fD);A?k.setState("value",A.getAttribute(vd)):L(F)}let B=()=>W(q().length-1),I=F=>{F.preventDefault(),F.metaKey?B():F.altKey?M(1):L(1)},R=F=>{F.preventDefault(),F.metaKey?W(0):F.altKey?M(-1):L(-1)};return p.createElement(Ie.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:F=>{var j;(j=x.onKeyDown)==null||j.call(x,F);let C=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||C))switch(F.key){case"n":case"j":{y&&F.ctrlKey&&I(F);break}case"ArrowDown":{I(F);break}case"p":case"k":{y&&F.ctrlKey&&R(F);break}case"ArrowUp":{R(F);break}case"Home":{F.preventDefault(),W(0);break}case"End":{F.preventDefault(),B();break}case"Enter":{F.preventDefault();let A=E();if(A){let D=new Event(UC);A.dispatchEvent(D)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:ope},c),Jw(e,F=>p.createElement(lW.Provider,{value:k},p.createElement(iW.Provider,{value:P},F))))}),Gme=p.forwardRef((e,t)=>{var n,r;let a=Zn(),s=p.useRef(null),i=p.useContext(cW),l=Kg(),c=dW(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;bu(()=>{if(!u)return l.item(a,i==null?void 0:i.id)},[u]);let d=fW(a,s,[e.value,e.children,s],e.keywords),f=rP(),h=Ql(_=>_.value&&_.value===d.current),m=Ql(_=>u||l.filter()===!1?!0:_.search?_.filtered.items.get(a)>0:!0);p.useEffect(()=>{let _=s.current;if(!(!_||e.disabled))return _.addEventListener(UC,v),()=>_.removeEventListener(UC,v)},[m,e.onSelect,e.disabled]);function v(){var _,k;g(),(k=(_=c.current).onSelect)==null||k.call(_,d.current)}function g(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:y,value:x,onSelect:b,forceMount:w,keywords:N,...S}=e;return p.createElement(Ie.div,{ref:Ti(s,t),...S,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:v},e.children)}),Yme=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...s}=e,i=Zn(),l=p.useRef(null),c=p.useRef(null),u=Zn(),d=Kg(),f=Ql(m=>a||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);bu(()=>d.group(i),[]),fW(i,l,[e.value,e.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:a}),[a]);return p.createElement(Ie.div,{ref:Ti(l,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Jw(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(cW.Provider,{value:h},m))))}),Kme=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=p.useRef(null),s=Ql(i=>!i.search);return!n&&!s?null:p.createElement(Ie.div,{ref:Ti(a,t),...r,"cmdk-separator":"",role:"separator"})}),Xme=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,s=rP(),i=Ql(u=>u.search),l=Ql(u=>u.selectedItemId),c=Kg();return p.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),p.createElement(Ie.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),Jme=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,s=p.useRef(null),i=p.useRef(null),l=Ql(u=>u.selectedItemId),c=Kg();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(Ie.div,{ref:Ti(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Jw(e,u=>p.createElement("div",{ref:Ti(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Qme=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:s,container:i,...l}=e;return p.createElement(XA,{open:n,onOpenChange:r},p.createElement(JA,{container:i},p.createElement(qw,{"cmdk-overlay":"",className:a}),p.createElement(Hw,{"aria-label":e.label,"cmdk-dialog":"",className:s},p.createElement(uW,{ref:t,...l}))))}),Zme=p.forwardRef((e,t)=>Ql(n=>n.filtered.count===0)?p.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),epe=p.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...s}=e;return p.createElement(Ie.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Jw(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),fa=Object.assign(uW,{List:Jme,Item:Gme,Input:Xme,Group:Yme,Separator:Kme,Dialog:Qme,Empty:Zme,Loading:epe});function tpe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function npe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function dW(e){let t=p.useRef(e);return bu(()=>{t.current=e}),t}var bu=typeof window>"u"?p.useEffect:p.useLayoutEffect;function yd(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Ql(e){let t=rP(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function fW(e,t,n,r=[]){let a=p.useRef(),s=Kg();return bu(()=>{var i;let l=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());s.value(e,l,c),(i=t.current)==null||i.setAttribute(vd,l),a.current=l}),a}var rpe=()=>{let[e,t]=p.useState(),n=yd(()=>new Map);return bu(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function ape(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jw({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(ape(t),{ref:t.ref},n(t.props.children)):n(t)}var ope={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Qw=p.forwardRef(({className:e,...t},n)=>o.jsx(fa,{ref:n,className:he("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qw.displayName=fa.displayName;const Zw=p.forwardRef(({className:e,...t},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(du,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(fa.Input,{ref:n,className:he("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Zw.displayName=fa.Input.displayName;const e1=p.forwardRef(({className:e,...t},n)=>o.jsx(fa.List,{ref:n,className:he("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));e1.displayName=fa.List.displayName;const t1=p.forwardRef((e,t)=>o.jsx(fa.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));t1.displayName=fa.Empty.displayName;const n1=p.forwardRef(({className:e,...t},n)=>o.jsx(fa.Group,{ref:n,className:he("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));n1.displayName=fa.Group.displayName;const spe=p.forwardRef(({className:e,...t},n)=>o.jsx(fa.Separator,{ref:n,className:he("-mx-1 h-px bg-border",e),...t}));spe.displayName=fa.Separator.displayName;const r1=p.forwardRef(({className:e,...t},n)=>o.jsx(fa.Item,{ref:n,className:he("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));r1.displayName=fa.Item.displayName;function ipe({value:e,onChange:t,placeholder:n="Select an industry…"}){const[r,a]=p.useState(!1),s=Z_.find(i=>i.label===e);return o.jsxs(yh,{open:r,onOpenChange:a,children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{type:"button",role:"combobox","aria-expanded":r,className:"flex h-11 w-full items-center justify-between rounded-md border border-input bg-background px-3 text-sm",children:[s?o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:he("flex h-6 w-6 items-center justify-center rounded-md",s.color),children:o.jsx(s.icon,{className:"h-3.5 w-3.5"})}),s.label]}):o.jsx("span",{className:e?"":"text-muted-foreground",children:e||n}),o.jsx(Iu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Fu,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:o.jsxs(Qw,{children:[o.jsx(Zw,{placeholder:"Search industries…"}),o.jsxs(e1,{children:[o.jsx(t1,{children:"No industries found."}),o.jsx(n1,{children:Z_.map(i=>{const l=i.icon;return o.jsxs(r1,{value:i.label,onSelect:()=>{t(i.label),a(!1)},children:[o.jsx(Ta,{className:he("mr-2 h-4 w-4 shrink-0",e===i.label?"opacity-100":"opacity-0")}),o.jsx("span",{className:he("mr-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",i.color),children:o.jsx(l,{className:"h-3.5 w-3.5"})}),i.label]},i.label)})})]})]})})]})}var a1="Checkbox",[lpe,qqe]=Gr(a1),[cpe,aP]=lpe(a1);function upe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:s,form:i,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=lo({prop:n,defaultProp:a??!1,onChange:c,caller:a1}),[v,g]=p.useState(null),[y,x]=p.useState(null),b=p.useRef(!1),w=v?!!i||!!v.closest("form"):!0,N={checked:h,disabled:s,setChecked:m,control:v,setControl:g,name:l,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Fl(a)?!1:a,isFormControl:w,bubbleInput:y,setBubbleInput:x};return o.jsx(cpe,{scope:t,...N,children:dpe(f)?f(N):r})}var hW="CheckboxTrigger",mW=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:s,value:i,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:v}=aP(hW,e),g=at(a,d),y=p.useRef(c);return p.useEffect(()=>{const x=s==null?void 0:s.form;
854if(x){const b=()=>f(y.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),o.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Fl(c)?"mixed":c,"aria-required":u,"data-state":xW(c),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:g,onKeyDown:xe(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:xe(n,x=>{f(b=>Fl(b)?!0:!b),v&&m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});mW.displayName=hW;var oP=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:s,required:i,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return o.jsx(upe,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:l,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>o.jsxs(o.Fragment,{children:[o.jsx(mW,{...f,ref:t,__scopeCheckbox:n}),h&&o.jsx(yW,{__scopeCheckbox:n})]})})});oP.displayName=a1;var pW="CheckboxIndicator",gW=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,s=aP(pW,n);return o.jsx(da,{present:r||Fl(s.checked)||s.checked===!0,children:o.jsx(Ie.span,{"data-state":xW(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});gW.displayName=pW;var vW="CheckboxBubbleInput",yW=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:s,defaultChecked:i,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m}=aP(vW,e),v=at(n,m),g=tP(s),y=lA(r);p.useEffect(()=>{const b=h;if(!b)return;const w=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(w,"checked").set,_=!a.current;if(g!==s&&S){const k=new Event("click",{bubbles:_});b.indeterminate=Fl(s),S.call(b,Fl(s)?!1:s),b.dispatchEvent(k)}},[h,g,s,a]);const x=p.useRef(Fl(s)?!1:s);return o.jsx(Ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});yW.displayName=vW;function dpe(e){return typeof e=="function"}function Fl(e){return e==="indeterminate"}function xW(e){return Fl(e)?"indeterminate":e?"checked":"unchecked"}const o1=p.forwardRef(({className:e,...t},n)=>o.jsx(oP,{ref:n,className:he("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(gW,{className:he("flex items-center justify-center text-current"),children:o.jsx(Ta,{className:"h-4 w-4"})})}));o1.displayName=oP.displayName;var fpe="Label",bW=p.forwardRef((e,t)=>o.jsx(Ie.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bW.displayName=fpe;var wW=bW;const hpe=nw("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ke=p.forwardRef(({className:e,...t},n)=>o.jsx(wW,{ref:n,className:he(hpe(),e),...t}));ke.displayName=wW.displayName;const wb={both:"Inbound & outbound",inbound:"Inbound only",outbound:"Outbound only"},cy=20,mpe=60,ppe=60,gpe=200,sP=e=>e.map(t=>({event_id:t})),jW=e=>`Saved, but ${e.length===1?"this agent":"these agents"} couldn't be updated in the voice service: ${e.join(", ")}. Open the agent and save it again to retry.`;function SW({open:e,onOpenChange:t,event:n,onSaved:r}){const a=!!n,[s,i]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState("both"),[m,v]=p.useState(!1),[g,y]=p.useState(!1),[x,b]=p.useState(null),w=S=>_=>{S(_),b(null)};p.useEffect(()=>{e&&(i((n==null?void 0:n.label)??""),c((n==null?void 0:n.outcome)??""),d((n==null?void 0:n.description)??""),h((n==null?void 0:n.applies_to)??"both"),v(!!(n!=null&&n.schedules_callback)),b(null))},[e,n]);const N=async()=>{var k;if(!s.trim()){b("Enter an event name.");return}y(!0),b(null);const S={label:s.trim(),outcome:l.trim()||null,description:u.trim()||null,applies_to:f,schedules_callback:m},_=a?await ee.updateCallEvent(n.id,S):await ee.createCallEvent(S);if(y(!1),_.error||!_.data){b(_.error||"Couldn't save the event.");return}
854(k=_.warnings)!=null&&k.length?X.warning(jW(_.warnings)):X.success(a?"Event updated":"Event created"),r({...n??{},..._.data}),t(!1)};return o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsx(xt,{children:a?"Edit event":"New call event"}),o.jsx(wt,{children:a?"Changes apply to every agent that uses this event.":"Define it once, then choose it on any agent."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"ce-label",children:"Event name"}),o.jsx(ve,{id:"ce-label",value:s,maxLength:mpe,placeholder:"Name this event",onChange:S=>w(i)(S.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"ce-outcome",children:"Outcome value"}),o.jsx(ve,{id:"ce-outcome",value:l,maxLength:ppe,placeholder:"Defaults to the event name",onChange:S=>w(c)(S.target.value)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Shown on the call when this is the last event raised."})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"ce-desc",children:"When should the agent raise it?"}),o.jsx(ve,{id:"ce-desc",value:u,maxLength:gpe,placeholder:"Describe when the agent should raise this event",onChange:S=>w(d)(S.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Applies to"}),o.jsxs(nt,{value:f,onValueChange:S=>w(h)(S),children:[o.jsx(Ze,{"aria-label":"Applies to",children:o.jsx(rt,{})}),o.jsx(et,{children:Object.keys(wb).map(S=>o.jsx(we,{value:S,children:wb[S]},S))})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "Inbound only" or "Outbound only" when the same agent handles both kinds of calls.'})]}),o.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-md border border-input p-3",children:[o.jsx(o1,{className:"mt-0.5",checked:m,"aria-label":"Schedule a callback",onCheckedChange:S=>w(v)(S===!0)}),o.jsxs("span",{className:"text-sm",children:[o.jsx("span",{className:"block font-medium",children:"Schedule a callback when this happens"}),o.jsx("span",{className:"block text-xs text-muted-foreground",children:"Use this when the event means the caller wants to be contacted again. If the caller names a day or time, the agent passes it along and a callback is recorded in the Callbacks tab."})]})]}),a&&o.jsx("p",{className:"rounded-md bg-muted/50 px-3 py-2 text-xs text-muted-foreground",children:"Renaming only changes the display name. Past calls keep their recorded events."}),x&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),disabled:g,children:"Cancel"}),o.jsxs(ne,{onClick:N,disabled:g,children:[g&&o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"}),a?"Save changes":"Create event"]})]})]})})}function NW({selectedIds:e,onChange:t,compact:n}){const[r,a]=p.useState([]),[s,i]=p.useState(!0),[l,c]=p.useState(null),[u,d]=p.useState(!1),f=p.useRef(e);f.current=e;const h=x=>{f.current=x,t(x)},m=p.useCallback(async()=>{i(!0),c(null);const{data:x,error:b}=await ee.getCallEvents();if(b||!Array.isArray(x)){c(b||"Couldn't load your events."),i(!1);return}a(x),i(!1);const w=new Set(x.map(N=>N.id));f.current.some(N=>!w.has(N))&&h(f.current.filter(N=>w.has(N)))},[]);p.useEffect(()=>{m()},[m]);const v=e.length>=cy,g=(x,b)=>{const w=f.current;b&&!w.includes(x)&&w.length>=cy||h(b?[...w.filter(N=>N!==x),x]:w.filter(N=>N!==x))},y=x=>{a(w=>w.some(N=>N.id===x.id)?w:[...w,x]);const b=f.current;!b.includes(x.id)&&b.length<cy&&h([...b,x.id])};return o.jsxs("div",{className:"space-y-6",children:[!n&&o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx($g,{className:"h-7 w-7"})}),o.jsx("h3",{className:"mt-3 text-lg font-bold",children:"Call Events"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Moments your agent should report during a call"})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose the events this agent should raise the instant they happen in a conversation. When the call ends, the last event sets the call's outcome, and all events are available to your automations. This step is optional."}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o.jsxs("span",{className:"text-sm font-medium",children:[e.length," selected ",o.jsxs("span",{className:"text-muted-foreground",children:["(max ",cy,")"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("a",{href:"/dashboard/call-events",target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline",children:"Manage events"}),o.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!0),children:[o.jsx(nn,{className:"mr-1.5 h-4 w-4"})," New event"]})]})]}),s?o.jsxs("div",{className:"flex items-center gap-2 py-8 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading your events…"]}):l?o.jsxs("div",{role:"alert",className:"space-y-2 rounded-xl border border-destructive/40 bg-destructive/5 p-4 text-sm",children:[o.jsx("p",{className:"text-destructive",children:l}),o.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:m,children:"Try again"})]}):r.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[o.jsx("p",{className:"text-sm font-medium",children:"You haven't created any events yet"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Create an event once, then reuse it on any of your agents."}),o.jsxs(ne,{type:"button",className:"mt-4",onClick:()=>d(!0),children:[o.jsx(nn,{className:"mr-1.5 h-4 w-4"})," Create your first event"]})]}):o.jsx("ul",{className:"space-y-2",children:r.map(x=>{const b=e.includes(x.id);return o.jsx("li",{children:o.jsxs("label",{className:`flex cursor-pointer items-start gap-3 rounded-xl border p-3 transition ${b?"border-primary/40 bg-primary/5":"border-border hover:bg-muted/40"}
854 ${!b&&v?"cursor-not-allowed opacity-50":""}`,children:[o.jsx(o1,{className:"mt-0.5",checked:b,disabled:!b&&v,"aria-label":x.label,onCheckedChange:w=>g(x.id,w===!0)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium",children:x.label}),o.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:wb[x.applies_to]}),x.schedules_callback&&o.jsx("span",{className:"rounded-full bg-warning/15 px-2 py-0.5 text-xs font-medium text-warning",children:"Schedules callback"}),x.outcome&&o.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:["→ ",x.outcome]})]}),x.description&&o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x.description})]})]})},x.id)})}),o.jsx(SW,{open:u,onOpenChange:d,onSaved:y})]})}const vpe=["check_availability","book_slot"];function ype({selectedKeys:e,onChange:t}){const[n,r]=p.useState([]),[a,s]=p.useState(!0),[i,l]=p.useState(null),[c,u]=p.useState(null),d=p.useRef(e);d.current=e;const f=p.useCallback(async()=>{s(!0),l(null);const{data:g,error:y}=await ee.getToolPresets();y||!Array.isArray(g)?l(y||"Couldn't load the available tools."):r(g),s(!1)},[]);p.useEffect(()=>{f()},[f]);const h=e.some(g=>vpe.includes(g));p.useEffect(()=>{!h||c||ee.getCalendarStatus().then(({data:g})=>{g&&u(g)})},[h,c]);const m=(g,y)=>{const x=y?[...d.current.filter(b=>b!==g),g]:d.current.filter(b=>b!==g);d.current=x,t(x)},v=h&&c?c.connected?c.status==="reauth_required"?"Your calendar connection needs to be reconnected before these tools will work.":null:"No calendar is connected yet, so these tools won't be able to check or book times until you connect one.":null;return a?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading tools…"]}):i?o.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm",children:[o.jsx("p",{className:"text-destructive",children:i}),o.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:f,children:"Try again"})]}):n.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No tools are available."}):o.jsxs("div",{className:"space-y-3",children:[o.jsx("ul",{className:"space-y-2",children:n.map(g=>{const y=e.includes(g.key);return o.jsx("li",{children:o.jsxs("label",{className:`flex cursor-pointer items-start gap-3 rounded-md border p-3 transition ${y?"border-primary/40 bg-primary/5":"border-input hover:bg-muted/40"}`,children:[o.jsx(o1,{className:"mt-0.5",checked:y,"aria-label":g.label,onCheckedChange:x=>m(g.key,x===!0)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-sm font-medium text-foreground",children:g.label}),o.jsx("span",{className:"block text-xs text-muted-foreground",children:g.description}),g.requires&&o.jsxs("span",{className:"mt-0.5 block text-xs text-muted-foreground/80",children:["Needs ",g.requires]})]})]})},g.key)})}),e.includes("book_slot")&&!e.includes("check_availability")&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"Tip: also tick “Check Availability” — without it the agent has no way to find free times to book."}),v&&o.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-md border border-warning/40 bg-warning/10 p-3 text-sm",children:[o.jsx(co,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),o.jsxs("p",{children:[v," ",o.jsx("a",{href:"/dashboard/integrations",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Open Integrations"})]})]})]})}const ur=[{key:"setup",title:"Complete Setup",description:"Basic agent configuration and tools",icon:zn},{key:"knowledge",title:"Knowledge Center",description:"Upload knowledge sources",icon:rw},{key:"prompt",title:"Prompt Studio",description:"Craft the agent's instructions",icon:qi},{key:"events",title:"Call Events",description:"Moments the agent reports during calls",icon:$g},{key:"testing",title:"Testing",description:"Test before going live",icon:As}],eu=8e3,LS=10,uy=[".pdf",".txt",".md",".doc",".docx"],xpe=()=>{const e=ua(),[t,n]=p.useState(0),[r,a]=p.useState(!1),[s,i]=p.useState({setup:!1,knowledge:!1,prompt:!1,events:!1,testing:!1}),[l,c]=p.useState({agentName:"",website:"",mainGoal:"",transferEnabled:!1,transferNumber:"",industry:"",language:"English",voice:"Elliot",knowledgeText:"",knowledgeFiles:[],systemPrompt:"",greeting:"",callEvents:[],toolKeys:[],testMessage:""}
854),[u,d]=p.useState(!1),f=ur[t],h=Object.values(s).filter(Boolean).length,m=()=>e("/dashboard/ai-agents"),v=(N,S)=>c(_=>({..._,[N]:S})),g=()=>{if(f.key==="setup"){if(!l.agentName.trim())return X.error("Agent name is required"),!1;if(!l.mainGoal.trim())return X.error("Main goal is required"),!1;if(l.transferEnabled&&!l.transferNumber.trim())return X.error("Enter a transfer number or turn off call transfer"),!1;if(l.transferEnabled&&!b8(l.transferNumber))return X.error("Transfer number must be in international format, e.g. +15551234567"),!1;if(!l.industry)return X.error("Please select an industry"),!1}if(f.key==="knowledge"){const N=l.knowledgeText.trim().length>0,S=l.knowledgeFiles.length>0;if(!N&&!S)return X.error("Add knowledge text or upload at least one file before continuing"),!1;if(l.knowledgeText.length>eu)return X.error(`Knowledge text exceeds ${eu.toLocaleString()} characters upload as a file instead`),!1}if(f.key==="prompt"){if(!l.systemPrompt.trim())return X.error("System prompt is required"),!1;if(!l.greeting.trim())return X.error("Greeting message is required"),!1}return!0},y=async()=>{const{data:N,error:S}=await ee.createAgent({name:l.agentName,category:l.industry||"General",voice:l.voice,language:l.language,status:"Active",system_prompt:l.systemPrompt||null,first_message:l.greeting||null,main_goal:l.mainGoal||null,website:l.website||null,transfer_number:l.transferEnabled&&l.transferNumber.trim()||null,knowledge_text:l.knowledgeText||null,call_events:sP(l.callEvents),selected_tool_keys:l.toolKeys});if(S||!(N!=null&&N.id))return X.error(S||"Failed to create agent"),!1;if(l.knowledgeFiles.length>0){let _=0;for(const k of l.knowledgeFiles){const P=await ee.uploadAgentKnowledge(N.id,k);P.error&&(_+=1,X.error(`Failed to upload ${k.name}: ${P.error}`))}_===0&&X.success(`Uploaded ${l.knowledgeFiles.length} knowledge file(s)`)}return!0},x=async()=>{if(g())if(i(N=>({...N,[f.key]:!0})),t<ur.length-1)n(t+1);else{d(!0);try{await y()&&a(!0)}finally{d(!1)}}},b=()=>t>0&&n(t-1),w=N=>{N<=t||s[ur[N].key]?n(N):X.error("Complete the current step first")};return o.jsxs("div",{className:"-mx-4 -my-6 min-h-[calc(100vh-4rem)] bg-muted/30 sm:-mx-6 lg:-mx-8",children:[o.jsxs("div",{className:"sticky top-16 z-20 flex items-start justify-between gap-3 border-b border-border bg-background px-4 py-3 sm:items-center sm:px-6 sm:py-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"bg-gradient-to-r from-primary to-emerald-400 bg-clip-text text-xl font-bold text-transparent sm:text-2xl",children:"Create AI Agent"}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground sm:gap-2 sm:text-sm",children:[o.jsx(jt,{to:"/dashboard/ai-agents",className:"hover:text-primary",children:"AI Agents"}),o.jsx("span",{children:"/"}),o.jsx("span",{children:"Create AI Agent"}),o.jsx("span",{children:"/"}),o.jsx("span",{className:"text-foreground font-medium",children:f.title})]})]}),o.jsx("button",{onClick:m,className:"shrink-0 rounded-md p-2 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 p-4 sm:gap-6 sm:p-6 lg:grid-cols-[280px_1fr]",children:[o.jsxs("aside",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-base font-semibold",children:"Setup Progress"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Completed ",h,"/",ur.length]}),o.jsx("div",{className:"mt-3 h-1.5 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${h/ur.length*100}%`}})})]}),o.jsx("ul",{className:"grid grid-cols-5 gap-2 lg:grid-cols-1",children:ur.map((N,S)=>{const _=S===t,k=s[N.key];return o.jsx("li",{children:o.jsxs("button",{onClick:()=>w(S),className:he("flex h-full w-full flex-col items-center gap-1.5 rounded-xl border px-1.5 py-2.5 text-center transition sm:p-3 lg:flex-row lg:items-start lg:gap-3 lg:text-left",_?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted"),children:[o.jsx("span",{className:he("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",k?"border-primary bg-primary text-primary-foreground":_?"border-primary text-primary":"border-muted-foreground
854/30 text-muted-foreground"),children:k?o.jsx(Ta,{className:"h-3 w-3"}):o.jsx("span",{className:"text-[10px]",children:S+1})}),o.jsxs("div",{className:"min-w-0 lg:flex-1",children:[o.jsx("div",{className:he("text-xs font-medium leading-tight sm:text-sm",_?"text-foreground":"text-muted-foreground"),children:N.title}),_&&o.jsx("div",{className:"mt-0.5 hidden text-xs text-muted-foreground lg:block",children:N.description})]})]})},N.key)})})]}),o.jsxs("section",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm sm:p-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsxs("h2",{className:"text-xl font-bold",children:[f.title," ",o.jsxs("span",{className:"ml-1 text-sm font-normal text-muted-foreground",children:["Step ",t+1," of ",ur.length]})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:f.description})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-background p-3 sm:p-6",children:[f.key==="setup"&&o.jsx(_W,{form:l,update:v}),f.key==="knowledge"&&o.jsx(CW,{form:l,update:v}),f.key==="prompt"&&o.jsx(kW,{form:l,update:v}),f.key==="events"&&o.jsx(NW,{selectedIds:l.callEvents,onChange:N=>v("callEvents",N)}),f.key==="testing"&&o.jsx(EW,{form:l,update:v})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-border pt-4",children:[o.jsxs(ne,{variant:"outline",onClick:b,disabled:t===0,children:[o.jsx(z2,{className:"mr-1.5 h-4 w-4"})," Back"]}),o.jsxs(ne,{onClick:x,disabled:u,className:"bg-primary text-primary-foreground",children:[t===ur.length-1?u?"Creating…":"Create Agent":"Continue",t<ur.length-1&&o.jsx(Wi,{className:"ml-1.5 h-4 w-4"})]})]})]})]}),o.jsx($me,{open:r,agentName:l.agentName,onClose:()=>{a(!1),e("/dashboard/ai-agents")}})]})};function _W({form:e,update:t,statusValue:n,onStatusChange:r,compact:a}){const s=iz,[i,l]=p.useState(!1),c=async()=>{if(!e.website.trim())return X.error("Enter a website URL first");l(!0);const{data:u,error:d}=await ee.analyzeAgentWebsite(e.website.trim());if(l(!1),d)return X.error(d);u!=null&&u.main_goal&&t("mainGoal",u.main_goal),u!=null&&u.industry&&t("industry",u.industry),X.success("Filled in Main Goal"+(u!=null&&u.industry?" and Industry":"")+" from the website")};return o.jsxs("div",{className:a?"space-y-6":"space-y-8",children:[!a&&o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(zn,{className:"h-7 w-7"})}),o.jsx("h3",{className:"mt-3 text-lg font-bold",children:"Complete Agent Setup"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Configure your agent's basic information, purpose, and communication settings"})]}),o.jsxs("div",{children:[o.jsx(dy,{icon:o.jsx(zn,{className:"h-4 w-4 text-primary"}),children:"Basic Information"}),o.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2",children:[o.jsx(ko,{label:"Agent Name",required:!0,children:o.jsx("input",{value:e.agentName,onChange:u=>t("agentName",u.target.value),placeholder:"Enter your agent's name…",className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"})}),o.jsx(ko,{label:"Website (Optional)",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{value:e.website,onChange:u=>t("website",u.target.value),placeholder:"example.com or https://example.com",className:"h-10 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"}),o.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-10 shrink-0 text-primary border-primary/30",onClick:c,disabled:i,children:[i?o.jsx(Te,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):o.jsx(Mi,{className:"mr-1 h-3.5 w-3.5"}),"Analyze"]})]})})]}),o.jsx(ko,{label:"Main Goal",required:!0,className:"mt-4",children:o.jsx("textarea",{value:e.mainGoal,onCh
854ange:u=>t("mainGoal",u.target.value),placeholder:"Describe what you want your agent to accomplish…",rows:4,className:"w-full rounded-md border border-input bg-background p-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"})}),o.jsxs("div",{className:"mt-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-input bg-background/40 p-3",children:[o.jsxs("div",{children:[o.jsx("span",{className:"block text-sm font-medium text-foreground",children:"Call transfer"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Transfer qualified calls to a human phone number."})]}),o.jsx(jh,{checked:e.transferEnabled,onCheckedChange:u=>t("transferEnabled",u)})]}),e.transferEnabled&&o.jsxs(ko,{label:"Transfer Number",required:!0,className:"mt-3",children:[o.jsx("input",{value:e.transferNumber,onChange:u=>t("transferNumber",u.target.value),placeholder:"+15551234567",className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"When a call is qualified, it will be transferred to this number. Use international format, like +15551234567."})]})]}),o.jsxs("div",{className:"mt-6",children:[o.jsx(dy,{icon:o.jsx($g,{className:"h-4 w-4 text-primary"}),children:"Agent tools"}),o.jsx("p",{className:"mb-3 mt-1 text-xs text-muted-foreground",children:"What the agent can do during a call, besides talking. Optional."}),o.jsx(ype,{selectedKeys:e.toolKeys,onChange:u=>t("toolKeys",u)})]}),r&&o.jsx(ko,{label:"Status",className:"mt-4",children:o.jsxs(nt,{value:n??"Active",onValueChange:r,children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Paused",children:"Paused"}),o.jsx(we,{value:"Inactive",children:"Inactive"})]})]})})]}),o.jsxs("div",{children:[o.jsx(dy,{icon:o.jsx(V2,{className:"h-4 w-4 text-primary"}),children:"Business Context"}),o.jsx(ko,{label:"Industry",required:!0,className:"mt-4",children:o.jsx(ipe,{value:e.industry,onChange:u=>t("industry",u)})})]}),o.jsxs("div",{children:[o.jsx(dy,{icon:o.jsx(Mi,{className:"h-4 w-4 text-primary"}),children:"Communication"}),o.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[o.jsx(ko,{label:"Language",children:o.jsxs(nt,{value:e.language,onValueChange:u=>t("language",u),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"English",children:"English"}),o.jsx(we,{value:"Urdu",children:"Urdu"}),o.jsx(we,{value:"Multilingual",children:"Multilingual (auto-detect)"})]})]})}),o.jsx(ko,{label:"Voice",children:o.jsxs(nt,{value:e.voice,onValueChange:u=>t("voice",u),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsx(et,{children:s.map(u=>o.jsx(we,{value:u,children:u},u))})]})})]})]})]})}function CW({form:e,update:t,compact:n}){const r=e.knowledgeText.length,a=r>eu,s=l=>{if(!l)return;const c=[];Array.from(l).forEach(u=>{const d=u.size/1048576,f="."+(u.name.split(".").pop()||"").toLowerCase();if(d>LS){X.error(`${u.name} exceeds ${LS}MB limit`);return}if(!uy.includes(f)){X.error(`${u.name}: unsupported file type (${uy.join(", ")})`);return}c.push(u)}),t("knowledgeFiles",[...e.knowledgeFiles,...c])},i=l=>{t("knowledgeFiles",e.knowledgeFiles.filter((c,u)=>u!==l))};return o.jsxs("div",{className:"space-y-6",children:[!n&&o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(rw,{className:"h-7 w-7"})}),o.jsx("h3",{className:"mt-3 text-lg font-bold",children:"Knowledge Center"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Give your agent the info it needs to answer accurately"})]}),o.jsx("div",{className:"rounded-lg border border-primary/20 bg-primary/5 p-4",children:o.jsxs("div",{className:"flex items-start gap-2.5",children:[o.jsx(Nre,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsx("p",{className:"font-semibold text-foreground",children:"When to use what"}),o.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[o.jsxs("li",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Paste text"}
854)," short FAQs, key policies, scripts (under ",eu.toLocaleString()," characters). Goes straight into the agent's instructions, available instantly on every call."]}),o.jsxs("li",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Upload files"})," product catalogs, full manuals, large documents. The agent retrieves relevant sections during the call."]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"You can use one or both. At least one is required."})]})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-1",children:[o.jsxs("span",{className:"text-sm font-medium",children:["Quick Text ",o.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"  short content"})]}),o.jsxs("span",{className:he("text-xs",a?"text-destructive font-semibold":"text-muted-foreground"),children:[r.toLocaleString()," / ",eu.toLocaleString()]})]}),o.jsx("textarea",{value:e.knowledgeText,onChange:l=>t("knowledgeText",l.target.value),rows:8,placeholder:"Paste FAQs, product info, policies, scripts…",className:he("w-full rounded-md border bg-background p-3 text-sm outline-none focus:ring-2 focus:ring-primary/30",a?"border-destructive":"border-input")}),a&&o.jsx("p",{className:"text-xs text-destructive",children:"This is too long for quick text. Save it as a .txt or .pdf file and upload it below instead."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("span",{className:"block text-sm font-medium",children:["Knowledge Files ",o.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"  large content"})]}),o.jsxs("label",{htmlFor:"knowledge-file-input",className:"flex cursor-pointer flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-input bg-muted/30 px-4 py-8 text-center transition hover:border-primary/40 hover:bg-muted/50",children:[o.jsx(H_,{className:"h-6 w-6 text-muted-foreground"}),o.jsx("div",{className:"text-sm font-medium",children:"Click to upload or drag files here"}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[uy.join(", ")," up to ",LS,"MB each"]}),o.jsx("input",{id:"knowledge-file-input",type:"file",multiple:!0,accept:uy.join(","),className:"hidden",onChange:l=>{s(l.target.files),l.target.value=""}})]}),e.knowledgeFiles.length>0&&o.jsx("ul",{className:"space-y-2",children:e.knowledgeFiles.map((l,c)=>o.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(qi,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsx("span",{className:"truncate text-sm font-medium",children:l.name}),o.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[(l.size/1024).toFixed(1)," KB"]})]}),o.jsx("button",{type:"button",onClick:()=>i(c),className:"rounded-md p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":`Remove ${l.name}`,children:o.jsx(Oa,{className:"h-4 w-4"})})]},`${l.name}-${c}`))})]})]})}function kW({form:e,update:t,compact:n}){return o.jsxs("div",{className:"space-y-6",children:[!n&&o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(qi,{className:"h-7 w-7"})}),o.jsx("h3",{className:"mt-3 text-lg font-bold",children:"Prompt Studio"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define how your agent thinks and speaks"})]}),o.jsx(ko,{label:"System Prompt",required:!0,children:o.jsx("textarea",{value:e.systemPrompt,onChange:r=>t("systemPrompt",r.target.value),rows:n?14:6,placeholder:"You are a friendly assistant who helps users with…",className:"w-full rounded-md border border-input bg-background p-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"})}),o.jsx(ko,{label:"Greeting Message",required:!0,children:o.jsx("input",{value:e.greeting,onChange:r=>t("greeting",r.target.value),placeholder:"Hi! How can I help you today?",className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"})})]})}function EW({form:e,update:t,compact:n}){const[r,a]=p.useState(null),[s,i]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(!1),f=async()=>
854{if(!e.testMessage.trim()){X.error("Type a test message first");return}i(!0),a(null);const{data:v,error:g}=await ee.testAgent({message:e.testMessage,system_prompt:e.systemPrompt||null,first_message:e.greeting||null});if(i(!1),g){X.error(g);return}a((v==null?void 0:v.reply)??"")},h=async()=>{if(!e.agentName.trim()){X.error("Give your agent a name first");return}d(!0);const{data:v,error:g}=await ee.startVoiceTest({name:e.agentName,voice:e.voice||null,language:e.language||null,system_prompt:e.systemPrompt||null,first_message:e.greeting||null});if(d(!1),g||!(v!=null&&v.vapi_assistant_id)){X.error(g||"Could not start the voice test");return}c({id:"voice-test",name:e.agentName,voice:e.voice,language:e.language,vapi_assistant_id:v.vapi_assistant_id})},m=v=>{if(v)return;const g=l==null?void 0:l.vapi_assistant_id;c(null),g&&ee.endVoiceTest(g)};return o.jsxs("div",{className:"space-y-6",children:[!n&&o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(As,{className:"h-7 w-7"})}),o.jsx("h3",{className:"mt-3 text-lg font-bold",children:"Test Your Agent"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Try your agent before going live (optional, you can skip this step)."})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-4 text-center",children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Talk to your agent"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Start a real live voice call with your agent, using its actual voice, prompt and language. No phone number needed."}),o.jsxs(ne,{type:"button",variant:"outline",className:"mt-3 gap-2",onClick:h,disabled:u,children:[u?o.jsx(Te,{className:"h-4 w-4 animate-spin"}):o.jsx(Un,{className:"h-4 w-4"}),u?"Starting…":"Test with voice call"]})]}),o.jsxs("div",{className:"relative text-center text-xs text-muted-foreground",children:[o.jsx("span",{className:"relative z-10 bg-background px-2",children:"or test with a text message"}),o.jsx("div",{className:"absolute left-0 right-0 top-1/2 -z-0 border-t border-border"})]}),o.jsx(ko,{label:"Test Message",children:o.jsx("textarea",{value:e.testMessage,onChange:v=>t("testMessage",v.target.value),rows:4,placeholder:"Type a test prompt for your agent…",className:"w-full rounded-md border border-input bg-background p-3 text-sm outline-none focus:ring-2 focus:ring-primary/30"})}),o.jsxs(ne,{type:"button",onClick:f,disabled:s||!e.testMessage.trim(),children:[o.jsx(As,{className:"mr-2 h-4 w-4"}),s?"Testing…":"Run test"]}),o.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/40 p-4 text-sm",children:s?o.jsx("span",{className:"text-muted-foreground",children:"Getting a response from your agent…"}):r?o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Agent reply"}),o.jsx("p",{className:"whitespace-pre-wrap text-foreground",children:r})]}):o.jsx("span",{className:"text-muted-foreground",children:"The agent's response will appear here after you run a test."})}),o.jsx(m7,{agent:l,open:!!l,onOpenChange:m})]})}function ko({label:e,required:t,children:n,className:r}){return o.jsxs("label",{className:he("block",r),children:[o.jsxs("span",{className:"mb-1.5 block text-sm font-medium",children:[e," ",t&&o.jsx("span",{className:"text-destructive",children:"*"})]}),n]})}function dy({icon:e,children:t}){return o.jsxs("div",{className:"flex items-center gap-2 border-b border-border pb-2",children:[e,o.jsx("h4",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:t})]})}const bpe=e=>e?e==="Multilingual"?"Multilingual":/urdu/i.test(e)?"Urdu":"English":"English",wpe={agentName:"",website:"",mainGoal:"",transferEnabled:!1,transferNumber:"",industry:"",language:"English",voice:"Elliot",knowledgeText:"",knowledgeFiles:[],systemPrompt:"",greeting:"",callEvents:[],toolKeys:[],testMessage:""},hD={setup:!1,knowledge:!1,prompt:!1,events:!1,testing:!1};function jpe({agentId:e,onClose:t,onSaved:n}){const[r,a]=p.useState(!0),[s,i]=p.useState(!1),[l,c]=p.useState(0),[u,d]=p.useState(hD),[f,h]=p.useState("Active"),[m,v]=p.useState(wpe),[g,y]=p.useState(!1);p.useEffect(()=>{if(!e)return;let O=!1;return a(!0),i(!1),c(0),d(hD),(async()=>{const{data:$,error:T}=await ee.getAgent(e);
854if(O)return;if(T||!$){i(!0),a(!1);return}const z=$,U=await ee.getAgentEvents(e);O||(v({agentName:z.name??"",website:z.website??"",mainGoal:z.main_goal??"",industry:z.category??"",language:bpe(z.language),voice:z.voice??"Elliot",transferEnabled:!!z.transfer_number,transferNumber:z.transfer_number??"",knowledgeText:"",knowledgeFiles:[],systemPrompt:z.system_prompt??"",greeting:z.first_message??"",callEvents:(U.data??[]).map(E=>E.library_event_id).filter(E=>!!E),toolKeys:z.selected_tool_keys??[],testMessage:""}),h(z.status??"Active"),a(!1))})(),()=>{O=!0}},[e]);const x=ur[l],b=Object.values(u).filter(Boolean).length,w=(O,$)=>v(T=>({...T,[O]:$})),N=()=>{if(x.key==="setup"){if(!m.agentName.trim())return X.error("Agent name is required"),!1;if(!m.mainGoal.trim())return X.error("Main goal is required"),!1;if(m.transferEnabled&&!m.transferNumber.trim())return X.error("Enter a transfer number or turn off call transfer"),!1;if(m.transferEnabled&&!b8(m.transferNumber))return X.error("Transfer number must be in international format, e.g. +15551234567"),!1;if(!m.industry)return X.error("Please select an industry"),!1}if(x.key==="knowledge"&&m.knowledgeText.length>eu)return X.error(`Knowledge text exceeds ${eu.toLocaleString()} characters — upload as a file instead`),!1;if(x.key==="prompt"){if(!m.systemPrompt.trim())return X.error("System prompt is required"),!1;if(!m.greeting.trim())return X.error("Greeting message is required"),!1}return!0},S=async()=>{if(!e)return!1;const O=m.knowledgeText.trim(),$=O?`${m.systemPrompt.trim()}
855
856Reference knowledge — use this to answer questions accurately:
857${O}`:m.systemPrompt,{error:T}=await ee.updateAgent(e,{name:m.agentName,category:m.industry||"General",voice:m.voice,language:m.language,status:f,system_prompt:$||null,first_message:m.greeting||null,main_goal:m.mainGoal||null,website:m.website||null,transfer_number:m.transferEnabled&&m.transferNumber.trim()||null,call_events:sP(m.callEvents),selected_tool_keys:m.toolKeys});if(T)return X.error(T),!1;if(m.knowledgeFiles.length>0){let z=0;for(const U of m.knowledgeFiles){const E=await ee.uploadAgentKnowledge(e,U);E.error&&(z+=1,X.error(`Failed to upload ${U.name}: ${E.error}`))}z===0&&X.success(`Uploaded ${m.knowledgeFiles.length} knowledge file(s)`)}return!0},_=async()=>{if(N())if(d(O=>({...O,[x.key]:!0})),l<ur.length-1)c(l+1);else{y(!0);try{await S()&&(X.success("Agent updated"),n(),t())}finally{y(!1)}}},k=()=>l>0&&c(l-1),P=O=>c(O);return o.jsx(ft,{open:!!e,onOpenChange:O=>!O&&t(),children:o.jsx(ct,{className:"flex h-[94vh] max-h-[94vh] flex-col overflow-y-auto p-0 max-w-[max(64rem,70vw)]",children:r?o.jsxs("div",{className:"flex min-h-[50vh] items-center justify-center text-sm text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Loading agent…"]}):s?o.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-center",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Agent not found."}),o.jsx(ne,{variant:"outline",onClick:t,children:"Close"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 border-b border-border bg-background px-5 py-3 pr-12 sm:px-6 sm:pr-12",children:[o.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:o.jsx(Ps,{className:"h-5 w-5"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"bg-gradient-to-r from-primary to-emerald-400 bg-clip-text text-lg font-bold text-transparent sm:text-xl",children:"Edit AI Agent"}),o.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground sm:gap-2 sm:text-sm",children:[o.jsx("span",{className:"max-w-[8rem] truncate font-medium text-foreground sm:max-w-none",children:m.agentName||"Edit Agent"}),o.jsx("span",{children:"/"}),o.jsx("span",{className:"text-foreground font-medium",children:x.title})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-4 p-4 sm:gap-5 sm:p-5 lg:grid-cols-[240px_1fr]",children:[o.jsxs("aside",{className:"space-y-4 self-start rounded-2xl border border-border bg-muted/20 p-4 lg:sticky lg:top-0",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-base font-semibold",children:"Edit Progress"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Reviewed ",b,"/",ur.length]}),o.jsx("div",{className:"mt-3 h-1.5 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${b/ur.length*100}%`}})})]}
857),o.jsx("ul",{className:"grid grid-cols-5 gap-2 lg:grid-cols-1",children:ur.map((O,$)=>{const T=$===l,z=u[O.key];return o.jsx("li",{children:o.jsxs("button",{onClick:()=>P($),className:he("flex h-full w-full flex-col items-center gap-1.5 rounded-xl border px-1.5 py-2.5 text-center transition sm:p-3 lg:flex-row lg:items-start lg:gap-3 lg:text-left",T?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted"),children:[o.jsx("span",{className:he("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",z?"border-primary bg-primary text-primary-foreground":T?"border-primary text-primary":"border-muted-foreground/30 text-muted-foreground"),children:z?o.jsx(Ta,{className:"h-3 w-3"}):o.jsx("span",{className:"text-[10px]",children:$+1})}),o.jsxs("div",{className:"min-w-0 lg:flex-1",children:[o.jsx("div",{className:he("text-xs font-medium leading-tight sm:text-sm",T?"text-foreground":"text-muted-foreground"),children:O.title}),T&&o.jsx("div",{className:"mt-0.5 hidden text-xs text-muted-foreground lg:block",children:O.description})]})]})},O.key)})})]}),o.jsxs("section",{className:"rounded-2xl border border-border bg-card p-4 shadow-sm sm:p-6",children:[o.jsxs("div",{className:"mb-5 border-b border-border pb-4",children:[o.jsxs("h2",{className:"text-xl font-bold",children:[x.title," ",o.jsxs("span",{className:"ml-1 text-sm font-normal text-muted-foreground",children:["Step ",l+1," of ",ur.length]})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:x.key==="knowledge"?"Anything you add here is appended to this agent's existing knowledge — you don't need to re-enter what's already there.":x.description})]}),x.key==="setup"&&o.jsx(_W,{form:m,update:w,statusValue:f,onStatusChange:h,compact:!0}),x.key==="knowledge"&&o.jsx(CW,{form:m,update:w,compact:!0}),x.key==="prompt"&&o.jsx(kW,{form:m,update:w,compact:!0}),x.key==="events"&&o.jsx(NW,{selectedIds:m.callEvents,onChange:O=>w("callEvents",O),compact:!0}),x.key==="testing"&&o.jsx(EW,{form:m,update:w,compact:!0}),o.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-border pt-4",children:[o.jsxs(ne,{variant:"outline",onClick:k,disabled:l===0,children:[o.jsx(z2,{className:"mr-1.5 h-4 w-4"})," Back"]}),o.jsxs(ne,{onClick:_,disabled:g,className:"bg-primary text-primary-foreground",children:[l===ur.length-1?g?"Saving…":"Save Changes":"Continue",l<ur.length-1&&o.jsx(Wi,{className:"ml-1.5 h-4 w-4"})]})]})]})]})]})})})}function AW({title:e,description:t,actions:n}){return o.jsxs("div",{className:"flex flex-col gap-3 border-b border-border pb-5 sm:flex-row sm:items-start sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}),t&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),n&&o.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n})]})}const Oc="All statuses",Mc="All categories",mx="All time",Spe=["All time","Last 7 days","Last 30 days","This year"];function Npe({placeholder:e="Search…",value:t,onChange:n,extra:r,status:a,onStatusChange:s,statusOptions:i=["Active","Inactive","Paused"],category:l,onCategoryChange:c,categoryOptions:u,dateRange:d,onDateRangeChange:f,dateRangeOptions:h=Spe}){const[m,v]=p.useState(!1),[g,y]=p.useState(Oc),[x,b]=p.useState(Mc),[w,N]=p.useState(mx),S=a??g,_=l??x,k=d??w,P=u!==void 0,O=E=>{y(E),s==null||s(E)},$=E=>{b(E),c==null||c(E)},T=E=>{N(E),f==null||f(E)},z=(t??"").length>0||S!==Oc||_!==Mc||k!==mx,U=()=>{n==null||n(""),O(Oc),P&&$(Mc),T(mx)};return o.jsxs("div",{className:"rounded-xl border border-border bg-card p-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(du,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(ve,{value:t??"",onChange:E=>n==null?void 0:n(E.target.value),placeholder:e,className:"pl-9"})]}),o.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>v(E=>!E),className:he(m&&"border-primary text-primary"),children:[o.jsx($re,{className:"mr-2 h-4 w-4"}),"Advanced"]}),z&&o.jsxs(ne,{variant:"ghost",size:"sm",onClick:U,className:"text-muted-foreground hover:text-foreground",children:[o.jsx(rn,{className:"mr-2 h-4 w-4"}),"Clear"]}),r]}),m&&o.jsxs("div",{className:he("mt-3 grid gap-2 border-t border-border pt-3",P?"sm:grid-cols-3":"sm:grid-cols-2"),children:[o.jsxs(nt,{value:S,onValueChange:O,children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:Oc,children:Oc}),i.map(E=>o.jsx(we,{value:E,children:E},E))]})]}),P&&o.jsxs(nt,{value:_,onValueChange:$,children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:Mc,children:Mc}),(u??[]).map(E=>o.jsx(we,{value:E,children:E},E))]})]}),o.jsxs(nt,{value:k,onValueChange:T,children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsx(et,{children:h.map(E=>o.jsx(we,{value:E,children:E},E))})]})]})]})}const _pe={success:{wrap:"bg-primary/15 text-primary border-primary/30",dot:"bg-primary shadow-[0_0_8px_hsl(var(--primary)/0.6)] animate-pulse"},muted:{wrap:"bg-muted text-muted-foreground border-border",dot:"bg-muted-foreground"}
857,warning:{wrap:"bg-warning/15 text-warning border-warning/30",dot:"bg-warning"},destructive:{wrap:"bg-destructive/15 text-destructive border-destructive/30",dot:"bg-destructive"},info:{wrap:"bg-info/15 text-info border-info/30",dot:"bg-info"}},Cpe={Active:"success",Completed:"success",Inactive:"muted",Queued:"muted",Paused:"warning",Ringing:"info",Pending:"warning","In Progress":"info",Initiated:"info",Error:"destructive",Unsuccessful:"destructive"};function PW({status:e,className:t}){const n=Cpe[e]??"muted",r=_pe[n];return o.jsxs("span",{className:he("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium",r.wrap,t),children:[o.jsx("span",{className:he("h-1.5 w-1.5 rounded-full",r.dot)}),e]})}var TW="AlertDialog",[kpe,Hqe]=Gr(TW,[J9]),Gi=J9(),OW=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gi(t);return o.jsx(XA,{...r,...n,modal:!0})};OW.displayName=TW;var Epe="AlertDialogTrigger",Ape=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Gi(n);return o.jsx(Xhe,{...a,...r,ref:t})});Ape.displayName=Epe;var Ppe="AlertDialogPortal",MW=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gi(t);return o.jsx(JA,{...r,...n})};MW.displayName=Ppe;var Tpe="AlertDialogOverlay",IW=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Gi(n);return o.jsx(qw,{...a,...r,ref:t})});IW.displayName=Tpe;var Jd="AlertDialogContent",[Ope,Mpe]=kpe(Jd),Ipe=lB("AlertDialogContent"),$W=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,s=Gi(n),i=p.useRef(null),l=at(t,i),c=p.useRef(null);return o.jsx(Hhe,{contentName:Jd,titleName:DW,docsSlug:"alert-dialog",children:o.jsx(Ope,{scope:n,cancelRef:c,children:o.jsxs(Hw,{role:"alertdialog",...s,...a,ref:l,onOpenAutoFocus:xe(a.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx(Ipe,{children:r}),o.jsx(Dpe,{contentRef:i})]})})})});$W.displayName=Jd;var DW="AlertDialogTitle",RW=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Gi(n);return o.jsx(QA,{...a,...r,ref:t})});RW.displayName=DW;var LW="AlertDialogDescription",FW=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Gi(n);return o.jsx(ZA,{...a,...r,ref:t})});FW.displayName=LW;var $pe="AlertDialogAction",BW=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Gi(n);return o.jsx(eP,{...a,...r,ref:t})});BW.displayName=$pe;var zW="AlertDialogCancel",UW=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Mpe(zW,n),s=Gi(n),i=at(t,a);return o.jsx(eP,{...s,...r,ref:i})});UW.displayName=zW;var Dpe=({contentRef:e})=>{const t=`\`${Jd}\` requires a description for the component to be accessible for screen reader users.
858
859You can add a description to the \`${Jd}\` by passing a \`${LW}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
860
861Alternatively, 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 \`${Jd}\`. 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.
862
863For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rpe=OW,Lpe=MW,VW=IW,WW=$W,qW=BW,HW=UW,GW=RW,YW=FW;const Is=Rpe,Fpe=Lpe,KW=p.forwardRef(({className:e,...t},n)=>o.jsx(VW,{className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));KW.displayName=VW.displayName;const Yo=p.forwardRef(({className:e,...t},n)=>o.jsxs(Fpe,{children:[o.jsx(KW,{}),o.jsx(WW,{ref:n,className:he("fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100vh-2rem)] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto border bg-background p-4 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 sm:p-6",e),...t})]}));
863Yo.displayName=WW.displayName;const Ko=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ko.displayName="AlertDialogHeader";const Xo=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xo.displayName="AlertDialogFooter";const Jo=p.forwardRef(({className:e,...t},n)=>o.jsx(GW,{ref:n,className:he("text-lg font-semibold",e),...t}));Jo.displayName=GW.displayName;const Qo=p.forwardRef(({className:e,...t},n)=>o.jsx(YW,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));Qo.displayName=YW.displayName;const Zo=p.forwardRef(({className:e,...t},n)=>o.jsx(qW,{ref:n,className:he(Ap(),e),...t}));Zo.displayName=qW.displayName;const es=p.forwardRef(({className:e,...t},n)=>o.jsx(HW,{ref:n,className:he(Ap({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));es.displayName=HW.displayName;const Bpe=()=>{const e=ua(),[t,n]=p.useState(""),[r,a]=p.useState(Oc),[s,i]=p.useState(Mc),[l,c]=p.useState(mx),[u,d]=p.useState([]),[f,h]=p.useState(null),[m,v]=p.useState(null),[g,y]=p.useState(null),[x,b]=p.useState(null),w=async()=>{const{data:$,error:T}=await ee.getAgents();if(T){X.error(T),d([]);return}d($??[])};p.useEffect(()=>{w()},[]);const N=async()=>{if(!g)return;const{error:$}=await ee.deleteAgent(g.id);if(y(null),$)return X.error($);X.success("Agent deleted"),w()},S=async()=>{if(!x)return;const $=x,T=await ee.getAgentEvents($.id),z=sP((T.data??[]).map(E=>E.library_event_id).filter(E=>!!E)),{error:U}=await ee.createAgent({call_events:z,selected_tool_keys:$.selected_tool_keys??[],name:`${$.name} (Copy)`,voice:$.voice,language:$.language,category:$.category,status:$.status,system_prompt:$.system_prompt,first_message:$.first_message});if(b(null),U)return X.error(U);X.success("Agent duplicated"),w()},_=$=>{h($)},k=Array.from(new Set(u.map($=>$.category).filter($=>!!$))).sort(),P=$=>{const T=new Date;return $==="Last 7 days"?new Date(T.getTime()-7*24*60*60*1e3):$==="Last 30 days"?new Date(T.getTime()-30*24*60*60*1e3):$==="This year"?new Date(T.getFullYear(),0,1):null},O=u.filter($=>{if(!$.name.toLowerCase().includes(t.toLowerCase())||r!==Oc&&$.status!==r||s!==Mc&&$.category!==s)return!1;const T=P(l);return!(T&&new Date($.created_at)<T)});return o.jsxs("div",{className:"space-y-6",children:[o.jsx(AW,{title:"AI Agents",description:"Build and manage your AI agents in one place.",actions:o.jsxs(ne,{onClick:()=>e("/dashboard/ai-agents/create"),className:"bg-primary text-primary-foreground hover:opacity-90",children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Add New Agent"]})}),o.jsx(Npe,{value:t,onChange:n,placeholder:"Search agents…",status:r,onStatusChange:a,category:s,onCategoryChange:i,categoryOptions:k,dateRange:l,onDateRangeChange:c}),O.length===0?o.jsx("div",{className:"rounded-xl border border-border bg-card p-12 text-center text-sm text-muted-foreground",children:"No agents found."}):o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:O.map($=>{var T;return o.jsxs("div",{className:"flex flex-col rounded-xl border border-border bg-card p-5 transition hover:border-primary/40 hover:shadow-sm",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary font-semibold",children:(T=$.name[0])==null?void 0:T.toUpperCase()}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"break-words font-semibold leading-tight",children:$.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:$.category??" "})]})]}),o.jsx(PW,{status:$.status,className:"shrink-0"})]}),o.jsxs("dl",{className:"mb-5 mt-5 space-y-1.5 text-sm",children:[o.jsx(FS,{label:"Voice",value:$.voice??" "}),o.jsx(FS,{label:"Language",value:$.language??" "}),o.jsx(FS,{label:"Created",value:new Date($.created_at).toLocaleDateString()})]}),o.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-4",children:[o.jsxs(ne,{size:"sm",variant:"outline",className:"text-primary border-primary/40",onClick:()=>_($),children:[o.jsx(As,{className:"mr-1.5 h-4 w-4"})," Test"]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{title:"Settings",onClick:()=>v($.id),className:"rounded-md p-2 text-muted-foreground hover:bg-muted sm:p-1.5",children:o.jsx(Ps,{className:"h-4 w-4"})}),o.jsx("button",{title:"Duplicate",onClick:()=>b($),className:"rounded-md p-2 text-muted-foreground hover:bg-muted sm:p-1.5",children:o.jsx(ow,{className:"h-4 w-4"})}),o.jsx("button",{title:"Delete",onClick:()=>y($),className:"rounded-md p-2 text-destructive hover:bg-destructive/10 sm:p-1.5",children:o.jsx(Oa,{className:"h-4 w-4"})})]})]})]},$.id)})}),o.jsx(Is,{open:!!g,onOpenChange:$=>{$||y(null)},children:o.jsxs(Yo,{children:[o.jsxs(Ko,{className:"text-center sm:text-center",children:[o.jsx(Jo,{children:"Are you sure?"}),o.jsxs(Qo,{children:[g&&`"${g.name}
863" will be permanently deleted. `,"This can't be undone."]})]}),o.jsxs(Xo,{className:"sm:justify-center",children:[o.jsx(es,{children:"Cancel"}),o.jsx(Zo,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),o.jsx(Is,{open:!!x,onOpenChange:$=>{$||b(null)},children:o.jsxs(Yo,{children:[o.jsxs(Ko,{className:"text-center sm:text-center",children:[o.jsx(Jo,{children:"Are you sure?"}),o.jsx(Qo,{children:x&&`A copy of "${x.name}" will be created.`})]}),o.jsxs(Xo,{className:"sm:justify-center",children:[o.jsx(es,{children:"Cancel"}),o.jsx(Zo,{onClick:S,children:"Duplicate"})]})]})}),o.jsx(m7,{agent:f,open:!!f,onOpenChange:$=>{$||h(null)}}),o.jsx(jpe,{agentId:m,onClose:()=>v(null),onSaved:w})]})};function FS({label:e,value:t}){return o.jsxs("div",{className:"flex justify-between",children:[o.jsx("dt",{className:"text-muted-foreground",children:e}),o.jsx("dd",{className:"font-medium text-foreground",children:t})]})}const Zl=p.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:he("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
863ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Zl.displayName="Textarea";const zpe=[{id:1,name:"Elliot",language:"English",accent:"Canadian",gender:"Male",description:"Realistic, friendly, professional, soothing",favorite:!1},{id:2,name:"Savannah",language:"English",accent:"American (Southern)",gender:"Female",description:"Realistic, straightforward",favorite:!1},{id:3,name:"Rohan",language:"English",accent:"Indian American",gender:"Male",description:"Realistic, bright, energetic",favorite:!1},{id:4,name:"Emma",language:"English",accent:"Asian American",gender:"Female",description:"Realistic, warm, conversational",favorite:!1},{id:5,name:"Clara",language:"English",accent:"American",gender:"Female",description:"Realistic, warm, professional",favorite:!1},{id:6,name:"Nico",language:"English",accent:"American",gender:"Male",description:"Realistic, young, casual, natural",favorite:!1},{id:7,name:"Kai",language:"English",accent:"American",gender:"Male",description:"Realistic, friendly, relaxed, approachable",favorite:!1},{id:8,name:"Sagar",language:"English",accent:"Indian American",gender:"Male",description:"Realistic, steady, professional",favorite:!1},{id:9,name:"Godfrey",language:"English",accent:"American",gender:"Male",description:"Realistic, young, energetic",favorite:!1},{id:10,name:"Neil",language:"English",accent:"Indian American",gender:"Male",description:"Realistic, clear, professional",favorite:!1},{id:11,name:"Layla",language:"English",accent:"American",gender:"Female",description:"Realistic, warm, bright, cheerful",favorite:!1},{id:12,name:"Sid",language:"English",accent:"American",gender:"Male",description:"Realistic, laid-back, smooth, deep-toned",favorite:!1},{id:13,name:"Naina",language:"English",accent:"Indian American",gender:"Female",description:"Realistic, calm, collected, professional",favorite:!1},{id:14,name:"Zara",language:"Urdu",accent:"Pakistani",gender:"Female",description:"Realistic, warm, professional",favorite:!1},{id:15,name:"Ali",language:"Urdu",accent:"Pakistani",gender:"Male",description:"Realistic, steady, professional",favorite:!1}],xa={provider:"deepgram",language:"en"},mD={provider:"deepgram",language:"ur",model:"nova-3"},Upe={elliot:{voice:{provider:"vapi",voiceId:"Elliot"},transcriber:xa},savannah:{voice:{provider:"vapi",voiceId:"Savannah"},transcriber:xa},rohan:{voice:{provider:"vapi",voiceId:"Rohan"},transcriber:xa},emma:{voice:{provider:"vapi",voiceId:"Emma"},transcriber:xa},clara:{voice:{provider:"vapi",voiceId:"Clara"},transcriber:xa},nico:{voice:{provider:"vapi",voiceId:"Nico"},transcriber:xa},kai:{voice:{provider:"vapi",voiceId:"Kai"},transcriber:xa},sagar:{voice:{provider:"vapi",voiceId:"Sagar"},transcriber:xa},godfrey:{voice:{provider:"vapi",voiceId:"Godfrey"},transcriber:xa},neil:{voice:{provider:"vapi",voiceId:"Neil"},transcriber:xa},layla:{voice:{provider:"vapi",voiceId:"Layla"},transcriber:xa},sid:{voice:{provider:"vapi",voiceId:"Sid"},transcriber:xa},naina:{voice:{provider:"vapi",voiceId:"Naina"},transcriber:xa},zara:{voice:{provider:"11labs",voiceId:"21m00Tcm4TlvDq8ikWAM",model:"eleven_multilingual_v2"},transcriber:mD},ali:{voice:{provider:"11labs",voiceId:"pNInz6obpgDQGcFmaJgB",model:"eleven_multilingual_v2"},transcriber:mD}},pD="80eb288d-0508-4459-8e24-fb76da4ebdf1".trim();function Vpe(e){var n;const t=((n=e==null?void 0:e.error)==null?void 0:n.message)??(e==null?void 0:e.message)??(e==null?void 0:e.error)??"Voice preview failed";if(typeof t=="string")return t;if(t&&typeof t=="object"){if(Array.isArray(t.message))return t.message.join(" ");if(typeof t.message=="string")return t.message;if(typeof t.error=="string")return t.error}try{return JSON.stringify(t)}catch{return"Voice preview failed"}}const Wpe=()=>{const[e,t]=p.useState(()=>{if(typeof window>"u")return[];try{return JSON.parse(window.localStorage.getItem("favorite:voices")??"[]")}catch{return[]}}),[n]=p.useState(()=>{if(typeof window>"u")return[];try{return JSON.parse(window.localStorage.getItem("hidden:voices")??"[]")}catch{return[]}}),[r,a]=p.useState(null),[s,i]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(null),f=p.useRef(null),h=S=>{t(S),typeof window<"u"&&window.localStorage.setItem("favorite:voices",JSON.stringify(S))},v=zpe.map(S=>({id:`mock_${S.id}`,name:S.name,language:S.language,accent:S.accent,gender:S.gender,description:S.description,favorite:S.favorite})).filter(S=>!n.includes(S.id)).map(S=>({...S,favorite:e.includes(S.id)?!0:S.favorite})),g=S=>{const k=e.includes(S.id)?e.filter(P=>P!==S.id):[...e,S.id];h(k)},y=S=>/^[aeiou]/i.test(S)?"an":"a",x=S=>{a(S),i(S.language==="Urdu"?`Assalam-o-alaikum, mera naam ${S.name}
863 hai. Main aapke AI agent ki awaaz ban ${S.gender==="Female"?"sakti":"sakta"} hoon.`:`Hi, I'm ${S.name}. I speak ${S.language}${S.accent?` with ${y(S.accent)} ${S.accent} accent`:""}. I'd love to be the voice of your next AI agent.`),c(!1),d(null)},b=()=>{var S;try{(S=f.current)==null||S.stop()}catch{}f.current=null},w=async()=>{if(!r)return;if(!pD){d("Voice preview is not configured. Please contact support.");return}const S=Upe[r.name.toLowerCase()];if(!S){d(`No voice mapping found for "${r.name}".`);return}d(null),c(!0);try{const _=new K9(pD);f.current=_,_.on("call-start",()=>{_.say(s,!0)}),_.on("call-end",()=>{c(!1),f.current=null}),_.on("error",k=>{const P=Vpe(k);X.error(P.includes("Permission denied")||P.toLowerCase().includes("ejection")?"Voice preview needs microphone access to connect the call (you won't need to speak).":P),c(!1),f.current=null,a(null)}),await _.start({name:`Preview: ${r.name}`,transcriber:S.transcriber,model:{provider:"openai",model:"gpt-4o-mini",messages:[{role:"system",content:"Stay silent until told to speak."}]},voice:S.voice,maxDurationSeconds:20})}catch(_){X.error((_==null?void 0:_.message)??"Failed to start voice preview"),c(!1),b(),a(null)}},N=()=>{b(),c(!1)};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"AI Voices"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and preview voices for your agents."})]}),o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:v.map(S=>o.jsxs("div",{className:"flex flex-col rounded-xl border border-border bg-card p-5 card-interactive",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(Oi,{className:"h-5 w-5"})}),o.jsx("div",{className:"flex items-center gap-1",children:o.jsx("button",{onClick:()=>g(S),className:"rounded-md p-2 hover:bg-muted sm:p-1","aria-label":"Toggle favorite",title:S.favorite?"Unfavorite":"Favorite",children:o.jsx(h8,{className:`h-4 w-4 ${S.favorite?"fill-warning text-warning":"text-muted-foreground"}`})})})]}),o.jsx("h3",{className:"mt-4 font-semibold text-foreground",children:S.name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[S.language," · ",S.accent||" "," · ",S.gender||S.category||" "]}),S.description&&o.jsx("p",{className:"mt-1 text-xs italic text-muted-foreground/80",children:S.description}),o.jsx("div",{className:"mt-auto flex items-center gap-2 pt-4",children:o.jsxs("button",{onClick:()=>x(S),className:"inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-xs font-medium hover:bg-muted sm:py-1.5",children:[o.jsx(Gl,{className:"h-3 w-3"})," Preview"]})})]},S.id))}),o.jsx(ft,{open:!!r,onOpenChange:S=>{S||(N(),a(null))},children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsxs(xt,{className:"flex items-center gap-2",children:[o.jsx(Oi,{className:"h-5 w-5 text-primary"}),"Preview ",r==null?void 0:r.name]}),o.jsxs(wt,{children:[r==null?void 0:r.language," · ",(r==null?void 0:r.accent)||" "," · ",(r==null?void 0:r.gender)||(r==null?void 0:r.category)||" "]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(ke,{htmlFor:"preview-text",children:"Sample text"}),o.jsx(Zl,{id:"preview-text",className:"h-28",value:s,onChange:S=>i(S.target.value)}),u?o.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx(co,{className:"mt-0.5 h-4 w-4 shrink-0"}),o.jsx("span",{children:u})]}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Plays a live sample using this voice's real model, the same voice your agents actually use on calls. Your browser will ask for microphone access even though you won't need to speak."})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>{N(),a(null)},children:"Close"}),l?o.jsxs(ne,{onClick:N,variant:"destructive",children:[o.jsx(Mg,{className:"mr-2 h-4 w-4"})," Stop"]}):o.jsxs(ne,{onClick:w,disabled:!s.trim(),children:[o.jsx(Gl,{className:"mr-2 h-4 w-4"})," Play Preview"]})]})]})})]})},qpe=nw("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function _n({className:e,variant:t,...n}){return o.jsx("div",{className:he(qpe({variant:t}),e),...n})}const Hpe=()=>{const{user:e}=vh(),[t,n]=p.useState(""),[r,a]=p.useState(""),[s,i]=p.useState(""),[l,c]=p.useState(!0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,v]=p.useState([]),[g,y]=p.useState(null),[x,b]=p.useState(!1),[w,N]=p.useState(""),[S,_]=p.useState("member"),[k,P]=p.useState(!1),O=async()=>{const[L,M,B]=await Promise.all([ee.getProfile(),ee.getTeam(),ee.getMyRole()]);L.data&&(n(L.data.full_name??""),a(L.data.company_name??""),i(L.data.phone??"")),Array.isArray(M.data)&&v(M.data),B.data&&y(B.data),c(!1)};p.useEffect(()=>{e&&O()},[e]);const $=async L=>{if(L.preventDefault(),!e)return;d(!0);const{error:M}=await ee.updateProfile({full_name:t,company_name:r,phone:s});if(d(!1),M)return X.error(M);X.success("Profile saved"),h(!1)},T=()=>{O(),h(!1)},z=async()=>
863{if(!w)return X.error("Enter an email");P(!0);const{data:L,error:M}=await ee.inviteTeamMember({member_email:w,role:S});if(P(!1),M)return X.error(M);X.success(L!=null&&L.email_sent?`Invite email sent to ${w}`:`${w} added, but the invite email couldn't be sent — share the accept-invite link with them manually.`),N(""),_("member"),b(!1),O()},U=async L=>{if(!confirm("Remove this team member?"))return;const{error:M}=await ee.removeTeamMember(L);if(M)return X.error(M);X.success("Member removed"),O()},E=async(L,M)=>{const{error:B}=await ee.updateTeamMember(L,{role:M});if(B)return X.error(B);X.success("Role updated"),O()},q=(g==null?void 0:g.is_owner)??!0,W=(t||(e==null?void 0:e.email)||"?").split(" ").map(L=>L[0]).filter(Boolean).slice(0,2).join("").toUpperCase();return o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Profile & Teams"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your account and invite collaborators."})]}),g&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(J2,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"Your role:"}),o.jsx(_n,{variant:q?"default":"secondary",className:"capitalize",children:q?"Account Owner":g.role==="viewer"?"Viewer (read-only)":"Member"})]}),o.jsxs("section",{className:"rounded-xl border border-border bg-card p-6",children:[o.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[o.jsx("h2",{className:"font-semibold text-foreground",children:"Your profile"}),!l&&!f&&o.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[o.jsx(lw,{className:"mr-2 h-4 w-4"}),"Edit"]})]}),l?o.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):f?o.jsxs("form",{onSubmit:$,className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Full name"}),o.jsx(ve,{value:t,onChange:L=>n(L.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Email"}),o.jsx(ve,{value:(e==null?void 0:e.email)??"",disabled:!0})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Company"}),o.jsx(ve,{value:r,onChange:L=>a(L.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Phone"}),o.jsx(ve,{value:s,onChange:L=>i(L.target.value)})]}),o.jsxs("div",{className:"sm:col-span-2 flex justify-end gap-2",children:[o.jsx(ne,{type:"button",variant:"outline",onClick:T,disabled:u,children:"Cancel"}),o.jsxs(ne,{type:"submit",disabled:u,children:[u&&o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Save changes"]})]})]}):o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-full bg-primary text-lg font-semibold text-primary-foreground",children:W}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"truncate text-lg font-semibold text-foreground",children:t||"Unnamed"}),o.jsx("div",{className:"truncate text-sm text-muted-foreground",children:(e==null?void 0:e.email)??"—"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsx(BS,{icon:hh,label:"Email",value:(e==null?void 0:e.email)??"—"}),o.jsx(BS,{icon:fre,label:"Company",value:r||"Not set"}),o.jsx(BS,{icon:Un,label:"Phone",value:s||"Not set"})]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[o.jsx("h2",{className:"font-semibold text-foreground",children:"Team Members"}),q&&o.jsxs(ne,{variant:"outline",onClick:()=>b(!x),children:[x?o.jsx(rn,{className:"mr-2 h-4 w-4"}
863):o.jsx(uw,{className:"mr-2 h-4 w-4"}),x?"Cancel":"Add Collaborator"]})]}),x&&q&&o.jsxs("div",{className:"mb-4 rounded-xl border border-border bg-card p-5 space-y-4",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Invite a Collaborator"}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Email"}),o.jsx(ve,{type:"email",placeholder:"[email protected]",value:w,onChange:L=>N(L.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Role"}),o.jsxs(nt,{value:S,onValueChange:_,children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"member",children:"Member (can create & edit)"}),o.jsx(we,{value:"viewer",children:"Viewer (read-only)"})]})]})]})]}),o.jsx("div",{className:"flex justify-end",children:o.jsxs(ne,{onClick:z,disabled:k,children:[k&&o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Send Invite"]})})]}),o.jsx("div",{className:"overflow-hidden rounded-xl border border-border",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-4 py-3",children:"Email"}),o.jsx("th",{className:"px-4 py-3",children:"Role"}),o.jsx("th",{className:"px-4 py-3",children:"Status"}),q&&o.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),o.jsxs("tbody",{children:[m.map(L=>o.jsxs("tr",{className:"border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 font-medium text-foreground",children:L.member_email}),o.jsx("td",{className:"px-4 py-3",children:q?o.jsxs(nt,{value:L.role,onValueChange:M=>E(L.id,M),children:[o.jsx(Ze,{className:"h-8 w-32 text-xs",children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"member",children:"Member"}),o.jsx(we,{value:"viewer",children:"Viewer"})]})]}):o.jsx(_n,{variant:"outline",className:"capitalize",children:L.role})}),o.jsx("td",{className:"px-4 py-3",children:o.jsx(_n,{variant:L.status==="Active"?"default":"secondary",children:L.status})}),q&&o.jsx("td",{className:"px-4 py-3 text-right",children:o.jsx(ne,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>U(L.id),children:o.jsx(Oa,{className:"h-4 w-4"})})})]},L.id)),m.length===0&&!l&&o.jsx("tr",{children:o.jsxs("td",{colSpan:q?4:3,className:"px-4 py-8 text-center text-muted-foreground",children:["No team members yet. ",q&&'Click "Add Collaborator" to invite someone.']})})]})]})})}),!q&&o.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:["You are a team member. Only account owners can invite, remove, or change the role of collaborators. Sub-users cannot delete any resources",(g==null?void 0:g.role)==="viewer"&&", and as a Viewer you have read-only access — creating or editing anything is disabled","."]})]})]})};function BS({icon:e,label:t,value:n}){return o.jsxs("div",{className:"flex min-w-0 items-center gap-3 rounded-lg border border-border bg-muted/30 p-3",children:[o.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:o.jsx(e,{className:"h-4 w-4"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:t}),o.jsx("div",{className:"break-words text-sm font-medium text-foreground sm:truncate",children:n})]})]})}const Gpe=[{q:"How do I create my first AI agent?",a:"Go to AI Agents and click Add New Agent. The guided setup walks you through the agent's name, goal, industry, language and voice, its knowledge, and its system prompt and greeting, then lets you test it with a live voice call in your browser before you save."},{q:"How do I get a phone number?",a:"Go to Phone Numbers and click Buy Number. Choose whether it's for inbound, outbound or both, optionally assign an agent, and confirm. A US local number is provisioned to your account for $3/month, paid from your balance or by card if your balance is too low."},{q:"How does billing work?",a:"Nexus is pay-as-you-go — no subscription. Calls are billed per minute at the rate shown on your Billing page, deducted from your credit balance. Add funds manually or turn on auto recharge so you're never interrupted mid-campaign."},{q:"How do I import my contacts?",a:"Go to Database > Contacts and click Import CSV, or add contacts one by one. Organize them into Lists so you can target a specific group when launching an outbound campaign."},{q:"How do outbound campaigns work?",a:"Under Outbound > Campaigns, create a campaign by picking an agent, a contact list, and a phone number to call from. Start, pause, or resume it anytime, and track qualified leads and completed calls as it runs."},{q:"Can an agent answer incoming calls?",a:"Yes — set up an AI Receptionist under Inbound to route incoming calls to an agent, and review every call afterward 
863in Inbound > Call Logs."},{q:"Where can I listen to call recordings and transcripts?",a:"Open All Conversations and click any call to view its recording, full transcript, and AI-generated summary."},{q:"Is my data secure?",a:"Data is encrypted in transit, access to your account is protected by your login, and card details are handled by Stripe — they never touch our servers."}],Ype=()=>o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Support"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Find answers fast or get in touch with our team."})]}),o.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:[{icon:n8,label:"Help Center",desc:"Articles & guides"},{icon:K2,label:"Live Chat",desc:"Mon–Fri, 9–6 ET"},{icon:hh,label:"Email",desc:"[email protected]"}].map(e=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 card-interactive",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(e.icon,{className:"h-5 w-5"})}),o.jsx("h3",{className:"mt-4 font-semibold text-foreground",children:e.label}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e.desc})]},e.label))}),o.jsxs("section",{children:[o.jsx("h2",{className:"mb-3 font-semibold text-foreground",children:"Frequently asked questions"}),o.jsx(kz,{type:"single",collapsible:!0,className:"rounded-xl border border-border bg-card px-4",children:Gpe.map((e,t)=>o.jsxs(wA,{value:`f${t}`,children:[o.jsx(jA,{className:"text-left",children:e.q}),o.jsx(SA,{children:e.a})]},t))})]})]}),Kpe=()=>{var l;const[e,t]=p.useState(null),[n,r]=p.useState(!0),a=p.useCallback(async()=>{const{data:c}=await ee.getMyReferrals();c&&t(c),r(!1)},[]);p.useEffect(()=>{a()},[a]);const s=e!=null&&e.code?`${window.location.origin}/register?ref=${e.code}`:"",i=()=>{navigator.clipboard.writeText(s),X.success("Referral link copied")};return n?o.jsxs("div",{className:"flex items-center justify-center py-14 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading..."]}):o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Referrals"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Share your link. Anyone who signs up through it is tracked as your referral."})]}),o.jsxs("div",{className:"flex max-w-xl gap-2",children:[o.jsx(ve,{readOnly:!0,value:s,className:"min-w-0 text-ellipsis font-mono text-sm"}),o.jsxs(ne,{type:"button",onClick:i,className:"gap-2",children:[o.jsx(ow,{className:"h-4 w-4"})," Copy"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 max-w-xl",children:[o.jsxs("div",{className:"rounded-xl border border-border bg-card/40 p-5",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[o.jsx(qre,{className:"h-4 w-4"})," Invited"]}),o.jsx("div",{className:"mt-2 text-2xl font-bold text-foreground",children:(e==null?void 0:e.invited_count)??0})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card/40 p-5",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[o.jsx(tr,{className:"h-4 w-4"})," Verified"]}),o.jsx("div",{className:"mt-2 text-2xl font-bold text-foreground",children:(e==null?void 0:e.verified_count)??0})]})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Referral activity"}),(l=e==null?void 0:e.referrals)!=null&&l.length?o.jsx("div",{className:"mt-4 overflow-hidden rounded-xl border border-border",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Referee"}),o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Status"}),o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Invited"})]})}),o.jsx("tbody",{children:e.referrals.map(c=>o.jsxs("tr",{className:"border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-3 py-3 text-foreground sm:px-4",children:c.referee_email}),o.jsx("td",{className:"px-3 py-3 sm:px-4",children:o.jsx("span",{className:c.status==="verified"?"text-green-500 font-medium":"text-muted-foreground",children:c.status==="verified"?"Verified":"Pending"})}),o.jsx("td",{className:"whitespace-nowrap px-3 py-3 text-muted-foreground sm:px-4",children:new Date(c.created_at).toLocaleDateString()})]},c.id))})]})})}):o.jsxs("div",{className:"mt-4 rounded-xl border border-dashed border-border bg-card/40 py-14 text-center",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:"No referrals yet"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Share your link to start inviting people"})]})]})]})};function _t(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ma(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Br(e,t){const n=_t(e);return isNaN(t)?Ma(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ts(e,t){const n=_t(e);if(isNaN(t))return Ma(e,NaN);if(!t)return n;const r=n.getDate(),a=Ma(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const s=a.getDate();return r>=s?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}const iP=6048e5,Xpe=864e5;let Jpe={};function Xg(){return Jpe}function $s(e,t){var l,c,u,d;const n=Xg(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=_t(e),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function wu(e){return $s(e,{weekStartsOn:1}
863)}function XW(e){const t=_t(e),n=t.getFullYear(),r=Ma(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=wu(r),s=Ma(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const i=wu(s);return t.getTime()>=a.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Pf(e){const t=_t(e);return t.setHours(0,0,0,0),t}function jb(e){const t=_t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function bs(e,t){const n=Pf(e),r=Pf(t),a=+n-jb(n),s=+r-jb(r);return Math.round((a-s)/Xpe)}function Qpe(e){const t=XW(e),n=Ma(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wu(n)}function VC(e,t){const n=t*7;return Br(e,n)}function Zpe(e,t){return ts(e,t*12)}function ege(e){let t;return e.forEach(function(n){const r=_t(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function tge(e){let t;return e.forEach(n=>{const r=_t(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Jn(e,t){const n=Pf(e),r=Pf(t);return+n==+r}function lP(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nge(e){if(!lP(e)&&typeof e!="number")return!1;const t=_t(e);return!isNaN(Number(t))}function $p(e,t){const n=_t(e),r=_t(t),a=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return a*12+s}function rge(e,t,n){const r=$s(e,n),a=$s(t,n),s=+r-jb(r),i=+a-jb(a);return Math.round((s-i)/iP)}function cP(e){const t=_t(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ia(e){const t=_t(e);return t.setDate(1),t.setHours(0,0,0,0),t}function JW(e){const t=_t(e),n=Ma(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uP(e,t){var l,c,u,d;const n=Xg(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=_t(e),s=a.getDay(),i=(s<r?-7:0)+6-(s-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function QW(e){return uP(e,{weekStartsOn:1})}const age={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"}},oge=(e,t,n)=>{let r;const a=age[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function zS(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const sge={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ige={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lge={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cge={date:zS({formats:sge,defaultWidth:"full"}),time:zS({formats:ige,defaultWidth:"full"}),dateTime:zS({formats:lge,defaultWidth:"full"})},uge={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dge=(e,t,n,r)=>uge[e];function em(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):i;a=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const fge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mge={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"]},pge={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","Frid
863ay","Saturday"]},gge={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"}},vge={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"}},yge=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},xge={ordinalNumber:yge,era:em({values:fge,defaultWidth:"wide"}),quarter:em({values:hge,defaultWidth:"wide",argumentCallback:e=>e-1}),month:em({values:mge,defaultWidth:"wide"}),day:em({values:pge,defaultWidth:"wide"}),dayPeriod:em({values:gge,defaultWidth:"wide",formattingValues:vge,defaultFormattingWidth:"wide"})};function tm(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?wge(l,f=>f.test(i)):bge(l,f=>f.test(i));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(i.length);return{value:u,rest:d}}}function bge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function wge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function jge(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=t.slice(a.length);return{value:i,rest:l}}}const Sge=/^(\d+)(th|st|nd|rd)?/i,Nge=/\d+/i,_ge={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},Cge={any:[/^b/i,/^(a|c)/i]},kge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ege={any:[/1/i,/2/i,/3/i,/4/i]},Age={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},Pge={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]},Tge={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},Oge={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]},Mge={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},Ige={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}},$ge={ordinalNumber:jge({matchPattern:Sge,parsePattern:Nge,valueCallback:e=>parseInt(e,10)}),era:tm({matchPatterns:_ge,defaultMatchWidth:"wide",parsePatterns:Cge,defaultParseWidth:"any"}),quarter:tm({matchPatterns:kge,defaultMatchWidth:"wide",parsePatterns:Ege,defaultParseWidth:"any",valueCallback:e=>e+1}),month:tm({matchPatterns:Age,defaultMatchWidth:"wide",parsePatterns:Pge,defaultParseWidth:"any"}),day:tm({matchPatterns:Tge,defaultMatchWidth:"wide",parsePatterns:Oge,defaultParseWidth:"any"}),dayPeriod:tm({matchPatterns:Mge,defaultMatchWidth:"any",parsePatterns:Ige,defaultParseWidth:"any"})},ZW={code:"en-US",formatDistance:oge,formatLong:cge,formatRelative:dge,localize:xge,match:$ge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Dge(e){const t=_t(e);return bs(t,JW(t))+1}function eq(e){const t=_t(e),n=+wu(t)-+Qpe(t);return Math.round(n/iP)+1}function tq(e,t){var d,f,h,m;
vendor: 6,468 bytes, line 863
863const n=_t(e),r=n.getFullYear(),a=Xg(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=Ma(e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=$s(i,t),c=Ma(e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const u=$s(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Rge(e,t){var l,c,u,d;const n=Xg(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=tq(e,t),s=Ma(e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),$s(s,t)}function nq(e,t){const n=_t(e),r=+$s(n,t)-+Rge(n,t);return Math.round(r/iP)+1}function Mt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const nl={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Mt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Mt(n+1,2)},d(e,t){return Mt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Mt(e.getHours()%12||12,t.length)},H(e,t){return Mt(e.getHours(),t.length)},m(e,t){return Mt(e.getMinutes(),t.length)},s(e,t){return Mt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Mt(a,t.length)}},id={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gD={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return nl.y(e,t)},Y:function(e,t,n,r){const a=tq(e,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return Mt(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Mt(s,t.length)},R:function(e,t){const n=XW(e);return Mt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Mt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Mt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Mt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return nl.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Mt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=nq(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Mt(a,t.length)},I:function(e,t,n){const r=eq(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Mt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):nl.d(e,t)},D:function(e,t,n){const r=Dge(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Mt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Mt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Mt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Mt(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=id.noon:r===0?a=id.midnight:a=r/12>
vendor: 4,717 bytes, line 863
863=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=id.evening:r>=12?a=id.afternoon:r>=4?a=id.morning:a=id.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return nl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):nl.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Mt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Mt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nl.s(e,t)},S:function(e,t){return nl.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return yD(r);case"XXXX":case"XX":return kc(r);case"XXXXX":case"XXX":default:return kc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return yD(r);case"xxxx":case"xx":return kc(r);case"xxxxx":case"xxx":default:return kc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+vD(r,":");case"OOOO":default:return"GMT"+kc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+vD(r,":");case"zzzz":default:return"GMT"+kc(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Mt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Mt(r,t.length)}};function vD(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+Mt(s,2)}function yD(e,t){return e%60===0?(e>0?"-":"+")+Mt(Math.abs(e)/60,2):kc(e,t)}function kc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Mt(Math.trunc(r/60),2),s=Mt(r%60,2);return n+a+t+s}const xD=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rq=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Lge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return xD(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",xD(r,t)).replace("{{time}}",rq(a,t))},Fge={p:rq,P:Lge},Bge=/^D+$/,zge=/^Y+$/,Uge=["D","DD","YY","YYYY"];function Vge(e){return Bge.test(e)}function Wge(e){return zge.test(e)}function qge(e,t,n){const r=Hge(e,t,n);if(console.warn(r),Uge.includes(e))throw new RangeError(r)}function Hge(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kge=/^'([^]*?)'?$/,Xge=/''/g,Jge=/[a-zA-Z]/;function la(e,t,n){var d,f,h,m,v,g,y,x;const r=Xg(),a=(n==null?void 0:n.locale)??r.locale??ZW,s=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((g=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((x=(y=r.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0,l=_t(e);if(!nge(l))throw new RangeError("Invalid time value");let c=t.match(Yge).map(b=>{const w=b[0];if(w==="p"||w==="P"){const N=Fge[w];return N(b,a.formatLong)}return b}).join("").match(Gge).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:Qge(b)};if(gD[w])return{isToken:!0,value:b};
863if(w.match(Jge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Wge(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Vge(w))&&qge(w,t,String(e));const N=gD[w[0]];return N(l,w,a.localize,u)}).join("")}function Qge(e){const t=e.match(Kge);return t?t[1].replace(Xge,"'"):e}function Zge(e){const t=_t(e),n=t.getFullYear(),r=t.getMonth(),a=Ma(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function eve(e){return Math.trunc(+_t(e)/1e3)}function tve(e){const t=_t(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function nve(e,t){return rge(tve(e),ia(e),t)+1}function WC(e,t){const n=_t(e),r=_t(t);return n.getTime()>r.getTime()}function aq(e,t){const n=_t(e),r=_t(t);return+n<+r}function dP(e,t){const n=_t(e),r=_t(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function rve(e,t){const n=_t(e),r=_t(t);return n.getFullYear()===r.getFullYear()}function US(e,t){return Br(e,-t)}function VS(e,t){const n=_t(e),r=n.getFullYear(),a=n.getDate(),s=Ma(e,0);s.setFullYear(r,t,15),s.setHours(0,0,0,0);const i=Zge(s);return n.setMonth(t,Math.min(a,i)),n}function bD(e,t){const n=_t(e);return isNaN(+n)?Ma(e,NaN):(n.setFullYear(t),n)}var qe=function(){return qe=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},qe.apply(this,arguments)};function ave(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function oq(e,t,n){for(var r=0,a=t.length,s;r<a;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function Jg(e){return e.mode==="multiple"}function Qg(e){return e.mode==="range"}function s1(e){return e.mode==="single"}var ove={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 sve(e,t){return la(e,"LLLL y",t)}function ive(e,t){return la(e,"d",t)}function lve(e,t){return la(e,"LLLL",t)}function cve(e){return"".concat(e)}function uve(e,t){return la(e,"cccccc",t)}function dve(e,t){return la(e,"yyyy",t)}var fve=Object.freeze({__proto__:null,formatCaption:sve,formatDay:ive,formatMonthCaption:lve,formatWeekNumber:cve,formatWeekdayName:uve,formatYearCaption:dve}),hve=function(e,t,n){return la(e,"do MMMM (EEEE)",n)},mve=function(){return"Month: "},pve=function(){return"Go to next month"},gve=function(){return"Go to previous month"},vve=function(e,t){return la(e,"cccc",t)},yve=function(e){return"Week n. ".concat(e)},xve=function(){return"Year: "},bve=Object.freeze({__proto__:null,labelDay:hve,labelMonthDropdown:mve,labelNext:pve,labelPrevious:gve,labelWeekNumber:yve,labelWeekday:vve,labelYearDropdown:xve});function wve(){var e="buttons",t=ove,n=ZW,r={},a={},s=1,i={},l=new Date;return{captionLayout:e,classNames:t,formatters:fve,labels:bve,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:s,styles:i,today:l,mode:"default"}}function jve(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,s=e.fromDate,i=e.toDate;return r?s=ia(r):t&&(s=new Date(t,0,1)),a?i=cP(a):n&&(i=new Date(n,11,31)),{fromDate:s?Pf(s):void 0,toDate:i?Pf(i):void 0}}var sq=p.createContext(void 0);function Sve(e){var t,n=e.initialProps,r=wve(),a=jve(n),s=a.fromDate,i=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!s||!i)&&(l="buttons");var c;(s1(n)||Jg(n)||Qg(n))&&(c=n.onSelect);var u=qe(qe(qe({}
863,r),n),{captionLayout:l,classNames:qe(qe({},r.classNames),n.classNames),components:qe({},n.components),formatters:qe(qe({},r.formatters),n.formatters),fromDate:s,labels:qe(qe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:qe(qe({},r.modifiers),n.modifiers),modifiersClassNames:qe(qe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:qe(qe({},r.styles),n.styles),toDate:i});return o.jsx(sq.Provider,{value:u,children:e.children})}function Kt(){var e=p.useContext(sq);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function iq(e){var t=Kt(),n=t.locale,r=t.classNames,a=t.styles,s=t.formatters.formatCaption;return o.jsx("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:s(e.displayMonth,{locale:n})})}function Nve(e){return o.jsx("svg",qe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:o.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 lq(e){var t,n,r=e.onChange,a=e.value,s=e.children,i=e.caption,l=e.className,c=e.style,u=Kt(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Nve;return o.jsxs("div",{className:l,style:c,children:[o.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),o.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:r,children:s}),o.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[i,o.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function _ve(e){var t,n=Kt(),r=n.fromDate,a=n.toDate,s=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return o.jsx(o.Fragment,{});if(!a)return o.jsx(o.Fragment,{});var f=[];if(rve(r,a))for(var h=ia(r),m=r.getMonth();m<=a.getMonth();m++)f.push(VS(h,m));else for(var h=ia(new Date),m=0;m<=11;m++)f.push(VS(h,m));var v=function(y){var x=Number(y.target.value),b=VS(ia(e.displayMonth),x);e.onChange(b)},g=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:lq;return o.jsx(g,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:f.map(function(y){return o.jsx("option",{value:y.getMonth(),children:l(y,{locale:i})},y.getMonth())})})}function Cve(e){var t,n=e.displayMonth,r=Kt(),a=r.fromDate,s=r.toDate,i=r.locale,l=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!a)return o.jsx(o.Fragment,{});if(!s)return o.jsx(o.Fragment,{});for(var m=a.getFullYear(),v=s.getFullYear(),g=m;g<=v;g++)h.push(bD(JW(new Date),g));var y=function(b){var w=bD(ia(n),Number(b.target.value));e.onChange(w)},x=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:lq;return o.jsx(x,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:y,value:n.getFullYear(),caption:d(n,{locale:i}),children:h.map(function(b){return o.jsx("option",{value:b.getFullYear(),children:d(b,{locale:i})},b.getFullYear())})})}function kve(e,t){var n=p.useState(e),r=n[0],a=n[1],s=t===void 0?r:t;return[s,a]}function Eve(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,s=e.toDate,i=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(s&&$p(s,a)<0){var u=-1*(c-1);a=ts(s,u)}return i&&$p(a,i)<0&&(a=i),ia(a)}function Ave(){var e=Kt(),t=Eve(e),n=kve(t,e.month),r=n[0],a=n[1],s=function(i){var l;if(!e.disableNavigation){var c=ia(i);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,s]}function Pve(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=ia(e),s=ia(ts(a,r)),i=$p(s,a),l=[],c=0;c<i;c++){var u=ts(a,c);l.push(u)}return n&&(l=l.reverse()),l}function Tve(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,s=a===void 0?1:a,i=r?s:1,l=ia(e);if(!n)return ts(l,i);var c=$p(n,e);if(!(c<s))return ts(l,i)}}function Ove(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,s=a===void 0?1:a,i=r?s:1,l=ia(e);if(!n)return ts(l,-i);var c=$p(l,n);if(!(c<=0))return ts(l,-i)}}var cq=p.createContext(void 0);function Mve(e){var t=Kt(),n=Ave(),r=n[0],a=n[1],s=Pve(r,t),i=Tve(r,t),l=Ove(r,t),c=function(f){return s.some(function(h){return dP(f,h)})},u=function(f,h){c(f)||(h&&aq(f,h)?a(ts(f,1+t.numberOfMonths*-1)):a(f))},d={currentMonth:r,displayMonths:s,goToMonth:a,goToDate:u,previousMonth:l,nextMonth:i,isDateDisplayed:c};return o.jsx(cq.Provider,{value:d,children:e.children})}function Zg(){var e=p.useContext(cq);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function wD(e){var t,n=Kt(),r=n.classNames,a=n.styles,s=n.components,i=Zg().goToMonth,l=function(d){i(ts(d,e.displayIndex?-e.dis
863playIndex:0))},c=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:iq,u=o.jsx(c,{id:e.id,displayMonth:e.displayMonth});return o.jsxs("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[o.jsx("div",{className:r.vhidden,children:u}),o.jsx(_ve,{onChange:l,displayMonth:e.displayMonth}),o.jsx(Cve,{onChange:l,displayMonth:e.displayMonth})]})}function Ive(e){return o.jsx("svg",qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.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 $ve(e){return o.jsx("svg",qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.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 Sb=p.forwardRef(function(e,t){var n=Kt(),r=n.classNames,a=n.styles,s=[r.button_reset,r.button];e.className&&s.push(e.className);var i=s.join(" "),l=qe(qe({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),o.jsx("button",qe({},e,{ref:t,type:"button",className:i,style:l}))});function Dve(e){var t,n,r=Kt(),a=r.dir,s=r.locale,i=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return o.jsx(o.Fragment,{});var h=u(e.previousMonth,{locale:s}),m=[i.nav_button,i.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:s}),g=[i.nav_button,i.nav_button_next].join(" "),y=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:$ve,x=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Ive;return o.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&o.jsx(Sb,{name:"previous-month","aria-label":h,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?o.jsx(y,{className:i.nav_icon,style:l.nav_icon}):o.jsx(x,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&o.jsx(Sb,{name:"next-month","aria-label":v,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?o.jsx(x,{className:i.nav_icon,style:l.nav_icon}):o.jsx(y,{className:i.nav_icon,style:l.nav_icon})})]})}function jD(e){var t=Kt().numberOfMonths,n=Zg(),r=n.previousMonth,a=n.nextMonth,s=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(v){return dP(e.displayMonth,v)}),c=l===0,u=l===i.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),h=function(){r&&s(r)},m=function(){a&&s(a)};return o.jsx(Dve,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:a,previousMonth:r,onPreviousClick:h,onNextClick:m})}function Rve(e){var t,n=Kt(),r=n.classNames,a=n.disableNavigation,s=n.styles,i=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:iq,u;return a?u=o.jsx(c,{id:e.id,displayMonth:e.displayMonth}):i==="dropdown"?u=o.jsx(wD,{displayMonth:e.displayMonth,id:e.id}):i==="dropdown-buttons"?u=o.jsxs(o.Fragment,{children:[o.jsx(wD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),o.jsx(jD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=o.jsxs(o.Fragment,{children:[o.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(jD,{displayMonth:e.displayMonth,id:e.id})]}),o.jsx("div",{className:r.caption,style:s.caption,children:u})}function Lve(e){var t=Kt(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?o.jsx("tfoot",{className:a,style:r.tfoot,children:o.jsx("tr",{children:o.jsx("td",{colSpan:8,children:n})})}):o.jsx(o.Fragment,{})}function Fve(e,t,n){for(var r=n?wu(new Date):$s(new Date,{locale:e,weekStartsOn:t}),a=[],s=0;s<7;s++){var i=Br(r,s);a.push(i)}return a}function Bve(){var e=Kt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,s=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=Fve(a,s,i);return o.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&o.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return o.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:a}),children:l(d,{locale:a})},f)})]})}function zve(){var e,t=Kt(),n=t.classNames,r=t.styles,a=t.components,s=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:Bve;return o.jsx("thead",{style:r.head,className:n.head,children:o.jsx(s,{})})}function Uve(e){var t=Kt(),n=t.locale,r=t.formatters.formatDay;return o.jsx(o.Fragment,{children:r(e.date,{locale:n})})}var fP=p.createContext(void 0);function Vve(e){if(!Jg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return o.jsx(fP.Provider,{value:t,children:e.children})}return o.jsx(Wve,{initialProps:e.initialProps,children:e.children})}function Wve(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,s=t.max,i=function(u,d,f){var h,m;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,f);var v=!!(d.selected&&a&&(r==null?void 0:r.length)===a);if(!v){var g=!!(!d.selected&&s&&(r==null?void 0:r.length)===s);if(!g){var y=r?oq([],r):[];if(d.selected){var x=y.findIndex(function(b){return Jn(u,b)});
863y.splice(x,1)}else y.push(u);(m=t.onSelect)===null||m===void 0||m.call(t,y,u,d,f)}}},l={disabled:[]};r&&l.disabled.push(function(u){var d=s&&r.length>s-1,f=r.some(function(h){return Jn(h,u)});return!!(d&&!f)});var c={selected:r,onDayClick:i,modifiers:l};return o.jsx(fP.Provider,{value:c,children:n})}function hP(){var e=p.useContext(fP);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function qve(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?Jn(a,e)&&Jn(r,e)?void 0:Jn(a,e)?{from:a,to:void 0}:Jn(r,e)?void 0:WC(r,e)?{from:e,to:a}:{from:r,to:e}:a?WC(e,a)?{from:a,to:e}:{from:e,to:a}:r?aq(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var mP=p.createContext(void 0);function Hve(e){if(!Qg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return o.jsx(mP.Provider,{value:t,children:e.children})}return o.jsx(Gve,{initialProps:e.initialProps,children:e.children})}function Gve(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},s=a.from,i=a.to,l=t.min,c=t.max,u=function(m,v,g){var y,x;(y=t.onDayClick)===null||y===void 0||y.call(t,m,v,g);var b=qve(m,r);(x=t.onSelect)===null||x===void 0||x.call(t,b,m,v,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(d.range_start=[s],i?(d.range_end=[i],Jn(s,i)||(d.range_middle=[{after:s,before:i}])):d.range_end=[s]):i&&(d.range_start=[i],d.range_end=[i]),l&&(s&&!i&&d.disabled.push({after:US(s,l-1),before:Br(s,l-1)}),s&&i&&d.disabled.push({after:s,before:Br(s,l-1)}),!s&&i&&d.disabled.push({after:US(i,l-1),before:Br(i,l-1)})),c){if(s&&!i&&(d.disabled.push({before:Br(s,-c+1)}),d.disabled.push({after:Br(s,c-1)})),s&&i){var f=bs(i,s)+1,h=c-f;d.disabled.push({before:US(s,h)}),d.disabled.push({after:Br(i,h)})}!s&&i&&(d.disabled.push({before:Br(i,-c+1)}),d.disabled.push({after:Br(i,c-1)}))}return o.jsx(mP.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function pP(){var e=p.useContext(mP);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function px(e){return Array.isArray(e)?oq([],e):e!==void 0?[e]:[]}function Yve(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=px(a)}),t}var ns;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ns||(ns={}));var Kve=ns.Selected,Qs=ns.Disabled,Xve=ns.Hidden,Jve=ns.Today,WS=ns.RangeEnd,qS=ns.RangeMiddle,HS=ns.RangeStart,Qve=ns.Outside;function Zve(e,t,n){var r,a=(r={},r[Kve]=px(e.selected),r[Qs]=px(e.disabled),r[Xve]=px(e.hidden),r[Jve]=[e.today],r[WS]=[],r[qS]=[],r[HS]=[],r[Qve]=[],r);return e.fromDate&&a[Qs].push({before:e.fromDate}),e.toDate&&a[Qs].push({after:e.toDate}),Jg(e)?a[Qs]=a[Qs].concat(t.modifiers[Qs]):Qg(e)&&(a[Qs]=a[Qs].concat(n.modifiers[Qs]),a[HS]=n.modifiers[HS],a[qS]=n.modifiers[qS],a[WS]=n.modifiers[WS]),a}var uq=p.createContext(void 0);function eye(e){var t=Kt(),n=hP(),r=pP(),a=Zve(t,n,r),s=Yve(t.modifiers),i=qe(qe({},a),s);return o.jsx(uq.Provider,{value:i,children:e.children})}function dq(){var e=p.useContext(uq);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function tye(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function nye(e){return!!(e&&typeof e=="object"&&"from"in e)}function rye(e){return!!(e&&typeof e=="object"&&"after"in e)}function aye(e){return!!(e&&typeof e=="object"&&"before"in e)}function oye(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function sye(e,t){var n,r=t.from,a=t.to;if(r&&a){var s=bs(a,r)<0;s&&(n=[a,r],r=n[0],a=n[1]);var i=bs(e,r)>=0&&bs(a,e)>=0;return i}return a?Jn(a,e):r?Jn(r,e):!1}function iye(e){return lP(e)}function lye(e){return Array.isArray(e)&&e.every(lP)}function cye(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(iye(n))return Jn(e,n);if(lye(n))return n.includes(e);if(nye(n))return sye(e,n);if(oye(n))return n.dayOfWeek.includes(e.getDay());if(tye(n)){var r=bs(n.before,e),a=bs(n.after,e),s=r>0,i=a<0,l=WC(n.before,n.after);return l?i&&s:s||i}return rye(n)?bs(e,n.after)>0:aye(n)?bs(n.before,e)>0:typeof n=="function"?n(e):!1})}function gP(e,t,n){var r=Object.keys(t).reduce(function(s,i){var l=t[i];return cye(e,l)&&s.push(i),s},[]),a={};return r.forEach(function(s){return a[s]=!0}),n&&!dP(e,n)&&(a.outside=!0),a}function uye(e,t){for(var n=ia(e[0]),r=cP(e[e.length-1]),a,s,i=n;i<=r;){var l=gP(i,t),c=!l.disabled&&!l.hidden;if(!c){i=Br(i,1);continue}if(l.selected)return i;l.today&&!s&&(s=i),a||(a=i),i=Br(i,1)}return s||a}var dye=365;function fq(e,t){var n=t.moveBy,r=t.direction,a=t.context,s=t.modifiers,i=t.retry,l=i===void 0?{count:0,lastFocused:e}:i,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,h={day:Br,week:VC,month:ts,year:Zpe,startOfWeek:function(y){return a.ISOWeek?wu(y):$s(y,{locale:f,weekStartsOn:c})},endOfWeek:function(y){return a.ISOWeek?QW(y):uP(y,{locale:f,weekStartsOn:c})}},m=h[n](e,r==="after"?1:-1);r==="before"&&u?m=ege([u,m]):r==="after"&&d&&(m=tge([d,m]));var v=!0;if(s){var g=gP(m,s);v=!g.disabled&&!g.hidden}return v?m:l.count>dye?l.lastFocused:fq(m,{moveBy:n,direction:r,context:a,modifiers:s,retry:qe(qe({},l),{count:l.count+1})})}var hq=p.createContext(void 0);function fye(e){var t=Zg(),n=dq(),r=p.useState(),a=r[0],s=r[1],i=p.useState(),l=i[0],c=i[1],u=uye(t.displayMonths,n),d=a??(l&&t.isDateDisplayed(l))?l:u,f=function(){c(a),s(void 0)},h=function(y){s(y)},m=Kt(),v=function(y,x){if(a){var b=fq(a,{moveBy:y,direction:x,context:m,modifiers:n});Jn(a,b)||(t.goToDate(b,a),h(b))}},g={focusedDay:a,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return o.jsx(hq.Provider,{value:g,children:e.children})}function vP(){var e=p.useContext(hq);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function hye(e,t){var n=dq(),r=gP(e,n,t);return r}var yP=p.createContext(void 0);function mye(e){if(!s1(e.initialProps)){var t={selected:void 0};return o.jsx(yP.Provider,{value:t,children:e.children})}return o.jsx(pye,{initialProps:e.initialProps,children:e.children})}function pye(e){var t=e.initialProps,n=e.children,r=function(s,i,l){var c,u,d;
863if((c=t.onDayClick)===null||c===void 0||c.call(t,s,i,l),i.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,s,i,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,s,s,i,l)},a={selected:t.selected,onDayClick:r};return o.jsx(yP.Provider,{value:a,children:n})}function mq(){var e=p.useContext(yP);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function gye(e,t){var n=Kt(),r=mq(),a=hP(),s=pP(),i=vP(),l=i.focusDayAfter,c=i.focusDayBefore,u=i.focusWeekAfter,d=i.focusWeekBefore,f=i.blur,h=i.focus,m=i.focusMonthBefore,v=i.focusMonthAfter,g=i.focusYearBefore,y=i.focusYearAfter,x=i.focusStartOfWeek,b=i.focusEndOfWeek,w=function(L){var M,B,I,R;s1(n)?(M=r.onDayClick)===null||M===void 0||M.call(r,e,t,L):Jg(n)?(B=a.onDayClick)===null||B===void 0||B.call(a,e,t,L):Qg(n)?(I=s.onDayClick)===null||I===void 0||I.call(s,e,t,L):(R=n.onDayClick)===null||R===void 0||R.call(n,e,t,L)},N=function(L){var M;h(e),(M=n.onDayFocus)===null||M===void 0||M.call(n,e,t,L)},S=function(L){var M;f(),(M=n.onDayBlur)===null||M===void 0||M.call(n,e,t,L)},_=function(L){var M;(M=n.onDayMouseEnter)===null||M===void 0||M.call(n,e,t,L)},k=function(L){var M;(M=n.onDayMouseLeave)===null||M===void 0||M.call(n,e,t,L)},P=function(L){var M;(M=n.onDayPointerEnter)===null||M===void 0||M.call(n,e,t,L)},O=function(L){var M;(M=n.onDayPointerLeave)===null||M===void 0||M.call(n,e,t,L)},$=function(L){var M;(M=n.onDayTouchCancel)===null||M===void 0||M.call(n,e,t,L)},T=function(L){var M;(M=n.onDayTouchEnd)===null||M===void 0||M.call(n,e,t,L)},z=function(L){var M;(M=n.onDayTouchMove)===null||M===void 0||M.call(n,e,t,L)},U=function(L){var M;(M=n.onDayTouchStart)===null||M===void 0||M.call(n,e,t,L)},E=function(L){var M;(M=n.onDayKeyUp)===null||M===void 0||M.call(n,e,t,L)},q=function(L){var M;switch(L.key){case"ArrowLeft":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":L.preventDefault(),L.stopPropagation(),u();break;case"ArrowUp":L.preventDefault(),L.stopPropagation(),d();break;case"PageUp":L.preventDefault(),L.stopPropagation(),L.shiftKey?g():m();break;case"PageDown":L.preventDefault(),L.stopPropagation(),L.shiftKey?y():v();break;case"Home":L.preventDefault(),L.stopPropagation(),x();break;case"End":L.preventDefault(),L.stopPropagation(),b();break}(M=n.onDayKeyDown)===null||M===void 0||M.call(n,e,t,L)},W={onClick:w,onFocus:N,onBlur:S,onKeyDown:q,onKeyUp:E,onMouseEnter:_,onMouseLeave:k,onPointerEnter:P,onPointerLeave:O,onTouchCancel:$,onTouchEnd:T,onTouchMove:z,onTouchStart:U};return W}function vye(){var e=Kt(),t=mq(),n=hP(),r=pP(),a=s1(e)?t.selected:Jg(e)?n.selected:Qg(e)?r.selected:void 0;return a}function yye(e){return Object.values(ns).includes(e)}function xye(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var a=e.modifiersClassNames[r];if(a)n.push(a);else if(yye(r)){var s=e.classNames["day_".concat(r)];s&&n.push(s)}}),n}function bye(e,t){var n=qe({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=qe(qe({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function wye(e,t,n){var r,a,s,i=Kt(),l=vP(),c=hye(e,t),u=gye(e,c),d=vye(),f=!!(i.onDayClick||i.mode!=="default");p.useEffect(function(){var _;c.outside||l.focusedDay&&f&&Jn(l.focusedDay,e)&&((_=n.current)===null||_===void 0||_.focus())},[l.focusedDay,e,n,f,c.outside]);var h=xye(i,c).join(" "),m=bye(i,c),v=!!(c.outside&&!i.showOutsideDays||c.hidden),g=(s=(a=i.components)===null||a===void 0?void 0:a.DayContent)!==null&&s!==void 0?s:Uve,y=o.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),x={style:m,className:h,children:y,role:"gridcell"},b=l.focusTarget&&Jn(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&Jn(l.focusedDay,e),N=qe(qe(qe({},x),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||b?0:-1,r)),u),S={isButton:f,isHidden:v,activeModifiers:c,selectedDays:d,buttonProps:N,divProps:x};return S}function jye(e){var t=p.useRef(null),n=wye(e.date,e.displayMonth,t);return n.isHidden?o.jsx("div",{role:"gridcell"}):n.isButton?o.jsx(Sb,qe({name:"day",ref:t},n.buttonProps)):o.jsx("div",qe({},n.divProps))}function Sye(e){var t=e.number,n=e.dates,r=Kt(),a=r.onWeekNumberClick,s=r.styles,i=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!a)return o.jsx("span",{className:i.weeknumber,style:s.weeknumber,children:d});var f=c(Number(t),{locale:l}),h=function(m){a(t,n,m)};return o.jsx(Sb,{name:"week-number","aria-label":f,className:i.weeknumber,style:s.weeknumber,onClick:h,children:d})}function Nye(e){var t,n,r=Kt(),a=r.styles,s=r.classNames,i=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:jye,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:Sye,d;return i&&(d=o.jsx("td",{className:s.cell,style:a.cell,children:o.jsx(u,{number:e.weekNumber,dates:e.dates})})),o.jsxs("tr",{className:s.row,style:a.row,children:[d,e.dates.map(function(f){return o.jsx("td",{className:s.cell,style:a.cell,role:"presentation",children:o.jsx(c,{displayMonth:e.displayMonth,date:f})},eve(f))})]})}function SD(e,t,n){for(var r=n!=null&&n.ISOWeek?QW(t):uP(t,n),a=n!=null&&n.ISOWeek?wu(e):$s(e,n
863),s=bs(r,a),i=[],l=0;l<=s;l++)i.push(Br(a,l));var c=i.reduce(function(u,d){var f=n!=null&&n.ISOWeek?eq(d):nq(d,n),h=u.find(function(m){return m.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function _ye(e,t){var n=SD(ia(e),cP(e),t);if(t!=null&&t.useFixedWeeks){var r=nve(e,t);if(r<6){var a=n[n.length-1],s=a.dates[a.dates.length-1],i=VC(s,6-r),l=SD(VC(s,1),i,t);n.push.apply(n,l)}}return n}function Cye(e){var t,n,r,a=Kt(),s=a.locale,i=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,f=a.weekStartsOn,h=a.firstWeekContainsDate,m=a.ISOWeek,v=_ye(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:s,weekStartsOn:f,firstWeekContainsDate:h}),g=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:zve,y=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:Nye,x=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:Lve;return o.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&o.jsx(g,{}),o.jsx("tbody",{className:i.tbody,style:l.tbody,children:v.map(function(b){return o.jsx(y,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),o.jsx(x,{displayMonth:e.displayMonth})]})}function kye(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Eye=kye()?p.useLayoutEffect:p.useEffect,GS=!1,Aye=0;function ND(){return"react-day-picker-".concat(++Aye)}function Pye(e){var t,n=e??(GS?ND():null),r=p.useState(n),a=r[0],s=r[1];return Eye(function(){a===null&&s(ND())},[]),p.useEffect(function(){GS===!1&&(GS=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function Tye(e){var t,n,r=Kt(),a=r.dir,s=r.classNames,i=r.styles,l=r.components,c=Zg().displayMonths,u=Pye(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[s.month],h=i.month,m=e.displayIndex===0,v=e.displayIndex===c.length-1,g=!m&&!v;a==="rtl"&&(t=[m,v],v=t[0],m=t[1]),m&&(f.push(s.caption_start),h=qe(qe({},h),i.caption_start)),v&&(f.push(s.caption_end),h=qe(qe({},h),i.caption_end)),g&&(f.push(s.caption_between),h=qe(qe({},h),i.caption_between));var y=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:Rve;return o.jsxs("div",{className:f.join(" "),style:h,children:[o.jsx(y,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(Cye,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function Oye(e){var t=Kt(),n=t.classNames,r=t.styles;return o.jsx("div",{className:n.months,style:r.months,children:e.children})}function Mye(e){var t,n,r=e.initialProps,a=Kt(),s=vP(),i=Zg(),l=p.useState(!1),c=l[0],u=l[1];p.useEffect(function(){a.initialFocus&&s.focusTarget&&(c||(s.focus(s.focusTarget),u(!0)))},[a.initialFocus,c,s.focus,s.focusTarget,s]);var d=[a.classNames.root,a.className];a.numberOfMonths>1&&d.push(a.classNames.multiple_months),a.showWeekNumber&&d.push(a.classNames.with_weeknumber);var f=qe(qe({},a.styles.root),a.style),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,g){var y;return qe(qe({},v),(y={},y[g]=r[g],y))},{}),m=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Oye;return o.jsx("div",qe({className:d.join(" "),style:f,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:o.jsx(m,{children:i.displayMonths.map(function(v,g){return o.jsx(Tye,{displayIndex:g,displayMonth:v},g)})})}))}function Iye(e){var t=e.children,n=ave(e,["children"]);return o.jsx(Sve,{initialProps:n,children:o.jsx(Mve,{children:o.jsx(mye,{initialProps:n,children:o.jsx(Vve,{initialProps:n,children:o.jsx(Hve,{initialProps:n,children:o.jsx(eye,{children:o.jsx(fye,{children:t})})})})})})})}function $ye(e){return o.jsx(Iye,qe({},e,{children:o.jsx(Mye,{initialProps:e})}))}function xP({className:e,classNames:t,showOutsideDays:n=!0,...r}){return o.jsx($ye,{showOutsideDays:n,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",n
863av_button:he(Ap({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:he(Ap({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>o.jsx(fh,{className:"h-4 w-4"}),IconRight:({...a})=>o.jsx(zo,{className:"h-4 w-4"})},...r})}xP.displayName="Calendar";const YS=e=>{(!isFinite(e)||e<0)&&(e=0);const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`},Dye=(e,t=100)=>p.useMemo(()=>{let n=(e||"seed").split("").reduce((i,l)=>(i*31+l.charCodeAt(0))%2147483647,7)||1;const r=()=>(n=n*1103515245+12345&2147483647,n%1e5/1e5),a=[];let s=.5;for(let i=0;i<t;i++){const l=r()<.07;s=s*.65+r()*.55;let c=l?.06+r()*.08:.18+s*.82;c*=.55+.45*Math.abs(Math.sin(i*.8)),a.push(Math.max(.05,Math.min(1,c)))}return a},[e,t]),KS=[1,1.5,2],i1=p.forwardRef(({src:e,onTimeUpdate:t,className:n},r)=>{const a=p.useRef(null),[s,i]=p.useState(!1),[l,c]=p.useState(0),[u,d]=p.useState(0),[f,h]=p.useState(!1),[m,v]=p.useState(!1),[g,y]=p.useState(0),x=Dye(e);p.useImperativeHandle(r,()=>({seek:k=>{const P=a.current;!P||!isFinite(k)||(P.currentTime=Math.max(0,k),c(P.currentTime),P.play().then(()=>i(!0)).catch(()=>{}))}})),p.useEffect(()=>{i(!1),c(0),d(0),h(!1),v(!1),y(0)},[e]);const b=()=>{const k=a.current;k&&(s?k.pause():k.play().then(()=>i(!0)).catch(()=>v(!0)))},w=k=>{const P=a.current;if(!P||!u)return;const O=Math.min(u,Math.max(0,k*u));P.currentTime=O,c(O)},N=()=>{const k=(g+1)%KS.length;y(k),a.current&&(a.current.playbackRate=KS[k])},S=u?l/u:0,_=p.useMemo(()=>{if(!u||!isFinite(u))return[];const k=5;return Array.from({length:k+1},(P,O)=>u*O/k)},[u]);return e?o.jsxs("div",{className:he("rounded-xl border border-border bg-muted/20 p-4",n),children:[o.jsx("audio",{ref:a,src:e,preload:"metadata",onLoadedMetadata:k=>{d(k.currentTarget.duration||0),h(!0)},onTimeUpdate:k=>{const P=k.currentTarget.currentTime;c(P),t==null||t(P)},onPlay:()=>i(!0),onPause:()=>i(!1),onEnded:()=>i(!1),onError:()=>v(!0)}),o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Recording"}),o.jsxs("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:[YS(l)," / ",YS(u)]})]}),o.jsxs("div",{className:"group relative h-20 w-full cursor-pointer",onClick:k=>{const P=k.currentTarget.getBoundingClientRect();w((k.clientX-P.left)/P.width)},role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.round(u),"aria-valuenow":Math.round(l),children:[o.jsx("div",{className:"flex h-full items-center gap-[2px]",children:x.map((k,P)=>{const O=P/x.length<=S;return o.jsx("span",{className:he("flex-1 rounded-full transition-colors",O?"bg-primary":"bg-muted-foreground/25 group-hover:bg-muted-foreground/40"),style:{height:`${Math.round(k*100)}%`}},P)})}),u>0&&o.jsx("div",{className:"pointer-events-none absolute top-1 bottom-1 w-0.5 rounded-full bg-primary shadow-[0_0_6px_hsl(var(--primary))]",style:{left:`${Math.min(100,S*100)}%`}})]}),_.length>0&&o.jsx("div",{className:"mt-1 flex justify-between font-mono text-[10px] tabular-nums text-muted-foreground
863/70",children:_.map((k,P)=>o.jsx("span",{children:YS(k)},P))}),o.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[o.jsx("button",{type:"button",onClick:b,disabled:m,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm transition hover:opacity-90 disabled:opacity-40","aria-label":s?"Pause":"Play",children:!f&&!m?o.jsx(Te,{className:"h-5 w-5 animate-spin"}):s?o.jsx(Mg,{className:"h-5 w-5"}):o.jsx(Gl,{className:"h-5 w-5 translate-x-0.5"})}),o.jsxs("button",{type:"button",onClick:N,className:"shrink-0 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-semibold text-muted-foreground transition hover:bg-muted hover:text-foreground",title:"Playback speed",children:[KS[g],"x"]}),o.jsx("div",{className:"flex-1"}),o.jsxs("a",{href:e,download:!0,target:"_blank",rel:"noreferrer",className:"flex shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition hover:bg-muted hover:text-foreground",title:"Download recording",children:[o.jsx(wre,{className:"h-4 w-4"})," Audio"]})]}),m&&o.jsxs("p",{className:"mt-2 text-xs text-destructive",children:["Couldn't load the recording here."," ",o.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline",children:"Open it in a new tab"}),"."]})]}):o.jsxs("div",{className:he("flex items-center gap-2 rounded-xl border border-border bg-muted/20 px-4 py-6 text-sm text-muted-foreground",n),children:[o.jsx(U2,{className:"h-4 w-4"})," No recording available for this call."]})});i1.displayName="CallAudioPlayer";
863const Rye=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`},Lye=e=>{const t=[],n=/(^|\n)\s*(AI|Assistant|Bot|User|Customer|Caller)\s*:\s*/gi,r=[];let a;for(;(a=n.exec(e))!==null;){const s=a[2].toLowerCase(),i=s==="user"||s==="customer"||s==="caller"?"user":"assistant";r.push({role:i,start:a.index+a[0].length})}if(!r.length)return e.trim()?[{role:"assistant",text:e.trim()}]:[];for(let s=0;s<r.length;s++){const i=s+1<r.length?e.lastIndexOf(`
864`,r[s+1].start):e.length,l=e.slice(r[s].start,i>r[s].start?i:void 0).trim();l&&t.push({role:r[s].role,text:l})}return t},bP=({messages:e,transcript:t,activeTime:n=0,onSeek:r,className:a})=>{const s=p.useMemo(()=>e&&e.length?e.filter(c=>c.role!=="system"):t?Lye(t):[],[e,t]),i=p.useMemo(()=>{let c=-1;for(let u=0;u<s.length;u++){const d=s[u].at;if(d!==void 0)if(d<=n)c=u;else break}return c},[s,n]),l=p.useRef(null);return p.useEffect(()=>{var c;(c=l.current)==null||c.scrollIntoView({block:"nearest",behavior:"smooth"})},[i]),s.length?o.jsx("div",{className:he("space-y-3",a),children:s.map((c,u)=>{const d=c.role==="user",f=c.role==="tool",h=r&&c.at!==void 0;return f?o.jsx("div",{className:"flex justify-center",children:o.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground",children:[o.jsx(Hre,{className:"h-3 w-3"})," ",c.text||"Tool call"]})},u):o.jsxs("div",{ref:u===i?l:void 0,className:he("flex flex-col",d?"items-end":"items-start"),children:[o.jsxs("div",{className:he("mb-1 flex items-center gap-2 px-1 text-[11px]",d&&"flex-row-reverse"),children:[o.jsxs("span",{className:he("flex items-center gap-1.5 font-semibold",d?"text-muted-foreground":"text-primary"),children:[d?o.jsx(eb,{className:"h-3 w-3"}):o.jsx(zn,{className:"h-3 w-3"}),d?"Caller":"AI Agent"]}),c.at!==void 0&&o.jsx("button",{type:"button",onClick:()=>h&&r(c.at),className:he("font-mono tabular-nums text-muted-foreground",h&&"hover:text-primary hover:underline"),title:h?"Jump to this moment":void 0,disabled:!h,children:Rye(c.at)})]}),o.jsx("div",{onClick:()=>h&&r(c.at),className:he("max-w-[88%] rounded-2xl border px-4 py-2.5 text-sm leading-relaxed transition",d?"rounded-tr-sm border-primary/25 bg-primary/10 text-foreground":"rounded-tl-sm border-border bg-card text-foreground",u===i&&"border-primary/60 ring-2 ring-primary/40",h&&"cursor-pointer hover:border-primary/40"),children:c.text})]},u)})}):o.jsx("p",{className:he("text-sm text-muted-foreground",a),children:"No transcript available for this call."})},Fye=e=>e==="Completed"?"bg-success/15 text-success":e==="Unsuccessful"?"bg-destructive/15 text-destructive":e==="Ringing"?"bg-warning/15 text-warning":e==="In Progress"||e==="Initiated"?"bg-info/15 text-info":"bg-muted text-muted-foreground",_D=[{key:"channel",label:"Channel"},{key:"agent_name",label:"Agent"},{key:"contact_name",label:"Contact"},{key:"phone",label:"Phone"},{key:"duration",label:"Duration",width:"w-36"},{key:"status",label:"Status",width:"w-36"},{key:"direction",label:"Type",width:"w-36"},{key:"qualified",label:"Qualified",width:"w-36"},{key:"call_outcome",label:"Outcome",width:"w-40"},{key:"call_time",label:"Time"}];function XS(e,t){return t==="qualified"?e.qualified?"Qualified":"—":t==="direction"?e.direction?e.direction.charAt(0).toUpperCase()+e.direction.slice(1):"—":e[t]||""}function CD(e){if(!e)return"—";const t=new Date(e);return isNaN(t.getTime())?e:la(t,"MMM d, yyyy, h:mm a")}const Bye=[10,25,50,100],zye=()=>{const[e,t]=p.useState([]),[n,r]=p.useState([]),[a,s]=p.useState(!0),[i,l]=p.useState(null),[c,u]=p.useState(!1),[d,f]=p.useState(0),[h,m]=p.useState(null),v=p.useRef(null),g=p.useRef(null),[y,x]=p.useState(null),[b,w]=p.useState("asc"),[N,S]=p.useState({channel:"",direction:"",agent_name:"",contact_name:"",phone:"",duration:"",status:"",qualified:"",call_outcome:"",call_time:""}),[_,k]=p.useState([]),[P,O]=p.useState(void 0),$=D=>{if(y!==D){x(D),w("asc");return}if(b==="asc"){w("desc");return}x(null)},T=(D,V)=>S(Y=>({...Y,[D]:V})),z=p.useMemo(()=>y?[...e].sort((V,Y)=>{const G=XS(V,y).toLowerCase(),K=XS(Y,y).toLowerCase();return G<K?b==="asc"?-1:1:G>K?b==="asc"?1:-1:0}):e,[e,y,b]),U=["Initiated","Ringing","In Progress","Completed","Failed","Unsuccessful"],E=async D=>{if(l(D),f(0),g.current=D.id,k([]),ee.getConversationEvents(D.id).then(({data:V})=>{g.current===D.id&&k(Array.isArray(V)?V:[])}),m(null),(D.recording_url||D.stereo_recording_url)&&ee.getConversationRecordingUrl(D.id).then(({data:V})=>{g.current===D.id&&m((V==null?void 0:V.url)??null)}),!D.transcript_messages||D.transcript_messages.length===0){u(!0);const{data:V}=await ee.getConversationTranscript(D.id);if(g.current!==D.id)return;V&&l(Y=>Y&&Y.id===D.id?{...Y,transcript:V.transcript??Y.transcript,transcript_messages:V.transcript_messages??Y.transcript_messages,recording_url:V.recording_url??Y.recording_url,stereo_recording_url:V.stereo_recording_url??Y.stereo_recording_url,ai_summary:V.ai_summary??Y.ai_summary}:Y),u(!1)}},[q,W]=p.useState(0),[L,M]=p.useState(1),[B,I]=p.useState(10),[R,F]=p.useState(N);p.useEffect(()=>{const D=setTimeout(()=>F(N),400);return()=>clearTimeout(D)}
864,[N]);const j=p.useCallback(()=>{const D=new URLSearchParams;return R.channel.trim()&&D.set("channel",R.channel.trim()),R.direction&&D.set("direction",R.direction),R.agent_name.trim()&&D.set("agent_name",R.agent_name.trim()),R.contact_name.trim()&&D.set("contact_name",R.contact_name.trim()),R.phone.trim()&&D.set("phone",R.phone.trim()),R.duration.trim()&&D.set("duration",R.duration.trim()),R.status&&D.set("status",R.status),R.qualified&&D.set("qualified",R.qualified),R.call_outcome.trim()&&D.set("call_outcome",R.call_outcome.trim()),P&&D.set("call_date",la(P,"yyyy-MM-dd")),D},[R,P]),C=p.useCallback(async(D=!1)=>{var K;D||s(!0);const V=j();V.set("limit",String(B)),V.set("offset",String((L-1)*B));const[Y,G]=await Promise.all([ee.getConversations(V.toString()),ee.getConversationStats()]);if(Y.data&&(t(Array.isArray(Y.data)?Y.data:[]),W(((K=Y.meta)==null?void 0:K.count)??0)),G.data){const Z=G.data;r([{label:"Total",count:Z.total??0},{label:"Completed",count:Z.completed??0},{label:"Failed",count:Z.failed??0},{label:"In Progress",count:Z.in_progress??0},{label:"Qualified",count:Z.qualified??0},{label:"Inbound",count:Z.inbound??0},{label:"Outbound",count:Z.outbound??0}])}D||s(!1)},[L,B,j]),A=Math.max(1,Math.ceil(q/B));return p.useEffect(()=>{C();const D=setInterval(()=>C(!0),3e4);return()=>clearInterval(D)},[C]),p.useEffect(()=>{M(1)},[B,R,P]),p.useEffect(()=>{L>A&&M(A)},[L,A]),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"All Conversations"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Every voice, SMS, WhatsApp and web chat in one place."})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:n.map(D=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:D.label}),o.jsx("div",{className:"mt-1 text-2xl font-bold text-foreground",children:D.count.toLocaleString()})]},D.label))}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[_D.map(({key:D,label:V,width:Y})=>o.jsx("th",{className:`px-4 py-3 ${Y??""}`,children:o.jsxs("button",{type:"button",onClick:()=>$(D),className:"flex w-full items-center justify-between gap-1 hover:text-foreground",children:[o.jsx("span",{children:V}),y===D?b==="asc"?o.jsx($B,{className:"h-3 w-3 shrink-0"}):o.jsx(MB,{className:"h-3 w-3 shrink-0"}):o.jsx(IB,{className:"h-3 w-3 shrink-0 opacity-50"})]})},D)),o.jsx("th",{className:"px-4 py-3 w-20",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[_D.map(({key:D,label:V,width:Y})=>D==="call_time"?o.jsx("th",{className:`px-4 py-3 font-normal normal-case ${Y??""}`,children:o.jsxs(yh,{children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{type:"button",className:"flex h-8 w-full items-center gap-1.5 rounded-md border border-input bg-background px-2 text-left text-xs text-muted-foreground hover:bg-muted",children:[o.jsx(W2,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"flex-1 truncate",children:P?la(P,"MMM d, yyyy"):"Date"}),P&&o.jsx("span",{role:"button",tabIndex:0,onClick:G=>{G.stopPropagation(),O(void 0)},className:"rounded p-0.5 hover:bg-muted-foreground/20",children:o.jsx(rn,{className:"h-3 w-3"})})]})}),o.jsx(Fu,{className:"w-auto p-0",align:"start",children:o.jsx(xP,{mode:"single",selected:P,onSelect:O,initialFocus:!0})})]})},D):D==="status"?o.jsx("th",{className:`px-4 py-3 font-normal normal-case ${Y??""}`,children:o.jsxs(nt,{value:N.status||"__all__",onValueChange:G=>T("status",G==="__all__"?"":G),children:[o.jsx(Ze,{className:"h-8 text-xs",children:o.jsx(rt,{placeholder:"Status"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__all__",children:"All"}),U.map(G=>o.jsx(we,{value:G,children:G},G))]})]})},D):D==="qualified"?o.jsx("th",{className:`px-4 py-3 font-normal normal-case ${Y??""}`,children:o.jsxs(nt,{value:N.qualified||"__all__",onValueChange:G=>T("qualified",G==="__all__"?"":G),children:[o.jsx(Ze,{className:"h-8 text-xs",children:o.jsx(rt,{placeholder:"Qualified"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__all__",children:"All"}),o.jsx(we,{value:"yes",children:"Qualified"}),o.jsx(we,{value:"no",children:"Not qualified"})]})]})},D):D==="direction"?o.jsx("th",{className:`px-4 py-3 font-normal normal-case ${Y??""}`,children:o.jsxs(nt,{value:N.direction||"__all__",onValueChange:G=>T("direction",G==="__all__"?"":G),children:[o.jsx(Ze,{className:"h-8 text-xs",children:o.jsx(rt,{placeholder:"Type"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__all__",children:"All"}),o.jsx(we,{value:"inbound",children:"Inbound"}),o.jsx(we,{value:"outbound",children:"Outbound"})]})]})},D):o.jsx("th",{className:`px-4 py-3 font-normal normal-case ${Y??""}`,children:o.jsxs("div",{className:"relative",children:[o.jsx(du,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),o.jsx(ve,{value:N[D],onChange:G=>T(D,G.target.value),placeholder:V,className:"h-8 pl-7 text-xs"})]})},D)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:a?o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:"px-4 py-8 text-center text-muted-foreground",children:"Loading..."})}):z.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:"px-4 py-8 text-center text-muted-foreground",children:e.length===0?"N
864o conversations found.":"No conversations match your filters."})}):z.map(D=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center",children:D.channel}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:D.agent_name||"—"}),o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:D.contact_name}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:D.phone}),o.jsx("td",{className:"px-4 py-3 text-center font-mono text-xs",children:D.duration}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${Fye(D.status)}`,children:D.status})}),o.jsx("td",{className:"px-4 py-3 text-center",children:D.direction&&o.jsx("span",{className:"rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success",children:XS(D,"direction")})}),o.jsx("td",{className:"px-4 py-3 text-center",children:D.qualified?o.jsx("span",{className:"rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success",children:"Qualified"}):o.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})}),o.jsx("td",{className:"px-4 py-3 text-center",children:D.call_outcome?o.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:D.call_outcome}):o.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})}),o.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-center text-muted-foreground",children:CD(D.call_time)}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("button",{onClick:()=>E(D),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground","aria-label":"View",title:"View",children:o.jsx(Ls,{className:"h-4 w-4"})})})]},D.id))})]})}),!a&&q>0&&o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-border bg-muted/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx("span",{children:"Items per page"}),o.jsxs(nt,{value:String(B),onValueChange:D=>I(Number(D)),children:[o.jsx(Ze,{className:"h-8 w-[72px] text-xs",children:o.jsx(rt,{})}),o.jsx(et,{children:Bye.map(D=>o.jsx(we,{value:String(D),children:D},D))})]})]}),o.jsx(Vye,{page:L,totalPages:A,onChange:M}),o.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[o.jsxs("span",{children:[(L-1)*B+1," - ",Math.min(L*B,q)," of ",q," items"]}),o.jsx("button",{type:"button",onClick:()=>C(),className:"rounded-md p-2.5 sm:p-1.5 hover:bg-muted hover:text-foreground","aria-label":"Refresh",title:"Refresh",children:o.jsx($u,{className:"h-4 w-4"})})]})]})]}),o.jsx(ft,{open:!!i,onOpenChange:D=>!D&&l(null),children:o.jsxs(ct,{className:"max-w-3xl max-h-[88vh] overflow-y-auto",children:[o.jsxs($t,{children:[o.jsxs(xt,{children:["Conversation · ",i==null?void 0:i.contact_name]}),o.jsxs(wt,{children:[i==null?void 0:i.channel," · ",i?CD(i.call_time):""]})]}),i&&o.jsxs("div",{className:"space-y-4",children:[(i.recording_url||i.stereo_recording_url)&&h===null?o.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-muted/20 px-4 py-6 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading recording…"]}):o.jsx(i1,{ref:v,src:h,onTimeUpdate:f}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-sm sm:grid-cols-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Phone"}),o.jsx("div",{className:"font-mono",children:i.phone||"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Duration"}),o.jsx("div",{className:"font-mono",children:i.duration||"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Type"}),o.jsx("div",{className:"capitalize",children:i.direction})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),o.jsx("div",{children:i.status})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Qualified"}),o.jsx("div",{children:i.qualified?"Yes":"No"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Outcome"}),o.jsx("div",{children:i.call_outcome||"—"})]}),i.transferred_to&&o.jsxs("div",{className:"col-span-2 sm:col-span-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Transferred to"}),o.jsx("div",{className:"font-mono",children:i.transferred_to})]})]}),_.length>0&&o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-semibold",children:"Call Events"}),o.jsx("ul",{className:"divide-y divide-border rounded-md border border-border text-xs",children:_.map(D=>o.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2",children:[o.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 font-medium text-primary",children:D.label||D.event_key}),D.note&&o.jsx("span",{className:"text-muted-foreground",children:D.note}),o.jsx("span",{className:"ml-auto text-muted-foreground",children:la(new Date(D.created_at),"h:mm:ss a")})]},D.id))})]}),i.ai_summary&&o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-semibold",children:"AI Summary"}),o.jsx("div",{className:"rounded-md bg-muted/50 p-3 text-xs leading-relaxed",children:i.ai_summary})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Transcript"}),c?o.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading transcript…"]}):o.jsx("div",{className:"max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/20 p-3",children:o.jsx(bP,{messages:i.transcript_messages,transcript:i.transcript,activeTime:d,onSeek:D=>{var V;return(V=v.current)==null?void 0:V.seek(D)}})})]})]}),o.jsx(Wt,{children:o.jsx(ne,{variant:"outline",onClick:()=>l(null),children:"Close"})})]})})]})};function Uye(e,t){const n=[],r=l=>n.push(l),s=Math.max(2,e-1),i=Math.min(t-1,e+1);r(1),s>2&&n.push("ellipsis");for(let l=s;l<=i;l++)r(l);return i<t-1&&n.push("ellipsis"),t>1&&r(t),n}function Vye({page:e,totalPages:t,onChange:n}){const r=Uye(e,t),a=i=>`flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition ${i?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,s="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40";return o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1",children:[o.jsx("button",{type:"button",className:s,disabled:e<=1,onClick:()=>n(1),"aria-label":"First page",title:"First page",children:o.jsx(RB,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",className:s,disabled:e<=1,onClick:()=>n(e-1),"aria-label":"Previous page",title:"Previous page",children:o.jsx(fh,{className:"h-4 w-4"})}),r.map((i,l)=>i==="ellipsis"?o.jsx("span",{className:"px-1.5 text-sm text-muted-foreground",children:"…"},`e${l}`):o.jsx("button",{type:"button",className:a(i===e),onClick:()=>n(i),children:i},i)),o.jsx("button",{type:"button",className:s,disabled:e>=t,onClick:()=>n(e+1),"aria-label":"Next page",title:"Next page",children:o.jsx(zo,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",className:s,disabled:e>=t,onClick:()=>n(t),"aria-label":"Last page",title:"Last page",children:o.jsx(LB,{className:"h-4 w-4"})})]})}const rl=({n:e,children:t})=>o.jsxs("li",{className:"flex gap-3",children:[o.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:e}),o.jsx("div",{className:"min-w-0 flex-1 text-sm text-foreground",children:t})]}),fy=({href:e,children:t})=>o.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-medium text-primary underline underline-offset-2 hover:opacity-80",children:[t," ",o.jsx(VB,{className:"h-3 w-3"})]});function Wye({value:e,label:t}){const[n,r]=p.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return o.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[o.jsx("code",{"aria-label":t,className:"min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted/40 px-2 py-1.5 text-xs",children:e}),o.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:a,"aria-label":`Copy ${t}`,children:n?o.jsx(tr,{className:"h-4 w-4"}):o.jsx(ow,{className:"h-4 w-4"})})]})}function qye({status:e,loading:t,error:n,isOwner:r,onRetry:a}){if(t)return o.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Checking calendar setup…"]});if(n||!e)return o.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm",children:[o.jsx("p",{className:"text-destructive",children:n||"Couldn't load the calendar setup."}),o.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:a,children:"Try again"})]});if(e.connected){const s=e.status==="reauth_required";return o.jsxs("div",{className:"space-y-2 text-sm",children:[s?o.jsxs("p",{className:"flex items-center gap-2 font-medium text-warning",children:[o.jsx(co,{className:"h-4 w-4"})," Your calendar needs to be reconnected"]}):o.jsxs("p",{className:"flex items-center gap-2 font-medium text-success",children:[o.jsx(tr,{className:"h-4 w-4"})," Google Calendar is already connected",e.email?` as ${e.email}`:""]}),o.jsx("p",{className:"text-muted-foreground",children:s?"Google stopped accepting the connection. Reconnect below — your working hours and settings are kept.":"Change its working hours or disconnect it from the Calendar section on this page."})]})}return r?e.configured?o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Let your AI agents check your free times and book meetings straight into your Google Calendar, while the caller is still on the line."}),o.jsxs("ol",{className:"space-y-3",children:[o.jsxs(rl,{n:1,children:["Click ",o.jsx("b",{children:"Connect with Google"})," below."]}),o.jsxs(rl,{n:2,children:["Choose your Google account and allow access. NEXUS can only see ",o.jsx("b",{children:"when you're busy"})," and add new meetings — it never reads your event titles or details."]}),o.jsxs(rl,{n:3,children:["You'll land back here. Set your working hours with ",o.jsx("b",{children:"Settings"}),", then tick ",o.jsx("b",{children:"Check Availability"})," and"," ",o.jsx("b",{children:"Book Calendar Slot"})," under ",o.jsx("b",{children:"Agent tools"})," when you edit an agent."]})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-md border border-warning/40 bg-warning/10 p-3 text-sm",children:[o.jsxs("p",{className:"flex items-center gap-2 font-medium",children:[o.jsx(co,{className:"h-4 w-4 text-warning"})," One-time setup needed first"]}),o.jsx("p",{className:"mt-1 text-muted-foreground",children:"Google needs to know about NEXUS before anyone can connect a calendar. Whoever runs the server does this once; after that, connecting is one click."})]}),o.jsxs("ol",{className:"space-y-3",children:[o.jsxs(rl,{n:1,children:["Open ",o.jsx(fy,{href:"https://console.cloud.google.com/projectcreate",children:"Google Cloud Console"})," and create a project (or pick one)."]}),o.jsxs(rl,{n:2,children:["Turn on the ",o.jsx(fy,{href:"https://console.cloud.google.com/apis/library/calendar-json.googleapis.com",children:"Google Calendar API"})," for that project."]}),o.jsxs(rl,{n:3,children:["Go to ",o.jsx(fy,{href:"https://console.cloud.google.com/apis/credentials/consent",children:"OAuth consent screen"}
864),", choose ",o.jsx("b",{children:"External"}),", and add these two scopes: ",o.jsx("code",{className:"text-xs",children:"calendar.events"})," and ",o.jsx("code",{className:"text-xs",children:"calendar.freebusy"}),". While testing, add each person who will connect as a ",o.jsx("b",{children:"Test user"}),"."]}),o.jsxs(rl,{n:4,children:["Go to ",o.jsx(fy,{href:"https://console.cloud.google.com/apis/credentials",children:"Credentials"})," → ",o.jsx("b",{children:"Create credentials → OAuth client ID"})," → ",o.jsx("b",{children:"Web application"}),", and add this as an ",o.jsx("b",{children:"Authorized redirect URI"}),":",o.jsx(Wye,{value:e.redirect_uri,label:"redirect URI"})]}),o.jsxs(rl,{n:5,children:["Copy the ",o.jsx("b",{children:"Client ID"})," and ",o.jsx("b",{children:"Client secret"})," into the server settings as"," ",o.jsx("code",{className:"text-xs",children:"GOOGLE_CLIENT_ID"})," and ",o.jsx("code",{className:"text-xs",children:"GOOGLE_CLIENT_SECRET"}),", then restart the server. Come back here and choose Google Calendar again."]})]})]}):o.jsx("p",{className:"text-sm text-muted-foreground",children:"Only the account owner can connect a calendar. Ask them to add it from this page."})}const Hye=e=>{window.location.assign(e)},l1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Gye=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}},c1=()=>{var e;try{const t=(e=Intl.supportedValuesOf)==null?void 0:e.call(Intl,"timeZone");if(t!=null&&t.length)return t}catch{}return["UTC","America/New_York","America/Chicago","America/Los_Angeles","Europe/London","Asia/Karachi","Asia/Dubai","Asia/Kolkata"]},Yye=e=>`${e.work_days.length===7?"Every day":e.work_days.join()==="0,1,2,3,4"?"Mon–Fri":e.work_days.map(n=>l1[n]).join(", ")}, ${e.start_time}–${e.end_time} (${e.timezone})`,Nb={slot_minutes:[10,240],buffer_minutes:[0,120],min_notice_hours:[0,168],max_days_ahead:[1,90]},Kye=(e,t=c1())=>{if(!e.timezone.trim()||t.length>0&&!t.includes(e.timezone))return"Choose a timezone from the list.";if(e.work_days.length===0)return"Pick at least one working day.";if(!/^([01]\d|2[0-3]):[0-5]\d$/.test(e.start_time)||!/^([01]\d|2[0-3]):[0-5]\d$/.test(e.end_time))return"Enter the start and end time.";if(e.start_time>=e.end_time)return"End time must be after start time.";const n={slot_minutes:"Meeting length",buffer_minutes:"Buffer",min_notice_hours:"Minimum notice",max_days_ahead:"Booking window"};for(const r of Object.keys(Nb)){const[a,s]=Nb[r],i=e[r];if(!Number.isInteger(i)||i<a||i>s)return`${n[r]} must be a whole number from ${a} to ${s}.`}return null};async function pq(){const{data:e,error:t}=await ee.getCalendarConnectUrl(Gye()),n=e==null?void 0:e.url;return t||!n?t||"Couldn't start the Google connection.":(Hye(n),null)}const kD=[{value:"WhitelistData",label:"WhitelistData",provider:"whitelistdata",urlPaste:!0,fields:[{key:"apiKey",label:"API Key",placeholder:"d5078618-5c1c-4e3e-…",help:"The apiKey value from your WhitelistData account"},{key:"code",label:"Function Code",placeholder:"ONbKJs8jpJZWJU5vO9Zg…",help:"The code value from your WhitelistData endpoint URL"},{key:"secret",label:"Secret",placeholder:"sha290OpGRNz",help:"The secret value from your WhitelistData endpoint URL",type:"password"}]},{value:"GoogleCalendar",label:"Google Calendar",calendar:!0,fields:[]},{value:"TwilioByot",label:"Twilio",twilioByot:!0,fields:[{key:"accountSid",label:"Account SID",placeholder:"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",help:"Twilio Console → Account"},{key:"authToken",label:"Auth Token",placeholder:"Your Twilio Auth Token",help:"Twilio Console → Account → API keys & tokens",type:"password"}]},{value:"Brevo",label:"Brevo",provider:"brevo",fields:[{key:"apiKey",label:"API Key",placeholder:"xkeysib-xxxxxxxxxxxx…",help:"Your Brevo API key (SMTP & API > API Keys)",type:"password"},{key:"fromEmail",label:"From Email",placeholder:"[email protected]",help:"Must be a verified sender in Brevo"}]},{value:"SendGrid",label:"SendGrid",provider:"sendgrid",fields:[{key:"apiKey",label:"API Key",placeholder:"SG.xxxxxxxxxxxx…",help:"Your SendGrid API key (Settings > API Keys)",type:"password"},{key:"fromEmail",label:"From Email",placeholder:"[email protected]",help:"Must be a verified sender identity in SendGrid"}]},{value:"SMTP",label:"SMTP",provider:"smtp",fields:[{key:"host",label:"SMTP Host",placeholder:"smtp.yourdomain.com",help:"Your SMTP server hostname"},{key:"port",label:"Port",placeholder:"587",help:"Usually 587 (TLS) or 465 (SSL)"},{key:"username",label:"Username",placeholder:"[email protected]",help:"SMTP login username"},{key:"password",label:"Password",placeholder:"••••••••",help:"SMTP login password",type:"password"},{key:"fromEmail",label:"From Email",placeholder:"[email protected]",help:"Address emails will be sent from"}]}];function Xye({open:e,onOpenChange:t,onCreate:n,onTwilioConnected:r}){const[a,s]=p.useState(1),[i,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(""),[h,m]=p.useState({}),[v,g]=p.useState({}),[y,x]=p.useState(!1),b=kD.find(F=>F.value===d),w=!!(b!=null&&b.calendar),N=!!(b!=null&&b.twilioByot),[S,_]=p.useState(null),[k,P]=p.useState(!1),[O,$]=p.useState(null),[T,z]=p.useState(!0),[U,E]=p.useState(!1),q=async()=>{var C;P(!0),$(null);const[F,j]=await Promise.all([ee.getCalendarStatus(),ee.getMyRole()]);F.error||!F.data?$(F.error||"Couldn't load the calendar setup."):_(F.data),z(((C=j.data)==null?void 0:C.is_owner)??!0),P(!1)};p.useEffect(()=>{e&&a===2&&w&&q()},[e,a,w]);const W=async()=>{E(!0);const F=await pq();F&&(E(!1),X.error(F))},L=!!S&&S.configured&&T&&(!S.connected||S.status==="reauth_required"),M=()=>{s(1),l(""),u(""),f(""),m({}),_(null),$(null),E(!1),x(!1)},B=F=>{F||M(),t(F)},I=async()=>
864{if(a===1){if(!d)return X.error("Please select an integration type");if(!w&&!i.trim())return X.error("Integration name is required");s(2);return}if(a===2){const F=b==null?void 0:b.fields.find(C=>{var A;return!((A=h[C.key])!=null&&A.trim())});if(F)return X.error(`${F.label} is required`);if(N){x(!0);const{error:C}=await ee.createTwilioCredential({account_sid:h.accountSid,auth_token:h.authToken,label:i.trim()||void 0});if(x(!1),C)return X.error(C);r==null||r(),s(3);return}const j=b!=null&&b.provider?{...h,provider:b.provider}:h;n==null||n({name:i,description:c,type:d,credentials:j}),s(3)}},R=F=>{if(F.trim())try{const j=F.includes("?")?F.slice(F.indexOf("?")+1):F,C=new URLSearchParams(j),A={};for(const D of["apiKey","code","secret","type"]){const V=C.get(D);V&&(A[D]=V)}if(!Object.keys(A).length)return X.error("Couldn't find apiKey, code or secret in that URL");m(D=>({...D,...A})),X.success(`Filled ${Object.keys(A).join(", ")}`)}catch{X.error("That doesn't look like a valid URL")}};return o.jsx(ft,{open:e,onOpenChange:B,children:o.jsxs(ct,{className:"max-w-xl gap-0 p-0 sm:rounded-xl [&>button]:hidden",children:[o.jsxs("div",{className:"flex items-start justify-between border-b border-border p-5",children:[o.jsx(xt,{className:"text-lg font-semibold",children:"Create Integration"}),o.jsx("button",{onClick:()=>B(!1),className:"rounded-md p-1 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsx("div",{className:"flex items-center justify-center gap-2 px-6 pt-5",children:(w?[1,2]:[1,2,3]).map((F,j,C)=>{const A=a>F,D=a===F;return o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:`flex h-9 w-9 items-center justify-center rounded-full text-sm font-semibold ${A||D?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:A?o.jsx(Ta,{className:"h-4 w-4"}):F}),j<C.length-1&&o.jsx("div",{className:`mx-1 h-1 w-10 rounded sm:w-24 ${a>F?"bg-primary":"bg-muted"}`})]},F)})}),o.jsxs("div",{className:"max-h-[60vh] overflow-y-auto p-6",children:[a===1&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-base font-semibold",children:"Integration Details"}),o.jsxs("div",{children:[o.jsxs("label",{className:"mb-1.5 block text-sm font-medium",children:["Select Integration Type ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs(nt,{value:d||"__none__",onValueChange:F=>{f(F==="__none__"?"":F),m({})},children:[o.jsx(Ze,{"aria-label":"Integration type",children:o.jsx(rt,{placeholder:"Select Integration"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__none__",disabled:!0,children:"Select Integration"}),kD.map(F=>o.jsx(we,{value:F.value,children:F.label},F.value))]})]})]}),w?o.jsx("p",{className:"rounded-md bg-muted/40 p-3 text-sm text-muted-foreground",children:"Connect your Google Calendar so agents can check your free times and book meetings during a call. Click Next to see how."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsxs("label",{className:"mb-1.5 block text-sm font-medium",children:["Integration Name ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(ve,{value:i,onChange:F=>l(F.target.value),placeholder:"e.g., My Custom API"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-sm font-medium",children:"Description"}),o.jsx("textarea",{value:c,onChange:F=>u(F.target.value),placeholder:"Describe what this integration does…",rows:3,className:"w-full rounded-md border border-input bg-background p-2 text-sm"})]})]})]}),a===2&&w&&o.jsx(qye,{status:S,loading:k,error:O,isOwner:T,onRetry:q}),a===2&&b&&!w&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Authenticate with ",b.label," using API key"]}),b.provider==="whitelistdata"&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Don't have credentials yet?"," ",o.jsx("a",{href:"https://app.whitelistdata.com/",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline underline-offset-2 hover:opacity-80",children:"Sign up at whitelistdata.com"})," ","to generate an apiKey, code, and secret."]}),b.urlPaste&&o.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-muted/30 p-3",children:[o.jsx("label",{className:"mb-1.5 block text-sm font-medium",children:"Paste your full API URL"}),o.jsx(ve,{placeholder:"https://hooks.whitelistdata.com/api/…?code=…&secret=…&apiKey=…",onChange:F=>R(F.target.value)}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Optional shortcut. This fills the fields below automatically. You can also enter them by hand."})]}),b.fields.map(F=>o.jsxs("div",{children:[o.jsxs("label",{className:"mb-1.5 block text-sm font-medium",children:[F.label," ",o.jsx("span",{className:"text-destructive",children:"*"})]}),F.type==="password"?o.jsxs("div",{className:"relative",children:[o.jsx(ve,{type:v[F.key]?"text":"password",value:h[F.key]??"",onChange:j=>m(C=>({...C,[F.key]:j.target.value})),placeholder:F.placeholder,className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>g(j=>({...j,[F.key]:!j[F.key]})),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":v[F.key]?"Hide secret":"Show secret",children:v[F.key]?o.jsx(sw,{size:16}):o.jsx(Ls,{size:16})})]}):o.jsx(ve,{value:h[F.key]??"",onChange:j=>m(C=>({...C,[F.key]:j.target.value})),placeholder:F.placeholder}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:F.help})]},F.key))]}),a===3&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full border-2 border-success",children:o.jsx(Ta,{className:"h-8 w-8 text-success"})}),o.jsx("h3",{className:"mt-4 text-xl font-semibold text-success",children:"Integration Created Successfully!"}),o.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Your integration has been configured and is ready to use."})]})]}),o.jsx("div",{className:"flex flex-col-reverse gap-2 border-t border-border p-4 sm:flex-row sm:items-center sm:justify-between",children:a===3?o.jsx(ne,{className:"ml-auto bg-primary text-primary-foreground",onClick:()=>B(!1),children:"Done"}):o.jsxs(o.Fragment,{children:[a===1?o.jsx(ne,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}):o.jsxs(ne,{variant:"outline",onClick:()=>s(1),children:[o.jsx(fh,{className:"mr-1 h-4 w-4"})," Previous"]}),a===1?o.jsxs(ne,{onClick:I,disabled:!d||!w&&!i.trim(),className:"bg-primary text-primary-foreground hover:opacity-90",children:["Next ",o.jsx(zo,{className:"ml-1 h-4 w-4"})]}):w?L?o.jsxs(ne,{onClick:W,disabled:U,className:"bg-primary text-primary-foreground hover:opacity-90",children:[U&&o.jsx(Te,{className:"mr-1 h-4 w-4 animate-spin"}),S!=null&&S.connected?"Reconnect with Google":"Connect with Google"]}):o.jsx(ne,{onClick:()=>B(!1),className:"bg-primary text-primary-foreground hover:opacity-90",children:"Close"}):o.jsxs(ne,{onClick:I,disabled:y,className:"bg-primary text-primary-foreground hover:opacity-90",children:[y?o.jsx(Te,{className:"mr-1 h-4 w-4 animate-spin"}):o.jsx(tr,{className:"mr-1 h-4 w-4"}),y?"Connecting…":"Create"]})]})})]})})}function gq({id:e,ariaLabel:t,value:n,onChange:r,options:a,disabled:s,placeholder:i="Select…",searchPlaceholder:l="Search…",searchable:c=!0}){const[u,d]=p.useState(!1),f=a.find(m=>m.value===n),h=Array.from(new Set(a.map(m=>m.group??"")));return o.jsxs(yh,{open:u,onOpenChange:d,modal:!0,children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{id:e,type:"button",role:"combobox","aria-expanded":u,"aria-label":t,disabled:s,className:"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-left text-sm r
864ing-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[o.jsx("span",{className:he("truncate",!f&&"text-muted-foreground"),children:(f==null?void 0:f.label)??(n||i)}),o.jsx(FB,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Fu,{className:"w-[var(--radix-popover-trigger-width)] min-w-[12rem] p-0",align:"start",children:o.jsxs(Qw,{children:[c&&o.jsx(Zw,{placeholder:l}),o.jsxs(e1,{children:[o.jsx(t1,{children:"No match."}),h.map(m=>o.jsx(n1,{heading:m||void 0,children:a.filter(v=>(v.group??"")===m).map(v=>o.jsxs(r1,{value:`${v.label} ${v.keywords??""} ${v.value}`,onSelect:()=>{r(v.value),d(!1)},children:[o.jsx(Ta,{className:he("mr-2 h-4 w-4",v.value===n?"opacity-100":"opacity-0")}),v.label]},v.value))},m))]})]})})]})}const ED=[{value:"America/New_York",label:"Eastern Time – EST/EDT (New York)"},{value:"America/Chicago",label:"Central Time – CST/CDT (Chicago)"},{value:"America/Denver",label:"Mountain Time – MST/MDT (Denver)"},{value:"America/Phoenix",label:"Arizona – MST, no daylight saving (Phoenix)"},{value:"America/Los_Angeles",label:"Pacific Time – PST/PDT (Los Angeles)"},{value:"America/Anchorage",label:"Alaska Time – AKST/AKDT (Anchorage)"},{value:"Pacific/Honolulu",label:"Hawaii – HST (Honolulu)"},{value:"UTC",label:"UTC"},{value:"Europe/London",label:"London (GMT/BST)"},{value:"Asia/Dubai",label:"Dubai (GST)"},{value:"Asia/Karachi",label:"Pakistan – PKT (Karachi)"},{value:"Asia/Kolkata",label:"India – IST (Kolkata)"}],Jye={"America/New_York":"EST EDT ET eastern","America/Chicago":"CST CDT CT central","America/Denver":"MST MDT MT mountain","America/Los_Angeles":"PST PDT PT pacific","America/Anchorage":"AKST AKDT alaska","Pacific/Honolulu":"HST hawaii","Asia/Karachi":"PKT pakistan","Asia/Kolkata":"IST india"};function vq({id:e,value:t,onChange:n,zones:r,disabled:a}){const s=p.useMemo(()=>{const i=new Set(ED.map(l=>l.value));return[...ED.map(l=>({...l,keywords:Jye[l.value],group:"Common"})),...Array.from(new Set([t,...r])).filter(l=>l&&!i.has(l)).map(l=>({value:l,label:l,group:"All regions"}))]},[r,t]);return o.jsx(gq,{id:e,ariaLabel:"Timezone",value:t,onChange:n,options:s,disabled:a,placeholder:"Select timezone",searchPlaceholder:"Type EST, PST, Karachi…"})}const yq=e=>{const[t,n]=e.split(":").map(Number);return`${t%12||12}:${String(n).padStart(2,"0")} ${t<12?"AM":"PM"}`},JS=Array.from({length:96},(e,t)=>{const n=`${String(Math.floor(t/4)).padStart(2,"0")}:${String(t%4*15).padStart(2,"0")}`;return{value:n,label:yq(n),keywords:n}});function Xm({id:e,value:t,onChange:n,disabled:r}){const a=!/^\d\d:\d\d$/.test(t)||JS.some(s=>s.value===t)?JS:[...JS,{value:t,label:yq(t),keywords:t}].sort((s,i)=>s.value.localeCompare(i.value));return o.jsx(gq,{id:e,value:t,onChange:n,options:a,disabled:r,placeholder:"Select time",searchable:!1})}const Qye=[{key:"slot_minutes",label:"Meeting length",unit:"minutes",hint:"How long each booking lasts by default."},{key:"buffer_minutes",label:"Buffer between meetings",unit:"minutes",hint:"Free time kept before and after each meeting."},{key:"min_notice_hours",label:"Minimum notice",unit:"hours",hint:"The agent won't book anything sooner than this."},{key:"max_days_ahead",label:"Booking window",unit:"days",hint:"How far ahead callers can book."}];function Zye({open:e,onOpenChange:t,settings:n,onSaved:r}){const[a,s]=p.useState(n),[i,l]=p.useState(!1),[c,u]=p.useState(null),d=p.useMemo(()=>Array.from(new Set(["UTC",n.timezone,...c1()])),[n.timezone]);p.useEffect(()=>{e&&(s(n),u(null))},[e,n]);const f=(v,g)=>{s(y=>({...y,[v]:g})),u(null)},h=v=>f("work_days",a.work_days.includes(v)?a.work_days.filter(g=>g!==v):[...a.work_days,v].sort()),m=async()=>{const v=Kye(a,d);if(v){u(v);return}l(!0);const{data:g,error:y}=await ee.updateCalendarSettings({...a});if(l(!1),y||!g){u(y||"Couldn't save your settings.");return}X.success("Calendar settings saved"),r(g),t(!1)};return o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Calendar settings"}),o.jsx(wt,{children:"When your agent may offer and book meetings."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cal-tz",children:"Timezone"}),o.jsx(vq,{id:"cal-tz",value:a.timezone,zones:d,onChange:v=>f("timezone",v)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Working days"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:l1.map((v,g)=>{const y=a.work_days.includes(g);return o.jsx("button",{type:"button","aria-pressed":y,onClick:()=>h(g),className:`rounded-md border px-3 py-1.5 text-sm transition ${y?"border-primary bg-primary/10 font-medium text-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:v},v)})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cal-start",children:"Day starts"}),o.jsx(Xm,{id:"cal-start",value:a.start_time,onChange:v=>f("start_time",v)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cal-end",children:"Day ends"}),o.jsx(Xm,{id:"cal-end",value:a.end_time,onChange:v=>f("end_time",v)})]})]}),o.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Qye.map(({key:v,label:g,unit:y,hint:x})=>o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(ke,{htmlFor:`cal-${v}`,children:[g," (",y,")"]}),o.jsx(ve,{id:`cal-${v}`,type:"number",inputMode:"numeric",min:Nb[v][0],max:Nb[v][1],value:Number.isNaN(a[v])?"":a[v],onChange:b=>f(v,b.target.value===""?NaN:Number(b.target.value))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:x})]},v))}),c&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),disabled:i,children:"Cancel"}),o.jsxs(ne,{onClick:m,disabled:i,children:[i&&o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"})," Save settings"]})]})]})})}function _b({icon:e,title:t,badge:n,actions:r,dashed:a,className:s,children:i}){return o.jsxs("div",{className:he("flex h-full flex-col gap-3 rounded-xl border p-4 transition-colors",a?"border-dashed border-border bg-muted/30":"border-border bg-card card-interactive",s),children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[o.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:o.jsx(e,{className:"h-4 w-4"})}),o.jsx("span",{className:"truncate font-semibold text-foreground",children:t})]}),n]}),i&&o.jsx("div",{className:"flex-1 space-y-2 text-sm text-muted-foreground",children:i}),r&&o.jsx("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:r})]})}const exe={connected:{kind:"success",text:"Google Calendar connected"},denied:{kind:"error",text:"Calendar connection was cancelled — nothing was changed."}},txe={state:"That connection link expired. Please try connecting again.",no_refresh:"Google didn't grant lasting access. Remove NEXUS from your Google account's connected apps, then connect again.",reauth:"Google rejected the connection. Please try again."};function nxe(){const[e,t]=p.useState(null),[n,r]=p.useState(!0),[a,s]=p.useState(!0),[i,l]=p.useState(null),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[v,g]=p.useState(!1),[y,x]=Eg(),b=p.useCallback(async()=>{var $;s(!0),l(null);const[P,O]=await Promise.all([ee.getCalendarStatus(),ee.getMyRole()]);P.error||!P.data?l(P.error||"Couldn't load the calendar status."):t(P.data),r((($=O.data)==null?void 0:$.is_owner)??!0),s(!1)},[]);p.useEffect(()=>{b()},[b]),p.useEffect(()=>{const P=y.get("calendar");if(!P)return;const O=exe[P];O?(O.kind==="success"?X.success:X.error)(O.text):X.error(txe[y.get("reason")??""]??"Couldn't connect Google Calendar. Please try again.");const $=new URLSearchParams(y);$.delete("calendar"),$.delete("reason"),x($,{replace:!0})},[y,x]);const w=async()=>{u(!0);const P=await pq();P&&(u(!1),X.error(P))},N=async()=>{g(!0);const{error:P}
864=await ee.disconnectCalendar();if(g(!1),m(!1),P){X.error(P);return}X.success("Google Calendar disconnected"),b()};if(a&&!e||e&&!e.connected&&!i)return null;const S=!!e&&e.status==="reauth_required",_=!a&&!i&&e&&(S?o.jsxs(_n,{variant:"outline",className:"shrink-0 gap-1 border-warning/40 bg-warning/10 text-warning",children:[o.jsx(co,{className:"h-3 w-3"})," Needs to be reconnected"]}):o.jsxs(_n,{variant:"outline",className:"shrink-0 gap-1 border-success/40 bg-success/10 text-success",children:[o.jsx(tr,{className:"h-3 w-3"})," Connected"]})),k=!a&&!i&&e&&n&&o.jsxs(o.Fragment,{children:[S&&o.jsx(ne,{size:"sm",onClick:w,disabled:c,children:"Reconnect"}),o.jsxs(ne,{size:"sm",variant:"outline",onClick:()=>f(!0),children:[o.jsx(Ps,{className:"mr-1.5 h-4 w-4"})," Settings"]}),o.jsx(ne,{size:"sm",variant:"outline",onClick:()=>m(!0),children:"Disconnect"})]});return o.jsxs(o.Fragment,{children:[o.jsx(_b,{icon:pre,title:"Google Calendar",badge:_,actions:k,children:a?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading…"]}):i||!e?o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{role:"alert",className:"text-destructive",children:i}),o.jsx(ne,{variant:"outline",size:"sm",onClick:b,children:"Try again"})]}):o.jsxs(o.Fragment,{children:[e.email&&o.jsxs("p",{children:["as ",e.email]}),S&&o.jsx("p",{children:"Google stopped accepting this connection, so agents can't book right now. Reconnect to fix it — your settings are kept."}),o.jsxs("p",{children:["Bookable: ",Yye(e.settings)]}),!n&&o.jsx("p",{className:"text-xs",children:"Only the account owner can change calendar settings."})]})}),e&&o.jsx(Zye,{open:d,onOpenChange:f,settings:e.settings,onSaved:P=>t(O=>O&&{...O,settings:P})}),o.jsx(Is,{open:h,onOpenChange:P=>!P&&!v&&m(!1),children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsx(Jo,{children:"Disconnect Google Calendar?"}),o.jsx(Qo,{children:"Agents will no longer be able to check availability or book meetings. Meetings already booked stay in your calendar."})]}),o.jsxs(Xo,{children:[o.jsx(es,{disabled:v,children:"Cancel"}),o.jsx(Zo,{onClick:P=>{P.preventDefault(),N()},disabled:v,children:v?"Disconnecting…":"Disconnect"})]})]})})]})}function AD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rxe(...e){return t=>{let n=!1;const r=e.map(a=>{const s=AD(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<r.length;a++){const s=r[a];typeof s=="function"?s():AD(e[a],null)}}}}function axe(...e){return p.useCallback(rxe(...e),e)}function oxe(e){const t=p.forwardRef((n,r)=>{let{children:a,...s}=n,i=null,l=!1;const c=[];PD(a)&&typeof hy=="function"&&(a=hy(a._payload)),p.Children.forEach(a,h=>{var m;if(uxe(h)){l=!0;const v=h;let g="child"in v.props?v.props.child:v.props.children;PD(g)&&typeof hy=="function"&&(g=hy(g._payload)),i=ixe(v,g),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!l&&p.Children.count(a)===1&&p.isValidElement(a)&&(i=a);const u=i?cxe(i):void 0,d=axe(r,u);if(!i){if(a||a===0)throw new Error(l?mxe(e):hxe(e));return a}const f=lxe(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}var sxe=Symbol.for("radix.slottable"),ixe=(e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null};function lxe(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const c=s(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function cxe(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function uxe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sxe}var dxe=Symbol.for("react.lazy");function PD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===dxe&&"_payload"in e&&fxe(e._payload)}function fxe(e){return typeof e=="object"&&e!==null&&"then"in e}var hxe=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,mxe=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,hy=M0[" use ".trim().toString()],pxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gxe=pxe.reduce((e,t)=>
864{const n=oxe(`Primitive.${t}`),r=p.forwardRef((a,s)=>{const{asChild:i,...l}=a,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vxe=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"}),yxe="VisuallyHidden",ev=p.forwardRef((e,t)=>o.jsx(gxe.span,{...e,ref:t,style:{...vxe,...e.style}}));ev.displayName=yxe;function xxe({target:e,onOpenChange:t,onSaved:n}){const[r,a]=p.useState(""),[s,i]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(!1);p.useEffect(()=>{e&&(a(e.account_sid),c(e.label||""),i(""),d(!1))},[e]);const m=()=>t(!1),v=async()=>{if(!e)return;const g=r.trim();if(!g){X.error("Account SID is required");return}const y={label:l.trim()};g!==e.account_sid&&(y.account_sid=g),s.trim()&&(y.auth_token=s.trim()),h(!0);const{error:x}=await ee.updateTwilioCredential(e.id,y);if(h(!1),x)return X.error(x);X.success("Twilio account updated"),m(),n==null||n()};return o.jsx(ft,{open:!!e,onOpenChange:g=>!g&&m(),children:o.jsxs(ct,{className:"max-w-lg p-0 gap-0 [&>button]:hidden",children:[o.jsxs(ev,{children:[o.jsx(xt,{children:"Edit Twilio account"}),o.jsx(wt,{children:"Update the label, Account SID, or Auth Token"})]}),o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[o.jsx("h2",{className:"text-lg font-bold",children:"Edit Twilio account"}),o.jsx("button",{onClick:m,className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"space-y-4 px-6 py-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Label"}),o.jsx(ve,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g. My Twilio account"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Account SID"}),o.jsx(ve,{value:r,onChange:g=>a(g.target.value),placeholder:"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Auth Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(ve,{type:u?"text":"password",value:s,onChange:g=>i(g.target.value),placeholder:"Leave blank to keep the current one",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>d(g=>!g),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":u?"Hide secret":"Show secret",children:u?o.jsx(sw,{size:16}):o.jsx(Ls,{size:16})})]})]})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border px-6 py-4 bg-muted/20 sm:flex-row sm:items-center sm:justify-end",children:[o.jsxs(ne,{variant:"outline",onClick:m,className:"w-full sm:w-auto",children:[o.jsx(rn,{className:"mr-1 h-4 w-4"})," Cancel"]}),o.jsxs(ne,{onClick:v,disabled:f,className:"w-full bg-primary text-primary-foreground hover:opacity-90 sm:w-auto",children:[o.jsx(X2,{className:"mr-1 h-4 w-4"})," ",f?"Saving…":"Save"]})]})]})})}function bxe(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[a,s]=p.useState(null),[i,l]=p.useState(!1),[c,u]=p.useState(null),d=p.useCallback(async()=>{r(!0);const{data:h,error:m}=await ee.getTwilioCredentials();m&&X.error(m),t(h??[]),r(!1)},[]);p.useEffect(()=>{d()},[d]);const f=async()=>{if(!a)return;l(!0);const{error:h}=await ee.deleteTwilioCredential(a.id);if(l(!1),h){X.error(h);return}X.success("Twilio account removed"),s(null),d()};return n||e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsx(_b,{icon:wf,title:"Twilio",badge:o.jsxs(_n,{variant:"outline",className:"shrink-0 gap-1 border-success/40 bg-success/10 text-success",children:[o.jsx(tr,{className:"h-3 w-3"})," Connected"]}),children:o.jsx("div",{className:"space-y-2",children:e.map(h=>o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 p-2.5",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:h.label||h.account_sid}),o.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[h.label?h.account_sid:"",h.auth_token_masked?`${h.label?" · ":""}${h.auth_token_masked}`:""]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[o.jsx("button",{onClick:()=>u(h),className:"rounded-md p-2 text-muted-foreground hover:bg-muted hover:text-foreground sm:p-1.5","aria-label":"Edit",title:"Edit",children:o.jsx(lw,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>s(h),className:"rounded-md p-2 text-muted-foreground hover:bg-muted hover:text-destructive sm:p-1.5","aria-label":"Remove",title:"Remove",children:o.jsx(Oa,{className:"h-4 w-4"})})]})]}
864,h.id))})}),o.jsx(xxe,{target:c,onOpenChange:h=>!h&&u(null),onSaved:d}),o.jsx(Is,{open:!!a,onOpenChange:h=>!h&&!i&&s(null),children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsx(Jo,{children:"Remove this Twilio account?"}),o.jsxs(Qo,{children:[(a==null?void 0:a.label)||(a==null?void 0:a.account_sid)," will be disconnected. This is blocked while any phone number still uses it."]})]}),o.jsxs(Xo,{children:[o.jsx(es,{disabled:i,children:"Cancel"}),o.jsx(Zo,{onClick:h=>{h.preventDefault(),f()},disabled:i,children:i?"Removing…":"Remove"})]})]})})]})}const wxe={voice:Un,email:hh,other:ac},jxe=()=>{const[e,t]=p.useState(!1),[n,r]=p.useState([]),[a,s]=p.useState(!0),[i,l]=p.useState(0),[c,u]=p.useState(null),[d,f]=p.useState("idle"),[h,m]=p.useState([]),[v,g]=p.useState(null),[y,x]=p.useState({}),b=p.useCallback(async()=>{const{data:U,error:E}=await ee.getIntegrations();E?X.error(E):r(U??[]),s(!1)},[]);p.useEffect(()=>{b()},[b]);const w=n.some(U=>U.category==="other"),N=async U=>{const{error:E}=await ee.deleteIntegration(U.id);if(E)return X.error(E);r(q=>q.filter(W=>W.id!==U.id)),X.success("Integration removed")},S=async U=>{u(U),f("running"),m([`Connecting to ${U.name}…`,"Sending authenticated request…"]);const{data:E,error:q}=await ee.testIntegration(U.id);if(q){m(B=>[...B,`Test failed: ${q}`]),f("fail");return}const W=E;if(!W){m(B=>[...B,"Test failed: no response from server"]),f("fail");return}const L=[];W.provider&&L.push(`Detected provider: ${W.provider}`);const M=W.latency_ms!=null?` (latency ${W.latency_ms}ms)`:"";L.push(`${W.message}${M}`),m(B=>[...B,...L]),f(W.ok?"success":"fail")},[_,k]=p.useState({}),P=U=>{g(U),x({name:U.name,description:U.description,status:U.status}),k({})},O=async()=>{if(!v)return;const U={name:y.name??v.name,description:y.description??v.description,status:y.status??v.status};Object.values(_).some(W=>W.trim())&&(U.config=_);const{error:q}=await ee.updateIntegration(v.id,U);if(q)return X.error(q);r(W=>W.map(L=>L.id===v.id?{...L,...U}:L)),X.success("Settings saved"),g(null)},$=U=>{const E=U.toLowerCase();return E.includes("sip")||E.includes("twilio")||E.includes("idt")||E.includes("telephony")||E.includes("vonage")||E.includes("plivo")?"voice":E.includes("mail")||E.includes("brevo")||E.includes("sendgrid")||E.includes("smtp")?"email":"other"},T=async U=>{const E=$(U.type),{data:q,error:W}=await ee.createIntegration({name:U.name,description:U.description||U.type,status:"Active",category:E,config:U.credentials});if(W)return X.error(W);q&&(r(L=>[q,...L]),X.success(`${U.name} connected`))},z=({i:U})=>o.jsx(_b,{icon:wxe[U.category],title:U.name,badge:U.status==="Active"?o.jsxs(_n,{variant:"outline",className:"shrink-0 gap-1 border-success/40 bg-success/10 text-success",children:[o.jsx(tr,{className:"h-3 w-3"})," Connected"]}):o.jsx(_n,{variant:U.status==="Paused"?"secondary":"outline",children:U.status}),actions:o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>S(U),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted hover:text-primary","aria-label":"Test",title:"Test connection",children:o.jsx(As,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>P(U),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground","aria-label":"Settings",title:"Settings",children:o.jsx(Ps,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>N(U),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted hover:text-destructive","aria-label":"Delete",title:"Delete",children:o.jsx(Oa,{className:"h-4 w-4"})})]}),children:o.jsx("p",{className:"truncate",children:U.description})});return a?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading integrations..."]}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Integrations"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect telephony providers, email services, and your CRM."})]}),o.jsx("div",{className:"flex gap-2",children:o.jsxs(ne,{onClick:()=>t(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Add Integration"]})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:[o.jsx(nxe,{}),o.jsx(bxe,{},i),n.map(U=>o.jsx(z,{i:U},U.id)),!w&&o.jsx(_b,{icon:ac,title:"DNC Screening",dashed:!0,actions:o.jsxs("a",{href:"https://app.whitelistdata.com/",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 whitespace-nowrap rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:opacity-90",children:["Get an API key ",o.jsx(VB,{className:"h-3.5 w-3.5"})]}),children:o.jsx("p",{children:"Screen contacts against Do-Not-Call and litigator lists before you dial. WhitelistData is a separate service — sign up to get an API key, then connect it here with Add Integration."})})]}),o.jsx(Xye,{open:e,onOpenChange:t,onCreate:T,onTwilioConnected:()=>l(U=>U+1)}),o.jsx(ft,{open:!!c,onOpenChange:U=>!U&&u(null),children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsxs(xt,{className:"flex items-center gap-2",children:[o.jsx(As,{className:"h-5 w-5 text-primary"}),"Test ",c==null?void 0:c.name]}),o.jsx(wt,{children:"Verifying connectivity and credentials for this integration."})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 font-mono text-xs space-y-1 max-h-56 overflow-y-auto",children:[h.map((U,E)=>o.jsx("div",{className:"text-foreground",children:U},E)),d==="running"&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Te,{className:"h-3 w-3 animate-spin"})," Working..."]})]}),d==="success"&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-success/10 px-3 py-2 text-sm text-success",children:[o.jsx(tr,{className:"h-4 w-4"})," Connection verified successfully."]}),d==="fail"&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[o.jsx(Og,{className:"h-4 w-4"})," Connection test failed."]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>u(null),children:"Close"}),o.jsx(ne,{onClick:()=>c&&S(c),disabled:d==="running",children:"Run Again"})]})]})}),o.jsx(ft,{open:!!v,onOpenChange:U=>!U&&g(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsxs(xt,{className:"flex items-center gap-2",children:[o.jsx(Ps,{className:"h-5 w-5 text-primary"}),"Integration Settings"]}),o.jsx(wt,{children:"Update name, description, and status. Changes save immediately."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{htmlFor:"int-name",children:"Name"}),o.jsx(ve,{id:"int-name",value:y.name??"",onChange:U=>x(E=>
864({...E,name:U.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{htmlFor:"int-desc",children:"Description"}),o.jsx(Zl,{id:"int-desc",value:y.description??"",onChange:U=>x(E=>({...E,description:U.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Status"}),o.jsxs(nt,{value:y.status??"Active",onValueChange:U=>x(E=>({...E,status:U})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Inactive",children:"Inactive"})]})]})]}),o.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[o.jsx(ke,{className:"text-sm font-semibold",children:"Update Credentials"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave blank to keep existing credentials. Fill in to replace them."}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{htmlFor:"cred-api-key",children:"API Key / Token"}),o.jsx(ve,{id:"cred-api-key",type:"password",placeholder:"Enter new API key…",value:_.apiKey??"",onChange:U=>k(E=>({...E,apiKey:U.target.value}))})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{htmlFor:"cred-username",children:"Username / SID"}),o.jsx(ve,{id:"cred-username",placeholder:"Optional",value:_.sid??"",onChange:U=>k(E=>({...E,sid:U.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{htmlFor:"cred-password",children:"Password / Secret"}),o.jsx(ve,{id:"cred-password",type:"password",placeholder:"Optional",value:_.token??"",onChange:U=>k(E=>({...E,token:U.target.value}))})]})]})]})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),o.jsx(ne,{onClick:O,children:"Save Changes"})]})]})})]})};function cn({label:e,active:t,dir:n,onClick:r}){return o.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-between gap-1 hover:text-foreground",children:[o.jsx("span",{children:e}),t?n==="asc"?o.jsx($B,{className:"h-3 w-3 shrink-0"}):o.jsx(MB,{className:"h-3 w-3 shrink-0"}):o.jsx(IB,{className:"h-3 w-3 shrink-0 opacity-50"})]})}function pn({value:e,onChange:t,placeholder:n}){return o.jsxs("div",{className:"relative",children:[o.jsx(du,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),o.jsx(ve,{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"h-8 pl-7 text-xs"})]})}function Tn({value:e,onChange:t,options:n,placeholder:r}){return o.jsxs(nt,{value:e||"__all__",onValueChange:a=>t(a==="__all__"?"":a),children:[o.jsx(Ze,{className:"h-8 text-xs",children:o.jsx(rt,{placeholder:r})}),o.jsxs(et,{children:[o.jsx(we,{value:"__all__",children:"All"}),n.map(a=>o.jsx(we,{value:a.value,children:a.label},a.value))]})]})}function Tf({value:e,onChange:t}){return o.jsxs(yh,{children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{type:"button",className:"flex h-8 w-full items-center gap-1.5 rounded-md border border-input bg-background px-2 text-left text-xs text-muted-foreground hover:bg-muted",children:[o.jsx(W2,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"flex-1 truncate",children:e?la(e,"MMM d, yyyy"):"Date"}),e&&o.jsx("span",{role:"button",tabIndex:0,onClick:n=>{n.stopPropagation(),t(void 0)},className:"rounded p-0.5 hover:bg-muted-foreground/20",children:o.jsx(rn,{className:"h-3 w-3"})})]})}),o.jsx(Fu,{className:"w-auto p-0",align:"start",children:o.jsx(xP,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}const wP=[10,25,50,100];function Sxe(e,t){const n=[],a=Math.max(2,e-1),s=Math.min(t-1,e+1);n.push(1),a>2&&n.push("ellipsis");for(let i=a;i<=s;i++)n.push(i);return s<t-1&&n.push("ellipsis"),t>1&&n.push(t),n}function Nxe({page:e,totalPages:t,onChange:n}){const r=Sxe(e,t),a=i=>`flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition ${i?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,s="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40";return o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1",children:[o.jsx("button",{type:"button",className:s,disabled:e<=1,onClick:()=>n(1),"aria-label":"First page",title:"First page",children:o.jsx(RB,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",className:s,disabled:e<=1,onClick:()=>n(e-1),"aria-label":"Previous page",title:"Previous page",children:o.jsx(fh,{className:"h-4 w-4"})}),r.map((i,l)=>i==="ellipsis"?o.jsx("span",{className:"px-1.5 text-sm text-muted-foreground",children:"…"},`e${l}`):o.jsx("button",{type:"button",className:a(i===e),onClick:()=>n(i),children:i},i)),o.jsx("button",{type:"button",className:s,disabled:e>=t,onClick:()=>n(e+1),"aria-label":"Next page",title:"Next page",children:o.jsx(zo,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",className:s,disabled:e>=t,onClick:()=>n(t),"aria-label":"Last page",title:"Last page",children:o.jsx(LB,{className:"h-4 w-4"})})]})}function dr({page:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:a,onRefresh:s,pageSizeOptions:i=wP}){const l=Math.max(1,Math.ceil(n/t));return n===0?null:o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-border bg-muted/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx("span",{children:"Items per page"}),o.jsxs(nt,{value:String(t),onValueChange:c=>a(Number(c)),children:[o.jsx(Ze,{className:"h-8 w-[72px] text-xs",children:o.jsx(rt,{})}),o.jsx(et,{children:i.map(c=>o.jsx(we,{value:String(c),children:c},c))})]})]}),o.jsx(Nxe,{page:e,totalPages:l,onChange:r}),o.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[o.jsxs("span",{children:[(e-1)*t+1," - ",Math.min(e*t,n)," of ",n," items"]}),s&&o.jsx("button",{type:"button",onClick:s,className:"rounded-md p-2.5 sm:p-1.5 hover:bg-muted hover:text-foreground","aria-label":"Refresh",title:"Refresh",children:o.jsx($u,{className:"h-4 w-4"})})]})]})}function _xe({open:e,onOpenChange:t,onCreate:n}){var v;const[r,a]=p.useState(1),[s,i]=p.useState({phone:"",email:"",name:"",list_id:""}),[l,c]=p.useState([]);p.useEffect(()=>{e&&ee.getLists().then(({data:g})=>c(g??[]))},[e]);const u=p.useMemo(()=>Math.round(r/2*100),[r]),d=()=>{a(1),i({phone:"",email:"",name:"",list_id:""})},f=g=>{g||d(),t(g)},h=()=>
864{if(!s.name.trim())return X.error("Name is required");if(!s.phone.trim())return X.error("Phone number is required");a(2)},m=()=>{n==null||n({basic:s}),X.success("Contact created"),f(!1)};return o.jsx(ft,{open:e,onOpenChange:f,children:o.jsxs(ct,{className:"max-w-2xl gap-0 p-0 sm:rounded-xl [&>button]:hidden",children:[o.jsxs("div",{className:"flex items-start justify-between border-b border-border p-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(eb,{className:"h-5 w-5"}),o.jsx("h2",{className:"text-lg font-semibold",children:"Add New Contact"})]}),o.jsx("button",{onClick:()=>f(!1),className:"rounded-md p-1 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"px-6 pt-4",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Step ",r," of 2"]}),o.jsxs("span",{children:[u,"% Complete"]})]}),o.jsx("div",{className:"relative h-2 overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${u}%`}})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 px-6 pt-4",children:[o.jsx(TD,{active:r===1,icon:o.jsx(eb,{className:"h-4 w-4"}),label:"Basic Info"}),o.jsx(TD,{active:r===2,icon:o.jsx(Ls,{className:"h-4 w-4"}),label:"Review"})]}),o.jsxs("div",{className:"max-h-[60vh] overflow-y-auto p-6",children:[r===1&&o.jsxs("div",{children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Basic Information"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the lead's basic contact information"})]}),o.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(my,{label:"Phone *",children:o.jsx(ve,{value:s.phone,onChange:g=>i(y=>({...y,phone:g.target.value})),placeholder:"Please provide customer phone"})}),o.jsx(my,{label:"Email",children:o.jsx(ve,{type:"email",value:s.email,onChange:g=>i(y=>({...y,email:g.target.value})),placeholder:"Please provide customer email"})}),o.jsx(my,{label:"Name",children:o.jsx(ve,{value:s.name,onChange:g=>i(y=>({...y,name:g.target.value})),placeholder:"Please provide customer name"})}),o.jsx(my,{label:"List",children:o.jsxs(nt,{value:s.list_id||"__none__",onValueChange:g=>i(y=>({...y,list_id:g==="__none__"?"":g})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"__none__",children:"No list (unassigned)"}),l.map(g=>o.jsx(we,{value:g.id,children:g.name},g.id))]})]})})]})]}),r===2&&o.jsxs("div",{children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Review & Submit"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Review the lead information before saving"})]}),o.jsx("div",{className:"mt-6 space-y-4 rounded-lg bg-muted/50 p-5",children:o.jsxs("div",{className:"grid grid-cols-1 gap-2 text-sm md:grid-cols-2",children:[o.jsx(py,{label:"Name",value:s.name}),o.jsx(py,{label:"Phone",value:s.phone}),o.jsx(py,{label:"Email",value:s.email}),o.jsx(py,{label:"List",value:((v=l.find(g=>g.id===s.list_id))==null?void 0:v.name)??"Unassigned"})]})})]})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border p-4 sm:flex-row sm:items-center sm:justify-between",children:[r===1?o.jsx("span",{}):o.jsxs(ne,{variant:"outline",onClick:()=>a(1),children:[o.jsx(fh,{className:"mr-1 h-4 w-4"})," Previous"]}),r<2?o.jsxs(ne,{onClick:h,className:"bg-primary text-primary-foreground hover:opacity-90",children:["Next ",o.jsx(zo,{className:"ml-1 h-4 w-4"})]}):o.jsxs(ne,{onClick:m,className:"bg-primary text-primary-foreground hover:opacity-90",children:[o.jsx(nn,{className:"mr-1 h-4 w-4"})," Create"]})]})]})})}function TD({active:e,icon:t,label:n}){return o.jsxs("div",{className:`flex items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium ${e?"border-foreground bg-background":"border-transparent bg-muted text-muted-foreground"}`,children:[t,o.jsx("span",{children:n})]})}function my({label:e,children:t}){return o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-sm font-semibold",children:e}),t]})}function py({label:e,value:t}){return o.jsxs("div",{children:[o.jsxs("span",{className:"font-semibold",children:[e,":"]}
864)," ",o.jsx("span",{className:"text-muted-foreground",children:t||" "})]})}function u1({onTest:e,onSettings:t,onView:n,onDelete:r,extra:a}){return o.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[a,n&&o.jsx("button",{onClick:n,title:"View","aria-label":"View",className:"flex h-9 w-9 items-center justify-center rounded-md p-0 text-muted-foreground hover:bg-muted hover:text-foreground sm:h-auto sm:w-auto sm:p-1.5",children:o.jsx(Ls,{className:"h-4 w-4"})}),e&&o.jsx("button",{onClick:e,title:"Test","aria-label":"Test",className:"flex h-9 w-9 items-center justify-center rounded-md p-0 text-muted-foreground hover:bg-muted hover:text-primary sm:h-auto sm:w-auto sm:p-1.5",children:o.jsx(As,{className:"h-4 w-4"})}),t&&o.jsx("button",{onClick:t,title:"Settings","aria-label":"Settings",className:"flex h-9 w-9 items-center justify-center rounded-md p-0 text-muted-foreground hover:bg-muted hover:text-foreground sm:h-auto sm:w-auto sm:p-1.5",children:o.jsx(Ps,{className:"h-4 w-4"})}),r&&o.jsx("button",{onClick:r,title:"Delete","aria-label":"Delete",className:"flex h-9 w-9 items-center justify-center rounded-md p-0 text-muted-foreground hover:bg-muted hover:text-destructive sm:h-auto sm:w-auto sm:p-1.5",children:o.jsx(Oa,{className:"h-4 w-4"})})]})}const QS=[{key:"name",label:"Name"},{key:"phone",label:"Phone"},{key:"email",label:"Email"},{key:"list",label:"List"},{key:"status",label:"Status"},{key:"createdAt",label:"Created"}],Cxe=["Active","Inactive","Pending"],kxe=[10,25,50,100],Exe=()=>{const[e,t]=p.useState(!1),[n,r]=p.useState(null),[a,s]=p.useState("asc"),[i,l]=p.useState({name:"",phone:"",email:"",list:"",status:"",createdAt:""}),[c,u]=p.useState(1),[d,f]=p.useState(10),[h,m]=p.useState([]),[v,g]=p.useState([]),y=p.useRef(null),[x,b]=p.useState(!1),[w,N]=p.useState(""),[S,_]=p.useState(""),[k,P]=p.useState(null),[O,$]=p.useState(null),[T,z]=p.useState({}),U=p.useCallback(async()=>{const[C,A]=await Promise.all([ee.getContacts(),ee.getLists()]);if(C.error){X.error("Failed to load contacts");return}const D=Array.isArray(A.data)?A.data:[];g(D);const V=new Map(D.map(Y=>[Y.id,Y.name]));C.data&&m(C.data.map(Y=>({id:Y.id,name:Y.name,phone:Y.phone??"",email:Y.email??"",status:Y.status??"Active",list_id:Y.list_id??null,list:Y.list_id?V.get(Y.list_id)??" ":" ",createdAt:Y.created_at?new Date(Y.created_at).toISOString().slice(0,10):""})))},[]);p.useEffect(()=>{U()},[U]);const E=C=>{if(n!==C){r(C),s("asc");return}if(a==="asc"){s("desc");return}r(null)},q=(C,A)=>l(D=>({...D,[C]:A})),W=p.useMemo(()=>h.filter(C=>QS.every(({key:A})=>{if(A==="status")return i.status?C.status===i.status:!0;const D=i[A].trim().toLowerCase();return!D||String(C[A]??"").toLowerCase().includes(D)})),[h,i]),L=p.useMemo(()=>n?[...W].sort((C,A)=>{const D=String(C[n]??"").toLowerCase(),V=String(A[n]??"").toLowerCase();return D<V?a==="asc"?-1:1:D>V?a==="asc"?1:-1:0}):W,[W,n,a]);p.useEffect(()=>{u(1)},[i,d]);const M=Math.max(1,Math.ceil(L.length/d));p.useEffect(()=>{c>M&&u(M)},[c,M]);const B=p.useMemo(()=>L.slice((c-1)*d,c*d),[L,c,d]),I=async C=>{const{error:A}=await ee.deleteContact(C.id);if(A){X.error("Failed to delete contact");return}X.success("Contact deleted"),U()},R=C=>{$(C),z({name:C.name,phone:C.phone,email:C.email,status:C.status,list_id:C.list_id})},F=async()=>{if(!O)return;const C={name:T.name??O.name,phone:T.phone??O.phone,email:T.email??O.email,status:T.status??O.status,list_id:T.list_id??null},{error:A}=await ee.updateContact(O.id,C);if(A){X.error("Failed to update contact");return}X.success("Contact updated"),$(null),U()},j=async C=>{if(!C.name.toLowerCase().endsWith(".csv")){X.error("Please upload a .csv file. In Excel: Save As → CSV (Comma delimited).");return}let A;if(w==="__new__"){if(!S.trim())return X.error("Enter a name for the new list");const{data:Z,error:J}=await ee.createList({name:S.trim()});if(J||!Z)return X.error(J||"Failed to create list");A=Z.id}else w&&(A=w);const V=(await C.text()).split(/\r?\n/).filter(Boolean);if(V.length===0)return X.error("Empty file");const Y=V[0].split(",").map(Z=>Z.trim().toLowerCase());let G=0,K=0;for(const Z of V.slice(1)){const J=Z.split(",").map(te=>te.trim()),ce={};Y.forEach((te,re)=>ce[te]=J[re]??"");const ue=ce.name||ce.full_name||ce.first_name||"Imported",be=(ce.phone??"").trim();if(!be){K++;continue}const{error:Ne}=await ee.createContact({name:ue,phone:be,email:ce.email??"",status:"Active",...A?{list_id:A}:{}});Ne||G++}K>0?X.success(`Imported ${G} contact${G===1?"":"s"}, skipped ${K} row${K===1?"":"s"}
864 with no phone number`):X.success(`Imported ${G} contact${G===1?"":"s"}`),N(""),_(""),U()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Contacts"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"All people across your lists."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap",children:[o.jsx("input",{ref:y,type:"file",accept:".csv,text/csv",className:"hidden",onChange:C=>{var D;const A=(D=C.target.files)==null?void 0:D[0];A&&j(A),y.current&&(y.current.value="")}}),o.jsxs(ne,{variant:"outline",onClick:()=>b(!0),children:[o.jsx(H_,{className:"mr-2 h-4 w-4"}),"Import CSV"]}),o.jsxs(ne,{onClick:()=>t(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"}),"Add Contact"]})]})]}),o.jsx(ft,{open:x,onOpenChange:b,children:o.jsxs(ct,{className:"sm:max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Import contacts from CSV"}),o.jsx(wt,{children:"Before you choose a file, make sure it matches this format."})]}),o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{children:[o.jsx("p",{className:"mb-1 font-medium text-foreground",children:"1. First row must be the column headers:"}),o.jsx("pre",{className:"whitespace-pre rounded-md border border-border bg-muted/50 p-3 text-xs overflow-x-auto",children:`name,phone,email
865John Doe,+13105551001,[email protected]
866Jane Smith,+13105551002,[email protected]`})]}),o.jsxs("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:[o.jsxs("li",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"name"})," and ",o.jsx("span",{className:"font-medium text-foreground",children:"phone"})," are required; ",o.jsx("span",{className:"font-medium text-foreground",children:"email"})," is optional."]}),o.jsx("li",{children:"Column order doesn't matter, and headers are case-insensitive."}),o.jsxs("li",{children:["Don't put commas inside a value (e.g. write ",o.jsx("span",{className:"font-medium text-foreground",children:"John Doe"}),", not ",o.jsx("span",{className:"font-medium text-foreground",children:"Doe, John"}),") since commas separate columns."]}),o.jsxs("li",{children:["New contacts are added with status ",o.jsx("span",{className:"font-medium text-foreground",children:"Active"}),"."]})]}),o.jsxs("div",{className:"space-y-2 border-t border-border pt-3",children:[o.jsx(ke,{children:"Add to List (optional)"}),o.jsxs(nt,{value:w||"__none__",onValueChange:C=>N(C==="__none__"?"":C),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"__none__",children:"No list"}),v.map(C=>o.jsx(we,{value:C.id,children:C.name},C.id)),o.jsx(we,{value:"__new__",children:"+ Create new list…"})]})]}),w==="__new__"&&o.jsx(ve,{value:S,onChange:C=>_(C.target.value),placeholder:"New list name",autoFocus:!0})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),o.jsxs(ne,{onClick:()=>{var C;b(!1),(C=y.current)==null||C.click()},children:[o.jsx(H_,{className:"mr-2 h-4 w-4"}),"Choose CSV File"]})]})]})}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[QS.map(({key:C,label:A})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:A,active:n===C,dir:a,onClick:()=>E(C)})},C)),o.jsx("th",{className:"px-4 py-3 w-32",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[QS.map(({key:C,label:A})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:C==="status"?o.jsx(Tn,{value:i.status,onChange:D=>q("status",D),placeholder:"Status",options:Cxe.map(D=>({value:D,label:D}))}):C==="list"?o.jsx(Tn,{value:i.list,onChange:D=>q("list",D),placeholder:"List",options:v.map(D=>({value:D.name,label:D.name}))}):o.jsx(pn,{value:i[C],onChange:D=>q(C,D),placeholder:A})},C)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:B.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-muted-foreground",children:h.length===0?"N
866o contacts yet.":"No contacts match your filters."})}):B.map(C=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:C.name}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:C.phone}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:C.email}),o.jsx("td",{className:"px-4 py-3 text-center",children:C.list}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:C.status==="Active"?"default":C.status==="Pending"?"secondary":"outline",children:C.status})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground whitespace-nowrap",children:C.createdAt}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(u1,{onView:()=>P(C),onSettings:()=>R(C),onDelete:()=>I(C)})})]},C.id))})]})}),o.jsx(dr,{page:c,pageSize:d,totalCount:L.length,onPageChange:u,onPageSizeChange:f,pageSizeOptions:kxe})]}),o.jsx(_xe,{open:e,onOpenChange:t,onCreate:async C=>{const A=C.basic.name||"Unnamed",{error:D}=await ee.createContact({name:A,phone:C.basic.phone||"",email:C.basic.email||"",status:"Active",...C.basic.list_id?{list_id:C.basic.list_id}:{}});if(D){X.error("Failed to create contact");return}U()}}),o.jsx(ft,{open:!!k,onOpenChange:C=>!C&&P(null),children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:k==null?void 0:k.name}),o.jsx(wt,{children:"Contact details"})]}),k&&o.jsxs("dl",{className:"grid grid-cols-1 gap-1.5 text-sm sm:grid-cols-3 sm:gap-3",children:[o.jsx("dt",{className:"text-muted-foreground",children:"Phone"}),o.jsx("dd",{className:"col-span-2 font-medium",children:k.phone||" "}),o.jsx("dt",{className:"text-muted-foreground",children:"Email"}),o.jsx("dd",{className:"col-span-2 font-medium",children:k.email||" "}),o.jsx("dt",{className:"text-muted-foreground",children:"List"}),o.jsx("dd",{className:"col-span-2 font-medium",children:k.list}),o.jsx("dt",{className:"text-muted-foreground",children:"Status"}),o.jsx("dd",{className:"col-span-2",children:o.jsx(_n,{children:k.status})}),o.jsx("dt",{className:"text-muted-foreground",children:"Created"}),o.jsx("dd",{className:"col-span-2 font-medium",children:k.createdAt})]}),o.jsx(Wt,{children:o.jsx(ne,{variant:"outline",onClick:()=>P(null),children:"Close"})})]})}),o.jsx(ft,{open:!!O,onOpenChange:C=>!C&&$(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Edit Contact"}),o.jsx(wt,{children:"Update contact information."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Name"}),o.jsx(ve,{value:T.name??"",onChange:C=>z(A=>({...A,name:C.target.value}))})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Phone"}),o.jsx(ve,{value:T.phone??"",onChange:C=>z(A=>({...A,phone:C.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Email"}),o.jsx(ve,{value:T.email??"",onChange:C=>z(A=>({...A,email:C.target.value}))})]})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"List"}),o.jsxs("select",{value:T.list_id??"",onChange:C=>z(A=>({...A,list_id:C.target.value||null})),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm",children:[o.jsx("option",{value:"",children:"No list"}),v.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Status"}),o.jsxs(nt,{value:T.status??"Active",onValueChange:C=>z(A=>({...A,status:C})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Inactive",children:"Inactive"}),o.jsx(we,{value:"Pending",children:"Pending"})]})]})]})]})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>$(null),children:"Cancel"}),o.jsx(ne,{onClick:F,children:"Save"})]})]})})]})};function Axe({open:e,onOpenChange:t,onCreate:n}){const[r,a]=p.useState(""),[s,i]=p.useState(""),l=()=>{a(""),i("")},c=d=>{d||l(),t(d)},u=()=>{if(!r.trim())return X.error("Customer list name is required");n==null||n({name:r,description:s}),X.success(`List "${r}" created`),c(!1)};return o.jsx(ft,{open:e,onOpenChange:c,children:o.jsxs(ct,{className:"max-w-3xl gap-0 p-0 sm:rounded-xl [&>button]:hidden",children:[o.jsxs("div",{className:"flex items-start justify-between border-b border-border p-5",children:[o.jsx("h2",{className:"text-lg font-semibold",children:"Create Customer List"}),o.jsx("button",{onClick:()=>c(!1),className:"rounded-md p-1 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"space-y-5 p-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-sm font-semibold",children:"Customer List Name"}),o.jsx(ve,{value:r,onChange:d=>
866a(d.target.value),placeholder:"Please provide your customer list name"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-sm font-semibold",children:"Customer List Description"}),o.jsx("textarea",{value:s,onChange:d=>i(d.target.value),placeholder:"Customer List Description",rows:5,className:"w-full rounded-md border border-input bg-background p-3 text-sm"})]})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border p-4 sm:flex-row sm:items-center sm:justify-end",children:[o.jsxs(ne,{variant:"outline",onClick:()=>c(!1),children:[o.jsx(rn,{className:"mr-1 h-4 w-4"})," Cancel"]}),o.jsxs(ne,{onClick:u,className:"bg-primary text-primary-foreground hover:opacity-90",children:[o.jsx(nn,{className:"mr-1 h-4 w-4"})," Create"]})]})]})})}const Pxe=()=>{const[e,t]=p.useState(!1),[n,r]=p.useState([]),[a,s]=p.useState(null),[i,l]=p.useState([]),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState({}),v=p.useCallback(async()=>{const{data:w,error:N}=await ee.getLists();if(N){X.error("Failed to load lists");return}w&&r(w.map(S=>({id:S.id,name:S.name,count:S.contact_count??0,createdAt:S.created_at?new Date(S.created_at).toISOString().slice(0,10):""})))},[]);p.useEffect(()=>{v()},[v]);const g=async w=>{const{error:N}=await ee.deleteList(w.id);if(N){X.error("Failed to delete list");return}X.success("List deleted"),v()},y=async w=>{s(w),l([]),u(!0);const{data:N,error:S}=await ee.getContacts();if(u(!1),S||!Array.isArray(N)){X.error("Failed to load contacts");return}l(N.filter(_=>_.list_id===w.id).map(_=>({id:_.id,name:_.name||"—",phone:_.phone||"—"})))},x=w=>{f(w),m({name:w.name})},b=async()=>{if(!d)return;const w={name:h.name??d.name},{error:N}=await ee.updateList(d.id,w);if(N){X.error("Failed to rename list");return}X.success("List renamed"),f(null),v()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Lists"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Group contacts for campaigns and flows."})]}),o.jsxs(ne,{onClick:()=>t(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"}),"New List"]})]}),o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:n.map(w=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 card-interactive",children:[o.jsx("div",{className:"flex items-start justify-between",children:o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(G2,{className:"h-5 w-5"})})}),o.jsx("h3",{className:"mt-4 font-semibold text-foreground",children:w.name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created ",w.createdAt]}),o.jsx("div",{className:"mt-3 text-2xl font-bold text-foreground",children:w.count.toLocaleString()}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"contacts"}),o.jsx("div",{className:"mt-3 border-t border-border pt-3",children:o.jsx(u1,{onView:()=>y(w),onSettings:()=>x(w),onDelete:()=>g(w)})})]},w.id))}),o.jsx(Axe,{open:e,onOpenChange:t,onCreate:async w=>{const{error:N}=await ee.createList({name:w.name});if(N){X.error("Failed to create list");return}v()}}),o.jsx(ft,{open:!!a,onOpenChange:w=>!w&&s(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsx(xt,{children:a==null?void 0:a.name}),o.jsx(wt,{children:"List details"})]}),a&&o.jsxs("dl",{className:"grid grid-cols-1 gap-1.5 text-sm sm:grid-cols-3 sm:gap-3",children:[o.jsx("dt",{className:"text-muted-foreground",children:"Contacts"}),o.jsx("dd",{className:"col-span-2 font-medium",children:a.count.toLocaleString()}),o.jsx("dt",{className:"text-muted-foreground",children:"Created"}),o.jsx("dd",{className:"col-span-2 font-medium",children:a.createdAt}),o.jsx("dt",{className:"text-muted-foreground",children:"ID"}),o.jsx("dd",{className:"col-span-2 font-mono text-xs",children:a.id})]}),o.jsxs("div",{className:"border-t border-border pt-3",children:[o.jsx("p",{className:"mb-2 text-xs font-semibold text-muted-foreground",children:"Contacts in this list"}),c?o.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading…"}):i.length===0?o.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"No contacts in this list yet."}):o.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pb-1 pr-1",children:i.map(w=>o.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border bg-muted/20 px-3 py-1.5 text-sm",children:[o.jsx("span",{className:"truncate font-medium text-foreground",children:w.name}),o.jsx("span",{className:"ml-2 shrink-0 font-mono text-xs text-muted-foreground",children:w.phone})]},w.id))})]}),o.jsx(Wt,{children:o.jsx(ne,{variant:"outline",onClick:()=>s(null),children:"Close"})})]})}),o.jsx(ft,{open:!!d,onOpenChange:w=>!w&&f(null),children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Rename List"}),o.jsx(wt,{children:"Change the list's display name."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Name"}),o.jsx(ve,{value:h.name??"",onChange:w=>m(N=>({...N,name:w.target.value}))})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),o.jsx(ne,{onClick:b,children:"Save"})]})]})})]})},ld=[{title:"Campaign Basics",subtitle:"Name, agent, phone number"}
866,{title:"Contact List",subtitle:"Pick the list to dial"},{title:"Review & Launch",subtitle:"Confirm and launch"}],OD=()=>({name:"",description:"",agentId:"",listId:"",phoneNumberId:"",dncScreeningEnabled:!0});function Txe({open:e,onOpenChange:t,onCreate:n}){const[r,a]=p.useState(0),[s,i]=p.useState(OD()),[l,c]=p.useState([]),[u,d]=p.useState([]),[f,h]=p.useState([]),[m,v]=p.useState(!1),[g,y]=p.useState(null),[x,b]=p.useState(!1);p.useEffect(()=>{e&&(b(!0),Promise.all([ee.getAgents(),ee.getLists(),ee.getPhoneNumbers(),ee.getDncStatus()]).then(([$,T,z,U])=>{var E,q;c(Array.isArray($.data)?$.data:[]),d(Array.isArray(T.data)?T.data:[]),h(Array.isArray(z.data)?z.data:[]),v(!!((E=U.data)!=null&&E.enabled)),y(((q=U.data)==null?void 0:q.integration_id)??null)}).finally(()=>b(!1)))},[e]);const w=($,T)=>i(z=>({...z,[$]:T})),N=()=>{a(0),i(OD())},S=$=>{$||N(),t($)},_=(r+1)/ld.length*100,k=()=>{if(r===0){if(!s.name.trim())return X.error("Campaign name is required");if(!s.agentId)return X.error("Select an agent");if(!s.phoneNumberId)return X.error("Select a phone number")}if(r===1&&!s.listId)return X.error("Select a contact list");a($=>Math.min($+1,ld.length-1))},P=()=>a($=>Math.max($-1,0)),O=()=>{n==null||n(s),S(!1)};return o.jsx(ft,{open:e,onOpenChange:S,children:o.jsxs(ct,{className:"max-w-4xl gap-0 overflow-hidden p-0 sm:rounded-xl [&>button]:hidden",children:[o.jsxs(ev,{children:[o.jsx(xt,{children:"Create Outbound Campaign"}),o.jsx(wt,{children:"Configure and launch an outbound dialing campaign in 3 steps."})]}),o.jsxs("div",{className:"flex items-center justify-between border-b border-border px-6 py-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow",children:o.jsx(Np,{className:"h-5 w-5"})}),o.jsxs("div",{className:"text-xl font-bold tracking-tight",children:["Create ",o.jsx("span",{className:"text-primary",children:"Outbound Campaign"}),o.jsxs("span",{className:"ml-1 text-sm font-normal text-muted-foreground",children:["Step ",r+1," of ",ld.length]})]})]}),o.jsx("button",{onClick:()=>S(!1),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"border-b border-border bg-primary/5 px-6 py-4",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("h3",{className:"text-base font-semibold",children:ld[r].title}),o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:[Math.round(_),"% Complete"]})]}),o.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${_}%`}})}),o.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:ld[r].subtitle})]}),o.jsxs("div",{className:"max-h-[60vh] overflow-y-auto px-6 py-6",children:[x&&o.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Loading your agents, lists, and numbers…"]}),!x&&r===0&&o.jsx(Oxe,{data:s,update:w,agents:l,phoneNumbers:f,dncEnabled:m,dncIntegrationId:g}),!x&&r===1&&o.jsx(Mxe,{data:s,update:w,lists:u}),!x&&r===2&&o.jsx(Ixe,{data:s,agents:l,lists:u,phoneNumbers:f,dncEnabled:m})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border bg-card px-6 py-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs(ne,{variant:"outline",onClick:P,disabled:r===0,className:"w-full sm:w-auto",children:[o.jsx(fh,{className:"mr-1 h-4 w-4"})," Previous"]}),r<ld.length-1?o.jsxs(ne,{onClick:k,className:"w-full bg-primary text-primary-foreground hover:opacity-90 sm:w-auto",children:["Next ",o.jsx(zo,{className:"ml-1 h-4 w-4"})]}):o.jsxs(ne,{onClick:O,className:"w-full bg-primary text-primary-foreground hover:opacity-90 sm:w-auto",children:[o.jsx(Np,{className:"mr-1.5 h-4 w-4"})," Launch Campaign"]})]})]})})}function Oxe({data:e,update:t,agents:n,phoneNumbers:r,dncEnabled:a,dncIntegrationId:s}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Id,{icon:Oi,title:"Campaign Information",children:[o.jsx(Om,{label:"Campaign Name",required:!0,children:o.jsx(ve,{value:e.name,onChange:i=>t("name",i.target.value),placeholder:"e.g. Q3 Cold Outreach"})}),o.jsx(Om,{label:"Description",hint:"Optional internal note about this campaign",children:o.jsx(Zl,{value:e.description,onChange:i=>t("description",i.target.value),placeholder:"What's this campaign for?",rows:3})})]}),o.jsx(Id,{icon:yre,title:"AI Agent",children:n.length===0?o.jsx(Mm,{label:"No AI agents yet",hint:"Create an agent in AI Agents → Create AI Agent before launching a campaign.",href:"/dashboard/ai-agents/create"}):o.jsx(Om,{label:"Agent",required:!0,children:o.jsxs(nt,{value:e.agentId,onValueChange:i=>t("agentId",i),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"Select an agent…"})}),o.jsx(et,{children:n.map(i=>o.jsx(we,{value:i.id,children:i.name},i.id))})]})})}),o.jsx(Id,{icon:Un,title:"Phone Number",children:r.length===0?o.jsx(Mm,{label:"No phone numbers provisioned",hint:"A phone number is required to launch a campaign. Add one in AI Telephony → Phone Numbers first.",href:"/dashboard/telephony/phone-numbers"}):o.jsx(Om,{label:"From Number",required:!0,children:o.jsx($xe,{phoneNumbers:r,value:e.phoneNumberId,onChange:i=>t("phoneNumberId",i)})})}),o.jsx(Id,{icon:ac,title:"DNC Screening",children:s?a?o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:e.dncScreeningEnabled?"Screening is on for this campaign":"Screening is off for this campaign"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e.dncScreeningEnabled?"Numbers found on your DNC/litigation list will be skipped automatically.":"Every number in this campaign's list will be dialed, including suppressed ones."})]}),o.jsx(jh,{checked:e.dncScreeningEnabled,onCheckedChange:i=>t("dncScreeningEnabled",i)})]}):o.jsx(Mm,{label:"WhitelistData is turned off account-wide",hint:"Turn it on in Integrations to make screening available to this (and every other) campaign.",href:"/dashboard/integrations"}):o.jsx(Mm,{label:"WhitelistData not connected",hint:"Add your WhitelistData credentials in Integrations to screen numbers against the DNC/litigation list before every call.",href:"/dashboard/integrations"})})]})}function Mxe({data:e,update:t,lists:n}){return o.jsx("div",{className:"space-y-6",children:o.jsx(Id,{icon:rw,title:"Contact List",children:n.length===0?o.jsx(Mm,{label:"No contact lists yet",hint:"Create one in Database → Lists and add contacts before launching.",href:"/dashboard/database/lists"}):o.jsx(Om,{label:"Contact List",required:!0,children:o.jsxs(nt,{value:e.listId,onValueChange:r=>t("listId",r),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"Select a list…"})}),o.jsx(et,{children:n.map(r=>
866o.jsxs(we,{value:r.id,children:[r.name,r.contact_count!=null?` (${r.contact_count} contacts)`:""]},r.id))})]})})})})}function Ixe({data:e,agents:t,lists:n,phoneNumbers:r,dncEnabled:a}){const s=p.useMemo(()=>{var c;return((c=t.find(u=>u.id===e.agentId))==null?void 0:c.name)??" "},[t,e.agentId]),i=p.useMemo(()=>{var c;return((c=n.find(u=>u.id===e.listId))==null?void 0:c.name)??" "},[n,e.listId]),l=p.useMemo(()=>{var c;return((c=r.find(u=>u.id===e.phoneNumberId))==null?void 0:c.number)??"Default number"},[r,e.phoneNumberId]);return o.jsx("div",{className:"space-y-6",children:o.jsxs(Id,{icon:Oi,title:"Campaign Summary",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsx(gy,{label:"Campaign Name",value:e.name||" "}),o.jsx(gy,{label:"AI Agent",value:s}),o.jsx(gy,{label:"Contact List",value:i}),o.jsx(gy,{label:"From Number",value:l})]}),a&&e.dncScreeningEnabled?o.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-lg border border-success/30 bg-success/10 px-3 py-2 text-sm text-success",children:[o.jsx(ac,{className:"h-4 w-4 shrink-0"}),"DNC screening is active for this campaign. Suppressed numbers will be skipped automatically."]}):a&&!e.dncScreeningEnabled?o.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-sm text-warning",children:[o.jsx(FM,{className:"h-4 w-4 shrink-0"}),"DNC screening is turned OFF for this campaign, even though it's on account-wide. Every number in the list will be dialed."]}):o.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:[o.jsx(FM,{className:"h-4 w-4 shrink-0"}),"DNC screening is off. Every number in the list will be dialed.",o.jsx("a",{href:"/dashboard/integrations",target:"_blank",rel:"noreferrer",className:"ml-auto shrink-0 font-semibold text-primary hover:underline",children:"Turn on →"})]})]})})}function Id({icon:e,title:t,children:n}){return o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-primary/10 text-primary",children:o.jsx(e,{className:"h-4 w-4"})}),o.jsx("h4",{className:"text-base font-bold",children:t})]}),n]})}function Om({label:e,required:t,hint:n,children:r}){return o.jsxs("div",{className:"mb-4 last:mb-0",children:[o.jsxs("label",{className:"mb-1.5 block text-sm font-semibold",children:[e," ",t&&o.jsx("span",{className:"text-destructive",children:"*"})]}),r,n&&o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n})]})}function gy({label:e,value:t}){return o.jsxs("div",{className:"rounded-lg border border-border bg-background p-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:e}),o.jsx("div",{className:"mt-0.5 text-sm font-semibold",children:t})]})}function Mm({label:e,hint:t,href:n}){return o.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-muted/20 p-4 text-sm",children:[o.jsx("div",{className:"font-semibold",children:e}),o.jsx("p",{className:"mt-1 text-muted-foreground",children:t}),o.jsx("a",{href:n,className:"mt-2 inline-block text-xs font-semibold text-primary hover:underline",children:"Open →"})]})}function $xe({phoneNumbers:e,value:t,onChange:n}){const[r,a]=p.useState(!1),s=e.find(i=>i.id===t);return o.jsxs(yh,{open:r,onOpenChange:a,children:[o.jsx(xh,{asChild:!0,children:o.jsxs("button",{type:"button",role:"combobox","aria-expanded":r,className:"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 text-sm",children:[o.jsx("span",{className:s?"":"text-muted-foreground",children:s?s.number:"Select a number…"}),o.jsx(FB,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Fu,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:o.jsxs(Qw,{children:[o.jsx(Zw,{placeholder:"Type a number to search…"}),o.jsxs(e1,{children:[o.jsx(t1,{children:"No matching number."}),o.jsx(n1,{children:e.map(i=>o.jsxs(r1,{value:i.number,onSelect:()=>{n(i.id),a(!1)},children:[o.jsx(Ta,{className:he("mr-2 h-4 w-4",t===i.id?"opacity-100":"opacity-0")}),i.number]},i.id))})]})]})})]})}function nm({icon:e,label:t,value:n,color:r}){return o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 flex items-center gap-4 lg:flex-col lg:items-start lg:gap-3 xl:flex-row xl:items-center xl:gap-4",children:[o.jsx("div",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg ${r}`,children:o.jsx(e,{className:"h-5 w-5"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:n}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t})]})]})}const MD={Active:"bg-green-500/15 text-green-600 border-green-500/20",Paused:"bg-yellow-500/15 text-yellow-600 border-yellow-500/20",Inactive:"bg-muted text-muted-foreground border-border",Completed:"bg-blue-500/15 text-blue-600 border-blue-500/20"},ID=()=>{const[e,t]=p.useState(!1),[n,r]=p.useState([]),[a,s]=p.useState(new Map),[i,l]=p.useState(new Map),[c,u]=
866p.useState(0),[d,f]=p.useState(!0),[h,m]=p.useState(null),[v,g]=p.useState({name:"",agent_id:"",status:""}),[y,x]=p.useState(null),[b,w]=p.useState([]),[N,S]=p.useState(!1),_=L=>L.map(M=>({...M,effectiveStatus:M.contacts_count>0&&M.completed_count>=M.contacts_count?"Completed":M.status})),k=async()=>{const[L,M,B,I]=await Promise.all([ee.getCampaigns(),ee.getAgents(),ee.getPhoneNumbers(),ee.getAnalyticsOverview()]);Array.isArray(L.data)&&r(_(L.data)),Array.isArray(M.data)&&s(new Map(M.data.map(R=>[R.id,R.name]))),Array.isArray(B.data)&&l(new Map(B.data.map(R=>[R.id,R.number]))),I.data&&u(I.data.qualified_calls??0),f(!1)};p.useEffect(()=>{k();const L=setInterval(()=>k(),3e4);return()=>clearInterval(L)},[]);const P=n.reduce((L,M)=>L+(M.contacts_count||0),0),O=n.reduce((L,M)=>L+(M.completed_count||0),0),$=n.filter(L=>L.effectiveStatus==="Active").length,T=async L=>{if(L.status==="Active"){const{error:M}=await ee.pauseCampaign(L.id);if(M)return X.error(M);X.success("Campaign paused"),k()}else z(L)},z=async L=>{x(L);const M=[{label:"Agent assigned & synced",status:"loading"},{label:"Phone number assigned & active",status:"loading"},{label:"Contact list has dialable contacts",status:"loading"}];w(M);const B=[...M];if(!L.agent_id)B[0]={...M[0],status:"fail",detail:"No agent assigned to this campaign"};else{const{data:I}=await ee.getAgents(),R=I==null?void 0:I.find(F=>F.id===L.agent_id);R?R.vapi_assistant_id?B[0]={...M[0],status:"pass",detail:`${R.name} ✓`}:B[0]={...M[0],status:"fail",detail:`"${R.name}" is not synced open the agent and click Sync agent`}:B[0]={...M[0],status:"fail",detail:"Agent not found"}}if(w([...B]),!L.phone_number_id)B[1]={...M[1],status:"fail",detail:"No phone number assigned edit the campaign and select one"};else{const{data:I}=await ee.getPhoneNumbers(),R=I==null?void 0:I.find(F=>F.id===L.phone_number_id);R?R.vapi_phone_id?B[1]={...M[1],status:"pass",detail:`${R.number} ✓`}:B[1]={...M[1],status:"fail",detail:`${R.number||"Number"} is not active yet`}:B[1]={...M[1],status:"fail",detail:"Phone number not found"}}if(w([...B]),!L.list_id)B[2]={...M[2],status:"fail",detail:"No contact list assigned edit the campaign and select a list"};else{const{data:I}=await ee.getContacts(),R=I==null?void 0:I.filter(F=>{var j;return F.list_id===L.list_id&&((j=F.phone)==null?void 0:j.trim())});!R||R.length===0?B[2]={...M[2],status:"fail",detail:"No contacts with phone numbers in the assigned list"}:B[2]={...M[2],status:"pass",detail:`${R.length} contact${R.length!==1?"s":""} ready to dial`}}w([...B])},U=async()=>{var A;if(!y)return;S(!0);const L=y.status==="Paused"?ee.resumeCampaign:ee.startCampaign,{data:M,error:B}=await L(y.id);if(S(!1),x(null),B)return X.error(B);const I=(M==null?void 0:M.dialed)??0,R=(M==null?void 0:M.errors)??0,F=(M==null?void 0:M.suppressed)??0,j=(M==null?void 0:M.error_details)??[],C=F>0?`, ${F} skipped (DNC)`:"";I===0&&R>0?X.error(`0 calls connected ${((A=j[0])==null?void 0:A.error)??"Unknown error"}${C}`):R>0?X.warning(`${I} called, ${R} failed${C}`):F>0?X.warning(`Dialing ${I} contact${I!==1?"s":""}${C}`):X.success(`Dialing ${I} contact${I!==1?"s":""}…`),k()},E=L=>{m(L),g({name:L.name,agent_id:L.agent_id,status:L.status})},q=async()=>{if(!h)return;const{error:L}=await ee.updateCampaign(h.id,v);if(L)return X.error(L);X.success("Campaign updated"),m(null),k()},W=async L=>{const{error:M}=await ee.deleteCampaign(L.id);if(M)return X.error(M);X.success("Campaign removed"),k()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Outbound Campaigns"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"AI powered outbound calling automated, intelligent, scalable."})]}),o.jsxs(ne,{onClick:()=>t(!0),className:"w-full sm:w-auto",children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," New Campaign"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5 [&>*:last-child]:col-span-2 sm:[&>*:last-child]:col-span-1",children:[o.jsx(nm,{icon:Ire,label:"Total Campaigns",value:n.length,color:"bg-primary/10 text-primary"}),o.jsx(nm,{icon:Vre,label:"Active Now",value:$,color:"bg-green-500/10 text-green-600"}
866),o.jsx(nm,{icon:Fs,label:"Total Contacts",value:P.toLocaleString(),color:"bg-blue-500/10 text-blue-600"}),o.jsx(nm,{icon:gre,label:"Calls Dialed",value:O.toLocaleString(),color:"bg-purple-500/10 text-purple-600"}),o.jsx(nm,{icon:tr,label:"Qualified",value:c.toLocaleString(),color:"bg-success/10 text-success"})]}),d?o.jsxs("div",{className:"flex items-center justify-center py-16 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading campaigns…"]}):n.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-card/50 p-16 text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Wo,{className:"h-7 w-7 text-primary"})}),o.jsx("h3",{className:"mt-4 text-lg font-semibold text-foreground",children:"No campaigns yet"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Create your first campaign to start AI powered outbound calling."}),o.jsxs(ne,{className:"mt-4",onClick:()=>t(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Create Campaign"]})]}):o.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:n.map(L=>{const M=L.contacts_count>0?Math.round(L.completed_count/L.contacts_count*100):0,B=L.effectiveStatus??L.status,I=L.status==="Active",R=B==="Completed",F=I&&!R,j=MD[B]??MD.Inactive;return o.jsxs("div",{className:`rounded-xl border bg-card p-5 transition-shadow hover:shadow-md ${F?"border-primary/30 shadow-sm shadow-primary/10":"border-border"}`,children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg ${F?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:o.jsx(Wo,{className:"h-5 w-5"})}),o.jsx("span",{className:`whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-semibold ${j}`,children:B})]}),o.jsx("h3",{className:"mt-4 break-words font-semibold text-foreground",children:L.name}),o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(zn,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"min-w-0",children:a.get(L.agent_id)??"Unassigned"})]}),i.get(L.phone_number_id??"")&&o.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Un,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{children:i.get(L.phone_number_id)})]}),o.jsxs("div",{className:"mt-4",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[o.jsxs("span",{className:"text-muted-foreground",children:[L.completed_count.toLocaleString()," / ",L.contacts_count.toLocaleString()," contacted"]}),o.jsxs("span",{className:"font-semibold text-foreground",children:[M,"%"]})]}),o.jsx("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:`h-full rounded-full transition-all ${R?"bg-blue-500":F?"bg-primary":"bg-muted-foreground/40"}`,style:{width:`${M}%`}})})]}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 border-t border-border pt-3",children:[o.jsx(ne,{size:"sm",variant:I?"outline":"default",onClick:()=>T(L),className:I?"":"bg-primary text-primary-foreground",children:I?o.jsxs(o.Fragment,{children:[o.jsx(Mg,{className:"mr-1.5 h-3.5 w-3.5"})," Pause"]}):o.jsxs(o.Fragment,{children:[o.jsx(Gl,{className:"mr-1.5 h-3.5 w-3.5"})," Start"]})}),o.jsx(u1,{onSettings:()=>E(L),onDelete:()=>W(L)})]})]},L.id)})}),o.jsx(Txe,{open:e,onOpenChange:t,onCreate:async L=>{const{error:M}=await ee.createCampaign({name:L.name,agent_id:L.agentId,list_id:L.listId,phone_number_id:L.phoneNumberId||null,dnc_screening_enabled:L.dncScreeningEnabled});if(M)return X.error(M);X.success(`Campaign "${L.name}" created`),k()}}),o.jsx(ft,{open:!!y,onOpenChange:L=>{L||x(null)},children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{className:"text-left",children:[o.jsxs(xt,{className:"flex items-center gap-2 text-base",children:[o.jsx(co,{className:"h-4 w-4 text-yellow-500"}),"Pre-launch Checks"]}),o.jsxs(wt,{children:["Verifying ",o.jsx("span",{className:"font-medium text-foreground",children:y==null?void 0:y.name})," is ready to dial."]})]}),o.jsx("div",{className:"space-y-2.5 py-1",children:b.map((L,M)=>o.jsxs("div",{className:`flex items-start gap-3 rounded-lg border px-3 py-2.5 transition-colors ${L.status==="pass"?"border-green-500/20 bg-green-500/5":L.status==="fail"?"border-destructive/20 bg-destructive/5":"border-border bg-muted/30"}`,children:[L.status==="loading"&&o.jsx(Te,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-muted-foreground"}),L.status==="pass"&&o.jsx(tr,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-500"}),L.status==="fail"&&o.jsx(Og,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),L.status==="warn"&&o.jsx(co,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:L.label}),L.detail&&o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:L.detail})]})]},M))}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>x(null),children:"Cancel"}),o.jsx(ne,{onClick:U,disabled:N||b.some(L=>L.status==="loading"||L.status==="fail"),children:N?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Launching…"]}):o.jsxs(o.Fragment,{children:[o.jsx(Gl,{className:"mr-2 h-4 w-4"}),"Launch Campaign"]})})]})]})}),o.jsx(ft,{open:!!h,onOpenChange:L=>!L&&m(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Campaign Settings"}),o.jsx(wt,{children:"Update campaign details."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Name"}),o.jsx(ve,{value:v.name,onChange:L=>g(M=>({...M,name:L.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Agent"}),o.jsxs("select",{value:v.agent_id,onChange:L=>g(M=>({...M,agent_id:L.target.value})),className:"h-9 w-full rounded-md border border-input bg-background px-2 text-sm",children:[o.jsx("option",{value:"",children:"Select agent…"}),Array.from(a.entries()).map(([L,M])=>o.jsx("option",{value:L,children:M},L))]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Status"}),o.jsxs(nt,{value:v.status,onValueChange:L=>g(M=>({...M,status:L})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Paused",children:"Paused"}),o.jsx(we,{value:"Inactive",children:"Inactive"})]})]})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),o.jsx(ne,{onClick:q,children:"Save Changes"})]})]})})]})};function vy({icon:e,label:t,value:n,color:r}){return o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 flex items-center gap-4",children:[o.jsx("div",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg ${r}`,children:o.jsx(e,{className:"h-5 w-5"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:n}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t})]})]})}function Dxe(e){const t=Math.floor(e/60),n=Math.round(e%60);return t>0?`${t}m ${n}s`:`${n}s`}const Rxe=()=>{const[e,t]=p.useState([]),[n,r]=p.useState([]),[a,s]=p.useState([]),[i,l]=p.useState([]),[c,u]=
866p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState({name:"",agent_id:"",phone_number_id:""}),[v,g]=p.useState(!1),y=a.filter(M=>!M.agent_id&&M.vapi_phone_id),[x,b]=p.useState(null),[w,N]=p.useState({name:"",agent_id:"",status:""}),S=new Map(n.map(M=>[M.id,M])),_=new Map(a.map(M=>[M.id,M])),k=p.useCallback(async()=>{const[M,B,I,R]=await Promise.all([ee.getInboundQueues(),ee.getAgents(),ee.getPhoneNumbers(),ee.getConversations("direction=inbound&limit=50")]);Array.isArray(M.data)&&t(M.data),Array.isArray(B.data)&&r(B.data),Array.isArray(I.data)&&s(I.data),Array.isArray(R.data)&&l(R.data),u(!1)},[]);p.useEffect(()=>{k()},[k]);const P=p.useRef(!1);p.useEffect(()=>{const M=new URLSearchParams(window.location.search),B=M.get("purchase");if(!B)return;const I=()=>window.history.replaceState({},"",window.location.pathname);if(B==="canceled"){X.info("Purchase canceled. No receptionist was created."),I();return}if(B==="success"){const R=M.get("session_id");if(!R||P.current){I();return}P.current=!0;const F=X.loading("Payment received. Setting up your receptionist…");ee.confirmPhonePurchase(R).then(({data:j,error:C})=>{X.dismiss(F),C||!j?X.error(C||"Could not finish setting up the receptionist after payment."):X.success(`Number ${j.number||""} purchased and receptionist created.`),I(),k()})}},[]);const O=i.length,$=i.filter(M=>M.status==="Completed").length,T=i.filter(M=>M.duration).length>0?Math.round(i.filter(M=>M.duration).reduce((M,B)=>M+(B.duration??0),0)/i.filter(M=>M.duration).length):0,z=e.filter(M=>M.status==="Active").length,U=async()=>{if(!h.name.trim())return X.error("Name is required");if(!h.agent_id)return X.error("Select an AI agent");g(!0);const{data:M,error:B}=await ee.createInboundQueue({name:h.name,agent_id:h.agent_id,phone_number_id:h.phone_number_id||void 0,status:"Active",success_url:`${window.location.origin}/dashboard/telephony/inbound`});if(g(!1),B)return X.error(B);if(M!=null&&M.checkout_url){window.location.href=M.checkout_url;return}X.success(h.phone_number_id?"AI Receptionist created. Existing number reassigned!":"AI Receptionist created. Phone number provisioned!"),f(!1),m({name:"",agent_id:"",phone_number_id:""}),k()},E=async M=>{const{error:B}=await ee.deleteInboundQueue(M.id);if(B)return X.error(B);X.success("Receptionist removed"),k()},q=M=>{b(M),N({name:M.name,agent_id:M.agent_id,status:M.status})},W=async()=>{if(!x)return;const{error:M}=await ee.updateInboundQueue(x.id,w);if(M)return X.error(M);X.success("Receptionist updated"),b(null),k()},L=M=>{navigator.clipboard.writeText(M),X.success("Number copied to clipboard")};return c?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading…"]}):o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"AI Receptionist"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"AI agents that answer every inbound call 24/7, no hold times, instant response."})]}),o.jsxs(ne,{onClick:()=>f(!0),className:"w-full sm:w-auto",children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," New Receptionist"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[o.jsx(vy,{icon:XB,label:"Active Receptionists",value:z,color:"bg-primary/10 text-primary"}),o.jsx(vy,{icon:ta,label:"Total Inbound Calls",value:O,color:"bg-blue-500/10 text-blue-600"}),o.jsx(vy,{icon:tr,label:"Completed Calls",value:$,color:"bg-green-500/10 text-green-600"}),o.jsx(vy,{icon:cre,label:"Avg Duration",value:T>0?Dxe(T):" ",color:"bg-purple-500/10 text-purple-600"})]}),e.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-card/50 p-16 text-center",children:[o.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:o.jsx(ta,{className:"h-7 w-7 text-primary"})}),o.jsx("h3",{className:"mt-4 text-lg font-semibold text-foreground",children:"No receptionists yet"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Create your first AI receptionist we'll provision a phone number automatically."}),o.jsxs(ne,{className:"mt-4",onClick:()=>f(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Create Receptionist"]})]}):o.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:e.map(M=>{const B=M.phone_number_id?_.get(M.phone_number_id):void 0,I=S.get(M.agent_id),R=M.status==="Active";return o.jsxs("div",{className:`rounded-xl border bg-card p-5 transition-shadow hover:shadow-md ${R?"border-primary/30 shadow-sm shadow-primary/10":"border-border"}`,children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg ${R?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:o.jsx(ta,{className:"h-5 w-5"})}),o.jsx("span",{className:`whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-semibold ${R?"border-green-500/20 bg-green-500/15 text-green-600":"border-border bg-muted text-muted-foreground"}`,children:M.status})]}),o.jsx("h3",{className:"mt-4 break-words font-semibold text-foreground",children:M.name}),o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(zn,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"min-w-0",children:(I==null?void 0:I.name)??"Unassigned Agent"})]}),B?o.jsxs("div",{className:"mt-4 rounded-lg border border-primary/25 bg-primary/5 p-3.5",children:[o.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-primary mb-2",children:"Inbound Number"}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Un,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsx("span",{className:"truncate text-lg font-bold tracking-wide text-foreground",children:B.number})]}),o.jsx("button",{onClick:()=>L(B.number),className:"shrink-0 rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-primary/10 hover:text-primary transition-colors",title:"Copy number",children:o.jsx(ow,{className:"h-3.5 w-3.5"})})]}),o.jsx("div",{className:"mt-1.5 text-[11px] text-muted-foreground",children:"Call this number your AI agent answers instantly"})]}):o.jsx("div",{className:"mt-4 rounded-lg border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"No phone number linked yet"}),o.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2 border-t border-border pt-3",children:[o.jsx("button",{onClick:()=>q(M),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Settings",children:o.jsx(Ps,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>E(M),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",title:"Delete",children:o.jsx(Oa,{className:"h-4 w-4"})})]})]},M.id)})}),o.jsx(ft,{open:d,onOpenChange:f,children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{className:"text-left",children:[o.jsxs(xt,{className:"flex items-center gap-2 pr-6",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(ta,{className:"h-4 w-4 text-primary"})}),"New AI Receptionist"]}),o.jsx(wt,{children:"Pick an AI agent and a phone number for it. Incoming calls to that number go straight to your agent."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Name"}),o.jsx(ve,{placeholder:"e.g. Front Desk, Sales Line",value:h.name,onChange:M=>m(B=>({...B,name:M.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"AI Agent"}),o.jsxs(nt,{value:h.agent_id,onValueChange:M=>m(B=>({...B,agent_id:M})),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"Select an agent…"})}),o.jsx(et,{children:n.filter(M=>M.vapi_assistant_id).map(M=>o.jsx(we,{value:M.id,children:M.name},M.id))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Phone Number"}),o.jsxs(nt,{value:h.phone_number_id||"__new__",onValueChange:M=>m(B=>({...B,phone_number_id:M==="__new__"?"":M})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"__new__",children:"Buy a new number ($3/month)"}),y.map(M=>o.jsxs(we,{value:M.id,children:[M.number," (existing, unused)"]},M.id))]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:h.phone_number_id?"This existing number will be reassigned to the agent above. No new purchase.":"A new number is deducted from your wallet, or paid by card if your balance is low."})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>f(!1),disabled:v,children:"Cancel"}),o.jsx(ne,{onClick:U,disabled:v,children:v?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Provisioning Number…"]}):"Create Receptionist"})]})]})}),o.jsx(ft,{open:!!x,onOpenChange:M=>!M&&b(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{className:"text-left",children:[o.jsxs(xt,{className:"flex items-center gap-2 pr-6",children:[o.jsx(Ps,{className:"h-5 w-5 shrink-0 text-primary"}),"Receptionist Settings"]}),o.jsx(wt,{children:"Update name, agent, and status."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Name"}),o.jsx(ve,{value:w.name,onChange:M=>N(B=>({...B,name:M.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"AI Agent"}),o.jsxs(nt,{value:w.agent_id,onValueChange:M=>N(B=>({...B,agent_id:M})),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"Select an agent…"})}),o.jsx(et,{children:n.filter(M=>M.vapi_assistant_id).map(M=>o.jsx(we,{value:M.id,children:M.name},M.id))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Status"}),o.jsxs(nt,{value:w.status,onValueChange:M=>N(B=>({...B,status:M})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Inactive",children:"Inactive"})]})]})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>b(null),children:"Cancel"}),o.jsx(ne,{onClick:W,children:"Save Changes"})]})]})})]})},Lxe=e=>e==="Completed"?"bg-success/15 text-success":e==="Failed"||e==="Unsuccessful"?"bg-destructive/15 text-destructive":e==="Ringing"?"bg-warning/15 text-warning":e==="In Progress"||e==="Initiated"?"bg-info/15 text-info":"bg-muted text-muted-foreground",$D=[{key:"contact_name",label:"Caller"},{key:"agent_name",label:"Agent"},{key:"status",label:"Status"},{key:"duration",label:"Duration"},{key:"call_time",label:"Time"}];function DD(e,t){return t==="contact_name"?e.contact_name||e.phone||"Unknown":t==="duration"?e.duration||(e.duration_seconds?`${e.duration_seconds}s`:""):e[t]||""}const Fxe=["Initiated","Ringing","In Progress","Completed","Failed","Unsuccessful"],Bxe=[10,25,50,100],zxe=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(0),[a,s]=p.useState({completed:0,failed:0,durationSeconds:0}
866),[i,l]=p.useState(!0),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(0),[v,g]=p.useState(null),y=p.useRef(null),x=p.useRef(null),[b,w]=p.useState(null),[N,S]=p.useState("asc"),[_,k]=p.useState({contact_name:"",agent_name:"",status:"",duration:"",call_time:""}),[P,O]=p.useState(1),[$,T]=p.useState(10),z=I=>{if(b!==I){w(I),S("asc");return}if(N==="asc"){S("desc");return}w(null)},U=(I,R)=>k(F=>({...F,[I]:R})),[E,q]=p.useState(_);p.useEffect(()=>{const I=setTimeout(()=>q(_),400);return()=>clearTimeout(I)},[_]);const W=p.useCallback(async(I=!1)=>{var C;I||l(!0);const R=new URLSearchParams;R.set("direction","inbound"),E.contact_name.trim()&&R.set("contact_name",E.contact_name.trim()),E.agent_name.trim()&&R.set("agent_name",E.agent_name.trim()),E.status&&R.set("status",E.status),E.duration.trim()&&R.set("duration",E.duration.trim()),R.set("limit",String($)),R.set("offset",String((P-1)*$));const[F,j]=await Promise.all([ee.getConversations(R.toString()),ee.getConversationStats("direction=inbound")]);if(Array.isArray(F.data)&&t(F.data),r(((C=F.meta)==null?void 0:C.count)??0),j.data){const A=j.data;s({completed:A.completed??0,failed:A.failed??0,durationSeconds:A.total_duration_seconds??0})}I||l(!1)},[E,P,$]);p.useEffect(()=>{W();const I=setInterval(()=>W(!0),3e4);return()=>clearInterval(I)},[W]),p.useEffect(()=>{O(1)},[E,$]);const L=Math.max(1,Math.ceil(n/$));p.useEffect(()=>{P>L&&O(L)},[P,L]);const M=p.useMemo(()=>b?[...e].sort((I,R)=>{const F=DD(I,b).toLowerCase(),j=DD(R,b).toLowerCase();return F<j?N==="asc"?-1:1:F>j?N==="asc"?1:-1:0}):e,[e,b,N]),B=async I=>{if(u(I),m(0),x.current=I.id,g(null),(I.recording_url||I.stereo_recording_url)&&ee.getConversationRecordingUrl(I.id).then(({data:R})=>{x.current===I.id&&g((R==null?void 0:R.url)??null)}),!I.transcript_messages||I.transcript_messages.length===0){f(!0);const{data:R}=await ee.getConversationTranscript(I.id);if(x.current!==I.id)return;R&&u(F=>F&&F.id===I.id?{...F,transcript:R.transcript??F.transcript,transcript_messages:R.transcript_messages??F.transcript_messages,recording_url:R.recording_url??F.recording_url,stereo_recording_url:R.stereo_recording_url??F.stereo_recording_url,ai_summary:R.ai_summary??F.ai_summary}:F),f(!1)}};return i?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading call logs..."]}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Inbound Call Logs"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"All incoming calls received by your AI receptionists."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 sm:gap-4",children:[o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:n}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Calls"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-green-600",children:a.completed}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Completed"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-destructive",children:a.failed}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Failed"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsxs("div",{className:"text-2xl font-bold text-foreground",children:[Math.round(a.durationSeconds/60),"m"]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Talk Time"})]})]}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[$D.map(({key:I,label:R})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:R,active:b===I,dir:N,onClick:()=>z(I)})},I)),o.jsx("th",{className:"px-4 py-3 w-20",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[$D.map(({key:I,label:R})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:I==="status"?o.jsx(Tn,{value:_.status,onChange:F=>U("status",F),placeholder:"Status",options:Fxe.map(F=>({value:F,label:F}))}):o.jsx(pn,{value:_[I],onChange:F=>U(I,F),placeholder:R})},I)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:M.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:n===0?"N
866o inbound calls recorded yet.":"No calls match your filters."})}):M.map(I=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:I.contact_name||I.phone||"Unknown"}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:I.agent_name||"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("span",{className:`whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium ${Lxe(I.status)}`,children:I.status})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:I.duration||(I.duration_seconds?`${I.duration_seconds}s`:"—")}),o.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-center text-muted-foreground",children:I.call_time?new Date(I.call_time).toLocaleString():"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("button",{onClick:()=>B(I),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-primary",title:"View details",children:o.jsx(qi,{className:"h-4 w-4"})})})]},I.id))})]})}),o.jsx(dr,{page:P,pageSize:$,totalCount:n,onPageChange:O,onPageSizeChange:T,onRefresh:()=>W(),pageSizeOptions:Bxe})]}),o.jsx(ft,{open:!!c,onOpenChange:I=>!I&&u(null),children:o.jsxs(ct,{className:"max-w-3xl max-h-[88vh] overflow-y-auto",children:[o.jsxs($t,{className:"text-left",children:[o.jsxs(xt,{className:"flex items-center gap-2 pr-6",children:[o.jsx(ta,{className:"h-5 w-5 text-primary"}),"Call Details"]}),o.jsxs(wt,{children:[(c==null?void 0:c.contact_name)||(c==null?void 0:c.phone)||"Unknown caller"," • ",c!=null&&c.call_time?new Date(c.call_time).toLocaleString():""]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[o.jsxs("div",{className:"rounded-lg border border-border p-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),o.jsx("div",{className:"mt-1 font-medium",children:c==null?void 0:c.status})]}),o.jsxs("div",{className:"rounded-lg border border-border p-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Duration"}),o.jsx("div",{className:"mt-1 font-medium",children:(c==null?void 0:c.duration)||(c!=null&&c.duration_seconds?`${c.duration_seconds}s`:"—")})]}),o.jsxs("div",{className:"col-span-2 rounded-lg border border-border p-3 sm:col-span-1",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Agent"}),o.jsx("div",{className:"mt-1 font-medium",children:(c==null?void 0:c.agent_name)||"—"})]})]}),(c==null?void 0:c.ai_summary)&&o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"AI Summary"}),o.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:c.ai_summary})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"Recording"}),(c!=null&&c.recording_url||c!=null&&c.stereo_recording_url)&&v===null?o.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-muted/20 px-4 py-6 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading recording…"]}):o.jsx(i1,{ref:y,src:v,onTimeUpdate:m})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"Transcript"}),d?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading transcript..."]}):o.jsx("div",{className:"rounded-lg border border-border bg-muted/20 p-3 max-h-72 overflow-y-auto",children:o.jsx(bP,{messages:c==null?void 0:c.transcript_messages,transcript:c==null?void 0:c.transcript,activeTime:h,onSeek:I=>{var R;return(R=y.current)==null?void 0:R.seek(I)}})})]})]}),o.jsx(Wt,{className:"gap-2 sm:gap-0",children:o.jsx(ne,{variant:"outline",onClick:()=>u(null),children:"Close"})})]})})]})},Uxe=e=>e==="Completed"?"bg-success/15 text-success":e==="Failed"||e==="Unsuccessful"?"bg-destructive/15 text-destructive":e==="Ringing"?"bg-warning/15 text-warning":e==="In Progress"||e==="Initiated"?"bg-info/15 text-info":"bg-muted text-muted-foreground",RD=[{key:"contact_name",label:"Called"},{key:"agent_name",label:"Agent"},{key:"status",label:"Status"},{key:"duration",label:"Duration"},{key:"call_time",label:"Time"}];function LD(e,t){return t==="contact_name"?e.contact_name||e.phone||"Unknown":t==="duration"?e.duration||(e.duration_seconds?`${e.duration_seconds}s`:""):e[t]||""}const Vxe=["Initiated","Ringing","In Progress","Completed","Failed","Unsuccessful"],Wxe=[10,25,50,100],qxe=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(0),[a,s]=p.useState({completed:0,failed:0,durationSeconds:0}
866),[i,l]=p.useState(!0),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(0),[v,g]=p.useState(null),y=p.useRef(null),x=p.useRef(null),[b,w]=p.useState(null),[N,S]=p.useState("asc"),[_,k]=p.useState({contact_name:"",agent_name:"",status:"",duration:"",call_time:""}),[P,O]=p.useState(1),[$,T]=p.useState(10),z=I=>{if(b!==I){w(I),S("asc");return}if(N==="asc"){S("desc");return}w(null)},U=(I,R)=>k(F=>({...F,[I]:R})),[E,q]=p.useState(_);p.useEffect(()=>{const I=setTimeout(()=>q(_),400);return()=>clearTimeout(I)},[_]);const W=p.useCallback(async(I=!1)=>{var C;I||l(!0);const R=new URLSearchParams;R.set("direction","outbound"),E.contact_name.trim()&&R.set("contact_name",E.contact_name.trim()),E.agent_name.trim()&&R.set("agent_name",E.agent_name.trim()),E.status&&R.set("status",E.status),E.duration.trim()&&R.set("duration",E.duration.trim()),R.set("limit",String($)),R.set("offset",String((P-1)*$));const[F,j]=await Promise.all([ee.getConversations(R.toString()),ee.getConversationStats("direction=outbound")]);if(Array.isArray(F.data)&&t(F.data),r(((C=F.meta)==null?void 0:C.count)??0),j.data){const A=j.data;s({completed:A.completed??0,failed:A.failed??0,durationSeconds:A.total_duration_seconds??0})}I||l(!1)},[E,P,$]);p.useEffect(()=>{W();const I=setInterval(()=>W(!0),3e4);return()=>clearInterval(I)},[W]),p.useEffect(()=>{O(1)},[E,$]);const L=Math.max(1,Math.ceil(n/$));p.useEffect(()=>{P>L&&O(L)},[P,L]);const M=p.useMemo(()=>b?[...e].sort((I,R)=>{const F=LD(I,b).toLowerCase(),j=LD(R,b).toLowerCase();return F<j?N==="asc"?-1:1:F>j?N==="asc"?1:-1:0}):e,[e,b,N]),B=async I=>{if(u(I),m(0),x.current=I.id,g(null),(I.recording_url||I.stereo_recording_url)&&ee.getConversationRecordingUrl(I.id).then(({data:R})=>{x.current===I.id&&g((R==null?void 0:R.url)??null)}),!I.transcript_messages||I.transcript_messages.length===0){f(!0);const{data:R}=await ee.getConversationTranscript(I.id);if(x.current!==I.id)return;R&&u(F=>F&&F.id===I.id?{...F,transcript:R.transcript??F.transcript,transcript_messages:R.transcript_messages??F.transcript_messages,recording_url:R.recording_url??F.recording_url,stereo_recording_url:R.stereo_recording_url??F.stereo_recording_url,ai_summary:R.ai_summary??F.ai_summary}:F),f(!1)}};return i?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading call logs..."]}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Outbound Call Logs"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"All outgoing calls placed by your agents and campaigns."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 sm:gap-4",children:[o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:n}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Calls"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-green-600",children:a.completed}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Completed"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-2xl font-bold text-destructive",children:a.failed}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Failed"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsxs("div",{className:"text-2xl font-bold text-foreground",children:[Math.round(a.durationSeconds/60),"m"]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Talk Time"})]})]}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[RD.map(({key:I,label:R})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:R,active:b===I,dir:N,onClick:()=>z(I)})},I)),o.jsx("th",{className:"px-4 py-3 w-20",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[RD.map(({key:I,label:R})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:I==="status"?o.jsx(Tn,{value:_.status,onChange:F=>U("status",F),placeholder:"Status",options:Vxe.map(F=>({value:F,label:F}))}):o.jsx(pn,{value:_[I],onChange:F=>U(I,F),placeholder:R})},I)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:M.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:n===0?"N
866o outbound calls recorded yet.":"No calls match your filters."})}):M.map(I=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:I.contact_name||I.phone||"Unknown"}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:I.agent_name||"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("span",{className:`whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium ${Uxe(I.status)}`,children:I.status})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:I.duration||(I.duration_seconds?`${I.duration_seconds}s`:"—")}),o.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-center text-muted-foreground",children:I.call_time?new Date(I.call_time).toLocaleString():"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("button",{onClick:()=>B(I),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-primary",title:"View details",children:o.jsx(qi,{className:"h-4 w-4"})})})]},I.id))})]})}),o.jsx(dr,{page:P,pageSize:$,totalCount:n,onPageChange:O,onPageSizeChange:T,onRefresh:()=>W(),pageSizeOptions:Wxe})]}),o.jsx(ft,{open:!!c,onOpenChange:I=>!I&&u(null),children:o.jsxs(ct,{className:"max-w-3xl max-h-[88vh] overflow-y-auto",children:[o.jsxs($t,{className:"text-left",children:[o.jsxs(xt,{className:"flex items-center gap-2 pr-6",children:[o.jsx(Wo,{className:"h-5 w-5 text-primary"}),"Call Details"]}),o.jsxs(wt,{children:[(c==null?void 0:c.contact_name)||(c==null?void 0:c.phone)||"Unknown"," • ",c!=null&&c.call_time?new Date(c.call_time).toLocaleString():""]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[o.jsxs("div",{className:"rounded-lg border border-border p-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),o.jsx("div",{className:"mt-1 font-medium",children:c==null?void 0:c.status})]}),o.jsxs("div",{className:"rounded-lg border border-border p-3",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Duration"}),o.jsx("div",{className:"mt-1 font-medium",children:(c==null?void 0:c.duration)||(c!=null&&c.duration_seconds?`${c.duration_seconds}s`:"—")})]}),o.jsxs("div",{className:"col-span-2 rounded-lg border border-border p-3 sm:col-span-1",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Agent"}),o.jsx("div",{className:"mt-1 font-medium",children:(c==null?void 0:c.agent_name)||"—"})]})]}),(c==null?void 0:c.ai_summary)&&o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"AI Summary"}),o.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:c.ai_summary})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"Recording"}),(c!=null&&c.recording_url||c!=null&&c.stereo_recording_url)&&v===null?o.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-muted/20 px-4 py-6 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading recording…"]}):o.jsx(i1,{ref:y,src:v,onTimeUpdate:m})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground mb-1",children:"Transcript"}),d?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(Te,{className:"h-4 w-4 animate-spin"})," Loading transcript..."]}):o.jsx("div",{className:"rounded-lg border border-border bg-muted/20 p-3 max-h-72 overflow-y-auto",children:o.jsx(bP,{messages:c==null?void 0:c.transcript_messages,transcript:c==null?void 0:c.transcript,activeTime:h,onSeek:I=>{var R;return(R=y.current)==null?void 0:R.seek(I)}})})]})]}),o.jsx(Wt,{className:"gap-2 sm:gap-0",children:o.jsx(ne,{variant:"outline",onClick:()=>u(null),children:"Close"})})]})})]})};function Hxe({open:e,onOpenChange:t,onConnected:n}){const[r,a]=p.useState(""),[s,i]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=()=>{a(""),i(""),h(!1),c("")},v=y=>{y||m(),t(y)},g=async()=>
866{if(!r.trim()||!s.trim()){X.error("Account SID and Auth Token are both required");return}d(!0);const{error:y}=await ee.createTwilioCredential({account_sid:r.trim(),auth_token:s.trim(),label:l.trim()||void 0});if(d(!1),y)return X.error(y);X.success("Twilio account connected"),v(!1),n==null||n()};return o.jsx(ft,{open:e,onOpenChange:v,children:o.jsxs(ct,{className:"max-w-lg p-0 gap-0 [&>button]:hidden",children:[o.jsxs(ev,{children:[o.jsx(xt,{children:"Connect your Twilio account"}),o.jsx(wt,{children:"Add your Twilio Account SID and Auth Token"})]}),o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[o.jsx("h2",{className:"text-lg font-bold",children:"Connect your Twilio account"}),o.jsx("button",{onClick:()=>v(!1),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"space-y-4 px-6 py-6",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Find these under your Twilio Console → Account → API keys & tokens. Your number stays billed directly by Twilio to your own account — we only use these credentials to connect it to your AI agent."}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Account SID"}),o.jsx(ve,{value:r,onChange:y=>a(y.target.value),placeholder:"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Auth Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(ve,{type:f?"text":"password",value:s,onChange:y=>i(y.target.value),placeholder:"Your Twilio Auth Token",className:"pr-10"}),o.jsx("button",{type:"button",onClick:()=>h(y=>!y),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":f?"Hide secret":"Show secret",children:f?o.jsx(sw,{size:16}):o.jsx(Ls,{size:16})})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Label (optional)"}),o.jsx(ve,{value:l,onChange:y=>c(y.target.value),placeholder:"e.g. My Twilio account"})]})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border px-6 py-4 bg-muted/20 sm:flex-row sm:items-center sm:justify-end",children:[o.jsxs(ne,{variant:"outline",onClick:()=>v(!1),className:"w-full sm:w-auto",children:[o.jsx(rn,{className:"mr-1 h-4 w-4"})," Cancel"]}),o.jsxs(ne,{onClick:g,disabled:u,className:"w-full bg-primary text-primary-foreground hover:opacity-90 sm:w-auto",children:[o.jsx(Cre,{className:"mr-1 h-4 w-4"})," ",u?"Connecting…":"Connect"]})]})]})})}const Gxe=["Twilio","BYOT"],Yxe={Twilio:"Standard",BYOT:"Twilio"};function Kxe({open:e,onOpenChange:t,onCreate:n}){const[r,a]=p.useState({active:!1,serviceProvider:"",agentId:"",purpose:"",byotMode:"import"}),[s,i]=p.useState([]),[l,c]=p.useState([]),[u,d]=p.useState(!1),f=()=>{ee.getTwilioCredentials().then(({data:y})=>{const x=y??[];c(x),x.length===1&&a(b=>b.byotCredentialId?b:{...b,byotCredentialId:x[0].id})})};p.useEffect(()=>{e&&(ee.getAgents().then(({data:y})=>i(y??[])),f())},[e]);const h=()=>a({active:!1,serviceProvider:"",agentId:"",purpose:"",byotMode:"import"}),m=y=>{y||h(),t(y)},v=r.serviceProvider==="BYOT",g=()=>{var y;if(!r.purpose)return X.error("Please select a purpose");if(!r.serviceProvider)return X.error("Please select a service provider");if(v){if(!r.byotCredentialId)return X.error("Please select (or connect) a Twilio account");if(r.byotMode==="import"&&!((y=r.byotNumber)!=null&&y.trim()))return X.error("Enter the phone number you already own")}n==null||n(r.byotNumber?{...r,byotNumber:r.byotNumber.trim()}:r),m(!1)};return o.jsx(ft,{open:e,onOpenChange:m,children:o.jsxs(ct,{className:"max-w-lg p-0 gap-0 [&>button]:hidden",children:[o.jsxs(ev,{children:[o.jsx(xt,{children:"Create Phone Number"}),o.jsx(wt,{children:"Provision a new phone number"})]}),o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[o.jsx("h2",{className:"text-lg font-bold",children:"Create Phone Number"}),o.jsx("button",{onClick:()=>m(!1),className:"rounded-md p-1.5 text-muted-foreground hover:bg-muted",children:o.jsx(rn,{className:"h-5 w-5"})})]}),o.jsxs("div",{className:"space-y-4 px-6 py-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-semibold mb-1.5",children:"Purpose"}),o.jsxs(nt,{value:r.purpose,onValueChange:y=>a({...r,purpose:y,agentId:y==="outbound"?"":r.agentId}),children:[o.jsx(Ze,{"aria-label":"Purpose",children:o.jsx(rt,{placeholder:"Select type"})}),o.jsxs(et,{children:[o.jsx(we,{value:"inbound",children:"Inbound"}),o.jsx(we,{value:"outbound",children:"Outbound"}),o.jsx(we,{value:"both",children:"Both"})]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-semibold mb-1.5",children:"Service Provider"}),o.jsxs(nt,{value:r.serviceProvider,onValueChange:y=>a({...r,serviceProvider:y}),children:[o.jsx(Ze,{"aria-label":"Service Provider",children:o.jsx(rt,{placeholder:"Please select your phone number provider"})}),o.jsx(et,{children:Gxe.map(y=>o.jsx(we,{value:y,children:Yxe[y]??y},y))})]})]}),r.serviceProvider==="Twilio"&&o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:["This number costs ",o.jsx("span",{className:"font-medium text-foreground",children:"$3"}),". If your account balance covers it, it's deducted from your balance;
866 otherwise you'll be taken to secure Stripe checkout to pay."]}),v&&o.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[o.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"$1/month"})," platform fee. Twilio bills you directly for the number and call minutes."]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"block text-sm font-semibold",children:"Twilio account"}),l.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-success",children:[o.jsx(tr,{className:"h-3.5 w-3.5"})," Connected"]})]}),l.length===0?o.jsx("p",{className:"text-xs text-muted-foreground",children:"No Twilio account connected yet."}):o.jsxs(nt,{value:r.byotCredentialId||"",onValueChange:y=>a({...r,byotCredentialId:y}),children:[o.jsx(Ze,{"aria-label":"Twilio account",children:o.jsx(rt,{placeholder:"Select a connected Twilio account"})}),o.jsx(et,{children:l.map(y=>o.jsx(we,{value:y.id,children:y.label||y.account_sid},y.id))})]}),o.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!0),children:l.length===0?"Connect a Twilio account":"Connect another Twilio account"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"block text-sm font-semibold",children:"How do you want to get the number?"}),o.jsxs(nt,{value:r.byotMode||"import",onValueChange:y=>a({...r,byotMode:y}),children:[o.jsx(Ze,{"aria-label":"Number acquisition mode",children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"import",children:"I already own a number"}),o.jsx(we,{value:"purchase",children:"Buy a new number on my Twilio account"})]})]})]}),r.byotMode!=="purchase"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"block text-sm font-semibold",children:"Your phone number"}),o.jsx(ve,{value:r.byotNumber||"",onChange:y=>a({...r,byotNumber:y.target.value}),placeholder:"+1XXXXXXXXXX"})]})]}),r.purpose!=="outbound"?o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-semibold mb-1.5",children:"Assign AI Agent"}),o.jsxs(nt,{value:r.agentId||"__none__",onValueChange:y=>a({...r,agentId:y==="__none__"?"":y}),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"No agent assigned"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__none__",children:"No agent assigned"}),s.map(y=>o.jsx(we,{value:y.id,children:y.name},y.id))]})]}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Agent that handles inbound calls on this number."})]}):o.jsx("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"You can add this number to a campaign from Outbound → Campaigns once it's created."}),o.jsx(Xxe,{label:"Active",checked:r.active,onChange:y=>a({...r,active:y})})]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border px-6 py-4 bg-muted/20 sm:flex-row sm:items-center sm:justify-end",children:[o.jsxs(ne,{variant:"outline",onClick:()=>m(!1),className:"w-full sm:w-auto",children:[o.jsx(rn,{className:"mr-1 h-4 w-4"})," Cancel"]}),o.jsxs(ne,{onClick:g,className:"w-full bg-primary text-primary-foreground hover:opacity-90 sm:w-auto",children:[o.jsx(nn,{className:"mr-1 h-4 w-4"})," Create"]})]}),o.jsx(Hxe,{open:u,onOpenChange:d,onConnected:f})]})})}function Xxe({label:e,checked:t,onChange:n}){return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(jh,{checked:t,onCheckedChange:n}),o.jsx("span",{className:"text-sm font-semibold",children:e})]})}const Jxe={twilio:"Standard",vapi:"Standard",twilio_byot:"Twilio"},rm=e=>Jxe[(e||"").toLowerCase()]??e;function Qxe(e){if(!e)return null;const t=new Date(e);if(isNaN(t.getTime()))return null;const n=Math.floor((t.getTime()-Date.now())/864e5);return{date:t,daysLeft:n}}const Zxe=2e3,ebe=12e4,FD=[{key:"number",label:"Number"},{key:"usedIn",label:"Used In"},{key:"provider",label:"Provider"},{key:"assignedAgent",label:"Assigned Agent"},{key:"status",label:"Status"},{key:"purchased",label:"Purchased"},{key:"expires",label:"Expires"}],tbe=[{value:"inbound",label:"Inbound"},{value:"outbound",label:"Outbound"},{value:"unused",label:"Unused"}],nbe=["Active","Inactive"],rbe=[10,25,50,100],abe=()=>{const[e,t]=p.useState(!1),[n,r]=p.useState([]),[a,s]=p.useState(new Map),[i,l]=p.useState(new Set),[c,u]=p.useState(!0),[d,f]=p.useState(null),[h,m]=p.useState("asc"),[v,g]=p.useState({number:"",usedIn:"",provider:"",assignedAgent:"",status:"",purchased:"",expires:""}),[y,x]=p.useState(void 0),[b,w]=p.useState(void 0),[N,S]=p.useState(1),[_,k]=p.useState(10),[P,O]=p.useState(null),[$,T]=p.useState([]),[z,U]=p.useState("idle"),E=p.useRef(null),[q,W]=p.useState(null),[L,M]=p.useState({agent_id:"",status:"",provider:""}),B=async()=>{const[te,re,pe]=await Promise.all([ee.getPhoneNumbers(),ee.getAgents(),ee.getCampaigns()]);te.data&&r(Array.isArray(te.data)?te.data:[]),Array.isArray(re.data)&&s(new Map(re.data.map(Ee=>[Ee.id,Ee.name]))),Array.isArray(pe.data)&&l(new Set(pe.data.map(Ee=>
866Ee.phone_number_id).filter(Boolean))),u(!1)};p.useEffect(()=>{B()},[]);const I=te=>{if(d!==te){f(te),m("asc");return}if(h==="asc"){m("desc");return}f(null)},R=(te,re)=>g(pe=>({...pe,[te]:re})),F=p.useMemo(()=>{const te=new Set(n.map(re=>rm(re.provider)).filter(Boolean));return Array.from(te).sort()},[n]),j=(te,re)=>re==="number"?te.number||"":re==="provider"?rm(te.provider)||"":re==="assignedAgent"?te.agent_id?a.get(te.agent_id)||"Unknown agent":"":re==="status"?te.status||"":re==="purchased"?te.created_at||"":re==="expires"&&te.next_billing_at||"",C=p.useMemo(()=>n.filter(te=>{if(v.usedIn==="inbound"&&!te.agent_id||v.usedIn==="outbound"&&!i.has(te.id)||v.usedIn==="unused"&&(te.agent_id||i.has(te.id))||v.status&&te.status!==v.status||v.provider&&rm(te.provider)!==v.provider)return!1;if(y){const re=te.created_at?new Date(te.created_at):null;if(!re||isNaN(re.getTime())||!Jn(re,y))return!1}if(b){const re=te.next_billing_at?new Date(te.next_billing_at):null;if(!re||isNaN(re.getTime())||!Jn(re,b))return!1}for(const re of["number","assignedAgent"]){const pe=v[re].trim().toLowerCase();if(pe&&!j(te,re).toLowerCase().includes(pe))return!1}return!0}),[n,i,v,y,b]),A=p.useMemo(()=>d?[...C].sort((te,re)=>{if(d==="purchased"||d==="expires"){const Fe=j(te,d)?new Date(j(te,d)).getTime():0,Be=j(re,d)?new Date(j(re,d)).getTime():0;return h==="asc"?Fe-Be:Be-Fe}if(d==="usedIn"){const Fe=Be=>(Be.agent_id?1:0)+(i.has(Be.id)?1:0);return h==="asc"?Fe(te)-Fe(re):Fe(re)-Fe(te)}const pe=j(te,d).toLowerCase(),Ee=j(re,d).toLowerCase();return pe<Ee?h==="asc"?-1:1:pe>Ee?h==="asc"?1:-1:0}):C,[C,d,h,i]);p.useEffect(()=>{S(1)},[v,y,b,_]);const D=Math.max(1,Math.ceil(A.length/_));p.useEffect(()=>{N>D&&S(D)},[N,D]);const V=p.useMemo(()=>A.slice((N-1)*_,N*_),[A,N,_]),Y=p.useRef(!1);p.useEffect(()=>{const te=new URLSearchParams(window.location.search),re=te.get("purchase");if(!re)return;const pe=()=>window.history.replaceState({},"",window.location.pathname);if(re==="canceled"){X.info("Purchase canceled. No number was created."),pe();return}if(re==="success"){const Ee=te.get("session_id");if(!Ee||Y.current){pe();return}Y.current=!0;const Fe=X.loading("Payment received. Provisioning your number…");ee.confirmPhonePurchase(Ee).then(({data:Be,error:st})=>{X.dismiss(Fe),st||!Be?X.error(st||"Could not provision the number after payment."):X.success(`Number ${Be.number||""} purchased and provisioned.`),pe(),B()})}},[]);const G=async te=>{const{error:re}=await ee.deletePhoneNumber(te.id);if(re)return X.error(re);X.success("Number released"),B()},K=()=>{E.current&&(clearInterval(E.current),E.current=null)},Z=te=>{K(),O(te),U("idle"),T([])},J=()=>{K(),O(null)},ce=te=>{K();const re=Date.now();let pe="";E.current=setInterval(async()=>{if(Date.now()-re>ebe){K();return}const{data:Ee,error:Fe}=await ee.getCallStatus(te);if(Fe||!Ee)return;const Be=Ee.status;Be&&Be!==pe&&(pe=Be,U(Be==="ended"?"ended":Be==="in-progress"||Be==="forwarding"?"in-progress":Be==="ringing"?"ringing":"queued"),T(st=>[...st,Be==="ended"?`Call ended${Ee.ended_reason?` (${Ee.ended_reason})`:""}.`:`Status: ${Be}`])),Be==="ended"&&K()},Zxe)};p.useEffect(()=>K,[]);const ue=async(te,re)=>{if(!te.agent_id){T(Fe=>[...Fe,"Error: no agent assigned to this number. Assign one in Settings first."]);return}if(!re.trim()){T(Fe=>[...Fe,"Error: enter a target phone number."]);return}U("dialing"),T(Fe=>[...Fe,`Dialing ${re}…`]);const{data:pe,error:Ee}=await ee.makeCall({agent_id:te.agent_id,phone_number:re.trim(),phone_number_id:te.id});Ee?(U("failed"),T(Fe=>[...Fe,`Call failed: ${Ee}`])):(U("queued"),T(Fe=>[...Fe,`Call queued (status: ${(pe==null?void 0:pe.status)??"queued"})`]),pe!=null&&pe.vapi_call_id&&ce(pe.vapi_call_id))},be=te=>{W(te),M({agent_id:te.agent_id,status:te.status,provider:te.provider})},Ne=async()=>{if(!q)return;const{error:te}=await ee.updatePhoneNumber(q.id,{agent_id:L.agent_id,status:L.status,provider:L.provider});if(te)return X.error(te);X.success("Number updated"),W(null),B()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Phone Numbers"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Every number across inbou
866nd and outbound use, in one place."})]}),o.jsxs(ne,{onClick:()=>t(!0),className:"w-full sm:w-auto",children:[o.jsx(nn,{className:"mr-2 h-4 w-4"}),"Buy Number"]})]}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[860px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[FD.map(({key:te,label:re})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:re,active:d===te,dir:h,onClick:()=>I(te)})},te)),o.jsx("th",{className:"px-4 py-3 w-32",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[FD.map(({key:te,label:re})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:te==="usedIn"?o.jsx(Tn,{value:v.usedIn,onChange:pe=>R("usedIn",pe),placeholder:"Used In",options:tbe}):te==="provider"?o.jsx(Tn,{value:v.provider,onChange:pe=>R("provider",pe),placeholder:"Provider",options:F.map(pe=>({value:pe,label:pe}))}):te==="status"?o.jsx(Tn,{value:v.status,onChange:pe=>R("status",pe),placeholder:"Status",options:nbe.map(pe=>({value:pe,label:pe}))}):te==="purchased"?o.jsx(Tf,{value:y,onChange:x}):te==="expires"?o.jsx(Tf,{value:b,onChange:w}):o.jsx(pn,{value:v[te],onChange:pe=>R(te,pe),placeholder:re})},te)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:c?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-muted-foreground",children:"Loading..."})}):V.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-muted-foreground",children:n.length===0?"No phone numbers found.":"No numbers match your filters."})}):V.map(te=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3",children:o.jsxs("div",{className:"flex items-center justify-center gap-2 whitespace-nowrap font-mono text-foreground",children:[o.jsx(Un,{className:"h-4 w-4 shrink-0 text-primary"})," ",te.number]})}),o.jsx("td",{className:"px-4 py-3",children:o.jsxs("div",{className:"flex flex-wrap justify-center gap-1.5",children:[te.agent_id&&o.jsx("span",{className:"whitespace-nowrap rounded-full bg-info/15 px-2 py-0.5 text-xs font-medium text-info",children:"Inbound"}),i.has(te.id)&&o.jsx("span",{className:"whitespace-nowrap rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success",children:"Outbound"}),!te.agent_id&&!i.has(te.id)&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})]})}),o.jsx("td",{className:"px-4 py-3 text-center",children:rm(te.provider)}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:a.get(te.agent_id)||(te.agent_id?"Unknown agent":"—")}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(sbe,{num:te})}),o.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-center text-muted-foreground xl:whitespace-normal",children:te.created_at?la(new Date(te.created_at),"MMM d, yyyy"):"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:(()=>{const re=Qxe(te.next_billing_at);if(!re)return o.jsx("span",{className:"text-muted-foreground",children:"—"});const pe=re.daysLeft<0,Ee=re.daysLeft>=0&&re.daysLeft<=5;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"whitespace-nowrap text-foreground xl:whitespace-normal",children:la(re.date,"MMM d, yyyy")}),o.jsx("div",{className:`whitespace-nowrap text-xs xl:whitespace-normal ${pe?"text-destructive font-medium":Ee?"text-yellow-500":"text-muted-foreground"}`,children:pe?"expired":`${re.daysLeft} day${re.daysLeft===1?"":"s"} left`})]})})()}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(u1,{onTest:()=>Z(te),onSettings:()=>be(te),onDelete:()=>G(te)})})]},te.id))})]})}),o.jsx(dr,{page:N,pageSize:_,totalCount:A.length,onPageChange:S,onPageSizeChange:k,pageSizeOptions:rbe})]}),o.jsx(Kxe,{open:e,onOpenChange:t,onCreate:async te=>{const re=te.active?"Active":"Inactive";if(te.serviceProvider==="BYOT"){const{data:Be,error:st}=await ee.createByotPhoneNumber({mode:te.byotMode||"import",credential_id:te.byotCredentialId,number:te.byotNumber||void 0,agent_id:te.agentId||void 0,status:re});if(st)return X.error(st);X.success(`Phone number ${(Be==null?void 0:Be.number)||""} connected`),B();return}const pe={status:re,provider:te.serviceProvider};te.agentId&&(pe.agent_id=te.agentId);const{data:Ee,error:Fe}=await ee.createPhoneNumber(pe);if(Fe)return X.error(Fe);if(Ee!=null&&Ee.checkout_url){window.location.href=Ee.checkout_url;return}X.success(`Phone number ${(Ee==null?void 0:Ee.number)||""} created`),B()}}),o.jsx(cbe,{target:P,log:$,stage:z,onPlace:ue,onClose:J}),o.jsx(ft,{open:!!q,onOpenChange:te=>!te&&W(null),children:o.jsxs(ct,{className:"max-w-lg",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Number Settings"}),o.jsx(wt,{children:"Reassign agent or change status."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Assigned Agent"}),o.jsxs(nt,{value:L.agent_id||"__none__",onValueChange:te=>M(re=>({...re,agent_id:te==="__none__"?null:te})),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:"Select an agent"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__none__",children:"No agent assigned"}),Array.from(a.entries()).map(([te,re])=>o.jsx(we,{value:te,children:re},te))]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Provider"}),o.jsx(ve,{value:rm(L.provider),readOnly:!0,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Status"}),o.jsxs(nt,{value:L.status,onValueChange:te=>M(re=>({...re,status:te})),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Inactive",children:"Inactive"})]})]})]})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>W(null),children:"Cancel"}),o.jsx(ne,{onClick:Ne,children:"Save"})]})]})})]})},obe=120;function sbe({num:e}){const[t,n]=p.useState(()=>{if((e.provider||"").toLowerCase()!=="vapi"||!e.vapi_phone_id||!e.created_at)return 0;const a=Math.floor((Date.now()-new Date(e.created_at).getTime())/1e3);return Math.max(0,obe-a)}),r=p.useRef(null);if(p.useEffect(()=>{if(!(t<=0))return r.current=setInterval(()=>{n(a=>a<=1?(clearInterval(r.current),0):a-1)},1e3),()=>clearInterval(r.current)},[]),t>0){const a=Math.floor(t/60),s=t%60;return o.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border border-yellow-500/40 bg-yellow-500/10 px-2.5 py-0.5 text-xs font-medium text-yellow-500",children:[o.jsx(aw,{className:"h-3 w-3 animate-pulse"}),"Activating ",a,":",String(s).padStart(2,"0")]})}return e.suspended_for_balance?o.jsx(_n,{variant:"destructive",className:"whitespace-nowrap xl:whitespace-normal",children:"Suspended — add funds"}):o.jsx(_n,{variant:e.status==="Active"?"default":"secondary",children:e.status})}const ibe=[["1",""],["2","ABC"],["3","DEF"],["4","GHI"],["5","JKL"],["6","MNO"],["7","PQRS"],["8","TUV"],["9","WXYZ"],["+",""],["0",""],["#",""]],lbe={idle:null,dialing:{label:"Dialing…",className:"border-info/40 bg-info/10 text-info"},queued:{label:"Queued",className:"border-yellow-500/40 bg-yellow-500/10 text-yellow-500"},ringing:{label:"Ringing…",className:"border-info/40 bg-info/10 text-info"}
866,"in-progress":{label:"In progress",className:"border-success/40 bg-success/10 text-success"},ended:{label:"Call ended",className:"border-muted-foreground/30 bg-muted text-muted-foreground"},failed:{label:"Call failed",className:"border-destructive/40 bg-destructive/10 text-destructive"}};function cbe({target:e,log:t,stage:n,onPlace:r,onClose:a}){const[s,i]=p.useState(""),l=n==="dialing"||n==="queued"||n==="ringing"||n==="in-progress",c=lbe[n];p.useEffect(()=>{e&&i("")},[e]);const u=f=>i(h=>h+f),d=()=>i(f=>f.slice(0,-1));return o.jsx(ft,{open:!!e,onOpenChange:f=>{f||a()},children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Place test call"}),o.jsx(wt,{children:"Enter any phone number to place a real test call and hear your agent in action."})]}),o.jsxs("div",{className:"space-y-3",children:[c&&o.jsxs("div",{className:`flex items-center justify-center gap-2 rounded-full border px-3 py-1 text-xs font-medium ${c.className}`,children:[l?o.jsx(Te,{className:"h-3.5 w-3.5 animate-spin"}):n==="failed"?o.jsx(i8,{className:"h-3.5 w-3.5"}):o.jsx(wf,{className:"h-3.5 w-3.5"}),c.label]}),o.jsxs("div",{className:"flex items-center gap-1 rounded-xl border border-border bg-muted/30 px-3 py-2",children:[o.jsx(ve,{value:s,onChange:f=>i(f.target.value),placeholder:"+1 (555) 123-4567",disabled:l,className:"h-8 border-0 bg-transparent p-0 text-center font-mono text-lg tracking-wide shadow-none focus-visible:ring-0"}),o.jsx("button",{type:"button",onClick:d,disabled:!s||l,className:"shrink-0 rounded-full p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30","aria-label":"Backspace",children:o.jsx(bre,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"grid grid-cols-3 gap-2 justify-items-center",children:ibe.map(([f,h])=>o.jsxs("button",{type:"button",disabled:l,onClick:()=>u(f),className:"flex h-12 w-12 flex-col items-center justify-center rounded-full bg-muted/50 text-foreground transition-colors hover:bg-muted disabled:opacity-40",children:[o.jsx("span",{className:"text-base font-semibold leading-none",children:f}),h&&o.jsx("span",{className:"mt-0.5 text-[8px] tracking-widest text-muted-foreground",children:h})]},f))}),o.jsx("div",{className:"flex justify-center",children:o.jsx("button",{type:"button",onClick:()=>e&&r(e,s),disabled:!s.trim()||l,"aria-label":"Place call",className:"flex h-12 w-12 items-center justify-center rounded-full bg-success text-success-foreground shadow-md transition-transform hover:scale-105 hover:bg-success/90 disabled:pointer-events-none disabled:opacity-40",children:l?o.jsx(Te,{className:"h-5 w-5 animate-spin"}):o.jsx(wf,{className:"h-5 w-5"})})}),t.length>0&&o.jsx("p",{className:"text-center text-xs text-muted-foreground",children:t[t.length-1]})]}),o.jsx(Wt,{className:"gap-2 sm:gap-0",children:o.jsx(ne,{variant:"outline",onClick:a,children:"Close"})})]})})}const ube=[{to:"/dashboard/billing",label:"Overview",end:!0},{to:"/dashboard/billing/transactions",label:"Transactions",end:!1},{to:"/dashboard/billing/call-costs",label:"Call Costs",end:!1},{to:"/dashboard/billing/payment-methods",label:"Payment methods",end:!1},{to:"/dashboard/billing/promotions",label:"Promotions",end:!1}],dbe=()=>o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Billing"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your balance, payment methods and promotions."})]}),o.jsx("div",{className:"flex items-center gap-4 overflow-x-auto shadow-[inset_0_-1px_0_0_hsl(var(--border))] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden max-sm:pr-6 max-sm:[mask-image:linear-gradient(to_right,#000_calc(100%-1.5rem),transparent)] sm:gap-6",children:ube.map(e=>o.jsx(Jx,{to:e.to,end:e.end,className:({isActive:t})=>`relative shrink-0 whitespace-nowrap py-3 text-sm font-medium ${t?"text-foreground [scroll-initial-target:nearest]":"text-muted-foreground hover:text-foreground"}`,children:({isActive:t})=>o.jsxs(o.Fragment,{children:[e.label,t&&o.jsx("span",{className:"absolute inset-x-0 bottom-0 h-0.5 bg-primary"})]})},e.to))}),o.jsx(M2,{})]}),fbe=[20,50,100,250],li=20,xq=1e3,qC={topup:"Top-up",phone:"Phone Number",admin:"Adjustment",promo:"Welcome credit",promo_code:"Promo code",call:"Call",refund:"Refund"};function bq(e){if(!e)return"0:00";const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}function hbe({open:e,onOpenChange:t,defaultAmount:n=50}){const[r,a]=p.useState(n),[s,i]=p.useState(!1),l=async()=>
866{if(r<li)return X.error(`Minimum top-up is $${li}`);i(!0);const{data:c,error:u}=await ee.topupCheckout(r);if(i(!1),u||!(c!=null&&c.checkout_url))return X.error(u||"Could not start checkout");window.location.href=c.checkout_url};return o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Add to credit balance"}),o.jsx(wt,{children:"Load your account balance. It's used for calls and phone numbers."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:fbe.map(c=>o.jsxs(ne,{type:"button",variant:r===c?"default":"outline",onClick:()=>a(c),children:["$",c]},c))}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-sm font-medium text-foreground",children:"Custom amount (USD)"}),o.jsx(ve,{type:"number",min:li,max:xq,value:r,onChange:c=>a(parseFloat(c.target.value)||0)}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Minimum $",li,". You'll pay securely via Stripe."]})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsx(ne,{onClick:l,disabled:s||r<li,children:s?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Redirecting…"]}):o.jsxs(o.Fragment,{children:["Pay $",r.toFixed(2)]})})]})]})})}function mbe({open:e,onOpenChange:t,billing:n,onSaved:r}){const[a,s]=p.useState(!1),[i,l]=p.useState(10),[c,u]=p.useState(50),[d,f]=p.useState(!1),[h,m]=p.useState(null);p.useEffect(()=>{if(!e)return;s(!!(n!=null&&n.auto_recharge_enabled)),l((n==null?void 0:n.auto_recharge_threshold)??10),u((n==null?void 0:n.auto_recharge_amount)??50);let y=!0;return ee.getPaymentMethods().then(({data:x})=>{y&&m(Array.isArray(x)&&x.length>0)}),()=>{y=!1}},[e,n]);const v=async()=>{if(a&&c<li)return X.error(`Recharge amount must be at least $${li}`);f(!0);const{error:y}=await ee.updateAutoRecharge({enabled:a,threshold:i,amount:c});if(f(!1),y)return X.error(y);X.success(a?"Auto recharge enabled":"Auto recharge turned off"),t(!1),r()},g=a&&h===!1;return o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Auto recharge settings"}),o.jsx(wt,{children:"Keep your balance topped up automatically so calls never stop mid-campaign."})]}),o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-background/40 p-3",children:[o.jsxs("div",{children:[o.jsx("span",{className:"block text-sm font-medium text-foreground",children:"Enable auto recharge"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Charges your default card when the balance runs low."})]}),o.jsx(jh,{checked:a,onCheckedChange:s})]}),g&&o.jsxs("p",{className:"rounded-lg border border-yellow-500/40 bg-yellow-500/10 p-3 text-xs text-yellow-600 dark:text-yellow-400",children:["You need a saved card first."," ",o.jsx(jt,{to:"/dashboard/billing/payment-methods",className:"font-medium underline",onClick:()=>t(!1),children:"Add a payment method"}),", then come back to enable this."]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(ke,{htmlFor:"ar-threshold",children:"When balance falls below"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),o.jsx(ve,{id:"ar-threshold",type:"number",min:0,max:500,step:"1",className:"pl-6",value:i,onChange:y=>l(parseFloat(y.target.value)||0),disabled:!a})]})]}),o.jsxs("div",{children:[o.jsx(ke,{htmlFor:"ar-amount",children:"Bring balance up by"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),o.jsx(ve,{id:"ar-amount",type:"number",min:li,max:xq,step:"1",className:"pl-6",value:c,onChange:y=>u(parseFloat(y.target.value)||0),disabled:!a})]}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Minimum $",li,"."]})]})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsx(ne,{onClick:v,disabled:d||g,children:d?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Saving…"]}):"Save"})]})]})})}const pbe=()=>{var y;const[e]=Eg(),[t,n]=p.useState(null),[r,a]=p.useState(!1),[s,i]=p.useState(0),[l,c]=p.useState(!0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=p.useCallback(async()=>{const[x,b,w]=await Promise.all([ee.getBillingStatus(),ee.getBillingCallCosts(),ee.getWalletTransactions()]);x.data&&n(x.data),b.data&&i(b.data.total_minutes||0),Array.isArray(w.data)&&a(w.data.some(N=>N.kind==="promo")),c(!1)},[]);if(p.useEffect(()=>{m()},[m]),p.useEffect(()=>{const x=e.get("topup");if(!x)return;const b=()=>window.history.replaceState({},"",window.location.pathname);if(x==="canceled"){X.info("Top-up canceled. No funds added."),b();return}if(x==="success"){const w=e.get("session_id");if(!w){b();return}const N=X.loading("Payment received. Updating your balance…");ee.topupConfirm(w).then(({data:S,error:_})=>{X.dismiss(N),_?X.error(_):X.success(`Added $${((S==null?void 0:S.added)??0).toFixed(2)} to your balance.`),b(),m()})}},[e,m]),l)return o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading billing..."]});const v=(t==null?void 0:t.rate_per_minute)??.35,g=!!(t!=null&&t.auto_recharge_enabled);return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"overflow-hidden rounded-2xl border border-border bg-gradient-to-br from-primary/10 via-background to-background p-6 sm:p-8",children:o.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-end xl:justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary/15",children:o.jsx(oc,{className:"h-4.5 w-4.5 text-primary"})}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Pay as you go · Credit balance"})]}),o.jsxs("div",{className:"mt-3 text-4xl font-bold tracking-tight text-foreground sm:text-5xl",children:["$",((t==null?void 0:t.balance)??0).toFixed(2)]}),o.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:["Calls are billed at $",v.toFixed(2)," per minute. No subscription or monthly fee."]}),r&&o.jsxs("div",{className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-3 py-1 text-xs font-medium text-primary",children:[o.jsx(Mi,{className:"h-3.5 w-3.5"})," Welcome credit included"]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap xl:shrink-0",children:[o.jsxs(ne,{className:"w-full sm:w-auto",onClick:()=>d(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Add to credit balance"]}),o.jsxs(ne,{variant:"outline",className:"w-full sm:w-auto",onClick:()=>h(!0),children:[o.jsx($u,{className:"mr-2 h-4 w-4"})," Auto recharge settings"]})]})]})}),g?o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card px-5 py-4 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-success/15",children:o.jsx(tr,{className:"h-4 w-4 text-success"})}
866),o.jsxs("span",{className:"text-foreground",children:["Auto recharge is ",o.jsx("span",{className:"font-semibold",children:"on"}),". When your balance falls below"," ",o.jsxs("span",{className:"font-medium",children:["$",((t==null?void 0:t.auto_recharge_threshold)??0).toFixed(2)]}),", we'll automatically add"," ",o.jsxs("span",{className:"font-medium",children:["$",((t==null?void 0:t.auto_recharge_amount)??0).toFixed(2)]})," using your default card."]})]}),o.jsx(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Change"})]}):o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-yellow-500/30 bg-yellow-500/[0.06] px-5 py-4 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-yellow-500/15",children:o.jsx(co,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"})}),o.jsxs("span",{className:"text-foreground",children:[o.jsx("span",{className:"font-semibold",children:"Auto recharge is off."})," ",o.jsx("span",{className:"text-muted-foreground",children:"When your credit balance reaches $0, your calls will stop working. Enable automatic recharge to keep your balance topped up."})]})]}),o.jsx(ne,{size:"sm",onClick:()=>h(!0),children:"Enable auto recharge"})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 transition-colors hover:border-border/80",children:[o.jsx("div",{className:"mb-3 flex h-9 w-9 items-center justify-center rounded-lg bg-green-500/10",children:o.jsx(q2,{className:"h-4.5 w-4.5 text-green-500"})}),o.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Total Charges"}),o.jsxs("div",{className:"mt-1 text-2xl font-bold text-foreground",children:["$",((y=t==null?void 0:t.total_charges)==null?void 0:y.toFixed(2))||"0.00"]}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"This billing period"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 transition-colors hover:border-border/80",children:[o.jsx("div",{className:"mb-3 flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/10",children:o.jsx(Bre,{className:"h-4.5 w-4.5 text-blue-500"})}),o.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Total Call Time"}),o.jsxs("div",{className:"mt-1 text-2xl font-bold text-foreground",children:[s.toFixed(1)," min"]}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Across all calls"})]}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5 transition-colors hover:border-border/80",children:[o.jsx("div",{className:"mb-3 flex h-9 w-9 items-center justify-center rounded-lg bg-purple-500/10",children:o.jsx(aw,{className:"h-4.5 w-4.5 text-purple-500"})}),o.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Est. Rate Per Minute"}),o.jsxs("div",{className:"mt-1 text-2xl font-bold text-foreground",children:["$",v.toFixed(2)]}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Estimated: each call is billed by its actual cost"})]})]}),o.jsx(hbe,{open:u,onOpenChange:d}),o.jsx(mbe,{open:f,onOpenChange:h,billing:t,onSaved:m})]})},ZS=[{key:"created_at",label:"Date"},{key:"kind",label:"Type"},{key:"description",label:"Description"},{key:"amount",label:"Amount"},{key:"balance_after",label:"Balance After"}];function eN(e,t){return t==="kind"?qC[e.kind]||e.kind:t==="description"?e.description||"":t==="amount"?String(e.amount):t==="balance_after"?e.balance_after!=null?String(e.balance_after):"":e.created_at}const gbe=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(!0),[a,s]=p.useState(null),[i,l]=p.useState("asc"),[c,u]=p.useState({created_at:"",kind:"",description:"",amount:"",balance_after:""}),[d,f]=p.useState(void 0),[h,m]=p.useState(1),[v,g]=p.useState(10);p.useEffect(()=>{ee.getWalletTransactions().then(({data:k})=>{Array.isArray(k)&&t(k),r(!1)})},[]);const y=k=>{if(a!==k){s(k),l("asc");return}if(i==="asc"){l("desc");return}s(null)},x=(k,P)=>u(O=>({...O,[k]:P})),b=p.useMemo(()=>{const k=new Set(e.map(P=>
866P.kind).filter(Boolean));return Array.from(k).sort()},[e]),w=p.useMemo(()=>e.filter(k=>ZS.every(({key:P})=>{if(P==="created_at"){if(!d)return!0;const $=k.created_at?new Date(k.created_at):null;return!!$&&!isNaN($.getTime())&&Jn($,d)}if(P==="kind")return c.kind?k.kind===c.kind:!0;const O=c[P].trim().toLowerCase();return!O||eN(k,P).toLowerCase().includes(O)})),[e,c,d]),N=p.useMemo(()=>a?[...w].sort((k,P)=>{if(a==="amount"||a==="balance_after"){const T=a==="amount"?k.amount:k.balance_after??0,z=a==="amount"?P.amount:P.balance_after??0;return i==="asc"?T-z:z-T}if(a==="created_at"){const T=new Date(k.created_at).getTime(),z=new Date(P.created_at).getTime();return i==="asc"?T-z:z-T}const O=eN(k,a).toLowerCase(),$=eN(P,a).toLowerCase();return O<$?i==="asc"?-1:1:O>$?i==="asc"?1:-1:0}):w,[w,a,i]);p.useEffect(()=>{m(1)},[c,d,a,i,v]);const S=Math.max(1,Math.ceil(N.length/v));p.useEffect(()=>{h>S&&m(S)},[h,S]);const _=p.useMemo(()=>N.slice((h-1)*v,h*v),[N,h,v]);return n?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading transactions..."]}):e.length===0?o.jsx("div",{className:"rounded-xl border border-border bg-card p-8 text-center text-sm text-muted-foreground",children:"No transactions yet."}):o.jsxs("div",{children:[o.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"Purchase History"}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:ZS.map(({key:k,label:P})=>o.jsx("th",{className:"px-4 py-3 text-center",children:o.jsx(cn,{label:P,active:a===k,dir:i,onClick:()=>y(k)})},k))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:ZS.map(({key:k,label:P})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:k==="created_at"?o.jsx(Tf,{value:d,onChange:f}):k==="kind"?o.jsx(Tn,{value:c.kind,onChange:O=>x("kind",O),placeholder:"Type",options:b.map(O=>({value:O,label:qC[O]||O}))}):o.jsx(pn,{value:c[k],onChange:O=>x(k,O),placeholder:P})},k))})]}),o.jsx("tbody",{children:_.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No transactions match your filters."})}):_.map(k=>{const P=k.amount>=0;return o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:[new Date(k.created_at).toLocaleDateString()," ",o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleTimeString()})]}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:"outline",className:"whitespace-nowrap",children:qC[k.kind]||k.kind})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:k.description||"—"}),o.jsxs("td",{className:`px-4 py-3 text-center font-medium ${P?"text-green-500":"text-destructive"}`,children:[P?"+":"-","$",Math.abs(k.amount).toFixed(2)]}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:k.balance_after!=null?`$${k.balance_after.toFixed(2)}`:"—"})]},k.id)})})]})}),o.jsx(dr,{page:h,pageSize:v,totalCount:N.length,onPageChange:m,onPageSizeChange:g})]})]})},tN=[{key:"created_at",label:"Date"},{key:"contact",label:"Contact"},{key:"direction",label:"Direction"},{key:"duration_seconds",label:"Duration"},{key:"call_cost",label:"Cost"},{key:"status",label:"Status"}];function nN(e,t){return t==="contact"?e.contact_name||e.phone||"Unknown":t==="duration_seconds"?bq(e.duration_seconds):t==="call_cost"?String(e.call_cost):t==="created_at"?e.created_at:e[t]||""}const vbe=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(0),[a,s]=p.useState(0),[i,l]=p.useState(!0),[c,u]=p.useState(null),[d,f]=p.useState("asc"),[h,m]=p.useState({created_at:"",contact:"",direction:"",duration_seconds:"",call_cost:"",status:""}),[v,g]=p.useState(void 0),[y,x]=p.useState(1),[b,w]=p.useState(10);p.useEffect(()=>{ee.getBillingCallCosts().then(({data:z})=>{z&&(t(z.calls||[]),r(z.total_cost||0),s(z.total_minutes||0)),l(!1)})},[]);const N=z=>{if(c!==z){u(z),f("asc");return}if(d==="asc"){f("desc");return}u(null)},S=(z,U)=>m(E=>({...E,[z]:U})),_=p.useMemo(()=>{const z=new Set(e.map(U=>
866U.direction).filter(Boolean));return Array.from(z).sort()},[e]),k=p.useMemo(()=>{const z=new Set(e.map(U=>U.status).filter(Boolean));return Array.from(z).sort()},[e]),P=p.useMemo(()=>e.filter(z=>tN.every(({key:U})=>{if(U==="created_at"){if(!v)return!0;const q=z.created_at?new Date(z.created_at):null;return!!q&&!isNaN(q.getTime())&&Jn(q,v)}if(U==="direction")return h.direction?z.direction===h.direction:!0;if(U==="status")return h.status?z.status===h.status:!0;const E=h[U].trim().toLowerCase();return!E||nN(z,U).toLowerCase().includes(E)})),[e,h,v]),O=p.useMemo(()=>c?[...P].sort((z,U)=>{if(c==="call_cost"||c==="duration_seconds"){const W=c==="call_cost"?z.call_cost:z.duration_seconds,L=c==="call_cost"?U.call_cost:U.duration_seconds;return d==="asc"?W-L:L-W}if(c==="created_at"){const W=new Date(z.created_at).getTime(),L=new Date(U.created_at).getTime();return d==="asc"?W-L:L-W}const E=nN(z,c).toLowerCase(),q=nN(U,c).toLowerCase();return E<q?d==="asc"?-1:1:E>q?d==="asc"?1:-1:0}):P,[P,c,d]);p.useEffect(()=>{x(1)},[h,v,c,d,b]);const $=Math.max(1,Math.ceil(O.length/b));p.useEffect(()=>{y>$&&x($)},[y,$]);const T=p.useMemo(()=>O.slice((y-1)*b,y*b),[O,y,b]);return i?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading call costs..."]}):e.length===0?o.jsx("div",{className:"rounded-xl border border-border bg-card p-8 text-center text-sm text-muted-foreground",children:"No calls yet."}):o.jsxs("div",{children:[o.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"Call Cost Breakdown"}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:tN.map(({key:z,label:U})=>o.jsx("th",{className:"px-4 py-3 text-center",children:o.jsx(cn,{label:U,active:c===z,dir:d,onClick:()=>N(z)})},z))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:tN.map(({key:z,label:U})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:z==="created_at"?o.jsx(Tf,{value:v,onChange:g}):z==="direction"?o.jsx(Tn,{value:h.direction,onChange:E=>S("direction",E),placeholder:"Direction",options:_.map(E=>({value:E,label:E}))}):z==="status"?o.jsx(Tn,{value:h.status,onChange:E=>S("status",E),placeholder:"Status",options:k.map(E=>({value:E,label:E}))}):o.jsx(pn,{value:h[z],onChange:E=>S(z,E),placeholder:U})},z))})]}),o.jsxs("tbody",{children:[T.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:"No calls match your filters."})}):T.map(z=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:[new Date(z.created_at).toLocaleDateString()," ",o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(z.created_at).toLocaleTimeString()})]}),o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:z.contact_name||z.phone||"Unknown"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:"outline",className:"whitespace-nowrap capitalize",children:z.direction})}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:bq(z.duration_seconds)}),o.jsxs("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:["$",(z.call_cost||0).toFixed(4)]}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:z.status==="Completed"?"default":"secondary",className:"whitespace-nowrap",children:z.status})})]},z.id)),o.jsxs("tr",{className:"divide-x divide-border border-t-2 border-border bg-muted/30 font-semibold",children:[o.jsx("td",{className:"px-4 py-3 text-center text-foreground",colSpan:3,children:"Total"}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:[a.toFixed(1)," min"]}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:["$",n.toFixed(2)]}),o.jsx("td",{})]})]})]})}),o.jsx(dr,{page:y,pageSize:b,totalCount:O.length,onPageChange:x,onPageSizeChange:w})]})]})};var wq={exports:{}},ybe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xbe=ybe,bbe=xbe;function jq(){}function Sq(){}Sq.resetWarningCache=jq;var wbe=function(){function e(r,a,s,i,l,c){if(c!==bbe){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
866:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Sq,resetWarningCache:jq};return n.PropTypes=n,n};wq.exports=wbe();var jbe=wq.exports;const Ve=Dt(jbe);function BD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sbe(e){if(Array.isArray(e))return e}function Nq(e,t,n){return(t=Abe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nbe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function _be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
867In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function UD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(n),!0).forEach(function(r){Nq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cbe(e,t){if(e==null)return{};var n,r,a=kbe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function kbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _q(e,t){return Sbe(e)||Nbe(e,t)||Pbe(e,t)||_be()}function Ebe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Abe(e){var t=Ebe(e,"string");return typeof t=="symbol"?t:t+""}function HC(e){"@babel/helpers - typeof";return HC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HC(e)}function Pbe(e,t){if(e){if(typeof e=="string")return BD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?BD(e,t):void 0}}var jr=function(t,n,r){var a=!!r,s=H.useRef(r);H.useEffect(function(){s.current=r},[r]),H.useEffect(function(){if(!a||!t)return function(){};var i=function(){if(s.current)return s.current.apply(s,arguments)};return t.on(n,i),function(){t.off(n,i)}},[a,n,t,s])},GC=function(t){var n=H.useRef(t);return H.useEffect(function(){n.current=t},[t]),n.current},Of=function(t){return t!==null&&HC(t)==="object"},Tbe=function(t){return Of(t)&&typeof t.then=="function"},Obe=function(t){return Of(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},VD="[object Object]",Mbe=function e(t,n){if(!Of(t)||!Of(n))return t===n;var r=Array.isArray(t),a=Array.isArray(n);if(r!==a)return!1;var s=Object.prototype.toString.call(t)===VD,i=Object.prototype.toString.call(n)===VD;if(s!==i)return!1;if(!s&&!r)return t===n;var l=Object.keys(t),c=Object.keys(n);if(l.length!==c.length)return!1;for(var u={},d=0;d<l.length;d+=1)u[l[d]]=!0;for(var f=0;f<c.length;f+=1)u[c[f]]=!0;var h=Object.keys(u);if(h.length!==l.length)return!1;var m=t,v=n,g=function(x){return e(m[x],v[x])};return h.every(g)},Cq=function(t,n,r){return Of(t)?Object.keys(t).reduce(function(a,s){var i=!Of(n)||!Mbe(t[s],n[s]);return r.includes(s)?(i&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),a):i?UD(UD({},a||{}),{},Nq({},s,t[s])):a},null):null},kq="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",WD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kq;if(t===null||Obe(t))return t;throw new Error(n)},Ibe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kq;if(Tbe(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return WD(a,n)})};var r=WD(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},$be=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"6.8.0"}),t.registerAppInfo({name:"react-stripe-js",version:"6.8.0",url:"https://stripe.com/docs/stripe-js/react"}))},d1=H.createContext(null);d1.displayName="ElementsContext";var Eq=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t},Aq=function(t){var n=t.stripe,r=t.options,a=t.children,s=H.useMemo(function(){return Ibe(n)},[n]),i=H.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(r):null}}),l=_q(i,2),c=l[0],u=l[1];H.useEffect(function(){var h=!0,m=function(g){u(function(y){return y.stripe?y:{stripe:g,elements:g.elements(r)}})};return s.tag==="async"&&!c.stripe?s.stripePromise.then(function(v){v&&h&&m(v)}):s.tag==="sync"&&!c.stripe&&m(s.stripe),function(){h=!1}},[s,c,r]);var d=GC(n);H.useEffect(function(){d!==null&&d!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[d,n]);var f=GC(r);return H.useEffect(function(){if(c.elements){var h=Cq(r,f,["clientSecret","fonts"]);h&&c.elements.update(h)}},[r,f,c.elements]),H.useEffect(function(){$be(c.stripe)},[c.stripe]),H.createElement(d1.Provider,{value:c},a)};Aq.propTypes={stripe:Ve.any,options:Ve.object};var Dbe=function(t){var n=H.useContext(d1);return Eq(n,t)},Rbe=function(){var t=Dbe("calls useElements()"),n=t.elements;return n};Ve.func.isRequired;var Pq=H.createContext(null);Pq.displayName="CheckoutContext";var YC=function(t){var n=H.useContext(Pq),r=H.useContext(d1);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both a checkout provider and <Elements> provider."));return n}else return Eq(r,t)},Lbe=["mode"],Fbe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},xn=function(t,n,r){var a="".concat(Fbe(t),"Element"),s=function(u){var d=u.id,f=u.className,h=u.options,m=h===void 0?{}
vendor: 6,250 bytes, line 867
867:h,v=u.onBlur,g=u.onFocus,y=u.onReady,x=u.onChange,b=u.onEscape,w=u.onClick,N=u.onLoadError,S=u.onLoaderStart,_=u.onNetworksChange,k=u.onConfirm,P=u.onCancel,O=u.onShippingAddressChange,$=u.onShippingRateChange,T=u.onSavedPaymentMethodRemove,z=u.onSavedPaymentMethodUpdate,U=u.onAvailablePaymentMethodsChange,E=YC("mounts <".concat(a,">")),q="elements"in E?E.elements:null,W="checkoutState"in E?E.checkoutState:null,L=(W==null?void 0:W.type)==="success"||(W==null?void 0:W.type)==="loading"?W.sdk:null,M=H.useState(null),B=_q(M,2),I=B[0],R=B[1],F=H.useRef(null),j=H.useRef(null);jr(I,"blur",v),jr(I,"focus",g),jr(I,"escape",b),jr(I,"click",w),jr(I,"loaderror",N),jr(I,"loaderstart",S),jr(I,"networkschange",_),jr(I,"confirm",k),jr(I,"cancel",P),jr(I,"shippingaddresschange",O),jr(I,"shippingratechange",$),jr(I,"savedpaymentmethodremove",T),jr(I,"savedpaymentmethodupdate",z),jr(I,"availablepaymentmethodschange",U),jr(I,"change",x);var C;y&&(t==="expressCheckout"?C=y:C=function(){y(I)}),jr(I,"ready",C),H.useLayoutEffect(function(){if(F.current===null&&j.current!==null&&(q||L)){var D=null;if(L){var V=L,Y=L;switch(t){case"paymentForm":D=Y.createForm(m);break;case"payment":D=V.createPaymentElement(m);break;case"address":if("mode"in m){var G=m.mode,K=Cbe(m,Lbe);if(G==="shipping")D=V.createShippingAddressElement(K);else if(G==="billing")D=V.createBillingAddressElement(K);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":D=V.createExpressCheckoutElement(m);break;case"currencySelector":D=L.createCurrencySelectorElement();break;case"taxId":D=V.createTaxIdElement(m);break;case"contactDetails":D=V.createContactDetailsElement();break;case"terms":D=V.createTermsElement(m);break;default:throw new Error("<".concat(a,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else q&&(D=q.create(t,m));F.current=D,R(D),D&&D.mount(j.current)}},[q,L,m]);var A=GC(m);return H.useEffect(function(){if(F.current){var D=Cq(m,A,["paymentRequest"]);D&&"update"in F.current&&F.current.update(D)}},[m,A]),H.useLayoutEffect(function(){return function(){if(F.current&&typeof F.current.destroy=="function")try{F.current.destroy(),F.current=null}catch{}}},[]),H.createElement("div",{id:d,className:f,ref:j})},i=function(u){YC("mounts <".concat(a,">"));var d=u.id,f=u.className;return H.createElement("div",{id:d,className:f})},l=n?i:s;return l.propTypes={id:Ve.string,className:Ve.string,onChange:Ve.func,onBlur:Ve.func,onFocus:Ve.func,onReady:Ve.func,onEscape:Ve.func,onClick:Ve.func,onLoadError:Ve.func,onLoaderStart:Ve.func,onNetworksChange:Ve.func,onConfirm:Ve.func,onCancel:Ve.func,onShippingAddressChange:Ve.func,onShippingRateChange:Ve.func,onSavedPaymentMethodRemove:Ve.func,onSavedPaymentMethodUpdate:Ve.func,onAvailablePaymentMethodsChange:Ve.func,options:Ve.object},l.displayName=a,l.__elementType=t,l},bn=typeof window>"u",Bbe=H.createContext(null);Bbe.displayName="EmbeddedCheckoutProviderContext";var zbe=function(){var t=YC("calls useStripe()"),n=t.stripe;return n};xn("auBankAccount",bn);xn("card",bn);xn("cardNumber",bn);xn("cardExpiry",bn);xn("cardCvc",bn);xn("currencySelector",bn);xn("iban",bn);var Ube=xn("payment",bn);xn("expressCheckout",bn);xn("paymentRequestButton",bn);xn("linkAuthentication",bn);xn("contactDetails",bn);xn("address",bn);xn("shippingAddress",bn);xn("paymentMethodMessaging",bn);xn("taxId",bn);xn("issuingCardNumberDisplay",bn);xn("issuingCardCvcDisplay",bn);xn("issuingCardExpiryDisplay",bn);xn("issuingCardPinDisplay",bn);xn("issuingCardCopyButton",bn);xn("terms",bn);function gx(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gx=function(t){return typeof t}:gx=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gx(e)}var Tq="dahlia",Vbe=function(t){return t===3?"v3":t},Oq="https://js.stripe.com",Wbe="".concat(Oq,"/").concat(Tq,"/stripe.js"),qbe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Hbe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,qD="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Gbe=function(t){return qbe.test(t)||Hbe.test(t)},Ybe=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Oq,'"]')),n=0;n<t.length;n++){var r=t[n];if(Gbe(r.src))return r}return null},HD=function(t){var n="",r=document.createElement("script");r.src="".concat(Wbe).concat(n);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(r),r},Kbe=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.12.1",startTime:n})},am=null,yy=null,xy=null,Xbe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Jbe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Qbe=function(t){return am!==null?am:(am=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(qD),window.Stripe){n(window.Stripe);return}try{var a=Ybe();if(a&&t)console.warn(qD);else if(!a)a=HD(t);else if(a&&xy!==null&&yy!==null){var s;a.removeEventListener("load",xy),a.removeEventListener("error",yy),(s=a.parentNode)===null||s===void 0||s.removeChild(a),a=HD(t)}xy=Jbe(n,r),yy=Xbe(r),a.addEventListener("load",xy),a.addEventListener("error",yy)}catch(i){r(i);return}}),am.catch(function(n){return am=null,Promise.reject(n)}))},Zbe=function(t,n,r){if(t===null)return null;var a=n[0];if(typeof a!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(gx(a)," instead."));var s=a.match(/^pk_test/),i=Vbe(t.version),l=Tq;s&&i!==l&&console.warn("Stripe.js@".concat(i," was loaded on the page, but @stripe/stripe-js@").concat("9.12.1"," expected Stripe.js@").concat(l,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var c=t.apply(void 0,n);return Kbe(c,r),c}
867,om,Mq=!1,Iq=function(){return om||(om=Qbe(null).catch(function(t){return om=null,Promise.reject(t)}),om)};Promise.resolve().then(function(){return Iq()}).catch(function(e){Mq||console.warn(e)});var e0e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];Mq=!0;var a=Date.now();return Iq().then(function(s){return Zbe(s,n,a)})};const rN=new Map;function t0e(e){return rN.has(e)||rN.set(e,e0e(e)),rN.get(e)}function n0e({onDone:e,onCancel:t}){const n=zbe(),r=Rbe(),[a,s]=p.useState(!1),[i,l]=p.useState(null),c=async u=>{if(u.preventDefault(),!n||!r)return;s(!0);const{error:d}=await n.confirmSetup({elements:r,confirmParams:{return_url:`${window.location.origin}/dashboard/billing/payment-methods`},redirect:"if_required"});if(s(!1),d)return X.error(d.message||"Could not save that card");X.success("Card saved"),e()};return o.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i?o.jsxs("div",{className:"rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[o.jsx("p",{className:"font-medium",children:"The card form couldn't load."}),o.jsx("p",{className:"mt-1 text-xs",children:i}),o.jsx("p",{className:"mt-2 text-xs",children:"This usually means the Stripe publishable key doesn't match the secret key's mode (test vs live). Ask an administrator to check the Stripe keys."})]}):o.jsx(Ube,{options:{wallets:{link:"never"}},onLoadError:u=>{var d;return l(((d=u==null?void 0:u.error)==null?void 0:d.message)||"Stripe could not initialise the payment form.")}}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{type:"button",variant:"outline",onClick:t,disabled:a,children:"Cancel"}),o.jsx(ne,{type:"submit",disabled:a||!n||!!i,children:a?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Saving…"]}):"Save card"})]})]})}function r0e({open:e,onOpenChange:t,onAdded:n}){const{resolvedTheme:r}=ew(),[a,s]=p.useState(null),[i,l]=p.useState(null),[c,u]=p.useState(null);p.useEffect(()=>{if(!e){l(null),u(null);return}let f=!0;return(async()=>{var g,y;const[h,m]=await Promise.all([ee.getStripeConfig(),ee.createSetupIntent()]);if(!f)return;const v=(g=h.data)==null?void 0:g.publishable_key;if(!v){u("Card payments aren't configured yet. Ask an administrator to add a Stripe publishable key.");return}if(m.error||!((y=m.data)!=null&&y.client_secret)){u(m.error||"Could not start card setup");return}s(v),l(m.data.client_secret)})(),()=>{f=!1}},[e]);const d=p.useMemo(()=>a?t0e(a):null,[a]);return o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Add payment method"}),o.jsx(wt,{children:"Your card is stored securely by Stripe and never touches our servers."})]}),c?o.jsx("p",{className:"py-4 text-sm text-destructive",children:c}):!i||!d?o.jsxs("div",{className:"flex items-center justify-center py-10 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Preparing secure form…"]}):o.jsx(Aq,{stripe:d,options:{clientSecret:i,appearance:{theme:r==="dark"?"night":"stripe"}},children:o.jsx(n0e,{onDone:()=>{t(!1),n()},onCancel:()=>t(!1)})},i)]})})}const a0e=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(!0),[a,s]=p.useState(!1),[i,l]=p.useState(null),[c,u]=p.useState(null),d=p.useCallback(async()=>{const{data:m,error:v}=await ee.getPaymentMethods();v&&X.error(v),Array.isArray(m)&&t(m),r(!1)},[]);p.useEffect(()=>{d()},[d]);const f=async m=>{u(m.id);const{error:v}=await ee.setDefaultPaymentMethod(m.id);if(u(null),v)return X.error(v);X.success(`${m.brand} •••• ${m.last4} is now your default`),d()},h=async()=>{if(!i)return;const m=i;l(null),u(m.id);const{error:v}=await ee.deletePaymentMethod(m.id);if(u(null),v)return X.error(v);X.success("Payment method removed"),d()};return n?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading payment methods…"]}):o.jsxs("div",{className:"space-y-6",children:[e.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-card/40 py-14 text-center",children:[o.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:o.jsx(uu,{className:"h-6 w-6 text-muted-foreground"})}),o.jsx("h3",{className:"font-semibold text-foreground",children:"No payment methods yet"}),o.jsx("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:"Add a card to top up your balance faster and to enable auto recharge."}),o.jsxs(ne,{className:"mt-4",onClick:()=>s(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Add payment method"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:e.map(m=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(uu,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-foreground",children:[m.brand," •••• ",m.last4]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Expires ",String(m.exp_month).padStart(2,"0"),"/",m.exp_year]})]})]}),m.is_default&&o.jsx(_n,{children:"Default"})]}),o.jsxs("div",{className:"mt-4 flex items-center gap-2 border-t border-border pt-3",children:[!m.is_default&&o.jsxs(ne,{size:"sm",variant:"outline",onClick:()=>f(m),disabled:c===m.id,children:[o.jsx(h8,{className:"mr-1 h-3.5 w-3.5"})," Set as default"]}),o.jsx(ne,{size:"sm",variant:"ghost",className:"ml-auto text-destructive hover:text-destructive",onClick:()=>l(m),disabled:c===m.id,children:c===m.id?o.jsx(Te,{className:"h-4 w-4 animate-spin"}):o.jsxs(o.Fragment,{children:[o.jsx(Oa,{className:"mr-1 h-3.5 w-3.5"})," Remove"]})})]})]},m.id))}),o.jsxs(ne,{variant:"outline",onClick:()=>s(!0),children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Add payment method"]})]}),o.jsx(r0e,{open:a,onOpenChange:s,onAdded:d}),o.jsx(Is,{open:!!i,onOpenChange:m=>{m||l(null)},children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsx(Jo,{children:"Remove this payment method?"}),o.jsxs(Qo,{children:[i&&`${i.brand} •••• ${i.last4} will be removed from your account. `,"You can add it again later."]})]}),o.jsxs(Xo,{children:[o.jsx(es,{children:"Cancel"}),o.jsx(Zo,{onClick:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})},o0e=()=>{const[e,t]=p.useState(""),[n,r]=p.useState(!1),[a,s]=p.useState([]),[i,l]=p.useState(!0),c=p.useCallback(async()=>{const{data:d}=await ee.getPromotions();Array.isArray(d)&&s(d),l(!1)},[]);p.useEffect(()=>{c()},[c]);const u=async d=>{d.preventDefault();const f=e.trim();if(!f)return X.error("Enter a promotion code");r(!0);const{data:h,error:m}=await ee.redeemPromoCode(f);if(r(!1),m)return X.error(m);X.success(`$${((h==null?void 0:h.amount)??0).toFixed(2)} credit added to your balance.`),t(""),c()};return o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Add a promotional credit"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Enter a promotional code to receive credits on your account."}),o.jsxs("form",{onSubmit:u,className:"mt-4 flex max-w-xl gap-2",children:[o.jsx(ve,{placeholder:"Enter code",value:e,onCh
vendor: 7,045 bytes, line 867
867ange:d=>t(d.target.value.toUpperCase()),autoComplete:"off",spellCheck:!1,className:"min-w-0"}),o.jsx(ne,{type:"submit",disabled:n||!e.trim(),children:n?o.jsxs(o.Fragment,{children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Applying…"]}):"Apply"})]})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Applied promotions"}),i?o.jsxs("div",{className:"flex items-center justify-center py-14 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading…"]}):a.length===0?o.jsxs("div",{className:"mt-4 rounded-xl border border-dashed border-border bg-card/40 py-14 text-center",children:[o.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:o.jsx(Lre,{className:"h-6 w-6 text-muted-foreground"})}),o.jsx("h3",{className:"font-semibold text-foreground",children:"You haven't applied any promotions yet"}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Applied promotions will appear here"})]}):o.jsx("div",{className:"mt-4 overflow-hidden rounded-xl border border-border",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Code"}),o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Credit"}),o.jsx("th",{className:"px-3 py-3 sm:px-4",children:"Applied"})]})}),o.jsx("tbody",{children:a.map(d=>o.jsxs("tr",{className:"border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-3 py-3 sm:px-4 font-medium text-foreground",children:d.code}),o.jsxs("td",{className:"px-3 py-3 sm:px-4 font-medium text-green-500",children:["+$",d.amount.toFixed(2)]}),o.jsx("td",{className:"px-3 py-3 sm:px-4 text-muted-foreground",children:new Date(d.created_at).toLocaleDateString()})]},d.id))})]})})})]})]})};var s0e=Array.isArray,ha=s0e,i0e=typeof xd=="object"&&xd&&xd.Object===Object&&xd,$q=i0e,l0e=$q,c0e=typeof self=="object"&&self&&self.Object===Object&&self,u0e=l0e||c0e||Function("return this")(),zs=u0e,d0e=zs,f0e=d0e.Symbol,tv=f0e,GD=tv,Dq=Object.prototype,h0e=Dq.hasOwnProperty,m0e=Dq.toString,sm=GD?GD.toStringTag:void 0;function p0e(e){var t=h0e.call(e,sm),n=e[sm];try{e[sm]=void 0;var r=!0}catch{}var a=m0e.call(e);return r&&(t?e[sm]=n:delete e[sm]),a}var g0e=p0e,v0e=Object.prototype,y0e=v0e.toString;function x0e(e){return y0e.call(e)}var b0e=x0e,YD=tv,w0e=g0e,j0e=b0e,S0e="[object Null]",N0e="[object Undefined]",KD=YD?YD.toStringTag:void 0;function _0e(e){return e==null?e===void 0?N0e:S0e:KD&&KD in Object(e)?w0e(e):j0e(e)}var Yi=_0e;function C0e(e){return e!=null&&typeof e=="object"}var Ki=C0e,k0e=Yi,E0e=Ki,A0e="[object Symbol]";function P0e(e){return typeof e=="symbol"||E0e(e)&&k0e(e)==A0e}var Nh=P0e,T0e=ha,O0e=Nh,M0e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,I0e=/^\w*$/;function $0e(e,t){if(T0e(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||O0e(e)?!0:I0e.test(e)||!M0e.test(e)||t!=null&&e in Object(t)}var jP=$0e;function D0e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var uc=D0e;const _h=Dt(uc);var R0e=Yi,L0e=uc,F0e="[object AsyncFunction]",B0e="[object Function]",z0e="[object GeneratorFunction]",U0e="[object Proxy]";function V0e(e){if(!L0e(e))return!1;var t=R0e(e);return t==B0e||t==z0e||t==F0e||t==U0e}var SP=V0e;const ot=Dt(SP);var W0e=zs,q0e=W0e["__core-js_shared__"],H0e=q0e,aN=H0e,XD=function(){var e=/[^.]+$/.exec(aN&&aN.keys&&aN.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function G0e(e){return!!XD&&XD in e}var Y0e=G0e,K0e=Function.prototype,X0e=K0e.toString;function J0e(e){if(e!=null){try{return X0e.call(e)}catch{}try{return e+""}catch{}}return""}var Rq=J0e,Q0e=SP,Z0e=Y0e,ewe=uc,twe=Rq,nwe=/[\\^$.*+?()[\]{}|]/g,rwe=/^\[object .+?Constructor\]$/,awe=Function.prototype,owe=Object.prototype,swe=awe.toString,iwe=owe.hasOwnProperty,lwe=RegExp("^"+swe.call(iwe).replace(nwe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cwe(e){if(!ewe(e)||Z0e(e))return!1;var t=Q0e(e)?lwe:rwe;return t.test(twe(e))}var uwe=cwe;function dwe(e,t){return e==null?void 0:e[t]}var fwe=dwe,hwe=uwe,mwe=fwe;function pwe(e,t){var n=mwe(e,t);return hwe(n)?n:void 0}var Wu=pwe,gwe=Wu,vwe=gwe(Object,"create"),f1=vwe,JD=f1;function ywe(){this.__data__=JD?JD(null):{},this.size=0}var xwe=ywe;function bwe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var wwe=bwe,jwe=f1,Swe="__lodash_hash_undefined__",Nwe=Object.prototype,_we=Nwe.hasOwnProperty;function Cwe(e){var t=this.__data__;if(jwe){var n=t[e];return n===Swe?void 0:n}return _we.call(t,e)?t[e]:void 0}var kwe=Cwe,Ewe=f1,Awe=Object.prototype,Pwe=Awe.hasOwnProperty;function Twe(e){var t=this.__data__;return Ewe?t[e]!==void 0:Pwe.call(t,e)}var Owe=Twe,Mwe=f1,Iwe="__lodash_hash_undefined__";function $we(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mwe&&t===void 0?Iwe:t,this}var Dwe=$we,Rwe=xwe,Lwe=wwe,Fwe=kwe,Bwe=Owe,zwe=Dwe;function Ch(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ch.prototype.clear=Rwe;Ch.prototype.delete=Lwe;Ch.prototype.get=Fwe;Ch.prototype.has=Bwe;Ch.prototype.set=zwe;var Uwe=Ch;function Vwe(){this.__data__=[],this.size=0}var Wwe=Vwe;function qwe(e,t){return e===t||e!==e&&t!==t}var NP=qwe,Hwe=NP;function Gwe(e,t){for(var n=e.length;n--;)if(Hwe(e[n][0],t))return n;return-1}var h1=Gwe,Ywe=h1,Kwe=Array.prototype,Xwe=Kwe.splice;function Jwe(e){var t=this.__data__,n=Ywe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Xwe.call(t,n,1),--this.size,!0}var Qwe=Jwe,Zwe=h1;function e1e(e){var t=this.__data__,n=Zwe(t,e);return n<0?void 0:t[n][1]}var t1e=e1e,n1e=h1;function r1e(e){return n1e(this.__data__,e)>-1}var a1e=r1e,o1e=h1;function s1e(e,t){var n=this.__data__,r=o1e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var i1e=s1e,l1e=Wwe,c1e=Qwe,u1e=t1e,d1e=a1e,f1e=i1e;function kh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kh.prototype.clear=l1e;kh.prototype.delete=c1e;kh.prototype.get=u1e;kh.prototype.has=d1e;kh.prototype.set=f1e;var m1=kh,h1e=Wu,m1e=zs,p1e=h1e(m1e,"Map"),_P=p1e,QD=Uwe,g1e=m1,v1e=_P;function y1e(){this.size=0,this.__data__={hash:new QD,map:new(v1e||g1e),string:new QD}}var x1e=y1e;function b1e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var w1e=b1e,j1e=w1e;function S1e(e,t){var n=e.__data__;return j1e(t)?n[typeof t=="string"?"string":"hash"]:n.map}var p1=S1e,N1e=p1;function _1e(e){var t=N1e(this,e).delete(e);return this.size-=t?1:0,t}var C1e=_1e,k1e=p1;function E1e(e){return k1e(this,e).get(e)}var A1e=E1e,P1e=p1;function T1e(e){return P1e(this,e).has(e)}var O1e=T1e,M1e=p1;function I1e(e,t){var n=M1e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}
867var $1e=I1e,D1e=x1e,R1e=C1e,L1e=A1e,F1e=O1e,B1e=$1e;function Eh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Eh.prototype.clear=D1e;Eh.prototype.delete=R1e;Eh.prototype.get=L1e;Eh.prototype.has=F1e;Eh.prototype.set=B1e;var CP=Eh,Lq=CP,z1e="Expected a function";function kP(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(z1e);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var i=e.apply(this,r);return n.cache=s.set(a,i)||s,i};return n.cache=new(kP.Cache||Lq),n}kP.Cache=Lq;var Fq=kP;const U1e=Dt(Fq);var V1e=Fq,W1e=500;function q1e(e){var t=V1e(e,function(r){return n.size===W1e&&n.clear(),r}),n=t.cache;return t}var H1e=q1e,G1e=H1e,Y1e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K1e=/\\(\\)?/g,X1e=G1e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Y1e,function(n,r,a,s){t.push(a?s.replace(K1e,"$1"):r||n)}),t}),J1e=X1e;function Q1e(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var EP=Q1e,ZD=tv,Z1e=EP,eje=ha,tje=Nh,nje=1/0,e4=ZD?ZD.prototype:void 0,t4=e4?e4.toString:void 0;function Bq(e){if(typeof e=="string")return e;if(eje(e))return Z1e(e,Bq)+"";if(tje(e))return t4?t4.call(e):"";var t=e+"";return t=="0"&&1/e==-nje?"-0":t}var rje=Bq,aje=rje;function oje(e){return e==null?"":aje(e)}var zq=oje,sje=ha,ije=jP,lje=J1e,cje=zq;function uje(e,t){return sje(e)?e:ije(e,t)?[e]:lje(cje(e))}var Uq=uje,dje=Nh,fje=1/0;function hje(e){if(typeof e=="string"||dje(e))return e;var t=e+"";return t=="0"&&1/e==-fje?"-0":t}var g1=hje,mje=Uq,pje=g1;function gje(e,t){t=mje(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[pje(t[n++])];return n&&n==r?e:void 0}var AP=gje,vje=AP;function yje(e,t,n){var r=e==null?void 0:vje(e,t);return r===void 0?n:r}var Vq=yje;const ro=Dt(Vq);function xje(e){return e==null}var bje=xje;const dt=Dt(bje);var wje=Yi,jje=ha,Sje=Ki,Nje="[object String]";function _je(e){return typeof e=="string"||!jje(e)&&Sje(e)&&wje(e)==Nje}var Cje=_je;const ju=Dt(Cje);var Wq={exports:{}},Rt={};/**
868 * @license React
869 * react-is.production.min.js
870 *
871 * Copyright (c) Facebook, Inc. and its affiliates.
872 *
873 * This source code is licensed under the MIT license found in the
874 * LICENSE file in the root directory of this source tree.
875 */var PP=Symbol.for("react.element"),TP=Symbol.for("react.portal"),v1=Symbol.for("react.fragment"),y1=Symbol.for("react.strict_mode"),x1=Symbol.for("react.profiler"),b1=Symbol.for("react.provider"),w1=Symbol.for("react.context"),kje=Symbol.for("react.server_context"),j1=Symbol.for("react.forward_ref"),S1=Symbol.for("react.suspense"),N1=Symbol.for("react.suspense_list"),_1=Symbol.for("react.memo"),C1=Symbol.for("react.lazy"),Eje=Symbol.for("react.offscreen"),qq;qq=Symbol.for("react.module.reference");function po(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case PP:switch(e=e.type,e){case v1:case x1:case y1:case S1:case N1:return e;default:switch(e=e&&e.$$typeof,e){case kje:case w1:case j1:case C1:case _1:case b1:return e;default:return t}}case TP:return t}}}Rt.ContextConsumer=w1;Rt.ContextProvider=b1;Rt.Element=PP;Rt.ForwardRef=j1;Rt.Fragment=v1;Rt.Lazy=C1;Rt.Memo=_1;Rt.Portal=TP;Rt.Profiler=x1;Rt.StrictMode=y1;Rt.Suspense=S1;Rt.SuspenseList=N1;Rt.isAsyncMode=function(){return!1};Rt.isConcurrentMode=function(){return!1};Rt.isContextConsumer=function(e){return po(e)===w1};Rt.isContextProvider=function(e){return po(e)===b1};Rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===PP};Rt.isForwardRef=function(e){return po(e)===j1};Rt.isFragment=function(e){return po(e)===v1};Rt.isLazy=function(e){return po(e)===C1};Rt.isMemo=function(e){return po(e)===_1};Rt.isPortal=function(e){return po(e)===TP};Rt.isProfiler=function(e){return po(e)===x1};Rt.isStrictMode=function(e){return po(e)===y1};Rt.isSuspense=function(e){return po(e)===S1};Rt.isSuspenseList=function(e){return po(e)===N1};Rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===v1||e===x1||e===y1||e===S1||e===N1||e===Eje||typeof e=="object"&&e!==null&&(e.$$typeof===C1||e.$$typeof===_1||e.$$typeof===b1||e.$$typeof===w1||e.$$typeof===j1||e.$$typeof===qq||e.getModuleId!==void 0)};Rt.typeOf=po;Wq.exports=Rt;var Aje=Wq.exports,Pje=Yi,Tje=Ki,Oje="[object Number]";function Mje(e){return typeof e=="number"||Tje(e)&&Pje(e)==Oje}var Hq=Mje;const Ije=Dt(Hq);var $je=Hq;function Dje(e){return $je(e)&&e!=+e}var Rje=Dje;const nv=Dt(Rje);var Lo=function(t){return t===0?0:t>0?1:-1},Lc=function(t){return ju(t)&&t.indexOf("%")===t.length-1},je=function(t){return Ije(t)&&!nv(t)},Lje=function(t){return dt(t)},Bn=function(t){return je(t)||ju(t)},Fje=0,rv=function(t){var n=++Fje;return"".concat(t||"").concat(n)},Su=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!je(t)&&!ju(t))return r;var s;if(Lc(t)){var i=t.indexOf("%");s=n*parseFloat(t.slice(0,i))/100}
vendor: 5,304 bytes, line 875
875else s=+t;return nv(s)&&(s=r),a&&s>n&&(s=n),s},vl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Bje=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},$o=function(t,n){return je(t)&&je(n)?function(r){return t+r*(n-t)}:function(){return n}};function Cb(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ro(r,t))===n})}var zje=function(t,n){return je(t)&&je(n)?t-n:ju(t)&&ju(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Qd(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function KC(e){"@babel/helpers - typeof";return KC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},KC(e)}var Uje=["viewBox","children"],Vje=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],n4=["points","pathLength"],oN={svg:Uje,polygon:n4,polyline:n4},OP=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
875ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],kb=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(p.isValidElement(t)&&(r=t.props),!_h(r))return null;var a={};return Object.keys(r).forEach(function(s){OP.includes(s)&&(a[s]=n||function(i){return r[s](r,i)})}),a},Wje=function(t,n,r){return function(a){return t(n,r,a),null}},Eb=function(t,n,r){if(!_h(t)||KC(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(s){var i=t[s];OP.includes(s)&&typeof i=="function"&&(a||(a={}),a[s]=Wje(i,n,r))}),a},qje=["children"],Hje=["children"];function r4(e,t){if(e==null)return{};var n=Gje(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function XC(e){"@babel/helpers - typeof";return XC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},XC(e)}var a4={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"}
vendor: 4,411 bytes, line 875
875,xi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},o4=null,sN=null,MP=function e(t){if(t===o4&&Array.isArray(sN))return sN;var n=[];return p.Children.forEach(t,function(r){dt(r)||(Aje.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),sN=n,o4=t,n};function ao(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return xi(a)}):r=[xi(t)],MP(e).forEach(function(a){var s=ro(a,"type.displayName")||ro(a,"type.name");r.indexOf(s)!==-1&&n.push(a)}),n}function Sa(e,t){var n=ao(e,t);return n&&n[0]}var s4=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!je(r)||r<=0||!je(a)||a<=0)},Yje=["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"],Kje=function(t){return t&&t.type&&ju(t.type)&&Yje.indexOf(t.type)>=0},Xje=function(t){return t&&XC(t)==="object"&&"clipDot"in t},Jje=function(t,n,r,a){var s,i=(s=oN==null?void 0:oN[a])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!ot(t)&&(a&&i.includes(n)||Vje.includes(n))||r&&OP.includes(n)},vt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(p.isValidElement(t)&&(a=t.props),!_h(a))return null;var s={};return Object.keys(a).forEach(function(i){var l;Jje((l=a)===null||l===void 0?void 0:l[i],i,n,r)&&(s[i]=a[i])}),s},JC=function e(t,n){if(t===n)return!0;var r=p.Children.count(t);if(r!==p.Children.count(n))return!1;if(r===0)return!0;if(r===1)return i4(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var s=t[a],i=n[a];if(Array.isArray(s)||Array.isArray(i)){if(!e(s,i))return!1}else if(!i4(s,i))return!1}return!0},i4=function(t,n){if(dt(t)&&dt(n))return!0;if(!dt(t)&&!dt(n)){var r=t.props||{},a=r.children,s=r4(r,qje),i=n.props||{},l=i.children,c=r4(i,Hje);return a&&l?Qd(s,c)&&JC(a,l):!a&&!l?Qd(s,c):!1}return!1},l4=function(t,n){var r=[],a={};return MP(t).forEach(function(s,i){if(Kje(s))r.push(s);else if(s){var l=xi(s.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(s,l,i);r.push(f),a[l]=!0}}}),r},Qje=function(t){var n=t&&t.type;return n&&a4[n]?a4[n]:null},Zje=function(t,n){return MP(n).indexOf(t)},eSe=["children","width","height","viewBox","className","style","title","desc"];function QC(){return QC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QC.apply(this,arguments)}function tSe(e,t){if(e==null)return{};var n=nSe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZC(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,s=e.className,i=e.style,l=e.title,c=e.desc,u=tSe(e,eSe),d=a||{width:n,height:r,x:0,y:0},f=yt("recharts-surface",s);return H.createElement("svg",QC({},vt(u,!0,"svg"),{className:f,width:n,height:r,style:i,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),H.createElement("title",null,l),H.createElement("desc",null,c),t)}var rSe=["children","className"];function ek(){return ek=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ek.apply(this,arguments)}function aSe(e,t){if(e==null)return{};var n=oSe(e,t),r,a;
875if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Cn=H.forwardRef(function(e,t){var n=e.children,r=e.className,a=aSe(e,rSe),s=yt("recharts-layer",r);return H.createElement("g",ek({className:s},vt(a,!0),{ref:t}),n)}),bi=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s]};function sSe(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s}var iSe=sSe,lSe=iSe;function cSe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:lSe(e,t,n)}var uSe=cSe,dSe="\\ud800-\\udfff",fSe="\\u0300-\\u036f",hSe="\\ufe20-\\ufe2f",mSe="\\u20d0-\\u20ff",pSe=fSe+hSe+mSe,gSe="\\ufe0e\\ufe0f",vSe="\\u200d",ySe=RegExp("["+vSe+dSe+pSe+gSe+"]");function xSe(e){return ySe.test(e)}var Gq=xSe;function bSe(e){return e.split("")}var wSe=bSe,Yq="\\ud800-\\udfff",jSe="\\u0300-\\u036f",SSe="\\ufe20-\\ufe2f",NSe="\\u20d0-\\u20ff",_Se=jSe+SSe+NSe,CSe="\\ufe0e\\ufe0f",kSe="["+Yq+"]",tk="["+_Se+"]",nk="\\ud83c[\\udffb-\\udfff]",ESe="(?:"+tk+"|"+nk+")",Kq="[^"+Yq+"]",Xq="(?:\\ud83c[\\udde6-\\uddff]){2}",Jq="[\\ud800-\\udbff][\\udc00-\\udfff]",ASe="\\u200d",Qq=ESe+"?",Zq="["+CSe+"]?",PSe="(?:"+ASe+"(?:"+[Kq,Xq,Jq].join("|")+")"+Zq+Qq+")*",TSe=Zq+Qq+PSe,OSe="(?:"+[Kq+tk+"?",tk,Xq,Jq,kSe].join("|")+")",MSe=RegExp(nk+"(?="+nk+")|"+OSe+TSe,"g");function ISe(e){return e.match(MSe)||[]}var $Se=ISe,DSe=wSe,RSe=Gq,LSe=$Se;function FSe(e){return RSe(e)?LSe(e):DSe(e)}var BSe=FSe,zSe=uSe,USe=Gq,VSe=BSe,WSe=zq;function qSe(e){return function(t){t=WSe(t);var n=USe(t)?VSe(t):void 0,r=n?n[0]:t.charAt(0),a=n?zSe(n,1).join(""):t.slice(1);return r[e]()+a}}var HSe=qSe,GSe=HSe,YSe=GSe("toUpperCase"),KSe=YSe;const k1=Dt(KSe);function Ht(e){return function(){return e}}const eH=Math.cos,Ab=Math.sin,os=Math.sqrt,Pb=Math.PI,E1=2*Pb,rk=Math.PI,ak=2*rk,Ec=1e-6,XSe=ak-Ec;function tH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function JSe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return tH;const n=10**t;return function(r){this._+=r[0];for(let a=1,s=r.length;a<s;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class QSe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?tH:JSe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,s,i){this._append`C${+t},${+n},${+r},${+a},${this._x1=+s},${this._y1=+i}`}arcTo(t,n,r,a,s){if(t=+t,n=+n,r=+r,a=+a,s=+s,s<0)throw new Error(`negative radius: ${s}`);let i=this._x1,l=this._y1,c=r-t,u=a-n,d=i-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Ec)if(!(Math.abs(f*c-u*d)>Ec)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-i,v=a-l,g=c*c+u*u,y=m*m+v*v,x=Math.sqrt(g),b=Math.sqrt(h),w=s*Math.tan((rk-Math.acos((g+h-y)/(2*x*b)))/2),N=w/b,S=w/x;Math.abs(N-1)>Ec&&this._append`L${t+N*d},${n+N*f}`,this._append`A${s},${s},0,0,${+(f*m>d*v)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,a,s,i){if(t=+t,n=+n,r=+r,i=!!i,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^i,h=i?a-s:s-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Ec||Math.abs(this._y1-d)>Ec)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%ak+ak),h>XSe?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Ec&&this._append`A${r},${r},0,${+(h>=rk)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function IP(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new QSe(t)}function $P(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nH(e){this._context=e}nH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function A1(e){return new nH(e)}function rH(e){return e[0]}function aH(e){return e[1]}function oH(e,t){var n=Ht(!0),r=null,a=A1,s=null,i=IP(l);e=typeof e=="function"?e:e===void 0?rH:Ht(e),t=typeof t=="function"?t:t===void 0?aH:Ht(t);function l(c){var u,d=(c=$P(c)).length,f,h=!1,m;
875for(r==null&&(s=a(m=i())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(f,u,c),+t(f,u,c));if(m)return s=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ht(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ht(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ht(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(s=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=s=null:s=a(r=c),l):r},l}function by(e,t,n){var r=null,a=Ht(!0),s=null,i=A1,l=null,c=IP(u);e=typeof e=="function"?e:e===void 0?rH:Ht(+e),t=typeof t=="function"?t:Ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?aH:Ht(+n);function u(f){var h,m,v,g=(f=$P(f)).length,y,x=!1,b,w=new Array(g),N=new Array(g);for(s==null&&(l=i(b=c())),h=0;h<=g;++h){if(!(h<g&&a(y=f[h],h,f))===x)if(x=!x)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=m;--v)l.point(w[v],N[v]);l.lineEnd(),l.areaEnd()}x&&(w[h]=+e(y,h,f),N[h]=+t(y,h,f),l.point(r?+r(y,h,f):w[h],n?+n(y,h,f):N[h]))}if(b)return l=null,b+""||null}function d(){return oH().defined(a).curve(i).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ht(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ht(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ht(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ht(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ht(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ht(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:Ht(!!f),u):a},u.curve=function(f){return arguments.length?(i=f,s!=null&&(l=i(s)),u):i},u.context=function(f){return arguments.length?(f==null?s=l=null:l=i(s=f),u):s},u}class sH{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function ZSe(e){return new sH(e,!0)}function eNe(e){return new sH(e,!1)}const DP={draw(e,t){const n=os(t/Pb);e.moveTo(n,0),e.arc(0,0,n,0,E1)}},tNe={draw(e,t){const n=os(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},iH=os(1/3),nNe=iH*2,rNe={draw(e,t){const n=os(t/nNe),r=n*iH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},aNe={draw(e,t){const n=os(t),r=-n/2;e.rect(r,r,n,n)}},oNe=.8908130915292852,lH=Ab(Pb/10)/Ab(7*Pb/10),sNe=Ab(E1/10)*lH,iNe=-eH(E1/10)*lH,lNe={draw(e,t){const n=os(t*oNe),r=sNe*n,a=iNe*n;e.moveTo(0,-n),e.lineTo(r,a);for(let s=1;s<5;++s){const i=E1*s/5,l=eH(i),c=Ab(i);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},iN=os(3),cNe={draw(e,t){const n=-os(t/(iN*3));e.moveTo(0,n*2),e.lineTo(-iN*n,-n),e.lineTo(iN*n,-n),e.closePath()}},Ua=-.5,Va=os(3)/2,ok=1/os(12),uNe=(ok/2+1)*3,dNe={draw(e,t){const n=os(t/uNe),r=n/2,a=n*ok,s=r,i=n*ok+n,l=-s,c=i;e.moveTo(r,a),e.lineTo(s,i),e.lineTo(l,c),e.lineTo(Ua*r-Va*a,Va*r+Ua*a),e.lineTo(Ua*s-Va*i,Va*s+Ua*i),e.lineTo(Ua*l-Va*c,Va*l+Ua*c),e.lineTo(Ua*r+Va*a,Ua*a-Va*r),e.lineTo(Ua*s+Va*i,Ua*i-Va*s),e.lineTo(Ua*l+Va*c,Ua*c-Va*l),e.closePath()}};function fNe(e,t){let n=null,r=IP(a);e=typeof e=="function"?e:Ht(e||DP),t=typeof t=="function"?t:Ht(t===void 0?64:+t);function a(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,
vendor: 6,548 bytes, line 875
875s+""||null}return a.type=function(s){return arguments.length?(e=typeof s=="function"?s:Ht(s),a):e},a.size=function(s){return arguments.length?(t=typeof s=="function"?s:Ht(+s),a):t},a.context=function(s){return arguments.length?(n=s??null,a):n},a}function Tb(){}function Ob(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function cH(e){this._context=e}cH.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:Ob(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ob(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hNe(e){return new cH(e)}function uH(e){this._context=e}uH.prototype={areaStart:Tb,areaEnd:Tb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ob(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mNe(e){return new uH(e)}function dH(e){this._context=e}dH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ob(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pNe(e){return new dH(e)}function fH(e){this._context=e}fH.prototype={areaStart:Tb,areaEnd:Tb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function gNe(e){return new fH(e)}function c4(e){return e<0?-1:1}function u4(e,t,n){var r=e._x1-e._x0,a=t-e._x1,s=(e._y1-e._y0)/(r||a<0&&-0),i=(n-e._y1)/(a||r<0&&-0),l=(s*a+i*r)/(r+a);return(c4(s)+c4(i))*Math.min(Math.abs(s),Math.abs(i),.5*Math.abs(l))||0}function d4(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function lN(e,t,n){var r=e._x0,a=e._y0,s=e._x1,i=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,a+l*t,s-l,i-l*n,s,i)}function Mb(e){this._context=e}Mb.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:lN(this,this._t0,d4(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,lN(this,d4(this,n=u4(this,e,t)),n);break;default:lN(this,this._t0,n=u4(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function hH(e){this._context=new mH(e)}(hH.prototype=Object.create(Mb.prototype)).point=function(e,t){Mb.prototype.point.call(this,t,e)};function mH(e){this._context=e}mH.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,s){this._context.bezierCurveTo(t,e,r,n,s,a)}};function vNe(e){return new Mb(e)}function yNe(e){return new hH(e)}function pH(e){this._context=e}pH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=f4(e),a=f4(t),s=0,i=1;i<n;++s,++i)this._context.bezierCurveTo(r[0][s],a[0][s],r[1][s],a[1][s],e[i],t[i]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function f4(e){var t,n=e.length-1,r,a=new Array(n),s=new Array(n),i=new Array(n);for(a[0]=0,s[0]=2,i[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,s[t]=4,i[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,s[n-1]=7,i[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/s[t-1],s[t]-=r,i[t]-=r*i[t-1];for(a[n-1]=i[n-1]/s[n-1],t=n-2;t>=0;--t)a[t]=(i[t]-a[t+1])/s[t];for(s[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function xNe(e){return new pH(e)}function P1(e,t){this._context=e,this._t=t}P1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,187 bytes, lines 875-878
875default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function bNe(e){return new P1(e,.5)}function wNe(e){return new P1(e,0)}function jNe(e){return new P1(e,1)}function Mf(e,t){if((i=e.length)>1)for(var n=1,r,a,s=e[t[0]],i,l=s.length;n<i;++n)for(a=s,s=e[t[n]],r=0;r<l;++r)s[r][1]+=s[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function sk(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function SNe(e,t){return e[t]}function NNe(e){const t=[];return t.key=e,t}function _Ne(){var e=Ht([]),t=sk,n=Mf,r=SNe;function a(s){var i=Array.from(e.apply(this,arguments),NNe),l,c=i.length,u=-1,d;for(const f of s)for(l=0,++u;l<c;++l)(i[l][u]=[0,+r(f,i[l].key,u,s)]).data=f;for(l=0,d=$P(t(i));l<c;++l)i[d[l]].index=l;return n(i,d),i}return a.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Ht(Array.from(s)),a):e},a.value=function(s){return arguments.length?(r=typeof s=="function"?s:Ht(+s),a):r},a.order=function(s){return arguments.length?(t=s==null?sk:typeof s=="function"?s:Ht(Array.from(s)),a):t},a.offset=function(s){return arguments.length?(n=s??Mf,a):n},a}function CNe(e,t){if((r=e.length)>0){for(var n,r,a=0,s=e[0].length,i;a<s;++a){for(i=n=0;n<r;++n)i+=e[n][a][1]||0;if(i)for(n=0;n<r;++n)e[n][a][1]/=i}Mf(e,t)}}function kNe(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,s=r.length;n<s;++n){for(var i=0,l=0;i<a;++i)l+=e[i][n][1]||0;r[n][1]+=r[n][0]=-l/2}Mf(e,t)}}function ENe(e,t){if(!(!((i=e.length)>0)||!((s=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,s,i;r<s;++r){for(var l=0,c=0,u=0;l<i;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,m=(f-h)/2,v=0;v<l;++v){var g=e[t[v]],y=g[r][1]||0,x=g[r-1][1]||0;m+=y-x}c+=f,u+=m*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,Mf(e,t)}}function Dp(e){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dp(e)}var ANe=["type","size","sizeType"];function ik(){return ik=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ik.apply(this,arguments)}function h4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function m4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h4(Object(n),!0).forEach(function(r){PNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PNe(e,t,n){return t=TNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TNe(e){var t=ONe(e,"string");return Dp(t)=="symbol"?t:t+""}function ONe(e,t){if(Dp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MNe(e,t){if(e==null)return{};var n=INe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function INe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var gH={symbolCircle:DP,symbolCross:tNe,symbolDiamond:rNe,symbolSquare:aNe,symbolStar:lNe,symbolTriangle:cNe,symbolWye:dNe},$Ne=Math.PI/180,DNe=function(t){var n="symbol".concat(k1(t));return gH[n]||DP},RNe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*$Ne;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},LNe=function(t,n){gH["symbol".concat(k1(t))]=n},RP=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,s=a===void 0?64:a,i=t.sizeType,l=i===void 0?"area":i,c=MNe(t,ANe),u=m4(m4({},c),{},{type:r,size:s,sizeType:l}),d=function(){var y=DNe(r),x=fNe().type(y).size(RNe(s,l,r));return x()},f=u.className,h=u.cx,m=u.cy,v=vt(u,!0);return h===+h&&m===+m&&s===+s?H.createElement("path",ik({},v,{className:yt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:d()})):null};RP.registerSymbol=LNe;function If(e){"@babel/helpers - typeof";return If=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},If(e)}function lk(){return lk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lk.apply(this,arguments)}function p4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function FNe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p4(Object(n),!0).forEach(function(r){Rp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zNe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yH(r.key),r)}}function UNe(e,t,n){return t&&zNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function VNe(e,t,n){return t=Ib(t),WNe(e,vH()?Reflect.construct(t,n||[],Ib(e).constructor):t.apply(e,n))}function WNe(e,t){if(t&&(If(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qNe(e)}function qNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vH=function(){return!!e})()}function Ib(e){return Ib=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ib(e)}function HNe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ck(e,t)}function ck(e,t){return ck=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ck(e,t)}function Rp(e,t,n){return t=yH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yH(e){var t=GNe(e,"string");return If(t)=="symbol"?t:t+""}function GNe(e,t){if(If(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(If(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wa=32,LP=function(e){function t(){return BNe(this,t),VNe(this,t,arguments)}return HNe(t,e),UNe(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,s=Wa/2,i=Wa/6,l=Wa/3,c=r.inactive?a:r.color;if(r.type==="plainline")return H.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:Wa,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return H.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
876            A`).concat(i,",").concat(i,",0,1,1,").concat(2*l,",").concat(s,`
877            H`).concat(Wa,"M").concat(2*l,",").concat(s,`
878            A`).concat(i,",").concat(i,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return H.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Wa/8,"h").concat(Wa,"v").concat(Wa*3/4,"h").concat(-Wa,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var u=FNe({},r);return delete u.legendIcon,H.cloneElement(r.legendIcon,u)}return H.createElement(RP,{fill:c,cx:s,cy:s,size:Wa,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,s=a.payload,i=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:Wa,height:Wa}
878,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(m,v){var g=m.formatter||c,y=yt(Rp(Rp({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",m.inactive));if(m.type==="none")return null;var x=ot(m.value)?null:m.value;bi(!ot(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=m.inactive?u:m.color;return H.createElement("li",lk({className:y,style:f,key:"legend-item-".concat(v)},Eb(r.props,m,v)),H.createElement(ZC,{width:i,height:i,viewBox:d,style:h},r.renderIcon(m)),H.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},g?g(x,m,v):x))})}},{key:"render",value:function(){var r=this.props,a=r.payload,s=r.layout,i=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?i:"left"};return H.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(p.PureComponent);Rp(LP,"displayName","Legend");Rp(LP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var YNe=m1;function KNe(){this.__data__=new YNe,this.size=0}var XNe=KNe;function JNe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var QNe=JNe;function ZNe(e){return this.__data__.get(e)}var e_e=ZNe;function t_e(e){return this.__data__.has(e)}var n_e=t_e,r_e=m1,a_e=_P,o_e=CP,s_e=200;function i_e(e,t){var n=this.__data__;if(n instanceof r_e){var r=n.__data__;if(!a_e||r.length<s_e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new o_e(r)}return n.set(e,t),this.size=n.size,this}var l_e=i_e,c_e=m1,u_e=XNe,d_e=QNe,f_e=e_e,h_e=n_e,m_e=l_e;function Ah(e){var t=this.__data__=new c_e(e);this.size=t.size}Ah.prototype.clear=u_e;Ah.prototype.delete=d_e;Ah.prototype.get=f_e;Ah.prototype.has=h_e;Ah.prototype.set=m_e;var xH=Ah,p_e="__lodash_hash_undefined__";function g_e(e){return this.__data__.set(e,p_e),this}var v_e=g_e;function y_e(e){return this.__data__.has(e)}var x_e=y_e,b_e=CP,w_e=v_e,j_e=x_e;function $b(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new b_e;++t<n;)this.add(e[t])}$b.prototype.add=$b.prototype.push=w_e;$b.prototype.has=j_e;var bH=$b;function S_e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var wH=S_e;function N_e(e,t){return e.has(t)}var jH=N_e,__e=bH,C_e=wH,k_e=jH,E_e=1,A_e=2;function P_e(e,t,n,r,a,s){var i=n&E_e,l=e.length,c=t.length;if(l!=c&&!(i&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,m=n&A_e?new __e:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var v=e[f],g=t[f];if(r)var y=i?r(g,v,f,t,e,s):r(v,g,f,e,t,s);if(y!==void 0){if(y)continue;h=!1;break}if(m){if(!C_e(t,function(x,b){if(!k_e(m,b)&&(v===x||a(v,x,n,r,s)))return m.push(b)})){h=!1;break}}else if(!(v===g||a(v,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var SH=P_e,T_e=zs,O_e=T_e.Uint8Array,M_e=O_e;function I_e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var $_e=I_e;function D_e(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var FP=D_e,g4=tv,v4=M_e,R_e=NP,L_e=SH,F_e=$_e,B_e=FP,z_e=1,U_e=2,V_e="[object Boolean]",W_e="[object Date]",q_e="[object Error]",H_e="[object Map]",G_e="[object Number]",Y_e="[object RegExp]",K_e="[object Set]",X_e="[object String]",J_e="[object Symbol]",Q_e="[object ArrayBuffer]",Z_e="[object DataView]",y4=g4?g4.prototype:void 0,cN=y4?y4.valueOf:void 0;function eCe(e,t,n,r,a,s,i){switch(n){case Z_e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Q_e:return!(e.byteLength!=t.byteLength||!s(new v4(e),new v4(t)));case V_e:case W_e:case G_e:return R_e(+e,+t);case q_e:return e.name==t.name&&e.message==t.message;case Y_e:case X_e:return e==t+"";case H_e:var l=F_e;case K_e:var c=r&z_e;if(l||(l=B_e),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;r|=U_e,i.set(e,t);var d=L_e(l(e),l(t),r,a,s,i);return i.delete(e),d;case J_e:if(cN)return cN.call(e)==cN.call(t)}return!1}var tCe=eCe;function nCe(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var NH=nCe,rCe=NH,aCe=ha;function oCe(e,t,n){var r=t(e);return aCe(e)?r:rCe(r,n(e))}var sCe=oCe;function iCe(e,t){for(var n=-1,r=e==null?0:e.length,a=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[a++]=i)}return s}var lCe=iCe;function cCe(){return[]}var uCe=cCe,dCe=lCe,fCe=uCe,hCe=Object.prototype,mCe=hCe.propertyIsEnumerable,x4=Object.getOwnPropertySymbols,pCe=x4?function(e){return e==null?[]:(e=Object(e),dCe(x4(e),function(t){return mCe.call(e,t)}))}:fCe,gCe=pCe;function vCe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}
vendor: 5,107 bytes, line 878
878var yCe=vCe,xCe=Yi,bCe=Ki,wCe="[object Arguments]";function jCe(e){return bCe(e)&&xCe(e)==wCe}var SCe=jCe,b4=SCe,NCe=Ki,_H=Object.prototype,_Ce=_H.hasOwnProperty,CCe=_H.propertyIsEnumerable,kCe=b4(function(){return arguments}())?b4:function(e){return NCe(e)&&_Ce.call(e,"callee")&&!CCe.call(e,"callee")},BP=kCe,Db={exports:{}};function ECe(){return!1}var ACe=ECe;Db.exports;(function(e,t){var n=zs,r=ACe,a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===a,l=i?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(Db,Db.exports);var CH=Db.exports,PCe=9007199254740991,TCe=/^(?:0|[1-9]\d*)$/;function OCe(e,t){var n=typeof e;return t=t??PCe,!!t&&(n=="number"||n!="symbol"&&TCe.test(e))&&e>-1&&e%1==0&&e<t}var zP=OCe,MCe=9007199254740991;function ICe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MCe}var UP=ICe,$Ce=Yi,DCe=UP,RCe=Ki,LCe="[object Arguments]",FCe="[object Array]",BCe="[object Boolean]",zCe="[object Date]",UCe="[object Error]",VCe="[object Function]",WCe="[object Map]",qCe="[object Number]",HCe="[object Object]",GCe="[object RegExp]",YCe="[object Set]",KCe="[object String]",XCe="[object WeakMap]",JCe="[object ArrayBuffer]",QCe="[object DataView]",ZCe="[object Float32Array]",eke="[object Float64Array]",tke="[object Int8Array]",nke="[object Int16Array]",rke="[object Int32Array]",ake="[object Uint8Array]",oke="[object Uint8ClampedArray]",ske="[object Uint16Array]",ike="[object Uint32Array]",Zt={};Zt[ZCe]=Zt[eke]=Zt[tke]=Zt[nke]=Zt[rke]=Zt[ake]=Zt[oke]=Zt[ske]=Zt[ike]=!0;Zt[LCe]=Zt[FCe]=Zt[JCe]=Zt[BCe]=Zt[QCe]=Zt[zCe]=Zt[UCe]=Zt[VCe]=Zt[WCe]=Zt[qCe]=Zt[HCe]=Zt[GCe]=Zt[YCe]=Zt[KCe]=Zt[XCe]=!1;function lke(e){return RCe(e)&&DCe(e.length)&&!!Zt[$Ce(e)]}var cke=lke;function uke(e){return function(t){return e(t)}}var kH=uke,Rb={exports:{}};Rb.exports;(function(e,t){var n=$q,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,i=s&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||i&&i.binding&&i.binding("util")}catch{}}();e.exports=l})(Rb,Rb.exports);var dke=Rb.exports,fke=cke,hke=kH,w4=dke,j4=w4&&w4.isTypedArray,mke=j4?hke(j4):fke,EH=mke,pke=yCe,gke=BP,vke=ha,yke=CH,xke=zP,bke=EH,wke=Object.prototype,jke=wke.hasOwnProperty;function Ske(e,t){var n=vke(e),r=!n&&gke(e),a=!n&&!r&&yke(e),s=!n&&!r&&!a&&bke(e),i=n||r||a||s,l=i?pke(e.length,String):[],c=l.length;for(var u in e)(t||jke.call(e,u))&&!(i&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||xke(u,c)))&&l.push(u);return l}var Nke=Ske,_ke=Object.prototype;function Cke(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_ke;return e===n}var kke=Cke;function Eke(e,t){return function(n){return e(t(n))}}var AH=Eke,Ake=AH,Pke=Ake(Object.keys,Object),Tke=Pke,Oke=kke,Mke=Tke,Ike=Object.prototype,$ke=Ike.hasOwnProperty;function Dke(e){if(!Oke(e))return Mke(e);var t=[];for(var n in Object(e))$ke.call(e,n)&&n!="constructor"&&t.push(n);return t}var Rke=Dke,Lke=SP,Fke=UP;function Bke(e){return e!=null&&Fke(e.length)&&!Lke(e)}var av=Bke,zke=Nke,Uke=Rke,Vke=av;function Wke(e){return Vke(e)?zke(e):Uke(e)}var T1=Wke,qke=sCe,Hke=gCe,Gke=T1;function Yke(e){return qke(e,Gke,Hke)}var Kke=Yke,S4=Kke,Xke=1,Jke=Object.prototype,Qke=Jke.hasOwnProperty;function Zke(e,t,n,r,a,s){var i=n&Xke,l=S4(e),c=l.length,u=S4(t),d=u.length;if(c!=d&&!i)return!1;for(var f=c;f--;){var h=l[f];if(!(i?h in t:Qke.call(t,h)))return!1}var m=s.get(e),v=s.get(t);if(m&&v)return m==t&&v==e;var g=!0;s.set(e,t),s.set(t,e);for(var y=i;++f<c;){h=l[f];var x=e[h],b=t[h];if(r)var w=i?r(b,x,h,t,e,s):r(x,b,h,e,t,s);if(!(w===void 0?x===b||a(x,b,n,r,s):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var N=e.constructor,S=t.constructor;N!=S&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var eEe=Zke,tEe=Wu,nEe=zs,rEe=tEe(nEe,"DataView"),aEe=rEe,oEe=Wu,sEe=zs,iEe=oEe(sEe,"Promise"),lEe=iEe,cEe=Wu,uEe=zs,dEe=cEe(uEe,"Set"),PH=dEe,fEe=Wu,hEe=zs,mEe=fEe(hEe,"WeakMap"),pEe=mEe,uk=aEe,dk=_P,fk=lEe,hk=PH,mk=pEe,TH=Yi,Ph=Rq,N4="[object Map]",gEe="[object Object]",_4="[object Promise]",C4="[object Set]",k4="[object WeakMap]",E4="[object DataView]",vEe=Ph(uk),yEe=Ph(dk),xEe=Ph(fk),bEe=Ph(hk),wEe=Ph(mk),Ac=TH;(uk&&Ac(new uk(new ArrayBuffer(1)))!=E4||dk&&Ac(new dk)!=N4||fk&&Ac(fk.resolve())!=_4||hk&&Ac(new hk)!=C4||mk&&Ac(new mk)!=k4)&&(Ac=function(e){var t=TH(e),n=t==gEe?e.constructor:void 0,r=n?Ph(n):"";if(r)switch(r){case vEe:return E4;case yEe:return N4;case xEe:return _4;case bEe:return C4;case wEe:return k4}return t});var jEe=Ac,uN=xH,SEe=SH,NEe=tCe,_Ee=eEe,A4=jEe,P4=ha,T4=CH,CEe=EH,kEe=1,O4="[object Arguments]",M4="[object Array]",wy="[object Object]",EEe=Object.prototype,I4=EEe.hasOwnProperty;function AEe(e,t,n,r,a,s){var i=P4(e),l=P4(t),c=i?M4:A4(e),u=l?M4:A4(t);c=c==O4?wy:c,u=u==O4?wy:u;var d=c==wy,f=u==wy,h=c==u;if(h&&T4(e)){if(!T4(t))return!1;i=!0,d=!1}if(h&&!d)return s||(s=new uN),i||CEe(e)?SEe(e,t,n,r,a,s):NEe(e,t,c,n,r,a,s);if(!(n&kEe)){var m=d&&I4.call(e,"__wrapped__"),v=f&&I4.call(t,"__wrapped__");
vendor: 4,112 bytes, line 878
878if(m||v){var g=m?e.value():e,y=v?t.value():t;return s||(s=new uN),a(g,y,n,r,s)}}return h?(s||(s=new uN),_Ee(e,t,n,r,a,s)):!1}var PEe=AEe,TEe=PEe,$4=Ki;function OH(e,t,n,r,a){return e===t?!0:e==null||t==null||!$4(e)&&!$4(t)?e!==e&&t!==t:TEe(e,t,n,r,OH,a)}var VP=OH,OEe=xH,MEe=VP,IEe=1,$Ee=2;function DEe(e,t,n,r){var a=n.length,s=a,i=!r;if(e==null)return!s;for(e=Object(e);a--;){var l=n[a];if(i&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){l=n[a];var c=l[0],u=e[c],d=l[1];if(i&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new OEe;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?MEe(d,u,IEe|$Ee,r,f):h))return!1}}return!0}var REe=DEe,LEe=uc;function FEe(e){return e===e&&!LEe(e)}var MH=FEe,BEe=MH,zEe=T1;function UEe(e){for(var t=zEe(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,BEe(a)]}return t}var VEe=UEe;function WEe(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var IH=WEe,qEe=REe,HEe=VEe,GEe=IH;function YEe(e){var t=HEe(e);return t.length==1&&t[0][2]?GEe(t[0][0],t[0][1]):function(n){return n===e||qEe(n,e,t)}}var KEe=YEe;function XEe(e,t){return e!=null&&t in Object(e)}var JEe=XEe,QEe=Uq,ZEe=BP,e2e=ha,t2e=zP,n2e=UP,r2e=g1;function a2e(e,t,n){t=QEe(t,e);for(var r=-1,a=t.length,s=!1;++r<a;){var i=r2e(t[r]);if(!(s=e!=null&&n(e,i)))break;e=e[i]}return s||++r!=a?s:(a=e==null?0:e.length,!!a&&n2e(a)&&t2e(i,a)&&(e2e(e)||ZEe(e)))}var o2e=a2e,s2e=JEe,i2e=o2e;function l2e(e,t){return e!=null&&i2e(e,t,s2e)}var c2e=l2e,u2e=VP,d2e=Vq,f2e=c2e,h2e=jP,m2e=MH,p2e=IH,g2e=g1,v2e=1,y2e=2;function x2e(e,t){return h2e(e)&&m2e(t)?p2e(g2e(e),t):function(n){var r=d2e(n,e);return r===void 0&&r===t?f2e(n,e):u2e(t,r,v2e|y2e)}}var b2e=x2e;function w2e(e){return e}var Th=w2e;function j2e(e){return function(t){return t==null?void 0:t[e]}}var S2e=j2e,N2e=AP;function _2e(e){return function(t){return N2e(t,e)}}var C2e=_2e,k2e=S2e,E2e=C2e,A2e=jP,P2e=g1;function T2e(e){return A2e(e)?k2e(P2e(e)):E2e(e)}var O2e=T2e,M2e=KEe,I2e=b2e,$2e=Th,D2e=ha,R2e=O2e;function L2e(e){return typeof e=="function"?e:e==null?$2e:typeof e=="object"?D2e(e)?I2e(e[0],e[1]):M2e(e):R2e(e)}var dc=L2e;function F2e(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1}var $H=F2e;function B2e(e){return e!==e}var z2e=B2e;function U2e(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var V2e=U2e,W2e=$H,q2e=z2e,H2e=V2e;function G2e(e,t,n){return t===t?H2e(e,t,n):W2e(e,q2e,n)}var Y2e=G2e,K2e=Y2e;function X2e(e,t){var n=e==null?0:e.length;return!!n&&K2e(e,t,0)>-1}var J2e=X2e;function Q2e(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var Z2e=Q2e;function eAe(){}var tAe=eAe,dN=PH,nAe=tAe,rAe=FP,aAe=1/0,oAe=dN&&1/rAe(new dN([,-0]))[1]==aAe?function(e){return new dN(e)}:nAe,sAe=oAe,iAe=bH,lAe=J2e,cAe=Z2e,uAe=jH,dAe=sAe,fAe=FP,hAe=200;function mAe(e,t,n){var r=-1,a=lAe,s=e.length,i=!0,l=[],c=l;if(n)i=!1,a=cAe;else if(s>=hAe){var u=t?null:dAe(e);if(u)return fAe(u);i=!1,a=uAe,c=new iAe}else c=t?[]:l;e:for(;++r<s;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,i&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var pAe=mAe,gAe=dc,vAe=pAe;function yAe(e,t){return e&&e.length?vAe(e,gAe(t)):[]}var xAe=yAe;const D4=Dt(xAe);function DH(e,t,n){return t===!0?D4(e,n):ot(t)?D4(e,t):e}function $f(e){"@babel/helpers - typeof";return $f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(e)}var bAe=["ref"];function R4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R4(Object(n),!0).forEach(function(r){O1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R4(Object(n)).forEac
vendor: 4,282 bytes, line 878
878h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LH(r.key),r)}}function jAe(e,t,n){return t&&L4(e.prototype,t),n&&L4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SAe(e,t,n){return t=Lb(t),NAe(e,RH()?Reflect.construct(t,n||[],Lb(e).constructor):t.apply(e,n))}function NAe(e,t){if(t&&($f(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _Ae(e)}function _Ae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RH=function(){return!!e})()}function Lb(e){return Lb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lb(e)}function CAe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pk(e,t)}function pk(e,t){return pk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pk(e,t)}function O1(e,t,n){return t=LH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LH(e){var t=kAe(e,"string");return $f(t)=="symbol"?t:t+""}function kAe(e,t){if($f(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($f(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EAe(e,t){if(e==null)return{};var n=AAe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AAe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function PAe(e){return e.value}function TAe(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=EAe(t,bAe);return H.createElement(LP,n)}var F4=1,Bl=function(e){function t(){var n;wAe(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=SAe(this,t,[].concat(a)),O1(n,"lastBoundingBox",{width:-1,height:-1}),n}return CAe(t,e),jAe(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>F4||Math.abs(a.height-this.lastBoundingBox.height)>F4)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Zs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,s=a.layout,i=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(i==="center"&&s==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=i==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var v=this.getBBoxSnapsh
878ot();h={top:((d||0)-v.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Zs(Zs({},f),h)}},{key:"render",value:function(){var r=this,a=this.props,s=a.content,i=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=Zs(Zs({position:"absolute",width:i||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return H.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){r.wrapperNode=m}},TAe(s,Zs(Zs({},this.props),{},{payload:DH(d,u,PAe)})))}}],[{key:"getWithHeight",value:function(r,a){var s=Zs(Zs({},this.defaultProps),r.props),i=s.layout;return i==="vertical"&&je(r.props.height)?{height:r.props.height}:i==="horizontal"?{width:r.props.width||a}:null}}])}(p.PureComponent);O1(Bl,"displayName","Legend");O1(Bl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var B4=tv,OAe=BP,MAe=ha,z4=B4?B4.isConcatSpreadable:void 0;function IAe(e){return MAe(e)||OAe(e)||!!(z4&&e&&e[z4])}var $Ae=IAe,DAe=NH,RAe=$Ae;function FH(e,t,n,r,a){var s=-1,i=e.length;for(n||(n=RAe),a||(a=[]);++s<i;){var l=e[s];t>0&&n(l)?t>1?FH(l,t-1,n,r,a):DAe(a,l):r||(a[a.length]=l)}return a}var BH=FH;function LAe(e){return function(t,n,r){for(var a=-1,s=Object(t),i=r(t),l=i.length;l--;){var c=i[e?l:++a];if(n(s[c],c,s)===!1)break}return t}}var FAe=LAe,BAe=FAe,zAe=BAe(),UAe=zAe,VAe=UAe,WAe=T1;function qAe(e,t){return e&&VAe(e,t,WAe)}var zH=qAe,HAe=av;function GAe(e,t){return function(n,r){if(n==null)return n;if(!HAe(n))return e(n,r);for(var a=n.length,s=t?a:-1,i=Object(n);(t?s--:++s<a)&&r(i[s],s,i)!==!1;);return n}}var YAe=GAe,KAe=zH,XAe=YAe,JAe=XAe(KAe),WP=JAe,QAe=WP,ZAe=av;function ePe(e,t){var n=-1,r=ZAe(e)?Array(e.length):[];return QAe(e,function(a,s,i){r[++n]=t(a,s,i)}),r}var UH=ePe;function tPe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var nPe=tPe,U4=Nh;function rPe(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,s=U4(e),i=t!==void 0,l=t===null,c=t===t,u=U4(t);if(!l&&!u&&!s&&e>t||s&&i&&c&&!l&&!u||r&&i&&c||!n&&c||!a)return 1;if(!r&&!s&&!u&&e<t||u&&n&&a&&!r&&!s||l&&n&&a||!i&&a||!c)return-1}return 0}var aPe=rPe,oPe=aPe;function sPe(e,t,n){for(var r=-1,a=e.criteria,s=t.criteria,i=a.length,l=n.length;++r<i;){var c=oPe(a[r],s[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var iPe=sPe,fN=EP,lPe=AP,cPe=dc,uPe=UH,dPe=nPe,fPe=kH,hPe=iPe,mPe=Th,pPe=ha;function gPe(e,t,n){t.length?t=fN(t,function(s){return pPe(s)?function(i){return lPe(i,s.length===1?s[0]:s)}:s}):t=[mPe];var r=-1;t=fN(t,fPe(cPe));var a=uPe(e,function(s,i,l){var c=fN(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return dPe(a,function(s,i){return hPe(s,i,n)})}var vPe=gPe;function yPe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var xPe=yPe,bPe=xPe,V4=Math.max;function wPe(e,t,n){return t=V4(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=V4(r.length-t,0),i=Array(s);++a<s;)i[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(i),bPe(e,this,l)}}var jPe=wPe;function SPe(e){return function(){return e}}var NPe=SPe,_Pe=Wu,CPe=function(){try{var e=_Pe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),VH=CPe,kPe=NPe,W4=VH,EPe=Th,APe=W4?function(e,t){return W4(e,"toString",{configurable:!0,enumerable:!1,value:kPe(t),writable:!0})}:EPe,PPe=APe,TPe=800,OPe=16,MPe=Date.now;function IPe(e){var t=0,n=0;return function(){var r=MPe(),a=OPe-(r-n);if(n=r,a>0){if(++t>=TPe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var $Pe=IPe,DPe=PPe,RPe=$Pe,LPe=RPe(DPe),FPe=LPe,BPe=Th,zPe=jPe,UPe=FPe;function VPe(e,t){return UPe(zPe(e,t,BPe),e+"")}var WPe=VPe,qPe=NP,HPe=av,GPe=zP,YPe=uc;function KPe(e,t,n){if(!YPe(n))return!1;var r=typeof t;return(r=="number"?HPe(n)&&GPe(t,n.length):r=="string"&&t in n)?qPe(n[t],e):!1}var M1=KPe,XPe=BH,JPe=vPe,QPe=WPe,q4=M1,ZPe=QPe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&q4(e,t[0],t[1])?t=[]:n>2&&q4(t[0],t[1],t[2])&&(t=[t[0]]),JPe(e,XPe(t,1),[])}),eTe=ZPe;const qP=Dt(eTe);function Lp(e){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lp(e)}function gk(){return gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gk.apply(this,arguments)}function tTe(e,t){return oTe(e)||aTe(e,t)||rTe(e,t)||nTe()}
vendor: 10,738 bytes, lines 878-879
878function nTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
879In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rTe(e,t){if(e){if(typeof e=="string")return H4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H4(e,t)}}function H4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aTe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function oTe(e){if(Array.isArray(e))return e}function G4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function hN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G4(Object(n),!0).forEach(function(r){sTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sTe(e,t,n){return t=iTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iTe(e){var t=lTe(e,"string");return Lp(t)=="symbol"?t:t+""}function lTe(e,t){if(Lp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Lp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cTe(e){return Array.isArray(e)&&Bn(e[0])&&Bn(e[1])?e.join(" ~ "):e}var uTe=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,s=a===void 0?{}:a,i=t.itemStyle,l=i===void 0?{}:i,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,m=t.wrapperClassName,v=t.labelClassName,g=t.label,y=t.labelFormatter,x=t.accessibilityLayer,b=x===void 0?!1:x,w=function(){if(d&&d.length){var z={padding:0,margin:0},U=(h?qP(d,h):d).map(function(E,q){if(E.type==="none")return null;var W=hN({display:"block",paddingTop:4,paddingBottom:4,color:E.color||"#000"},l),L=E.formatter||f||cTe,M=E.value,B=E.name,I=M,R=B;if(L&&I!=null&&R!=null){var F=L(M,B,E,q,d);if(Array.isArray(F)){var j=tTe(F,2);I=j[0],R=j[1]}else I=F}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(q),style:W},Bn(R)?H.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Bn(R)?H.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,H.createElement("span",{className:"recharts-tooltip-item-value"},I),H.createElement("span",{className:"recharts-tooltip-item-unit"},E.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:z},U)}return null},N=hN({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),S=hN({margin:0},u),_=!dt(g),k=_?g:"",P=yt("recharts-default-tooltip",m),O=yt("recharts-tooltip-label",v);_&&y&&d!==void 0&&d!==null&&(k=y(g,d));var $=b?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",gk({className:P,style:N},$),H.createElement("p",{className:O,style:S},H.isValidElement(k)?k:"".concat(k)),w())};function Fp(e){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fp(e)}function jy(e,t,n){return t=dTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dTe(e){var t=fTe(e,"string");return Fp(t)=="symbol"?t:t+""}function fTe(e,t){if(Fp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var im="recharts-tooltip-wrapper",hTe={visibility:"hidden"};function mTe(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return yt(im,jy(jy(jy(jy({},"".concat(im,"-right"),je(n)&&t&&je(t.x)&&n>=t.x),"".concat(im,"-left"),je(n)&&t&&je(t.x)&&n<t.x),"".concat(im,"-bottom"),je(r)&&t&&je(t.y)&&r>=t.y),"".concat(im,"-top"),je(r)&&t&&je(t.y)&&r<t.y))}function Y4(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,s=e.position,i=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&je(s[r]))return s[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return i[r]?d:f;if(i[r]){var h=d,m=c[r];return h<m?Math.max(f,c[r]):Math.max(d,c[r])}var v=f+l,g=c[r]+u;return v>g?Math.max(d,c[r]):Math.max(f,c[r])}function pTe(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function gTe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,s=e.reverseDirection,i=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return i.height>0&&i.width>0&&n?(d=Y4({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:i.width,viewBox:c,viewBoxDimension:c.width}),f=Y4({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:i.height,viewBox:c,viewBoxDimension:c.height}),u=pTe({translateX:d,translateY:f,useTranslate3d:l})):u=hTe,{cssProperties:u,cssClasses:mTe({translateX:d,translateY:f,coordinate:n})}}function Df(e){"@babel/helpers - typeof";return Df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Df(e)}function K4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function X4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K4(Object(n),!0).forEach(function(r){yk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yTe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qH(r.key),r)}}function xTe(e,t,n){return t&&yTe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bTe(e,t,n){return t=Fb(t),wTe(e,WH()?Reflect.construct(t,n||[],Fb(e).constructor):t.apply(e,n))}function wTe(e,t){if(t&&(Df(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jTe(e)}function jTe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WH=function(){return!!e})()}function Fb(e){return Fb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fb(e)}function STe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vk(e,t)}function vk(e,t){return vk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},vk(e,t)}function yk(e,t,n){return t=qH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qH(e){var t=NTe(e,"string");return Df(t)=="symbol"?t:t+""}function NTe(e,t){if(Df(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Df(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J4=1,_Te=function(e){function t(){var n;vTe(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=bTe(this,t,[].concat(a)),yk(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yk(n,"handleKeyDown",function(i){if(i.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return STe(t,e),xTe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>J4||Math.abs(r.height-this.state.lastBoundingBox.height)>J4)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,s=a.active,i=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,m=a.offset,v=a.position,g=a.reverseDirection,y=a.useTranslate3d,x=a.viewBox,b=a.wrapperStyle,w=gTe({allowEscapeViewBox:i,coordinate:d,offsetTopLeft:m,position:v,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:x}
879),N=w.cssClasses,S=w.cssProperties,_=X4(X4({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return H.createElement("div",{tabIndex:-1,className:N,style:_,ref:function(P){r.wrapperNode=P}},u)}}])}(p.PureComponent),CTe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wi={isSsr:CTe(),get:function(t){return wi[t]},set:function(t,n){if(typeof t=="string")wi[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(a){wi[a]=t[a]})}}};function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function Q4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Z4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q4(Object(n),!0).forEach(function(r){HP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ETe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GH(r.key),r)}}function ATe(e,t,n){return t&&ETe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PTe(e,t,n){return t=Bb(t),TTe(e,HH()?Reflect.construct(t,n||[],Bb(e).constructor):t.apply(e,n))}function TTe(e,t){if(t&&(Rf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OTe(e)}function OTe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HH=function(){return!!e})()}function Bb(e){return Bb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bb(e)}function MTe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xk(e,t)}function xk(e,t){return xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},xk(e,t)}function HP(e,t,n){return t=GH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GH(e){var t=ITe(e,"string");return Rf(t)=="symbol"?t:t+""}function ITe(e,t){if(Rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Te(e){return e.dataKey}function DTe(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(uTe,t)}var Qr=function(e){function t(){return kTe(this,t),PTe(this,t,arguments)}return MTe(t,e),ATe(t,[{key:"render",value:function(){var r=this,a=this.props,s=a.active,i=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,m=a.offset,v=a.payload,g=a.payloadUniqBy,y=a.position,x=a.reverseDirection,b=a.useTranslate3d,w=a.viewBox,N=a.wrapperStyle,S=v??[];f&&S.length&&(S=DH(v.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),g,$Te));var _=S.length>0;return H.createElement(_Te,{allowEscapeViewBox:i,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:_,offset:m,position:y,reverseDirection:x,useTranslate3d:b,viewBox:w,wrapperStyle:N},DTe(u,Z4(Z4({},this.props),{},{payload:S})))}}])}(p.PureComponent);HP(Qr,"displayName","Tooltip");HP(Qr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wi.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 RTe=zs,LTe=function(){return RTe.Date.now()},FTe=LTe,BTe=/\s/;function zTe(e){for(var t=e.length;t--&&BTe.test(e.charAt(t)););return t}var UTe=zTe,VTe=UTe,WTe=/^\s+/;function qTe(e){return e&&e.slice(0,VTe(e)+1).replace(WTe,"")}var HTe=qTe,GTe=HTe,eR=uc,YTe=Nh,tR=NaN,KTe=/^[-+]0x[0-9a-f]+$/i,XTe=/^0b[01]+$/i,JTe=/^0o[0-7]+$/i,QTe=parseInt;function ZTe(e){if(typeof e=="number")return e;if(YTe(e))return tR;if(eR(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=eR(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=GTe(e);var n=XTe.test(e);return n||JTe.test(e)?QTe(e.slice(2),n?2:8):KTe.test(e)?tR:+e}var YH=ZTe,eOe=uc,mN=FTe,nR=YH,tOe="Expected a function",nOe=Math.max,rOe=Math.min;function aOe(e,t,n){var r,a,s,i,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(tOe);
vendor: 17,207 bytes, lines 879-886
879t=nR(t)||0,eOe(n)&&(d=!!n.leading,f="maxWait"in n,s=f?nOe(nR(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function m(_){var k=r,P=a;return r=a=void 0,u=_,i=e.apply(P,k),i}function v(_){return u=_,l=setTimeout(x,t),d?m(_):i}function g(_){var k=_-c,P=_-u,O=t-k;return f?rOe(O,s-P):O}function y(_){var k=_-c,P=_-u;return c===void 0||k>=t||k<0||f&&P>=s}function x(){var _=mN();if(y(_))return b(_);l=setTimeout(x,g(_))}function b(_){return l=void 0,h&&r?m(_):(r=a=void 0,i)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function N(){return l===void 0?i:b(mN())}function S(){var _=mN(),k=y(_);if(r=arguments,a=this,c=_,k){if(l===void 0)return v(c);if(f)return clearTimeout(l),l=setTimeout(x,t),m(c)}return l===void 0&&(l=setTimeout(x,t)),i}return S.cancel=w,S.flush=N,S}var oOe=aOe,sOe=oOe,iOe=uc,lOe="Expected a function";function cOe(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(lOe);return iOe(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),sOe(e,t,{leading:r,maxWait:t,trailing:a})}var uOe=cOe;const KH=Dt(uOe);function Bp(e){"@babel/helpers - typeof";return Bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bp(e)}function rR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rR(Object(n),!0).forEach(function(r){dOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dOe(e,t,n){return t=fOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fOe(e){var t=hOe(e,"string");return Bp(t)=="symbol"?t:t+""}function hOe(e,t){if(Bp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mOe(e,t){return yOe(e)||vOe(e,t)||gOe(e,t)||pOe()}function pOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
880In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gOe(e,t){if(e){if(typeof e=="string")return aR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aR(e,t)}}function aR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vOe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function yOe(e){if(Array.isArray(e))return e}var Jm=p.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,s=e.width,i=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,m=e.children,v=e.debounce,g=v===void 0?0:v,y=e.id,x=e.className,b=e.onResize,w=e.style,N=w===void 0?{}:w,S=p.useRef(null),_=p.useRef();_.current=b,p.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var k=p.useState({containerWidth:a.width,containerHeight:a.height}),P=mOe(k,2),O=P[0],$=P[1],T=p.useCallback(function(U,E){$(function(q){var W=Math.round(U),L=Math.round(E);return q.containerWidth===W&&q.containerHeight===L?q:{containerWidth:W,containerHeight:L}})},[]);p.useEffect(function(){var U=function(B){var I,R=B[0].contentRect,F=R.width,j=R.height;T(F,j),(I=_.current)===null||I===void 0||I.call(_,F,j)};g>0&&(U=KH(U,g,{trailing:!0,leading:!1}));var E=new ResizeObserver(U),q=S.current.getBoundingClientRect(),W=q.width,L=q.height;return T(W,L),E.observe(S.current),function(){E.disconnect()}},[T,g]);var z=p.useMemo(function(){var U=O.containerWidth,E=O.containerHeight;if(U<0||E<0)return null;bi(Lc(i)||Lc(c),`The width(%s) and height(%s) are both fixed numbers,
881       maybe you don't need to use a ResponsiveContainer.`,i,c),bi(!n||n>0,"The aspect(%s) must be greater than zero.",n);var q=Lc(i)?U:i,W=Lc(c)?E:c;n&&n>0&&(q?W=q/n:W&&(q=W*n),h&&W>h&&(W=h)),bi(q>0||W>0,`The width(%s) and height(%s) of chart should be greater than 0,
882       please check the style of container, or the props width(%s) and height(%s),
883       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
884       height and width.`,q,W,i,c,d,f,n);var L=!Array.isArray(m)&&xi(m.type).endsWith("Chart");return H.Children.map(m,function(M){return H.isValidElement(M)?p.cloneElement(M,Sy({width:q,height:W},L?{style:Sy({height:"100%",width:"100%",maxHeight:W,maxWidth:q},M.props.style)}:{})):M})},[n,m,c,h,f,d,O,i]);return H.createElement("div",{id:y?"".concat(y):void 0,className:yt("recharts-responsive-container",x),style:Sy(Sy({},N),{},{width:i,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},z)}),XH=function(t){return null};XH.displayName="Cell";function zp(e){"@babel/helpers - typeof";return zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zp(e)}function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){xOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xOe(e,t,n){return t=bOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bOe(e){var t=wOe(e,"string");return zp(t)=="symbol"?t:t+""}function wOe(e,t){if(zp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cd={widthCache:{},cacheCount:0},jOe=2e3,SOe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},sR="recharts_measurement_span";function NOe(e){var t=bk({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Qm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wi.isSsr)return{width:0,height:0};var r=NOe(n),a=JSON.stringify({text:t,copyStyle:r});if(cd.widthCache[a])return cd.widthCache[a];try{var s=document.getElementById(sR);s||(s=document.createElement("span"),s.setAttribute("id",sR),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var i=bk(bk({},SOe),r);Object.assign(s.style,i),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return cd.widthCache[a]=c,++cd.cacheCount>jOe&&(cd.cacheCount=0,cd.widthCache={}),c}catch{return{width:0,height:0}}},_Oe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Up(e){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Up(e)}function zb(e,t){return AOe(e)||EOe(e,t)||kOe(e,t)||COe()}function COe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
885In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kOe(e,t){if(e){if(typeof e=="string")return iR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iR(e,t)}}function iR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EOe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function AOe(e){if(Array.isArray(e))return e}function POe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OOe(r.key),r)}}function TOe(e,t,n){return t&&lR(e.prototype,t),n&&lR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OOe(e){var t=MOe(e,"string");return Up(t)=="symbol"?t:t+""}function MOe(e,t){if(Up(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Up(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,IOe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,$Oe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,JH={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},DOe=Object.keys(JH),$d="NaN";function ROe(e,t){return e*JH[t]}var Ny=function(){function e(t,n){POe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!IOe.test(n)&&(this.num=NaN,this.unit=""),DOe.includes(n)&&(this.num=ROe(t,n),this.unit="px")}return TOe(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=$Oe.exec(n))!==null&&r!==void 0?r:[],s=zb(a,3),i=s[1],l=s[2];return new e(parseFloat(i),l??"")}}])}();function QH(e){if(e.includes($d))return $d;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=cR.exec(t))!==null&&n!==void 0?n:[],a=zb(r,4),s=a[1],i=a[2],l=a[3],c=Ny.parse(s??""),u=Ny.parse(l??""),d=i==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return $d;t=t.replace(cR,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=uR.exec(t))!==null&&f!==void 0?f:[],m=zb(h,4),v=m[1],g=m[2],y=m[3],x=Ny.parse(v??""),b=Ny.parse(y??""),w=g==="+"?x.add(b):x.subtract(b);if(w.isNaN())return $d;t=t.replace(uR,w.toString())}return t}var dR=/\(([^()]*)\)/;function LOe(e){for(var t=e;t.includes("(");){var n=dR.exec(t),r=zb(n,2),a=r[1];t=t.replace(dR,QH(a))}return t}function FOe(e){var t=e.replace(/\s+/g,"");return t=LOe(t),t=QH(t),t}function BOe(e){try{return FOe(e)}catch{return $d}}function pN(e){var t=BOe(e.slice(5,-1));return t===$d?"":t}var zOe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],UOe=["dx","dy","angle","className","breakAll"];function wk(){return wk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wk.apply(this,arguments)}function fR(e,t){if(e==null)return{};var n=VOe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VOe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function hR(e,t){return GOe(e)||HOe(e,t)||qOe(e,t)||WOe()}function WOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
886In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qOe(e,t){if(e){if(typeof e=="string")return mR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mR(e,t)}}function mR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HOe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function GOe(e){if(Array.isArray(e))return e}var ZH=/[ \f\n\r\t\v\u2028\u2029]+/,eG=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var s=[];dt(n)||(r?s=n.toString().split(""):s=n.toString().split(ZH));var i=s.map(function(c){return{word:c,width:Qm(c,a).width}}),l=r?0:Qm(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch{return null}},YOe=function(t,n,r,a,s){var i=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=je(i),f=l,h=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(W,L){var M=L.word,B=L.width,I=W[W.length-1];if(I&&(a==null||s||I.width+B+r<Number(a)))I.words.push(M),I.width+=B+r;else{var R={words:[M],width:B};W.push(R)}return W},[])},m=h(n),v=function(q){return q.reduce(function(W,L){return W.width>L.width?W:L})};if(!d)return m;for(var g="…",y=function(q){var W=f.slice(0,q),L=eG({breakAll:u,style:c,children:W+g}).wordsWithComputedWidth,M=h(L),B=M.length>i||v(M).width>Number(a);return[B,M]},x=0,b=f.length-1,w=0,N;x<=b&&w<=f.length-1;){var S=Math.floor((x+b)/2),_=S-1,k=y(_),P=hR(k,2),O=P[0],$=P[1],T=y(S),z=hR(T,1),U=z[0];if(!O&&!U&&(x=S+1),O&&U&&(b=S-1),!O&&U){N=$;break}w++}return N||m},pR=function(t){var n=dt(t)?[]:t.toString().split(ZH);return[{words:n}]},KOe=function(t){var n=t.width,r=t.scaleToFit,a=t.children,s=t.style,i=t.breakAll,l=t.maxLines;if((n||r)&&!wi.isSsr){var c,u,d=eG({breakAll:i,children:a,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return pR(a);return YOe({breakAll:i,children:a,maxLines:l,style:s},c,u,n,r)}return pR(a)},gR="#808080",Ub=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,i=t.lineHeight,l=i===void 0?"1em":i,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,m=h===void 0?"start":h,v=t.verticalAnchor,g=v===void 0?"end":v,y=t.fill,x=y===void 0?gR:y,b=fR(t,zOe),w=p.useMemo(function(){return KOe({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),N=b.dx,S=b.dy,_=b.angle,k=b.className,P=b.breakAll,O=fR(b,UOe);if(!Bn(r)||!Bn(s))return null;var $=r+(je(N)?N:0),T=s+(je(S)?S:0),z;switch(g){case"start":z=pN("calc(".concat(u,")"));break;case"middle":z=pN("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:z=pN("calc(".concat(w.length-1," * -").concat(l,")"));break}var U=[];if(f){var E=w[0].width,q=b.width;U.push("scale(".concat((je(q)?q/E:1)/E,")"))}return _&&U.push("rotate(".concat(_,", ").concat($,", ").concat(T,")")),U.length&&(O.transform=U.join(" ")),H.createElement("text",wk({},vt(O,!0),{x:$,y:T,className:yt("recharts-text",k),textAnchor:m,fill:x.includes("url")?gR:x}),w.map(function(W,L){var M=W.words.join(P?"":" ");return H.createElement("tspan",{x:$,dy:L===0?z:l,key:"".concat(M,"-").concat(L)},M)}))};function zl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function XOe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function GP(e){let t,n,r;
886e.length!==2?(t=zl,n=(l,c)=>zl(e(l),c),r=(l,c)=>e(l)-c):(t=e===zl||e===XOe?e:JOe,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:i,right:s}}function JOe(){return 0}function tG(e){return e===null?NaN:+e}function*QOe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ZOe=GP(zl),ov=ZOe.right;GP(tG).center;class vR extends Map{constructor(t,n=nMe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(yR(this,t))}has(t){return super.has(yR(this,t))}set(t,n){return super.set(eMe(this,t),n)}delete(t){return super.delete(tMe(this,t))}}function yR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function eMe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function tMe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function nMe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rMe(e=zl){if(e===zl)return nG;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function nG(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const aMe=Math.sqrt(50),oMe=Math.sqrt(10),sMe=Math.sqrt(2);function Vb(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),s=r/Math.pow(10,a),i=s>=aMe?10:s>=oMe?5:s>=sMe?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/i,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*i,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Vb(e,t,n*2):[l,c,u]}function jk(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,s,i]=r?Vb(t,e,n):Vb(e,t,n);if(!(s>=a))return[];const l=s-a+1,c=new Array(l);if(r)if(i<0)for(let u=0;u<l;++u)c[u]=(s-u)/-i;else for(let u=0;u<l;++u)c[u]=(s-u)*i;else if(i<0)for(let u=0;u<l;++u)c[u]=(a+u)/-i;else for(let u=0;u<l;++u)c[u]=(a+u)*i;return c}function Sk(e,t,n){return t=+t,e=+e,n=+n,Vb(e,t,n)[2]}function Nk(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?Sk(t,e,n):Sk(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function xR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function bR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function rG(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?nG:rMe(a);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*f/c+h)),v=Math.min(r,Math.floor(t+(c-u)*f/c+h));rG(e,t,m,v,a)}const s=e[t];let i=n,l=r;for(lm(e,n,t),a(e[r],s)>0&&lm(e,n,r);i<l;){for(lm(e,i,l),++i,--l;a(e[i],s)<0;)++i;for(;a(e[l],s)>0;)--l}a(e[n],s)===0?lm(e,n,l):(++l,lm(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function lm(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function iMe(e,t,n){if(e=Float64Array.from(QOe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return bR(e);if(t>=1)return xR(e);var r,a=(r-1)*t,s=Math.floor(a),i=xR(rG(e,s).subarray(0,s+1)),l=bR(e.subarray(s+1));return i+(l-i)*(a-s)}}function lMe(e,t,n=tG){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,s=Math.floor(a),i=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return i+(l-i)*(a-s)}}function cMe(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(a);++r<a;)s[r]=e+r*n;return s}function go(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Xi(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}
vendor: 6,190 bytes, line 886
886const _k=Symbol("implicit");function YP(){var e=new vR,t=[],n=[],r=_k;function a(s){let i=e.get(s);if(i===void 0){if(r!==_k)return r;e.set(s,i=t.push(s)-1)}return n[i%n.length]}return a.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new vR;for(const i of s)e.has(i)||e.set(i,t.push(i)-1);return a},a.range=function(s){return arguments.length?(n=Array.from(s),a):n.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return YP(t,n).unknown(r)},go.apply(a,arguments),a}function Vp(){var e=YP().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,s,i,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,m=a<r,v=m?a:r,g=m?r:a;s=(g-v)/Math.max(1,h-c+u*2),l&&(s=Math.floor(s)),v+=(g-v-s*(h-c))*d,i=s*(1-c),l&&(v=Math.round(v),i=Math.round(i));var y=cMe(h).map(function(x){return v+s*x});return n(m?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,a]=h,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(h){return[r,a]=h,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return i},e.step=function(){return s},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return Vp(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},go.apply(f(),arguments)}function aG(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return aG(t())},e}function Zm(){return aG(Vp.apply(null,arguments).paddingInner(1))}function KP(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function oG(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function sv(){}var Wp=.7,Wb=1/Wp,Zd="\\s*([+-]?\\d+)\\s*",qp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uMe=/^#([0-9a-f]{3,8})$/,dMe=new RegExp(`^rgb\\(${Zd},${Zd},${Zd}\\)$`),fMe=new RegExp(`^rgb\\(${Cs},${Cs},${Cs}\\)$`),hMe=new RegExp(`^rgba\\(${Zd},${Zd},${Zd},${qp}\\)$`),mMe=new RegExp(`^rgba\\(${Cs},${Cs},${Cs},${qp}\\)$`),pMe=new RegExp(`^hsl\\(${qp},${Cs},${Cs}\\)$`),gMe=new RegExp(`^hsla\\(${qp},${Cs},${Cs},${qp}\\)$`),wR={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};KP(sv,Nu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jR,formatHex:jR,formatHex8:vMe,formatHsl:yMe,formatRgb:SR,toString:SR});function jR(){return this.rgb().formatHex()}function vMe(){return this.rgb().formatHex8()}function yMe(){return sG(this).formatHsl()}function SR(){return this.rgb().formatRgb()}function Nu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uMe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NR(t):n===3?new na(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_y(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_y(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=dMe.exec(e))?new na(t[1],t[2],t[3],1):(t=fMe.exec(e))?new na(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hMe.exec(e))?_y(t[1],t[2],t[3],t[4]):(t=mMe.exec(e))?_y(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pMe.exec(e))?kR(t[1],t[2]/100,t[3]/100,1):(t=gMe.exec(e))?kR(t[1],t[2]/100,t[3]/100,t[4]):wR.hasOwnProperty(e)?NR(wR[e]):e==="transparent"?new n
vendor: 17,424 bytes, line 886
886a(NaN,NaN,NaN,0):null}function NR(e){return new na(e>>16&255,e>>8&255,e&255,1)}function _y(e,t,n,r){return r<=0&&(e=t=n=NaN),new na(e,t,n,r)}function xMe(e){return e instanceof sv||(e=Nu(e)),e?(e=e.rgb(),new na(e.r,e.g,e.b,e.opacity)):new na}function Ck(e,t,n,r){return arguments.length===1?xMe(e):new na(e,t,n,r??1)}function na(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}KP(na,Ck,oG(sv,{brighter(e){return e=e==null?Wb:Math.pow(Wb,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wp:Math.pow(Wp,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new na(tu(this.r),tu(this.g),tu(this.b),qb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_R,formatHex:_R,formatHex8:bMe,formatRgb:CR,toString:CR}));function _R(){return`#${Fc(this.r)}${Fc(this.g)}${Fc(this.b)}`}function bMe(){return`#${Fc(this.r)}${Fc(this.g)}${Fc(this.b)}${Fc((isNaN(this.opacity)?1:this.opacity)*255)}`}function CR(){const e=qb(this.opacity);return`${e===1?"rgb(":"rgba("}${tu(this.r)}, ${tu(this.g)}, ${tu(this.b)}${e===1?")":`, ${e})`}`}function qb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fc(e){return e=tu(e),(e<16?"0":"")+e.toString(16)}function kR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ro(e,t,n,r)}function sG(e){if(e instanceof Ro)return new Ro(e.h,e.s,e.l,e.opacity);if(e instanceof sv||(e=Nu(e)),!e)return new Ro;if(e instanceof Ro)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),i=NaN,l=s-a,c=(s+a)/2;return l?(t===s?i=(n-r)/l+(n<r)*6:n===s?i=(r-t)/l+2:i=(t-n)/l+4,l/=c<.5?s+a:2-s-a,i*=60):l=c>0&&c<1?0:i,new Ro(i,l,c,e.opacity)}function wMe(e,t,n,r){return arguments.length===1?sG(e):new Ro(e,t,n,r??1)}function Ro(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}KP(Ro,wMe,oG(sv,{brighter(e){return e=e==null?Wb:Math.pow(Wb,e),new Ro(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wp:Math.pow(Wp,e),new Ro(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new na(gN(e>=240?e-240:e+120,a,r),gN(e,a,r),gN(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ro(ER(this.h),Cy(this.s),Cy(this.l),qb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=qb(this.opacity);return`${e===1?"hsl(":"hsla("}${ER(this.h)}, ${Cy(this.s)*100}%, ${Cy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ER(e){return e=(e||0)%360,e<0?e+360:e}function Cy(e){return Math.max(0,Math.min(1,e||0))}function gN(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const XP=e=>()=>e;function jMe(e,t){return function(n){return e+n*t}}function SMe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function NMe(e){return(e=+e)==1?iG:function(t,n){return n-t?SMe(t,n,e):XP(isNaN(t)?n:t)}}function iG(e,t){var n=t-e;return n?jMe(e,n):XP(isNaN(e)?t:e)}const Hb=function e(t){var n=NMe(t);function r(a,s){var i=n((a=Ck(a)).r,(s=Ck(s)).r),l=n(a.g,s.g),c=n(a.b,s.b),u=iG(a.opacity,s.opacity);return function(d){return a.r=i(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function _Me(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function CMe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kMe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),i;for(i=0;i<r;++i)a[i]=Oh(e[i],t[i]);for(;i<n;++i)s[i]=t[i];return function(l){for(i=0;i<r;++i)s[i]=a[i](l);return s}}function EMe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Do(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AMe(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Oh(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var kk=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vN=new RegExp(kk.source,"g");function PMe(e){return function(){return e}}function TMe(e){return function(t){return e(t)+""}}function lG(e,t){var n=kk.lastIndex=vN.lastIndex=0,r,a,s,i=-1,l=[],c=[];for(e=e+"",t=t+"";(r=kk.exec(e))&&(a=vN.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(r=r[0])===(a=a[0])?l[i]?l[i]+=a:l[++i]=a:(l[++i]=null,c.push({i,x:Do(r,a)})),n=vN.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?c[0]?TMe(c[0].x):PMe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Oh(e,t){var n=typeof t,r;return t==null||n==="boolean"?XP(t):(n==="number"?Do:n==="string"?(r=Nu(t))?(t=r,Hb):lG:t instanceof Nu?Hb:t instanceof Date?EMe:CMe(t)?_Me:Array.isArray(t)?kMe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AMe:Do)(e,t)}function JP(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var AR=180/Math.PI,Ek={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cG(e,t,n,r,a,s){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,i=-i),{translateX:a,translateY:s,rotate:Math.atan2(t,e)*AR,skewX:Math.atan(c)*AR,scaleX:i,scaleY:l}}var ky;function OMe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ek:cG(t.a,t.b,t.c,t.d,t.e,t.f)}function MMe(e){return e==null||(ky||(ky=document.createElementNS("http://www.w3.org/2000/svg","g")),ky.setAttribute("transform",e),!(e=ky.transform.baseVal.consolidate()))?Ek:(e=e.matrix,cG(e.a,e.b,e.c,e.d,e.e,e.f))}function uG(e,t,n,r){function a(u){return u.length?u.pop()+" ":""}function s(u,d,f,h,m,v){if(u!==f||d!==h){var g=m.push("translate(",null,t,null,n);v.push({i:g-4,x:Do(u,f)},{i:g-2,x:Do(d,h)})}else(f||h)&&m.push("translate("+f+t+h+n)}function i(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,r)-2,x:Do(u,d)})):d&&f.push(a(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(a(f)+"skewX(",null,r)-2,x:Do(u,d)}):d&&f.push(a(f)+"skewX("+d+r)}function c(u,d,f,h,m,v){if(u!==f||d!==h){var g=m.push(a(m)+"scale(",null,",",null,")");v.push({i:g-4,x:Do(u,f)},{i:g-2,x:Do(d,h)})}else(f!==1||h!==1)&&m.push(a(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),i(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var v=-1,g=h.length,y;++v<g;)f[(y=h[v]).i]=y.x(m);return f.join("")}}}var IMe=uG(OMe,"px, ","px)","deg)"),$Me=uG(MMe,", ",")",")"),DMe=1e-12;function PR(e){return((e=Math.exp(e))+1/e)/2}function RMe(e){return((e=Math.exp(e))-1/e)/2}function LMe(e){return((e=Math.exp(2*e))-1)/(e+1)}const FMe=function e(t,n,r){function a(s,i){var l=s[0],c=s[1],u=s[2],d=i[0],f=i[1],h=i[2],m=d-l,v=f-c,g=m*m+v*v,y,x;if(g<DMe)x=Math.log(h/u)/t,y=function(k){return[l+k*m,c+k*v,u*Math.exp(t*k*x)]};else{var b=Math.sqrt(g),w=(h*h-u*u+r*g)/(2*u*n*b),N=(h*h-u*u-r*g)/(2*h*n*b),S=Math.log(Math.sqrt(w*w+1)-w),_=Math.log(Math.sqrt(N*N+1)-N);x=(_-S)/t,y=function(k){var P=k*x,O=PR(S),$=u/(n*b)*(O*LMe(t*P+S)-RMe(S));return[l+$*m,c+$*v,u*O/PR(t*P+S)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return a.rho=function(s){var i=Math.max(.001,+s),l=i*i,c=l*l;return e(i,l,c)},a}(Math.SQRT2,2,4);function BMe(e,t){t===void 0&&(t=e,e=Oh);for(var n=0,r=t.length-1,a=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(a,a=t[++n]);return function(i){var l=Math.max(0,Math.min(r-1,Math.floor(i*=r)));return s[l](i-l)}}function zMe(e){return function(){return e}}function Gb(e){return+e}var TR=[0,1];function Vr(e){return e}function Ak(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:zMe(isNaN(t)?NaN:.5)}function UMe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function VMe(e,t,n){var r=e[0],a=e[1],s=t[0],i=t[1];return a<r?(r=Ak(a,r),s=n(i,s)):(r=Ak(r,a),s=n(s,i)),function(l){return s(r(l))}}function WMe(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),s=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)a[i]=Ak(e[i],e[i+1]),s[i]=n(t[i],t[i+1]);return function(l){var c=ov(e,l,1,r)-1;return s[c](a[c](l))}}function iv(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function I1(){var e=TR,t=TR,n=Oh,r,a,s,i=Vr,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==Vr&&(i=UMe(e[0],e[h-1])),l=h>2?WMe:VMe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(r),t,n)))(r(i(h)))}return f.invert=function(h){return i(a((u||(u=l(t,e.map(r),Do)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Gb),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=JP,d()},f.clamp=function(h){return arguments.length?(i=h?!0:Vr,d()):i!==Vr},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,m){return r=h,a=m,d()}}function QP(){return I1()(Vr,Vr)}function qMe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Yb(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Lf(e){return e=Yb(Math.abs(e)),e?e[1]:NaN}function HMe(e,t){return function(n,r){for(var a=n.length,s=[],i=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),s.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[i=(i+1)%e.length];return s.reverse().join(t)}}function GMe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var YMe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hp(e){if(!(t=YMe.exec(e)))throw new Error("invalid format: "+e);var t;return new ZP({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Hp.prototype=ZP.prototype;function ZP(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ZP.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 KMe(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var dG;function XMe(e,t){var n=Yb(e,t);if(!n)return e+"";var r=n[0],a=n[1],s=a-(dG=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,i=r.length;return s===i?r:s>i?r+new Array(s-i+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Yb(e,Math.max(0,t+s-1))[0]}function OR(e,t){var n=Yb(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const MR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:qMe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OR(e*100,t),r:OR,s:XMe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function IR(e){return e}var $R=Array.prototype.map,DR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JMe(e){var t=e.grouping===void 0||e.thousands===void 0?IR:HMe($R.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?IR:GMe($R.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Hp(f);var h=f.fill,m=f.align,v=f.sign,g=f.symbol,y=f.zero,x=f.width,b=f.comma,w=f.precision,N=f.trim,S=f.type;S==="n"?(b=!0,S="g"):MR[S]||(w===void 0&&(w=12),N=!0,S="g"),(y||h==="0"&&m==="=")&&(y=!0,h="0",m="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",k=g==="$"?r:/[%p]/.test(S)?i:"",P=MR[S],O=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function $(T){var z=_,U=k,E,q,W;if(S==="c")U=P(T)+U,T="";else{T=+T;var L=T<0||1/T<0;if(T=isNaN(T)?c:P(Math.abs(T),w),N&&(T=KMe(T)),L&&+T==0&&v!=="+"&&(L=!1),z=(L?v==="("?v:l:v==="-"||v==="("?"":v)+z,U=(S==="s"?DR[8+dG/3]:"")+U+(L&&v==="("?")":""),O){for(E=-1,q=T.length;++E<q;)if(W=T.charCodeAt(E),48>W||W>57){U=(W===46?a+T.slice(E+1):T.slice(E))+U,T=T.slice(0,E);break}}}b&&!y&&(T=t(T,1/0));var M=z.length+T.length+U.length,B=M<x?new Array(x-M+1).join(h):"";switch(b&&y&&(T=t(B+T,B.length?x-U.length:1/0),B=""),m){case"<":T=z+T+U+B;break;case"=":T=z+B+T+U;break;case"^":T=B.slice(0,M=B.length>>1)+z+T+U+B.slice(M);break;default:T=B+z+T+U;break}return s(T)}return $.toString=function(){return f+""},$}function d(f,h){var m=u((f=Hp(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(Lf(h)/3)))*3,g=Math.pow(10,-v),y=DR[8+v/3];return function(x){return m(g*x)+y}}return{format:u,formatPrefix:d}}var Ey,eT,fG;QMe({thousands:",",grouping:[3],currency:["$",""]});function QMe(e){return Ey=JMe(e),eT=Ey.format,fG=Ey.formatPrefix,Ey}function ZMe(e){return Math.max(0,-Lf(Math.abs(e)))}function eIe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Lf(t)/3)))*3-Lf(Math.abs(e)))}function tIe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Lf(t)-Lf(e))+1}function hG(e,t,n,r){var a=Nk(e,t,n),s;switch(r=Hp(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=eIe(a,i))&&(r.precision=s),fG(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=tIe(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=ZMe(a))&&(r.precision=s-(r.type==="%")*2);break}}return eT(r)}function fc(e){var t=e.domain;return e.ticks=function(n){var r=t();return jk(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return hG(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,s=r.length-1,i=r[a],l=r[s],c,u,d=10;for(l<i&&(u=i,i=l,l=u,u=a,a=s,s=u);d-- >0;){if(u=Sk(i,l,n),u===c)return r[a]=i,r[s]=l,t(r);if(u>0)i=Math.floor(i/u)*u,l=Math.ceil(l/u)*u;else if(u<0)i=Math.ceil(i*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Kb(){var e=QP();return e.copy=function(){return iv(e,Kb())},go.apply(e,arguments),fc(e)}function mG(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Gb),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return mG(e).unknown(t)},e=arguments.length?Array.from(e,Gb):[0,1],fc(n)}function pG(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],s=e[r],i;return s<a&&(i=n,n=r,r=i,i=a,a=s,s=i),e[n]=t.floor(a),e[r]=t.ceil(s),e}function RR(e){return Math.log(e)}function LR(e){return Math.exp(e)}function nIe(e){return-Math.log(-e)}function rIe(e){return-Math.exp(-e)}function aIe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function oIe(e){return e===10?aIe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function sIe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function FR(e){return(t,n)=>-e(-t,n)}function tT(e){const t=e(RR,LR),n=t.domain;let r=10,a,s;function i(){return a=sIe(r),s=oIe(r),n()[0]<0?(a=FR(a),s=FR(s),e(nIe,rIe)):e(RR,LR),t}return t.base=function(l){return arguments.length?(r=+l,i()):r},t.domain=function(l){return arguments.length?(n(l),i()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),m=a(d),v,g;const y=l==null?10:+l;let x=[];if(!(r%1)&&m-h<y){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(v=1;v<r;++v)if(g=h<0?v/s(-h):v*s(h),!(g<u)){if(g>d)break;x.push(g)}}else for(;h<=m;++h)for(v=r-1;v>=1;--v)if(g=h>0?v/s(-h):v*s(h),!(g<u)){if(g>d)break;x.push(g)}x.length*2<y&&(x=jk(u,d,y))}else x=jk(h,m,Math.min(m-h,y)).map(s);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Hp(c)).precision==null&&(c.trim=!0),c=eT(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/s(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(pG(n(),{floor:l=>s(Math.floor(a(l))),ceil:l=>s(Math.ceil(a(l)))})),t}function gG(){const e=tT(I1()).domain([1,10]);return e.copy=()=>iv(e,gG()).base(e.base()),go.apply(e,arguments),e}
886function BR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function nT(e){var t=1,n=e(BR(t),zR(t));return n.constant=function(r){return arguments.length?e(BR(t=+r),zR(t)):t},fc(n)}function vG(){var e=nT(I1());return e.copy=function(){return iv(e,vG()).constant(e.constant())},go.apply(e,arguments)}function UR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iIe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lIe(e){return e<0?-e*e:e*e}function rT(e){var t=e(Vr,Vr),n=1;function r(){return n===1?e(Vr,Vr):n===.5?e(iIe,lIe):e(UR(n),UR(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},fc(t)}function aT(){var e=rT(I1());return e.copy=function(){return iv(e,aT()).exponent(e.exponent())},go.apply(e,arguments),e}function cIe(){return aT.apply(null,arguments).exponent(.5)}function VR(e){return Math.sign(e)*e*e}function uIe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function yG(){var e=QP(),t=[0,1],n=!1,r;function a(s){var i=uIe(e(s));return isNaN(i)?r:n?Math.round(i):i}return a.invert=function(s){return e.invert(VR(s))},a.domain=function(s){return arguments.length?(e.domain(s),a):e.domain()},a.range=function(s){return arguments.length?(e.range((t=Array.from(s,Gb)).map(VR)),a):t.slice()},a.rangeRound=function(s){return a.range(s).round(!0)},a.round=function(s){return arguments.length?(n=!!s,a):n},a.clamp=function(s){return arguments.length?(e.clamp(s),a):e.clamp()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return yG(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},go.apply(a,arguments),fc(a)}function xG(){var e=[],t=[],n=[],r;function a(){var i=0,l=Math.max(1,t.length);for(n=new Array(l-1);++i<l;)n[i-1]=lMe(e,i/l);return s}function s(i){return i==null||isNaN(i=+i)?r:t[ov(n,i)]}return s.invertExtent=function(i){var l=t.indexOf(i);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},s.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let l of i)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(zl),a()},s.range=function(i){return arguments.length?(t=Array.from(i),a()):t.slice()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return xG().domain(e).range(t).unknown(r)},go.apply(s,arguments)}function bG(){var e=0,t=1,n=1,r=[.5],a=[0,1],s;function i(c){return c!=null&&c<=c?a[ov(r,c,0,n)]:s}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return i}return i.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},i.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},i.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},i.unknown=function(c){return arguments.length&&(s=c),i},i.thresholds=function(){return r.slice()},i.copy=function(){return bG().domain([e,t]).range(a).unknown(s)},go.apply(fc(i),arguments)}function wG(){var e=[.5],t=[0,1],n,r=1;function a(s){return s!=null&&s<=s?t[ov(e,s,0,r)]:n}return a.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(s){var i=t.indexOf(s);return[e[i-1],e[i]]},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return wG().domain(e).range(t).unknown(n)},go.apply(a,arguments)}const yN=new Date,xN=new Date;function Vn(e,t,n,r){function a(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=s=>(e(s=new Date(+s)),s),a.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),a.round=s=>{const i=a(s),l=a.ceil(s);return s-i<l-s?i:l},a.offset=(s,i)=>(t(s=new Date(+s),i==null?1:Math.floor(i)),s),a.range=(s,i,l)=>{const c=[];if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<i)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<i);return c},a.filter=s=>Vn(i=>{if(i>=i)for(;e(i),!s(i);)i.setTime(i-1)},(i,l)=>{if(i>=i)if(l<0)for(;++l<=0;)for(;t(i,-1),!s(i););else for(;--l>=0;)for(;t(i,1),!s(i););}),n&&(a.count=(s,i)=>(yN.setTime(+s),xN.setTime(+i),e(yN),e(xN),Math.floor(n(yN,xN))),a.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(r?i=>r(i)%s===0:i=>a.count(0,i)%s===0):a)),a}const Xb=Vn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Xb);Xb.range;const hi=1e3,Qa=hi*60,mi=Qa*60,Di=mi*24,oT=Di*7,WR=Di*30,bN=Di*365,Bc=Vn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getUTCSeconds());Bc.range;const sT=Vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi)},(e,t)=>{e.setTime(+e+t*Qa)},(e,t)=>(t-e)/Qa,e=>e.getMinutes());sT.range;const iT=Vn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qa)},(e,t)=>(t-e)/Qa,e=>e.getUTCMinutes());iT.range;const lT=Vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi-e.getMinutes()*Qa)},(e,t)=>{e.setTime(+e+t*mi)},(e,t)=>(t-e)/mi,e=>e.getHours());lT.range;const cT=Vn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mi)},(e,t)=>(t-e)/mi,e=>e.getUTCHours());cT.range;const lv=Vn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qa)/Di,e=>e.getDate()-1);lv.range;const $1=Vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Di,e=>e.getUTCDate()-1);$1.range;const jG=Vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Di,e=>Math.floor(e/Di));jG.range;function qu(e){return Vn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qa)/oT)}const D1=qu(0),Jb=qu(1),dIe=qu(2),fIe=qu(3),Ff=qu(4),hIe=qu(5),mIe=qu(6);D1.range;Jb.range;dIe.range;fIe.range;Ff.range;hIe.range;mIe.range;function Hu(e){return Vn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/oT)}const R1=Hu(0),Qb=Hu(1),pIe=Hu(2),gIe=Hu(3),Bf=Hu(4),vIe=Hu(5),yIe=Hu(6);R1.range;Qb.range;pIe.range;gIe.range;Bf.range;vIe.range;yIe.range;const uT=Vn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());uT.range;const dT=Vn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());dT.range;const Ri=Vn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ri.every=e=>
vendor: 5,050 bytes, line 886
886!isFinite(e=Math.floor(e))||!(e>0)?null:Vn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ri.range;const Li=Vn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Li.range;function SG(e,t,n,r,a,s){const i=[[Bc,1,hi],[Bc,5,5*hi],[Bc,15,15*hi],[Bc,30,30*hi],[s,1,Qa],[s,5,5*Qa],[s,15,15*Qa],[s,30,30*Qa],[a,1,mi],[a,3,3*mi],[a,6,6*mi],[a,12,12*mi],[r,1,Di],[r,2,2*Di],[n,1,oT],[t,1,WR],[t,3,3*WR],[e,1,bN]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),v=m?m.range(u,+d+1):[];return h?v.reverse():v}function c(u,d,f){const h=Math.abs(d-u)/f,m=GP(([,,y])=>y).right(i,h);if(m===i.length)return e.every(Nk(u/bN,d/bN,f));if(m===0)return Xb.every(Math.max(Nk(u,d,f),1));const[v,g]=i[h/i[m-1][2]<i[m][2]/h?m-1:m];return v.every(g)}return[l,c]}const[xIe,bIe]=SG(Li,dT,R1,jG,cT,iT),[wIe,jIe]=SG(Ri,uT,D1,lv,lT,sT);function wN(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function jN(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function cm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function SIe(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,s=e.days,i=e.shortDays,l=e.months,c=e.shortMonths,u=um(a),d=dm(a),f=um(s),h=dm(s),m=um(i),v=dm(i),g=um(l),y=dm(l),x=um(c),b=dm(c),w={a:L,A:M,b:B,B:I,c:null,d:XR,e:XR,f:HIe,g:n$e,G:a$e,H:VIe,I:WIe,j:qIe,L:NG,m:GIe,M:YIe,p:R,q:F,Q:ZR,s:eL,S:KIe,u:XIe,U:JIe,V:QIe,w:ZIe,W:e$e,x:null,X:null,y:t$e,Y:r$e,Z:o$e,"%":QR},N={a:j,A:C,b:A,B:D,c:null,d:JR,e:JR,f:c$e,g:x$e,G:w$e,H:s$e,I:i$e,j:l$e,L:CG,m:u$e,M:d$e,p:V,q:Y,Q:ZR,s:eL,S:f$e,u:h$e,U:m$e,V:p$e,w:g$e,W:v$e,x:null,X:null,y:y$e,Y:b$e,Z:j$e,"%":QR},S={a:$,A:T,b:z,B:U,c:E,d:YR,e:YR,f:FIe,g:GR,G:HR,H:KR,I:KR,j:$Ie,L:LIe,m:IIe,M:DIe,p:O,q:MIe,Q:zIe,s:UIe,S:RIe,u:EIe,U:AIe,V:PIe,w:kIe,W:TIe,x:q,X:W,y:GR,Y:HR,Z:OIe,"%":BIe};w.x=_(n,w),w.X=_(r,w),w.c=_(t,w),N.x=_(n,N),N.X=_(r,N),N.c=_(t,N);function _(G,K){return function(Z){var J=[],ce=-1,ue=0,be=G.length,Ne,te,re;for(Z instanceof Date||(Z=new Date(+Z));++ce<be;)G.charCodeAt(ce)===37&&(J.push(G.slice(ue,ce)),(te=qR[Ne=G.charAt(++ce)])!=null?Ne=G.charAt(++ce):te=Ne==="e"?" ":"0",(re=K[Ne])&&(Ne=re(Z,te)),J.push(Ne),ue=ce+1);return J.push(G.slice(ue,ce)),J.join("")}}function k(G,K){return function(Z){var J=cm(1900,void 0,1),ce=P(J,G,Z+="",0),ue,be;if(ce!=Z.length)return null;if("Q"in J)return new Date(J.Q);if("s"in J)return new Date(J.s*1e3+("L"in J?J.L:0));if(K&&!("Z"in J)&&(J.Z=0),"p"in J&&(J.H=J.H%12+J.p*12),J.m===void 0&&(J.m="q"in J?J.q:0),"V"in J){if(J.V<1||J.V>53)return null;"w"in J||(J.w=1),"Z"in J?(ue=jN(cm(J.y,0,1)),be=ue.getUTCDay(),ue=be>4||be===0?Qb.ceil(ue):Qb(ue),ue=$1.offset(ue,(J.V-1)*7),J.y=ue.getUTCFullYear(),J.m=ue.getUTCMonth(),J.d=ue.getUTCDate()+(J.w+6)%7):(ue=wN(cm(J.y,0,1)),be=ue.getDay(),ue=be>4||be===0?Jb.ceil(ue):Jb(ue),ue=lv.offset(ue,(J.V-1)*7),J.y=ue.getFullYear(),J.m=ue.getMonth(),J.d=ue.getDate()+(J.w+6)%7)}else("W"in J||"U"in J)&&("w"in J||(J.w="u"in J?J.u%7:"W"in J?1:0),be="Z"in J?jN(cm(J.y,0,1)).getUTCDay():wN(cm(J.y,0,1)).getDay(),J.m=0,J.d="W"in J?(J.w+6)%7+J.W*7-(be+5)%7:J.w+J.U*7-(be+6)%7);return"Z"in J?(J.H+=J.Z/100|0,J.M+=J.Z%100,jN(J)):wN(J)}}function P(G,K,Z,J){for(var ce=0,ue=K.length,be=Z.length,Ne,te;ce<ue;){if(J>=be)return-1;if(Ne=K.charCodeAt(ce++),Ne===37){if(Ne=K.charAt(ce++),te=S[Ne in qR?K.charAt(ce++):Ne],!te||(J=te(G,Z,J))<0)return-1}else if(Ne!=Z.charCodeAt(J++))return-1}return J}function O(G,K,Z){var J=u.exec(K.slice(Z));return J?(G.p=d.get(J[0].toLowerCase()),Z+J[0].length):-1}function $(G,K,Z){var J=m.exec(K.slice(Z));return J?(G.w=v.get(J[0].toLowerCase()),Z+J[0].length):-1}function T(G,K,Z){var J=f.exec(K.slice(Z));return J?(G.w=h.get(J[0].toLowerCase()),Z+J[0].length):-1}function z(G,K,Z){var J=x.exec(K.slice(Z));return J?(G.m=b.get(J[0].toLowerCase()),Z+J[0].length):-1}function U(G,K,Z){var J=g.exec(K.slice(Z));return J?(G.m=y.get(J[0].toLowerCase()),Z+J[0].length):-1}function E(G,K,Z){return P(G,t,K,Z)}function q(G,K,Z){return P(G,n,K,Z)}function W(G,K,Z){return P(G,r,K,Z)}function L(G){return i[G.getDay()]}function M(G){return s[G.getDay()]}function B(G){return c[G.getMonth()]}function I(G){return l[G.getMonth()]}function R(G){return a[+(G.getHours()>=12)]}function F(G){return 1+~~(G.getMonth()/3)}function j(G){return i[G.getUTCDay()]}function C(G){return s[G.getUTCDay()]}function A(G){return c[G.getUTCMonth()]}function D(G){return l[G.getUTCMonth()]}function V(G){return a[+(G.getUTCHours()>=12)]}function Y(G){return 1+~~(G.getUTCMonth()/3)}
vendor: 5,019 bytes, line 886
886return{format:function(G){var K=_(G+="",w);return K.toString=function(){return G},K},parse:function(G){var K=k(G+="",!1);return K.toString=function(){return G},K},utcFormat:function(G){var K=_(G+="",N);return K.toString=function(){return G},K},utcParse:function(G){var K=k(G+="",!0);return K.toString=function(){return G},K}}}var qR={"-":"",_:" ",0:"0"},rr=/^\s*\d+/,NIe=/^%/,_Ie=/[\\^$*+?|[\]().{}]/g;function Et(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",s=a.length;return r+(s<n?new Array(n-s+1).join(t)+a:a)}function CIe(e){return e.replace(_Ie,"\\$&")}function um(e){return new RegExp("^(?:"+e.map(CIe).join("|")+")","i")}function dm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function kIe(e,t,n){var r=rr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function EIe(e,t,n){var r=rr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function AIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function PIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function TIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function HR(e,t,n){var r=rr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GR(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function OIe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function MIe(e,t,n){var r=rr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function IIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function YR(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $Ie(e,t,n){var r=rr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function KR(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function DIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function RIe(e,t,n){var r=rr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function LIe(e,t,n){var r=rr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function FIe(e,t,n){var r=rr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function BIe(e,t,n){var r=NIe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zIe(e,t,n){var r=rr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function UIe(e,t,n){var r=rr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function XR(e,t){return Et(e.getDate(),t,2)}function VIe(e,t){return Et(e.getHours(),t,2)}function WIe(e,t){return Et(e.getHours()%12||12,t,2)}function qIe(e,t){return Et(1+lv.count(Ri(e),e),t,3)}function NG(e,t){return Et(e.getMilliseconds(),t,3)}function HIe(e,t){return NG(e,t)+"000"}function GIe(e,t){return Et(e.getMonth()+1,t,2)}function YIe(e,t){return Et(e.getMinutes(),t,2)}function KIe(e,t){return Et(e.getSeconds(),t,2)}function XIe(e){var t=e.getDay();return t===0?7:t}function JIe(e,t){return Et(D1.count(Ri(e)-1,e),t,2)}function _G(e){var t=e.getDay();return t>=4||t===0?Ff(e):Ff.ceil(e)}function QIe(e,t){return e=_G(e),Et(Ff.count(Ri(e),e)+(Ri(e).getDay()===4),t,2)}function ZIe(e){return e.getDay()}function e$e(e,t){return Et(Jb.count(Ri(e)-1,e),t,2)}function t$e(e,t){return Et(e.getFullYear()%100,t,2)}function n$e(e,t){return e=_G(e),Et(e.getFullYear()%100,t,2)}function r$e(e,t){return Et(e.getFullYear()%1e4,t,4)}function a$e(e,t){var n=e.getDay();return e=n>=4||n===0?Ff(e):Ff.ceil(e),Et(e.getFullYear()%1e4,t,4)}function o$e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function JR(e,t){return Et(e.getUTCDate(),t,2)}function s$e(e,t){return Et(e.getUTCHours(),t,2)}function i$e(e,t){return Et(e.getUTCHours()%12||12,t,2)}function l$e(e,t){return Et(1+$1.count(Li(e),e),t,3)}function CG(e,t){return Et(e.getUTCMilliseconds(),t,3)}function c$e(e,t){return CG(e,t)+"000"}function u$e(e,t){return Et(e.getUTCMonth()+1,t,2)}function d$e(e,t){return Et(e.getUTCMinutes(),t,2)}function f$e(e,t){return Et(e.getUTCSeconds(),t,2)}function h$e(e){var t=e.getUTCDay();return t===0?7:t}function m$e(e,t){return Et(R1.count(Li(e)-1,e),t,2)}function kG(e){var t=e.getUTCDay();return t>=4||t===0?Bf(e):Bf.ceil(e)}function p$e(e,t){return e=kG(e),Et(Bf.count(Li(e),e)+(Li(e).getUTCDay()===4),t,2)}function g$e(e){return e.getUTCDay()}function v$e(e,t){return Et(Qb.count(Li(e)-1,e),t,2)}function y$e(e,t){return Et(e.getUTCFullYear()%100,t,2)}function x$e(e,t){return e=kG(e),Et(e.getUTCFullYear()%100,t,2)}function b$e(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function w$e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Bf(e):Bf.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function j$e(){return"+0000"}function QR(){return"%"}function ZR(e){return+e}function eL(e){return Math.floor(+e/1e3)}var ud,EG,AG;S$e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
886ay","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 S$e(e){return ud=SIe(e),EG=ud.format,ud.parse,AG=ud.utcFormat,ud.utcParse,ud}function N$e(e){return new Date(e)}function _$e(e){return e instanceof Date?+e:+new Date(+e)}function fT(e,t,n,r,a,s,i,l,c,u){var d=QP(),f=d.invert,h=d.domain,m=u(".%L"),v=u(":%S"),g=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),b=u("%b %d"),w=u("%B"),N=u("%Y");function S(_){return(c(_)<_?m:l(_)<_?v:i(_)<_?g:s(_)<_?y:r(_)<_?a(_)<_?x:b:n(_)<_?w:N)(_)}return d.invert=function(_){return new Date(f(_))},d.domain=function(_){return arguments.length?h(Array.from(_,_$e)):h().map(N$e)},d.ticks=function(_){var k=h();return e(k[0],k[k.length-1],_??10)},d.tickFormat=function(_,k){return k==null?S:u(k)},d.nice=function(_){var k=h();return(!_||typeof _.range!="function")&&(_=t(k[0],k[k.length-1],_??10)),_?h(pG(k,_)):d},d.copy=function(){return iv(d,fT(e,t,n,r,a,s,i,l,c,u))},d}function C$e(){return go.apply(fT(wIe,jIe,Ri,uT,D1,lv,lT,sT,Bc,EG).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function k$e(){return go.apply(fT(xIe,bIe,Li,dT,R1,$1,cT,iT,Bc,AG).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function L1(){var e=0,t=1,n,r,a,s,i=Vr,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:i(a===0?.5:(f=(s(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),r=s(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(i=f,u):i};function d(f){return function(h){var m,v;return arguments.length?([m,v]=h,i=f(m,v),u):[i(0),i(1)]}}return u.range=d(Oh),u.rangeRound=d(JP),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function hc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function PG(){var e=fc(L1()(Vr));return e.copy=function(){return hc(e,PG())},Xi.apply(e,arguments)}function TG(){var e=tT(L1()).domain([1,10]);return e.copy=function(){return hc(e,TG()).base(e.base())},Xi.apply(e,arguments)}function OG(){var e=nT(L1());return e.copy=function(){return hc(e,OG()).constant(e.constant())},Xi.apply(e,arguments)}function hT(){var e=rT(L1());return e.copy=function(){return hc(e,hT()).exponent(e.exponent())},Xi.apply(e,arguments)}function E$e(){return hT.apply(null,arguments).exponent(.5)}function MG(){var e=[],t=Vr;function n(r){if(r!=null&&!isNaN(r=+r))return t((ov(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(zl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,s)=>iMe(e,s/r))},n.copy=function(){return MG(t).domain(e)},Xi.apply(n,arguments)}function F1(){var e=0,t=.5,n=1,r=1,a,s,i,l,c,u=Vr,d,f=!1,h;function m(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-s)*(r*g<r*s?l:c),u(f?Math.max(0,Math.min(1,g)):g))}m.domain=function(g){return arguments.length?([e,t,n]=g,a=d(e=+e),s=d(t=+t),i=d(n=+n),l=a===s?0:.5/(s-a),c=s===i?0:.5/(i-s),r=s<a?-1:1,m):[e,t,n]},m.clamp=function(g){return arguments.length?(f=!!g,m):f},m.interpolator=function(g){return arguments.length?(u=g,m):u};function v(g){return function(y){var x,b,w;return arguments.length?([x,b,w]=y,u=BMe(g,[x,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=v(Oh),m.rangeRound=v(JP),m.unknown=function(g){return arguments.length?(h=g,m):h},function(g){return d=g,a=g(e),s=g(t),i=g(n),l=a===s?0:.5/(s-a),c=s===i?0:.5/(i-s),r=s<a?-1:1,m}}function IG(){var e=fc(F1()(Vr));return e.copy=function(){return hc(e,IG())},Xi.apply(e,arguments)}function $G(){var e=tT(F1()).domain([.1,1,10]);return e.copy=function(){return hc(e,$G()).base(e.base())},Xi.apply(e,arguments)}function DG(){var e=nT(F1());return e.copy=function(){return hc(e,DG()).constant(e.constant())},Xi.apply(e,arguments)}function mT(){var e=rT(F1());return e.copy=function(){return hc(e,mT()).exponent(e.exponent())},Xi.apply(e,arguments)}function A$e(){return mT.apply(null,arguments).exponent(.5)}const tL=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Vp,scaleDiverging:IG,scaleDivergingLog:$G,scaleDivergingPow:mT,scaleDivergingSqrt:A$e,scaleDivergingSymlog:DG,scaleIdentity:mG,scaleImplicit:_k,scaleLinear:Kb,scaleLog:gG,scaleOrdinal:YP,scalePoint:Zm,scalePow:aT,scaleQuantile:xG,scaleQuantize:bG,scaleRadial:yG,scaleSequential:PG,scaleSequentialLog:TG,scaleSequentialPow:hT,scaleSequentialQuantile:MG,scaleSequentialSqrt:E$e,scaleSequentialSymlog:OG,scaleSqrt:cIe,scaleSymlog:vG,scaleThreshold:wG,scaleTime:C$e,scaleUtc:k$e,tickFormat:hG},Symbol.toStringTag,{value:"Module"}));var P$e=Nh;function T$e(e,t,n){for(var r=-1,a=e.length;++r<a;){var s=e[r],i=t(s);if(i!=null&&(l===void 0?i===i&&!P$e(i):n(i,l)))var l=i,c=s}return c}var RG=T$e;function O$e(e,t){return e>t}var M$e=O$e,I$e=RG,$$e=M$e,D$e=Th;function R$e(e){return e&&e.length?I$e(e,D$e,$$e):void 0}var L$e=R$e;const B1=Dt(L$e);function F$e(e,t){return e<t}
886var B$e=F$e,z$e=RG,U$e=B$e,V$e=Th;function W$e(e){return e&&e.length?z$e(e,V$e,U$e):void 0}var q$e=W$e;const z1=Dt(q$e);var H$e=EP,G$e=dc,Y$e=UH,K$e=ha;function X$e(e,t){var n=K$e(e)?H$e:Y$e;return n(e,G$e(t))}var J$e=X$e,Q$e=BH,Z$e=J$e;function eDe(e,t){return Q$e(Z$e(e,t),1)}var tDe=eDe;const nDe=Dt(tDe);var rDe=VP;function aDe(e,t){return rDe(e,t)}var oDe=aDe;const U1=Dt(oDe);var Mh=1e9,sDe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gT,sn=!0,ho="[DecimalError] ",nu=ho+"Invalid argument: ",pT=ho+"Exponent out of range: ",Ih=Math.floor,Pc=Math.pow,iDe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_a,Yn=1e7,en=7,LG=9007199254740991,Zb=Ih(LG/en),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,a,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===a?0:r>a^s.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*en;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};
vendor: 63,445 bytes, lines 886-912
886Me.dividedBy=Me.div=function(e){return ji(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Vt(ji(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return Mn(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,a=r.precision,s=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(_a))throw Error(ho+"NaN");if(n.s<1)throw Error(ho+(n.s?"NaN":"-Infinity"));return n.eq(_a)?new r(0):(sn=!1,t=ji(Gp(n,s),Gp(e,s),s),sn=!0,Vt(t,a))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zG(t,e):FG(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(ho+"NaN");return n.s?(sn=!1,t=ji(n,e,0,1).times(e),sn=!0,n.minus(t)):Vt(new r(n),a)};Me.naturalExponential=Me.exp=function(){return BG(this)};Me.naturalLogarithm=Me.ln=function(){return Gp(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FG(t,e):zG(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(nu+e);if(t=Mn(a)+1,r=a.d.length-1,n=r*en+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,a,s,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(ho+"NaN")}for(e=Mn(l),sn=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=ws(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Ih((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=i=n+3;;)if(s=r,r=s.plus(ji(l,s,i+2)).times(.5),ws(s.d).slice(0,i)===(t=ws(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),a==i&&t=="4999"){if(Vt(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;i+=4}return sn=!0,Vt(r,n)};Me.times=Me.mul=function(e){var t,n,r,a,s,i,l,c,u,d=this,f=d.constructor,h=d.d,m=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=m.length,c<u&&(s=h,h=m,m=s,i=c,c=u,u=i),s=[],i=c+u,r=i;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=s[a]+m[r]*h[a-r-1]+t,s[a--]=l%Yn|0,t=l/Yn|0;s[a]=(s[a]+t)%Yn|0}for(;!s[--i];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,sn?Vt(e,f.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ds(e,0,Mh),t===void 0?t=r.rounding:Ds(t,0,8),Vt(n,e+Mn(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=_u(r,!0):(Ds(e,0,Mh),t===void 0?t=a.rounding:Ds(t,0,8),r=Vt(new a(r),e+1,t),n=_u(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?_u(a):(Ds(e,0,Mh),t===void 0?t=s.rounding:Ds(t,0,8),r=Vt(new s(a),e+Mn(a)+1,t),n=_u(r.abs(),!1,e+Mn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Vt(new t(e),Mn(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,a,s,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(_a);if(l=new c(l),!l.s){if(e.s<1)throw Error(ho+"Infinity");return l}if(l.eq(_a))return l;if(r=c.precision,e.eq(_a))return Vt(l,r);if(t=e.e,n=e.d.length-1,i=t>=n,s=l.s,i){if((n=d<0?-d:d)<=LG){for(a=new c(_a),t=Math.ceil(r/en+4),sn=!1;n%2&&(a=a.times(l),rL(a.d,t)),n=Ih(n/2),n!==0;)l=l.times(l),rL(l.d,t);return sn=!0,e.s<0?new c(_a).div(a):Vt(a,r)}}else if(s<0)throw Error(ho+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,sn=!1,a=e.times(Gp(l,r+u)),sn=!0,a=BG(a),a.s=s,a};Me.toPrecision=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?(n=Mn(a),r=_u(a,n<=s.toExpNeg||n>=s.toExpPos)):(Ds(e,1,Mh),t===void 0?t=s.rounding:Ds(t,0,8),a=Vt(new s(a),e,t),n=Mn(a),r=_u(a,e<=n||n<=s.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ds(e,1,Mh),t===void 0?t=r.rounding:Ds(t,0,8)),Vt(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Mn(e),n=e.constructor;return _u(e,t<=n.toExpNeg||t>=n.toExpPos)};function FG(e,t){var n,r,a,s,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),sn?Vt(t,f):t;if(c=e.d,u=t.d,i=e.e,a=t.e,c=c.slice(),s=i-a,s){for(s<0?(r=c,s=-s,l=u.length):(r=u,a=i,l=c.length),i=Math.ceil(f/en),l=i>l?i+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/Yn|0,c[s]%=Yn;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,sn?Vt(t,f):t}function Ds(e,t,n){if(e!==~~e||e<t||e>n)throw Error(nu+e)}function ws(e){var t,n,r,a=e.length-1,s="",i=e[0];if(a>0){for(s+=i,t=1;t<a;t++)r=e[t]+"",n=en-r.length,n&&(s+=fl(n)),s+=r;i=e[t],r=i+"",n=en-r.length,n&&(s+=fl(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return s+i}var ji=function(){function e(r,a){var s,i=0,l=r.length;for(r=r.slice();l--;)s=r[l]*a+i,r[l]=s%Yn|0,i=s/Yn|0;return i&&r.unshift(i),r}function t(r,a,s,i){var l,c;if(s!=i)c=s>i?1:-1;else for(l=c=0;l<s;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,s){for(var i=0;s--;)r[s]-=i,i=r[s]<a[s]?1:0,r[s]=i*Yn+r[s]-a[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,s,i){var l,c,u,d,f,h,m,v,g,y,x,b,w,N,S,_,k,P,O=r.constructor,$=r.s==a.s?1:-1,T=r.d,z=a.d;if(!r.s)return new O(r);if(!a.s)throw Error(ho+"Division by zero");for(c=r.e-a.e,k=z.length,S=T.length,m=new O($),v=m.d=[],u=0;z[u]==(T[u]||0);)++u;if(z[u]>(T[u]||0)&&--c,s==null?b=s=O.precision:i?b=s+(Mn(r)-Mn(a))+1:b=s,b<0)return new O(0);if(b=b/en+2|0,u=0,k==1)for(d=0,z=z[0],b++;(u<S||d)&&b--;u++)w=d*Yn+(T[u]||0),v[u]=w/z|0,d=w%z|0;else{for(d=Yn/(z[0]+1)|0,d>1&&(z=e(z,d),T=e(T,d),k=z.length,S=T.length),N=k,g=T.slice(0,k),y=g.length;y<k;)g[y++]=0;P=z.slice(),P.unshift(0),_=z[0],z[1]>=Yn/2&&++_;do d=0,l=t(z,g,k,y),l<0?(x=g[0],k!=y&&(x=x*Yn+(g[1]||0)),d=x/_|0,d>1?(d>=Yn&&(d=Yn-1),f=e(z,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,n(f,k<h?P:z,h))):(d==0&&(l=d=1),f=z.slice()),h=f.length,h<y&&f.unshift(0),n(g,f,y),l==-1&&(y=g.length,l=t(z,g,k,y),l<1&&(d++,n(g,k<y?P:z,y))),y=g.length):l===0&&(d++,g=[0]),v[u++]=d,l&&g[0]?g[y++]=T[N]||0:(g=[T[N]],y=1);while((N++<S||g[0]!==void 0)&&b--)}return v[0]||v.shift(),m.e=c,Vt(m,i?s+Mn(m)+1:s)}}();function BG(e,t){var n,r,a,s,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(Mn(e)>16)throw Error(pT+Mn(e));if(!e.s)return new d(_a);for(t==null?(sn=!1,l=f):l=t,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(r=Math.log(Pc(2,u))/Math.LN10*2+5|0,l+=r,n=a=s=new d(_a),d.precision=l;;){if(a=Vt(a.times(e),l),n=n.times(++c),i=s.plus(ji(a,n,l)),ws(i.d).slice(0,l)===ws(s.d).slice(0,l)){for(;u--;)s=Vt(s.times(s),l);return d.precision=f,t==null?(sn=!0,Vt(s,f)):s}s=i}}function Mn(e){for(var t=e.e*en,n=e.d[0];n>=10;n/=10)t++;return t}function SN(e,t,n){if(t>e.LN10.sd())throw sn=!0,n&&(e.precision=n),Error(ho+"LN10 precision limit exceeded");return Vt(new e(e.LN10),t)}function fl(e){for(var t="";e--;)t+="0";return t}function Gp(e,t){var n,r,a,s,i,l,c,u,d,f=1,h=10,m=e,v=m.d,g=m.constructor,y=g.precision;if(m.s<1)throw Error(ho+(m.s?"NaN":"-Infinity"));if(m.eq(_a))return new g(0);if(t==null?(sn=!1,u=y):u=t,m.eq(10))return t==null&&(sn=!0),SN(g,u);if(u+=h,g.precision=u,n=ws(v),r=n.charAt(0),s=Mn(m),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=ws(m.d),r=n.charAt(0),f++;s=Mn(m),r>1?(m=new g("0."+n),s++):m=new g(r+"."+n.slice(1))}else return c=SN(g,u+2,y).times(s+""),m=Gp(new g(r+"."+n.slice(1)),u-h).plus(c),g.precision=y,t==null?(sn=!0,Vt(m,y)):m;for(l=i=m=ji(m.minus(_a),m.plus(_a),u),d=Vt(m.times(m),u),a=3;;){if(i=Vt(i.times(d),u),c=l.plus(ji(i,new g(a),u)),ws(c.d).slice(0,u)===ws(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(SN(g,u+2,y).times(s+""))),l=ji(l,new g(f),u),g.precision=y,t==null?(sn=!0,Vt(l,y)):l;l=c,a+=2}}function nL(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Ih(n/en),e.d=[],r=(n+1)%en,n<0&&(r+=en),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=en;r<a;)e.d.push(+t.slice(r,r+=en));t=t.slice(r),r=en-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),sn&&(e.e>Zb||e.e<-Zb))throw Error(pT+n)}else e.s=0,e.e=0,e.d=[0];return e}function Vt(e,t,n){var r,a,s,i,l,c,u,d,f=e.d;for(i=1,s=f[0];s>=10;s/=10)i++;if(r=t-i,r<0)r+=en,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/en),s=f.length,d>=s)return e;for(u=s=f[d],i=1;s>=10;s/=10)i++;r%=en,a=r-en+i}if(n!==void 0&&(s=Pc(10,i-a-1),l=u/s%10|0,c=t<0||f[d+1]!==void 0||u%s,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/Pc(10,i-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(s=Mn(e),f.length=1,t=t-s-1,f[0]=Pc(10,(en-t%en)%en),e.e=Ih(-t/en)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Pc(10,en-r),f[d]=a>0?(u/Pc(10,i-a)%Pc(10,a)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==Yn&&(f[0]=1,++e.e);break}else{if(f[d]+=s,f[d]!=Yn)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(sn&&(e.e>Zb||e.e<-Zb))throw Error(pT+Mn(e));return e}function zG(e,t){var n,r,a,s,i,l,c,u,d,f,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),sn?Vt(t,m):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r,i){for(d=i<0,d?(n=c,i=-i,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(m/en),l)+2,i>a&&(i=a,n.length=1),n.reverse(),a=i;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>i;){if(c[--a]<f[a]){for(s=a;s&&c[--s]===0;)c[s]=Yn-1;--c[s],c[a]+=Yn}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,sn?Vt(t,m):t):new h(0)}function _u(e,t,n){var r,a=Mn(e),s=ws(e.d),i=s.length;return t?(n&&(r=n-i)>0?s=s.charAt(0)+"."+s.slice(1)+fl(r):i>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(a<0?"e":"e+")+a):a<0?(s="0."+fl(-a-1)+s,n&&(r=n-i)>0&&(s+=fl(r))):a>=i?(s+=fl(a+1-i),n&&(r=n-a-1)>0&&(s=s+"."+fl(r))):((r=a+1)<i&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-i)>0&&(a+1===i&&(s+="."),s+=fl(r))),e.s<0?"-"+s:s}function rL(e,t){if(e.length>t)return e.length=t,!0}function UG(e){var t,n,r;function a(s){var i=this;if(!(i instanceof a))return new a(s);if(i.constructor=a,s instanceof a){i.s=s.s,i.e=s.e,i.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(nu+s);if(s>0)i.s=1;else if(s<0)s=-s,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(s===~~s&&s<1e7){i.e=0,i.d=[s];return}return nL(i,s.toString())}else if(typeof s!="string")throw Error(nu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),i.s=-1):i.s=1,iDe.test(s))nL(i,s);else throw Error(nu+s)}if(a.prototype=Me,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=UG,a.config=a.set=lDe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function lDe(e){if(!e||typeof e!="object")throw Error(ho+"Object expected");var t,n,r,a=["precision",1,Mh,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Ih(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(nu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(nu+n+": "+r);return this}var gT=UG(sDe);_a=new gT(1);const Ft=gT;function cDe(e){return hDe(e)||fDe(e)||dDe(e)||uDe()}function uDe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
887In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dDe(e,t){if(e){if(typeof e=="string")return Pk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pk(e,t)}}function fDe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hDe(e){if(Array.isArray(e))return Pk(e)}function Pk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mDe=function(t){return t},VG={"@@functional/placeholder":!0},WG=function(t){return t===VG},aL=function(t){return function n(){return arguments.length===0||arguments.length===1&&WG(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},pDe=function e(t,n){return t===1?n:aL(function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var i=a.filter(function(l){return l!==VG}).length;return i>=t?n.apply(void 0,a):e(t-i,aL(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return WG(f)?c.shift():f});return n.apply(void 0,cDe(d).concat(c))}))})},V1=function(t){return pDe(t.length,t)},Tk=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},gDe=V1(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),vDe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return mDe;var a=n.reverse(),s=a[0],i=a.slice(1);return function(){return i.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},Ok=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},qG=function(t){var n=null,r=null;return function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return n&&s.every(function(l,c){return l===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function yDe(e){var t;return e===0?t=1:t=Math.floor(new Ft(e).abs().log(10).toNumber())+1,t}function xDe(e,t,n){for(var r=new Ft(e),a=0,s=[];r.lt(t)&&a<1e5;)s.push(r.toNumber()),r=r.add(n),a++;return s}var bDe=V1(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),wDe=V1(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),jDe=V1(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const W1={rangeStep:xDe,getDigitCount:yDe,interpolateNumber:bDe,uninterpolateNumber:wDe,uninterpolateTruncation:jDe};function Mk(e){return _De(e)||NDe(e)||HG(e)||SDe()}function SDe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
888In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NDe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function _De(e){if(Array.isArray(e))return Ik(e)}function Yp(e,t){return EDe(e)||kDe(e,t)||HG(e,t)||CDe()}function CDe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
889In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HG(e,t){if(e){if(typeof e=="string")return Ik(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ik(e,t)}}function Ik(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kDe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,s=void 0;try{for(var i=e[Symbol.iterator](),l;!(r=(l=i.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,s=c}finally{try{!r&&i.return!=null&&i.return()}finally{if(a)throw s}}return n}}function EDe(e){if(Array.isArray(e))return e}function GG(e){var t=Yp(e,2),n=t[0],r=t[1],a=n,s=r;return n>r&&(a=r,s=n),[a,s]}function YG(e,t,n){if(e.lte(0))return new Ft(0);var r=W1.getDigitCount(e.toNumber()),a=new Ft(10).pow(r),s=e.div(a),i=r!==1?.05:.1,l=new Ft(Math.ceil(s.div(i).toNumber())).add(n).mul(i),c=l.mul(a);return t?c:new Ft(Math.ceil(c))}function ADe(e,t,n){var r=1,a=new Ft(e);if(!a.isint()&&n){var s=Math.abs(e);s<1?(r=new Ft(10).pow(W1.getDigitCount(e)-1),a=new Ft(Math.floor(a.div(r).toNumber())).mul(r)):s>1&&(a=new Ft(Math.floor(e)))}else e===0?a=new Ft(Math.floor((t-1)/2)):n||(a=new Ft(Math.floor(e)));var i=Math.floor((t-1)/2),l=vDe(gDe(function(c){return a.add(new Ft(c-i).mul(r)).toNumber()}),Tk);return l(0,t)}function KG(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ft(0),tickMin:new Ft(0),tickMax:new Ft(0)};var s=YG(new Ft(t).sub(e).div(n-1),r,a),i;e<=0&&t>=0?i=new Ft(0):(i=new Ft(e).add(t).div(2),i=i.sub(new Ft(i).mod(s)));var l=Math.ceil(i.sub(e).div(s).toNumber()),c=Math.ceil(new Ft(t).sub(i).div(s).toNumber()),u=l+c+1;return u>n?KG(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:s,tickMin:i.sub(new Ft(l).mul(s)),tickMax:i.add(new Ft(c).mul(s))})}function PDe(e){var t=Yp(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Math.max(a,2),l=GG([n,r]),c=Yp(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Mk(Tk(0,a-1).map(function(){return 1/0}))):[].concat(Mk(Tk(0,a-1).map(function(){return-1/0})),[d]);return n>r?Ok(f):f}if(u===d)return ADe(u,a,s);var h=KG(u,d,i,s),m=h.step,v=h.tickMin,g=h.tickMax,y=W1.rangeStep(v,g.add(new Ft(.1).mul(m)),m);return n>r?Ok(y):y}function TDe(e,t){var n=Yp(e,2),r=n[0],a=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=GG([r,a]),l=Yp(i,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=YG(new Ft(u).sub(c).div(d-1),s,0),h=[].concat(Mk(W1.rangeStep(new Ft(c),new Ft(u).sub(new Ft(.99).mul(f)),f)),[u]);return r>a?Ok(h):h}var ODe=qG(PDe),MDe=qG(TDe),IDe="Invariant failed";function Cu(e,t){throw new Error(IDe)}var $De=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function zf(e){"@babel/helpers - typeof";return zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zf(e)}function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e0.apply(this,arguments)}function DDe(e,t){return BDe(e)||FDe(e,t)||LDe(e,t)||RDe()}function RDe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
890In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LDe(e,t){if(e){if(typeof e=="string")return oL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oL(e,t)}}function oL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FDe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function BDe(e){if(Array.isArray(e))return e}function zDe(e,t){if(e==null)return{};var n=UDe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UDe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function VDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WDe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,QG(r.key),r)}}function qDe(e,t,n){return t&&WDe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HDe(e,t,n){return t=t0(t),GDe(e,XG()?Reflect.construct(t,n||[],t0(e).constructor):t.apply(e,n))}function GDe(e,t){if(t&&(zf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YDe(e)}function YDe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XG=function(){return!!e})()}function t0(e){return t0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},t0(e)}function KDe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$k(e,t)}function $k(e,t){return $k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$k(e,t)}function JG(e,t,n){return t=QG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QG(e){var t=XDe(e,"string");return zf(t)=="symbol"?t:t+""}function XDe(e,t){if(zf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cv=function(e){function t(){return VDe(this,t),HDe(this,t,arguments)}return KDe(t,e),qDe(t,[{key:"render",value:function(){var r=this.props,a=r.offset,s=r.layout,i=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=zDe(r,$De),m=vt(h,!1);this.props.direction==="x"&&d.type!=="number"&&Cu();var v=c.map(function(g){var y=u(g,l),x=y.x,b=y.y,w=y.value,N=y.errorVal;if(!N)return null;var S=[],_,k;if(Array.isArray(N)){var P=DDe(N,2);_=P[0],k=P[1]}else _=k=N;if(s==="vertical"){var O=d.scale,$=b+a,T=$+i,z=$-i,U=O(w-_),E=O(w+k);S.push({x1:E,y1:T,x2:E,y2:z}),S.push({x1:U,y1:$,x2:E,y2:$}),S.push({x1:U,y1:T,x2:U,y2:z})}else if(s==="horizontal"){var q=f.scale,W=x+a,L=W-i,M=W+i,B=q(w-_),I=q(w+k);S.push({x1:L,y1:I,x2:M,y2:I}),S.push({x1:W,y1:B,x2:W,y2:I}),S.push({x1:L,y1:B,x2:M,y2:B})}return H.createElement(Cn,e0({className:"recharts-errorBar",key:"bar-".concat(S.map(function(R){return"".concat(R.x1,"-").concat(R.x2,"-").concat(R.y1,"-").concat(R.y2)}))},m),S.map(function(R){return H.createElement("line",e0({},R,{key:"line-".concat(R.x1,"-").concat(R.x2,"-").concat(R.y1,"-").concat(R.y2)}))}))});return H.createElement(Cn,{className:"recharts-errorBars"},v)}}])}(H.Component);JG(cv,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});JG(cv,"displayName","ErrorBar");function Kp(e){"@babel/helpers - typeof";return Kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kp(e)}function sL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sL(Object(n),!0).forEach(function(r){JDe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JDe(e,t,n){return t=QDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QDe(e){var t=ZDe(e,"string");return Kp(t)=="symbol"?t:t+""}function ZDe(e,t){if(Kp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZG=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,s=t.legendContent,i=Sa(n,Bl);if(!i)return null;var l=Bl.defaultProps,c=l!==void 0?Nc(Nc({},l),i.props):{},u;return i.props&&i.props.payload?u=i.props&&i.props.payload:s==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,m=f.props,v=m.sectors||m.data||[];return d.concat(v.map(function(g){return{type:i.props.iconType||h.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,m=h!==void 0?Nc(Nc({},h),f.props):{},v=m.dataKey,g=m.name,y=m.legendType,x=m.hide;return{inactive:x,dataKey:v,type:c.iconType||y||"square",color:vT(f),value:g||v,payload:m}}),Nc(Nc(Nc({},c),Bl.getWithHeight(i,a)),{},{payload:u,item:i})};function Xp(e){"@babel/helpers - typeof";return Xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xp(e)}function iL(e){return r4e(e)||n4e(e)||t4e(e)||e4e()}function e4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
891In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t4e(e,t){if(e){if(typeof e=="string")return Dk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dk(e,t)}}function n4e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r4e(e){if(Array.isArray(e))return Dk(e)}function Dk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lL(Object(n),!0).forEach(function(r){ef(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ef(e,t,n){return t=a4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a4e(e){var t=o4e(e,"string");return Xp(t)=="symbol"?t:t+""}function o4e(e,t){if(Xp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ia(e,t,n){return dt(e)||dt(t)?n:Bn(t)?ro(e,t,n):ot(t)?t(e):n}function ep(e,t,n,r){var a=nDe(e,function(l){return Ia(l,t)});if(n==="number"){var s=a.filter(function(l){return je(l)||parseFloat(l)});return s.length?[z1(s),B1(s)]:[1/0,-1/0]}var i=r?a.filter(function(l){return!dt(l)}):a;return i.map(function(l){return Bn(l)||l instanceof Date?l:""})}var s4e=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,i=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,m=void 0;if(Lo(f-d)!==Lo(h-f)){var v=[];if(Lo(h-f)===Lo(c[1]-c[0])){m=h;var g=f+c[1]-c[0];v[0]=Math.min(g,(g+d)/2),v[1]=Math.max(g,(g+d)/2)}else{m=d;var y=h+c[1]-c[0];v[0]=Math.min(f,(y+f)/2),v[1]=Math.max(f,(y+f)/2)}var x=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(t>x[0]&&t<=x[1]||t>=v[0]&&t<=v[1]){i=a[u].index;break}}else{var b=Math.min(d,h),w=Math.max(d,h);if(t>(b+f)/2&&t<=(w+f)/2){i=a[u].index;break}}}else for(var N=0;N<l;N++)if(N===0&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N>0&&N<l-1&&t>(r[N].coordinate+r[N-1].coordinate)/2&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N===l-1&&t>(r[N].coordinate+r[N-1].coordinate)/2){i=r[N].index;break}return i},vT=function(t){var n,r=t,a=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?vn(vn({},t.type.defaultProps),t.props):t.props,i=s.stroke,l=s.fill,c;switch(a){case"Line":c=i;break;case"Area":case"Radar":c=i&&i!=="none"?i:l;break;default:c=l;break}return c},i4e=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,s=a===void 0?{}:a;if(!s)return{};for(var i={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var d=s[l[c]].stackGroups,f=Object.keys(d),h=0,m=f.length;h<m;h++){var v=d[f[h]],g=v.items,y=v.cateAxisId,x=g.filter(function(k){return xi(k.type).indexOf("Bar")>=0});if(x&&x.length){var b=x[0].type.defaultProps,w=b!==void 0?vn(vn({},b),x[0].props):x[0].props,N=w.barSize,S=w[y];i[S]||(i[S]=[]);var _=dt(N)?n:N;i[S].push({item:x[0],stackList:x.slice(1),barSize:dt(_)?void 0:Su(_,r,0)})}}return i},l4e=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,s=t.sizeList,i=s===void 0?[]:s,l=t.maxBarSize,c=i.length;if(c<1)return null;var u=Su(n,a,0,!0),d,f=[];if(i[0].barSize===+i[0].barSize){var h=!1,m=a/c,v=i.reduce(function(N,S){return N+S.barSize||0},0);v+=(c-1)*u,v>=a&&(v-=(c-1)*u,u=0),v>=a&&m>0&&(h=!0,m*=.9,v=c*m);var g=(a-v)/2>>0,y={offset:g-u,size:0};d=i.reduce(function(N,S){var _={item:S.item,position:{offset:y.offset+y.size+u,size:h?m:S.barSize}},k=[].concat(iL(N),[_]);return y=k[k.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){k.push({item:P,position:y})}),k},f)}else{var x=Su(r,a,0,!0);a-2*x-(c-1)*u<=0&&(u=0);var b=(a-2*x-(c-1)*u)/c;b>1&&(b>>=0);var w=l===+l?Math.min(b,l):b;d=i.reduce(function(N,S,_){var k=[].concat(iL(N),[{item:S.item,position:{offset:x+(b+u)*_+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){k.push({item:P,position:k[k.length-1].position})}),k},f)}return d},c4e=function(t,n,r,a){var s=r.children,i=r.width,l=r.margin,c=i-(l.left||0)-(l.right||0),u=ZG({children:s,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,m=u.align,v=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&v==="middle")&&m!=="center"&&je(t[m]))return vn(vn({},t),{},ef({},m,t[m]+(f||0)));if((g==="horizontal"||g==="vertical"&&m==="center")&&v!=="middle"&&je(t[v]))return vn(vn({},t),{},ef({},v,t[v]+(h||0)))}return t},u4e=function(t,n,r){return dt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},eY=function(t,n,r,a,s){var i=n.props.children,l=ao(i,cv).filter(function(u){return u4e(a,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Ia(d,r);if(dt(f))return u;var h=Array.isArray(f)?[z1(f),B1(f)]:[f,f],m=c.reduce(function(v,g){var y=Ia(d,g,0),x=h[0]-Math.abs(Array.isArray(y)?y[0]:y),b=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(x,v[0]),Math.max(b,v[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},d4e=function(t,n,r,a,s){var i=n.map(function(l){return eY(t,l,r,s,a)}).filter(function(l){return!dt(l)});return i&&i.length?i.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},tY=function(t,n,r,a,s){var i=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&eY(t,c,u,a)||ep(t,u,r,s)});if(r==="number")return i.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return i.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},nY=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},rY=function(t,n,r,a){if(a)return t.map(function(c){return c.coordinate});var s,i,l=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(i=!0),c.coordinate});return s||l.push(n),i||l.push(r),l},pi=function(t,n,r){if(!t)return null;var a=t.scale,s=t.duplicateDomain,i=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&i==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Lo(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!nv(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:s?s[f]:f,index:h,offset:u}})},NN=new WeakMap,Ay=function(t,n){if(typeof n!="function")return t;NN.has(t)||NN.set(t,new WeakMap);var r=NN.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},f4e=function(t,n,r){var a=t.scale,s=t.type,i=t.layout,l=t.axisType;if(a==="auto")return i==="radial"&&l==="radiusAxis"?{scale:Vp(),realScaleType:"band"}:i==="radial"&&l==="angleAxis"?{scale:Kb(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Zm(),realScaleType:"point"}:s==="category"?{scale:Vp(),realScaleType:"band"}:{scale:Kb(),realScaleType:"linear"};if(ju(a)){var c="scale".concat(k1(a));return{scale:(tL[c]||Zm)(),realScaleType:tL[c]?c:"point"}}return ot(a)?{scale:a}:{scale:Zm(),realScaleType:"point"}},cL=1e-4,h4e=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),s=Math.min(a[0],a[1])-cL,i=Math.max(a[0],a[1])+cL,l=t(n[0]),c=t(n[r-1]);(l<s||l>i||c<s||c>i)&&t.domain([n[0],n[r-1]])}},m4e=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},p4e=function(t,n){if(!n||n.length!==2||!je(n[0])||!je(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!je(t[0])||t[0]<r)&&(s[0]=r),(!je(t[1])||t[1]>a)&&(s[1]=a),s[0]>a&&(s[0]=a),s[1]<r&&(s[1]=r),s},g4e=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,i=0,l=0;l<n;++l){var c=nv(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=i,t[l][r][1]=i+c,i=t[l][r][1])}},v4e=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,i=0;i<n;++i){var l=nv(t[i][r][1])?t[i][r][0]:t[i][r][1];l>=0?(t[i][r][0]=s,t[i][r][1]=s+l,s=t[i][r][1]):(t[i][r][0]=0,t[i][r][1]=0)}},y4e={sign:g4e,expand:CNe,none:Mf,silhouette:kNe,wiggle:ENe,positive:v4e},x4e=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),s=y4e[r],i=_Ne().keys(a).value(function(l,c){return+Ia(l,c,0)}).order(sk).offset(s);return i(t)},b4e=function(t,n,r,a,s,i){if(!t)return null;var l=i?n.reverse():n,c={},u=l.reduce(function(f,h){var m,v=(m=h.type)!==null&&m!==void 0&&m.defaultProps?vn(vn({},h.type.defaultProps),h.props):h.props,g=v.stackId,y=v.hide;if(y)return f;var x=v[r],b=f[x]||{hasStack:!1,stackGroups:{}};if(Bn(g)){var w=b.stackGroups[g]||{numericAxisId:r,cateAxisId:a,items:[]};w.items.push(h),b.hasStack=!0,b.stackGroups[g]=w}else b.stackGroups[rv("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[h]};return vn(vn({},f),{},ef({},x,b))},c),d={};return Object.keys(u).reduce(function(f,h){var m=u[h];if(m.hasStack){var v={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(g,y){var x=m.stackGroups[y];return vn(vn({},g),{},ef({},y,{numericAxisId:r,cateAxisId:a,items:x.items,stackedData:x4e(t,x.items,s)}))},v)}return vn(vn({},f),{},ef({},h,m))},d)},w4e=function(t,n){var r=n.realScaleType,a=n.type,s=n.tickCount,i=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&a==="number"&&i&&(i[0]==="auto"||i[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=ODe(u,s,l);return t.domain([z1(d),B1(d)]),{niceTicks:d}}if(s&&a==="number"){var f=t.domain(),h=MDe(f,s,l);return{niceTicks:h}}return null};function uL(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,s=e.index,i=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dt(a[t.dataKey])){var l=Cb(n,"value",a[t.dataKey]);if(l)return l.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var c=Ia(a,dt(i)?t.dataKey:i);return dt(c)?null:t.scale(c)}var dL=function(t){var n=t.axis,r=t.ticks,a=t.offset,s=t.bandSize,i=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=Ia(i,n.dataKey,n.domain[l]);return dt(c)?null:n.scale(c)-s/2+a},j4e=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return a<=0&&s>=0?0:s<0?s:a}return r[0]},S4e=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?vn(vn({},t.type.defaultProps),t.props):t.props,s=a.stackId;if(Bn(s)){var i=n[s];if(i){var l=i.items.indexOf(t);return l>=0?i.stackedData[l]:null}}return null},N4e=function(t){return t.reduce(function(n,r){return[z1(r.concat([n[0]]).filter(je)),B1(r.concat([n[1]]).filter(je))]},[1/0,-1/0])},aY=function(t,n,r){return Object.keys(t).reduce(function(a,s){var i=t[s],l=i.stackedData,c=l.reduce(function(u,d){var f=N4e(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},fL=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hL=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Rk=function(t,n,r){if(ot(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(je(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(fL.test(t[0])){var s=+fL.exec(t[0])[1];a[0]=n[0]-s}else ot(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(je(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(hL.test(t[1])){var i=+hL.exec(t[1])[1];a[1]=n[1]+i}else ot(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},n0=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var s=qP(n,function(f){return f.coordinate}),i=1/0,l=1,c=s.length;l<c;l++){var u=s[l],d=s[l-1];i=Math.min((u.coordinate||0)-(d.coordinate||0),i)}return i===1/0?0:i}return r?void 0:0},mL=function(t,n,r){return!t||!t.length||U1(t,ro(r,"type.defaultProps.domain"))?n:t},oY=function(t,n){var r=t.type.defaultProps?vn(vn({},t.type.defaultProps),t.props):t.props,a=r.dataKey,s=r.name,i=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return vn(vn({},vt(t,!1)),{},{dataKey:a,unit:i,formatter:l,name:s||a,color:vT(t),value:Ia(n,a),type:c,payload:n,chartType:u,hide:d})};function Jp(e){"@babel/helpers - typeof";return Jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jp(e)}function pL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(n),!0).forEach(function(r){_4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _4e(e,t,n){return t=C4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C4e(e){var t=k4e(e,"string");return Jp(t)=="symbol"?t:t+""}function k4e(e,t){if(Jp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var r0=Math.PI/180,E4e=function(t){return t*180/Math.PI},fr=function(t,n,r,a){return{x:t+Math.cos(-r0*a)*r,y:n+Math.sin(-r0*a)*r}},A4e=function(t,n){var r=t.x,a=t.y,s=n.x,i=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(a-i,2))},P4e=function(t,n){var r=t.x,a=t.y,s=n.cx,i=n.cy,l=A4e({x:r,y:a},{x:s,y:i});if(l<=0)return{radius:l};var c=(r-s)/l,u=Math.acos(c);return a>i&&(u=2*Math.PI-u),{radius:l,angle:E4e(u),angleInRadian:u}},T4e=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),s=Math.floor(r/360),i=Math.min(a,s);return{startAngle:n-i*360,endAngle:r-i*360}},O4e=function(t,n){var r=n.startAngle,a=n.endAngle,s=Math.floor(r/360),i=Math.floor(a/360),l=Math.min(s,i);return t+l*360},vL=function(t,n){var r=t.x,a=t.y,s=P4e({x:r,y:a},n),i=s.radius,l=s.angle,c=n.innerRadius,u=n.outerRadius;if(i<c||i>u)return!1;if(i===0)return!0;var d=T4e(n),f=d.startAngle,h=d.endAngle,m=l,v;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;v=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;v=m>=h&&m<=f}return v?gL(gL({},n),{},{radius:i,angle:O4e(m,n)}):null};function Qp(e){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qp(e)}var M4e=["offset"];function I4e(e){return L4e(e)||R4e(e)||D4e(e)||$4e()}function $4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
892In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D4e(e,t){if(e){if(typeof e=="string")return Lk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lk(e,t)}}function R4e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function L4e(e){if(Array.isArray(e))return Lk(e)}function Lk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F4e(e,t){if(e==null)return{};var n=B4e(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function B4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yL(Object(n),!0).forEach(function(r){z4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z4e(e,t,n){return t=U4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U4e(e){var t=V4e(e,"string");return Qp(t)=="symbol"?t:t+""}function V4e(e,t){if(Qp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zp.apply(this,arguments)}var W4e=function(t){var n=t.value,r=t.formatter,a=dt(t.children)?n:t.children;return ot(r)?r(a):a},q4e=function(t,n){var r=Lo(n-t),a=Math.min(Math.abs(n-t),360);return r*a},H4e=function(t,n,r){var a=t.position,s=t.viewBox,i=t.offset,l=t.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,v=c.endAngle,g=c.clockWise,y=(f+h)/2,x=q4e(m,v),b=x>=0?1:-1,w,N;a==="insideStart"?(w=m+b*i,N=g):a==="insideEnd"?(w=v-b*i,N=!g):a==="end"&&(w=v+b*i,N=g),N=x<=0?N:!N;var S=fr(u,d,y,w),_=fr(u,d,y,w+(N?1:-1)*359),k="M".concat(S.x,",").concat(S.y,`
893    A`).concat(y,",").concat(y,",0,1,").concat(N?0:1,`,
894    `).concat(_.x,",").concat(_.y),P=dt(t.id)?rv("recharts-radial-line-"):t.id;return H.createElement("text",Zp({},r,{dominantBaseline:"central",className:yt("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:P,d:k})),H.createElement("textPath",{xlinkHref:"#".concat(P)},n))},G4e=function(t){var n=t.viewBox,r=t.offset,a=t.position,s=n,i=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(a==="outside"){var m=fr(i,l,u+r,h),v=m.x,g=m.y;return{x:v,y:g,textAnchor:v>=i?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:i,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:i,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:i,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,x=fr(i,l,y,h),b=x.x,w=x.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Y4e=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,s=t.position,i=n,l=i.x,c=i.y,u=i.width,d=i.height,f=d>=0?1:-1,h=f*a,m=f>0?"end":"start",v=f>0?"start":"end",g=u>=0?1:-1,y=g*a,x=g>0?"end":"start",b=g>0?"start":"end";if(s==="top"){var w={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:m};return Rn(Rn({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var N={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:v};return Rn(Rn({},N),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var S={x:l-y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Rn(Rn({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(s==="right"){var _={x:l+u+y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Rn(Rn({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:d}:{})}var k=r?{width:u,height:d}:{};return s==="insideLeft"?Rn({x:l+y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},k):s==="insideRight"?Rn({x:l+u-y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},k):s==="insideTop"?Rn({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:v},k):s==="insideBottom"?Rn({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:m},k):s==="insideTopLeft"?Rn({x:l+y,y:c+h,textAnchor:b,verticalAnchor:v},k):s==="insideTopRight"?Rn({x:l+u-y,y:c+h,textAnchor:x,verticalAnchor:v},k):s==="insideBottomLeft"?Rn({x:l+y,y:c+d-h,textAnchor:b,verticalAnchor:m},k):s==="insideBottomRight"?Rn({x:l+u-y,y:c+d-h,textAnchor:x,verticalAnchor:m},k):_h(s)&&(je(s.x)||Lc(s.x))&&(je(s.y)||Lc(s.y))?Rn({x:l+Su(s.x,u),y:c+Su(s.y,d),textAnchor:"end",verticalAnchor:"end"},k):Rn({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},K4e=function(t){return"cx"in t&&je(t.cx)};function kr(e){var t=e.offset,n=t===void 0?5:t,r=F4e(e,M4e),a=Rn({offset:n},r),s=a.viewBox,i=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!s||dt(l)&&dt(c)&&!p.isValidElement(u)&&!ot(u))return null;if(p.isValidElement(u))return p.cloneElement(u,a);var m;if(ot(u)){if(m=p.createElement(u,a),p.isValidElement(m))return m}else m=W4e(a);var v=K4e(s),g=vt(a,!0);if(v&&(i==="insideStart"||i==="insideEnd"||i==="end"))return H4e(a,m,g);var y=v?G4e(a):Y4e(a);return H.createElement(Ub,Zp({className:yt("recharts-label",f)},g,y,{breakAll:h}),m)}kr.displayName="Label";var sY=function(t){var n=t.cx,r=t.cy,a=t.angle,s=t.startAngle,i=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,m=t.top,v=t.left,g=t.width,y=t.height,x=t.clockWise,b=t.labelViewBox;if(b)return b;if(je(g)&&je(y)){if(je(f)&&je(h))return{x:f,y:h,width:g,height:y};if(je(m)&&je(v))return{x:m,y:v,width:g,height:y}}return je(f)&&je(h)?{x:f,y:h,width:0,height:0}:je(n)&&je(r)?{cx:n,cy:r,startAngle:s||a||0,endAngle:i||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:x}:t.viewBox?t.viewBox:{}},X4e=function(t,n){return t?t===!0?H.createElement(kr,{key:"label-implicit",viewBox:n}):Bn(t)?H.createElement(kr,{key:"label-implicit",viewBox:n,value:t}):p.isValidElement(t)?t.type===kr?p.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(kr,{key:"label-implicit",content:t,viewBox:n}):ot(t)?H.createElement(kr,{key:"label-implicit",content:t,viewBox:n}):_h(t)?H.createElement(kr,Zp({viewBox:n},t,{key:"label-implicit"})):null:null},J4e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,s=sY(t),i=ao(a,kr).map(function(c,u){return p.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return i;var l=X4e(t.label,n||s);return[l].concat(I4e(i))};kr.parseViewBox=sY;kr.renderCallByParent=J4e;function Q4e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Z4e=Q4e;const eRe=Dt(Z4e);function eg(e){"@babel/helpers - typeof";return eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eg(e)}var tRe=["valueAccessor"],nRe=["data","dataKey","clockWise","id","textBreakAll"];function rRe(e){return iRe(e)||sRe(e)||oRe(e)||aRe()}function aRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
895In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oRe(e,t){if(e){if(typeof e=="string")return Fk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fk(e,t)}}function sRe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iRe(e){if(Array.isArray(e))return Fk(e)}function Fk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a0.apply(this,arguments)}function xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xL(Object(n),!0).forEach(function(r){lRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lRe(e,t,n){return t=cRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cRe(e){var t=uRe(e,"string");return eg(t)=="symbol"?t:t+""}function uRe(e,t){if(eg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(eg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wL(e,t){if(e==null)return{};var n=dRe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dRe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fRe=function(t){return Array.isArray(t.value)?eRe(t.value):t.value};function Ul(e){var t=e.valueAccessor,n=t===void 0?fRe:t,r=wL(e,tRe),a=r.data,s=r.dataKey,i=r.clockWise,l=r.id,c=r.textBreakAll,u=wL(r,nRe);return!a||!a.length?null:H.createElement(Cn,{className:"recharts-label-list"},a.map(function(d,f){var h=dt(s)?n(d,f):Ia(d&&d.payload,s),m=dt(l)?{}:{id:"".concat(l,"-").concat(f)};return H.createElement(kr,a0({},vt(d,!0),u,m,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:kr.parseViewBox(dt(i)?d:bL(bL({},d),{},{clockWise:i})),key:"label-".concat(f),index:f}))}))}Ul.displayName="LabelList";function hRe(e,t){return e?e===!0?H.createElement(Ul,{key:"labelList-implicit",data:t}):H.isValidElement(e)||ot(e)?H.createElement(Ul,{key:"labelList-implicit",data:t,content:e}):_h(e)?H.createElement(Ul,a0({data:t},e,{key:"labelList-implicit"})):null:null}function mRe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=ao(r,Ul).map(function(i,l){return p.cloneElement(i,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var s=hRe(e.label,t);return[s].concat(rRe(a))}Ul.renderCallByParent=mRe;function tg(e){"@babel/helpers - typeof";return tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tg(e)}function Bk(){return Bk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bk.apply(this,arguments)}function jL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function SL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jL(Object(n),!0).forEach(function(r){pRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pRe(e,t,n){return t=gRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gRe(e){var t=vRe(e,"string");return tg(t)=="symbol"?t:t+""}function vRe(e,t){if(tg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yRe=function(t,n){var r=Lo(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Py=function(t){var n=t.cx,r=t.cy,a=t.radius,s=t.angle,i=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/r0,h=u?s:s+i*f,m=fr(n,r,d,h),v=fr(n,r,a,h),g=u?s-i*f:s,y=fr(n,r,d*Math.cos(f*r0),g);return{center:m,circleTangency:v,lineTangency:y,theta:f}},iY=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,i=t.startAngle,l=t.endAngle,c=yRe(i,l),u=i+c,d=fr(n,r,s,i),f=fr(n,r,s,u),h="M ".concat(d.x,",").concat(d.y,`
896    A `).concat(s,",").concat(s,`,0,
897    `).concat(+(Math.abs(c)>180),",").concat(+(i>u),`,
898    `).concat(f.x,",").concat(f.y,`
899  `);if(a>0){var m=fr(n,r,a,i),v=fr(n,r,a,u);h+="L ".concat(v.x,",").concat(v.y,`
900            A `).concat(a,",").concat(a,`,0,
901            `).concat(+(Math.abs(c)>180),",").concat(+(i<=u),`,
902            `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},xRe=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,i=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Lo(d-u),h=Py({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:i,cornerIsExternal:c}),m=h.circleTangency,v=h.lineTangency,g=h.theta,y=Py({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:i,cornerIsExternal:c}),x=y.circleTangency,b=y.lineTangency,w=y.theta,N=c?Math.abs(u-d):Math.abs(u-d)-g-w;if(N<0)return l?"M ".concat(v.x,",").concat(v.y,`
903        a`).concat(i,",").concat(i,",0,0,1,").concat(i*2,`,0
904        a`).concat(i,",").concat(i,",0,0,1,").concat(-i*2,`,0
905      `):iY({cx:n,cy:r,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d});var S="M ".concat(v.x,",").concat(v.y,`
906    A`).concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
907    A`).concat(s,",").concat(s,",0,").concat(+(N>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
908    A`).concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
909  `);if(a>0){var _=Py({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),k=_.circleTangency,P=_.lineTangency,O=_.theta,$=Py({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),T=$.circleTangency,z=$.lineTangency,U=$.theta,E=c?Math.abs(u-d):Math.abs(u-d)-O-U;if(E<0&&i===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(z.x,",").concat(z.y,`
910      A`).concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,`
911      A`).concat(a,",").concat(a,",0,").concat(+(E>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,`
912      A`).concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},bRe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lY=function(t){var n=SL(SL({},bRe),t),r=n.cx,a=n.cy,s=n.innerRadius,i=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(i<s||d===f)return null;var m=yt("recharts-sector",h),v=i-s,g=Su(l,v,0,!0),y;return g>0&&Math.abs(d-f)<360?y=xRe({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(g,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=iY({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:d,endAngle:f}),H.createElement("path",Bk({},vt(n,!0),{className:m,d:y,role:"img"}))};function ng(e){"@babel/helpers - typeof";return ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ng(e)}function zk(){return zk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zk.apply(this,arguments)}function NL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NL(Object(n),!0).forEach(function(r){wRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wRe(e,t,n){return t=jRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jRe(e){var t=SRe(e,"string");return ng(t)=="symbol"?t:t+""}function SRe(e,t){if(ng(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ng(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CL={curveBasisClosed:mNe,curveBasisOpen:pNe,curveBasis:hNe,curveBumpX:ZSe,curveBumpY:eNe,curveLinearClosed:gNe,curveLinear:A1,curveMonotoneX:vNe,curveMonotoneY:yNe,curveNatural:xNe,curveStep:bNe,curveStepAfter:jNe,curveStepBefore:wNe},Ty=function(t){return t.x===+t.x&&t.y===+t.y},fm=function(t){return t.x},hm=function(t){return t.y},NRe=function(t,n){if(ot(t))return t;var r="curve".concat(k1(t));return(r==="curveMonotone"||r==="curveBump")&&n?CL["".concat(r).concat(n==="vertical"?"Y":"X")]:CL[r]||A1},_Re=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,s=a===void 0?[]:a,i=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=NRe(r,l),f=u?s.filter(function(g){return Ty(g)}):s,h;if(Array.isArray(i)){var m=u?i.filter(function(g){return Ty(g)}):i,v=f.map(function(g,y){return _L(_L({},g),{},{base:m[y]})});return l==="vertical"?h=by().y(hm).x1(fm).x0(function(g){return g.base.x}):h=by().x(fm).y1(hm).y0(function(g){return g.base.y}),h.defined(Ty).curve(d),h(v)}return l==="vertical"&&je(i)?h=by().y(hm).x1(fm).x0(i):je(i)?h=by().x(fm).y1(hm).y0(i):h=oH().x(fm).y(hm),h.defined(Ty).curve(d),h(f)},Uk=function(t){var n=t.className,r=t.points,a=t.path,s=t.pathRef;if((!r||!r.length)&&!a)return null;var i=r&&r.length?_Re(t):a;return p.createElement("path",zk({},vt(t,!1),kb(t),{className:yt("recharts-curve",n),d:i,ref:s}))},CRe=Object.getOwnPropertyNames,kRe=Object.getOwnPropertySymbols,ERe=Object.prototype.hasOwnProperty;function kL(e,t){return function(r,a,s){return e(r,a,s)&&t(r,a,s)}}function Oy(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);var s=a.cache,i=s.get(n),l=s.get(r);if(i&&l)return i===r&&l===n;s.set(n,r),s.set(r,n);var c=e(n,r,a);return s.delete(n),s.delete(r),c}}function EL(e){return CRe(e).concat(kRe(e))}var ARe=Object.hasOwn||function(e,t){return ERe.call(e,t)};function Gu(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var PRe="__v",TRe="__o",ORe="_owner",AL=Object.getOwnPropertyDescriptor,PL=Object.keys;function MRe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function IRe(e,t){return Gu(e.getTime(),t.getTime())}function $Re(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function DRe(e,t){return e===t}function TL(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),s=e.entries(),i,l,c=0;(i=s.next())&&!i.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var h=i.value,m=l.value;if(n.equals(h[0],m[0],c,f,e,t,n)&&n.equals(h[1],m[1],h[0],m[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var RRe=Gu;function LRe(e,t,n){var r=PL(e),a=r.length;if(PL(t).length!==a)return!1;for(;a-- >0;)if(!cY(e,t,n,r[a]))return!1;return!0}function mm(e,t,n){var r=EL(e),a=r.length;if(EL(t).length!==a)return!1;for(var s,i,l;a-- >0;
912)if(s=r[a],!cY(e,t,n,s)||(i=AL(e,s),l=AL(t,s),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function FRe(e,t){return Gu(e.valueOf(),t.valueOf())}function BRe(e,t){return e.source===t.source&&e.flags===t.flags}function OL(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),s=e.values(),i,l;(i=s.next())&&!i.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(i.value,l.value,i.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function zRe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function URe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function cY(e,t,n,r){return(r===ORe||r===TRe||r===PRe)&&(e.$$typeof||t.$$typeof)?!0:ARe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var VRe="[object Arguments]",WRe="[object Boolean]",qRe="[object Date]",HRe="[object Error]",GRe="[object Map]",YRe="[object Number]",KRe="[object Object]",XRe="[object RegExp]",JRe="[object Set]",QRe="[object String]",ZRe="[object URL]",eLe=Array.isArray,ML=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,IL=Object.assign,tLe=Object.prototype.toString.call.bind(Object.prototype.toString);function nLe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,s=e.areMapsEqual,i=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(v,g,y){if(v===g)return!0;if(v==null||g==null)return!1;var x=typeof v;if(x!==typeof g)return!1;if(x!=="object")return x==="number"?i(v,g,y):x==="function"?a(v,g,y):!1;var b=v.constructor;if(b!==g.constructor)return!1;if(b===Object)return l(v,g,y);if(eLe(v))return t(v,g,y);if(ML!=null&&ML(v))return f(v,g,y);if(b===Date)return n(v,g,y);if(b===RegExp)return u(v,g,y);if(b===Map)return s(v,g,y);if(b===Set)return d(v,g,y);var w=tLe(v);return w===qRe?n(v,g,y):w===XRe?u(v,g,y):w===GRe?s(v,g,y):w===JRe?d(v,g,y):w===KRe?typeof v.then!="function"&&typeof g.then!="function"&&l(v,g,y):w===ZRe?h(v,g,y):w===HRe?r(v,g,y):w===VRe?l(v,g,y):w===WRe||w===YRe||w===QRe?c(v,g,y):!1}}function rLe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?mm:MRe,areDatesEqual:IRe,areErrorsEqual:$Re,areFunctionsEqual:DRe,areMapsEqual:r?kL(TL,mm):TL,areNumbersEqual:RRe,areObjectsEqual:r?mm:LRe,arePrimitiveWrappersEqual:FRe,areRegExpsEqual:BRe,areSetsEqual:r?kL(OL,mm):OL,areTypedArraysEqual:r?mm:zRe,areUrlsEqual:URe};if(n&&(a=IL({},a,n(a))),t){var s=Oy(a.areArraysEqual),i=Oy(a.areMapsEqual),l=Oy(a.areObjectsEqual),c=Oy(a.areSetsEqual);a=IL({},a,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:c})}return a}function aLe(e){return function(t,n,r,a,s,i,l){return e(t,n,l)}}function oLe(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,s=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,m=d.meta;return n(c,u,{cache:h,equals:a,meta:m,strict:s})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:s})};var i={cache:void 0,equals:a,meta:void 0,strict:s};return function(c,u){return n(c,u,i)}}var sLe=mc();mc({strict:!0});mc({circular:!0});mc({circular:!0,strict:!0});mc({createInternalComparator:function(){return Gu}});mc({strict:!0,createInternalComparator:function(){return Gu}});mc({circular:!0,createInternalComparator:function(){return Gu}});mc({circular:!0,createInternalComparator:function(){return Gu},strict:!0});function mc(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,s=e.strict,i=s===void 0?!1:s,l=rLe(e),c=nLe(l),u=r?r(c):aLe(c);return oLe({circular:n,comparator:c,createState:a,equals:u,strict:i})}function iLe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function $L(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(s){n<0&&(n=s),s-n>t?(e(s),n=-1):iLe(a)};requestAnimationFrame(r)}function Vk(e){"@babel/helpers - typeof";return Vk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vk(e)}function lLe(e){return fLe(e)||dLe(e)||uLe(e)||cLe()}
vendor: 50,089 bytes, lines 912-930
912function cLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
913In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uLe(e,t){if(e){if(typeof e=="string")return DL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DL(e,t)}}function DL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fLe(e){if(Array.isArray(e))return e}function hLe(){var e={},t=function(){return null},n=!1,r=function a(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var i=s,l=lLe(i),c=l[0],u=l.slice(1);if(typeof c=="number"){$L(a.bind(null,u),c);return}a(c),$L(a.bind(null,u));return}Vk(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function rg(e){"@babel/helpers - typeof";return rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rg(e)}function RL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function LL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(n),!0).forEach(function(r){uY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uY(e,t,n){return t=mLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mLe(e){var t=pLe(e,"string");return rg(t)==="symbol"?t:String(t)}function pLe(e,t){if(rg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gLe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(s){return a.includes(s)})})},vLe=function(t){return t},yLe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},tp=function(t,n){return Object.keys(n).reduce(function(r,a){return LL(LL({},r),{},uY({},a,t(a,n[a])))},{})},FL=function(t,n,r){return t.map(function(a){return"".concat(yLe(a)," ").concat(n,"ms ").concat(r)}).join(",")};function xLe(e,t){return jLe(e)||wLe(e,t)||dY(e,t)||bLe()}function bLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
914In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wLe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function jLe(e){if(Array.isArray(e))return e}function SLe(e){return CLe(e)||_Le(e)||dY(e)||NLe()}function NLe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
915In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dY(e,t){if(e){if(typeof e=="string")return Wk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wk(e,t)}}function _Le(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CLe(e){if(Array.isArray(e))return Wk(e)}function Wk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o0=1e-4,fY=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},hY=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},BL=function(t,n){return function(r){var a=fY(t,n);return hY(a,r)}},kLe=function(t,n){return function(r){var a=fY(t,n),s=[].concat(SLe(a.map(function(i,l){return i*l}).slice(1)),[0]);return hY(s,r)}},zL=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],s=n[1],i=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,s=0,i=1,l=1;break;case"ease":a=.25,s=.1,i=.25,l=1;break;case"ease-in":a=.42,s=0,i=1,l=1;break;case"ease-out":a=.42,s=0,i=.58,l=1;break;case"ease-in-out":a=0,s=0,i=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=xLe(u,4);a=d[0],s=d[1],i=d[2],l=d[3]}}}var f=BL(a,i),h=BL(s,l),m=kLe(a,i),v=function(x){return x>1?1:x<0?0:x},g=function(x){for(var b=x>1?1:x,w=b,N=0;N<8;++N){var S=f(w)-b,_=m(w);if(Math.abs(S-b)<o0||_<o0)return h(w);w=v(w-S/_)}return h(w)};return g.isStepper=!1,g},ELe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,s=a===void 0?8:a,i=t.dt,l=i===void 0?17:i,c=function(d,f,h){var m=-(d-f)*r,v=h*s,g=h+(m-v)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<o0&&Math.abs(g)<o0?[f,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},ALe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return zL(a);case"spring":return ELe();default:if(a.split("(")[0]==="cubic-bezier")return zL(a)}return typeof a=="function"?a:null};function ag(e){"@babel/helpers - typeof";return ag=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ag(e)}function UL(e){return OLe(e)||TLe(e)||mY(e)||PLe()}function PLe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
916In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OLe(e){if(Array.isArray(e))return Hk(e)}function VL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VL(Object(n),!0).forEach(function(r){qk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qk(e,t,n){return t=MLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MLe(e){var t=ILe(e,"string");return ag(t)==="symbol"?t:String(t)}function ILe(e,t){if(ag(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ag(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Le(e,t){return LLe(e)||RLe(e,t)||mY(e,t)||DLe()}function DLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
917In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mY(e,t){if(e){if(typeof e=="string")return Hk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hk(e,t)}}function Hk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RLe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function LLe(e){if(Array.isArray(e))return e}var s0=function(t,n,r){return t+(n-t)*r},Gk=function(t){var n=t.from,r=t.to;return n!==r},FLe=function e(t,n,r){var a=tp(function(s,i){if(Gk(i)){var l=t(i.from,i.to,i.velocity),c=$Le(l,2),u=c[0],d=c[1];return lr(lr({},i),{},{from:u,velocity:d})}return i},n);return r<1?tp(function(s,i){return Gk(i)?lr(lr({},i),{},{velocity:s0(i.velocity,a[s].velocity,r),from:s0(i.from,a[s].from,r)}):i},n):e(t,a,r-1)};const BLe=function(e,t,n,r,a){var s=gLe(e,t),i=s.reduce(function(y,x){return lr(lr({},y),{},qk({},x,[e[x],t[x]]))},{}),l=s.reduce(function(y,x){return lr(lr({},y),{},qk({},x,{from:e[x],velocity:0,to:t[x]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return tp(function(x,b){return b.from},l)},m=function(){return!Object.values(l).filter(Gk).length},v=function(x){u||(u=x);var b=x-u,w=b/n.dt;l=FLe(n,l,w),a(lr(lr(lr({},e),t),h())),u=x,m()||(c=requestAnimationFrame(f))},g=function(x){d||(d=x);var b=(x-d)/r,w=tp(function(S,_){return s0.apply(void 0,UL(_).concat([n(b)]))},i);if(a(lr(lr(lr({},e),t),w)),b<1)c=requestAnimationFrame(f);else{var N=tp(function(S,_){return s0.apply(void 0,UL(_).concat([n(1)]))},i);a(lr(lr(lr({},e),t),N))}};return f=n.isStepper?v:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Uf(e){"@babel/helpers - typeof";return Uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uf(e)}var zLe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function ULe(e,t){if(e==null)return{};var n=VLe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VLe(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function _N(e){return GLe(e)||HLe(e)||qLe(e)||WLe()}function WLe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
918In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qLe(e,t){if(e){if(typeof e=="string")return Yk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yk(e,t)}}function HLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GLe(e){if(Array.isArray(e))return Yk(e)}function Yk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WL(Object(n),!0).forEach(function(r){Im(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Im(e,t,n){return t=pY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pY(r.key),r)}}function XLe(e,t,n){return t&&KLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pY(e){var t=JLe(e,"string");return Uf(t)==="symbol"?t:String(t)}function JLe(e,t){if(Uf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Uf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kk(e,t)}function Kk(e,t){return Kk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Kk(e,t)}function ZLe(e){var t=e3e();return function(){var r=i0(e),a;if(t){var s=i0(this).constructor;a=Reflect.construct(r,arguments,s)}else a=r.apply(this,arguments);return Xk(this,a)}}function Xk(e,t){if(t&&(Uf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jk(e)}function Jk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e3e(){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 i0(e){return i0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},i0(e)}var Fi=function(e){QLe(n,e);var t=ZLe(n);function n(r,a){var s;YLe(this,n),s=t.call(this,r,a);var i=s.props,l=i.isActive,c=i.attributeName,u=i.from,d=i.to,f=i.steps,h=i.children,m=i.duration;if(s.handleStyleChange=s.handleStyleChange.bind(Jk(s)),s.changeStyle=s.changeStyle.bind(Jk(s)),!l||m<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),Xk(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},Xk(s);s.state={style:c?Im({},c,u):u}}else s.state={style:{}};return s}return XLe(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.isActive,i=a.canBegin;this.mounted=!0,!(!s||!i)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var s=this.props,i=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(l){if(!i){var m={style:c?Im({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(m);return}if(!(sLe(a.to,d)&&a.canBegin&&a.isActive)){var v=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=v||u?f:a.to;if(this.state&&h){var y={style:c?Im({},c,g):g};(c&&h[c]!==g||!c&&h!==g)&&this.setState(y)}this.runAnimation(jo(jo({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var s=this,i=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,m=BLe(i,l,ALe(u),c,this.changeStyle),v=function(){s.stopJSAnimation=m()};this.manager.start([h,d,v,c,f])}},{key:"runStepAnimation",value:function(a){var s=this,i=a.steps,l=a.begin,c=a.onAnimationStart,u=i[0],d=u.style,f=u.duration,h=f===void 0?0:f,m=function(g,y,x){if(x===0)return g;var b=y.duration,w=y.easing,N=w===void 0?"ease":w,S=y.style,_=y.properties,k=y.onAnimationEnd,P=x>0?i[x-1]:y,O=_||Object.keys(S);if(typeof N=="function"||N==="spring")return[].concat(_N(g),[s.runJSAnimation.bind(s,{from:P.style,to:S,duration:b,easing:N}),b]);var $=FL(O,b,N),T=jo(jo(jo({},P.style),S),{},{transition:$});return[].concat(_N(g),[T,b,k]).filter(vLe)};return this.manager.start([c].concat(_N(i.reduce(m,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=hLe());var s=a.begin,i=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,m=a.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var g=l?Im({},l,c):c,y=FL(Object.keys(g),i,u);v.start([d,s,jo(jo({},g),{},{transition:y}),i,f])}},{key:"render",value:function(){var a=this.props,s=a.children;a.begin;var i=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=ULe(a,zLe),u=p.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!l||u===0||i<=0)return s;var f=function(m){var v=m.props,g=v.style,y=g===void 0?{}:g,x=v.className,b=p.cloneElement(m,jo(jo({},c),{},{style:jo(jo({},y),d),className:x}));return b};return u===1?f(p.Children.only(s)):H.createElement("div",null,p.Children.map(s,function(h){return f(h)}))}}]),n}(p.PureComponent);Fi.displayName="Animate";Fi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Fi.propTypes={from:Ve.oneOfType([Ve.object,Ve.string]),to:Ve.oneOfType([Ve.object,Ve.string]),attributeName:Ve.string,duration:Ve.number,begin:Ve.number,easing:Ve.oneOfType([Ve.string,Ve.func]),steps:Ve.arrayOf(Ve.shape({duration:Ve.number.isRequired,style:Ve.object.isRequired,easing:Ve.oneOfType([Ve.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ve.func]),properties:Ve.arrayOf("string"),onAnimationEnd:Ve.func})),children:Ve.oneOfType([Ve.node,Ve.func]),isActive:Ve.bool,canBegin:Ve.bool,onAnimationEnd:Ve.func,shouldReAnimate:Ve.bool,onAnimationStart:Ve.func,onAnimationReStart:Ve.func};function og(e){"@babel/helpers - typeof";return og=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},og(e)}function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l0.apply(this,arguments)}function t3e(e,t){return o3e(e)||a3e(e,t)||r3e(e,t)||n3e()}function n3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
919In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r3e(e,t){if(e){if(typeof e=="string")return qL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qL(e,t)}}function qL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a3e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function o3e(e){if(Array.isArray(e))return e}function HL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function GL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){s3e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s3e(e,t,n){return t=i3e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i3e(e){var t=l3e(e,"string");return og(t)=="symbol"?t:t+""}function l3e(e,t){if(og(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(og(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var YL=function(t,n,r,a,s){var i=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(i>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,m=4;h<m;h++)f[h]=s[h]>i?i:s[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
920        `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
921        `).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
922        `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(i>0&&s===+s&&s>0){var v=Math.min(i,s);d="M ".concat(t,",").concat(n+l*v,`
923            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(n,`
924            L `).concat(t+r-c*v,",").concat(n,`
925            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*v,`
926            L `).concat(t+r,",").concat(n+a-l*v,`
927            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r-c*v,",").concat(n+a,`
928            L `).concat(t+c*v,",").concat(n+a,`
929            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*v," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},c3e=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,s=n.x,i=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),d=Math.max(s,s+l),f=Math.min(i,i+c),h=Math.max(i,i+c);return r>=u&&r<=d&&a>=f&&a<=h}return!1},u3e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yT=function(t){var n=GL(GL({},u3e),t),r=p.useRef(),a=p.useState(-1),s=t3e(a,2),i=s[0],l=s[1];p.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&l(N)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,m=n.className,v=n.animationEasing,g=n.animationDuration,y=n.animationBegin,x=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=yt("recharts-rectangle",m);return b?H.createElement(Fi,{canBegin:i>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:v,isActive:b},function(N){var S=N.width,_=N.height,k=N.x,P=N.y;return H.createElement(Fi,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:x,easing:v},H.createElement("path",l0({},vt(n,!0),{className:w,d:YL(k,P,S,_,h),ref:r})))}):H.createElement("path",l0({},vt(n,!0),{className:w,d:YL(c,u,d,f,h)}))};function Qk(){return Qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qk.apply(this,arguments)}var xT=function(t){var n=t.cx,r=t.cy,a=t.r,s=t.className,i=yt("recharts-dot",s);return n===+n&&r===+r&&a===+a?p.createElement("circle",Qk({},vt(t,!1),kb(t),{className:i,cx:n,cy:r,r:a})):null};function sg(e){"@babel/helpers - typeof";return sg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sg(e)}var d3e=["x","y","top","left","width","height","className"];function Zk(){return Zk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zk.apply(this,arguments)}function KL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function f3e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KL(Object(n),!0).forEach(function(r){h3e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h3e(e,t,n){return t=m3e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m3e(e){var t=p3e(e,"string");return sg(t)=="symbol"?t:t+""}function p3e(e,t){if(sg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function g3e(e,t){if(e==null)return{};var n=v3e(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function v3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var y3e=function(t,n,r,a,s,i){return"M".concat(t,",").concat(s,"v").concat(a,"M").concat(i,",").concat(n,"h").concat(r)},x3e=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,i=t.top,l=i===void 0?0:i,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,m=h===void 0?0:h,v=t.className,g=g3e(t,d3e),y=f3e({x:r,y:s,top:l,left:u,width:f,height:m},g);return!je(r)||!je(s)||!je(f)||!je(m)||!je(l)||!je(u)?null:H.createElement("path",Zk({},vt(y,!0),{className:yt("recharts-cross",v),d:y3e(r,s,f,m,l,u)}))},b3e=AH,w3e=b3e(Object.getPrototypeOf,Object),j3e=w3e,S3e=Yi,N3e=j3e,_3e=Ki,C3e="[object Object]",k3e=Function.prototype,E3e=Object.prototype,gY=k3e.toString,A3e=E3e.hasOwnProperty,P3e=gY.call(Object);function T3e(e){if(!_3e(e)||S3e(e)!=C3e)return!1;var t=N3e(e);if(t===null)return!0;var n=A3e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&gY.call(n)==P3e}var O3e=T3e;const M3e=Dt(O3e);var I3e=Yi,$3e=Ki,D3e="[object Boolean]";function R3e(e){return e===!0||e===!1||$3e(e)&&I3e(e)==D3e}var L3e=R3e;const F3e=Dt(L3e);function ig(e){"@babel/helpers - typeof";return ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ig(e)}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c0.apply(this,arguments)}function B3e(e,t){return W3e(e)||V3e(e,t)||U3e(e,t)||z3e()}function z3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
930In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U3e(e,t){if(e){if(typeof e=="string")return XL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XL(e,t)}}function XL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V3e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function W3e(e){if(Array.isArray(e))return e}function JL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function QL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JL(Object(n),!0).forEach(function(r){q3e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q3e(e,t,n){return t=H3e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H3e(e){var t=G3e(e,"string");return ig(t)=="symbol"?t:t+""}function G3e(e,t){if(ig(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ig(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZL=function(t,n,r,a,s){var i=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-i/2,",").concat(n+s),l+="L ".concat(t+r-i/2-a,",").concat(n+s),l+="L ".concat(t,",").concat(n," Z"),l},Y3e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},K3e=function(t){var n=QL(QL({},Y3e),t),r=p.useRef(),a=p.useState(-1),s=B3e(a,2),i=s[0],l=s[1];p.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,m=n.className,v=n.animationEasing,g=n.animationDuration,y=n.animationBegin,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var b=yt("recharts-trapezoid",m);return x?H.createElement(Fi,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:g,animationEasing:v,isActive:x},function(w){var N=w.upperWidth,S=w.lowerWidth,_=w.height,k=w.x,P=w.y;return H.createElement(Fi,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:v},H.createElement("path",c0({},vt(n,!0),{className:b,d:ZL(k,P,N,S,_),ref:r})))}):H.createElement("g",null,H.createElement("path",c0({},vt(n,!0),{className:b,d:ZL(c,u,d,f,h)})))},X3e=["option","shapeType","propTransformer","activeClassName","isActive"];function lg(e){"@babel/helpers - typeof";return lg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lg(e)}function J3e(e,t){if(e==null)return{};var n=Q3e(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Q3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function e3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function u0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e3(Object(n),!0).forEach(function(r){Z3e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z3e(e,t,n){return t=e5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e5e(e){var t=t5e(e,"string");return lg(t)=="symbol"?t:t+""}function t5e(e,t){if(lg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(lg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n5e(e,t){return u0(u0({},t),e)}function r5e(e,t){return e==="symbols"}function t3(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(yT,n);case"trapezoid":return H.createElement(K3e,n);case"sector":return H.createElement(lY,n);case"symbols":if(r5e(t))return H.createElement(RP,n);break;default:return null}}function a5e(e){return p.isValidElement(e)?e.props:e}function o5e(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?n5e:r,s=e.activeClassName,i=s===void 0?"recharts-active-shape":s,l=e.isActive,c=J3e(e,X3e),u;if(p.isValidElement(t))u=p.cloneElement(t,u0(u0({},c),a5e(t)));else if(ot(t))u=t(c);else if(M3e(t)&&!F3e(t)){var d=a(t,c);u=H.createElement(t3,{shapeType:n,elementProps:d})}else{var f=c;u=H.createElement(t3,{shapeType:n,elementProps:f})}return l?H.createElement(Cn,{className:i},u):u}function q1(e,t){return t!=null&&"trapezoids"in e.props}function H1(e,t){return t!=null&&"sectors"in e.props}function cg(e,t){return t!=null&&"points"in e.props}function s5e(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&s}function i5e(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function l5e(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function c5e(e,t){var n;return q1(e,t)?n=s5e:H1(e,t)?n=i5e:cg(e,t)&&(n=l5e),n}function u5e(e,t){var n;return q1(e,t)?n="trapezoids":H1(e,t)?n="sectors":cg(e,t)&&(n="points"),n}function d5e(e,t){if(q1(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(H1(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return cg(e,t)?t.payload:{}}function f5e(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=u5e(n,t),s=d5e(n,t),i=r.filter(function(c,u){var d=U1(s,c),f=n.props[a].filter(function(v){var g=c5e(n,t);return g(v,t)}),h=n.props[a].indexOf(f[f.length-1]),m=u===h;return d&&m}),l=r.indexOf(i[i.length-1]);return l}var h5e=Math.ceil,m5e=Math.max;function p5e(e,t,n,r){for(var a=-1,s=m5e(h5e((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++a]=e,e+=n;return i}var g5e=p5e,v5e=YH,n3=1/0,y5e=17976931348623157e292;function x5e(e){if(!e)return e===0?e:0;if(e=v5e(e),e===n3||e===-n3){var t=e<0?-1:1;return t*y5e}return e===e?e:0}var vY=x5e,b5e=g5e,w5e=M1,CN=vY;function j5e(e){return function(t,n,r){return r&&typeof r!="number"&&w5e(t,n,r)&&(n=r=void 0),t=CN(t),n===void 0?(n=t,t=0):n=CN(n),r=r===void 0?t<n?1:-1:CN(r),b5e(t,n,r,e)}}var S5e=j5e,N5e=S5e,_5e=N5e(),C5e=_5e;const d0=Dt(C5e);function ug(e){"@babel/helpers - typeof";return ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ug(e)}function r3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function a3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r3(Object(n),!0).forEach(function(r){yY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yY(e,t,n){return t=k5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k5e(e){var t=E5e(e,"string");return ug(t)=="symbol"?t:t+""}function E5e(e,t){if(ug(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ug(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A5e=["Webkit","Moz","O","ms"],P5e=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),a=A5e.reduce(function(s,i){return a3(a3({},s),{},yY({},i+r,n))},{});return a[t]=n,a};function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}function f0(){return f0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f0.apply(this,arguments)}function o3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o3(Object(n),!0).forEach(function(r){wa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bY(r.key),r)}}function O5e(e,t,n){return t&&s3(e.prototype,t),n&&s3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function M5e(e,t,n){return t=h0(t),I5e(e,xY()?Reflect.construct(t,n||[],h0(e).constructor):t.apply(e,n))}function I5e(e,t){if(t&&(Vf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $5e(e)}function $5e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xY=function(){return!!e})()}function h0(e){return h0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},h0(e)}function D5e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eE(e,t)}function eE(e,t){return eE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eE(e,t)}function wa(e,t,n){return t=bY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bY(e){var t=R5e(e,"string");return Vf(t)=="symbol"?t:t+""}function R5e(e,t){if(Vf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var L5e=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,s=t.x,i=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=Zm().domain(d0(0,c)).range([s,s+i-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},i3=function(t){return t.changedTouches&&!!t.changedTouches.length},Wf=function(e){function t(n){var r;return T5e(this,t),r=M5e(this,t,[n]),wa(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),wa(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),wa(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,s=a.endIndex,i=a.onDragEnd,l=a.startIndex;i==null||i({endIndex:s,startIndex:l})}),r.detachDragEndListener()}),wa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wa(r,"handleSlideDragStart",function(a){var s=i3(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return D5e(t,e),O5e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,s=r.endX,i=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,s),h=Math.max(a,s),m=t.getIndexInRange(i,f),v=t.getIndexInRange(i,h);return{startIndex:m-m%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,s=a.data,i=a.tickFormatter,l=a.dataKey,c=Ia(s[r],l,r);return ot(i)?i(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,s=a.slideMoveStartX,i=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,v=c.onChange,g=r.pageX-s;g>0?g=Math.min(g,u+d-f-l,u+d-f-i):g<0&&(g=Math.max(g,u-i,u-l));var y=this.getIndex({startX:i+g,endX:l+g});(y.startIndex!==h||y.endIndex!==m)&&v&&v(y),this.setState({startX:i+g,endX:l+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var s=i3(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,s=a.brushMoveStartX,i=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[i],d=this.props,f=d.x,h=d.width,m=d.travellerWidth,v=d.onChange,g=d.gap,y=d.data,x={startX:this.state.startX,endX:this.state.endX},b=r.pageX-s;b>0?b=Math.min(b,f+h-m-u):b<0&&(b=Math.max(b,f-u)),x[i]=u+b;var w=this.getIndex(x),N=w.startIndex,S=w.endIndex,_=function(){var P=y.length-1;return i==="startX"&&(l>c?N%g===0:S%g===0)||l<c&&S===P||i==="endX"&&(l>c?S%g===0:N%g===0)||l>c&&S===P};this.setState(wa(wa({},i,u+b),"brushMoveStartX",r.pageX),function(){v&&_()&&v(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var s=this,i=this.state,l=i.scaleValues,c=i.startX,u=i.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var m=l[h];a==="startX"&&m>=u||a==="endX"&&m<=c||this.setState(wa({},a,m),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,s=r.y,i=r.width,l=r.height,c=r.fill,u=r.stroke;return H.createElement("rect",{stroke:u,fill:c,x:a,y:s,width:i,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,s=r.y,i=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=p.Children.only(u);return f?H.cloneElement(f,{x:a,y:s,width:i,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var s,i,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,v=c.data,g=c.startIndex,y=c.endIndex,x=Math.max(r,this.props.x),b=kN(kN({},vt(this.props,!1)),{},{x,y:u,width:d,height:f}),w=m||"Min value: ".concat((s=v[g])===null||s===void 0?void 0:s.name,", Max value: ").concat((i=v[y])===null||i===void 0?void 0:i.name);return H.createElement(Cn,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,b))}},{key:"renderSlide",value:function(r,a){var s=this.props,i=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return H.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:i,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,s=r.endIndex,i=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,m=5,v={pointerEvents:"none",fill:u};return H.createElement(Cn,{className:"recharts-brush-texts"},H.createElement(Ub,f0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:i+l/2},v),this.getTextOfTick(a)),H.createElement(Ub,f0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:i+l/2},v),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,a=r.data,s=r.className,i=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,m=h.startX,v=h.endX,g=h.isTextActive,y=h.isSlideMoving,x=h.isTravellerMoving,b=h.isTravellerFocused;if(!a||!a.length||!je(l)||!je(c)||!je(u)||!je(d)||u<=0||d<=0)return null;var w=yt("recharts-brush",s),N=H.Children.count(i)===1,S=P5e("userSelect","none");return H.createElement(Cn,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(m,v),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(v,"endX"),(g||y||x||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,s=r.y,i=r.width,l=r.height,c=r.stroke,u=Math.floor(s+l/2)-1;return H.createElement(H.Fragment,null,H.createElement("rect",{x:a,y:s,width:i,height:l,fill:c,stroke:"none"}),H.createElement("line",{x1:a+1,y1:u,x2:a+i-1,y2:u,fill:"none",stroke:"#fff"}),H.createElement("line",{x1:a+1,y1:u+2,x2:a+i-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var s;return H.isValidElement(r)?s=H.cloneElement(r,a):ot(r)?s=r(a):s=t.renderDefaultTraveller(a),s}},{key:"getDerivedStateFromProps",value:function(r,a){var s=r.data,i=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==a.prevData||u!==a.prevUpdateId)return kN({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:i},s&&s.length?L5e({data:s,width:i,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(i!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+i-c]);var h=a.scale.domain().map(function(m){return a.scale(m)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:i,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var s=r.length,i=0,l=s-1;l-i>1;){var c=Math.floor((i+l)/2);r[c]>a?l=c:i=c}return a>=r[l]?l:i}}])}(p.PureComponent);wa(Wf,"displayName","Brush");wa(Wf,"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 F5e=WP;function B5e(e,t){var n;return F5e(e,function(r,a,s){return n=t(r,a,s),!n}),!!n}var z5e=B5e,U5e=wH,V5e=dc,W5e=z5e,q5e=ha,H5e=M1;function G5e(e,t,n){var r=q5e(e)?U5e:W5e;return n&&H5e(e,t,n)&&(t=void 0),r(e,V5e(t))}var Y5e=G5e;const K5e=Dt(Y5e);var ks=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},l3=VH;
930function X5e(e,t,n){t=="__proto__"&&l3?l3(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var J5e=X5e,Q5e=J5e,Z5e=zH,eFe=dc;function tFe(e,t){var n={};return t=eFe(t),Z5e(e,function(r,a,s){Q5e(n,a,t(r,a,s))}),n}var nFe=tFe;const rFe=Dt(nFe);function aFe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var oFe=aFe,sFe=WP;function iFe(e,t){var n=!0;return sFe(e,function(r,a,s){return n=!!t(r,a,s),n}),n}var lFe=iFe,cFe=oFe,uFe=lFe,dFe=dc,fFe=ha,hFe=M1;function mFe(e,t,n){var r=fFe(e)?cFe:uFe;return n&&hFe(e,t,n)&&(t=void 0),r(e,dFe(t))}var pFe=mFe;const wY=Dt(pFe);var gFe=["x","y"];function dg(e){"@babel/helpers - typeof";return dg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dg(e)}function tE(){return tE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tE.apply(this,arguments)}function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(n),!0).forEach(function(r){vFe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vFe(e,t,n){return t=yFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yFe(e){var t=xFe(e,"string");return dg(t)=="symbol"?t:t+""}function xFe(e,t){if(dg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bFe(e,t){if(e==null)return{};var n=wFe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wFe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jFe(e,t){var n=e.x,r=e.y,a=bFe(e,gFe),s="".concat(n),i=parseInt(s,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return pm(pm(pm(pm(pm({},t),a),i?{x:i}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function u3(e){return H.createElement(o5e,tE({shapeType:"rectangle",propTransformer:jFe,activeClassName:"recharts-active-bar"},e))}var SFe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var s=je(r)||Lje(r);return s?t(r,a):(s||Cu(),n)}},NFe=["value","background"],jY;function qf(e){"@babel/helpers - typeof";return qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qf(e)}function _Fe(e,t){if(e==null)return{};var n=CFe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CFe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m0.apply(this,arguments)}function d3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 106,209 bytes, lines 930-935
930t%2?d3(Object(n),!0).forEach(function(r){kl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,NY(r.key),r)}}function EFe(e,t,n){return t&&f3(e.prototype,t),n&&f3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function AFe(e,t,n){return t=p0(t),PFe(e,SY()?Reflect.construct(t,n||[],p0(e).constructor):t.apply(e,n))}function PFe(e,t){if(t&&(qf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TFe(e)}function TFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SY=function(){return!!e})()}function p0(e){return p0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},p0(e)}function OFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nE(e,t)}function nE(e,t){return nE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},nE(e,t)}function kl(e,t,n){return t=NY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NY(e){var t=MFe(e,"string");return qf(t)=="symbol"?t:t+""}function MFe(e,t){if(qf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Si=function(e){function t(){var n;kFe(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=AFe(this,t,[].concat(a)),kl(n,"state",{isAnimationFinished:!1}),kl(n,"id",rv("recharts-bar-")),kl(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),i&&i()}),kl(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),i&&i()}),n}return OFe(t,e),EFe(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,s=this.props,i=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,d=vt(this.props,!1);return r&&r.map(function(f,h){var m=h===c,v=m?u:i,g=Pn(Pn(Pn({},d),f),{},{isActive:m,option:v,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return H.createElement(Cn,m0({className:"recharts-bar-rectangle"},Eb(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),H.createElement(u3,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,s=a.data,i=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return H.createElement(Fi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var v=m.t,g=s.map(function(y,x){var b=h&&h[x];if(b){var w=$o(b.x,y.x),N=$o(b.y,y.y),S=$o(b.width,y.width),_=$o(b.height,y.height);return Pn(Pn({},y),{},{x:w(v),y:N(v),width:S(v),height:_(v)})}if(i==="horizontal"){var k=$o(0,y.height),P=k(v);return Pn(Pn({},y),{},{y:y.y+y.height-P,height:P})}var O=$o(0,y.width),$=O(v);return Pn(Pn({},y),{},{width:$})});return H.createElement(Cn,null,r.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,s=r.isAnimationActive,i=this.state.prevData;return s&&a&&a.length&&(!i||!U1(i,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,s=a.data,i=a.dataKey,l=a.activeIndex,c=vt(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,h=_Fe(u,NFe);if(!f)return null;var m=Pn(Pn(Pn(Pn(Pn({},h),{},{fill:"#eee"},f),c),Eb(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:i,index:d,className:"recharts-bar-background-rectangle"});return H.createElement(u3,m0({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},m))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,i=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=ao(d,cv);if(!f)return null;var h=u==="vertical"?i[0].height/2:i[0].width/2,m=function(y,x){var b=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:b,errorVal:Ia(y,x)}},v={clipPath:r?"url(#clipPath-".concat(a,")"):null};return H.createElement(Cn,v,f.map(function(g){return H.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:i,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,s=r.data,i=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,m=r.isAnimationActive,v=r.background,g=r.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,x=yt("recharts-bar",i),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,N=b||w,S=dt(g)?this.id:g;return H.createElement(Cn,{className:x},b||w?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(S)},H.createElement("rect",{x:b?u:u-f/2,y:w?d:d-h/2,width:b?f:f*2,height:w?h:h*2}))):null,H.createElement(Cn,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(S,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,S),(!m||y)&&Ul.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(p.PureComponent);jY=Si;kl(Si,"displayName","Bar");kl(Si,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wi.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});kl(Si,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,s=e.xAxis,i=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=m4e(r,n);if(!m)return null;var v=t.layout,g=n.type.defaultProps,y=g!==void 0?Pn(Pn({},g),n.props):n.props,x=y.dataKey,b=y.children,w=y.minPointSize,N=v==="horizontal"?i:s,S=u?N.scale.domain():null,_=j4e({numericAxis:N}),k=ao(b,XH),P=f.map(function(O,$){var T,z,U,E,q,W;u?T=p4e(u[d+$],S):(T=Ia(O,x),Array.isArray(T)||(T=[_,T]));var L=SFe(w,jY.defaultProps.minPointSize)(T[1],$);if(v==="horizontal"){var M,B=[i.scale(T[0]),i.scale(T[1])],I=B[0],R=B[1];z=dL({axis:s,ticks:l,bandSize:a,offset:m.offset,entry:O,index:$}),U=(M=R??I)!==null&&M!==void 0?M:void 0,E=m.size;var F=I-R;if(q=Number.isNaN(F)?0:F,W={x:z,y:i.y,width:E,height:i.height},Math.abs(L)>0&&Math.abs(q)<Math.abs(L)){var j=Lo(q||L)*(Math.abs(L)-Math.abs(q));U-=j,q+=j}}else{var C=[s.scale(T[0]),s.scale(T[1])],A=C[0],D=C[1];if(z=A,U=dL({axis:i,ticks:c,bandSize:a,offset:m.offset,entry:O,index:$}),E=D-A,q=m.size,W={x:s.x,y:U,width:s.width,height:q},Math.abs(L)>0&&Math.abs(E)<Math.abs(L)){var V=Lo(E||L)*(Math.abs(L)-Math.abs(E));E+=V}}return Pn(Pn(Pn({},O),{},{x:z,y:U,width:E,height:q,value:u?T:T[1],payload:O,background:W},k&&k[$]&&k[$].props),{},{tooltipPayload:[oY(n,O)],tooltipPosition:{x:z+E/2,y:U+q/2}})});return Pn({data:P,layout:v},h)});function fg(e){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fg(e)}function IFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_Y(r.key),r)}}function $Fe(e,t,n){return t&&h3(e.prototype,t),n&&h3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m3(Object(n),!0).forEach(function(r){G1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G1(e,t,n){return t=_Y(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Y(e){var t=DFe(e,"string");return fg(t)=="symbol"?t:t+""}function DFe(e,t){if(fg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CY=function(t,n,r,a,s){var i=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:i-r.right,rightMirror:i-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!Sa(u,Si);return d.reduce(function(m,v){var g=n[v],y=g.orientation,x=g.domain,b=g.padding,w=b===void 0?{}:b,N=g.mirror,S=g.reversed,_="".concat(y).concat(N?"Mirror":""),k,P,O,$,T;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var z=x[1]-x[0],U=1/0,E=g.categoricalDomain.sort(zje);if(E.forEach(function(C,A){A>0&&(U=Math.min((C||0)-(E[A-1]||0),U))}),Number.isFinite(U)){var q=U/z,W=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(k=q*W/2),g.padding==="no-gap"){var L=Su(t.barCategoryGap,q*W),M=q*W/2;k=M-L-(M-L)/W*L}}}a==="xAxis"?P=[r.left+(w.left||0)+(k||0),r.left+r.width-(w.right||0)-(k||0)]:a==="yAxis"?P=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(k||0),r.top+r.height-(w.bottom||0)-(k||0)]:P=g.range,S&&(P=[P[1],P[0]]);var B=f4e(g,s,h),I=B.scale,R=B.realScaleType;I.domain(x).range(P),h4e(I);var F=w4e(I,To(To({},g),{},{realScaleType:R}));a==="xAxis"?(T=y==="top"&&!N||y==="bottom"&&N,O=r.left,$=f[_]-T*g.height):a==="yAxis"&&(T=y==="left"&&!N||y==="right"&&N,O=f[_]-T*g.width,$=r.top);var j=To(To(To({},g),F),{},{realScaleType:R,x:O,y:$,scale:I,width:a==="xAxis"?r.width:g.width,height:a==="yAxis"?r.height:g.height});return j.bandSize=n0(j,F),!g.hide&&a==="xAxis"?f[_]+=(T?-1:1)*j.height:g.hide||(f[_]+=(T?-1:1)*j.width),To(To({},m),{},G1({},v,j))},{})},kY=function(t,n){var r=t.x,a=t.y,s=n.x,i=n.y;return{x:Math.min(r,s),y:Math.min(a,i),width:Math.abs(s-r),height:Math.abs(i-a)}},RFe=function(t){var n=t.x1,r=t.y1,a=t.x2,s=t.y2;return kY({x:n,y:r},{x:a,y:s})},EY=function(){function e(t){IFe(this,e),this.scale=t}return $Fe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+i}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],s=r[r.length-1];return a<=s?n>=a&&n<=s:n>=s&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();G1(EY,"EPS",1e-4);var bT=function(t){var n=Object.keys(t).reduce(function(r,a){return To(To({},r),{},G1({},a,EY.create(t[a])))},{});return To(To({},n),{},{apply:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.bandAware,l=s.position;return rFe(a,function(c,u){return n[u].apply(c,{bandAware:i,position:l})})},isInRange:function(a){return wY(a,function(s,i){return n[i].isInRange(s)})}})};function LFe(e){return(e%180+180)%180}var FFe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=LFe(a),i=s*Math.PI/180,l=Math.atan(r/n),c=i>l&&i<Math.PI-l?r/Math.sin(i):n/Math.cos(i);return Math.abs(c)},BFe=dc,zFe=av,UFe=T1;function VFe(e){return function(t,n,r){var a=Object(t);if(!zFe(t)){var s=BFe(n);t=UFe(t),n=function(l){return s(a[l],l,a)}}var i=e(t,n,r);return i>-1?a[s?t[i]:i]:void 0}}var WFe=VFe,qFe=vY;function HFe(e){var t=qFe(e),n=t%1;return t===t?n?t-n:t:0}var GFe=HFe,YFe=$H,KFe=dc,XFe=GFe,JFe=Math.max;function QFe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:XFe(n);return a<0&&(a=JFe(r+a,0)),YFe(e,KFe(t),a)}var ZFe=QFe,e6e=WFe,t6e=ZFe,n6e=e6e(t6e),r6e=n6e;const a6e=Dt(r6e);var o6e=U1e(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),wT=p.createContext(void 0),jT=p.createContext(void 0),AY=p.createContext(void 0),PY=p.createContext({}),TY=p.createContext(void 0),OY=p.createContext(0),MY=p.createContext(0),p3=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,s=n.offset,i=t.clipPathId,l=t.children,c=t.width,u=t.height,d=o6e(s);return H.createElement(wT.Provider,{value:r},H.createElement(jT.Provider,{value:a},H.createElement(PY.Provider,{value:s},H.createElement(AY.Provider,{value:d},H.createElement(TY.Provider,{value:i},H.createElement(OY.Provider,{value:u},H.createElement(MY.Provider,{value:c},l)))))))},s6e=function(){return p.useContext(TY)},IY=function(t){var n=p.useContext(wT);n==null&&Cu();var r=n[t];return r==null&&Cu(),r},i6e=function(){var t=p.useContext(wT);return vl(t)},l6e=function(){var t=p.useContext(jT),n=a6e(t,function(r){return wY(r.domain,Number.isFinite)});return n||vl(t)},$Y=function(t){var n=p.useContext(jT);n==null&&Cu();var r=n[t];return r==null&&Cu(),r},c6e=function(){var t=p.useContext(AY);return t},u6e=function(){return p.useContext(PY)},ST=function(){return p.useContext(MY)},NT=function(){return p.useContext(OY)};function Hf(e){"@babel/helpers - typeof";return Hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hf(e)}function d6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RY(r.key),r)}}function h6e(e,t,n){return t&&f6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function m6e(e,t,n){return t=g0(t),p6e(e,DY()?Reflect.construct(t,n||[],g0(e).constructor):t.apply(e,n))}function p6e(e,t){if(t&&(Hf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g6e(e)}function g6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DY=function(){return!!e})()}function g0(e){return g0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g0(e)}function v6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rE(e,t)}function rE(e,t){return rE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},rE(e,t)}function g3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function v3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(n),!0).forEach(function(r){_T(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _T(e,t,n){return t=RY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RY(e){var t=y6e(e,"string");return Hf(t)=="symbol"?t:t+""}function y6e(e,t){if(Hf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x6e(e,t){return S6e(e)||j6e(e,t)||w6e(e,t)||b6e()}function b6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
931In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w6e(e,t){if(e){if(typeof e=="string")return y3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y3(e,t)}}function y3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function j6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function S6e(e){if(Array.isArray(e))return e}function aE(){return aE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aE.apply(this,arguments)}var N6e=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):ot(t)?r=t(n):r=H.createElement("line",aE({},n,{className:"recharts-reference-line-line"})),r},_6e=function(t,n,r,a,s,i,l,c,u){var d=s.x,f=s.y,h=s.width,m=s.height;if(r){var v=u.y,g=t.y.apply(v,{position:i});if(ks(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+h,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(n){var x=u.x,b=t.x.apply(x,{position:i});if(ks(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:f+m},{x:b,y:f}];return l==="top"?w.reverse():w}if(a){var N=u.segment,S=N.map(function(_){return t.apply(_,{position:i})});return ks(u,"discard")&&K5e(S,function(_){return!t.isInRange(_)})?null:S}return null};function C6e(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,s=e.yAxisId,i=e.shape,l=e.className,c=e.alwaysShow,u=s6e(),d=IY(a),f=$Y(s),h=c6e();if(!u||!h)return null;bi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=bT({x:d.scale,y:f.scale}),v=Bn(t),g=Bn(n),y=r&&r.length===2,x=_6e(m,v,g,y,h,e.position,d.orientation,f.orientation,e);if(!x)return null;var b=x6e(x,2),w=b[0],N=w.x,S=w.y,_=b[1],k=_.x,P=_.y,O=ks(e,"hidden")?"url(#".concat(u,")"):void 0,$=v3(v3({clipPath:O},vt(e,!0)),{},{x1:N,y1:S,x2:k,y2:P});return H.createElement(Cn,{className:yt("recharts-reference-line",l)},N6e(i,$),kr.renderCallByParent(e,RFe({x1:N,y1:S,x2:k,y2:P})))}var CT=function(e){function t(){return d6e(this,t),m6e(this,t,arguments)}return v6e(t,e),h6e(t,[{key:"render",value:function(){return H.createElement(C6e,this.props)}}])}(H.Component);_T(CT,"displayName","ReferenceLine");_T(CT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function oE(){return oE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oE.apply(this,arguments)}function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}function x3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x3(Object(n),!0).forEach(function(r){Y1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,FY(r.key),r)}}function A6e(e,t,n){return t&&E6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P6e(e,t,n){return t=v0(t),T6e(e,LY()?Reflect.construct(t,n||[],v0(e).constructor):t.apply(e,n))}function T6e(e,t){if(t&&(Gf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O6e(e)}function O6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LY=function(){return!!e})()}function v0(e){return v0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},v0(e)}function M6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sE(e,t)}function sE(e,t){return sE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},sE(e,t)}function Y1(e,t,n){return t=FY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FY(e){var t=I6e(e,"string");return Gf(t)=="symbol"?t:t+""}function I6e(e,t){if(Gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $6e=function(t){var n=t.x,r=t.y,a=t.xAxis,s=t.yAxis,i=bT({x:a.scale,y:s.scale}),l=i.apply({x:n,y:r},{bandAware:!0});return ks(t,"discard")&&!i.isInRange(l)?null:l},K1=function(e){function t(){return k6e(this,t),P6e(this,t,arguments)}return M6e(t,e),A6e(t,[{key:"render",value:function(){var r=this.props,a=r.x,s=r.y,i=r.r,l=r.alwaysShow,c=r.clipPathId,u=Bn(a),d=Bn(s);if(bi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=$6e(this.props);if(!f)return null;var h=f.x,m=f.y,v=this.props,g=v.shape,y=v.className,x=ks(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=b3(b3({clipPath:x},vt(this.props,!0)),{},{cx:h,cy:m});return H.createElement(Cn,{className:yt("recharts-reference-dot",y)},t.renderDot(g,b),kr.renderCallByParent(this.props,{x:h-i,y:m-i,width:2*i,height:2*i}))}}])}(H.Component);Y1(K1,"displayName","ReferenceDot");Y1(K1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Y1(K1,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):ot(e)?n=e(t):n=H.createElement(xT,oE({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function iE(){return iE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iE.apply(this,arguments)}function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}function w3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function j3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w3(Object(n),!0).forEach(function(r){X1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zY(r.key),r)}}function L6e(e,t,n){return t&&R6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function F6e(e,t,n){return t=y0(t),B6e(e,BY()?Reflect.construct(t,n||[],y0(e).constructor):t.apply(e,n))}function B6e(e,t){if(t&&(Yf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z6e(e)}function z6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BY=function(){return!!e})()}function y0(e){return y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},y0(e)}function U6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lE(e,t)}function lE(e,t){return lE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lE(e,t)}function X1(e,t,n){return t=zY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zY(e){var t=V6e(e,"string");return Yf(t)=="symbol"?t:t+""}function V6e(e,t){if(Yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W6e=function(t,n,r,a,s){var i=s.x1,l=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var h=bT({x:d.scale,y:f.scale}),m={x:t?h.x.apply(i,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},v={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return ks(s,"discard")&&(!h.isInRange(m)||!h.isInRange(v))?null:kY(m,v)},J1=function(e){function t(){return D6e(this,t),F6e(this,t,arguments)}return U6e(t,e),L6e(t,[{key:"render",value:function(){var r=this.props,a=r.x1,s=r.x2,i=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;bi(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Bn(a),h=Bn(s),m=Bn(i),v=Bn(l),g=this.props.shape;if(!f&&!h&&!m&&!v&&!g)return null;var y=W6e(f,h,m,v,this.props);if(!y&&!g)return null;var x=ks(this.props,"hidden")?"url(#".concat(d,")"):void 0;return H.createElement(Cn,{className:yt("recharts-reference-area",c)},t.renderRect(g,j3(j3({clipPath:x},vt(this.props,!0)),y)),kr.renderCallByParent(this.props,y))}}])}(H.Component);X1(J1,"displayName","ReferenceArea");X1(J1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});X1(J1,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):ot(e)?n=e(t):n=H.createElement(yT,iE({},t,{className:"recharts-reference-area-rect"})),n});function UY(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function q6e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return FFe(r,n)}function H6e(e,t,n){var r=n==="width",a=e.x,s=e.y,i=e.width,l=e.height;return t===1?{start:r?a:s,end:r?a+i:s+l}:{start:r?a+i:s+l,end:r?a:s}}function x0(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-a)<=0}function G6e(e,t){return UY(e,t+1)}function Y6e(e,t,n,r,a){for(var s=(r||[]).slice(),i=t.start,l=t.end,c=0,u=1,d=i,f=function(){var v=r==null?void 0:r[c];if(v===void 0)return{v:UY(r,u)};var g=c,y,x=function(){return y===void 0&&(y=n(v,g)),y},b=v.coordinate,w=c===0||x0(e,b,x,d,l);w||(c=0,d=i,u+=1),w&&(d=b+e*(x()/2+a),c+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function hg(e){"@babel/helpers - typeof";return hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hg(e)}function S3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S3(Object(n),!0).forEach(function(r){K6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K6e(e,t,n){return t=X6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X6e(e){var t=J6e(e,"string");return hg(t)=="symbol"?t:t+""}function J6e(e,t){if(hg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(hg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q6e(e,t,n,r,a){for(var s=(r||[]).slice(),i=s.length,l=t.start,c=t.end,u=function(h){var m=s[h],v,g=function(){return v===void 0&&(v=n(m,h)),v};if(h===i-1){var y=e*(m.coordinate+e*g()/2-c);s[h]=m=Nr(Nr({},m),{},{tickCoord:y>0?m.coordinate-y*e:m.coordinate})}else s[h]=m=Nr(Nr({},m),{},{tickCoord:m.coordinate});var x=x0(e,m.tickCoord,g,l,c);x&&(c=m.tickCoord-e*(g()/2+a),s[h]=Nr(Nr({},m),{},{isShow:!0}))},d=i-1;d>=0;d--)u(d);return s}function Z6e(e,t,n,r,a,s){var i=(r||[]).slice(),l=i.length,c=t.start,u=t.end;if(s){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);i[l-1]=d=Nr(Nr({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var m=x0(e,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-e*(f/2+a),i[l-1]=Nr(Nr({},d),{},{isShow:!0}))}for(var v=s?l-1:l,g=function(b){var w=i[b],N,S=function(){return N===void 0&&(N=n(w,b)),N};if(b===0){var _=e*(w.coordinate-e*S()/2-c);i[b]=w=Nr(Nr({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else i[b]=w=Nr(Nr({},w),{},{tickCoord:w.coordinate});var k=x0(e,w.tickCoord,S,c,u);k&&(c=w.tickCoord+e*(S()/2+a),i[b]=Nr(Nr({},w),{},{isShow:!0}))},y=0;y<v;y++)g(y);return i}function kT(e,t,n){var r=e.tick,a=e.ticks,s=e.viewBox,i=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(je(c)||wi.isSsr)return G6e(a,typeof c=="number"&&je(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",v=d&&m==="width"?Qm(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(w,N){var S=ot(u)?u(w.value,N):w.value;return m==="width"?q6e(Qm(S,{fontSize:t,letterSpacing:n}),v,f):Qm(S,{fontSize:t,letterSpacing:n})[m]},y=a.length>=2?Lo(a[1].coordinate-a[0].coordinate):1,x=H6e(s,y,m);return c==="equidistantPreserveStart"?Y6e(y,x,g,a,i):(c==="preserveStart"||c==="preserveStartEnd"?h=Z6e(y,x,g,a,i,c==="preserveStartEnd"):h=Q6e(y,x,g,a,i),h.filter(function(b){return b.isShow}))}var eBe=["viewBox"],tBe=["viewBox"],nBe=["ticks"];function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function Dd(){return Dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dd.apply(this,arguments)}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){ET(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EN(e,t){if(e==null)return{};var n=rBe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WY(r.key),r)}}function oBe(e,t,n){return t&&_3(e.prototype,t),n&&_3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sBe(e,t,n){return t=b0(t),iBe(e,VY()?Reflect.construct(t,n||[],b0(e).constructor):t.apply(e,n))}function iBe(e,t){if(t&&(Kf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lBe(e)}function lBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VY=function(){return!!e})()}function b0(e){return b0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},b0(e)}function cBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cE(e,t)}function cE(e,t){return cE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cE(e,t)}function ET(e,t,n){return t=WY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WY(e){var t=uBe(e,"string");return Kf(t)=="symbol"?t:t+""}function uBe(e,t){if(Kf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $h=function(e){function t(n){var r;return aBe(this,t),r=sBe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return cBe(t,e),oBe(t,[{key:"shouldComponentUpdate",value:function(r,a){var s=r.viewBox,i=EN(r,eBe),l=this.props,c=l.viewBox,u=EN(l,tBe);return!Qd(s,c)||!Qd(i,u)||!Qd(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,s=a.x,i=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,m,v,g,y,x,b,w=f?-1:1,N=r.tickSize||d,S=je(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":m=v=r.coordinate,y=i+ +!f*c,g=y-w*N,b=g-w*h,x=S;break;case"left":g=y=r.coordinate,v=s+ +!f*l,m=v-w*N,x=m-w*h,b=S;break;case"right":g=y=r.coordinate,v=s+ +f*l,m=v+w*N,x=m+w*h,b=S;break;default:m=v=r.coordinate,y=i+ +f*c,g=y+w*N,b=g+w*h,x=S;break}return{line:{x1:m,y1:g,x2:v,y2:y},tick:{x,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,i;switch(a){case"left":i=s?"start":"end";break;case"right":i=s?"end":"start";break;default:i="middle";break}return i}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,i="end";switch(a){case"left":case"right":i="middle";break;case"top":i=s?"start":"end";break;default:i=s?"end":"start";break}return i}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,s=r.y,i=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Dn(Dn(Dn({},vt(this.props,!1)),vt(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Dn(Dn({},f),{},{x1:a,y1:s+h*l,x2:a+i,y2:s+h*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=Dn(Dn({},f),{},{x1:a+m*i,y1:s,x2:a+m*i,y2:s+l})}return H.createElement("line",Dd({},f,{className:yt("recharts-cartesian-axis-line",ro(d,"className"))}))}},{key:"renderTicks",value:function(r,a,s){var i=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,m=kT(Dn(Dn({},this.props),{},{ticks:r}),a,s),v=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=vt(this.props,!1),x=vt(d,!1),b=Dn(Dn({},y),{},{fill:"none"},vt(c,!1)),w=m.map(function(N,S){var _=i.getTickLineCoord(N),k=_.line,P=_.tick,O=Dn(Dn(Dn(Dn({textAnchor:v,verticalAnchor:g},y),{},{stroke:"none",fill:u},x),P),{},{index:S,payload:N,visibleTicksCount:m.length,tickFormatter:f});return H.createElement(Cn,Dd({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},Eb(i.props,N,S)),c&&H.createElement("line",Dd({},b,k,{className:yt("recharts-cartesian-axis-tick-line",ro(c,"className"))})),d&&t.renderTickItem(d,O,"".concat(ot(f)?f(N.value,S):N.value).concat(h||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,a=this.props,s=a.axisLine,i=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,m=EN(f,nBe),v=h;return ot(c)&&(v=h&&h.length>0?c(this.props):c(m)),i<=0||l<=0||!v||!v.length?null:H.createElement(Cn,{className:yt("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},s&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),kr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,s){var i,l=yt(a.className,"recharts-cartesian-axis-tick-value");return H.isValidElement(r)?i=H.cloneElement(r,Dn(Dn({},a),{},{className:l})):ot(r)?i=r(Dn(Dn({},a),{},{className:l})):i=H.createElement(Ub,Dd({},a,{className:"recharts-cartesian-axis-tick-value"}),s),i}}])}(p.Component);ET($h,"displayName","CartesianAxis");ET($h,"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 dBe=["x1","y1","x2","y2","key"],fBe=["offset"];function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function C3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C3(Object(n),!0).forEach(function(r){hBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hBe(e,t,n){return t=mBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mBe(e){var t=pBe(e,"string");return ku(t)=="symbol"?t:t+""}function pBe(e,t){if(ku(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ku(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zc.apply(this,arguments)}function k3(e,t){if(e==null)return{};var n=gBe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var vBe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,s=t.y,i=t.width,l=t.height,c=t.ry;return H.createElement("rect",{x:a,y:s,ry:c,width:i,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function qY(e,t){var n;if(H.isValidElement(e))n=H.cloneElement(e,t);else if(ot(e))n=e(t);else{var r=t.x1,a=t.y1,s=t.x2,i=t.y2,l=t.key,c=k3(t,dBe),u=vt(c,!1);u.offset;var d=k3(u,fBe);n=H.createElement("line",zc({},d,{x1:r,y1:a,x2:s,y2:i,fill:"none",key:l}))}return n}function yBe(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,s=e.horizontalPoints;if(!a||!s||!s.length)return null;var i=s.map(function(l,c){var u=Er(Er({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return qY(a,u)});return H.createElement("g",{className:"recharts-cartesian-grid-horizontal"},i)}function xBe(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,s=e.verticalPoints;if(!a||!s||!s.length)return null;var i=s.map(function(l,c){var u=Er(Er({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return qY(a,u)});return H.createElement("g",{className:"recharts-cartesian-grid-vertical"},i)}function bBe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,s=e.width,i=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,m){return h-m});a!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var v=!d[m+1],g=v?a+i-h:d[m+1]-h;if(g<=0)return null;var y=m%t.length;return H.createElement("rect",{key:"react-".concat(m),y:h,x:r,height:g,width:s,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function wBe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,s=e.x,i=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,m){return h-m});s!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var v=!d[m+1],g=v?s+l-h:d[m+1]-h;if(g<=0)return null;var y=m%r.length;return H.createElement("rect",{key:"react-".concat(m),x:h,y:i,width:g,height:c,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var jBe=function(t,n){var r=t.xAxis,a=t.width,s=t.height,i=t.offset;return rY(kT(Er(Er(Er({},$h.defaultProps),r),{},{ticks:pi(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),i.left,i.left+i.width,n)},SBe=function(t,n){var r=t.yAxis,a=t.width,s=t.height,i=t.offset;return rY(kT(Er(Er(Er({},$h.defaultProps),r),{},{ticks:pi(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),i.top,i.top+i.height,n)},dd={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function tf(e){var t,n,r,a,s,i,l=ST(),c=NT(),u=u6e(),d=Er(Er({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:dd.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:dd.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:dd.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:dd.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:dd.vertical,verticalFill:(i=e.verticalFill)!==null&&i!==void 0?i:dd.verticalFill,x:je(e.x)?e.x:u.left,y:je(e.y)?e.y:u.top,width:je(e.width)?e.width:u.width,height:je(e.height)?e.height:u.height}),f=d.x,h=d.y,m=d.width,v=d.height,g=d.syncWithTicks,y=d.horizontalValues,x=d.verticalValues,b=i6e(),w=l6e();if(!je(m)||m<=0||!je(v)||v<=0||!je(f)||f!==+f||!je(h)||h!==+h)return null;var N=d.verticalCoordinatesGenerator||jBe,S=d.horizontalCoordinatesGenerator||SBe,_=d.horizontalPoints,k=d.verticalPoints;if((!_||!_.length)&&ot(S)){var P=y&&y.length,O=S({yAxis:w?Er(Er({},w),{},{ticks:P?y:w.ticks}):void 0,width:l,height:c,offset:u},P?!0:g);bi(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ku(O),"]")),Array.isArray(O)&&(_=O)}if((!k||!k.length)&&ot(N)){var $=x&&x.length,T=N({xAxis:b?Er(Er({},b),{},{ticks:$?x:b.ticks}):void 0,width:l,height:c,offset:u},$?!0:g);bi(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ku(T),"]")),Array.isArray(T)&&(k=T)}return H.createElement("g",{className:"recharts-cartesian-grid"},H.createElement(vBe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),H.createElement(yBe,zc({},d,{offset:u,horizontalPoints:_,xAxis:b,yAxis:w})),H.createElement(xBe,zc({},d,{offset:u,verticalPoints:k,xAxis:b,yAxis:w})),H.createElement(bBe,zc({},d,{horizontalPoints:_})),H.createElement(wBe,zc({},d,{verticalPoints:k})))}tf.displayName="CartesianGrid";var NBe=["type","layout","connectNulls","ref"],_Be=["key"];function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function E3(e,t){if(e==null)return{};var n=CBe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},np.apply(this,arguments)}function A3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ba(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A3(Object(n),!0).forEach(function(r){Oo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fd(e){return PBe(e)||ABe(e)||EBe(e)||kBe()}function kBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
932In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EBe(e,t){if(e){if(typeof e=="string")return uE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uE(e,t)}}function ABe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PBe(e){if(Array.isArray(e))return uE(e)}function uE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GY(r.key),r)}}function OBe(e,t,n){return t&&P3(e.prototype,t),n&&P3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MBe(e,t,n){return t=w0(t),IBe(e,HY()?Reflect.construct(t,n||[],w0(e).constructor):t.apply(e,n))}function IBe(e,t){if(t&&(Xf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $Be(e)}function $Be(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HY=function(){return!!e})()}function w0(e){return w0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},w0(e)}function DBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dE(e,t)}function dE(e,t){return dE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},dE(e,t)}function Oo(e,t,n){return t=GY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GY(e){var t=RBe(e,"string");return Xf(t)=="symbol"?t:t+""}function RBe(e,t){if(Xf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Es=function(e){function t(){var n;TBe(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=MBe(this,t,[].concat(a)),Oo(n,"state",{isAnimationFinished:!0,totalLength:0}),Oo(n,"generateSimpleStrokeDasharray",function(i,l){return"".concat(l,"px ").concat(i-l,"px")}),Oo(n,"getStrokeDasharray",function(i,l,c){var u=c.reduce(function(x,b){return x+b});if(!u)return n.generateSimpleStrokeDasharray(l,i);for(var d=Math.floor(i/u),f=i%u,h=l-i,m=[],v=0,g=0;v<c.length;g+=c[v],++v)if(g+c[v]>f){m=[].concat(fd(c.slice(0,v)),[f-g]);break}var y=m.length%2===0?[0,h]:[h];return[].concat(fd(t.repeat(c,d)),fd(m),y).map(function(x){return"".concat(x,"px")}).join(", ")}),Oo(n,"id",rv("recharts-line-")),Oo(n,"pathRef",function(i){n.mainCurve=i}),Oo(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Oo(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return DBe(t,e),OBe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,i=s.points,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=ao(d,cv);if(!f)return null;var h=function(g,y){return{x:g.x,y:g.y,value:g.value,errorVal:Ia(g.payload,y)}},m={clipPath:r?"url(#clipPath-".concat(a,")"):null};return H.createElement(Cn,m,f.map(function(v){return H.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:i,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,a,s){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=vt(this.props,!1),h=vt(c,!0),m=u.map(function(g,y){var x=ba(ba(ba({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:g.x,cy:g.y,value:g.value,dataKey:d,payload:g.payload,points:u});return t.renderDotItem(c,x)}),v={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(s,")"):null};return H.createElement(Cn,np({className:"recharts-line-dots",key:"dots"},v),m)}},{key:"renderCurveStatically",value:function(r,a,s,i){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=E3(l,NBe),h=ba(ba(ba({},vt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(s,")"):null,points:r},i),{},{type:c,layout:u,connectNulls:d});return H.createElement(Uk,np({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var s=this,i=this.props,l=i.points,c=i.strokeDasharray,u=i.isAnimationActive,d=i.animationBegin,f=i.animationDuration,h=i.animationEasing,m=i.animationId,v=i.animateNewValues,g=i.width,y=i.height,x=this.state,b=x.prevPoints,w=x.totalLength;return H.createElement(Fi,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var S=N.t;if(b){var _=b.length/l.length,k=l.map(function(z,U){var E=Math.floor(U*_);if(b[E]){var q=b[E],W=$o(q.x,z.x),L=$o(q.y,z.y);return ba(ba({},z),{},{x:W(S),y:L(S)})}if(v){var M=$o(g*2,z.x),B=$o(y/2,z.y);return ba(ba({},z),{},{x:M(S),y:B(S)})}return ba(ba({},z),{},{x:z.x,y:z.y})});return s.renderCurveStatically(k,r,a)}var P=$o(0,w),O=P(S),$;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(z){return parseFloat(z)});$=s.getStrokeDasharray(O,w,T)}else $=s.generateSimpleStrokeDasharray(w,O);return s.renderCurveStatically(l,r,a,{strokeDasharray:$})})}},{key:"renderCurve",value:function(r,a){var s=this.props,i=s.points,l=s.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&i&&i.length&&(!u&&d>0||!U1(u,i))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(i,r,a)}},{key:"render",value:function(){var r,a=this.props,s=a.hide,i=a.dot,l=a.points,c=a.className,u=a.xAxis,d=a.yAxis,f=a.top,h=a.left,m=a.width,v=a.height,g=a.isAnimationActive,y=a.id;if(s||!l||!l.length)return null;var x=this.state.isAnimationFinished,b=l.length===1,w=yt("recharts-line",c),N=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,_=N||S,k=dt(y)?this.id:y,P=(r=vt(i,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},O=P.r,$=O===void 0?3:O,T=P.strokeWidth,z=T===void 0?2:T,U=Xje(i)?i:{},E=U.clipDot,q=E===void 0?!0:E,W=$*2+z;return H.createElement(Cn,{className:w},N||S?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(k)},H.createElement("rect",{x:N?h:h-m/2,y:S?f:f-v/2,width:N?m:m*2,height:S?v:v*2})),!q&&H.createElement("clipPath",{id:"clipPath-dots-".concat(k)},H.createElement("rect",{x:h-W/2,y:f-W/2,width:m+W,height:v+W}))):null,!b&&this.renderCurve(_,k),this.renderErrorBar(_,k),(b||i)&&this.renderDots(_,q,k),(!g||x)&&Ul.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var s=r.length%2!==0?[].concat(fd(r),[0]):r,i=[],l=0;l<a;++l)i=[].concat(fd(i),fd(s));return i}},{key:"renderDotItem",value:function(r,a){var s;if(H.isValidElement(r))s=H.cloneElement(r,a);else if(ot(r))s=r(a);else{var i=a.key,l=E3(a,_Be),c=yt("recharts-line-dot",typeof r!="boolean"?r.className:"");s=H.createElement(xT,np({key:i},l,{className:c}))}return s}}])}(p.PureComponent);Oo(Es,"displayName","Line");Oo(Es,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wi.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Oo(Es,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,s=e.yAxisTicks,i=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,m){var v=Ia(h,i);return d==="horizontal"?{x:uL({axis:n,ticks:a,bandSize:l,entry:h,index:m}),y:dt(v)?null:r.scale(v),value:v,payload:h}:{x:dt(v)?null:n.scale(v),y:uL({axis:r,ticks:s,bandSize:l,entry:h,index:m}),value:v,payload:h}});return ba({points:f,layout:d},u)});function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function LBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FBe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XY(r.key),r)}}function BBe(e,t,n){return t&&FBe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zBe(e,t,n){return t=j0(t),UBe(e,YY()?Reflect.construct(t,n||[],j0(e).constructor):t.apply(e,n))}function UBe(e,t){if(t&&(Jf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VBe(e)}function VBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YY=function(){return!!e})()}function j0(e){return j0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},j0(e)}function WBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fE(e,t)}function fE(e,t){return fE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},fE(e,t)}function KY(e,t,n){return t=XY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XY(e){var t=qBe(e,"string");return Jf(t)=="symbol"?t:t+""}function qBe(e,t){if(Jf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hE.apply(this,arguments)}function HBe(e){var t=e.xAxisId,n=ST(),r=NT(),a=IY(t);return a==null?null:p.createElement($h,hE({},a,{className:yt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(i){return pi(i,!0)}}))}var Ni=function(e){function t(){return LBe(this,t),zBe(this,t,arguments)}return WBe(t,e),BBe(t,[{key:"render",value:function(){return p.createElement(HBe,this.props)}}])}(p.Component);KY(Ni,"displayName","XAxis");KY(Ni,"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 Qf(e){"@babel/helpers - typeof";return Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qf(e)}function GBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YBe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZY(r.key),r)}}function KBe(e,t,n){return t&&YBe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XBe(e,t,n){return t=S0(t),JBe(e,JY()?Reflect.construct(t,n||[],S0(e).constructor):t.apply(e,n))}function JBe(e,t){if(t&&(Qf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QBe(e)}function QBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JY=function(){return!!e})()}function S0(e){return S0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},S0(e)}function ZBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mE(e,t)}function mE(e,t){return mE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mE(e,t)}function QY(e,t,n){return t=ZY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZY(e){var t=e8e(e,"string");return Qf(t)=="symbol"?t:t+""}function e8e(e,t){if(Qf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pE(){return pE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pE.apply(this,arguments)}var t8e=function(t){var n=t.yAxisId,r=ST(),a=NT(),s=$Y(n);return s==null?null:p.createElement($h,pE({},s,{className:yt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return pi(l,!0)}}))},_i=function(e){function t(){return GBe(this,t),XBe(this,t,arguments)}return ZBe(t,e),KBe(t,[{key:"render",value:function(){return p.createElement(t8e,this.props)}}])}(p.Component);QY(_i,"displayName","YAxis");QY(_i,"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 T3(e){return o8e(e)||a8e(e)||r8e(e)||n8e()}function n8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
933In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r8e(e,t){if(e){if(typeof e=="string")return gE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gE(e,t)}}function a8e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o8e(e){if(Array.isArray(e))return gE(e)}function gE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vE=function(t,n,r,a,s){var i=ao(t,CT),l=ao(t,K1),c=[].concat(T3(i),T3(l)),u=ao(t,J1),d="".concat(a,"Id"),f=a[0],h=n;if(c.length&&(h=c.reduce(function(g,y){if(y.props[d]===r&&ks(y.props,"extendDomain")&&je(y.props[f])){var x=y.props[f];return[Math.min(g[0],x),Math.max(g[1],x)]}return g},h)),u.length){var m="".concat(f,"1"),v="".concat(f,"2");h=u.reduce(function(g,y){if(y.props[d]===r&&ks(y.props,"extendDomain")&&je(y.props[m])&&je(y.props[v])){var x=y.props[m],b=y.props[v];return[Math.min(g[0],x,b),Math.max(g[1],x,b)]}return g},h)}return s&&s.length&&(h=s.reduce(function(g,y){return je(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},h)),h},eK={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new a(d,f||c,h),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],m]:c._events[v].push(m):(c._events[v]=m,c._eventsCount++),c}function i(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,v=new Array(m);h<m;h++)v[h]=f[h].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,m,v){var g=n?n+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,b,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,m),!0;case 6:return y.fn.call(y.context,d,f,h,m,v),!0}for(w=1,b=new Array(x-1);w<x;w++)b[w-1]=arguments[w];y.fn.apply(y.context,b)}else{var N=y.length,S;for(w=0;w<N;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),x){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,d);break;case 3:y[w].fn.call(y[w].context,d,f);break;case 4:y[w].fn.call(y[w].context,d,f,h);break;default:if(!b)for(S=1,b=new Array(x-1);S<x;S++)b[S-1]=arguments[S];y[w].fn.apply(y[w].context,b)}}return!0},l.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var m=n?n+u:u;if(!this._events[m])return this;if(!d)return i(this,m),this;var v=this._events[m];if(v.fn)v.fn===d&&(!h||v.once)&&(!f||v.context===f)&&i(this,m);else{for(var g=0,y=[],x=v.length;g<x;g++)(v[g].fn!==d||h&&!v[g].once||f&&v[g].context!==f)&&y.push(v[g]);y.length?this._events[m]=y.length===1?y[0]:y:i(this,m)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&i(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(eK);var s8e=eK.exports;const i8e=Dt(s8e);var AN=new i8e,PN="recharts.syncMouseEvents";function mg(e){"@babel/helpers - typeof";return mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mg(e)}function l8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c8e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tK(r.key),r)}}function u8e(e,t,n){return t&&c8e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function TN(e,t,n){return t=tK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tK(e){var t=d8e(e,"string");return mg(t)=="symbol"?t:t+""}function d8e(e,t){if(mg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var f8e=function(){function e(){l8e(this,e),TN(this,"activeIndex",0),TN(this,"coordinateList",[]),TN(this,"layout","horizontal")}return u8e(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,s=a===void 0?null:a,i=n.container,l=i===void 0?null:i,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),s=a.x,i=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=s+c+u,h=i+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function h8e(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&je(r)&&je(a))return!0}return!1}function m8e(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function nK(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,s=e.endAngle,i=fr(t,n,r,a),l=fr(t,n,r,s);return{points:[i,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:s}}function p8e(e,t,n){var r,a,s,i;if(e==="horizontal")r=t.x,s=r,a=n.top,i=n.top+n.height;else if(e==="vertical")a=t.y,i=a,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=fr(l,c,u,f),m=fr(l,c,d,f);r=h.x,a=h.y,s=m.x,i=m.y}else return nK(t);return[{x:r,y:a},{x:s,y:i}]}function pg(e){"@babel/helpers - typeof";return pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pg(e)}function O3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function My(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O3(Object(n),!0).forEach(function(r){g8e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g8e(e,t,n){return t=v8e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v8e(e){var t=y8e(e,"string");return pg(t)=="symbol"?t:t+""}function y8e(e,t){if(pg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x8e(e){var t,n,r=e.element,a=e.tooltipEventType,s=e.isActive,i=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,m=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!m||!s||!i||h!=="ScatterChart"&&a!=="axis")return null;var v,g=Uk;if(h==="ScatterChart")v=i,g=x3e;else if(h==="BarChart")v=m8e(f,i,c,d),g=yT;else if(f==="radial"){var y=nK(i),x=y.cx,b=y.cy,w=y.radius,N=y.startAngle,S=y.endAngle;v={cx:x,cy:b,startAngle:N,endAngle:S,innerRadius:w,outerRadius:w},g=lY}else v={points:p8e(f,i,c)},g=Uk;var _=My(My(My(My({stroke:"#ccc",pointerEvents:"none"},c),v),vt(m,!1)),{},{payload:l,payloadIndex:u,className:yt("recharts-tooltip-cursor",m.className)});return p.isValidElement(m)?p.cloneElement(m,_):p.createElement(g,_)}var b8e=["item"],w8e=["children","className","width","height","style","compact","title","desc"];function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rd.apply(this,arguments)}function M3(e,t){return N8e(e)||S8e(e,t)||aK(e,t)||j8e()}function j8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
934In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S8e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return l}}function N8e(e){if(Array.isArray(e))return e}function I3(e,t){if(e==null)return{};var n=_8e(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _8e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function C8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k8e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oK(r.key),r)}}function E8e(e,t,n){return t&&k8e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A8e(e,t,n){return t=N0(t),P8e(e,rK()?Reflect.construct(t,n||[],N0(e).constructor):t.apply(e,n))}function P8e(e,t){if(t&&(Zf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T8e(e)}function T8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rK=function(){return!!e})()}function N0(e){return N0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},N0(e)}function O8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yE(e,t)}function yE(e,t){return yE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},yE(e,t)}function eh(e){return $8e(e)||I8e(e)||aK(e)||M8e()}function M8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
935In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aK(e,t){if(e){if(typeof e=="string")return xE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xE(e,t)}}function I8e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $8e(e){if(Array.isArray(e))return xE(e)}function xE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$3(Object(n),!0).forEach(function(r){We(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function We(e,t,n){return t=oK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oK(e){var t=D8e(e,"string");return Zf(t)=="symbol"?t:t+""}function D8e(e,t){if(Zf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R8e={xAxis:["bottom","top"],yAxis:["left","right"]},L8e={width:"100%",height:"100%"},sK={x:0,y:0};function Iy(e){return e}var F8e=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},B8e=function(t,n,r,a){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:s.coordinate};if(t==="centric"){var i=s.coordinate,l=a.radius;return le(le(le({},a),fr(a.cx,a.cy,l,i)),{},{angle:i,radius:l})}var c=s.coordinate,u=a.angle;return le(le(le({},a),fr(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return sK},Q1=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,s=n.dataEndIndex,i=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(eh(l),eh(u)):l},[]);return i.length>0?i:t&&t.length&&je(a)&&je(s)?t.slice(a,s+1):[]};function iK(e){return e==="number"?[0,"auto"]:void 0}var bE=function(t,n,r,a){var s=t.graphicalItems,i=t.tooltipAxis,l=Q1(n,t);return r<0||!s||!s.length||r>=l.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(i.dataKey&&!i.allowDuplicatedCategory){var m=f===void 0?l:f;h=Cb(m,i.dataKey,a)}else h=f&&f[r]||l[r];return h?[].concat(eh(c),[oY(u,h)]):c},[])},D3=function(t,n,r,a){var s=a||{x:t.chartX,y:t.chartY},i=F8e(s,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=s4e(i,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=bE(t,n,d,f),m=B8e(r,l,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},z8e=function(t,n){var r=n.axes,a=n.graphicalItems,s=n.axisType,i=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,m=nY(d,s);return r.reduce(function(v,g){var y,x=g.type.defaultProps!==void 0?le(le({},g.type.defaultProps),g.props):g.props,b=x.type,w=x.dataKey,N=x.allowDataOverflow,S=x.allowDuplicatedCategory,_=x.scale,k=x.ticks,P=x.includeHidden,O=x[i];if(v[O])return v;var $=Q1(t.data,{graphicalItems:a.filter(function(F){var j,C=i in F.props?F.props[i]:(j=F.type.defaultProps)===null||j===void 0?void 0:j[i];return C===O}),dataStartIndex:c,dataEndIndex:u}),T=$.length,z,U,E;h8e(x.domain,N,b)&&(z=Rk(x.domain,null,N),m&&(b==="number"||_!=="auto")&&(E=ep($,w,"category")));var q=iK(b);if(!z||z.length===0){var W,L=(W=x.domain)!==null&&W!==void 0?W:q;if(w){if(z=ep($,w,b),b==="category"&&m){var M=Bje(z);S&&M?(U=z,z=d0(0,T)):S||(z=mL(L,z,g).reduce(function(F,j){return F.indexOf(j)>=0?F:[].concat(eh(F),[j])},[]))}else if(b==="category")S?z=z.filter(function(F){return F!==""&&!dt(F)}):z=mL(L,z,g).reduce(function(F,j){return F.indexOf(j)>=0||j===""||dt(j)?F:[].concat(eh(F),[j])},[]);else if(b==="number"){var B=d4e($,a.filter(function(F){var j,C,A=i in F.props?F.props[i]:(j=F.type.defaultProps)===null||j===void 0?void 0:j[i],D="hide"in F.props?F.props.hide:(C=F.type.defaultProps)===null||C===void 0?void 0:C.hide;return A===O&&(P||!D)}),w,s,d);B&&(z=B)}m&&(b==="number"||_!=="auto")&&(E=ep($,w,"category"))}else m?z=d0(0,T):l&&l[O]&&l[O].hasStack&&b==="number"?z=h==="expand"?[0,1]:aY(l[O].stackGroups,c,u):z=tY($,a.filter(function(F){var j=i in F.props?F.props[i]:F.type.defaultProps[i],C="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return j===O&&(P||!C)}),b,d,!0);if(b==="number")z=vE(f,z,O,s,k),L&&(z=Rk(L,z,N));else if(b==="category"&&L){var I=L,R=z.every(function(F){return I.indexOf(F)>=0});R&&(z=I)}}return le(le({},v),{},We({},O,le(le({},x),{},{axisType:s,domain:z,categoricalDomain:E,duplicateDomain:U,originalDomain:(y=x.domain)!==null&&y!==void 0?y:q,isCategorical:m,layout:d})))},{})},U8e=function(t,n){var r=n.graphicalItems,a=n.Axis,s=n.axisType,i=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=Q1(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),m=h.length,v=nY(d,s),g=-1;return r.reduce(function(y,x){var b=x.type.defaultProps!==void 0?le(le({},x.type.defaultProps),x.props):x.props,w=b[i],N=iK("number");if(!y[w]){g++;var S;return v?S=d0(0,m):l&&l[w]&&l[w].hasStack?(S=aY(l[w].stackGroups,c,u),S=vE(f,S,w,s)):(S=Rk(N,tY(h,r.filter(function(_){var k,P,O=i in _.props?_.props[i]:(k=_.type.defaultProps)===null||k===void 0?void 0:k[i],$="hide"in _.props?_.props.hide:(P=_.type.defaultProps)===null||P===void 0?void 0:P.hide;return O===w&&!$}),"number",d),a.defaultProps.allowDataOverflow),S=vE(f,S,w,s)),le(le({},y),{},We({},w,le(le({axisType:s},a.defaultProps),{},{hide:!0,orientation:ro(R8e,"".concat(s,".").concat(g%2),null),domain:S,originalDomain:N,isCategorical:v,layout:d})))}return y},{})},V8e=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,s=n.AxisComp,i=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=ao(d,s),m={};return h&&h.length?m=z8e(t,{axes:h,graphicalItems:i,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):i&&i.length&&(m=U8e(t,{Axis:s,graphicalItems:i,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},W8e=function(t){var n=vl(t),r=pi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:qP(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:n0(n,r)}},R3=function(t){var n=t.children,r=t.defaultShowTooltip,a=Sa(n,Wf),s=0,i=0;return t.data&&t.data.length!==0&&(i=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(s=a.props.startIndex),a.props.endIndex>=0&&(i=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!r}},q8e=function(t){return!t||!t.length?!1:t.some(function(n){var r=xi(n&&n.type);return r&&r.indexOf("Bar")>=0})},L3=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},H8e=function(t,n){var r=t.props,a=t.graphicalItems,s=t.xAxisMap,i=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},m=Sa(f,Wf),v=Sa(f,Bl),g=Object.keys(c).reduce(function(S,_){var k=c[_],P=k.orientation;return!k.mirror&&!k.hide?le(le({},S),{},We({},P,S[P]+k.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(i).reduce(function(S,_){var k=i[_],P=k.orientation;return!k.mirror&&!k.hide?le(le({},S),{},We({},P,ro(S,"".concat(P))+k.height)):S},{top:h.top||0,bottom:h.bottom||0}),x=le(le({},y),g),b=x.bottom;m&&(x.bottom+=m.props.height||Wf.defaultProps.height),v&&n&&(x=c4e(x,a,r,n));var w=u-x.left-x.right,N=d-x.top-x.bottom;return le(le({brushBottom:b},x),{},{width:Math.max(w,0),height:Math.max(N,0)})},G8e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},lK=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,s=a===void 0?"axis":a,i=t.validateTooltipEventTypes,l=i===void 0?["axis"]:i,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(x,b){var w=b.graphicalItems,N=b.stackGroups,S=b.offset,_=b.updateId,k=b.dataStartIndex,P=b.dataEndIndex,O=x.barSize,$=x.layout,T=x.barGap,z=x.barCategoryGap,U=x.maxBarSize,E=L3($),q=E.numericAxisName,W=E.cateAxisName,L=q8e(w),M=[];return w.forEach(function(B,I){var R=Q1(x.data,{graphicalItems:[B],dataStartIndex:k,dataEndIndex:P}),F=B.type.defaultProps!==void 0?le(le({},B.type.defaultProps),B.props):B.props,j=F.dataKey,C=F.maxBarSize,A=F["".concat(q,"Id")],D=F["".concat(W,"Id")],V={},Y=c.reduce(function(Fe,Be){var st=b["".concat(Be.axisType,"Map")],Pt=F["".concat(Be.axisType,"Id")];st&&st[Pt]||Be.axisType==="zAxis"||Cu();var kn=st[Pt];return le(le({},Fe),{},We(We({},Be.axisType,kn),"".concat(Be.axisType,"Ticks"),pi(kn)))},V),G=Y[W],K=Y["".concat(W,"Ticks")],Z=N&&N[A]&&N[A].hasStack&&S4e(B,N[A].stackGroups),J=xi(B.type).indexOf("Bar")>=0,ce=n0(G,K),ue=[],be=L&&i4e({barSize:O,stackGroups:N,totalSize:G8e(Y,W)});if(J){var Ne,te,re=dt(C)?U:C,pe=(Ne=(te=n0(G,K,!0))!==null&&te!==void 0?te:re)!==null&&Ne!==void 0?Ne:0;ue=l4e({barGap:T,barCategoryGap:z,bandSize:pe!==ce?pe:ce,sizeList:be[D],maxBarSize:re}),pe!==ce&&(ue=ue.map(function(Fe){return le(le({},Fe),{},{position:le(le({},Fe.position),{},{offset:Fe.position.offset-pe/2})})}))}var Ee=B&&B.type&&B.type.getComposedData;Ee&&M.push({props:le(le({},Ee(le(le({},Y),{},{displayedData:R,props:x,dataKey:j,item:B,bandSize:ce,barPosition:ue,offset:S,stackedData:Z,layout:$,dataStartIndex:k,dataEndIndex:P}))),{},We(We(We({key:B.key||"item-".concat(I)},q,Y[q]),W,Y[W]),"animationId",_)),childIndex:Zje(B,x.children),item:B})}),M},m=function(x,b){var w=x.props,N=x.dataStartIndex,S=x.dataEndIndex,_=x.updateId;if(!s4({props:w}))return null;var k=w.children,P=w.layout,O=w.stackOffset,$=w.data,T=w.reverseStackOrder,z=L3(P),U=z.numericAxisName,E=z.cateAxisName,q=ao(k,r),W=b4e($,q,"".concat(U,"Id"),"".concat(E,"Id"),O,T),L=c.reduce(function(F,j){var C="".concat(j.axisType,"Map");return le(le({},F),{},We({},C,V8e(w,le(le({},j),{},{graphicalItems:q,stackGroups:j.axisType===U&&W,dataStartIndex:N,dataEndIndex:S}))))},{}),M=H8e(le(le({},L),{},{props:w,graphicalItems:q}),b==null?void 0:b.legendBBox);Object.keys(L).forEach(function(F){L[F]=d(w,L[F],M,F.replace("Map",""),n)});var B=L["".concat(E,"Map")],I=W8e(B),R=h(w,le(le({},L),{},{dataStartIndex:N,dataEndIndex:S,updateId:_,graphicalItems:q,stackGroups:W,offset:M}));return le(le({formattedGraphicalItems:R,graphicalItems:q,offset:M,stackGroups:W},I),L)},v=function(y){function x(b){var w,N,S;return C8e(this,x),S=A8e(this,x,[b]),We(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),We(S,"accessibilityManager",new f8e),We(S,"handleLegendBBoxUpdate",function(_){if(_){var k=S.state,P=k.dataStartIndex,O=k.dataEndIndex,$=k.updateId;S.setState(le({legendBBox:_},m({props:S.props,dataStartIndex:P,dataEndIndex:O,updateId:$},le(le({},S.state),{},{legendBBox:_}))))}}),We(S,"handleReceiveSyncEvent",function(_,k,P){if(S.props.syncId===_){if(P===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(k)}}),We(S,"handleBrushChange",function(_){var k=_.startIndex,P=_.endIndex;if(k!==S.state.dataStartIndex||P!==S.state.dataEndIndex){var O=S.state.updateId;S.setState(function(){return le({dataStartIndex:k,dataEndIndex:P},m({props:S.props,dataStartIndex:k,dataEndIndex:P,updateId:O},S.state))}),S.triggerSyncEvent({dataStartIndex:k,dataEndIndex:P})}}),We(S,"handleMouseEnter",function(_){var k=S.getMouseInfo(_);if(k){var P=le(le({},k),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var O=S.props.onMouseEnter;ot(O)&&O(P,_)}}),We(S,"triggeredAfterMouseMove",function(_){var k=S.getMouseInfo(_),P=k?le(le({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(P),S.triggerSyncEvent(P);var O=S.props.onMouseMove;ot(O)&&O(P,_)}),We(S,"handleItemMouseEnter",function(_){S.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),We(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),We(S,"handleMouseMove",function(_){_.persist(),S.throttleTriggeredAfterMouseMove(_)}),We(S,"handleMouseLeave",function(_){S.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};S.setState(k),S.triggerSyncEvent(k);var P=S.props.onMouseLeave;ot(P)&&P(k,_)}),We(S,"handleOuterEvent",function(_){var k=Qje(_),P=ro(S.props,"".concat(k));if(k&&ot(P)){var O,$;/.*touch.*/i.test(k)?$=S.getMouseInfo(_.changedTouches[0]):$=S.getMouseInfo(_),P((O=$)!==null&&O!==void 0?O:{},_)}}),We(S,"handleClick",function(_){var k=S.getMouseInfo(_);if(k){var P=le(le({},k),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var O=S.props.onClick;ot(O)&&O(P,_)}}),We(S,"handleMouseDown",function(_){var k=S.props.onMouseDown;if(ot(k)){var P=S.getMouseInfo(_);k(P,_)}}),We(S,"handleMouseUp",function(_){var k=S.props.onMouseUp;if(ot(k)){var P=S.getMouseInfo(_);k(P,_)}}),We(S,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),We(S,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseDown(_.changedTouches[0])}),We(S,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseUp(_.changedTouches[0])}),We(S,"handleDoubleClick",function(_){var k=S.props.onDoubleClick;if(ot(k)){var P=S.getMouseInfo(_);k(P,_)}}),We(S,"handleContextMenu",function(_){var k=S.props.onContextMenu;if(ot(k)){var P=S.getMouseInfo(_);k(P,_)}}),We(S,"triggerSyncEvent",function(_){S.props.syncId!==void 0&&AN.emit(PN,S.props.syncId,_,S.eventEmitterSymbol)}),We(S,"applySyncEvent",function(_){var k=S.props,P=k.layout,O=k.syncMethod,$=S.state.updateId,T=_.dataStartIndex,z=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)S.setState(le({dataStartIndex:T,dataEndIndex:z},m({props:S.props,dataStartIndex:T,dataEndIndex:z,updateId:$},S.state)));else if(_.activeTooltipIndex!==void 0){var U=_.chartX,E=_.chartY,q=_.activeTooltipIndex,W=S.state,L=W.offset,M=W.tooltipTicks;if(!L)return;if(typeof O=="function")q=O(M,_);else if(O==="value"){q=-1;for(var B=0;B<M.length;B++)if(M[B].value===_.activeLabel){q=B;break}}var I=le(le({},L),{},{x:L.left,y:L.top}),R=Math.min(U,I.x+I.width),F=Math.min(E,I.y+I.height),j=M[q]&&M[q].value,C=bE(S.state,S.props.data,q),A=M[q]?{x:P==="horizontal"?M[q].coordinate:R,y:P==="horizontal"?F:M[q].coordinate}:sK;S.setState(le(le({},_),{},{activeLabel:j,activeCoordinate:A,activePayload:C,activeTooltipIndex:q}))}else S.setState(_)}),We(S,"renderCursor",function(_){var k,P=S.state,O=P.isTooltipActive,$=P.activeCoordinate,T=P.activePayload,z=P.offset,U=P.activeTooltipIndex,E=P.tooltipAxisBandSize,q=S.getTooltipEventType(),W=(k=_.props.active)!==null&&k!==void 0?k:O,L=S.props.layout,M=_.key||"_recharts-cursor";return H.createElement(x8e,{key:M,activeCoordinate:$,activePayload:T,activeTooltipIndex:U,chartName:n,element:_,isActive:W,layout:L,offset:z,tooltipAxisBandSize:E,tooltipEventType:q})}),We(S,"renderPolarAxis",function(_,k,P){var O=ro(_,"type.axisType"),$=ro(S.state,"".concat(O,"Map")),T=_.type.defaultProps,z=T!==void 0?le(le({},T),_.props):_.props,U=$&&$[z["".concat(O,"Id")]];return p.cloneElement(_,le(le({},U),{},{className:yt(O,U.className),key:_.key||"".concat(k,"-").concat(P),ticks:pi(U,!0)}))}),We(S,"renderPolarGrid",function(_){var k=_.props,P=k.radialLines,O=k.polarAngles,$=k.polarRadius,T=S.state,z=T.radiusAxisMap,U=T.angleAxisMap,E=vl(z),q=vl(U),W=q.cx,L=q.cy,M=q.innerRadius,B=q.outerRadius;return p.cloneElement(_,{polarAngles:Array.isArray(O)?O:pi(q,!0).map(function(I){return I.coordinate}),polarRadius:Array.isArray($)?$:pi(E,!0).map(function(I){return I.coordinate}),cx:W,cy:L,innerRadius:M,outerRadius:B,key:_.key||"polar-grid",radialLines:P})}),We(S,"renderLegend",function(){var _=S.state.formattedGraphicalItems,k=S.props,P=k.children,O=k.width,$=k.height,T=S.props.margin||{},z=O-(T.left||0)-(T.right||0),U=ZG({children:P,formattedGraphicalItems:_,legendWidth:z,legendContent:u});if(!U)return null;var E=U.item,q=I3(U,b8e);return p.cloneElement(E,le(le({},q),{},{chartWidth:O,chartHeight:$,margin:T,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),We(S,"renderTooltip",function(){var _,k=S.props,P=k.children,O=k.accessibilityLayer,$=Sa(P,Qr);if(!$)return null;var T=S.state,z=T.isTooltipActive,U=T.activeCoordinate,E=T.activePayload,q=T.activeLabel,W=T.offset,L=(_=$.props.active)!==null&&_!==void 0?_:z;return p.cloneElement($,{viewBox:le(le({},W),{},{x:W.left,y:W.top}),active:L,label:q,payload:L?E:[],coordinate:U,accessibilityLayer:O})}),We(S,"renderBrush",function(_){var k=S.props,P=k.margin,O=k.data,$=S.state,T=$.offset,z=$.dataStartIndex,U=$.dataEndIndex,E=$.updateId;return p.cloneElement(_,{key:_.key||"_recharts-brush",onChange:Ay(S.handleBrushChange,_.props.onChange),data:O,x:je(_.props.x)?_.props.x:T.left,y:je(_.props.y)?_.props.y:T.top+T.height+T.brushBottom-(P.bottom||0),width:je(_.props.width)?_.props.width:T.width,startIndex:z,endIndex:U,updateId:"brush-".concat(E)})}),We(S,"renderReferenceElement",function(_,k,P){if(!_)return null;var O=S,$=O.clipPathId,T=S.state,z=T.xAxisMap,U=T.yAxisMap,E=T.offset,q=_.type.defaultProps||{},W=_.props,L=W.xAxisId,M=L===void 0?q.xAxisId:L,B=W.yAxisId,I=B===void 0?q.yAxisId:B;return p.cloneElement(_,{key:_.key||"".concat(k,"-").concat(P),xAxis:z[M],yAxis:U[I],viewBox:{x:E.left,y:E.top,width:E.width,height:E.height},clipPathId:$})}),We(S,"renderActivePoints",function(_){var k=_.item,P=_.activePoint,O=_.basePoint,$=_.childIndex,T=_.isRange,z=[],U=k.props.key,E=k.item.type.defaultProps!==void 0?le(le({},k.item.type.defaultProps),k.item.props):k.item.props,q=E.activeDot,W=E.dataKey,L=le(le({index:$,dataKey:W,cx:P.x,cy:P.y,r:4,fill:vT(k.item),strokeWidth:2,stroke:"#fff",payload:P.payload,value:P.value},vt(q,!1)),kb(q));return z.push(x.renderActiveDot(q,L,"".concat(U,"-activePoint-").concat($))),O?z.push(x.renderActiveDot(q,le(le({},L),{},{cx:O.x,cy:O.y}),"".concat(U,"-basePoint-").concat($))):T&&z.push(null),z}),We(S,"renderGraphicChild",function(_,k,P){var O=S.filterFormatItem(_,k,P);if(!O)return null;var $=S.getTooltipEventType(),T=S.state,z=T.isTooltipActive,U=T.tooltipAxis,E=T.activeTooltipIndex,q=T.activeLabel,W=S.props.children,L=Sa(W,Qr),M=O.props,B=M.points,I=M.isRange,R=M.baseLine,F=O.item.type.defaultProps!==void 0?le(le({},O.item.type.defaultProps),O.item.props):O.item.props,j=F.activeDot,C=F.hide,A=F.activeBar,D=F.activeShape,V=!!(!C&&z&&L&&(j||A||D)),Y={};$!=="axis"&&L&&L.props.trigger==="click"?Y={onClick:Ay(S.handleItemMouseEnter,_.props.onClick)}:$!=="axis"&&(Y={onMouseLeave:Ay(S.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:Ay(S.handleItemMouseEnter,_.props.onMouseEnter)});var G=p.cloneElement(_,le(le({},O.props),Y));function K(Be){return typeof U.dataKey=="function"?U.dataKey(Be.payload):null}if(V)if(E>=0){var Z,J;if(U.dataKey&&!U.allowDuplicatedCategory){var ce=typeof U.dataKey=="function"?K:"payload.".concat(U.dataKey.toString());Z=Cb(B,ce,q),J=I&&R&&Cb(R,ce,q)}else Z=B==null?void 0:B[E],J=I&&R&&R[E];if(D||A){var ue=_.props.activeIndex!==void 0?_.props.activeIndex:E;return[p.cloneElement(_,le(le(le({},O.props),Y),{},{activeIndex:ue})),null,null]}if(!dt(Z))return[G].concat(eh(S.renderActivePoints({item:O,activePoint:Z,basePoint:J,childIndex:E,isRange:I})))}else{var be,Ne=(be=S.getItemByXY(S.state.activeCoordinate))!==null&&be!==void 0?be:{graphicalItem:G},te=Ne.graphicalItem,re=te.item,pe=re===void 0?_:re,Ee=te.childIndex,Fe=le(le(le({},O.props),Y),{},{activeIndex:Ee});return[p.cloneElement(pe,Fe),null,null]}return I?[G,null,null]:[G,null]}),We(S,"renderCustomized",function(_,k,P){return p.cloneElement(_,le(le({key:"recharts-customized-".concat(P)},S.props),S.state))}),We(S,"renderMap",{CartesianGrid:{handler:Iy,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Iy},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Iy},YAxis:{handler:Iy},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:rv("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=KH(S.triggeredAfterMouseMove,(N=b.throttleDelay)!==null&&N!==void 0?N:1e3/60),S.state={},S}return O8e(x,y),E8e(x,[{key:"componentDidMount",value:function(){var w,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,N=w.children,S=w.data,_=w.height,k=w.layout,P=Sa(N,Qr);if(P){var O=P.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,T=bE(this.state,S,O,$),z=this.state.tooltipTicks[O].coordinate,U=(this.state.offset.top+_)/2,E=k==="horizontal",q=E?{x:z,y:U}:{y:z,x:U},W=this.state.formattedGraphicalItems.find(function(M){var B=M.item;return B.type.name==="Scatter"});W&&(q=le(le({},q),W.props.points[O].tooltipPosition),T=W.props.points[O].tooltipPayload);var L={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:$,activePayload:T,activeCoordinate:q};this.setState(L),this.renderCursor(P),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,_;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){JC([Sa(w.children,Qr)],[Sa(this.props.children,Qr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Sa(this.props.children,Qr);if(w&&typeof w.props.shared=="boolean"){var N=w.props.shared?"axis":"item";return l.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var N=this.container,S=N.getBoundingClientRect(),_=_Oe(S),k={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},P=S.width/N.offsetWidth||1,O=this.inRange(k.chartX,k.chartY,P);if(!O)return null;var $=this.state,T=$.xAxisMap,z=$.yAxisMap,U=this.getTooltipEventType(),E=D3(this.state,this.props.data,this.props.layout,O);if(U!=="axis"&&T&&z){var q=vl(T).scale,W=vl(z).scale,L=q&&q.invert?q.invert(k.chartX):null,M=W&&W.invert?W.invert(k.chartY):null;return le(le({},k),{},{xValue:L,yValue:M},E)}return E?le(le({},k),E):null}},{key:"inRange",value:function(w,N){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,k=w/S,P=N/S;if(_==="horizontal"||_==="vertical"){var O=this.state.offset,$=k>=O.left&&k<=O.left+O.width&&P>=O.top&&P<=O.top+O.height;return $?{x:k,y:P}:null}var T=this.state,z=T.angleAxisMap,U=T.radiusAxisMap;if(z&&U){var E=vl(z);return vL({x:k,y:P},E)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,N=this.getTooltipEventType(),S=Sa(w,Qr),_={};S&&N==="axis"&&(S.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=kb(this.props,this.handleOuterEvent);return le(le({},k),_)}},{key:"addListener",value:function(){AN.on(PN,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){AN.removeListener(PN,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,N,S){for(var _=this.state.formattedGraphicalItems,k=0,P=_.length;k<P;k++){var O=_[k];if(O.item===w||O.props.key===w.key||N===xi(O.item.type)&&S===O.childIndex)return O}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,N=this.state.offset,S=N.left,_=N.top,k=N.height,P=N.width;return H.createElement("defs",null,H.createElement("clipPath",{id:w},H.createElement("rect",{x:S,y:_,height:k,width:P})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(N,S){var _=M3(S,2),k=_[0],P=_[1];return le(le({},N),{},We({},k,P.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(N,S){var _=M3(S,2),k=_[0],P=_[1];return le(le({},N),{},We({},k,P.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[w])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(w){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[w])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(w){var N=this.state,S=N.formattedGraphicalItems,_=N.activeItem;if(S&&S.length)for(var k=0,P=S.length;k<P;k++){var O=S[k],$=O.props,T=O.item,z=T.type.defaultProps!==void 0?le(le({},T.type.defaultProps),T.props):T.props,U=xi(T.type);if(U==="Bar"){var E=($.data||[]).find(function(M){return c3e(w,M)});if(E)return{graphicalItem:O,payload:E}}else if(U==="RadialBar"){var q=($.data||[]).find(function(M){return vL(w,M)});if(q)return{graphicalItem:O,payload:q}}else if(q1(O,_)||H1(O,_)||cg(O,_)){var W=f5e({graphicalItem:O,activeTooltipItem:_,itemData:z.data}),L=z.activeIndex===void 0?W:z.activeIndex;return{graphicalItem:le(le({},O),{},{childIndex:L}),payload:cg(O,_)?z.data[W]:O.props.data[W]}}}return null}},{key:"render",value:function(){var w=this;if(!s4(this))return null;var N=this.props,S=N.children,_=N.className,k=N.width,P=N.height,O=N.style,$=N.compact,T=N.title,z=N.desc,U=I3(N,w8e),E=vt(U,!1);if($)return H.createElement(p3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(ZC,Rd({},E,{width:k,height:P,title:T,desc:z}),this.renderClipPath(),l4(S,this.renderMap)));if(this.props.accessibilityLayer){var q,W;E.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,E.role=(W=this.props.role)!==null&&W!==void 0?W:"application",E.onKeyDown=function(M){w.accessibilityManager.keyboardEvent(M)},E.onFocus=function(){w.accessibilityManager.focus()}}var L=this.parseEventsOfWrapper();return H.createElement(p3,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",Rd({className:yt("recharts-wrapper",_),style:le({position:"relative",curs
935or:"default",width:k,height:P},O)},L,{ref:function(B){w.container=B}}),H.createElement(ZC,Rd({},E,{width:k,height:P,title:T,desc:z,style:L8e}),this.renderClipPath(),l4(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(p.Component);We(v,"displayName",n),We(v,"defaultProps",le({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),We(v,"getDerivedStateFromProps",function(y,x){var b=y.dataKey,w=y.data,N=y.children,S=y.width,_=y.height,k=y.layout,P=y.stackOffset,O=y.margin,$=x.dataStartIndex,T=x.dataEndIndex;if(x.updateId===void 0){var z=R3(y);return le(le(le({},z),{},{updateId:0},m(le(le({props:y},z),{},{updateId:0}),x)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:_,prevLayout:k,prevStackOffset:P,prevMargin:O,prevChildren:N})}if(b!==x.prevDataKey||w!==x.prevData||S!==x.prevWidth||_!==x.prevHeight||k!==x.prevLayout||P!==x.prevStackOffset||!Qd(O,x.prevMargin)){var U=R3(y),E={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},q=le(le({},D3(x,w,k)),{},{updateId:x.updateId+1}),W=le(le(le({},U),E),q);return le(le(le({},W),m(le({props:y},W),x)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:_,prevLayout:k,prevStackOffset:P,prevMargin:O,prevChildren:N})}if(!JC(N,x.prevChildren)){var L,M,B,I,R=Sa(N,Wf),F=R&&(L=(M=R.props)===null||M===void 0?void 0:M.startIndex)!==null&&L!==void 0?L:$,j=R&&(B=(I=R.props)===null||I===void 0?void 0:I.endIndex)!==null&&B!==void 0?B:T,C=F!==$||j!==T,A=!dt(w),D=A&&!C?x.updateId:x.updateId+1;return le(le({updateId:D},m(le(le({props:y},x),{},{updateId:D,dataStartIndex:F,dataEndIndex:j}),x)),{},{prevChildren:N,dataStartIndex:F,dataEndIndex:j})}return null}),We(v,"renderActiveDot",function(y,x,b){var w;return p.isValidElement(y)?w=p.cloneElement(y,x):ot(y)?w=y(x):w=H.createElement(xT,x),H.createElement(Cn,{className:"recharts-active-dot",key:b},w)});var g=p.forwardRef(function(x,b){return H.createElement(v,Rd({},x,{ref:b}))});return g.displayName=v.displayName,g},vx=lK({chartName:"LineChart",GraphicalChild:Es,axisComponents:[{axisType:"xAxis",AxisComp:Ni},{axisType:"yAxis",AxisComp:_i}],formatAxisMap:CY}),Y8e=lK({chartName:"BarChart",GraphicalChild:Si,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ni},{axisType:"yAxis",AxisComp:_i}],formatAxisMap:CY});const F3=e=>"children"in e,B3=[{key:"overview",label:"Overview",icon:H2},{key:"users",label:"Users",icon:Fs},{key:"agents",label:"Agents",icon:zn},{key:"numbers",label:"Numbers",icon:Un},{key:"payments",label:"Payments",icon:uu},{group:"Reports",icon:cu,children:[{key:"revenue",label:"Revenue Report",icon:q2},{key:"agent-report",label:"Agent Report",icon:cu},{key:"user-report",label:"User Report",icon:qi}]},{key:"promotions",label:"Promotions",icon:HB},{key:"referrals",label:"Referrals",icon:d8}];function $y({label:e,value:t,icon:n}){return o.jsx("div",{className:"rounded-xl border border-border bg-card p-5",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(n,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:t}),o.jsx("div",{className:"text-xs text-muted-foreground",children:e})]})]})})}const K8e=()=>{const[e,t]=p.useState(()=>!!sessionStorage.getItem(_m)),[n,r]=p.useState(""),[a,s]=p.useState(""),[i,l]=p.useState(""),[c,u]=p.useState("overview"),[d,f]=p.useState({}),[h,m]=p.useState(null),[v,g]=p.useState([]),[y,x]=p.useState(!0),[b,w]=p.useState(null),[N,S]=p.useState(10),[_,k]=p.useState(null),[P,O]=p.useState({rate_per_minute:.35,cost_multiplier:3,total_charges:0}),[$,T]=p.useState(!1),[z,U]=p.useState({email:"",full_name:"",password:""}),[E,q]=p.useState(null),[W,L]=p.useState(null),[M,B]=p.useState(!1),[I,R]=p.useState([]),[F,j]=p.useState(!1),[C,A]=p.useState([]),[D,V]=p.useState(!1),[Y,G]=p.useState(null),[K,Z]=p.useState(null),[J,ce]=p.useState(null),[ue,be]=p.useState([]),[Ne,te]=p.useState(null),[re,pe]=p.useState(!1),[Ee,Fe]=p.useState(!1),[Be,st]=p.useState(!1),[Pt,kn]=p.useState(!1),[Tt,an]=p.useState(null),[Kr,Tr]=p.useState(null),[me,Se]=p.useState(!1),[it,Lt]=p.useState(!1),[In,Or]=p.useState([]),[bt,qn]=p.useState({code:"",amount:20,expiry_days:"",max_redemptions:""}),[is,Vs]=p.useState(!1),[Xr,pc]=p.useState([]),[Ws,Hn]=p.useState(!1),[ma,He]=p.useState({key:null,dir:"asc"}),[mt,Ot]=p.useState({}),[Mr,gr]=p.useState(1),[Ir,vo]=p.useState(10),[En,Ba]=p.useState({key:null,dir:"asc"}),[Ji,Yu]=p.useState({}),[cj,fv]=p.useState(1),[Ku,uj]=p.useState(10),[pa,dj]=p.useState({key:null,dir:"asc"}),[ls,Xu]=p.useState({}),[fj,hv]=p.useState(1),[Ju,hj]=p.useState(10),[yo,mv]=p.useState({key:null,dir:"asc"}),[gc,pv]=p.useState({}),[mj,gv]=p.useState(1),[Qu,pj]=p.useState(10),[qs,gj]=p.useState({key:null,dir:"asc"}),[vc,vv]=p.useState({}),[Dh,HT]=p.useState(1),[yv,RX]=p.useState(10),[Hs,LX]=p.useState({key:null,dir:"asc"}),[Rh,GT]=p.useState({}),[FX,YT]=p.useState(1),[xv,BX]=p.useState(10),[Zu,zX]=p.useState({key:null,dir:"asc"}),[Lh,KT]=p.useState({}),[UX,XT]=p.useState(1),[bv,VX]=p.useState(10),[Gs,WX]=p.useState({key:null,dir:"asc"}),[JT,qX]=p.useState({}),[HX,QT]=p.useState(1),[wv,GX]=p.useState(10),[Ys,YX]=p.useState({key:null,dir:"asc"}),[ZT,KX]=p.useState({}),[XX,eO]=p.useState(1),[jv,JX]=p.useState(10),QX=async Q=>{Q.preventDefault();const{data:ae,error:$e}=await ee.adminLogin(n,a);if($e||!(ae!=null&&ae.admin_token)){l($e||"Invalid username or password");return}sessionStorage.setItem(_m,ae.admin_token),t(!0),l("")},ZX=()=>{sessionStorage.removeItem(_m),t(!1)},eJ=Q=>
935!!Q&&/admin (login|session)|expired|not an admin|401|unauthor/i.test(Q),tJ=()=>{sessionStorage.removeItem(_m),t(!1),x(!1),X.error("Admin session expired. Please log in again.")},yc=async()=>{const[Q,ae]=await Promise.all([ee.getAdminStats(),ee.getAdminUsers()]);if(eJ(Q.error))return tJ();Q.data&&m(Q.data),Array.isArray(ae.data)&&g(ae.data),x(!1)};p.useEffect(()=>{e&&yc()},[e]),p.useEffect(()=>{e&&(c==="overview"&&(Ee||ee.getAdminRevenue().then(Q=>{Q.data&&ce(Q.data),Fe(!0)}),Pt||ee.getAdminUsersReport().then(Q=>{Q.data&&te(Q.data),kn(!0)})),c==="agents"&&!F&&ee.getAdminAgents().then(Q=>{Array.isArray(Q.data)&&R(Q.data),j(!0)}),c==="numbers"&&!D&&ee.getAdminPhoneNumbers().then(Q=>{Array.isArray(Q.data)&&A(Q.data),V(!0)}),c==="payments"&&!re&&ee.getAdminPayments().then(Q=>{Q.data&&Z(Q.data),pe(!0)}),c==="promotions"&&!me&&Promise.all([ee.getAdminSettings(),ee.getAdminPromoKpis(),ee.getAdminPromoCodes()]).then(([Q,ae,$e])=>{Q.data&&an(Q.data),ae.data&&Tr(ae.data),Array.isArray($e.data)&&Or($e.data),Se(!0)}),c==="revenue"&&!Ee&&ee.getAdminRevenue().then(Q=>{Q.data&&ce(Q.data),Fe(!0)}),c==="agent-report"&&!Be&&ee.getAdminAgentsReport().then(Q=>{Array.isArray(Q.data)&&be(Q.data),st(!0)}),c==="user-report"&&!Pt&&ee.getAdminUsersReport().then(Q=>{Q.data&&te(Q.data),kn(!0)}),c==="referrals"&&!Ws&&ee.getAdminReferrals().then(Q=>{Array.isArray(Q.data)&&pc(Q.data),Hn(!0)}))},[e,c,F,D,re,Ee,Be,Pt,me,Ws]);const vj=[{key:"user",label:"User"},{key:"status",label:"Status"},{key:"balance",label:"Balance"},{key:"rate",label:"Rate"},{key:"numbers",label:"Numbers"},{key:"calls",label:"Calls"}],ed=(Q,ae)=>ae==="user"?`${Q.full_name||""} ${Q.email} ${Q.company_name||""}`:ae==="status"?Q.is_active?Q.status:"Disabled":ae==="balance"?String(Q.balance??0):ae==="rate"?String(Q.rate_per_minute??.35):ae==="numbers"?String(Q.phone_numbers??0):ae==="calls"?String(Q.total_conversations):"",tO=v.filter(Q=>vj.every(({key:ae})=>{if(ae==="status"){const Ce=mt.status;return!Ce||ed(Q,"status")===Ce}const $e=(mt[ae]||"").trim().toLowerCase();return!$e||ed(Q,ae).toLowerCase().includes($e)})),yj=ma.key?[...tO].sort((Q,ae)=>{const $e=["balance","rate","numbers","calls"].includes(ma.key);let Ce;return $e?Ce=parseFloat(ed(Q,ma.key))-parseFloat(ed(ae,ma.key)):Ce=ed(Q,ma.key).toLowerCase().localeCompare(ed(ae,ma.key).toLowerCase()),ma.dir==="asc"?Ce:-Ce}):tO,nJ=Math.max(1,Math.ceil(yj.length/Ir)),xj=Math.min(Mr,nJ),nO=yj.slice((xj-1)*Ir,xj*Ir),rJ=Q=>He(ae=>ae.key!==Q?{key:Q,dir:"asc"}:ae.dir==="asc"?{key:Q,dir:"desc"}:{key:null,dir:"asc"}),aJ=async()=>{if(!z.email.trim()||!z.password.trim())return X.error("Email and password are required");if(z.password.length<6)return X.error("Password must be at least 6 characters");B(!0);const{error:Q}=await ee.createAdminUser({email:z.email.trim(),password:z.password,full_name:z.full_name.trim()||void 0});if(B(!1),Q)return X.error(Q);X.success(`Account created for ${z.email.trim()}`),T(!1),U({email:"",full_name:"",password:""}),yc()},rO=async Q=>{const{error:ae}=await ee.toggleAccess(Q);if(ae)return X.error(ae);X.success("Access toggled"),yc()},oJ=async()=>{E&&(await rO(E.id),q(null))},sJ=async Q=>{if(!N)return X.error("Enter an amount");const{data:ae,error:$e}=await ee.adjustUserBalance(Q,N,"Admin credit");if($e)return X.error($e);X.success(`Added $${N.toFixed(2)}. New balance: $${((ae==null?void 0:ae.balance)??0).toFixed(2)}`),yc()},iJ=async Q=>{const{error:ae}=await ee.updateAdminUser(Q,P);if(ae)return X.error(ae);X.success("Rate updated"),k(null),yc()},lJ=async(Q,ae)=>{const{error:$e}=await ee.updateAdminUser(Q,ae);if($e)return X.error($e);X.success("User updated"),yc()},cJ=async(Q,ae)=>{const $e=window.open("about:blank","_blank"),{data:Ce,error:Ct}=await ee.impersonateUser(Q);if(Ct||!(Ce!=null&&Ce.access_token))return $e&&$e.close(),X.error(Ct||"Could not start impersonation");$e?(wse($e,Ce.access_token,ae),X.success(`Opened ${ae}'s dashboard in a new tab`)):jse(Ce.access_token,ae)},uJ=(Q,ae)=>{L({id:Q,label:ae})},dJ=async()=>{if(!W)return;const{error:Q}=await ee.deleteAdminUser(W.id);if(Q){X.error(Q),L(null);return}X.success("User deleted"),w(null),L(null),yc()};if(!e)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("form",{onSubmit:QX,className:"w-full max-w-sm space-y-5 rounded-xl border border-border bg-card p-6 shadow-lg sm:p-8",children:[o.jsxs("div",{className:"text-center",children:[o.jsx(r8,{className:"mx-auto h-10 w-10 text-primary mb-3"}),o.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Admin Dashboard"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Enter credentials to continue"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"admin-user",children:"Username"}),o.jsx(ve,{id:"admin-user",value:n,onChange:Q=>r(Q.target.value),placeholder:"Username",autoFocus:!0})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"admin-pass",children:"Password"}
935),o.jsx(ve,{id:"admin-pass",type:"password",value:a,onChange:Q=>s(Q.target.value),placeholder:"Password"})]}),i&&o.jsx("p",{className:"text-sm text-destructive",children:i}),o.jsx(ne,{type:"submit",className:"w-full",children:"Sign In"})]})});return o.jsxs("div",{className:"flex min-h-screen bg-background",children:[o.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-border bg-card/40 lg:flex",children:[o.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[o.jsx(Os,{linked:!1}),o.jsx("span",{className:"rounded-md bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary",children:"Admin"})]}),o.jsx("nav",{className:"flex-1 space-y-0.5 p-3",children:B3.map(Q=>{if(!F3(Q))return o.jsxs("button",{onClick:()=>u(Q.key),className:he("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm transition",c===Q.key?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[o.jsx(Q.icon,{className:"h-4 w-4"}),Q.label]},Q.key);const ae=d[Q.group],$e=Q.children.some(Ce=>Ce.key===c);return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>f(Ce=>({...Ce,[Q.group]:!Ce[Q.group]})),className:he("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm transition",$e?"bg-primary/15 text-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[o.jsx(Q.icon,{className:"h-4 w-4"}),o.jsx("span",{className:"flex-1 text-left",children:Q.group}),ae?o.jsx(Iu,{className:"h-4 w-4"}):o.jsx(zo,{className:"h-4 w-4"})]}),ae&&o.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l border-border pl-3",children:Q.children.map(Ce=>o.jsxs("button",{onClick:()=>u(Ce.key),className:he("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm transition",c===Ce.key?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[o.jsx(Ce.icon,{className:"h-4 w-4"}),Ce.label]},Ce.key))})]},Q.group)})}),o.jsx("div",{className:"border-t border-border p-3",children:o.jsxs(ne,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:ZX,children:[o.jsx(Y2,{className:"mr-2 h-4 w-4"})," Logout"]})})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsxs("header",{className:"sticky top-0 z-30 flex min-h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-background/95 px-4 py-2 backdrop-blur lg:hidden",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Os,{linked:!1}),o.jsx("span",{className:"rounded-md bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary",children:"Admin"})]}),o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(ob,{}),o.jsx("select",{value:c,onChange:Q=>u(Q.target.value),className:"h-9 max-w-[55vw] rounded-md border border-input bg-background px-2 text-sm sm:max-w-none",children:B3.map(Q=>F3(Q)?o.jsx("optgroup",{label:Q.group,children:Q.children.map(ae=>o.jsx("option",{value:ae.key,children:ae.label},ae.key))},Q.group):o.jsx("option",{value:Q.key,children:Q.label},Q.key))})]})]}),o.jsx("header",{className:"sticky top-0 z-30 hidden h-14 items-center justify-end border-b border-border bg-background/95 px-6 backdrop-blur lg:flex",children:o.jsx(ob,{})}),o.jsx("main",{className:"flex-1 px-4 py-6 sm:px-6 lg:px-8",children:y?o.jsxs("div",{className:"flex items-center justify-center py-24 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading admin panel…"]}):o.jsxs(o.Fragment,{children:[c==="overview"&&wJ(),c==="users"&&NJ(),c==="agents"&&jJ(),c==="numbers"&&SJ(),c==="payments"&&fJ(),c==="promotions"&&hJ(),c==="referrals"&&vJ(),c==="revenue"&&yJ(),c==="agent-report"&&xJ(),c==="user-report"&&bJ()]})})]})]});function Ks({title:Q,subtitle:ae}){return o.jsxs("div",{className:"mb-6",children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:Q}),o.jsx("p",{className:"text-sm text-muted-foreground",children:ae})]})}function xc(Q){return`$${(Q??0).toFixed(2)}`}function td(){return o.jsxs("div",{className:"flex items-center justify-center py-16 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading…"]})}function vr({label:Q,value:ae}){return o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:ae}),o.jsx("div",{className:"text-xs text-muted-foreground",children:Q})]})}function fJ(){const Q=[{key:"user",label:"User"},{key:"status",label:"Status"},{key:"total_charges",label:"Charges"},{key:"balance",label:"Balance"}
935,{key:"stripe_customer_id",label:"Stripe"}],ae=(se,Pe)=>Pe==="user"?`${se.name||""} ${se.email||""}`:Pe==="total_charges"||Pe==="balance"?String(se[Pe]??0):se[Pe]||"",$e=[{key:"email",label:"User"},{key:"contact",label:"Contact"},{key:"direction",label:"Direction"},{key:"duration",label:"Duration"},{key:"call_cost",label:"Cost"},{key:"call_time",label:"Time"}],Ce=(se,Pe)=>Pe==="contact"?se.contact_name||se.phone||"":Pe==="call_time"?se.call_time?new Date(se.call_time).toLocaleString():"":Pe==="call_cost"?String(se.call_cost??0):se[Pe]||"";let Ct=[],wn=[],ln=1,$n=1,Ae=1,ie=1,De=0,ye=0,Ye=[],yr=[];if(K){Ye=Array.from(new Set(K.per_user.map(Xt=>Xt.status).filter(Boolean)));const se=K.per_user.filter(Xt=>Q.every(({key:ar})=>{if(ar==="status")return!gc.status||Xt.status===gc.status;const Xs=(gc[ar]||"").trim().toLowerCase();return!Xs||ae(Xt,ar).toLowerCase().includes(Xs)})),Pe=yo.key?[...se].sort((Xt,ar)=>{const aO=["total_charges","balance"].includes(yo.key)?parseFloat(ae(Xt,yo.key))-parseFloat(ae(ar,yo.key)):ae(Xt,yo.key).toLowerCase().localeCompare(ae(ar,yo.key).toLowerCase());return yo.dir==="asc"?aO:-aO}):se;De=Pe.length,ln=Math.max(1,Math.ceil(Pe.length/Qu)),$n=Math.min(mj,ln),Ct=Pe.slice(($n-1)*Qu,$n*Qu),yr=Array.from(new Set(K.recent_calls.map(Xt=>Xt.direction).filter(Boolean)));const ut=K.recent_calls.filter(Xt=>$e.every(({key:ar})=>{if(ar==="direction")return!vc.direction||Xt.direction===vc.direction;const Xs=(vc[ar]||"").trim().toLowerCase();return!Xs||Ce(Xt,ar).toLowerCase().includes(Xs)})),jn=qs.key?[...ut].sort((Xt,ar)=>{const Xs=Ce(Xt,qs.key).toLowerCase().localeCompare(Ce(ar,qs.key).toLowerCase());return qs.dir==="asc"?Xs:-Xs}):ut;ye=jn.length,Ae=Math.max(1,Math.ceil(jn.length/yv)),ie=Math.min(Dh,Ae),wn=jn.slice((ie-1)*yv,ie*yv)}const ga=se=>mv(Pe=>Pe.key!==se?{key:se,dir:"asc"}:Pe.dir==="asc"?{key:se,dir:"desc"}:{key:null,dir:"asc"}),Gn=se=>gj(Pe=>Pe.key!==se?{key:se,dir:"asc"}:Pe.dir==="asc"?{key:se,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{children:[o.jsx(Ks,{title:"Payments",subtitle:"Charges and recent billed calls across all users."}),!re||!K?o.jsx(td,{}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:o.jsx(vr,{label:"Total Charges",value:xc(K.summary.total_charges)})}),o.jsx("h3",{className:"mb-2 mt-6 text-sm font-semibold text-foreground",children:"By user"}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:Q.map(({key:se,label:Pe})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:Pe,active:yo.key===se,dir:yo.dir,onClick:()=>ga(se)})},se))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:Q.map(({key:se,label:Pe})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:se==="status"?o.jsx(Tn,{value:gc.status||"",onChange:ut=>pv(jn=>({...jn,status:ut})),placeholder:"Status",options:Ye.map(ut=>({value:ut,label:ut}))}):o.jsx(pn,{value:gc[se]||"",onChange:ut=>pv(jn=>({...jn,[se]:ut})),placeholder:Pe})},se))})]}),o.jsx("tbody",{children:Ct.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No matching users."})}):Ct.map((se,Pe)=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"text-foreground",children:se.name||"—"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:se.email})]}),o.jsx("td",{className:"px-4 py-3 text-center",children:se.status}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:xc(se.total_charges)}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:xc(se.balance)}),o.jsx("td",{className:"px-4 py-3 text-center text-xs text-muted-foreground",children:se.stripe_customer_id||"—"})]},Pe))})]})}),o.jsx(dr,{page:$n,pageSize:Qu,totalCount:De,onPageChange:gv,onPageSizeChange:se=>{pj(se),gv(1)}})]}),o.jsx("h3",{className:"mb-2 mt-6 text-sm font-semibold text-foreground",children:"Recent billed calls"}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[640px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:$e.map(({key:se,label:Pe})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:Pe,active:qs.key===se,dir:qs.dir,onClick:()=>Gn(se)})},se))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:$e.map(({key:se,label:Pe})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:se==="direction"?o.jsx(Tn,{value:vc.direction||"",onChange:ut=>vv(jn=>({...jn,direction:ut})),placeholder:"Direction",options:yr.map(ut=>({value:ut,label:ut}))}):o.jsx(pn,{value:vc[se]||"",onChange:ut=>vv(jn=>({...jn,[se]:ut})),placeholder:Pe})},se))})]}),o.jsx("tbody",{children:wn.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:K.recent_calls.length===0?"N
935o billed calls yet.":"No calls match your filters."})}):wn.map((se,Pe)=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center text-xs text-muted-foreground",children:se.email}),o.jsx("td",{className:"px-4 py-3 text-center",children:se.contact_name||se.phone||"—"}),o.jsx("td",{className:"px-4 py-3 text-center capitalize",children:se.direction}),o.jsx("td",{className:"px-4 py-3 text-center",children:se.duration||"—"}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:xc(se.call_cost)}),o.jsx("td",{className:"px-4 py-3 text-center text-xs text-muted-foreground",children:se.call_time?new Date(se.call_time).toLocaleString():"—"})]},Pe))})]})}),o.jsx(dr,{page:ie,pageSize:yv,totalCount:ye,onPageChange:HT,onPageSizeChange:se=>{RX(se),HT(1)}})]})]})]})}function hJ(){const Q=Tt||{},ae=Kr||{},$e=async()=>{Lt(!0);const{data:Ce,error:Ct}=await ee.updateAdminSettings({promo_enabled:!!Q.promo_enabled,promo_amount:Number(Q.promo_amount)||0,promo_expiry_days:Number(Q.promo_expiry_days)||0});if(Lt(!1),Ct)return X.error(String(Ct));an(Ce),X.success("Promotion settings saved")};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Promotions"}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx(vr,{label:"Free credits issued",value:`$${Number(ae.credits_issued??0).toFixed(2)}`}),o.jsx(vr,{label:"Free credits consumed",value:`$${Number(ae.credits_consumed??0).toFixed(2)}`}),o.jsx(vr,{label:"Conversion (Free → Paid)",value:`${ae.conversion_rate??0}%`}),o.jsx(vr,{label:"Converted / total",value:`${ae.converted_users??0} / ${ae.total_users??0}`}),o.jsx(vr,{label:"Avg LTV (paid users)",value:`$${Number(ae.ltv??0).toFixed(2)}`}),o.jsx(vr,{label:"Avg time to 1st purchase",value:ae.avg_time_to_first_purchase_days!=null?`${ae.avg_time_to_first_purchase_days} days`:"—"}),o.jsx(vr,{label:"CAC",value:"Manual"})]}),o.jsxs("div",{className:"max-w-md space-y-4 rounded-xl border border-border bg-card p-5",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:"Welcome promo"}),o.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm text-foreground",children:[o.jsx("span",{children:"Promotion enabled"}),o.jsx("input",{type:"checkbox",checked:!!Q.promo_enabled,onChange:Ce=>an({...Q,promo_enabled:Ce.target.checked}),className:"h-4 w-4 accent-primary"})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(ke,{children:"Promo amount ($)"}),o.jsx(ve,{type:"number",min:0,value:Q.promo_amount??0,onChange:Ce=>an({...Q,promo_amount:Ce.target.value})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(ke,{children:"Expiry (days, 0 = never)"}),o.jsx(ve,{type:"number",min:0,value:Q.promo_expiry_days??0,onChange:Ce=>an({...Q,promo_expiry_days:Ce.target.value})})]}),o.jsx(ne,{onClick:$e,disabled:it,children:it?"Saving…":"Save settings"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"New signups receive this credit (one-time, expiring). Turn off to stop granting it."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Promo codes"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Codes users can redeem under Billing → Promotions for wallet credit."})]}),o.jsxs("div",{className:"grid grid-cols-2 items-end gap-3 rounded-xl border border-border bg-card p-4 sm:flex sm:flex-wrap",children:[o.jsxs("div",{className:"min-w-0 space-y-1",children:[o.jsx(ke,{className:"text-xs",children:"Code"}),o.jsx(ve,{className:"w-full font-mono uppercase sm:w-40",placeholder:"LAUNCH20",value:bt.code,onChange:Ce=>qn({...bt,code:Ce.target.value.toUpperCase()})})]}),o.jsxs("div",{className:"min-w-0 space-y-1",children:[o.jsx(ke,{className:"text-xs",children:"Credit ($)"}),o.jsx(ve,{type:"number",min:1,className:"w-full sm:w-28",value:bt.amount,onChange:Ce=>qn({...bt,amount:parseFloat(Ce.target.value)||0})})]}),o.jsxs("div",{className:"min-w-0 space-y-1",children:[o.jsx(ke,{className:"text-xs",children:"Credit expires (days)"}),o.jsx(ve,{type:"number",min:0,className:"w-full sm:w-36",placeholder:"never",value:bt.expiry_days,onChange:Ce=>qn({...bt,expiry_days:Ce.target.value})})]}),o.jsxs("div",{className:"min-w-0 space-y-1",children:[o.jsx(ke,{className:"text-xs",children:"Max redemptions"}
935),o.jsx(ve,{type:"number",min:1,className:"w-full sm:w-36",placeholder:"unlimited",value:bt.max_redemptions,onChange:Ce=>qn({...bt,max_redemptions:Ce.target.value})})]}),o.jsxs(ne,{className:"col-span-2",onClick:mJ,disabled:is||!bt.code.trim(),children:[o.jsx(nn,{className:"mr-1 h-4 w-4"})," ",is?"Creating…":"Create code"]})]}),(()=>{const Ce=[{key:"code",label:"Code"},{key:"amount",label:"Credit"},{key:"redemption_count",label:"Redeemed"},{key:"expiry_days",label:"Credit expiry"},{key:"active",label:"Status"}],Ct=(ye,Ye)=>Ye==="amount"?String(ye.amount):Ye==="redemption_count"?String(ye.redemption_count):Ye==="expiry_days"?ye.expiry_days?`${ye.expiry_days} days`:"never":Ye==="active"?ye.active?"Active":"Disabled":String(ye[Ye]??""),wn=In.filter(ye=>Ce.every(({key:Ye})=>{if(Ye==="active")return!Rh.active||Ct(ye,"active")===Rh.active;const yr=(Rh[Ye]||"").trim().toLowerCase();return!yr||Ct(ye,Ye).toLowerCase().includes(yr)})),ln=Hs.key?[...wn].sort((ye,Ye)=>{const ga=["amount","redemption_count"].includes(Hs.key)?parseFloat(Ct(ye,Hs.key))-parseFloat(Ct(Ye,Hs.key)):Ct(ye,Hs.key).toLowerCase().localeCompare(Ct(Ye,Hs.key).toLowerCase());return Hs.dir==="asc"?ga:-ga}):wn,$n=Math.max(1,Math.ceil(ln.length/xv)),Ae=Math.min(FX,$n),ie=ln.slice((Ae-1)*xv,Ae*xv),De=ye=>LX(Ye=>Ye.key!==ye?{key:ye,dir:"asc"}:Ye.dir==="asc"?{key:ye,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[640px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[Ce.map(({key:ye,label:Ye})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:Ye,active:Hs.key===ye,dir:Hs.dir,onClick:()=>De(ye)})},ye)),o.jsx("th",{className:"px-4 py-3",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[Ce.map(({key:ye,label:Ye})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:ye==="active"?o.jsx(Tn,{value:Rh.active||"",onChange:yr=>GT(ga=>({...ga,active:yr})),placeholder:"Status",options:[{value:"Active",label:"Active"},{value:"Disabled",label:"Disabled"}]}):o.jsx(pn,{value:Rh[ye]||"",onChange:yr=>GT(ga=>({...ga,[ye]:yr})),placeholder:Ye})},ye)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:ie.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:In.length===0?"No promo codes yet.":"No codes match your filters."})}):ie.map(ye=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-mono font-medium text-foreground",children:ye.code}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:["$",Number(ye.amount).toFixed(2)]}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:[ye.redemption_count,ye.max_redemptions?` / ${ye.max_redemptions}`:""]}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ye.expiry_days?`${ye.expiry_days} days`:"never"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:ye.active?"default":"secondary",children:ye.active?"Active":"Disabled"})}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o.jsx(ne,{size:"sm",variant:"outline",onClick:()=>pJ(ye),children:ye.active?"Disable":"Enable"}),o.jsx(ne,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>gJ(ye),children:o.jsx(Oa,{className:"h-4 w-4"})})]})})]},ye.id))})]})}),o.jsx(dr,{page:Ae,pageSize:xv,totalCount:ln.length,onPageChange:YT,onPageSizeChange:ye=>{BX(ye),YT(1)}})]})})()]})]})}async function bj(){const{data:Q}=await ee.getAdminPromoCodes();Array.isArray(Q)&&Or(Q)}async function mJ(){const Q=bt.code.trim().toUpperCase();if(!Q)return X.error("Enter a code");if(!bt.amount||bt.amount<=0)return X.error("Credit must be greater than 0");Vs(!0);const{error:ae}=await ee.createAdminPromoCode({code:Q,amount:bt.amount,expiry_days:bt.expiry_days?Number(bt.expiry_days):null,max_redemptions:bt.max_redemptions?Number(bt.max_redemptions):null});if(Vs(!1),ae)return X.error(String(ae));X.success(`Code ${Q} created`),qn({code:"",amount:20,expiry_days:"",max_redemptions:""}),bj()}async function pJ(Q){const{error:ae}=await ee.updateAdminPromoCode(Q.id,{active:!Q.active});if(ae)return X.error(String(ae));bj()}async function gJ(Q){if(!confirm(`Delete code ${Q.code}? Credit already granted to users is not affected.`))return;const{error:ae}=await ee.deleteAdminPromoCode(Q.id);if(ae)return X.error(String(ae));X.success("Code deleted"),bj()}function vJ(){const Q=Xr.filter(ae=>ae.status==="verified").length;return o.jsxs("div",{className:"space-y-6",children:[o.jsx(Ks,{title:"Referrals",subtitle:"Every referral relationship platform-wide (tracking only — no credit is granted)."}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[o.jsx(vr,{label:"Total referrals",value:String(Xr.length)}),o.jsx(vr,{label:"Verified",value:String(Q)}),o.jsx(vr,{label:"Pending",value:String(Xr.length-Q)})]}),(()=>{const ae=[{key:"referrer_email",label:"Referrer"},{key:"referee_email",label:"Referee"},{key:"referral_code",label:"Code"},{key:"status",label:"Status"},{key:"created_at",label:"Invited"},{key:"verified_at",label:"Verified"}],$e=(ie,De)=>De==="status"?ie.status==="verified"?"Verified":"Pending":De==="created_at"?ie.created_at?new Date(ie.created_at).toLocaleDateString():"":De==="verified_at"?ie.verified_at?new Date(ie.verified_at).toLocaleDateString():"":String(ie[De]??""),Ce=Xr.filter(ie=>ae.every(({key:De})=>
935{if(De==="status")return!Lh.status||$e(ie,"status")===Lh.status;const ye=(Lh[De]||"").trim().toLowerCase();return!ye||$e(ie,De).toLowerCase().includes(ye)})),Ct=Zu.key?[...Ce].sort((ie,De)=>{const ye=$e(ie,Zu.key).toLowerCase().localeCompare($e(De,Zu.key).toLowerCase());return Zu.dir==="asc"?ye:-ye}):Ce,wn=Math.max(1,Math.ceil(Ct.length/bv)),ln=Math.min(UX,wn),$n=Ct.slice((ln-1)*bv,ln*bv),Ae=ie=>zX(De=>De.key!==ie?{key:ie,dir:"asc"}:De.dir==="asc"?{key:ie,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[640px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:ae.map(({key:ie,label:De})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:De,active:Zu.key===ie,dir:Zu.dir,onClick:()=>Ae(ie)})},ie))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:ae.map(({key:ie,label:De})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:ie==="status"?o.jsx(Tn,{value:Lh.status||"",onChange:ye=>KT(Ye=>({...Ye,status:ye})),placeholder:"Status",options:[{value:"Verified",label:"Verified"},{value:"Pending",label:"Pending"}]}):o.jsx(pn,{value:Lh[ie]||"",onChange:ye=>KT(Ye=>({...Ye,[ie]:ye})),placeholder:De})},ie))})]}),o.jsx("tbody",{children:$n.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:Xr.length===0?"No referrals yet.":"No referrals match your filters."})}):$n.map(ie=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:ie.referrer_email||"—"}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:ie.referee_email||"—"}),o.jsx("td",{className:"px-4 py-3 text-center font-mono text-xs text-muted-foreground",children:ie.referral_code}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:ie.status==="verified"?"default":"secondary",children:ie.status==="verified"?"Verified":"Pending"})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ie.created_at?new Date(ie.created_at).toLocaleDateString():"—"}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ie.verified_at?new Date(ie.verified_at).toLocaleDateString():"—"})]},ie.id))})]})}),o.jsx(dr,{page:ln,pageSize:bv,totalCount:Ct.length,onPageChange:XT,onPageSizeChange:ie=>{VX(ie),XT(1)}})]})})()]})}function yJ(){return o.jsxs("div",{children:[o.jsx(Ks,{title:"Revenue Report",subtitle:"Usage revenue and a 30-day trend."}),!Ee||!J?o.jsx(td,{}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsx(vr,{label:"Usage Revenue",value:xc(J.totals.usage_revenue)}),o.jsx(vr,{label:"Lifetime Charges",value:xc(J.totals.total_charges)})]}),o.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"Usage revenue (last 30 days)"}),o.jsx("div",{className:"h-64 w-full [&_.recharts-surface]:overflow-visible",children:o.jsx(Jm,{width:"100%",height:"100%",children:o.jsxs(vx,{data:J.timeseries,margin:{top:5,right:24,left:0,bottom:5},children:[o.jsx(tf,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(Ni,{dataKey:"label",stroke:"hsl(var(--muted-foreground))",fontSize:12,minTickGap:20,tickMargin:6}),o.jsx(_i,{stroke:"hsl(var(--muted-foreground))",fontSize:12}),o.jsx(Qr,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:8}}),o.jsx(Es,{type:"monotone",dataKey:"revenue",name:"Revenue ($)",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1})]})})})]})]})]})}function xJ(){const Q=[{key:"name",label:"Agent"},{key:"owner_email",label:"Owner"},{key:"total_calls",label:"Total Calls"},{key:"completed",label:"Completed"},{key:"qualified",label:"Qualified"}],ae=(Ae,ie)=>String(Ae[ie]??""),$e=ue.filter(Ae=>Q.every(({key:ie})=>{const De=(JT[ie]||"").trim().toLowerCase();return!De||ae(Ae,ie).toLowerCase().includes(De)})),Ce=Gs.key?[...$e].sort((Ae,ie)=>{const ye=["total_calls","completed","qualified"].includes(Gs.key)?parseFloat(ae(Ae,Gs.key)||"0")-parseFloat(ae(ie,Gs.key)||"0"):ae(Ae,Gs.key).toLowerCase().localeCompare(ae(ie,Gs.key).toLowerCase());return Gs.dir==="asc"?ye:-ye}):$e,Ct=Math.max(1,Math.ceil(Ce.length/wv)),wn=Math.min(HX,Ct),ln=Ce.slice((wn-1)*wv,wn*wv),$n=Ae=>WX(ie=>ie.key!==Ae?{key:Ae,dir:"asc"}:ie.dir==="asc"?{key:Ae,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{children:[o.jsx(Ks,{title:"Agent Report",subtitle:"Every agent's call performance across the platform."}),Be?o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:Q.map(({key:Ae,label:ie})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:ie,active:Gs.key===Ae,dir:Gs.dir,onClick:()=>$n(Ae)})},Ae))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:Q.map(({key:Ae,label:ie})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:JT[Ae]||"",onChange:De=>qX(ye=>({...ye,[Ae]:De})),placeholder:ie})},Ae))})]}),o.jsx("tbody",{children:ln.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:ue.length===0?"N
935o agents yet.":"No agents match your filters."})}):ln.map(Ae=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:Ae.name}),o.jsx("td",{className:"px-4 py-3 text-center text-xs text-muted-foreground",children:Ae.owner_email}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:Ae.total_calls}),o.jsx("td",{className:"px-4 py-3 text-center",children:Ae.completed}),o.jsx("td",{className:"px-4 py-3 text-center font-medium text-success",children:Ae.qualified})]},Ae.id))})]})}),o.jsx(dr,{page:wn,pageSize:wv,totalCount:Ce.length,onPageChange:QT,onPageSizeChange:Ae=>{GX(Ae),QT(1)}})]}):o.jsx(td,{})]})}function bJ(){return o.jsxs("div",{children:[o.jsx(Ks,{title:"User Report",subtitle:"Sign-ups, active users, and the most active accounts."}),!Pt||!Ne?o.jsx(td,{}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[o.jsx(vr,{label:"Total Users",value:Ne.totals.total_users}),o.jsx(vr,{label:"Active",value:Ne.totals.active_users}),o.jsx(vr,{label:"Disabled",value:Ne.totals.disabled_users})]}),o.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"Sign-ups (last 30 days)"}),o.jsx("div",{className:"h-64 w-full [&_.recharts-surface]:overflow-visible",children:o.jsx(Jm,{width:"100%",height:"100%",children:o.jsxs(vx,{data:Ne.signups,margin:{top:5,right:24,left:0,bottom:5},children:[o.jsx(tf,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(Ni,{dataKey:"label",stroke:"hsl(var(--muted-foreground))",fontSize:12,minTickGap:20,tickMargin:6}),o.jsx(_i,{stroke:"hsl(var(--muted-foreground))",fontSize:12,allowDecimals:!1}),o.jsx(Qr,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:8}}),o.jsx(Es,{type:"monotone",dataKey:"signups",name:"Sign-ups",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1})]})})})]}),o.jsx("h3",{className:"mb-2 mt-6 text-sm font-semibold text-foreground",children:"Top users by activity"}),(()=>{const Q=[{key:"user",label:"User"},{key:"conversations",label:"Conversations"},{key:"agents",label:"Agents"}],ae=(Ae,ie)=>ie==="user"?`${Ae.name||""} ${Ae.email||""}`:String(Ae[ie]??""),$e=Ne.top_users.filter(Ae=>Q.every(({key:ie})=>{const De=(ZT[ie]||"").trim().toLowerCase();return!De||ae(Ae,ie).toLowerCase().includes(De)})),Ce=Ys.key?[...$e].sort((Ae,ie)=>{const ye=["conversations","agents"].includes(Ys.key)?parseFloat(ae(Ae,Ys.key)||"0")-parseFloat(ae(ie,Ys.key)||"0"):ae(Ae,Ys.key).toLowerCase().localeCompare(ae(ie,Ys.key).toLowerCase());return Ys.dir==="asc"?ye:-ye}):$e,Ct=Math.max(1,Math.ceil(Ce.length/jv)),wn=Math.min(XX,Ct),ln=Ce.slice((wn-1)*jv,wn*jv),$n=Ae=>YX(ie=>ie.key!==Ae?{key:Ae,dir:"asc"}:ie.dir==="asc"?{key:Ae,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[420px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:Q.map(({key:Ae,label:ie})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:ie,active:Ys.key===Ae,dir:Ys.dir,onClick:()=>$n(Ae)})},Ae))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:Q.map(({key:Ae,label:ie})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:ZT[Ae]||"",onChange:De=>KX(ye=>({...ye,[Ae]:De})),placeholder:ie})},Ae))})]}),o.jsx("tbody",{children:ln.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:3,className:"px-4 py-8 text-center text-muted-foreground",children:"No users match your filters."})}):ln.map((Ae,ie)=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"text-foreground",children:Ae.name||"—"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:Ae.email})]}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:Ae.conversations}),o.jsx("td",{className:"px-4 py-3 text-center",children:Ae.agents})]},ie))})]})}),o.jsx(dr,{page:wn,pageSize:jv,totalCount:Ce.length,onPageChange:eO,onPageSizeChange:Ae=>{JX(Ae),eO(1)}})]})})()]})]})}function wJ(){const Q=v.reduce(($e,Ce)=>$e+(Ce.phone_numbers||0),0),ae=v.reduce(($e,Ce)=>$e+(Ce.total_charges||0),0);return o.jsxs("div",{children:[o.jsx(Ks,{title:"Overview",subtitle:"Platform snapshot across all users."}),h&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx($y,{label:"Total Users",value:h.total_users,icon:Fs}),o.jsx($y,{label:"Total Conversations",value:h.total_conversations,icon:Wo}),o.jsx($y,{label:"Total Agents",value:h.total_agents,icon:zn}),o.jsx($y,{label:"Phone Numbers",value:Q,icon:Un})]}),o.jsx("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:o.jsx("div",{className:"rounded-xl border border-border bg-card p-5",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:o.jsx(q2,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:xc(ae)}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Lifetime Charges"})]})]})})}),o.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"Sign-ups (last 30 days)"}),Ne?o.jsx("div",{className:"h-56 w-full [&_.recharts-surface]:overflow-visible",children:o.jsx(Jm,{width:"100%",height:"100%",children:o.jsxs(vx,{data:Ne.signups,margin:{top:5,right:24,left:0,bottom:5},children:[o.jsx(tf,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(Ni,{dataKey:"label",stroke:"hsl(var(--muted-foreground))",fontSize:12,minTickGap:20,tickMargin:6}),o.jsx(_i,{stroke:"hsl(var(--muted-foreground))",fontSize:12,allowDecimals:!1}),o.jsx(Qr,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:8}}),o.jsx(Es,{type:"monotone",dataKey:"signups",name:"Sign-ups",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1})]})})}):o.jsx(td,{})]})]})}function jJ(){const Q=[{key:"name",label:"Agent"},{key:"owner",label:"Owner"},{key:"category",label:"Industry"},{key:"voice",label:"Voice"},{key:"status",label:"Status"},{key:"synced",label:"VAPI"},{key:"created_at",label:"Created"}],ae=(ie,De)=>De==="owner"?`${ie.owner_name||""} ${ie.owner_email||""}`:De==="synced"?ie.synced?"Synced":"Not synced":De==="created_at"?ie.created_at?new Date(ie.created_at).toLocaleDateString():"":String(ie[De]??""),$e=Array.from(new Set(I.map(ie=>
935ie.category).filter(Boolean))),Ce=I.filter(ie=>Q.every(({key:De})=>{if(De==="status"||De==="category"||De==="synced"){const Ye=Ji[De];return Ye?De==="synced"?(ie.synced?"Synced":"Not synced")===Ye:ie[De]===Ye:!0}const ye=(Ji[De]||"").trim().toLowerCase();return!ye||ae(ie,De).toLowerCase().includes(ye)})),Ct=En.key?[...Ce].sort((ie,De)=>{const ye=ae(ie,En.key).toLowerCase(),Ye=ae(De,En.key).toLowerCase(),yr=ye<Ye?-1:ye>Ye?1:0;return En.dir==="asc"?yr:-yr}):Ce,wn=Math.max(1,Math.ceil(Ct.length/Ku)),ln=Math.min(cj,wn),$n=Ct.slice((ln-1)*Ku,ln*Ku),Ae=ie=>Ba(De=>De.key!==ie?{key:ie,dir:"asc"}:De.dir==="asc"?{key:ie,dir:"desc"}:{key:null,dir:"asc"});return o.jsxs("div",{children:[o.jsx(Ks,{title:"Agents",subtitle:"Every AI agent created across all users."}),F?o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[760px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsx("tr",{className:"divide-x divide-border",children:Q.map(({key:ie,label:De})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:De,active:En.key===ie,dir:En.dir,onClick:()=>Ae(ie)})},ie))}),o.jsx("tr",{className:"divide-x divide-border border-t border-border",children:Q.map(({key:ie,label:De})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:ie==="category"?o.jsx(Tn,{value:Ji.category||"",onChange:ye=>Yu(Ye=>({...Ye,category:ye})),placeholder:"Industry",options:$e.map(ye=>({value:ye,label:ye}))}):ie==="status"?o.jsx(Tn,{value:Ji.status||"",onChange:ye=>Yu(Ye=>({...Ye,status:ye})),placeholder:"Status",options:[{value:"Active",label:"Active"},{value:"Inactive",label:"Inactive"}]}):ie==="synced"?o.jsx(Tn,{value:Ji.synced||"",onChange:ye=>Yu(Ye=>({...Ye,synced:ye})),placeholder:"VAPI",options:[{value:"Synced",label:"Synced"},{value:"Not synced",label:"Not synced"}]}):o.jsx(pn,{value:Ji[ie]||"",onChange:ye=>Yu(Ye=>({...Ye,[ie]:ye})),placeholder:De})},ie))})]}),o.jsx("tbody",{children:$n.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-muted-foreground",children:I.length===0?"No agents found.":"No agents match your filters."})}):$n.map(ie=>o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsx("td",{className:"px-4 py-3 text-center font-medium text-foreground",children:ie.name}),o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"text-foreground",children:ie.owner_name||"—"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:ie.owner_email})]}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ie.category||"—"}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ie.voice||"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:ie.status==="Active"?"default":"secondary",children:ie.status})}),o.jsx("td",{className:"px-4 py-3 text-center",children:ie.synced?o.jsx("span",{className:"text-xs font-medium text-success",children:"Synced"}):o.jsx("span",{className:"text-xs text-muted-foreground",children:"Not synced"})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:ie.created_at?new Date(ie.created_at).toLocaleDateString():"—"})]},ie.id))})]})}),o.jsx(dr,{page:ln,pageSize:Ku,totalCount:Ct.length,onPageChange:fv,onPageSizeChange:ie=>{uj(ie),fv(1)}})]}):o.jsxs("div",{className:"flex items-center justify-center py-16 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading agents…"]})]})}function SJ(){const Q=se=>se?new Date(se).toLocaleDateString():"—",ae=se=>{const Pe=se!=null&&se<0,ut=se!=null&&se>=0&&se<=5;return{label:se==null?"":Pe?"expired":`${se} day${se===1?"":"s"} left`,cls:Pe?"text-destructive font-medium":ut?"text-yellow-500":"text-muted-foreground"}},$e=new Map;for(const se of C){const Pe=se.owner_email||se.owner_name||se.id;$e.has(Pe)||$e.set(Pe,{owner_email:se.owner_email,owner_name:se.owner_name,numbers:[]}),$e.get(Pe).numbers.push(se)}const Ce=Array.from($e.values()).map(se=>{const Pe=se.numbers.reduce((Xt,ar)=>Xt+(ar.monthly_cost??0),0),ut=se.numbers.filter(Xt=>Xt.days_left!=null),jn=ut.length?ut.reduce((Xt,ar)=>(Xt.days_left??0)<=(ar.days_left??0)?Xt:ar):null;return{...se,count:se.numbers.length,totalMonthly:Pe,soonest:jn}}),Ct=(ls.owner||"").trim().toLowerCase(),wn=(ls.count||"").trim().toLowerCase(),ln=(ls.totalMonthly||"").trim().toLowerCase(),$n=(ls.soonest||"").trim().toLowerCase(),Ae=Ce.filter(se=>{var Pe;if(Ct&&!((se.owner_email||"").toLowerCase().includes(Ct)||(se.owner_name||"").toLowerCase().includes(Ct))||wn&&!String(se.count).includes(wn)||ln&&!(se.totalMonthly>0?`$${se.totalMonthly.toFixed(2)}`:"Free").toLowerCase().includes(ln))return!1;if($n){const ut=((Pe=se.soonest)==null?void 0:Pe.days_left)??null;if(!(ut==null?"—":ut<0?"expired":`${ut} day${ut===1?"":"s"} left`).toLowerCase().includes($n))return!1}return!0}),ie=pa.key,De=ie?[...Ae].sort((se,Pe)=>{var jn,Xt;let ut=0;return ie==="count"?ut=se.count-Pe.count:ie==="totalMonthly"?ut=se.totalMonthly-Pe.totalMonthly:ie==="soonest"?ut=(((jn=se.s
935oonest)==null?void 0:jn.days_left)??1/0)-(((Xt=Pe.soonest)==null?void 0:Xt.days_left)??1/0):ut=(se.owner_name||se.owner_email||"").toLowerCase().localeCompare((Pe.owner_name||Pe.owner_email||"").toLowerCase()),pa.dir==="asc"?ut:-ut}):Ae,ye=Math.max(1,Math.ceil(De.length/Ju)),Ye=Math.min(fj,ye),yr=De.slice((Ye-1)*Ju,Ye*Ju),ga=se=>dj(Pe=>Pe.key!==se?{key:se,dir:"asc"}:Pe.dir==="asc"?{key:se,dir:"desc"}:{key:null,dir:"asc"}),Gn=Y?$e.get(Y)??null:null;return o.jsxs("div",{children:[o.jsx(Ks,{title:"Numbers",subtitle:"How many numbers each user owns. Click a user to see all their numbers and expiry dates."}),D?o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[600px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:"Owner",active:pa.key==="owner",dir:pa.dir,onClick:()=>ga("owner")})}),o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:"Numbers",active:pa.key==="count",dir:pa.dir,onClick:()=>ga("count")})}),o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:"Total Monthly",active:pa.key==="totalMonthly",dir:pa.dir,onClick:()=>ga("totalMonthly")})}),o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:"Soonest Expiry",active:pa.key==="soonest",dir:pa.dir,onClick:()=>ga("soonest")})}),o.jsx("th",{className:"px-4 py-3",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:ls.owner||"",onChange:se=>Xu(Pe=>({...Pe,owner:se})),placeholder:"Owner"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:ls.count||"",onChange:se=>Xu(Pe=>({...Pe,count:se})),placeholder:"Numbers"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:ls.totalMonthly||"",onChange:se=>Xu(Pe=>({...Pe,totalMonthly:se})),placeholder:"Total Monthly"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:ls.soonest||"",onChange:se=>Xu(Pe=>({...Pe,soonest:se})),placeholder:"Soonest Expiry"})}),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsx("tbody",{children:yr.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:Ce.length===0?"No numbers found.":"No owners match your filter."})}):yr.map(se=>{var jn;const Pe=ae(((jn=se.soonest)==null?void 0:jn.days_left)??null),ut=se.owner_email||se.owner_name;return o.jsxs("tr",{onClick:()=>G(ut),className:"cursor-pointer divide-x divide-border border-t border-border bg-card/30 hover:bg-muted/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"font-medium text-foreground",children:se.owner_name||"—"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:se.owner_email})]}),o.jsx("td",{className:"px-4 py-3 text-center text-lg font-bold text-foreground",children:se.count}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:se.totalMonthly>0?`$${se.totalMonthly.toFixed(2)}`:"Free"}),o.jsx("td",{className:"px-4 py-3 text-center",children:se.soonest?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-foreground",children:Q(se.soonest.expires_at)}),Pe.label&&o.jsx("div",{className:`text-xs ${Pe.cls}`,children:Pe.label})]}):"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(zo,{className:"h-4 w-4 text-muted-foreground"})})]},ut)})})]})}),o.jsx(dr,{page:Ye,pageSize:Ju,totalCount:De.length,onPageChange:hv,onPageSizeChange:se=>{hj(se),hv(1)}})]}):o.jsx(td,{}),o.jsx(ft,{open:!!Gn,onOpenChange:se=>{se||G(null)},children:o.jsxs(ct,{className:"max-w-2xl",children:[o.jsxs($t,{className:"px-6 sm:pl-0",children:[o.jsxs(xt,{children:["Numbers owned by ",(Gn==null?void 0:Gn.owner_name)||(Gn==null?void 0:Gn.owner_email)||""]}),o.jsxs(wt,{children:[Gn==null?void 0:Gn.owner_email," · ",(Gn==null?void 0:Gn.numbers.length)||0," number(s)"]})]}),o.jsx("div",{className:"max-h-[60vh] overflow-auto rounded-lg border border-border",children:o.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-3 py-2",children:"Number"}),o.jsx("th",{className:"px-3 py-2",children:"Provider"}),o.jsx("th",{className:"px-3 py-2",children:"Status"}),o.jsx("th",{className:"px-3 py-2",children:"Purchased"}),o.jsx("th",{className:"px-3 py-2",children:"Expires"}),o.jsx("th",{className:"px-3 py-2",children:"Monthly"})]})}),o.jsx("tbody",{children:Gn==null?void 0:Gn.numbers.map(se=>{const Pe=ae(se.days_left);return o.jsxs("tr",{className:"border-t border-border",children:[o.jsx("td",{className:"px-3 py-2 font-medium text-foreground",children:se.number||"—"}),o.jsx("td",{className:"px-3 py-2 capitalize text-muted-foreground",children:se.provider}),o.jsx("td",{className:"px-3 py-2",children:o.jsx(_n,{variant:se.status==="Active"?"default":"secondary",children:se.status})}),o.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:Q(se.created_at)}),o.jsxs("td",{className:"px-3 py-2",children:[o.jsx("div",{className:"text-foreground",children:Q(se.expires_at)}),Pe.label&&o.jsx("div",{className:`text-xs ${Pe.cls}`,children:Pe.label})]}),o.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:(se.monthly_cost??0)>0?`$${(se.monthly_cost??0).toFixed(2)}`:"Free"})]},se.id)})})]})})]})})]})}function NJ(){return o.jsxs("div",{children:[o.jsxs("div",{className:"mb-6 flex flex-col gap-0 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[o.jsx(Ks,{title:"Users",subtitle:"Manage users, balances and rates."}),o.jsxs(ne,{onClick:()=>T(!0),children:[o.jsx(nn,{className:"mr-1.5 h-4 w-4"})," Add User"]})]}),o.jsx(ft,{open:$,onOpenChange:Q=>{T(Q),Q||U({email:"",full_name:"",password:""})},children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Add User"}),o.jsx(wt,{children:"Creates an account that can sign in immediately. No email verification step, since you're vouching for it directly. Gets the same welcome credit a verified sign-up would."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Full Name"}),o.jsx(ve,{value:z.full_name,onChange:Q=>U(ae=>({...ae,full_name:Q.target.value})),placeholder:"Jane Doe"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Email *"}),o.jsx(ve,{type:"email",value:z.email,onChange:Q=>U(ae=>({...ae,email:Q.target.value})),placeholder:"[email protected]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ke,{children:"Password *"}),o.jsx(ve,{type:"text",value:z.password,onChange:Q=>U(ae=>({...ae,password:Q.target.value})),placeholder:"At least 6 characters. Share this with the user directly"})]})]}),o.jsxs(Wt,{className:"gap-2 sm:gap-0",children:[o.jsx(ne,{variant:"outline",onClick:()=>T(!1),children:"Cancel"}),o.jsxs(ne,{onClick:aJ,disabled:M,children:[M?o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"}):o.jsx(nn,{className:"mr-1.5 h-4 w-4"}),"Create Account"]})]})]})}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[780px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[vj.map(({key:Q,label:ae})=>o.jsx("th",{className:"px-4 py-3",children:o.jsx(cn,{label:ae,active:ma.key===Q,dir:ma.dir,onClick:()=>rJ(Q)})},Q)),o.jsx("th",{className:"px-4 py-3",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[vj.map(({key:Q,label:ae})=>o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:Q==="status"?o.jsx(Tn,{value:mt.status||"",onChange:$e=>Ot(Ce=>({...Ce,status:$e})),placeholder:"Status",options:[{value:"active",label:"Active"},{value:"Disabled",label:"Disabled"}]}):o.jsx(pn,{value:mt[Q]||"",onChange:$e=>Ot(Ce=>({...Ce,[Q]:$e})),placeholder:ae})},Q)),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsxs("tbody",{children:[nO.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-muted-foreground",children:v.length===0?"N
935o users found":"No users match your filters"})}),nO.map(Q=>o.jsxs(p.Fragment,{children:[o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30 hover:bg-muted/30 cursor-pointer",onClick:()=>w(b===Q.id?null:Q.id),children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"font-medium text-foreground",children:Q.full_name||" "}),o.jsx("div",{className:"text-xs text-muted-foreground",children:Q.email}),Q.company_name&&o.jsx("div",{className:"text-xs text-muted-foreground",children:Q.company_name})]}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(_n,{variant:Q.is_active?Q.status==="active"?"default":"secondary":"destructive",children:Q.is_active?Q.status:"Disabled"})}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:["$",(Q.balance??0).toFixed(2)]}),o.jsxs("td",{className:"px-4 py-3 text-center text-foreground",children:["$",(Q.rate_per_minute??.35).toFixed(2),"/min"]}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:Q.phone_numbers??0}),o.jsx("td",{className:"px-4 py-3 text-center text-foreground",children:Q.total_conversations}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(zo,{className:`h-4 w-4 mx-auto text-muted-foreground transition ${b===Q.id?"rotate-90":""}`})})]}),b===Q.id&&o.jsx("tr",{className:"border-t border-border bg-muted/20",children:o.jsx("td",{colSpan:7,className:"px-4 py-4 sm:px-6",children:o.jsxs("div",{className:"max-w-[calc(100vw-66px)] sm:max-w-none",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Access"}),o.jsx(ne,{size:"sm",variant:Q.is_active?"outline":"default",className:Q.is_active?"border-destructive/40 text-destructive hover:bg-destructive/10":void 0,onClick:ae=>{ae.stopPropagation(),Q.is_active?q({id:Q.id,label:Q.full_name||Q.email}):rO(Q.id)},children:Q.is_active?o.jsxs(o.Fragment,{children:[o.jsx(Ure,{className:"mr-1 h-4 w-4"})," Disable"]}):o.jsxs(o.Fragment,{children:[o.jsx(zre,{className:"mr-1 h-4 w-4"})," Enable"]})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"text-xs font-semibold text-muted-foreground uppercase",children:["Balance ($",(Q.balance??0).toFixed(2),")"]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"$"}),o.jsx("input",{type:"number",min:1,step:"0.01",value:N,onChange:ae=>S(parseFloat(ae.target.value)||0),onClick:ae=>ae.stopPropagation(),className:"h-8 w-20 rounded border border-input bg-background px-2 text-sm"}),o.jsxs(ne,{size:"sm",onClick:ae=>{ae.stopPropagation(),sJ(Q.id)},children:[o.jsx(nn,{className:"mr-1 h-3 w-3"})," Add"]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Status"}),o.jsxs(nt,{value:Q.status,onValueChange:ae=>lJ(Q.id,{status:ae}),children:[o.jsx(Ze,{onClick:ae=>ae.stopPropagation(),className:"h-8 w-full text-sm sm:w-40",children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"trial",children:"Trial"}),o.jsx(we,{value:"active",children:"Active"}),o.jsx(we,{value:"past_due",children:"Past Due"}),o.jsx(we,{value:"canceled",children:"Canceled"})]})]})]})]}),o.jsx("div",{className:"mt-4 border-t border-border pt-4",children:_===Q.id?o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Custom Rate"}),o.jsxs("div",{className:"flex flex-wrap gap-3",children:[o.jsxs("label",{className:"space-y-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Rate $/min"}),o.jsx("input",{type:"number",step:"0.01",value:P.rate_per_minute,onClick:ae=>ae.stopPropagation(),onChange:ae=>O($e=>({...$e,rate_per_minute:parseFloat(ae.target.value)||0})),className:"block h-8 w-24 rounded border border-input bg-background px-2 text-sm"})]}),o.jsxs("label",{className:"space-y-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Cost multiplier"}),o.jsx("input",{type:"number",step:"0.01",value:P.cost_multiplier,onClick:ae=>ae.stopPropagation(),onChange:ae=>O($e=>({...$e,cost_multiplier:parseFloat(ae.target.value)||0})),className:"block h-8 w-24 rounded border border-input bg-background px-2 text-sm"})]}),o.jsxs("label",{className:"space-y-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Total charges $"}),o.jsx("input",{type:"number",step:"0.01",value:P.total_charges,onClick:ae=>ae.stopPropagation(),onChange:ae=>O($e=>({...$e,total_charges:parseFloat(ae.target.value)||0})),className:"block h-8 w-28 rounded border border-input bg-background px-2 text-sm"})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ne,{size:"sm",onClick:ae=>{ae.stopPropagation(),iJ(Q.id)},children:"Save"}),o.jsx(ne,{size:"sm",variant:"outline",onClick:ae=>{ae.stopPropagation(),k(null)},children:"Cancel"})]})]}):o.jsx(ne,{size:"sm",variant:"ghost",onClick:ae=>{ae.stopPropagation(),O({rate_per_minute:Q.rate_per_minute??.35,cost_multiplier:Q.cost_multiplier??3,total_charges:Q.total_charges??0}),k(Q.id)},children:"Set Custom Rate / Billing"})}),o.jsxs("div",{className:"mt-4 flex flex-col gap-3 border-t border-border pt-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Joined: ",new Date(Q.created_at).toLocaleDateString(),Q.stripe_customer_id&&o.jsxs(o.Fragment,{children:[" · Stripe: ",Q.stripe_customer_id]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(ne,{size:"sm",variant:"outline",onClick:ae=>{ae.stopPropagation(),cJ(Q.id,Q.email)},children:[o.jsx(Ls,{className:"mr-1 h-4 w-4"})," View as user"]}),o.jsxs(ne,{size:"sm",variant:"destructive",onClick:ae=>{ae.stopPropagation(),uJ(Q.id,Q.full_name||Q.email)},children:[o.jsx(Oa,{className:"mr-1 h-4 w-4"})," Delete User"]})]})]})]})})})]},Q.id))]})]})}),o.jsx(dr,{page:xj,pageSize:Ir,totalCount:yj.length,onPageChange:gr,onPageSizeChange:Q=>{vo(Q),gr(1)}})]}),o.jsx(Is,{open:!!E,onOpenChange:Q=>{Q||q(null)},children:o.jsxs(Yo,{children:[o.jsxs(Ko,{className:"text-center sm:text-center",children:[o.jsx(Jo,{children:"Disable this account?"}),o.jsxs(Qo,{children:[E&&`"${E.label}" `,"will immediately lose access. No calls, campaigns or agent creation until re-enabled."]})]}),o.jsxs(Xo,{className:"sm:justify-center",children:[o.jsx(es,{children:"Cancel"}),o.jsx(Zo,{onClick:oJ,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disable"})]})]})}),o.jsx(Is,{open:!!W,onOpenChange:Q=>{Q||L(null)},children:o.jsxs(Yo,{children:[o.jsxs(Ko,{className:"text-center sm:text-center",children:[o.jsx(Jo,{children:"Permanently delete this user?"}),o.jsxs(Qo,{children:[W&&`"${W.label}" `,"and ALL their data (agents, contacts, calls, numbers) will be permanently deleted. This can't be und
935one."]})]}),o.jsxs(Xo,{className:"sm:justify-center",children:[o.jsx(es,{children:"Cancel"}),o.jsx(Zo,{onClick:dJ,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}},AT=({title:e,subtitle:t,variant:n})=>{const[r,a]=p.useState(null),[s,i]=p.useState([]),[l,c]=p.useState([]),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,v]=p.useState(!0);p.useEffect(()=>{(async()=>{var S,_,k,P,O;const b=[ee.getAnalyticsOverview(),ee.getAnalyticsTimeseries(14)];n==="campaign"&&b.push(ee.getAnalyticsCampaign()),(n==="channel"||n==="scenario")&&b.push(ee.getAnalyticsChannel()),n==="scenario"&&b.push(ee.getAnalyticsAgent());const w=await Promise.all(b);(S=w[0])!=null&&S.data&&a(w[0].data),Array.isArray((_=w[1])==null?void 0:_.data)&&i(w[1].data);let N=2;n==="campaign"&&(Array.isArray((k=w[N])==null?void 0:k.data)&&d(w[N].data),N++),(n==="channel"||n==="scenario")&&((P=w[N])!=null&&P.data&&typeof w[N].data=="object"&&h(w[N].data),N++),n==="scenario"&&Array.isArray((O=w[N])==null?void 0:O.data)&&c(w[N].data),v(!1)})()},[n]);const g=r?[{label:"Total calls",value:r.total_calls.toLocaleString()},{label:"Completed calls",value:r.completed_calls.toLocaleString()},{label:"Qualified calls",value:`${r.qualified_calls.toLocaleString()} (${r.qualified_rate}%)`},{label:"Active agents",value:r.active_agents.toLocaleString()},{label:"Total campaigns",value:r.total_campaigns.toLocaleString()}]:[{label:"Total calls",value:"--"},{label:"Completed calls",value:"--"},{label:"Qualified calls",value:"--"},{label:"Active agents",value:"--"},{label:"Total campaigns",value:"--"}],x=s.reduce((b,w)=>b+w.calls,0)>0;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:g.map(b=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:b.label}),o.jsx("div",{className:"mt-1 text-2xl font-bold text-foreground",children:m?o.jsx(Te,{className:"h-5 w-5 animate-spin"}):b.value})]},b.label))}),o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("h3",{className:"font-semibold text-foreground",children:"Trends (last 14 days)"}),!m&&!x&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"No call data yet chart will populate after your first calls."})]}),o.jsx("div",{className:"h-72 w-full",children:m?o.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"})," Loading…"]}):x?o.jsx(Jm,{width:"100%",height:"100%",children:o.jsxs(vx,{data:s,margin:{top:5,right:24,left:0,bottom:5},children:[o.jsx(tf,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(Ni,{dataKey:"label",stroke:"hsl(var(--muted-foreground))",fontSize:12,minTickGap:20,tickMargin:6}),o.jsx(_i,{stroke:"hsl(var(--muted-foreground))",fontSize:12}),o.jsx(Qr,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:8,color:"hsl(var(--foreground))"}}),o.jsx(Bl,{wrapperStyle:{paddingTop:16,fontSize:12}}),o.jsx(Es,{type:"monotone",dataKey:"calls",name:"Calls",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1}),o.jsx(Es,{type:"monotone",dataKey:"completed",name:"Completed",stroke:"hsl(var(--neon-cyan))",strokeWidth:2,dot:!1}),o.jsx(Es,{type:"monotone",dataKey:"duration_min",name:"Duration (min)",stroke:"hsl(var(--warning))",strokeWidth:2,dot:!1})]})}):o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground",children:[o.jsx("p",{children:"No conversations in the last 14 days."}),o.jsx("p",{className:"text-xs",children:"Run a campaign or take an inbound call to populate this chart."})]})})]}),n==="channel"&&o.jsx(X8e,{channels:f}),n==="campaign"&&o.jsx(J8e,{campaigns:u}),n==="scenario"&&o.jsx(Q8e,{agents:l})]})};function X8e({channels:e}){const t=Object.entries(e).map(([n,r])=>({name:n,...r}));return t.length?o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"By Channel"}),o.jsx("div",{className:"h-64 w-full",children:o.jsx(Jm,{width:"100%",height:"100%",children:o.jsxs(Y8e,{data:t,margin:{top:5,right:24,left:0,bottom:5},children:[o.jsx(tf,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(Ni,{dataKey:"name",stroke:"hsl(var(--muted-foreground))",fontSize:12,minTickGap:8,tickMargin:6}),o.jsx(_i,{stroke:"hsl(var(--muted-foreground))",fontSize:12}),o.jsx(Qr,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"}}),o.jsx(Bl,{wrapperStyle:{paddingTop:16,fontSize:12}}),o.jsx(Si,{dataKey:"total",name:"Total",fill:"hsl(var(--primary))"}),o.jsx(Si,{dataKey:"completed",name:"Completed",fill:"hsl(var(--neon-cyan))"}),o.jsx(Si,{dataKey:"failed",name:"Failed",fill:"hsl(var(--destructive))"})]})})})]}):null}function J8e({campaigns:e}){return e.length?o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"Campaigns"}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[600px] text-sm",children:[o.jsx("thead",{className:"text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"py-2",children:"Name"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Contacts"}),o.jsx("th",{children:"Completed"}),o.jsx("th",{children:"Qualified"}),o.jsx("th",{children:"Progress"})]})}),o.jsx("tbody",{children:e.map(t=>{const n=t.contacts_count>0?Math.round(t.completed_count/t.contacts_count*100):0;return o.jsxs("tr",{className:"border-t border-border",children:[o.jsx("td",{className:"py-2 font-medium",children:t.name}),o.jsx("td",{children:t.status}
935),o.jsx("td",{children:t.contacts_count.toLocaleString()}),o.jsx("td",{children:t.completed_count.toLocaleString()}),o.jsx("td",{className:"font-medium text-success",children:(t.qualified_count??0).toLocaleString()}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"h-1.5 w-24 rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary",style:{width:`${n}%`}})}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n,"%"]})]})})]},t.id)})})]})})]}):null}function Q8e({agents:e}){return e.length?o.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[o.jsx("h3",{className:"mb-4 font-semibold text-foreground",children:"By Agent"}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[480px] text-sm",children:[o.jsx("thead",{className:"text-left text-xs uppercase tracking-wide text-muted-foreground",children:o.jsxs("tr",{children:[o.jsx("th",{className:"py-2",children:"Agent"}),o.jsx("th",{children:"Total"}),o.jsx("th",{children:"Completed"}),o.jsx("th",{children:"Failed"}),o.jsx("th",{children:"Qualified"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{className:"border-t border-border",children:[o.jsx("td",{className:"py-2 font-medium",children:t.name}),o.jsx("td",{children:t.total_calls.toLocaleString()}),o.jsx("td",{children:t.completed.toLocaleString()}),o.jsx("td",{children:t.failed.toLocaleString()}),o.jsx("td",{className:"font-medium text-success",children:(t.qualified??0).toLocaleString()})]},t.id))})]})})]}):null}const Z8e=()=>o.jsx(AT,{variant:"channel",title:"Channel Analytics",subtitle:"Performance per voice / SMS / WhatsApp / Web."}),eze=()=>o.jsx(AT,{variant:"campaign",title:"Campaign Analytics",subtitle:"Compare campaigns side by side."}),tze=()=>o.jsx(AT,{variant:"scenario",title:"Scenario Analytics",subtitle:"Outcomes by agent and scenario."});function nze({open:e,onOpenChange:t,onCreated:n,basePath:r="/dashboard/automation"}){const[a,s]=p.useState(""),[i,l]=p.useState(""),[c,u]=p.useState(!1),d=ua(),f=m=>{m||(s(""),l("")),t(m)},h=async()=>{if(!a.trim())return X.error("Please enter a flow name");u(!0);const{data:m,error:v}=await ee.createFlow({name:a.trim(),description:i.trim()||null,status:"Active"});if(u(!1),v){X.error(v);return}const g=(m==null?void 0:m.id)??a.trim();X.success(`Flow "${a}" created`),f(!1),n==null||n(),d(`${r}/${g}?name=${encodeURIComponent(a.trim())}`)};return o.jsx(ft,{open:e,onOpenChange:f,children:o.jsxs(ct,{className:"max-w-md gap-0 p-0 sm:rounded-xl [&>button]:hidden",children:[o.jsxs("div",{className:"border-b border-border p-5",children:[o.jsx(xt,{className:"text-lg font-semibold",children:"Create new flow"}),o.jsx(wt,{className:"sr-only",children:"Enter a name to create a new automation flow."})]}),o.jsxs("div",{className:"space-y-4 p-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-semibold",children:"Enter new flow name"}),o.jsx(ve,{autoFocus:!0,value:a,onChange:m=>s(m.target.value),onKeyDown:m=>m.key==="Enter"&&h(),placeholder:"Name"})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"mb-2 block text-sm font-semibold",children:["Description ",o.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional)"})]}),o.jsx(Zl,{value:i,onChange:m=>l(m.target.value),placeholder:"What does this flow do?",rows:3,maxLength:500})]})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border p-4",children:[o.jsxs(ne,{variant:"outline",onClick:()=>f(!1),children:[o.jsx(rn,{className:"mr-1 h-4 w-4"})," Cancel"]}),o.jsxs(ne,{onClick:h,disabled:c,className:"bg-primary text-primary-foreground hover:opacity-90",children:[o.jsx(nn,{className:"mr-1 h-4 w-4"})," ",c?"Creating...":"Create"]})]})]})})}const rze=[{key:"id",label:"ID"},{key:"name",label:"Name"},{key:"description",label:"Description"},{key:"status",label:"Status"},{key:"updated_at",label:"Modified"}],aze=({v2:e=!1})=>{const t=e?"/dashboard/automation-v2":"/dashboard/automation",[n,r]=p.useState(!1),[a,s]=p.useState([]),[i,l]=p.useState(!0),[c,u]=
935p.useState(null),[d,f]=p.useState({key:"updated_at",dir:"desc"}),[h,m]=p.useState({}),[v,g]=p.useState(void 0),[y,x]=p.useState(1),[b,w]=p.useState(wP[0]),N=p.useCallback(async()=>{const{data:U,error:E}=await ee.getFlows();E?X.error(E):s(U??[]),l(!1)},[]);p.useEffect(()=>{N()},[N]),p.useEffect(()=>{x(1)},[h,v,b]);const S=async U=>{const E=U.status==="Paused"?"Active":"Paused";u(U.id);const{error:q}=await ee.updateFlow(U.id,{status:E});if(u(null),q)return X.error(q);s(W=>W.map(L=>L.id===U.id?{...L,status:E}:L)),X.success(E==="Paused"?"Flow paused":"Flow resumed")},_=async U=>{const{error:E}=await ee.deleteFlow(U.id);if(E)return X.error(E);s(q=>q.filter(W=>W.id!==U.id)),X.success("Flow deleted")},k=U=>{f(E=>E.key!==U?{key:U,dir:"asc"}:E.dir==="asc"?{key:U,dir:"desc"}:E.dir==="desc"?{key:null,dir:"asc"}:{key:U,dir:"asc"})},P=p.useMemo(()=>Array.from(new Set(a.map(U=>U.status).filter(Boolean))).map(U=>({value:U,label:U})),[a]),O=p.useMemo(()=>{let U=a.filter(E=>{if(h.id&&!E.id.toLowerCase().includes(h.id.toLowerCase())||h.name&&!E.name.toLowerCase().includes(h.name.toLowerCase())||h.description&&!(E.description??"").toLowerCase().includes(h.description.toLowerCase())||h.status&&E.status!==h.status)return!1;if(v){const q=new Date(E.updated_at);if(q.getFullYear()!==v.getFullYear()||q.getMonth()!==v.getMonth()||q.getDate()!==v.getDate())return!1}return!0});if(d.key){const E=d.key;U=[...U].sort((q,W)=>{let L="",M="";return E==="updated_at"?(L=new Date(q.updated_at).getTime(),M=new Date(W.updated_at).getTime()):(L=(q[E]??"").toString().toLowerCase(),M=(W[E]??"").toString().toLowerCase()),L<M?d.dir==="asc"?-1:1:L>M?d.dir==="asc"?1:-1:0})}return U},[a,h,v,d]),$=Math.max(1,Math.ceil(O.length/b)),T=Math.min(y,$),z=O.slice((T-1)*b,T*b);return i?o.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 h-5 w-5 animate-spin"})," Loading flows..."]}):o.jsxs("div",{className:"space-y-6",children:[o.jsx(AW,{title:e?"Flows Lists (V2)":"Flows Lists",description:"Manage your workflow automation.",actions:o.jsxs(ne,{onClick:()=>r(!0),className:"bg-primary text-primary-foreground",children:[o.jsx(nn,{className:"mr-2 h-4 w-4"})," Create New Flow"]})}),o.jsx(nze,{open:n,onOpenChange:r,onCreated:N,basePath:t}),o.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[700px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-xs uppercase tracking-wider text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[rze.map(U=>o.jsx("th",{className:"px-4 py-3 font-semibold",children:o.jsx(cn,{label:U.label,active:d.key===U.key,dir:d.dir,onClick:()=>k(U.key)})},U.key)),o.jsx("th",{className:"px-4 py-3 text-center font-semibold",children:"Actions"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:h.id||"",onChange:U=>m(E=>({...E,id:U})),placeholder:"ID"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:h.name||"",onChange:U=>m(E=>({...E,name:U})),placeholder:"Name"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(pn,{value:h.description||"",onChange:U=>m(E=>({...E,description:U})),placeholder:"Description"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(Tn,{value:h.status||"",onChange:U=>m(E=>({...E,status:U})),options:P,placeholder:"Status"})}),o.jsx("th",{className:"px-4 py-3 font-normal normal-case",children:o.jsx(Tf,{value:v,onChange:g})}),o.jsx("th",{className:"px-4 py-3"})]})]}),o.jsxs("tbody",{className:"divide-y divide-border",children:[z.map(U=>o.jsxs("tr",{className:"divide-x divide-border hover:bg-muted/40",children:[o.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-center font-mono text-xs text-muted-foreground",children:U.id.slice(0,8)}),o.jsx("td",{className:"px-4 py-3 text-center font-medium",children:U.name}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:U.description}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx(PW,{status:U.status})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:new Date(U.updated_at).toLocaleDateString()}),o.jsx("td",{className:"px-4 py-3",children:o.jsxs("div",{className:"flex justify-center gap-1",children:[o.jsx("button",{onClick:()=>S(U),disabled:c===U.id,className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted disabled:opacity-50","aria-label":U.status==="Paused"?"Resume flow":"Pause flow",title:U.status==="Paused"?"Resume flow":"Pause flow",children:U.status==="Paused"?o.jsx(Gl,{className:"h-4 w-4"}):o.jsx(Mg,{className:"h-4 w-4"})}),o.jsx(jt,{to:`${t}/${U.id}?name=${encodeURIComponent(U.name)}`,className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted","aria-label":"Edit flow",children:o.jsx(lw,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>_(U),className:"rounded-md p-2.5 sm:p-1.5 text-destructive hover:bg-destructive/10",children:o.jsx(Oa,{className:"h-4 w-4"})})]})})]},U.id)),z.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-4 py-12 text-center text-muted-foreground",children:"No flows found."})})]})]})}),o.jsx(dr,{page:T,pageSize:b,totalCount:O.length,onPageChange:x,onPageSizeChange:w,onRefresh:N})]})]})},oze=()=>o.jsx(aze,{}),Dy=["Event","Outcome","Applies to","Used by","Actions"],sze=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(!0),[a,s]=p.useState(null),[i,l]=p.useState(!1),[c,u]=
935p.useState(null),[d,f]=p.useState(null),[h,m]=p.useState(!1),v=p.useCallback(async()=>{r(!0),s(null);const{data:b,error:w}=await ee.getCallEvents();w||!Array.isArray(b)?s(w||"Couldn't load your events."):t(b),r(!1)},[]);p.useEffect(()=>{v()},[v]);const g=()=>{u(null),l(!0)},y=b=>{u(b),l(!0)},x=async()=>{var w;if(!d)return;m(!0);const b=await ee.deleteCallEvent(d.id);if(m(!1),f(null),b.error){X.error(b.error);return}(w=b.warnings)!=null&&w.length?X.warning(jW(b.warnings)):X.success("Event deleted"),v()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Moments your agents report during calls. Create them once, then choose them on any agent."}),o.jsxs(ne,{onClick:g,children:[o.jsx(nn,{className:"mr-1.5 h-4 w-4"})," New Event"]})]}),o.jsx("div",{className:"overflow-hidden rounded-xl border border-border",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:o.jsx("tr",{className:"divide-x divide-border",children:Dy.map(b=>o.jsx("th",{className:"px-4 py-3",children:b},b))})}),o.jsx("tbody",{children:n?o.jsx("tr",{children:o.jsxs("td",{colSpan:Dy.length,className:"px-4 py-8 text-center text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 inline h-4 w-4 animate-spin"})," Loading…"]})}):a?o.jsx("tr",{children:o.jsxs("td",{colSpan:Dy.length,className:"px-4 py-8 text-center",children:[o.jsx("p",{role:"alert",className:"text-destructive",children:a}),o.jsx(ne,{variant:"outline",size:"sm",className:"mt-3",onClick:v,children:"Try again"})]})}):e.length===0?o.jsx("tr",{children:o.jsxs("td",{colSpan:Dy.length,className:"px-4 py-12 text-center",children:[o.jsx($g,{className:"mx-auto h-8 w-8 text-muted-foreground"}),o.jsx("p",{className:"mt-2 font-medium",children:"No events yet"}),o.jsx("p",{className:"mt-1 text-muted-foreground",children:"Create an event for each moment you want your agents to report."}),o.jsxs(ne,{className:"mt-4",onClick:g,children:[o.jsx(nn,{className:"mr-1.5 h-4 w-4"})," Create your first event"]})]})}):e.map(b=>{var w;return o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"font-medium text-foreground",children:b.label}),b.description&&o.jsx("div",{className:"mx-auto mt-0.5 max-w-xs text-xs text-muted-foreground",children:b.description}),b.schedules_callback&&o.jsx("span",{className:"mt-1 inline-block rounded-full bg-warning/15 px-2 py-0.5 text-xs font-medium text-warning",children:"Schedules callback"})]}),o.jsx("td",{className:"px-4 py-3 text-center",children:b.outcome?o.jsx("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:b.outcome}):"—"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-medium",children:wb[b.applies_to]})}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:(w=b.agents)!=null&&w.length?o.jsx("div",{className:"flex flex-wrap justify-center gap-1",children:b.agents.map(N=>o.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground",children:N.name},N.id))}):b.agent_count?`${b.agent_count} agent${b.agent_count===1?"":"s"}`:"Not used"}),o.jsx("td",{className:"px-4 py-3 text-center",children:o.jsxs("div",{className:"flex items-center justify-center gap-1",children:[o.jsx("button",{onClick:()=>y(b),"aria-label":`Edit ${b.label}`,title:"Edit",className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:o.jsx(lw,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>f(b),"aria-label":`Delete ${b.label}`,title:"Delete",className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:o.jsx(Oa,{className:"h-4 w-4"})})]})})]},b.id)})})]})})}),o.jsx(SW,{open:i,onOpenChange:l,event:c,onSaved:()=>v()}),o.jsx(Is,{open:!!d,onOpenChange:b=>!b&&!h&&f(null),children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsxs(Jo,{children:['Delete "',d==null?void 0:d.label,'"?']}
935),o.jsxs(Qo,{children:[d!=null&&d.agent_count?`It will be removed from ${d.agent_count} agent${d.agent_count===1?"":"s"} (${(d.agents??[]).map(b=>b.name).join(", ")}). `:"No agents use it. ","Past calls keep their recorded events and outcomes."]})]}),o.jsxs(Xo,{children:[o.jsx(es,{disabled:h,children:"Cancel"}),o.jsx(Zo,{onClick:b=>{b.preventDefault(),x()},disabled:h,children:h?"Deleting…":"Delete"})]})]})})]})},ize=[{to:"/dashboard/call-events",label:"Events",end:!0},{to:"/dashboard/call-events/callbacks",label:"Callbacks",end:!1}],lze=()=>o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Call Events"}),o.jsx("nav",{"aria-label":"Call events sections",className:"mt-4 flex gap-1 border-b border-border",children:ize.map(e=>o.jsx(Jx,{to:e.to,end:e.end,className:({isActive:t})=>he("-mb-px border-b-2 px-4 py-2 text-sm font-medium transition",t?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:e.label},e.to))})]}),o.jsx(M2,{})]}),z3={pending:"Scheduled",calling:"Calling now",called:"Called",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped"},cze={caller:"Time the caller asked for",default:"Default time (caller gave none)",manual:"Set by a person"},cK=e=>{try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),e}catch{return}};function uze(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?"—":new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:cK(t),timeZoneName:"short"}).format(n)}function dze(e,t){const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=Object.fromEntries(new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:cK(t)}).formatToParts(n).map(a=>[a.type,a.value]));return`${r.year}-${r.month}-${r.day}T${r.hour}:${r.minute}`}const fze=(e,t=new Date)=>e.status==="pending"&&new Date(e.due_at).getTime()<t.getTime();function hze(e,t=c1()){const n=/^([01]\d|2[0-3]):[0-5]\d$/;return!e.timezone.trim()||t.length>0&&!["UTC",...t].includes(e.timezone)?"Choose a timezone from the list.":e.work_days.length===0?"Pick at least one calling day.":[e.start_time,e.end_time,e.default_time].every(r=>n.test(r))?e.start_time>=e.end_time?"End time must be after start time.":e.default_time<e.start_time||e.default_time>=e.end_time?"The default callback time must fall inside your calling hours.":!Number.isInteger(e.retry_minutes)||e.retry_minutes<5||e.retry_minutes>1440?"Retry delay must be a whole number from 5 to 1440.":!Number.isInteger(e.max_attempts)||e.max_attempts<1||e.max_attempts>5?"Attempts must be a whole number from 1 to 5.":null:"Enter the start, end and default times."}function mze({open:e,onOpenChange:t,settings:n,isOwner:r,onSaved:a}){const[s,i]=p.useState(n),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=p.useMemo(()=>Array.from(new Set(["UTC",n.timezone,...c1()])),[n.timezone]);p.useEffect(()=>{e&&(i(n),d(null),h(!1))},[e,n]);const v=(w,N)=>{i(S=>({...S,[w]:N})),d(null)},g=w=>v("work_days",s.work_days.includes(w)?s.work_days.filter(N=>N!==w):[...s.work_days,w].sort()),y=async()=>{c(!0);const{data:w,error:N}=await ee.updateCallbackSettings({...s});if(c(!1),h(!1),N||!w){d(N||"Couldn't save your settings.");return}X.success("Callback settings saved"),a(w),t(!1)},x=()=>{const w=hze(s,m);
935if(w){d(w);return}if(s.auto_call&&!n.auto_call){h(!0);return}y()},b=(w,N,S,_,k)=>o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:`cbs-${w}`,children:N}),o.jsx(ve,{id:`cbs-${w}`,type:"number",inputMode:"numeric",min:_,max:k,disabled:!r,value:Number.isNaN(s[w])?"":s[w],onChange:P=>v(w,P.target.value===""?NaN:Number(P.target.value))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:S})]});return o.jsxs(o.Fragment,{children:[o.jsx(ft,{open:e,onOpenChange:t,children:o.jsxs(ct,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Callback settings"}),o.jsx(wt,{children:"When callbacks may be placed, and whether NEXUS places them for you."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-md border border-input p-3",children:[o.jsxs("div",{children:[o.jsx(ke,{htmlFor:"cbs-auto",className:"text-sm font-medium",children:"Place callbacks automatically"}),o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Off: callbacks are only recorded here and your team calls them. On: NEXUS calls the customer at the time they asked for, inside your calling hours. Each call uses your wallet balance."})]}),o.jsx(jh,{id:"cbs-auto","aria-label":"Place callbacks automatically",checked:s.auto_call,disabled:!r,onCheckedChange:w=>v("auto_call",w)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cbs-tz",children:"Timezone"}),o.jsx(vq,{id:"cbs-tz",value:s.timezone,zones:m,disabled:!r,onChange:w=>v("timezone",w)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Days and times the caller names are understood in this timezone."})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{children:"Calling days"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:l1.map((w,N)=>{const S=s.work_days.includes(N);return o.jsx("button",{type:"button","aria-pressed":S,disabled:!r,onClick:()=>g(N),className:`rounded-md border px-3 py-1.5 text-sm transition disabled:opacity-60 ${S?"border-primary bg-primary/10 font-medium text-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:w},w)})})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cbs-start",children:"Calls start"}),o.jsx(Xm,{id:"cbs-start",value:s.start_time,disabled:!r,onChange:w=>v("start_time",w)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cbs-end",children:"Calls stop"}),o.jsx(Xm,{id:"cbs-end",value:s.end_time,disabled:!r,onChange:w=>v("end_time",w)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cbs-default",children:"Default time"}),o.jsx(Xm,{id:"cbs-default",value:s.default_time,disabled:!r,onChange:w=>v("default_time",w)})]})]}),o.jsx("p",{className:"-mt-2 text-xs text-muted-foreground",children:"The default time is used when a callback is requested without a time (next calling day)."}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[b("retry_minutes","Retry after (minutes)","If placing the call fails.",5,1440),b("max_attempts","Attempts","How many times to try before giving up.",1,5)]}),!r&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"Only the account owner can change these settings."}),u&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:u})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),disabled:l,children:r?"Cancel":"Close"}),r&&o.jsxs(ne,{onClick:x,disabled:l,children:[l&&o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"})," Save settings"]})]})]})}),o.jsx(Is,{open:f,onOpenChange:w=>!w&&!l&&h(!1),children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsx(Jo,{children:"Turn on automatic callbacks?"}),o.jsx(Qo,{children:"NEXUS will place real phone calls to customers at the time they asked for, only inside your calling hours, never to numbers on a do-not-call list, and each call uses your wallet balance. Callbacks that are already due will be placed within a minute. You can turn this off at any time."})]}),o.jsxs(Xo,{children:[o.jsx(es,{disabled:l,children:"Not yet"}),o.jsx(Zo,{onClick:w=>{w.preventDefault(),y()},disabled:l,children:l?"Turning on…":"Turn on"})]})]})})]})}function pze({callback:e,onOpenChange:t,onSaved:n}){const[r,a]=p.useState(""),[s,i]=p.useState(!1),[l,c]=p.useState(null);p.useEffect(()=>{if(e){const d=new Date(e.due_at).getTime()>Date.now();a(dze(d?e.due_at:new Date(Date.now()+36e5).toISOString(),e.timezone)),c(null)}},[e]);const u=async()=>
935{if(!e)return;if(!r){c("Choose a date and time.");return}i(!0),c(null);const{error:d}=await ee.updateCallback(e.id,{due_local:r});if(i(!1),d){c(d);return}X.success("Callback rescheduled"),n(),t(!1)};return o.jsx(ft,{open:!!e,onOpenChange:t,children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Reschedule callback"}),o.jsx(wt,{children:e?`${e.contact_name||e.phone||"This customer"} — time is in ${e.timezone}.`:""})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(ke,{htmlFor:"cb-when",children:"Call back at"}),o.jsx(ve,{id:"cb-when",type:"datetime-local",value:r,onChange:d=>{a(d.target.value),c(null)}}),l&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l})]}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),o.jsxs(ne,{onClick:u,disabled:s,children:[s&&o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"})," Reschedule"]})]})]})})}const gze=[{key:"all",label:"All"},{key:"pending",label:"Scheduled"},{key:"called",label:"Called"},{key:"failed",label:"Failed"},{key:"skipped",label:"Skipped"},{key:"cancelled",label:"Cancelled"}],vze={pending:"bg-info/15 text-info",calling:"bg-warning/15 text-warning",called:"bg-success/15 text-success",failed:"bg-destructive/15 text-destructive",cancelled:"bg-muted text-muted-foreground",skipped:"bg-muted text-muted-foreground"},Ry=["Customer","Agent","Call back at","Status","What they said","Actions"],yze=e=>`${e.work_days.join()==="0,1,2,3,4"?"Mon–Fri":e.work_days.map(n=>l1[n]).join(", ")}, ${e.start_time}–${e.end_time} (${e.timezone})`,xze=()=>{const[e,t]=p.useState([]),[n,r]=p.useState(null),[a,s]=p.useState(null),[i,l]=p.useState(!0),[c,u]=p.useState("all"),[d,f]=p.useState(!0),[h,m]=p.useState(null),[v,g]=p.useState(!1),[y,x]=p.useState(null),[b,w]=p.useState(null),[N,S]=p.useState(!1),_=p.useCallback(async()=>{var U,E;f(!0),m(null);const[$,T,z]=await Promise.all([ee.getCallbacks(c==="all"?void 0:c),ee.getCallbackSettings(),ee.getMyRole()]);$.error||!Array.isArray($.data)?m($.error||"Couldn't load your callbacks."):(t($.data),r(((U=$.meta)==null?void 0:U.counts)??null)),T.data&&s(T.data),l(((E=z.data)==null?void 0:E.is_owner)??!0),f(!1)},[c]);p.useEffect(()=>{_()},[_]);const k=n?Object.values(n).reduce(($,T)=>$+T,0):0,P=async $=>{S(!0);const{error:T}=await ee.updateCallback($.id,{status:"called"});if(S(!1),T){X.error(T);return}X.success("Marked as called"),_()},O=async()=>{if(!b)return;S(!0);const{error:$}=await ee.updateCallback(b.id,{status:"cancelled"});if(S(!1),w(null),$){X.error($);return}X.success("Callback cancelled"),_()};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Calls your customers asked to receive at a later time."}),o.jsxs(ne,{variant:"outline",onClick:()=>g(!0),disabled:!a,children:[o.jsx(Ps,{className:"mr-1.5 h-4 w-4"})," Settings"]})]}),a&&(a.auto_call?o.jsxs("div",{className:"rounded-xl border border-success/40 bg-success/10 p-3 text-sm",children:[o.jsx("b",{children:"Automatic calling is on."})," Due callbacks are placed for you, only ",yze(a),"."]}):o.jsxs("div",{className:"rounded-xl border border-border bg-muted/30 p-3 text-sm",children:[o.jsx("b",{children:"Automatic calling is off."})," Callbacks are only recorded here; your team makes the calls.",i&&o.jsxs(o.Fragment,{children:[" ",o.jsx("button",{className:"font-medium text-primary underline underline-offset-2",onClick:()=>g(!0),children:"Turn it on in settings"})," when you are ready."]})]})),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Filter by status",children:gze.map($=>{const T=$.key==="all"?k:(n==null?void 0:n[$.key])??0;return o.jsxs("button",{role:"tab","aria-selected":c===$.key,onClick:()=>u($.key),className:`rounded-full border px-3 py-1 text-sm transition ${c===$.key?"border-primary bg-primary/10 font-medium text-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:[$.label," ",o.jsx("span",{className:"ml-1 text-xs opacity-70",children:T})]},$.key)})}),o.jsx("div",{className:"overflow-hidden rounded-xl border border-border",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50 text-center text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:o.jsx("tr",{className:"divide-x divide-border",children:Ry.map($=>o.jsx("th",{className:"px-4 py-3",children:$},$))})}),o.jsx("tbody",{children:d?o.jsx("tr",{children:o.jsxs("td",{colSpan:Ry.length,className:"px-4 py-8 text-center text-muted-foreground",children:[o.jsx(Te,{className:"mr-2 inline h-4 w-4 animate-spin"})," Loading…"]})}):h?o.jsx("tr",{children:o.jsxs("td",{colSpan:Ry.length,className:"px-4 py-8 text-center",children:[o.jsx("p",{role:"alert",className:"text-destructive",children:h}),o.jsx(ne,{variant:"outline",size:"sm",className:"mt-3",onClick:_,children:"Try again"})]})}):e.length===0?o.jsx("tr",{children:o.jsxs("td",{colSpan:Ry.length,className:"px-4 py-12 text-center",children:[o.jsx(mre,{className:"mx-auto h-8 w-8 text-muted-foreground"}),o.jsx("p",{className:"mt-2 font-medium",children:c==="all"?"No callbacks yet":`No ${z3[c].toLowerCase()} callbacks`}),c==="all"&&o.jsxs("p",{className:"mx-auto mt-1 max-w-md text-muted-foreground",children:["To get them, open the ",o.jsx("b",{children:"Events"})," tab, edit an event and tick",o.jsx("b",{children:" Schedule a callback"}),". Then add it to your agent."]})]})}):e.map($=>{const T=fze($),z=$.status==="pending"||$.status==="failed"||$.status==="skipped";return o.jsxs("tr",{className:"divide-x divide-border border-t border-border bg-card/30",children:[o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"font-medium text-foreground",children:$.contact_name||"Unknown caller"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:$.phone||"No phone number"})]}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:$.agent_name||"—"}),o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("div",{className:"whitespace-nowrap",children:uze
935($.due_at,$.timezone)}),o.jsx("div",{className:"text-xs text-muted-foreground",children:cze[$.time_source]}),T&&!(a!=null&&a.auto_call)&&o.jsx("span",{className:"mt-1 inline-block rounded-full bg-warning/15 px-2 py-0.5 text-xs font-medium text-warning",children:"Overdue — call them"})]}),o.jsxs("td",{className:"px-4 py-3 text-center",children:[o.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${vze[$.status]}`,children:z3[$.status]}),$.attempts>0&&o.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Attempts: ",$.attempts]}),$.last_error&&$.status!=="called"&&o.jsx("div",{className:"mx-auto mt-1 max-w-[16rem] text-xs text-muted-foreground",children:$.last_error})]}),o.jsx("td",{className:"px-4 py-3 text-center text-muted-foreground",children:o.jsx("div",{className:"mx-auto max-w-[16rem] text-xs",children:$.requested_text||"—"})}),o.jsx("td",{className:"px-4 py-3 text-center",children:z||$.status==="cancelled"?o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1.5",children:[o.jsx(ne,{size:"sm",variant:"outline",onClick:()=>x($),"aria-label":`Reschedule ${$.contact_name||$.phone||"callback"}`,children:"Reschedule"}),z&&o.jsxs(o.Fragment,{children:[o.jsx(ne,{size:"sm",variant:"outline",disabled:N,onClick:()=>P($),"aria-label":`Mark ${$.contact_name||$.phone||"callback"} as called`,children:"Mark called"}),$.status==="pending"&&o.jsx(ne,{size:"sm",variant:"outline",disabled:N,onClick:()=>w($),"aria-label":`Cancel ${$.contact_name||$.phone||"callback"}`,children:"Cancel"})]})]}):o.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},$.id)})})]})})}),a&&o.jsx(mze,{open:v,onOpenChange:g,settings:a,isOwner:i,onSaved:$=>{s($),_()}}),o.jsx(pze,{callback:y,onOpenChange:$=>!$&&x(null),onSaved:_}),o.jsx(Is,{open:!!b,onOpenChange:$=>!$&&!N&&w(null),children:o.jsxs(Yo,{children:[o.jsxs(Ko,{children:[o.jsx(Jo,{children:"Cancel this callback?"}),o.jsxs(Qo,{children:[(b==null?void 0:b.contact_name)||(b==null?void 0:b.phone)||"This customer"," will not be called back. You can reschedule it later."]})]}),o.jsxs(Xo,{children:[o.jsx(es,{disabled:N,children:"Keep it"}),o.jsx(Zo,{onClick:$=>{$.preventDefault(),O()},disabled:N,children:N?"Cancelling…":"Cancel callback"})]})]})})]})};function pr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=pr(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var uK={exports:{}},dK={},fK={exports:{}},hK={};/**
936 * @license React
937 * use-sync-external-store-shim.production.js
938 *
939 * Copyright (c) Meta Platforms, Inc. and affiliates.
940 *
941 * This source code is licensed under the MIT license found in the
942 * LICENSE file in the root directory of this source tree.
943 */var th=p;function bze(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wze=typeof Object.is=="function"?Object.is:bze,jze=th.useState,Sze=th.useEffect,Nze=th.useLayoutEffect,_ze=th.useDebugValue;function Cze(e,t){var n=t(),r=jze({inst:{value:n,getSnapshot:t}}),a=r[0].inst,s=r[1];return Nze(function(){a.value=n,a.getSnapshot=t,ON(a)&&s({inst:a})},[e,n,t]),Sze(function(){return ON(a)&&s({inst:a}),e(function(){ON(a)&&s({inst:a})})},[e]),_ze(n),n}function ON(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wze(e,n)}catch{return!0}}function kze(e,t){return t()}var Eze=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kze:Cze;hK.useSyncExternalStore=th.useSyncExternalStore!==void 0?th.useSyncExternalStore:Eze;fK.exports=hK;var Aze=fK.exports;/**
944 * @license React
945 * use-sync-external-store-shim/with-selector.production.js
946 *
947 * Copyright (c) Meta Platforms, Inc. and affiliates.
948 *
949 * This source code is licensed under the MIT license found in the
950 * LICENSE file in the root directory of this source tree.
951 */var Z1=p,Pze=Aze;function Tze(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oze=typeof Object.is=="function"?Object.is:Tze,Mze=Pze.useSyncExternalStore,Ize=Z1.useRef,$ze=Z1.useEffect,Dze=Z1.useMemo,Rze=Z1.useDebugValue;dK.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var s=Ize(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=Dze(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),a!==void 0&&i.hasValue){var v=i.value;if(a(v,m))return f=v}return f=m}if(v=f,Oze(d,m))return v;var g=r(m);return a!==void 0&&a(v,g)?(d=m,v):(d=m,f=g)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,a]);var l=Mze(e,s[0],s[1]);return $ze(function(){i.hasValue=!0,i.value=l},[l]),Rze(l),l};uK.exports=dK;var Lze=uK.exports;const Fze=Dt(Lze),Bze={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_PUBLIC_URL:"https://api.edmnexus.ai",VITE_API_URL:"https://api.edmnexus.ai",VITE_RECAPTCHA_SITE_KEY:"6LfHXbstAAAAAC94tlxSpVPxlj79ErtbX1u61ncc",VITE_STRIPE_PUBLIC_KEY:"pk_live_51Twr0LDbyh4wXycwoVXAVlEetTGI9kMRF8BQcH3cebSfORfOYxpi7zCbA8RIfpLGYuP7OPmhc4nhvzh0fIyjFVR700EJ4UDWWP",VITE_VAPI_PUBLIC_KEY:"80eb288d-0508-4459-8e24-fb76da4ebdf1"},U3=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({}
951,t,h),n.forEach(v=>v(t,m))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Bze?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,a,c);return c},zze=e=>e?U3(e):U3,{useDebugValue:Uze}=H,{useSyncExternalStoreWithSelector:Vze}=Fze,Wze=e=>e;function mK(e,t=Wze,n){const r=Vze(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Uze(r),r}const V3=(e,t)=>{const n=zze(e),r=(a,s=t)=>mK(n,a,s);return Object.assign(r,n),r},qze=(e,t)=>e?V3(e,t):V3;function nr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Hze={value:()=>{}};function ej(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new yx(n)}function yx(e){this._=e}function Gze(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}yx.prototype=ej.prototype={constructor:yx,on:function(e,t){var n=this._,r=Gze(e+"",n),a,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((a=(e=r[s]).type)&&(a=Yze(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(a=(e=r[s]).type)n[a]=W3(n[a],e.name,t);else if(t==null)for(a in n)n[a]=W3(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new yx(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,s;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,a=s.length;r<a;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,s=r.length;a<s;++a)r[a].value.apply(t,n)}};function Yze(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function W3(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Hze,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wE="http://www.w3.org/1999/xhtml";const q3={svg:"http://www.w3.org/2000/svg",xhtml:wE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tj(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),q3.hasOwnProperty(t)?{space:q3[t],local:e}:e}function Kze(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===wE&&t.documentElement.namespaceURI===wE?t.createElement(e):t.createElementNS(n,e)}}function Xze(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pK(e){var t=tj(e);return(t.local?Xze:Kze)(t)}function Jze(){}function PT(e){return e==null?Jze:function(){return this.querySelector(e)}}function Qze(e){typeof e!="function"&&(e=PT(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=new Array(i),c,u,d=0;d<i;++d)(c=s[d])&&(u=e.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new $a(r,this._parents)}function Zze(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function eUe(){return[]}function gK(e){return e==null?eUe:function(){return this.querySelectorAll(e)}}function tUe(e){return function(){return Zze(e.apply(this,arguments))}}function nUe(e){typeof e=="function"?e=tUe(e):e=gK(e);for(var t=this._groups,n=t.length,r=[],a=[],s=0;s<n;++s)for(var i=t[s],l=i.length,c,u=0;u<l;++u)(c=i[u])&&(r.push(e.call(c,c.__data__,u,i)),a.push(c));return new $a(r,a)}function vK(e){return function(){return this.matches(e)}}function yK(e){return function(t){return t.matches(e)}}var rUe=Array.prototype.find;function aUe(e){return function(){return rUe.call(this.children,e)}}function oUe(){return this.firstElementChild}function sUe(e){return this.select(e==null?oUe:aUe(typeof e=="function"?e:yK(e)))}var iUe=Array.prototype.filter;function lUe(){return Array.from(this.children)}function cUe(e){return function(){return iUe.call(this.children,e)}}function uUe(e){return this.selectAll(e==null?lUe:cUe(typeof e=="function"?e:yK(e)))}
vendor: 9,048 bytes, line 951
951function dUe(e){typeof e!="function"&&(e=vK(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=[],c,u=0;u<i;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new $a(r,this._parents)}function xK(e){return new Array(e.length)}function fUe(){return new $a(this._enter||this._groups.map(xK),this._parents)}function _0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_0.prototype={constructor:_0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function hUe(e){return function(){return e}}function mUe(e,t,n,r,a,s){for(var i=0,l,c=t.length,u=s.length;i<u;++i)(l=t[i])?(l.__data__=s[i],r[i]=l):n[i]=new _0(e,s[i]);for(;i<c;++i)(l=t[i])&&(a[i]=l)}function pUe(e,t,n,r,a,s,i){var l,c,u=new Map,d=t.length,f=s.length,h=new Array(d),m;for(l=0;l<d;++l)(c=t[l])&&(h[l]=m=i.call(c,c.__data__,l,t)+"",u.has(m)?a[l]=c:u.set(m,c));for(l=0;l<f;++l)m=i.call(e,s[l],l,s)+"",(c=u.get(m))?(r[l]=c,c.__data__=s[l],u.delete(m)):n[l]=new _0(e,s[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(a[l]=c)}function gUe(e){return e.__data__}function vUe(e,t){if(!arguments.length)return Array.from(this,gUe);var n=t?pUe:mUe,r=this._parents,a=this._groups;typeof e!="function"&&(e=hUe(e));for(var s=a.length,i=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=r[u],f=a[u],h=f.length,m=yUe(e.call(d,d&&d.__data__,u,r)),v=m.length,g=l[u]=new Array(v),y=i[u]=new Array(v),x=c[u]=new Array(h);n(d,f,g,y,x,m,t);for(var b=0,w=0,N,S;b<v;++b)if(N=g[b]){for(b>=w&&(w=b+1);!(S=y[w])&&++w<v;);N._next=S||null}}return i=new $a(i,r),i._enter=l,i._exit=c,i}function yUe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xUe(){return new $a(this._exit||this._groups.map(xK),this._parents)}function bUe(e,t,n){var r=this.enter(),a=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?s.remove():n(s),r&&a?r.merge(a).order():a}function wUe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,s=r.length,i=Math.min(a,s),l=new Array(a),c=0;c<i;++c)for(var u=n[c],d=r[c],f=u.length,h=l[c]=new Array(f),m,v=0;v<f;++v)(m=u[v]||d[v])&&(h[v]=m);for(;c<a;++c)l[c]=n[c];return new $a(l,this._parents)}function jUe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,s=r[a],i;--a>=0;)(i=r[a])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function SUe(e){e||(e=NUe);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,a=new Array(r),s=0;s<r;++s){for(var i=n[s],l=i.length,c=a[s]=new Array(l),u,d=0;d<l;++d)(u=i[d])&&(c[d]=u);c.sort(t)}return new $a(a,this._parents).order()}function NUe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _Ue(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function CUe(){return Array.from(this)}function kUe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length;a<s;++a){var i=r[a];if(i)return i}return null}function EUe(){let e=0;for(const t of this)++e;return e}function AUe(){return!this.node()}function PUe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],s=0,i=a.length,l;s<i;++s)(l=a[s])&&e.call(l,l.__data__,s,a);return this}function TUe(e){return function(){this.removeAttribute(e)}}function OUe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function MUe(e,t){return function(){this.setAttribute(e,t)}}function IUe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $Ue(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function DUe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function RUe(e,t){var n=tj(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?OUe:TUe:typeof t=="function"?n.local?DUe:$Ue:n.local?IUe:MUe)(n,t))}function bK(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function LUe(e){return function(){this.style.removeProperty(e)}}function FUe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BUe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zUe(e,t,n){return arguments.length>1?this.each((t==null?LUe:typeof t=="function"?BUe:FUe)(e,t,n??"")):nh(this.node(),e)}function nh(e,t){return e.style.getPropertyValue(t)||bK(e).getComputedStyle(e,null).getPropertyValue(t)}function UUe(e){return function(){delete this[e]}}function VUe(e,t){return function(){this[e]=t}}function WUe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qUe(e,t){return arguments.length>1?this.each((t==null?UUe:typeof t=="function"?WUe:VUe)(e,t)):this.node()[e]}function wK(e){return e.trim().split(/^|\s+/)}function TT(e){return e.classList||new jK(e)}function jK(e){this._node=e,this._names=wK(e.getAttribute("class")||"")}jK.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function SK(e,t){for(var n=TT(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function NK(e,t){for(var n=TT(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function HUe(e){return function(){SK(this,e)}}function GUe(e){return function(){NK(this,e)}}function YUe(e,t){return function(){(t.apply(this,arguments)?SK:NK)(this,e)}}function KUe(e,t){var n=wK(e+"");if(arguments.length<2){for(var r=TT(this.node()),a=-1,s=n.length;++a<s;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?YUe:t?HUe:GUe)(n,t))}function XUe(){this.textContent=""}function JUe(e){return function(){this.textContent=e}}function QUe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ZUe(e){return arguments.length?this.each(e==null?XUe:(typeof e=="function"?QUe:JUe)(e)):this.node().textContent}function eVe(){this.innerHTML=""}function tVe(e){return function(){this.innerHTML=e}}function nVe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function rVe(e){return arguments.length?this.each(e==null?eVe:(typeof e=="function"?nVe:tVe)(e)):this.node().innerHTML}function aVe(){this.nextSibling&&this.parentNode.appendChild(this)}function oVe(){return this.each(aVe)}function sVe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function iVe(){return this.each(sVe)}function lVe(e){var t=typeof e=="function"?e:pK(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function cVe(){return null}function uVe(e,t){var n=typeof e=="function"?e:pK(e),r=t==null?cVe:typeof t=="function"?t:PT(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function dVe(){var e=this.parentNode;e&&e.removeChild(this)}function fVe(){return this.each(dVe)}function hVe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mVe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pVe(e){return this.select(e?mVe:hVe)}function gVe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vVe(e){return function(t){e.call(this,t,this.__data__)}}function yVe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function xVe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,s;n<a;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function bVe(e,t,n){return function(){var r=this.__on,a,s=vVe(t);if(r){for(var i=0,l=r.length;i<l;++i)if((a=r[i]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=s,a.options=n),a.value=t;return}}this.addEventListener(e.type,s,n),a={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(a):this.__on=[a]}}function wVe(e,t,n){var r=yVe(e+""),a,s=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(a=0,d=l[c];a<s;++a)if((i=r[a]).type===d.type&&i.name===d.name)return d.value}return}for(l=t?bVe:xVe,a=0;a<s;++a)this.each(l(r[a],t,n));return this}
vendor: 28,144 bytes, line 951
951function _K(e,t,n){var r=bK(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function jVe(e,t){return function(){return _K(this,e,t)}}function SVe(e,t){return function(){return _K(this,e,t.apply(this,arguments))}}function NVe(e,t){return this.each((typeof t=="function"?SVe:jVe)(e,t))}function*_Ve(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length,i;a<s;++a)(i=r[a])&&(yield i)}var CK=[null];function $a(e,t){this._groups=e,this._parents=t}function uv(){return new $a([[document.documentElement]],CK)}function CVe(){return this}$a.prototype=uv.prototype={constructor:$a,select:Qze,selectAll:nUe,selectChild:sUe,selectChildren:uUe,filter:dUe,data:vUe,enter:fUe,exit:xUe,join:bUe,merge:wUe,selection:CVe,order:jUe,sort:SUe,call:_Ue,nodes:CUe,node:kUe,size:EUe,empty:AUe,each:PUe,attr:RUe,style:zUe,property:qUe,classed:KUe,text:ZUe,html:rVe,raise:oVe,lower:iVe,append:lVe,insert:uVe,remove:fVe,clone:pVe,datum:gVe,on:wVe,dispatch:NVe,[Symbol.iterator]:_Ve};function Ka(e){return typeof e=="string"?new $a([[document.querySelector(e)]],[document.documentElement]):new $a([[e]],CK)}function kVe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Mo(e,t){if(e=kVe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const EVe={passive:!1},gg={capture:!0,passive:!1};function MN(e){e.stopImmediatePropagation()}function nf(e){e.preventDefault(),e.stopImmediatePropagation()}function kK(e){var t=e.document.documentElement,n=Ka(e).on("dragstart.drag",nf,gg);"onselectstart"in t?n.on("selectstart.drag",nf,gg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function EK(e,t){var n=e.document.documentElement,r=Ka(e).on("dragstart.drag",null);t&&(r.on("click.drag",nf,gg),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ly=e=>()=>e;function jE(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:s,x:i,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}jE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function AVe(e){return!e.ctrlKey&&!e.button}function PVe(){return this.parentNode}function TVe(e,t){return t??{x:e.x,y:e.y}}function OVe(){return navigator.maxTouchPoints||"ontouchstart"in this}function MVe(){var e=AVe,t=PVe,n=TVe,r=OVe,a={},s=ej("start","drag","end"),i=0,l,c,u,d,f=0;function h(N){N.on("mousedown.drag",m).filter(r).on("touchstart.drag",y).on("touchmove.drag",x,EVe).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,S){if(!(d||!e.call(this,N,S))){var _=w(this,t.call(this,N,S),N,S,"mouse");_&&(Ka(N.view).on("mousemove.drag",v,gg).on("mouseup.drag",g,gg),kK(N.view),MN(N),u=!1,l=N.clientX,c=N.clientY,_("start",N))}}function v(N){if(nf(N),!u){var S=N.clientX-l,_=N.clientY-c;u=S*S+_*_>f}a.mouse("drag",N)}function g(N){Ka(N.view).on("mousemove.drag mouseup.drag",null),EK(N.view,u),nf(N),a.mouse("end",N)}function y(N,S){if(e.call(this,N,S)){var _=N.changedTouches,k=t.call(this,N,S),P=_.length,O,$;for(O=0;O<P;++O)($=w(this,k,N,S,_[O].identifier,_[O]))&&(MN(N),$("start",N,_[O]))}}function x(N){var S=N.changedTouches,_=S.length,k,P;for(k=0;k<_;++k)(P=a[S[k].identifier])&&(nf(N),P("drag",N,S[k]))}function b(N){var S=N.changedTouches,_=S.length,k,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),k=0;k<_;++k)(P=a[S[k].identifier])&&(MN(N),P("end",N,S[k]))}function w(N,S,_,k,P,O){var $=s.copy(),T=Mo(O||_,S),z,U,E;if((E=n.call(N,new jE("beforestart",{sourceEvent:_,target:h,identifier:P,active:i,x:T[0],y:T[1],dx:0,dy:0,dispatch:$}),k))!=null)return z=E.x-T[0]||0,U=E.y-T[1]||0,function q(W,L,M){var B=T,I;switch(W){case"start":a[P]=q,I=i++;break;case"end":delete a[P],--i;case"drag":T=Mo(M||L,S),I=i;break}$.call(W,N,new jE(W,{sourceEvent:L,subject:E,target:h,identifier:P,active:I,x:T[0]+z,y:T[1]+U,dx:T[0]-B[0],dy:T[1]-B[1],dispatch:$}),k)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Ly(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:Ly(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Ly(N),h):n},h.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:Ly(!!N),h):r},h.on=function(){var N=s.on.apply(s,arguments);return N===s?h:N},h.clickDistance=function(N){return arguments.length?(f=(N=+N)*N,h):Math.sqrt(f)},h}var rh=0,$m=0,gm=0,AK=1e3,C0,Dm,k0=0,Eu=0,nj=0,vg=typeof performance=="object"&&performance.now?performance:Date,PK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function OT(){return Eu||(PK(IVe),Eu=vg.now()+nj)}function IVe(){Eu=0}function E0(){this._call=this._time=this._next=null}E0.prototype=TK.prototype={constructor:E0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?OT():+n)+(t==null?0:+t),!this._next&&Dm!==this&&(Dm?Dm._next=this:C0=this,Dm=this),this._call=e,this._time=n,SE()},stop:function(){this._call&&(this._call=null,this._time=1/0,SE())}};function TK(e,t,n){var r=new E0;return r.restart(e,t,n),r}function $Ve(){OT(),++rh;for(var e=C0,t;e;)(t=Eu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--rh}function H3(){Eu=(k0=vg.now())+nj,rh=$m=0;try{$Ve()}finally{rh=0,RVe(),Eu=0}}function DVe(){var e=vg.now(),t=e-k0;t>AK&&(nj-=t,k0=e)}function RVe(){for(var e,t=C0,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:C0=n);Dm=e,SE(r)}function SE(e){if(!rh){$m&&($m=clearTimeout($m));var t=e-Eu;t>24?(e<1/0&&($m=setTimeout(H3,e-vg.now()-nj)),gm&&(gm=clearInterval(gm))):(gm||(k0=vg.now(),gm=setInterval(DVe,AK)),rh=1,PK(H3))}}function G3(e,t,n){var r=new E0;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var LVe=ej("start","end","cancel","interrupt"),FVe=[],OK=0,Y3=1,NE=2,xx=3,K3=4,_E=5,bx=6;function rj(e,t,n,r,a,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;BVe(e,n,{name:t,index:r,group:a,on:LVe,tween:FVe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:OK})}function MT(e,t){var n=ss(e,t);if(n.state>OK)throw new Error("too late; already scheduled");return n}function Us(e,t){var n=ss(e,t);if(n.state>xx)throw new Error("too late; already running");return n}function ss(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function BVe(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=TK(s,0,n.time);function s(u){n.state=Y3,n.timer.restart(i,n.delay,n.time),n.delay<=u&&i(u-n.delay)}function i(u){var d,f,h,m;if(n.state!==Y3)return c();for(d in r)if(m=r[d],m.name===n.name){if(m.state===xx)return G3(i);m.state===K3?(m.state=bx,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+d<t&&(m.state=bx,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[d])}if(G3(function(){n.state===xx&&(n.state=K3,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=NE,n.on.call("start",e,e.__data__,n.index,n.group),n.state===NE){for(n.state=xx,a=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(a[++f]=m);a.length=f+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=_E,1),f=-1,h=a.length;++f<h;)a[f].call(e,d);n.state===_E&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=bx,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function wx(e,t){var n=e.__transition,r,a,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){s=!1;continue}a=r.state>NE&&r.state<_E,r.state=bx,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}s&&delete e.__transition}}function zVe(e){return this.each(function(){wx(this,e)})}function UVe(e,t){var n,r;return function(){var a=Us(this,e),s=a.tween;if(s!==n){r=n=s;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}a.tween=r}}function VVe(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var s=Us(this,e),i=s.tween;if(i!==r){a=(r=i).slice();for(var l={name:t,value:n},c=0,u=a.length;c<u;++c)if(a[c].name===t){a[c]=l;break}c===u&&a.push(l)}s.tween=a}}function WVe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ss(this.node(),n).tween,a=0,s=r.length,i;a<s;++a)if((i=r[a]).name===e)return i.value;return null}return this.each((t==null?UVe:VVe)(n,e,t))}function IT(e,t,n){var r=e._id;return e.each(function(){var a=Us(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ss(a,r).value[t]}}function MK(e,t){var n;return(typeof t=="number"?Do:t instanceof Nu?Hb:(n=Nu(t))?(t=n,Hb):lG)(e,t)}function qVe(e){return function(){this.removeAttribute(e)}}function HVe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GVe(e,t,n){var r,a=n+"",s;return function(){var i=this.getAttribute(e);return i===a?null:i===r?s:s=t(r=i,n)}}function YVe(e,t,n){var r,a=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?s:s=t(r=i,n)}}function KVe(e,t,n){var r,a,s;return function(){var i,l=n(this),c;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),c=l+"",i===c?null:i===r&&c===a?s:(a=c,s=t(r=i,l)))}}function XVe(e,t,n){var r,a,s;return function(){var i,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),c=l+"",i===c?null:i===r&&c===a?s:(a=c,s=t(r=i,l)))}}function JVe(e,t){var n=tj(e),r=n==="transform"?$Me:MK;return this.attrTween(e,typeof t=="function"?(n.local?XVe:KVe)(n,r,IT(this,"attr."+e,t)):t==null?(n.local?HVe:qVe)(n):(n.local?YVe:GVe)(n,r,t))}function QVe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ZVe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function e9e(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ZVe(e,s)),n}return a._value=t,a}function t9e(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&QVe(e,s)),n}return a._value=t,a}function n9e(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=tj(e);return this.tween(n,(r.local?e9e:t9e)(r,t))}function r9e(e,t){return function(){MT(this,e).delay=+t.apply(this,arguments)}}function a9e(e,t){return t=+t,function(){MT(this,e).delay=t}}function o9e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?r9e:a9e)(t,e)):ss(this.node(),t).delay}function s9e(e,t){return function(){Us(this,e).duration=+t.apply(this,arguments)}}function i9e(e,t){return t=+t,function(){Us(this,e).duration=t}}function l9e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?s9e:i9e)(t,e)):ss(this.node(),t).duration}function c9e(e,t){if(typeof t!="function")throw new Error;return function(){Us(this,e).ease=t}}function u9e(e){var t=this._id;return arguments.length?this.each(c9e(t,e)):ss(this.node(),t).ease}function d9e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Us(this,e).ease=n}}function f9e(e){if(typeof e!="function")throw new Error;return this.each(d9e(this._id,e))}function h9e(e){typeof e!="function"&&(e=vK(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=[],c,u=0;u<i;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new Bi(r,this._parents,this._name,this._id)}function m9e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,s=Math.min(r,a),i=new Array(r),l=0;l<s;++l)for(var c=t[l],u=n[l],d=c.length,f=i[l]=new Array(d),h,m=0;m<d;++m)(h=c[m]||u[m])&&(f[m]=h);for(;l<r;++l)i[l]=t[l];return new Bi(i,this._parents,this._name,this._id)}function p9e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function g9e(e,t,n){var r,a,s=p9e(t)?MT:Us;return function(){var i=s(this,e),l=i.on;l!==r&&(a=(r=l).copy()).on(t,n),i.on=a}}function v9e(e,t){var n=this._id;return arguments.length<2?ss(this.node(),n).on.on(e):this.each(g9e(n,e,t))}function y9e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function x9e(){return this.on("end.remove",y9e(this._id))}function b9e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=PT(e));for(var r=this._groups,a=r.length,s=new Array(a),i=0;i<a;++i)for(var l=r[i],c=l.length,u=s[i]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,rj(u[h],t,n,h,u,ss(d,n)));return new Bi(s,this._parents,t,n)}function w9e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gK(e));for(var r=this._groups,a=r.length,s=[],i=[],l=0;l<a;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),m,v=ss(d,n),g=0,y=h.length;g<y;++g)(m=h[g])&&rj(m,t,n,g,h,v);s.push(h),i.push(d)}return new Bi(s,i,t,n)}var j9e=uv.prototype.constructor;function S9e(){return new j9e(this._groups,this._parents)}function N9e(e,t){var n,r,a;return function(){var s=nh(this,e),i=(this.style.removeProperty(e),nh(this,e));return s===i?null:s===n&&i===r?a:a=t(n=s,r=i)}}function IK(e){return function(){this.style.removeProperty(e)}}function _9e(e,t,n){var r,a=n+"",s;return function(){var i=nh(this,e);return i===a?null:i===r?s:s=t(r=i,n)}}function C9e(e,t,n){var r,a,s;return function(){var i=nh(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),nh(this,e))),i===c?null:i===r&&c===a?s:(a=c,s=t(r=i,l))}}function k9e(e,t){var n,r,a,s="style."+t,i="end."+s,l;return function(){var c=Us(this,e),u=c.on,d=c.value[s]==null?l||(l=IK(t)):void 0;(u!==n||a!==d)&&(r=(n=u).copy()).on(i,a=d),c.on=r}}function E9e(e,t,n){var r=(e+="")=="transform"?IMe:MK;return t==null?this.styleTween(e,N9e(e,r)).on("end.style."+e,IK(e)):typeof t=="function"?this.styleTween(e,C9e(e,r,IT(this,"style."+e,t))).each(k9e(this._id,e)):this.styleTween(e,_9e(e,r,t),n).on("end.style."+e,null)}function A9e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function P9e(e,t,n){var r,a;function s(){var i=t.apply(this,arguments);return i!==a&&(r=(a=i)&&A9e(e,i,n)),r}return s._value=t,s}function T9e(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,P9e(e,t,n??""))}function O9e(e){return function(){this.textContent=e}}function M9e(e){return function(){var t=e(this);this.textContent=t??""}}function I9e(e){return this.tween("text",typeof e=="function"?M9e(IT(this,"text",e)):O9e(e==null?"":e+""))}function $9e(e){return function(t){this.textContent=e.call(this,t)}}function D9e(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&$9e(a)),t}return r._value=e,r}function R9e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,D9e(e))}function L9e(){for(var e=this._name,t=this._id,n=$K(),r=this._groups,a=r.length,s=0;s<a;++s)for(var i=r[s],l=i.length,c,u=0;u<l;++u)if(c=i[u]){var d=ss(c,t);rj(c,e,n,u,i,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Bi(r,this._parents,e,n)}function F9e(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(s,i){var l={value:i},c={value:function(){--a===0&&s()}};n.each(function(){var u=Us(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),a===0&&s()})}var B9e=0;function Bi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $K(){return++B9e}var ei=uv.prototype;Bi.prototype={constructor:Bi,select:b9e,selectAll:w9e,selectChild:ei.selectChild,selectChildren:ei.selectChildren,filter:h9e,merge:m9e,selection:S9e,transition:L9e,call:ei.call,nodes:ei.nodes,node:ei.node,size:ei.size,empty:ei.empty,each:ei.each,on:v9e,attr:JVe,attrTween:n9e,style:E9e,styleTween:T9e,text:I9e,textTween:R9e,remove:x9e,tween:WVe,delay:o9e,duration:l9e,ease:u9e,easeVarying:f9e,end:F9e,[Symbol.iterator]:ei[Symbol.iterator]};function z9e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var U9e={time:null,delay:0,duration:250,ease:z9e};function V9e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function W9e(e){var t,n;e instanceof Bi?(t=e._id,e=e._name):(t=$K(),(n=U9e).time=OT(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,s=0;s<a;++s)for(var i=r[s],l=i.length,c,u=0;u<l;++u)(c=i[u])&&rj(c,e,t,u,i,n||V9e(c,t));return new Bi(r,this._parents,e,t)}uv.prototype.interrupt=zVe;uv.prototype.transition=W9e;const Fy=e=>()=>e;function q9e(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function gi(e,t,n){this.k=e,this.x=t,this.y=n}gi.prototype={constructor:gi,scale:function(e){return e===1?this:new gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new gi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ci=new gi(1,0,0);gi.prototype;function IN(e){e.stopImmediatePropagation()}function vm(e){e.preventDefault(),e.stopImmediatePropagation()}function H9e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function G9e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function X3(){return this.__zoom||Ci}function Y9e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function K9e(){return navigator.maxTouchPoints||"ontouchstart"in this}function X9e(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function DK(){var e=H9e,t=G9e,n=X9e,r=Y9e,a=K9e,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,c=FMe,u=ej("start","zoom","end"),d,f,h,m=500,v=150,g=0,y=10;function x(E){E.property("__zoom",X3).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",$).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,q,W,L){var M=E.selection?E.selection():E;M.property("__zoom",X3),E!==M?S(E,q,W,L):M.interrupt().each(function(){_(this,arguments).event(L).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},x.scaleBy=function(E,q,W,L){x.scaleTo(E,function(){var M=this.__zoom.k,B=typeof q=="function"?q.apply(this,arguments):q;return M*B},W,L)},x.scaleTo=function(E,q,W,L){x.transform(E,function(){var M=t.apply(this,arguments),B=this.__zoom,I=W==null?N(M):typeof W=="function"?W.apply(this,arguments):W,R=B.invert(I),F=typeof q=="function"?q.apply(this,arguments):q;return n(w(b(B,F),I,R),M,i)},W,L)},x.translateBy=function(E,q,W,L){x.transform(E,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof W=="function"?W.apply(this,arguments):W),t.apply(this,arguments),i)},null,L)},x.translateTo=function(E,q,W,L,M){x.transform(E,function(){var B=t.apply(this,arguments),I=this.__zoom,R=L==null?N(B):typeof L=="function"?L.apply(this,arguments):L;return n(Ci.translate(R[0],R[1]).scale(I.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof W=="function"?-W.apply(this,arguments):-W),B,i)},L,M)};function b(E,q){return q=Math.max(s[0],Math.min(s[1],q)),q===E.k?E:new gi(q,E.x,E.y)}function w(E,q,W){var L=q[0]-W[0]*E.k,M=q[1]-W[1]*E.k;return L===E.x&&M===E.y?E:new gi(E.k,L,M)}function N(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,q,W,L){E.on("start.zoom",function(){_(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,B=arguments,I=_(M,B).event(L),R=t.apply(M,B),F=W==null?N(R):typeof W=="function"?W.apply(M,B):W,j=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),C=M.__zoom,A=typeof q=="function"?q.apply(M,B):q,D=c(C.invert(F).concat(j/C.k),A.invert(F).concat(j/A.k));return function(V){if(V===1)V=A;else{var Y=D(V),G=j/Y[2];V=new gi(G,F[0]-Y[0]*G,F[1]-Y[1]*G)}I.zoom(null,V)}})}function _(E,q,W){return!W&&E.__zooming||new k(E,q)}function k(E,q){this.that=E,this.args=q,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,q),this.taps=0}k.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,q){return this.mouse&&E!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var q=Ka(this.that).datum();u.call(E,this.that,new q9e(E,{sourceEvent:this.sourceEvent,target:x,type:E,transform:this.that.__zoom,dispatch:u}),q)}};function P(E,...q){if(!e.apply(this,arguments))return;var W=_(this,q).event(E),L=this.__zoom,M=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,r.apply(this,arguments)))),B=Mo(E);if(W.wheel)(W.mouse[0][0]!==B[0]||W.mouse[0][1]!==B[1])&&(W.mouse[1]=L.invert(W.mouse[0]=B)),clearTimeout(W.wheel);else{if(L.k===M)return;W.mouse=[B,L.invert(B)],wx(this),W.start()}vm(E),W.wheel=setTimeout(I,v),W.zoom("mouse",n(w(b(L,M),W.mouse[0],W.mouse[1]),W.extent,i));function I(){W.wheel=null,W.end()}}function O(E,...q){if(h||!e.apply(this,arguments))return;var W=E.currentTarget,L=_(this,q,!0).event(E),M=Ka(E.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",j,!0),B=Mo(E,W),I=E.clientX,R=E.clientY;kK(E.view),IN(E),L.mouse=[B,this.__zoom.invert(B)],wx(this),L.start();function F(C){if(vm(C),!L.moved){var A=C.clientX-I,D=C.clientY-R;L.moved=A*A+D*D>g}L.event(C).zoom("mouse",n(w(L.that.__zoom,L.mouse[0]=Mo(C,W),L.mouse[1]),L.extent,i))}function j(C){M.on("mousemove.zoom mouseup.zoom",null),EK(C.view,L.moved),vm(C),L.event(C).end()}}function $(E,...q){if(e.apply(this,arguments)){var W=this.__zoom,L=Mo(E.changedTouches?E.changedTouches[0]:E,this),M=W.invert(L),B=W.k*(E.shiftKey?.5:2),I=n(w(b(W,B),L,M),t.apply(this,q),i);vm(E),l>0?Ka(this).transition().duration(l).call(S,I,L,E):Ka(this).call(x.transform,I,L,E)}}function T(E,...q){if(e.apply(this,arguments)){var W=E.touches,L=W.length,M=_(this,q,E.changedTouches.length===L).event(E),B,I,R,F;for(IN(E),I=0;I<L;++I)R=W[I],F=Mo(R,this),F=[F,this.__zoom.invert(F),R.identifier],M.touch0?!M.touch1&&M.touch0[2]!==F[2]&&(M.touch1=F,M.taps=0):(M.touch0=F,B=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),B&&(M.taps<2&&(f=F[0],d=setTimeout(function(){d=null},m)),wx(this),M.start())}}function z(E,...q){if(this.__zooming){var W=_(this,q).event(E),L=E.changedTouches,M=L.length,B,I,R,F;for(vm(E),B=0;B<M;++B)I=L[B],R=Mo(I,this),W.touch0&&W.touch0[2]===I.identifier?W.touch0[0]=R:W.touch1&&W.touch1[2]===I.identifier&&(W.touch1[0]=R);if(I=W.that.__zoom,W.touch1){var j=W.touch0[0],C=W.touch0[1],A=W.touch1[0],D=W.touch1[1],V=(V=A[0]-j[0])*V+(V=A[1]-j[1])*V,Y=(Y=D[0]-C[0])*Y+(Y=D[1]-C[1])*Y;I=b(I,Math.sqrt(V/Y)),R=[(j[0]+A[0])/2,(j[1]+A[1])/2],F=[(C[0]+D[0])/2,(C[1]+D[1])/2]}else if(W.touch0)R=W.touch0[0],F=W.touch0[1];else return;W.zoom("touch",n(w(I,R,F),W.extent,i))}}function U(E,...q){if(this.__zooming){var W=_(this,q).event(E),L=E.changedTouches,M=L.length,B,I;for(IN(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),B=0;B<M;++B)I=L[B],W.touch0&&W.touch0[2]===I.identifier?delete W.touch0:W.touch1&&W.touch1[2]===I.identifier&&delete W.touch1;if(W.touch1&&!W.touch0&&(W.touch0=W.touch1,delete W.touch1),W.touch0)W.touch0[1]=this.__zoom.invert(W.touch0[0]);else if(W.end(),W.taps===2&&(I=Mo(I,this),Math.hypot(f[0]-I[0],f[1]-I[1])<y)){var R=Ka(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Fy(+E),x):r},x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Fy(!!E),x):e},x.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:Fy(!!E),x):a},x.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Fy([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):t},x.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],x):[s[0],s[1]]},x.translateExtent=function(E){return arguments.length?(i[0][0]=+E[0][0],i[1][0]=+E[1][0],i[0][1]=+E[0][1],i[1][1]=+E[1][1],x):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},x.constrain=function(E){return arguments.length?(n=E,x):n},x.duration=function(E){return arguments.length?(l=+E,x):l},x.interpolate=function(E){return arguments.length?(c=E,x):c},x.on=function(){var E=u.on.apply(u,arguments);return E===u?x:E},x.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,x):Math.sqrt(g)},x.tapDistance=function(E){return arguments.length?(y=+E,x):y},x}const aj=p.createContext(null),J9e=aj.Provider,zi={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>
951`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},RK=zi.error001();function Yt(e,t){const n=p.useContext(aj);if(n===null)throw new Error(RK);return mK(n,e,t)}const Wn=()=>{const e=p.useContext(aj);if(e===null)throw new Error(RK);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Q9e=e=>e.userSelectionActive?"none":"all";function $T({position:e,children:t,className:n,style:r,...a}){const s=Yt(Q9e),i=`${e}`.split("-");return H.createElement("div",{className:pr(["react-flow__panel",n,...i]),style:{...r,pointerEvents:s},...a},t)}function Z9e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:H.createElement($T,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},H.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const e7e=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d})=>{const f=p.useRef(null),[h,m]=p.useState({x:0,y:0,width:0,height:0}),v=pr(["react-flow__edge-textwrapper",u]);return p.useEffect(()=>{if(f.current){const g=f.current.getBBox();m({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:H.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...d},a&&H.createElement("rect",{width:h.width+2*i[0],x:-i[0],y:-i[1],height:h.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),H.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:f,style:r},n),c)};var t7e=p.memo(e7e);const DT=e=>({width:e.offsetWidth,height:e.offsetHeight}),ah=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),RT=(e={x:0,y:0},t)=>({x:ah(e.x,t[0][0],t[1][0]),y:ah(e.y,t[0][1],t[1][1])}),J3=(e,t,n)=>e<t?ah(Math.abs(e-t),1,50)/50:e>n?-ah(Math.abs(e-n),1,50)/50:0,LK=(e,t)=>{const n=J3(e.x,35,t.width-35)*20,r=J3(e.y,35,t.height-35)*20;return[n,r]},FK=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},BK=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),yg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),zK=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Q3=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),n7e=(e,t)=>zK(BK(yg(e),yg(t))),CE=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},r7e=e=>Za(e.width)&&Za(e.height)&&Za(e.x)&&Za(e.y),Za=e=>!isNaN(e)&&isFinite(e),yn=Symbol.for("internals"),UK=["Enter"," ","Escape"],a7e=(e,t)=>{},o7e=e=>"nativeEvent"in e;function kE(e){var a,s;const t=o7e(e)?e.nativeEvent:e,n=((s=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:s[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const VK=e=>"clientX"in e,Vl=(e,t)=>{var s,i;const n=VK(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,a=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},A0=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},dv=({id:e,path:t,labelX:n,labelY:r,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m=20})=>H.createElement(H.Fragment,null,H.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:h}),m&&H.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),a&&Za(n)&&Za(r)?H.createElement(t7e,{x:n,y:r,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);dv.displayName="BaseEdge";function ym(e,t,n){return n===void 0?n:r=>
951{const a=t().edges.find(s=>s.id===e);a&&n(r,{...a})}}function WK({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,s=n<e?n+a:n-a,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[s,l,a,i]}function qK({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:i,targetControlY:l}){const c=e*.125+a*.375+i*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}var Au;(function(e){e.Strict="strict",e.Loose="loose"})(Au||(Au={}));var Uc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Uc||(Uc={}));var xg;(function(e){e.Partial="partial",e.Full="full"})(xg||(xg={}));var yl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(yl||(yl={}));var oh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(oh||(oh={}));var Re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Re||(Re={}));function Z3({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Re.Left||e===Re.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function HK({sourceX:e,sourceY:t,sourcePosition:n=Re.Bottom,targetX:r,targetY:a,targetPosition:s=Re.Top}){const[i,l]=Z3({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,u]=Z3({pos:s,x1:r,y1:a,x2:e,y2:t}),[d,f,h,m]=qK({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:i,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${i},${l} ${c},${u} ${r},${a}`,d,f,h,m]}const LT=p.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:a=Re.Bottom,targetPosition:s=Re.Top,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:v,interactionWidth:g})=>{const[y,x,b]=HK({sourceX:e,sourceY:t,sourcePosition:a,targetX:n,targetY:r,targetPosition:s});return H.createElement(dv,{path:y,labelX:x,labelY:b,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:v,interactionWidth:g})});LT.displayName="SimpleBezierEdge";const e5={[Re.Left]:{x:-1,y:0},[Re.Right]:{x:1,y:0},[Re.Top]:{x:0,y:-1},[Re.Bottom]:{x:0,y:1}},s7e=({source:e,sourcePosition:t=Re.Bottom,target:n})=>t===Re.Left||t===Re.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},t5=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function i7e({source:e,sourcePosition:t=Re.Bottom,target:n,targetPosition:r=Re.Top,center:a,offset:s}){const i=e5[t],l=e5[r],c={x:e.x+i.x*s,y:e.y+i.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},d=s7e({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let m=[],v,g;const y={x:0,y:0},x={x:0,y:0},[b,w,N,S]=WK({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[f]*l[f]===-1){v=a.x??b,g=a.y??w;const k=[{x:v,y:c.y},{x:v,y:u.y}],P=[{x:c.x,y:g},{x:u.x,y:g}];i[f]===h?m=f==="x"?k:P:m=f==="x"?P:k}else{const k=[{x:c.x,y:u.y}],P=[{x:u.x,y:c.y}];if(f==="x"?m=i.x===h?P:k:m=i.y===h?k:P,t===r){const U=Math.abs(e[f]-n[f]);if(U<=s){const E=Math.min(s-1,s-U);i[f]===h?y[f]=(c[f]>e[f]?-1:1)*E:x[f]=(u[f]>n[f]?-1:1)*E}}if(t!==r){const U=f==="x"?"y":"x",E=i[f]===l[U],q=c[U]>u[U],W=c[U]<u[U];(i[f]===1&&(!E&&q||E&&W)||i[f]!==1&&(!E&&W||E&&q))&&(m=f==="x"?k:P)}const O={x:c.x+y.x,y:c.y+y.y},$={x:u.x+x.x,y:u.y+x.y},T=Math.max(Math.abs(O.x-m[0].x),Math.abs($.x-m[0].x)),z=Math.max(Math.abs(O.y-m[0].y),Math.abs($.y-m[0].y));T>=z?(v=(O.x+$.x)/2,g=m[0].y):(v=m[0].x,g=(O.y+$.y)/2)}return[[e,{x:c.x+y.x,y:c.y+y.y},...m,{x:u.x+x.x,y:u.y+x.y},n],v,g,N,S]}function l7e(e,t,n,r){const a=Math.min(t5(e,t)/2,t5(t,n)/2,r),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+a*u},${i}Q ${s},${i} ${s},${i+a*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${i+a*c}Q ${s},${i} ${s+a*l},${i}`}function EE({sourceX:e,sourceY:t,sourcePosition:n=Re.Bottom,targetX:r,targetY:a,targetPosition:s=Re.Top,borderRadius:i=5,centerX:l,centerY:c,offset:u=20}){const[d,f,h,m,v]=i7e({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:s,center:{x:l,y:c},offset:u});return[d.reduce((y,x,b)=>{let w="";return b>0&&b<d.length-1?w=l7e(d[b-1],x,d[b+1],i):w=`${b===0?"M":"L"}${x.x} ${x.y}`,y+=w,y},""),f,h,m,v]}const oj=p.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=Re.Bottom,targetPosition:h=Re.Top,markerEnd:m,markerStart:v,pathOptions:g,interactionWidth:y})=>{const[x,b,w]=EE({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:h,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return H.createElement(dv,{path:x,labelX:b,labelY:w,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:m,markerStart:v,interactionWidth:y})});oj.displayName="SmoothStepEdge";const FT=p.memo(e=>{var t;return H.createElement(oj,{...e,pathOptions:p.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});FT.displayName="StepEdge";function c7e({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,s,i,l]=WK({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,s,i,l]}const BT=p.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m})=>{const[v,g,y]=c7e({sourceX:e,sourceY:t,targetX:n,targetY:r});return H.createElement(dv,{path:v,labelX:g,labelY:y,label:a,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:m})});BT.displayName="StraightEdge";function By(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function n5({pos:e,x1:t,y1:n,x2:r,y2:a,c:s}){switch(e){case Re.Left:return[t-By(t-r,s),n];case Re.Right:return[t+By(r-t,s),n];case Re.Top:return[t,n-By(n-a,s)];case Re.Bottom:return[t,n+By(a-n,s)]}}function GK({sourceX:e,sourceY:t,sourcePosition:n=Re.Bottom,targetX:r,targetY:a,targetPosition:s=Re.Top,curvature:i=.25}){const[l,c]=n5({pos:n,x1:e,y1:t,x2:r,y2:a,c:i}),[u,d]=n5({pos:s,x1:r,y1:a,x2:e,y2:t,c:i}
951),[f,h,m,v]=qK({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${a}`,f,h,m,v]}const P0=p.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:a=Re.Bottom,targetPosition:s=Re.Top,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:v,pathOptions:g,interactionWidth:y})=>{const[x,b,w]=GK({sourceX:e,sourceY:t,sourcePosition:a,targetX:n,targetY:r,targetPosition:s,curvature:g==null?void 0:g.curvature});return H.createElement(dv,{path:x,labelX:b,labelY:w,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:v,interactionWidth:y})});P0.displayName="BezierEdge";const zT=p.createContext(null),u7e=zT.Provider;zT.Consumer;const d7e=()=>p.useContext(zT),f7e=e=>"id"in e&&"source"in e&&"target"in e,h7e=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,AE=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,m7e=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),YK=(e,t)=>{if(!e.source||!e.target)return t;let n;return f7e(e)?n={...e}:n={...e,id:h7e(e)},m7e(n,t)?t:t.concat(n)},PE=({x:e,y:t},[n,r,a],s,[i,l])=>{const c={x:(e-n)/a,y:(t-r)/a};return s?{x:i*Math.round(c.x/i),y:l*Math.round(c.y/l)}:c},KK=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r}),ru=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],a={x:e.position.x-n,y:e.position.y-r};return{...a,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:a}},sj=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const{x:s,y:i}=ru(a,t).positionAbsolute;return BK(r,yg({x:s,y:i,width:a.width||0,height:a.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zK(n)},XK=(e,t,[n,r,a]=[0,0,1],s=!1,i=!1,l=[0,0])=>{const c={x:(t.x-n)/a,y:(t.y-r)/a,width:t.width/a,height:t.height/a},u=[];return e.forEach(d=>{const{width:f,height:h,selectable:m=!0,hidden:v=!1}=d;if(i&&!m||v)return!1;const{positionAbsolute:g}=ru(d,l),y={x:g.x,y:g.y,width:f||0,height:h||0},x=CE(c,y),b=typeof f>"u"||typeof h>"u"||f===null||h===null,w=s&&x>0,N=(f||0)*(h||0);(b||w||x>=N||d.dragging)&&u.push(d)}),u},JK=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},QK=(e,t,n,r,a,s=.1)=>{const i=t/(e.width*(1+s)),l=n/(e.height*(1+s)),c=Math.min(i,l),u=ah(c,r,a),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,m=n/2-f*u;return{x:h,y:m,zoom:u}},Tc=(e,t=0)=>e.transition().duration(t);function r5(e,t,n,r){return(t[n]||[]).reduce((a,s)=>{var i,l;return`${e.id}-${s.id}-${n}`!==r&&a.push({id:s.id||null,type:n,nodeId:e.id,x:(((i=e.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+s.y+s.height/2}),a},[])}function p7e(e,t,n,r,a,s){const{x:i,y:l}=Vl(e),u=t.elementsFromPoint(i,l).find(v=>v.classList.contains("react-flow__handle"));if(u){const v=u.getAttribute("data-nodeid");if(v){const g=UT(void 0,u),y=u.getAttribute("data-handleid"),x=s({nodeId:v,id:y,type:g});if(x){const b=a.find(w=>w.nodeId===v&&w.type===g&&w.id===y);return{handle:{id:y,type:g,nodeId:v,x:(b==null?void 0:b.x)||n.x,y:(b==null?void 0:b.y)||n.y},validHandleResult:x}}}}let d=[],f=1/0;if(a.forEach(v=>{const g=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(g<=r){const y=s(v);g<=f&&(g<f?d=[{handle:v,validHandleResult:y}]:g===f&&d.push({handle:v,validHandleResult:y}),f=g)}}),!d.length)return{handle:null,validHandleResult:ZK()};if(d.length===1)return d[0];const h=d.some(({validHandleResult:v})=>v.isValid),m=d.some(({handle:v})=>v.type==="target");return d.find(({handle:v,validHandleResult:g})=>m?v.type==="target":h?g.isValid:!0)||d[0]}const g7e={source:null,target:null,sourceHandle:null,targetHandle:null},ZK=()=>
951({handleDomNode:null,isValid:!1,connection:g7e,endHandle:null});function eX(e,t,n,r,a,s,i){const l=a==="target",c=i.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...ZK(),handleDomNode:c};if(c){const d=UT(void 0,c),f=c.getAttribute("data-nodeid"),h=c.getAttribute("data-handleid"),m=c.classList.contains("connectable"),v=c.classList.contains("connectableend"),g={source:l?f:n,sourceHandle:l?h:r,target:l?n:f,targetHandle:l?r:h};u.connection=g,m&&v&&(t===Au.Strict?l&&d==="source"||!l&&d==="target":f!==n||h!==r)&&(u.endHandle={nodeId:f,handleId:h,type:d},u.isValid=s(g))}return u}function v7e({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((a,s)=>{if(s[yn]){const{handleBounds:i}=s[yn];let l=[],c=[];i&&(l=r5(s,i,"source",`${t}-${n}-${r}`),c=r5(s,i,"target",`${t}-${n}-${r}`)),a.push(...l,...c)}return a},[])}function UT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $N(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function y7e(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function tX({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:a,getState:s,setState:i,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:u}){const d=FK(e.target),{connectionMode:f,domNode:h,autoPanOnConnect:m,connectionRadius:v,onConnectStart:g,panBy:y,getNodes:x,cancelConnection:b}=s();let w=0,N;const{x:S,y:_}=Vl(e),k=d==null?void 0:d.elementFromPoint(S,_),P=UT(c,k),O=h==null?void 0:h.getBoundingClientRect();if(!O||!P)return;let $,T=Vl(e,O),z=!1,U=null,E=!1,q=null;const W=v7e({nodes:x(),nodeId:n,handleId:t,handleType:P}),L=()=>
951{if(!m)return;const[I,R]=LK(T,O);y({x:I,y:R}),w=requestAnimationFrame(L)};i({connectionPosition:T,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:P,connectionStartHandle:{nodeId:n,handleId:t,type:P},connectionEndHandle:null}),g==null||g(e,{nodeId:n,handleId:t,handleType:P});function M(I){const{transform:R}=s();T=Vl(I,O);const{handle:F,validHandleResult:j}=p7e(I,d,PE(T,R,!1,[1,1]),v,W,C=>eX(C,f,n,t,a?"target":"source",l,d));if(N=F,z||(L(),z=!0),q=j.handleDomNode,U=j.connection,E=j.isValid,i({connectionPosition:N&&E?KK({x:N.x,y:N.y},R):T,connectionStatus:y7e(!!N,E),connectionEndHandle:j.endHandle}),!N&&!E&&!q)return $N($);U.source!==U.target&&q&&($N($),$=q,q.classList.add("connecting","react-flow__handle-connecting"),q.classList.toggle("valid",E),q.classList.toggle("react-flow__handle-valid",E))}function B(I){var R,F;(N||q)&&U&&E&&(r==null||r(U)),(F=(R=s()).onConnectEnd)==null||F.call(R,I),c&&(u==null||u(I)),$N($),b(),cancelAnimationFrame(w),z=!1,E=!1,U=null,q=null,d.removeEventListener("mousemove",M),d.removeEventListener("mouseup",B),d.removeEventListener("touchmove",M),d.removeEventListener("touchend",B)}d.addEventListener("mousemove",M),d.addEventListener("mouseup",B),d.addEventListener("touchmove",M),d.addEventListener("touchend",B)}const a5=()=>!0,x7e=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),b7e=(e,t,n)=>r=>{const{connectionStartHandle:a,connectionEndHandle:s,connectionClickStartHandle:i}=r;return{connecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n||(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n}},nX=p.forwardRef(({type:e="source",position:t=Re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:i,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m)=>{var O,$;const v=i||null,g=e==="target",y=Wn(),x=d7e(),{connectOnClick:b,noPanClassName:w}=Yt(x7e,nr),{connecting:N,clickConnecting:S}=Yt(b7e(x,v,e),nr);x||($=(O=y.getState()).onError)==null||$.call(O,"010",zi.error010());const _=T=>{const{defaultEdgeOptions:z,onConnect:U,hasDefaultEdges:E}=y.getState(),q={...z,...T};if(E){const{edges:W,setEdges:L}=y.getState();L(YK(q,W))}U==null||U(q),l==null||l(q)},k=T=>{if(!x)return;const z=VK(T);a&&(z&&T.button===0||!z)&&tX({event:T,handleId:v,nodeId:x,onConnect:_,isTarget:g,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||a5}),z?d==null||d(T):f==null||f(T)},P=T=>{const{onClickConnectStart:z,onClickConnectEnd:U,connectionClickStartHandle:E,connectionMode:q,isValidConnection:W}=y.getState();if(!x||!E&&!a)return;if(!E){z==null||z(T,{nodeId:x,handleId:v,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:x,type:e,handleId:v}});return}const L=FK(T.target),M=n||W||a5,{connection:B,isValid:I}=eX({nodeId:x,id:v,type:e},q,E.nodeId,E.handleId||null,E.type,M,L);I&&_(B),U==null||U(T),y.setState({connectionClickStartHandle:null})};return H.createElement("div",{"data-handleid":v,"data-nodeid":x,"data-handlepos":t,"data-id":`${x}-${v}-${e}`,className:pr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!g,target:g,connectable:r,connectablestart:a,connectableend:s,connecting:S,connectionindicator:r&&(a&&!N||s&&N)}]),onMouseDown:k,onTouchStart:k,onClick:b?P:void 0,ref:m,...h},c)});nX.displayName="Handle";var El=p.memo(nX);const rX=({data:e,isConnectable:t,targetPosition:n=Re.Top,sourcePosition:r=Re.Bottom})=>H.createElement(H.Fragment,null,H.createElement(El,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,H.createElement(El,{type:"source",position:r,isConnectable:t}));rX.displayName="DefaultNode";var TE=p.memo(rX);const aX=({data:e,isConnectable:t,sourcePosition:n=Re.Bottom})=>H.createElement(H.Fragment,null,e==null?void 0:e.label,H.createElement(El,{type:"source",position:n,isConnectable:t}));aX.displayName="InputNode";var oX=p.memo(aX);const sX=({data:e,isConnectable:t,targetPosition:n=Re.Top})=>H.createElement(H.Fragment,null,H.createElement(El,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);sX.displayName="OutputNode";var iX=p.memo(sX);const VT=()=>null;VT.displayName="GroupNode";const w7e=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),zy=e=>e.id;function j7e(e,t){return nr(e.selectedNodes.map(zy),t.selectedNodes.map(zy))&&nr(e.selectedEdges.map(zy),t.selectedEdges.map(zy))}const lX=p.memo(({onSelectionChange:e})=>{const t=Wn(),{selectedNodes:n,selectedEdges:r}=Yt(w7e,j7e);return p.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChange.forEach(s=>s(a))},[n,r,e]),null});lX.displayName="SelectionListener";const S7e=e=>!!e.onSelectionChange;function N7e({onSelectionChange:e}){const t=Yt(S7e);
951return e||t?H.createElement(lX,{onSelectionChange:e}):null}const _7e=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function hd(e,t){p.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function lt(e,t,n){p.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const C7e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:a,onConnectStart:s,onConnectEnd:i,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:h,edgesUpdatable:m,elevateNodesOnSelect:v,minZoom:g,maxZoom:y,nodeExtent:x,onNodesChange:b,onEdgesChange:w,elementsSelectable:N,connectionMode:S,snapGrid:_,snapToGrid:k,translateExtent:P,connectOnClick:O,defaultEdgeOptions:$,fitView:T,fitViewOptions:z,onNodesDelete:U,onEdgesDelete:E,onNodeDrag:q,onNodeDragStart:W,onNodeDragStop:L,onSelectionDrag:M,onSelectionDragStart:B,onSelectionDragStop:I,noPanClassName:R,nodeOrigin:F,rfId:j,autoPanOnConnect:C,autoPanOnNodeDrag:A,onError:D,connectionRadius:V,isValidConnection:Y,nodeDragThreshold:G})=>{const{setNodes:K,setEdges:Z,setDefaultNodesAndEdges:J,setMinZoom:ce,setMaxZoom:ue,setTranslateExtent:be,setNodeExtent:Ne,reset:te}=Yt(_7e,nr),re=Wn();return p.useEffect(()=>{const pe=r==null?void 0:r.map(Ee=>({...Ee,...$}));return J(n,pe),()=>{te()}},[]),lt("defaultEdgeOptions",$,re.setState),lt("connectionMode",S,re.setState),lt("onConnect",a,re.setState),lt("onConnectStart",s,re.setState),lt("onConnectEnd",i,re.setState),lt("onClickConnectStart",l,re.setState),lt("onClickConnectEnd",c,re.setState),lt("nodesDraggable",u,re.setState),lt("nodesConnectable",d,re.setState),lt("nodesFocusable",f,re.setState),lt("edgesFocusable",h,re.setState),lt("edgesUpdatable",m,re.setState),lt("elementsSelectable",N,re.setState),lt("elevateNodesOnSelect",v,re.setState),lt("snapToGrid",k,re.setState),lt("snapGrid",_,re.setState),lt("onNodesChange",b,re.setState),lt("onEdgesChange",w,re.setState),lt("connectOnClick",O,re.setState),lt("fitViewOnInit",T,re.setState),lt("fitViewOnInitOptions",z,re.setState),lt("onNodesDelete",U,re.setState),lt("onEdgesDelete",E,re.setState),lt("onNodeDrag",q,re.setState),lt("onNodeDragStart",W,re.setState),lt("onNodeDragStop",L,re.setState),lt("onSelectionDrag",M,re.setState),lt("onSelectionDragStart",B,re.setState),lt("onSelectionDragStop",I,re.setState),lt("noPanClassName",R,re.setState),lt("nodeOrigin",F,re.setState),lt("rfId",j,re.setState),lt("autoPanOnConnect",C,re.setState),lt("autoPanOnNodeDrag",A,re.setState),lt("onError",D,re.setState),lt("connectionRadius",V,re.setState),lt("isValidConnection",Y,re.setState),lt("nodeDragThreshold",G,re.setState),hd(e,K),hd(t,Z),hd(g,ce),hd(y,ue),hd(P,be),hd(x,Ne),null},o5={display:"none"},k7e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},cX="react-flow__node-desc",uX="react-flow__edge-desc",E7e="react-flow__aria-live",A7e=e=>e.ariaLiveMessage;function P7e({rfId:e}){const t=Yt(A7e);return H.createElement("div",{id:`${E7e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:k7e},t)}function T7e({rfId:e,disableKeyboardA11y:t}){return H.createElement(H.Fragment,null,H.createElement("div",{id:`${cX}-${e}`,style:o5},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),H.createElement("div",{id:`${uX}-${e}`,style:o5},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&H.createElement(P7e,{rfId:e}))}var bg=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=p.useState(!1),a=p.useRef(!1),s=p.useRef(new Set([])),[i,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const d=m=>{if(a.current=m.ctrlKey||m.metaKey||m.shiftKey,(!a.current||a.current&&!t.actInsideInputWithModifier)&&kE(m))return!1;const g=i5(m.code,l);s.current.add(m[g]),s5(i,s.current,!1)&&(m.preventDefault(),r(!0))},f=m=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&kE(m))return!1;const g=i5(m.code,l);s5(i,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),a.current=!1},h=()=>{s.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",d),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),()=>{u==null||u.removeEventListener("keydown",d),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",h)}}},[e,r]),n};
951function s5(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function i5(e,t){return t.includes(e)?"code":"key"}function dX(e,t,n,r){var l,c;const a=e.parentNode||e.parentId;if(!a)return n;const s=t.get(a),i=ru(s,r);return dX(s,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((l=s[yn])==null?void 0:l.z)??0)>(n.z??0)?((c=s[yn])==null?void 0:c.z)??0:n.z??0},r)}function fX(e,t,n){e.forEach(r=>{var s;const a=r.parentNode||r.parentId;if(a&&!e.has(a))throw new Error(`Parent node ${a} not found`);if(a||n!=null&&n[r.id]){const{x:i,y:l,z:c}=dX(r,e,{...r.position,z:((s=r[yn])==null?void 0:s.z)??0},t);r.positionAbsolute={x:i,y:l},r[yn].z=c,n!=null&&n[r.id]&&(r[yn].isParent=!0)}})}function DN(e,t,n,r){const a=new Map,s={},i=r?1e3:0;return e.forEach(l=>{var m;const c=(Za(l.zIndex)?l.zIndex:0)+(l.selected?i:0),u=t.get(l.id),d={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},f=l.parentNode||l.parentId;f&&(s[f]=!0);const h=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==l.type;Object.defineProperty(d,yn,{enumerable:!1,value:{handleBounds:h||(m=u==null?void 0:u[yn])==null?void 0:m.handleBounds,z:c}}),a.set(l.id,d)}),fX(a,n,s),a}function hX(e,t={}){const{getNodes:n,width:r,height:a,minZoom:s,maxZoom:i,d3Zoom:l,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:d,nodeOrigin:f}=e(),h=t.initial&&!u&&d;if(l&&c&&(h||!t.initial)){const v=n().filter(y=>{var b;const x=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(b=t.nodes)!=null&&b.length?x&&t.nodes.some(w=>w.id===y.id):x}),g=v.every(y=>y.width&&y.height);if(v.length>0&&g){const y=sj(v,f),{x,y:b,zoom:w}=QK(y,r,a,t.minZoom??s,t.maxZoom??i,t.padding??.1),N=Ci.translate(x,b).scale(w);return typeof t.duration=="number"&&t.duration>0?l.transform(Tc(c,t.duration),N):l.transform(c,N),!0}}return!1}function O7e(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[yn]:r[yn],selected:n.selected})}),new Map(t)}function M7e(e,t){return t.map(n=>{const r=e.find(a=>a.id===n.id);return r&&(n.selected=r.selected),n})}function Uy({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:a,edges:s,onNodesChange:i,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:u}=n();e!=null&&e.length&&(c&&r({nodeInternals:O7e(e,a)}),i==null||i(e)),t!=null&&t.length&&(u&&r({edges:M7e(t,s)}),l==null||l(t))}const md=()=>{},I7e={zoomIn:md,zoomOut:md,zoomTo:md,getZoom:()=>1,setViewport:md,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:md,fitBounds:md,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},$7e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),D7e=()=>{const e=Wn(),{d3Zoom:t,d3Selection:n}=Yt($7e,nr);return p.useMemo(()=>n&&t?{zoomIn:a=>t.scaleBy(Tc(n,a==null?void 0:a.duration),1.2),zoomOut:a=>t.scaleBy(Tc(n,a==null?void 0:a.duration),1/1.2),zoomTo:(a,s)=>t.scaleTo(Tc(n,s==null?void 0:s.duration),a),getZoom:()=>e.getState().transform[2],setViewport:(a,s)=>{const[i,l,c]=e.getState().transform,u=Ci.translate(a.x??i,a.y??l).scale(a.zoom??c);t.transform(Tc(n,s==null?void 0:s.duration),u)},getViewport:()=>{const[a,s,i]=e.getState().transform;return{x:a,y:s,zoom:i}},fitView:a=>hX(e.getState,a),setCenter:(a,s,i)=>{const{width:l,height:c,maxZoom:u}=e.getState(),d=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:u,f=l/2-a*d,h=c/2-s*d,m=Ci.translate(f,h).scale(d);t.transform(Tc(n,i==null?void 0:i.duration),m)},fitBounds:(a,s)=>{const{width:i,height:l,minZoom:c,maxZoom:u}=e.getState(),{x:d,y:f,zoom:h}=QK(a,i,l,c,u,(s==null?void 0:s.padding)??.1),m=Ci.translate(d,f).scale(h);t.transform(Tc(n,s==null?void 0:s.duration),m)},project:a=>{const{transform:s,snapToGrid:i,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),PE(a,s,i,l)},screenToFlowPosition:a=>{const{transform:s,snapToGrid:i,snapGrid:l,domNode:c}=e.getState();if(!c)return a;const{x:u,y:d}=c.getBoundingClientRect(),f={x:a.x-u,y:a.y-d};return PE(f,s,i,l)},flowToScreenPosition:a=>{const{transform:s,domNode:i}=e.getState();if(!i)return a;const{x:l,y:c}=i.getBoundingClientRect(),u=KK(a,s);return{x:u.x+l,y:u.y+c}},viewportInitialized:!0}:I7e,[t,n])};function ij(){const e=D7e(),t=Wn(),n=p.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),r=p.useCallback(g=>t.getState().nodeInternals.get(g),[]),a=p.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(y=>({...y}))},[]),s=p.useCallback(g=>{const{edges:y=[]}=t.getState();return y.find(x=>x.id===g)},[]),i=p.useCallback(g=>{const{getNodes:y,setNodes:x,hasDefaultNodes:b,onNodesChange:w}=t.getState(),N=y(),S=typeof g=="function"?g(N):g;if(b)x(S);else if(w){const _=S.length===0?N.map(k=>({type:"remove",id:k.id})):S.map(k=>({item:k,type:"reset"}));w(_)}},[]),l=p.useCallback(g=>{const{edges:y=[],setEdges:x,hasDefaultEdges:b,onEdgesChange:w}=t.getState(),N=typeof g=="function"?g(y):g;if(b)x(N);else if(w){const S=N.length===0?y.map(_=>({type:"remove",id:_.id})):N.map(_=>({item:_,type:"reset"}));w(S)}},[]),c=p.useCallback(g=>{const y=Array.isArray(g)?g:[g],{getNodes:x,setNodes:b,hasDefaultNodes:w,onNodesChange:N}=t.getState();if(w){const _=[...x(),...y];b(_)}else if(N){const S=y.map(_=>({item:_,type:"add"}));N(S)}},[]),u=p.useCallback(g=>{const y=Array.isArray(g)?g:[g],{edges:x=[],setEdges:b,hasDefaultEdges:w,onEdgesChange:N}=t.getState();if(w)b([...x,...y]);else if(N){const S=y.map(_=>({item:_,type:"add"}));N(S)}},[]),d=p.useCallback(()=>{const{getNodes:g,edges:y=[],transform:x}=t.getState(),[b,w,N]=x;return{nodes:g().map(S=>({...S}
951)),edges:y.map(S=>({...S})),viewport:{x:b,y:w,zoom:N}}},[]),f=p.useCallback(({nodes:g,edges:y})=>{const{nodeInternals:x,getNodes:b,edges:w,hasDefaultNodes:N,hasDefaultEdges:S,onNodesDelete:_,onEdgesDelete:k,onNodesChange:P,onEdgesChange:O}=t.getState(),$=(g||[]).map(q=>q.id),T=(y||[]).map(q=>q.id),z=b().reduce((q,W)=>{const L=W.parentNode||W.parentId,M=!$.includes(W.id)&&L&&q.find(I=>I.id===L);return(typeof W.deletable=="boolean"?W.deletable:!0)&&($.includes(W.id)||M)&&q.push(W),q},[]),U=w.filter(q=>typeof q.deletable=="boolean"?q.deletable:!0),E=U.filter(q=>T.includes(q.id));if(z||E){const q=JK(z,U),W=[...E,...q],L=W.reduce((M,B)=>(M.includes(B.id)||M.push(B.id),M),[]);if((S||N)&&(S&&t.setState({edges:w.filter(M=>!L.includes(M.id))}),N&&(z.forEach(M=>{x.delete(M.id)}),t.setState({nodeInternals:new Map(x)}))),L.length>0&&(k==null||k(W),O&&O(L.map(M=>({id:M,type:"remove"})))),z.length>0&&(_==null||_(z),P)){const M=z.map(B=>({id:B.id,type:"remove"}));P(M)}}},[]),h=p.useCallback(g=>{const y=r7e(g),x=y?null:t.getState().nodeInternals.get(g.id);return!y&&!x?[null,null,y]:[y?g:Q3(x),x,y]},[]),m=p.useCallback((g,y=!0,x)=>{const[b,w,N]=h(g);return b?(x||t.getState().getNodes()).filter(S=>{if(!N&&(S.id===w.id||!S.positionAbsolute))return!1;const _=Q3(S),k=CE(_,b);return y&&k>0||k>=b.width*b.height}):[]},[]),v=p.useCallback((g,y,x=!0)=>{const[b]=h(g);if(!b)return!1;const w=CE(b,y);return x&&w>0||w>=b.width*b.height},[]);return p.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:a,getEdge:s,setNodes:i,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:m,isNodeIntersecting:v}),[e,n,r,a,s,i,l,c,u,d,f,m,v])}const R7e={actInsideInputWithModifier:!1};var L7e=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Wn(),{deleteElements:r}=ij(),a=bg(e,R7e),s=bg(t);p.useEffect(()=>{if(a){const{edges:i,getNodes:l}=n.getState(),c=l().filter(d=>d.selected),u=i.filter(d=>d.selected);r({nodes:c,edges:u}),n.setState({nodesSelectionActive:!1})}},[a]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])};function F7e(e){const t=Wn();p.useEffect(()=>{let n;const r=()=>{var s,i;if(!e.current)return;const a=DT(e.current);(a.height===0||a.width===0)&&((i=(s=t.getState()).onError)==null||i.call(s,"004",zi.error004())),t.setState({width:a.width||500,height:a.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const WT={position:"absolute",width:"100%",height:"100%",top:0,left:0},B7e=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Vy=e=>({x:e.x,y:e.y,zoom:e.k}),pd=(e,t)=>e.target.closest(`.${t}`),l5=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),c5=e=>{const t=e.ctrlKey&&A0()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},z7e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),U7e=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:a=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Uc.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:m,minZoom:v,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:x=!0,children:b,noWheelClassName:w,noPanClassName:N})=>{const S=p.useRef(),_=Wn(),k=p.useRef(!1),P=p.useRef(!1),O=p.useRef(null),$=p.useRef({x:0,y:0,zoom:0}),{d3Zoom:T,d3Selection:z,d3ZoomHandler:U,userSelectionActive:E}=Yt(z7e,nr),q=bg(y),W=p.useRef(0),L=p.useRef(!1),M=p.useRef();return F7e(O),p.useEffect(()=>{if(O.current){const B=O.current.getBoundingClientRect(),I=DK().scaleExtent([v,g]).translateExtent(m),R=Ka(O.current).call(I),F=Ci.translate(h.x,h.y).scale(ah(h.zoom,v,g)),j=[[0,0],[B.width,B.height]],C=I.constrain()(F,j,m);I.transform(R,C),I.wheelDelta(c5),_.setState({d3Zoom:I,d3Selection:R,d3ZoomHandler:R.on("wheel.zoom"),transform:[C.x,C.y,C.k],domNode:O.current.closest(".react-flow")})}},[]),p.useEffect(()=>{z&&T&&(i&&!q&&!E?z.on("wheel.zoom",B=>{if(pd(B,w))return!1;B.preventDefault(),B.stopImmediatePropagation();const I=z.property("__zoom").k||1;if(B.ctrlKey&&s){const Y=Mo(B),G=c5(B),K=I*Math.pow(2,G);T.scaleTo(z,K,Y,B);return}const R=B.deltaMode===1?20:1;let F=c===Uc.Vertical?0:B.deltaX*R,j=c===Uc.Horizontal?0:B.deltaY*R;!A0()&&B.shiftKey&&c!==Uc.Vertical&&(F=B.deltaY*R,j=0),T.translateBy(z,-(F/I)*l,-(j/I)*l,{internal:!0});const C=Vy(z.property("__zoom")),{onViewportChangeStart:A,onViewportChange:D,onViewportChangeEnd:V}=_.getState();
951clearTimeout(M.current),L.current||(L.current=!0,t==null||t(B,C),A==null||A(C)),L.current&&(e==null||e(B,C),D==null||D(C),M.current=setTimeout(()=>{n==null||n(B,C),V==null||V(C),L.current=!1},150))},{passive:!1}):typeof U<"u"&&z.on("wheel.zoom",function(B,I){if(!x&&B.type==="wheel"&&!B.ctrlKey||pd(B,w))return null;B.preventDefault(),U.call(this,B,I)},{passive:!1}))},[E,i,c,z,T,U,q,s,x,w,t,e,n]),p.useEffect(()=>{T&&T.on("start",B=>{var F,j;if(!B.sourceEvent||B.sourceEvent.internal)return null;W.current=(F=B.sourceEvent)==null?void 0:F.button;const{onViewportChangeStart:I}=_.getState(),R=Vy(B.transform);k.current=!0,$.current=R,((j=B.sourceEvent)==null?void 0:j.type)==="mousedown"&&_.setState({paneDragging:!0}),I==null||I(R),t==null||t(B.sourceEvent,R)})},[T,t]),p.useEffect(()=>{T&&(E&&!k.current?T.on("zoom",null):E||T.on("zoom",B=>{var R;const{onViewportChange:I}=_.getState();if(_.setState({transform:[B.transform.x,B.transform.y,B.transform.k]}),P.current=!!(r&&l5(f,W.current??0)),(e||I)&&!((R=B.sourceEvent)!=null&&R.internal)){const F=Vy(B.transform);I==null||I(F),e==null||e(B.sourceEvent,F)}}))},[E,T,e,f,r]),p.useEffect(()=>{T&&T.on("end",B=>{if(!B.sourceEvent||B.sourceEvent.internal)return null;const{onViewportChangeEnd:I}=_.getState();if(k.current=!1,_.setState({paneDragging:!1}),r&&l5(f,W.current??0)&&!P.current&&r(B.sourceEvent),P.current=!1,(n||I)&&B7e($.current,B.transform)){const R=Vy(B.transform);$.current=R,clearTimeout(S.current),S.current=setTimeout(()=>{I==null||I(R),n==null||n(B.sourceEvent,R)},i?150:0)}})},[T,i,f,n,r]),p.useEffect(()=>{T&&T.filter(B=>{const I=q||a,R=s&&B.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&B.button===1&&B.type==="mousedown"&&(pd(B,"react-flow__node")||pd(B,"react-flow__edge")))return!0;if(!f&&!I&&!i&&!u&&!s||E||!u&&B.type==="dblclick"||pd(B,w)&&B.type==="wheel"||pd(B,N)&&(B.type!=="wheel"||i&&B.type==="wheel"&&!q)||!s&&B.ctrlKey&&B.type==="wheel"||!I&&!i&&!R&&B.type==="wheel"||!f&&(B.type==="mousedown"||B.type==="touchstart")||Array.isArray(f)&&!f.includes(B.button)&&B.type==="mousedown")return!1;const F=Array.isArray(f)&&f.includes(B.button)||!B.button||B.button<=1;return(!B.ctrlKey||B.type==="wheel")&&F})},[E,T,a,s,i,u,f,d,q]),H.createElement("div",{className:"react-flow__renderer",ref:O,style:WT},b)},V7e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function W7e(){const{userSelectionActive:e,userSelectionRect:t}=Yt(V7e,nr);return e&&t?H.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function u5(e,t){const n=t.parentNode||t.parentId,r=e.find(a=>a.id===n);if(r){const a=t.position.x+t.width-r.width,s=t.position.y+t.height-r.height;if(a>0||s>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,a>0&&(r.style.width+=a),s>0&&(r.style.height+=s),t.position.x<0){const i=Math.abs(t.position.x);r.position.x=r.position.x-i,r.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);r.position.y=r.position.y-i,r.style.height+=i,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function mX(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,a)=>{const s=e.filter(l=>l.id===a.id);if(s.length===0)return r.push(a),r;const i={...a};for(const l of s)if(l)switch(l.type){case"select":{i.selected=l.selected;break}case"position":{typeof l.position<"u"&&(i.position=l.position),typeof l.positionAbsolute<"u"&&(i.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(i.dragging=l.dragging),i.expandParent&&u5(r,i);break}case"dimensions":{typeof l.dimensions<"u"&&(i.width=l.dimensions.width,i.height=l.dimensions.height),typeof l.updateStyle<"u"&&(i.style={...i.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(i.resizing=l.resizing),i.expandParent&&u5(r,i);break}case"remove":return r}return r.push(i),r},n)}function pX(e,t){return mX(e,t)}function q7e(e,t){return mX(e,t)}const hl=(e,t)=>({id:e,type:"select",selected:t});function Ld(e,t){return e.reduce((n,r)=>{const a=t.includes(r.id);return!r.selected&&a?(r.selected=!0,n.push(hl(r.id,!0))):r.selected&&!a&&(r.selected=!1,n.push(hl(r.id,!1))),n},[])}const RN=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},H7e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),gX=p.memo(({isSelecting:e,selectionMode:t=xg.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:a,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:d,children:f})=>{const h=p.useRef(null),m=Wn(),v=p.useRef(0),g=p.useRef(0),y=p.useRef(),{userSelectionActive:x,elementsSelectable:b,dragging:w}=Yt(H7e,nr),N=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,g.current=0},S=U=>
951{s==null||s(U),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},_=U=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){U.preventDefault();return}i==null||i(U)},k=l?U=>l(U):void 0,P=U=>{const{resetSelectedElements:E,domNode:q}=m.getState();if(y.current=q==null?void 0:q.getBoundingClientRect(),!b||!e||U.button!==0||U.target!==h.current||!y.current)return;const{x:W,y:L}=Vl(U,y.current);E(),m.setState({userSelectionRect:{width:0,height:0,startX:W,startY:L,x:W,y:L}}),r==null||r(U)},O=U=>{const{userSelectionRect:E,nodeInternals:q,edges:W,transform:L,onNodesChange:M,onEdgesChange:B,nodeOrigin:I,getNodes:R}=m.getState();if(!e||!y.current||!E)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const F=Vl(U,y.current),j=E.startX??0,C=E.startY??0,A={...E,x:F.x<j?F.x:j,y:F.y<C?F.y:C,width:Math.abs(F.x-j),height:Math.abs(F.y-C)},D=R(),V=XK(q,A,L,t===xg.Partial,!0,I),Y=JK(V,W).map(K=>K.id),G=V.map(K=>K.id);if(v.current!==G.length){v.current=G.length;const K=Ld(D,G);K.length&&(M==null||M(K))}if(g.current!==Y.length){g.current=Y.length;const K=Ld(W,Y);K.length&&(B==null||B(K))}m.setState({userSelectionRect:A})},$=U=>{if(U.button!==0)return;const{userSelectionRect:E}=m.getState();!x&&E&&U.target===h.current&&(S==null||S(U)),m.setState({nodesSelectionActive:v.current>0}),N(),a==null||a(U)},T=U=>{x&&(m.setState({nodesSelectionActive:v.current>0}),a==null||a(U)),N()},z=b&&(e||x);return H.createElement("div",{className:pr(["react-flow__pane",{dragging:w,selection:e}]),onClick:z?void 0:RN(S,h),onContextMenu:RN(_,h),onWheel:RN(k,h),onMouseEnter:z?void 0:c,onMouseDown:z?P:void 0,onMouseMove:z?O:u,onMouseUp:z?$:void 0,onMouseLeave:z?T:d,ref:h,style:WT},f,H.createElement(W7e,null))});gX.displayName="Pane";function vX(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:vX(r,t):!1}function d5(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function G7e(e,t,n,r){return Array.from(e.values()).filter(a=>(a.selected||a.id===r)&&(!a.parentNode||a.parentId||!vX(a,e))&&(a.draggable||t&&typeof a.draggable>"u")).map(a=>{var s,i;return{id:a.id,position:a.position||{x:0,y:0},positionAbsolute:a.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=a.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=a.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:a.extent,parentNode:a.parentNode||a.parentId,parentId:a.parentNode||a.parentId,width:a.width,height:a.height,expandParent:a.expandParent}})}function Y7e(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function yX(e,t,n,r,a=[0,0],s){const i=Y7e(e,e.extent||r);let l=i;const c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const f=n.get(c),{x:h,y:m}=ru(f,a).positionAbsolute;l=f&&Za(h)&&Za(m)&&Za(f.width)&&Za(f.height)?[[h+e.width*a[0],m+e.height*a[1]],[h+f.width-e.width+e.width*a[0],m+f.height-e.height+e.height*a[1]]]:l}else s==null||s("005",zi.error005()),l=i;else if(e.extent&&c&&e.extent!=="parent"){const f=n.get(c),{x:h,y:m}=ru(f,a).positionAbsolute;l=[[e.extent[0][0]+h,e.extent[0][1]+m],[e.extent[1][0]+h,e.extent[1][1]+m]]}let u={x:0,y:0};if(c){const f=n.get(c);u=ru(f,a).positionAbsolute}const d=l&&l!=="parent"?RT(t,l):t;return{position:{x:d.x-u.x,y:d.y-u.y},positionAbsolute:d}}function LN({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(a=>({...n.get(a.id),position:a.position,positionAbsolute:a.positionAbsolute}));return[e?r.find(a=>a.id===e):r[0],r]}const f5=(e,t,n,r)=>{const a=t.querySelectorAll(e);if(!a||!a.length)return null;const s=Array.from(a),i=t.getBoundingClientRect(),l={x:i.width*r[0],y:i.height*r[1]};return s.map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-i.left-l.x)/n,y:(u.top-i.top-l.y)/n,...DT(c)}})};function xm(e,t,n){return n===void 0?n:r=>{const a=t().nodeInternals.get(e);a&&n(r,{...a})}}function OE({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",zi.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&i)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):a([e])}function K7e(){const e=Wn();return p.useCallback(({sourceEvent:n})=>
951{const{transform:r,snapGrid:a,snapToGrid:s}=e.getState(),i=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(i-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:s?a[0]*Math.round(c.x/a[0]):c.x,ySnapped:s?a[1]*Math.round(c.y/a[1]):c.y,...c}},[])}function FN(e){return(t,n,r)=>e==null?void 0:e(t,r)}function xX({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:s,selectNodesOnDrag:i}){const l=Wn(),[c,u]=p.useState(!1),d=p.useRef([]),f=p.useRef({x:null,y:null}),h=p.useRef(0),m=p.useRef(null),v=p.useRef({x:0,y:0}),g=p.useRef(null),y=p.useRef(!1),x=p.useRef(!1),b=p.useRef(!1),w=K7e();return p.useEffect(()=>{if(e!=null&&e.current){const N=Ka(e.current),S=({x:P,y:O})=>{const{nodeInternals:$,onNodeDrag:T,onSelectionDrag:z,updateNodePositions:U,nodeExtent:E,snapGrid:q,snapToGrid:W,nodeOrigin:L,onError:M}=l.getState();f.current={x:P,y:O};let B=!1,I={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&E){const F=sj(d.current,L);I=yg(F)}if(d.current=d.current.map(F=>{const j={x:P-F.distance.x,y:O-F.distance.y};W&&(j.x=q[0]*Math.round(j.x/q[0]),j.y=q[1]*Math.round(j.y/q[1]));const C=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];d.current.length>1&&E&&!F.extent&&(C[0][0]=F.positionAbsolute.x-I.x+E[0][0],C[1][0]=F.positionAbsolute.x+(F.width??0)-I.x2+E[1][0],C[0][1]=F.positionAbsolute.y-I.y+E[0][1],C[1][1]=F.positionAbsolute.y+(F.height??0)-I.y2+E[1][1]);const A=yX(F,j,$,C,L,M);return B=B||F.position.x!==A.position.x||F.position.y!==A.position.y,F.position=A.position,F.positionAbsolute=A.positionAbsolute,F}),!B)return;U(d.current,!0,!0),u(!0);const R=a?T:FN(z);if(R&&g.current){const[F,j]=LN({nodeId:a,dragItems:d.current,nodeInternals:$});R(g.current,F,j)}},_=()=>{if(!m.current)return;const[P,O]=LK(v.current,m.current);if(P!==0||O!==0){const{transform:$,panBy:T}=l.getState();f.current.x=(f.current.x??0)-P/$[2],f.current.y=(f.current.y??0)-O/$[2],T({x:P,y:O})&&S(f.current)}h.current=requestAnimationFrame(_)},k=P=>{var L;const{nodeInternals:O,multiSelectionActive:$,nodesDraggable:T,unselectNodesAndEdges:z,onNodeDragStart:U,onSelectionDragStart:E}=l.getState();x.current=!0;const q=a?U:FN(E);(!i||!s)&&!$&&a&&((L=O.get(a))!=null&&L.selected||z()),a&&s&&i&&OE({id:a,store:l,nodeRef:e});const W=w(P);if(f.current=W,d.current=G7e(O,T,W,a),q&&d.current){const[M,B]=LN({nodeId:a,dragItems:d.current,nodeInternals:O});q(P.sourceEvent,M,B)}};if(t)N.on(".drag",null);else{const P=MVe().on("start",O=>{const{domNode:$,nodeDragThreshold:T}=l.getState();T===0&&k(O),b.current=!1;const z=w(O);f.current=z,m.current=($==null?void 0:$.getBoundingClientRect())||null,v.current=Vl(O.sourceEvent,m.current)}).on("drag",O=>{var U,E;const $=w(O),{autoPanOnNodeDrag:T,nodeDragThreshold:z}=l.getState();if(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&x.current&&T&&(y.current=!0,_()),!x.current){const q=$.xSnapped-(((U=f==null?void 0:f.current)==null?void 0:U.x)??0),W=$.ySnapped-(((E=f==null?void 0:f.current)==null?void 0:E.y)??0);Math.sqrt(q*q+W*W)>z&&k(O)}(f.current.x!==$.xSnapped||f.current.y!==$.ySnapped)&&d.current&&x.current&&(g.current=O.sourceEvent,v.current=Vl(O.sourceEvent,m.current),S($))}}).on("end",O=>{if(!(!x.current||b.current)&&(u(!1),y.current=!1,x.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:$,nodeInternals:T,onNodeDragStop:z,onSelectionDragStop:U}=l.getState(),E=a?z:FN(U);if($(d.current,!1,!1),E){const[q,W]=LN({nodeId:a,dragItems:d.current,nodeInternals:T});E(O.sourceEvent,q,W)}}}).filter(O=>{const $=O.target;return!O.button&&(!n||!d5($,`.${n}`,e))&&(!r||d5($,r,e))});return N.call(P),()=>{N.on(".drag",null)}}}},[e,t,n,r,s,l,a,i,w]),c}function bX(){const e=Wn();return p.useCallback(n=>{const{nodeInternals:r,nodeExtent:a,updateNodePositions:s,getNodes:i,snapToGri
951d:l,snapGrid:c,onError:u,nodesDraggable:d}=e.getState(),f=i().filter(b=>b.selected&&(b.draggable||d&&typeof b.draggable>"u")),h=l?c[0]:5,m=l?c[1]:5,v=n.isShiftPressed?4:1,g=n.x*h*v,y=n.y*m*v,x=f.map(b=>{if(b.positionAbsolute){const w={x:b.positionAbsolute.x+g,y:b.positionAbsolute.y+y};l&&(w.x=c[0]*Math.round(w.x/c[0]),w.y=c[1]*Math.round(w.y/c[1]));const{positionAbsolute:N,position:S}=yX(b,w,r,a,void 0,u);b.position=S,b.positionAbsolute=N}return b});s(x,!0,!1)},[])}const rf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var bm=e=>{const t=({id:n,type:r,data:a,xPos:s,yPos:i,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:m,onContextMenu:v,onDoubleClick:g,style:y,className:x,isDraggable:b,isSelectable:w,isConnectable:N,isFocusable:S,selectNodesOnDrag:_,sourcePosition:k,targetPosition:P,hidden:O,resizeObserver:$,dragHandle:T,zIndex:z,isParent:U,noDragClassName:E,noPanClassName:q,initialized:W,disableKeyboardA11y:L,ariaLabel:M,rfId:B,hasHandleBounds:I})=>{const R=Wn(),F=p.useRef(null),j=p.useRef(null),C=p.useRef(k),A=p.useRef(P),D=p.useRef(r),V=w||b||d||f||h||m,Y=bX(),G=xm(n,R.getState,f),K=xm(n,R.getState,h),Z=xm(n,R.getState,m),J=xm(n,R.getState,v),ce=xm(n,R.getState,g),ue=te=>{const{nodeDragThreshold:re}=R.getState();if(w&&(!_||!b||re>0)&&OE({id:n,store:R,nodeRef:F}),d){const pe=R.getState().nodeInternals.get(n);pe&&d(te,{...pe})}},be=te=>{if(!kE(te)&&!L)if(UK.includes(te.key)&&w){const re=te.key==="Escape";OE({id:n,store:R,unselect:re,nodeRef:F})}else b&&u&&Object.prototype.hasOwnProperty.call(rf,te.key)&&(R.setState({ariaLiveMessage:`Moved selected node ${te.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),Y({x:rf[te.key].x,y:rf[te.key].y,isShiftPressed:te.shiftKey}))};p.useEffect(()=>()=>{j.current&&($==null||$.unobserve(j.current),j.current=null)},[]),p.useEffect(()=>{if(F.current&&!O){const te=F.current;(!W||!I||j.current!==te)&&(j.current&&($==null||$.unobserve(j.current)),$==null||$.observe(te),j.current=te)}},[O,W,I]),p.useEffect(()=>{const te=D.current!==r,re=C.current!==k,pe=A.current!==P;F.current&&(te||re||pe)&&(te&&(D.current=r),re&&(C.current=k),pe&&(A.current=P),R.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,k,P]);const Ne=xX({nodeRef:F,disabled:O||!b,noDragClassName:E,handleSelector:T,nodeId:n,isSelectable:w,selectNodesOnDrag:_});return O?null:H.createElement("div",{className:pr(["react-flow__node",`react-flow__node-${r}`,{[q]:b},x,{selected:u,selectable:w,parent:U,dragging:Ne}]),ref:F,style:{zIndex:z,transform:`translate(${l}px,${c}px)`,pointerEvents:V?"all":"none",visibility:W?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:G,onMouseMove:K,onMouseLeave:Z,onContextMenu:J,onClick:ue,onDoubleClick:ce,onKeyDown:S?be:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":L?void 0:`${cX}-${B}`,"aria-label":M},H.createElement(u7e,{value:n},H.createElement(e,{id:n,data:a,type:r,xPos:s,yPos:i,selected:u,isConnectable:N,sourcePosition:k,targetPosition:P,dragging:Ne,dragHandle:T,zIndex:z})))};return t.displayName="NodeWrapper",p.memo(t)};const X7e=e=>{const t=e.getNodes().filter(n=>n.selected);return{...sj(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function J7e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Wn(),{width:a,height:s,x:i,y:l,transformString:c,userSelectionActive:u}=Yt(X7e,nr),d=bX(),f=p.useRef(null);if(p.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]),xX({nodeRef:f}),u||!a||!s)return null;const h=e?v=>{const g=r.getState().getNodes().filter(y=>y.selected);e(v,g)}:void 0,m=v=>{Object.prototype.hasOwnProperty.call(rf,v.key)&&d({x:rf[v.key].x,y:rf[v.key].y,isShiftPressed:v.shiftKey})};return H.createElement("div",{className:pr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},H.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:s,top:l,left:i}}))}var Q7e=p.memo(J7e);const Z7e=e=>e.nodesSelectionActive,wX=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:m,onSelectionStart:v,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:b,elementsSelectable:w,zoomOnScroll:N,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:P,zoomOnDoubleClick:O,panOnDrag:$,defaultViewport:T,translateExtent:z,minZoom:U,maxZoom:E,preventScrolling:q,onSelectionContextMenu:W,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:B})=>{const I=Yt(Z7e),R=bg(f),F=bg(x),j=F||$,C=F||_,A=R||h&&j!==!0;return L7e({deleteKeyCode:l,multiSelectionKeyCode:y}),H.createElement(U7e,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:N,zoomOnPinch:S,panOnScroll:C,panOnScrollSpeed:k,panOnScrollMode:P,zoomOnDoubleClick:O,panOnDrag:!R&&j,defaultViewport:T,translateExtent:z,minZoom:U,maxZoom:E,zoomActivationKeyCode:b,preventScrolling:q,noWheelClassName:L,noPanClassName:M},H.createElement(gX,{onSelectionStart:v,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:j,isSelecting:!!A,selectionMode:m},e,I&&H.createElement(Q7e,{onSelectionContextMenu:W,noPanClassName:M,disableKeyboardA11y:B})))};wX.displayName="FlowRenderer";var eWe=p.memo(wX);function tWe(e){return Yt(p.useCallback(n=>e?XK(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function nWe(e){const t={input:bm(e.input||oX),default:bm(e.default||TE),output:bm(e.output||iX),group:bm(e.group||VT)},n={},r=Object.keys(e).filter(a=>!["input","default","output","group"].includes(a)).reduce((a,s)=>(a[s]=bm(e[s]||TE),a),n);return{...t,...r}}const rWe=({x:e,y:t,width:n,height:r,origin:a})=>!n||!r?{x:e,y:t}:a[0]<0||a[1]<0||a[0]>1||a[1]>1?{x:e,y:t}:{x:e-n*a[0],y:t-r*a[1]},aWe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,no
951desFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),jX=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,updateNodeDimensions:s,onError:i}=Yt(aWe,nr),l=tWe(e.onlyRenderVisibleElements),c=p.useRef(),u=p.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const h=f.map(m=>({id:m.target.getAttribute("data-id"),nodeElement:m.target,forceUpdate:!0}));s(h)});return c.current=d,d},[]);return p.useEffect(()=>()=>{var d;(d=c==null?void 0:c.current)==null||d.disconnect()},[]),H.createElement("div",{className:"react-flow__nodes",style:WT},l.map(d=>{var S,_,k;let f=d.type||"default";e.nodeTypes[f]||(i==null||i("003",zi.error003(f)),f="default");const h=e.nodeTypes[f]||e.nodeTypes.default,m=!!(d.draggable||t&&typeof d.draggable>"u"),v=!!(d.selectable||a&&typeof d.selectable>"u"),g=!!(d.connectable||n&&typeof d.connectable>"u"),y=!!(d.focusable||r&&typeof d.focusable>"u"),x=e.nodeExtent?RT(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,b=(x==null?void 0:x.x)??0,w=(x==null?void 0:x.y)??0,N=rWe({x:b,y:w,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return H.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||Re.Bottom,targetPosition:d.targetPosition||Re.Top,hidden:d.hidden,xPos:b,yPos:w,xPosOrigin:N.x,yPosOrigin:N.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:m,isSelectable:v,isConnectable:g,isFocusable:y,resizeObserver:u,dragHandle:d.dragHandle,zIndex:((S=d[yn])==null?void 0:S.z)??0,isParent:!!((_=d[yn])!=null&&_.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((k=d[yn])!=null&&k.handleBounds)})}))};jX.displayName="NodeRenderer";var oWe=p.memo(jX);const sWe=(e,t,n)=>n===Re.Left?e-t:n===Re.Right?e+t:e,iWe=(e,t,n)=>n===Re.Top?e-t:n===Re.Bottom?e+t:e,h5="react-flow__edgeupdater",m5=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:s,onMouseOut:i,type:l})=>H.createElement("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:i,className:pr([h5,`${h5}-${l}`]),cx:sWe(t,r,e),cy:iWe(n,r,e),r,stroke:"transparent",fill:"transparent"}),lWe=()=>!0;var gd=e=>{const t=({id:n,className:r,type:a,data:s,onClick:i,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:g,style:y,source:x,target:b,sourceX:w,sourceY:N,targetX:S,targetY:_,sourcePosition:k,targetPosition:P,elementsSelectable:O,hidden:$,sourceHandleId:T,targetHandleId:z,onContextMenu:U,onMouseEnter:E,onMouseMove:q,onMouseLeave:W,reconnectRadius:L,onReconnect:M,onReconnectStart:B,onReconnectEnd:I,markerEnd:R,markerStart:F,rfId:j,ariaLabel:C,isFocusable:A,isReconnectable:D,pathOptions:V,interactionWidth:Y,disableKeyboardA11y:G})=>{const K=p.useRef(null),[Z,J]=p.useState(!1),[ce,ue]=p.useState(!1),be=Wn(),Ne=p.useMemo(()=>`url('#${AE(F,j)}')`,[F,j]),te=p.useMemo(()=>`url('#${AE(R,j)}')`,[R,j]);if($)return null;const re=Se=>{var qn;const{edges:it,addSelectedEdges:Lt,unselectNodesAndEdges:In,multiSelectionActive:Or}=be.getState(),bt=it.find(is=>is.id===n);bt&&(O&&(be.setState({nodesSelectionActive:!1}),bt.selected&&Or?(In({nodes:[],edges:[bt]}),(qn=K.current)==null||qn.blur()):Lt([n])),i&&i(Se,bt))},pe=ym(n,be.getState,l),Ee=ym(n,be.getState,U),Fe=ym(n,be.getState,E),Be=ym(n,be.getState,q),st=ym(n,be.getState,W),Pt=(Se,it)=>{if(Se.button!==0)return;const{edges:Lt,isValidConnection:In}=be.getState(),Or=it?b:x,bt=(it?z:T)||null,qn=it?"target":"source",is=In||lWe,Vs=it,Xr=Lt.find(Hn=>Hn.id===n);ue(!0),B==null||B(Se,Xr,qn);const pc=Hn=>{ue(!1),I==null||I(Hn,Xr,qn)};tX({event:Se,handleId:bt,nodeId:Or,onConnect:Hn=>M==null?void 0:M(Xr,Hn),isTarget:Vs,getState:be.getState,setState:be.setState,isValidConnection:is,edgeUpdaterType:qn,onReconnectEnd:pc})},kn=Se=>Pt(Se,!0),Tt=Se=>Pt(Se,!1),an=()=>J(!0),Kr=()=>
951J(!1),Tr=!O&&!i,me=Se=>{var it;if(!G&&UK.includes(Se.key)&&O){const{unselectNodesAndEdges:Lt,addSelectedEdges:In,edges:Or}=be.getState();Se.key==="Escape"?((it=K.current)==null||it.blur(),Lt({edges:[Or.find(qn=>qn.id===n)]})):In([n])}};return H.createElement("g",{className:pr(["react-flow__edge",`react-flow__edge-${a}`,r,{selected:c,animated:u,inactive:Tr,updating:Z}]),onClick:re,onDoubleClick:pe,onContextMenu:Ee,onMouseEnter:Fe,onMouseMove:Be,onMouseLeave:st,onKeyDown:A?me:void 0,tabIndex:A?0:void 0,role:A?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":C===null?void 0:C||`Edge from ${x} to ${b}`,"aria-describedby":A?`${uX}-${j}`:void 0,ref:K},!ce&&H.createElement(e,{id:n,source:x,target:b,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:g,data:s,style:y,sourceX:w,sourceY:N,targetX:S,targetY:_,sourcePosition:k,targetPosition:P,sourceHandleId:T,targetHandleId:z,markerStart:Ne,markerEnd:te,pathOptions:V,interactionWidth:Y}),D&&H.createElement(H.Fragment,null,(D==="source"||D===!0)&&H.createElement(m5,{position:k,centerX:w,centerY:N,radius:L,onMouseDown:kn,onMouseEnter:an,onMouseOut:Kr,type:"source"}),(D==="target"||D===!0)&&H.createElement(m5,{position:P,centerX:S,centerY:_,radius:L,onMouseDown:Tt,onMouseEnter:an,onMouseOut:Kr,type:"target"})))};return t.displayName="EdgeWrapper",p.memo(t)};function cWe(e){const t={default:gd(e.default||P0),straight:gd(e.bezier||BT),step:gd(e.step||FT),smoothstep:gd(e.step||oj),simplebezier:gd(e.simplebezier||LT)},n={},r=Object.keys(e).filter(a=>!["default","bezier"].includes(a)).reduce((a,s)=>(a[s]=gd(e[s]||P0),a),n);return{...t,...r}}function p5(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,a=((n==null?void 0:n.y)||0)+t.y,s=(n==null?void 0:n.width)||t.width,i=(n==null?void 0:n.height)||t.height;switch(e){case Re.Top:return{x:r+s/2,y:a};case Re.Right:return{x:r+s,y:a+i/2};case Re.Bottom:return{x:r+s/2,y:a+i};case Re.Left:return{x:r,y:a+i/2}}}function g5(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const uWe=(e,t,n,r,a,s)=>{const i=p5(n,e,t),l=p5(s,r,a);return{sourceX:i.x,sourceY:i.y,targetX:l.x,targetY:l.y}};function dWe({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:a,targetHeight:s,width:i,height:l,transform:c}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+a),y2:Math.max(e.y+r,t.y+s)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const d=yg({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:i/c[2],height:l/c[2]}),f=Math.max(0,Math.min(d.x2,u.x2)-Math.max(d.x,u.x)),h=Math.max(0,Math.min(d.y2,u.y2)-Math.max(d.y,u.y));return Math.ceil(f*h)>0}function v5(e){var r,a,s,i,l;const t=((r=e==null?void 0:e[yn])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)<"u"&&typeof((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)<"u";return[{x:((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const fWe=[{level:0,isMaxLevel:!0,edges:[]}];function hWe(e,t,n=!1){let r=-1;const a=e.reduce((i,l)=>{var d,f;const c=Za(l.zIndex);let u=c?l.zIndex:0;if(n){const h=t.get(l.target),m=t.get(l.source),v=l.selected||(h==null?void 0:h.selected)||(m==null?void 0:m.selected),g=Math.max(((d=m==null?void 0:m[yn])==null?void 0:d.z)||0,((f=h==null?void 0:h[yn])==null?void 0:f.z)||0,1e3);u=(c?l.zIndex:0)+(v?g:0)}return i[u]?i[u].push(l):i[u]=[l],r=u>r?u:r,i},{}),s=Object.entries(a).map(([i,l])=>{const c=+i;return{edges:l,level:c,isMaxLevel:c===r}});return s.length===0?fWe:s}function mWe(e,t,n){const r=Yt(p.useCallback(a=>e?a.edges.filter(s=>{const i=t.get(s.source),l=t.get(s.target);return(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&dWe({sourcePos:i.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:i.width,sourceHeight:i.height,targetWidth:l.width,targetHeight:l.height,width:a.width,height:a.height,transform:a.transform})}):a.edges,[e,t]));return hWe(r,t,n)}const pWe=({color:e="none",strokeWidth:t=1})=>H.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),gWe=({color:e="none",strokeWidth:t=1})=>H.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),y5={[oh.Arrow]:pWe,[oh.ArrowClosed]:gWe};function vWe(e){const t=Wn();return p.useMemo(()=>{var a,s;return Object.prototype.hasOwnProperty.call(y5,e)?y5[e]:((s=(a=t.getState()).onError)==null||s.call(a,"009",zi.error009(e)),null)},[e])}const yWe=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const c=vWe(t);return c?H.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0"},H.createElement(c,{color:n,strokeWidth:i})):null},xWe=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((a,s)=>
951([s.markerStart,s.markerEnd].forEach(i=>{if(i&&typeof i=="object"){const l=AE(i,t);r.includes(l)||(a.push({id:l,color:i.color||e,...i}),r.push(l))}}),a),[]).sort((a,s)=>a.id.localeCompare(s.id))},SX=({defaultColor:e,rfId:t})=>{const n=Yt(p.useCallback(xWe({defaultColor:e,rfId:t}),[e,t]),(r,a)=>!(r.length!==a.length||r.some((s,i)=>s.id!==a[i].id)));return H.createElement("defs",null,n.map(r=>H.createElement(yWe,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};SX.displayName="MarkerDefinitions";var bWe=p.memo(SX);const wWe=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),NX=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:a,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:g,children:y,disableKeyboardA11y:x})=>{const{edgesFocusable:b,edgesUpdatable:w,elementsSelectable:N,width:S,height:_,connectionMode:k,nodeInternals:P,onError:O}=Yt(wWe,nr),$=mWe(t,P,n);return S?H.createElement(H.Fragment,null,$.map(({level:T,edges:z,isMaxLevel:U})=>H.createElement("svg",{key:T,style:{zIndex:T},width:S,height:_,className:"react-flow__edges react-flow__container"},U&&H.createElement(bWe,{defaultColor:e,rfId:r}),H.createElement("g",null,z.map(E=>{const[q,W,L]=v5(P.get(E.source)),[M,B,I]=v5(P.get(E.target));if(!L||!I)return null;let R=E.type||"default";a[R]||(O==null||O("011",zi.error011(R)),R="default");const F=a[R]||a.default,j=k===Au.Strict?B.target:(B.target??[]).concat(B.source??[]),C=g5(W.source,E.sourceHandle),A=g5(j,E.targetHandle),D=(C==null?void 0:C.position)||Re.Bottom,V=(A==null?void 0:A.position)||Re.Top,Y=!!(E.focusable||b&&typeof E.focusable>"u"),G=E.reconnectable||E.updatable,K=typeof h<"u"&&(G||w&&typeof G>"u");if(!C||!A)return O==null||O("008",zi.error008(C,E)),null;const{sourceX:Z,sourceY:J,targetX:ce,targetY:ue}=uWe(q,C,D,M,A,V);return H.createElement(F,{key:E.id,id:E.id,className:pr([E.className,s]),type:R,data:E.data,selected:!!E.selected,animated:!!E.animated,hidden:!!E.hidden,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,style:E.style,source:E.source,target:E.target,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerEnd:E.markerEnd,markerStart:E.markerStart,sourceX:Z,sourceY:J,targetX:ce,targetY:ue,sourcePosition:D,targetPosition:V,elementsSelectable:N,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:v,reconnectRadius:g,rfId:r,ariaLabel:E.ariaLabel,isFocusable:Y,isReconnectable:K,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth,disableKeyboardA11y:x})})))),y):null};NX.displayName="EdgeRenderer";var jWe=p.memo(NX);const SWe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function NWe({children:e}){const t=Yt(SWe);return H.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function _We(e){const t=ij(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const CWe={[Re.Left]:Re.Right,[Re.Right]:Re.Left,[Re.Top]:Re.Bottom,[Re.Bottom]:Re.Top},_X=({nodeId:e,handleType:t,style:n,type:r=yl.Bezier,CustomComponent:a,connectionStatus:s})=>{var _,k,P;const{fromNode:i,handleId:l,toX:c,toY:u,connectionMode:d}=Yt(p.useCallback(O=>({fromNode:O.nodeInternals.get(e),handleId:O.connectionHandleId,toX:(O.connectionPosition.x-O.transform[0])/O.transform[2],toY:(O.connectionPosition.y-O.transform[1])/O.transform[2],connectionMode:O.connectionMode}),[e]),nr),f=(_=i==null?void 0:i[yn])==null?void 0:_.handleBounds;let h=f==null?void 0:f[t];
951if(d===Au.Loose&&(h=h||(f==null?void 0:f[t==="source"?"target":"source"])),!i||!h)return null;const m=l?h.find(O=>O.id===l):h[0],v=m?m.x+m.width/2:(i.width??0)/2,g=m?m.y+m.height/2:i.height??0,y=(((k=i.positionAbsolute)==null?void 0:k.x)??0)+v,x=(((P=i.positionAbsolute)==null?void 0:P.y)??0)+g,b=m==null?void 0:m.position,w=b?CWe[b]:null;if(!b||!w)return null;if(a)return H.createElement(a,{connectionLineType:r,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:y,fromY:x,toX:c,toY:u,fromPosition:b,toPosition:w,connectionStatus:s});let N="";const S={sourceX:y,sourceY:x,sourcePosition:b,targetX:c,targetY:u,targetPosition:w};return r===yl.Bezier?[N]=GK(S):r===yl.Step?[N]=EE({...S,borderRadius:0}):r===yl.SmoothStep?[N]=EE(S):r===yl.SimpleBezier?[N]=HK(S):N=`M${y},${x} ${c},${u}`,H.createElement("path",{d:N,fill:"none",className:"react-flow__connection-path",style:n})};_X.displayName="ConnectionLine";const kWe=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function EWe({containerStyle:e,style:t,type:n,component:r}){const{nodeId:a,handleType:s,nodesConnectable:i,width:l,height:c,connectionStatus:u}=Yt(kWe,nr);return!(a&&s&&l&&i)?null:H.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},H.createElement("g",{className:pr(["react-flow__connection",u])},H.createElement(_X,{nodeId:a,handleType:s,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function x5(e,t){return p.useRef(null),Wn(),p.useMemo(()=>t(e),[e])}const CX=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:a,onInit:s,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,onSelectionContextMenu:v,onSelectionStart:g,onSelectionEnd:y,connectionLineType:x,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:N,selectionKeyCode:S,selectionOnDrag:_,selectionMode:k,multiSelectionKeyCode:P,panActivationKeyCode:O,zoomActivationKeyCode:$,deleteKeyCode:T,onlyRenderVisibleElements:z,elementsSelectable:U,selectNodesOnDrag:E,defaultViewport:q,translateExtent:W,minZoom:L,maxZoom:M,preventScrolling:B,defaultMarkerColor:I,zoomOnScroll:R,zoomOnPinch:F,panOnScroll:j,panOnScrollSpeed:C,panOnScrollMode:A,zoomOnDoubleClick:D,panOnDrag:V,onPaneClick:Y,onPaneMouseEnter:G,onPaneMouseMove:K,onPaneMouseLeave:Z,onPaneScroll:J,onPaneContextMenu:ce,onEdgeContextMenu:ue,onEdgeMouseEnter:be,onEdgeMouseMove:Ne,onEdgeMouseLeave:te,onReconnect:re,onReconnectStart:pe,onReconnectEnd:Ee,reconnectRadius:Fe,noDragClassName:Be,noWheelClassName:st,noPanClassName:Pt,elevateEdgesOnSelect:kn,disableKeyboardA11y:Tt,nodeOrigin:an,nodeExtent:Kr,rfId:Tr})=>{const me=x5(e,nWe),Se=x5(t,cWe);return _We(s),H.createElement(eWe,{onPaneClick:Y,onPaneMouseEnter:G,onPaneMouseMove:K,onPaneMouseLeave:Z,onPaneContextMenu:ce,onPaneScroll:J,deleteKeyCode:T,selectionKeyCode:S,selectionOnDrag:_,selectionMode:k,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:P,panActivationKeyCode:O,zoomActivationKeyCode:$,elementsSelectable:U,onMove:n,onMoveStart:r,onMoveEnd:a,zoomOnScroll:R,zoomOnPinch:F,zoomOnDoubleClick:D,panOnScroll:j,panOnScrollSpeed:C,panOnScrollMode:A,panOnDrag:V,defaultViewport:q,translateExtent:W,minZoom:L,maxZoom:M,onSelectionContextMenu:v,preventScrolling:B,noDragClassName:Be,noWheelClassName:st,noPanClassName:Pt,disableKeyboardA11y:Tt},H.createElement(NWe,null,H.createElement(jWe,{edgeTypes:Se,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:z,onEdgeContextMenu:ue,onEdgeMouseEnter:be,onEdgeMouseMove:Ne,onEdgeMouseLeave:te,onReconnect:re,onReconnectStart:pe,onReconnectEnd:Ee,reconnectRadius:Fe,defaultMarkerColor:I,noPanClassName:Pt,elevateEdgesOnSelect:!!kn,disableKeyboardA11y:Tt,rfId:Tr},H.createElement(EWe,{style:b,type:x,component:w,containerStyle:N})),H.createElement("div",{className:"react-flow__edgelabel-renderer"}),H.createElement(oWe,{nodeTypes:me,onNodeClick:i,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:m,selectNodesOnDrag:E,onlyRenderVisibleElements:z,noPanClassName:Pt,noDragClassName:Be,disableKeyboardA11y:Tt,nodeOrigin:an,nodeExtent:Kr,rfId:Tr})))};CX.displayName="GraphView";var AWe=p.memo(CX);const ME=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],al={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ME,nodeExtent:ME,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Au.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGri
951d:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:a7e,isValidConnection:void 0},PWe=()=>qze((e,t)=>({...al,setNodes:n=>{const{nodeInternals:r,nodeOrigin:a,elevateNodesOnSelect:s}=t();e({nodeInternals:DN(n,r,a,s)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(a=>({...r,...a}))})},setDefaultNodesAndEdges:(n,r)=>{const a=typeof n<"u",s=typeof r<"u",i=a?DN(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:s?r:[],hasDefaultNodes:a,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:a,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:l,domNode:c,nodeOrigin:u}=t(),d=c==null?void 0:c.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(f.transform),m=n.reduce((g,y)=>{const x=a.get(y.id);if(x!=null&&x.hidden)a.set(x.id,{...x,[yn]:{...x[yn],handleBounds:void 0}});else if(x){const b=DT(y.nodeElement);!!(b.width&&b.height&&(x.width!==b.width||x.height!==b.height||y.forceUpdate))&&(a.set(x.id,{...x,[yn]:{...x[yn],handleBounds:{source:f5(".source",y.nodeElement,h,u),target:f5(".target",y.nodeElement,h,u)}},...b}),g.push({id:x.id,type:"dimensions",dimensions:b}))}return g},[]);fX(a,u);const v=i||s&&!i&&hX(t,{initial:!0,...l});e({nodeInternals:new Map(a),fitViewOnInitDone:v}),(m==null?void 0:m.length)>0&&(r==null||r(m))},updateNodePositions:(n,r=!0,a=!1)=>{const{triggerNodeChanges:s}=t(),i=n.map(l=>{const c={id:l.id,type:"position",dragging:a};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});s(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:a,hasDefaultNodes:s,nodeOrigin:i,getNodes:l,elevateNodesOnSelect:c}=t();if(n!=null&&n.length){if(s){const u=pX(n,l()),d=DN(u,a,i,c);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:a,getNodes:s}=t();let i,l=null;r?i=n.map(c=>hl(c,!0)):(i=Ld(s(),n),l=Ld(a,[])),Uy({changedNodes:i,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:a,getNodes:s}=t();let i,l=null;r?i=n.map(c=>hl(c,!0)):(i=Ld(a,n),l=Ld(s(),[])),Uy({changedNodes:l,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:a,getNodes:s}=t(),i=n||s(),l=r||a,c=i.map(d=>(d.selected=!1,hl(d.id,!1))),u=l.map(d=>hl(d.id,!1));Uy({changedNodes:c,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:a}=t();r==null||r.scaleExtent([n,a]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:a}=t();r==null||r.scaleExtent([a,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),s=r().filter(l=>l.selected).map(l=>hl(l.id,!1)),i=n.filter(l=>l.selected).map(l=>hl(l.id,!1));Uy({changedNodes:s,changedEdges:i,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(a=>{a.positionAbsolute=RT(a.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:a,height:s,d3Zoom:i,d3Selection:l,translateExtent:c}=t();if(!i||!l||!n.x&&!n.y)return!1;const u=Ci.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[a,s]],f=i==null?void 0:i.constrain()(u,d,c);return i.transform(l,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:al.connectionNodeId,connectionHandleId:al.connectionHandleId,connectionHandleType:al.connectionHandleType,connectionStatus:al.connectionStatus,connectionStartHandle:al.connectionStartHandle,connectionEndHandle:al.connectionEndHandle}),reset:()=>e({...al})}),Object.is),qT=({children:e})=>{const t=p.useRef(null);return t.current||(t.current=PWe()),H.createElement(J9e,{value:t.current},e)};qT.displayName="ReactFlowProvider";const kX=({children:e})=>p.useContext(aj)?H.createElement(H.Fragment,null,e):H.createElement(qT,null,e);kX.displayName="ReactFlowWrapper";const TWe={input:oX,default:TE,output:iX,group:VT},OWe={default:P0,straight:BT,step:FT,smoothstep:oj,simplebezier:LT},MWe=[0,0],IWe=[15,15],$We={x:0,y:0,zoom:1},DWe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},EX=p.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:s=TWe,edgeTypes:i=OWe,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:x,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:N,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:O,onNodesDelete:$,onEdgesDelete:T,onSelectionChange:z,onSelectionDragStart:U,onSelectionDrag:E,onSelectionDragStop:q,onSelectionContextMenu:W,onSelectionStart:L,onSelectionEnd:M,connectionMode:B=Au.Strict,connectionLineType:I=yl.Bezier,connectionLineStyle:R,connectionLineComponent:F,connectionLineContainerStyle:j,deleteKeyCode:C="Backspace",selectionKeyCode:A="Shift",selectionOnDrag:D=!1,selectionMode:V=xg.Full,panActivationKeyCode:Y="Space",multiSelectionKeyCode:G=A0()?"Meta":"Control",zoomActivationKeyCode:K=A0()?"Meta":"Control",snapToGri
951d:Z=!1,snapGrid:J=IWe,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ue=!0,nodesDraggable:be,nodesConnectable:Ne,nodesFocusable:te,nodeOrigin:re=MWe,edgesFocusable:pe,edgesUpdatable:Ee,elementsSelectable:Fe,defaultViewport:Be=$We,minZoom:st=.5,maxZoom:Pt=2,translateExtent:kn=ME,preventScrolling:Tt=!0,nodeExtent:an,defaultMarkerColor:Kr="#b1b1b7",zoomOnScroll:Tr=!0,zoomOnPinch:me=!0,panOnScroll:Se=!1,panOnScrollSpeed:it=.5,panOnScrollMode:Lt=Uc.Free,zoomOnDoubleClick:In=!0,panOnDrag:Or=!0,onPaneClick:bt,onPaneMouseEnter:qn,onPaneMouseMove:is,onPaneMouseLeave:Vs,onPaneScroll:Xr,onPaneContextMenu:pc,children:Ws,onEdgeContextMenu:Hn,onEdgeDoubleClick:ma,onEdgeMouseEnter:He,onEdgeMouseMove:mt,onEdgeMouseLeave:Ot,onEdgeUpdate:Mr,onEdgeUpdateStart:gr,onEdgeUpdateEnd:Ir,onReconnect:vo,onReconnectStart:En,onReconnectEnd:Ba,reconnectRadius:Ji=10,edgeUpdaterRadius:Yu=10,onNodesChange:cj,onEdgesChange:fv,noDragClassName:Ku="nodrag",noWheelClassName:uj="nowheel",noPanClassName:pa="nopan",fitView:dj=!1,fitViewOptions:ls,connectOnClick:Xu=!0,attributionPosition:fj,proOptions:hv,defaultEdgeOptions:Ju,elevateNodesOnSelect:hj=!0,elevateEdgesOnSelect:yo=!1,disableKeyboardA11y:mv=!1,autoPanOnConnect:gc=!0,autoPanOnNodeDrag:pv=!0,connectionRadius:mj=20,isValidConnection:gv,onError:Qu,style:pj,id:qs,nodeDragThreshold:gj,...vc},vv)=>{const Dh=qs||"1";return H.createElement("div",{...vc,style:{...pj,...DWe},ref:vv,className:pr(["react-flow",a]),"data-testid":"rf__wrapper",id:qs},H.createElement(kX,null,H.createElement(AWe,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:w,onNodeMouseLeave:N,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:i,connectionLineType:I,connectionLineStyle:R,connectionLineComponent:F,connectionLineContainerStyle:j,selectionKeyCode:A,selectionOnDrag:D,selectionMode:V,deleteKeyCode:C,multiSelectionKeyCode:G,panActivationKeyCode:Y,zoomActivationKeyCode:K,onlyRenderVisibleElements:ce,selectNodesOnDrag:ue,defaultViewport:Be,translateExtent:kn,minZoom:st,maxZoom:Pt,preventScrolling:Tt,zoomOnScroll:Tr,zoomOnPinch:me,zoomOnDoubleClick:In,panOnScroll:Se,panOnScrollSpeed:it,panOnScrollMode:Lt,panOnDrag:Or,onPaneClick:bt,onPaneMouseEnter:qn,onPaneMouseMove:is,onPaneMouseLeave:Vs,onPaneScroll:Xr,onPaneContextMenu:pc,onSelectionContextMenu:W,onSelectionStart:L,onSelectionEnd:M,onEdgeContextMenu:Hn,onEdgeDoubleClick:ma,onEdgeMouseEnter:He,onEdgeMouseMove:mt,onEdgeMouseLeave:Ot,onReconnect:vo??Mr,onReconnectStart:En??gr,onReconnectEnd:Ba??Ir,reconnectRadius:Ji??Yu,defaultMarkerColor:Kr,noDragClassName:Ku,noWheelClassName:uj,noPanClassName:pa,elevateEdgesOnSelect:yo,rfId:Dh,disableKeyboardA11y:mv,nodeOrigin:re,nodeExtent:an}),H.createElement(C7e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:x,nodesDraggable:be,nodesConnectable:Ne,nodesFocusable:te,edgesFocusable:pe,edgesUpdatable:Ee,elementsSelectable:Fe,elevateNodesOnSelect:hj,minZoom:st,maxZoom:Pt,nodeExtent:an,onNodesChange:cj,onEdgesChange:fv,snapToGrid:Z,snapGrid:J,connectionMode:B,translateExtent:kn,connectOnClick:Xu,defaultEdgeOptions:Ju,fitView:dj,fitViewOptions:ls,onNodesDelete:$,onEdgesDelete:T,onNodeDragStart:k,onNodeDrag:P,onNodeDragStop:O,onSelectionDrag:E,onSelectionDragStart:U,onSelectionDragStop:q,noPanClassName:pa,nodeOrigin:re,rfId:Dh,autoPanOnConnect:gc,autoPanOnNodeDrag:pv,onError:Qu,connectionRadius:mj,isValidConnection:gv,nodeDragThreshold:gj}),H.createElement(N7e,{onSelectionChange:z}),Ws,H.createElement(Z9e,{proOptions:hv,position:fj}),H.createElement(T7e,{rfId:Dh,disableKeyboardA11y:mv})))});EX.displayName="ReactFlow";function AX(e){return t=>{const[n,r]=p.useState(t),a=p.useCallback(s=>r(i=>e(s,i)),[]);return[n,r,a]}}const RWe=AX(pX),LWe=AX(q7e),PX=({id:e,x:t,y:n,width:r,height:a,style:s,color:i,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,onClick:h,selected:m})=>{const{background:v,backgroundColor:g}=s||{},y=i||v||g;return H.createElement("rect",{className:pr(["react-flow__minimap-node",{selected:m},u]),x:t,y:n,rx:d,ry:d,width:r,height:a,fill:y,stroke:l,strokeWidth:c,shapeRendering:f,onClick:h?x=>h(x,e):void 0})};PX.displayName="MiniMapNode";var FWe=p.memo(PX);const BWe=e=>e.nodeOrigin,zWe=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),BN=e=>e instanceof Function?e:()=>e;
vendor: 5,848 bytes, lines 951-952
951function UWe({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a=2,nodeComponent:s=FWe,onClick:i}){const l=Yt(zWe,nr),c=Yt(BWe),u=BN(t),d=BN(e),f=BN(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return H.createElement(H.Fragment,null,l.map(m=>{const{x:v,y:g}=ru(m,c).positionAbsolute;return H.createElement(s,{key:m.id,x:v,y:g,width:m.width,height:m.height,style:m.style,selected:m.selected,className:f(m),color:u(m),borderRadius:r,strokeColor:d(m),strokeWidth:a,shapeRendering:h,onClick:i,id:m.id})}))}var VWe=p.memo(UWe);const WWe=200,qWe=150,HWe=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?n7e(sj(t,e.nodeOrigin),n):n,rfId:e.rfId}},GWe="react-flow__minimap-desc";function TX({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:a="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:d=1,position:f="bottom-right",onClick:h,onNodeClick:m,pannable:v=!1,zoomable:g=!1,ariaLabel:y="React Flow mini map",inversePan:x=!1,zoomStep:b=10,offsetScale:w=5}){const N=Wn(),S=p.useRef(null),{boundingRect:_,viewBB:k,rfId:P}=Yt(HWe,nr),O=(e==null?void 0:e.width)??WWe,$=(e==null?void 0:e.height)??qWe,T=_.width/O,z=_.height/$,U=Math.max(T,z),E=U*O,q=U*$,W=w*U,L=_.x-(E-_.width)/2-W,M=_.y-(q-_.height)/2-W,B=E+W*2,I=q+W*2,R=`${GWe}-${P}`,F=p.useRef(0);F.current=U,p.useEffect(()=>{if(S.current){const A=Ka(S.current),D=G=>{const{transform:K,d3Selection:Z,d3Zoom:J}=N.getState();if(G.sourceEvent.type!=="wheel"||!Z||!J)return;const ce=-G.sourceEvent.deltaY*(G.sourceEvent.deltaMode===1?.05:G.sourceEvent.deltaMode?1:.002)*b,ue=K[2]*Math.pow(2,ce);J.scaleTo(Z,ue)},V=G=>{const{transform:K,d3Selection:Z,d3Zoom:J,translateExtent:ce,width:ue,height:be}=N.getState();if(G.sourceEvent.type!=="mousemove"||!Z||!J)return;const Ne=F.current*Math.max(1,K[2])*(x?-1:1),te={x:K[0]-G.sourceEvent.movementX*Ne,y:K[1]-G.sourceEvent.movementY*Ne},re=[[0,0],[ue,be]],pe=Ci.translate(te.x,te.y).scale(K[2]),Ee=J.constrain()(pe,re,ce);J.transform(Z,Ee)},Y=DK().on("zoom",v?V:null).on("zoom.wheel",g?D:null);return A.call(Y),()=>{A.on("zoom",null)}}},[v,g,x,b]);const j=h?A=>{const D=Mo(A);h(A,{x:D[0],y:D[1]})}:void 0,C=m?(A,D)=>{const V=N.getState().nodeInternals.get(D);m(A,V)}:void 0;return H.createElement($T,{position:f,style:e,className:pr(["react-flow__minimap",t]),"data-testid":"rf__minimap"},H.createElement("svg",{width:O,height:$,viewBox:`${L} ${M} ${B} ${I}`,role:"img","aria-labelledby":R,ref:S,onClick:j},y&&H.createElement("title",{id:R},y),H.createElement(VWe,{onClick:C,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:a,nodeStrokeWidth:i,nodeComponent:l}),H.createElement("path",{className:"react-flow__minimap-mask",d:`M${L-W},${M-W}h${B+W*2}v${I+W*2}h${-B-W*2}z
952        M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fill:c,fillRule:"evenodd",stroke:u,strokeWidth:d,pointerEvents:"none"})))}TX.displayName="MiniMap";var YWe=p.memo(TX);function KWe(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},H.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function XWe(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},H.createElement("path",{d:"M0 0h32v4.2H0z"}))}function JWe(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},H.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function QWe(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},H.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function ZWe(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},H.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Rm=({children:e,className:t,...n})=>H.createElement("button",{type:"button",className:pr(["react-flow__controls-button",t]),...n},e);Rm.displayName="ControlButton";const eqe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),OX=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:s,onZoomOut:i,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left"})=>{const h=Wn(),[m,v]=p.useState(!1),{isInteractive:g,minZoomReached:y,maxZoomReached:x}=Yt(eqe,nr),{zoomIn:b,zoomOut:w,fitView:N}=ij();if(p.useEffect(()=>
952{v(!0)},[]),!m)return null;const S=()=>{b(),s==null||s()},_=()=>{w(),i==null||i()},k=()=>{N(a),l==null||l()},P=()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)};return H.createElement($T,{className:pr(["react-flow__controls",u]),position:f,style:e,"data-testid":"rf__controls"},t&&H.createElement(H.Fragment,null,H.createElement(Rm,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:x},H.createElement(KWe,null)),H.createElement(Rm,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y},H.createElement(XWe,null))),n&&H.createElement(Rm,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view"},H.createElement(JWe,null)),r&&H.createElement(Rm,{className:"react-flow__controls-interactive",onClick:P,title:"toggle interactivity","aria-label":"toggle interactivity"},g?H.createElement(ZWe,null):H.createElement(QWe,null)),d)};OX.displayName="Controls";var tqe=p.memo(OX),oo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(oo||(oo={}));function nqe({color:e,dimensions:t,lineWidth:n}){return H.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function rqe({color:e,radius:t}){return H.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const aqe={[oo.Dots]:"#91919a",[oo.Lines]:"#eee",[oo.Cross]:"#e2e2e2"},oqe={[oo.Dots]:1,[oo.Lines]:1,[oo.Cross]:6},sqe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function MX({id:e,variant:t=oo.Dots,gap:n=20,size:r,lineWidth:a=1,offset:s=2,color:i,style:l,className:c}){const u=p.useRef(null),{transform:d,patternId:f}=Yt(sqe,nr),h=i||aqe[t],m=r||oqe[t],v=t===oo.Dots,g=t===oo.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*d[2]||1,y[1]*d[2]||1],b=m*d[2],w=g?[b,b]:x,N=v?[b/s,b/s]:[w[0]/s,w[1]/s];return H.createElement("svg",{className:pr(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},H.createElement("pattern",{id:f+e,x:d[0]%x[0],y:d[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`},v?H.createElement(rqe,{color:h,radius:b/s}):H.createElement(nqe,{dimensions:w,color:h,lineWidth:a})),H.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}MX.displayName="Background";var iqe=p.memo(MX);const T0={event:{bg:"bg-emerald-500/10",border:"border-emerald-500",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400",group:"Trigger",icon:W2},now:{bg:"bg-emerald-500/10",border:"border-emerald-500",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400",group:"Trigger",icon:Gl},"inbound-call":{bg:"bg-emerald-500/10",border:"border-emerald-500",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400",group:"Trigger",icon:ta},"internet-call":{bg:"bg-emerald-500/10",border:"border-emerald-500",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400",group:"Trigger",icon:GB},split:{bg:"bg-amber-500/10",border:"border-amber-500",iconBg:"bg-amber-500/20",iconColor:"text-amber-400",group:"Operator",icon:Dre},delay:{bg:"bg-amber-500/10",border:"border-amber-500",iconBg:"bg-amber-500/20",iconColor:"text-amber-400",group:"Operator",icon:aw},condition:{bg:"bg-amber-500/10",border:"border-amber-500",iconBg:"bg-amber-500/20",iconColor:"text-amber-400",group:"Condition",icon:Sre},webhook:{bg:"bg-teal-500/10",border:"border-teal-500",iconBg:"bg-teal-500/20",iconColor:"text-teal-400",group:"Action",icon:Z2},call:{bg:"bg-teal-500/10",border:"border-teal-500",iconBg:"bg-teal-500/20",iconColor:"text-teal-400",group:"Action",icon:Un},"connect-agent":{bg:"bg-teal-500/10",border:"border-teal-500",iconBg:"bg-teal-500/20",iconColor:"text-teal-400",group:"Action",icon:wf},sms:{bg:"bg-teal-500/10",border:"border-teal-500",iconBg:"bg-teal-500/20",iconColor:"text-teal-400",group:"Action",icon:K2},email:{bg:"bg-teal-500/10",border:"border-teal-500",iconBg:"bg-teal-500/20",iconColor:"text-teal-400",group:"Action",icon:hh}
952,"update-contact":{bg:"bg-emerald-500/10",border:"border-emerald-500",iconBg:"bg-emerald-500/20",iconColor:"text-emerald-400",group:"Action",icon:Q2}};function IX(e){return T0[e]}function zN(e){return e.map(t=>{var n;return((n=t.data)==null?void 0:n.kind)==="inbound-call"&&t.data.label==="Inbound Call"?{...t,data:{...t.data,label:"Call Ended"}}:t})}const b5="!h-3.5 !w-3.5 !border-2 !border-background !bg-muted-foreground hover:!bg-emerald-500 hover:!scale-125 transition-all !cursor-crosshair";function lqe({kind:e,label:t,showInput:n=!0,showOutput:r=!0,dual:a=!1}){const s=T0[e],i=s.icon;return o.jsxs("div",{className:`group relative min-w-[180px] rounded-xl border-2 ${s.border} ${s.bg} px-3 py-2.5 shadow-sm backdrop-blur-sm`,children:[n&&o.jsx(El,{type:"target",position:Re.Left,className:b5,style:{left:-7},isConnectable:!0}),o.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s.group}),o.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[o.jsx("div",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md ${s.iconBg}`,children:o.jsx(i,{className:`h-3.5 w-3.5 ${s.iconColor}`})}),o.jsx("div",{className:"text-sm font-semibold text-foreground",children:t})]}),a?o.jsxs("div",{className:"mt-3 space-y-1.5",children:[o.jsxs("div",{className:"relative flex items-center justify-end pr-2 text-[10px] font-semibold text-emerald-400",children:[o.jsx("span",{children:"Yes"}),o.jsx(El,{id:"yes",type:"source",position:Re.Right,className:"!h-3.5 !w-3.5 !border-2 !border-background !bg-emerald-500 hover:!scale-125 transition-all !cursor-crosshair",style:{right:-7,top:"50%",position:"absolute"},isConnectable:!0})]}),o.jsxs("div",{className:"relative flex items-center justify-end pr-2 text-[10px] font-semibold text-rose-400",children:[o.jsx("span",{children:"No"}),o.jsx(El,{id:"no",type:"source",position:Re.Right,className:"!h-3.5 !w-3.5 !border-2 !border-background !bg-rose-500 hover:!scale-125 transition-all !cursor-crosshair",style:{right:-7,top:"50%",position:"absolute"},isConnectable:!0})]})]}):r&&o.jsx(El,{type:"source",position:Re.Right,className:b5,style:{right:-7},isConnectable:!0})]})}function lj(e={}){const t=({data:n})=>o.jsx(lqe,{kind:n.kind,label:n.label,...e});return p.memo(t)}const cqe=lj({showInput:!1}),uqe=lj(),dqe=lj(),fqe=lj({dual:!0}),hqe={trigger:cqe,action:uqe,operator:dqe,condition:fqe};function mqe(e){return e==="condition"?"condition":T0[e].group==="Trigger"?"trigger":T0[e].group==="Operator"?"operator":"action"}const pqe=[{title:"Triggers",items:[{kind:"now",label:"Now"},{kind:"inbound-call",label:"Call Ended"}]},{title:"Operators",items:[{kind:"split",label:"Split"},{kind:"delay",label:"Delay"},{kind:"condition",label:"Condition"}]},{title:"Actions",items:[{kind:"webhook",label:"Webhook"},{kind:"call",label:"Call Fixed Number"},{kind:"connect-agent",label:"Call Back Contact"},{kind:"sms",label:"SMS"},{kind:"email",label:"Email"},{kind:"update-contact",label:"Update Contact"}]}];function gqe({node:e,agents:t,phoneNumbers:n,emailIntegrations:r,onClose:a,onSave:s,onDelete:i}){const[l,c]=p.useState(""),[u,d]=p.useState({});if(p.useEffect(()=>{e&&(c(e.data.label),d(e.data.config??{}))},[e]),!e)return null;const f=IX(e.data.kind),h=f.icon,m=(g,y)=>d(x=>({...x,[g]:y})),v=()=>{switch(e.data.kind){case"sms":return o.jsxs(o.Fragment,{children:[o.jsxs(An,{label:"To number (optional)",children:[o.jsx(ve,{value:u.to??"",onChange:g=>m("to",g.target.value),placeholder:"+1XXXXXXXXXX"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Leave blank to text the contact from the call. Fill it to always text this number instead."})]}),o.jsx(An,{label:"Message",children:o.jsx(Zl,{rows:4,value:u.message??"",onChange:g=>m("message",g.target.value),placeholder:"Hi {{contact_name}}, thanks for your time today!"})}),o.jsxs(An,{label:"From number",children:[o.jsxs(nt,{value:u.from&&n.some(g=>g.number===u.from)?u.from:"__custom__",onValueChange:g=>m("from",g==="__custom__"?u.from&&!n.some(y=>y.number===u.from)?u.from:"":g),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[n.map(g=>o.jsx(we,{value:g.number,children:g.number},g.id)),o.jsx(we,{value:"__custom__",children:"Custom number…"})]})]}),(!u.from||!n.some(g=>g.number===u.from))&&o.jsx(ve,{className:"mt-2",value:u.from??"",onChange:g=>m("from",g.target.value),placeholder:"+1XXXXXXXXXX"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Your own purchased numbers send through the platform automatically. A custom number must belong to your connected SMS provider account."})]})]});case"email":return o.jsxs(o.Fragment,{children:[o.jsx(vqe,{icon:"✉️",text:"Requires an email integration",hint:"Add a Brevo, SendGrid or SMTP integration in"}),o.jsxs(An,{label:"Send via",children:[o.jsxs(nt,{value:u.integration_id||"__default__",onValueChange:g=>m("integration_id",g==="__default__"?"":g),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:r.length?"Select an integration":"No email integrations yet"})}),o.jsxs(et,{children:[o.jsx(we,{value:"__default__",children:"Default (first active integration)"}),r.map(g=>o.jsx(we,{value:g.id,children:g.name},g.id))]})]}),!r.length&&o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"No active email integrations foun
952d. Add one in Integrations first."})]}),o.jsx(An,{label:"Subject",children:o.jsx(ve,{value:u.subject??"",onChange:g=>m("subject",g.target.value),placeholder:"Follow-up from your call"})}),o.jsx(An,{label:"Body",children:o.jsx(Zl,{rows:5,value:u.body??"",onChange:g=>m("body",g.target.value),placeholder:`Hi {{contact_name}},
953
954Thank you for speaking with us today...`})})]});case"condition":return o.jsxs(o.Fragment,{children:[o.jsx(An,{label:"Field",children:o.jsx(ve,{value:u.field??"",onChange:g=>m("field",g.target.value),placeholder:"call_outcome"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Call fields: ",o.jsx("code",{children:"status"}),", ",o.jsx("code",{children:"qualified"}),", ",o.jsx("code",{children:"call_outcome"})," (final outcome), ",o.jsx("code",{children:"call_events"}),' (all events raised, use "contains").']}),o.jsx(An,{label:"Operator",children:o.jsxs("select",{value:u.op??"equals",onChange:g=>m("op",g.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-2 text-sm",children:[o.jsx("option",{value:"equals",children:"equals"}),o.jsx("option",{value:"not_equals",children:"not equals"}),o.jsx("option",{value:"contains",children:"contains"}),o.jsx("option",{value:"gt",children:"greater than"}),o.jsx("option",{value:"lt",children:"less than"})]})}),o.jsx(An,{label:"Value",children:o.jsx(ve,{value:u.value??"",onChange:g=>m("value",g.target.value)})})]});case"delay":return o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsx(An,{label:"Duration",children:o.jsx(ve,{type:"number",value:u.duration??"1",onChange:g=>m("duration",g.target.value)})}),o.jsx(An,{label:"Unit",children:o.jsxs("select",{value:u.unit??"minutes",onChange:g=>m("unit",g.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-2 text-sm",children:[o.jsx("option",{value:"minutes",children:"Minutes"}),o.jsx("option",{value:"hours",children:"Hours"}),o.jsx("option",{value:"days",children:"Days"})]})})]});case"now":return o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs the whole flow as designed when you press ",o.jsx("strong",{children:"Run now"})," in the editor."]});case"connect-agent":return o.jsxs(o.Fragment,{children:[o.jsx(An,{label:"AI Agent",children:o.jsxs(nt,{value:u.agent_id??"",onValueChange:g=>m("agent_id",g),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:t.length?"Select an agent":"No agents yet"})}),o.jsx(et,{children:t.map(g=>o.jsx(we,{value:g.id,children:g.name},g.id))})]})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'Automatically calls back whichever number triggered this flow (the contact/caller), using this agent — no number to type in. Use "Call Fixed Number" instead to notify a different, fixed number (e.g. a manager).'})]});case"call":return o.jsxs(o.Fragment,{children:[o.jsx(An,{label:"AI Agent",children:o.jsxs(nt,{value:u.agent_id??"",onValueChange:g=>m("agent_id",g),children:[o.jsx(Ze,{children:o.jsx(rt,{placeholder:t.length?"Select an agent":"No agents yet"})}),o.jsx(et,{children:t.map(g=>o.jsx(we,{value:g.id,children:g.name},g.id))})]})}),o.jsx(An,{label:"Phone number to call",children:o.jsx(ve,{value:u.to??"",onChange:g=>m("to",g.target.value),placeholder:"+15551234567"})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'Places a real outbound call to this fixed number (not the contact) using this agent — e.g. to notify a manager when the flow runs. Use "Call Back Contact" instead to call the contact back.'})]});case"split":return o.jsx("p",{className:"text-sm text-muted-foreground",children:"No configuration needed. Connect this node to multiple next steps — every connected branch runs when the flow reaches this point."});case"webhook":return o.jsxs(o.Fragment,{children:[o.jsx(An,{label:"URL",children:o.jsx(ve,{value:u.url??"",onChange:g=>m("url",g.target.value),placeholder:"https://..."})}),o.jsx(An,{label:"Method",children:o.jsxs("select",{value:u.method??"POST",onChange:g=>m("method",g.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-2 text-sm",children:[o.jsx("option",{children:"POST"}),o.jsx("option",{children:"GET"}),o.jsx("option",{children:"PUT"}),o.jsx("option",{children:"DELETE"})]})})]});case"update-contact":return o.jsxs(o.Fragment,{children:[o.jsx(An,{label:"Field to update",children:o.jsxs(nt,{value:u.field||"status",onValueChange:g=>m("field",g),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"status",children:"Status"}),o.jsx(we,{value:"name",children:"Name"}),o.jsx(we,{value:"email",children:"Email"})]})]})}),(u.field??"status")==="status"?o.jsx(An,{label:"New value",children:o.jsxs(nt,{value:u.value??"Active",onValueChange:g=>m("value",g),children:[o.jsx(Ze,{children:o.jsx(rt,{})}),o.jsxs(et,{children:[o.jsx(we,{value:"Active",children:"Active"}),o.jsx(we,{value:"Inactive",children:"Inactive"}),o.jsx(we,{value:"Pending",children:"Pending"})]})]})}):o.jsx(An,{label:"New value",children:o.jsx(ve,{value:u.value??"",onChange:g=>m("value",g.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Only applies when the call is linked to a saved contact (matched by phone number)."})]});default:return o.jsx("div",{className:"text-sm text-muted-foreground",children:"No additional configuration."})}};return o.jsxs("div",{className:"fixed inset-0 z-30 flex flex-col border-l border-border bg-card shadow-2xl animate-in slide-in-from-right-5 duration-200 lg:absolute lg:inset-y-0 lg:inset-x-auto lg:right-0 lg:w-[360
954px]",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded-md ${f.iconBg}`,children:o.jsx(h,{className:`h-4 w-4 ${f.iconColor}`})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:f.group}),o.jsx("div",{className:"text-sm font-semibold",children:"Edit node"})]})]}),o.jsx("button",{onClick:a,className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted","aria-label":"Close",children:o.jsx(rn,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[o.jsx(An,{label:"Name",children:o.jsx(ve,{value:l,onChange:g=>c(g.target.value)})}),v()]}),o.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-border p-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs(ne,{variant:"ghost",className:"w-full text-destructive hover:bg-destructive/10 sm:w-auto",onClick:()=>i(e.id),children:[o.jsx(Oa,{className:"mr-1.5 h-4 w-4"})," Delete"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ne,{variant:"outline",className:"flex-1 sm:flex-none",onClick:a,children:"Cancel"}),o.jsxs(ne,{className:"flex-1 bg-primary text-primary-foreground sm:flex-none",onClick:()=>s(e.id,{...e.data,label:l||e.data.label,config:u}),children:[o.jsx(X2,{className:"mr-1.5 h-4 w-4"})," Save"]})]})]})]})}function An({label:e,children:t}){return o.jsxs("div",{children:[o.jsx(ke,{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e}),t]})}function vqe({icon:e,text:t,hint:n}){return o.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2.5 text-xs text-warning",children:[o.jsx(co,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),o.jsxs("span",{children:[o.jsxs("span",{className:"font-semibold",children:[e," ",t,"."]})," ",n," ",o.jsx("a",{href:"/dashboard/integrations",className:"underline hover:opacity-80",children:"Integrations"})," ","to set up."]})]})}const $X=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,DX=e=>`flow:graph:${e}`,IE=e=>`flow:history:${e}`;function w5(){return{nodes:[{id:$X(),type:"trigger",position:{x:80,y:160},data:{kind:"now",label:"Now"}}],edges:[],savedAt:new Date().toISOString()}}function yqe(e){if(typeof window>"u")return w5();try{const t=window.localStorage.getItem(DX(e));if(t)return JSON.parse(t)}catch{}return w5()}function xqe(e){return{event:e.some(n=>n.type==="trigger"&&(n.data.kind==="inbound-call"||n.data.kind==="internet-call"))?"call_ended":"manual"}}function bqe(e,t){if(!(typeof window>"u")){window.localStorage.setItem(DX(e),JSON.stringify(t));try{const n=window.localStorage.getItem(IE(e)),r=n?JSON.parse(n):[];r.unshift(t),window.localStorage.setItem(IE(e),JSON.stringify(r.slice(0,10)))}catch{}}}function wqe({v2:e=!1}){ua();const{flowId:t="new"}
954=tte(),n=mo(),r=new URLSearchParams(n.search).get("name")??"Untitled Flow",[a,s]=p.useState(r),[i,l]=p.useState("design"),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(""),[v,g]=p.useState("Active"),[y,x]=p.useState(!1),[b,w]=p.useState(!1),N=p.useMemo(()=>yqe(t),[t]),[S,_,k]=RWe(N.nodes),[P,O,$]=LWe(N.edges),[T,z]=p.useState(null),[U,E]=p.useState(null),[q,W]=p.useState(t!=="new"),[L,M]=p.useState(!1),[B,I]=p.useState(()=>{if(typeof window>"u")return[];try{return JSON.parse(window.localStorage.getItem(IE(t))??"[]")}catch{return[]}}),[R,F]=p.useState([]),[j,C]=p.useState(!1),[A,D]=p.useState([]),[V,Y]=p.useState([]),[G,K]=p.useState([]);p.useEffect(()=>{ee.getAgents().then(({data:me})=>{Array.isArray(me)&&D(me.map(Se=>({id:Se.id,name:Se.name})))}),ee.getPhoneNumbers().then(({data:me})=>{Array.isArray(me)&&Y(me.map(Se=>({id:Se.id,number:Se.number})))}),ee.getIntegrations().then(({data:me})=>{Array.isArray(me)&&K(me.filter(Se=>Se.category==="email"&&Se.status==="Active").map(Se=>({id:Se.id,name:Se.name})))})},[]);const Z=p.useCallback(async()=>{if(!t||t==="new")return;C(!0);const{data:me}=await ee.getFlowVersions(t);Array.isArray(me)&&F(me),C(!1)},[t]);p.useEffect(()=>{L&&Z()},[L,Z]),p.useEffect(()=>{let me=!1;if(!(!t||t==="new"))return(async()=>{const{data:Se,error:it}=await ee.getFlow(t);if(me)return;if(it||!Se){W(!1);return}Se.name&&s(Se.name),u(Se.description??""),Se.status&&g(Se.status);const Lt=Se.definition;Lt&&Array.isArray(Lt.nodes)&&(_(zN(Lt.nodes)),O(Array.isArray(Lt.edges)?Lt.edges:[])),W(!1)})(),()=>{me=!0}},[t,_,O]);const J=async me=>{const{data:Se}=await ee.getFlowVersion(t,me);if(!(Se!=null&&Se.definition)){X.error("Could not load that version");return}const{error:it}=await ee.restoreFlowVersion(t,me);if(it){X.error(it);return}_(zN(Se.definition.nodes||[])),O(Se.definition.edges||[]),M(!1),X.success(`Restored version ${Se.version_number}`),Z()},ce=p.useRef(null),ue=p.useRef(null),{screenToFlowPosition:be}=ij(),Ne=p.useRef(!1);p.useEffect(()=>{var me;q||Ne.current||!S.length||S.every(Se=>Se.width&&Se.height)&&(Ne.current=!0,(me=ue.current)==null||me.fitView({padding:.2,maxZoom:1}))},[q,S]);const te=e?"/dashboard/automation-v2":"/dashboard/automation",re=p.useCallback(me=>O(Se=>YK({...me,type:"smoothstep",animated:!0,style:{stroke:me.sourceHandle==="no"?"#ADADAD":"#22A655",strokeWidth:2},markerEnd:{type:oh.ArrowClosed,color:me.sourceHandle==="no"?"#ADADAD":"#22A655"}},Se)),[O]),pe=p.useCallback(me=>{me.preventDefault();const Se=me.dataTransfer.getData("application/reactflow"),it=me.dataTransfer.getData("application/reactflow-label")||"Untitled";if(!Se)return;const Lt=be({x:me.clientX,y:me.clientY}),In={id:$X(),type:mqe(Se),position:Lt,data:{kind:Se,label:it}};_(Or=>Or.concat(In))},[be,_]),Ee=p.useCallback(me=>{me.preventDefault(),me.dataTransfer.dropEffect="move"},[]),Fe=p.useCallback((me,Se)=>{z(Se)},[]),Be=(me,Se)=>{_(it=>it.map(Lt=>Lt.id===me?{...Lt,data:Se}:Lt)),z(null),X.success("Node updated")},st=me=>{_(Se=>Se.filter(it=>it.id!==me)),O(Se=>Se.filter(it=>it.source!==me&&it.target!==me)),z(null),X.success("Node deleted")},Pt=p.useCallback(async(me=!1)=>{const Se={nodes:S,edges:P,savedAt:new Date().toISOString()};if(bqe(t,Se),I(it=>[Se,...it].slice(0,10)),t&&t!=="new"){const{error:it}=await ee.updateFlow(t,{name:a,description:c,definition:{nodes:S,edges:P,trigger:xqe(S)}});it&&!me?X.error(`Saved locally but server update failed: ${it}`):me?(E("Saved"),setTimeout(()=>E(null),1500)):X.success("Flow saved")}else me?(E("Saved"),setTimeout(()=>E(null),1500)):X.success("Flow saved locally")},[t,a,c,S,P]),kn=S.some(me=>me.data.kind==="now"),Tt=async()=>{if(!t||t==="new"){X.error("Save the flow first");return}w(!0),await Pt(!0);const{error:me}=await ee.runFlowNow(t);if(w(!1),me){X.error(`Could not run flow: ${me}`);return}X.success("Flow started — check the Runs tab for the result")},an=async()=>{if(!t||t==="new"){X.error("Save the flow first");return}const me=v==="Paused"?"Active":"Paused";x(!0);const{error:Se}=await ee.updateFlow(t,{status:me});if(x(!1),Se){X.error(`Could not update status: ${Se}`);return}g(me),X.success(me==="Paused"?"Flow paused":"Flow resumed")},Kr=()=>{m(c),f(!0)},Tr=async()=>{const me=h.trim();if(u(me),f(!1),t&&t!=="new"){const{error:Se}=await ee.updateFlow(t,{description:me});Se?X.error(`Could not save description: ${Se}`):X.success("Description saved")}else X.success("Description updated")};return p.useEffect(()=>{if(q)return;const me=window.setInterval(()=>{E("Saving…"),Pt(!0)},3e4);return()=>window.clearInterval(me)},[Pt,q]),o.jsxs("div",{className:"-mx-4 -my-6 flex h-[calc(100vh-4rem)] flex-col bg-background sm:-mx-6 lg:-mx-8",children:[o.jsxs("div",{className:"flex flex-col gap-3 border-b border-border bg-card px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(jt,{to:te,className:"shrink-0 rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted","aria-label":"Back",children:o.jsx(z2,{className:"h-4 w-4"})}),o.jsx(ve,{value:a,onChange:me=>s(me.target.value),className:"h-9 min-w-0 flex-1 font-medium sm:w-72 sm:flex-initial"}),o.jsxs("button",{type:"button",onClick:Kr,title:c||"Add a description",className:"hidden shrink-0 whitespace-nowrap md:inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-muted",children:[o.jsx(qi,{className:"h-4 w-4"})," Description",c&&o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary","aria-label":"Has description"})]}),o.jsxs("button",{className:"hidden shrink-0 whitespace-nowrap md:inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-muted",children:[o.jsx(Ps,{className:"h-4 w-4"})," Settings"]}),q&&o.jsx("span",{className:"hidden shrink-0 text-xs text-muted-foreground sm:inline",children:"Loading…"}),!q&&U&&o.jsx("span",{className:"hidden shrink-0 text-xs text-muted-foreground sm:inline",children:U})]}),o.jsxs("div",{className:"relative flex items-center justify-end gap-2 sm:shrink-0",children:[o.jsxs("div",{className:"sm:relative",children:[o.jsx("button",{onClick:()=>M(me=>!me),className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted","aria-label":"History",children:o.jsx(ZB,{className:"h-4 w-4"})}),L&&o.jsxs("div",{className:"absolute right-0 top-full z-30 mt-2 w-72 max-w-[calc(100vw-2rem)] rounded-lg border border-border bg-card p-2 shadow-lg",children:[o.jsxs("div",{className:"px-2 py-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:["Saved Versions ",j&&o.jsx("span",{className:"ml-1 normal-case font-normal",children:"  loading…"})]}),R.length===0&&!j?o.jsx("div",{className:"p-3 text-center text-xs text-muted-foreground",children:"No saved versions yet. Save the flow to create one."}):R.map(me=>o.jsxs("button",{onClick:()=>J(me.id),className:"block w-full rounded-md px-2 py-1.5 text-left text-xs hover:bg-muted",children:[o.jsxs("span",{className:"font-semibold",children:["v",me.version_number]})," ",o.jsxs("span",{className:"text-muted-foreground",children:["· ",new Date(me.created_at).toLocaleStr
954ing()]})]},me.id)),B.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-2 border-t border-border pt-2 px-2 py-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Local Snapshots"}),B.slice(0,5).map(me=>o.jsxs("button",{onClick:()=>{_(zN(me.nodes)),O(me.edges),M(!1),X.success("Restored local snapshot")},className:"block w-full rounded-md px-2 py-1.5 text-left text-xs hover:bg-muted",children:[new Date(me.savedAt).toLocaleString()," · ",me.nodes.length," nodes"]},me.savedAt))]})]})]}),o.jsxs(ne,{onClick:()=>Pt(!1),disabled:q,className:"bg-primary text-primary-foreground hover:opacity-90",children:[o.jsx(X2,{className:"mr-1.5 h-4 w-4"})," Save"]}),kn&&o.jsxs(ne,{variant:"outline",onClick:Tt,disabled:q||b,children:[b?o.jsx(Te,{className:"mr-1.5 h-4 w-4 animate-spin"}):o.jsx(As,{className:"mr-1.5 h-4 w-4"}),"Run now"]}),o.jsx(ne,{variant:v==="Paused"?"default":"destructive",onClick:an,disabled:q||y,children:v==="Paused"?o.jsxs(o.Fragment,{children:[o.jsx(Gl,{className:"mr-1.5 h-4 w-4"})," Resume"]}):o.jsxs(o.Fragment,{children:[o.jsx(Mg,{className:"mr-1.5 h-4 w-4"})," Pause"]})})]})]}),o.jsx(ft,{open:d,onOpenChange:f,children:o.jsxs(ct,{className:"max-w-md",children:[o.jsxs($t,{children:[o.jsx(xt,{children:"Flow description"}),o.jsx(wt,{children:"Describe what this flow does so your team knows at a glance."})]}),o.jsx(Zl,{autoFocus:!0,value:h,onChange:me=>m(me.target.value),placeholder:"e.g. Texts the caller after an inbound call and updates their contact",rows:5,maxLength:500}),o.jsxs(Wt,{children:[o.jsx(ne,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),o.jsx(ne,{onClick:Tr,disabled:q,children:"Save"})]})]})}),o.jsx("div",{className:"flex items-center gap-6 overflow-x-auto overflow-y-hidden border-b border-border bg-card px-4 sm:px-5",children:[["design","Design"],["statistics","Runs"]].map(([me,Se])=>o.jsxs("button",{onClick:()=>l(me),className:`relative py-3 text-sm font-medium ${i===me?"text-foreground":"text-muted-foreground"}`,children:[Se,i===me&&o.jsx("span",{className:"absolute inset-x-0 bottom-0 h-0.5 bg-primary"})]},me))}),i==="design"?o.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden",children:[o.jsx("div",{ref:ce,className:"min-h-[240px] w-full flex-1 lg:min-h-0 lg:w-auto",onDrop:pe,onDragOver:Ee,children:o.jsxs(EX,{nodes:S,edges:P,onNodesChange:k,onEdgesChange:$,onConnect:re,onNodeDoubleClick:Fe,onInit:me=>ue.current=me,nodeTypes:hqe,snapToGrid:!0,snapGrid:[20,20],fitView:!0,fitViewOptions:{padding:.2,maxZoom:1},minZoom:.2,proOptions:{hideAttribution:!0},defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#22A655",strokeWidth:2},markerEnd:{type:oh.ArrowClosed,color:"#22A655"}},deleteKeyCode:["Backspace","Delete"],children:[o.jsx(iqe,{variant:oo.Dots,gap:20,size:1.5,color:"hsl(var(--border))"}),o.jsx(tqe,{className:"!rounded-md !border !border-border !bg-card !shadow-sm [&_button]:!bg-card [&_button]:!border-border [&_button]:!text-foreground [&_svg]:!fill-current max-lg:[&_button]:!h-6 max-lg:[&_button]:!w-6",showInteractive:!1,position:"bottom-left"}),o.jsx(YWe,{className:"!rounded-md !border !border-border !bg-card max-sm:!hidden",nodeColor:()=>"hsl(var(--primary))",maskColor:"hsl(var(--background) / 0.8)",pannable:!0,zoomable:!0})]})}),o.jsx(jqe,{}),o.jsx(gqe,{node:T,agents:A,phoneNumbers:V,emailIntegrations:G,onClose:()=>z(null),onSave:Be,onDelete:st})]}):o.jsx(_qe,{flowId:t})]})}function jqe(){const e=(t,n,r)=>{t.dataTransfer.setData("application/reactflow",n),t.dataTransfer.setData("application/reactflow-label",r),t.dataTransfer.effectAllowed="move"};return o.jsxs("aside",{className:"w-full max-h-[35vh] shrink-0 overflow-y-auto border-t border-border bg-card p-4 lg:h-auto lg:w-[220px] lg:max-h-none lg:border-l lg:border-t-0",children:[pqe.map(t=>o.jsxs("div",{className:"mb-5",children:[o.jsx("h3",{className:"mb-2 text-sm font-semibold text-foreground",children:t.title}),o.jsx("div",{className:"space-y-1.5",children:t.items.map(({kind:n,label:r})=>{const a=IX(n),s=a.icon;return o.jsxs("div",{draggable:!0,onDragStart:i=>e(i,n,r),className:"flex cursor-grab items-center gap-2.5 rounded-md border border-border bg-background px-3 py-2 text-sm font-medium transition hover:bg-primary/5 hover:border-primary/40 active:cursor-grabbing",children:[o.jsx("div",{className:`flex h-6 w-6 items-center justify-center rounded ${a.iconBg}`,children:o.jsx(s,{className:`h-3.5 w-3.5 ${a.iconColor}`})}),o.jsx("span",{children:r})]},n)})})]},t.title)),o.jsxs("div",{className:"mt-3 rounded-md border border-dashed border-border bg-muted/30 p-2.5 text-[11px] leading-snug text-muted-foreground",children:[o.jsxs("div",{className:"mb-1 flex items-center gap-1 font-semibold text-foreground",children:[o.jsx(Ere,{className:"h-3 w-3"})," Tips"]}),"Drag a block onto the canvas. Connect output dots to inputs. Double-click a node to edit."]})]})}function Sqe(e){if(!e.completed_at)return"—";const t=new Date(e.completed_at).getTime()-new Date(e.created_at).getTime();return!Number.isFinite(t)||t<0?"—":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function Nqe({status:e}){return e==="success"?o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success",children:[o.jsx(tr,{className:"h-3 w-3"})," Success"]}):e==="failed"?o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/15 px-2 py-0.5 text-xs font-medium text-destructive",children:[o.jsx(Og,{className:"h-3 w-3"})," Failed"]}):o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-warning/15 px-2 py-0.5 text-xs font-medium text-warning",children:[o.jsx(Te,{className:"h-3 w-3 animate-spin"})," ",e==="running"?"Running":"Queued"]})}function _qe({flowId:e}){const[t,n]=p.useState([]),[r,a]=p.useState(!0),[s,i]=p.useState(null),[l,c]=p.useState({key:"created_at",dir:"desc"}),[u,d]=p.useState({}),[f,h]=p.useState(void 0),[m,v]=p.useState(1),[g,y]=p.useState(wP[0]),x=p.useCallback(async()=>
954{if(!e||e==="new"){a(!1);return}const{data:E}=await ee.getRuns(`flow_id=${e}&limit=100`);Array.isArray(E)&&n(E),a(!1)},[e]);p.useEffect(()=>{a(!0),x();const E=setInterval(x,15e3);return()=>clearInterval(E)},[x]),p.useEffect(()=>{v(1)},[u,f,g]);const b=E=>{c(q=>q.key!==E?{key:E,dir:"asc"}:q.dir==="asc"?{key:E,dir:"desc"}:q.dir==="desc"?{key:null,dir:"asc"}:{key:E,dir:"asc"})},w=E=>{var q,W;return((q=E.input_data)==null?void 0:q.contact_name)||((W=E.input_data)==null?void 0:W.phone)||"—"},N=p.useMemo(()=>Array.from(new Set(t.map(E=>E.status).filter(Boolean))).map(E=>({value:E,label:E.charAt(0).toUpperCase()+E.slice(1)})),[t]),S=p.useMemo(()=>{let E=t.filter(q=>{if(u.status&&q.status!==u.status||u.contact&&!w(q).toLowerCase().includes(u.contact.toLowerCase()))return!1;if(f){const W=new Date(q.created_at);if(W.getFullYear()!==f.getFullYear()||W.getMonth()!==f.getMonth()||W.getDate()!==f.getDate())return!1}return!0});if(l.key){const q=l.key;E=[...E].sort((W,L)=>{let M="",B="";return q==="created_at"?(M=new Date(W.created_at).getTime(),B=new Date(L.created_at).getTime()):q==="contact"?(M=w(W).toLowerCase(),B=w(L).toLowerCase()):q==="duration"?(M=W.completed_at?new Date(W.completed_at).getTime()-new Date(W.created_at).getTime():-1,B=L.completed_at?new Date(L.completed_at).getTime()-new Date(L.created_at).getTime():-1):(M=W.status,B=L.status),M<B?l.dir==="asc"?-1:1:M>B?l.dir==="asc"?1:-1:0})}return E},[t,u,f,l]),_=Math.max(1,Math.ceil(S.length/g)),k=Math.min(m,_),P=S.slice((k-1)*g,k*g),O=t.length,$=t.filter(E=>E.status==="success").length,T=t.filter(E=>E.status==="failed").length,z=O>0?`${Math.round($/O*100)}%`:"—",U=[{label:"Total runs",value:O},{label:"Success rate",value:z},{label:"Failed runs",value:T},{label:"In progress",value:t.filter(E=>E.status==="running"||E.status==="queued").length}];return!e||e==="new"?o.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o.jsx("div",{className:"rounded-xl border border-dashed border-border bg-card p-10 text-center text-sm text-muted-foreground",children:"Save this flow first — runs only start showing up here once it's a real, saved flow that can actually trigger."})}):o.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:U.map(E=>o.jsxs("div",{className:"rounded-xl border border-border bg-card p-4",children:[o.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:E.label}),o.jsx("div",{className:"mt-2 text-2xl font-bold",children:E.value})]},E.label))}),o.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-card",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(As,{className:"h-4 w-4 text-primary"}),o.jsx("h3",{className:"text-sm font-semibold",children:"Run history"})]}),o.jsx("button",{type:"button",onClick:()=>{a(!0),x()},className:"rounded-md p-2.5 sm:p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",title:"Refresh",children:o.jsx($u,{className:"h-4 w-4"})})]}),r?o.jsxs("div",{className:"p-8 text-center text-sm text-muted-foreground",children:[o.jsx(Te,{className:"mx-auto mb-2 h-5 w-5 animate-spin"})," Loading…"]}):t.length===0?o.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"No runs yet. This flow's trigger has never fired. Place or receive a real call that matches its trigger to see a run appear here."}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[640px] text-sm",children:[o.jsxs("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wide text-muted-foreground",children:[o.jsxs("tr",{className:"divide-x divide-border",children:[o.jsx("th",{className:"px-4 py-2.5",children:o.jsx(cn,{label:"Status",active:l.key==="status",dir:l.dir,onClick:()=>b("status")})}),o.jsx("th",{className:"px-4 py-2.5",children:o.jsx(cn,{label:"Contact / Phone",active:l.key==="contact",dir:l.dir,onClick:()=>b("contact")})}),o.jsx("th",{className:"px-4 py-2.5",children:o.jsx(cn,{label:"Started",active:l.key==="created_at",dir:l.dir,onClick:()=>b("created_at")})}),o.jsx("th",{className:"px-4 py-2.5",children:o.jsx(cn,{label:"Duration",active:l.key==="duration",dir:l.dir,onClick:()=>b("duration")})}),o.jsx("th",{className:"px-4 py-2.5"})]}),o.jsxs("tr",{className:"divide-x divide-border border-t border-border",children:[o.jsx("th",{className:"px-4 py-2.5 font-normal normal-case",children:o.jsx(Tn,{value:u.status||"",onChange:E=>d(q=>
954({...q,status:E})),options:N,placeholder:"Status"})}),o.jsx("th",{className:"px-4 py-2.5 font-normal normal-case",children:o.jsx(pn,{value:u.contact||"",onChange:E=>d(q=>({...q,contact:E})),placeholder:"Contact / Phone"})}),o.jsx("th",{className:"px-4 py-2.5 font-normal normal-case",children:o.jsx(Tf,{value:f,onChange:h})}),o.jsx("th",{className:"px-4 py-2.5"}),o.jsx("th",{className:"px-4 py-2.5"})]})]}),o.jsxs("tbody",{children:[P.map(E=>{var q,W,L,M;return o.jsxs(p.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer divide-x divide-border border-t border-border hover:bg-muted/20",onClick:()=>i(B=>B===E.id?null:E.id),children:[o.jsx("td",{className:"px-4 py-2.5",children:o.jsx(Nqe,{status:E.status})}),o.jsx("td",{className:"px-4 py-2.5 text-foreground",children:((q=E.input_data)==null?void 0:q.contact_name)||((W=E.input_data)==null?void 0:W.phone)||"—"}),o.jsx("td",{className:"px-4 py-2.5 text-muted-foreground whitespace-nowrap",children:new Date(E.created_at).toLocaleString()}),o.jsx("td",{className:"px-4 py-2.5 text-muted-foreground",children:Sqe(E)}),o.jsx("td",{className:"px-4 py-2.5 text-right text-muted-foreground",children:s===E.id?"Hide":"Details"})]}),s===E.id&&o.jsx("tr",{className:"border-t border-border bg-muted/10",children:o.jsx("td",{colSpan:5,className:"px-4 py-3",children:E.status==="failed"&&((L=E.output_data)!=null&&L.error)?o.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive",children:E.output_data.error}):E.status==="success"?o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Ran ",((M=E.output_data)==null?void 0:M.nodes_executed)??"—"," node(s) successfully."]}):o.jsx("div",{className:"text-xs text-muted-foreground",children:"Still in progress…"})})})]},E.id)}),P.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No runs match these filters."})})]})]})}),o.jsx(dr,{page:k,pageSize:g,totalCount:S.length,onPageChange:v,onPageSizeChange:y})]})]})]})}const Cqe=({v2:e=!1})=>o.jsx(qT,{children:o.jsx(wqe,{v2:e})}),kqe=()=>o.jsx(Cqe,{}),Eqe=new See,Aqe=()=>{const e=vse();return o.jsx(Ote,{attribute:"class",defaultTheme:"dark",enableSystem:!0,storageKey:"nexus-theme",children:o.jsx(_ee,{client:Eqe,children:o.jsxs(pse,{children:[o.jsx(Eae,{}),o.jsx(une,{}),o.jsx(Nte,{children:o.jsx(Cse,{children:e?o.jsx(_M,{children:o.jsx(Ue,{path:"*",element:o.jsx(K8e,{})})}):o.jsxs(_M,{children:[o.jsx(Ue,{path:"/",element:o.jsx(nie,{})}),o.jsx(Ue,{path:"/features",element:o.jsx(rie,{})}),o.jsx(Ue,{path:"/technology",element:o.jsx(sie,{})}),o.jsx(Ue,{path:"/advertisers",element:o.jsx(cie,{})}),o.jsx(Ue,{path:"/publishers",element:o.jsx(fie,{})}),o.jsx(Ue,{path:"/use-cases",element:o.jsx(mie,{})}),o.jsx(Ue,{path:"/pricing",element:o.jsx(Fie,{})}),o.jsx(Ue,{path:"/about",element:o.jsx(Uie,{})}),o.jsx(Ue,{path:"/login",element:o.jsx(Vie,{})}),o.jsx(Ue,{path:"/register",element:o.jsx(Wie,{})}),o.jsx(Ue,{path:"/verify-email",element:o.jsx(qie,{})}),o.jsx(Ue,{path:"/accept-invite",element:o.jsx(Hie,{})}),o.jsx(Ue,{path:"/reset-password",element:o.jsx(Gie,{})}),o.jsx(Ue,{path:"/request-access",element:o.jsx(Kie,{})}),o.jsx(Ue,{path:"/privacy",element:o.jsx(Jie,{})}),o.jsxs(Ue,{path:"/dashboard",element:o.jsx(Rue,{}),children:[o.jsx(Ue,{index:!0,element:o.jsx(Fue,{})}),o.jsx(Ue,{path:"quick-setup",element:o.jsx(zue,{})}),o.jsx(Ue,{path:"ai-agents",element:o.jsx(Bpe,{})}),o.jsx(Ue,{path:"ai-agents/create",element:o.jsx(xpe,{})}),o.jsx(Ue,{path:"ai-voices",element:o.jsx(Wpe,{})}),o.jsx(Ue,{path:"conversations",element:o.jsx(zye,{})}),o.jsx(Ue,{path:"integrations",element:o.jsx(jxe,{})}),o.jsx(Ue,{path:"profile",element:o.jsx(Hpe,{})}),o.jsx(Ue,{path:"referrals",element:o.jsx(Kpe,{})}),o.jsx(Ue,{path:"support",element:o.jsx(Ype,{})}),o.jsx(Ue,{path:"database/contacts",element:o.jsx(Exe,{})}),o.jsx(Ue,{path:"database/lists",element:o.jsx(Pxe,{})}),o.jsx(Ue,{path:"telephony/outbound",element:o.jsx(ID,{})}),o.jsx(Ue,{path:"telephony/campaigns",element:o.jsx(ID,{})}),o.jsx(Ue,{path:"telephony/inbound",element:o.jsx(Rxe,{})}),o.jsx(Ue,{path:"telephony/inbound-numbers",element:o.jsx(R_,{to:"/dashboard/telephony/phone-numbers",replace:!0})}),o.jsx(Ue,{path:"telephony/inbound-logs",element:o.jsx(zxe,{})}),o.jsx(Ue,{path:"telephony/outbound-logs",element:o.jsx(qxe,{})}),o.jsx(Ue,{path:"telephony/phone-numbers",element:o.jsx(abe,{})}),o.jsx(Ue,{path:"analytics/channel",element:o.jsx(Z8e,{})}),o.jsx(Ue,{path:"analytics/campaign",element:o.jsx(eze,{})}),o.jsx(Ue,{path:"analytics/scenario",element:o.jsx(tze,{})}),o.jsxs(Ue,{path:"call-events",element:o.jsx(lze,{}),children:[o.jsx(Ue,{index:!0,element:o.jsx(sze,{})}),o.jsx(Ue,{path:"callbacks",element:o.jsx(xze,{})})]}),o.jsx(Ue,{path:"callbacks",element:o.jsx(R_,{to:"/dashboard/call-events/callbacks",replace:!0})}),o.jsx(Ue,{path:"automation",element:o.jsx(oze,{})}),o.jsx(Ue,{path:"automation/:flowId",element:o.jsx(kqe,{})}),o.jsxs(Ue,{path:"billing",element:o.jsx(dbe,{}),children:[o.jsx(Ue,{index:!0,element:o.jsx(pbe,{})}),o.jsx(Ue,{path:"transactions",element:o.jsx(gbe,{})}),o.jsx(Ue,{path:"call-costs",element:o.jsx(vbe,{})}),o.jsx(Ue,{path:"payment-methods",element:o.jsx(a0e,{})}),o.jsx(Ue,{path:"promotions",element:o.jsx(o0e,{})})]})]}),o.jsx(Ue,{path:"*",element:o.jsx(Qie,{})})]})})})]})})})};V6(document.getElementById("root")).render(o.jsx(Aqe,{}))});export default Pqe();

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.