var rC=e=>{throw TypeError(e)};var Gx=(e,t,n)=>t.has(e)||rC("Cannot "+n);var L=(e,t,n)=>(Gx(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?rC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),me=(e,t,n,r)=>(Gx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Fe=(e,t,n)=>(Gx(e,t,"access private method"),n);var Pm=(e,t,n,r)=>({set _(i){me(e,t,i,n)},get _(){return L(e,t,r)}});function gz(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var km=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sM={exports:{}},Kv={},oM={exports:{}},We={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var zh=Symbol.for("react.element"),vz=Symbol.for("react.portal"),yz=Symbol.for("react.fragment"),xz=Symbol.for("react.strict_mode"),bz=Symbol.for("react.profiler"),wz=Symbol.for("react.provider"),jz=Symbol.for("react.context"),Sz=Symbol.for("react.forward_ref"),Az=Symbol.for("react.suspense"),Nz=Symbol.for("react.memo"),Tz=Symbol.for("react.lazy"),iC=Symbol.iterator;function Cz(e){return e===null||typeof e!="object"?null:(e=iC&&e[iC]||e["@@iterator"],typeof e=="function"?e:null)}var lM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cM=Object.assign,uM={};function Ou(e,t,n){this.props=e,this.context=t,this.refs=uM,this.updater=n||lM}Ou.prototype.isReactComponent={};Ou.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")};Ou.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function dM(){}dM.prototype=Ou.prototype;function eS(e,t,n){this.props=e,this.context=t,this.refs=uM,this.updater=n||lM}var tS=eS.prototype=new dM;tS.constructor=eS;cM(tS,Ou.prototype);tS.isPureReactComponent=!0;var aC=Array.isArray,fM=Object.prototype.hasOwnProperty,nS={current:null},hM={key:!0,ref:!0,__self:!0,__source:!0};function mM(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)fM.call(t,r)&&!hM.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,q=O[Y];if(0>>1;Yi($e,W))Eei(fe,$e)?(O[Y]=fe,O[Ee]=W,Y=Ee):(O[Y]=$e,O[je]=W,Y=je);else if(Eei(fe,W))O[Y]=fe,O[Ee]=W,Y=Ee;else break e}}return M}function i(O,M){var W=O.sortIndex-M.sortIndex;return W!==0?W:O.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,y=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=O)r(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function S(O){if(p=!1,w(O),!y)if(n(c)!==null)y=!0,R(j);else{var M=n(u);M!==null&&B(S,M.startTime-O)}}function j(O,M){y=!1,p&&(p=!1,x(T),T=-1),m=!0;var W=h;try{for(w(M),f=n(c);f!==null&&(!(f.expirationTime>M)||O&&!P());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var q=Y(f.expirationTime<=M);M=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(c)&&r(c),w(M)}else r(c);f=n(c)}if(f!==null)var oe=!0;else{var je=n(u);je!==null&&B(S,je.startTime-M),oe=!1}return oe}finally{f=null,h=W,m=!1}}var A=!1,N=null,T=-1,C=5,E=-1;function P(){return!(e.unstable_now()-EO||125Y?(O.sortIndex=W,t(u,O),n(c)===null&&O===n(u)&&(p?(x(T),T=-1):p=!0,B(S,W-Y))):(O.sortIndex=q,t(c,O),y||m||(y=!0,R(j))),O},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(O){var M=h;return function(){var W=h;h=M;try{return O.apply(this,arguments)}finally{h=W}}}})(bM);xM.exports=bM;var Lz=xM.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Fz=v,fr=Lz;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),E0=Object.prototype.hasOwnProperty,Bz=/^[: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]*$/,oC={},lC={};function Vz(e){return E0.call(lC,e)?!0:E0.call(oC,e)?!1:Bz.test(e)?lC[e]=!0:(oC[e]=!0,!1)}function Wz(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 zz(e,t,n,r){if(t===null||typeof t>"u"||Wz(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 Fn(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new Fn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new Fn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new Fn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new Fn(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){hn[e]=new Fn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new Fn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new Fn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new Fn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new Fn(e,5,!1,e.toLowerCase(),null,!1,!1)});var iS=/[\-:]([a-z])/g;function aS(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(iS,aS);hn[t]=new Fn(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(iS,aS);hn[t]=new Fn(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(iS,aS);hn[t]=new Fn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new Fn(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new Fn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new Fn(e,1,!1,e.toLowerCase(),null,!0,!0)});function sS(e,t,n,r){var i=hn.hasOwnProperty(t)?hn[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==a[l]){var c=` `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Xx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cd(e):""}function Uz(e){switch(e.tag){case 5:return Cd(e.type);case 16:return Cd("Lazy");case 13:return Cd("Suspense");case 19:return Cd("SuspenseList");case 0:case 2:case 15:return e=Zx(e.type,!1),e;case 11:return e=Zx(e.type.render,!1),e;case 1:return e=Zx(e.type,!0),e;default:return""}}function M0(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 Wl:return"Fragment";case Vl:return"Portal";case O0:return"Profiler";case oS:return"StrictMode";case _0:return"Suspense";case I0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case SM:return(e.displayName||"Context")+".Consumer";case jM:return(e._context.displayName||"Context")+".Provider";case lS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case cS:return t=e.displayName||null,t!==null?t:M0(e.type)||"Memo";case is:t=e._payload,e=e._init;try{return M0(e(t))}catch{}}return null}function Hz(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 M0(t);case 8:return t===oS?"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 Fs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function NM(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qz(e){var t=NM(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 i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _m(e){e._valueTracker||(e._valueTracker=qz(e))}function TM(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=NM(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bp(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 R0(e,t){var n=t.checked;return Tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uC(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function CM(e,t){t=t.checked,t!=null&&sS(e,"checked",t,!1)}function D0(e,t){CM(e,t);var n=Fs(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")?$0(e,t.type,n):t.hasOwnProperty("defaultValue")&&$0(e,t.type,Fs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dC(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 $0(e,t,n){(t!=="number"||Bp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Pd=Array.isArray;function lc(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Im.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ff(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zd={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},Gz=["Webkit","ms","Moz","O"];Object.keys(zd).forEach(function(e){Gz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zd[t]=zd[e]})});function OM(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zd.hasOwnProperty(e)&&zd[e]?(""+t).trim():t+"px"}function _M(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=OM(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Yz=Tt({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 B0(e,t){if(t){if(Yz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function V0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var W0=null;function uS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var z0=null,cc=null,uc=null;function mC(e){if(e=qh(e)){if(typeof z0!="function")throw Error(J(280));var t=e.stateNode;t&&(t=ey(t),z0(e.stateNode,e.type,t))}}function IM(e){cc?uc?uc.push(e):uc=[e]:cc=e}function MM(){if(cc){var e=cc,t=uc;if(uc=cc=null,mC(e),t)for(e=0;e>>=0,e===0?32:31-(aU(e)/sU|0)|0}var Mm=64,Rm=4194304;function kd(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 Up(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=kd(l):(a&=o,a!==0&&(r=kd(a)))}else o=n&~i,o!==0?r=kd(o):a!==0&&(r=kd(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Uh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-li(t),e[t]=n}function uU(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=Hd),SC=" ",AC=!1;function eR(e,t){switch(e){case"keyup":return LU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zl=!1;function BU(e,t){switch(e){case"compositionend":return tR(t);case"keypress":return t.which!==32?null:(AC=!0,SC);case"textInput":return e=t.data,e===SC&&AC?null:e;default:return null}}function VU(e,t){if(zl)return e==="compositionend"||!yS&&eR(e,t)?(e=QM(),wp=pS=Ss=null,zl=!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)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=PC(n)}}function aR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sR(){for(var e=window,t=Bp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bp(e.document)}return t}function xS(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 XU(e){var t=sR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&aR(n.ownerDocument.documentElement,n)){if(r!==null&&xS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=kC(n,a);var o=kC(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ul=null,K0=null,Gd=null,X0=!1;function EC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;X0||Ul==null||Ul!==Bp(r)||(r=Ul,"selectionStart"in r&&xS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gd&&yf(Gd,r)||(Gd=r,r=Gp(K0,"onSelect"),0Gl||(e.current=nw[Gl],nw[Gl]=null,Gl--)}function ut(e,t){Gl++,nw[Gl]=e.current,e.current=t}var Bs={},Tn=eo(Bs),Gn=eo(!1),Yo=Bs;function Wc(e,t){var n=e.type.contextTypes;if(!n)return Bs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yn(e){return e=e.childContextTypes,e!=null}function Kp(){gt(Gn),gt(Tn)}function $C(e,t,n){if(Tn.current!==Bs)throw Error(J(168));ut(Tn,t),ut(Gn,n)}function pR(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(J(108,Hz(e)||"Unknown",i));return Tt({},n,r)}function Xp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bs,Yo=Tn.current,ut(Tn,e),ut(Gn,Gn.current),!0}function LC(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=pR(e,t,Yo),r.__reactInternalMemoizedMergedChildContext=e,gt(Gn),gt(Tn),ut(Tn,e)):gt(Gn),ut(Gn,n)}var ua=null,ty=!1,db=!1;function gR(e){ua===null?ua=[e]:ua.push(e)}function lH(e){ty=!0,gR(e)}function to(){if(!db&&ua!==null){db=!0;var e=0,t=tt;try{var n=ua;for(tt=1;e>=o,i-=o,ma=1<<32-li(t)+i|n<T?(C=N,N=null):C=N.sibling;var E=h(x,N,w[T],S);if(E===null){N===null&&(N=C);break}e&&N&&E.alternate===null&&t(x,N),g=a(E,g,T),A===null?j=E:A.sibling=E,A=E,N=C}if(T===w.length)return n(x,N),vt&&po(x,T),j;if(N===null){for(;TT?(C=N,N=null):C=N.sibling;var P=h(x,N,E.value,S);if(P===null){N===null&&(N=C);break}e&&N&&P.alternate===null&&t(x,N),g=a(P,g,T),A===null?j=P:A.sibling=P,A=P,N=C}if(E.done)return n(x,N),vt&&po(x,T),j;if(N===null){for(;!E.done;T++,E=w.next())E=f(x,E.value,S),E!==null&&(g=a(E,g,T),A===null?j=E:A.sibling=E,A=E);return vt&&po(x,T),j}for(N=r(x,N);!E.done;T++,E=w.next())E=m(N,x,T,E.value,S),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?T:E.key),g=a(E,g,T),A===null?j=E:A.sibling=E,A=E);return e&&N.forEach(function(k){return t(x,k)}),vt&&po(x,T),j}function b(x,g,w,S){if(typeof w=="object"&&w!==null&&w.type===Wl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Om:e:{for(var j=w.key,A=g;A!==null;){if(A.key===j){if(j=w.type,j===Wl){if(A.tag===7){n(x,A.sibling),g=i(A,w.props.children),g.return=x,x=g;break e}}else if(A.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===is&&VC(j)===A.type){n(x,A.sibling),g=i(A,w.props),g.ref=od(x,A,w),g.return=x,x=g;break e}n(x,A);break}else t(x,A);A=A.sibling}w.type===Wl?(g=Wo(w.props.children,x.mode,S,w.key),g.return=x,x=g):(S=kp(w.type,w.key,w.props,null,x.mode,S),S.ref=od(x,g,w),S.return=x,x=S)}return o(x);case Vl:e:{for(A=w.key;g!==null;){if(g.key===A)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(x,g.sibling),g=i(g,w.children||[]),g.return=x,x=g;break e}else{n(x,g);break}else t(x,g);g=g.sibling}g=xb(w,x.mode,S),g.return=x,x=g}return o(x);case is:return A=w._init,b(x,g,A(w._payload),S)}if(Pd(w))return y(x,g,w,S);if(nd(w))return p(x,g,w,S);Wm(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(x,g.sibling),g=i(g,w),g.return=x,x=g):(n(x,g),g=yb(w,x.mode,S),g.return=x,x=g),o(x)):n(x,g)}return b}var Uc=bR(!0),wR=bR(!1),Jp=eo(null),eg=null,Xl=null,SS=null;function AS(){SS=Xl=eg=null}function NS(e){var t=Jp.current;gt(Jp),e._currentValue=t}function aw(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 fc(e,t){eg=e,SS=Xl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Hn=!0),e.firstContext=null)}function Dr(e){var t=e._currentValue;if(SS!==e)if(e={context:e,memoizedValue:t,next:null},Xl===null){if(eg===null)throw Error(J(308));Xl=e,eg.dependencies={lanes:0,firstContext:e}}else Xl=Xl.next=e;return t}var No=null;function TS(e){No===null?No=[e]:No.push(e)}function jR(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,TS(t)):(n.next=i.next,i.next=n),t.interleaved=n,_a(e,r)}function _a(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 as=!1;function CS(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function SR(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 ba(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Os(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ye&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_a(e,n)}return i=r.interleaved,i===null?(t.next=t,TS(r)):(t.next=i.next,i.next=t),r.interleaved=t,_a(e,n)}function Sp(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,fS(e,n)}}function WC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tg(e,t,n,r){var i=e.updateQueue;as=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;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 y=e,p=l;switch(h=t,m=n,p.tag){case 1:if(y=p.payload,typeof y=="function"){f=y.call(m,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=p.payload,h=typeof y=="function"?y.call(m,f,h):y,h==null)break e;f=Tt({},f,h);break e;case 2:as=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Zo|=o,e.lanes=o,e.memoizedState=f}}function zC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=hb.transition;hb.transition={};try{e(!1),t()}finally{tt=n,hb.transition=r}}function BR(){return $r().memoizedState}function fH(e,t,n){var r=Is(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},VR(e))WR(t,n);else if(n=jR(e,t,n,r),n!==null){var i=Dn();ci(n,e,r,i),zR(n,t,r)}}function hH(e,t,n){var r=Is(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(VR(e))WR(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,hi(l,o)){var c=t.interleaved;c===null?(i.next=i,TS(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=jR(e,t,i,r),n!==null&&(i=Dn(),ci(n,e,r,i),zR(n,t,r))}}function VR(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function WR(e,t){Yd=rg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zR(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fS(e,n)}}var ig={readContext:Dr,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useInsertionEffect:pn,useLayoutEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useMutableSource:pn,useSyncExternalStore:pn,useId:pn,unstable_isNewReconciler:!1},mH={readContext:Dr,useCallback:function(e,t){return Ni().memoizedState=[e,t===void 0?null:t],e},useContext:Dr,useEffect:HC,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Np(4194308,4,RR.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Np(4194308,4,e,t)},useInsertionEffect:function(e,t){return Np(4,2,e,t)},useMemo:function(e,t){var n=Ni();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ni();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=fH.bind(null,Nt,e),[r.memoizedState,e]},useRef:function(e){var t=Ni();return e={current:e},t.memoizedState=e},useState:UC,useDebugValue:RS,useDeferredValue:function(e){return Ni().memoizedState=e},useTransition:function(){var e=UC(!1),t=e[0];return e=dH.bind(null,e[1]),Ni().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Nt,i=Ni();if(vt){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),nn===null)throw Error(J(349));Xo&30||CR(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,HC(kR.bind(null,r,a,e),[e]),r.flags|=2048,Tf(9,PR.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ni(),t=nn.identifierPrefix;if(vt){var n=pa,r=ma;n=(r&~(1<<32-li(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Af++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ei]=t,e[wf]=r,JR(e,t,!1,!1),t.stateNode=e;e:{switch(o=V0(n,r),n){case"dialog":ht("cancel",e),ht("close",e),i=r;break;case"iframe":case"object":case"embed":ht("load",e),i=r;break;case"video":case"audio":for(i=0;iGc&&(t.flags|=128,r=!0,ld(a,!1),t.lanes=4194304)}else{if(!r)if(e=ng(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ld(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!vt)return gn(t),null}else 2*Mt()-a.renderingStartTime>Gc&&n!==1073741824&&(t.flags|=128,r=!0,ld(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Mt(),t.sibling=null,n=St.current,ut(St,r?n&1|2:n&1),t):(gn(t),null);case 22:case 23:return VS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nr&1073741824&&(gn(t),t.subtreeFlags&6&&(t.flags|=8192)):gn(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function jH(e,t){switch(wS(t),t.tag){case 1:return Yn(t.type)&&Kp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hc(),gt(Gn),gt(Tn),ES(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kS(t),null;case 13:if(gt(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));zc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gt(St),null;case 4:return Hc(),null;case 10:return NS(t.type._context),null;case 22:case 23:return VS(),null;case 24:return null;default:return null}}var Um=!1,bn=!1,SH=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Zl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){kt(e,t,r)}else n.current=null}function mw(e,t,n){try{n()}catch(r){kt(e,t,r)}}var nP=!1;function AH(e,t){if(Z0=Hp,e=sR(),xS(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 i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(l=o+i),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===i&&(l=o),h===a&&++d===r&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Q0={focusedElem:e,selectionRange:n},Hp=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var p=y.memoizedProps,b=y.memoizedState,x=t.stateNode,g=x.getSnapshotBeforeUpdate(t.elementType===t.type?p:qr(t.type,p),b);x.__reactInternalSnapshotBeforeUpdate=g}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(J(163))}}catch(S){kt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return y=nP,nP=!1,y}function Kd(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&mw(t,n,a)}i=i.next}while(i!==r)}}function iy(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 pw(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 nD(e){var t=e.alternate;t!==null&&(e.alternate=null,nD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ei],delete t[wf],delete t[tw],delete t[sH],delete t[oH])),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 rD(e){return e.tag===5||e.tag===3||e.tag===4}function rP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rD(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 gw(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=Yp));else if(r!==4&&(e=e.child,e!==null))for(gw(e,t,n),e=e.sibling;e!==null;)gw(e,t,n),e=e.sibling}function vw(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(vw(e,t,n),e=e.sibling;e!==null;)vw(e,t,n),e=e.sibling}var cn=null,Yr=!1;function Ya(e,t,n){for(n=n.child;n!==null;)iD(e,t,n),n=n.sibling}function iD(e,t,n){if(Mi&&typeof Mi.onCommitFiberUnmount=="function")try{Mi.onCommitFiberUnmount(Xv,n)}catch{}switch(n.tag){case 5:bn||Zl(n,t);case 6:var r=cn,i=Yr;cn=null,Ya(e,t,n),cn=r,Yr=i,cn!==null&&(Yr?(e=cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cn.removeChild(n.stateNode));break;case 18:cn!==null&&(Yr?(e=cn,n=n.stateNode,e.nodeType===8?ub(e.parentNode,n):e.nodeType===1&&ub(e,n),gf(e)):ub(cn,n.stateNode));break;case 4:r=cn,i=Yr,cn=n.stateNode.containerInfo,Yr=!0,Ya(e,t,n),cn=r,Yr=i;break;case 0:case 11:case 14:case 15:if(!bn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&mw(n,t,o),i=i.next}while(i!==r)}Ya(e,t,n);break;case 1:if(!bn&&(Zl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){kt(n,t,l)}Ya(e,t,n);break;case 21:Ya(e,t,n);break;case 22:n.mode&1?(bn=(r=bn)||n.memoizedState!==null,Ya(e,t,n),bn=r):Ya(e,t,n);break;default:Ya(e,t,n)}}function iP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new SH),t.forEach(function(r){var i=IH.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Wr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Mt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*TH(r/1960))-r,10e?16:e,As===null)var r=!1;else{if(e=As,As=null,og=0,Ye&6)throw Error(J(331));var i=Ye;for(Ye|=4,ge=e.current;ge!==null;){var a=ge,o=a.child;if(ge.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cMt()-FS?Vo(e,0):LS|=n),Kn(e,t)}function fD(e,t){t===0&&(e.mode&1?(t=Rm,Rm<<=1,!(Rm&130023424)&&(Rm=4194304)):t=1);var n=Dn();e=_a(e,t),e!==null&&(Uh(e,t,n),Kn(e,n))}function _H(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fD(e,n)}function IH(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),fD(e,n)}var hD;hD=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gn.current)Hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Hn=!1,bH(e,t,n);Hn=!!(e.flags&131072)}else Hn=!1,vt&&t.flags&1048576&&vR(t,Qp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tp(e,t),e=t.pendingProps;var i=Wc(t,Tn.current);fc(t,n),i=_S(null,t,r,e,i,n);var a=IS();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(r)?(a=!0,Xp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,CS(t),i.updater=ry,t.stateNode=i,i._reactInternals=t,ow(t,r,e,n),t=uw(null,t,r,!0,a,n)):(t.tag=0,vt&&a&&bS(t),In(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=RH(r),e=qr(r,e),i){case 0:t=cw(null,t,r,e,n);break e;case 1:t=JC(null,t,r,e,n);break e;case 11:t=ZC(null,t,r,e,n);break e;case 14:t=QC(null,t,r,qr(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),cw(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),JC(e,t,r,i,n);case 3:e:{if(XR(t),e===null)throw Error(J(387));r=t.pendingProps,a=t.memoizedState,i=a.element,SR(e,t),tg(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=qc(Error(J(423)),t),t=eP(e,t,r,n,i);break e}else if(r!==i){i=qc(Error(J(424)),t),t=eP(e,t,r,n,i);break e}else for(lr=Es(t.stateNode.containerInfo.firstChild),cr=t,vt=!0,Qr=null,n=wR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zc(),r===i){t=Ia(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return AR(t),e===null&&iw(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,J0(r,i)?o=null:a!==null&&J0(r,a)&&(t.flags|=32),KR(e,t),In(e,t,o,n),t.child;case 6:return e===null&&iw(t),null;case 13:return ZR(e,t,n);case 4:return PS(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Uc(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),ZC(e,t,r,i,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,ut(Jp,r._currentValue),r._currentValue=o,a!==null)if(hi(a.value,o)){if(a.children===i.children&&!Gn.current){t=Ia(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=ba(-1,n&-n),c.tag=2;var u=a.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}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),aw(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(J(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),aw(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}In(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fc(t,n),i=Dr(i),r=r(i),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,i=qr(r,t.pendingProps),i=qr(r.type,i),QC(e,t,r,i,n);case 15:return GR(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),Tp(e,t),t.tag=1,Yn(r)?(e=!0,Xp(t)):e=!1,fc(t,n),UR(t,r,i),ow(t,r,i,n),uw(null,t,r,!0,e,n);case 19:return QR(e,t,n);case 22:return YR(e,t,n)}throw Error(J(156,t.tag))};function mD(e,t){return VM(e,t)}function MH(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 Pr(e,t,n,r){return new MH(e,t,n,r)}function zS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RH(e){if(typeof e=="function")return zS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lS)return 11;if(e===cS)return 14}return 2}function Ms(e,t){var n=e.alternate;return n===null?(n=Pr(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 kp(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")zS(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Wl:return Wo(n.children,i,a,t);case oS:o=8,i|=8;break;case O0:return e=Pr(12,n,t,i|2),e.elementType=O0,e.lanes=a,e;case _0:return e=Pr(13,n,t,i),e.elementType=_0,e.lanes=a,e;case I0:return e=Pr(19,n,t,i),e.elementType=I0,e.lanes=a,e;case AM:return sy(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jM:o=10;break e;case SM:o=9;break e;case lS:o=11;break e;case cS:o=14;break e;case is:o=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=Pr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Wo(e,t,n,r){return e=Pr(7,e,r,t),e.lanes=n,e}function sy(e,t,n,r){return e=Pr(22,e,r,t),e.elementType=AM,e.lanes=n,e.stateNode={isHidden:!1},e}function yb(e,t,n){return e=Pr(6,e,null,t),e.lanes=n,e}function xb(e,t,n){return t=Pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function DH(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jx(0),this.expirationTimes=Jx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jx(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function US(e,t,n,r,i,a,o,l,c){return e=new DH(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Pr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},CS(a),e}function $H(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yD)}catch(e){console.error(e)}}yD(),yM.exports=gr;var yl=yM.exports;const WH=st(yl);var xD,fP=yl;xD=fP.createRoot,fP.hydrateRoot;function zH(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],l="",c=e.split("/");for(c[0]||c.shift();i=c.shift();)n=i[0],n==="*"?(o.push(n),l+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=i.indexOf("?",1),a=i.indexOf(".",1),o.push(i.substring(1,~r?r:~a?a:i.length)),l+=~r&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(l+=(~r?"?":"")+"\\"+i.substring(a))):l+="/"+i;return{keys:o,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}var bD={exports:{}},wD={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yc=v;function UH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HH=typeof Object.is=="function"?Object.is:UH,qH=Yc.useState,GH=Yc.useEffect,YH=Yc.useLayoutEffect,KH=Yc.useDebugValue;function XH(e,t){var n=t(),r=qH({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return YH(function(){i.value=n,i.getSnapshot=t,bb(i)&&a({inst:i})},[e,n,t]),GH(function(){return bb(i)&&a({inst:i}),e(function(){bb(i)&&a({inst:i})})},[e]),KH(n),n}function bb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HH(e,n)}catch{return!0}}function ZH(e,t){return t()}var QH=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ZH:XH;wD.useSyncExternalStore=Yc.useSyncExternalStore!==void 0?Yc.useSyncExternalStore:QH;bD.exports=wD;var JH=bD.exports;const e7=gM.useInsertionEffect,t7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",n7=t7?v.useLayoutEffect:v.useEffect,r7=e7||n7,jD=e=>{const t=v.useRef([e,(...n)=>t[0](...n)]).current;return r7(()=>{t[0]=e}),t[1]},i7="popstate",YS="pushState",KS="replaceState",a7="hashchange",hP=[i7,YS,KS,a7],s7=e=>{for(const t of hP)addEventListener(t,e);return()=>{for(const t of hP)removeEventListener(t,e)}},SD=(e,t)=>JH.useSyncExternalStore(s7,e,t),o7=()=>location.search,l7=({ssrSearch:e=""}={})=>SD(o7,()=>e),mP=()=>location.pathname,c7=({ssrPath:e}={})=>SD(mP,e?()=>e:mP),u7=(e,{replace:t=!1,state:n=null}={})=>history[t?KS:YS](n,"",e),d7=(e={})=>[c7(e),u7],pP=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[pP]>"u"){for(const e of[YS,KS]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,pP,{value:!0})}const f7=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",AD=(e="")=>e==="/"?"":e,h7=(e,t)=>e[0]==="~"?e.slice(1):AD(t)+e,m7=(e="",t)=>f7(gP(AD(e)),gP(t)),gP=e=>{try{return decodeURI(e)}catch{return e}},ND={hook:d7,searchHook:l7,parser:zH,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},TD=v.createContext(ND),Yh=()=>v.useContext(TD),CD={},PD=v.createContext(CD),Kh=()=>v.useContext(PD),dy=e=>{const[t,n]=e.hook(e);return[m7(e.base,t),jD((r,i)=>n(h7(r,e.base),i))]},xl=()=>dy(Yh()),kD=(e,t,n,r)=>{const{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),o=i.exec(n)||[],[l,...c]=o;return l!==void 0?[!0,(()=>{const u=a!==!1?Object.fromEntries(a.map((f,h)=>[f,c[h]])):o.groups;let d={...c};return u&&Object.assign(d,u),d})(),...r?[l]:[]]:[!1,null]},p7=({children:e,...t})=>{var d,f;const n=Yh(),r=t.hook?ND:n;let i=r;const[a,o]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??((f=t.hook)==null?void 0:f.hrefs);let l=v.useRef({}),c=l.current,u=c;for(let h in r){const m=h==="base"?r[h]+(t[h]||""):t[h]||r[h];c===u&&m!==u[h]&&(l.current=u={...u}),u[h]=m,m!==r[h]&&(i=u)}return v.createElement(TD.Provider,{value:i,children:e})},vP=({children:e,component:t},n)=>t?v.createElement(t,{params:n}):typeof e=="function"?e(n):e,g7=e=>{let t=v.useRef(CD),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return Object.keys(e).length===0&&(n=e),t.current=n},wt=({path:e,nest:t,match:n,...r})=>{const i=Yh(),[a]=dy(i),[o,l,c]=n??kD(i.parser,e,a,t),u=g7({...Kh(),...l});if(!o)return null;const d=c?v.createElement(p7,{base:c},vP(r,u)):vP(r,u);return v.createElement(PD.Provider,{value:u,children:d})},de=v.forwardRef((e,t)=>{const n=Yh(),[r,i]=dy(n),{to:a="",href:o=a,onClick:l,asChild:c,children:u,className:d,replace:f,state:h,...m}=e,y=jD(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(l==null||l(b),b.defaultPrevented||(b.preventDefault(),i(o,e)))}),p=n.hrefs(o[0]==="~"?o.slice(1):n.base+o,n);return c&&v.isValidElement(u)?v.cloneElement(u,{onClick:y,href:p}):v.createElement("a",{...m,onClick:y,href:p,className:d!=null&&d.call?d(r===o):d,children:u,ref:t})}),ED=e=>Array.isArray(e)?e.flatMap(t=>ED(t&&t.type===v.Fragment?t.props.children:t)):[e],wb=({children:e,location:t})=>{const n=Yh(),[r]=dy(n);for(const i of ED(e)){let a=0;if(v.isValidElement(i)&&(a=kD(n.parser,i.props.path,t||r,i.props.nest))[0])return v.cloneElement(i,{match:a})}return null};var Mu=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(){}},Jo=typeof window>"u"||"Deno"in globalThis;function Nr(){}function v7(e,t){return typeof e=="function"?e(t):e}function jw(e){return typeof e=="number"&&e>=0&&e!==1/0}function OD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mc(e,t){return typeof e=="function"?e(t):e}function Jr(e,t){return typeof e=="function"?e(t):e}function yP(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==XS(o,t.options))return!1}else if(!Pf(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function xP(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(el(t.options.mutationKey)!==el(a))return!1}else if(!Pf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function XS(e,t){return((t==null?void 0:t.queryKeyHashFn)||el)(e)}function el(e){return JSON.stringify(e,(t,n)=>Sw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Pf(e[n],t[n])):!1}function _D(e,t){if(e===t)return e;const n=bP(e)&&bP(t);if(n||Sw(e)&&Sw(t)){const r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function Aw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?_D(e,t):t}function x7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function b7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ZS=Symbol();function ID(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ZS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Mo,ms,Pc,XI,w7=(XI=class extends Mu{constructor(){super();Se(this,Mo);Se(this,ms);Se(this,Pc);me(this,Pc,t=>{if(!Jo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,ms)||this.setEventListener(L(this,Pc))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ms))==null||t.call(this),me(this,ms,void 0))}setEventListener(t){var n;me(this,Pc,t),(n=L(this,ms))==null||n.call(this),me(this,ms,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){L(this,Mo)!==t&&(me(this,Mo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,Mo)=="boolean"?L(this,Mo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Mo=new WeakMap,ms=new WeakMap,Pc=new WeakMap,XI),QS=new w7,kc,ps,Ec,ZI,j7=(ZI=class extends Mu{constructor(){super();Se(this,kc,!0);Se(this,ps);Se(this,Ec);me(this,Ec,t=>{if(!Jo&&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(){L(this,ps)||this.setEventListener(L(this,Ec))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ps))==null||t.call(this),me(this,ps,void 0))}setEventListener(t){var n;me(this,Ec,t),(n=L(this,ps))==null||n.call(this),me(this,ps,t(this.setOnline.bind(this)))}setOnline(t){L(this,kc)!==t&&(me(this,kc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return L(this,kc)}},kc=new WeakMap,ps=new WeakMap,Ec=new WeakMap,ZI),dg=new j7;function Nw(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function S7(e){return Math.min(1e3*2**e,3e4)}function MD(e){return(e??"online")==="online"?dg.isOnline():!0}var RD=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jb(e){return e instanceof RD}function DD(e){let t=!1,n=0,r=!1,i;const a=Nw(),o=p=>{var b;r||(h(new RD(p)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>QS.isFocused()&&(e.networkMode==="always"||dg.isOnline())&&e.canRun(),d=()=>MD(e.networkMode)&&e.canRun(),f=p=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,p),i==null||i(),a.resolve(p))},h=p=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,p),i==null||i(),a.reject(p))},m=()=>new Promise(p=>{var b;i=x=>{(r||u())&&p(x)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;i=void 0,r||(p=e.onContinue)==null||p.call(e)}),y=()=>{if(r)return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(f).catch(x=>{var A;if(r)return;const g=e.retry??(Jo?0:3),w=e.retryDelay??S7,S=typeof w=="function"?w(n,x):w,j=g===!0||typeof g=="number"&&nu()?void 0:m()).then(()=>{t?h(x):y()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?y():m().then(y),a)}}function A7(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Yt=A7(),Ro,QI,$D=(QI=class{constructor(){Se(this,Ro)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jw(this.gcTime)&&me(this,Ro,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jo?1/0:5*60*1e3))}clearGcTimeout(){L(this,Ro)&&(clearTimeout(L(this,Ro)),me(this,Ro,void 0))}},Ro=new WeakMap,QI),Oc,_c,Ar,vn,Fh,Do,Gr,ia,JI,N7=(JI=class extends $D{constructor(t){super();Se(this,Gr);Se(this,Oc);Se(this,_c);Se(this,Ar);Se(this,vn);Se(this,Fh);Se(this,Do);me(this,Do,!1),me(this,Fh,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,Ar,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,Oc,T7(this.options)),this.state=t.state??L(this,Oc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,vn))==null?void 0:t.promise}setOptions(t){this.options={...L(this,Fh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Ar).remove(this)}setData(t,n){const r=Aw(this.state.data,t,this.options);return Fe(this,Gr,ia).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Fe(this,Gr,ia).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=L(this,vn))==null?void 0:r.promise;return(i=L(this,vn))==null||i.cancel(t),n?n.then(Nr).catch(Nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,Oc))}isActive(){return this.observers.some(t=>Jr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ZS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!OD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,vn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,vn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Ar).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,vn)&&(L(this,Do)?L(this,vn).cancel({revert:!0}):L(this,vn).cancelRetry()),this.scheduleGc()),L(this,Ar).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fe(this,Gr,ia).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,vn))return L(this,vn).continueRetry(),L(this,vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(me(this,Do,!0),r.signal)})},a=()=>{const f=ID(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),me(this,Do,!1),this.options.persister?this.options.persister(f,h,this):f(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),me(this,_c,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Fe(this,Gr,ia).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,m,y,p;jb(f)&&f.silent||Fe(this,Gr,ia).call(this,{type:"error",error:f}),jb(f)||((m=(h=L(this,Ar).config).onError)==null||m.call(h,f,this),(p=(y=L(this,Ar).config).onSettled)==null||p.call(y,this.state.data,f,this)),this.scheduleGc()};return me(this,vn,DD({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,m,y,p;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){l(b);return}(m=(h=L(this,Ar).config).onSuccess)==null||m.call(h,f,this),(p=(y=L(this,Ar).config).onSettled)==null||p.call(y,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Fe(this,Gr,ia).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Fe(this,Gr,ia).call(this,{type:"pause"})},onContinue:()=>{Fe(this,Gr,ia).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),L(this,vn).start()}},Oc=new WeakMap,_c=new WeakMap,Ar=new WeakMap,vn=new WeakMap,Fh=new WeakMap,Do=new WeakMap,Gr=new WeakSet,ia=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,...LD(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...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 i=t.error;return jb(i)&&i.revert&&L(this,_c)?{...L(this,_c),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),L(this,Ar).notify({query:this,type:"updated",action:t})})},JI);function LD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:MD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function T7(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 Ti,eM,C7=(eM=class extends Mu{constructor(t={}){super();Se(this,Ti);this.config=t,me(this,Ti,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??XS(i,n);let o=this.get(a);return o||(o=new N7({cache:this,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){L(this,Ti).has(t.queryHash)||(L(this,Ti).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Ti).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Ti).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Ti).get(t)}getAll(){return[...L(this,Ti).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yP(t,r)):n}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ti=new WeakMap,eM),Ci,En,$o,Pi,Qa,tM,P7=(tM=class extends $D{constructor(t){super();Se(this,Pi);Se(this,Ci);Se(this,En);Se(this,$o);this.mutationId=t.mutationId,me(this,En,t.mutationCache),me(this,Ci,[]),this.state=t.state||FD(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Ci).includes(t)||(L(this,Ci).push(t),this.clearGcTimeout(),L(this,En).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,Ci,L(this,Ci).filter(n=>n!==t)),this.scheduleGc(),L(this,En).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Ci).length||(this.state.status==="pending"?this.scheduleGc():L(this,En).remove(this))}continue(){var t;return((t=L(this,$o))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,o,l,c,u,d,f,h,m,y,p,b,x,g,w,S,j,A,N;me(this,$o,DD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,C)=>{Fe(this,Pi,Qa).call(this,{type:"failed",failureCount:T,error:C})},onPause:()=>{Fe(this,Pi,Qa).call(this,{type:"pause"})},onContinue:()=>{Fe(this,Pi,Qa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,En).canRun(this)}));const n=this.state.status==="pending",r=!L(this,$o).canStart();try{if(!n){Fe(this,Pi,Qa).call(this,{type:"pending",variables:t,isPaused:r}),await((a=(i=L(this,En).config).onMutate)==null?void 0:a.call(i,t,this));const C=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));C!==this.state.context&&Fe(this,Pi,Qa).call(this,{type:"pending",context:C,variables:t,isPaused:r})}const T=await L(this,$o).start();return await((u=(c=L(this,En).config).onSuccess)==null?void 0:u.call(c,T,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,t,this.state.context)),await((m=(h=L(this,En).config).onSettled)==null?void 0:m.call(h,T,null,this.state.variables,this.state.context,this)),await((p=(y=this.options).onSettled)==null?void 0:p.call(y,T,null,t,this.state.context)),Fe(this,Pi,Qa).call(this,{type:"success",data:T}),T}catch(T){try{throw await((x=(b=L(this,En).config).onError)==null?void 0:x.call(b,T,t,this.state.context,this)),await((w=(g=this.options).onError)==null?void 0:w.call(g,T,t,this.state.context)),await((j=(S=L(this,En).config).onSettled)==null?void 0:j.call(S,void 0,T,this.state.variables,this.state.context,this)),await((N=(A=this.options).onSettled)==null?void 0:N.call(A,void 0,T,t,this.state.context)),T}finally{Fe(this,Pi,Qa).call(this,{type:"error",error:T})}}finally{L(this,En).runNext(this)}}},Ci=new WeakMap,En=new WeakMap,$o=new WeakMap,Pi=new WeakSet,Qa=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),Yt.batch(()=>{L(this,Ci).forEach(r=>{r.onMutationUpdate(t)}),L(this,En).notify({mutation:this,type:"updated",action:t})})},tM);function FD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tr,Bh,nM,k7=(nM=class extends Mu{constructor(t={}){super();Se(this,tr);Se(this,Bh);this.config=t,me(this,tr,new Map),me(this,Bh,Date.now())}build(t,n,r){const i=new P7({mutationCache:this,mutationId:++Pm(this,Bh)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Gm(t),r=L(this,tr).get(n)??[];r.push(t),L(this,tr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Gm(t);if(L(this,tr).has(n)){const i=(r=L(this,tr).get(n))==null?void 0:r.filter(a=>a!==t);i&&(i.length===0?L(this,tr).delete(n):L(this,tr).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=L(this,tr).get(Gm(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=L(this,tr).get(Gm(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...L(this,tr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xP(n,r))}findAll(t={}){return this.getAll().filter(n=>xP(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nr))))}},tr=new WeakMap,Bh=new WeakMap,nM);function Gm(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function jP(e){return{onFetch:(t,n)=>{var d,f,h,m,y;const r=t.options,i=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=ID(t.options,t.fetchOptions),g=async(w,S,j)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const A={queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};b(A);const N=await x(A),{maxPages:T}=t.options,C=j?b7:x7;return{pages:C(w.pages,N,T),pageParams:C(w.pageParams,S,T)}};if(i&&a.length){const w=i==="backward",S=w?E7:SP,j={pages:a,pageParams:o},A=S(r,j);l=await g(j,A,w)}else{const w=e??a.length;do{const S=c===0?o[0]??r.initialPageParam:SP(r,l);if(c>0&&S==null)break;l=await g(l,S),c++}while(c{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function SP(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 E7(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 Ct,gs,vs,Ic,Mc,ys,Rc,Dc,rM,O7=(rM=class{constructor(e={}){Se(this,Ct);Se(this,gs);Se(this,vs);Se(this,Ic);Se(this,Mc);Se(this,ys);Se(this,Rc);Se(this,Dc);me(this,Ct,e.queryCache||new C7),me(this,gs,e.mutationCache||new k7),me(this,vs,e.defaultOptions||{}),me(this,Ic,new Map),me(this,Mc,new Map),me(this,ys,0)}mount(){Pm(this,ys)._++,L(this,ys)===1&&(me(this,Rc,QS.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Ct).onFocus())})),me(this,Dc,dg.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Ct).onOnline())})))}unmount(){var e,t;Pm(this,ys)._--,L(this,ys)===0&&((e=L(this,Rc))==null||e.call(this),me(this,Rc,void 0),(t=L(this,Dc))==null||t.call(this),me(this,Dc,void 0))}isFetching(e){return L(this,Ct).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Ct).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=L(this,Ct).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(mc(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return L(this,Ct).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=L(this,Ct).get(r.queryHash),a=i==null?void 0:i.state.data,o=v7(t,a);if(o!==void 0)return L(this,Ct).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>L(this,Ct).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Ct).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Ct);Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Ct),r={type:"active",...e};return Yt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Yt.batch(()=>L(this,Ct).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nr).catch(Nr)}invalidateQueries(e={},t={}){return Yt.batch(()=>{if(L(this,Ct).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Yt.batch(()=>L(this,Ct).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Nr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Ct).build(this,t);return n.isStaleByTime(mc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nr).catch(Nr)}fetchInfiniteQuery(e){return e.behavior=jP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nr).catch(Nr)}ensureInfiniteQueryData(e){return e.behavior=jP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return dg.isOnline()?L(this,gs).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Ct)}getMutationCache(){return L(this,gs)}getDefaultOptions(){return L(this,vs)}setDefaultOptions(e){me(this,vs,e)}setQueryDefaults(e,t){L(this,Ic).set(el(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Ic).values()];let n={};return t.forEach(r=>{Pf(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){L(this,Mc).set(el(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Mc).values()];let n={};return t.forEach(r=>{Pf(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,vs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=XS(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.enabled!==!0&&t.queryFn===ZS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,vs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Ct).clear(),L(this,gs).clear()}},Ct=new WeakMap,gs=new WeakMap,vs=new WeakMap,Ic=new WeakMap,Mc=new WeakMap,ys=new WeakMap,Rc=new WeakMap,Dc=new WeakMap,rM),Wn,Ue,Vh,On,Lo,$c,xs,ki,Wh,Lc,Fc,Fo,Bo,bs,Bc,Je,Od,Tw,Cw,Pw,kw,Ew,Ow,_w,BD,iM,_7=(iM=class extends Mu{constructor(t,n){super();Se(this,Je);Se(this,Wn);Se(this,Ue);Se(this,Vh);Se(this,On);Se(this,Lo);Se(this,$c);Se(this,xs);Se(this,ki);Se(this,Wh);Se(this,Lc);Se(this,Fc);Se(this,Fo);Se(this,Bo);Se(this,bs);Se(this,Bc,new Set);this.options=n,me(this,Wn,t),me(this,ki,null),me(this,xs,Nw()),this.options.experimental_prefetchInRender||L(this,xs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ue).addObserver(this),AP(L(this,Ue),this.options)?Fe(this,Je,Od).call(this):this.updateResult(),Fe(this,Je,kw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Iw(L(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Iw(L(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fe(this,Je,Ew).call(this),Fe(this,Je,Ow).call(this),L(this,Ue).removeObserver(this)}setOptions(t,n){const r=this.options,i=L(this,Ue);if(this.options=L(this,Wn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jr(this.options.enabled,L(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fe(this,Je,_w).call(this),L(this,Ue).setOptions(this.options),r._defaulted&&!ug(this.options,r)&&L(this,Wn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ue),observer:this});const a=this.hasListeners();a&&NP(L(this,Ue),i,this.options,r)&&Fe(this,Je,Od).call(this),this.updateResult(n),a&&(L(this,Ue)!==i||Jr(this.options.enabled,L(this,Ue))!==Jr(r.enabled,L(this,Ue))||mc(this.options.staleTime,L(this,Ue))!==mc(r.staleTime,L(this,Ue)))&&Fe(this,Je,Tw).call(this);const o=Fe(this,Je,Cw).call(this);a&&(L(this,Ue)!==i||Jr(this.options.enabled,L(this,Ue))!==Jr(r.enabled,L(this,Ue))||o!==L(this,bs))&&Fe(this,Je,Pw).call(this,o)}getOptimisticResult(t){const n=L(this,Wn).getQueryCache().build(L(this,Wn),t),r=this.createResult(n,t);return M7(this,r)&&(me(this,On,r),me(this,$c,this.options),me(this,Lo,L(this,Ue).state)),r}getCurrentResult(){return L(this,On)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){L(this,Bc).add(t)}getCurrentQuery(){return L(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,Wn).defaultQueryOptions(t),r=L(this,Wn).getQueryCache().build(L(this,Wn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Fe(this,Je,Od).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,On)))}createResult(t,n){var T;const r=L(this,Ue),i=this.options,a=L(this,On),o=L(this,Lo),l=L(this,$c),u=t!==r?t.state:L(this,Vh),{state:d}=t;let f={...d},h=!1,m;if(n._optimisticResults){const C=this.hasListeners(),E=!C&&AP(t,n),P=C&&NP(t,r,n,i);(E||P)&&(f={...f,...LD(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:b}=f;if(n.select&&f.data!==void 0)if(a&&f.data===(o==null?void 0:o.data)&&n.select===L(this,Wh))m=L(this,Lc);else try{me(this,Wh,n.select),m=n.select(f.data),m=Aw(a==null?void 0:a.data,m,n),me(this,Lc,m),me(this,ki,null)}catch(C){me(this,ki,C)}else m=f.data;if(n.placeholderData!==void 0&&m===void 0&&b==="pending"){let C;if(a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))C=a.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData((T=L(this,Fc))==null?void 0:T.state.data,L(this,Fc)):n.placeholderData,n.select&&C!==void 0)try{C=n.select(C),me(this,ki,null)}catch(E){me(this,ki,E)}C!==void 0&&(b="success",m=Aw(a==null?void 0:a.data,C,n),h=!0)}L(this,ki)&&(y=L(this,ki),m=L(this,Lc),p=Date.now(),b="error");const x=f.fetchStatus==="fetching",g=b==="pending",w=b==="error",S=g&&x,j=m!==void 0,N={status:b,fetchStatus:f.fetchStatus,isPending:g,isSuccess:b==="success",isError:w,isInitialLoading:S,isLoading:S,data:m,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!g,isLoadingError:w&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:w&&j,isStale:JS(t,n),refetch:this.refetch,promise:L(this,xs)};if(this.options.experimental_prefetchInRender){const C=k=>{N.status==="error"?k.reject(N.error):N.data!==void 0&&k.resolve(N.data)},E=()=>{const k=me(this,xs,N.promise=Nw());C(k)},P=L(this,xs);switch(P.status){case"pending":t.queryHash===r.queryHash&&C(P);break;case"fulfilled":(N.status==="error"||N.data!==P.value)&&E();break;case"rejected":(N.status!=="error"||N.error!==P.reason)&&E();break}}return N}updateResult(t){const n=L(this,On),r=this.createResult(L(this,Ue),this.options);if(me(this,Lo,L(this,Ue).state),me(this,$c,this.options),L(this,Lo).data!==void 0&&me(this,Fc,L(this,Ue)),ug(r,n))return;me(this,On,r);const i={},a=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!L(this,Bc).size)return!0;const c=new Set(l??L(this,Bc));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,On)).some(u=>{const d=u;return L(this,On)[d]!==n[d]&&c.has(d)})};(t==null?void 0:t.listeners)!==!1&&a()&&(i.listeners=!0),Fe(this,Je,BD).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fe(this,Je,kw).call(this)}},Wn=new WeakMap,Ue=new WeakMap,Vh=new WeakMap,On=new WeakMap,Lo=new WeakMap,$c=new WeakMap,xs=new WeakMap,ki=new WeakMap,Wh=new WeakMap,Lc=new WeakMap,Fc=new WeakMap,Fo=new WeakMap,Bo=new WeakMap,bs=new WeakMap,Bc=new WeakMap,Je=new WeakSet,Od=function(t){Fe(this,Je,_w).call(this);let n=L(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nr)),n},Tw=function(){Fe(this,Je,Ew).call(this);const t=mc(this.options.staleTime,L(this,Ue));if(Jo||L(this,On).isStale||!jw(t))return;const r=OD(L(this,On).dataUpdatedAt,t)+1;me(this,Fo,setTimeout(()=>{L(this,On).isStale||this.updateResult()},r))},Cw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ue)):this.options.refetchInterval)??!1},Pw=function(t){Fe(this,Je,Ow).call(this),me(this,bs,t),!(Jo||Jr(this.options.enabled,L(this,Ue))===!1||!jw(L(this,bs))||L(this,bs)===0)&&me(this,Bo,setInterval(()=>{(this.options.refetchIntervalInBackground||QS.isFocused())&&Fe(this,Je,Od).call(this)},L(this,bs)))},kw=function(){Fe(this,Je,Tw).call(this),Fe(this,Je,Pw).call(this,Fe(this,Je,Cw).call(this))},Ew=function(){L(this,Fo)&&(clearTimeout(L(this,Fo)),me(this,Fo,void 0))},Ow=function(){L(this,Bo)&&(clearInterval(L(this,Bo)),me(this,Bo,void 0))},_w=function(){const t=L(this,Wn).getQueryCache().build(L(this,Wn),this.options);if(t===L(this,Ue))return;const n=L(this,Ue);me(this,Ue,t),me(this,Vh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},BD=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,On))}),L(this,Wn).getQueryCache().notify({query:L(this,Ue),type:"observerResultsUpdated"})})},iM);function I7(e,t){return Jr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function AP(e,t){return I7(e,t)||e.state.data!==void 0&&Iw(e,t,t.refetchOnMount)}function Iw(e,t,n){if(Jr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&JS(e,t)}return!1}function NP(e,t,n,r){return(e!==t||Jr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&JS(e,n)}function JS(e,t){return Jr(t.enabled,e)!==!1&&e.isStaleByTime(mc(t.staleTime,e))}function M7(e,t){return!ug(e.getCurrentResult(),t)}var ws,js,zn,fa,ka,Ep,Mw,aM,R7=(aM=class extends Mu{constructor(n,r){super();Se(this,ka);Se(this,ws);Se(this,js);Se(this,zn);Se(this,fa);me(this,ws,n),this.setOptions(r),this.bindMethods(),Fe(this,ka,Ep).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=L(this,ws).defaultMutationOptions(n),ug(this.options,r)||L(this,ws).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,zn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&el(r.mutationKey)!==el(this.options.mutationKey)?this.reset():((i=L(this,zn))==null?void 0:i.state.status)==="pending"&&L(this,zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=L(this,zn))==null||n.removeObserver(this)}onMutationUpdate(n){Fe(this,ka,Ep).call(this),Fe(this,ka,Mw).call(this,n)}getCurrentResult(){return L(this,js)}reset(){var n;(n=L(this,zn))==null||n.removeObserver(this),me(this,zn,void 0),Fe(this,ka,Ep).call(this),Fe(this,ka,Mw).call(this)}mutate(n,r){var i;return me(this,fa,r),(i=L(this,zn))==null||i.removeObserver(this),me(this,zn,L(this,ws).getMutationCache().build(L(this,ws),this.options)),L(this,zn).addObserver(this),L(this,zn).execute(n)}},ws=new WeakMap,js=new WeakMap,zn=new WeakMap,fa=new WeakMap,ka=new WeakSet,Ep=function(){var r;const n=((r=L(this,zn))==null?void 0:r.state)??FD();me(this,js,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Mw=function(n){Yt.batch(()=>{var r,i,a,o,l,c,u,d;if(L(this,fa)&&this.hasListeners()){const f=L(this,js).variables,h=L(this,js).context;(n==null?void 0:n.type)==="success"?((i=(r=L(this,fa)).onSuccess)==null||i.call(r,n.data,f,h),(o=(a=L(this,fa)).onSettled)==null||o.call(a,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((c=(l=L(this,fa)).onError)==null||c.call(l,n.error,f,h),(d=(u=L(this,fa)).onSettled)==null||d.call(u,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(L(this,js))})})},aM),VD=v.createContext(void 0),WD=e=>{const t=v.useContext(VD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D7=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(VD.Provider,{value:e,children:t})),zD=v.createContext(!1),$7=()=>v.useContext(zD);zD.Provider;function L7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var F7=v.createContext(L7()),B7=()=>v.useContext(F7);function UD(e,t){return typeof e=="function"?e(...t):!!e}function Rw(){}var V7=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},W7=e=>{v.useEffect(()=>{e.clearReset()},[e])},z7=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&UD(n,[e.error,r]),U7=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},H7=(e,t)=>e.isLoading&&e.isFetching&&!t,q7=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,TP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function G7(e,t,n){var d,f,h,m,y;const r=WD(),i=$7(),a=B7(),o=r.defaultQueryOptions(e);(f=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",U7(o),V7(o,a),W7(a);const l=!r.getQueryCache().get(o.queryHash),[c]=v.useState(()=>new t(r,o)),u=c.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(p=>{const b=i?Rw:c.subscribe(Yt.batchCalls(p));return c.updateResult(),b},[c,i]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(o,{listeners:!1})},[o,c]),q7(o,u))throw TP(o,c,a);if(z7({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,o,u),o.experimental_prefetchInRender&&!Jo&&H7(u,i)){const p=l?TP(o,c,a):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;p==null||p.catch(Rw).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function $t(e,t){return G7(e,_7)}function tn(e,t){const n=WD(),[r]=v.useState(()=>new R7(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(Yt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=v.useCallback((o,l)=>{r.mutate(o,l).catch(Rw)},[r]);if(i.error&&UD(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}async function HD(e){if(!e.ok){const t=await e.text()||e.statusText;throw new Error(`${e.status}: ${t}`)}}async function zt(e,t,n){const r=await fetch(t,{method:e,headers:n?{"Content-Type":"application/json"}:{},body:n?JSON.stringify(n):void 0,credentials:"include"});return await HD(r),r}const Y7=({on401:e})=>async({queryKey:t})=>{const n=await fetch(t.join("/"),{credentials:"include"});return e==="returnNull"&&n.status===401?null:(await HD(n),await n.json())},Sn=new O7({defaultOptions:{queries:{queryFn:Y7({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),K7=1,X7=1e6;let Sb=0;function Z7(){return Sb=(Sb+1)%Number.MAX_SAFE_INTEGER,Sb.toString()}const Ab=new Map,CP=e=>{if(Ab.has(e))return;const t=setTimeout(()=>{Ab.delete(e),Qd({type:"REMOVE_TOAST",toastId:e})},X7);Ab.set(e,t)},Q7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,K7)};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;return n?CP(n):e.toasts.forEach(r=>{CP(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)}}},Op=[];let _p={toasts:[]};function Qd(e){_p=Q7(_p,e),Op.forEach(t=>{t(_p)})}function J7({...e}){const t=Z7(),n=i=>Qd({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Qd({type:"DISMISS_TOAST",toastId:t});return Qd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function Pn(){const[e,t]=v.useState(_p);return v.useEffect(()=>(Op.push(t),()=>{const n=Op.indexOf(t);n>-1&&Op.splice(n,1)}),[e]),{...e,toast:J7,dismiss:n=>Qd({type:"DISMISS_TOAST",toastId:n})}}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function PP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fy(...e){return t=>{let n=!1;const r=e.map(i=>{const a=PP(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i{const{children:o,...l}=a,c=v.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function rn(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];const u=f=>{var x;const{scope:h,children:m,...y}=f,p=((x=h==null?void 0:h[e])==null?void 0:x[c])||l,b=v.useMemo(()=>y,Object.values(y));return s.jsx(p.Provider,{value:b,children:m})};u.displayName=a+"Provider";function d(f,h){var p;const m=((p=h==null?void 0:h[e])==null?void 0:p[c])||l,y=v.useContext(m);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,tq(i,...t)]}function tq(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Vs(e){const t=nq(e),n=v.forwardRef((r,i)=>{const{children:a,...o}=r,l=v.Children.toArray(a),c=l.find(rq);if(c){const u=c.props.children,d=l.map(f=>f===c?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:i,children:v.isValidElement(u)?v.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var eA=Vs("Slot");function nq(e){const t=v.forwardRef((n,r)=>{const{children:i,...a}=n;if(v.isValidElement(i)){const o=aq(i),l=iq(a,i.props);return i.type!==v.Fragment&&(l.ref=r?fy(r,o):o),v.cloneElement(i,l)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qD=Symbol("radix.slottable");function GD(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=qD,t}function rq(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qD}function iq(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{a(...l),i(...l)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function aq(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xh(e){const t=e+"CollectionProvider",[n,r]=rn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:b,children:x}=p,g=_.useRef(null),w=_.useRef(new Map).current;return s.jsx(i,{scope:b,itemMap:w,collectionRef:g,children:x})};o.displayName=t;const l=e+"CollectionSlot",c=Vs(l),u=_.forwardRef((p,b)=>{const{scope:x,children:g}=p,w=a(l,x),S=ke(b,w.collectionRef);return s.jsx(c,{ref:S,children:g})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Vs(d),m=_.forwardRef((p,b)=>{const{scope:x,children:g,...w}=p,S=_.useRef(null),j=ke(b,S),A=a(d,x);return _.useEffect(()=>(A.itemMap.set(S,{ref:S,...w}),()=>void A.itemMap.delete(S))),s.jsx(h,{[f]:"",ref:j,children:g})});m.displayName=d;function y(p){const b=a(e+"CollectionConsumer",p);return _.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,N)=>w.indexOf(A.ref.current)-w.indexOf(N.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},y,r]}var sq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ye=sq.reduce((e,t)=>{const n=Vs(`Primitive.${t}`),r=v.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tA(e,t){e&&yl.flushSync(()=>e.dispatchEvent(t))}function yt(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function oq(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var lq="DismissableLayer",Dw="dismissableLayer.update",cq="dismissableLayer.pointerDownOutside",uq="dismissableLayer.focusOutside",kP,YD=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bl=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=v.useContext(YD),[d,f]=v.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=v.useState({}),y=ke(t,N=>f(N)),p=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(b),g=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=g>=x,j=fq(N=>{const T=N.target,C=[...u.branches].some(E=>E.contains(T));!S||C||(i==null||i(N),o==null||o(N),N.defaultPrevented||l==null||l())},h),A=hq(N=>{const T=N.target;[...u.branches].some(E=>E.contains(T))||(a==null||a(N),o==null||o(N),N.defaultPrevented||l==null||l())},h);return oq(N=>{g===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},h),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(kP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),EP(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=kP)}},[d,h,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),EP())},[d,u]),v.useEffect(()=>{const N=()=>m({});return document.addEventListener(Dw,N),()=>document.removeEventListener(Dw,N)},[]),s.jsx(ye.div,{...c,ref:y,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,j.onPointerDownCapture)})});bl.displayName=lq;var dq="DismissableLayerBranch",KD=v.forwardRef((e,t)=>{const n=v.useContext(YD),r=v.useRef(null),i=ke(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(ye.div,{...e,ref:i})});KD.displayName=dq;function fq(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){XD(cq,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hq(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=v.useRef(!1);return v.useEffect(()=>{const i=a=>{a.target&&!r.current&&XD(uq,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function EP(){const e=new CustomEvent(Dw);document.dispatchEvent(e)}function XD(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tA(i,a):i.dispatchEvent(a)}var mq=bl,pq=KD,Ft=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},gq="Portal",Ru=v.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=v.useState(!1);Ft(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?WH.createPortal(s.jsx(ye.div,{...r,ref:t}),o):null});Ru.displayName=gq;function vq(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var an=e=>{const{present:t,children:n}=e,r=yq(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=ke(r.ref,xq(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:a}):null};an.displayName="Presence";function yq(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[l,c]=vq(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Ym(r.current);a.current=l==="mounted"?u:"none"},[l]),Ft(()=>{const u=r.current,d=i.current;if(d!==e){const h=a.current,m=Ym(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Ft(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const p=Ym(r.current).includes(m.animationName);if(m.target===t&&p&&(c("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=m=>{m.target===t&&(a.current=Ym(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:v.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Ym(e){return(e==null?void 0:e.animationName)||"none"}function xq(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=bq({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,l=yt(n),c=v.useCallback(u=>{if(a){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else i(u)},[a,e,i,l]);return[o,c]}function bq({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),a=yt(t);return v.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var wq="VisuallyHidden",Zh=v.forwardRef((e,t)=>s.jsx(ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Zh.displayName=wq;var jq=Zh,nA="ToastProvider",[rA,Sq,Aq]=Xh("Toast"),[ZD,S_e]=rn("Toast",[Aq]),[Nq,hy]=ZD(nA),QD=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:o}=e,[l,c]=v.useState(null),[u,d]=v.useState(0),f=v.useRef(!1),h=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${nA}\`. Expected non-empty \`string\`.`),s.jsx(rA.Provider,{scope:t,children:s.jsx(Nq,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:v.useCallback(()=>d(m=>m+1),[]),onToastRemove:v.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};QD.displayName=nA;var JD="ToastViewport",Tq=["F8"],$w="toast.viewportPause",Lw="toast.viewportResume",e$=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Tq,label:i="Notifications ({hotkey})",...a}=e,o=hy(JD,n),l=Sq(n),c=v.useRef(null),u=v.useRef(null),d=v.useRef(null),f=v.useRef(null),h=ke(t,f,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;v.useEffect(()=>{const b=x=>{var w;r.length!==0&&r.every(S=>x[S]||x.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),v.useEffect(()=>{const b=c.current,x=f.current;if(y&&b&&x){const g=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent($w);x.dispatchEvent(A),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(Lw);x.dispatchEvent(A),o.isClosePausedRef.current=!1}},S=A=>{!b.contains(A.relatedTarget)&&w()},j=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",g),b.addEventListener("focusout",S),b.addEventListener("pointermove",g),b.addEventListener("pointerleave",j),window.addEventListener("blur",g),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",g),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",g),b.removeEventListener("pointerleave",j),window.removeEventListener("blur",g),window.removeEventListener("focus",w)}}},[y,o.isClosePausedRef]);const p=v.useCallback(({tabbingDirection:b})=>{const g=l().map(w=>{const S=w.ref.current,j=[S,...Fq(S)];return b==="forwards"?j:j.reverse()});return(b==="forwards"?g.reverse():g).flat()},[l]);return v.useEffect(()=>{const b=f.current;if(b){const x=g=>{var j,A,N;const w=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!w){const T=document.activeElement,C=g.shiftKey;if(g.target===b&&C){(j=u.current)==null||j.focus();return}const k=p({tabbingDirection:C?"backwards":"forwards"}),$=k.findIndex(I=>I===T);Nb(k.slice($+1))?g.preventDefault():C?(A=u.current)==null||A.focus():(N=d.current)==null||N.focus()}};return b.addEventListener("keydown",x),()=>b.removeEventListener("keydown",x)}},[l,p]),s.jsxs(pq,{ref:c,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&s.jsx(Fw,{ref:u,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"forwards"});Nb(b)}}),s.jsx(rA.Slot,{scope:n,children:s.jsx(ye.ol,{tabIndex:-1,...a,ref:h})}),y&&s.jsx(Fw,{ref:d,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"backwards"});Nb(b)}})]})});e$.displayName=JD;var t$="ToastFocusProxy",Fw=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=hy(t$,n);return s.jsx(Zh,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Fw.displayName=t$;var my="Toast",Cq="toast.swipeStart",Pq="toast.swipeMove",kq="toast.swipeCancel",Eq="toast.swipeEnd",n$=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[l=!0,c]=hr({prop:r,defaultProp:i,onChange:a});return s.jsx(an,{present:n||l,children:s.jsx(Iq,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:yt(e.onPause),onResume:yt(e.onResume),onSwipeStart:ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ee(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:ee(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:ee(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)})})})});n$.displayName=my;var[Oq,_q]=ZD(my,{onClose(){}}),Iq=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...y}=e,p=hy(my,n),[b,x]=v.useState(null),g=ke(t,I=>x(I)),w=v.useRef(null),S=v.useRef(null),j=i||p.duration,A=v.useRef(0),N=v.useRef(j),T=v.useRef(0),{onToastAdd:C,onToastRemove:E}=p,P=yt(()=>{var F;(b==null?void 0:b.contains(document.activeElement))&&((F=p.viewport)==null||F.focus()),o()}),k=v.useCallback(I=>{!I||I===1/0||(window.clearTimeout(T.current),A.current=new Date().getTime(),T.current=window.setTimeout(P,I))},[P]);v.useEffect(()=>{const I=p.viewport;if(I){const F=()=>{k(N.current),u==null||u()},R=()=>{const B=new Date().getTime()-A.current;N.current=N.current-B,window.clearTimeout(T.current),c==null||c()};return I.addEventListener($w,R),I.addEventListener(Lw,F),()=>{I.removeEventListener($w,R),I.removeEventListener(Lw,F)}}},[p.viewport,j,c,u,k]),v.useEffect(()=>{a&&!p.isClosePausedRef.current&&k(j)},[a,j,p.isClosePausedRef,k]),v.useEffect(()=>(C(),()=>E()),[C,E]);const $=v.useMemo(()=>b?c$(b):null,[b]);return p.viewport?s.jsxs(s.Fragment,{children:[$&&s.jsx(Mq,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),s.jsx(Oq,{scope:n,onClose:P,children:yl.createPortal(s.jsx(rA.ItemSlot,{scope:n,children:s.jsx(mq,{asChild:!0,onEscapeKeyDown:ee(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||P(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ye.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ee(e.onKeyDown,I=>{I.key==="Escape"&&(l==null||l(I.nativeEvent),I.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:ee(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:ee(e.onPointerMove,I=>{if(!w.current)return;const F=I.clientX-w.current.x,R=I.clientY-w.current.y,B=!!S.current,O=["left","right"].includes(p.swipeDirection),M=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,W=O?M(0,F):0,Y=O?0:M(0,R),q=I.pointerType==="touch"?10:2,oe={x:W,y:Y},je={originalEvent:I,delta:oe};B?(S.current=oe,Km(Pq,f,je,{discrete:!1})):OP(oe,p.swipeDirection,q)?(S.current=oe,Km(Cq,d,je,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(F)>q||Math.abs(R)>q)&&(w.current=null)}),onPointerUp:ee(e.onPointerUp,I=>{const F=S.current,R=I.target;if(R.hasPointerCapture(I.pointerId)&&R.releasePointerCapture(I.pointerId),S.current=null,w.current=null,F){const B=I.currentTarget,O={originalEvent:I,delta:F};OP(F,p.swipeDirection,p.swipeThreshold)?Km(Eq,m,O,{discrete:!0}):Km(kq,h,O,{discrete:!0}),B.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Mq=e=>{const{__scopeToast:t,children:n,...r}=e,i=hy(my,t),[a,o]=v.useState(!1),[l,c]=v.useState(!1);return $q(()=>o(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(Ru,{asChild:!0,children:s.jsx(Zh,{...r,children:a&&s.jsxs(s.Fragment,{children:[i.label," ",n]})})})},Rq="ToastTitle",r$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ye.div,{...r,ref:t})});r$.displayName=Rq;var Dq="ToastDescription",i$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ye.div,{...r,ref:t})});i$.displayName=Dq;var a$="ToastAction",s$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(l$,{altText:n,asChild:!0,children:s.jsx(iA,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${a$}\`. Expected non-empty \`string\`.`),null)});s$.displayName=a$;var o$="ToastClose",iA=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=_q(o$,n);return s.jsx(l$,{asChild:!0,children:s.jsx(ye.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,i.onClose)})})});iA.displayName=o$;var l$=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return s.jsx(ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function c$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Lq(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...c$(r))}}),t}function Km(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tA(i,a):i.dispatchEvent(a)}var OP=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t==="left"||t==="right"?a&&r>n:!a&&i>n};function $q(e=()=>{}){const t=yt(e);Ft(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Lq(e){return e.nodeType===e.ELEMENT_NODE}function Fq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nb(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Bq=QD,u$=e$,d$=n$,f$=r$,h$=i$,m$=s$,p$=iA;function g$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,IP=Ge,Du=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return IP(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=a==null?void 0:a[u];if(d===null)return null;const h=_P(d)||_P(f);return i[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(y=>{let[p,b]=y;return Array.isArray(b)?b.includes({...a,...l}[p]):{...a,...l}[p]===b})?[...u,f,h]:u},[]);return IP(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v$=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Wq={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"};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zq=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>v.createElement("svg",{ref:c,...Wq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:v$("lucide",i),...l},[...o.map(([u,d])=>v.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ne=(e,t)=>{const n=v.forwardRef(({className:r,...i},a)=>v.createElement(zq,{ref:a,iconNode:t,className:v$(`lucide-${Vq(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Uq=ne("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y$=ne("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _r=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kr=ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x$=ne("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hq=ne("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qq=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gq=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ui=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MP=ne("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aA=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yq=ne("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sA=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kf=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kc=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const py=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oA=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kq=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wl=ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lA=ne("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ds=ne("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b$=ne("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tl=ne("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xq=ne("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mi=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nl=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RP=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gy=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w$=ne("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ef=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zq=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j$=ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qq=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jq=ne("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pc=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DP=ne("FileUp",[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e9=ne("File",[["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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Of=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S$=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $P=ne("Heart",[["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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t9=ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const A$=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LP=ne("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r9=ne("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ss=ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cA=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fg=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const di=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rl=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a9=ne("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hg=ne("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const s9=ne("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N$=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const o9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l9=ne("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gc=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mg=ne("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c9=ne("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const u9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vy=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const d9=ne("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const il=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const f9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xc=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bw=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const m9=ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FP=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vw=ne("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uA=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ws=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p9=ne("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yy=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dA=ne("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xy=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ui=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BP=ne("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y9=ne("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x9=ne("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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zo=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hi=ne("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"}]]),fA="-",b9=e=>{const t=j9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(fA);return l[0]===""&&l.length!==1&&l.shift(),T$(l,t)||w9(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},T$=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?T$(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(fA);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},VP=/^\[(.+)\]$/,w9=e=>{if(VP.test(e)){const t=VP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},j9=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return A9(Object.entries(e.classGroups),n).forEach(([a,o])=>{Ww(o,r,a,t)}),r},Ww=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:WP(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(S9(i)){Ww(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{Ww(o,WP(t,a),n,r)})})},WP=(e,t)=>{let n=e;return t.split(fA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},S9=e=>e.isThemeGetter,A9=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,i]}):e,N9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},C$="!",T9=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let b=0;bd?f-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:p}};return n?l=>n({className:l,parseClassName:o}):o},C9=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},P9=e=>({cache:N9(e.cacheSize),parseClassName:T9(e),...b9(e)}),k9=/\s+/,E9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(k9);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(u);let y=!!m,p=r(y?h.substring(0,m):h);if(!p){if(!y){l=u+(l.length>0?" "+l:l);continue}if(p=r(h),!p){l=u+(l.length>0?" "+l:l);continue}y=!1}const b=C9(d).join(":"),x=f?b+C$:b,g=x+p;if(a.includes(g))continue;a.push(g);const w=i(p,y);for(let S=0;S0?" "+l:l)}return l};function O9(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(d),e());return n=P9(u),r=n.cache.get,i=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=E9(c,n);return i(c,d),d}return function(){return a(O9.apply(null,arguments))}}const ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},k$=/^\[(?:([a-z-]+):)?(.+)\]$/i,I9=/^\d+\/\d+$/,M9=new Set(["px","full","screen"]),R9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D9=/\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$/,$9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ea=e=>vc(e)||M9.has(e)||I9.test(e),Ka=e=>$u(e,"length",G9),vc=e=>!!e&&!Number.isNaN(Number(e)),Tb=e=>$u(e,"number",vc),ud=e=>!!e&&Number.isInteger(Number(e)),B9=e=>e.endsWith("%")&&vc(e.slice(0,-1)),Ie=e=>k$.test(e),Xa=e=>R9.test(e),V9=new Set(["length","size","percentage"]),W9=e=>$u(e,V9,E$),z9=e=>$u(e,"position",E$),U9=new Set(["image","url"]),H9=e=>$u(e,U9,K9),q9=e=>$u(e,"",Y9),dd=()=>!0,$u=(e,t,n)=>{const r=k$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},G9=e=>D9.test(e)&&!$9.test(e),E$=()=>!1,Y9=e=>L9.test(e),K9=e=>F9.test(e),X9=()=>{const e=ft("colors"),t=ft("spacing"),n=ft("blur"),r=ft("brightness"),i=ft("borderColor"),a=ft("borderRadius"),o=ft("borderSpacing"),l=ft("borderWidth"),c=ft("contrast"),u=ft("grayscale"),d=ft("hueRotate"),f=ft("invert"),h=ft("gap"),m=ft("gradientColorStops"),y=ft("gradientColorStopPositions"),p=ft("inset"),b=ft("margin"),x=ft("opacity"),g=ft("padding"),w=ft("saturate"),S=ft("scale"),j=ft("sepia"),A=ft("skew"),N=ft("space"),T=ft("translate"),C=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Ie,t],k=()=>[Ie,t],$=()=>["",ea,Ka],I=()=>["auto",vc,Ie],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",Ie],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[vc,Ie];return{cacheSize:500,separator:":",theme:{colors:[dd],spacing:[ea,Ka],blur:["none","",Xa,Ie],brightness:Y(),borderColor:[e],borderRadius:["none","","full",Xa,Ie],borderSpacing:k(),borderWidth:$(),contrast:Y(),grayscale:M(),hueRotate:Y(),invert:M(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[B9,Ka],inset:P(),margin:P(),opacity:Y(),padding:k(),saturate:Y(),scale:Y(),sepia:M(),skew:Y(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[Xa]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:[...F(),Ie]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ud,Ie]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",ud,Ie]}],"grid-cols":[{"grid-cols":[dd]}],"col-start-end":[{col:["auto",{span:["full",ud,Ie]},Ie]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[dd]}],"row-start-end":[{row:["auto",{span:[ud,Ie]},Ie]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,t]}],"min-w":[{"min-w":[Ie,t,"min","max","fit"]}],"max-w":[{"max-w":[Ie,t,"none","full","min","max","fit","prose",{screen:[Xa]},Xa]}],h:[{h:[Ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xa,Ka]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tb]}],"font-family":[{font:[dd]}],"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",Ie]}],"line-clamp":[{"line-clamp":["none",vc,Tb]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ea,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"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:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ea,Ka]}],"underline-offset":[{"underline-offset":["auto",ea,Ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],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",Ie]}],"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:[...F(),z9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",W9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[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:[...R(),"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:R()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[ea,Ie]}],"outline-w":[{outline:[ea,Ka]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ea,Ka]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xa,q9]}],"shadow-color":[{shadow:[dd]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Xa,Ie]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"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":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ie]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ud,Ie]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],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",Ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],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",Ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ea,Ka,Tb]}],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"]}}},Z9=_9(X9);function Q(...e){return Z9(Ge(e))}const Q9=Bq,O$=v.forwardRef(({className:e,...t},n)=>s.jsx(u$,{ref:n,className:Q("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}));O$.displayName=u$.displayName;const J9=Du("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"}}),_$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(d$,{ref:r,className:Q(J9({variant:t}),e),...n}));_$.displayName=d$.displayName;const eG=v.forwardRef(({className:e,...t},n)=>s.jsx(m$,{ref:n,className:Q("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));eG.displayName=m$.displayName;const I$=v.forwardRef(({className:e,...t},n)=>s.jsx(p$,{ref:n,className:Q("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(zo,{className:"h-4 w-4"})}));I$.displayName=p$.displayName;const M$=v.forwardRef(({className:e,...t},n)=>s.jsx(f$,{ref:n,className:Q("text-sm font-semibold",e),...t}));M$.displayName=f$.displayName;const R$=v.forwardRef(({className:e,...t},n)=>s.jsx(h$,{ref:n,className:Q("text-sm opacity-90",e),...t}));R$.displayName=h$.displayName;function tG(){const{toasts:e}=Pn();return s.jsxs(Q9,{children:[e.map(function({id:t,title:n,description:r,action:i,...a}){return s.jsxs(_$,{...a,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(M$,{children:n}),r&&s.jsx(R$,{children:r})]}),i,s.jsx(I$,{})]},t)}),s.jsx(O$,{})]})}var nG=gM[" useId ".trim().toString()]||(()=>{}),rG=0;function Xn(e){const[t,n]=v.useState(nG());return Ft(()=>{n(r=>r??String(rG++))},[e]),t?`radix-${t}`:""}const iG=["top","right","bottom","left"],zs=Math.min,ar=Math.max,pg=Math.round,Xm=Math.floor,Di=e=>({x:e,y:e}),aG={left:"right",right:"left",bottom:"top",top:"bottom"},sG={start:"end",end:"start"};function zw(e,t,n){return ar(e,zs(t,n))}function Ma(e,t){return typeof e=="function"?e(t):e}function Ra(e){return e.split("-")[0]}function Lu(e){return e.split("-")[1]}function hA(e){return e==="x"?"y":"x"}function mA(e){return e==="y"?"height":"width"}function Us(e){return["top","bottom"].includes(Ra(e))?"y":"x"}function pA(e){return hA(Us(e))}function oG(e,t,n){n===void 0&&(n=!1);const r=Lu(e),i=pA(e),a=mA(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=gg(o)),[o,gg(o)]}function lG(e){const t=gg(e);return[Uw(e),t,Uw(t)]}function Uw(e){return e.replace(/start|end/g,t=>sG[t])}function cG(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function uG(e,t,n,r){const i=Lu(e);let a=cG(Ra(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Uw)))),a}function gg(e){return e.replace(/left|right|bottom|top/g,t=>aG[t])}function dG(e){return{top:0,right:0,bottom:0,left:0,...e}}function D$(e){return typeof e!="number"?dG(e):{top:e,right:e,bottom:e,left:e}}function vg(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zP(e,t,n){let{reference:r,floating:i}=e;const a=Us(t),o=pA(t),l=mA(o),c=Ra(t),u=a==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-i.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-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Lu(t)){case"start":m[o]-=h*(n&&u?-1:1);break;case"end":m[o]+=h*(n&&u?-1:1);break}return m}const fG=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=zP(u,r,c),h=r,m={},y=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ma(e,t)||{};if(u==null)return{};const f=D$(d),h={x:n,y:r},m=pA(i),y=mA(m),p=await o.getDimensions(u),b=m==="y",x=b?"top":"left",g=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[m]-h[m]-a.floating[y],j=h[m]-a.reference[m],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=A?A[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(A)))&&(N=l.floating[w]||a.floating[y]);const T=S/2-j/2,C=N/2-p[y]/2-1,E=zs(f[x],C),P=zs(f[g],C),k=E,$=N-p[y]-P,I=N/2-p[y]/2+T,F=zw(k,I,$),R=!c.arrow&&Lu(i)!=null&&I!==F&&a.reference[y]/2-(II<=0)){var P,k;const I=(((P=a.flip)==null?void 0:P.index)||0)+1,F=N[I];if(F)return{data:{index:I,overflows:E},reset:{placement:F}};let R=(k=E.filter(B=>B.overflows[0]<=0).sort((B,O)=>B.overflows[1]-O.overflows[1])[0])==null?void 0:k.placement;if(!R)switch(m){case"bestFit":{var $;const B=($=E.filter(O=>{if(A){const M=Us(O.placement);return M===g||M==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(M=>M>0).reduce((M,W)=>M+W,0)]).sort((O,M)=>O[1]-M[1])[0])==null?void 0:$[0];B&&(R=B);break}case"initialPlacement":R=l;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function UP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HP(e){return iG.some(t=>e[t]>=0)}const pG=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ma(e,t);switch(r){case"referenceHidden":{const a=await _f(t,{...i,elementContext:"reference"}),o=UP(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:HP(o)}}}case"escaped":{const a=await _f(t,{...i,altBoundary:!0}),o=UP(a,n.floating);return{data:{escapedOffsets:o,escaped:HP(o)}}}default:return{}}}}};async function gG(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ra(n),l=Lu(n),c=Us(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=Ma(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const vG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:l}=t,c=await gG(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},yG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x,y:g}=b;return{x,y:g}}},...c}=Ma(e,t),u={x:n,y:r},d=await _f(t,c),f=Us(Ra(i)),h=hA(f);let m=u[h],y=u[f];if(a){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",g=m+d[b],w=m-d[x];m=zw(g,m,w)}if(o){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",g=y+d[b],w=y-d[x];y=zw(g,y,w)}const p=l.fn({...t,[h]:m,[f]:y});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:a,[f]:o}}}}}},xG=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ma(e,t),d={x:n,y:r},f=Us(i),h=hA(f);let m=d[h],y=d[f];const p=Ma(l,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=h==="y"?"height":"width",S=a.reference[h]-a.floating[w]+b.mainAxis,j=a.reference[h]+a.reference[w]-b.mainAxis;mj&&(m=j)}if(u){var x,g;const w=h==="y"?"width":"height",S=["top","left"].includes(Ra(i)),j=a.reference[f]-a.floating[w]+(S&&((x=o.offset)==null?void 0:x[f])||0)+(S?0:b.crossAxis),A=a.reference[f]+a.reference[w]+(S?0:((g=o.offset)==null?void 0:g[f])||0)-(S?b.crossAxis:0);yA&&(y=A)}return{[h]:m,[f]:y}}}},bG=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Ma(e,t),d=await _f(t,u),f=Ra(i),h=Lu(i),m=Us(i)==="y",{width:y,height:p}=a.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,b=h==="end"?"top":"bottom");const g=p-d.top-d.bottom,w=y-d.left-d.right,S=zs(p-d[b],g),j=zs(y-d[x],w),A=!t.middlewareData.shift;let N=S,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=g),A&&!h){const E=ar(d.left,0),P=ar(d.right,0),k=ar(d.top,0),$=ar(d.bottom,0);m?T=y-2*(E!==0||P!==0?E+P:ar(d.left,d.right)):N=p-2*(k!==0||$!==0?k+$:ar(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:N});const C=await o.getDimensions(l.floating);return y!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function by(){return typeof window<"u"}function Fu(e){return $$(e)?(e.nodeName||"").toLowerCase():"#document"}function ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xi(e){var t;return(t=($$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $$(e){return by()?e instanceof Node||e instanceof ur(e).Node:!1}function pi(e){return by()?e instanceof Element||e instanceof ur(e).Element:!1}function qi(e){return by()?e instanceof HTMLElement||e instanceof ur(e).HTMLElement:!1}function qP(e){return!by()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot}function Qh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=gi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function wG(e){return["table","td","th"].includes(Fu(e))}function wy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gA(e){const t=vA(),n=pi(e)?gi(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function jG(e){let t=Hs(e);for(;qi(t)&&!Zc(t);){if(gA(t))return t;if(wy(t))return null;t=Hs(t)}return null}function vA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zc(e){return["html","body","#document"].includes(Fu(e))}function gi(e){return ur(e).getComputedStyle(e)}function jy(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hs(e){if(Fu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qP(e)&&e.host||Xi(e);return qP(t)?t.host:t}function L$(e){const t=Hs(e);return Zc(t)?e.ownerDocument?e.ownerDocument.body:e.body:qi(t)&&Qh(t)?t:L$(t)}function If(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=L$(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=ur(i);if(a){const l=Hw(o);return t.concat(o,o.visualViewport||[],Qh(i)?i:[],l&&n?If(l):[])}return t.concat(i,If(i,[],n))}function Hw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F$(e){const t=gi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=qi(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=pg(n)!==a||pg(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function yA(e){return pi(e)?e:e.contextElement}function yc(e){const t=yA(e);if(!qi(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=F$(t);let o=(a?pg(n.width):n.width)/r,l=(a?pg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const SG=Di(0);function B$(e){const t=ur(e);return!vA()||!t.visualViewport?SG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AG(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ur(e)?!1:t}function al(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=yA(e);let o=Di(1);t&&(r?pi(r)&&(o=yc(r)):o=yc(e));const l=AG(a,n,r)?B$(a):Di(0);let c=(i.left+l.x)/o.x,u=(i.top+l.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){const h=ur(a),m=r&&pi(r)?ur(r):r;let y=h,p=Hw(y);for(;p&&r&&m!==y;){const b=yc(p),x=p.getBoundingClientRect(),g=gi(p),w=x.left+(p.clientLeft+parseFloat(g.paddingLeft))*b.x,S=x.top+(p.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,u*=b.y,d*=b.x,f*=b.y,c+=w,u+=S,y=ur(p),p=Hw(y)}}return vg({width:d,height:f,x:c,y:u})}function xA(e,t){const n=jy(e).scrollLeft;return t?t.left+n:al(Xi(e)).left+n}function V$(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:xA(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function NG(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Xi(r),l=t?wy(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Di(1);const d=Di(0),f=qi(r);if((f||!f&&!a)&&((Fu(r)!=="body"||Qh(o))&&(c=jy(r)),qi(r))){const m=al(r);u=yc(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=o&&!f&&!a?V$(o,c,!0):Di(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 TG(e){return Array.from(e.getClientRects())}function CG(e){const t=Xi(e),n=jy(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+xA(e);const l=-n.scrollTop;return gi(r).direction==="rtl"&&(o+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}function PG(e,t){const n=ur(e),r=Xi(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const u=vA();(!u||u&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:l,y:c}}function kG(e,t){const n=al(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qi(e)?yc(e):Di(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function GP(e,t,n){let r;if(t==="viewport")r=PG(e,n);else if(t==="document")r=CG(Xi(e));else if(pi(t))r=kG(t,n);else{const i=B$(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return vg(r)}function W$(e,t){const n=Hs(e);return n===t||!pi(n)||Zc(n)?!1:gi(n).position==="fixed"||W$(n,t)}function EG(e,t){const n=t.get(e);if(n)return n;let r=If(e,[],!1).filter(l=>pi(l)&&Fu(l)!=="body"),i=null;const a=gi(e).position==="fixed";let o=a?Hs(e):e;for(;pi(o)&&!Zc(o);){const l=gi(o),c=gA(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Qh(o)&&!c&&W$(e,o))?r=r.filter(d=>d!==o):i=l,o=Hs(o)}return t.set(e,r),r}function OG(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?wy(t)?[]:EG(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=GP(t,d,i);return u.top=ar(f.top,u.top),u.right=zs(f.right,u.right),u.bottom=zs(f.bottom,u.bottom),u.left=ar(f.left,u.left),u},GP(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _G(e){const{width:t,height:n}=F$(e);return{width:t,height:n}}function IG(e,t,n){const r=qi(t),i=Xi(t),a=n==="fixed",o=al(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Di(0);if(r||!r&&!a)if((Fu(t)!=="body"||Qh(i))&&(l=jy(t)),r){const h=al(t,!0,a,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else i&&(c.x=xA(i));const u=i&&!r&&!a?V$(i,l):Di(0),d=o.left+l.scrollLeft-c.x-u.x,f=o.top+l.scrollTop-c.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function Cb(e){return gi(e).position==="static"}function YP(e,t){if(!qi(e)||gi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xi(e)===n&&(n=n.ownerDocument.body),n}function z$(e,t){const n=ur(e);if(wy(e))return n;if(!qi(e)){let i=Hs(e);for(;i&&!Zc(i);){if(pi(i)&&!Cb(i))return i;i=Hs(i)}return n}let r=YP(e,t);for(;r&&wG(r)&&Cb(r);)r=YP(r,t);return r&&Zc(r)&&Cb(r)&&!gA(r)?n:r||jG(e)||n}const MG=async function(e){const t=this.getOffsetParent||z$,n=this.getDimensions,r=await n(e.floating);return{reference:IG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RG(e){return gi(e).direction==="rtl"}const DG={convertOffsetParentRelativeRectToViewportRelativeRect:NG,getDocumentElement:Xi,getClippingRect:OG,getOffsetParent:z$,getElementRects:MG,getClientRects:TG,getDimensions:_G,getScale:yc,isElement:pi,isRTL:RG};function U$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $G(e,t){let n=null,r;const i=Xi(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(l||t(),!h||!m)return;const y=Xm(f),p=Xm(i.clientWidth-(d+h)),b=Xm(i.clientHeight-(f+m)),x=Xm(d),w={rootMargin:-y+"px "+-p+"px "+-b+"px "+-x+"px",threshold:ar(0,zs(1,c))||1};let S=!0;function j(A){const N=A[0].intersectionRatio;if(N!==c){if(!S)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!U$(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(j,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,w)}n.observe(e)}return o(!0),a}function LG(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=yA(e),d=i||a?[...u?If(u):[],...If(t)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const f=u&&l?$G(u,n):null;let h=-1,m=null;o&&(m=new ResizeObserver(x=>{let[g]=x;g&&g.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 y,p=c?al(e):null;c&&b();function b(){const x=al(e);p&&!U$(p,x)&&n(),p=x,y=requestAnimationFrame(b)}return n(),()=>{var x;d.forEach(g=>{i&&g.removeEventListener("scroll",n),a&&g.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const FG=vG,BG=yG,VG=mG,WG=bG,zG=pG,KP=hG,UG=xG,HG=(e,t,n)=>{const r=new Map,i={platform:DG,...n},a={...i.platform,_c:r};return fG(e,t,{...i,platform:a})};var Ip=typeof document<"u"?v.useLayoutEffect:v.useEffect;function yg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!yg(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function H$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function XP(e,t){const n=H$(e);return Math.round(t*n)/n}function Pb(e){const t=v.useRef(e);return Ip(()=>{t.current=e}),t}function qG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=v.useState(r);yg(h,r)||m(r);const[y,p]=v.useState(null),[b,x]=v.useState(null),g=v.useCallback(O=>{O!==A.current&&(A.current=O,p(O))},[]),w=v.useCallback(O=>{O!==N.current&&(N.current=O,x(O))},[]),S=a||y,j=o||b,A=v.useRef(null),N=v.useRef(null),T=v.useRef(d),C=c!=null,E=Pb(c),P=Pb(i),k=Pb(u),$=v.useCallback(()=>{if(!A.current||!N.current)return;const O={placement:t,strategy:n,middleware:h};P.current&&(O.platform=P.current),HG(A.current,N.current,O).then(M=>{const W={...M,isPositioned:k.current!==!1};I.current&&!yg(T.current,W)&&(T.current=W,yl.flushSync(()=>{f(W)}))})},[h,t,n,P,k]);Ip(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[u]);const I=v.useRef(!1);Ip(()=>(I.current=!0,()=>{I.current=!1}),[]),Ip(()=>{if(S&&(A.current=S),j&&(N.current=j),S&&j){if(E.current)return E.current(S,j,$);$()}},[S,j,$,E,C]);const F=v.useMemo(()=>({reference:A,floating:N,setReference:g,setFloating:w}),[g,w]),R=v.useMemo(()=>({reference:S,floating:j}),[S,j]),B=v.useMemo(()=>{const O={position:n,left:0,top:0};if(!R.floating)return O;const M=XP(R.floating,d.x),W=XP(R.floating,d.y);return l?{...O,transform:"translate("+M+"px, "+W+"px)",...H$(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:W}},[n,l,R.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:$,refs:F,elements:R,floatingStyles:B}),[d,$,F,R,B])}const GG=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?KP({element:r.current,padding:i}).fn(n):{}:r?KP({element:r,padding:i}).fn(n):{}}}},YG=(e,t)=>({...FG(e),options:[e,t]}),KG=(e,t)=>({...BG(e),options:[e,t]}),XG=(e,t)=>({...UG(e),options:[e,t]}),ZG=(e,t)=>({...VG(e),options:[e,t]}),QG=(e,t)=>({...WG(e),options:[e,t]}),JG=(e,t)=>({...zG(e),options:[e,t]}),eY=(e,t)=>({...GG(e),options:[e,t]});var tY="Arrow",q$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return s.jsx(ye.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});q$.displayName=tY;var nY=q$;function G$(e){const[t,n]=v.useState(void 0);return Ft(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var bA="Popper",[Y$,no]=rn(bA),[rY,K$]=Y$(bA),X$=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return s.jsx(rY,{scope:t,anchor:r,onAnchorChange:i,children:n})};X$.displayName=bA;var Z$="PopperAnchor",Q$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=K$(Z$,n),o=v.useRef(null),l=ke(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(ye.div,{...i,ref:l})});Q$.displayName=Z$;var wA="PopperContent",[iY,aY]=Y$(wA),J$=v.forwardRef((e,t)=>{var fe,we,K,V,re,U;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...p}=e,b=K$(wA,n),[x,g]=v.useState(null),w=ke(t,Le=>g(Le)),[S,j]=v.useState(null),A=G$(S),N=(A==null?void 0:A.width)??0,T=(A==null?void 0:A.height)??0,C=r+(a!=="center"?"-"+a:""),E=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],k=P.length>0,$={padding:E,boundary:P.filter(oY),altBoundary:k},{refs:I,floatingStyles:F,placement:R,isPositioned:B,middlewareData:O}=qG({strategy:"fixed",placement:C,whileElementsMounted:(...Le)=>LG(...Le,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[YG({mainAxis:i+T,alignmentAxis:o}),c&&KG({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?XG():void 0,...$}),c&&ZG({...$}),QG({...$,apply:({elements:Le,rects:Pe,availableWidth:ot,availableHeight:rt})=>{const{width:bt,height:yr}=Pe.reference,Qn=Le.floating.style;Qn.setProperty("--radix-popper-available-width",`${ot}px`),Qn.setProperty("--radix-popper-available-height",`${rt}px`),Qn.setProperty("--radix-popper-anchor-width",`${bt}px`),Qn.setProperty("--radix-popper-anchor-height",`${yr}px`)}}),S&&eY({element:S,padding:l}),lY({arrowWidth:N,arrowHeight:T}),h&&JG({strategy:"referenceHidden",...$})]}),[M,W]=n4(R),Y=yt(y);Ft(()=>{B&&(Y==null||Y())},[B,Y]);const q=(fe=O.arrow)==null?void 0:fe.x,oe=(we=O.arrow)==null?void 0:we.y,je=((K=O.arrow)==null?void 0:K.centerOffset)!==0,[$e,Ee]=v.useState();return Ft(()=>{x&&Ee(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[(V=O.transformOrigin)==null?void 0:V.x,(re=O.transformOrigin)==null?void 0:re.y].join(" "),...((U=O.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(iY,{scope:n,placedSide:M,onArrowChange:j,arrowX:q,arrowY:oe,shouldHideArrow:je,children:s.jsx(ye.div,{"data-side":M,"data-align":W,...p,ref:w,style:{...p.style,animation:B?void 0:"none"}})})})});J$.displayName=wA;var e4="PopperArrow",sY={top:"bottom",right:"left",bottom:"top",left:"right"},t4=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=aY(e4,r),o=sY[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(nY,{...i,ref:n,style:{...i.style,display:"block"}})})});t4.displayName=e4;function oY(e){return e!==null}var lY=e=>({name:"transformOrigin",options:e,fn(t){var b,x,g;const{placement:n,rects:r,middlewareData:i}=t,o=((b=i.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=n4(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=i.arrow)==null?void 0:x.x)??0)+l/2,m=(((g=i.arrow)==null?void 0:g.y)??0)+c/2;let y="",p="";return u==="bottom"?(y=o?f:`${h}px`,p=`${-c}px`):u==="top"?(y=o?f:`${h}px`,p=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,p=o?f:`${m}px`):u==="left"&&(y=`${r.floating.width+c}px`,p=o?f:`${m}px`),{data:{x:y,y:p}}}});function n4(e){const[t,n="center"]=e.split("-");return[t,n]}var Sy=X$,Jh=Q$,Ay=J$,Ny=t4,[Ty,A_e]=rn("Tooltip",[no]),Cy=no(),r4="TooltipProvider",cY=700,qw="tooltip.open",[uY,jA]=Ty(r4),i4=e=>{const{__scopeTooltip:t,delayDuration:n=cY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),l=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(uY,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:v.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:a})};i4.displayName=r4;var Py="Tooltip",[dY,ky]=Ty(Py),a4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=jA(Py,e.__scopeTooltip),u=Cy(t),[d,f]=v.useState(null),h=Xn(),m=v.useRef(0),y=o??c.disableHoverableContent,p=l??c.delayDuration,b=v.useRef(!1),[x=!1,g]=hr({prop:r,defaultProp:i,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(qw))):c.onClose(),a==null||a(N)}}),w=v.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),S=v.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,g(!0)},[g]),j=v.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g(!1)},[g]),A=v.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,g(!0),m.current=0},p)},[p,g]);return v.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Sy,{...u,children:s.jsx(dY,{scope:t,contentId:h,open:x,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?A():S()},[c.isOpenDelayedRef,A,S]),onTriggerLeave:v.useCallback(()=>{y?j():(window.clearTimeout(m.current),m.current=0)},[j,y]),onOpen:S,onClose:j,disableHoverableContent:y,children:n})})};a4.displayName=Py;var Gw="TooltipTrigger",s4=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ky(Gw,n),a=jA(Gw,n),o=Cy(n),l=v.useRef(null),c=ke(t,l,i.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),f=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(Jh,{asChild:!0,...o,children:s.jsx(ye.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ee(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:ee(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:ee(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ee(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:ee(e.onBlur,i.onClose),onClick:ee(e.onClick,i.onClose)})})});s4.displayName=Gw;var fY="TooltipPortal",[N_e,hY]=Ty(fY,{forceMount:void 0}),Qc="TooltipContent",o4=v.forwardRef((e,t)=>{const n=hY(Qc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=ky(Qc,e.__scopeTooltip);return s.jsx(an,{present:r||o.open,children:o.disableHoverableContent?s.jsx(l4,{side:i,...a,ref:t}):s.jsx(mY,{side:i,...a,ref:t})})}),mY=v.forwardRef((e,t)=>{const n=ky(Qc,e.__scopeTooltip),r=jA(Qc,e.__scopeTooltip),i=v.useRef(null),a=ke(t,i),[o,l]=v.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{l(null),f(!1)},[f]),m=v.useCallback((y,p)=>{const b=y.currentTarget,x={x:y.clientX,y:y.clientY},g=xY(x,b.getBoundingClientRect()),w=bY(x,g),S=wY(p.getBoundingClientRect()),j=SY([...w,...S]);l(j),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(c&&d){const y=b=>m(b,d),p=b=>m(b,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",p)}}},[c,d,m,h]),v.useEffect(()=>{if(o){const y=p=>{const b=p.target,x={x:p.clientX,y:p.clientY},g=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),w=!jY(x,o);g?h():w&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,o,u,h]),s.jsx(l4,{...e,ref:a})}),[pY,gY]=Ty(Py,{isInside:!1}),vY=GD("TooltipContent"),l4=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=ky(Qc,n),u=Cy(n),{onClose:d}=c;return v.useEffect(()=>(document.addEventListener(qw,d),()=>document.removeEventListener(qw,d)),[d]),v.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs(Ay,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(vY,{children:r}),s.jsx(pY,{scope:n,isInside:!0,children:s.jsx(jq,{id:c.contentId,role:"tooltip",children:i||r})})]})})});o4.displayName=Qc;var c4="TooltipArrow",yY=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Cy(n);return gY(c4,n).isInside?null:s.jsx(Ny,{...i,...r,ref:t})});yY.displayName=c4;function xY(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function bY(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 wY(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jY(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(i=!i)}return i}function SY(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),AY(t)}function AY(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}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 NY=i4,TY=a4,CY=s4,u4=o4;const d4=NY,PY=TY,kY=CY,f4=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(u4,{ref:r,sideOffset:t,className:Q("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 origin-[--radix-tooltip-content-transform-origin]",e),...n}));f4.displayName=u4.displayName;const kb=768;function EY(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${kb-1}px)`),r=()=>{t(window.innerWidthn.removeEventListener("change",r)},[]),!!e}const SA=Du("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover-elevate active-elevate-2",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary-border",destructive:"bg-destructive text-destructive-foreground border border-destructive-border",outline:" border [border-color:var(--button-outline)] shadow-xs active:shadow-none ",secondary:"border bg-secondary text-secondary-foreground border border-secondary-border ",ghost:"border border-transparent"},size:{default:"min-h-9 px-4 py-2",sm:"min-h-8 rounded-md px-3 text-xs",lg:"min-h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),X=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?eA:"button";return s.jsx(o,{className:Q(SA({variant:t,size:n,className:e})),ref:a,...i})});X.displayName="Button";const Dt=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Q("flex h-9 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}));Dt.displayName="Input";var OY="Separator",ZP="horizontal",_Y=["horizontal","vertical"],h4=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=ZP,...i}=e,a=IY(r)?r:ZP,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return s.jsx(ye.div,{"data-orientation":a,...l,...i,ref:t})});h4.displayName=OY;function IY(e){return _Y.includes(e)}var m4=h4;const ha=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>s.jsx(m4,{ref:i,decorative:n,orientation:t,className:Q("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ha.displayName=m4.displayName;var Eb="focusScope.autoFocusOnMount",Ob="focusScope.autoFocusOnUnmount",QP={bubbles:!1,cancelable:!0},MY="FocusScope",em=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=v.useState(null),u=yt(i),d=yt(a),f=v.useRef(null),h=ke(t,p=>c(p)),m=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let p=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:Ja(f.current,{select:!0})},b=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Ja(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Ja(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const g=new MutationObserver(x);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),g.disconnect()}}},[r,l,m.paused]),v.useEffect(()=>{if(l){ek.add(m);const p=document.activeElement;if(!l.contains(p)){const x=new CustomEvent(Eb,QP);l.addEventListener(Eb,u),l.dispatchEvent(x),x.defaultPrevented||(RY(BY(p4(l)),{select:!0}),document.activeElement===p&&Ja(l))}return()=>{l.removeEventListener(Eb,u),setTimeout(()=>{const x=new CustomEvent(Ob,QP);l.addEventListener(Ob,d),l.dispatchEvent(x),x.defaultPrevented||Ja(p??document.body,{select:!0}),l.removeEventListener(Ob,d),ek.remove(m)},0)}}},[l,u,d,m]);const y=v.useCallback(p=>{if(!n&&!r||m.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(b&&x){const g=p.currentTarget,[w,S]=DY(g);w&&S?!p.shiftKey&&x===S?(p.preventDefault(),n&&Ja(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),n&&Ja(S,{select:!0})):x===g&&p.preventDefault()}},[n,r,m.paused]);return s.jsx(ye.div,{tabIndex:-1,...o,ref:h,onKeyDown:y})});em.displayName=MY;function RY(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ja(r,{select:t}),document.activeElement!==n)return}function DY(e){const t=p4(e),n=JP(t,e),r=JP(t.reverse(),e);return[n,r]}function p4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JP(e,t){for(const n of e)if(!$Y(n,{upTo:t}))return n}function $Y(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 LY(e){return e instanceof HTMLInputElement&&"select"in e}function Ja(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LY(e)&&t&&e.select()}}var ek=FY();function FY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tk(e,t),e.unshift(t)},remove(t){var n;e=tk(e,t),(n=e[0])==null||n.resume()}}}function tk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BY(e){return e.filter(t=>t.tagName!=="A")}var _b=0;function Ey(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nk()),document.body.insertAdjacentElement("beforeend",e[1]??nk()),_b++,()=>{_b===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_b--}},[])}function nk(){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 Oi=function(){return Oi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return rK;var t=iK(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])}},sK=x4(),xc="data-scroll-locked",oK=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(WY,` { overflow: hidden `).concat(r,`; padding-right: `).concat(l,"px ").concat(r,`; } body[`).concat(xc,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(a,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(l,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Mp,` { right: `).concat(l,"px ").concat(r,`; } .`).concat(Rp,` { margin-right: `).concat(l,"px ").concat(r,`; } .`).concat(Mp," .").concat(Mp,` { right: 0 `).concat(r,`; } .`).concat(Rp," .").concat(Rp,` { margin-right: 0 `).concat(r,`; } body[`).concat(xc,`] { `).concat(zY,": ").concat(l,`px; } `)},ik=function(){var e=parseInt(document.body.getAttribute(xc)||"0",10);return isFinite(e)?e:0},lK=function(){v.useEffect(function(){return document.body.setAttribute(xc,(ik()+1).toString()),function(){var e=ik()-1;e<=0?document.body.removeAttribute(xc):document.body.setAttribute(xc,e.toString())}},[])},cK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lK();var a=v.useMemo(function(){return aK(i)},[i]);return v.createElement(sK,{styles:oK(a,!t,i,n?"":"!important")})},Yw=!1;if(typeof window<"u")try{var Zm=Object.defineProperty({},"passive",{get:function(){return Yw=!0,!0}});window.addEventListener("test",Zm,Zm),window.removeEventListener("test",Zm,Zm)}catch{Yw=!1}var Ol=Yw?{passive:!1}:!1,uK=function(e){return e.tagName==="TEXTAREA"},b4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uK(e)&&n[t]==="visible")},dK=function(e){return b4(e,"overflowY")},fK=function(e){return b4(e,"overflowX")},ak=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=w4(e,r);if(i){var a=j4(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},w4=function(e,t){return e==="v"?dK(t):fK(t)},j4=function(e,t){return e==="v"?hK(t):mK(t)},pK=function(e,t){return e==="h"&&t==="rtl"?-1:1},gK=function(e,t,n,r,i){var a=pK(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{var m=j4(e,l),y=m[0],p=m[1],b=m[2],x=p-b-a*y;(y||x)&&w4(e,l)&&(f+=x,h+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},Qm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sk=function(e){return[e.deltaX,e.deltaY]},ok=function(e){return e&&"current"in e?e.current:e},vK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yK=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},xK=0,_l=[];function bK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(xK++)[0],a=v.useState(x4)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=VY([e.lockRef.current],(e.shards||[]).map(ok),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var x=Qm(p),g=n.current,w="deltaX"in p?p.deltaX:g[0]-x[0],S="deltaY"in p?p.deltaY:g[1]-x[1],j,A=p.target,N=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in p&&N==="h"&&A.type==="range")return!1;var T=ak(N,A);if(!T)return!0;if(T?j=N:(j=N==="v"?"h":"v",T=ak(N,A)),!T)return!1;if(!r.current&&"changedTouches"in p&&(w||S)&&(r.current=j),!j)return!0;var C=r.current||j;return gK(C,b,p,C==="h"?w:S,!0)},[]),c=v.useCallback(function(p){var b=p;if(!(!_l.length||_l[_l.length-1]!==a)){var x="deltaY"in b?sk(b):Qm(b),g=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&vK(j.delta,x)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var w=(o.current.shards||[]).map(ok).filter(Boolean).filter(function(j){return j.contains(b.target)}),S=w.length>0?l(b,w[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=v.useCallback(function(p,b,x,g){var w={name:p,delta:b,target:x,should:g,shadowParent:wK(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(p){n.current=Qm(p),r.current=void 0},[]),f=v.useCallback(function(p){u(p.type,sk(p),p.target,l(p,e.lockRef.current))},[]),h=v.useCallback(function(p){u(p.type,Qm(p),p.target,l(p,e.lockRef.current))},[]);v.useEffect(function(){return _l.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ol),document.addEventListener("touchmove",c,Ol),document.addEventListener("touchstart",d,Ol),function(){_l=_l.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,Ol),document.removeEventListener("touchmove",c,Ol),document.removeEventListener("touchstart",d,Ol)}},[]);var m=e.removeScrollBar,y=e.inert;return v.createElement(v.Fragment,null,y?v.createElement(a,{styles:yK(i)}):null,m?v.createElement(cK,{gapMode:e.gapMode}):null)}function wK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jK=XY(y4,bK);var tm=v.forwardRef(function(e,t){return v.createElement(Oy,Oi({},e,{ref:t,sideCar:jK}))});tm.classNames=Oy.classNames;var SK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Il=new WeakMap,Jm=new WeakMap,ep={},Db=0,S4=function(e){return e&&(e.host||S4(e.parentNode))},AK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=S4(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})},NK=function(e,t,n,r){var i=AK(t,Array.isArray(e)?e:[e]);ep[n]||(ep[n]=new WeakMap);var a=ep[n],o=[],l=new Set,c=new Set(i),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};i.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),y=m!==null&&m!=="false",p=(Il.get(h)||0)+1,b=(a.get(h)||0)+1;Il.set(h,p),a.set(h,b),o.push(h),p===1&&y&&Jm.set(h,!0),b===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),l.clear(),Db++,function(){o.forEach(function(f){var h=Il.get(f)-1,m=a.get(f)-1;Il.set(f,h),a.set(f,m),h||(Jm.has(f)||f.removeAttribute(r),Jm.delete(f)),m||f.removeAttribute(n)}),Db--,Db||(Il=new WeakMap,Il=new WeakMap,Jm=new WeakMap,ep={})}},_y=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=SK(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),NK(r,i,n,"aria-hidden")):function(){return null}},AA="Dialog",[A4,N4]=rn(AA),[TK,yi]=A4(AA),T4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=v.useRef(null),c=v.useRef(null),[u=!1,d]=hr({prop:r,defaultProp:i,onChange:a});return s.jsx(TK,{scope:t,triggerRef:l,contentRef:c,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};T4.displayName=AA;var C4="DialogTrigger",P4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=yi(C4,n),a=ke(t,i.triggerRef);return s.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CA(i.open),...r,ref:a,onClick:ee(e.onClick,i.onOpenToggle)})});P4.displayName=C4;var NA="DialogPortal",[CK,k4]=A4(NA,{forceMount:void 0}),E4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=yi(NA,t);return s.jsx(CK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(an,{present:n||a.open,children:s.jsx(Ru,{asChild:!0,container:i,children:o})}))})};E4.displayName=NA;var xg="DialogOverlay",O4=v.forwardRef((e,t)=>{const n=k4(xg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yi(xg,e.__scopeDialog);return a.modal?s.jsx(an,{present:r||a.open,children:s.jsx(kK,{...i,ref:t})}):null});O4.displayName=xg;var PK=Vs("DialogOverlay.RemoveScroll"),kK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=yi(xg,n);return s.jsx(tm,{as:PK,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(ye.div,{"data-state":CA(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),sl="DialogContent",_4=v.forwardRef((e,t)=>{const n=k4(sl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yi(sl,e.__scopeDialog);return s.jsx(an,{present:r||a.open,children:a.modal?s.jsx(EK,{...i,ref:t}):s.jsx(OK,{...i,ref:t})})});_4.displayName=sl;var EK=v.forwardRef((e,t)=>{const n=yi(sl,e.__scopeDialog),r=v.useRef(null),i=ke(t,n.contentRef,r);return v.useEffect(()=>{const a=r.current;if(a)return _y(a)},[]),s.jsx(I4,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,a=>a.preventDefault())})}),OK=v.forwardRef((e,t)=>{const n=yi(sl,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return s.jsx(I4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),I4=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=yi(sl,n),c=v.useRef(null),u=ke(t,c);return Ey(),s.jsxs(s.Fragment,{children:[s.jsx(em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(bl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":CA(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(IK,{titleId:l.titleId}),s.jsx(RK,{contentRef:c,descriptionId:l.descriptionId})]})]})}),TA="DialogTitle",M4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=yi(TA,n);return s.jsx(ye.h2,{id:i.titleId,...r,ref:t})});M4.displayName=TA;var R4="DialogDescription",D4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=yi(R4,n);return s.jsx(ye.p,{id:i.descriptionId,...r,ref:t})});D4.displayName=R4;var $4="DialogClose",L4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=yi($4,n);return s.jsx(ye.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});L4.displayName=$4;function CA(e){return e?"open":"closed"}var F4="DialogTitleWarning",[_K,B4]=eq(F4,{contentName:sl,titleName:TA,docsSlug:"dialog"}),IK=({titleId:e})=>{const t=B4(F4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},MK="DialogDescriptionWarning",RK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B4(MK).contentName}}.`;return v.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},PA=T4,DK=P4,kA=E4,nm=O4,rm=_4,im=M4,am=D4,Iy=L4;const $K=PA,LK=kA,V4=v.forwardRef(({className:e,...t},n)=>s.jsx(nm,{className:Q("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}));V4.displayName=nm.displayName;const FK=Du("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),W4=v.forwardRef(({side:e="right",className:t,children:n,...r},i)=>s.jsxs(LK,{children:[s.jsx(V4,{}),s.jsxs(rm,{ref:i,className:Q(FK({side:e}),t),...r,children:[n,s.jsxs(Iy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(zo,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));W4.displayName=rm.displayName;const z4=({className:e,...t})=>s.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});z4.displayName="SheetHeader";const U4=v.forwardRef(({className:e,...t},n)=>s.jsx(im,{ref:n,className:Q("text-lg font-semibold text-foreground",e),...t}));U4.displayName=im.displayName;const H4=v.forwardRef(({className:e,...t},n)=>s.jsx(am,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));H4.displayName=am.displayName;function Oe({className:e,...t}){return s.jsx("div",{className:Q("animate-pulse rounded-md bg-muted",e),...t})}const BK="sidebar_state",VK=60*60*24*7,WK="16rem",zK="18rem",UK="3rem",HK="b",q4=v.createContext(null);function EA(){const e=v.useContext(q4);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function qK({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){const l=EY(),[c,u]=v.useState(!1),[d,f]=v.useState(e),h=t??d,m=v.useCallback(x=>{const g=typeof x=="function"?x(h):x;n?n(g):f(g),document.cookie=`${BK}=${g}; path=/; max-age=${VK}`},[n,h]),y=v.useCallback(()=>l?u(x=>!x):m(x=>!x),[l,m,u]);v.useEffect(()=>{const x=g=>{g.key===HK&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),y())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y]);const p=h?"expanded":"collapsed",b=v.useMemo(()=>({state:p,open:h,setOpen:m,isMobile:l,openMobile:c,setOpenMobile:u,toggleSidebar:y}),[p,h,m,l,c,u,y]);return s.jsx(q4.Provider,{value:b,children:s.jsx(d4,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":WK,"--sidebar-width-icon":UK,...i},className:Q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...o,children:a})})})}function GK({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,...a}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:u}=EA();return n==="none"?s.jsx("div",{"data-slot":"sidebar",className:Q("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",r),...a,children:i}):o?s.jsx($K,{open:c,onOpenChange:u,...a,children:s.jsxs(W4,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden",style:{"--sidebar-width":zK},side:e,children:[s.jsxs(z4,{className:"sr-only",children:[s.jsx(U4,{children:"Sidebar"}),s.jsx(H4,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):s.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:Q("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+var(--spacing-4))]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),s.jsx("div",{"data-slot":"sidebar-container",className:Q("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+var(--spacing-4)+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function YK({className:e,onClick:t,...n}){const{toggleSidebar:r}=EA();return s.jsxs(X,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:Q("h-7 w-7",e),onClick:i=>{t==null||t(i),r()},...n,children:[s.jsx(s9,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function KK({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Q("flex flex-col gap-2 p-2",e),...t})}function XK({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Q("flex flex-col gap-2 p-2",e),...t})}function ZK({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function QK({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Q("relative flex w-full min-w-0 flex-col p-2",e),...t})}function JK({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Q("w-full text-sm",e),...t})}function eX({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Q("flex w-full min-w-0 flex-col gap-1",e),...t})}function lk({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Q("group/menu-item relative",e),...t})}const tX=Du("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:w-8! group-data-[collapsible=icon]:h-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ck({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:a,...o}){const l=e?eA:"button",{isMobile:c,state:u}=EA(),d=s.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:Q(tX({variant:n,size:r}),a),...o});return i?(typeof i=="string"&&(i={children:i}),s.jsxs(PY,{children:[s.jsx(kY,{asChild:!0,children:d}),s.jsx(f4,{side:"right",align:"center",hidden:u!=="collapsed"||c,...i})]})):d}var nX=v.createContext(void 0);function Bu(e){const t=v.useContext(nX);return e||t||"ltr"}var $b="rovingFocusGroup.onEntryFocus",rX={bubbles:!1,cancelable:!0},My="RovingFocusGroup",[Kw,G4,iX]=Xh(My),[aX,Ry]=rn(My,[iX]),[sX,oX]=aX(My),Y4=v.forwardRef((e,t)=>s.jsx(Kw.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Kw.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(lX,{...e,ref:t})})}));Y4.displayName=My;var lX=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=v.useRef(null),m=ke(t,h),y=Bu(a),[p=null,b]=hr({prop:o,defaultProp:l,onChange:c}),[x,g]=v.useState(!1),w=yt(u),S=G4(n),j=v.useRef(!1),[A,N]=v.useState(0);return v.useEffect(()=>{const T=h.current;if(T)return T.addEventListener($b,w),()=>T.removeEventListener($b,w)},[w]),s.jsx(sX,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:p,onItemFocus:v.useCallback(T=>b(T),[b]),onItemShiftTab:v.useCallback(()=>g(!0),[]),onFocusableItemAdd:v.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>N(T=>T-1),[]),children:s.jsx(ye.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{j.current=!0}),onFocus:ee(e.onFocus,T=>{const C=!j.current;if(T.target===T.currentTarget&&C&&!x){const E=new CustomEvent($b,rX);if(T.currentTarget.dispatchEvent(E),!E.defaultPrevented){const P=S().filter(R=>R.focusable),k=P.find(R=>R.active),$=P.find(R=>R.id===p),F=[k,$,...P].filter(Boolean).map(R=>R.ref.current);Z4(F,d)}}j.current=!1}),onBlur:ee(e.onBlur,()=>g(!1))})})}),K4="RovingFocusGroupItem",X4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,l=Xn(),c=a||l,u=oX(K4,n),d=u.currentTabStopId===c,f=G4(n),{onFocusableItemAdd:h,onFocusableItemRemove:m}=u;return v.useEffect(()=>{if(r)return h(),()=>m()},[r,h,m]),s.jsx(Kw.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:s.jsx(ye.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:ee(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:ee(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const p=dX(y,u.orientation,u.dir);if(p!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(g=>g.focusable).map(g=>g.ref.current);if(p==="last")x.reverse();else if(p==="prev"||p==="next"){p==="prev"&&x.reverse();const g=x.indexOf(y.currentTarget);x=u.loop?fX(x,g+1):x.slice(g+1)}setTimeout(()=>Z4(x))}})})})});X4.displayName=K4;var cX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dX(e,t,n){const r=uX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cX[r]}function Z4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q4=Y4,J4=X4,Xw=["Enter"," "],hX=["ArrowDown","PageUp","Home"],eL=["ArrowUp","PageDown","End"],mX=[...hX,...eL],pX={ltr:[...Xw,"ArrowRight"],rtl:[...Xw,"ArrowLeft"]},gX={ltr:["ArrowLeft"],rtl:["ArrowRight"]},sm="Menu",[Mf,vX,yX]=Xh(sm),[jl,tL]=rn(sm,[yX,no,Ry]),Dy=no(),nL=Ry(),[xX,Sl]=jl(sm),[bX,om]=jl(sm),rL=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=Dy(t),[c,u]=v.useState(null),d=v.useRef(!1),f=yt(a),h=Bu(i);return v.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),s.jsx(Sy,{...l,children:s.jsx(xX,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:s.jsx(bX,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};rL.displayName=sm;var wX="MenuAnchor",OA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Dy(n);return s.jsx(Jh,{...i,...r,ref:t})});OA.displayName=wX;var _A="MenuPortal",[jX,iL]=jl(_A,{forceMount:void 0}),aL=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Sl(_A,t);return s.jsx(jX,{scope:t,forceMount:n,children:s.jsx(an,{present:n||a.open,children:s.jsx(Ru,{asChild:!0,container:i,children:r})})})};aL.displayName=_A;var Ir="MenuContent",[SX,IA]=jl(Ir),sL=v.forwardRef((e,t)=>{const n=iL(Ir,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Sl(Ir,e.__scopeMenu),o=om(Ir,e.__scopeMenu);return s.jsx(Mf.Provider,{scope:e.__scopeMenu,children:s.jsx(an,{present:r||a.open,children:s.jsx(Mf.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(AX,{...i,ref:t}):s.jsx(NX,{...i,ref:t})})})})}),AX=v.forwardRef((e,t)=>{const n=Sl(Ir,e.__scopeMenu),r=v.useRef(null),i=ke(t,r);return v.useEffect(()=>{const a=r.current;if(a)return _y(a)},[]),s.jsx(MA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),NX=v.forwardRef((e,t)=>{const n=Sl(Ir,e.__scopeMenu);return s.jsx(MA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),TX=Vs("MenuContent.ScrollLock"),MA=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...p}=e,b=Sl(Ir,n),x=om(Ir,n),g=Dy(n),w=nL(n),S=vX(n),[j,A]=v.useState(null),N=v.useRef(null),T=ke(t,N,b.onContentChange),C=v.useRef(0),E=v.useRef(""),P=v.useRef(0),k=v.useRef(null),$=v.useRef("right"),I=v.useRef(0),F=y?tm:v.Fragment,R=y?{as:TX,allowPinchZoom:!0}:void 0,B=M=>{var fe,we;const W=E.current+M,Y=S().filter(K=>!K.disabled),q=document.activeElement,oe=(fe=Y.find(K=>K.ref.current===q))==null?void 0:fe.textValue,je=Y.map(K=>K.textValue),$e=LX(je,W,oe),Ee=(we=Y.find(K=>K.textValue===$e))==null?void 0:we.ref.current;(function K(V){E.current=V,window.clearTimeout(C.current),V!==""&&(C.current=window.setTimeout(()=>K(""),1e3))})(W),Ee&&setTimeout(()=>Ee.focus())};v.useEffect(()=>()=>window.clearTimeout(C.current),[]),Ey();const O=v.useCallback(M=>{var Y,q;return $.current===((Y=k.current)==null?void 0:Y.side)&&BX(M,(q=k.current)==null?void 0:q.area)},[]);return s.jsx(SX,{scope:n,searchRef:E,onItemEnter:v.useCallback(M=>{O(M)&&M.preventDefault()},[O]),onItemLeave:v.useCallback(M=>{var W;O(M)||((W=N.current)==null||W.focus(),A(null))},[O]),onTriggerLeave:v.useCallback(M=>{O(M)&&M.preventDefault()},[O]),pointerGraceTimerRef:P,onPointerGraceIntentChange:v.useCallback(M=>{k.current=M},[]),children:s.jsx(F,{...R,children:s.jsx(em,{asChild:!0,trapped:i,onMountAutoFocus:ee(a,M=>{var W;M.preventDefault(),(W=N.current)==null||W.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(bl,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:s.jsx(Q4,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:A,onEntryFocus:ee(c,M=>{x.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Ay,{role:"menu","aria-orientation":"vertical","data-state":jL(b.open),"data-radix-menu-content":"",dir:x.dir,...g,...p,ref:T,style:{outline:"none",...p.style},onKeyDown:ee(p.onKeyDown,M=>{const Y=M.target.closest("[data-radix-menu-content]")===M.currentTarget,q=M.ctrlKey||M.altKey||M.metaKey,oe=M.key.length===1;Y&&(M.key==="Tab"&&M.preventDefault(),!q&&oe&&B(M.key));const je=N.current;if(M.target!==je||!mX.includes(M.key))return;M.preventDefault();const Ee=S().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);eL.includes(M.key)&&Ee.reverse(),DX(Ee)}),onBlur:ee(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(C.current),E.current="")}),onPointerMove:ee(e.onPointerMove,Rf(M=>{const W=M.target,Y=I.current!==M.clientX;if(M.currentTarget.contains(W)&&Y){const q=M.clientX>I.current?"right":"left";$.current=q,I.current=M.clientX}}))})})})})})})});sL.displayName=Ir;var CX="MenuGroup",RA=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ye.div,{role:"group",...r,ref:t})});RA.displayName=CX;var PX="MenuLabel",oL=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ye.div,{...r,ref:t})});oL.displayName=PX;var bg="MenuItem",uk="menu.itemSelect",$y=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=om(bg,e.__scopeMenu),l=IA(bg,e.__scopeMenu),c=ke(t,a),u=v.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const h=new CustomEvent(uk,{bubbles:!0,cancelable:!0});f.addEventListener(uk,m=>r==null?void 0:r(m),{once:!0}),tA(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(lL,{...i,ref:c,disabled:n,onClick:ee(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:ee(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:ee(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||Xw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});$y.displayName=bg;var lL=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=IA(bg,n),l=nL(n),c=v.useRef(null),u=ke(t,c),[d,f]=v.useState(!1),[h,m]=v.useState("");return v.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[a.children]),s.jsx(Mf.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:s.jsx(J4,{asChild:!0,...l,focusable:!r,children:s.jsx(ye.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:ee(e.onPointerMove,Rf(y=>{r?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,Rf(y=>o.onItemLeave(y))),onFocus:ee(e.onFocus,()=>f(!0)),onBlur:ee(e.onBlur,()=>f(!1))})})})}),kX="MenuCheckboxItem",cL=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return s.jsx(mL,{scope:e.__scopeMenu,checked:n,children:s.jsx($y,{role:"menuitemcheckbox","aria-checked":wg(n)?"mixed":n,...i,ref:t,"data-state":$A(n),onSelect:ee(i.onSelect,()=>r==null?void 0:r(wg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cL.displayName=kX;var uL="MenuRadioGroup",[EX,OX]=jl(uL,{value:void 0,onValueChange:()=>{}}),dL=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=yt(r);return s.jsx(EX,{scope:e.__scopeMenu,value:n,onValueChange:a,children:s.jsx(RA,{...i,ref:t})})});dL.displayName=uL;var fL="MenuRadioItem",hL=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=OX(fL,e.__scopeMenu),a=n===i.value;return s.jsx(mL,{scope:e.__scopeMenu,checked:a,children:s.jsx($y,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":$A(a),onSelect:ee(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});hL.displayName=fL;var DA="MenuItemIndicator",[mL,_X]=jl(DA,{checked:!1}),pL=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=_X(DA,n);return s.jsx(an,{present:r||wg(a.checked)||a.checked===!0,children:s.jsx(ye.span,{...i,ref:t,"data-state":$A(a.checked)})})});pL.displayName=DA;var IX="MenuSeparator",gL=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});gL.displayName=IX;var MX="MenuArrow",vL=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Dy(n);return s.jsx(Ny,{...i,...r,ref:t})});vL.displayName=MX;var RX="MenuSub",[T_e,yL]=jl(RX),_d="MenuSubTrigger",xL=v.forwardRef((e,t)=>{const n=Sl(_d,e.__scopeMenu),r=om(_d,e.__scopeMenu),i=yL(_d,e.__scopeMenu),a=IA(_d,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),s.jsx(OA,{asChild:!0,...u,children:s.jsx(lL,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":jL(n.open),...e,ref:fy(t,i.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:ee(e.onPointerMove,Rf(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ee(e.onPointerLeave,Rf(f=>{var m,y;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const p=(y=n.content)==null?void 0:y.dataset.side,b=p==="right",x=b?-5:5,g=h[b?"left":"right"],w=h[b?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:g,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:g,y:h.bottom}],side:p}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,f=>{var m;const h=a.searchRef.current!=="";e.disabled||h&&f.key===" "||pX[r.dir].includes(f.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),f.preventDefault())})})})});xL.displayName=_d;var bL="MenuSubContent",wL=v.forwardRef((e,t)=>{const n=iL(Ir,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Sl(Ir,e.__scopeMenu),o=om(Ir,e.__scopeMenu),l=yL(bL,e.__scopeMenu),c=v.useRef(null),u=ke(t,c);return s.jsx(Mf.Provider,{scope:e.__scopeMenu,children:s.jsx(an,{present:r||a.open,children:s.jsx(Mf.Slot,{scope:e.__scopeMenu,children:s.jsx(MA,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ee(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ee(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),h=gX[o.dir].includes(d.key);f&&h&&(a.onOpenChange(!1),(m=l.trigger)==null||m.focus(),d.preventDefault())})})})})})});wL.displayName=bL;function jL(e){return e?"open":"closed"}function wg(e){return e==="indeterminate"}function $A(e){return wg(e)?"indeterminate":e?"checked":"unchecked"}function DX(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $X(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function LX(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=$X(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function FX(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(i=!i)}return i}function BX(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return FX(n,t)}function Rf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var VX=rL,WX=OA,zX=aL,UX=sL,HX=RA,qX=oL,GX=$y,YX=cL,KX=dL,XX=hL,ZX=pL,QX=gL,JX=vL,eZ=xL,tZ=wL,LA="DropdownMenu",[nZ,C_e]=rn(LA,[tL]),Bn=tL(),[rZ,SL]=nZ(LA),AL=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Bn(t),u=v.useRef(null),[d=!1,f]=hr({prop:i,defaultProp:a,onChange:o});return s.jsx(rZ,{scope:t,triggerId:Xn(),triggerRef:u,contentId:Xn(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:l,children:s.jsx(VX,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};AL.displayName=LA;var NL="DropdownMenuTrigger",TL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=SL(NL,n),o=Bn(n);return s.jsx(WX,{asChild:!0,...o,children:s.jsx(ye.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:fy(t,a.triggerRef),onPointerDown:ee(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:ee(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});TL.displayName=NL;var iZ="DropdownMenuPortal",CL=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Bn(t);return s.jsx(zX,{...r,...n})};CL.displayName=iZ;var PL="DropdownMenuContent",kL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=SL(PL,n),a=Bn(n),o=v.useRef(!1);return s.jsx(UX,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kL.displayName=PL;var aZ="DropdownMenuGroup",sZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(HX,{...i,...r,ref:t})});sZ.displayName=aZ;var oZ="DropdownMenuLabel",EL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(qX,{...i,...r,ref:t})});EL.displayName=oZ;var lZ="DropdownMenuItem",OL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(GX,{...i,...r,ref:t})});OL.displayName=lZ;var cZ="DropdownMenuCheckboxItem",_L=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(YX,{...i,...r,ref:t})});_L.displayName=cZ;var uZ="DropdownMenuRadioGroup",dZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(KX,{...i,...r,ref:t})});dZ.displayName=uZ;var fZ="DropdownMenuRadioItem",IL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(XX,{...i,...r,ref:t})});IL.displayName=fZ;var hZ="DropdownMenuItemIndicator",ML=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(ZX,{...i,...r,ref:t})});ML.displayName=hZ;var mZ="DropdownMenuSeparator",RL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(QX,{...i,...r,ref:t})});RL.displayName=mZ;var pZ="DropdownMenuArrow",gZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(JX,{...i,...r,ref:t})});gZ.displayName=pZ;var vZ="DropdownMenuSubTrigger",DL=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(eZ,{...i,...r,ref:t})});DL.displayName=vZ;var yZ="DropdownMenuSubContent",$L=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Bn(n);return s.jsx(tZ,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$L.displayName=yZ;var xZ=AL,bZ=TL,wZ=CL,LL=kL,FL=EL,BL=OL,VL=_L,WL=IL,zL=ML,UL=RL,HL=DL,qL=$L;const FA=xZ,BA=bZ,jZ=v.forwardRef(({className:e,inset:t,children:n,...r},i)=>s.jsxs(HL,{ref:i,className:Q("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,s.jsx(oA,{className:"ml-auto"})]}));jZ.displayName=HL.displayName;const SZ=v.forwardRef(({className:e,...t},n)=>s.jsx(qL,{ref:n,className:Q("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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));SZ.displayName=qL.displayName;const Ly=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(wZ,{children:s.jsx(LL,{ref:r,sideOffset:t,className:Q("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));Ly.displayName=LL.displayName;const sr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(BL,{ref:r,className:Q("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));sr.displayName=BL.displayName;const AZ=v.forwardRef(({className:e,children:t,checked:n,...r},i)=>s.jsxs(VL,{ref:i,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(zL,{children:s.jsx(Kc,{className:"h-4 w-4"})})}),t]}));AZ.displayName=VL.displayName;const NZ=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(WL,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(zL,{children:s.jsx(Xq,{className:"h-2 w-2 fill-current"})})}),t]}));NZ.displayName=WL.displayName;const TZ=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(FL,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));TZ.displayName=FL.displayName;const CZ=v.forwardRef(({className:e,...t},n)=>s.jsx(UL,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));CZ.displayName=UL.displayName;var VA="Avatar",[PZ,P_e]=rn(VA),[kZ,GL]=PZ(VA),YL=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,a]=v.useState("idle");return s.jsx(kZ,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:s.jsx(ye.span,{...r,ref:t})})});YL.displayName=VA;var KL="AvatarImage",XL=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=GL(KL,n),l=EZ(r,a),c=yt(u=>{i(u),o.onImageLoadingStatusChange(u)});return Ft(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(ye.img,{...a,ref:t,src:r}):null});XL.displayName=KL;var ZL="AvatarFallback",QL=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,a=GL(ZL,n),[o,l]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&a.imageLoadingStatus!=="loaded"?s.jsx(ye.span,{...i,ref:t}):null});QL.displayName=ZL;function dk(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function EZ(e,{referrerPolicy:t,crossOrigin:n}){const r=_Z(),i=v.useRef(null),a=r?(i.current||(i.current=new window.Image),i.current):null,[o,l]=v.useState(()=>dk(a,e));return Ft(()=>{l(dk(a,e))},[a,e]),Ft(()=>{const c=f=>()=>{l(f)};if(!a)return;const u=c("loaded"),d=c("error");return a.addEventListener("load",u),a.addEventListener("error",d),t&&(a.referrerPolicy=t),typeof n=="string"&&(a.crossOrigin=n),()=>{a.removeEventListener("load",u),a.removeEventListener("error",d)}},[a,n,t]),o}function OZ(){return()=>{}}function _Z(){return v.useSyncExternalStore(OZ,()=>!0,()=>!1)}var JL=YL,e3=XL,t3=QL;const WA=v.forwardRef(({className:e,...t},n)=>s.jsx(JL,{ref:n,className:Q(` after:content-[''] after:block after:absolute after:inset-0 after:rounded-full after:pointer-events-none after:border after:border-black/10 dark:after:border-white/10 relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));WA.displayName=JL.displayName;const zA=v.forwardRef(({className:e,...t},n)=>s.jsx(e3,{ref:n,className:Q("aspect-square h-full w-full",e),...t}));zA.displayName=e3.displayName;const UA=v.forwardRef(({className:e,...t},n)=>s.jsx(t3,{ref:n,className:Q("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));UA.displayName=t3.displayName;const IZ=Du("whitespace-nowrap inline-flex items-center rounded-md 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 hover-elevate ",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-xs",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-xs",outline:" border [border-color:var(--badge-outline)] shadow-xs"}},defaultVariants:{variant:"default"}});function Me({className:e,variant:t,...n}){return s.jsx("div",{className:Q(IZ({variant:t}),e),...n})}function qs({size:e="md",showText:t=!0}){const n=e==="sm"?"w-5 h-5":e==="lg"?"w-8 h-8":"w-6 h-6",r=e==="sm"?"w-8 h-8":e==="lg"?"w-12 h-12":"w-10 h-10",i=e==="sm"?"text-lg":e==="lg"?"text-2xl":"text-xl";return s.jsxs("div",{className:"flex items-center gap-2","data-testid":"logo",children:[s.jsx("div",{className:`${r} rounded-lg gradient-primary flex items-center justify-center`,children:s.jsx(rl,{className:`${n} text-white`})}),t&&s.jsxs("span",{className:`font-semibold ${i}`,children:[s.jsx("span",{className:"gradient-primary-text",children:"VoiceSalesFlow"}),s.jsx("span",{className:"text-muted-foreground ml-1",children:"AI"})]})]})}function Zi(){const{data:e,isLoading:t}=$t({queryKey:["/api/auth/user"],retry:!1});return{user:e,isLoading:t,isAuthenticated:!!e}}const MZ=[{title:"Dashboard",url:"/dashboard",icon:A$},{title:"Agents",url:"/agents",icon:ui},{title:"Analytics",url:"/analytics",icon:kf},{title:"Leads",url:"/leads",icon:Ui},{title:"Integrations",url:"#",icon:n9,disabled:!0,comingSoon:!0},{title:"Billing",url:"/billing",icon:gy},{title:"Settings",url:"/settings",icon:il}];function RZ(){const[e]=xl(),{user:t}=Zi(),n=()=>t!=null&&t.firstName&&(t!=null&&t.lastName)?`${t.firstName[0]}${t.lastName[0]}`.toUpperCase():t!=null&&t.email?t.email[0].toUpperCase():"U",r=()=>t!=null&&t.firstName&&(t!=null&&t.lastName)?`${t.firstName} ${t.lastName}`:(t==null?void 0:t.email)||"User";return s.jsxs(GK,{className:"border-r border-sidebar-border",children:[s.jsx(KK,{className:"p-4",children:s.jsx(de,{href:"/dashboard",children:s.jsx(qs,{size:"sm"})})}),s.jsx(ZK,{children:s.jsx(QK,{children:s.jsx(JK,{children:s.jsx(eX,{children:MZ.map(i=>{const a=e===i.url||i.url!=="/dashboard"&&e.startsWith(i.url),o="disabled"in i&&i.disabled,l="comingSoon"in i&&i.comingSoon;return o?s.jsx(lk,{children:s.jsxs(ck,{className:"relative opacity-50 cursor-not-allowed","data-testid":`nav-${i.title.toLowerCase().replace(/\s+/g,"-")}`,children:[s.jsx(i.icon,{className:"w-5 h-5"}),s.jsx("span",{children:i.title}),l&&s.jsx(Me,{variant:"secondary",className:"ml-auto text-[10px] px-1.5 py-0",children:"Soon"})]})},i.title):s.jsx(lk,{children:s.jsx(ck,{asChild:!0,isActive:a,className:"relative","data-testid":`nav-${i.title.toLowerCase().replace(/\s+/g,"-")}`,children:s.jsxs(de,{href:i.url,children:[a&&s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 rounded-r-full bg-primary"}),s.jsx(i.icon,{className:"w-5 h-5"}),s.jsx("span",{children:i.title})]})})},i.title)})})})})}),s.jsx(XK,{className:"p-4",children:s.jsxs(FA,{children:[s.jsx(BA,{asChild:!0,children:s.jsxs("button",{className:"flex items-center gap-3 w-full p-2 rounded-lg hover-elevate transition-colors","data-testid":"user-menu-trigger",children:[s.jsxs(WA,{className:"w-8 h-8",children:[s.jsx(zA,{src:(t==null?void 0:t.profileImageUrl)||void 0,className:"object-cover"}),s.jsx(UA,{className:"bg-primary text-primary-foreground text-sm",children:n()})]}),s.jsxs("div",{className:"flex-1 text-left min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r()}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t==null?void 0:t.email})]}),s.jsx(py,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"})]})}),s.jsxs(Ly,{align:"start",className:"w-56",children:[s.jsx(sr,{asChild:!0,children:s.jsxs(de,{href:"/settings",className:"flex items-center gap-2",children:[s.jsx(il,{className:"w-4 h-4"}),"Settings"]})}),s.jsx(sr,{asChild:!0,children:s.jsxs("a",{href:"/api/logout",className:"flex items-center gap-2 text-destructive","data-testid":"button-logout",children:[s.jsx(cA,{className:"w-4 h-4"}),"Log Out"]})})]})]})})]})}const ie=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("shadcn-card rounded-xl border bg-card border-card-border text-card-foreground shadow-sm",e),...t}));ie.displayName="Card";const Re=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("flex flex-col space-y-1.5 p-6",e),...t}));Re.displayName="CardHeader";const De=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("text-2xl font-semibold leading-none tracking-tight",e),...t}));De.displayName="CardTitle";const dt=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));dt.displayName="CardDescription";const ae=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("p-6 pt-0",e),...t}));ae.displayName="CardContent";const Id=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Q("flex items-center p-6 pt-0",e),...t}));Id.displayName="CardFooter";function DZ(){return s.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:s.jsx(ie,{className:"w-full max-w-md mx-4",children:s.jsxs(ae,{className:"pt-6",children:[s.jsxs("div",{className:"flex mb-4 gap-2",children:[s.jsx(wl,{className:"h-8 w-8 text-red-500"}),s.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),s.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function jg({isActive:e,color:t="hsl(var(--primary))",size:n="md"}){const r=n==="sm"?"h-3":n==="lg"?"h-8":"h-5",i=n==="sm"?"w-0.5":n==="lg"?"w-1.5":"w-1",a=n==="sm"?"gap-0.5":n==="lg"?"gap-1.5":"gap-1";return s.jsx("div",{className:`flex items-center justify-center ${a}`,"data-testid":"voice-waveform",children:[0,1,2,3,4].map(o=>s.jsx("div",{className:`${i} ${r} rounded-full transition-all duration-150 ${e?o===0?"animate-wave":o===1?"animate-wave-delay-1":o===2?"animate-wave-delay-2":o===3?"animate-wave-delay-3":"animate-wave-delay-4":"opacity-40"}`,style:{backgroundColor:t,transform:e?void 0:"scaleY(0.3)"}},o))})}var n3={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},fk=_.createContext&&_.createContext(n3),$Z=["attr","size","title"];function LZ(e,t){if(e==null)return{};var n=FZ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FZ(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 Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t_.createElement(t.tag,Ag({key:n},t.attr),r3(t.child)))}function zZ(e){return t=>_.createElement(UZ,Sg({attr:Ag({},e.attr)},t),r3(e.child))}function UZ(e){var t=n=>{var{attr:r,size:i,title:a}=e,o=LZ(e,$Z),l=i||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),_.createElement("svg",Sg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:c,style:Ag(Ag({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&_.createElement("title",null,a),e.children)};return fk!==void 0?_.createElement(fk.Consumer,null,n=>t(n)):t(n3)}function HA(e){return zZ({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"},child:[]}]})(e)}var qA="Collapsible",[HZ,i3]=rn(qA),[qZ,GA]=HZ(qA),a3=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c=!1,u]=hr({prop:r,defaultProp:i,onChange:o});return s.jsx(qZ,{scope:n,disabled:a,contentId:Xn(),open:c,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:s.jsx(ye.div,{"data-state":KA(c),"data-disabled":a?"":void 0,...l,ref:t})})});a3.displayName=qA;var s3="CollapsibleTrigger",o3=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=GA(s3,n);return s.jsx(ye.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":KA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ee(e.onClick,i.onOpenToggle)})});o3.displayName=s3;var YA="CollapsibleContent",l3=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=GA(YA,e.__scopeCollapsible);return s.jsx(an,{present:n||i.open,children:({present:a})=>s.jsx(GZ,{...r,ref:t,present:a})})});l3.displayName=YA;var GZ=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=GA(YA,n),[l,c]=v.useState(r),u=v.useRef(null),d=ke(t,u),f=v.useRef(0),h=f.current,m=v.useRef(0),y=m.current,p=o.open||l,b=v.useRef(p),x=v.useRef(void 0);return v.useEffect(()=>{const g=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(g)},[]),Ft(()=>{const g=u.current;if(g){x.current=x.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const w=g.getBoundingClientRect();f.current=w.height,m.current=w.width,b.current||(g.style.transitionDuration=x.current.transitionDuration,g.style.animationName=x.current.animationName),c(r)}},[o.open,r]),s.jsx(ye.div,{"data-state":KA(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!p,...a,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:p&&i})});function KA(e){return e?"open":"closed"}var YZ=a3,KZ=o3,XZ=l3,za="Accordion",ZZ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[XA,QZ,JZ]=Xh(za),[Fy,k_e]=rn(za,[JZ,i3]),ZA=i3(),c3=_.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,a=r;return s.jsx(XA.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(rQ,{...a,ref:t}):s.jsx(nQ,{...i,ref:t})})});c3.displayName=za;var[u3,eQ]=Fy(za),[d3,tQ]=Fy(za,{collapsible:!1}),nQ=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[l,c]=hr({prop:n,defaultProp:r,onChange:i});return s.jsx(u3,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:c,onItemClose:_.useCallback(()=>a&&c(""),[a,c]),children:s.jsx(d3,{scope:e.__scopeAccordion,collapsible:a,children:s.jsx(f3,{...o,ref:t})})})}),rQ=_.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o=[],l]=hr({prop:n,defaultProp:r,onChange:i}),c=_.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=_.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return s.jsx(u3,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(d3,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(f3,{...a,ref:t})})})}),[iQ,By]=Fy(za),f3=_.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:a="vertical",...o}=e,l=_.useRef(null),c=ke(l,t),u=QZ(n),f=Bu(i)==="ltr",h=ee(e.onKeyDown,m=>{var T;if(!ZZ.includes(m.key))return;const y=m.target,p=u().filter(C=>{var E;return!((E=C.ref.current)!=null&&E.disabled)}),b=p.findIndex(C=>C.ref.current===y),x=p.length;if(b===-1)return;m.preventDefault();let g=b;const w=0,S=x-1,j=()=>{g=b+1,g>S&&(g=w)},A=()=>{g=b-1,g{const{__scopeAccordion:n,value:r,...i}=e,a=By(Ng,n),o=eQ(Ng,n),l=ZA(n),c=Xn(),u=r&&o.value.includes(r)||!1,d=a.disabled||e.disabled;return s.jsx(aQ,{scope:n,open:u,disabled:d,triggerId:c,children:s.jsx(YZ,{"data-orientation":a.orientation,"data-state":x3(u),...l,...i,ref:t,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});h3.displayName=Ng;var m3="AccordionHeader",p3=_.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=By(za,n),a=QA(m3,n);return s.jsx(ye.h3,{"data-orientation":i.orientation,"data-state":x3(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});p3.displayName=m3;var Zw="AccordionTrigger",g3=_.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=By(za,n),a=QA(Zw,n),o=tQ(Zw,n),l=ZA(n);return s.jsx(XA.ItemSlot,{scope:n,children:s.jsx(KZ,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...r,ref:t})})});g3.displayName=Zw;var v3="AccordionContent",y3=_.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=By(za,n),a=QA(v3,n),o=ZA(n);return s.jsx(XZ,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});y3.displayName=v3;function x3(e){return e?"open":"closed"}var sQ=c3,oQ=h3,lQ=p3,b3=g3,w3=y3;const cQ=sQ,aa=v.forwardRef(({className:e,...t},n)=>s.jsx(oQ,{ref:n,className:Q("border-b",e),...t}));aa.displayName="AccordionItem";const sa=v.forwardRef(({className:e,children:t,...n},r)=>s.jsx(lQ,{className:"flex",children:s.jsxs(b3,{ref:r,className:Q("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,s.jsx(py,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));sa.displayName=b3.displayName;const oa=v.forwardRef(({className:e,children:t,...n},r)=>s.jsx(w3,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:s.jsx("div",{className:Q("pb-4 pt-0",e),children:t})}));oa.displayName=w3.displayName;function mk(){return v.useEffect(()=>{const e=`${window.location.origin}/widget.js`,t=document.createElement("script");return t.id="voiceflow-widget",t.src=e,t.async=!0,t.onload=()=>{window.VoiceFlowWidget&&window.VoiceFlowWidget.init&&window.VoiceFlowWidget.init({agentId:"24d697b8-78d5-437d-86e1-393f21957660",primaryColor:"#FF6B35",secondaryColor:"#FFB81C",position:"bottom-right",greeting:"Hi! I'm your AI assistant. How can I help you find the perfect product today?"})},document.head.appendChild(t),()=>{const n=document.getElementById("voiceflow-widget");n&&n.remove();const r=document.getElementById("voiceflow-widget-container");r&&r.remove()}},[]),s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("nav",{className:"fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-md border-b border-border",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex items-center justify-between h-16 gap-4",children:[s.jsx(qs,{size:"md"}),s.jsxs("div",{className:"hidden md:flex items-center gap-8",children:[s.jsx("a",{href:"#features",className:"text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"nav-features",children:"Features"}),s.jsx("a",{href:"#how-it-works",className:"text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"nav-how-it-works",children:"How It Works"}),s.jsx("a",{href:"#pricing",className:"text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"nav-pricing",children:"Pricing"}),s.jsx("a",{href:"#faq",className:"text-sm text-muted-foreground hover:text-foreground transition-colors","data-testid":"nav-faq",children:"FAQ"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("a",{href:"/api/login",children:s.jsxs(X,{variant:"ghost","data-testid":"button-login",children:[s.jsx(HA,{className:"w-4 h-4 mr-2"}),"Sign In"]})}),s.jsx("a",{href:"/api/login",children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-get-started",children:["Get Started",s.jsx(kr,{className:"w-4 h-4 ml-2"})]})})]})]})})}),s.jsxs("section",{className:"relative pt-32 pb-20 overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-background via-background to-primary/5"}),s.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/10 rounded-full blur-3xl"}),s.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[s.jsxs(Me,{variant:"secondary",className:"mb-6 px-4 py-1.5 text-sm","data-testid":"badge-hero",children:[s.jsx(Hi,{className:"w-3 h-3 mr-1.5 text-primary"}),"AI-Powered Voice Sales Agents"]}),s.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6","data-testid":"hero-title",children:["Transform Your Website with",s.jsx("span",{className:"block gradient-primary-text mt-2",children:"Intelligent Voice Sales Agents"})]}),s.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-2xl mx-auto","data-testid":"hero-description",children:"Deploy AI-powered voice assistants that help customers, answer questions, and drive conversions 24/7. Just like having your best sales rep available around the clock."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 mb-12",children:[s.jsx("a",{href:"/api/login",children:s.jsxs(X,{size:"lg",className:"gradient-primary border-0 px-8 h-12 text-base","data-testid":"button-hero-start",children:["Start Free Trial",s.jsx(kr,{className:"w-5 h-5 ml-2"})]})}),s.jsx("a",{href:"https://kkmtile.com/",target:"_blank",rel:"noopener noreferrer",children:s.jsxs(X,{size:"lg",variant:"outline",className:"px-8 h-12 text-base","data-testid":"button-hero-demo",children:[s.jsx(tl,{className:"w-5 h-5 mr-2"}),"Watch Demo"]})})]}),s.jsx("div",{className:"grid grid-cols-3 gap-8 max-w-2xl mx-auto",children:[{value:"10K+",label:"Active Agents"},{value:"2M+",label:"Conversations"},{value:"35%",label:"Conversion Boost"}].map((e,t)=>s.jsxs("div",{className:"text-center","data-testid":`stat-${t}`,children:[s.jsx("div",{className:"text-2xl sm:text-3xl font-bold gradient-primary-text",children:e.value}),s.jsx("div",{className:"text-sm text-muted-foreground",children:e.label})]},t))})]}),s.jsxs("div",{className:"mt-16 relative max-w-4xl mx-auto",children:[s.jsxs("div",{className:"relative bg-card border border-card-border rounded-2xl p-6 shadow-2xl",children:[s.jsxs("div",{className:"flex items-center gap-2 pb-4 border-b border-border mb-4",children:[s.jsxs("div",{className:"flex gap-1.5",children:[s.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),s.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),s.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),s.jsx("div",{className:"flex-1 mx-4",children:s.jsx("div",{className:"h-7 bg-muted rounded-md flex items-center px-3",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"yourstore.com"})})})]}),s.jsxs("div",{className:"relative h-72 bg-gradient-to-br from-slate-100 to-slate-50 dark:from-slate-800 dark:to-slate-900 rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"p-6",children:[s.jsx("div",{className:"h-4 bg-slate-300 dark:bg-slate-700 rounded w-48 mb-3"}),s.jsx("div",{className:"h-3 bg-slate-200 dark:bg-slate-600 rounded w-64 mb-6"}),s.jsx("div",{className:"grid grid-cols-4 gap-4",children:[1,2,3,4].map(e=>s.jsx("div",{className:"aspect-square bg-slate-200 dark:bg-slate-700 rounded-lg"},e))})]}),s.jsxs("div",{className:"absolute bottom-24 right-6 max-w-56 p-4 bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-border",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Hi! I'm your AI assistant. How can I help you find the perfect product today?"}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(jg,{isActive:!0,color:"hsl(var(--primary))",size:"sm"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Listening..."})]})]}),s.jsxs("div",{className:"absolute bottom-4 right-6 w-14 h-14 rounded-full gradient-primary flex items-center justify-center shadow-lg glow-orange",children:[s.jsx(rl,{className:"w-6 h-6 text-white"}),s.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/30 animate-pulse-ring"})]})]})]}),s.jsx("div",{className:"absolute -top-4 -left-4 w-24 h-24 bg-primary/20 rounded-full blur-2xl"}),s.jsx("div",{className:"absolute -bottom-4 -right-4 w-32 h-32 bg-accent/20 rounded-full blur-2xl"})]})]})]}),s.jsx("section",{id:"features",className:"py-24 bg-card/50",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx(Me,{variant:"secondary",className:"mb-4","data-testid":"badge-features",children:"Features"}),s.jsxs("h2",{className:"text-3xl sm:text-4xl font-bold mb-4","data-testid":"features-title",children:["Everything You Need to ",s.jsx("span",{className:"gradient-primary-text",children:"Convert Visitors"})]}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Powerful features designed to help you create, train, and deploy AI voice agents that truly understand your business."})]}),s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:[{icon:rl,title:"Natural Voice AI",description:"State-of-the-art voice technology that sounds natural and engages visitors in real conversations."},{icon:yy,title:"Smart Lead Capture",description:"AI automatically extracts emails, phone numbers, and custom data fields during conversations. Never miss a lead."},{icon:pc,title:"Full Transcripts",description:"Access complete conversation transcripts for every interaction. Review what was said and how leads engaged."},{icon:S$,title:"Audio Recordings",description:"Listen to recorded conversations anytime. Hear exactly how your AI agent handled each customer interaction."},{icon:MP,title:"Smart Training",description:"Train your agent with documents, URLs, and custom prompts to make it an expert on your products."},{icon:kf,title:"Deep Analytics",description:"Track every conversation, measure conversion rates, and optimize your agent's performance."},{icon:hg,title:"Brand Customization",description:"Match your widget to your brand with custom colors, positioning, and greeting messages."},{icon:nl,title:"Easy Integration",description:"Simple JavaScript snippet that works with any website. Just copy, paste, and you're live."},{icon:tl,title:"Live Testing",description:"Test and refine your agent's responses before deploying to your website."}].map((e,t)=>s.jsx(ie,{className:"bg-card border-card-border hover-elevate transition-all duration-300","data-testid":`feature-card-${t}`,children:s.jsxs(ae,{className:"p-6",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:s.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:e.title}),s.jsx("p",{className:"text-muted-foreground",children:e.description})]})},t))})]})}),s.jsx("section",{id:"how-it-works",className:"py-24",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx(Me,{variant:"secondary",className:"mb-4","data-testid":"badge-how-it-works",children:"How It Works"}),s.jsxs("h2",{className:"text-3xl sm:text-4xl font-bold mb-4","data-testid":"how-it-works-title",children:["Go Live in ",s.jsx("span",{className:"gradient-primary-text",children:"Minutes"})]}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Getting started is simple. Create your agent, train it, customize the look, and deploy to your website."})]}),s.jsx("div",{className:"grid md:grid-cols-4 gap-8",children:[{step:"01",title:"Create Agent",description:"Name your agent and define its personality with a custom prompt.",icon:Ui},{step:"02",title:"Train It",description:"Upload documents, add URLs, or paste content to train your agent.",icon:MP},{step:"03",title:"Customize",description:"Match your brand colors and configure the widget appearance.",icon:hg},{step:"04",title:"Deploy",description:"Copy the code snippet and paste it into your website header.",icon:Of}].map((e,t)=>s.jsxs("div",{className:"text-center relative","data-testid":`step-${t}`,children:[t<3&&s.jsx("div",{className:"hidden md:block absolute top-12 left-1/2 w-full h-0.5 bg-gradient-to-r from-primary/50 to-transparent"}),s.jsxs("div",{className:"relative z-10",children:[s.jsx("div",{className:"w-24 h-24 mx-auto rounded-2xl gradient-primary flex items-center justify-center mb-4 glow-orange-sm",children:s.jsx(e.icon,{className:"w-10 h-10 text-white"})}),s.jsx("div",{className:"text-sm font-mono text-primary mb-2",children:e.step}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:e.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})]},t))})]})}),s.jsx("section",{id:"pricing",className:"py-24 bg-card/50",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx(Me,{variant:"secondary",className:"mb-4","data-testid":"badge-pricing",children:"Pricing"}),s.jsxs("h2",{className:"text-3xl sm:text-4xl font-bold mb-4","data-testid":"pricing-title",children:["Simple, ",s.jsx("span",{className:"gradient-primary-text",children:"Transparent Pricing"})]}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Start free and scale as you grow. No hidden fees, no surprises."})]}),s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:[{id:"free",name:"Free Forever",price:"$0",period:"/month",description:"Perfect for trying out VoiceSalesFlow AI",minutes:"15 minutes",conversations:"~7 conversations",overage:"Upgrade required",features:["1 Voice Agent","Lead Capture (Email & Phone)","Conversation Transcripts","Audio Recordings","Basic Analytics"],cta:"Get Started Free",popular:!1},{id:"starter",name:"Starter",price:"$49",period:"/month",description:"For small businesses getting started",minutes:"200 minutes",conversations:"~100 conversations",overage:"$0.40/min overage",features:["3 Voice Agents","Lead Capture + Custom Fields","Full Transcripts & Recordings","Leads Dashboard","5 Training Documents"],cta:"Start Free Trial",popular:!1},{id:"growth",name:"Growth",price:"$149",period:"/month",description:"For growing businesses",minutes:"600 minutes",conversations:"~300 conversations",overage:"$0.35/min overage",features:["Unlimited Agents","Advanced Lead Capture","Full Transcripts & Recordings","Conversion Tracking","Advanced Analytics"],cta:"Start Free Trial",popular:!0},{id:"scale",name:"Scale",price:"$399",period:"/month",description:"For high-volume businesses",minutes:"1,600 minutes",conversations:"~800 conversations",overage:"$0.30/min overage",features:["Everything in Growth","Custom Voice Cloning","Custom Data Fields","CRM Integrations","Dedicated Manager"],cta:"Start Free Trial",popular:!1}].map((e,t)=>s.jsxs(ie,{className:`relative bg-card border-card-border ${e.popular?"ring-2 ring-primary glow-orange":""}`,"data-testid":`pricing-card-${e.id}`,children:[e.popular&&s.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:s.jsx(Me,{className:"gradient-primary border-0 text-white",children:"Most Popular"})}),s.jsxs(ae,{className:"p-5",children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:e.name}),s.jsxs("div",{className:"mb-3",children:[s.jsx("span",{className:"text-3xl font-bold",children:e.price}),s.jsx("span",{className:"text-muted-foreground text-sm",children:e.period})]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:e.description}),s.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 mb-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-lg font-bold text-primary",children:e.minutes}),s.jsx("div",{className:"text-xs text-muted-foreground",children:e.conversations})]}),s.jsx("div",{className:"text-center mt-2 pt-2 border-t border-border",children:s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:e.overage})})]}),s.jsx("ul",{className:"space-y-2 mb-5",children:e.features.map((n,r)=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsx(lA,{className:"w-3.5 h-3.5 text-primary flex-shrink-0"}),s.jsx("span",{children:n})]},r))}),s.jsx("a",{href:"/api/login",children:s.jsx(X,{className:`w-full ${e.popular?"gradient-primary border-0":""}`,variant:e.popular?"default":"outline",size:"sm","data-testid":`button-pricing-${e.id}`,children:e.cta})})]})]},t))}),s.jsx("div",{className:"text-center mt-8",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"All plans include real-time AI voice conversations. Average conversation length is ~2 minutes."})})]})}),s.jsxs("section",{id:"guarantee",className:"py-20 relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-amber-500/5 via-transparent to-yellow-500/5"}),s.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-amber-500/10 rounded-full blur-3xl"}),s.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsxs(Me,{variant:"secondary",className:"mb-4 px-4 py-1.5 bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20","data-testid":"badge-guarantee",children:[s.jsx(h9,{className:"w-3 h-3 mr-1.5"}),"Risk-Free Guarantee"]}),s.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-4","data-testid":"guarantee-title",children:['Our "You Win Or We Pay" ',s.jsx("span",{className:"text-amber-500",children:"Promise"})]}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"We're so confident Voice Sales Flow AI will transform your business that we're putting our money where our mouth is."})]}),s.jsx(ie,{className:"bg-gradient-to-br from-card via-card to-amber-500/5 border-2 border-amber-500/20 shadow-2xl shadow-amber-500/10","data-testid":"guarantee-card",children:s.jsxs(ae,{className:"p-8 md:p-12",children:[s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[s.jsx("div",{className:"flex justify-center",children:s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-amber-400 to-yellow-500 blur-xl opacity-30 animate-pulse"}),s.jsx("div",{className:"relative w-64 h-64 rounded-full bg-gradient-to-br from-amber-400 via-amber-500 to-yellow-600 p-1 shadow-2xl",children:s.jsxs("div",{className:"w-full h-full rounded-full bg-gradient-to-br from-amber-50 to-amber-100 dark:from-amber-950 dark:to-amber-900 flex flex-col items-center justify-center p-6",children:[s.jsx(Hq,{className:"w-12 h-12 text-amber-600 dark:text-amber-400 mb-2"}),s.jsx("div",{className:"text-4xl font-black text-amber-600 dark:text-amber-400",children:"100%"}),s.jsx("div",{className:"text-lg font-bold text-amber-700 dark:text-amber-300 text-center",children:"Money Back"}),s.jsx("div",{className:"text-sm font-semibold text-amber-600 dark:text-amber-400 text-center mt-1",children:"GUARANTEE"}),s.jsx("div",{className:"mt-2 px-3 py-1 bg-amber-500/20 rounded-full",children:s.jsx("span",{className:"text-xs font-bold text-amber-700 dark:text-amber-300",children:"90 DAYS"})})]})}),s.jsx("div",{className:"absolute -top-2 -right-2 text-amber-400 text-2xl",children:"✦"}),s.jsx("div",{className:"absolute -bottom-1 -left-3 text-amber-400 text-xl",children:"✦"})]})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold mb-4",children:"The Bold Promise:"}),s.jsxs("p",{className:"text-lg leading-relaxed",children:["Use Voice Sales Flow AI for ",s.jsx("strong",{className:"text-amber-500",children:"90 days"}),". If your AI voice agent doesn't increase your qualified leads or sales by at least ",s.jsx("strong",{className:"text-amber-500",children:"25%"}),", we'll refund every single penny."]})]}),s.jsxs("div",{className:"bg-muted/50 rounded-xl p-5 border border-border",children:[s.jsx("p",{className:"font-semibold text-lg mb-1",children:"No fine print. No hoops to jump through."}),s.jsx("p",{className:"text-muted-foreground",children:"Just send us an email, and we'll process your full refund within 5 business days. No questions asked. No awkward phone calls. No guilt trips."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 pt-2",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto rounded-xl bg-amber-500/10 flex items-center justify-center mb-2",children:s.jsx(mi,{className:"w-6 h-6 text-amber-500"})}),s.jsx("div",{className:"text-sm font-semibold",children:"90 Days"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"To Test It"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto rounded-xl bg-amber-500/10 flex items-center justify-center mb-2",children:s.jsx(Ws,{className:"w-6 h-6 text-amber-500"})}),s.jsx("div",{className:"text-sm font-semibold",children:"25% Lift"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Or It's Free"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto rounded-xl bg-amber-500/10 flex items-center justify-center mb-2",children:s.jsx(Ef,{className:"w-6 h-6 text-amber-500"})}),s.jsx("div",{className:"text-sm font-semibold",children:"100% Back"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"No Questions"})]})]})]})]}),s.jsxs("div",{className:"mt-10 pt-8 border-t border-border text-center",children:[s.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"Why do we offer this? Because we've watched businesses just like yours transform with AI voice agents. We've seen the 35% conversion boosts. We've seen the leads pour in at 3am. We know it works. And now it's your turn."}),s.jsx("a",{href:"/api/login",children:s.jsxs(X,{size:"lg",className:"bg-gradient-to-r from-amber-500 to-yellow-500 hover:from-amber-600 hover:to-yellow-600 text-white border-0 px-8 h-12 text-base shadow-lg shadow-amber-500/25","data-testid":"button-guarantee-cta",children:["Start Risk-Free Today",s.jsx(kr,{className:"w-5 h-5 ml-2"})]})}),s.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"Cancel anytime. Seriously."})]})]})})]})]}),s.jsx("section",{className:"py-16 border-t border-border",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsx("div",{className:"flex flex-wrap justify-center items-center gap-8",children:[{icon:Xc,text:"Enterprise Security"},{icon:di,text:"24/7 Support"},{icon:Ws,text:"99.9% Uptime"},{icon:Of,text:"GDPR Compliant"}].map((e,t)=>s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground","data-testid":`trust-${t}`,children:[s.jsx(e.icon,{className:"w-5 h-5 text-primary"}),s.jsx("span",{className:"text-sm",children:e.text})]},t))})})}),s.jsx("section",{id:"faq",className:"py-20 bg-card/50",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsxs(Me,{variant:"secondary",className:"mb-4 px-4 py-1.5","data-testid":"badge-faq",children:[s.jsx(b$,{className:"w-3 h-3 mr-1.5"}),"Frequently Asked Questions"]}),s.jsxs("h2",{className:"text-3xl sm:text-4xl font-bold mb-4","data-testid":"faq-title",children:["Got Questions? We've Got ",s.jsx("span",{className:"gradient-primary-text",children:"Answers"})]}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to know about Voice Sales Flow AI and how it can transform your business."})]}),s.jsxs(cQ,{type:"single",collapsible:!0,className:"w-full space-y-4","data-testid":"faq-accordion",children:[s.jsxs(aa,{value:"item-1",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-1",children:"What is Voice Sales Flow AI and how does it work?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-1",children:"Voice Sales Flow AI is a platform that lets you deploy AI-powered voice sales agents on your website. These agents use advanced AI technology from OpenAI to have natural voice conversations with your visitors. When someone clicks on the voice widget, they can speak directly to the AI which understands their questions, processes the context, and responds with helpful information using natural speech. The AI is trained on your specific business information to provide accurate, personalized responses 24/7."})]}),s.jsxs(aa,{value:"item-2",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-2",children:"What websites can use Voice Sales Flow AI?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-2",children:"Any website can integrate Voice Sales Flow AI! Our embeddable widget works with all major platforms including WordPress, Shopify, Wix, Squarespace, Webflow, and custom HTML sites. Simply add a small JavaScript code snippet to your website and the voice agent will appear as a customizable widget. The integration takes less than 5 minutes and requires no coding knowledge."})]}),s.jsxs(aa,{value:"item-3",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-3",children:"How much does Voice Sales Flow AI cost?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-3",children:"We offer flexible pricing starting with a Free Forever plan (15 minutes/month) so you can try it risk-free. Paid plans include: Starter at $49/month (200 minutes, 3 agents), Growth at $149/month (600 minutes, unlimited agents), and Scale at $399/month (1,600 minutes, all features plus dedicated support). All plans include core features like custom branding, analytics, and training capabilities."})]}),s.jsxs(aa,{value:"item-4",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-4",children:"Can I customize the AI voice and widget appearance?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-4",children:"Absolutely! You can choose from 8 different professional AI voice options including alloy, coral, sage, and shimmer. You can also fully customize the widget's colors to match your brand, set the position on your page, and create personalized greeting messages. Train the AI with your specific business information to ensure responses align with your brand voice and knowledge."})]}),s.jsxs(aa,{value:"item-5",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-5",children:"How long does it take to set up?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-5",children:"Most businesses can deploy their first AI voice agent in under 10 minutes! The process is simple: 1) Create an account, 2) Set up your agent with a name, greeting, and voice selection, 3) Add training content about your business, 4) Customize the widget appearance, and 5) Copy the embed code to your website. No technical expertise or coding knowledge is required."})]}),s.jsxs(aa,{value:"item-6",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-6",children:"Is Voice Sales Flow AI really available 24/7?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-6",children:"Yes! Voice Sales Flow AI operates 24 hours a day, 7 days a week, 365 days a year. Unlike human sales representatives who work limited hours, AI voice agents are always available to engage website visitors, answer questions, and capture leads. This means you never miss a potential customer, even outside business hours, on holidays, or during peak traffic times."})]}),s.jsxs(aa,{value:"item-7",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-7",children:"What industries benefit most from AI voice agents?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-7",children:"AI voice agents benefit many industries including: E-commerce (product recommendations, cart abandonment recovery), Real Estate (property information, scheduling viewings), Healthcare (appointment scheduling, FAQ answering), Professional Services (service inquiries, consultation booking), SaaS/Technology (product demos, feature explanations), and Financial Services (product information, lead qualification). Any business that wants to engage website visitors and capture leads can benefit."})]}),s.jsxs(aa,{value:"item-8",className:"border border-border rounded-lg px-6 bg-card",children:[s.jsx(sa,{className:"text-left hover:no-underline","data-testid":"faq-question-8",children:"How does Voice AI compare to traditional chatbots?"}),s.jsx(oa,{className:"text-muted-foreground","data-testid":"faq-answer-8",children:"Voice Sales Flow AI offers several advantages over traditional text-based chatbots: Natural voice conversations feel more personal and engaging, visitors can multitask while speaking instead of typing, voice AI can convey emotion and empathy better than text, complex questions are easier to explain verbally, and voice interactions typically have higher engagement and conversion rates. Our AI uses advanced natural language processing for human-like conversations rather than scripted responses."})]})]})]})}),s.jsxs("section",{className:"py-24 relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 gradient-primary opacity-10"}),s.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-primary/20 rounded-full blur-3xl"}),s.jsxs("div",{className:"relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[s.jsxs("h2",{className:"text-3xl sm:text-4xl font-bold mb-4","data-testid":"cta-title",children:["Ready to Transform Your ",s.jsx("span",{className:"gradient-primary-text",children:"Customer Experience"}),"?"]}),s.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join thousands of businesses using VoiceSalesFlow AI to engage visitors and boost conversions."}),s.jsx("a",{href:"/api/login",children:s.jsxs(X,{size:"lg",className:"gradient-primary border-0 px-8 h-12 text-base","data-testid":"button-cta-start",children:["Start Your Free Trial",s.jsx(kr,{className:"w-5 h-5 ml-2"})]})})]})]}),s.jsx("footer",{className:"py-12 bg-card border-t border-border",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"grid md:grid-cols-4 gap-8 mb-8",children:[s.jsxs("div",{children:[s.jsx(qs,{size:"sm"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"AI-powered voice sales agents that help your business grow 24/7."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-4",children:"Product"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx("a",{href:"#features",className:"hover:text-foreground transition-colors",children:"Features"})}),s.jsx("li",{children:s.jsx("a",{href:"#pricing",className:"hover:text-foreground transition-colors",children:"Pricing"})}),s.jsx("li",{children:s.jsx("a",{href:"#faq",className:"hover:text-foreground transition-colors",children:"FAQ"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-4",children:"Company"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx("a",{href:"/about",className:"hover:text-foreground transition-colors",children:"About"})}),s.jsx("li",{children:s.jsx("a",{href:"/blog",className:"hover:text-foreground transition-colors",children:"Blog"})}),s.jsx("li",{children:s.jsx("a",{href:"/contact",className:"hover:text-foreground transition-colors",children:"Contact"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-4",children:"Legal"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx("a",{href:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})}),s.jsx("li",{children:s.jsx("a",{href:"/terms",className:"hover:text-foreground transition-colors",children:"Terms of Service"})})]})]})]}),s.jsx("div",{className:"pt-8 border-t border-border flex flex-col md:flex-row justify-between items-center gap-4",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," MeTel, Inc d/b/a Voice Sales Flow AI. All rights reserved."]})})]})})]})}function pk(){const{toast:e}=Pn(),{user:t,isAuthenticated:n,isLoading:r}=Zi();v.useEffect(()=>{!r&&!n&&(e({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500))},[n,r,e]),v.useEffect(()=>{const u=localStorage.getItem("vf_visitor_id")||"",d=new Image;d.src="https://voicesalesflow.app/api/pixel/conversion?agentId=24d697b8-78d5-437d-86e1-393f21957660&value=49.00"+(u?"&visitorId="+encodeURIComponent(u):"")},[]);const{data:i,isLoading:a}=$t({queryKey:["/api/agents"],enabled:n}),{data:o}=$t({queryKey:["/api/analytics/overview"],enabled:n}),l=u=>{const d=Math.floor(u/60),f=u%60;return`${d}:${f.toString().padStart(2,"0")}`};if(r)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})});const c=[{title:"Total Agents",value:(i==null?void 0:i.length)||0,icon:ui,trend:null,color:"text-primary"},{title:"Total Conversations",value:(o==null?void 0:o.totalConversations)||0,icon:di,trend:(o==null?void 0:o.conversationsTrend)||0,color:"text-blue-500"},{title:"Conversion Rate",value:`${(o==null?void 0:o.conversionRate)||0}%`,icon:Ws,trend:(o==null?void 0:o.conversionTrend)||0,color:"text-green-500"},{title:"Monthly Usage",value:l((o==null?void 0:o.monthlyUsageSeconds)||0),icon:Uq,trend:null,color:"text-purple-500"}];return s.jsxs("div",{className:"p-6 space-y-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold","data-testid":"dashboard-title",children:["Welcome back",t!=null&&t.firstName?`, ${t.firstName}`:""]}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Here's what's happening with your voice agents today."})]}),s.jsx(de,{href:"/agents/new",children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-create-agent",children:[s.jsx(gc,{className:"w-4 h-4 mr-2"}),"Create Agent"]})})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:c.map((u,d)=>s.jsx(ie,{className:"bg-card border-card-border","data-testid":`stat-card-${d}`,children:s.jsxs(ae,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:s.jsx(u.icon,{className:`w-5 h-5 ${u.color}`})}),u.trend!==null&&s.jsxs(Me,{variant:"secondary",className:u.trend>=0?"text-green-600":"text-red-600",children:[u.trend>=0?s.jsx(x$,{className:"w-3 h-3 mr-1"}):s.jsx(y$,{className:"w-3 h-3 mr-1"}),Math.abs(u.trend),"%"]})]}),s.jsx("div",{className:"text-2xl font-bold",children:u.value}),s.jsx("div",{className:"text-sm text-muted-foreground",children:u.title})]})},d))}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-lg font-semibold","data-testid":"recent-agents-title",children:"Your Agents"}),s.jsx(de,{href:"/agents",children:s.jsxs(X,{variant:"ghost",size:"sm","data-testid":"button-view-all-agents",children:["View All",s.jsx(kr,{className:"w-4 h-4 ml-1"})]})})]}),a?s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(u=>s.jsx(ie,{className:"bg-card border-card-border",children:s.jsxs(ae,{className:"p-6",children:[s.jsx(Oe,{className:"h-6 w-32 mb-2"}),s.jsx(Oe,{className:"h-4 w-full mb-4"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{className:"h-8 w-20"}),s.jsx(Oe,{className:"h-8 w-20"})]})]})},u))}):i&&i.length>0?s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[i.slice(0,6).map(u=>{var d;return s.jsx(ie,{className:"bg-card border-card-border hover-elevate transition-all duration-300","data-testid":`agent-card-${u.id}`,children:s.jsxs(ae,{className:"p-6",children:[s.jsx("div",{className:"flex items-start justify-between mb-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:u.widgetPrimaryColor||"#FF6B35"},children:s.jsx(ui,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:u.name}),s.jsx(Me,{variant:u.isActive?"default":"secondary",className:"mt-1",children:u.isActive?"Active":"Inactive"})]})]})}),s.jsxs("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:[((d=u.prompt)==null?void 0:d.slice(0,100))||"No prompt configured","..."]}),s.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-4",children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(di,{className:"w-4 h-4"}),u.totalConversations||0]})}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsx(de,{href:`/agents/${u.id}`,children:s.jsx(X,{size:"sm",variant:"outline","data-testid":`button-edit-${u.id}`,children:"Configure"})}),s.jsx(de,{href:`/agents/${u.id}/test`,children:s.jsx(X,{size:"sm",className:"gradient-primary border-0","data-testid":`button-test-${u.id}`,children:"Test"})}),s.jsx(de,{href:`/agents/${u.id}/embed`,children:s.jsxs(X,{size:"sm",variant:"outline","data-testid":`button-embed-${u.id}`,children:[s.jsx(nl,{className:"w-3 h-3 mr-1"}),"Embed"]})})]})]})},u.id)}),s.jsx(de,{href:"/agents/new",children:s.jsx(ie,{className:"bg-card border-card-border border-dashed hover-elevate transition-all duration-300 cursor-pointer h-full min-h-[200px]","data-testid":"card-create-new-agent",children:s.jsxs(ae,{className:"p-6 h-full flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-3",children:s.jsx(gc,{className:"w-6 h-6 text-primary"})}),s.jsx("p",{className:"font-medium",children:"Create New Agent"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center mt-1",children:"Set up a new voice sales agent"})]})})})]}):s.jsx(ie,{className:"bg-card border-card-border",children:s.jsxs(ae,{className:"p-12 text-center",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:s.jsx(ui,{className:"w-8 h-8 text-primary"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No agents yet"}),s.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm mx-auto",children:"Create your first voice sales agent to start helping customers and driving conversions."}),s.jsx(de,{href:"/agents/new",children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-create-first-agent",children:[s.jsx(gc,{className:"w-4 h-4 mr-2"}),"Create Your First Agent"]})})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(ie,{className:"bg-gradient-to-br from-primary/10 to-accent/10 border-primary/20",children:s.jsxs(ae,{className:"p-6",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"Need help getting started?"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Check out our documentation to learn how to create and train your first agent."}),s.jsx(de,{href:"/docs",children:s.jsxs(X,{variant:"outline",size:"sm","data-testid":"button-view-docs",children:["View Documentation",s.jsx(kr,{className:"w-4 h-4 ml-2"})]})})]})}),s.jsx(ie,{className:"bg-card border-card-border",children:s.jsxs(ae,{className:"p-6",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"Upgrade for more features"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Get unlimited agents, advanced analytics, and priority support with our Pro plan."}),s.jsx(de,{href:"/billing",children:s.jsxs(X,{variant:"outline",size:"sm","data-testid":"button-view-plans",children:["View Plans",s.jsx(kr,{className:"w-4 h-4 ml-2"})]})})]})})]})]})}function Md(e){return/^401: .*Unauthorized/.test(e.message)}function Lb(e){return/^403:.*PLAN_LIMIT_REACHED/.test(e.message)||e.message.includes("PLAN_LIMIT_REACHED")||e.message.includes("plan allows")}var j3="AlertDialog",[uQ,E_e]=rn(j3,[N4]),Ua=N4(),S3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ua(t);return s.jsx(PA,{...r,...n,modal:!0})};S3.displayName=j3;var dQ="AlertDialogTrigger",fQ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ua(n);return s.jsx(DK,{...i,...r,ref:t})});fQ.displayName=dQ;var hQ="AlertDialogPortal",A3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ua(t);return s.jsx(kA,{...r,...n})};A3.displayName=hQ;var mQ="AlertDialogOverlay",N3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ua(n);return s.jsx(nm,{...i,...r,ref:t})});N3.displayName=mQ;var bc="AlertDialogContent",[pQ,gQ]=uQ(bc),vQ=GD("AlertDialogContent"),T3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,a=Ua(n),o=v.useRef(null),l=ke(t,o),c=v.useRef(null);return s.jsx(_K,{contentName:bc,titleName:C3,docsSlug:"alert-dialog",children:s.jsx(pQ,{scope:n,cancelRef:c,children:s.jsxs(rm,{role:"alertdialog",...a,...i,ref:l,onOpenAutoFocus:ee(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(vQ,{children:r}),s.jsx(xQ,{contentRef:o})]})})})});T3.displayName=bc;var C3="AlertDialogTitle",P3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ua(n);return s.jsx(im,{...i,...r,ref:t})});P3.displayName=C3;var k3="AlertDialogDescription",E3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ua(n);return s.jsx(am,{...i,...r,ref:t})});E3.displayName=k3;var yQ="AlertDialogAction",O3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ua(n);return s.jsx(Iy,{...i,...r,ref:t})});O3.displayName=yQ;var _3="AlertDialogCancel",I3=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=gQ(_3,n),a=Ua(n),o=ke(t,i);return s.jsx(Iy,{...a,...r,ref:o})});I3.displayName=_3;var xQ=({contentRef:e})=>{const t=`\`${bc}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${bc}\` by passing a \`${k3}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${bc}\`. 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. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},bQ=S3,wQ=A3,M3=N3,R3=T3,D3=O3,$3=I3,L3=P3,F3=E3;const jQ=bQ,SQ=wQ,B3=v.forwardRef(({className:e,...t},n)=>s.jsx(M3,{className:Q("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}));B3.displayName=M3.displayName;const V3=v.forwardRef(({className:e,...t},n)=>s.jsxs(SQ,{children:[s.jsx(B3,{}),s.jsx(R3,{ref:n,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));V3.displayName=R3.displayName;const W3=({className:e,...t})=>s.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});W3.displayName="AlertDialogHeader";const z3=({className:e,...t})=>s.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});z3.displayName="AlertDialogFooter";const U3=v.forwardRef(({className:e,...t},n)=>s.jsx(L3,{ref:n,className:Q("text-lg font-semibold",e),...t}));U3.displayName=L3.displayName;const H3=v.forwardRef(({className:e,...t},n)=>s.jsx(F3,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));H3.displayName=F3.displayName;const q3=v.forwardRef(({className:e,...t},n)=>s.jsx(D3,{ref:n,className:Q(SA(),e),...t}));q3.displayName=D3.displayName;const G3=v.forwardRef(({className:e,...t},n)=>s.jsx($3,{ref:n,className:Q(SA({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));G3.displayName=$3.displayName;function AQ(){const{toast:e}=Pn(),{isAuthenticated:t,isLoading:n}=Zi(),[r,i]=v.useState(""),[a,o]=v.useState(null);v.useEffect(()=>{!n&&!t&&(e({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500))},[t,n,e]);const{data:l,isLoading:c}=$t({queryKey:["/api/agents"],enabled:t}),u=tn({mutationFn:async f=>{await zt("DELETE",`/api/agents/${f}`)},onSuccess:()=>{Sn.invalidateQueries({queryKey:["/api/agents"]}),e({title:"Agent deleted",description:"The agent has been successfully deleted."}),o(null)},onError:f=>{if(Md(f)){e({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500);return}e({title:"Error",description:"Failed to delete agent. Please try again.",variant:"destructive"})}}),d=l==null?void 0:l.filter(f=>f.name.toLowerCase().includes(r.toLowerCase()));return n?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold","data-testid":"agents-title",children:"Voice Agents"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Create and manage your AI voice sales agents."})]}),s.jsx(de,{href:"/agents/new",children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-create-agent",children:[s.jsx(gc,{className:"w-4 h-4 mr-2"}),"Create Agent"]})})]}),s.jsxs("div",{className:"relative max-w-md",children:[s.jsx(vy,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(Dt,{placeholder:"Search agents...",value:r,onChange:f=>i(f.target.value),className:"pl-10","data-testid":"input-search-agents"})]}),c?s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3,4,5,6].map(f=>s.jsx(ie,{className:"bg-card border-card-border",children:s.jsxs(ae,{className:"p-6",children:[s.jsx(Oe,{className:"h-10 w-10 rounded-lg mb-4"}),s.jsx(Oe,{className:"h-6 w-32 mb-2"}),s.jsx(Oe,{className:"h-4 w-full mb-4"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{className:"h-8 w-20"}),s.jsx(Oe,{className:"h-8 w-20"})]})]})},f))}):d&&d.length>0?s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[d.map(f=>{var h;return s.jsx(ie,{className:"bg-card border-card-border hover-elevate transition-all duration-300","data-testid":`agent-card-${f.id}`,children:s.jsxs(ae,{className:"p-6",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center",style:{backgroundColor:f.widgetPrimaryColor||"#FF6B35"},children:s.jsx(ui,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg",children:f.name}),s.jsx(Me,{variant:f.isActive?"default":"secondary",children:f.isActive?"Active":"Inactive"})]})]}),s.jsxs(FA,{children:[s.jsx(BA,{asChild:!0,children:s.jsx(X,{variant:"ghost",size:"icon","data-testid":`agent-menu-${f.id}`,children:s.jsx(j$,{className:"w-4 h-4"})})}),s.jsxs(Ly,{align:"end",children:[s.jsx(sr,{asChild:!0,children:s.jsxs(de,{href:`/agents/${f.id}`,className:"flex items-center gap-2",children:[s.jsx(N$,{className:"w-4 h-4"}),"Edit"]})}),s.jsx(sr,{asChild:!0,children:s.jsxs(de,{href:`/agents/${f.id}/test`,className:"flex items-center gap-2",children:[s.jsx(tl,{className:"w-4 h-4"}),"Test"]})}),s.jsx(sr,{asChild:!0,children:s.jsxs(de,{href:`/agents/${f.id}/embed`,className:"flex items-center gap-2",children:[s.jsx(nl,{className:"w-4 h-4"}),"Get Embed Code"]})}),s.jsxs(sr,{className:"text-destructive focus:text-destructive",onClick:()=>o(f.id),children:[s.jsx(uA,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4 min-h-[40px]",children:[((h=f.prompt)==null?void 0:h.slice(0,100))||"No prompt configured","..."]}),s.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-4",children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(di,{className:"w-4 h-4"}),f.totalConversations||0," conversations"]})}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsx(de,{href:`/agents/${f.id}`,className:"flex-1",children:s.jsx(X,{variant:"outline",className:"w-full","data-testid":`button-configure-${f.id}`,children:"Configure"})}),s.jsx(de,{href:`/agents/${f.id}/test`,className:"flex-1",children:s.jsx(X,{className:"w-full gradient-primary border-0","data-testid":`button-test-${f.id}`,children:"Test"})}),s.jsx(de,{href:`/agents/${f.id}/embed`,className:"w-full",children:s.jsxs(X,{variant:"outline",className:"w-full","data-testid":`button-embed-${f.id}`,children:[s.jsx(nl,{className:"w-3 h-3 mr-1"}),"Get Embed Code"]})})]})]})},f.id)}),s.jsx(de,{href:"/agents/new",children:s.jsx(ie,{className:"bg-card border-card-border border-dashed hover-elevate transition-all duration-300 cursor-pointer h-full min-h-[280px]","data-testid":"card-create-agent",children:s.jsxs(ae,{className:"p-6 h-full flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:s.jsx(gc,{className:"w-7 h-7 text-primary"})}),s.jsx("p",{className:"font-semibold text-lg",children:"Create New Agent"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center mt-2",children:"Set up a new voice sales agent for your website"})]})})})]}):s.jsx(ie,{className:"bg-card border-card-border",children:s.jsxs(ae,{className:"p-12 text-center",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:s.jsx(ui,{className:"w-8 h-8 text-primary"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:r?"No agents found":"No agents yet"}),s.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm mx-auto",children:r?"Try adjusting your search query.":"Create your first voice sales agent to start helping customers."}),!r&&s.jsx(de,{href:"/agents/new",children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-create-first",children:[s.jsx(gc,{className:"w-4 h-4 mr-2"}),"Create Your First Agent"]})})]})}),s.jsx(jQ,{open:!!a,onOpenChange:()=>o(null),children:s.jsxs(V3,{children:[s.jsxs(W3,{children:[s.jsx(U3,{children:"Delete Agent"}),s.jsx(H3,{children:"Are you sure you want to delete this agent? This action cannot be undone. All training data and conversation history will be permanently removed."})]}),s.jsxs(z3,{children:[s.jsx(G3,{"data-testid":"button-cancel-delete",children:"Cancel"}),s.jsx(q3,{onClick:()=>a&&u.mutate(a),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90","data-testid":"button-confirm-delete",children:u.isPending?"Deleting...":"Delete"})]})]})})]})}var lm=e=>e.type==="checkbox",Co=e=>e instanceof Date,Mn=e=>e==null;const Y3=e=>typeof e=="object";var Lt=e=>!Mn(e)&&!Array.isArray(e)&&Y3(e)&&!Co(e),K3=e=>Lt(e)&&e.target?lm(e.target)?e.target.checked:e.target.value:e,NQ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,X3=(e,t)=>e.has(NQ(t)),TQ=e=>{const t=e.constructor&&e.constructor.prototype;return Lt(t)&&t.hasOwnProperty("isPrototypeOf")},JA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function on(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(JA&&(e instanceof Blob||r))&&(n||Lt(e)))if(t=n?[]:{},!n&&!TQ(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=on(e[i]));else return e;return t}var Vy=e=>Array.isArray(e)?e.filter(Boolean):[],It=e=>e===void 0,ce=(e,t,n)=>{if(!t||!Lt(e))return n;const r=Vy(t.split(/[,[\].]+?/)).reduce((i,a)=>Mn(i)?i:i[a],e);return It(r)||r===e?It(e[t])?n:e[t]:r},ir=e=>typeof e=="boolean",eN=e=>/^\w*$/.test(e),Z3=e=>Vy(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Qe=(e,t,n)=>{let r=-1;const i=eN(t)?[t]:Z3(t),a=i.length,o=a-1;for(;++r_.useContext(Q3),CQ=e=>{const{children:t,...n}=e;return _.createElement(Q3.Provider,{value:n},t)};var J3=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==ti.all&&(t._proxyFormState[o]=!r||ti.all),n&&(n[o]=!0),e[o]}});return i};function PQ(e){const t=Wy(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,l]=_.useState(n._formState),c=_.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=_.useRef(i);return u.current=i,_.useEffect(()=>n._subscribe({name:u.current,formState:c.current,exact:a,callback:d=>{!r&&l({...n._formState,...d})}}),[n,r,a]),_.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),_.useMemo(()=>J3(o,n,c.current,!1),[o,n])}var _i=e=>typeof e=="string",eF=(e,t,n,r,i)=>_i(e)?(r&&t.watch.add(e),ce(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),ce(n,a))):(r&&(t.watchAll=!0),n);function kQ(e){const t=Wy(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o}=e||{},l=_.useRef(r),c=_.useRef(i);l.current=r,_.useEffect(()=>n._subscribe({name:l.current,formState:{values:!0},exact:o,callback:f=>!a&&d(eF(l.current,n._names,f.values||n._formValues,!1,c.current))}),[n,a,o]);const[u,d]=_.useState(n._getWatch(r,i));return _.useEffect(()=>n._removeUnmounted()),u}function EQ(e){const t=Wy(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,o=X3(i._names.array,n),l=kQ({control:i,name:n,defaultValue:ce(i._formValues,n,ce(i._defaultValues,n,e.defaultValue)),exact:!0}),c=PQ({control:i,name:n,exact:!0}),u=_.useRef(e),d=_.useRef(i.register(n,{...e.rules,value:l,...ir(e.disabled)?{disabled:e.disabled}:{}})),f=_.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!ce(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ce(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ce(c.validatingFields,n)},error:{enumerable:!0,get:()=>ce(c.errors,n)}}),[c,n]),h=_.useCallback(b=>d.current.onChange({target:{value:K3(b),name:n},type:Tg.CHANGE}),[n]),m=_.useCallback(()=>d.current.onBlur({target:{value:ce(i._formValues,n),name:n},type:Tg.BLUR}),[n,i._formValues]),y=_.useCallback(b=>{const x=ce(i._fields,n);x&&b&&(x._f.ref={focus:()=>b.focus(),select:()=>b.select(),setCustomValidity:g=>b.setCustomValidity(g),reportValidity:()=>b.reportValidity()})},[i._fields,n]),p=_.useMemo(()=>({name:n,value:l,...ir(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:h,onBlur:m,ref:y}),[n,r,c.disabled,h,m,y,l]);return _.useEffect(()=>{const b=i._options.shouldUnregister||a;i.register(n,{...u.current.rules,...ir(u.current.disabled)?{disabled:u.current.disabled}:{}});const x=(g,w)=>{const S=ce(i._fields,g);S&&S._f&&(S._f.mount=w)};if(x(n,!0),b){const g=on(ce(i._options.defaultValues,n));Qe(i._defaultValues,n,g),It(ce(i._formValues,n))&&Qe(i._formValues,n,g)}return!o&&i.register(n),()=>{(o?b&&!i._state.action:b)?i.unregister(n):x(n,!1)}},[n,i,o,a]),_.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),_.useMemo(()=>({field:p,formState:c,fieldState:f}),[p,c,f])}const OQ=e=>e.render(EQ(e));var tF=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Jd=e=>Array.isArray(e)?e:[e],gk=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},Qw=e=>Mn(e)||!Y3(e);function fs(e,t){if(Qw(e)||Qw(t))return e===t;if(Co(e)&&Co(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(Co(a)&&Co(o)||Lt(a)&&Lt(o)||Array.isArray(a)&&Array.isArray(o)?!fs(a,o):a!==o)return!1}}return!0}var _n=e=>Lt(e)&&!Object.keys(e).length,tN=e=>e.type==="file",ni=e=>typeof e=="function",Cg=e=>{if(!JA)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nF=e=>e.type==="select-multiple",nN=e=>e.type==="radio",_Q=e=>nN(e)||lm(e),Fb=e=>Cg(e)&&e.isConnected;function IQ(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const t in e)if(ni(e[t]))return!0;return!1};function Pg(e,t={}){const n=Array.isArray(e);if(Lt(e)||n)for(const r in e)Array.isArray(e[r])||Lt(e[r])&&!rF(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Pg(e[r],t[r])):Mn(e[r])||(t[r]=!0);return t}function iF(e,t,n){const r=Array.isArray(e);if(Lt(e)||r)for(const i in e)Array.isArray(e[i])||Lt(e[i])&&!rF(e[i])?It(t)||Qw(n[i])?n[i]=Array.isArray(e[i])?Pg(e[i],[]):{...Pg(e[i])}:iF(e[i],Mn(t)?{}:t[i],n[i]):n[i]=!fs(e[i],t[i]);return n}var fd=(e,t)=>iF(e,t,Pg(t));const vk={value:!1,isValid:!1},yk={value:!0,isValid:!0};var aF=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!It(e[0].attributes.value)?It(e[0].value)||e[0].value===""?yk:{value:e[0].value,isValid:!0}:yk:vk}return vk},sF=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>It(e)?e:t?e===""?NaN:e&&+e:n&&_i(e)?new Date(e):r?r(e):e;const xk={isValid:!1,value:null};var oF=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,xk):xk;function bk(e){const t=e.ref;return tN(t)?t.files:nN(t)?oF(e.refs).value:nF(t)?[...t.selectedOptions].map(({value:n})=>n):lm(t)?aF(e.refs).value:sF(It(t.value)?e.ref.value:t.value,e)}var RQ=(e,t,n,r)=>{const i={};for(const a of e){const o=ce(t,a);o&&Qe(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},kg=e=>e instanceof RegExp,hd=e=>It(e)?e:kg(e)?e.source:Lt(e)?kg(e.value)?e.value.source:e.value:e,wk=e=>({isOnSubmit:!e||e===ti.onSubmit,isOnBlur:e===ti.onBlur,isOnChange:e===ti.onChange,isOnAll:e===ti.all,isOnTouch:e===ti.onTouched});const jk="AsyncFunction";var DQ=e=>!!e&&!!e.validate&&!!(ni(e.validate)&&e.validate.constructor.name===jk||Lt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===jk)),$Q=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Sk=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const ef=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const a=ce(e,i);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(ef(l,t))break}else if(Lt(l)&&ef(l,t))break}}};function Ak(e,t,n){const r=ce(e,n);if(r||eN(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=ce(t,a),l=ce(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};i.pop()}return{name:n}}var LQ=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return _n(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||ti.all))},FQ=(e,t,n)=>!e||!t||e===t||Jd(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),BQ=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,VQ=(e,t)=>!Vy(ce(e,t)).length&&qt(e,t),WQ=(e,t,n)=>{const r=Jd(ce(e,n));return Qe(r,"root",t[n]),Qe(e,n,r),e},Dp=e=>_i(e);function Nk(e,t,n="validate"){if(Dp(e)||Array.isArray(e)&&e.every(Dp)||ir(e)&&!e)return{type:n,message:Dp(e)?e:"",ref:t}}var Ml=e=>Lt(e)&&!kg(e)?e:{value:e,message:""},Tk=async(e,t,n,r,i,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:m,validate:y,name:p,valueAsNumber:b,mount:x}=e._f,g=ce(n,p);if(!x||t.has(p))return{};const w=l?l[0]:o,S=k=>{i&&w.reportValidity&&(w.setCustomValidity(ir(k)?"":k||""),w.reportValidity())},j={},A=nN(o),N=lm(o),T=A||N,C=(b||tN(o))&&It(o.value)&&It(g)||Cg(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,E=tF.bind(null,p,r,j),P=(k,$,I,F=ta.maxLength,R=ta.minLength)=>{const B=k?$:I;j[p]={type:k?F:R,message:B,ref:o,...E(k?F:R,B)}};if(a?!Array.isArray(g)||!g.length:c&&(!T&&(C||Mn(g))||ir(g)&&!g||N&&!aF(l).isValid||A&&!oF(l).isValid)){const{value:k,message:$}=Dp(c)?{value:!!c,message:c}:Ml(c);if(k&&(j[p]={type:ta.required,message:$,ref:w,...E(ta.required,$)},!r))return S($),j}if(!C&&(!Mn(f)||!Mn(h))){let k,$;const I=Ml(h),F=Ml(f);if(!Mn(g)&&!isNaN(g)){const R=o.valueAsNumber||g&&+g;Mn(I.value)||(k=R>I.value),Mn(F.value)||($=Rnew Date(new Date().toDateString()+" "+W),O=o.type=="time",M=o.type=="week";_i(I.value)&&g&&(k=O?B(g)>B(I.value):M?g>I.value:R>new Date(I.value)),_i(F.value)&&g&&($=O?B(g)+k.value,F=!Mn($.value)&&g.length<+$.value;if((I||F)&&(P(I,k.message,$.message),!r))return S(j[p].message),j}if(m&&!C&&_i(g)){const{value:k,message:$}=Ml(m);if(kg(k)&&!g.match(k)&&(j[p]={type:ta.pattern,message:$,ref:o,...E(ta.pattern,$)},!r))return S($),j}if(y){if(ni(y)){const k=await y(g,n),$=Nk(k,w);if($&&(j[p]={...$,...E(ta.validate,$.message)},!r))return S($.message),j}else if(Lt(y)){let k={};for(const $ in y){if(!_n(k)&&!r)break;const I=Nk(await y[$](g,n),w,$);I&&(k={...I,...E($,I.message)},S(I.message),r&&(j[p]=k))}if(!_n(k)&&(j[p]={ref:w,...k},!r))return j}}return S(!0),j};const zQ={mode:ti.onSubmit,reValidateMode:ti.onChange,shouldFocusError:!0};function UQ(e={}){let t={...zQ,...e},n={submitCount:0,isDirty:!1,isLoading:ni(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let i=Lt(t.defaultValues)||Lt(t.values)?on(t.values||t.defaultValues)||{}:{},a=t.shouldUnregister?{}:on(i),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:gk(),state:gk()},m=wk(t.mode),y=wk(t.reValidateMode),p=t.criteriaMode===ti.all,b=D=>z=>{clearTimeout(u),u=setTimeout(D,z)},x=async D=>{if(!t.disabled&&(d.isValid||f.isValid||D)){const z=t.resolver?_n((await C()).errors):await P(r,!0);z!==n.isValid&&h.state.next({isValid:z})}},g=(D,z)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((D||Array.from(l.mount)).forEach(G=>{G&&(z?Qe(n.validatingFields,G,z):qt(n.validatingFields,G))}),h.state.next({validatingFields:n.validatingFields,isValidating:!_n(n.validatingFields)}))},w=(D,z=[],G,he,le=!0,te=!0)=>{if(he&&G&&!t.disabled){if(o.action=!0,te&&Array.isArray(ce(r,D))){const xe=G(ce(r,D),he.argA,he.argB);le&&Qe(r,D,xe)}if(te&&Array.isArray(ce(n.errors,D))){const xe=G(ce(n.errors,D),he.argA,he.argB);le&&Qe(n.errors,D,xe),VQ(n.errors,D)}if((d.touchedFields||f.touchedFields)&&te&&Array.isArray(ce(n.touchedFields,D))){const xe=G(ce(n.touchedFields,D),he.argA,he.argB);le&&Qe(n.touchedFields,D,xe)}(d.dirtyFields||f.dirtyFields)&&(n.dirtyFields=fd(i,a)),h.state.next({name:D,isDirty:$(D,z),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qe(a,D,z)},S=(D,z)=>{Qe(n.errors,D,z),h.state.next({errors:n.errors})},j=D=>{n.errors=D,h.state.next({errors:n.errors,isValid:!1})},A=(D,z,G,he)=>{const le=ce(r,D);if(le){const te=ce(a,D,It(G)?ce(i,D):G);It(te)||he&&he.defaultChecked||z?Qe(a,D,z?te:bk(le._f)):R(D,te),o.mount&&x()}},N=(D,z,G,he,le)=>{let te=!1,xe=!1;const Ke={name:D};if(!t.disabled){if(!G||he){(d.isDirty||f.isDirty)&&(xe=n.isDirty,n.isDirty=Ke.isDirty=$(),te=xe!==Ke.isDirty);const Bt=fs(ce(i,D),z);xe=!!ce(n.dirtyFields,D),Bt?qt(n.dirtyFields,D):Qe(n.dirtyFields,D,!0),Ke.dirtyFields=n.dirtyFields,te=te||(d.dirtyFields||f.dirtyFields)&&xe!==!Bt}if(G){const Bt=ce(n.touchedFields,D);Bt||(Qe(n.touchedFields,D,G),Ke.touchedFields=n.touchedFields,te=te||(d.touchedFields||f.touchedFields)&&Bt!==G)}te&&le&&h.state.next(Ke)}return te?Ke:{}},T=(D,z,G,he)=>{const le=ce(n.errors,D),te=(d.isValid||f.isValid)&&ir(z)&&n.isValid!==z;if(t.delayError&&G?(c=b(()=>S(D,G)),c(t.delayError)):(clearTimeout(u),c=null,G?Qe(n.errors,D,G):qt(n.errors,D)),(G?!fs(le,G):le)||!_n(he)||te){const xe={...he,...te&&ir(z)?{isValid:z}:{},errors:n.errors,name:D};n={...n,...xe},h.state.next(xe)}},C=async D=>{g(D,!0);const z=await t.resolver(a,t.context,RQ(D||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return g(D),z},E=async D=>{const{errors:z}=await C(D);if(D)for(const G of D){const he=ce(z,G);he?Qe(n.errors,G,he):qt(n.errors,G)}else n.errors=z;return z},P=async(D,z,G={valid:!0})=>{for(const he in D){const le=D[he];if(le){const{_f:te,...xe}=le;if(te){const Ke=l.array.has(te.name),Bt=le._f&&DQ(le._f);Bt&&d.validatingFields&&g([he],!0);const mn=await Tk(le,l.disabled,a,p,t.shouldUseNativeValidation&&!z,Ke);if(Bt&&d.validatingFields&&g([he]),mn[te.name]&&(G.valid=!1,z))break;!z&&(ce(mn,te.name)?Ke?WQ(n.errors,mn,te.name):Qe(n.errors,te.name,mn[te.name]):qt(n.errors,te.name))}!_n(xe)&&await P(xe,z,G)}}return G.valid},k=()=>{for(const D of l.unMount){const z=ce(r,D);z&&(z._f.refs?z._f.refs.every(G=>!Fb(G)):!Fb(z._f.ref))&&K(D)}l.unMount=new Set},$=(D,z)=>!t.disabled&&(D&&z&&Qe(a,D,z),!fs(q(),i)),I=(D,z,G)=>eF(D,l,{...o.mount?a:It(z)?i:_i(D)?{[D]:z}:z},G,z),F=D=>Vy(ce(o.mount?a:i,D,t.shouldUnregister?ce(i,D,[]):[])),R=(D,z,G={})=>{const he=ce(r,D);let le=z;if(he){const te=he._f;te&&(!te.disabled&&Qe(a,D,sF(z,te)),le=Cg(te.ref)&&Mn(z)?"":z,nF(te.ref)?[...te.ref.options].forEach(xe=>xe.selected=le.includes(xe.value)):te.refs?lm(te.ref)?te.refs.length>1?te.refs.forEach(xe=>(!xe.defaultChecked||!xe.disabled)&&(xe.checked=Array.isArray(le)?!!le.find(Ke=>Ke===xe.value):le===xe.value)):te.refs[0]&&(te.refs[0].checked=!!le):te.refs.forEach(xe=>xe.checked=xe.value===le):tN(te.ref)?te.ref.value="":(te.ref.value=le,te.ref.type||h.state.next({name:D,values:on(a)})))}(G.shouldDirty||G.shouldTouch)&&N(D,le,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&Y(D)},B=(D,z,G)=>{for(const he in z){const le=z[he],te=`${D}.${he}`,xe=ce(r,te);(l.array.has(D)||Lt(le)||xe&&!xe._f)&&!Co(le)?B(te,le,G):R(te,le,G)}},O=(D,z,G={})=>{const he=ce(r,D),le=l.array.has(D),te=on(z);Qe(a,D,te),le?(h.array.next({name:D,values:on(a)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&G.shouldDirty&&h.state.next({name:D,dirtyFields:fd(i,a),isDirty:$(D,te)})):he&&!he._f&&!Mn(te)?B(D,te,G):R(D,te,G),Sk(D,l)&&h.state.next({...n}),h.state.next({name:o.mount?D:void 0,values:on(a)})},M=async D=>{o.mount=!0;const z=D.target;let G=z.name,he=!0;const le=ce(r,G),te=xe=>{he=Number.isNaN(xe)||Co(xe)&&isNaN(xe.getTime())||fs(xe,ce(a,G,xe))};if(le){let xe,Ke;const Bt=z.type?bk(le._f):K3(D),mn=D.type===Tg.BLUR||D.type===Tg.FOCUS_OUT,hz=!$Q(le._f)&&!t.resolver&&!ce(n.errors,G)&&!le._f.deps||BQ(mn,ce(n.touchedFields,G),n.isSubmitted,y,m),Hx=Sk(G,l,mn);Qe(a,G,Bt),mn?(le._f.onBlur&&le._f.onBlur(D),c&&c(0)):le._f.onChange&&le._f.onChange(D);const qx=N(G,Bt,mn),mz=!_n(qx)||Hx;if(!mn&&h.state.next({name:G,type:D.type,values:on(a)}),hz)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?mn&&x():mn||x()),mz&&h.state.next({name:G,...Hx?{}:qx});if(!mn&&Hx&&h.state.next({...n}),t.resolver){const{errors:tC}=await C([G]);if(te(Bt),he){const pz=Ak(n.errors,r,G),nC=Ak(tC,r,pz.name||G);xe=nC.error,G=nC.name,Ke=_n(tC)}}else g([G],!0),xe=(await Tk(le,l.disabled,a,p,t.shouldUseNativeValidation))[G],g([G]),te(Bt),he&&(xe?Ke=!1:(d.isValid||f.isValid)&&(Ke=await P(r,!0)));he&&(le._f.deps&&Y(le._f.deps),T(G,Ke,xe,qx))}},W=(D,z)=>{if(ce(n.errors,z)&&D.focus)return D.focus(),1},Y=async(D,z={})=>{let G,he;const le=Jd(D);if(t.resolver){const te=await E(It(D)?D:le);G=_n(te),he=D?!le.some(xe=>ce(te,xe)):G}else D?(he=(await Promise.all(le.map(async te=>{const xe=ce(r,te);return await P(xe&&xe._f?{[te]:xe}:xe)}))).every(Boolean),!(!he&&!n.isValid)&&x()):he=G=await P(r);return h.state.next({...!_i(D)||(d.isValid||f.isValid)&&G!==n.isValid?{}:{name:D},...t.resolver||!D?{isValid:G}:{},errors:n.errors}),z.shouldFocus&&!he&&ef(r,W,D?le:l.mount),he},q=D=>{const z={...o.mount?a:i};return It(D)?z:_i(D)?ce(z,D):D.map(G=>ce(z,G))},oe=(D,z)=>({invalid:!!ce((z||n).errors,D),isDirty:!!ce((z||n).dirtyFields,D),error:ce((z||n).errors,D),isValidating:!!ce(n.validatingFields,D),isTouched:!!ce((z||n).touchedFields,D)}),je=D=>{D&&Jd(D).forEach(z=>qt(n.errors,z)),h.state.next({errors:D?n.errors:{}})},$e=(D,z,G)=>{const he=(ce(r,D,{_f:{}})._f||{}).ref,le=ce(n.errors,D)||{},{ref:te,message:xe,type:Ke,...Bt}=le;Qe(n.errors,D,{...Bt,...z,ref:he}),h.state.next({name:D,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&he&&he.focus&&he.focus()},Ee=(D,z)=>ni(D)?h.state.subscribe({next:G=>D(I(void 0,z),G)}):I(D,z,!0),fe=D=>h.state.subscribe({next:z=>{FQ(D.name,z.name,D.exact)&&LQ(z,D.formState||d,Qn,D.reRenderRoot)&&D.callback({values:{...a},...n,...z})}}).unsubscribe,we=D=>(o.mount=!0,f={...f,...D.formState},fe({...D,formState:f})),K=(D,z={})=>{for(const G of D?Jd(D):l.mount)l.mount.delete(G),l.array.delete(G),z.keepValue||(qt(r,G),qt(a,G)),!z.keepError&&qt(n.errors,G),!z.keepDirty&&qt(n.dirtyFields,G),!z.keepTouched&&qt(n.touchedFields,G),!z.keepIsValidating&&qt(n.validatingFields,G),!t.shouldUnregister&&!z.keepDefaultValue&&qt(i,G);h.state.next({values:on(a)}),h.state.next({...n,...z.keepDirty?{isDirty:$()}:{}}),!z.keepIsValid&&x()},V=({disabled:D,name:z})=>{(ir(D)&&o.mount||D||l.disabled.has(z))&&(D?l.disabled.add(z):l.disabled.delete(z))},re=(D,z={})=>{let G=ce(r,D);const he=ir(z.disabled)||ir(t.disabled);return Qe(r,D,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:D}},name:D,mount:!0,...z}}),l.mount.add(D),G?V({disabled:ir(z.disabled)?z.disabled:t.disabled,name:D}):A(D,!0,z.value),{...he?{disabled:z.disabled||t.disabled}:{},...t.progressive?{required:!!z.required,min:hd(z.min),max:hd(z.max),minLength:hd(z.minLength),maxLength:hd(z.maxLength),pattern:hd(z.pattern)}:{},name:D,onChange:M,onBlur:M,ref:le=>{if(le){re(D,z),G=ce(r,D);const te=It(le.value)&&le.querySelectorAll&&le.querySelectorAll("input,select,textarea")[0]||le,xe=_Q(te),Ke=G._f.refs||[];if(xe?Ke.find(Bt=>Bt===te):te===G._f.ref)return;Qe(r,D,{_f:{...G._f,...xe?{refs:[...Ke.filter(Fb),te,...Array.isArray(ce(i,D))?[{}]:[]],ref:{type:te.type,name:D}}:{ref:te}}}),A(D,!1,void 0,te)}else G=ce(r,D,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||z.shouldUnregister)&&!(X3(l.array,D)&&o.action)&&l.unMount.add(D)}}},U=()=>t.shouldFocusError&&ef(r,W,l.mount),Le=D=>{ir(D)&&(h.state.next({disabled:D}),ef(r,(z,G)=>{const he=ce(r,G);he&&(z.disabled=he._f.disabled||D,Array.isArray(he._f.refs)&&he._f.refs.forEach(le=>{le.disabled=he._f.disabled||D}))},0,!1))},Pe=(D,z)=>async G=>{let he;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let le=on(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:xe}=await C();n.errors=te,le=xe}else await P(r);if(l.disabled.size)for(const te of l.disabled)Qe(le,te,void 0);if(qt(n.errors,"root"),_n(n.errors)){h.state.next({errors:{}});try{await D(le,G)}catch(te){he=te}}else z&&await z({...n.errors},G),U(),setTimeout(U);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:_n(n.errors)&&!he,submitCount:n.submitCount+1,errors:n.errors}),he)throw he},ot=(D,z={})=>{ce(r,D)&&(It(z.defaultValue)?O(D,on(ce(i,D))):(O(D,z.defaultValue),Qe(i,D,on(z.defaultValue))),z.keepTouched||qt(n.touchedFields,D),z.keepDirty||(qt(n.dirtyFields,D),n.isDirty=z.defaultValue?$(D,on(ce(i,D))):$()),z.keepError||(qt(n.errors,D),d.isValid&&x()),h.state.next({...n}))},rt=(D,z={})=>{const G=D?on(D):i,he=on(G),le=_n(D),te=le?i:he;if(z.keepDefaultValues||(i=G),!z.keepValues){if(z.keepDirtyValues){const xe=new Set([...l.mount,...Object.keys(fd(i,a))]);for(const Ke of Array.from(xe))ce(n.dirtyFields,Ke)?Qe(te,Ke,ce(a,Ke)):O(Ke,ce(te,Ke))}else{if(JA&&It(D))for(const xe of l.mount){const Ke=ce(r,xe);if(Ke&&Ke._f){const Bt=Array.isArray(Ke._f.refs)?Ke._f.refs[0]:Ke._f.ref;if(Cg(Bt)){const mn=Bt.closest("form");if(mn){mn.reset();break}}}}for(const xe of l.mount)O(xe,ce(te,xe))}a=on(te),h.array.next({values:{...te}}),h.state.next({values:{...te}})}l={mount:z.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!z.keepIsValid||!!z.keepDirtyValues,o.watch=!!t.shouldUnregister,h.state.next({submitCount:z.keepSubmitCount?n.submitCount:0,isDirty:le?!1:z.keepDirty?n.isDirty:!!(z.keepDefaultValues&&!fs(D,i)),isSubmitted:z.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:le?{}:z.keepDirtyValues?z.keepDefaultValues&&a?fd(i,a):n.dirtyFields:z.keepDefaultValues&&D?fd(i,D):z.keepDirty?n.dirtyFields:{},touchedFields:z.keepTouched?n.touchedFields:{},errors:z.keepErrors?n.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},bt=(D,z)=>rt(ni(D)?D(a):D,z),yr=(D,z={})=>{const G=ce(r,D),he=G&&G._f;if(he){const le=he.refs?he.refs[0]:he.ref;le.focus&&(le.focus(),z.shouldSelect&&ni(le.select)&&le.select())}},Qn=D=>{n={...n,...D}},wi={control:{register:re,unregister:K,getFieldState:oe,handleSubmit:Pe,setError:$e,_subscribe:fe,_runSchema:C,_getWatch:I,_getDirty:$,_setValid:x,_setFieldArray:w,_setDisabledField:V,_setErrors:j,_getFieldArray:F,_reset:rt,_resetDefaultValues:()=>ni(t.defaultValues)&&t.defaultValues().then(D=>{bt(D,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:Le,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(D){o=D},get _defaultValues(){return i},get _names(){return l},set _names(D){l=D},get _formState(){return n},get _options(){return t},set _options(D){t={...t,...D}}},subscribe:we,trigger:Y,register:re,handleSubmit:Pe,watch:Ee,setValue:O,getValues:q,reset:bt,resetField:ot,clearErrors:je,unregister:K,setError:$e,setFocus:yr,getFieldState:oe};return{...wi,formControl:wi}}function HQ(e={}){const t=_.useRef(void 0),n=_.useRef(void 0),[r,i]=_.useState({isDirty:!1,isValidating:!1,isLoading:ni(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ni(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:UQ(e),formState:r},e.formControl&&e.defaultValues&&!ni(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const a=t.current.control;return a._options=e,_.useLayoutEffect(()=>a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0}),[a]),_.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),_.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==r.isDirty&&a._subjects.state.next({isDirty:o})}},[a,r.isDirty]),_.useEffect(()=>{e.values&&!fs(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i(o=>({...o}))):a._resetDefaultValues()},[e.values,a]),_.useEffect(()=>{e.errors&&!_n(e.errors)&&a._setErrors(e.errors)},[e.errors,a]),_.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),_.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[e.shouldUnregister,a]),t.current.formState=J3(r,a),t.current}const Ck=(e,t,n)=>{if(e&&"reportValidity"in e){const r=ce(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},lF=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Ck(r.ref,n,e):r.refs&&r.refs.forEach(i=>Ck(i,n,e))}},qQ=(e,t)=>{t.shouldUseNativeValidation&&lF(e,t);const n={};for(const r in e){const i=ce(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(GQ(t.names||Object.keys(e),r)){const o=Object.assign({},ce(n,r));Qe(o,"root",a),Qe(n,r,o)}else Qe(n,r,a)}return n},GQ=(e,t)=>e.some(n=>n.startsWith(t+"."));var YQ=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:a,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=n[o].types,u=c&&c[r.code];n[o]=tF(o,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n},KQ=function(e,t,n){return n===void 0&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return a.shouldUseNativeValidation&&lF({},a),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:qQ(YQ(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},qe;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),o={};for(const l of a)o[l]=i[l];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(qe||(qe={}));var Jw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Jw||(Jw={}));const pe=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),da=e=>{switch(typeof e){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return isNaN(e)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":return Array.isArray(e)?pe.array:e===null?pe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?pe.promise:typeof Map<"u"&&e instanceof Map?pe.map:typeof Set<"u"&&e instanceof Set?pe.set:typeof Date<"u"&&e instanceof Date?pe.date:pe.object;default:return pe.unknown}},Z=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),XQ=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class dr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;cn.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}dr.create=e=>new dr(e);const Jc=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===pe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,qe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${qe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${qe.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${qe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:qe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,qe.assertNever(e)}return{message:n}};let cF=Jc;function ZQ(e){cF=e}function Eg(){return cF}const Og=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...i,path:a,message:l}},QQ=[];function ue(e,t){const n=Eg(),r=Og({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Jc?void 0:Jc].filter(i=>!!i)});e.common.issues.push(r)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ce;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const Ce=Object.freeze({status:"aborted"}),Jl=e=>({status:"dirty",value:e}),$n=e=>({status:"valid",value:e}),e1=e=>e.status==="aborted",t1=e=>e.status==="dirty",ol=e=>e.status==="valid",Df=e=>typeof Promise<"u"&&e instanceof Promise;function _g(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function uF(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var be;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(be||(be={}));var Rd,Dd;class Gi{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pk=(e,t)=>{if(ol(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new dr(e.common.issues);return this._error=n,this._error}}};function _e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,l)=>{var c,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:(c=d??r)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:l.defaultError}},description:i}}class Be{get description(){return this._def.description}_getType(t){return da(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Df(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Pk(i,a)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:i});return ol(a)?{value:a.value}:{issues:i.common.issues}}catch(a){!((r=(n=a==null?void 0:a.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(a=>ol(a)?{value:a.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Df(i)?i:Promise.resolve(i));return Pk(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),l=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new vi({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return $i.create(this,this._def)}nullable(){return Xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fi.create(this)}promise(){return tu.create(this,this._def)}or(t){return Bf.create([this,t],this._def)}and(t){return Vf.create(this,t,this._def)}transform(t){return new vi({..._e(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new qf({..._e(this._def),innerType:this,defaultValue:n,typeName:Te.ZodDefault})}brand(){return new rN({typeName:Te.ZodBranded,type:this,..._e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Gf({..._e(this._def),innerType:this,catchValue:n,typeName:Te.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cm.create(this,t)}readonly(){return Yf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const JQ=/^c[^\s-]{8,}$/i,eJ=/^[0-9a-z]+$/,tJ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,rJ=/^[a-z0-9_-]{21}$/i,iJ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,aJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Bb;const lJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,uJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,dJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hJ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",mJ=new RegExp(`^${dF}$`);function fF(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function pJ(e){return new RegExp(`^${fF(e)}$`)}function hF(e){let t=`${dF}T${fF(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function gJ(e,t){return!!((t==="v4"||!t)&&lJ.test(e)||(t==="v6"||!t)&&uJ.test(e))}function vJ(e,t){if(!iJ.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function yJ(e,t){return!!((t==="v4"||!t)&&cJ.test(e)||(t==="v6"||!t)&&dJ.test(e))}class ii extends Be{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==pe.string){const a=this._getOrReturnCtx(t);return ue(a,{code:Z.invalid_type,expected:pe.string,received:a.parsedType}),Ce}const r=new Cn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.lengtht.test(i),{validation:n,code:Z.invalid_string,...be.errToObj(r)})}_addCheck(t){return new ii({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...be.errToObj(t)})}url(t){return this._addCheck({kind:"url",...be.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...be.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...be.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...be.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...be.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...be.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...be.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...be.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...be.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...be.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...be.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...be.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...be.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...be.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...be.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...be.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...be.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...be.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...be.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...be.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...be.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...be.errToObj(n)})}nonempty(t){return this.min(1,be.errToObj(t))}trim(){return new ii({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ii({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ii({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new ii({checks:[],typeName:Te.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};function xJ(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class Gs extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==pe.number){const a=this._getOrReturnCtx(t);return ue(a,{code:Z.invalid_type,expected:pe.number,received:a.parsedType}),Ce}let r;const i=new Cn;for(const a of this._def.checks)a.kind==="int"?qe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?xJ(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.not_finite,message:a.message}),i.dirty()):qe.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,be.toString(n))}gt(t,n){return this.setLimit("min",t,!1,be.toString(n))}lte(t,n){return this.setLimit("max",t,!0,be.toString(n))}lt(t,n){return this.setLimit("max",t,!1,be.toString(n))}setLimit(t,n,r,i){return new Gs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:be.toString(i)}]})}_addCheck(t){return new Gs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:be.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:be.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:be.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:be.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:be.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:be.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&qe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Gs({checks:[],typeName:Te.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class Ys extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==pe.bigint)return this._getInvalidInput(t);let r;const i=new Cn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):qe.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ue(n,{code:Z.invalid_type,expected:pe.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,be.toString(n))}gt(t,n){return this.setLimit("min",t,!1,be.toString(n))}lte(t,n){return this.setLimit("max",t,!0,be.toString(n))}lt(t,n){return this.setLimit("max",t,!1,be.toString(n))}setLimit(t,n,r,i){return new Ys({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:be.toString(i)}]})}_addCheck(t){return new Ys({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:be.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:be.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ys({checks:[],typeName:Te.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};class $f extends Be{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==pe.boolean){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.boolean,received:r.parsedType}),Ce}return $n(t.data)}}$f.create=e=>new $f({typeName:Te.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class ll extends Be{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==pe.date){const a=this._getOrReturnCtx(t);return ue(a,{code:Z.invalid_type,expected:pe.date,received:a.parsedType}),Ce}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return ue(a,{code:Z.invalid_date}),Ce}const r=new Cn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):qe.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ll({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:be.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:be.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew ll({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Te.ZodDate,..._e(e)});class Ig extends Be{_parse(t){if(this._getType(t)!==pe.symbol){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.symbol,received:r.parsedType}),Ce}return $n(t.data)}}Ig.create=e=>new Ig({typeName:Te.ZodSymbol,..._e(e)});class Lf extends Be{_parse(t){if(this._getType(t)!==pe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.undefined,received:r.parsedType}),Ce}return $n(t.data)}}Lf.create=e=>new Lf({typeName:Te.ZodUndefined,..._e(e)});class Ff extends Be{_parse(t){if(this._getType(t)!==pe.null){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.null,received:r.parsedType}),Ce}return $n(t.data)}}Ff.create=e=>new Ff({typeName:Te.ZodNull,..._e(e)});class eu extends Be{constructor(){super(...arguments),this._any=!0}_parse(t){return $n(t.data)}}eu.create=e=>new eu({typeName:Te.ZodAny,..._e(e)});class Uo extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $n(t.data)}}Uo.create=e=>new Uo({typeName:Te.ZodUnknown,..._e(e)});class Da extends Be{_parse(t){const n=this._getOrReturnCtx(t);return ue(n,{code:Z.invalid_type,expected:pe.never,received:n.parsedType}),Ce}}Da.create=e=>new Da({typeName:Te.ZodNever,..._e(e)});class Mg extends Be{_parse(t){if(this._getType(t)!==pe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.void,received:r.parsedType}),Ce}return $n(t.data)}}Mg.create=e=>new Mg({typeName:Te.ZodVoid,..._e(e)});class fi extends Be{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==pe.array)return ue(n,{code:Z.invalid_type,expected:pe.array,received:n.parsedType}),Ce;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,l=n.data.lengthi.maxLength.value&&(ue(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>i.type._parseAsync(new Gi(n,o,n.path,l)))).then(o=>Cn.mergeArray(r,o));const a=[...n.data].map((o,l)=>i.type._parseSync(new Gi(n,o,n.path,l)));return Cn.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new fi({...this._def,minLength:{value:t,message:be.toString(n)}})}max(t,n){return new fi({...this._def,maxLength:{value:t,message:be.toString(n)}})}length(t,n){return new fi({...this._def,exactLength:{value:t,message:be.toString(n)}})}nonempty(t){return this.min(1,t)}}fi.create=(e,t)=>new fi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,..._e(t)});function Bl(e){if(e instanceof jt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$i.create(Bl(r))}return new jt({...e._def,shape:()=>t})}else return e instanceof fi?new fi({...e._def,type:Bl(e.element)}):e instanceof $i?$i.create(Bl(e.unwrap())):e instanceof Xs?Xs.create(Bl(e.unwrap())):e instanceof Yi?Yi.create(e.items.map(t=>Bl(t))):e}class jt extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=qe.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==pe.object){const u=this._getOrReturnCtx(t);return ue(u,{code:Z.invalid_type,expected:pe.object,received:u.parsedType}),Ce}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Da&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Gi(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Da){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")l.length>0&&(ue(i,{code:Z.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Gi(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Cn.mergeObjectSync(r,u)):Cn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return be.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,o,l;const c=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=be.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Te.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const n={};return qe.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new jt({...this._def,shape:()=>n})}omit(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new jt({...this._def,shape:()=>n})}deepPartial(){return Bl(this)}partial(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new jt({...this._def,shape:()=>n})}required(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof $i;)a=a._def.innerType;n[r]=a}}),new jt({...this._def,shape:()=>n})}keyof(){return mF(qe.objectKeys(this.shape))}}jt.create=(e,t)=>new jt({shape:()=>e,unknownKeys:"strip",catchall:Da.create(),typeName:Te.ZodObject,..._e(t)});jt.strictCreate=(e,t)=>new jt({shape:()=>e,unknownKeys:"strict",catchall:Da.create(),typeName:Te.ZodObject,..._e(t)});jt.lazycreate=(e,t)=>new jt({shape:e,unknownKeys:"strip",catchall:Da.create(),typeName:Te.ZodObject,..._e(t)});class Bf extends Be{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new dr(l.ctx.common.issues));return ue(n,{code:Z.invalid_union,unionErrors:o}),Ce}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new dr(c));return ue(n,{code:Z.invalid_union,unionErrors:l}),Ce}}get options(){return this._def.options}}Bf.create=(e,t)=>new Bf({options:e,typeName:Te.ZodUnion,..._e(t)});const la=e=>e instanceof zf?la(e.schema):e instanceof vi?la(e.innerType()):e instanceof Uf?[e.value]:e instanceof Ks?e.options:e instanceof Hf?qe.objectValues(e.enum):e instanceof qf?la(e._def.innerType):e instanceof Lf?[void 0]:e instanceof Ff?[null]:e instanceof $i?[void 0,...la(e.unwrap())]:e instanceof Xs?[null,...la(e.unwrap())]:e instanceof rN||e instanceof Yf?la(e.unwrap()):e instanceof Gf?la(e._def.innerType):[];class zy extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==pe.object)return ue(n,{code:Z.invalid_type,expected:pe.object,received:n.parsedType}),Ce;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(ue(n,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const a of n){const o=la(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(i.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);i.set(l,a)}}return new zy({typeName:Te.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,..._e(r)})}}function n1(e,t){const n=da(e),r=da(t);if(e===t)return{valid:!0,data:e};if(n===pe.object&&r===pe.object){const i=qe.objectKeys(t),a=qe.objectKeys(e).filter(l=>i.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=n1(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===pe.array&&r===pe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a{if(e1(a)||e1(o))return Ce;const l=n1(a.value,o.value);return l.valid?((t1(a)||t1(o))&&n.dirty(),{status:n.value,value:l.data}):(ue(r,{code:Z.invalid_intersection_types}),Ce)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Vf.create=(e,t,n)=>new Vf({left:e,right:t,typeName:Te.ZodIntersection,..._e(n)});class Yi extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pe.array)return ue(r,{code:Z.invalid_type,expected:pe.array,received:r.parsedType}),Ce;if(r.data.lengththis._def.items.length&&(ue(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Gi(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Cn.mergeArray(n,o)):Cn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Yi({...this._def,rest:t})}}Yi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yi({items:e,typeName:Te.ZodTuple,rest:null,..._e(t)})};class Wf extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pe.object)return ue(r,{code:Z.invalid_type,expected:pe.object,received:r.parsedType}),Ce;const i=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)i.push({key:a._parse(new Gi(r,l,r.path,l)),value:o._parse(new Gi(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Be?new Wf({keyType:t,valueType:n,typeName:Te.ZodRecord,..._e(r)}):new Wf({keyType:ii.create(),valueType:t,typeName:Te.ZodRecord,..._e(n)})}}class Rg extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pe.map)return ue(r,{code:Z.invalid_type,expected:pe.map,received:r.parsedType}),Ce;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:i._parse(new Gi(r,l,r.path,[u,"key"])),value:a._parse(new Gi(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}Rg.create=(e,t,n)=>new Rg({valueType:t,keyType:e,typeName:Te.ZodMap,..._e(n)});class cl extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pe.set)return ue(r,{code:Z.invalid_type,expected:pe.set,received:r.parsedType}),Ce;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(ue(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Ce;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new Gi(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new cl({...this._def,minSize:{value:t,message:be.toString(n)}})}max(t,n){return new cl({...this._def,maxSize:{value:t,message:be.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}cl.create=(e,t)=>new cl({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,..._e(t)});class wc extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==pe.function)return ue(n,{code:Z.invalid_type,expected:pe.function,received:n.parsedType}),Ce;function r(l,c){return Og({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eg(),Jc].filter(u=>!!u),issueData:{code:Z.invalid_arguments,argumentsError:c}})}function i(l,c){return Og({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eg(),Jc].filter(u=>!!u),issueData:{code:Z.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof tu){const l=this;return $n(async function(...c){const u=new dr([]),d=await l._def.args.parseAsync(c,a).catch(m=>{throw u.addIssue(r(c,m)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(m=>{throw u.addIssue(i(f,m)),u})})}else{const l=this;return $n(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new dr([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new dr([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new wc({...this._def,args:Yi.create(t).rest(Uo.create())})}returns(t){return new wc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new wc({args:t||Yi.create([]).rest(Uo.create()),returns:n||Uo.create(),typeName:Te.ZodFunction,..._e(r)})}}class zf extends Be{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zf.create=(e,t)=>new zf({getter:e,typeName:Te.ZodLazy,..._e(t)});class Uf extends Be{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}Uf.create=(e,t)=>new Uf({value:e,typeName:Te.ZodLiteral,..._e(t)});function mF(e,t){return new Ks({values:e,typeName:Te.ZodEnum,..._e(t)})}class Ks extends Be{constructor(){super(...arguments),Rd.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:qe.joinValues(r),received:n.parsedType,code:Z.invalid_type}),Ce}if(_g(this,Rd)||uF(this,Rd,new Set(this._def.values)),!_g(this,Rd).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:Z.invalid_enum_value,options:r}),Ce}return $n(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ks.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ks.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Rd=new WeakMap;Ks.create=mF;class Hf extends Be{constructor(){super(...arguments),Dd.set(this,void 0)}_parse(t){const n=qe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==pe.string&&r.parsedType!==pe.number){const i=qe.objectValues(n);return ue(r,{expected:qe.joinValues(i),received:r.parsedType,code:Z.invalid_type}),Ce}if(_g(this,Dd)||uF(this,Dd,new Set(qe.getValidEnumValues(this._def.values))),!_g(this,Dd).has(t.data)){const i=qe.objectValues(n);return ue(r,{received:r.data,code:Z.invalid_enum_value,options:i}),Ce}return $n(t.data)}get enum(){return this._def.values}}Dd=new WeakMap;Hf.create=(e,t)=>new Hf({values:e,typeName:Te.ZodNativeEnum,..._e(t)});class tu extends Be{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==pe.promise&&n.common.async===!1)return ue(n,{code:Z.invalid_type,expected:pe.promise,received:n.parsedType}),Ce;const r=n.parsedType===pe.promise?n.data:Promise.resolve(n.data);return $n(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tu.create=(e,t)=>new tu({type:e,typeName:Te.ZodPromise,..._e(t)});class vi extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{ue(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?Ce:c.status==="dirty"||n.value==="dirty"?Jl(c.value):c});{if(n.value==="aborted")return Ce;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?Ce:l.status==="dirty"||n.value==="dirty"?Jl(l.value):l}}if(i.type==="refinement"){const o=l=>{const c=i.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Ce:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Ce:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ol(o))return o;const l=i.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ol(o)?Promise.resolve(i.transform(o.value,a)).then(l=>({status:n.value,value:l})):o);qe.assertNever(i)}}vi.create=(e,t,n)=>new vi({schema:e,typeName:Te.ZodEffects,effect:t,..._e(n)});vi.createWithPreprocess=(e,t,n)=>new vi({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,..._e(n)});class $i extends Be{_parse(t){return this._getType(t)===pe.undefined?$n(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$i.create=(e,t)=>new $i({innerType:e,typeName:Te.ZodOptional,..._e(t)});class Xs extends Be{_parse(t){return this._getType(t)===pe.null?$n(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Xs.create=(e,t)=>new Xs({innerType:e,typeName:Te.ZodNullable,..._e(t)});class qf extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===pe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}qf.create=(e,t)=>new qf({innerType:e,typeName:Te.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._e(t)});class Gf extends Be{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Df(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new dr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new dr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Gf.create=(e,t)=>new Gf({innerType:e,typeName:Te.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._e(t)});class Dg extends Be{_parse(t){if(this._getType(t)!==pe.nan){const r=this._getOrReturnCtx(t);return ue(r,{code:Z.invalid_type,expected:pe.nan,received:r.parsedType}),Ce}return{status:"valid",value:t.data}}}Dg.create=e=>new Dg({typeName:Te.ZodNaN,..._e(e)});const bJ=Symbol("zod_brand");class rN extends Be{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class cm extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ce:a.status==="dirty"?(n.dirty(),Jl(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ce:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new cm({in:t,out:n,typeName:Te.ZodPipeline})}}class Yf extends Be{_parse(t){const n=this._def.innerType._parse(t),r=i=>(ol(i)&&(i.value=Object.freeze(i.value)),i);return Df(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Yf.create=(e,t)=>new Yf({innerType:e,typeName:Te.ZodReadonly,..._e(t)});function kk(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function pF(e,t={},n){return e?eu.create().superRefine((r,i)=>{var a,o;const l=e(r);if(l instanceof Promise)return l.then(c=>{var u,d;if(!c){const f=kk(t,r),h=(d=(u=f.fatal)!==null&&u!==void 0?u:n)!==null&&d!==void 0?d:!0;i.addIssue({code:"custom",...f,fatal:h})}});if(!l){const c=kk(t,r),u=(o=(a=c.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0;i.addIssue({code:"custom",...c,fatal:u})}}):eu.create()}const wJ={object:jt.lazycreate};var Te;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Te||(Te={}));const jJ=(e,t={message:`Input not instance of ${e.name}`})=>pF(n=>n instanceof e,t),gF=ii.create,vF=Gs.create,SJ=Dg.create,AJ=Ys.create,yF=$f.create,NJ=ll.create,TJ=Ig.create,CJ=Lf.create,PJ=Ff.create,kJ=eu.create,EJ=Uo.create,OJ=Da.create,_J=Mg.create,IJ=fi.create,MJ=jt.create,RJ=jt.strictCreate,DJ=Bf.create,$J=zy.create,LJ=Vf.create,FJ=Yi.create,BJ=Wf.create,VJ=Rg.create,WJ=cl.create,zJ=wc.create,UJ=zf.create,HJ=Uf.create,qJ=Ks.create,GJ=Hf.create,YJ=tu.create,Ek=vi.create,KJ=$i.create,XJ=Xs.create,ZJ=vi.createWithPreprocess,QJ=cm.create,JJ=()=>gF().optional(),eee=()=>vF().optional(),tee=()=>yF().optional(),nee={string:e=>ii.create({...e,coerce:!0}),number:e=>Gs.create({...e,coerce:!0}),boolean:e=>$f.create({...e,coerce:!0}),bigint:e=>Ys.create({...e,coerce:!0}),date:e=>ll.create({...e,coerce:!0})},ree=Ce;var Si=Object.freeze({__proto__:null,defaultErrorMap:Jc,setErrorMap:ZQ,getErrorMap:Eg,makeIssue:Og,EMPTY_PATH:QQ,addIssueToContext:ue,ParseStatus:Cn,INVALID:Ce,DIRTY:Jl,OK:$n,isAborted:e1,isDirty:t1,isValid:ol,isAsync:Df,get util(){return qe},get objectUtil(){return Jw},ZodParsedType:pe,getParsedType:da,ZodType:Be,datetimeRegex:hF,ZodString:ii,ZodNumber:Gs,ZodBigInt:Ys,ZodBoolean:$f,ZodDate:ll,ZodSymbol:Ig,ZodUndefined:Lf,ZodNull:Ff,ZodAny:eu,ZodUnknown:Uo,ZodNever:Da,ZodVoid:Mg,ZodArray:fi,ZodObject:jt,ZodUnion:Bf,ZodDiscriminatedUnion:zy,ZodIntersection:Vf,ZodTuple:Yi,ZodRecord:Wf,ZodMap:Rg,ZodSet:cl,ZodFunction:wc,ZodLazy:zf,ZodLiteral:Uf,ZodEnum:Ks,ZodNativeEnum:Hf,ZodPromise:tu,ZodEffects:vi,ZodTransformer:vi,ZodOptional:$i,ZodNullable:Xs,ZodDefault:qf,ZodCatch:Gf,ZodNaN:Dg,BRAND:bJ,ZodBranded:rN,ZodPipeline:cm,ZodReadonly:Yf,custom:pF,Schema:Be,ZodSchema:Be,late:wJ,get ZodFirstPartyTypeKind(){return Te},coerce:nee,any:kJ,array:IJ,bigint:AJ,boolean:yF,date:NJ,discriminatedUnion:$J,effect:Ek,enum:qJ,function:zJ,instanceof:jJ,intersection:LJ,lazy:UJ,literal:HJ,map:VJ,nan:SJ,nativeEnum:GJ,never:OJ,null:PJ,nullable:XJ,number:vF,object:MJ,oboolean:tee,onumber:eee,optional:KJ,ostring:JJ,pipeline:QJ,preprocess:ZJ,promise:YJ,record:BJ,set:WJ,strictObject:RJ,string:gF,symbol:TJ,transformer:Ek,tuple:FJ,undefined:CJ,union:DJ,unknown:EJ,void:_J,NEVER:ree,ZodIssueCode:Z,quotelessJson:XQ,ZodError:dr});const $g=PA,iee=kA,xF=v.forwardRef(({className:e,...t},n)=>s.jsx(nm,{ref:n,className:Q("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}));xF.displayName=nm.displayName;const Kf=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(iee,{children:[s.jsx(xF,{}),s.jsxs(rm,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(Iy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(zo,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kf.displayName=rm.displayName;const Xf=({className:e,...t})=>s.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xf.displayName="DialogHeader";const Uy=({className:e,...t})=>s.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Uy.displayName="DialogFooter";const Zf=v.forwardRef(({className:e,...t},n)=>s.jsx(im,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));Zf.displayName=im.displayName;const Qf=v.forwardRef(({className:e,...t},n)=>s.jsx(am,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));Qf.displayName=am.displayName;const Ok={starter:{icon:w$,color:"text-yellow-500",bgColor:"bg-yellow-500/10",price:49,features:["3 voice agents","200 minutes/month","Lead capture + custom fields","Transcripts & recordings"]},growth:{icon:mg,color:"text-orange-500",bgColor:"bg-orange-500/10",price:149,features:["Unlimited agents","600 minutes/month","Advanced lead capture","Conversion tracking"]},scale:{icon:aA,color:"text-purple-500",bgColor:"bg-purple-500/10",price:399,features:["Everything in Growth","1,600 minutes/month","Custom voice cloning","CRM integrations"]}};function aee({open:e,onOpenChange:t,title:n="Upgrade Required",description:r="You've reached the limit of your current plan. Upgrade to unlock more features.",currentPlan:i="free",suggestedPlan:a="starter"}){const o=Ok[a]||Ok.starter,l=o.icon;return s.jsx($g,{open:e,onOpenChange:t,children:s.jsxs(Kf,{className:"sm:max-w-md","data-testid":"modal-upgrade",children:[s.jsxs(Xf,{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:`p-2 rounded-lg ${o.bgColor}`,children:s.jsx(Hi,{className:"h-5 w-5 text-orange-500"})}),s.jsx(Zf,{children:n})]}),s.jsx(Qf,{children:r})]}),s.jsxs("div",{className:`p-4 rounded-lg border-2 ${o.bgColor} ${o.color.replace("text-","border-")}/30`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(l,{className:`h-5 w-5 ${o.color}`}),s.jsx("span",{className:"font-semibold capitalize",children:a})]}),s.jsxs("div",{className:"text-lg font-bold",children:["$",o.price,s.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"/mo"})]})]}),s.jsx("ul",{className:"space-y-2",children:o.features.map((c,u)=>s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Kc,{className:`h-4 w-4 ${o.color}`}),c]},u))})]}),s.jsxs(Uy,{className:"flex gap-2 sm:gap-2",children:[s.jsx(X,{variant:"outline",onClick:()=>t(!1),"data-testid":"button-cancel-upgrade",children:"Maybe Later"}),s.jsx(de,{href:"/billing",children:s.jsxs(X,{className:"bg-gradient-to-r from-orange-500 to-yellow-500 hover:from-orange-600 hover:to-yellow-600",onClick:()=>t(!1),"data-testid":"button-go-to-billing",children:["View Plans ",s.jsx(kr,{className:"h-4 w-4 ml-2"})]})})]})]})})}const Po=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Po.displayName="Textarea";var see="Label",bF=v.forwardRef((e,t)=>s.jsx(ye.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bF.displayName=see;var wF=bF;const oee=Du("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Kt=v.forwardRef(({className:e,...t},n)=>s.jsx(wF,{ref:n,className:Q(oee(),e),...t}));Kt.displayName=wF.displayName;function jF(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var iN="Switch",[lee,O_e]=rn(iN),[cee,uee]=lee(iN),SF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,m]=v.useState(null),y=ke(t,w=>m(w)),p=v.useRef(!1),b=h?d||!!h.closest("form"):!0,[x=!1,g]=hr({prop:i,defaultProp:a,onChange:u});return s.jsxs(cee,{scope:n,checked:x,disabled:l,children:[s.jsx(ye.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":TF(x),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:y,onClick:ee(e.onClick,w=>{g(S=>!S),b&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),b&&s.jsx(dee,{control:h,bubbles:!p.current,name:r,value:c,checked:x,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});SF.displayName=iN;var AF="SwitchThumb",NF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=uee(AF,n);return s.jsx(ye.span,{"data-state":TF(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});NF.displayName=AF;var dee=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,a=v.useRef(null),o=jF(n),l=G$(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function TF(e){return e?"checked":"unchecked"}var CF=SF,fee=NF;const tf=v.forwardRef(({className:e,...t},n)=>s.jsx(CF,{className:Q("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(fee,{className:Q("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")})}));tf.displayName=CF.displayName;var aN="Tabs",[hee,__e]=rn(aN,[Ry]),PF=Ry(),[mee,sN]=hee(aN),kF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Bu(l),[f,h]=hr({prop:r,onChange:i,defaultProp:a});return s.jsx(mee,{scope:n,baseId:Xn(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:s.jsx(ye.div,{dir:d,"data-orientation":o,...u,ref:t})})});kF.displayName=aN;var EF="TabsList",OF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=sN(EF,n),o=PF(n);return s.jsx(Q4,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:s.jsx(ye.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});OF.displayName=EF;var _F="TabsTrigger",IF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=sN(_F,n),l=PF(n),c=DF(o.baseId,r),u=$F(o.baseId,r),d=r===o.value;return s.jsx(J4,{asChild:!0,...l,focusable:!i,active:d,children:s.jsx(ye.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(r)})})})});IF.displayName=_F;var MF="TabsContent",RF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=sN(MF,n),c=DF(l.baseId,r),u=$F(l.baseId,r),d=r===l.value,f=v.useRef(d);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(an,{present:i||d,children:({present:h})=>s.jsx(ye.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});RF.displayName=MF;function DF(e,t){return`${e}-trigger-${t}`}function $F(e,t){return`${e}-content-${t}`}var pee=kF,LF=OF,FF=IF,BF=RF;const oN=pee,Hy=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Hy.displayName=LF.displayName;const ai=v.forwardRef(({className:e,...t},n)=>s.jsx(FF,{ref:n,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ai.displayName=FF.displayName;const si=v.forwardRef(({className:e,...t},n)=>s.jsx(BF,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));si.displayName=BF.displayName;function r1(e,[t,n]){return Math.min(n,Math.max(t,e))}var gee=[" ","Enter","ArrowUp","ArrowDown"],vee=[" ","Enter"],um="Select",[qy,Gy,yee]=Xh(um),[Vu,I_e]=rn(um,[yee,no]),Yy=no(),[xee,ro]=Vu(um),[bee,wee]=Vu(um),VF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:y}=e,p=Yy(t),[b,x]=v.useState(null),[g,w]=v.useState(null),[S,j]=v.useState(!1),A=Bu(u),[N=!1,T]=hr({prop:r,defaultProp:i,onChange:a}),[C,E]=hr({prop:o,defaultProp:l,onChange:c}),P=v.useRef(null),k=b?y||!!b.closest("form"):!0,[$,I]=v.useState(new Set),F=Array.from($).map(R=>R.props.value).join(";");return s.jsx(Sy,{...p,children:s.jsxs(xee,{required:m,scope:t,trigger:b,onTriggerChange:x,valueNode:g,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:Xn(),value:C,onValueChange:E,open:N,onOpenChange:T,dir:A,triggerPointerDownPosRef:P,disabled:h,children:[s.jsx(qy.Provider,{scope:t,children:s.jsx(bee,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(R=>{I(B=>new Set(B).add(R))},[]),onNativeOptionRemove:v.useCallback(R=>{I(B=>{const O=new Set(B);return O.delete(R),O})},[]),children:n})}),k?s.jsxs(f5,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:C,onChange:R=>E(R.target.value),disabled:h,form:y,children:[C===void 0?s.jsx("option",{value:""}):null,Array.from($)]},F):null]})})};VF.displayName=um;var WF="SelectTrigger",zF=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=Yy(n),o=ro(WF,n),l=o.disabled||r,c=ke(t,o.onTriggerChange),u=Gy(n),d=v.useRef("touch"),[f,h,m]=h5(p=>{const b=u().filter(w=>!w.disabled),x=b.find(w=>w.value===o.value),g=m5(b,p,x);g!==void 0&&o.onValueChange(g.value)}),y=p=>{l||(o.onOpenChange(!0),m()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(Jh,{asChild:!0,...a,children:s.jsx(ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":d5(o.value)?"":void 0,...i,ref:c,onClick:ee(i.onClick,p=>{p.currentTarget.focus(),d.current!=="mouse"&&y(p)}),onPointerDown:ee(i.onPointerDown,p=>{d.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:ee(i.onKeyDown,p=>{const b=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(b&&p.key===" ")&&gee.includes(p.key)&&(y(),p.preventDefault())})})})});zF.displayName=WF;var UF="SelectValue",HF=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=ro(UF,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=ke(t,c.onValueNodeChange);return Ft(()=>{u(d)},[u,d]),s.jsx(ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:d5(c.value)?s.jsx(s.Fragment,{children:o}):a})});HF.displayName=UF;var jee="SelectIcon",qF=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return s.jsx(ye.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});qF.displayName=jee;var See="SelectPortal",GF=e=>s.jsx(Ru,{asChild:!0,...e});GF.displayName=See;var ul="SelectContent",YF=v.forwardRef((e,t)=>{const n=ro(ul,e.__scopeSelect),[r,i]=v.useState();if(Ft(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?yl.createPortal(s.jsx(KF,{scope:e.__scopeSelect,children:s.jsx(qy.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(XF,{...e,ref:t})});YF.displayName=ul;var Ur=10,[KF,io]=Vu(ul),Aee="SelectContentImpl",Nee=Vs("SelectContent.RemoveScroll"),XF=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:b,...x}=e,g=ro(ul,n),[w,S]=v.useState(null),[j,A]=v.useState(null),N=ke(t,fe=>S(fe)),[T,C]=v.useState(null),[E,P]=v.useState(null),k=Gy(n),[$,I]=v.useState(!1),F=v.useRef(!1);v.useEffect(()=>{if(w)return _y(w)},[w]),Ey();const R=v.useCallback(fe=>{const[we,...K]=k().map(U=>U.ref.current),[V]=K.slice(-1),re=document.activeElement;for(const U of fe)if(U===re||(U==null||U.scrollIntoView({block:"nearest"}),U===we&&j&&(j.scrollTop=0),U===V&&j&&(j.scrollTop=j.scrollHeight),U==null||U.focus(),document.activeElement!==re))return},[k,j]),B=v.useCallback(()=>R([T,w]),[R,T,w]);v.useEffect(()=>{$&&B()},[$,B]);const{onOpenChange:O,triggerPointerDownPosRef:M}=g;v.useEffect(()=>{if(w){let fe={x:0,y:0};const we=V=>{var re,U;fe={x:Math.abs(Math.round(V.pageX)-(((re=M.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(V.pageY)-(((U=M.current)==null?void 0:U.y)??0))}},K=V=>{fe.x<=10&&fe.y<=10?V.preventDefault():w.contains(V.target)||O(!1),document.removeEventListener("pointermove",we),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",K,{capture:!0})}}},[w,O,M]),v.useEffect(()=>{const fe=()=>O(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[O]);const[W,Y]=h5(fe=>{const we=k().filter(re=>!re.disabled),K=we.find(re=>re.ref.current===document.activeElement),V=m5(we,fe,K);V&&setTimeout(()=>V.ref.current.focus())}),q=v.useCallback((fe,we,K)=>{const V=!F.current&&!K;(g.value!==void 0&&g.value===we||V)&&(C(fe),V&&(F.current=!0))},[g.value]),oe=v.useCallback(()=>w==null?void 0:w.focus(),[w]),je=v.useCallback((fe,we,K)=>{const V=!F.current&&!K;(g.value!==void 0&&g.value===we||V)&&P(fe)},[g.value]),$e=r==="popper"?i1:ZF,Ee=$e===i1?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:b}:{};return s.jsx(KF,{scope:n,content:w,viewport:j,onViewportChange:A,itemRefCallback:q,selectedItem:T,onItemLeave:oe,itemTextRefCallback:je,focusSelectedItem:B,selectedItemText:E,position:r,isPositioned:$,searchRef:W,children:s.jsx(tm,{as:Nee,allowPinchZoom:!0,children:s.jsx(em,{asChild:!0,trapped:g.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ee(i,fe=>{var we;(we=g.trigger)==null||we.focus({preventScroll:!0}),fe.preventDefault()}),children:s.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:s.jsx($e,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:fe=>fe.preventDefault(),...x,...Ee,onPlaced:()=>I(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ee(x.onKeyDown,fe=>{const we=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!we&&fe.key.length===1&&Y(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let V=k().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const re=fe.target,U=V.indexOf(re);V=V.slice(U+1)}setTimeout(()=>R(V)),fe.preventDefault()}})})})})})})});XF.displayName=Aee;var Tee="SelectItemAlignedPosition",ZF=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=ro(ul,n),o=io(ul,n),[l,c]=v.useState(null),[u,d]=v.useState(null),f=ke(t,N=>d(N)),h=Gy(n),m=v.useRef(!1),y=v.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:x,focusSelectedItem:g}=o,w=v.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&b&&x){const N=a.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),C=a.valueNode.getBoundingClientRect(),E=x.getBoundingClientRect();if(a.dir!=="rtl"){const re=E.left-T.left,U=C.left-re,Le=N.left-U,Pe=N.width+Le,ot=Math.max(Pe,T.width),rt=window.innerWidth-Ur,bt=r1(U,[Ur,Math.max(Ur,rt-ot)]);l.style.minWidth=Pe+"px",l.style.left=bt+"px"}else{const re=T.right-E.right,U=window.innerWidth-C.right-re,Le=window.innerWidth-N.right-U,Pe=N.width+Le,ot=Math.max(Pe,T.width),rt=window.innerWidth-Ur,bt=r1(U,[Ur,Math.max(Ur,rt-ot)]);l.style.minWidth=Pe+"px",l.style.right=bt+"px"}const P=h(),k=window.innerHeight-Ur*2,$=p.scrollHeight,I=window.getComputedStyle(u),F=parseInt(I.borderTopWidth,10),R=parseInt(I.paddingTop,10),B=parseInt(I.borderBottomWidth,10),O=parseInt(I.paddingBottom,10),M=F+R+$+O+B,W=Math.min(b.offsetHeight*5,M),Y=window.getComputedStyle(p),q=parseInt(Y.paddingTop,10),oe=parseInt(Y.paddingBottom,10),je=N.top+N.height/2-Ur,$e=k-je,Ee=b.offsetHeight/2,fe=b.offsetTop+Ee,we=F+R+fe,K=M-we;if(we<=je){const re=P.length>0&&b===P[P.length-1].ref.current;l.style.bottom="0px";const U=u.clientHeight-p.offsetTop-p.offsetHeight,Le=Math.max($e,Ee+(re?oe:0)+U+B),Pe=we+Le;l.style.height=Pe+"px"}else{const re=P.length>0&&b===P[0].ref.current;l.style.top="0px";const Le=Math.max(je,F+p.offsetTop+(re?q:0)+Ee)+K;l.style.height=Le+"px",p.scrollTop=we-je+p.offsetTop}l.style.margin=`${Ur}px 0`,l.style.minHeight=W+"px",l.style.maxHeight=k+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,a.trigger,a.valueNode,l,u,p,b,x,a.dir,r]);Ft(()=>w(),[w]);const[S,j]=v.useState();Ft(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const A=v.useCallback(N=>{N&&y.current===!0&&(w(),g==null||g(),y.current=!1)},[w,g]);return s.jsx(Pee,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:A,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:s.jsx(ye.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ZF.displayName=Tee;var Cee="SelectPopperPosition",i1=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ur,...a}=e,o=Yy(n);return s.jsx(Ay,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});i1.displayName=Cee;var[Pee,lN]=Vu(ul,{}),a1="SelectViewport",QF=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=io(a1,n),o=lN(a1,n),l=ke(t,a.onViewportChange),c=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(qy.Slot,{scope:n,children:s.jsx(ye.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ee(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const y=window.innerHeight-Ur*2,p=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),x=Math.max(p,b);if(x0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});QF.displayName=a1;var JF="SelectGroup",[kee,Eee]=Vu(JF),Oee=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Xn();return s.jsx(kee,{scope:n,id:i,children:s.jsx(ye.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Oee.displayName=JF;var e5="SelectLabel",t5=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Eee(e5,n);return s.jsx(ye.div,{id:i.id,...r,ref:t})});t5.displayName=e5;var Lg="SelectItem",[_ee,n5]=Vu(Lg),r5=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=ro(Lg,n),c=io(Lg,n),u=l.value===r,[d,f]=v.useState(a??""),[h,m]=v.useState(!1),y=ke(t,g=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,g,r,i)}),p=Xn(),b=v.useRef("touch"),x=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(_ee,{scope:n,value:r,disabled:i,textId:p,isSelected:u,onItemTextChange:v.useCallback(g=>{f(w=>w||((g==null?void 0:g.textContent)??"").trim())},[]),children:s.jsx(qy.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:s.jsx(ye.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:ee(o.onFocus,()=>m(!0)),onBlur:ee(o.onBlur,()=>m(!1)),onClick:ee(o.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:ee(o.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:ee(o.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:ee(o.onPointerMove,g=>{var w;b.current=g.pointerType,i?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(o.onPointerLeave,g=>{var w;g.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ee(o.onKeyDown,g=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&g.key===" "||(vee.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});r5.displayName=Lg;var $d="SelectItemText",i5=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=ro($d,n),l=io($d,n),c=n5($d,n),u=wee($d,n),[d,f]=v.useState(null),h=ke(t,x=>f(x),c.onItemTextChange,x=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,x,c.value,c.disabled)}),m=d==null?void 0:d.textContent,y=v.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=u;return Ft(()=>(p(y),()=>b(y)),[p,b,y]),s.jsxs(s.Fragment,{children:[s.jsx(ye.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?yl.createPortal(a.children,o.valueNode):null]})});i5.displayName=$d;var a5="SelectItemIndicator",s5=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return n5(a5,n).isSelected?s.jsx(ye.span,{"aria-hidden":!0,...r,ref:t}):null});s5.displayName=a5;var s1="SelectScrollUpButton",o5=v.forwardRef((e,t)=>{const n=io(s1,e.__scopeSelect),r=lN(s1,e.__scopeSelect),[i,a]=v.useState(!1),o=ke(t,r.onScrollButtonChange);return Ft(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?s.jsx(c5,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});o5.displayName=s1;var o1="SelectScrollDownButton",l5=v.forwardRef((e,t)=>{const n=io(o1,e.__scopeSelect),r=lN(o1,e.__scopeSelect),[i,a]=v.useState(!1),o=ke(t,r.onScrollButtonChange);return Ft(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?s.jsx(c5,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});l5.displayName=o1;var c5=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=io("SelectScrollButton",n),o=v.useRef(null),l=Gy(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Ft(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(ye.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ee(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ee(i.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ee(i.onPointerLeave,()=>{c()})})}),Iee="SelectSeparator",u5=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ye.div,{"aria-hidden":!0,...r,ref:t})});u5.displayName=Iee;var l1="SelectArrow",Mee=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Yy(n),a=ro(l1,n),o=io(l1,n);return a.open&&o.position==="popper"?s.jsx(Ny,{...i,...r,ref:t}):null});Mee.displayName=l1;function d5(e){return e===""||e===void 0}var f5=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=v.useRef(null),a=ke(t,i),o=jF(n);return v.useEffect(()=>{const l=i.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&d){const f=new Event("change",{bubbles:!0});d.call(l,n),l.dispatchEvent(f)}},[o,n]),s.jsx(Zh,{asChild:!0,children:s.jsx("select",{...r,ref:a,defaultValue:n})})});f5.displayName="BubbleSelect";function h5(e){const t=yt(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function m5(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Ree(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Ree(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Dee=VF,p5=zF,$ee=HF,Lee=qF,Fee=GF,g5=YF,Bee=QF,v5=t5,y5=r5,Vee=i5,Wee=s5,x5=o5,b5=l5,w5=u5;const wa=Dee,ja=$ee,Li=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(p5,{ref:r,className:Q("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(Lee,{asChild:!0,children:s.jsx(py,{className:"h-4 w-4 opacity-50"})})]}));Li.displayName=p5.displayName;const j5=v.forwardRef(({className:e,...t},n)=>s.jsx(x5,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Kq,{className:"h-4 w-4"})}));j5.displayName=x5.displayName;const S5=v.forwardRef(({className:e,...t},n)=>s.jsx(b5,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(py,{className:"h-4 w-4"})}));S5.displayName=b5.displayName;const Fi=v.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>s.jsx(Fee,{children:s.jsxs(g5,{ref:i,className:Q("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(j5,{}),s.jsx(Bee,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(S5,{})]})}));Fi.displayName=g5.displayName;const zee=v.forwardRef(({className:e,...t},n)=>s.jsx(v5,{ref:n,className:Q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));zee.displayName=v5.displayName;const Et=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(y5,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Wee,{children:s.jsx(Kc,{className:"h-4 w-4"})})}),s.jsx(Vee,{children:t})]}));Et.displayName=y5.displayName;const Uee=v.forwardRef(({className:e,...t},n)=>s.jsx(w5,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));Uee.displayName=w5.displayName;const Hee=CQ,A5=v.createContext({}),na=({...e})=>s.jsx(A5.Provider,{value:{name:e.name},children:s.jsx(OQ,{...e})}),Ky=()=>{const e=v.useContext(A5),t=v.useContext(N5),{getFieldState:n,formState:r}=Wy(),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},N5=v.createContext({}),Ai=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return s.jsx(N5.Provider,{value:{id:r},children:s.jsx("div",{ref:n,className:Q("space-y-2",e),...t})})});Ai.displayName="FormItem";const es=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:i}=Ky();return s.jsx(Kt,{ref:n,className:Q(r&&"text-destructive",e),htmlFor:i,...t})});es.displayName="FormLabel";const ts=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Ky();return s.jsx(eA,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});ts.displayName="FormControl";const ns=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Ky();return s.jsx("p",{ref:n,id:r,className:Q("text-sm text-muted-foreground",e),...t})});ns.displayName="FormDescription";const Ld=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:i,formMessageId:a}=Ky(),o=i?String((i==null?void 0:i.message)??""):t;return o?s.jsx("p",{ref:r,id:a,className:Q("text-sm font-medium text-destructive",e),...n,children:o}):null});Ld.displayName="FormMessage";var cN="Popover",[T5,M_e]=rn(cN,[no]),dm=no(),[qee,ao]=T5(cN),C5=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,l=dm(t),c=v.useRef(null),[u,d]=v.useState(!1),[f=!1,h]=hr({prop:r,defaultProp:i,onChange:a});return s.jsx(Sy,{...l,children:s.jsx(qee,{scope:t,contentId:Xn(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:v.useCallback(()=>d(!0),[]),onCustomAnchorRemove:v.useCallback(()=>d(!1),[]),modal:o,children:n})})};C5.displayName=cN;var P5="PopoverAnchor",Gee=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ao(P5,n),a=dm(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=i;return v.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(Jh,{...a,...r,ref:t})});Gee.displayName=P5;var k5="PopoverTrigger",E5=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ao(k5,n),a=dm(n),o=ke(t,i.triggerRef),l=s.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":R5(i.open),...r,ref:o,onClick:ee(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:s.jsx(Jh,{asChild:!0,...a,children:l})});E5.displayName=k5;var uN="PopoverPortal",[Yee,Kee]=T5(uN,{forceMount:void 0}),O5=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ao(uN,t);return s.jsx(Yee,{scope:t,forceMount:n,children:s.jsx(an,{present:n||a.open,children:s.jsx(Ru,{asChild:!0,container:i,children:r})})})};O5.displayName=uN;var nu="PopoverContent",_5=v.forwardRef((e,t)=>{const n=Kee(nu,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ao(nu,e.__scopePopover);return s.jsx(an,{present:r||a.open,children:a.modal?s.jsx(Zee,{...i,ref:t}):s.jsx(Qee,{...i,ref:t})})});_5.displayName=nu;var Xee=Vs("PopoverContent.RemoveScroll"),Zee=v.forwardRef((e,t)=>{const n=ao(nu,e.__scopePopover),r=v.useRef(null),i=ke(t,r),a=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return _y(o)},[]),s.jsx(tm,{as:Xee,allowPinchZoom:!0,children:s.jsx(I5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ee(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qee=v.forwardRef((e,t)=>{const n=ao(nu,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return s.jsx(I5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),I5=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=ao(nu,n),m=dm(n);return Ey(),s.jsx(em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(bl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:s.jsx(Ay,{"data-state":R5(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)"}})})})}),M5="PopoverClose",Jee=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ao(M5,n);return s.jsx(ye.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});Jee.displayName=M5;var ete="PopoverArrow",tte=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=dm(n);return s.jsx(Ny,{...i,...r,ref:t})});tte.displayName=ete;function R5(e){return e?"open":"closed"}var nte=C5,rte=E5,ite=O5,D5=_5;const ate=nte,ste=rte,$5=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>s.jsx(ite,{children:s.jsx(D5,{ref:i,align:t,sideOffset:n,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));$5.displayName=D5.displayName;const ote=["#FF6B35","#FFB81C","#10B981","#3B82F6","#8B5CF6","#EC4899","#EF4444","#F59E0B","#6366F1","#14B8A6","#000000","#FFFFFF"];function _k({value:e,onChange:t,label:n}){const[r,i]=v.useState(e),a=v.useCallback(l=>{const c=l.target.value;i(c),/^#[0-9A-Fa-f]{6}$/.test(c)&&t(c)},[t]),o=v.useCallback(l=>{i(l),t(l)},[t]);return s.jsxs("div",{className:"space-y-2",children:[n&&s.jsx(Kt,{className:"text-sm text-muted-foreground",children:n}),s.jsxs(ate,{children:[s.jsx(ste,{asChild:!0,children:s.jsxs(X,{variant:"outline",className:"w-full justify-start gap-3 h-10","data-testid":`color-picker-${(n==null?void 0:n.toLowerCase().replace(/\s+/g,"-"))||"button"}`,children:[s.jsx("div",{className:"w-5 h-5 rounded-md border border-border",style:{backgroundColor:e}}),s.jsx("span",{className:"font-mono text-sm",children:e})]})}),s.jsx($5,{className:"w-64 p-3",align:"start",children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"grid grid-cols-6 gap-2",children:ote.map(l=>s.jsx("button",{className:"w-8 h-8 rounded-md border border-border hover-elevate transition-transform",style:{backgroundColor:l},onClick:()=>o(l),"data-testid":`preset-color-${l.replace("#","")}`},l))}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("div",{className:"w-10 h-10 rounded-md border border-border flex-shrink-0",style:{backgroundColor:e}}),s.jsx(Dt,{type:"text",value:r,onChange:a,placeholder:"#FF6B35",className:"font-mono text-sm","data-testid":"color-input"})]})]})})]})]})}function L5({agentName:e,greeting:t,primaryColor:n,secondaryColor:r,position:i="bottom-right",isOpen:a=!1,isListening:o=!1,showBubble:l=!0}){const c=i==="bottom-right"?"right-4":"left-4";return s.jsxs("div",{className:"relative w-full h-80 bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-800 dark:to-slate-900 rounded-lg overflow-hidden border border-border","data-testid":"widget-preview",children:[s.jsxs("div",{className:"absolute inset-0 p-4",children:[s.jsx("div",{className:"w-full h-4 bg-slate-300 dark:bg-slate-700 rounded mb-3"}),s.jsx("div",{className:"w-3/4 h-4 bg-slate-300 dark:bg-slate-700 rounded mb-3"}),s.jsx("div",{className:"w-5/6 h-4 bg-slate-300 dark:bg-slate-700 rounded mb-6"}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:[1,2,3].map(u=>s.jsx("div",{className:"aspect-square bg-slate-300 dark:bg-slate-700 rounded-lg"},u))})]}),l&&!a&&s.jsxs("div",{className:`absolute bottom-20 ${c} max-w-48 p-3 bg-white dark:bg-slate-800 rounded-lg shadow-lg border border-border`,"data-testid":"widget-bubble",children:[s.jsx("button",{className:"absolute -top-2 -right-2 w-5 h-5 bg-slate-200 dark:bg-slate-700 rounded-full flex items-center justify-center",children:s.jsx(zo,{className:"w-3 h-3 text-muted-foreground"})}),s.jsxs("p",{className:"text-xs text-foreground",children:[t.slice(0,80),"..."]})]}),a&&s.jsxs("div",{className:`absolute bottom-20 ${c} w-72 h-48 bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-border overflow-hidden`,"data-testid":"widget-chat",children:[s.jsxs("div",{className:"h-10 px-3 flex items-center justify-between",style:{backgroundColor:n},children:[s.jsx("span",{className:"text-white text-sm font-medium",children:e}),s.jsx("button",{className:"text-white/80 hover:text-white",children:s.jsx(a9,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"p-3 flex-1",children:[s.jsxs("div",{className:"bg-slate-100 dark:bg-slate-700 rounded-lg p-2 text-xs mb-2",children:[t.slice(0,100),"..."]}),o&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(jg,{isActive:!0,color:n,size:"sm"}),s.jsx("span",{children:"Listening..."})]})]})]}),s.jsxs("button",{className:`absolute bottom-4 ${c} w-14 h-14 rounded-full flex items-center justify-center shadow-lg transition-all duration-300 ${o?"scale-110":"hover:scale-105"}`,style:{background:`linear-gradient(135deg, ${n} 0%, ${r} 100%)`,boxShadow:o?`0 0 30px ${n}60`:`0 0 20px ${n}40`},"data-testid":"widget-mic-button",children:[o?s.jsx(jg,{isActive:!0,color:"white",size:"md"}):s.jsx(rl,{className:"w-6 h-6 text-white"}),o&&s.jsx("div",{className:"absolute inset-0 rounded-full animate-ping",style:{backgroundColor:`${n}30`,animationDuration:"1.5s"}})]})]})}const lte=Si.object({name:Si.string().min(1,"Name is required").max(100),prompt:Si.string().min(10,"Prompt must be at least 10 characters"),greeting:Si.string().min(10,"Greeting must be at least 10 characters"),voiceType:Si.string(),isActive:Si.boolean(),widgetPrimaryColor:Si.string(),widgetSecondaryColor:Si.string(),widgetPosition:Si.string(),widgetSize:Si.string()}),Ik=[{value:"alloy",label:"Alloy - Neutral & balanced",gender:"female"},{value:"ash",label:"Ash - Clear & precise",gender:"male"},{value:"ballad",label:"Ballad - Gentle & melodic",gender:"female"},{value:"coral",label:"Coral - Warm & friendly",gender:"female"},{value:"echo",label:"Echo - Deep & resonant",gender:"male"},{value:"sage",label:"Sage - Calm & thoughtful",gender:"female"},{value:"shimmer",label:"Shimmer - Bright & energetic",gender:"female"},{value:"verse",label:"Verse - Expressive & dynamic",gender:"male"}];function cte(){const{id:e}=Kh(),[,t]=xl(),{toast:n}=Pn(),{isAuthenticated:r,isLoading:i}=Zi(),a=e==="new",[o,l]=v.useState(""),[c,u]=v.useState(""),[d,f]=v.useState(""),[h,m]=v.useState(null),[y,p]=v.useState(!1),[b,x]=v.useState(""),[g,w]=v.useState("all"),[S,j]=v.useState(null),[A,N]=v.useState(""),[T,C]=v.useState(""),[E,P]=v.useState(!1);v.useEffect(()=>{!i&&!r&&(n({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500))},[r,i,n]);const{data:k,isLoading:$}=$t({queryKey:["/api/agents",e],enabled:r&&!a}),{data:I,isLoading:F}=$t({queryKey:["/api/agents",e,"training"],enabled:r&&!a}),R="You are a helpful sales assistant. Help customers find the right products and answer their questions professionally.",B="Hi! I'm here to help you with any questions about our products and services. How can I assist you today?",O=HQ({resolver:KQ(lte),defaultValues:{name:"",prompt:R,greeting:B,voiceType:"alloy",isActive:!0,widgetPrimaryColor:"#FF6B35",widgetSecondaryColor:"#FFB81C",widgetPosition:"bottom-right",widgetSize:"medium"},mode:"onBlur"});v.useEffect(()=>{k&&O.reset({name:k.name,prompt:k.prompt||R,greeting:k.greeting||B,voiceType:k.voiceType||"alloy",isActive:k.isActive??!0,widgetPrimaryColor:k.widgetPrimaryColor||"#FF6B35",widgetSecondaryColor:k.widgetSecondaryColor||"#FFB81C",widgetPosition:k.widgetPosition||"bottom-right",widgetSize:k.widgetSize||"medium"})},[k]);const M=tn({mutationFn:async V=>a?await(await zt("POST","/api/agents",V)).json():await(await zt("PATCH",`/api/agents/${e}`,V)).json(),onSuccess:V=>{Sn.invalidateQueries({queryKey:["/api/agents"]}),n({title:a?"Agent created":"Agent updated",description:a?"Your new agent has been created successfully.":"Changes have been saved."}),a&&(V!=null&&V.id)&&t(`/agents/${V.id}`)},onError:V=>{if(Md(V)){n({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500);return}if(Lb(V)){x(V.message.replace(/^403:\s*/,"")),p(!0);return}n({title:"Error",description:"Failed to save agent. Please try again.",variant:"destructive"})}}),W=tn({mutationFn:async V=>{await zt("POST",`/api/agents/${e}/training`,V)},onSuccess:()=>{Sn.invalidateQueries({queryKey:["/api/agents",e,"training"]}),n({title:"Training document added"}),l(""),u(""),f(""),m(null)},onError:V=>{if(Md(V)){n({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500);return}if(Lb(V)){x(V.message.replace(/^403:\s*/,"")),p(!0);return}n({title:"Error",description:"Failed to add training document.",variant:"destructive"})}}),Y=tn({mutationFn:async V=>{await zt("DELETE",`/api/agents/${e}/training/${V}`)},onSuccess:()=>{Sn.invalidateQueries({queryKey:["/api/agents",e,"training"]}),n({title:"Training document removed"})},onError:()=>{n({title:"Error",description:"Failed to remove training document.",variant:"destructive"})}}),q=tn({mutationFn:async V=>{await zt("PATCH",`/api/agents/${e}/training/${V.docId}`,{name:V.name,content:V.content})},onSuccess:()=>{Sn.invalidateQueries({queryKey:["/api/agents",e,"training"]}),n({title:"Training document updated"}),j(null),N(""),C("")},onError:V=>{if(Md(V)){n({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500);return}n({title:"Error",description:"Failed to update training document.",variant:"destructive"})}}),oe=tn({mutationFn:async V=>{P(!0);const re=new FormData;re.append("file",V);const U=await fetch(`/api/agents/${e}/training/upload`,{method:"POST",body:re,credentials:"include"});if(!U.ok){const Le=await U.json();throw new Error(Le.message||"Upload failed")}return U.json()},onSuccess:()=>{Sn.invalidateQueries({queryKey:["/api/agents",e,"training"]}),n({title:"File uploaded successfully"}),P(!1)},onError:V=>{if(P(!1),Md(V)){n({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500);return}if(Lb(V)){x(V.message.replace(/^403:\s*/,"")),p(!0);return}n({title:"Error",description:V.message||"Failed to upload file.",variant:"destructive"})}}),je=V=>{var U;const re=(U=V.target.files)==null?void 0:U[0];re&&oe.mutate(re),V.target.value=""},$e=V=>{j(V),N(V.name),C(V.content)},Ee=()=>{S&&A&&T&&q.mutate({docId:S.id,name:A,content:T})},fe=()=>{h==="text"&&o&&c?W.mutate({name:o,type:"text",content:c}):h==="url"&&o&&d&&W.mutate({name:o,type:"url",content:d,sourceUrl:d})},we=V=>{M.mutate(V)},K=O.watch();return i||!a&&$?s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx(Oe,{className:"h-10 w-48"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(Oe,{className:"h-96"}),s.jsx(Oe,{className:"h-96"})]})]}):s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(de,{href:"/agents",children:s.jsx(X,{variant:"ghost",size:"icon","data-testid":"button-back",children:s.jsx(_r,{className:"w-5 h-5"})})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h1",{className:"text-2xl font-bold","data-testid":"config-title",children:a?"Create New Agent":`Configure ${(k==null?void 0:k.name)||"Agent"}`}),s.jsx("p",{className:"text-muted-foreground",children:a?"Set up your new voice sales agent":"Update your agent's settings and training"})]}),!a&&s.jsx(de,{href:`/agents/${e}/test`,children:s.jsxs(X,{variant:"outline","data-testid":"button-test-agent",children:[s.jsx(tl,{className:"w-4 h-4 mr-2"}),"Test Agent"]})})]}),s.jsx(Hee,{...O,children:s.jsxs("form",{onSubmit:O.handleSubmit(we),className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx("div",{className:"space-y-6",children:s.jsxs(oN,{defaultValue:"basic",className:"w-full",children:[s.jsxs(Hy,{className:"grid w-full grid-cols-3",children:[s.jsxs(ai,{value:"basic","data-testid":"tab-basic",children:[s.jsx(ui,{className:"w-4 h-4 mr-2"}),"Basic"]}),s.jsxs(ai,{value:"widget","data-testid":"tab-widget",children:[s.jsx(hg,{className:"w-4 h-4 mr-2"}),"Widget"]}),s.jsxs(ai,{value:"training",disabled:a,"data-testid":"tab-training",children:[s.jsx(pc,{className:"w-4 h-4 mr-2"}),"Training"]})]}),s.jsx(si,{value:"basic",className:"space-y-4 mt-4",children:s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsxs(Re,{children:[s.jsx(De,{children:"Agent Details"}),s.jsx(dt,{children:"Configure your agent's identity and behavior"})]}),s.jsxs(ae,{className:"space-y-4",children:[s.jsx(na,{control:O.control,name:"name",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(es,{children:"Agent Name"}),s.jsx(ts,{children:s.jsx(Dt,{placeholder:"e.g., Sales Assistant",...V,"data-testid":"input-agent-name"})}),s.jsx(ns,{children:"This name will be shown to visitors in the chat widget"}),s.jsx(Ld,{})]})}),s.jsx(na,{control:O.control,name:"prompt",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(es,{children:"System Prompt"}),s.jsx(ts,{children:s.jsx(Po,{placeholder:"Describe how your agent should behave...",className:"min-h-32 resize-none",...V,"data-testid":"input-agent-prompt"})}),s.jsx(ns,{children:"Instructions that define your agent's personality and knowledge"}),s.jsx(Ld,{})]})}),s.jsx(na,{control:O.control,name:"greeting",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(es,{children:"Greeting Message"}),s.jsx(ts,{children:s.jsx(Po,{placeholder:"Hi! How can I help you today?",className:"min-h-20 resize-none",...V,"data-testid":"input-agent-greeting"})}),s.jsx(ns,{children:"The first message visitors see when they open the widget"}),s.jsx(Ld,{})]})}),s.jsx(na,{control:O.control,name:"voiceType",render:({field:V})=>{const re=g==="all"?Ik:Ik.filter(U=>U.gender===g);return s.jsxs(Ai,{children:[s.jsx(es,{children:"Voice Type"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-1 p-1 bg-muted/50 rounded-lg w-fit",children:[s.jsx("button",{type:"button",onClick:()=>w("all"),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${g==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"filter-voice-all",children:"All"}),s.jsx("button",{type:"button",onClick:()=>w("female"),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${g==="female"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"filter-voice-female",children:"Female"}),s.jsx("button",{type:"button",onClick:()=>w("male"),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${g==="male"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"filter-voice-male",children:"Male"})]}),s.jsxs(wa,{onValueChange:V.onChange,value:V.value,children:[s.jsx(ts,{children:s.jsx(Li,{"data-testid":"select-voice-type",children:s.jsx(ja,{placeholder:"Select a voice"})})}),s.jsx(Fi,{children:re.map(U=>s.jsx(Et,{value:U.value,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:U.label}),s.jsx(Me,{variant:"outline",className:"text-xs",children:U.gender==="male"?"M":"F"})]})},U.value))})]})]}),s.jsx(ns,{children:"Choose a voice that matches your brand personality"}),s.jsx(Ld,{})]})}}),s.jsx(na,{control:O.control,name:"isActive",render:({field:V})=>s.jsxs(Ai,{className:"flex items-center justify-between rounded-lg border border-border p-4",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(es,{className:"text-base",children:"Active Status"}),s.jsx(ns,{children:"Enable or disable this agent on your website"})]}),s.jsx(ts,{children:s.jsx(tf,{checked:V.value,onCheckedChange:V.onChange,"data-testid":"switch-active"})})]})})]})]})}),s.jsx(si,{value:"widget",className:"space-y-4 mt-4",children:s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsxs(Re,{children:[s.jsx(De,{children:"Widget Appearance"}),s.jsx(dt,{children:"Customize how the widget looks on your website"})]}),s.jsxs(ae,{className:"space-y-4",children:[s.jsx(na,{control:O.control,name:"widgetPrimaryColor",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(_k,{label:"Primary Color",value:V.value,onChange:V.onChange}),s.jsx(ns,{children:"Main color for the widget button and header"})]})}),s.jsx(na,{control:O.control,name:"widgetSecondaryColor",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(_k,{label:"Secondary Color",value:V.value,onChange:V.onChange}),s.jsx(ns,{children:"Accent color for gradients and highlights"})]})}),s.jsx(na,{control:O.control,name:"widgetPosition",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(es,{children:"Widget Position"}),s.jsxs(wa,{onValueChange:V.onChange,defaultValue:V.value,children:[s.jsx(ts,{children:s.jsx(Li,{"data-testid":"select-position",children:s.jsx(ja,{placeholder:"Select position"})})}),s.jsxs(Fi,{children:[s.jsx(Et,{value:"bottom-right",children:"Bottom Right"}),s.jsx(Et,{value:"bottom-left",children:"Bottom Left"})]})]})]})}),s.jsx(na,{control:O.control,name:"widgetSize",render:({field:V})=>s.jsxs(Ai,{children:[s.jsx(es,{children:"Widget Size"}),s.jsxs(wa,{onValueChange:V.onChange,defaultValue:V.value,children:[s.jsx(ts,{children:s.jsx(Li,{"data-testid":"select-size",children:s.jsx(ja,{placeholder:"Select size"})})}),s.jsxs(Fi,{children:[s.jsx(Et,{value:"small",children:"Small"}),s.jsx(Et,{value:"medium",children:"Medium"}),s.jsx(Et,{value:"large",children:"Large"})]})]})]})})]})]})}),s.jsx(si,{value:"training",className:"space-y-4 mt-4",children:s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsxs(Re,{children:[s.jsx(De,{children:"Training Documents"}),s.jsx(dt,{children:"Add content to train your agent about your products and services. Supports text, URLs, PDFs, and images."})]}),s.jsxs(ae,{className:"space-y-4",children:[S&&s.jsxs("div",{className:"space-y-3 p-4 rounded-lg border-2 border-primary bg-primary/5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Kt,{className:"text-base font-semibold",children:"Edit Document"}),s.jsx(X,{type:"button",variant:"ghost",size:"icon",onClick:()=>{j(null),N(""),C("")},children:s.jsx(zo,{className:"w-4 h-4"})})]}),s.jsx(Dt,{placeholder:"Document name",value:A,onChange:V=>N(V.target.value),"data-testid":"input-edit-doc-name"}),s.jsx(Po,{placeholder:"Document content...",value:T,onChange:V=>C(V.target.value),className:"min-h-32 resize-none","data-testid":"input-edit-doc-content"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(X,{type:"button",onClick:Ee,disabled:q.isPending||!A||!T,className:"gradient-primary border-0","data-testid":"button-save-edit-doc",children:q.isPending?"Saving...":"Save Changes"}),s.jsx(X,{type:"button",variant:"outline",onClick:()=>{j(null),N(""),C("")},children:"Cancel"})]})]}),!S&&s.jsx(s.Fragment,{children:F?s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{className:"h-12 w-full"}),s.jsx(Oe,{className:"h-12 w-full"})]}):I&&I.length>0?s.jsx("div",{className:"space-y-2",children:I.map(V=>s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50 border border-border",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[V.type==="url"?s.jsx(LP,{className:"w-4 h-4 text-muted-foreground"}):V.type==="file"?V.fileType==="pdf"?s.jsx(e9,{className:"w-4 h-4 text-red-500"}):V.fileType==="image"?s.jsx(t9,{className:"w-4 h-4 text-blue-500"}):s.jsx(DP,{className:"w-4 h-4 text-muted-foreground"}):s.jsx(pc,{className:"w-4 h-4 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:V.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:V.type==="url"?V.sourceUrl:V.type==="file"?`${V.fileName||"File"} - ${Math.round(V.fileSize/1024)}KB`:`${V.content.length} characters`})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(X,{variant:"ghost",size:"icon",onClick:()=>$e(V),disabled:Y.isPending,"data-testid":`button-edit-doc-${V.id}`,children:s.jsx(N$,{className:"w-4 h-4"})}),s.jsx(X,{variant:"ghost",size:"icon",onClick:()=>Y.mutate(V.id),disabled:Y.isPending,"data-testid":`button-delete-doc-${V.id}`,children:s.jsx(zo,{className:"w-4 h-4"})})]})]},V.id))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No training documents yet. Add some content below."})}),s.jsx("input",{type:"file",id:"file-upload",className:"hidden",accept:".pdf,.txt,.jpg,.jpeg,.png,.gif,.webp",onChange:je,"data-testid":"input-file-upload"}),!S&&h===null?s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(X,{type:"button",variant:"outline",onClick:()=>m("text"),"data-testid":"button-add-text",children:[s.jsx(pc,{className:"w-4 h-4 mr-2"}),"Add Text"]}),s.jsxs(X,{type:"button",variant:"outline",onClick:()=>m("url"),"data-testid":"button-add-url",children:[s.jsx(LP,{className:"w-4 h-4 mr-2"}),"Add URL"]}),s.jsxs(X,{type:"button",variant:"outline",onClick:()=>{var V;return(V=document.getElementById("file-upload"))==null?void 0:V.click()},disabled:E,"data-testid":"button-upload-file",children:[s.jsx(DP,{className:"w-4 h-4 mr-2"}),E?"Uploading...":"Upload File"]})]}):!S&&s.jsxs("div",{className:"space-y-3 p-4 rounded-lg border border-border",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Kt,{children:["Add ",h==="text"?"Text Content":"URL"]}),s.jsx(X,{type:"button",variant:"ghost",size:"icon",onClick:()=>{m(null),l(""),u(""),f("")},children:s.jsx(zo,{className:"w-4 h-4"})})]}),s.jsx(Dt,{placeholder:"Document name",value:o,onChange:V=>l(V.target.value),"data-testid":"input-doc-name"}),h==="text"?s.jsx(Po,{placeholder:"Paste your content here...",value:c,onChange:V=>u(V.target.value),className:"min-h-24 resize-none","data-testid":"input-doc-content"}):s.jsx(Dt,{placeholder:"https://example.com/page",value:d,onChange:V=>f(V.target.value),"data-testid":"input-doc-url"}),s.jsx(X,{type:"button",onClick:fe,disabled:W.isPending,className:"gradient-primary border-0","data-testid":"button-save-doc",children:W.isPending?"Adding...":"Add Document"})]})]})]})})]})}),s.jsx("div",{className:"space-y-6",children:s.jsxs(ie,{className:"bg-card border-card-border sticky top-6",children:[s.jsxs(Re,{children:[s.jsx(De,{children:"Live Preview"}),s.jsx(dt,{children:"See how your widget will look on your website"})]}),s.jsx(ae,{children:s.jsx(L5,{agentName:K.name||"Sales Assistant",greeting:K.greeting||"Hi! How can I help you?",primaryColor:K.widgetPrimaryColor,secondaryColor:K.widgetSecondaryColor,position:K.widgetPosition,showBubble:!0})})]})})]}),s.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-border",children:[s.jsx(de,{href:"/agents",children:s.jsx(X,{type:"button",variant:"outline","data-testid":"button-cancel",children:"Cancel"})}),s.jsxs(X,{type:"submit",className:"gradient-primary border-0",disabled:M.isPending,"data-testid":"button-save",children:[s.jsx(u9,{className:"w-4 h-4 mr-2"}),M.isPending?"Saving...":a?"Create Agent":"Save Changes"]})]})]})}),s.jsx(aee,{open:y,onOpenChange:p,title:"Plan Limit Reached",description:b||"You've reached the limit of your current plan. Upgrade to unlock more features."})]})}function ute(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var dN="ScrollArea",[F5,R_e]=rn(dN),[dte,Fr]=F5(dN),B5=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=v.useState(null),[u,d]=v.useState(null),[f,h]=v.useState(null),[m,y]=v.useState(null),[p,b]=v.useState(null),[x,g]=v.useState(0),[w,S]=v.useState(0),[j,A]=v.useState(!1),[N,T]=v.useState(!1),C=ke(t,P=>c(P)),E=Bu(i);return s.jsx(dte,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:j,onScrollbarXEnabledChange:A,scrollbarY:p,onScrollbarYChange:b,scrollbarYEnabled:N,onScrollbarYEnabledChange:T,onCornerWidthChange:g,onCornerHeightChange:S,children:s.jsx(ye.div,{dir:E,...o,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});B5.displayName=dN;var V5="ScrollAreaViewport",W5=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Fr(V5,n),l=v.useRef(null),c=ke(t,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),s.jsx(ye.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});W5.displayName=V5;var Qi="ScrollAreaScrollbar",fN=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fr(Qi,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return v.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?s.jsx(fte,{...r,ref:t,forceMount:n}):i.type==="scroll"?s.jsx(hte,{...r,ref:t,forceMount:n}):i.type==="auto"?s.jsx(z5,{...r,ref:t,forceMount:n}):i.type==="always"?s.jsx(hN,{...r,ref:t}):null});fN.displayName=Qi;var fte=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fr(Qi,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),s.jsx(an,{present:n||a,children:s.jsx(z5,{"data-state":a?"visible":"hidden",...r,ref:t})})}),hte=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fr(Qi,e.__scopeScrollArea),a=e.orientation==="horizontal",o=Zy(()=>c("SCROLL_END"),100),[l,c]=ute("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,i.scrollHideDelay,c]),v.useEffect(()=>{const u=i.viewport,d=a?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),o()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,a,c,o]),s.jsx(an,{present:n||l!=="hidden",children:s.jsx(hN,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ee(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ee(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),z5=v.forwardRef((e,t)=>{const n=Fr(Qi,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=v.useState(!1),l=e.orientation==="horizontal",c=Zy(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=Fr(Qi,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[l,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Y5(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,m){return xte(h,o.current,l,m)}return n==="horizontal"?s.jsx(mte,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const h=i.viewport.scrollLeft,m=Mk(h,l,i.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?s.jsx(pte,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const h=i.viewport.scrollTop,m=Mk(h,l);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),mte=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Fr(Qi,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=ke(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(H5,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Xy(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),X5(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Bg(o.paddingLeft),paddingEnd:Bg(o.paddingRight)}})}})}),pte=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Fr(Qi,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=ke(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(H5,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Xy(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),X5(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Bg(o.paddingTop),paddingEnd:Bg(o.paddingBottom)}})}})}),[gte,U5]=F5(Qi),H5=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,m=Fr(Qi,n),[y,p]=v.useState(null),b=ke(t,C=>p(C)),x=v.useRef(null),g=v.useRef(""),w=m.viewport,S=r.content-r.viewport,j=yt(d),A=yt(c),N=Zy(f,10);function T(C){if(x.current){const E=C.clientX-x.current.left,P=C.clientY-x.current.top;u({x:E,y:P})}}return v.useEffect(()=>{const C=E=>{const P=E.target;(y==null?void 0:y.contains(P))&&j(E,S)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[w,y,S,j]),v.useEffect(A,[r,A]),ru(y,N),ru(m.content,N),s.jsx(gte,{scope:n,scrollbar:y,hasThumb:i,onThumbChange:yt(a),onThumbPointerUp:yt(o),onThumbPositionChange:A,onThumbPointerDown:yt(l),children:s.jsx(ye.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:ee(e.onPointerDown,C=>{C.button===0&&(C.target.setPointerCapture(C.pointerId),x.current=y.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),T(C))}),onPointerMove:ee(e.onPointerMove,T),onPointerUp:ee(e.onPointerUp,C=>{const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),Fg="ScrollAreaThumb",q5=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=U5(Fg,e.__scopeScrollArea);return s.jsx(an,{present:n||i.hasThumb,children:s.jsx(vte,{ref:t,...r})})}),vte=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Fr(Fg,n),o=U5(Fg,n),{onThumbPositionChange:l}=o,c=ke(t,f=>o.onThumbChange(f)),u=v.useRef(void 0),d=Zy(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const f=a.viewport;if(f){const h=()=>{if(d(),!u.current){const m=bte(f,l);u.current=m,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[a.viewport,d,l]),s.jsx(ye.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ee(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),y=f.clientX-m.left,p=f.clientY-m.top;o.onThumbPointerDown({x:y,y:p})}),onPointerUp:ee(e.onPointerUp,o.onThumbPointerUp)})});q5.displayName=Fg;var mN="ScrollAreaCorner",G5=v.forwardRef((e,t)=>{const n=Fr(mN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(yte,{...e,ref:t}):null});G5.displayName=mN;var yte=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Fr(mN,n),[a,o]=v.useState(0),[l,c]=v.useState(0),u=!!(a&&l);return ru(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),ru(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?s.jsx(ye.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bg(e){return e?parseInt(e,10):0}function Y5(e,t){const n=e/t;return isNaN(n)?0:n}function Xy(e){const t=Y5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xte(e,t,n,r="ltr"){const i=Xy(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return K5([c,u],f)(e)}function Mk(e,t,n="ltr"){const r=Xy(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=r1(e,c);return K5([0,o],[0,l])(u)}function K5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function X5(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Zy(e,t){const n=yt(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ru(e,t){const n=yt(t);Ft(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Z5=B5,wte=W5,jte=G5;const fm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Z5,{ref:r,className:Q("relative overflow-hidden",e),...n,children:[s.jsx(wte,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(Q5,{}),s.jsx(jte,{})]}));fm.displayName=Z5.displayName;const Q5=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(fN,{ref:r,orientation:t,className:Q("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(q5,{className:"relative flex-1 rounded-full bg-border"})}));Q5.displayName=fN.displayName;function Ste(){const{id:e}=Kh(),{toast:t}=Pn(),{isAuthenticated:n,isLoading:r}=Zi(),[i,a]=v.useState([]),[o,l]=v.useState("disconnected"),[c,u]=v.useState("idle"),[d,f]=v.useState(!1),[h,m]=v.useState(!1),[y,p]=v.useState(""),b=v.useRef(null),x=v.useRef(null),g=v.useRef(null),w=v.useRef(null),S=v.useRef(null),j=v.useRef(null);v.useEffect(()=>{!r&&!n&&(t({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500))},[n,r,t]);const{data:A,isLoading:N}=$t({queryKey:["/api/agents",e],enabled:n&&!!e});v.useEffect(()=>{b.current&&(b.current.scrollTop=b.current.scrollHeight)},[i]);const T=v.useCallback((R,B)=>{a(O=>[...O,{id:Date.now().toString(),role:R,content:B,timestamp:new Date}])},[]);v.useCallback(R=>{a(B=>{const O=B.length-1;return O>=0&&B[O].role==="assistant"?[...B.slice(0,O),{...B[O],content:R}]:B})},[]);const C=v.useCallback(async()=>{if(e){l("connecting"),u("processing");try{const R=await zt("POST",`/api/agents/${e}/realtime-session`);if(!R.ok){const we=await R.json();if(we.code==="MISSING_API_KEY"){t({title:"API Key Required",description:"Please add your OpenAI API key in Settings to use voice features.",variant:"destructive"}),l("error"),u("idle");return}throw new Error(we.message||"Failed to start session")}const B=await R.json(),O=B.client_secret.value,M=new RTCPeerConnection;x.current=M,M.onconnectionstatechange=()=>{console.log("Connection state:",M.connectionState)},M.oniceconnectionstatechange=()=>{console.log("ICE connection state:",M.iceConnectionState)},M.onicegatheringstatechange=()=>{console.log("ICE gathering state:",M.iceGatheringState)};const W=document.createElement("audio");W.autoplay=!0,W.playsInline=!0,W.style.display="none",document.body.appendChild(W),w.current=W,M.ontrack=we=>{console.log("Received remote audio track:",we.track.kind),W.srcObject=we.streams[0],W.play().catch(K=>{console.error("Audio play error:",K)})};const Y=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:24e3}});S.current=Y,Y.getTracks().forEach(we=>{M.addTrack(we,Y)});const q=M.createDataChannel("oai-events");g.current=q,q.onopen=()=>{console.log("Data channel opened"),l("connected"),m(!0),j.current=Date.now(),B.agent.greeting&&(q.send(JSON.stringify({type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:"Hello, please greet me and introduce yourself."}]}})),q.send(JSON.stringify({type:"response.create",response:{modalities:["audio","text"]}})))},q.onmessage=we=>{const K=JSON.parse(we.data);E(K)},q.onerror=we=>{console.error("Data channel error:",we)},q.onclose=()=>{console.log("Data channel closed"),l("disconnected"),m(!1)};const oe=await M.createOffer();await M.setLocalDescription(oe);const Ee=await fetch("https://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-12-17",{method:"POST",headers:{Authorization:`Bearer ${O}`,"Content-Type":"application/sdp"},body:oe.sdp});if(!Ee.ok)throw new Error("Failed to exchange SDP with OpenAI");const fe=await Ee.text();await M.setRemoteDescription({type:"answer",sdp:fe}),u("listening")}catch(R){console.error("Error starting realtime session:",R),t({title:"Connection Error",description:R instanceof Error?R.message:"Failed to connect to voice service",variant:"destructive"}),l("error"),u("idle")}}},[e,t]),E=v.useCallback(R=>{var O;const B=R.type;switch(console.log("Realtime event:",B,R),B){case"session.created":case"session.updated":console.log("Session event:",B);break;case"input_audio_buffer.speech_started":u("listening"),p("");break;case"input_audio_buffer.speech_stopped":u("processing");break;case"conversation.item.input_audio_transcription.completed":R.transcript&&T("user",R.transcript);break;case"response.audio_transcript.delta":p(M=>M+(R.delta||""));break;case"response.audio_transcript.done":R.transcript&&T("assistant",R.transcript),p("");break;case"response.audio.delta":u("speaking");break;case"response.output_item.added":case"response.content_part.added":console.log("Response content:",B);break;case"response.done":u("listening");break;case"error":console.error("Realtime API error:",R.error),t({title:"Error",description:((O=R.error)==null?void 0:O.message)||"An error occurred",variant:"destructive"});break}},[T,t]),P=v.useCallback(()=>{if(j.current&&e){const R=Math.floor((Date.now()-j.current)/1e3);R>0&&zt("POST","/api/usage/track",{agentId:e,durationSeconds:R}).catch(B=>{console.error("Failed to track usage:",B)}),j.current=null}g.current&&(g.current.close(),g.current=null),x.current&&(x.current.close(),x.current=null),S.current&&(S.current.getTracks().forEach(R=>R.stop()),S.current=null),w.current&&(w.current.srcObject=null,w.current.parentNode&&w.current.parentNode.removeChild(w.current),w.current=null),l("disconnected"),u("idle"),m(!1),p("")},[e]),k=v.useCallback(()=>{h?P():C()},[h,C,P]),$=v.useCallback(()=>{a([]),h&&P()},[h,P]);v.useEffect(()=>()=>{P()},[P]),v.useEffect(()=>{S.current&&S.current.getAudioTracks().forEach(R=>{R.enabled=!d}),w.current&&(w.current.muted=d)},[d]);const I=()=>{if(o==="connecting")return"Connecting...";switch(c){case"listening":return"Listening... (speak now)";case"processing":return"Processing...";case"speaking":return"Speaking...";default:return h?"Connected":"Click the mic to start"}},F=()=>{if(o==="connecting")return"text-yellow-500";if(o==="error")return"text-destructive";switch(c){case"listening":return"text-primary";case"processing":return"text-yellow-500";case"speaking":return"text-green-500";default:return"text-muted-foreground"}};return r||N?s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx(Oe,{className:"h-10 w-48"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(Oe,{className:"h-96"})}),s.jsx(Oe,{className:"h-96"})]})]}):s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(de,{href:`/agents/${e}`,children:s.jsx(X,{variant:"ghost",size:"icon","data-testid":"button-back",children:s.jsx(_r,{className:"w-5 h-5"})})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("h1",{className:"text-2xl font-bold","data-testid":"test-title",children:["Test ",(A==null?void 0:A.name)||"Agent"]}),s.jsx(Me,{variant:o==="connected"?"default":o==="error"?"destructive":"secondary",children:o==="connected"?"Live":o==="connecting"?"Connecting":o==="error"?"Error":"Ready"})]}),s.jsx("p",{className:"text-muted-foreground",children:"Have a live voice conversation with your agent"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{href:`/agents/${e}`,children:s.jsxs(X,{variant:"outline","data-testid":"button-settings",children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),"Settings"]})}),s.jsx(de,{href:`/agents/${e}/embed`,children:s.jsxs(X,{className:"gradient-primary border-0","data-testid":"button-get-code",children:[s.jsx(nl,{className:"w-4 h-4 mr-2"}),"Get Code"]})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[s.jsx(ie,{className:"bg-card border-card-border",children:s.jsx(ae,{className:"p-8",children:s.jsxs("div",{className:"flex flex-col items-center justify-center",children:[s.jsxs("div",{className:"relative mb-8",children:[s.jsx("div",{className:`absolute inset-0 rounded-full transition-all duration-300 ${c!=="idle"&&h?"animate-pulse":""}`,style:{transform:"scale(1.5)",backgroundColor:c!=="idle"&&h?`${(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"}15`:"transparent"}}),s.jsx("div",{className:`absolute inset-0 rounded-full transition-all duration-300 ${c!=="idle"&&h?"animate-ping":""}`,style:{transform:"scale(1.3)",backgroundColor:c!=="idle"&&h?`${(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"}20`:"transparent",animationDuration:"1.5s"}}),s.jsx("button",{onClick:k,disabled:o==="connecting",className:`relative w-28 h-28 rounded-full flex items-center justify-center transition-all duration-300 ${h&&c==="listening"?"scale-110":o==="connecting"?"opacity-70 cursor-wait":"hover:scale-105"}`,style:{background:h?`linear-gradient(135deg, ${(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"} 0%, ${(A==null?void 0:A.widgetSecondaryColor)||"#FFB81C"} 100%)`:`linear-gradient(135deg, ${(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"}80 0%, ${(A==null?void 0:A.widgetSecondaryColor)||"#FFB81C"}80 100%)`,boxShadow:h?`0 0 40px ${(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"}60`:void 0},"data-testid":"button-mic",children:o==="connecting"?s.jsx(ss,{className:"w-10 h-10 text-white animate-spin"}):h&&c==="listening"?s.jsx(jg,{isActive:!0,color:"white",size:"lg"}):h&&c==="speaking"?s.jsx(BP,{className:"w-10 h-10 text-white animate-pulse"}):s.jsx(rl,{className:"w-10 h-10 text-white"})})]}),s.jsx("p",{className:`text-lg font-medium mb-2 ${F()}`,"data-testid":"status-text",children:I()}),y&&s.jsxs("p",{className:"text-sm text-muted-foreground italic max-w-md text-center",children:['"',y,'"']}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:h?"Click mic to end session":"Click mic to start voice chat"}),s.jsxs("div",{className:"flex items-center gap-4 mt-6",children:[s.jsx(X,{variant:"outline",size:"icon",onClick:()=>f(!d),disabled:!h,"data-testid":"button-mute",children:d?s.jsx(y9,{className:"w-4 h-4"}):s.jsx(BP,{className:"w-4 h-4"})}),s.jsxs(X,{variant:"outline",onClick:$,"data-testid":"button-clear",children:[s.jsx(c9,{className:"w-4 h-4 mr-2"}),"Clear"]})]})]})})}),s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsxs(Re,{children:[s.jsx(De,{children:"Conversation"}),s.jsx(dt,{children:"Voice conversation transcript"})]}),s.jsx(ae,{children:s.jsx(fm,{className:"h-64",ref:b,children:i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:[s.jsx(rl,{className:"w-12 h-12 text-muted-foreground/30 mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"No messages yet. Click the mic button to start a conversation."})]}):s.jsx("div",{className:"space-y-4 pr-4",children:i.map(R=>s.jsx("div",{className:`flex ${R.role==="user"?"justify-end":"justify-start"}`,children:s.jsxs("div",{className:`max-w-[80%] rounded-xl px-4 py-2 ${R.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,"data-testid":`message-${R.id}`,children:[s.jsx("p",{className:"text-sm",children:R.content}),s.jsx("p",{className:`text-xs mt-1 ${R.role==="user"?"text-primary-foreground/70":"text-muted-foreground"}`,children:R.timestamp.toLocaleTimeString()})]})},R.id))})})})]})]}),s.jsxs("div",{className:"space-y-6",children:[o==="error"&&s.jsx(ie,{className:"bg-yellow-500/10 border-yellow-500/30",children:s.jsx(ae,{className:"p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(wl,{className:"w-5 h-5 text-yellow-500 shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-yellow-500",children:"Setup Required"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Add your OpenAI API key in"," ",s.jsx(de,{href:"/settings",className:"text-primary hover:underline",children:"Settings"})," ","to enable real-time voice conversations."]})]})]})})}),s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsx(Re,{children:s.jsx(De,{children:"Agent Details"})}),s.jsxs(ae,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Name"}),s.jsx("p",{className:"font-medium",children:A==null?void 0:A.name})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Voice"}),s.jsx("p",{className:"font-medium capitalize",children:(A==null?void 0:A.voiceType)||"Alloy"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Status"}),s.jsx(Me,{variant:A!=null&&A.isActive?"default":"secondary",children:A!=null&&A.isActive?"Active":"Inactive"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Widget Colors"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("div",{className:"w-8 h-8 rounded-md border border-border",style:{backgroundColor:(A==null?void 0:A.widgetPrimaryColor)||"#FF6B35"}}),s.jsx("div",{className:"w-8 h-8 rounded-md border border-border",style:{backgroundColor:(A==null?void 0:A.widgetSecondaryColor)||"#FFB81C"}})]})]})]})]}),s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsx(Re,{children:s.jsx(De,{children:"Greeting Message"})}),s.jsx(ae,{children:s.jsx("p",{className:"text-sm text-muted-foreground",children:(A==null?void 0:A.greeting)||"No greeting configured"})})]}),s.jsxs(ie,{className:"bg-card border-card-border",children:[s.jsx(Re,{children:s.jsx(De,{children:"How It Works"})}),s.jsxs(ae,{className:"space-y-3 text-sm text-muted-foreground",children:[s.jsx("p",{children:"1. Click the mic to start a voice session"}),s.jsx("p",{children:"2. The agent will greet you automatically"}),s.jsx("p",{children:"3. Speak naturally - the agent listens and responds"}),s.jsx("p",{children:"4. Click the mic again to end the session"})]})]})]})]})]})}function Ate(){const{id:e}=Kh(),{toast:t}=Pn(),{isAuthenticated:n,isLoading:r}=Zi(),[i,a]=v.useState(!1),[o,l]=v.useState(!1),[c,u]=v.useState("");v.useEffect(()=>{!r&&!n&&(t({title:"Unauthorized",description:"You are logged out. Logging in again...",variant:"destructive"}),setTimeout(()=>{window.location.href="/api/login"},500))},[n,r,t]);const{data:d,isLoading:f}=$t({queryKey:["/api/agents",e],enabled:n&&!!e}),h=`