@crmy/web 0.5.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
var M3=Object.defineProperty;var Xb=e=>{throw TypeError(e)};var D3=(e,t,n)=>t in e?M3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var be=(e,t,n)=>D3(e,typeof t!="symbol"?t+"":t,n),np=(e,t,n)=>t.has(e)||Xb("Cannot "+n);var W=(e,t,n)=>(np(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?Xb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(np(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),qe=(e,t,n)=>(np(e,t,"access private method"),n);var cd=(e,t,n,r)=>({set _(a){ye(e,t,a,n)},get _(){return W(e,t,r)}});function R3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Ng(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rp={exports:{}},ql={},sp={exports:{}},Ke={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Zb;function O3(){if(Zb)return Ke;Zb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,j={};function N(B,L,G){this.props=B,this.context=L,this.refs=j,this.updater=G||y}N.prototype.isReactComponent={},N.prototype.setState=function(B,L){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,L,"setState")},N.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function _(){}_.prototype=N.prototype;function w(B,L,G){this.props=B,this.context=L,this.refs=j,this.updater=G||y}var S=w.prototype=new _;S.constructor=w,k(S,N.prototype),S.isPureReactComponent=!0;var E=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function D(B,L,G){var se,ae={},ue=null,oe=null;if(L!=null)for(se in L.ref!==void 0&&(oe=L.ref),L.key!==void 0&&(ue=""+L.key),L)P.call(L,se)&&!M.hasOwnProperty(se)&&(ae[se]=L[se]);var he=arguments.length-2;if(he===1)ae.children=G;else if(1<he){for(var ge=Array(he),Ce=0;Ce<he;Ce++)ge[Ce]=arguments[Ce+2];ae.children=ge}if(B&&B.defaultProps)for(se in he=B.defaultProps,he)ae[se]===void 0&&(ae[se]=he[se]);return{$$typeof:e,type:B,key:ue,ref:oe,props:ae,_owner:T.current}}function q(B,L){return{$$typeof:e,type:B.type,key:L,ref:B.ref,props:B.props,_owner:B._owner}}function H(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function I(B){var L={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(G){return L[G]})}var F=/\/+/g;function te(B,L){return typeof B=="object"&&B!==null&&B.key!=null?I(""+B.key):L.toString(36)}function Y(B,L,G,se,ae){var ue=typeof B;(ue==="undefined"||ue==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(ue){case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case e:case t:oe=!0}}if(oe)return oe=B,ae=ae(oe),B=se===""?"."+te(oe,0):se,E(ae)?(G="",B!=null&&(G=B.replace(F,"$&/")+"/"),Y(ae,L,G,"",function(Ce){return Ce})):ae!=null&&(H(ae)&&(ae=q(ae,G+(!ae.key||oe&&oe.key===ae.key?"":(""+ae.key).replace(F,"$&/")+"/")+B)),L.push(ae)),1;if(oe=0,se=se===""?".":se+":",E(B))for(var he=0;he<B.length;he++){ue=B[he];var ge=se+te(ue,he);oe+=Y(ue,L,G,ge,ae)}else if(ge=v(B),typeof ge=="function")for(B=ge.call(B),he=0;!(ue=B.next()).done;)ue=ue.value,ge=se+te(ue,he++),oe+=Y(ue,L,G,ge,ae);else if(ue==="object")throw L=String(B),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return oe}function O(B,L,G){if(B==null)return B;var se=[],ae=0;return Y(B,se,"","",function(ue){return L.call(G,ue,ae++)}),se}function U(B){if(B._status===-1){var L=B._result;L=L(),L.then(function(G){(B._status===0||B._status===-1)&&(B._status=1,B._result=G)},function(G){(B._status===0||B._status===-1)&&(B._status=2,B._result=G)}),B._status===-1&&(B._status=0,B._result=L)}if(B._status===1)return B._result.default;throw B._result}var $={current:null},R={transition:null},z={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:R,ReactCurrentOwner:T};function X(){throw Error("act(...) is not supported in production builds of React.")}return Ke.Children={map:O,forEach:function(B,L,G){O(B,function(){L.apply(this,arguments)},G)},count:function(B){var L=0;return O(B,function(){L++}),L},toArray:function(B){return O(B,function(L){return L})||[]},only:function(B){if(!H(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Ke.Component=N,Ke.Fragment=n,Ke.Profiler=a,Ke.PureComponent=w,Ke.StrictMode=r,Ke.Suspense=f,Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z,Ke.act=X,Ke.cloneElement=function(B,L,G){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var se=k({},B.props),ae=B.key,ue=B.ref,oe=B._owner;if(L!=null){if(L.ref!==void 0&&(ue=L.ref,oe=T.current),L.key!==void 0&&(ae=""+L.key),B.type&&B.type.defaultProps)var he=B.type.defaultProps;for(ge in L)P.call(L,ge)&&!M.hasOwnProperty(ge)&&(se[ge]=L[ge]===void 0&&he!==void 0?he[ge]:L[ge])}var ge=arguments.length-2;if(ge===1)se.children=G;else if(1<ge){he=Array(ge);for(var Ce=0;Ce<ge;Ce++)he[Ce]=arguments[Ce+2];se.children=he}return{$$typeof:e,type:B.type,key:ae,ref:ue,props:se,_owner:oe}},Ke.createContext=function(B){return B={$$typeof:c,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:l,_context:B},B.Consumer=B},Ke.createElement=D,Ke.createFactory=function(B){var L=D.bind(null,B);return L.type=B,L},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(B){return{$$typeof:u,render:B}},Ke.isValidElement=H,Ke.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:U}},Ke.memo=function(B,L){return{$$typeof:m,type:B,compare:L===void 0?null:L}},Ke.startTransition=function(B){var L=R.transition;R.transition={};try{B()}finally{R.transition=L}},Ke.unstable_act=X,Ke.useCallback=function(B,L){return $.current.useCallback(B,L)},Ke.useContext=function(B){return $.current.useContext(B)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(B){return $.current.useDeferredValue(B)},Ke.useEffect=function(B,L){return $.current.useEffect(B,L)},Ke.useId=function(){return $.current.useId()},Ke.useImperativeHandle=function(B,L,G){return $.current.useImperativeHandle(B,L,G)},Ke.useInsertionEffect=function(B,L){return $.current.useInsertionEffect(B,L)},Ke.useLayoutEffect=function(B,L){return $.current.useLayoutEffect(B,L)},Ke.useMemo=function(B,L){return $.current.useMemo(B,L)},Ke.useReducer=function(B,L,G){return $.current.useReducer(B,L,G)},Ke.useRef=function(B){return $.current.useRef(B)},Ke.useState=function(B){return $.current.useState(B)},Ke.useSyncExternalStore=function(B,L,G){return $.current.useSyncExternalStore(B,L,G)},Ke.useTransition=function(){return $.current.useTransition()},Ke.version="18.3.1",Ke}var Jb;function Cg(){return Jb||(Jb=1,sp.exports=O3()),sp.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ew;function I3(){if(ew)return ql;ew=1;var e=Cg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(u,f,m){var p,g={},v=null,y=null;m!==void 0&&(v=""+m),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(y=f.ref);for(p in f)r.call(f,p)&&!l.hasOwnProperty(p)&&(g[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:t,type:u,key:v,ref:y,props:g,_owner:a.current}}return ql.Fragment=n,ql.jsx=c,ql.jsxs=c,ql}var tw;function L3(){return tw||(tw=1,rp.exports=I3()),rp.exports}var s=L3(),x=Cg();const fe=Ng(x),Mf=R3({__proto__:null,default:fe},[x]);var ud={},op={exports:{}},On={},ap={exports:{}},ip={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var nw;function F3(){return nw||(nw=1,(function(e){function t(R,z){var X=R.length;R.push(z);e:for(;0<X;){var B=X-1>>>1,L=R[B];if(0<a(L,z))R[B]=z,R[X]=L,X=B;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],X=R.pop();if(X!==z){R[0]=X;e:for(var B=0,L=R.length,G=L>>>1;B<G;){var se=2*(B+1)-1,ae=R[se],ue=se+1,oe=R[ue];if(0>a(ae,X))ue<L&&0>a(oe,ae)?(R[B]=oe,R[ue]=X,B=ue):(R[B]=ae,R[se]=X,B=se);else if(ue<L&&0>a(oe,X))R[B]=oe,R[ue]=X,B=ue;else break e}}return z}function a(R,z){var X=R.sortIndex-z.sortIndex;return X!==0?X:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],m=[],p=1,g=null,v=3,y=!1,k=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(R){for(var z=n(m);z!==null;){if(z.callback===null)r(m);else if(z.startTime<=R)r(m),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(m)}}function E(R){if(j=!1,S(R),!k)if(n(f)!==null)k=!0,U(P);else{var z=n(m);z!==null&&$(E,z.startTime-R)}}function P(R,z){k=!1,j&&(j=!1,_(D),D=-1),y=!0;var X=v;try{for(S(z),g=n(f);g!==null&&(!(g.expirationTime>z)||R&&!I());){var B=g.callback;if(typeof B=="function"){g.callback=null,v=g.priorityLevel;var L=B(g.expirationTime<=z);z=e.unstable_now(),typeof L=="function"?g.callback=L:g===n(f)&&r(f),S(z)}else r(f);g=n(f)}if(g!==null)var G=!0;else{var se=n(m);se!==null&&$(E,se.startTime-z),G=!1}return G}finally{g=null,v=X,y=!1}}var T=!1,M=null,D=-1,q=5,H=-1;function I(){return!(e.unstable_now()-H<q)}function F(){if(M!==null){var R=e.unstable_now();H=R;var z=!0;try{z=M(!0,R)}finally{z?te():(T=!1,M=null)}}else T=!1}var te;if(typeof w=="function")te=function(){w(F)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,O=Y.port2;Y.port1.onmessage=F,te=function(){O.postMessage(null)}}else te=function(){N(F,0)};function U(R){M=R,T||(T=!0,te())}function $(R,z){D=N(function(){R(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){k||y||(k=!0,U(P))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(R){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var X=v;v=z;try{return R()}finally{v=X}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var X=v;v=R;try{return z()}finally{v=X}},e.unstable_scheduleCallback=function(R,z,X){var B=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?B+X:B):X=B,R){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=X+L,R={id:p++,callback:z,priorityLevel:R,startTime:X,expirationTime:L,sortIndex:-1},X>B?(R.sortIndex=X,t(m,R),n(f)===null&&R===n(m)&&(j?(_(D),D=-1):j=!0,$(E,X-B))):(R.sortIndex=L,t(f,R),k||y||(k=!0,U(P))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var z=v;return function(){var X=v;v=z;try{return R.apply(this,arguments)}finally{v=X}}}})(ip)),ip}var rw;function $3(){return rw||(rw=1,ap.exports=F3()),ap.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var sw;function V3(){if(sw)return On;sw=1;var e=Cg(),t=$3();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)i+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function l(o,i){c(o,i),c(o+"Capture",i)}function c(o,i){for(a[o]=i,o=0;o<i.length;o++)r.add(i[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function v(o){return f.call(g,o)?!0:f.call(p,o)?!1:m.test(o)?g[o]=!0:(p[o]=!0,!1)}function y(o,i,d,h){if(d!==null&&d.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function k(o,i,d,h){if(i===null||typeof i>"u"||y(o,i,d,h))return!0;if(h)return!1;if(d!==null)switch(d.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function j(o,i,d,h,b,C,A){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=o,this.type=i,this.sanitizeURL=C,this.removeEmptyString=A}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){N[o]=new j(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var i=o[0];N[i]=new j(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){N[o]=new j(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){N[o]=new j(o,2,!1,o,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(o){N[o]=new j(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){N[o]=new j(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){N[o]=new j(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){N[o]=new j(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){N[o]=new j(o,5,!1,o.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function w(o){return o[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(o){var i=o.replace(_,w);N[i]=new j(i,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var i=o.replace(_,w);N[i]=new j(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var i=o.replace(_,w);N[i]=new j(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){N[o]=new j(o,1,!1,o.toLowerCase(),null,!1,!1)}),N.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){N[o]=new j(o,1,!1,o.toLowerCase(),null,!0,!0)});function S(o,i,d,h){var b=N.hasOwnProperty(i)?N[i]:null;(b!==null?b.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(k(i,d,b,h)&&(d=null),h||b===null?v(i)&&(d===null?o.removeAttribute(i):o.setAttribute(i,""+d)):b.mustUseProperty?o[b.propertyName]=d===null?b.type===3?!1:"":d:(i=b.attributeName,h=b.attributeNamespace,d===null?o.removeAttribute(i):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,h?o.setAttributeNS(h,i,d):o.setAttribute(i,d))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),T=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),I=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),R=Symbol.iterator;function z(o){return o===null||typeof o!="object"?null:(o=R&&o[R]||o["@@iterator"],typeof o=="function"?o:null)}var X=Object.assign,B;function L(o){if(B===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);B=i&&i[1]||""}return`
|
|
34
|
+
`+B+o}var G=!1;function se(o,i){if(!o||G)return"";G=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(re){var h=re}Reflect.construct(o,[],i)}else{try{i.call()}catch(re){h=re}o.call(i.prototype)}else{try{throw Error()}catch(re){h=re}o()}}catch(re){if(re&&h&&typeof re.stack=="string"){for(var b=re.stack.split(`
|
|
35
|
+
`),C=h.stack.split(`
|
|
36
|
+
`),A=b.length-1,V=C.length-1;1<=A&&0<=V&&b[A]!==C[V];)V--;for(;1<=A&&0<=V;A--,V--)if(b[A]!==C[V]){if(A!==1||V!==1)do if(A--,V--,0>V||b[A]!==C[V]){var K=`
|
|
37
|
+
`+b[A].replace(" at new "," at ");return o.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",o.displayName)),K}while(1<=A&&0<=V);break}}}finally{G=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?L(o):""}function ae(o){switch(o.tag){case 5:return L(o.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case M:return"Fragment";case T:return"Portal";case q:return"Profiler";case D:return"StrictMode";case te:return"Suspense";case Y:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case I:return(o.displayName||"Context")+".Consumer";case H:return(o._context.displayName||"Context")+".Provider";case F:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case O:return i=o.displayName||null,i!==null?i:ue(o.type)||"Memo";case U:i=o._payload,o=o._init;try{return ue(o(i))}catch{}}return null}function oe(o){var i=o.type;switch(o.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=i.render,o=o.displayName||o.name||"",i.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(i);case 8:return i===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function he(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ge(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ce(o){var i=ge(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),h=""+o[i];if(!o.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var b=d.get,C=d.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return b.call(this)},set:function(A){h=""+A,C.call(this,A)}}),Object.defineProperty(o,i,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(A){h=""+A},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function ce(o){o._valueTracker||(o._valueTracker=Ce(o))}function Be(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var d=i.getValue(),h="";return o&&(h=ge(o)?o.checked?"true":"false":o.value),o=h,o!==d?(i.setValue(o),!0):!1}function at(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Et(o,i){var d=i.checked;return X({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function Yt(o,i){var d=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;d=he(i.value!=null?i.value:d),o._wrapperState={initialChecked:h,initialValue:d,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Qt(o,i){i=i.checked,i!=null&&S(o,"checked",i,!1)}function zt(o,i){Qt(o,i);var d=he(i.value),h=i.type;if(d!=null)h==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(h==="submit"||h==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?hn(o,i.type,d):i.hasOwnProperty("defaultValue")&&hn(o,i.type,he(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function Un(o,i,d){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+o._wrapperState.initialValue,d||i===o.value||(o.value=i),o.defaultValue=i}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function hn(o,i,d){(i!=="number"||at(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var mt=Array.isArray;function Z(o,i,d,h){if(o=o.options,i){i={};for(var b=0;b<d.length;b++)i["$"+d[b]]=!0;for(d=0;d<o.length;d++)b=i.hasOwnProperty("$"+o[d].value),o[d].selected!==b&&(o[d].selected=b),b&&h&&(o[d].defaultSelected=!0)}else{for(d=""+he(d),i=null,b=0;b<o.length;b++){if(o[b].value===d){o[b].selected=!0,h&&(o[b].defaultSelected=!0);return}i!==null||o[b].disabled||(i=o[b])}i!==null&&(i.selected=!0)}}function Pe(o,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},i,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function Ye(o,i){var d=i.value;if(d==null){if(d=i.children,i=i.defaultValue,d!=null){if(i!=null)throw Error(n(92));if(mt(d)){if(1<d.length)throw Error(n(93));d=d[0]}i=d}i==null&&(i=""),d=i}o._wrapperState={initialValue:he(d)}}function rt(o,i){var d=he(i.value),h=he(i.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),i.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),h!=null&&(o.defaultValue=""+h)}function Rt(o){var i=o.textContent;i===o._wrapperState.initialValue&&i!==""&&i!==null&&(o.value=i)}function ht(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gt(o,i){return o==null||o==="http://www.w3.org/1999/xhtml"?ht(i):o==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var fs,ne=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,d,h,b){MSApp.execUnsafeLocalFunction(function(){return o(i,d,h,b)})}:o})(function(o,i){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=i;else{for(fs=fs||document.createElement("div"),fs.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=fs.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;i.firstChild;)o.appendChild(i.firstChild)}});function ke(o,i){if(i){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=i;return}}o.textContent=i}var Ae={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},pn=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(o){pn.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),Ae[i]=Ae[o]})});function _n(o,i,d){return i==null||typeof i=="boolean"||i===""?"":d||typeof i!="number"||i===0||Ae.hasOwnProperty(o)&&Ae[o]?(""+i).trim():i+"px"}function ms(o,i){o=o.style;for(var d in i)if(i.hasOwnProperty(d)){var h=d.indexOf("--")===0,b=_n(d,i[d],h);d==="float"&&(d="cssFloat"),h?o.setProperty(d,b):o[d]=b}}var eu=X({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 zr(o,i){if(i){if(eu[o]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function ul(o,i){if(o.indexOf("-")===-1)return typeof i.is=="string";switch(o){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 dl=null;function Ba(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var za=null,Fs=null,Wr=null;function pr(o){if(o=Al(o)){if(typeof za!="function")throw Error(n(280));var i=o.stateNode;i&&(i=Cu(i),za(o.stateNode,o.type,i))}}function tu(o){Fs?Wr?Wr.push(o):Wr=[o]:Fs=o}function ze(){if(Fs){var o=Fs,i=Wr;if(Wr=Fs=null,pr(o),i)for(o=0;o<i.length;o++)pr(i[o])}}function Ze(o,i){return o(i)}function it(){}var xn=!1;function En(o,i,d){if(xn)return o(i,d);xn=!0;try{return Ze(o,i,d)}finally{xn=!1,(Fs!==null||Wr!==null)&&(it(),ze())}}function Pn(o,i){var d=o.stateNode;if(d===null)return null;var h=Cu(d);if(h===null)return null;d=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,i,typeof d));return d}var xr=!1;if(u)try{var Xt={};Object.defineProperty(Xt,"passive",{get:function(){xr=!0}}),window.addEventListener("test",Xt,Xt),window.removeEventListener("test",Xt,Xt)}catch{xr=!1}function Ur(o,i,d,h,b,C,A,V,K){var re=Array.prototype.slice.call(arguments,3);try{i.apply(d,re)}catch(le){this.onError(le)}}var fl=!1,nu=null,ru=!1,wm=null,$5={onError:function(o){fl=!0,nu=o}};function V5(o,i,d,h,b,C,A,V,K){fl=!1,nu=null,Ur.apply($5,arguments)}function B5(o,i,d,h,b,C,A,V,K){if(V5.apply(this,arguments),fl){if(fl){var re=nu;fl=!1,nu=null}else throw Error(n(198));ru||(ru=!0,wm=re)}}function Ko(o){var i=o,d=o;if(o.alternate)for(;i.return;)i=i.return;else{o=i;do i=o,(i.flags&4098)!==0&&(d=i.return),o=i.return;while(o)}return i.tag===3?d:null}function bv(o){if(o.tag===13){var i=o.memoizedState;if(i===null&&(o=o.alternate,o!==null&&(i=o.memoizedState)),i!==null)return i.dehydrated}return null}function wv(o){if(Ko(o)!==o)throw Error(n(188))}function z5(o){var i=o.alternate;if(!i){if(i=Ko(o),i===null)throw Error(n(188));return i!==o?null:o}for(var d=o,h=i;;){var b=d.return;if(b===null)break;var C=b.alternate;if(C===null){if(h=b.return,h!==null){d=h;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===d)return wv(b),o;if(C===h)return wv(b),i;C=C.sibling}throw Error(n(188))}if(d.return!==h.return)d=b,h=C;else{for(var A=!1,V=b.child;V;){if(V===d){A=!0,d=b,h=C;break}if(V===h){A=!0,h=b,d=C;break}V=V.sibling}if(!A){for(V=C.child;V;){if(V===d){A=!0,d=C,h=b;break}if(V===h){A=!0,h=C,d=b;break}V=V.sibling}if(!A)throw Error(n(189))}}if(d.alternate!==h)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:i}function jv(o){return o=z5(o),o!==null?Nv(o):null}function Nv(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var i=Nv(o);if(i!==null)return i;o=o.sibling}return null}var Cv=t.unstable_scheduleCallback,kv=t.unstable_cancelCallback,W5=t.unstable_shouldYield,U5=t.unstable_requestPaint,Pt=t.unstable_now,H5=t.unstable_getCurrentPriorityLevel,jm=t.unstable_ImmediatePriority,Sv=t.unstable_UserBlockingPriority,su=t.unstable_NormalPriority,q5=t.unstable_LowPriority,_v=t.unstable_IdlePriority,ou=null,Hr=null;function K5(o){if(Hr&&typeof Hr.onCommitFiberRoot=="function")try{Hr.onCommitFiberRoot(ou,o,void 0,(o.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:G5,Y5=Math.log,Q5=Math.LN2;function G5(o){return o>>>=0,o===0?32:31-(Y5(o)/Q5|0)|0}var au=64,iu=4194304;function ml(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function lu(o,i){var d=o.pendingLanes;if(d===0)return 0;var h=0,b=o.suspendedLanes,C=o.pingedLanes,A=d&268435455;if(A!==0){var V=A&~b;V!==0?h=ml(V):(C&=A,C!==0&&(h=ml(C)))}else A=d&~b,A!==0?h=ml(A):C!==0&&(h=ml(C));if(h===0)return 0;if(i!==0&&i!==h&&(i&b)===0&&(b=h&-h,C=i&-i,b>=C||b===16&&(C&4194240)!==0))return i;if((h&4)!==0&&(h|=d&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=h;0<i;)d=31-gr(i),b=1<<d,h|=o[d],i&=~b;return h}function X5(o,i){switch(o){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Z5(o,i){for(var d=o.suspendedLanes,h=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var A=31-gr(C),V=1<<A,K=b[A];K===-1?((V&d)===0||(V&h)!==0)&&(b[A]=X5(V,i)):K<=i&&(o.expiredLanes|=V),C&=~V}}function Nm(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Ev(){var o=au;return au<<=1,(au&4194240)===0&&(au=64),o}function Cm(o){for(var i=[],d=0;31>d;d++)i.push(o);return i}function hl(o,i,d){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-gr(i),o[i]=d}function J5(o,i){var d=o.pendingLanes&~i;o.pendingLanes=i,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=i,o.mutableReadLanes&=i,o.entangledLanes&=i,i=o.entanglements;var h=o.eventTimes;for(o=o.expirationTimes;0<d;){var b=31-gr(d),C=1<<b;i[b]=0,h[b]=-1,o[b]=-1,d&=~C}}function km(o,i){var d=o.entangledLanes|=i;for(o=o.entanglements;d;){var h=31-gr(d),b=1<<h;b&i|o[h]&i&&(o[h]|=i),d&=~b}}var st=0;function Pv(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Tv,Sm,Av,Mv,Dv,_m=!1,cu=[],$s=null,Vs=null,Bs=null,pl=new Map,xl=new Map,zs=[],eE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rv(o,i){switch(o){case"focusin":case"focusout":$s=null;break;case"dragenter":case"dragleave":Vs=null;break;case"mouseover":case"mouseout":Bs=null;break;case"pointerover":case"pointerout":pl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":xl.delete(i.pointerId)}}function gl(o,i,d,h,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:i,domEventName:d,eventSystemFlags:h,nativeEvent:C,targetContainers:[b]},i!==null&&(i=Al(i),i!==null&&Sm(i)),o):(o.eventSystemFlags|=h,i=o.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),o)}function tE(o,i,d,h,b){switch(i){case"focusin":return $s=gl($s,o,i,d,h,b),!0;case"dragenter":return Vs=gl(Vs,o,i,d,h,b),!0;case"mouseover":return Bs=gl(Bs,o,i,d,h,b),!0;case"pointerover":var C=b.pointerId;return pl.set(C,gl(pl.get(C)||null,o,i,d,h,b)),!0;case"gotpointercapture":return C=b.pointerId,xl.set(C,gl(xl.get(C)||null,o,i,d,h,b)),!0}return!1}function Ov(o){var i=Yo(o.target);if(i!==null){var d=Ko(i);if(d!==null){if(i=d.tag,i===13){if(i=bv(d),i!==null){o.blockedOn=i,Dv(o.priority,function(){Av(d)});return}}else if(i===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function uu(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var d=Pm(o.domEventName,o.eventSystemFlags,i[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var h=new d.constructor(d.type,d);dl=h,d.target.dispatchEvent(h),dl=null}else return i=Al(d),i!==null&&Sm(i),o.blockedOn=d,!1;i.shift()}return!0}function Iv(o,i,d){uu(o)&&d.delete(i)}function nE(){_m=!1,$s!==null&&uu($s)&&($s=null),Vs!==null&&uu(Vs)&&(Vs=null),Bs!==null&&uu(Bs)&&(Bs=null),pl.forEach(Iv),xl.forEach(Iv)}function yl(o,i){o.blockedOn===i&&(o.blockedOn=null,_m||(_m=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,nE)))}function vl(o){function i(b){return yl(b,o)}if(0<cu.length){yl(cu[0],o);for(var d=1;d<cu.length;d++){var h=cu[d];h.blockedOn===o&&(h.blockedOn=null)}}for($s!==null&&yl($s,o),Vs!==null&&yl(Vs,o),Bs!==null&&yl(Bs,o),pl.forEach(i),xl.forEach(i),d=0;d<zs.length;d++)h=zs[d],h.blockedOn===o&&(h.blockedOn=null);for(;0<zs.length&&(d=zs[0],d.blockedOn===null);)Ov(d),d.blockedOn===null&&zs.shift()}var Wa=E.ReactCurrentBatchConfig,du=!0;function rE(o,i,d,h){var b=st,C=Wa.transition;Wa.transition=null;try{st=1,Em(o,i,d,h)}finally{st=b,Wa.transition=C}}function sE(o,i,d,h){var b=st,C=Wa.transition;Wa.transition=null;try{st=4,Em(o,i,d,h)}finally{st=b,Wa.transition=C}}function Em(o,i,d,h){if(du){var b=Pm(o,i,d,h);if(b===null)qm(o,i,h,fu,d),Rv(o,h);else if(tE(b,o,i,d,h))h.stopPropagation();else if(Rv(o,h),i&4&&-1<eE.indexOf(o)){for(;b!==null;){var C=Al(b);if(C!==null&&Tv(C),C=Pm(o,i,d,h),C===null&&qm(o,i,h,fu,d),C===b)break;b=C}b!==null&&h.stopPropagation()}else qm(o,i,h,null,d)}}var fu=null;function Pm(o,i,d,h){if(fu=null,o=Ba(h),o=Yo(o),o!==null)if(i=Ko(o),i===null)o=null;else if(d=i.tag,d===13){if(o=bv(i),o!==null)return o;o=null}else if(d===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null);return fu=o,null}function Lv(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(H5()){case jm:return 1;case Sv:return 4;case su:case q5:return 16;case _v:return 536870912;default:return 16}default:return 16}}var Ws=null,Tm=null,mu=null;function Fv(){if(mu)return mu;var o,i=Tm,d=i.length,h,b="value"in Ws?Ws.value:Ws.textContent,C=b.length;for(o=0;o<d&&i[o]===b[o];o++);var A=d-o;for(h=1;h<=A&&i[d-h]===b[C-h];h++);return mu=b.slice(o,1<h?1-h:void 0)}function hu(o){var i=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&i===13&&(o=13)):o=i,o===10&&(o=13),32<=o||o===13?o:0}function pu(){return!0}function $v(){return!1}function Hn(o){function i(d,h,b,C,A){this._reactName=d,this._targetInst=b,this.type=h,this.nativeEvent=C,this.target=A,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(d=o[V],this[V]=d?d(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?pu:$v,this.isPropagationStopped=$v,this}return X(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=pu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=pu)},persist:function(){},isPersistent:pu}),i}var Ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Am=Hn(Ua),bl=X({},Ua,{view:0,detail:0}),oE=Hn(bl),Mm,Dm,wl,xu=X({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Om,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==wl&&(wl&&o.type==="mousemove"?(Mm=o.screenX-wl.screenX,Dm=o.screenY-wl.screenY):Dm=Mm=0,wl=o),Mm)},movementY:function(o){return"movementY"in o?o.movementY:Dm}}),Vv=Hn(xu),aE=X({},xu,{dataTransfer:0}),iE=Hn(aE),lE=X({},bl,{relatedTarget:0}),Rm=Hn(lE),cE=X({},Ua,{animationName:0,elapsedTime:0,pseudoElement:0}),uE=Hn(cE),dE=X({},Ua,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),fE=Hn(dE),mE=X({},Ua,{data:0}),Bv=Hn(mE),hE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gE(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=xE[o])?!!i[o]:!1}function Om(){return gE}var yE=X({},bl,{key:function(o){if(o.key){var i=hE[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=hu(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?pE[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Om,charCode:function(o){return o.type==="keypress"?hu(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?hu(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),vE=Hn(yE),bE=X({},xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zv=Hn(bE),wE=X({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Om}),jE=Hn(wE),NE=X({},Ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),CE=Hn(NE),kE=X({},xu,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),SE=Hn(kE),_E=[9,13,27,32],Im=u&&"CompositionEvent"in window,jl=null;u&&"documentMode"in document&&(jl=document.documentMode);var EE=u&&"TextEvent"in window&&!jl,Wv=u&&(!Im||jl&&8<jl&&11>=jl),Uv=" ",Hv=!1;function qv(o,i){switch(o){case"keyup":return _E.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kv(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ha=!1;function PE(o,i){switch(o){case"compositionend":return Kv(i);case"keypress":return i.which!==32?null:(Hv=!0,Uv);case"textInput":return o=i.data,o===Uv&&Hv?null:o;default:return null}}function TE(o,i){if(Ha)return o==="compositionend"||!Im&&qv(o,i)?(o=Fv(),mu=Tm=Ws=null,Ha=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Wv&&i.locale!=="ko"?null:i.data;default:return null}}var AE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yv(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!AE[o.type]:i==="textarea"}function Qv(o,i,d,h){tu(h),i=wu(i,"onChange"),0<i.length&&(d=new Am("onChange","change",null,d,h),o.push({event:d,listeners:i}))}var Nl=null,Cl=null;function ME(o){m0(o,0)}function gu(o){var i=Ga(o);if(Be(i))return o}function DE(o,i){if(o==="change")return i}var Gv=!1;if(u){var Lm;if(u){var Fm="oninput"in document;if(!Fm){var Xv=document.createElement("div");Xv.setAttribute("oninput","return;"),Fm=typeof Xv.oninput=="function"}Lm=Fm}else Lm=!1;Gv=Lm&&(!document.documentMode||9<document.documentMode)}function Zv(){Nl&&(Nl.detachEvent("onpropertychange",Jv),Cl=Nl=null)}function Jv(o){if(o.propertyName==="value"&&gu(Cl)){var i=[];Qv(i,Cl,o,Ba(o)),En(ME,i)}}function RE(o,i,d){o==="focusin"?(Zv(),Nl=i,Cl=d,Nl.attachEvent("onpropertychange",Jv)):o==="focusout"&&Zv()}function OE(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return gu(Cl)}function IE(o,i){if(o==="click")return gu(i)}function LE(o,i){if(o==="input"||o==="change")return gu(i)}function FE(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var yr=typeof Object.is=="function"?Object.is:FE;function kl(o,i){if(yr(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var d=Object.keys(o),h=Object.keys(i);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var b=d[h];if(!f.call(i,b)||!yr(o[b],i[b]))return!1}return!0}function e0(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function t0(o,i){var d=e0(o);o=0;for(var h;d;){if(d.nodeType===3){if(h=o+d.textContent.length,o<=i&&h>=i)return{node:d,offset:i-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=e0(d)}}function n0(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?n0(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function r0(){for(var o=window,i=at();i instanceof o.HTMLIFrameElement;){try{var d=typeof i.contentWindow.location.href=="string"}catch{d=!1}if(d)o=i.contentWindow;else break;i=at(o.document)}return i}function $m(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}function $E(o){var i=r0(),d=o.focusedElem,h=o.selectionRange;if(i!==d&&d&&d.ownerDocument&&n0(d.ownerDocument.documentElement,d)){if(h!==null&&$m(d)){if(i=h.start,o=h.end,o===void 0&&(o=i),"selectionStart"in d)d.selectionStart=i,d.selectionEnd=Math.min(o,d.value.length);else if(o=(i=d.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var b=d.textContent.length,C=Math.min(h.start,b);h=h.end===void 0?C:Math.min(h.end,b),!o.extend&&C>h&&(b=h,h=C,C=b),b=t0(d,C);var A=t0(d,h);b&&A&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==A.node||o.focusOffset!==A.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),o.removeAllRanges(),C>h?(o.addRange(i),o.extend(A.node,A.offset)):(i.setEnd(A.node,A.offset),o.addRange(i)))}}for(i=[],o=d;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<i.length;d++)o=i[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var VE=u&&"documentMode"in document&&11>=document.documentMode,qa=null,Vm=null,Sl=null,Bm=!1;function s0(o,i,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Bm||qa==null||qa!==at(h)||(h=qa,"selectionStart"in h&&$m(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Sl&&kl(Sl,h)||(Sl=h,h=wu(Vm,"onSelect"),0<h.length&&(i=new Am("onSelect","select",null,i,d),o.push({event:i,listeners:h}),i.target=qa)))}function yu(o,i){var d={};return d[o.toLowerCase()]=i.toLowerCase(),d["Webkit"+o]="webkit"+i,d["Moz"+o]="moz"+i,d}var Ka={animationend:yu("Animation","AnimationEnd"),animationiteration:yu("Animation","AnimationIteration"),animationstart:yu("Animation","AnimationStart"),transitionend:yu("Transition","TransitionEnd")},zm={},o0={};u&&(o0=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);function vu(o){if(zm[o])return zm[o];if(!Ka[o])return o;var i=Ka[o],d;for(d in i)if(i.hasOwnProperty(d)&&d in o0)return zm[o]=i[d];return o}var a0=vu("animationend"),i0=vu("animationiteration"),l0=vu("animationstart"),c0=vu("transitionend"),u0=new Map,d0="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Us(o,i){u0.set(o,i),l(i,[o])}for(var Wm=0;Wm<d0.length;Wm++){var Um=d0[Wm],BE=Um.toLowerCase(),zE=Um[0].toUpperCase()+Um.slice(1);Us(BE,"on"+zE)}Us(a0,"onAnimationEnd"),Us(i0,"onAnimationIteration"),Us(l0,"onAnimationStart"),Us("dblclick","onDoubleClick"),Us("focusin","onFocus"),Us("focusout","onBlur"),Us(c0,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),WE=new Set("cancel close invalid load scroll toggle".split(" ").concat(_l));function f0(o,i,d){var h=o.type||"unknown-event";o.currentTarget=d,B5(h,i,void 0,o),o.currentTarget=null}function m0(o,i){i=(i&4)!==0;for(var d=0;d<o.length;d++){var h=o[d],b=h.event;h=h.listeners;e:{var C=void 0;if(i)for(var A=h.length-1;0<=A;A--){var V=h[A],K=V.instance,re=V.currentTarget;if(V=V.listener,K!==C&&b.isPropagationStopped())break e;f0(b,V,re),C=K}else for(A=0;A<h.length;A++){if(V=h[A],K=V.instance,re=V.currentTarget,V=V.listener,K!==C&&b.isPropagationStopped())break e;f0(b,V,re),C=K}}}if(ru)throw o=wm,ru=!1,wm=null,o}function pt(o,i){var d=i[Zm];d===void 0&&(d=i[Zm]=new Set);var h=o+"__bubble";d.has(h)||(h0(i,o,2,!1),d.add(h))}function Hm(o,i,d){var h=0;i&&(h|=4),h0(d,o,h,i)}var bu="_reactListening"+Math.random().toString(36).slice(2);function El(o){if(!o[bu]){o[bu]=!0,r.forEach(function(d){d!=="selectionchange"&&(WE.has(d)||Hm(d,!1,o),Hm(d,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[bu]||(i[bu]=!0,Hm("selectionchange",!1,i))}}function h0(o,i,d,h){switch(Lv(i)){case 1:var b=rE;break;case 4:b=sE;break;default:b=Em}d=b.bind(null,i,d,o),b=void 0,!xr||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),h?b!==void 0?o.addEventListener(i,d,{capture:!0,passive:b}):o.addEventListener(i,d,!0):b!==void 0?o.addEventListener(i,d,{passive:b}):o.addEventListener(i,d,!1)}function qm(o,i,d,h,b){var C=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var V=h.stateNode.containerInfo;if(V===b||V.nodeType===8&&V.parentNode===b)break;if(A===4)for(A=h.return;A!==null;){var K=A.tag;if((K===3||K===4)&&(K=A.stateNode.containerInfo,K===b||K.nodeType===8&&K.parentNode===b))return;A=A.return}for(;V!==null;){if(A=Yo(V),A===null)return;if(K=A.tag,K===5||K===6){h=C=A;continue e}V=V.parentNode}}h=h.return}En(function(){var re=C,le=Ba(d),de=[];e:{var ie=u0.get(o);if(ie!==void 0){var ve=Am,je=o;switch(o){case"keypress":if(hu(d)===0)break e;case"keydown":case"keyup":ve=vE;break;case"focusin":je="focus",ve=Rm;break;case"focusout":je="blur",ve=Rm;break;case"beforeblur":case"afterblur":ve=Rm;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=Vv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=iE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=jE;break;case a0:case i0:case l0:ve=uE;break;case c0:ve=CE;break;case"scroll":ve=oE;break;case"wheel":ve=SE;break;case"copy":case"cut":case"paste":ve=fE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=zv}var Se=(i&4)!==0,Tt=!Se&&o==="scroll",J=Se?ie!==null?ie+"Capture":null:ie;Se=[];for(var Q=re,ee;Q!==null;){ee=Q;var me=ee.stateNode;if(ee.tag===5&&me!==null&&(ee=me,J!==null&&(me=Pn(Q,J),me!=null&&Se.push(Pl(Q,me,ee)))),Tt)break;Q=Q.return}0<Se.length&&(ie=new ve(ie,je,null,d,le),de.push({event:ie,listeners:Se}))}}if((i&7)===0){e:{if(ie=o==="mouseover"||o==="pointerover",ve=o==="mouseout"||o==="pointerout",ie&&d!==dl&&(je=d.relatedTarget||d.fromElement)&&(Yo(je)||je[hs]))break e;if((ve||ie)&&(ie=le.window===le?le:(ie=le.ownerDocument)?ie.defaultView||ie.parentWindow:window,ve?(je=d.relatedTarget||d.toElement,ve=re,je=je?Yo(je):null,je!==null&&(Tt=Ko(je),je!==Tt||je.tag!==5&&je.tag!==6)&&(je=null)):(ve=null,je=re),ve!==je)){if(Se=Vv,me="onMouseLeave",J="onMouseEnter",Q="mouse",(o==="pointerout"||o==="pointerover")&&(Se=zv,me="onPointerLeave",J="onPointerEnter",Q="pointer"),Tt=ve==null?ie:Ga(ve),ee=je==null?ie:Ga(je),ie=new Se(me,Q+"leave",ve,d,le),ie.target=Tt,ie.relatedTarget=ee,me=null,Yo(le)===re&&(Se=new Se(J,Q+"enter",je,d,le),Se.target=ee,Se.relatedTarget=Tt,me=Se),Tt=me,ve&&je)t:{for(Se=ve,J=je,Q=0,ee=Se;ee;ee=Ya(ee))Q++;for(ee=0,me=J;me;me=Ya(me))ee++;for(;0<Q-ee;)Se=Ya(Se),Q--;for(;0<ee-Q;)J=Ya(J),ee--;for(;Q--;){if(Se===J||J!==null&&Se===J.alternate)break t;Se=Ya(Se),J=Ya(J)}Se=null}else Se=null;ve!==null&&p0(de,ie,ve,Se,!1),je!==null&&Tt!==null&&p0(de,Tt,je,Se,!0)}}e:{if(ie=re?Ga(re):window,ve=ie.nodeName&&ie.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ie.type==="file")var Ee=DE;else if(Yv(ie))if(Gv)Ee=LE;else{Ee=OE;var De=RE}else(ve=ie.nodeName)&&ve.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(Ee=IE);if(Ee&&(Ee=Ee(o,re))){Qv(de,Ee,d,le);break e}De&&De(o,ie,re),o==="focusout"&&(De=ie._wrapperState)&&De.controlled&&ie.type==="number"&&hn(ie,"number",ie.value)}switch(De=re?Ga(re):window,o){case"focusin":(Yv(De)||De.contentEditable==="true")&&(qa=De,Vm=re,Sl=null);break;case"focusout":Sl=Vm=qa=null;break;case"mousedown":Bm=!0;break;case"contextmenu":case"mouseup":case"dragend":Bm=!1,s0(de,d,le);break;case"selectionchange":if(VE)break;case"keydown":case"keyup":s0(de,d,le)}var Re;if(Im)e:{switch(o){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ha?qv(o,d)&&(Ve="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ve="onCompositionStart");Ve&&(Wv&&d.locale!=="ko"&&(Ha||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ha&&(Re=Fv()):(Ws=le,Tm="value"in Ws?Ws.value:Ws.textContent,Ha=!0)),De=wu(re,Ve),0<De.length&&(Ve=new Bv(Ve,o,null,d,le),de.push({event:Ve,listeners:De}),Re?Ve.data=Re:(Re=Kv(d),Re!==null&&(Ve.data=Re)))),(Re=EE?PE(o,d):TE(o,d))&&(re=wu(re,"onBeforeInput"),0<re.length&&(le=new Bv("onBeforeInput","beforeinput",null,d,le),de.push({event:le,listeners:re}),le.data=Re))}m0(de,i)})}function Pl(o,i,d){return{instance:o,listener:i,currentTarget:d}}function wu(o,i){for(var d=i+"Capture",h=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=Pn(o,d),C!=null&&h.unshift(Pl(o,C,b)),C=Pn(o,i),C!=null&&h.push(Pl(o,C,b))),o=o.return}return h}function Ya(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function p0(o,i,d,h,b){for(var C=i._reactName,A=[];d!==null&&d!==h;){var V=d,K=V.alternate,re=V.stateNode;if(K!==null&&K===h)break;V.tag===5&&re!==null&&(V=re,b?(K=Pn(d,C),K!=null&&A.unshift(Pl(d,K,V))):b||(K=Pn(d,C),K!=null&&A.push(Pl(d,K,V)))),d=d.return}A.length!==0&&o.push({event:i,listeners:A})}var UE=/\r\n?/g,HE=/\u0000|\uFFFD/g;function x0(o){return(typeof o=="string"?o:""+o).replace(UE,`
|
|
38
|
+
`).replace(HE,"")}function ju(o,i,d){if(i=x0(i),x0(o)!==i&&d)throw Error(n(425))}function Nu(){}var Km=null,Ym=null;function Qm(o,i){return o==="textarea"||o==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Gm=typeof setTimeout=="function"?setTimeout:void 0,qE=typeof clearTimeout=="function"?clearTimeout:void 0,g0=typeof Promise=="function"?Promise:void 0,KE=typeof queueMicrotask=="function"?queueMicrotask:typeof g0<"u"?function(o){return g0.resolve(null).then(o).catch(YE)}:Gm;function YE(o){setTimeout(function(){throw o})}function Xm(o,i){var d=i,h=0;do{var b=d.nextSibling;if(o.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"){if(h===0){o.removeChild(b),vl(i);return}h--}else d!=="$"&&d!=="$?"&&d!=="$!"||h++;d=b}while(d);vl(i)}function Hs(o){for(;o!=null;o=o.nextSibling){var i=o.nodeType;if(i===1||i===3)break;if(i===8){if(i=o.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return o}function y0(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(i===0)return o;i--}else d==="/$"&&i++}o=o.previousSibling}return null}var Qa=Math.random().toString(36).slice(2),qr="__reactFiber$"+Qa,Tl="__reactProps$"+Qa,hs="__reactContainer$"+Qa,Zm="__reactEvents$"+Qa,QE="__reactListeners$"+Qa,GE="__reactHandles$"+Qa;function Yo(o){var i=o[qr];if(i)return i;for(var d=o.parentNode;d;){if(i=d[hs]||d[qr]){if(d=i.alternate,i.child!==null||d!==null&&d.child!==null)for(o=y0(o);o!==null;){if(d=o[qr])return d;o=y0(o)}return i}o=d,d=o.parentNode}return null}function Al(o){return o=o[qr]||o[hs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ga(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Cu(o){return o[Tl]||null}var Jm=[],Xa=-1;function qs(o){return{current:o}}function xt(o){0>Xa||(o.current=Jm[Xa],Jm[Xa]=null,Xa--)}function ct(o,i){Xa++,Jm[Xa]=o.current,o.current=i}var Ks={},an=qs(Ks),Tn=qs(!1),Qo=Ks;function Za(o,i){var d=o.type.contextTypes;if(!d)return Ks;var h=o.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in d)b[C]=i[C];return h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=b),b}function An(o){return o=o.childContextTypes,o!=null}function ku(){xt(Tn),xt(an)}function v0(o,i,d){if(an.current!==Ks)throw Error(n(168));ct(an,i),ct(Tn,d)}function b0(o,i,d){var h=o.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return d;h=h.getChildContext();for(var b in h)if(!(b in i))throw Error(n(108,oe(o)||"Unknown",b));return X({},d,h)}function Su(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ks,Qo=an.current,ct(an,o),ct(Tn,Tn.current),!0}function w0(o,i,d){var h=o.stateNode;if(!h)throw Error(n(169));d?(o=b0(o,i,Qo),h.__reactInternalMemoizedMergedChildContext=o,xt(Tn),xt(an),ct(an,o)):xt(Tn),ct(Tn,d)}var ps=null,_u=!1,eh=!1;function j0(o){ps===null?ps=[o]:ps.push(o)}function XE(o){_u=!0,j0(o)}function Ys(){if(!eh&&ps!==null){eh=!0;var o=0,i=st;try{var d=ps;for(st=1;o<d.length;o++){var h=d[o];do h=h(!0);while(h!==null)}ps=null,_u=!1}catch(b){throw ps!==null&&(ps=ps.slice(o+1)),Cv(jm,Ys),b}finally{st=i,eh=!1}}return null}var Ja=[],ei=0,Eu=null,Pu=0,rr=[],sr=0,Go=null,xs=1,gs="";function Xo(o,i){Ja[ei++]=Pu,Ja[ei++]=Eu,Eu=o,Pu=i}function N0(o,i,d){rr[sr++]=xs,rr[sr++]=gs,rr[sr++]=Go,Go=o;var h=xs;o=gs;var b=32-gr(h)-1;h&=~(1<<b),d+=1;var C=32-gr(i)+b;if(30<C){var A=b-b%5;C=(h&(1<<A)-1).toString(32),h>>=A,b-=A,xs=1<<32-gr(i)+b|d<<b|h,gs=C+o}else xs=1<<C|d<<b|h,gs=o}function th(o){o.return!==null&&(Xo(o,1),N0(o,1,0))}function nh(o){for(;o===Eu;)Eu=Ja[--ei],Ja[ei]=null,Pu=Ja[--ei],Ja[ei]=null;for(;o===Go;)Go=rr[--sr],rr[sr]=null,gs=rr[--sr],rr[sr]=null,xs=rr[--sr],rr[sr]=null}var qn=null,Kn=null,yt=!1,vr=null;function C0(o,i){var d=lr(5,null,null,0);d.elementType="DELETED",d.stateNode=i,d.return=o,i=o.deletions,i===null?(o.deletions=[d],o.flags|=16):i.push(d)}function k0(o,i){switch(o.tag){case 5:var d=o.type;return i=i.nodeType!==1||d.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(o.stateNode=i,qn=o,Kn=Hs(i.firstChild),!0):!1;case 6:return i=o.pendingProps===""||i.nodeType!==3?null:i,i!==null?(o.stateNode=i,qn=o,Kn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(d=Go!==null?{id:xs,overflow:gs}:null,o.memoizedState={dehydrated:i,treeContext:d,retryLane:1073741824},d=lr(18,null,null,0),d.stateNode=i,d.return=o,o.child=d,qn=o,Kn=null,!0):!1;default:return!1}}function rh(o){return(o.mode&1)!==0&&(o.flags&128)===0}function sh(o){if(yt){var i=Kn;if(i){var d=i;if(!k0(o,i)){if(rh(o))throw Error(n(418));i=Hs(d.nextSibling);var h=qn;i&&k0(o,i)?C0(h,d):(o.flags=o.flags&-4097|2,yt=!1,qn=o)}}else{if(rh(o))throw Error(n(418));o.flags=o.flags&-4097|2,yt=!1,qn=o}}}function S0(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qn=o}function Tu(o){if(o!==qn)return!1;if(!yt)return S0(o),yt=!0,!1;var i;if((i=o.tag!==3)&&!(i=o.tag!==5)&&(i=o.type,i=i!=="head"&&i!=="body"&&!Qm(o.type,o.memoizedProps)),i&&(i=Kn)){if(rh(o))throw _0(),Error(n(418));for(;i;)C0(o,i),i=Hs(i.nextSibling)}if(S0(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,i=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(i===0){Kn=Hs(o.nextSibling);break e}i--}else d!=="$"&&d!=="$!"&&d!=="$?"||i++}o=o.nextSibling}Kn=null}}else Kn=qn?Hs(o.stateNode.nextSibling):null;return!0}function _0(){for(var o=Kn;o;)o=Hs(o.nextSibling)}function ti(){Kn=qn=null,yt=!1}function oh(o){vr===null?vr=[o]:vr.push(o)}var ZE=E.ReactCurrentBatchConfig;function Ml(o,i,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var h=d.stateNode}if(!h)throw Error(n(147,o));var b=h,C=""+o;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===C?i.ref:(i=function(A){var V=b.refs;A===null?delete V[C]:V[C]=A},i._stringRef=C,i)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Au(o,i){throw o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o))}function E0(o){var i=o._init;return i(o._payload)}function P0(o){function i(J,Q){if(o){var ee=J.deletions;ee===null?(J.deletions=[Q],J.flags|=16):ee.push(Q)}}function d(J,Q){if(!o)return null;for(;Q!==null;)i(J,Q),Q=Q.sibling;return null}function h(J,Q){for(J=new Map;Q!==null;)Q.key!==null?J.set(Q.key,Q):J.set(Q.index,Q),Q=Q.sibling;return J}function b(J,Q){return J=no(J,Q),J.index=0,J.sibling=null,J}function C(J,Q,ee){return J.index=ee,o?(ee=J.alternate,ee!==null?(ee=ee.index,ee<Q?(J.flags|=2,Q):ee):(J.flags|=2,Q)):(J.flags|=1048576,Q)}function A(J){return o&&J.alternate===null&&(J.flags|=2),J}function V(J,Q,ee,me){return Q===null||Q.tag!==6?(Q=Gh(ee,J.mode,me),Q.return=J,Q):(Q=b(Q,ee),Q.return=J,Q)}function K(J,Q,ee,me){var Ee=ee.type;return Ee===M?le(J,Q,ee.props.children,me,ee.key):Q!==null&&(Q.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&E0(Ee)===Q.type)?(me=b(Q,ee.props),me.ref=Ml(J,Q,ee),me.return=J,me):(me=td(ee.type,ee.key,ee.props,null,J.mode,me),me.ref=Ml(J,Q,ee),me.return=J,me)}function re(J,Q,ee,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ee.containerInfo||Q.stateNode.implementation!==ee.implementation?(Q=Xh(ee,J.mode,me),Q.return=J,Q):(Q=b(Q,ee.children||[]),Q.return=J,Q)}function le(J,Q,ee,me,Ee){return Q===null||Q.tag!==7?(Q=oa(ee,J.mode,me,Ee),Q.return=J,Q):(Q=b(Q,ee),Q.return=J,Q)}function de(J,Q,ee){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=Gh(""+Q,J.mode,ee),Q.return=J,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case P:return ee=td(Q.type,Q.key,Q.props,null,J.mode,ee),ee.ref=Ml(J,null,Q),ee.return=J,ee;case T:return Q=Xh(Q,J.mode,ee),Q.return=J,Q;case U:var me=Q._init;return de(J,me(Q._payload),ee)}if(mt(Q)||z(Q))return Q=oa(Q,J.mode,ee,null),Q.return=J,Q;Au(J,Q)}return null}function ie(J,Q,ee,me){var Ee=Q!==null?Q.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ee!==null?null:V(J,Q,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case P:return ee.key===Ee?K(J,Q,ee,me):null;case T:return ee.key===Ee?re(J,Q,ee,me):null;case U:return Ee=ee._init,ie(J,Q,Ee(ee._payload),me)}if(mt(ee)||z(ee))return Ee!==null?null:le(J,Q,ee,me,null);Au(J,ee)}return null}function ve(J,Q,ee,me,Ee){if(typeof me=="string"&&me!==""||typeof me=="number")return J=J.get(ee)||null,V(Q,J,""+me,Ee);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case P:return J=J.get(me.key===null?ee:me.key)||null,K(Q,J,me,Ee);case T:return J=J.get(me.key===null?ee:me.key)||null,re(Q,J,me,Ee);case U:var De=me._init;return ve(J,Q,ee,De(me._payload),Ee)}if(mt(me)||z(me))return J=J.get(ee)||null,le(Q,J,me,Ee,null);Au(Q,me)}return null}function je(J,Q,ee,me){for(var Ee=null,De=null,Re=Q,Ve=Q=0,Ht=null;Re!==null&&Ve<ee.length;Ve++){Re.index>Ve?(Ht=Re,Re=null):Ht=Re.sibling;var Xe=ie(J,Re,ee[Ve],me);if(Xe===null){Re===null&&(Re=Ht);break}o&&Re&&Xe.alternate===null&&i(J,Re),Q=C(Xe,Q,Ve),De===null?Ee=Xe:De.sibling=Xe,De=Xe,Re=Ht}if(Ve===ee.length)return d(J,Re),yt&&Xo(J,Ve),Ee;if(Re===null){for(;Ve<ee.length;Ve++)Re=de(J,ee[Ve],me),Re!==null&&(Q=C(Re,Q,Ve),De===null?Ee=Re:De.sibling=Re,De=Re);return yt&&Xo(J,Ve),Ee}for(Re=h(J,Re);Ve<ee.length;Ve++)Ht=ve(Re,J,Ve,ee[Ve],me),Ht!==null&&(o&&Ht.alternate!==null&&Re.delete(Ht.key===null?Ve:Ht.key),Q=C(Ht,Q,Ve),De===null?Ee=Ht:De.sibling=Ht,De=Ht);return o&&Re.forEach(function(ro){return i(J,ro)}),yt&&Xo(J,Ve),Ee}function Se(J,Q,ee,me){var Ee=z(ee);if(typeof Ee!="function")throw Error(n(150));if(ee=Ee.call(ee),ee==null)throw Error(n(151));for(var De=Ee=null,Re=Q,Ve=Q=0,Ht=null,Xe=ee.next();Re!==null&&!Xe.done;Ve++,Xe=ee.next()){Re.index>Ve?(Ht=Re,Re=null):Ht=Re.sibling;var ro=ie(J,Re,Xe.value,me);if(ro===null){Re===null&&(Re=Ht);break}o&&Re&&ro.alternate===null&&i(J,Re),Q=C(ro,Q,Ve),De===null?Ee=ro:De.sibling=ro,De=ro,Re=Ht}if(Xe.done)return d(J,Re),yt&&Xo(J,Ve),Ee;if(Re===null){for(;!Xe.done;Ve++,Xe=ee.next())Xe=de(J,Xe.value,me),Xe!==null&&(Q=C(Xe,Q,Ve),De===null?Ee=Xe:De.sibling=Xe,De=Xe);return yt&&Xo(J,Ve),Ee}for(Re=h(J,Re);!Xe.done;Ve++,Xe=ee.next())Xe=ve(Re,J,Ve,Xe.value,me),Xe!==null&&(o&&Xe.alternate!==null&&Re.delete(Xe.key===null?Ve:Xe.key),Q=C(Xe,Q,Ve),De===null?Ee=Xe:De.sibling=Xe,De=Xe);return o&&Re.forEach(function(A3){return i(J,A3)}),yt&&Xo(J,Ve),Ee}function Tt(J,Q,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===M&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case P:e:{for(var Ee=ee.key,De=Q;De!==null;){if(De.key===Ee){if(Ee=ee.type,Ee===M){if(De.tag===7){d(J,De.sibling),Q=b(De,ee.props.children),Q.return=J,J=Q;break e}}else if(De.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&E0(Ee)===De.type){d(J,De.sibling),Q=b(De,ee.props),Q.ref=Ml(J,De,ee),Q.return=J,J=Q;break e}d(J,De);break}else i(J,De);De=De.sibling}ee.type===M?(Q=oa(ee.props.children,J.mode,me,ee.key),Q.return=J,J=Q):(me=td(ee.type,ee.key,ee.props,null,J.mode,me),me.ref=Ml(J,Q,ee),me.return=J,J=me)}return A(J);case T:e:{for(De=ee.key;Q!==null;){if(Q.key===De)if(Q.tag===4&&Q.stateNode.containerInfo===ee.containerInfo&&Q.stateNode.implementation===ee.implementation){d(J,Q.sibling),Q=b(Q,ee.children||[]),Q.return=J,J=Q;break e}else{d(J,Q);break}else i(J,Q);Q=Q.sibling}Q=Xh(ee,J.mode,me),Q.return=J,J=Q}return A(J);case U:return De=ee._init,Tt(J,Q,De(ee._payload),me)}if(mt(ee))return je(J,Q,ee,me);if(z(ee))return Se(J,Q,ee,me);Au(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,Q!==null&&Q.tag===6?(d(J,Q.sibling),Q=b(Q,ee),Q.return=J,J=Q):(d(J,Q),Q=Gh(ee,J.mode,me),Q.return=J,J=Q),A(J)):d(J,Q)}return Tt}var ni=P0(!0),T0=P0(!1),Mu=qs(null),Du=null,ri=null,ah=null;function ih(){ah=ri=Du=null}function lh(o){var i=Mu.current;xt(Mu),o._currentValue=i}function ch(o,i,d){for(;o!==null;){var h=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),o===d)break;o=o.return}}function si(o,i){Du=o,ah=ri=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(Mn=!0),o.firstContext=null)}function or(o){var i=o._currentValue;if(ah!==o)if(o={context:o,memoizedValue:i,next:null},ri===null){if(Du===null)throw Error(n(308));ri=o,Du.dependencies={lanes:0,firstContext:o}}else ri=ri.next=o;return i}var Zo=null;function uh(o){Zo===null?Zo=[o]:Zo.push(o)}function A0(o,i,d,h){var b=i.interleaved;return b===null?(d.next=d,uh(i)):(d.next=b.next,b.next=d),i.interleaved=d,ys(o,h)}function ys(o,i){o.lanes|=i;var d=o.alternate;for(d!==null&&(d.lanes|=i),d=o,o=o.return;o!==null;)o.childLanes|=i,d=o.alternate,d!==null&&(d.childLanes|=i),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Qs=!1;function dh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function M0(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function vs(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function Gs(o,i,d){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Ge&2)!==0){var b=h.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),h.pending=i,ys(o,d)}return b=h.interleaved,b===null?(i.next=i,uh(h)):(i.next=b.next,b.next=i),h.interleaved=i,ys(o,d)}function Ru(o,i,d){if(i=i.updateQueue,i!==null&&(i=i.shared,(d&4194240)!==0)){var h=i.lanes;h&=o.pendingLanes,d|=h,i.lanes=d,km(o,d)}}function D0(o,i){var d=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var b=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var A={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?b=C=A:C=C.next=A,d=d.next}while(d!==null);C===null?b=C=i:C=C.next=i}else b=C=i;d={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:h.shared,effects:h.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=i:o.next=i,d.lastBaseUpdate=i}function Ou(o,i,d,h){var b=o.updateQueue;Qs=!1;var C=b.firstBaseUpdate,A=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var K=V,re=K.next;K.next=null,A===null?C=re:A.next=re,A=K;var le=o.alternate;le!==null&&(le=le.updateQueue,V=le.lastBaseUpdate,V!==A&&(V===null?le.firstBaseUpdate=re:V.next=re,le.lastBaseUpdate=K))}if(C!==null){var de=b.baseState;A=0,le=re=K=null,V=C;do{var ie=V.lane,ve=V.eventTime;if((h&ie)===ie){le!==null&&(le=le.next={eventTime:ve,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var je=o,Se=V;switch(ie=i,ve=d,Se.tag){case 1:if(je=Se.payload,typeof je=="function"){de=je.call(ve,de,ie);break e}de=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Se.payload,ie=typeof je=="function"?je.call(ve,de,ie):je,ie==null)break e;de=X({},de,ie);break e;case 2:Qs=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,ie=b.effects,ie===null?b.effects=[V]:ie.push(V))}else ve={eventTime:ve,lane:ie,tag:V.tag,payload:V.payload,callback:V.callback,next:null},le===null?(re=le=ve,K=de):le=le.next=ve,A|=ie;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;ie=V,V=ie.next,ie.next=null,b.lastBaseUpdate=ie,b.shared.pending=null}}while(!0);if(le===null&&(K=de),b.baseState=K,b.firstBaseUpdate=re,b.lastBaseUpdate=le,i=b.shared.interleaved,i!==null){b=i;do A|=b.lane,b=b.next;while(b!==i)}else C===null&&(b.shared.lanes=0);ta|=A,o.lanes=A,o.memoizedState=de}}function R0(o,i,d){if(o=i.effects,i.effects=null,o!==null)for(i=0;i<o.length;i++){var h=o[i],b=h.callback;if(b!==null){if(h.callback=null,h=d,typeof b!="function")throw Error(n(191,b));b.call(h)}}}var Dl={},Kr=qs(Dl),Rl=qs(Dl),Ol=qs(Dl);function Jo(o){if(o===Dl)throw Error(n(174));return o}function fh(o,i){switch(ct(Ol,i),ct(Rl,o),ct(Kr,Dl),o=i.nodeType,o){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:Gt(null,"");break;default:o=o===8?i.parentNode:i,i=o.namespaceURI||null,o=o.tagName,i=Gt(i,o)}xt(Kr),ct(Kr,i)}function oi(){xt(Kr),xt(Rl),xt(Ol)}function O0(o){Jo(Ol.current);var i=Jo(Kr.current),d=Gt(i,o.type);i!==d&&(ct(Rl,o),ct(Kr,d))}function mh(o){Rl.current===o&&(xt(Kr),xt(Rl))}var vt=qs(0);function Iu(o){for(var i=o;i!==null;){if(i.tag===13){var d=i.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var hh=[];function ph(){for(var o=0;o<hh.length;o++)hh[o]._workInProgressVersionPrimary=null;hh.length=0}var Lu=E.ReactCurrentDispatcher,xh=E.ReactCurrentBatchConfig,ea=0,bt=null,Ft=null,Wt=null,Fu=!1,Il=!1,Ll=0,JE=0;function ln(){throw Error(n(321))}function gh(o,i){if(i===null)return!1;for(var d=0;d<i.length&&d<o.length;d++)if(!yr(o[d],i[d]))return!1;return!0}function yh(o,i,d,h,b,C){if(ea=C,bt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Lu.current=o===null||o.memoizedState===null?r3:s3,o=d(h,b),Il){C=0;do{if(Il=!1,Ll=0,25<=C)throw Error(n(301));C+=1,Wt=Ft=null,i.updateQueue=null,Lu.current=o3,o=d(h,b)}while(Il)}if(Lu.current=Bu,i=Ft!==null&&Ft.next!==null,ea=0,Wt=Ft=bt=null,Fu=!1,i)throw Error(n(300));return o}function vh(){var o=Ll!==0;return Ll=0,o}function Yr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?bt.memoizedState=Wt=o:Wt=Wt.next=o,Wt}function ar(){if(Ft===null){var o=bt.alternate;o=o!==null?o.memoizedState:null}else o=Ft.next;var i=Wt===null?bt.memoizedState:Wt.next;if(i!==null)Wt=i,Ft=o;else{if(o===null)throw Error(n(310));Ft=o,o={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Wt===null?bt.memoizedState=Wt=o:Wt=Wt.next=o}return Wt}function Fl(o,i){return typeof i=="function"?i(o):i}function bh(o){var i=ar(),d=i.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var h=Ft,b=h.baseQueue,C=d.pending;if(C!==null){if(b!==null){var A=b.next;b.next=C.next,C.next=A}h.baseQueue=b=C,d.pending=null}if(b!==null){C=b.next,h=h.baseState;var V=A=null,K=null,re=C;do{var le=re.lane;if((ea&le)===le)K!==null&&(K=K.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),h=re.hasEagerState?re.eagerState:o(h,re.action);else{var de={lane:le,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};K===null?(V=K=de,A=h):K=K.next=de,bt.lanes|=le,ta|=le}re=re.next}while(re!==null&&re!==C);K===null?A=h:K.next=V,yr(h,i.memoizedState)||(Mn=!0),i.memoizedState=h,i.baseState=A,i.baseQueue=K,d.lastRenderedState=h}if(o=d.interleaved,o!==null){b=o;do C=b.lane,bt.lanes|=C,ta|=C,b=b.next;while(b!==o)}else b===null&&(d.lanes=0);return[i.memoizedState,d.dispatch]}function wh(o){var i=ar(),d=i.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var h=d.dispatch,b=d.pending,C=i.memoizedState;if(b!==null){d.pending=null;var A=b=b.next;do C=o(C,A.action),A=A.next;while(A!==b);yr(C,i.memoizedState)||(Mn=!0),i.memoizedState=C,i.baseQueue===null&&(i.baseState=C),d.lastRenderedState=C}return[C,h]}function I0(){}function L0(o,i){var d=bt,h=ar(),b=i(),C=!yr(h.memoizedState,b);if(C&&(h.memoizedState=b,Mn=!0),h=h.queue,jh(V0.bind(null,d,h,o),[o]),h.getSnapshot!==i||C||Wt!==null&&Wt.memoizedState.tag&1){if(d.flags|=2048,$l(9,$0.bind(null,d,h,b,i),void 0,null),Ut===null)throw Error(n(349));(ea&30)!==0||F0(d,i,b)}return b}function F0(o,i,d){o.flags|=16384,o={getSnapshot:i,value:d},i=bt.updateQueue,i===null?(i={lastEffect:null,stores:null},bt.updateQueue=i,i.stores=[o]):(d=i.stores,d===null?i.stores=[o]:d.push(o))}function $0(o,i,d,h){i.value=d,i.getSnapshot=h,B0(i)&&z0(o)}function V0(o,i,d){return d(function(){B0(i)&&z0(o)})}function B0(o){var i=o.getSnapshot;o=o.value;try{var d=i();return!yr(o,d)}catch{return!0}}function z0(o){var i=ys(o,1);i!==null&&Nr(i,o,1,-1)}function W0(o){var i=Yr();return typeof o=="function"&&(o=o()),i.memoizedState=i.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fl,lastRenderedState:o},i.queue=o,o=o.dispatch=n3.bind(null,bt,o),[i.memoizedState,o]}function $l(o,i,d,h){return o={tag:o,create:i,destroy:d,deps:h,next:null},i=bt.updateQueue,i===null?(i={lastEffect:null,stores:null},bt.updateQueue=i,i.lastEffect=o.next=o):(d=i.lastEffect,d===null?i.lastEffect=o.next=o:(h=d.next,d.next=o,o.next=h,i.lastEffect=o)),o}function U0(){return ar().memoizedState}function $u(o,i,d,h){var b=Yr();bt.flags|=o,b.memoizedState=$l(1|i,d,void 0,h===void 0?null:h)}function Vu(o,i,d,h){var b=ar();h=h===void 0?null:h;var C=void 0;if(Ft!==null){var A=Ft.memoizedState;if(C=A.destroy,h!==null&&gh(h,A.deps)){b.memoizedState=$l(i,d,C,h);return}}bt.flags|=o,b.memoizedState=$l(1|i,d,C,h)}function H0(o,i){return $u(8390656,8,o,i)}function jh(o,i){return Vu(2048,8,o,i)}function q0(o,i){return Vu(4,2,o,i)}function K0(o,i){return Vu(4,4,o,i)}function Y0(o,i){if(typeof i=="function")return o=o(),i(o),function(){i(null)};if(i!=null)return o=o(),i.current=o,function(){i.current=null}}function Q0(o,i,d){return d=d!=null?d.concat([o]):null,Vu(4,4,Y0.bind(null,i,o),d)}function Nh(){}function G0(o,i){var d=ar();i=i===void 0?null:i;var h=d.memoizedState;return h!==null&&i!==null&&gh(i,h[1])?h[0]:(d.memoizedState=[o,i],o)}function X0(o,i){var d=ar();i=i===void 0?null:i;var h=d.memoizedState;return h!==null&&i!==null&&gh(i,h[1])?h[0]:(o=o(),d.memoizedState=[o,i],o)}function Z0(o,i,d){return(ea&21)===0?(o.baseState&&(o.baseState=!1,Mn=!0),o.memoizedState=d):(yr(d,i)||(d=Ev(),bt.lanes|=d,ta|=d,o.baseState=!0),i)}function e3(o,i){var d=st;st=d!==0&&4>d?d:4,o(!0);var h=xh.transition;xh.transition={};try{o(!1),i()}finally{st=d,xh.transition=h}}function J0(){return ar().memoizedState}function t3(o,i,d){var h=eo(o);if(d={lane:h,action:d,hasEagerState:!1,eagerState:null,next:null},eb(o))tb(i,d);else if(d=A0(o,i,d,h),d!==null){var b=yn();Nr(d,o,h,b),nb(d,i,h)}}function n3(o,i,d){var h=eo(o),b={lane:h,action:d,hasEagerState:!1,eagerState:null,next:null};if(eb(o))tb(i,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=i.lastRenderedReducer,C!==null))try{var A=i.lastRenderedState,V=C(A,d);if(b.hasEagerState=!0,b.eagerState=V,yr(V,A)){var K=i.interleaved;K===null?(b.next=b,uh(i)):(b.next=K.next,K.next=b),i.interleaved=b;return}}catch{}finally{}d=A0(o,i,b,h),d!==null&&(b=yn(),Nr(d,o,h,b),nb(d,i,h))}}function eb(o){var i=o.alternate;return o===bt||i!==null&&i===bt}function tb(o,i){Il=Fu=!0;var d=o.pending;d===null?i.next=i:(i.next=d.next,d.next=i),o.pending=i}function nb(o,i,d){if((d&4194240)!==0){var h=i.lanes;h&=o.pendingLanes,d|=h,i.lanes=d,km(o,d)}}var Bu={readContext:or,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},r3={readContext:or,useCallback:function(o,i){return Yr().memoizedState=[o,i===void 0?null:i],o},useContext:or,useEffect:H0,useImperativeHandle:function(o,i,d){return d=d!=null?d.concat([o]):null,$u(4194308,4,Y0.bind(null,i,o),d)},useLayoutEffect:function(o,i){return $u(4194308,4,o,i)},useInsertionEffect:function(o,i){return $u(4,2,o,i)},useMemo:function(o,i){var d=Yr();return i=i===void 0?null:i,o=o(),d.memoizedState=[o,i],o},useReducer:function(o,i,d){var h=Yr();return i=d!==void 0?d(i):i,h.memoizedState=h.baseState=i,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:i},h.queue=o,o=o.dispatch=t3.bind(null,bt,o),[h.memoizedState,o]},useRef:function(o){var i=Yr();return o={current:o},i.memoizedState=o},useState:W0,useDebugValue:Nh,useDeferredValue:function(o){return Yr().memoizedState=o},useTransition:function(){var o=W0(!1),i=o[0];return o=e3.bind(null,o[1]),Yr().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,d){var h=bt,b=Yr();if(yt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=i(),Ut===null)throw Error(n(349));(ea&30)!==0||F0(h,i,d)}b.memoizedState=d;var C={value:d,getSnapshot:i};return b.queue=C,H0(V0.bind(null,h,C,o),[o]),h.flags|=2048,$l(9,$0.bind(null,h,C,d,i),void 0,null),d},useId:function(){var o=Yr(),i=Ut.identifierPrefix;if(yt){var d=gs,h=xs;d=(h&~(1<<32-gr(h)-1)).toString(32)+d,i=":"+i+"R"+d,d=Ll++,0<d&&(i+="H"+d.toString(32)),i+=":"}else d=JE++,i=":"+i+"r"+d.toString(32)+":";return o.memoizedState=i},unstable_isNewReconciler:!1},s3={readContext:or,useCallback:G0,useContext:or,useEffect:jh,useImperativeHandle:Q0,useInsertionEffect:q0,useLayoutEffect:K0,useMemo:X0,useReducer:bh,useRef:U0,useState:function(){return bh(Fl)},useDebugValue:Nh,useDeferredValue:function(o){var i=ar();return Z0(i,Ft.memoizedState,o)},useTransition:function(){var o=bh(Fl)[0],i=ar().memoizedState;return[o,i]},useMutableSource:I0,useSyncExternalStore:L0,useId:J0,unstable_isNewReconciler:!1},o3={readContext:or,useCallback:G0,useContext:or,useEffect:jh,useImperativeHandle:Q0,useInsertionEffect:q0,useLayoutEffect:K0,useMemo:X0,useReducer:wh,useRef:U0,useState:function(){return wh(Fl)},useDebugValue:Nh,useDeferredValue:function(o){var i=ar();return Ft===null?i.memoizedState=o:Z0(i,Ft.memoizedState,o)},useTransition:function(){var o=wh(Fl)[0],i=ar().memoizedState;return[o,i]},useMutableSource:I0,useSyncExternalStore:L0,useId:J0,unstable_isNewReconciler:!1};function br(o,i){if(o&&o.defaultProps){i=X({},i),o=o.defaultProps;for(var d in o)i[d]===void 0&&(i[d]=o[d]);return i}return i}function Ch(o,i,d,h){i=o.memoizedState,d=d(h,i),d=d==null?i:X({},i,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var zu={isMounted:function(o){return(o=o._reactInternals)?Ko(o)===o:!1},enqueueSetState:function(o,i,d){o=o._reactInternals;var h=yn(),b=eo(o),C=vs(h,b);C.payload=i,d!=null&&(C.callback=d),i=Gs(o,C,b),i!==null&&(Nr(i,o,b,h),Ru(i,o,b))},enqueueReplaceState:function(o,i,d){o=o._reactInternals;var h=yn(),b=eo(o),C=vs(h,b);C.tag=1,C.payload=i,d!=null&&(C.callback=d),i=Gs(o,C,b),i!==null&&(Nr(i,o,b,h),Ru(i,o,b))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var d=yn(),h=eo(o),b=vs(d,h);b.tag=2,i!=null&&(b.callback=i),i=Gs(o,b,h),i!==null&&(Nr(i,o,h,d),Ru(i,o,h))}};function rb(o,i,d,h,b,C,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,C,A):i.prototype&&i.prototype.isPureReactComponent?!kl(d,h)||!kl(b,C):!0}function sb(o,i,d){var h=!1,b=Ks,C=i.contextType;return typeof C=="object"&&C!==null?C=or(C):(b=An(i)?Qo:an.current,h=i.contextTypes,C=(h=h!=null)?Za(o,b):Ks),i=new i(d,C),o.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=zu,o.stateNode=i,i._reactInternals=o,h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),i}function ob(o,i,d,h){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(d,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(d,h),i.state!==o&&zu.enqueueReplaceState(i,i.state,null)}function kh(o,i,d,h){var b=o.stateNode;b.props=d,b.state=o.memoizedState,b.refs={},dh(o);var C=i.contextType;typeof C=="object"&&C!==null?b.context=or(C):(C=An(i)?Qo:an.current,b.context=Za(o,C)),b.state=o.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(Ch(o,i,C,d),b.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(i=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),i!==b.state&&zu.enqueueReplaceState(b,b.state,null),Ou(o,d,b,h),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function ai(o,i){try{var d="",h=i;do d+=ae(h),h=h.return;while(h);var b=d}catch(C){b=`
|
|
39
|
+
Error generating stack: `+C.message+`
|
|
40
|
+
`+C.stack}return{value:o,source:i,stack:b,digest:null}}function Sh(o,i,d){return{value:o,source:null,stack:d??null,digest:i??null}}function _h(o,i){try{console.error(i.value)}catch(d){setTimeout(function(){throw d})}}var a3=typeof WeakMap=="function"?WeakMap:Map;function ab(o,i,d){d=vs(-1,d),d.tag=3,d.payload={element:null};var h=i.value;return d.callback=function(){Qu||(Qu=!0,zh=h),_h(o,i)},d}function ib(o,i,d){d=vs(-1,d),d.tag=3;var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var b=i.value;d.payload=function(){return h(b)},d.callback=function(){_h(o,i)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){_h(o,i),typeof h!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var A=i.stack;this.componentDidCatch(i.value,{componentStack:A!==null?A:""})}),d}function lb(o,i,d){var h=o.pingCache;if(h===null){h=o.pingCache=new a3;var b=new Set;h.set(i,b)}else b=h.get(i),b===void 0&&(b=new Set,h.set(i,b));b.has(d)||(b.add(d),o=b3.bind(null,o,i,d),i.then(o,o))}function cb(o){do{var i;if((i=o.tag===13)&&(i=o.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return o;o=o.return}while(o!==null);return null}function ub(o,i,d,h,b){return(o.mode&1)===0?(o===i?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(i=vs(-1,1),i.tag=2,Gs(d,i,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var i3=E.ReactCurrentOwner,Mn=!1;function gn(o,i,d,h){i.child=o===null?T0(i,null,d,h):ni(i,o.child,d,h)}function db(o,i,d,h,b){d=d.render;var C=i.ref;return si(i,b),h=yh(o,i,d,h,C,b),d=vh(),o!==null&&!Mn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,bs(o,i,b)):(yt&&d&&th(i),i.flags|=1,gn(o,i,h,b),i.child)}function fb(o,i,d,h,b){if(o===null){var C=d.type;return typeof C=="function"&&!Qh(C)&&C.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(i.tag=15,i.type=C,mb(o,i,C,h,b)):(o=td(d.type,null,h,i,i.mode,b),o.ref=i.ref,o.return=i,i.child=o)}if(C=o.child,(o.lanes&b)===0){var A=C.memoizedProps;if(d=d.compare,d=d!==null?d:kl,d(A,h)&&o.ref===i.ref)return bs(o,i,b)}return i.flags|=1,o=no(C,h),o.ref=i.ref,o.return=i,i.child=o}function mb(o,i,d,h,b){if(o!==null){var C=o.memoizedProps;if(kl(C,h)&&o.ref===i.ref)if(Mn=!1,i.pendingProps=h=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(Mn=!0);else return i.lanes=o.lanes,bs(o,i,b)}return Eh(o,i,d,h,b)}function hb(o,i,d){var h=i.pendingProps,b=h.children,C=o!==null?o.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(li,Yn),Yn|=d;else{if((d&1073741824)===0)return o=C!==null?C.baseLanes|d:d,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:o,cachePool:null,transitions:null},i.updateQueue=null,ct(li,Yn),Yn|=o,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=C!==null?C.baseLanes:d,ct(li,Yn),Yn|=h}else C!==null?(h=C.baseLanes|d,i.memoizedState=null):h=d,ct(li,Yn),Yn|=h;return gn(o,i,b,d),i.child}function pb(o,i){var d=i.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(i.flags|=512,i.flags|=2097152)}function Eh(o,i,d,h,b){var C=An(d)?Qo:an.current;return C=Za(i,C),si(i,b),d=yh(o,i,d,h,C,b),h=vh(),o!==null&&!Mn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~b,bs(o,i,b)):(yt&&h&&th(i),i.flags|=1,gn(o,i,d,b),i.child)}function xb(o,i,d,h,b){if(An(d)){var C=!0;Su(i)}else C=!1;if(si(i,b),i.stateNode===null)Uu(o,i),sb(i,d,h),kh(i,d,h,b),h=!0;else if(o===null){var A=i.stateNode,V=i.memoizedProps;A.props=V;var K=A.context,re=d.contextType;typeof re=="object"&&re!==null?re=or(re):(re=An(d)?Qo:an.current,re=Za(i,re));var le=d.getDerivedStateFromProps,de=typeof le=="function"||typeof A.getSnapshotBeforeUpdate=="function";de||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(V!==h||K!==re)&&ob(i,A,h,re),Qs=!1;var ie=i.memoizedState;A.state=ie,Ou(i,h,A,b),K=i.memoizedState,V!==h||ie!==K||Tn.current||Qs?(typeof le=="function"&&(Ch(i,d,le,h),K=i.memoizedState),(V=Qs||rb(i,d,V,h,ie,K,re))?(de||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(i.flags|=4194308)):(typeof A.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=K),A.props=h,A.state=K,A.context=re,h=V):(typeof A.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{A=i.stateNode,M0(o,i),V=i.memoizedProps,re=i.type===i.elementType?V:br(i.type,V),A.props=re,de=i.pendingProps,ie=A.context,K=d.contextType,typeof K=="object"&&K!==null?K=or(K):(K=An(d)?Qo:an.current,K=Za(i,K));var ve=d.getDerivedStateFromProps;(le=typeof ve=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(V!==de||ie!==K)&&ob(i,A,h,K),Qs=!1,ie=i.memoizedState,A.state=ie,Ou(i,h,A,b);var je=i.memoizedState;V!==de||ie!==je||Tn.current||Qs?(typeof ve=="function"&&(Ch(i,d,ve,h),je=i.memoizedState),(re=Qs||rb(i,d,re,h,ie,je,K)||!1)?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(h,je,K),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(h,je,K)),typeof A.componentDidUpdate=="function"&&(i.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof A.componentDidUpdate!="function"||V===o.memoizedProps&&ie===o.memoizedState||(i.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ie===o.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=je),A.props=h,A.state=je,A.context=K,h=re):(typeof A.componentDidUpdate!="function"||V===o.memoizedProps&&ie===o.memoizedState||(i.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ie===o.memoizedState||(i.flags|=1024),h=!1)}return Ph(o,i,d,h,C,b)}function Ph(o,i,d,h,b,C){pb(o,i);var A=(i.flags&128)!==0;if(!h&&!A)return b&&w0(i,d,!1),bs(o,i,C);h=i.stateNode,i3.current=i;var V=A&&typeof d.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,o!==null&&A?(i.child=ni(i,o.child,null,C),i.child=ni(i,null,V,C)):gn(o,i,V,C),i.memoizedState=h.state,b&&w0(i,d,!0),i.child}function gb(o){var i=o.stateNode;i.pendingContext?v0(o,i.pendingContext,i.pendingContext!==i.context):i.context&&v0(o,i.context,!1),fh(o,i.containerInfo)}function yb(o,i,d,h,b){return ti(),oh(b),i.flags|=256,gn(o,i,d,h),i.child}var Th={dehydrated:null,treeContext:null,retryLane:0};function Ah(o){return{baseLanes:o,cachePool:null,transitions:null}}function vb(o,i,d){var h=i.pendingProps,b=vt.current,C=!1,A=(i.flags&128)!==0,V;if((V=A)||(V=o!==null&&o.memoizedState===null?!1:(b&2)!==0),V?(C=!0,i.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),ct(vt,b&1),o===null)return sh(i),o=i.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((i.mode&1)===0?i.lanes=1:o.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(A=h.children,o=h.fallback,C?(h=i.mode,C=i.child,A={mode:"hidden",children:A},(h&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=A):C=nd(A,h,0,null),o=oa(o,h,d,null),C.return=i,o.return=i,C.sibling=o,i.child=C,i.child.memoizedState=Ah(d),i.memoizedState=Th,o):Mh(i,A));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return l3(o,i,A,h,V,b,d);if(C){C=h.fallback,A=i.mode,b=o.child,V=b.sibling;var K={mode:"hidden",children:h.children};return(A&1)===0&&i.child!==b?(h=i.child,h.childLanes=0,h.pendingProps=K,i.deletions=null):(h=no(b,K),h.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=no(V,C):(C=oa(C,A,d,null),C.flags|=2),C.return=i,h.return=i,h.sibling=C,i.child=h,h=C,C=i.child,A=o.child.memoizedState,A=A===null?Ah(d):{baseLanes:A.baseLanes|d,cachePool:null,transitions:A.transitions},C.memoizedState=A,C.childLanes=o.childLanes&~d,i.memoizedState=Th,h}return C=o.child,o=C.sibling,h=no(C,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=d),h.return=i,h.sibling=null,o!==null&&(d=i.deletions,d===null?(i.deletions=[o],i.flags|=16):d.push(o)),i.child=h,i.memoizedState=null,h}function Mh(o,i){return i=nd({mode:"visible",children:i},o.mode,0,null),i.return=o,o.child=i}function Wu(o,i,d,h){return h!==null&&oh(h),ni(i,o.child,null,d),o=Mh(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function l3(o,i,d,h,b,C,A){if(d)return i.flags&256?(i.flags&=-257,h=Sh(Error(n(422))),Wu(o,i,A,h)):i.memoizedState!==null?(i.child=o.child,i.flags|=128,null):(C=h.fallback,b=i.mode,h=nd({mode:"visible",children:h.children},b,0,null),C=oa(C,b,A,null),C.flags|=2,h.return=i,C.return=i,h.sibling=C,i.child=h,(i.mode&1)!==0&&ni(i,o.child,null,A),i.child.memoizedState=Ah(A),i.memoizedState=Th,C);if((i.mode&1)===0)return Wu(o,i,A,null);if(b.data==="$!"){if(h=b.nextSibling&&b.nextSibling.dataset,h)var V=h.dgst;return h=V,C=Error(n(419)),h=Sh(C,h,void 0),Wu(o,i,A,h)}if(V=(A&o.childLanes)!==0,Mn||V){if(h=Ut,h!==null){switch(A&-A){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(h.suspendedLanes|A))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,ys(o,b),Nr(h,o,b,-1))}return Yh(),h=Sh(Error(n(421))),Wu(o,i,A,h)}return b.data==="$?"?(i.flags|=128,i.child=o.child,i=w3.bind(null,o),b._reactRetry=i,null):(o=C.treeContext,Kn=Hs(b.nextSibling),qn=i,yt=!0,vr=null,o!==null&&(rr[sr++]=xs,rr[sr++]=gs,rr[sr++]=Go,xs=o.id,gs=o.overflow,Go=i),i=Mh(i,h.children),i.flags|=4096,i)}function bb(o,i,d){o.lanes|=i;var h=o.alternate;h!==null&&(h.lanes|=i),ch(o.return,i,d)}function Dh(o,i,d,h,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:b}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=h,C.tail=d,C.tailMode=b)}function wb(o,i,d){var h=i.pendingProps,b=h.revealOrder,C=h.tail;if(gn(o,i,h.children,d),h=vt.current,(h&2)!==0)h=h&1|2,i.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=i.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&bb(o,d,i);else if(o.tag===19)bb(o,d,i);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}h&=1}if(ct(vt,h),(i.mode&1)===0)i.memoizedState=null;else switch(b){case"forwards":for(d=i.child,b=null;d!==null;)o=d.alternate,o!==null&&Iu(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=i.child,i.child=null):(b=d.sibling,d.sibling=null),Dh(i,!1,b,d,C);break;case"backwards":for(d=null,b=i.child,i.child=null;b!==null;){if(o=b.alternate,o!==null&&Iu(o)===null){i.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}Dh(i,!0,d,null,C);break;case"together":Dh(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Uu(o,i){(i.mode&1)===0&&o!==null&&(o.alternate=null,i.alternate=null,i.flags|=2)}function bs(o,i,d){if(o!==null&&(i.dependencies=o.dependencies),ta|=i.lanes,(d&i.childLanes)===0)return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,d=no(o,o.pendingProps),i.child=d,d.return=i;o.sibling!==null;)o=o.sibling,d=d.sibling=no(o,o.pendingProps),d.return=i;d.sibling=null}return i.child}function c3(o,i,d){switch(i.tag){case 3:gb(i),ti();break;case 5:O0(i);break;case 1:An(i.type)&&Su(i);break;case 4:fh(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,b=i.memoizedProps.value;ct(Mu,h._currentValue),h._currentValue=b;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(ct(vt,vt.current&1),i.flags|=128,null):(d&i.child.childLanes)!==0?vb(o,i,d):(ct(vt,vt.current&1),o=bs(o,i,d),o!==null?o.sibling:null);ct(vt,vt.current&1);break;case 19:if(h=(d&i.childLanes)!==0,(o.flags&128)!==0){if(h)return wb(o,i,d);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ct(vt,vt.current),h)break;return null;case 22:case 23:return i.lanes=0,hb(o,i,d)}return bs(o,i,d)}var jb,Rh,Nb,Cb;jb=function(o,i){for(var d=i.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===i)break;for(;d.sibling===null;){if(d.return===null||d.return===i)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Rh=function(){},Nb=function(o,i,d,h){var b=o.memoizedProps;if(b!==h){o=i.stateNode,Jo(Kr.current);var C=null;switch(d){case"input":b=Et(o,b),h=Et(o,h),C=[];break;case"select":b=X({},b,{value:void 0}),h=X({},h,{value:void 0}),C=[];break;case"textarea":b=Pe(o,b),h=Pe(o,h),C=[];break;default:typeof b.onClick!="function"&&typeof h.onClick=="function"&&(o.onclick=Nu)}zr(d,h);var A;d=null;for(re in b)if(!h.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var V=b[re];for(A in V)V.hasOwnProperty(A)&&(d||(d={}),d[A]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(a.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in h){var K=h[re];if(V=b!=null?b[re]:void 0,h.hasOwnProperty(re)&&K!==V&&(K!=null||V!=null))if(re==="style")if(V){for(A in V)!V.hasOwnProperty(A)||K&&K.hasOwnProperty(A)||(d||(d={}),d[A]="");for(A in K)K.hasOwnProperty(A)&&V[A]!==K[A]&&(d||(d={}),d[A]=K[A])}else d||(C||(C=[]),C.push(re,d)),d=K;else re==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,V=V?V.__html:void 0,K!=null&&V!==K&&(C=C||[]).push(re,K)):re==="children"?typeof K!="string"&&typeof K!="number"||(C=C||[]).push(re,""+K):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(a.hasOwnProperty(re)?(K!=null&&re==="onScroll"&&pt("scroll",o),C||V===K||(C=[])):(C=C||[]).push(re,K))}d&&(C=C||[]).push("style",d);var re=C;(i.updateQueue=re)&&(i.flags|=4)}},Cb=function(o,i,d,h){d!==h&&(i.flags|=4)};function Vl(o,i){if(!yt)switch(o.tailMode){case"hidden":i=o.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function cn(o){var i=o.alternate!==null&&o.alternate.child===o.child,d=0,h=0;if(i)for(var b=o.child;b!==null;)d|=b.lanes|b.childLanes,h|=b.subtreeFlags&14680064,h|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)d|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=h,o.childLanes=d,i}function u3(o,i,d){var h=i.pendingProps;switch(nh(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(i),null;case 1:return An(i.type)&&ku(),cn(i),null;case 3:return h=i.stateNode,oi(),xt(Tn),xt(an),ph(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Tu(i)?i.flags|=4:o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,vr!==null&&(Hh(vr),vr=null))),Rh(o,i),cn(i),null;case 5:mh(i);var b=Jo(Ol.current);if(d=i.type,o!==null&&i.stateNode!=null)Nb(o,i,d,h,b),o.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(n(166));return cn(i),null}if(o=Jo(Kr.current),Tu(i)){h=i.stateNode,d=i.type;var C=i.memoizedProps;switch(h[qr]=i,h[Tl]=C,o=(i.mode&1)!==0,d){case"dialog":pt("cancel",h),pt("close",h);break;case"iframe":case"object":case"embed":pt("load",h);break;case"video":case"audio":for(b=0;b<_l.length;b++)pt(_l[b],h);break;case"source":pt("error",h);break;case"img":case"image":case"link":pt("error",h),pt("load",h);break;case"details":pt("toggle",h);break;case"input":Yt(h,C),pt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!C.multiple},pt("invalid",h);break;case"textarea":Ye(h,C),pt("invalid",h)}zr(d,C),b=null;for(var A in C)if(C.hasOwnProperty(A)){var V=C[A];A==="children"?typeof V=="string"?h.textContent!==V&&(C.suppressHydrationWarning!==!0&&ju(h.textContent,V,o),b=["children",V]):typeof V=="number"&&h.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&ju(h.textContent,V,o),b=["children",""+V]):a.hasOwnProperty(A)&&V!=null&&A==="onScroll"&&pt("scroll",h)}switch(d){case"input":ce(h),Un(h,C,!0);break;case"textarea":ce(h),Rt(h);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(h.onclick=Nu)}h=b,i.updateQueue=h,h!==null&&(i.flags|=4)}else{A=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ht(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=A.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof h.is=="string"?o=A.createElement(d,{is:h.is}):(o=A.createElement(d),d==="select"&&(A=o,h.multiple?A.multiple=!0:h.size&&(A.size=h.size))):o=A.createElementNS(o,d),o[qr]=i,o[Tl]=h,jb(o,i,!1,!1),i.stateNode=o;e:{switch(A=ul(d,h),d){case"dialog":pt("cancel",o),pt("close",o),b=h;break;case"iframe":case"object":case"embed":pt("load",o),b=h;break;case"video":case"audio":for(b=0;b<_l.length;b++)pt(_l[b],o);b=h;break;case"source":pt("error",o),b=h;break;case"img":case"image":case"link":pt("error",o),pt("load",o),b=h;break;case"details":pt("toggle",o),b=h;break;case"input":Yt(o,h),b=Et(o,h),pt("invalid",o);break;case"option":b=h;break;case"select":o._wrapperState={wasMultiple:!!h.multiple},b=X({},h,{value:void 0}),pt("invalid",o);break;case"textarea":Ye(o,h),b=Pe(o,h),pt("invalid",o);break;default:b=h}zr(d,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var K=V[C];C==="style"?ms(o,K):C==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&ne(o,K)):C==="children"?typeof K=="string"?(d!=="textarea"||K!=="")&&ke(o,K):typeof K=="number"&&ke(o,""+K):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(a.hasOwnProperty(C)?K!=null&&C==="onScroll"&&pt("scroll",o):K!=null&&S(o,C,K,A))}switch(d){case"input":ce(o),Un(o,h,!1);break;case"textarea":ce(o),Rt(o);break;case"option":h.value!=null&&o.setAttribute("value",""+he(h.value));break;case"select":o.multiple=!!h.multiple,C=h.value,C!=null?Z(o,!!h.multiple,C,!1):h.defaultValue!=null&&Z(o,!!h.multiple,h.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=Nu)}switch(d){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return cn(i),null;case 6:if(o&&i.stateNode!=null)Cb(o,i,o.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(n(166));if(d=Jo(Ol.current),Jo(Kr.current),Tu(i)){if(h=i.stateNode,d=i.memoizedProps,h[qr]=i,(C=h.nodeValue!==d)&&(o=qn,o!==null))switch(o.tag){case 3:ju(h.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&ju(h.nodeValue,d,(o.mode&1)!==0)}C&&(i.flags|=4)}else h=(d.nodeType===9?d:d.ownerDocument).createTextNode(h),h[qr]=i,i.stateNode=h}return cn(i),null;case 13:if(xt(vt),h=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(yt&&Kn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)_0(),ti(),i.flags|=98560,C=!1;else if(C=Tu(i),h!==null&&h.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=i.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[qr]=i}else ti(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),C=!1}else vr!==null&&(Hh(vr),vr=null),C=!0;if(!C)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=d,i):(h=h!==null,h!==(o!==null&&o.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(o===null||(vt.current&1)!==0?$t===0&&($t=3):Yh())),i.updateQueue!==null&&(i.flags|=4),cn(i),null);case 4:return oi(),Rh(o,i),o===null&&El(i.stateNode.containerInfo),cn(i),null;case 10:return lh(i.type._context),cn(i),null;case 17:return An(i.type)&&ku(),cn(i),null;case 19:if(xt(vt),C=i.memoizedState,C===null)return cn(i),null;if(h=(i.flags&128)!==0,A=C.rendering,A===null)if(h)Vl(C,!1);else{if($t!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(A=Iu(o),A!==null){for(i.flags|=128,Vl(C,!1),h=A.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=d,d=i.child;d!==null;)C=d,o=h,C.flags&=14680066,A=C.alternate,A===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=A.childLanes,C.lanes=A.lanes,C.child=A.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=A.memoizedProps,C.memoizedState=A.memoizedState,C.updateQueue=A.updateQueue,C.type=A.type,o=A.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return ct(vt,vt.current&1|2),i.child}o=o.sibling}C.tail!==null&&Pt()>ci&&(i.flags|=128,h=!0,Vl(C,!1),i.lanes=4194304)}else{if(!h)if(o=Iu(A),o!==null){if(i.flags|=128,h=!0,d=o.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),Vl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!A.alternate&&!yt)return cn(i),null}else 2*Pt()-C.renderingStartTime>ci&&d!==1073741824&&(i.flags|=128,h=!0,Vl(C,!1),i.lanes=4194304);C.isBackwards?(A.sibling=i.child,i.child=A):(d=C.last,d!==null?d.sibling=A:i.child=A,C.last=A)}return C.tail!==null?(i=C.tail,C.rendering=i,C.tail=i.sibling,C.renderingStartTime=Pt(),i.sibling=null,d=vt.current,ct(vt,h?d&1|2:d&1),i):(cn(i),null);case 22:case 23:return Kh(),h=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(Yn&1073741824)!==0&&(cn(i),i.subtreeFlags&6&&(i.flags|=8192)):cn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function d3(o,i){switch(nh(i),i.tag){case 1:return An(i.type)&&ku(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return oi(),xt(Tn),xt(an),ph(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return mh(i),null;case 13:if(xt(vt),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));ti()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return xt(vt),null;case 4:return oi(),null;case 10:return lh(i.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var Hu=!1,un=!1,f3=typeof WeakSet=="function"?WeakSet:Set,we=null;function ii(o,i){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(h){Nt(o,i,h)}else d.current=null}function Oh(o,i,d){try{d()}catch(h){Nt(o,i,h)}}var kb=!1;function m3(o,i){if(Km=du,o=r0(),$m(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var b=h.anchorOffset,C=h.focusNode;h=h.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var A=0,V=-1,K=-1,re=0,le=0,de=o,ie=null;t:for(;;){for(var ve;de!==d||b!==0&&de.nodeType!==3||(V=A+b),de!==C||h!==0&&de.nodeType!==3||(K=A+h),de.nodeType===3&&(A+=de.nodeValue.length),(ve=de.firstChild)!==null;)ie=de,de=ve;for(;;){if(de===o)break t;if(ie===d&&++re===b&&(V=A),ie===C&&++le===h&&(K=A),(ve=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=ve}d=V===-1||K===-1?null:{start:V,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(Ym={focusedElem:o,selectionRange:d},du=!1,we=i;we!==null;)if(i=we,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,we=o;else for(;we!==null;){i=we;try{var je=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(je!==null){var Se=je.memoizedProps,Tt=je.memoizedState,J=i.stateNode,Q=J.getSnapshotBeforeUpdate(i.elementType===i.type?Se:br(i.type,Se),Tt);J.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var ee=i.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(me){Nt(i,i.return,me)}if(o=i.sibling,o!==null){o.return=i.return,we=o;break}we=i.return}return je=kb,kb=!1,je}function Bl(o,i,d){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var b=h=h.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Oh(i,d,C)}b=b.next}while(b!==h)}}function qu(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&o)===o){var h=d.create;d.destroy=h()}d=d.next}while(d!==i)}}function Ih(o){var i=o.ref;if(i!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof i=="function"?i(o):i.current=o}}function Sb(o){var i=o.alternate;i!==null&&(o.alternate=null,Sb(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[qr],delete i[Tl],delete i[Zm],delete i[QE],delete i[GE])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function _b(o){return o.tag===5||o.tag===3||o.tag===4}function Eb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||_b(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Lh(o,i,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?d.nodeType===8?d.parentNode.insertBefore(o,i):d.insertBefore(o,i):(d.nodeType===8?(i=d.parentNode,i.insertBefore(o,d)):(i=d,i.appendChild(o)),d=d._reactRootContainer,d!=null||i.onclick!==null||(i.onclick=Nu));else if(h!==4&&(o=o.child,o!==null))for(Lh(o,i,d),o=o.sibling;o!==null;)Lh(o,i,d),o=o.sibling}function Fh(o,i,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?d.insertBefore(o,i):d.appendChild(o);else if(h!==4&&(o=o.child,o!==null))for(Fh(o,i,d),o=o.sibling;o!==null;)Fh(o,i,d),o=o.sibling}var Zt=null,wr=!1;function Xs(o,i,d){for(d=d.child;d!==null;)Pb(o,i,d),d=d.sibling}function Pb(o,i,d){if(Hr&&typeof Hr.onCommitFiberUnmount=="function")try{Hr.onCommitFiberUnmount(ou,d)}catch{}switch(d.tag){case 5:un||ii(d,i);case 6:var h=Zt,b=wr;Zt=null,Xs(o,i,d),Zt=h,wr=b,Zt!==null&&(wr?(o=Zt,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Zt.removeChild(d.stateNode));break;case 18:Zt!==null&&(wr?(o=Zt,d=d.stateNode,o.nodeType===8?Xm(o.parentNode,d):o.nodeType===1&&Xm(o,d),vl(o)):Xm(Zt,d.stateNode));break;case 4:h=Zt,b=wr,Zt=d.stateNode.containerInfo,wr=!0,Xs(o,i,d),Zt=h,wr=b;break;case 0:case 11:case 14:case 15:if(!un&&(h=d.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){b=h=h.next;do{var C=b,A=C.destroy;C=C.tag,A!==void 0&&((C&2)!==0||(C&4)!==0)&&Oh(d,i,A),b=b.next}while(b!==h)}Xs(o,i,d);break;case 1:if(!un&&(ii(d,i),h=d.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=d.memoizedProps,h.state=d.memoizedState,h.componentWillUnmount()}catch(V){Nt(d,i,V)}Xs(o,i,d);break;case 21:Xs(o,i,d);break;case 22:d.mode&1?(un=(h=un)||d.memoizedState!==null,Xs(o,i,d),un=h):Xs(o,i,d);break;default:Xs(o,i,d)}}function Tb(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new f3),i.forEach(function(h){var b=j3.bind(null,o,h);d.has(h)||(d.add(h),h.then(b,b))})}}function jr(o,i){var d=i.deletions;if(d!==null)for(var h=0;h<d.length;h++){var b=d[h];try{var C=o,A=i,V=A;e:for(;V!==null;){switch(V.tag){case 5:Zt=V.stateNode,wr=!1;break e;case 3:Zt=V.stateNode.containerInfo,wr=!0;break e;case 4:Zt=V.stateNode.containerInfo,wr=!0;break e}V=V.return}if(Zt===null)throw Error(n(160));Pb(C,A,b),Zt=null,wr=!1;var K=b.alternate;K!==null&&(K.return=null),b.return=null}catch(re){Nt(b,i,re)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)Ab(i,o),i=i.sibling}function Ab(o,i){var d=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(jr(i,o),Qr(o),h&4){try{Bl(3,o,o.return),qu(3,o)}catch(Se){Nt(o,o.return,Se)}try{Bl(5,o,o.return)}catch(Se){Nt(o,o.return,Se)}}break;case 1:jr(i,o),Qr(o),h&512&&d!==null&&ii(d,d.return);break;case 5:if(jr(i,o),Qr(o),h&512&&d!==null&&ii(d,d.return),o.flags&32){var b=o.stateNode;try{ke(b,"")}catch(Se){Nt(o,o.return,Se)}}if(h&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,A=d!==null?d.memoizedProps:C,V=o.type,K=o.updateQueue;if(o.updateQueue=null,K!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&Qt(b,C),ul(V,A);var re=ul(V,C);for(A=0;A<K.length;A+=2){var le=K[A],de=K[A+1];le==="style"?ms(b,de):le==="dangerouslySetInnerHTML"?ne(b,de):le==="children"?ke(b,de):S(b,le,de,re)}switch(V){case"input":zt(b,C);break;case"textarea":rt(b,C);break;case"select":var ie=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var ve=C.value;ve!=null?Z(b,!!C.multiple,ve,!1):ie!==!!C.multiple&&(C.defaultValue!=null?Z(b,!!C.multiple,C.defaultValue,!0):Z(b,!!C.multiple,C.multiple?[]:"",!1))}b[Tl]=C}catch(Se){Nt(o,o.return,Se)}}break;case 6:if(jr(i,o),Qr(o),h&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Se){Nt(o,o.return,Se)}}break;case 3:if(jr(i,o),Qr(o),h&4&&d!==null&&d.memoizedState.isDehydrated)try{vl(i.containerInfo)}catch(Se){Nt(o,o.return,Se)}break;case 4:jr(i,o),Qr(o);break;case 13:jr(i,o),Qr(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Bh=Pt())),h&4&&Tb(o);break;case 22:if(le=d!==null&&d.memoizedState!==null,o.mode&1?(un=(re=un)||le,jr(i,o),un=re):jr(i,o),Qr(o),h&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!le&&(o.mode&1)!==0)for(we=o,le=o.child;le!==null;){for(de=we=le;we!==null;){switch(ie=we,ve=ie.child,ie.tag){case 0:case 11:case 14:case 15:Bl(4,ie,ie.return);break;case 1:ii(ie,ie.return);var je=ie.stateNode;if(typeof je.componentWillUnmount=="function"){h=ie,d=ie.return;try{i=h,je.props=i.memoizedProps,je.state=i.memoizedState,je.componentWillUnmount()}catch(Se){Nt(h,d,Se)}}break;case 5:ii(ie,ie.return);break;case 22:if(ie.memoizedState!==null){Rb(de);continue}}ve!==null?(ve.return=ie,we=ve):Rb(de)}le=le.sibling}e:for(le=null,de=o;;){if(de.tag===5){if(le===null){le=de;try{b=de.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=de.stateNode,K=de.memoizedProps.style,A=K!=null&&K.hasOwnProperty("display")?K.display:null,V.style.display=_n("display",A))}catch(Se){Nt(o,o.return,Se)}}}else if(de.tag===6){if(le===null)try{de.stateNode.nodeValue=re?"":de.memoizedProps}catch(Se){Nt(o,o.return,Se)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===o)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===o)break e;for(;de.sibling===null;){if(de.return===null||de.return===o)break e;le===de&&(le=null),de=de.return}le===de&&(le=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:jr(i,o),Qr(o),h&4&&Tb(o);break;case 21:break;default:jr(i,o),Qr(o)}}function Qr(o){var i=o.flags;if(i&2){try{e:{for(var d=o.return;d!==null;){if(_b(d)){var h=d;break e}d=d.return}throw Error(n(160))}switch(h.tag){case 5:var b=h.stateNode;h.flags&32&&(ke(b,""),h.flags&=-33);var C=Eb(o);Fh(o,C,b);break;case 3:case 4:var A=h.stateNode.containerInfo,V=Eb(o);Lh(o,V,A);break;default:throw Error(n(161))}}catch(K){Nt(o,o.return,K)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function h3(o,i,d){we=o,Mb(o)}function Mb(o,i,d){for(var h=(o.mode&1)!==0;we!==null;){var b=we,C=b.child;if(b.tag===22&&h){var A=b.memoizedState!==null||Hu;if(!A){var V=b.alternate,K=V!==null&&V.memoizedState!==null||un;V=Hu;var re=un;if(Hu=A,(un=K)&&!re)for(we=b;we!==null;)A=we,K=A.child,A.tag===22&&A.memoizedState!==null?Ob(b):K!==null?(K.return=A,we=K):Ob(b);for(;C!==null;)we=C,Mb(C),C=C.sibling;we=b,Hu=V,un=re}Db(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,we=C):Db(o)}}function Db(o){for(;we!==null;){var i=we;if((i.flags&8772)!==0){var d=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:un||qu(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!un)if(d===null)h.componentDidMount();else{var b=i.elementType===i.type?d.memoizedProps:br(i.type,d.memoizedProps);h.componentDidUpdate(b,d.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var C=i.updateQueue;C!==null&&R0(i,C,h);break;case 3:var A=i.updateQueue;if(A!==null){if(d=null,i.child!==null)switch(i.child.tag){case 5:d=i.child.stateNode;break;case 1:d=i.child.stateNode}R0(i,A,d)}break;case 5:var V=i.stateNode;if(d===null&&i.flags&4){d=V;var K=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&d.focus();break;case"img":K.src&&(d.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var re=i.alternate;if(re!==null){var le=re.memoizedState;if(le!==null){var de=le.dehydrated;de!==null&&vl(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}un||i.flags&512&&Ih(i)}catch(ie){Nt(i,i.return,ie)}}if(i===o){we=null;break}if(d=i.sibling,d!==null){d.return=i.return,we=d;break}we=i.return}}function Rb(o){for(;we!==null;){var i=we;if(i===o){we=null;break}var d=i.sibling;if(d!==null){d.return=i.return,we=d;break}we=i.return}}function Ob(o){for(;we!==null;){var i=we;try{switch(i.tag){case 0:case 11:case 15:var d=i.return;try{qu(4,i)}catch(K){Nt(i,d,K)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var b=i.return;try{h.componentDidMount()}catch(K){Nt(i,b,K)}}var C=i.return;try{Ih(i)}catch(K){Nt(i,C,K)}break;case 5:var A=i.return;try{Ih(i)}catch(K){Nt(i,A,K)}}}catch(K){Nt(i,i.return,K)}if(i===o){we=null;break}var V=i.sibling;if(V!==null){V.return=i.return,we=V;break}we=i.return}}var p3=Math.ceil,Ku=E.ReactCurrentDispatcher,$h=E.ReactCurrentOwner,ir=E.ReactCurrentBatchConfig,Ge=0,Ut=null,Ot=null,Jt=0,Yn=0,li=qs(0),$t=0,zl=null,ta=0,Yu=0,Vh=0,Wl=null,Dn=null,Bh=0,ci=1/0,ws=null,Qu=!1,zh=null,Zs=null,Gu=!1,Js=null,Xu=0,Ul=0,Wh=null,Zu=-1,Ju=0;function yn(){return(Ge&6)!==0?Pt():Zu!==-1?Zu:Zu=Pt()}function eo(o){return(o.mode&1)===0?1:(Ge&2)!==0&&Jt!==0?Jt&-Jt:ZE.transition!==null?(Ju===0&&(Ju=Ev()),Ju):(o=st,o!==0||(o=window.event,o=o===void 0?16:Lv(o.type)),o)}function Nr(o,i,d,h){if(50<Ul)throw Ul=0,Wh=null,Error(n(185));hl(o,d,h),((Ge&2)===0||o!==Ut)&&(o===Ut&&((Ge&2)===0&&(Yu|=d),$t===4&&to(o,Jt)),Rn(o,h),d===1&&Ge===0&&(i.mode&1)===0&&(ci=Pt()+500,_u&&Ys()))}function Rn(o,i){var d=o.callbackNode;Z5(o,i);var h=lu(o,o===Ut?Jt:0);if(h===0)d!==null&&kv(d),o.callbackNode=null,o.callbackPriority=0;else if(i=h&-h,o.callbackPriority!==i){if(d!=null&&kv(d),i===1)o.tag===0?XE(Lb.bind(null,o)):j0(Lb.bind(null,o)),KE(function(){(Ge&6)===0&&Ys()}),d=null;else{switch(Pv(h)){case 1:d=jm;break;case 4:d=Sv;break;case 16:d=su;break;case 536870912:d=_v;break;default:d=su}d=Hb(d,Ib.bind(null,o))}o.callbackPriority=i,o.callbackNode=d}}function Ib(o,i){if(Zu=-1,Ju=0,(Ge&6)!==0)throw Error(n(327));var d=o.callbackNode;if(ui()&&o.callbackNode!==d)return null;var h=lu(o,o===Ut?Jt:0);if(h===0)return null;if((h&30)!==0||(h&o.expiredLanes)!==0||i)i=ed(o,h);else{i=h;var b=Ge;Ge|=2;var C=$b();(Ut!==o||Jt!==i)&&(ws=null,ci=Pt()+500,ra(o,i));do try{y3();break}catch(V){Fb(o,V)}while(!0);ih(),Ku.current=C,Ge=b,Ot!==null?i=0:(Ut=null,Jt=0,i=$t)}if(i!==0){if(i===2&&(b=Nm(o),b!==0&&(h=b,i=Uh(o,b))),i===1)throw d=zl,ra(o,0),to(o,h),Rn(o,Pt()),d;if(i===6)to(o,h);else{if(b=o.current.alternate,(h&30)===0&&!x3(b)&&(i=ed(o,h),i===2&&(C=Nm(o),C!==0&&(h=C,i=Uh(o,C))),i===1))throw d=zl,ra(o,0),to(o,h),Rn(o,Pt()),d;switch(o.finishedWork=b,o.finishedLanes=h,i){case 0:case 1:throw Error(n(345));case 2:sa(o,Dn,ws);break;case 3:if(to(o,h),(h&130023424)===h&&(i=Bh+500-Pt(),10<i)){if(lu(o,0)!==0)break;if(b=o.suspendedLanes,(b&h)!==h){yn(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Gm(sa.bind(null,o,Dn,ws),i);break}sa(o,Dn,ws);break;case 4:if(to(o,h),(h&4194240)===h)break;for(i=o.eventTimes,b=-1;0<h;){var A=31-gr(h);C=1<<A,A=i[A],A>b&&(b=A),h&=~C}if(h=b,h=Pt()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*p3(h/1960))-h,10<h){o.timeoutHandle=Gm(sa.bind(null,o,Dn,ws),h);break}sa(o,Dn,ws);break;case 5:sa(o,Dn,ws);break;default:throw Error(n(329))}}}return Rn(o,Pt()),o.callbackNode===d?Ib.bind(null,o):null}function Uh(o,i){var d=Wl;return o.current.memoizedState.isDehydrated&&(ra(o,i).flags|=256),o=ed(o,i),o!==2&&(i=Dn,Dn=d,i!==null&&Hh(i)),o}function Hh(o){Dn===null?Dn=o:Dn.push.apply(Dn,o)}function x3(o){for(var i=o;;){if(i.flags&16384){var d=i.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var h=0;h<d.length;h++){var b=d[h],C=b.getSnapshot;b=b.value;try{if(!yr(C(),b))return!1}catch{return!1}}}if(d=i.child,i.subtreeFlags&16384&&d!==null)d.return=i,i=d;else{if(i===o)break;for(;i.sibling===null;){if(i.return===null||i.return===o)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function to(o,i){for(i&=~Vh,i&=~Yu,o.suspendedLanes|=i,o.pingedLanes&=~i,o=o.expirationTimes;0<i;){var d=31-gr(i),h=1<<d;o[d]=-1,i&=~h}}function Lb(o){if((Ge&6)!==0)throw Error(n(327));ui();var i=lu(o,0);if((i&1)===0)return Rn(o,Pt()),null;var d=ed(o,i);if(o.tag!==0&&d===2){var h=Nm(o);h!==0&&(i=h,d=Uh(o,h))}if(d===1)throw d=zl,ra(o,0),to(o,i),Rn(o,Pt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=i,sa(o,Dn,ws),Rn(o,Pt()),null}function qh(o,i){var d=Ge;Ge|=1;try{return o(i)}finally{Ge=d,Ge===0&&(ci=Pt()+500,_u&&Ys())}}function na(o){Js!==null&&Js.tag===0&&(Ge&6)===0&&ui();var i=Ge;Ge|=1;var d=ir.transition,h=st;try{if(ir.transition=null,st=1,o)return o()}finally{st=h,ir.transition=d,Ge=i,(Ge&6)===0&&Ys()}}function Kh(){Yn=li.current,xt(li)}function ra(o,i){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,qE(d)),Ot!==null)for(d=Ot.return;d!==null;){var h=d;switch(nh(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&ku();break;case 3:oi(),xt(Tn),xt(an),ph();break;case 5:mh(h);break;case 4:oi();break;case 13:xt(vt);break;case 19:xt(vt);break;case 10:lh(h.type._context);break;case 22:case 23:Kh()}d=d.return}if(Ut=o,Ot=o=no(o.current,null),Jt=Yn=i,$t=0,zl=null,Vh=Yu=ta=0,Dn=Wl=null,Zo!==null){for(i=0;i<Zo.length;i++)if(d=Zo[i],h=d.interleaved,h!==null){d.interleaved=null;var b=h.next,C=d.pending;if(C!==null){var A=C.next;C.next=b,h.next=A}d.pending=h}Zo=null}return o}function Fb(o,i){do{var d=Ot;try{if(ih(),Lu.current=Bu,Fu){for(var h=bt.memoizedState;h!==null;){var b=h.queue;b!==null&&(b.pending=null),h=h.next}Fu=!1}if(ea=0,Wt=Ft=bt=null,Il=!1,Ll=0,$h.current=null,d===null||d.return===null){$t=1,zl=i,Ot=null;break}e:{var C=o,A=d.return,V=d,K=i;if(i=Jt,V.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var re=K,le=V,de=le.tag;if((le.mode&1)===0&&(de===0||de===11||de===15)){var ie=le.alternate;ie?(le.updateQueue=ie.updateQueue,le.memoizedState=ie.memoizedState,le.lanes=ie.lanes):(le.updateQueue=null,le.memoizedState=null)}var ve=cb(A);if(ve!==null){ve.flags&=-257,ub(ve,A,V,C,i),ve.mode&1&&lb(C,re,i),i=ve,K=re;var je=i.updateQueue;if(je===null){var Se=new Set;Se.add(K),i.updateQueue=Se}else je.add(K);break e}else{if((i&1)===0){lb(C,re,i),Yh();break e}K=Error(n(426))}}else if(yt&&V.mode&1){var Tt=cb(A);if(Tt!==null){(Tt.flags&65536)===0&&(Tt.flags|=256),ub(Tt,A,V,C,i),oh(ai(K,V));break e}}C=K=ai(K,V),$t!==4&&($t=2),Wl===null?Wl=[C]:Wl.push(C),C=A;do{switch(C.tag){case 3:C.flags|=65536,i&=-i,C.lanes|=i;var J=ab(C,K,i);D0(C,J);break e;case 1:V=K;var Q=C.type,ee=C.stateNode;if((C.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Zs===null||!Zs.has(ee)))){C.flags|=65536,i&=-i,C.lanes|=i;var me=ib(C,V,i);D0(C,me);break e}}C=C.return}while(C!==null)}Bb(d)}catch(Ee){i=Ee,Ot===d&&d!==null&&(Ot=d=d.return);continue}break}while(!0)}function $b(){var o=Ku.current;return Ku.current=Bu,o===null?Bu:o}function Yh(){($t===0||$t===3||$t===2)&&($t=4),Ut===null||(ta&268435455)===0&&(Yu&268435455)===0||to(Ut,Jt)}function ed(o,i){var d=Ge;Ge|=2;var h=$b();(Ut!==o||Jt!==i)&&(ws=null,ra(o,i));do try{g3();break}catch(b){Fb(o,b)}while(!0);if(ih(),Ge=d,Ku.current=h,Ot!==null)throw Error(n(261));return Ut=null,Jt=0,$t}function g3(){for(;Ot!==null;)Vb(Ot)}function y3(){for(;Ot!==null&&!W5();)Vb(Ot)}function Vb(o){var i=Ub(o.alternate,o,Yn);o.memoizedProps=o.pendingProps,i===null?Bb(o):Ot=i,$h.current=null}function Bb(o){var i=o;do{var d=i.alternate;if(o=i.return,(i.flags&32768)===0){if(d=u3(d,i,Yn),d!==null){Ot=d;return}}else{if(d=d3(d,i),d!==null){d.flags&=32767,Ot=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{$t=6,Ot=null;return}}if(i=i.sibling,i!==null){Ot=i;return}Ot=i=o}while(i!==null);$t===0&&($t=5)}function sa(o,i,d){var h=st,b=ir.transition;try{ir.transition=null,st=1,v3(o,i,d,h)}finally{ir.transition=b,st=h}return null}function v3(o,i,d,h){do ui();while(Js!==null);if((Ge&6)!==0)throw Error(n(327));d=o.finishedWork;var b=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=d.lanes|d.childLanes;if(J5(o,C),o===Ut&&(Ot=Ut=null,Jt=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Gu||(Gu=!0,Hb(su,function(){return ui(),null})),C=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||C){C=ir.transition,ir.transition=null;var A=st;st=1;var V=Ge;Ge|=4,$h.current=null,m3(o,d),Ab(d,o),$E(Ym),du=!!Km,Ym=Km=null,o.current=d,h3(d),U5(),Ge=V,st=A,ir.transition=C}else o.current=d;if(Gu&&(Gu=!1,Js=o,Xu=b),C=o.pendingLanes,C===0&&(Zs=null),K5(d.stateNode),Rn(o,Pt()),i!==null)for(h=o.onRecoverableError,d=0;d<i.length;d++)b=i[d],h(b.value,{componentStack:b.stack,digest:b.digest});if(Qu)throw Qu=!1,o=zh,zh=null,o;return(Xu&1)!==0&&o.tag!==0&&ui(),C=o.pendingLanes,(C&1)!==0?o===Wh?Ul++:(Ul=0,Wh=o):Ul=0,Ys(),null}function ui(){if(Js!==null){var o=Pv(Xu),i=ir.transition,d=st;try{if(ir.transition=null,st=16>o?16:o,Js===null)var h=!1;else{if(o=Js,Js=null,Xu=0,(Ge&6)!==0)throw Error(n(331));var b=Ge;for(Ge|=4,we=o.current;we!==null;){var C=we,A=C.child;if((we.flags&16)!==0){var V=C.deletions;if(V!==null){for(var K=0;K<V.length;K++){var re=V[K];for(we=re;we!==null;){var le=we;switch(le.tag){case 0:case 11:case 15:Bl(8,le,C)}var de=le.child;if(de!==null)de.return=le,we=de;else for(;we!==null;){le=we;var ie=le.sibling,ve=le.return;if(Sb(le),le===re){we=null;break}if(ie!==null){ie.return=ve,we=ie;break}we=ve}}}var je=C.alternate;if(je!==null){var Se=je.child;if(Se!==null){je.child=null;do{var Tt=Se.sibling;Se.sibling=null,Se=Tt}while(Se!==null)}}we=C}}if((C.subtreeFlags&2064)!==0&&A!==null)A.return=C,we=A;else e:for(;we!==null;){if(C=we,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Bl(9,C,C.return)}var J=C.sibling;if(J!==null){J.return=C.return,we=J;break e}we=C.return}}var Q=o.current;for(we=Q;we!==null;){A=we;var ee=A.child;if((A.subtreeFlags&2064)!==0&&ee!==null)ee.return=A,we=ee;else e:for(A=Q;we!==null;){if(V=we,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:qu(9,V)}}catch(Ee){Nt(V,V.return,Ee)}if(V===A){we=null;break e}var me=V.sibling;if(me!==null){me.return=V.return,we=me;break e}we=V.return}}if(Ge=b,Ys(),Hr&&typeof Hr.onPostCommitFiberRoot=="function")try{Hr.onPostCommitFiberRoot(ou,o)}catch{}h=!0}return h}finally{st=d,ir.transition=i}}return!1}function zb(o,i,d){i=ai(d,i),i=ab(o,i,1),o=Gs(o,i,1),i=yn(),o!==null&&(hl(o,1,i),Rn(o,i))}function Nt(o,i,d){if(o.tag===3)zb(o,o,d);else for(;i!==null;){if(i.tag===3){zb(i,o,d);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Zs===null||!Zs.has(h))){o=ai(d,o),o=ib(i,o,1),i=Gs(i,o,1),o=yn(),i!==null&&(hl(i,1,o),Rn(i,o));break}}i=i.return}}function b3(o,i,d){var h=o.pingCache;h!==null&&h.delete(i),i=yn(),o.pingedLanes|=o.suspendedLanes&d,Ut===o&&(Jt&d)===d&&($t===4||$t===3&&(Jt&130023424)===Jt&&500>Pt()-Bh?ra(o,0):Vh|=d),Rn(o,i)}function Wb(o,i){i===0&&((o.mode&1)===0?i=1:(i=iu,iu<<=1,(iu&130023424)===0&&(iu=4194304)));var d=yn();o=ys(o,i),o!==null&&(hl(o,i,d),Rn(o,d))}function w3(o){var i=o.memoizedState,d=0;i!==null&&(d=i.retryLane),Wb(o,d)}function j3(o,i){var d=0;switch(o.tag){case 13:var h=o.stateNode,b=o.memoizedState;b!==null&&(d=b.retryLane);break;case 19:h=o.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(i),Wb(o,d)}var Ub;Ub=function(o,i,d){if(o!==null)if(o.memoizedProps!==i.pendingProps||Tn.current)Mn=!0;else{if((o.lanes&d)===0&&(i.flags&128)===0)return Mn=!1,c3(o,i,d);Mn=(o.flags&131072)!==0}else Mn=!1,yt&&(i.flags&1048576)!==0&&N0(i,Pu,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;Uu(o,i),o=i.pendingProps;var b=Za(i,an.current);si(i,d),b=yh(null,i,h,o,b,d);var C=vh();return i.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,An(h)?(C=!0,Su(i)):C=!1,i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,dh(i),b.updater=zu,i.stateNode=b,b._reactInternals=i,kh(i,h,o,d),i=Ph(null,i,h,!0,C,d)):(i.tag=0,yt&&C&&th(i),gn(null,i,b,d),i=i.child),i;case 16:h=i.elementType;e:{switch(Uu(o,i),o=i.pendingProps,b=h._init,h=b(h._payload),i.type=h,b=i.tag=C3(h),o=br(h,o),b){case 0:i=Eh(null,i,h,o,d);break e;case 1:i=xb(null,i,h,o,d);break e;case 11:i=db(null,i,h,o,d);break e;case 14:i=fb(null,i,h,br(h.type,o),d);break e}throw Error(n(306,h,""))}return i;case 0:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:br(h,b),Eh(o,i,h,b,d);case 1:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:br(h,b),xb(o,i,h,b,d);case 3:e:{if(gb(i),o===null)throw Error(n(387));h=i.pendingProps,C=i.memoizedState,b=C.element,M0(o,i),Ou(i,h,null,d);var A=i.memoizedState;if(h=A.element,C.isDehydrated)if(C={element:h,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},i.updateQueue.baseState=C,i.memoizedState=C,i.flags&256){b=ai(Error(n(423)),i),i=yb(o,i,h,d,b);break e}else if(h!==b){b=ai(Error(n(424)),i),i=yb(o,i,h,d,b);break e}else for(Kn=Hs(i.stateNode.containerInfo.firstChild),qn=i,yt=!0,vr=null,d=T0(i,null,h,d),i.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(ti(),h===b){i=bs(o,i,d);break e}gn(o,i,h,d)}i=i.child}return i;case 5:return O0(i),o===null&&sh(i),h=i.type,b=i.pendingProps,C=o!==null?o.memoizedProps:null,A=b.children,Qm(h,b)?A=null:C!==null&&Qm(h,C)&&(i.flags|=32),pb(o,i),gn(o,i,A,d),i.child;case 6:return o===null&&sh(i),null;case 13:return vb(o,i,d);case 4:return fh(i,i.stateNode.containerInfo),h=i.pendingProps,o===null?i.child=ni(i,null,h,d):gn(o,i,h,d),i.child;case 11:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:br(h,b),db(o,i,h,b,d);case 7:return gn(o,i,i.pendingProps,d),i.child;case 8:return gn(o,i,i.pendingProps.children,d),i.child;case 12:return gn(o,i,i.pendingProps.children,d),i.child;case 10:e:{if(h=i.type._context,b=i.pendingProps,C=i.memoizedProps,A=b.value,ct(Mu,h._currentValue),h._currentValue=A,C!==null)if(yr(C.value,A)){if(C.children===b.children&&!Tn.current){i=bs(o,i,d);break e}}else for(C=i.child,C!==null&&(C.return=i);C!==null;){var V=C.dependencies;if(V!==null){A=C.child;for(var K=V.firstContext;K!==null;){if(K.context===h){if(C.tag===1){K=vs(-1,d&-d),K.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var le=re.pending;le===null?K.next=K:(K.next=le.next,le.next=K),re.pending=K}}C.lanes|=d,K=C.alternate,K!==null&&(K.lanes|=d),ch(C.return,d,i),V.lanes|=d;break}K=K.next}}else if(C.tag===10)A=C.type===i.type?null:C.child;else if(C.tag===18){if(A=C.return,A===null)throw Error(n(341));A.lanes|=d,V=A.alternate,V!==null&&(V.lanes|=d),ch(A,d,i),A=C.sibling}else A=C.child;if(A!==null)A.return=C;else for(A=C;A!==null;){if(A===i){A=null;break}if(C=A.sibling,C!==null){C.return=A.return,A=C;break}A=A.return}C=A}gn(o,i,b.children,d),i=i.child}return i;case 9:return b=i.type,h=i.pendingProps.children,si(i,d),b=or(b),h=h(b),i.flags|=1,gn(o,i,h,d),i.child;case 14:return h=i.type,b=br(h,i.pendingProps),b=br(h.type,b),fb(o,i,h,b,d);case 15:return mb(o,i,i.type,i.pendingProps,d);case 17:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:br(h,b),Uu(o,i),i.tag=1,An(h)?(o=!0,Su(i)):o=!1,si(i,d),sb(i,h,b),kh(i,h,b,d),Ph(null,i,h,!0,o,d);case 19:return wb(o,i,d);case 22:return hb(o,i,d)}throw Error(n(156,i.tag))};function Hb(o,i){return Cv(o,i)}function N3(o,i,d,h){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lr(o,i,d,h){return new N3(o,i,d,h)}function Qh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function C3(o){if(typeof o=="function")return Qh(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===O)return 14}return 2}function no(o,i){var d=o.alternate;return d===null?(d=lr(o.tag,i,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=i,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,i=o.dependencies,d.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function td(o,i,d,h,b,C){var A=2;if(h=o,typeof o=="function")Qh(o)&&(A=1);else if(typeof o=="string")A=5;else e:switch(o){case M:return oa(d.children,b,C,i);case D:A=8,b|=8;break;case q:return o=lr(12,d,i,b|2),o.elementType=q,o.lanes=C,o;case te:return o=lr(13,d,i,b),o.elementType=te,o.lanes=C,o;case Y:return o=lr(19,d,i,b),o.elementType=Y,o.lanes=C,o;case $:return nd(d,b,C,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case H:A=10;break e;case I:A=9;break e;case F:A=11;break e;case O:A=14;break e;case U:A=16,h=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=lr(A,d,i,b),i.elementType=o,i.type=h,i.lanes=C,i}function oa(o,i,d,h){return o=lr(7,o,h,i),o.lanes=d,o}function nd(o,i,d,h){return o=lr(22,o,h,i),o.elementType=$,o.lanes=d,o.stateNode={isHidden:!1},o}function Gh(o,i,d){return o=lr(6,o,null,i),o.lanes=d,o}function Xh(o,i,d){return i=lr(4,o.children!==null?o.children:[],o.key,i),i.lanes=d,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function k3(o,i,d,h,b){this.tag=i,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cm(0),this.expirationTimes=Cm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cm(0),this.identifierPrefix=h,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Zh(o,i,d,h,b,C,A,V,K){return o=new k3(o,i,d,V,K),i===1?(i=1,C===!0&&(i|=8)):i=0,C=lr(3,null,null,i),o.current=C,C.stateNode=o,C.memoizedState={element:h,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},dh(C),o}function S3(o,i,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:h==null?null:""+h,children:o,containerInfo:i,implementation:d}}function qb(o){if(!o)return Ks;o=o._reactInternals;e:{if(Ko(o)!==o||o.tag!==1)throw Error(n(170));var i=o;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(An(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(An(d))return b0(o,d,i)}return i}function Kb(o,i,d,h,b,C,A,V,K){return o=Zh(d,h,!0,o,b,C,A,V,K),o.context=qb(null),d=o.current,h=yn(),b=eo(d),C=vs(h,b),C.callback=i??null,Gs(d,C,b),o.current.lanes=b,hl(o,b,h),Rn(o,h),o}function rd(o,i,d,h){var b=i.current,C=yn(),A=eo(b);return d=qb(d),i.context===null?i.context=d:i.pendingContext=d,i=vs(C,A),i.payload={element:o},h=h===void 0?null:h,h!==null&&(i.callback=h),o=Gs(b,i,A),o!==null&&(Nr(o,b,A,C),Ru(o,b,A)),A}function sd(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Yb(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<i?d:i}}function Jh(o,i){Yb(o,i),(o=o.alternate)&&Yb(o,i)}function _3(){return null}var Qb=typeof reportError=="function"?reportError:function(o){console.error(o)};function ep(o){this._internalRoot=o}od.prototype.render=ep.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));rd(o,i,null,null)},od.prototype.unmount=ep.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;na(function(){rd(null,o,null,null)}),i[hs]=null}};function od(o){this._internalRoot=o}od.prototype.unstable_scheduleHydration=function(o){if(o){var i=Mv();o={blockedOn:null,target:o,priority:i};for(var d=0;d<zs.length&&i!==0&&i<zs[d].priority;d++);zs.splice(d,0,o),d===0&&Ov(o)}};function tp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function ad(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Gb(){}function E3(o,i,d,h,b){if(b){if(typeof h=="function"){var C=h;h=function(){var re=sd(A);C.call(re)}}var A=Kb(i,h,o,0,null,!1,!1,"",Gb);return o._reactRootContainer=A,o[hs]=A.current,El(o.nodeType===8?o.parentNode:o),na(),A}for(;b=o.lastChild;)o.removeChild(b);if(typeof h=="function"){var V=h;h=function(){var re=sd(K);V.call(re)}}var K=Zh(o,0,!1,null,null,!1,!1,"",Gb);return o._reactRootContainer=K,o[hs]=K.current,El(o.nodeType===8?o.parentNode:o),na(function(){rd(i,K,d,h)}),K}function id(o,i,d,h,b){var C=d._reactRootContainer;if(C){var A=C;if(typeof b=="function"){var V=b;b=function(){var K=sd(A);V.call(K)}}rd(i,A,o,b)}else A=E3(d,i,o,b,h);return sd(A)}Tv=function(o){switch(o.tag){case 3:var i=o.stateNode;if(i.current.memoizedState.isDehydrated){var d=ml(i.pendingLanes);d!==0&&(km(i,d|1),Rn(i,Pt()),(Ge&6)===0&&(ci=Pt()+500,Ys()))}break;case 13:na(function(){var h=ys(o,1);if(h!==null){var b=yn();Nr(h,o,1,b)}}),Jh(o,1)}},Sm=function(o){if(o.tag===13){var i=ys(o,134217728);if(i!==null){var d=yn();Nr(i,o,134217728,d)}Jh(o,134217728)}},Av=function(o){if(o.tag===13){var i=eo(o),d=ys(o,i);if(d!==null){var h=yn();Nr(d,o,i,h)}Jh(o,i)}},Mv=function(){return st},Dv=function(o,i){var d=st;try{return st=o,i()}finally{st=d}},za=function(o,i,d){switch(i){case"input":if(zt(o,d),i=d.name,d.type==="radio"&&i!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<d.length;i++){var h=d[i];if(h!==o&&h.form===o.form){var b=Cu(h);if(!b)throw Error(n(90));Be(h),zt(h,b)}}}break;case"textarea":rt(o,d);break;case"select":i=d.value,i!=null&&Z(o,!!d.multiple,i,!1)}},Ze=qh,it=na;var P3={usingClientEntryPoint:!1,Events:[Al,Ga,Cu,tu,ze,qh]},Hl={findFiberByHostInstance:Yo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},T3={bundleType:Hl.bundleType,version:Hl.version,rendererPackageName:Hl.rendererPackageName,rendererConfig:Hl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=jv(o),o===null?null:o.stateNode},findFiberByHostInstance:Hl.findFiberByHostInstance||_3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ld.isDisabled&&ld.supportsFiber)try{ou=ld.inject(T3),Hr=ld}catch{}}return On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P3,On.createPortal=function(o,i){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tp(i))throw Error(n(200));return S3(o,i,null,d)},On.createRoot=function(o,i){if(!tp(o))throw Error(n(299));var d=!1,h="",b=Qb;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=Zh(o,1,!1,null,null,d,!1,h,b),o[hs]=i.current,El(o.nodeType===8?o.parentNode:o),new ep(i)},On.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var i=o._reactInternals;if(i===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=jv(i),o=o===null?null:o.stateNode,o},On.flushSync=function(o){return na(o)},On.hydrate=function(o,i,d){if(!ad(i))throw Error(n(200));return id(null,o,i,!0,d)},On.hydrateRoot=function(o,i,d){if(!tp(o))throw Error(n(405));var h=d!=null&&d.hydratedSources||null,b=!1,C="",A=Qb;if(d!=null&&(d.unstable_strictMode===!0&&(b=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onRecoverableError!==void 0&&(A=d.onRecoverableError)),i=Kb(i,null,o,1,d??null,b,!1,C,A),o[hs]=i.current,El(o),h)for(o=0;o<h.length;o++)d=h[o],b=d._getVersion,b=b(d._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[d,b]:i.mutableSourceEagerHydrationData.push(d,b);return new od(i)},On.render=function(o,i,d){if(!ad(i))throw Error(n(200));return id(null,o,i,!1,d)},On.unmountComponentAtNode=function(o){if(!ad(o))throw Error(n(40));return o._reactRootContainer?(na(function(){id(null,null,o,!1,function(){o._reactRootContainer=null,o[hs]=null})}),!0):!1},On.unstable_batchedUpdates=qh,On.unstable_renderSubtreeIntoContainer=function(o,i,d,h){if(!ad(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return id(o,i,d,!1,h)},On.version="18.3.1-next-f1338f8080-20240426",On}var ow;function NN(){if(ow)return op.exports;ow=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),op.exports=V3(),op.exports}var aw;function B3(){if(aw)return ud;aw=1;var e=NN();return ud.createRoot=e.createRoot,ud.hydrateRoot=e.hydrateRoot,ud}var z3=B3();const W3=Ng(z3);var Yi=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(){}},U3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ho,jg,fN,H3=(fN=class{constructor(){Te(this,ho,U3);Te(this,jg,!1)}setTimeoutProvider(e){ye(this,ho,e)}setTimeout(e,t){return W(this,ho).setTimeout(e,t)}clearTimeout(e){W(this,ho).clearTimeout(e)}setInterval(e,t){return W(this,ho).setInterval(e,t)}clearInterval(e){W(this,ho).clearInterval(e)}},ho=new WeakMap,jg=new WeakMap,fN),pa=new H3;function q3(e){setTimeout(e,0)}var Pa=typeof window>"u"||"Deno"in globalThis;function bn(){}function K3(e,t){return typeof e=="function"?e(t):e}function ox(e){return typeof e=="number"&&e>=0&&e!==1/0}function CN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _o(e,t){return typeof e=="function"?e(t):e}function ur(e,t){return typeof e=="function"?e(t):e}function iw(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:l,queryKey:c,stale:u}=e;if(c){if(r){if(t.queryHash!==kg(c,t.options))return!1}else if(!pc(t.queryKey,c))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||a&&a!==t.state.fetchStatus||l&&!l(t))}function lw(e,t){const{exact:n,status:r,predicate:a,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Ta(t.options.mutationKey)!==Ta(l))return!1}else if(!pc(t.options.mutationKey,l))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function kg(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ta)(e)}function Ta(e){return JSON.stringify(e,(t,n)=>ax(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function pc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>pc(e[n],t[n])):!1}var Y3=Object.prototype.hasOwnProperty;function kN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=cw(e)&&cw(t);if(!r&&!(ax(e)&&ax(t)))return t;const l=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),u=c.length,f=r?new Array(u):{};let m=0;for(let p=0;p<u;p++){const g=r?p:c[p],v=e[g],y=t[g];if(v===y){f[g]=v,(r?p<l:Y3.call(e,g))&&m++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){f[g]=y;continue}const k=kN(v,y,n+1);f[g]=k,k===v&&m++}return l===u&&m===l?e:f}function Jd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function cw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ax(e){if(!uw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!uw(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function uw(e){return Object.prototype.toString.call(e)==="[object Object]"}function Q3(e){return new Promise(t=>{pa.setTimeout(t,e)})}function ix(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?kN(e,t):t}function G3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function X3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Sg=Symbol();function SN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _g(e,t){return typeof e=="function"?e(...t):!!e}function Z3(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var ya,po,_i,mN,J3=(mN=class extends Yi{constructor(){super();Te(this,ya);Te(this,po);Te(this,_i);ye(this,_i,t=>{if(!Pa&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,po)||this.setEventListener(W(this,_i))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,po))==null||t.call(this),ye(this,po,void 0))}setEventListener(t){var n;ye(this,_i,t),(n=W(this,po))==null||n.call(this),ye(this,po,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,ya)!==t&&(ye(this,ya,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,ya)=="boolean"?W(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,po=new WeakMap,_i=new WeakMap,mN),Eg=new J3;function lx(){let e,t;const n=new Promise((a,l)=>{e=a,t=l});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var eP=q3;function tP(){let e=[],t=0,n=u=>{u()},r=u=>{u()},a=eP;const l=u=>{t?e.push(u):a(()=>{n(u)})},c=()=>{const u=e;e=[],u.length&&a(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||c()}return f},batchCalls:u=>(...f)=>{l(()=>{u(...f)})},schedule:l,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{a=u}}}var Bt=tP(),Ei,xo,Pi,hN,nP=(hN=class extends Yi{constructor(){super();Te(this,Ei,!0);Te(this,xo);Te(this,Pi);ye(this,Pi,t=>{if(!Pa&&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(){W(this,xo)||this.setEventListener(W(this,Pi))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,xo))==null||t.call(this),ye(this,xo,void 0))}setEventListener(t){var n;ye(this,Pi,t),(n=W(this,xo))==null||n.call(this),ye(this,xo,t(this.setOnline.bind(this)))}setOnline(t){W(this,Ei)!==t&&(ye(this,Ei,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Ei)}},Ei=new WeakMap,xo=new WeakMap,Pi=new WeakMap,hN),ef=new nP;function rP(e){return Math.min(1e3*2**e,3e4)}function _N(e){return(e??"online")==="online"?ef.isOnline():!0}var cx=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EN(e){let t=!1,n=0,r;const a=lx(),l=()=>a.status!=="pending",c=j=>{var N;if(!l()){const _=new cx(j);v(_),(N=e.onCancel)==null||N.call(e,_)}},u=()=>{t=!0},f=()=>{t=!1},m=()=>Eg.isFocused()&&(e.networkMode==="always"||ef.isOnline())&&e.canRun(),p=()=>_N(e.networkMode)&&e.canRun(),g=j=>{l()||(r==null||r(),a.resolve(j))},v=j=>{l()||(r==null||r(),a.reject(j))},y=()=>new Promise(j=>{var N;r=_=>{(l()||m())&&j(_)},(N=e.onPause)==null||N.call(e)}).then(()=>{var j;r=void 0,l()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(l())return;let j;const N=n===0?e.initialPromise:void 0;try{j=N??e.fn()}catch(_){j=Promise.reject(_)}Promise.resolve(j).then(g).catch(_=>{var T;if(l())return;const w=e.retry??(Pa?0:3),S=e.retryDelay??rP,E=typeof S=="function"?S(n,_):S,P=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,_);if(t||!P){v(_);return}n++,(T=e.onFail)==null||T.call(e,n,_),Q3(E).then(()=>m()?void 0:y()).then(()=>{t?v(_):k()})})};return{promise:a,status:()=>a.status,cancel:c,continue:()=>(r==null||r(),a),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?k():y().then(k),a)}}var va,pN,PN=(pN=class{constructor(){Te(this,va)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ox(this.gcTime)&&ye(this,va,pa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Pa?1/0:300*1e3))}clearGcTimeout(){W(this,va)&&(pa.clearTimeout(W(this,va)),ye(this,va,void 0))}},va=new WeakMap,pN),ba,Ti,cr,wa,Kt,Ac,ja,Er,Cs,xN,sP=(xN=class extends PN{constructor(t){super();Te(this,Er);Te(this,ba);Te(this,Ti);Te(this,cr);Te(this,wa);Te(this,Kt);Te(this,Ac);Te(this,ja);ye(this,ja,!1),ye(this,Ac,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,wa,t.client),ye(this,cr,W(this,wa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,ba,fw(this.options)),this.state=t.state??W(this,ba),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,Kt))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Ac),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=fw(this.options);n.data!==void 0&&(this.setState(dw(n.data,n.dataUpdatedAt)),ye(this,ba,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,cr).remove(this)}setData(t,n){const r=ix(this.state.data,t,this.options);return qe(this,Er,Cs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){qe(this,Er,Cs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=W(this,Kt))==null?void 0:r.promise;return(a=W(this,Kt))==null||a.cancel(t),n?n.then(bn).catch(bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,ba))}isActive(){return this.observers.some(t=>ur(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>_o(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!CN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Kt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Kt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,cr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,Kt)&&(W(this,ja)?W(this,Kt).cancel({revert:!0}):W(this,Kt).cancelRetry()),this.scheduleGc()),W(this,cr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||qe(this,Er,Cs).call(this,{type:"invalidate"})}async fetch(t,n){var f,m,p,g,v,y,k,j,N,_,w,S;if(this.state.fetchStatus!=="idle"&&((f=W(this,Kt))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Kt))return W(this,Kt).continueRetry(),W(this,Kt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(P=>P.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,a=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(ye(this,ja,!0),r.signal)})},l=()=>{const E=SN(this.options,n),T=(()=>{const M={client:W(this,wa),queryKey:this.queryKey,meta:this.meta};return a(M),M})();return ye(this,ja,!1),this.options.persister?this.options.persister(E,T,this):E(T)},u=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,wa),state:this.state,fetchFn:l};return a(E),E})();(m=this.options.behavior)==null||m.onFetch(u,this),ye(this,Ti,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&qe(this,Er,Cs).call(this,{type:"fetch",meta:(g=u.fetchOptions)==null?void 0:g.meta}),ye(this,Kt,EN({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:E=>{E instanceof cx&&E.revert&&this.setState({...W(this,Ti),fetchStatus:"idle"}),r.abort()},onFail:(E,P)=>{qe(this,Er,Cs).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{qe(this,Er,Cs).call(this,{type:"pause"})},onContinue:()=>{qe(this,Er,Cs).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const E=await W(this,Kt).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(y=(v=W(this,cr).config).onSuccess)==null||y.call(v,E,this),(j=(k=W(this,cr).config).onSettled)==null||j.call(k,E,this.state.error,this),E}catch(E){if(E instanceof cx){if(E.silent)return W(this,Kt).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw qe(this,Er,Cs).call(this,{type:"error",error:E}),(_=(N=W(this,cr).config).onError)==null||_.call(N,E,this),(S=(w=W(this,cr).config).onSettled)==null||S.call(w,this.state.data,E,this),E}finally{this.scheduleGc()}}},ba=new WeakMap,Ti=new WeakMap,cr=new WeakMap,wa=new WeakMap,Kt=new WeakMap,Ac=new WeakMap,ja=new WeakMap,Er=new WeakSet,Cs=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,...TN(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...dw(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,Ti,t.manual?a:void 0),a;case"error":const l=t.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Bt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,cr).notify({query:this,type:"updated",action:t})})},xN);function TN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_N(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function dw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function fw(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 Ln,Qe,Mc,vn,Na,Ai,ks,go,Dc,Mi,Di,Ca,ka,yo,Ri,tt,rc,ux,dx,fx,mx,hx,px,xx,AN,gN,oP=(gN=class extends Yi{constructor(t,n){super();Te(this,tt);Te(this,Ln);Te(this,Qe);Te(this,Mc);Te(this,vn);Te(this,Na);Te(this,Ai);Te(this,ks);Te(this,go);Te(this,Dc);Te(this,Mi);Te(this,Di);Te(this,Ca);Te(this,ka);Te(this,yo);Te(this,Ri,new Set);this.options=n,ye(this,Ln,t),ye(this,go,null),ye(this,ks,lx()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Qe).addObserver(this),mw(W(this,Qe),this.options)?qe(this,tt,rc).call(this):this.updateResult(),qe(this,tt,mx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gx(W(this,Qe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gx(W(this,Qe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,qe(this,tt,hx).call(this),qe(this,tt,px).call(this),W(this,Qe).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Qe);if(this.options=W(this,Ln).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ur(this.options.enabled,W(this,Qe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");qe(this,tt,xx).call(this),W(this,Qe).setOptions(this.options),n._defaulted&&!Jd(this.options,n)&&W(this,Ln).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Qe),observer:this});const a=this.hasListeners();a&&hw(W(this,Qe),r,this.options,n)&&qe(this,tt,rc).call(this),this.updateResult(),a&&(W(this,Qe)!==r||ur(this.options.enabled,W(this,Qe))!==ur(n.enabled,W(this,Qe))||_o(this.options.staleTime,W(this,Qe))!==_o(n.staleTime,W(this,Qe)))&&qe(this,tt,ux).call(this);const l=qe(this,tt,dx).call(this);a&&(W(this,Qe)!==r||ur(this.options.enabled,W(this,Qe))!==ur(n.enabled,W(this,Qe))||l!==W(this,yo))&&qe(this,tt,fx).call(this,l)}getOptimisticResult(t){const n=W(this,Ln).getQueryCache().build(W(this,Ln),t),r=this.createResult(n,t);return iP(this,r)&&(ye(this,vn,r),ye(this,Ai,this.options),ye(this,Na,W(this,Qe).state)),r}getCurrentResult(){return W(this,vn)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,ks).status==="pending"&&W(this,ks).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){W(this,Ri).add(t)}getCurrentQuery(){return W(this,Qe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,Ln).defaultQueryOptions(t),r=W(this,Ln).getQueryCache().build(W(this,Ln),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return qe(this,tt,rc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,vn)))}createResult(t,n){var q;const r=W(this,Qe),a=this.options,l=W(this,vn),c=W(this,Na),u=W(this,Ai),m=t!==r?t.state:W(this,Mc),{state:p}=t;let g={...p},v=!1,y;if(n._optimisticResults){const H=this.hasListeners(),I=!H&&mw(t,n),F=H&&hw(t,r,n,a);(I||F)&&(g={...g,...TN(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:N}=g;y=g.data;let _=!1;if(n.placeholderData!==void 0&&y===void 0&&N==="pending"){let H;l!=null&&l.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(H=l.data,_=!0):H=typeof n.placeholderData=="function"?n.placeholderData((q=W(this,Di))==null?void 0:q.state.data,W(this,Di)):n.placeholderData,H!==void 0&&(N="success",y=ix(l==null?void 0:l.data,H,n),v=!0)}if(n.select&&y!==void 0&&!_)if(l&&y===(c==null?void 0:c.data)&&n.select===W(this,Dc))y=W(this,Mi);else try{ye(this,Dc,n.select),y=n.select(y),y=ix(l==null?void 0:l.data,y,n),ye(this,Mi,y),ye(this,go,null)}catch(H){ye(this,go,H)}W(this,go)&&(k=W(this,go),y=W(this,Mi),j=Date.now(),N="error");const w=g.fetchStatus==="fetching",S=N==="pending",E=N==="error",P=S&&w,T=y!==void 0,D={status:N,fetchStatus:g.fetchStatus,isPending:S,isSuccess:N==="success",isError:E,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>m.dataUpdateCount||g.errorUpdateCount>m.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:E&&!T,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&T,isStale:Pg(t,n),refetch:this.refetch,promise:W(this,ks),isEnabled:ur(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=D.data!==void 0,I=D.status==="error"&&!H,F=O=>{I?O.reject(D.error):H&&O.resolve(D.data)},te=()=>{const O=ye(this,ks,D.promise=lx());F(O)},Y=W(this,ks);switch(Y.status){case"pending":t.queryHash===r.queryHash&&F(Y);break;case"fulfilled":(I||D.data!==Y.value)&&te();break;case"rejected":(!I||D.error!==Y.reason)&&te();break}}return D}updateResult(){const t=W(this,vn),n=this.createResult(W(this,Qe),this.options);if(ye(this,Na,W(this,Qe).state),ye(this,Ai,this.options),W(this,Na).data!==void 0&&ye(this,Di,W(this,Qe)),Jd(n,t))return;ye(this,vn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!W(this,Ri).size)return!0;const c=new Set(l??W(this,Ri));return this.options.throwOnError&&c.add("error"),Object.keys(W(this,vn)).some(u=>{const f=u;return W(this,vn)[f]!==t[f]&&c.has(f)})};qe(this,tt,AN).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&qe(this,tt,mx).call(this)}},Ln=new WeakMap,Qe=new WeakMap,Mc=new WeakMap,vn=new WeakMap,Na=new WeakMap,Ai=new WeakMap,ks=new WeakMap,go=new WeakMap,Dc=new WeakMap,Mi=new WeakMap,Di=new WeakMap,Ca=new WeakMap,ka=new WeakMap,yo=new WeakMap,Ri=new WeakMap,tt=new WeakSet,rc=function(t){qe(this,tt,xx).call(this);let n=W(this,Qe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bn)),n},ux=function(){qe(this,tt,hx).call(this);const t=_o(this.options.staleTime,W(this,Qe));if(Pa||W(this,vn).isStale||!ox(t))return;const r=CN(W(this,vn).dataUpdatedAt,t)+1;ye(this,Ca,pa.setTimeout(()=>{W(this,vn).isStale||this.updateResult()},r))},dx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Qe)):this.options.refetchInterval)??!1},fx=function(t){qe(this,tt,px).call(this),ye(this,yo,t),!(Pa||ur(this.options.enabled,W(this,Qe))===!1||!ox(W(this,yo))||W(this,yo)===0)&&ye(this,ka,pa.setInterval(()=>{(this.options.refetchIntervalInBackground||Eg.isFocused())&&qe(this,tt,rc).call(this)},W(this,yo)))},mx=function(){qe(this,tt,ux).call(this),qe(this,tt,fx).call(this,qe(this,tt,dx).call(this))},hx=function(){W(this,Ca)&&(pa.clearTimeout(W(this,Ca)),ye(this,Ca,void 0))},px=function(){W(this,ka)&&(pa.clearInterval(W(this,ka)),ye(this,ka,void 0))},xx=function(){const t=W(this,Ln).getQueryCache().build(W(this,Ln),this.options);if(t===W(this,Qe))return;const n=W(this,Qe);ye(this,Qe,t),ye(this,Mc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},AN=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,vn))}),W(this,Ln).getQueryCache().notify({query:W(this,Qe),type:"observerResultsUpdated"})})},gN);function aP(e,t){return ur(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mw(e,t){return aP(e,t)||e.state.data!==void 0&&gx(e,t,t.refetchOnMount)}function gx(e,t,n){if(ur(t.enabled,e)!==!1&&_o(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Pg(e,t)}return!1}function hw(e,t,n,r){return(e!==t||ur(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Pg(e,n)}function Pg(e,t){return ur(t.enabled,e)!==!1&&e.isStaleByTime(_o(t.staleTime,e))}function iP(e,t){return!Jd(e.getCurrentResult(),t)}function pw(e){return{onFetch:(t,n)=>{var p,g,v,y,k;const r=t.options,a=(v=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:v.direction,l=((y=t.state.data)==null?void 0:y.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const m=async()=>{let j=!1;const N=S=>{Z3(S,()=>t.signal,()=>j=!0)},_=SN(t.options,t.fetchOptions),w=async(S,E,P)=>{if(j)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const M=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:E,direction:P?"backward":"forward",meta:t.options.meta};return N(I),I})(),D=await _(M),{maxPages:q}=t.options,H=P?X3:G3;return{pages:H(S.pages,D,q),pageParams:H(S.pageParams,E,q)}};if(a&&l.length){const S=a==="backward",E=S?lP:xw,P={pages:l,pageParams:c},T=E(r,P);u=await w(P,T,S)}else{const S=e??l.length;do{const E=f===0?c[0]??r.initialPageParam:xw(r,u);if(f>0&&E==null)break;u=await w(u,E),f++}while(f<S)}return u};t.options.persister?t.fetchFn=()=>{var j,N;return(N=(j=t.options).persister)==null?void 0:N.call(j,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=m}}}function xw(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 lP(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 Rc,Xr,dn,Sa,Zr,co,yN,cP=(yN=class extends PN{constructor(t){super();Te(this,Zr);Te(this,Rc);Te(this,Xr);Te(this,dn);Te(this,Sa);ye(this,Rc,t.client),this.mutationId=t.mutationId,ye(this,dn,t.mutationCache),ye(this,Xr,[]),this.state=t.state||MN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Xr).includes(t)||(W(this,Xr).push(t),this.clearGcTimeout(),W(this,dn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Xr,W(this,Xr).filter(n=>n!==t)),this.scheduleGc(),W(this,dn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():W(this,dn).remove(this))}continue(){var t;return((t=W(this,Sa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,u,f,m,p,g,v,y,k,j,N,_,w,S,E,P,T,M;const n=()=>{qe(this,Zr,co).call(this,{type:"continue"})},r={client:W(this,Rc),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Sa,EN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,q)=>{qe(this,Zr,co).call(this,{type:"failed",failureCount:D,error:q})},onPause:()=>{qe(this,Zr,co).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,dn).canRun(this)}));const a=this.state.status==="pending",l=!W(this,Sa).canStart();try{if(a)n();else{qe(this,Zr,co).call(this,{type:"pending",variables:t,isPaused:l}),W(this,dn).config.onMutate&&await W(this,dn).config.onMutate(t,this,r);const q=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));q!==this.state.context&&qe(this,Zr,co).call(this,{type:"pending",context:q,variables:t,isPaused:l})}const D=await W(this,Sa).start();return await((m=(f=W(this,dn).config).onSuccess)==null?void 0:m.call(f,D,t,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,D,t,this.state.context,r)),await((y=(v=W(this,dn).config).onSettled)==null?void 0:y.call(v,D,null,this.state.variables,this.state.context,this,r)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,D,null,t,this.state.context,r)),qe(this,Zr,co).call(this,{type:"success",data:D}),D}catch(D){try{await((_=(N=W(this,dn).config).onError)==null?void 0:_.call(N,D,t,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((S=(w=this.options).onError)==null?void 0:S.call(w,D,t,this.state.context,r))}catch(q){Promise.reject(q)}try{await((P=(E=W(this,dn).config).onSettled)==null?void 0:P.call(E,void 0,D,this.state.variables,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((M=(T=this.options).onSettled)==null?void 0:M.call(T,void 0,D,t,this.state.context,r))}catch(q){Promise.reject(q)}throw qe(this,Zr,co).call(this,{type:"error",error:D}),D}finally{W(this,dn).runNext(this)}}},Rc=new WeakMap,Xr=new WeakMap,dn=new WeakMap,Sa=new WeakMap,Zr=new WeakSet,co=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),Bt.batch(()=>{W(this,Xr).forEach(r=>{r.onMutationUpdate(t)}),W(this,dn).notify({mutation:this,type:"updated",action:t})})},yN);function MN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ss,Pr,Oc,vN,uP=(vN=class extends Yi{constructor(t={}){super();Te(this,Ss);Te(this,Pr);Te(this,Oc);this.config=t,ye(this,Ss,new Set),ye(this,Pr,new Map),ye(this,Oc,0)}build(t,n,r){const a=new cP({client:t,mutationCache:this,mutationId:++cd(this,Oc)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){W(this,Ss).add(t);const n=dd(t);if(typeof n=="string"){const r=W(this,Pr).get(n);r?r.push(t):W(this,Pr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Ss).delete(t)){const n=dd(t);if(typeof n=="string"){const r=W(this,Pr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&W(this,Pr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=dd(t);if(typeof n=="string"){const r=W(this,Pr).get(n),a=r==null?void 0:r.find(l=>l.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=dd(t);if(typeof n=="string"){const a=(r=W(this,Pr).get(n))==null?void 0:r.find(l=>l!==t&&l.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Bt.batch(()=>{W(this,Ss).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Ss).clear(),W(this,Pr).clear()})}getAll(){return Array.from(W(this,Ss))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>lw(n,r))}findAll(t={}){return this.getAll().filter(n=>lw(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(bn))))}},Ss=new WeakMap,Pr=new WeakMap,Oc=new WeakMap,vN);function dd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _s,vo,Fn,Es,Ps,Dd,yx,bN,dP=(bN=class extends Yi{constructor(n,r){super();Te(this,Ps);Te(this,_s);Te(this,vo);Te(this,Fn);Te(this,Es);ye(this,_s,n),this.setOptions(r),this.bindMethods(),qe(this,Ps,Dd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=W(this,_s).defaultMutationOptions(n),Jd(this.options,r)||W(this,_s).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,Fn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ta(r.mutationKey)!==Ta(this.options.mutationKey)?this.reset():((a=W(this,Fn))==null?void 0:a.state.status)==="pending"&&W(this,Fn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,Fn))==null||n.removeObserver(this)}onMutationUpdate(n){qe(this,Ps,Dd).call(this),qe(this,Ps,yx).call(this,n)}getCurrentResult(){return W(this,vo)}reset(){var n;(n=W(this,Fn))==null||n.removeObserver(this),ye(this,Fn,void 0),qe(this,Ps,Dd).call(this),qe(this,Ps,yx).call(this)}mutate(n,r){var a;return ye(this,Es,r),(a=W(this,Fn))==null||a.removeObserver(this),ye(this,Fn,W(this,_s).getMutationCache().build(W(this,_s),this.options)),W(this,Fn).addObserver(this),W(this,Fn).execute(n)}},_s=new WeakMap,vo=new WeakMap,Fn=new WeakMap,Es=new WeakMap,Ps=new WeakSet,Dd=function(){var r;const n=((r=W(this,Fn))==null?void 0:r.state)??MN();ye(this,vo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},yx=function(n){Bt.batch(()=>{var r,a,l,c,u,f,m,p;if(W(this,Es)&&this.hasListeners()){const g=W(this,vo).variables,v=W(this,vo).context,y={client:W(this,_s),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=W(this,Es)).onSuccess)==null||a.call(r,n.data,g,v,y)}catch(k){Promise.reject(k)}try{(c=(l=W(this,Es)).onSettled)==null||c.call(l,n.data,null,g,v,y)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(f=(u=W(this,Es)).onError)==null||f.call(u,n.error,g,v,y)}catch(k){Promise.reject(k)}try{(p=(m=W(this,Es)).onSettled)==null||p.call(m,void 0,n.error,g,v,y)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(W(this,vo))})})},bN),Jr,wN,fP=(wN=class extends Yi{constructor(t={}){super();Te(this,Jr);this.config=t,ye(this,Jr,new Map)}build(t,n,r){const a=n.queryKey,l=n.queryHash??kg(a,n);let c=this.get(l);return c||(c=new sP({client:t,queryKey:a,queryHash:l,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(c)),c}add(t){W(this,Jr).has(t.queryHash)||(W(this,Jr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Jr).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Jr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Jr).get(t)}getAll(){return[...W(this,Jr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iw(t,r)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jr=new WeakMap,wN),Ct,bo,wo,Oi,Ii,jo,Li,Fi,jN,mP=(jN=class{constructor(e={}){Te(this,Ct);Te(this,bo);Te(this,wo);Te(this,Oi);Te(this,Ii);Te(this,jo);Te(this,Li);Te(this,Fi);ye(this,Ct,e.queryCache||new fP),ye(this,bo,e.mutationCache||new uP),ye(this,wo,e.defaultOptions||{}),ye(this,Oi,new Map),ye(this,Ii,new Map),ye(this,jo,0)}mount(){cd(this,jo)._++,W(this,jo)===1&&(ye(this,Li,Eg.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Ct).onFocus())})),ye(this,Fi,ef.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Ct).onOnline())})))}unmount(){var e,t;cd(this,jo)._--,W(this,jo)===0&&((e=W(this,Li))==null||e.call(this),ye(this,Li,void 0),(t=W(this,Fi))==null||t.call(this),ye(this,Fi,void 0))}isFetching(e){return W(this,Ct).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,bo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Ct).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Ct).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_o(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(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}),a=W(this,Ct).get(r.queryHash),l=a==null?void 0:a.state.data,c=K3(t,l);if(c!==void 0)return W(this,Ct).build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>W(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=W(this,Ct).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Ct);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Ct);return Bt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Bt.batch(()=>W(this,Ct).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(bn).catch(bn)}invalidateQueries(e,t={}){return Bt.batch(()=>(W(this,Ct).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Bt.batch(()=>W(this,Ct).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let l=a.fetch(void 0,n);return n.throwOnError||(l=l.catch(bn)),a.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(bn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,Ct).build(this,t);return n.isStaleByTime(_o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bn).catch(bn)}fetchInfiniteQuery(e){return e.behavior=pw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bn).catch(bn)}ensureInfiniteQueryData(e){return e.behavior=pw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ef.isOnline()?W(this,bo).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Ct)}getMutationCache(){return W(this,bo)}getDefaultOptions(){return W(this,wo)}setDefaultOptions(e){ye(this,wo,e)}setQueryDefaults(e,t){W(this,Oi).set(Ta(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Oi).values()],n={};return t.forEach(r=>{pc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Ii).set(Ta(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Ii).values()],n={};return t.forEach(r=>{pc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,wo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=kg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Sg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,wo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Ct).clear(),W(this,bo).clear()}},Ct=new WeakMap,bo=new WeakMap,wo=new WeakMap,Oi=new WeakMap,Ii=new WeakMap,jo=new WeakMap,Li=new WeakMap,Fi=new WeakMap,jN),DN=x.createContext(void 0),He=e=>{const t=x.useContext(DN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hP=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(DN.Provider,{value:e,children:t})),RN=x.createContext(!1),pP=()=>x.useContext(RN);RN.Provider;function xP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gP=x.createContext(xP()),yP=()=>x.useContext(gP),vP=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?_g(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},bP=e=>{x.useEffect(()=>{e.clearReset()},[e])},wP=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||_g(n,[e.error,r])),jP=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},NP=(e,t)=>e.isLoading&&e.isFetching&&!t,CP=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kP(e,t,n){var v,y,k,j;const r=pP(),a=yP(),l=He(),c=l.defaultQueryOptions(e);(y=(v=l.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||y.call(v,c);const u=l.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jP(c),vP(c,a,u),bP(a);const f=!l.getQueryCache().get(c.queryHash),[m]=x.useState(()=>new t(l,c)),p=m.getOptimisticResult(c),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(N=>{const _=g?m.subscribe(Bt.batchCalls(N)):bn;return m.updateResult(),_},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(c)},[c,m]),CP(c,p))throw gw(c,m,a);if(wP({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw p.error;if((j=(k=l.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,p),c.experimental_prefetchInRender&&!Pa&&NP(p,r)){const N=f?gw(c,m,a):u==null?void 0:u.promise;N==null||N.catch(bn).finally(()=>{m.updateResult()})}return c.notifyOnChangeProps?p:m.trackResult(p)}function Lt(e,t){return kP(e,oP)}function We(e,t){const n=He(),[r]=x.useState(()=>new dP(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(c=>r.subscribe(Bt.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=x.useCallback((c,u)=>{r.mutate(c,u).catch(bn)},[r]);if(a.error&&_g(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}var Qi=NN();const ON=Ng(Qi);/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function xc(){return xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xc.apply(this,arguments)}var No;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(No||(No={}));const yw="popstate";function SP(e){e===void 0&&(e={});function t(r,a){let{pathname:l,search:c,hash:u}=r.location;return vx("",{pathname:l,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:tf(a)}return EP(t,n,null,e)}function Dt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _P(){return Math.random().toString(36).substr(2,8)}function vw(e,t){return{usr:e.state,key:e.key,idx:t}}function vx(e,t,n,r){return n===void 0&&(n=null),xc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Gi(t):t,{state:n,key:t&&t.key||r||_P()})}function tf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Gi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function EP(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:l=!1}=r,c=a.history,u=No.Pop,f=null,m=p();m==null&&(m=0,c.replaceState(xc({},c.state,{idx:m}),""));function p(){return(c.state||{idx:null}).idx}function g(){u=No.Pop;let N=p(),_=N==null?null:N-m;m=N,f&&f({action:u,location:j.location,delta:_})}function v(N,_){u=No.Push;let w=vx(j.location,N,_);m=p()+1;let S=vw(w,m),E=j.createHref(w);try{c.pushState(S,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(E)}l&&f&&f({action:u,location:j.location,delta:1})}function y(N,_){u=No.Replace;let w=vx(j.location,N,_);m=p();let S=vw(w,m),E=j.createHref(w);c.replaceState(S,"",E),l&&f&&f({action:u,location:j.location,delta:0})}function k(N){let _=a.location.origin!=="null"?a.location.origin:a.location.href,w=typeof N=="string"?N:tf(N);return w=w.replace(/ $/,"%20"),Dt(_,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,_)}let j={get action(){return u},get location(){return e(a,c)},listen(N){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(yw,g),f=N,()=>{a.removeEventListener(yw,g),f=null}},createHref(N){return t(a,N)},createURL:k,encodeLocation(N){let _=k(N);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:v,replace:y,go(N){return c.go(N)}};return j}var bw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(bw||(bw={}));function PP(e,t,n){return n===void 0&&(n="/"),TP(e,t,n)}function TP(e,t,n,r){let a=typeof t=="string"?Gi(t):t,l=Ag(a.pathname||"/",n);if(l==null)return null;let c=IN(e);AP(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=WP(l);u=VP(c[f],m)}return u}function IN(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(l,c,u)=>{let f={relativePath:u===void 0?l.path||"":u,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};f.relativePath.startsWith("/")&&(Dt(f.relativePath.startsWith(r),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(r.length));let m=Eo([r,f.relativePath]),p=n.concat(f);l.children&&l.children.length>0&&(Dt(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),IN(l.children,t,p,m)),!(l.path==null&&!l.index)&&t.push({path:m,score:FP(m,l.index),routesMeta:p})};return e.forEach((l,c)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))a(l,c);else for(let f of LN(l.path))a(l,c,f)}),t}function LN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return a?[l,""]:[l];let c=LN(r.join("/")),u=[];return u.push(...c.map(f=>f===""?l:[l,f].join("/"))),a&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function AP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$P(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const MP=/^:[\w-]+$/,DP=3,RP=2,OP=1,IP=10,LP=-2,ww=e=>e==="*";function FP(e,t){let n=e.split("/"),r=n.length;return n.some(ww)&&(r+=LP),t&&(r+=RP),n.filter(a=>!ww(a)).reduce((a,l)=>a+(MP.test(l)?DP:l===""?OP:IP),r)}function $P(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function VP(e,t,n){let{routesMeta:r}=e,a={},l="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],m=u===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=BP({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},p),v=f.route;if(!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:Eo([l,g.pathname]),pathnameBase:YP(Eo([l,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(l=Eo([l,g.pathnameBase]))}return c}function BP(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zP(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((m,p,g)=>{let{paramName:v,isOptional:y}=p;if(v==="*"){let j=u[g]||"";c=l.slice(0,l.length-j.length).replace(/(.)\/+$/,"$1")}const k=u[g];return y&&!k?m[v]=void 0:m[v]=(k||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function zP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Tg(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function WP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tg(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ag(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const UP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HP=e=>UP.test(e);function qP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Gi(e):e,l;if(n)if(HP(n))l=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Tg(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+n))}n.startsWith("/")?l=jw(n.substring(1),"/"):l=jw(n,t)}else l=t;return{pathname:l,search:QP(r),hash:GP(a)}}function jw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function lp(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function KP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mg(e,t){let n=KP(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Dg(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Gi(e):(a=xc({},e),Dt(!a.pathname||!a.pathname.includes("?"),lp("?","pathname","search",a)),Dt(!a.pathname||!a.pathname.includes("#"),lp("#","pathname","hash",a)),Dt(!a.search||!a.search.includes("#"),lp("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=qP(a,u),m=c&&c!=="/"&&c.endsWith("/"),p=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||p)&&(f.pathname+="/"),f}const Eo=e=>e.join("/").replace(/\/\/+/g,"/"),YP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function XP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const FN=["post","put","patch","delete"];new Set(FN);const ZP=["get",...FN];new Set(ZP);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gc.apply(this,arguments)}const Rg=x.createContext(null),JP=x.createContext(null),Fo=x.createContext(null),Df=x.createContext(null),$o=x.createContext({outlet:null,matches:[],isDataRoute:!1}),$N=x.createContext(null);function eT(e,t){let{relative:n}=t===void 0?{}:t;Xi()||Dt(!1);let{basename:r,navigator:a}=x.useContext(Fo),{hash:l,pathname:c,search:u}=BN(e,{relative:n}),f=c;return r!=="/"&&(f=c==="/"?r:Eo([r,c])),a.createHref({pathname:f,search:u,hash:l})}function Xi(){return x.useContext(Df)!=null}function nr(){return Xi()||Dt(!1),x.useContext(Df).location}function VN(e){x.useContext(Fo).static||x.useLayoutEffect(e)}function on(){let{isDataRoute:e}=x.useContext($o);return e?mT():tT()}function tT(){Xi()||Dt(!1);let e=x.useContext(Rg),{basename:t,future:n,navigator:r}=x.useContext(Fo),{matches:a}=x.useContext($o),{pathname:l}=nr(),c=JSON.stringify(Mg(a,n.v7_relativeSplatPath)),u=x.useRef(!1);return VN(()=>{u.current=!0}),x.useCallback(function(m,p){if(p===void 0&&(p={}),!u.current)return;if(typeof m=="number"){r.go(m);return}let g=Dg(m,JSON.parse(c),l,p.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Eo([t,g.pathname])),(p.replace?r.replace:r.push)(g,p.state,p)},[t,r,c,l,e])}function BN(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(Fo),{matches:a}=x.useContext($o),{pathname:l}=nr(),c=JSON.stringify(Mg(a,r.v7_relativeSplatPath));return x.useMemo(()=>Dg(e,JSON.parse(c),l,n==="path"),[e,c,l,n])}function nT(e,t){return rT(e,t)}function rT(e,t,n,r){Xi()||Dt(!1);let{navigator:a}=x.useContext(Fo),{matches:l}=x.useContext($o),c=l[l.length-1],u=c?c.params:{};c&&c.pathname;let f=c?c.pathnameBase:"/";c&&c.route;let m=nr(),p;if(t){var g;let N=typeof t=="string"?Gi(t):t;f==="/"||(g=N.pathname)!=null&&g.startsWith(f)||Dt(!1),p=N}else p=m;let v=p.pathname||"/",y=v;if(f!=="/"){let N=f.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=PP(e,{pathname:y}),j=lT(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:Eo([f,a.encodeLocation?a.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?f:Eo([f,a.encodeLocation?a.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),l,n,r);return t&&j?x.createElement(Df.Provider,{value:{location:gc({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:No.Pop}},j):j}function sT(){let e=fT(),t=XP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,null)}const oT=x.createElement(sT,null);class aT extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement($o.Provider,{value:this.props.routeContext},x.createElement($N.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function iT(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(Rg);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement($o.Provider,{value:t},r)}function lT(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let c=e,u=(a=n)==null?void 0:a.errors;if(u!=null){let p=c.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);p>=0||Dt(!1),c=c.slice(0,Math.min(c.length,p+1))}let f=!1,m=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<c.length;p++){let g=c[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(m=p),g.route.id){let{loaderData:v,errors:y}=n,k=g.route.loader&&v[g.route.id]===void 0&&(!y||y[g.route.id]===void 0);if(g.route.lazy||k){f=!0,m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}return c.reduceRight((p,g,v)=>{let y,k=!1,j=null,N=null;n&&(y=u&&g.route.id?u[g.route.id]:void 0,j=g.route.errorElement||oT,f&&(m<0&&v===0?(hT("route-fallback"),k=!0,N=null):m===v&&(k=!0,N=g.route.hydrateFallbackElement||null)));let _=t.concat(c.slice(0,v+1)),w=()=>{let S;return y?S=j:k?S=N:g.route.Component?S=x.createElement(g.route.Component,null):g.route.element?S=g.route.element:S=p,x.createElement(iT,{match:g,routeContext:{outlet:p,matches:_,isDataRoute:n!=null},children:S})};return n&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?x.createElement(aT,{location:n.location,revalidation:n.revalidation,component:j,error:y,children:w(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):w()},null)}var zN=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(zN||{}),WN=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(WN||{});function cT(e){let t=x.useContext(Rg);return t||Dt(!1),t}function uT(e){let t=x.useContext(JP);return t||Dt(!1),t}function dT(e){let t=x.useContext($o);return t||Dt(!1),t}function UN(e){let t=dT(),n=t.matches[t.matches.length-1];return n.route.id||Dt(!1),n.route.id}function fT(){var e;let t=x.useContext($N),n=uT(),r=UN();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function mT(){let{router:e}=cT(zN.UseNavigateStable),t=UN(WN.UseNavigateStable),n=x.useRef(!1);return VN(()=>{n.current=!0}),x.useCallback(function(a,l){l===void 0&&(l={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,gc({fromRouteId:t},l)))},[e,t])}const Nw={};function hT(e,t,n){Nw[e]||(Nw[e]=!0)}function pT(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Og(e){let{to:t,replace:n,state:r,relative:a}=e;Xi()||Dt(!1);let{future:l,static:c}=x.useContext(Fo),{matches:u}=x.useContext($o),{pathname:f}=nr(),m=on(),p=Dg(t,Mg(u,l.v7_relativeSplatPath),f,a==="path"),g=JSON.stringify(p);return x.useEffect(()=>m(JSON.parse(g),{replace:n,state:r,relative:a}),[m,g,a,n,r]),null}function ut(e){Dt(!1)}function xT(e){let{basename:t="/",children:n=null,location:r,navigationType:a=No.Pop,navigator:l,static:c=!1,future:u}=e;Xi()&&Dt(!1);let f=t.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:c,future:gc({v7_relativeSplatPath:!1},u)}),[f,u,l,c]);typeof r=="string"&&(r=Gi(r));let{pathname:p="/",search:g="",hash:v="",state:y=null,key:k="default"}=r,j=x.useMemo(()=>{let N=Ag(p,f);return N==null?null:{location:{pathname:N,search:g,hash:v,state:y,key:k},navigationType:a}},[f,p,g,v,y,k,a]);return j==null?null:x.createElement(Fo.Provider,{value:m},x.createElement(Df.Provider,{children:n,value:j}))}function Ig(e){let{children:t,location:n}=e;return nT(bx(t),n)}new Promise(()=>{});function bx(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let l=[...t,a];if(r.type===x.Fragment){n.push.apply(n,bx(r.props.children,l));return}r.type!==ut&&Dt(!1),!r.props.index||!r.props.children||Dt(!1);let c={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=bx(r.props.children,l)),n.push(c)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function wx(){return wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wx.apply(this,arguments)}function gT(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,l;for(l=0;l<r.length;l++)a=r[l],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function yT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vT(e,t){return e.button===0&&(!t||t==="_self")&&!yT(e)}function jx(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function bT(e,t){let n=jx(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}const wT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jT="6";try{window.__reactRouterVersion=jT}catch{}const NT="startTransition",Cw=Mf[NT];function CT(e){let{basename:t,children:n,future:r,window:a}=e,l=x.useRef();l.current==null&&(l.current=SP({window:a,v5Compat:!0}));let c=l.current,[u,f]=x.useState({action:c.action,location:c.location}),{v7_startTransition:m}=r||{},p=x.useCallback(g=>{m&&Cw?Cw(()=>f(g)):f(g)},[f,m]);return x.useLayoutEffect(()=>c.listen(p),[c,p]),x.useEffect(()=>pT(r),[r]),x.createElement(xT,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:c,future:r})}const kT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ST=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qn=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:l,replace:c,state:u,target:f,to:m,preventScrollReset:p,viewTransition:g}=t,v=gT(t,wT),{basename:y}=x.useContext(Fo),k,j=!1;if(typeof m=="string"&&ST.test(m)&&(k=m,kT))try{let S=new URL(window.location.href),E=m.startsWith("//")?new URL(S.protocol+m):new URL(m),P=Ag(E.pathname,y);E.origin===S.origin&&P!=null?m=P+E.search+E.hash:j=!0}catch{}let N=eT(m,{relative:a}),_=_T(m,{replace:c,state:u,target:f,preventScrollReset:p,relative:a,viewTransition:g});function w(S){r&&r(S),S.defaultPrevented||_(S)}return x.createElement("a",wx({},v,{href:k||N,onClick:j||l?r:w,ref:n,target:f}))});var kw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kw||(kw={}));var Sw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sw||(Sw={}));function _T(e,t){let{target:n,replace:r,state:a,preventScrollReset:l,relative:c,viewTransition:u}=t===void 0?{}:t,f=on(),m=nr(),p=BN(e,{relative:c});return x.useCallback(g=>{if(vT(g,n)){g.preventDefault();let v=r!==void 0?r:tf(m)===tf(p);f(e,{replace:v,state:a,preventScrollReset:l,relative:c,viewTransition:u})}},[m,f,p,r,a,n,e,l,c,u])}function ET(e){let t=x.useRef(jx(e)),n=x.useRef(!1),r=nr(),a=x.useMemo(()=>bT(r.search,n.current?null:t.current),[r.search]),l=on(),c=x.useCallback((u,f)=>{const m=jx(typeof u=="function"?u(a):u);n.current=!0,l("?"+m,f)},[l,a]);return[a,c]}var PT=e=>{switch(e){case"success":return MT;case"info":return RT;case"warning":return DT;case"error":return OT;default:return null}},TT=Array(12).fill(0),AT=({visible:e,className:t})=>fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},fe.createElement("div",{className:"sonner-spinner"},TT.map((n,r)=>fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),MT=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),DT=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),RT=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),OT=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),IT=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LT=()=>{let[e,t]=fe.useState(document.hidden);return fe.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,FT=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,l=this.toasts.find(u=>u.id===a),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:c,title:n}):u):this.addToast({title:n,...r,dismissible:c,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,l,c=r.then(async f=>{if(l=["resolve",f],fe.isValidElement(f))a=!1,this.create({id:n,type:"default",message:f});else if(VT(f)&&!f.ok){a=!1;let m=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:m,description:p})}else if(t.success!==void 0){a=!1;let m=typeof t.success=="function"?await t.success(f):t.success,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:m,description:p})}}).catch(async f=>{if(l=["reject",f],t.error!==void 0){a=!1;let m=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:m,description:p})}}).finally(()=>{var f;a&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,m)=>c.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},$n=new FT,$T=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return $n.addToast({title:e,...t,id:n}),n},VT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BT=$T,zT=()=>$n.toasts,WT=()=>$n.getActiveToasts();Object.assign(BT,{success:$n.success,info:$n.info,warning:$n.warning,error:$n.error,custom:$n.custom,message:$n.message,promise:$n.promise,dismiss:$n.dismiss,loading:$n.loading},{getHistory:zT,getToasts:WT});function UT(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}UT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
68
|
+
`);function fd(e){return e.label!==void 0}var HT=3,qT="32px",KT="16px",_w=4e3,YT=356,QT=14,GT=20,XT=200;function Cr(...e){return e.filter(Boolean).join(" ")}function ZT(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JT=e=>{var t,n,r,a,l,c,u,f,m,p,g;let{invert:v,toast:y,unstyled:k,interacting:j,setHeights:N,visibleToasts:_,heights:w,index:S,toasts:E,expanded:P,removeToast:T,defaultRichColors:M,closeButton:D,style:q,cancelButtonStyle:H,actionButtonStyle:I,className:F="",descriptionClassName:te="",duration:Y,position:O,gap:U,loadingIcon:$,expandByDefault:R,classNames:z,icons:X,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:L}=e,[G,se]=fe.useState(null),[ae,ue]=fe.useState(null),[oe,he]=fe.useState(!1),[ge,Ce]=fe.useState(!1),[ce,Be]=fe.useState(!1),[at,Et]=fe.useState(!1),[Yt,Qt]=fe.useState(!1),[zt,Un]=fe.useState(0),[hn,mt]=fe.useState(0),Z=fe.useRef(y.duration||Y||_w),Pe=fe.useRef(null),Ye=fe.useRef(null),rt=S===0,Rt=S+1<=_,ht=y.type,Gt=y.dismissible!==!1,fs=y.className||"",ne=y.descriptionClassName||"",ke=fe.useMemo(()=>w.findIndex(ze=>ze.toastId===y.id)||0,[w,y.id]),Ae=fe.useMemo(()=>{var ze;return(ze=y.closeButton)!=null?ze:D},[y.closeButton,D]),pn=fe.useMemo(()=>y.duration||Y||_w,[y.duration,Y]),_n=fe.useRef(0),ms=fe.useRef(0),eu=fe.useRef(0),zr=fe.useRef(null),[ul,dl]=O.split("-"),Ba=fe.useMemo(()=>w.reduce((ze,Ze,it)=>it>=ke?ze:ze+Ze.height,0),[w,ke]),za=LT(),Fs=y.invert||v,Wr=ht==="loading";ms.current=fe.useMemo(()=>ke*U+Ba,[ke,Ba]),fe.useEffect(()=>{Z.current=pn},[pn]),fe.useEffect(()=>{he(!0)},[]),fe.useEffect(()=>{let ze=Ye.current;if(ze){let Ze=ze.getBoundingClientRect().height;return mt(Ze),N(it=>[{toastId:y.id,height:Ze,position:y.position},...it]),()=>N(it=>it.filter(xn=>xn.toastId!==y.id))}},[N,y.id]),fe.useLayoutEffect(()=>{if(!oe)return;let ze=Ye.current,Ze=ze.style.height;ze.style.height="auto";let it=ze.getBoundingClientRect().height;ze.style.height=Ze,mt(it),N(xn=>xn.find(En=>En.toastId===y.id)?xn.map(En=>En.toastId===y.id?{...En,height:it}:En):[{toastId:y.id,height:it,position:y.position},...xn])},[oe,y.title,y.description,N,y.id]);let pr=fe.useCallback(()=>{Ce(!0),Un(ms.current),N(ze=>ze.filter(Ze=>Ze.toastId!==y.id)),setTimeout(()=>{T(y)},XT)},[y,T,N,ms]);fe.useEffect(()=>{if(y.promise&&ht==="loading"||y.duration===1/0||y.type==="loading")return;let ze;return P||j||L&&za?(()=>{if(eu.current<_n.current){let Ze=new Date().getTime()-_n.current;Z.current=Z.current-Ze}eu.current=new Date().getTime()})():Z.current!==1/0&&(_n.current=new Date().getTime(),ze=setTimeout(()=>{var Ze;(Ze=y.onAutoClose)==null||Ze.call(y,y),pr()},Z.current)),()=>clearTimeout(ze)},[P,j,y,ht,L,za,pr]),fe.useEffect(()=>{y.delete&&pr()},[pr,y.delete]);function tu(){var ze,Ze,it;return X!=null&&X.loading?fe.createElement("div",{className:Cr(z==null?void 0:z.loader,(ze=y==null?void 0:y.classNames)==null?void 0:ze.loader,"sonner-loader"),"data-visible":ht==="loading"},X.loading):$?fe.createElement("div",{className:Cr(z==null?void 0:z.loader,(Ze=y==null?void 0:y.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":ht==="loading"},$):fe.createElement(AT,{className:Cr(z==null?void 0:z.loader,(it=y==null?void 0:y.classNames)==null?void 0:it.loader),visible:ht==="loading"})}return fe.createElement("li",{tabIndex:0,ref:Ye,className:Cr(F,fs,z==null?void 0:z.toast,(t=y==null?void 0:y.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[ht],(n=y==null?void 0:y.classNames)==null?void 0:n[ht]),"data-sonner-toast":"","data-rich-colors":(r=y.richColors)!=null?r:M,"data-styled":!(y.jsx||y.unstyled||k),"data-mounted":oe,"data-promise":!!y.promise,"data-swiped":Yt,"data-removed":ge,"data-visible":Rt,"data-y-position":ul,"data-x-position":dl,"data-index":S,"data-front":rt,"data-swiping":ce,"data-dismissible":Gt,"data-type":ht,"data-invert":Fs,"data-swipe-out":at,"data-swipe-direction":ae,"data-expanded":!!(P||R&&oe),style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${ge?zt:ms.current}px`,"--initial-height":R?"auto":`${hn}px`,...q,...y.style},onDragEnd:()=>{Be(!1),se(null),zr.current=null},onPointerDown:ze=>{Wr||!Gt||(Pe.current=new Date,Un(ms.current),ze.target.setPointerCapture(ze.pointerId),ze.target.tagName!=="BUTTON"&&(Be(!0),zr.current={x:ze.clientX,y:ze.clientY}))},onPointerUp:()=>{var ze,Ze,it,xn;if(at||!Gt)return;zr.current=null;let En=Number(((ze=Ye.current)==null?void 0:ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pn=Number(((Ze=Ye.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xr=new Date().getTime()-((it=Pe.current)==null?void 0:it.getTime()),Xt=G==="x"?En:Pn,Ur=Math.abs(Xt)/xr;if(Math.abs(Xt)>=GT||Ur>.11){Un(ms.current),(xn=y.onDismiss)==null||xn.call(y,y),ue(G==="x"?En>0?"right":"left":Pn>0?"down":"up"),pr(),Et(!0),Qt(!1);return}Be(!1),se(null)},onPointerMove:ze=>{var Ze,it,xn,En;if(!zr.current||!Gt||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;let Pn=ze.clientY-zr.current.y,xr=ze.clientX-zr.current.x,Xt=(it=e.swipeDirections)!=null?it:ZT(O);!G&&(Math.abs(xr)>1||Math.abs(Pn)>1)&&se(Math.abs(xr)>Math.abs(Pn)?"x":"y");let Ur={x:0,y:0};G==="y"?(Xt.includes("top")||Xt.includes("bottom"))&&(Xt.includes("top")&&Pn<0||Xt.includes("bottom")&&Pn>0)&&(Ur.y=Pn):G==="x"&&(Xt.includes("left")||Xt.includes("right"))&&(Xt.includes("left")&&xr<0||Xt.includes("right")&&xr>0)&&(Ur.x=xr),(Math.abs(Ur.x)>0||Math.abs(Ur.y)>0)&&Qt(!0),(xn=Ye.current)==null||xn.style.setProperty("--swipe-amount-x",`${Ur.x}px`),(En=Ye.current)==null||En.style.setProperty("--swipe-amount-y",`${Ur.y}px`)}},Ae&&!y.jsx?fe.createElement("button",{"aria-label":B,"data-disabled":Wr,"data-close-button":!0,onClick:Wr||!Gt?()=>{}:()=>{var ze;pr(),(ze=y.onDismiss)==null||ze.call(y,y)},className:Cr(z==null?void 0:z.closeButton,(a=y==null?void 0:y.classNames)==null?void 0:a.closeButton)},(l=X==null?void 0:X.close)!=null?l:IT):null,y.jsx||x.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:fe.createElement(fe.Fragment,null,ht||y.icon||y.promise?fe.createElement("div",{"data-icon":"",className:Cr(z==null?void 0:z.icon,(c=y==null?void 0:y.classNames)==null?void 0:c.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||tu():null,y.type!=="loading"?y.icon||(X==null?void 0:X[ht])||PT(ht):null):null,fe.createElement("div",{"data-content":"",className:Cr(z==null?void 0:z.content,(u=y==null?void 0:y.classNames)==null?void 0:u.content)},fe.createElement("div",{"data-title":"",className:Cr(z==null?void 0:z.title,(f=y==null?void 0:y.classNames)==null?void 0:f.title)},typeof y.title=="function"?y.title():y.title),y.description?fe.createElement("div",{"data-description":"",className:Cr(te,ne,z==null?void 0:z.description,(m=y==null?void 0:y.classNames)==null?void 0:m.description)},typeof y.description=="function"?y.description():y.description):null),x.isValidElement(y.cancel)?y.cancel:y.cancel&&fd(y.cancel)?fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||H,onClick:ze=>{var Ze,it;fd(y.cancel)&&Gt&&((it=(Ze=y.cancel).onClick)==null||it.call(Ze,ze),pr())},className:Cr(z==null?void 0:z.cancelButton,(p=y==null?void 0:y.classNames)==null?void 0:p.cancelButton)},y.cancel.label):null,x.isValidElement(y.action)?y.action:y.action&&fd(y.action)?fe.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||I,onClick:ze=>{var Ze,it;fd(y.action)&&((it=(Ze=y.action).onClick)==null||it.call(Ze,ze),!ze.defaultPrevented&&pr())},className:Cr(z==null?void 0:z.actionButton,(g=y==null?void 0:y.classNames)==null?void 0:g.actionButton)},y.action.label):null))};function Ew(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function e4(e,t){let n={};return[e,t].forEach((r,a)=>{let l=a===1,c=l?"--mobile-offset":"--offset",u=l?KT:qT;function f(m){["top","right","bottom","left"].forEach(p=>{n[`${c}-${p}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=u:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(u)}),n}var t4=x.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:f,mobileOffset:m,theme:p="light",richColors:g,duration:v,style:y,visibleToasts:k=HT,toastOptions:j,dir:N=Ew(),gap:_=QT,loadingIcon:w,icons:S,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:P}=e,[T,M]=fe.useState([]),D=fe.useMemo(()=>Array.from(new Set([r].concat(T.filter(L=>L.position).map(L=>L.position)))),[T,r]),[q,H]=fe.useState([]),[I,F]=fe.useState(!1),[te,Y]=fe.useState(!1),[O,U]=fe.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=fe.useRef(null),R=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=fe.useRef(null),X=fe.useRef(!1),B=fe.useCallback(L=>{M(G=>{var se;return(se=G.find(ae=>ae.id===L.id))!=null&&se.delete||$n.dismiss(L.id),G.filter(({id:ae})=>ae!==L.id)})},[]);return fe.useEffect(()=>$n.subscribe(L=>{if(L.dismiss){M(G=>G.map(se=>se.id===L.id?{...se,delete:!0}:se));return}setTimeout(()=>{ON.flushSync(()=>{M(G=>{let se=G.findIndex(ae=>ae.id===L.id);return se!==-1?[...G.slice(0,se),{...G[se],...L},...G.slice(se+1)]:[L,...G]})})})}),[]),fe.useEffect(()=>{if(p!=="system"){U(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{L.addListener(({matches:se})=>{try{U(se?"dark":"light")}catch(ae){console.error(ae)}})}},[p]),fe.useEffect(()=>{T.length<=1&&F(!1)},[T]),fe.useEffect(()=>{let L=G=>{var se,ae;a.every(ue=>G[ue]||G.code===ue)&&(F(!0),(se=$.current)==null||se.focus()),G.code==="Escape"&&(document.activeElement===$.current||(ae=$.current)!=null&&ae.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[a]),fe.useEffect(()=>{if($.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,X.current=!1)}},[$.current]),fe.createElement("section",{ref:t,"aria-label":`${E} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((L,G)=>{var se;let[ae,ue]=L.split("-");return T.length?fe.createElement("ol",{key:L,dir:N==="auto"?Ew():N,tabIndex:-1,ref:$,className:u,"data-sonner-toaster":!0,"data-theme":O,"data-y-position":ae,"data-lifted":I&&T.length>1&&!l,"data-x-position":ue,style:{"--front-toast-height":`${((se=q[0])==null?void 0:se.height)||0}px`,"--width":`${YT}px`,"--gap":`${_}px`,...y,...e4(f,m)},onBlur:oe=>{X.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(X.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||X.current||(X.current=!0,z.current=oe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{te||F(!1)},onDragEnd:()=>F(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},T.filter(oe=>!oe.position&&G===0||oe.position===L).map((oe,he)=>{var ge,Ce;return fe.createElement(JT,{key:oe.id,icons:S,index:he,toast:oe,defaultRichColors:g,duration:(ge=j==null?void 0:j.duration)!=null?ge:v,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:n,visibleToasts:k,closeButton:(Ce=j==null?void 0:j.closeButton)!=null?Ce:c,interacting:te,position:L,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:B,toasts:T.filter(ce=>ce.position==oe.position),heights:q.filter(ce=>ce.position==oe.position),setHeights:H,expandByDefault:l,gap:_,loadingIcon:w,expanded:I,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const n4=({...e})=>s.jsx(t4,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e}),r4=1,s4=1e6;let cp=0;function o4(){return cp=(cp+1)%Number.MAX_SAFE_INTEGER,cp.toString()}const up=new Map,Pw=e=>{if(up.has(e))return;const t=setTimeout(()=>{up.delete(e),lc({type:"REMOVE_TOAST",toastId:e})},s4);up.set(e,t)},a4=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,r4)};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?Pw(n):e.toasts.forEach(r=>{Pw(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)}}},Rd=[];let Od={toasts:[]};function lc(e){Od=a4(Od,e),Rd.forEach(t=>{t(Od)})}function xe({...e}){const t=o4(),n=a=>lc({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>lc({type:"DISMISS_TOAST",toastId:t});return lc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function i4(){const[e,t]=x.useState(Od);return x.useEffect(()=>(Rd.push(t),()=>{const n=Rd.indexOf(t);n>-1&&Rd.splice(n,1)}),[e]),{...e,toast:xe,dismiss:n=>lc({type:"DISMISS_TOAST",toastId:n})}}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Tw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mr(...e){return t=>{let n=!1;const r=e.map(a=>{const l=Tw(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<r.length;a++){const l=r[a];typeof l=="function"?l():Tw(e[a],null)}}}}function Je(...e){return x.useCallback(mr(...e),e)}function l4(e,t){const n=x.createContext(t),r=l=>{const{children:c,...u}=l,f=x.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function a(l){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,a]}function Os(e,t=[]){let n=[];function r(l,c){const u=x.createContext(c),f=n.length;n=[...n,c];const m=g=>{var _;const{scope:v,children:y,...k}=g,j=((_=v==null?void 0:v[e])==null?void 0:_[f])||u,N=x.useMemo(()=>k,Object.values(k));return s.jsx(j.Provider,{value:N,children:y})};m.displayName=l+"Provider";function p(g,v){var j;const y=((j=v==null?void 0:v[e])==null?void 0:j[f])||u,k=x.useContext(y);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[m,p]}const a=()=>{const l=n.map(c=>x.createContext(c));return function(u){const f=(u==null?void 0:u[e])||l;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return a.scopeName=e,[r,c4(a,...t)]}function c4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(l){const c=r.reduce((u,{useScope:f,scopeName:m})=>{const g=f(l)[`__scope${m}`];return{...u,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Aw(e){const t=u4(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,u=x.Children.toArray(l),f=u.find(f4);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function u4(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=h4(a),u=m4(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d4=Symbol("radix.slottable");function f4(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d4}function m4(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function h4(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function HN(e){const t=e+"CollectionProvider",[n,r]=Os(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j=>{const{scope:N,children:_}=j,w=fe.useRef(null),S=fe.useRef(new Map).current;return s.jsx(a,{scope:N,itemMap:S,collectionRef:w,children:_})};c.displayName=t;const u=e+"CollectionSlot",f=Aw(u),m=fe.forwardRef((j,N)=>{const{scope:_,children:w}=j,S=l(u,_),E=Je(N,S.collectionRef);return s.jsx(f,{ref:E,children:w})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Aw(p),y=fe.forwardRef((j,N)=>{const{scope:_,children:w,...S}=j,E=fe.useRef(null),P=Je(N,E),T=l(p,_);return fe.useEffect(()=>(T.itemMap.set(E,{ref:E,...S}),()=>void T.itemMap.delete(E))),s.jsx(v,{[g]:"",ref:P,children:w})});y.displayName=p;function k(j){const N=l(e+"CollectionConsumer",j);return fe.useCallback(()=>{const w=N.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${g}]`));return Array.from(N.itemMap.values()).sort((T,M)=>S.indexOf(T.ref.current)-S.indexOf(M.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:c,Slot:m,ItemSlot:y},k,r]}function p4(e){const t=x4(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,u=x.Children.toArray(l),f=u.find(y4);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function x4(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=b4(a),u=v4(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g4=Symbol("radix.slottable");function y4(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g4}function v4(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function b4(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var w4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=w4.reduce((e,t)=>{const n=p4(`Primitive.${t}`),r=x.forwardRef((a,l)=>{const{asChild:c,...u}=a,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(f,{...u,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qN(e,t){e&&Qi.flushSync(()=>e.dispatchEvent(t))}function Mr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function j4(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N4="DismissableLayer",Cx="dismissableLayer.update",C4="dismissableLayer.pointerDownOutside",k4="dismissableLayer.focusOutside",Mw,KN=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zi=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...f}=e,m=x.useContext(KN),[p,g]=x.useState(null),v=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),k=Je(t,M=>g(M)),j=Array.from(m.layers),[N]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=j.indexOf(N),w=p?j.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,E=w>=_,P=_4(M=>{const D=M.target,q=[...m.branches].some(H=>H.contains(D));!E||q||(a==null||a(M),c==null||c(M),M.defaultPrevented||u==null||u())},v),T=E4(M=>{const D=M.target;[...m.branches].some(H=>H.contains(D))||(l==null||l(M),c==null||c(M),M.defaultPrevented||u==null||u())},v);return j4(M=>{w===m.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&u&&(M.preventDefault(),u()))},v),x.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Mw=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Dw(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Mw)}},[p,v,n,m]),x.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Dw())},[p,m]),x.useEffect(()=>{const M=()=>y({});return document.addEventListener(Cx,M),()=>document.removeEventListener(Cx,M)},[]),s.jsx($e.div,{...f,ref:k,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,P.onPointerDownCapture)})});Zi.displayName=N4;var S4="DismissableLayerBranch",YN=x.forwardRef((e,t)=>{const n=x.useContext(KN),r=x.useRef(null),a=Je(t,r);return x.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx($e.div,{...e,ref:a})});YN.displayName=S4;function _4(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const l=u=>{if(u.target&&!r.current){let f=function(){QN(C4,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function E4(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=x.useRef(!1);return x.useEffect(()=>{const a=l=>{l.target&&!r.current&&QN(k4,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Dw(){const e=new CustomEvent(Cx);document.dispatchEvent(e)}function QN(e,t,n,{discrete:r}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?qN(a,l):a.dispatchEvent(l)}var P4=Zi,T4=YN,sn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},A4="Portal",Ic=x.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,l]=x.useState(!1);sn(()=>l(!0),[]);const c=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?ON.createPortal(s.jsx($e.div,{...r,ref:t}),c):null});Ic.displayName=A4;function M4(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Is=e=>{const{present:t,children:n}=e,r=D4(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),l=Je(r.ref,R4(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:l}):null};Is.displayName="Presence";function D4(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),l=x.useRef("none"),c=e?"mounted":"unmounted",[u,f]=M4(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const m=md(r.current);l.current=u==="mounted"?m:"none"},[u]),sn(()=>{const m=r.current,p=a.current;if(p!==e){const v=l.current,y=md(m);e?f("MOUNT"):y==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),sn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=y=>{const j=md(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&j&&(f("ANIMATION_END"),!a.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},v=y=>{y.target===t&&(l.current=md(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function md(e){return(e==null?void 0:e.animationName)||"none"}function R4(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O4=Mf[" useInsertionEffect ".trim().toString()]||sn;function Aa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,l,c]=I4({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const g=p.current;g!==u&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const m=x.useCallback(p=>{var g;if(u){const v=L4(p)?p(e):p;v!==e&&((g=c.current)==null||g.call(c,v))}else l(p)},[u,e,l,c]);return[f,m]}function I4({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),l=x.useRef(t);return O4(()=>{l.current=t},[t]),x.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,r,l]}function L4(e){return typeof e=="function"}var GN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),F4="VisuallyHidden",Rf=x.forwardRef((e,t)=>s.jsx($e.span,{...e,ref:t,style:{...GN,...e.style}}));Rf.displayName=F4;var $4=Rf,Lg="ToastProvider",[Fg,V4,B4]=HN("Toast"),[XN]=Os("Toast",[B4]),[z4,Of]=XN(Lg),ZN=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:l=50,children:c}=e,[u,f]=x.useState(null),[m,p]=x.useState(0),g=x.useRef(!1),v=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lg}\`. Expected non-empty \`string\`.`),s.jsx(Fg.Provider,{scope:t,children:s.jsx(z4,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:l,toastCount:m,viewport:u,onViewportChange:f,onToastAdd:x.useCallback(()=>p(y=>y+1),[]),onToastRemove:x.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:v,children:c})})};ZN.displayName=Lg;var JN="ToastViewport",W4=["F8"],kx="toast.viewportPause",Sx="toast.viewportResume",eC=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=W4,label:a="Notifications ({hotkey})",...l}=e,c=Of(JN,n),u=V4(n),f=x.useRef(null),m=x.useRef(null),p=x.useRef(null),g=x.useRef(null),v=Je(t,g,c.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=c.toastCount>0;x.useEffect(()=>{const N=_=>{var S;r.length!==0&&r.every(E=>_[E]||_.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[r]),x.useEffect(()=>{const N=f.current,_=g.current;if(k&&N&&_){const w=()=>{if(!c.isClosePausedRef.current){const T=new CustomEvent(kx);_.dispatchEvent(T),c.isClosePausedRef.current=!0}},S=()=>{if(c.isClosePausedRef.current){const T=new CustomEvent(Sx);_.dispatchEvent(T),c.isClosePausedRef.current=!1}},E=T=>{!N.contains(T.relatedTarget)&&S()},P=()=>{N.contains(document.activeElement)||S()};return N.addEventListener("focusin",w),N.addEventListener("focusout",E),N.addEventListener("pointermove",w),N.addEventListener("pointerleave",P),window.addEventListener("blur",w),window.addEventListener("focus",S),()=>{N.removeEventListener("focusin",w),N.removeEventListener("focusout",E),N.removeEventListener("pointermove",w),N.removeEventListener("pointerleave",P),window.removeEventListener("blur",w),window.removeEventListener("focus",S)}}},[k,c.isClosePausedRef]);const j=x.useCallback(({tabbingDirection:N})=>{const w=u().map(S=>{const E=S.ref.current,P=[E,...nA(E)];return N==="forwards"?P:P.reverse()});return(N==="forwards"?w.reverse():w).flat()},[u]);return x.useEffect(()=>{const N=g.current;if(N){const _=w=>{var P,T,M;const S=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!S){const D=document.activeElement,q=w.shiftKey;if(w.target===N&&q){(P=m.current)==null||P.focus();return}const F=j({tabbingDirection:q?"backwards":"forwards"}),te=F.findIndex(Y=>Y===D);dp(F.slice(te+1))?w.preventDefault():q?(T=m.current)==null||T.focus():(M=p.current)==null||M.focus()}};return N.addEventListener("keydown",_),()=>N.removeEventListener("keydown",_)}},[u,j]),s.jsxs(T4,{ref:f,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:k?void 0:"none"},children:[k&&s.jsx(_x,{ref:m,onFocusFromOutsideViewport:()=>{const N=j({tabbingDirection:"forwards"});dp(N)}}),s.jsx(Fg.Slot,{scope:n,children:s.jsx($e.ol,{tabIndex:-1,...l,ref:v})}),k&&s.jsx(_x,{ref:p,onFocusFromOutsideViewport:()=>{const N=j({tabbingDirection:"backwards"});dp(N)}})]})});eC.displayName=JN;var tC="ToastFocusProxy",_x=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,l=Of(tC,n);return s.jsx(Rf,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var m;const u=c.relatedTarget;!((m=l.viewport)!=null&&m.contains(u))&&r()}})});_x.displayName=tC;var Lc="Toast",U4="toast.swipeStart",H4="toast.swipeMove",q4="toast.swipeCancel",K4="toast.swipeEnd",nC=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:l,...c}=e,[u,f]=Aa({prop:r,defaultProp:a??!0,onChange:l,caller:Lc});return s.jsx(Is,{present:n||u,children:s.jsx(G4,{open:u,...c,ref:t,onClose:()=>f(!1),onPause:Mr(e.onPause),onResume:Mr(e.onResume),onSwipeStart:Ie(e.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(e.onSwipeMove,m=>{const{x:p,y:g}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ie(e.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ie(e.onSwipeEnd,m=>{const{x:p,y:g}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),f(!1)})})})});nC.displayName=Lc;var[Y4,Q4]=XN(Lc,{onClose(){}}),G4=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:l,onClose:c,onEscapeKeyDown:u,onPause:f,onResume:m,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:v,onSwipeEnd:y,...k}=e,j=Of(Lc,n),[N,_]=x.useState(null),w=Je(t,Y=>_(Y)),S=x.useRef(null),E=x.useRef(null),P=a||j.duration,T=x.useRef(0),M=x.useRef(P),D=x.useRef(0),{onToastAdd:q,onToastRemove:H}=j,I=Mr(()=>{var O;(N==null?void 0:N.contains(document.activeElement))&&((O=j.viewport)==null||O.focus()),c()}),F=x.useCallback(Y=>{!Y||Y===1/0||(window.clearTimeout(D.current),T.current=new Date().getTime(),D.current=window.setTimeout(I,Y))},[I]);x.useEffect(()=>{const Y=j.viewport;if(Y){const O=()=>{F(M.current),m==null||m()},U=()=>{const $=new Date().getTime()-T.current;M.current=M.current-$,window.clearTimeout(D.current),f==null||f()};return Y.addEventListener(kx,U),Y.addEventListener(Sx,O),()=>{Y.removeEventListener(kx,U),Y.removeEventListener(Sx,O)}}},[j.viewport,P,f,m,F]),x.useEffect(()=>{l&&!j.isClosePausedRef.current&&F(P)},[l,P,j.isClosePausedRef,F]),x.useEffect(()=>(q(),()=>H()),[q,H]);const te=x.useMemo(()=>N?cC(N):null,[N]);return j.viewport?s.jsxs(s.Fragment,{children:[te&&s.jsx(X4,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:te}),s.jsx(Y4,{scope:n,onClose:I,children:Qi.createPortal(s.jsx(Fg.ItemSlot,{scope:n,children:s.jsx(P4,{asChild:!0,onEscapeKeyDown:Ie(u,()=>{j.isFocusedToastEscapeKeyDownRef.current||I(),j.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx($e.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":j.swipeDirection,...k,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ie(e.onKeyDown,Y=>{Y.key==="Escape"&&(u==null||u(Y.nativeEvent),Y.nativeEvent.defaultPrevented||(j.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:Ie(e.onPointerDown,Y=>{Y.button===0&&(S.current={x:Y.clientX,y:Y.clientY})}),onPointerMove:Ie(e.onPointerMove,Y=>{if(!S.current)return;const O=Y.clientX-S.current.x,U=Y.clientY-S.current.y,$=!!E.current,R=["left","right"].includes(j.swipeDirection),z=["left","up"].includes(j.swipeDirection)?Math.min:Math.max,X=R?z(0,O):0,B=R?0:z(0,U),L=Y.pointerType==="touch"?10:2,G={x:X,y:B},se={originalEvent:Y,delta:G};$?(E.current=G,hd(H4,g,se,{discrete:!1})):Rw(G,j.swipeDirection,L)?(E.current=G,hd(U4,p,se,{discrete:!1}),Y.target.setPointerCapture(Y.pointerId)):(Math.abs(O)>L||Math.abs(U)>L)&&(S.current=null)}),onPointerUp:Ie(e.onPointerUp,Y=>{const O=E.current,U=Y.target;if(U.hasPointerCapture(Y.pointerId)&&U.releasePointerCapture(Y.pointerId),E.current=null,S.current=null,O){const $=Y.currentTarget,R={originalEvent:Y,delta:O};Rw(O,j.swipeDirection,j.swipeThreshold)?hd(K4,y,R,{discrete:!0}):hd(q4,v,R,{discrete:!0}),$.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),j.viewport)})]}):null}),X4=e=>{const{__scopeToast:t,children:n,...r}=e,a=Of(Lc,t),[l,c]=x.useState(!1),[u,f]=x.useState(!1);return eA(()=>c(!0)),x.useEffect(()=>{const m=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(m)},[]),u?null:s.jsx(Ic,{asChild:!0,children:s.jsx(Rf,{...r,children:l&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},Z4="ToastTitle",rC=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx($e.div,{...r,ref:t})});rC.displayName=Z4;var J4="ToastDescription",sC=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx($e.div,{...r,ref:t})});sC.displayName=J4;var oC="ToastAction",aC=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(lC,{altText:n,asChild:!0,children:s.jsx($g,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${oC}\`. Expected non-empty \`string\`.`),null)});aC.displayName=oC;var iC="ToastClose",$g=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=Q4(iC,n);return s.jsx(lC,{asChild:!0,children:s.jsx($e.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,a.onClose)})})});$g.displayName=iC;var lC=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx($e.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function cC(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),tA(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",l=r.dataset.radixToastAnnounceExclude==="";if(!a)if(l){const c=r.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...cC(r))}}),t}function hd(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?qN(a,l):a.dispatchEvent(l)}var Rw=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),l=r>a;return t==="left"||t==="right"?l&&r>n:!l&&a>n};function eA(e=()=>{}){const t=Mr(e);sn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function tA(e){return e.nodeType===e.ELEMENT_NODE}function nA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var rA=ZN,uC=eC,dC=nC,fC=rC,mC=sC,hC=aC,pC=$g;function xC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=xC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gC(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=xC(e))&&(r&&(r+=" "),r+=t);return r}const Ow=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Iw=gC,Vg=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Iw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(m=>{const p=n==null?void 0:n[m],g=l==null?void 0:l[m];if(p===null)return null;const v=Ow(p)||Ow(g);return a[m][v]}),u=n&&Object.entries(n).reduce((m,p)=>{let[g,v]=p;return v===void 0||(m[g]=v),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,p)=>{let{class:g,className:v,...y}=p;return Object.entries(y).every(k=>{let[j,N]=k;return Array.isArray(N)?N.includes({...l,...u}[j]):{...l,...u}[j]===N})?[...m,g,v]:m},[]);return Iw(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
69
|
+
* @license lucide-react v0.468.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const sA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
74
|
+
* @license lucide-react v0.468.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/var oA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
79
|
+
* @license lucide-react v0.468.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const aA=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:l,iconNode:c,...u},f)=>x.createElement("svg",{ref:f,...oA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yC("lucide",a),...u},[...c.map(([m,p])=>x.createElement(m,p)),...Array.isArray(l)?l:[l]]));/**
|
|
84
|
+
* @license lucide-react v0.468.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const pe=(e,t)=>{const n=x.forwardRef(({className:r,...a},l)=>x.createElement(aA,{ref:l,iconNode:t,className:yC(`lucide-${sA(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
89
|
+
* @license lucide-react v0.468.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const yc=pe("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"}]]);/**
|
|
94
|
+
* @license lucide-react v0.468.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const iA=pe("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
|
99
|
+
* @license lucide-react v0.468.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const ji=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
104
|
+
* @license lucide-react v0.468.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const lA=pe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
109
|
+
* @license lucide-react v0.468.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const Ex=pe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
114
|
+
* @license lucide-react v0.468.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const fn=pe("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"}]]);/**
|
|
119
|
+
* @license lucide-react v0.468.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const Fc=pe("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"}]]);/**
|
|
124
|
+
* @license lucide-react v0.468.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const nf=pe("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
129
|
+
* @license lucide-react v0.468.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const Px=pe("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"}]]);/**
|
|
134
|
+
* @license lucide-react v0.468.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const cA=pe("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"}]]);/**
|
|
139
|
+
* @license lucide-react v0.468.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const $c=pe("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"}]]);/**
|
|
144
|
+
* @license lucide-react v0.468.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const vC=pe("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"}]]);/**
|
|
149
|
+
* @license lucide-react v0.468.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const If=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
154
|
+
* @license lucide-react v0.468.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const Wn=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
159
|
+
* @license lucide-react v0.468.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Vo=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
164
|
+
* @license lucide-react v0.468.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const Ao=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
169
|
+
* @license lucide-react v0.468.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const $r=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
174
|
+
* @license lucide-react v0.468.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const Lw=pe("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"}]]);/**
|
|
179
|
+
* @license lucide-react v0.468.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const er=pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
184
|
+
* @license lucide-react v0.468.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const Fw=pe("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
189
|
+
* @license lucide-react v0.468.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const uA=pe("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
|
|
194
|
+
* @license lucide-react v0.468.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const $i=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
199
|
+
* @license lucide-react v0.468.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const rf=pe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
204
|
+
* @license lucide-react v0.468.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const Ji=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
209
|
+
* @license lucide-react v0.468.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const bC=pe("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
214
|
+
* @license lucide-react v0.468.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const wC=pe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
219
|
+
* @license lucide-react v0.468.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const jC=pe("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"}]]);/**
|
|
224
|
+
* @license lucide-react v0.468.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const NC=pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
229
|
+
* @license lucide-react v0.468.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const Bg=pe("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"}]]);/**
|
|
234
|
+
* @license lucide-react v0.468.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const dA=pe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
239
|
+
* @license lucide-react v0.468.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const fA=pe("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"}]]);/**
|
|
244
|
+
* @license lucide-react v0.468.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const Fa=pe("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"}]]);/**
|
|
249
|
+
* @license lucide-react v0.468.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const mA=pe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
254
|
+
* @license lucide-react v0.468.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const Tx=pe("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
|
|
259
|
+
* @license lucide-react v0.468.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const CC=pe("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"}]]);/**
|
|
264
|
+
* @license lucide-react v0.468.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const Lf=pe("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"}]]);/**
|
|
269
|
+
* @license lucide-react v0.468.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const Ff=pe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
274
|
+
* @license lucide-react v0.468.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const hA=pe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
279
|
+
* @license lucide-react v0.468.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const cc=pe("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
284
|
+
* @license lucide-react v0.468.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const kC=pe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
289
|
+
* @license lucide-react v0.468.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const pA=pe("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"}]]);/**
|
|
294
|
+
* @license lucide-react v0.468.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const Vc=pe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
299
|
+
* @license lucide-react v0.468.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const vc=pe("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
304
|
+
* @license lucide-react v0.468.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const xA=pe("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"}]]);/**
|
|
309
|
+
* @license lucide-react v0.468.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const gA=pe("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
314
|
+
* @license lucide-react v0.468.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const $a=pe("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
319
|
+
* @license lucide-react v0.468.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const sf=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
324
|
+
* @license lucide-react v0.468.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const SC=pe("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"}]]);/**
|
|
329
|
+
* @license lucide-react v0.468.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const yA=pe("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"}]]);/**
|
|
334
|
+
* @license lucide-react v0.468.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const _C=pe("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"}]]);/**
|
|
339
|
+
* @license lucide-react v0.468.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const Ni=pe("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"}]]);/**
|
|
344
|
+
* @license lucide-react v0.468.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const vA=pe("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
|
|
349
|
+
* @license lucide-react v0.468.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const EC=pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
354
|
+
* @license lucide-react v0.468.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const Id=pe("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
|
|
359
|
+
* @license lucide-react v0.468.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const bA=pe("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"}]]);/**
|
|
364
|
+
* @license lucide-react v0.468.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const wA=pe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
369
|
+
* @license lucide-react v0.468.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const jA=pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
374
|
+
* @license lucide-react v0.468.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const ls=pe("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"}]]);/**
|
|
379
|
+
* @license lucide-react v0.468.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const bc=pe("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"}]]);/**
|
|
384
|
+
* @license lucide-react v0.468.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const NA=pe("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
|
|
389
|
+
* @license lucide-react v0.468.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const Vi=pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
394
|
+
* @license lucide-react v0.468.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const Bo=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
399
|
+
* @license lucide-react v0.468.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const $w=pe("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
404
|
+
* @license lucide-react v0.468.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const Vw=pe("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
409
|
+
* @license lucide-react v0.468.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const CA=pe("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/**
|
|
414
|
+
* @license lucide-react v0.468.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const kA=pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
419
|
+
* @license lucide-react v0.468.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const el=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
424
|
+
* @license lucide-react v0.468.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const zg=pe("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"}]]);/**
|
|
429
|
+
* @license lucide-react v0.468.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const PC=pe("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"}]]);/**
|
|
434
|
+
* @license lucide-react v0.468.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const wc=pe("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"}]]);/**
|
|
439
|
+
* @license lucide-react v0.468.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const SA=pe("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"}]]);/**
|
|
444
|
+
* @license lucide-react v0.468.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const kn=pe("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"}]]);/**
|
|
449
|
+
* @license lucide-react v0.468.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const _A=pe("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);/**
|
|
454
|
+
* @license lucide-react v0.468.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const EA=pe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
459
|
+
* @license lucide-react v0.468.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const TC=pe("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
|
|
464
|
+
* @license lucide-react v0.468.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const AC=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
469
|
+
* @license lucide-react v0.468.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const MC=pe("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"}]]);/**
|
|
474
|
+
* @license lucide-react v0.468.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const Ts=pe("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"}]]);/**
|
|
479
|
+
* @license lucide-react v0.468.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const PA=pe("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"}]]);/**
|
|
484
|
+
* @license lucide-react v0.468.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const cs=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
489
|
+
* @license lucide-react v0.468.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const Bc=pe("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"}]]);/**
|
|
494
|
+
* @license lucide-react v0.468.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const Ma=pe("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"}]]);/**
|
|
499
|
+
* @license lucide-react v0.468.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const of=pe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
504
|
+
* @license lucide-react v0.468.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const Sn=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wg="-",TA=e=>{const t=MA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const u=c.split(Wg);return u[0]===""&&u.length!==1&&u.shift(),DC(u,t)||AA(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&r[c]?[...f,...r[c]]:f}}},DC=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?DC(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Wg);return(c=t.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},Bw=/^\[(.+)\]$/,AA=e=>{if(Bw.test(e)){const t=Bw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},MA=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return RA(Object.entries(e.classGroups),n).forEach(([l,c])=>{Ax(c,r,l,t)}),r},Ax=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:zw(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(DA(a)){Ax(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Ax(c,zw(t,l),n,r)})})},zw=(e,t)=>{let n=e;return t.split(Wg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},DA=e=>e.isThemeGetter,RA=(e,t)=>t?e.map(([n,r])=>{const a=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,u])=>[t+c,u])):l);return[n,a]}):e,OA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},RC="!",IA=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],l=t.length,c=u=>{const f=[];let m=0,p=0,g;for(let N=0;N<u.length;N++){let _=u[N];if(m===0){if(_===a&&(r||u.slice(N,N+l)===t)){f.push(u.slice(p,N)),p=N+l;continue}if(_==="/"){g=N;continue}}_==="["?m++:_==="]"&&m--}const v=f.length===0?u:u.substring(p),y=v.startsWith(RC),k=y?v.substring(1):v,j=g&&g>p?g-p:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:k,maybePostfixModifierPosition:j}};return n?u=>n({className:u,parseClassName:c}):c},LA=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},FA=e=>({cache:OA(e.cacheSize),parseClassName:IA(e),...TA(e)}),$A=/\s+/,VA=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split($A);let u="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{modifiers:p,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:y}=n(m);let k=!!y,j=r(k?v.substring(0,y):v);if(!j){if(!k){u=m+(u.length>0?" "+u:u);continue}if(j=r(v),!j){u=m+(u.length>0?" "+u:u);continue}k=!1}const N=LA(p).join(":"),_=g?N+RC:N,w=_+j;if(l.includes(w))continue;l.push(w);const S=a(j,k);for(let E=0;E<S.length;++E){const P=S[E];l.push(_+P)}u=m+(u.length>0?" "+u:u)}return u};function BA(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=OC(t))&&(r&&(r+=" "),r+=n);return r}const OC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=OC(e[r]))&&(n&&(n+=" "),n+=t);return n};function zA(e,...t){let n,r,a,l=c;function c(f){const m=t.reduce((p,g)=>g(p),e());return n=FA(m),r=n.cache.get,a=n.cache.set,l=u,u(f)}function u(f){const m=r(f);if(m)return m;const p=VA(f,n);return a(f,p),p}return function(){return l(BA.apply(null,arguments))}}const gt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},IC=/^\[(?:([a-z-]+):)?(.+)\]$/i,WA=/^\d+\/\d+$/,UA=new Set(["px","full","screen"]),HA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qA=/\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$/,KA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=e=>Ci(e)||UA.has(e)||WA.test(e),so=e=>tl(e,"length",rM),Ci=e=>!!e&&!Number.isNaN(Number(e)),fp=e=>tl(e,"number",Ci),Kl=e=>!!e&&Number.isInteger(Number(e)),GA=e=>e.endsWith("%")&&Ci(e.slice(0,-1)),Ue=e=>IC.test(e),oo=e=>HA.test(e),XA=new Set(["length","size","percentage"]),ZA=e=>tl(e,XA,LC),JA=e=>tl(e,"position",LC),eM=new Set(["image","url"]),tM=e=>tl(e,eM,oM),nM=e=>tl(e,"",sM),Yl=()=>!0,tl=(e,t,n)=>{const r=IC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},rM=e=>qA.test(e)&&!KA.test(e),LC=()=>!1,sM=e=>YA.test(e),oM=e=>QA.test(e),aM=()=>{const e=gt("colors"),t=gt("spacing"),n=gt("blur"),r=gt("brightness"),a=gt("borderColor"),l=gt("borderRadius"),c=gt("borderSpacing"),u=gt("borderWidth"),f=gt("contrast"),m=gt("grayscale"),p=gt("hueRotate"),g=gt("invert"),v=gt("gap"),y=gt("gradientColorStops"),k=gt("gradientColorStopPositions"),j=gt("inset"),N=gt("margin"),_=gt("opacity"),w=gt("padding"),S=gt("saturate"),E=gt("scale"),P=gt("sepia"),T=gt("skew"),M=gt("space"),D=gt("translate"),q=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ue,t],F=()=>[Ue,t],te=()=>["",js,so],Y=()=>["auto",Ci,Ue],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ue],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ci,Ue];return{cacheSize:500,separator:":",theme:{colors:[Yl],spacing:[js,so],blur:["none","",oo,Ue],brightness:B(),borderColor:[e],borderRadius:["none","","full",oo,Ue],borderSpacing:F(),borderWidth:te(),contrast:B(),grayscale:z(),hueRotate:B(),invert:z(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[GA,so],inset:I(),margin:I(),opacity:B(),padding:F(),saturate:B(),scale:B(),sepia:z(),skew:B(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Ue]}],container:["container"],columns:[{columns:[oo]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...O(),Ue]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kl,Ue]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ue]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Kl,Ue]}],"grid-cols":[{"grid-cols":[Yl]}],"col-start-end":[{col:["auto",{span:["full",Kl,Ue]},Ue]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Yl]}],"row-start-end":[{row:["auto",{span:[Kl,Ue]},Ue]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ue]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ue,t]}],"min-w":[{"min-w":[Ue,t,"min","max","fit"]}],"max-w":[{"max-w":[Ue,t,"none","full","min","max","fit","prose",{screen:[oo]},oo]}],h:[{h:[Ue,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ue,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ue,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ue,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oo,so]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fp]}],"font-family":[{font:[Yl]}],"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",Ue]}],"line-clamp":[{"line-clamp":["none",Ci,fp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",js,Ue]}],"list-image":[{"list-image":["none",Ue]}],"list-style-type":[{list:["none","disc","decimal",Ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",js,so]}],"underline-offset":[{"underline-offset":["auto",js,Ue]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue]}],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",Ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),JA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},tM]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:U()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[js,Ue]}],"outline-w":[{outline:[js,so]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[js,so]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oo,nM]}],"shadow-color":[{shadow:[Yl]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",oo,Ue]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ue]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Ue]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Kl,Ue]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ue]}],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",Ue]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ue]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[js,so,fp]}],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"]}}},iM=zA(aM);function Oe(...e){return iM(gC(e))}const lM=rA,FC=x.forwardRef(({className:e,...t},n)=>s.jsx(uC,{ref:n,className:Oe("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}));FC.displayName=uC.displayName;const cM=Vg("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"}}),$C=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(dC,{ref:r,className:Oe(cM({variant:t}),e),...n}));$C.displayName=dC.displayName;const uM=x.forwardRef(({className:e,...t},n)=>s.jsx(hC,{ref:n,className:Oe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));uM.displayName=hC.displayName;const VC=x.forwardRef(({className:e,...t},n)=>s.jsx(pC,{ref:n,className:Oe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Sn,{className:"h-4 w-4"})}));VC.displayName=pC.displayName;const BC=x.forwardRef(({className:e,...t},n)=>s.jsx(fC,{ref:n,className:Oe("text-sm font-semibold",e),...t}));BC.displayName=fC.displayName;const zC=x.forwardRef(({className:e,...t},n)=>s.jsx(mC,{ref:n,className:Oe("text-sm opacity-90",e),...t}));zC.displayName=mC.displayName;function dM(){const{toasts:e}=i4();return s.jsxs(lM,{children:[e.map(function({id:t,title:n,description:r,action:a,...l}){return s.jsxs($C,{...l,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(BC,{children:n}),r&&s.jsx(zC,{children:r})]}),a,s.jsx(VC,{})]},t)}),s.jsx(FC,{})]})}var fM=Mf[" useId ".trim().toString()]||(()=>{}),mM=0;function Xn(e){const[t,n]=x.useState(fM());return sn(()=>{n(r=>r??String(mM++))},[e]),t?`radix-${t}`:""}const hM=["top","right","bottom","left"],Mo=Math.min,Gn=Math.max,af=Math.round,pd=Math.floor,as=e=>({x:e,y:e}),pM={left:"right",right:"left",bottom:"top",top:"bottom"};function Mx(e,t,n){return Gn(e,Mo(t,n))}function As(e,t){return typeof e=="function"?e(t):e}function Ms(e){return e.split("-")[0]}function nl(e){return e.split("-")[1]}function Ug(e){return e==="x"?"y":"x"}function Hg(e){return e==="y"?"height":"width"}function ss(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qg(e){return Ug(ss(e))}function xM(e,t,n){n===void 0&&(n=!1);const r=nl(e),a=qg(e),l=Hg(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=lf(c)),[c,lf(c)]}function gM(e){const t=lf(e);return[Dx(e),t,Dx(t)]}function Dx(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ww=["left","right"],Uw=["right","left"],yM=["top","bottom"],vM=["bottom","top"];function bM(e,t,n){switch(e){case"top":case"bottom":return n?t?Uw:Ww:t?Ww:Uw;case"left":case"right":return t?yM:vM;default:return[]}}function wM(e,t,n,r){const a=nl(e);let l=bM(Ms(e),n==="start",r);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(Dx)))),l}function lf(e){const t=Ms(e);return pM[t]+e.slice(t.length)}function jM(e){return{top:0,right:0,bottom:0,left:0,...e}}function WC(e){return typeof e!="number"?jM(e):{top:e,right:e,bottom:e,left:e}}function cf(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Hw(e,t,n){let{reference:r,floating:a}=e;const l=ss(t),c=qg(t),u=Hg(c),f=Ms(t),m=l==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let y;switch(f){case"top":y={x:p,y:r.y-a.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-a.width,y:g};break;default:y={x:r.x,y:r.y}}switch(nl(t)){case"start":y[c]-=v*(n&&m?-1:1);break;case"end":y[c]+=v*(n&&m?-1:1);break}return y}async function NM(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:l,rects:c,elements:u,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:y=0}=As(t,e),k=WC(y),N=u[v?g==="floating"?"reference":"floating":g],_=cf(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(N)))==null||n?N:N.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:m,rootBoundary:p,strategy:f})),w=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),E=await(l.isElement==null?void 0:l.isElement(S))?await(l.getScale==null?void 0:l.getScale(S))||{x:1,y:1}:{x:1,y:1},P=cf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:S,strategy:f}):w);return{top:(_.top-P.top+k.top)/E.y,bottom:(P.bottom-_.bottom+k.bottom)/E.y,left:(_.left-P.left+k.left)/E.x,right:(P.right-_.right+k.right)/E.x}}const CM=50,kM=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,u=c.detectOverflow?c:{...c,detectOverflow:NM},f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=Hw(m,r,f),v=r,y=0;const k={};for(let j=0;j<l.length;j++){const N=l[j];if(!N)continue;const{name:_,fn:w}=N,{x:S,y:E,data:P,reset:T}=await w({x:p,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:k,rects:m,platform:u,elements:{reference:e,floating:t}});p=S??p,g=E??g,k[_]={...k[_],...P},T&&y<CM&&(y++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(m=T.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:p,y:g}=Hw(m,v,f)),j=-1)}return{x:p,y:g,placement:v,strategy:a,middlewareData:k}},SM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:l,platform:c,elements:u,middlewareData:f}=t,{element:m,padding:p=0}=As(e,t)||{};if(m==null)return{};const g=WC(p),v={x:n,y:r},y=qg(a),k=Hg(y),j=await c.getDimensions(m),N=y==="y",_=N?"top":"left",w=N?"bottom":"right",S=N?"clientHeight":"clientWidth",E=l.reference[k]+l.reference[y]-v[y]-l.floating[k],P=v[y]-l.reference[y],T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let M=T?T[S]:0;(!M||!await(c.isElement==null?void 0:c.isElement(T)))&&(M=u.floating[S]||l.floating[k]);const D=E/2-P/2,q=M/2-j[k]/2-1,H=Mo(g[_],q),I=Mo(g[w],q),F=H,te=M-j[k]-I,Y=M/2-j[k]/2+D,O=Mx(F,Y,te),U=!f.arrow&&nl(a)!=null&&Y!==O&&l.reference[k]/2-(Y<F?H:I)-j[k]/2<0,$=U?Y<F?Y-F:Y-te:0;return{[y]:v[y]+$,data:{[y]:O,centerOffset:Y-O-$,...U&&{alignmentOffset:$}},reset:U}}}),_M=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:l,rects:c,initialPlacement:u,platform:f,elements:m}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:j=!0,...N}=As(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const _=Ms(a),w=ss(u),S=Ms(u)===u,E=await(f.isRTL==null?void 0:f.isRTL(m.floating)),P=v||(S||!j?[lf(u)]:gM(u)),T=k!=="none";!v&&T&&P.push(...wM(u,j,k,E));const M=[u,...P],D=await f.detectOverflow(t,N),q=[];let H=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&q.push(D[_]),g){const Y=xM(a,c,E);q.push(D[Y[0]],D[Y[1]])}if(H=[...H,{placement:a,overflows:q}],!q.every(Y=>Y<=0)){var I,F;const Y=(((I=l.flip)==null?void 0:I.index)||0)+1,O=M[Y];if(O&&(!(g==="alignment"?w!==ss(O):!1)||H.every(R=>ss(R.placement)===w?R.overflows[0]>0:!0)))return{data:{index:Y,overflows:H},reset:{placement:O}};let U=(F=H.filter($=>$.overflows[0]<=0).sort(($,R)=>$.overflows[1]-R.overflows[1])[0])==null?void 0:F.placement;if(!U)switch(y){case"bestFit":{var te;const $=(te=H.filter(R=>{if(T){const z=ss(R.placement);return z===w||z==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,X)=>z+X,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:te[0];$&&(U=$);break}case"initialPlacement":U=u;break}if(a!==U)return{reset:{placement:U}}}return{}}}};function qw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kw(e){return hM.some(t=>e[t]>=0)}const EM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...l}=As(e,t);switch(a){case"referenceHidden":{const c=await r.detectOverflow(t,{...l,elementContext:"reference"}),u=qw(c,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Kw(u)}}}case"escaped":{const c=await r.detectOverflow(t,{...l,altBoundary:!0}),u=qw(c,n.floating);return{data:{escapedOffsets:u,escaped:Kw(u)}}}default:return{}}}}},UC=new Set(["left","top"]);async function PM(e,t){const{placement:n,platform:r,elements:a}=e,l=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ms(n),u=nl(n),f=ss(n)==="y",m=UC.has(c)?-1:1,p=l&&f?-1:1,g=As(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:k}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof k=="number"&&(y=u==="end"?k*-1:k),f?{x:y*p,y:v*m}:{x:v*m,y:y*p}}const TM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:l,placement:c,middlewareData:u}=t,f=await PM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:l+f.y,data:{...f,placement:c}}}}},AM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:l}=t,{mainAxis:c=!0,crossAxis:u=!1,limiter:f={fn:_=>{let{x:w,y:S}=_;return{x:w,y:S}}},...m}=As(e,t),p={x:n,y:r},g=await l.detectOverflow(t,m),v=ss(Ms(a)),y=Ug(v);let k=p[y],j=p[v];if(c){const _=y==="y"?"top":"left",w=y==="y"?"bottom":"right",S=k+g[_],E=k-g[w];k=Mx(S,k,E)}if(u){const _=v==="y"?"top":"left",w=v==="y"?"bottom":"right",S=j+g[_],E=j-g[w];j=Mx(S,j,E)}const N=f.fn({...t,[y]:k,[v]:j});return{...N,data:{x:N.x-n,y:N.y-r,enabled:{[y]:c,[v]:u}}}}}},MM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:m=!0}=As(e,t),p={x:n,y:r},g=ss(a),v=Ug(g);let y=p[v],k=p[g];const j=As(u,t),N=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const S=v==="y"?"height":"width",E=l.reference[v]-l.floating[S]+N.mainAxis,P=l.reference[v]+l.reference[S]-N.mainAxis;y<E?y=E:y>P&&(y=P)}if(m){var _,w;const S=v==="y"?"width":"height",E=UC.has(Ms(a)),P=l.reference[g]-l.floating[S]+(E&&((_=c.offset)==null?void 0:_[g])||0)+(E?0:N.crossAxis),T=l.reference[g]+l.reference[S]+(E?0:((w=c.offset)==null?void 0:w[g])||0)-(E?N.crossAxis:0);k<P?k=P:k>T&&(k=T)}return{[v]:y,[g]:k}}}},DM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:l,platform:c,elements:u}=t,{apply:f=()=>{},...m}=As(e,t),p=await c.detectOverflow(t,m),g=Ms(a),v=nl(a),y=ss(a)==="y",{width:k,height:j}=l.floating;let N,_;g==="top"||g==="bottom"?(N=g,_=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(_=g,N=v==="end"?"top":"bottom");const w=j-p.top-p.bottom,S=k-p.left-p.right,E=Mo(j-p[N],w),P=Mo(k-p[_],S),T=!t.middlewareData.shift;let M=E,D=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=w),T&&!v){const H=Gn(p.left,0),I=Gn(p.right,0),F=Gn(p.top,0),te=Gn(p.bottom,0);y?D=k-2*(H!==0||I!==0?H+I:Gn(p.left,p.right)):M=j-2*(F!==0||te!==0?F+te:Gn(p.top,p.bottom))}await f({...t,availableWidth:D,availableHeight:M});const q=await c.getDimensions(u.floating);return k!==q.width||j!==q.height?{reset:{rects:!0}}:{}}}};function $f(){return typeof window<"u"}function rl(e){return HC(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(HC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HC(e){return $f()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return $f()?e instanceof Element||e instanceof Zn(e).Element:!1}function Ls(e){return $f()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function Yw(e){return!$f()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function zc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function RM(e){return/^(table|td|th)$/.test(rl(e))}function Vf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const OM=/transform|translate|scale|rotate|perspective|filter/,IM=/paint|layout|strict|content/,aa=e=>!!e&&e!=="none";let mp;function Kg(e){const t=Dr(e)?Rr(e):e;return aa(t.transform)||aa(t.translate)||aa(t.scale)||aa(t.rotate)||aa(t.perspective)||!Yg()&&(aa(t.backdropFilter)||aa(t.filter))||OM.test(t.willChange||"")||IM.test(t.contain||"")}function LM(e){let t=Do(e);for(;Ls(t)&&!Bi(t);){if(Kg(t))return t;if(Vf(t))return null;t=Do(t)}return null}function Yg(){return mp==null&&(mp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mp}function Bi(e){return/^(html|body|#document)$/.test(rl(e))}function Rr(e){return Zn(e).getComputedStyle(e)}function Bf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Do(e){if(rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yw(e)&&e.host||ds(e);return Yw(t)?t.host:t}function qC(e){const t=Do(e);return Bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ls(t)&&zc(t)?t:qC(t)}function jc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=qC(e),l=a===((r=e.ownerDocument)==null?void 0:r.body),c=Zn(a);if(l){const u=Rx(c);return t.concat(c,c.visualViewport||[],zc(a)?a:[],u&&n?jc(u):[])}else return t.concat(a,jc(a,[],n))}function Rx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function KC(e){const t=Rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ls(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:r,u=af(n)!==l||af(r)!==c;return u&&(n=l,r=c),{width:n,height:r,$:u}}function Qg(e){return Dr(e)?e:e.contextElement}function ki(e){const t=Qg(e);if(!Ls(t))return as(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:l}=KC(t);let c=(l?af(n.width):n.width)/r,u=(l?af(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const FM=as(0);function YC(e){const t=Zn(e);return!Yg()||!t.visualViewport?FM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $M(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=Qg(e);let c=as(1);t&&(r?Dr(r)&&(c=ki(r)):c=ki(e));const u=$M(l,n,r)?YC(l):as(0);let f=(a.left+u.x)/c.x,m=(a.top+u.y)/c.y,p=a.width/c.x,g=a.height/c.y;if(l){const v=Zn(l),y=r&&Dr(r)?Zn(r):r;let k=v,j=Rx(k);for(;j&&r&&y!==k;){const N=ki(j),_=j.getBoundingClientRect(),w=Rr(j),S=_.left+(j.clientLeft+parseFloat(w.paddingLeft))*N.x,E=_.top+(j.clientTop+parseFloat(w.paddingTop))*N.y;f*=N.x,m*=N.y,p*=N.x,g*=N.y,f+=S,m+=E,k=Zn(j),j=Rx(k)}}return cf({width:p,height:g,x:f,y:m})}function zf(e,t){const n=Bf(e).scrollLeft;return t?t.left+n:Da(ds(e)).left+n}function QC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zf(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function VM(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const l=a==="fixed",c=ds(r),u=t?Vf(t.floating):!1;if(r===c||u&&l)return n;let f={scrollLeft:0,scrollTop:0},m=as(1);const p=as(0),g=Ls(r);if((g||!g&&!l)&&((rl(r)!=="body"||zc(c))&&(f=Bf(r)),g)){const y=Da(r);m=ki(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=c&&!g&&!l?QC(c,f):as(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+p.x+v.x,y:n.y*m.y-f.scrollTop*m.y+p.y+v.y}}function BM(e){return Array.from(e.getClientRects())}function zM(e){const t=ds(e),n=Bf(e),r=e.ownerDocument.body,a=Gn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Gn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+zf(e);const u=-n.scrollTop;return Rr(r).direction==="rtl"&&(c+=Gn(t.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:u}}const Qw=25;function WM(e,t){const n=Zn(e),r=ds(e),a=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,u=0,f=0;if(a){l=a.width,c=a.height;const p=Yg();(!p||p&&t==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}const m=zf(r);if(m<=0){const p=r.ownerDocument,g=p.body,v=getComputedStyle(g),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(r.clientWidth-g.clientWidth-y);k<=Qw&&(l-=k)}else m<=Qw&&(l+=m);return{width:l,height:c,x:u,y:f}}function UM(e,t){const n=Da(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,l=Ls(e)?ki(e):as(1),c=e.clientWidth*l.x,u=e.clientHeight*l.y,f=a*l.x,m=r*l.y;return{width:c,height:u,x:f,y:m}}function Gw(e,t,n){let r;if(t==="viewport")r=WM(e,n);else if(t==="document")r=zM(ds(e));else if(Dr(t))r=UM(t,n);else{const a=YC(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return cf(r)}function GC(e,t){const n=Do(e);return n===t||!Dr(n)||Bi(n)?!1:Rr(n).position==="fixed"||GC(n,t)}function HM(e,t){const n=t.get(e);if(n)return n;let r=jc(e,[],!1).filter(u=>Dr(u)&&rl(u)!=="body"),a=null;const l=Rr(e).position==="fixed";let c=l?Do(e):e;for(;Dr(c)&&!Bi(c);){const u=Rr(c),f=Kg(c);!f&&u.position==="fixed"&&(a=null),(l?!f&&!a:!f&&u.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||zc(c)&&!f&&GC(e,c))?r=r.filter(p=>p!==c):a=u,c=Do(c)}return t.set(e,r),r}function qM(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?Vf(t)?[]:HM(t,this._c):[].concat(n),r],u=Gw(t,c[0],a);let f=u.top,m=u.right,p=u.bottom,g=u.left;for(let v=1;v<c.length;v++){const y=Gw(t,c[v],a);f=Gn(y.top,f),m=Mo(y.right,m),p=Mo(y.bottom,p),g=Gn(y.left,g)}return{width:m-g,height:p-f,x:g,y:f}}function KM(e){const{width:t,height:n}=KC(e);return{width:t,height:n}}function YM(e,t,n){const r=Ls(t),a=ds(t),l=n==="fixed",c=Da(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const f=as(0);function m(){f.x=zf(a)}if(r||!r&&!l)if((rl(t)!=="body"||zc(a))&&(u=Bf(t)),r){const y=Da(t,!0,l,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&m();l&&!r&&a&&m();const p=a&&!r&&!l?QC(a,u):as(0),g=c.left+u.scrollLeft-f.x-p.x,v=c.top+u.scrollTop-f.y-p.y;return{x:g,y:v,width:c.width,height:c.height}}function hp(e){return Rr(e).position==="static"}function Xw(e,t){if(!Ls(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ds(e)===n&&(n=n.ownerDocument.body),n}function XC(e,t){const n=Zn(e);if(Vf(e))return n;if(!Ls(e)){let a=Do(e);for(;a&&!Bi(a);){if(Dr(a)&&!hp(a))return a;a=Do(a)}return n}let r=Xw(e,t);for(;r&&RM(r)&&hp(r);)r=Xw(r,t);return r&&Bi(r)&&hp(r)&&!Kg(r)?n:r||LM(e)||n}const QM=async function(e){const t=this.getOffsetParent||XC,n=this.getDimensions,r=await n(e.floating);return{reference:YM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GM(e){return Rr(e).direction==="rtl"}const XM={convertOffsetParentRelativeRectToViewportRelativeRect:VM,getDocumentElement:ds,getClippingRect:qM,getOffsetParent:XC,getElementRects:QM,getClientRects:BM,getDimensions:KM,getScale:ki,isElement:Dr,isRTL:GM};function ZC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZM(e,t){let n=null,r;const a=ds(e);function l(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:p,top:g,width:v,height:y}=m;if(u||t(),!v||!y)return;const k=pd(g),j=pd(a.clientWidth-(p+v)),N=pd(a.clientHeight-(g+y)),_=pd(p),S={rootMargin:-k+"px "+-j+"px "+-N+"px "+-_+"px",threshold:Gn(0,Mo(1,f))||1};let E=!0;function P(T){const M=T[0].intersectionRatio;if(M!==f){if(!E)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!ZC(m,e.getBoundingClientRect())&&c(),E=!1}try{n=new IntersectionObserver(P,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return c(!0),l}function JM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=Qg(e),p=a||l?[...m?jc(m):[],...t?jc(t):[]]:[];p.forEach(_=>{a&&_.addEventListener("scroll",n,{passive:!0}),l&&_.addEventListener("resize",n)});const g=m&&u?ZM(m,n):null;let v=-1,y=null;c&&(y=new ResizeObserver(_=>{let[w]=_;w&&w.target===m&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var S;(S=y)==null||S.observe(t)})),n()}),m&&!f&&y.observe(m),t&&y.observe(t));let k,j=f?Da(e):null;f&&N();function N(){const _=Da(e);j&&!ZC(j,_)&&n(),j=_,k=requestAnimationFrame(N)}return n(),()=>{var _;p.forEach(w=>{a&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),g==null||g(),(_=y)==null||_.disconnect(),y=null,f&&cancelAnimationFrame(k)}}const eD=TM,tD=AM,nD=_M,rD=DM,sD=EM,Zw=SM,oD=MM,aD=(e,t,n)=>{const r=new Map,a={platform:XM,...n},l={...a.platform,_c:r};return kM(e,t,{...a,platform:l})};var iD=typeof document<"u",lD=function(){},Ld=iD?x.useLayoutEffect:lD;function uf(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,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uf(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const l=a[r];if(!(l==="_owner"&&e.$$typeof)&&!uf(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function JC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jw(e,t){const n=JC(e);return Math.round(t*n)/n}function pp(e){const t=x.useRef(e);return Ld(()=>{t.current=e}),t}function cD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:f,open:m}=e,[p,g]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);uf(v,r)||y(r);const[k,j]=x.useState(null),[N,_]=x.useState(null),w=x.useCallback(R=>{R!==T.current&&(T.current=R,j(R))},[]),S=x.useCallback(R=>{R!==M.current&&(M.current=R,_(R))},[]),E=l||k,P=c||N,T=x.useRef(null),M=x.useRef(null),D=x.useRef(p),q=f!=null,H=pp(f),I=pp(a),F=pp(m),te=x.useCallback(()=>{if(!T.current||!M.current)return;const R={placement:t,strategy:n,middleware:v};I.current&&(R.platform=I.current),aD(T.current,M.current,R).then(z=>{const X={...z,isPositioned:F.current!==!1};Y.current&&!uf(D.current,X)&&(D.current=X,Qi.flushSync(()=>{g(X)}))})},[v,t,n,I,F]);Ld(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(R=>({...R,isPositioned:!1})))},[m]);const Y=x.useRef(!1);Ld(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Ld(()=>{if(E&&(T.current=E),P&&(M.current=P),E&&P){if(H.current)return H.current(E,P,te);te()}},[E,P,te,H,q]);const O=x.useMemo(()=>({reference:T,floating:M,setReference:w,setFloating:S}),[w,S]),U=x.useMemo(()=>({reference:E,floating:P}),[E,P]),$=x.useMemo(()=>{const R={position:n,left:0,top:0};if(!U.floating)return R;const z=Jw(U.floating,p.x),X=Jw(U.floating,p.y);return u?{...R,transform:"translate("+z+"px, "+X+"px)",...JC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:X}},[n,u,U.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:te,refs:O,elements:U,floatingStyles:$}),[p,te,O,U,$])}const uD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Zw({element:r.current,padding:a}).fn(n):{}:r?Zw({element:r,padding:a}).fn(n):{}}}},dD=(e,t)=>{const n=eD(e);return{name:n.name,fn:n.fn,options:[e,t]}},fD=(e,t)=>{const n=tD(e);return{name:n.name,fn:n.fn,options:[e,t]}},mD=(e,t)=>({fn:oD(e).fn,options:[e,t]}),hD=(e,t)=>{const n=nD(e);return{name:n.name,fn:n.fn,options:[e,t]}},pD=(e,t)=>{const n=rD(e);return{name:n.name,fn:n.fn,options:[e,t]}},xD=(e,t)=>{const n=sD(e);return{name:n.name,fn:n.fn,options:[e,t]}},gD=(e,t)=>{const n=uD(e);return{name:n.name,fn:n.fn,options:[e,t]}};var yD="Arrow",ek=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...l}=e;return s.jsx($e.svg,{...l,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});ek.displayName=yD;var vD=ek;function Gg(e){const[t,n]=x.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let c,u;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xg="Popper",[tk,sl]=Os(Xg),[bD,nk]=tk(Xg),rk=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return s.jsx(bD,{scope:t,anchor:r,onAnchorChange:a,children:n})};rk.displayName=Xg;var sk="PopperAnchor",ok=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,l=nk(sk,n),c=x.useRef(null),u=Je(t,c),f=x.useRef(null);return x.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&l.onAnchorChange(f.current)}),r?null:s.jsx($e.div,{...a,ref:u})});ok.displayName=sk;var Zg="PopperContent",[wD,jD]=tk(Zg),ak=x.forwardRef((e,t)=>{var oe,he,ge,Ce,ce,Be;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:k,...j}=e,N=nk(Zg,n),[_,w]=x.useState(null),S=Je(t,at=>w(at)),[E,P]=x.useState(null),T=Gg(E),M=(T==null?void 0:T.width)??0,D=(T==null?void 0:T.height)??0,q=r+(l!=="center"?"-"+l:""),H=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},I=Array.isArray(m)?m:[m],F=I.length>0,te={padding:H,boundary:I.filter(CD),altBoundary:F},{refs:Y,floatingStyles:O,placement:U,isPositioned:$,middlewareData:R}=cD({strategy:"fixed",placement:q,whileElementsMounted:(...at)=>JM(...at,{animationFrame:y==="always"}),elements:{reference:N.anchor},middleware:[dD({mainAxis:a+D,alignmentAxis:c}),f&&fD({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?mD():void 0,...te}),f&&hD({...te}),pD({...te,apply:({elements:at,rects:Et,availableWidth:Yt,availableHeight:Qt})=>{const{width:zt,height:Un}=Et.reference,hn=at.floating.style;hn.setProperty("--radix-popper-available-width",`${Yt}px`),hn.setProperty("--radix-popper-available-height",`${Qt}px`),hn.setProperty("--radix-popper-anchor-width",`${zt}px`),hn.setProperty("--radix-popper-anchor-height",`${Un}px`)}}),E&&gD({element:E,padding:u}),kD({arrowWidth:M,arrowHeight:D}),v&&xD({strategy:"referenceHidden",...te})]}),[z,X]=ck(U),B=Mr(k);sn(()=>{$&&(B==null||B())},[$,B]);const L=(oe=R.arrow)==null?void 0:oe.x,G=(he=R.arrow)==null?void 0:he.y,se=((ge=R.arrow)==null?void 0:ge.centerOffset)!==0,[ae,ue]=x.useState();return sn(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),s.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:$?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(Ce=R.transformOrigin)==null?void 0:Ce.x,(ce=R.transformOrigin)==null?void 0:ce.y].join(" "),...((Be=R.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(wD,{scope:n,placedSide:z,onArrowChange:P,arrowX:L,arrowY:G,shouldHideArrow:se,children:s.jsx($e.div,{"data-side":z,"data-align":X,...j,ref:S,style:{...j.style,animation:$?void 0:"none"}})})})});ak.displayName=Zg;var ik="PopperArrow",ND={top:"bottom",right:"left",bottom:"top",left:"right"},lk=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,l=jD(ik,r),c=ND[l.placedSide];return s.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:s.jsx(vD,{...a,ref:n,style:{...a.style,display:"block"}})})});lk.displayName=ik;function CD(e){return e!==null}var kD=e=>({name:"transformOrigin",options:e,fn(t){var N,_,w;const{placement:n,rects:r,middlewareData:a}=t,c=((N=a.arrow)==null?void 0:N.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,p]=ck(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(((_=a.arrow)==null?void 0:_.x)??0)+u/2,y=(((w=a.arrow)==null?void 0:w.y)??0)+f/2;let k="",j="";return m==="bottom"?(k=c?g:`${v}px`,j=`${-f}px`):m==="top"?(k=c?g:`${v}px`,j=`${r.floating.height+f}px`):m==="right"?(k=`${-f}px`,j=c?g:`${y}px`):m==="left"&&(k=`${r.floating.width+f}px`,j=c?g:`${y}px`),{data:{x:k,y:j}}}});function ck(e){const[t,n="center"]=e.split("-");return[t,n]}var uk=rk,Wf=ok,Jg=ak,ey=lk,SD=Symbol("radix.slottable");function _D(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SD,t}var[Uf]=Os("Tooltip",[sl]),ty=sl(),dk="TooltipProvider",ED=700,e1="tooltip.open",[PD,fk]=Uf(dk),mk=e=>{const{__scopeTooltip:t,delayDuration:n=ED,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:l}=e,c=x.useRef(!0),u=x.useRef(!1),f=x.useRef(0);return x.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),s.jsx(PD,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(m=>{u.current=m},[]),disableHoverableContent:a,children:l})};mk.displayName=dk;var hk="Tooltip",[PH,Hf]=Uf(hk),Ox="TooltipTrigger",TD=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Hf(Ox,n),l=fk(Ox,n),c=ty(n),u=x.useRef(null),f=Je(t,u,a.onTriggerChange),m=x.useRef(!1),p=x.useRef(!1),g=x.useCallback(()=>m.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),s.jsx(Wf,{asChild:!0,...c,children:s.jsx($e.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:f,onPointerMove:Ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ie(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:Ie(e.onBlur,a.onClose),onClick:Ie(e.onClick,a.onClose)})})});TD.displayName=Ox;var AD="TooltipPortal",[TH,MD]=Uf(AD,{forceMount:void 0}),zi="TooltipContent",pk=x.forwardRef((e,t)=>{const n=MD(zi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...l}=e,c=Hf(zi,e.__scopeTooltip);return s.jsx(Is,{present:r||c.open,children:c.disableHoverableContent?s.jsx(xk,{side:a,...l,ref:t}):s.jsx(DD,{side:a,...l,ref:t})})}),DD=x.forwardRef((e,t)=>{const n=Hf(zi,e.__scopeTooltip),r=fk(zi,e.__scopeTooltip),a=x.useRef(null),l=Je(t,a),[c,u]=x.useState(null),{trigger:f,onClose:m}=n,p=a.current,{onPointerInTransitChange:g}=r,v=x.useCallback(()=>{u(null),g(!1)},[g]),y=x.useCallback((k,j)=>{const N=k.currentTarget,_={x:k.clientX,y:k.clientY},w=FD(_,N.getBoundingClientRect()),S=$D(_,w),E=VD(j.getBoundingClientRect()),P=zD([...S,...E]);u(P),g(!0)},[g]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(f&&p){const k=N=>y(N,p),j=N=>y(N,f);return f.addEventListener("pointerleave",k),p.addEventListener("pointerleave",j),()=>{f.removeEventListener("pointerleave",k),p.removeEventListener("pointerleave",j)}}},[f,p,y,v]),x.useEffect(()=>{if(c){const k=j=>{const N=j.target,_={x:j.clientX,y:j.clientY},w=(f==null?void 0:f.contains(N))||(p==null?void 0:p.contains(N)),S=!BD(_,c);w?v():S&&(v(),m())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[f,p,c,m,v]),s.jsx(xk,{...e,ref:l})}),[RD,OD]=Uf(hk,{isInside:!1}),ID=_D("TooltipContent"),xk=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=e,f=Hf(zi,n),m=ty(n),{onClose:p}=f;return x.useEffect(()=>(document.addEventListener(e1,p),()=>document.removeEventListener(e1,p)),[p]),x.useEffect(()=>{if(f.trigger){const g=v=>{const y=v.target;y!=null&&y.contains(f.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,p]),s.jsx(Zi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:s.jsxs(Jg,{"data-state":f.stateAttribute,...m,...u,ref:t,style:{...u.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(ID,{children:r}),s.jsx(RD,{scope:n,isInside:!0,children:s.jsx($4,{id:f.contentId,role:"tooltip",children:a||r})})]})})});pk.displayName=zi;var gk="TooltipArrow",LD=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ty(n);return OD(gk,n).isInside?null:s.jsx(ey,{...a,...r,ref:t})});LD.displayName=gk;function FD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,a,l)){case l:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function $D(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 VD(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function BD(e,t){const{x:n,y:r}=e;let a=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const u=t[l],f=t[c],m=u.x,p=u.y,g=f.x,v=f.y;p>r!=v>r&&n<(g-m)*(r-p)/(v-p)+m&&(a=!a)}return a}function zD(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),WD(t)}function WD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var UD=mk,yk=pk;const HD=UD,qD=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(yk,{ref:r,sideOffset:t,className:Oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qD.displayName=yk.displayName;const ny=x.createContext({});function ry(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const KD=typeof window<"u",vk=KD?x.useLayoutEffect:x.useEffect,qf=x.createContext(null);function sy(e,t){e.indexOf(t)===-1&&e.push(t)}function df(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const us=(e,t,n)=>n>t?t:n<e?e:n;let oy=()=>{};const Ro={},bk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function wk(e){return typeof e=="object"&&e!==null}const jk=e=>/^0[^.\s]+$/u.test(e);function Nk(e){let t;return()=>(t===void 0&&(t=e()),t)}const fr=e=>e,YD=(e,t)=>n=>t(e(n)),Wc=(...e)=>e.reduce(YD),Nc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class ay{constructor(){this.subscriptions=[]}add(t){return sy(this.subscriptions,t),()=>df(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let l=0;l<a;l++){const c=this.subscriptions[l];c&&c(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Jn=e=>e*1e3,dr=e=>e/1e3;function Ck(e,t){return t?e*(1e3/t):0}const kk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,QD=1e-7,GD=12;function XD(e,t,n,r,a){let l,c,u=0;do c=t+(n-t)/2,l=kk(c,r,a)-e,l>0?n=c:t=c;while(Math.abs(l)>QD&&++u<GD);return c}function Uc(e,t,n,r){if(e===t&&n===r)return fr;const a=l=>XD(l,0,1,e,n);return l=>l===0||l===1?l:kk(a(l),t,r)}const Sk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_k=e=>t=>1-e(1-t),Ek=Uc(.33,1.53,.69,.99),iy=_k(Ek),Pk=Sk(iy),Tk=e=>e>=1?1:(e*=2)<1?.5*iy(e):.5*(2-Math.pow(2,-10*(e-1))),ly=e=>1-Math.sin(Math.acos(e)),Ak=_k(ly),Mk=Sk(ly),ZD=Uc(.42,0,1,1),JD=Uc(0,0,.58,1),Dk=Uc(.42,0,.58,1),eR=e=>Array.isArray(e)&&typeof e[0]!="number",Rk=e=>Array.isArray(e)&&typeof e[0]=="number",tR={linear:fr,easeIn:ZD,easeInOut:Dk,easeOut:JD,circIn:ly,circInOut:Mk,circOut:Ak,backIn:iy,backInOut:Pk,backOut:Ek,anticipate:Tk},nR=e=>typeof e=="string",t1=e=>{if(Rk(e)){oy(e.length===4);const[t,n,r,a]=e;return Uc(t,n,r,a)}else if(nR(e))return tR[e];return e},xd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rR(e,t){let n=new Set,r=new Set,a=!1,l=!1;const c=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function f(p){c.has(p)&&(m.schedule(p),e()),p(u)}const m={schedule:(p,g=!1,v=!1)=>{const k=v&&a?n:r;return g&&c.add(p),k.add(p),p},cancel:p=>{r.delete(p),c.delete(p)},process:p=>{if(u=p,a){l=!0;return}a=!0;const g=n;n=r,r=g,n.forEach(f),n.clear(),a=!1,l&&(l=!1,m.process(p))}};return m}const sR=40;function Ok(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>n=!0,c=xd.reduce((S,E)=>(S[E]=rR(l),S),{}),{setup:u,read:f,resolveKeyframes:m,preUpdate:p,update:g,preRender:v,render:y,postRender:k}=c,j=()=>{const S=Ro.useManualTiming,E=S?a.timestamp:performance.now();n=!1,S||(a.delta=r?1e3/60:Math.max(Math.min(E-a.timestamp,sR),1)),a.timestamp=E,a.isProcessing=!0,u.process(a),f.process(a),m.process(a),p.process(a),g.process(a),v.process(a),y.process(a),k.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(j))},N=()=>{n=!0,r=!0,a.isProcessing||e(j)};return{schedule:xd.reduce((S,E)=>{const P=c[E];return S[E]=(T,M=!1,D=!1)=>(n||N(),P.schedule(T,M,D)),S},{}),cancel:S=>{for(let E=0;E<xd.length;E++)c[xd[E]].cancel(S)},state:a,steps:c}}const{schedule:dt,cancel:Oo,state:tn,steps:xp}=Ok(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0);let Fd;function oR(){Fd=void 0}const jn={now:()=>(Fd===void 0&&jn.set(tn.isProcessing||Ro.useManualTiming?tn.timestamp:performance.now()),Fd),set:e=>{Fd=e,queueMicrotask(oR)}},Ik=e=>t=>typeof t=="string"&&t.startsWith(e),Lk=Ik("--"),aR=Ik("var(--"),cy=e=>aR(e)?iR.test(e.split("/*")[0].trim()):!1,iR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function n1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ol={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cc={...ol,transform:e=>us(0,1,e)},gd={...ol,default:1},uc=e=>Math.round(e*1e5)/1e5,uy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lR(e){return e==null}const cR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dy=(e,t)=>n=>!!(typeof n=="string"&&cR.test(n)&&n.startsWith(e)||t&&!lR(n)&&Object.prototype.hasOwnProperty.call(n,t)),Fk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,l,c,u]=r.match(uy);return{[e]:parseFloat(a),[t]:parseFloat(l),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},uR=e=>us(0,255,e),gp={...ol,transform:e=>Math.round(uR(e))},xa={test:dy("rgb","red"),parse:Fk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+gp.transform(e)+", "+gp.transform(t)+", "+gp.transform(n)+", "+uc(Cc.transform(r))+")"};function dR(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const Ix={test:dy("#"),parse:dR,transform:xa.transform},Hc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),uo=Hc("deg"),is=Hc("%"),Ne=Hc("px"),fR=Hc("vh"),mR=Hc("vw"),r1={...is,parse:e=>is.parse(e)/100,transform:e=>is.transform(e*100)},vi={test:dy("hsl","hue"),parse:Fk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+is.transform(uc(t))+", "+is.transform(uc(n))+", "+uc(Cc.transform(r))+")"},It={test:e=>xa.test(e)||Ix.test(e)||vi.test(e),parse:e=>xa.test(e)?xa.parse(e):vi.test(e)?vi.parse(e):Ix.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xa.transform(e):vi.transform(e),getAnimatableNone:e=>{const t=It.parse(e);return t.alpha=0,It.transform(t)}},hR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function pR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(uy))==null?void 0:t.length)||0)+(((n=e.match(hR))==null?void 0:n.length)||0)>0}const $k="number",Vk="color",xR="var",gR="var(",s1="${}",yR=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let l=0;const u=t.replace(yR,f=>(It.test(f)?(r.color.push(l),a.push(Vk),n.push(It.parse(f))):f.startsWith(gR)?(r.var.push(l),a.push(xR),n.push(f)):(r.number.push(l),a.push($k),n.push(parseFloat(f))),++l,s1)).split(s1);return{values:n,split:u,indexes:r,types:a}}function vR(e){return Wi(e).values}function Bk({split:e,types:t}){const n=e.length;return r=>{let a="";for(let l=0;l<n;l++)if(a+=e[l],r[l]!==void 0){const c=t[l];c===$k?a+=uc(r[l]):c===Vk?a+=It.transform(r[l]):a+=r[l]}return a}}function bR(e){return Bk(Wi(e))}const wR=e=>typeof e=="number"?0:It.test(e)?It.getAnimatableNone(e):e,jR=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:wR(e);function NR(e){const t=Wi(e);return Bk(t)(t.values.map((r,a)=>jR(r,t.split[a])))}const Ar={test:pR,parse:vR,createTransformer:bR,getAnimatableNone:NR};function yp(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function CR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,l=0,c=0;if(!t)a=l=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,f=2*n-u;a=yp(f,u,e+1/3),l=yp(f,u,e),c=yp(f,u,e-1/3)}return{red:Math.round(a*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:r}}function ff(e,t){return n=>n>0?t:e}const wt=(e,t,n)=>e+(t-e)*n,vp=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},kR=[Ix,xa,vi],SR=e=>kR.find(t=>t.test(e));function o1(e){const t=SR(e);if(!t)return!1;let n=t.parse(e);return t===vi&&(n=CR(n)),n}const a1=(e,t)=>{const n=o1(e),r=o1(t);if(!n||!r)return ff(e,t);const a={...n};return l=>(a.red=vp(n.red,r.red,l),a.green=vp(n.green,r.green,l),a.blue=vp(n.blue,r.blue,l),a.alpha=wt(n.alpha,r.alpha,l),xa.transform(a))},Lx=new Set(["none","hidden"]);function _R(e,t){return Lx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ER(e,t){return n=>wt(e,t,n)}function fy(e){return typeof e=="number"?ER:typeof e=="string"?cy(e)?ff:It.test(e)?a1:AR:Array.isArray(e)?zk:typeof e=="object"?It.test(e)?a1:PR:ff}function zk(e,t){const n=[...e],r=n.length,a=e.map((l,c)=>fy(l)(l,t[c]));return l=>{for(let c=0;c<r;c++)n[c]=a[c](l);return n}}function PR(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=fy(e[a])(e[a],t[a]));return a=>{for(const l in r)n[l]=r[l](a);return n}}function TR(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const l=t.types[a],c=e.indexes[l][r[l]],u=e.values[c]??0;n[a]=u,r[l]++}return n}const AR=(e,t)=>{const n=Ar.createTransformer(t),r=Wi(e),a=Wi(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Lx.has(e)&&!a.values.length||Lx.has(t)&&!r.values.length?_R(e,t):Wc(zk(TR(r,a),a.values),n):ff(e,t)};function Wk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?wt(e,t,n):fy(e)(e,t)}const MR=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Oo(t),now:()=>tn.isProcessing?tn.timestamp:jn.now()}},Uk=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let l=0;l<a;l++)r+=Math.round(e(l/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},mf=2e4;function my(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<mf;)t+=n,r=e.next(t);return t>=mf?1/0:t}function DR(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(my(r),mf);return{type:"keyframes",ease:l=>r.next(a*l).value/t,duration:dr(a)}}const St={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Fx(e,t){return e*Math.sqrt(1-t*t)}const RR=12;function OR(e,t,n){let r=n;for(let a=1;a<RR;a++)r=r-e(r)/t(r);return r}const bp=.001;function IR({duration:e=St.duration,bounce:t=St.bounce,velocity:n=St.velocity,mass:r=St.mass}){let a,l,c=1-t;c=us(St.minDamping,St.maxDamping,c),e=us(St.minDuration,St.maxDuration,dr(e)),c<1?(a=m=>{const p=m*c,g=p*e,v=p-n,y=Fx(m,c),k=Math.exp(-g);return bp-v/y*k},l=m=>{const g=m*c*e,v=g*n+n,y=Math.pow(c,2)*Math.pow(m,2)*e,k=Math.exp(-g),j=Fx(Math.pow(m,2),c);return(-a(m)+bp>0?-1:1)*((v-y)*k)/j}):(a=m=>{const p=Math.exp(-m*e),g=(m-n)*e+1;return-bp+p*g},l=m=>{const p=Math.exp(-m*e),g=(n-m)*(e*e);return p*g});const u=5/e,f=OR(a,l,u);if(e=Jn(e),isNaN(f))return{stiffness:St.stiffness,damping:St.damping,duration:e};{const m=Math.pow(f,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:e}}}const LR=["duration","bounce"],FR=["stiffness","damping","mass"];function i1(e,t){return t.some(n=>e[n]!==void 0)}function $R(e){let t={velocity:St.velocity,stiffness:St.stiffness,damping:St.damping,mass:St.mass,isResolvedFromDuration:!1,...e};if(!i1(e,FR)&&i1(e,LR))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,l=2*us(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:St.mass,stiffness:a,damping:l}}else{const n=IR({...e,velocity:0});t={...t,...n,mass:St.mass},t.isResolvedFromDuration=!0}return t}function hf(e=St.visualDuration,t=St.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const l=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:l},{stiffness:f,damping:m,mass:p,duration:g,velocity:v,isResolvedFromDuration:y}=$R({...n,velocity:-dr(n.velocity||0)}),k=v||0,j=m/(2*Math.sqrt(f*p)),N=c-l,_=dr(Math.sqrt(f/p)),w=Math.abs(N)<5;r||(r=w?St.restSpeed.granular:St.restSpeed.default),a||(a=w?St.restDelta.granular:St.restDelta.default);let S,E,P,T,M,D;if(j<1)P=Fx(_,j),T=(k+j*_*N)/P,S=H=>{const I=Math.exp(-j*_*H);return c-I*(T*Math.sin(P*H)+N*Math.cos(P*H))},M=j*_*T+N*P,D=j*_*N-T*P,E=H=>Math.exp(-j*_*H)*(M*Math.sin(P*H)+D*Math.cos(P*H));else if(j===1){S=I=>c-Math.exp(-_*I)*(N+(k+_*N)*I);const H=k+_*N;E=I=>Math.exp(-_*I)*(_*H*I-k)}else{const H=_*Math.sqrt(j*j-1);S=Y=>{const O=Math.exp(-j*_*Y),U=Math.min(H*Y,300);return c-O*((k+j*_*N)*Math.sinh(U)+H*N*Math.cosh(U))/H};const I=(k+j*_*N)/H,F=j*_*I-N*H,te=j*_*N-I*H;E=Y=>{const O=Math.exp(-j*_*Y),U=Math.min(H*Y,300);return O*(F*Math.sinh(U)+te*Math.cosh(U))}}const q={calculatedDuration:y&&g||null,velocity:H=>Jn(E(H)),next:H=>{if(!y&&j<1){const F=Math.exp(-j*_*H),te=Math.sin(P*H),Y=Math.cos(P*H),O=c-F*(T*te+N*Y),U=Jn(F*(M*te+D*Y));return u.done=Math.abs(U)<=r&&Math.abs(c-O)<=a,u.value=u.done?c:O,u}const I=S(H);if(y)u.done=H>=g;else{const F=Jn(E(H));u.done=Math.abs(F)<=r&&Math.abs(c-I)<=a}return u.value=u.done?c:I,u},toString:()=>{const H=Math.min(my(q),mf),I=Uk(F=>q.next(H*F).value,H,30);return H+"ms "+I},toTransition:()=>{}};return q}hf.applyToOptions=e=>{const t=DR(e,100,hf);return e.ease=t.ease,e.duration=Jn(t.duration),e.type="keyframes",e};const VR=5;function Hk(e,t,n){const r=Math.max(t-VR,0);return Ck(n-e(r),t-r)}function $x({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:l=500,modifyTarget:c,min:u,max:f,restDelta:m=.5,restSpeed:p}){const g=e[0],v={done:!1,value:g},y=D=>u!==void 0&&D<u||f!==void 0&&D>f,k=D=>u===void 0?f:f===void 0||Math.abs(u-D)<Math.abs(f-D)?u:f;let j=n*t;const N=g+j,_=c===void 0?N:c(N);_!==N&&(j=_-g);const w=D=>-j*Math.exp(-D/r),S=D=>_+w(D),E=D=>{const q=w(D),H=S(D);v.done=Math.abs(q)<=m,v.value=v.done?_:H};let P,T;const M=D=>{y(v.value)&&(P=D,T=hf({keyframes:[v.value,k(v.value)],velocity:Hk(S,D,v.value),damping:a,stiffness:l,restDelta:m,restSpeed:p}))};return M(0),{calculatedDuration:null,next:D=>{let q=!1;return!T&&P===void 0&&(q=!0,E(D),M(D)),P!==void 0&&D>=P?T.next(D-P):(!q&&E(D),v)}}}function BR(e,t,n){const r=[],a=n||Ro.mix||Wk,l=e.length-1;for(let c=0;c<l;c++){let u=a(e[c],e[c+1]);if(t){const f=Array.isArray(t)?t[c]||fr:t;u=Wc(f,u)}r.push(u)}return r}function zR(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const l=e.length;if(oy(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=BR(t,r,a),f=u.length,m=p=>{if(c&&p<e[0])return t[0];let g=0;if(f>1)for(;g<e.length-2&&!(p<e[g+1]);g++);const v=Nc(e[g],e[g+1],p);return u[g](v)};return n?p=>m(us(e[0],e[l-1],p)):m}function WR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=Nc(0,t,r);e.push(wt(n,1,a))}}function UR(e){const t=[0];return WR(t,e.length-1),t}function HR(e,t){return e.map(n=>n*t)}function qR(e,t){return e.map(()=>t||Dk).splice(0,e.length-1)}function dc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=eR(r)?r.map(t1):t1(r),l={done:!1,value:t[0]},c=HR(n&&n.length===t.length?n:UR(t),e),u=zR(c,t,{ease:Array.isArray(a)?a:qR(t,a)});return{calculatedDuration:e,next:f=>(l.value=u(f),l.done=f>=e,l)}}const KR=e=>e!==null;function Kf(e,{repeat:t,repeatType:n="loop"},r,a=1){const l=e.filter(KR),u=a<0||t&&n!=="loop"&&t%2===1?0:l.length-1;return!u||r===void 0?l[u]:r}const YR={decay:$x,inertia:$x,tween:dc,keyframes:dc,spring:hf};function qk(e){typeof e.type=="string"&&(e.type=YR[e.type])}class hy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const QR=e=>e/100;class pf extends hy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,a;const{motionValue:n}=this.options;n&&n.updatedAt!==jn.now()&&this.tick(jn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(r=this.options).onStop)==null||a.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;qk(t);const{type:n=dc,repeat:r=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:u}=t;const f=n||dc;f!==dc&&typeof u[0]!="number"&&(this.mixKeyframes=Wc(QR,Wk(u[0],u[1])),u=[0,100]);const m=f({...t,keyframes:u});l==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...u].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=my(m));const{calculatedDuration:p}=m;this.calculatedDuration=p,this.resolvedDuration=p+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:a,mixKeyframes:l,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:f}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:p,repeat:g,repeatType:v,repeatDelay:y,type:k,onUpdate:j,finalKeyframe:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-m*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?_<0:_>a;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let S=this.currentTime,E=r;if(g){const D=Math.min(this.currentTime,a)/u;let q=Math.floor(D),H=D%1;!H&&D>=1&&(H=1),H===1&&q--,q=Math.min(q,g+1),!!(q%2)&&(v==="reverse"?(H=1-H,y&&(H-=y/u)):v==="mirror"&&(E=c)),S=us(0,1,H)*u}let P;w?(this.delayState.value=p[0],P=this.delayState):P=E.next(S),l&&!w&&(P.value=l(P.value));let{done:T}=P;!w&&f!==null&&(T=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return M&&k!==$x&&(P.value=Kf(p,this.options,N,this.speed)),j&&j(P.value),M&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return dr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dr(t)}get time(){return dr(this.currentTime)}set time(t){t=Jn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Hk(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(jn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=dr(this.currentTime))}play(){var a,l;if(this.isStopped)return;const{driver:t=MR,startTime:n}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(l=(a=this.options).onPlay)==null||l.call(a);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(jn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function GR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ga=e=>e*180/Math.PI,Vx=e=>{const t=ga(Math.atan2(e[1],e[0]));return Bx(t)},XR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vx,rotateZ:Vx,skewX:e=>ga(Math.atan(e[1])),skewY:e=>ga(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bx=e=>(e=e%360,e<0&&(e+=360),e),l1=Vx,c1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),u1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ZR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:c1,scaleY:u1,scale:e=>(c1(e)+u1(e))/2,rotateX:e=>Bx(ga(Math.atan2(e[6],e[5]))),rotateY:e=>Bx(ga(Math.atan2(-e[2],e[0]))),rotateZ:l1,rotate:l1,skewX:e=>ga(Math.atan(e[4])),skewY:e=>ga(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function zx(e){return e.includes("scale")?1:0}function Wx(e,t){if(!e||e==="none")return zx(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=ZR,a=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=XR,a=u}if(!a)return zx(t);const l=r[t],c=a[1].split(",").map(eO);return typeof l=="function"?l(c):c[l]}const JR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Wx(n,t)};function eO(e){return parseFloat(e.trim())}const al=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],il=new Set(al),d1=e=>e===ol||e===Ne,tO=new Set(["x","y","z"]),nO=al.filter(e=>!tO.has(e));function rO(e){const t=[];return nO.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const a=e.max-e.min;return r==="border-box"?a:a-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const a=e.max-e.min;return r==="border-box"?a:a-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Wx(t,"x"),y:(e,{transform:t})=>Wx(t,"y")};Co.translateX=Co.x;Co.translateY=Co.y;const _a=new Set;let Ux=!1,Hx=!1,qx=!1;function Kk(){if(Hx){const e=Array.from(_a).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=rO(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([l,c])=>{var u;(u=r.getValue(l))==null||u.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hx=!1,Ux=!1,_a.forEach(e=>e.complete(qx)),_a.clear()}function Yk(){_a.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hx=!0)})}function sO(){qx=!0,Yk(),Kk(),qx=!1}class py{constructor(t,n,r,a,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(_a.add(this),Ux||(Ux=!0,dt.read(Yk),dt.resolveKeyframes(Kk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const l=a==null?void 0:a.get(),c=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&n){const u=r.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),a&&l===void 0&&a.set(t[0])}GR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_a.delete(this)}cancel(){this.state==="scheduled"&&(_a.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const oO=e=>e.startsWith("--");function Qk(e,t,n){oO(t)?e.style.setProperty(t,n):e.style[t]=n}const aO={};function Gk(e,t){const n=Nk(e);return()=>aO[t]??n()}const iO=Gk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Xk=Gk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,f1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sc([0,.65,.55,1]),circOut:sc([.55,0,1,.45]),backIn:sc([.31,.01,.66,-.59]),backOut:sc([.33,1.53,.69,.99])};function Zk(e,t){if(e)return typeof e=="function"?Xk()?Uk(e,t):"ease-out":Rk(e)?sc(e):Array.isArray(e)?e.map(n=>Zk(n,t)||f1.easeOut):f1[e]}function lO(e,t,n,{delay:r=0,duration:a=300,repeat:l=0,repeatType:c="loop",ease:u="easeOut",times:f}={},m=void 0){const p={[t]:n};f&&(p.offset=f);const g=Zk(u,a);Array.isArray(g)&&(p.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(p,v)}function Jk(e){return typeof e=="function"&&"applyToOptions"in e}function cO({type:e,...t}){return Jk(e)&&Xk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class eS extends hy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:u,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,oy(typeof t.type!="string");const m=cO(t);this.animation=lO(n,r,a,m,l),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const p=Kf(a,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(p),Qk(n,r,p),this.animation.cancel()}f==null||f(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,a;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((a=(r=this.animation).commitStyles)==null||a.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return dr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dr(t)}get time(){return dr(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Jn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:a}){var l;return this.allowFlatten&&((l=this.animation.effect)==null||l.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&iO()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),fr):a(this)}}const tS={anticipate:Tk,backInOut:Pk,circInOut:Mk};function uO(e){return e in tS}function dO(e){typeof e.ease=="string"&&uO(e.ease)&&(e.ease=tS[e.ease])}const wp=10;class fO extends eS{constructor(t){dO(t),qk(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:l,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new pf({...c,autoplay:!1}),f=Math.max(wp,jn.now()-this.startTime),m=us(0,wp,f-wp),p=u.sample(f).value,{name:g}=this.options;l&&g&&Qk(l,g,p),n.setWithVelocity(u.sample(Math.max(0,f-m)).value,p,m),u.stop()}}const m1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ar.test(e)||e==="0")&&!e.startsWith("url("));function mO(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hO(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],c=m1(a,t),u=m1(l,t);return!c||!u?!1:mO(e)||(n==="spring"||Jk(n))&&r}function Kx(e){e.duration=0,e.type="keyframes"}const nS=new Set(["opacity","clipPath","filter","transform"]),pO=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function xO(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&pO.test(e[t]))return!0;return!1}const gO=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),yO=Nk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function vO(e){var g;const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:l,type:c,keyframes:u}=e;if(!(((g=t==null?void 0:t.owner)==null?void 0:g.current)instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:p}=t.owner.getProps();return yO()&&n&&(nS.has(n)||gO.has(n)&&xO(u))&&(n!=="transform"||!p)&&!m&&!r&&a!=="mirror"&&l!==0&&c!=="inertia"}const bO=40;class wO extends hy{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:l=0,repeatType:c="loop",keyframes:u,name:f,motionValue:m,element:p,...g}){var k;super(),this.stop=()=>{var j,N;this._animation&&(this._animation.stop(),(j=this.stopTimeline)==null||j.call(this)),(N=this.keyframeResolver)==null||N.cancel()},this.createdAt=jn.now();const v={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:l,repeatType:c,name:f,motionValue:m,element:p,...g},y=(p==null?void 0:p.KeyframeResolver)||py;this.keyframeResolver=new y(u,(j,N,_)=>this.onKeyframesResolved(j,N,v,!_),f,m,p),(k=this.keyframeResolver)==null||k.scheduleResolve()}onKeyframesResolved(t,n,r,a){var _,w;this.keyframeResolver=void 0;const{name:l,type:c,velocity:u,delay:f,isHandoff:m,onUpdate:p}=r;this.resolvedAt=jn.now();let g=!0;hO(t,l,c,u)||(g=!1,(Ro.instantAnimations||!f)&&(p==null||p(Kf(t,r,n))),t[0]=t[t.length-1],Kx(r),r.repeat=0);const y={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>bO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},k=g&&!m&&vO(y),j=(w=(_=y.motionValue)==null?void 0:_.owner)==null?void 0:w.current;let N;if(k)try{N=new fO({...y,element:j})}catch{N=new pf(y)}else N=new pf(y);N.finished.then(()=>{this.notifyFinished()}).catch(fr),this.pendingTimeline&&(this.stopTimeline=N.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=N}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),sO()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function rS(e,t,n,r=0,a=1){const l=Array.from(e).sort((m,p)=>m.sortNodePosition(p)).indexOf(t),c=e.size,u=(c-1)*r;return typeof n=="function"?n(l,c):a===1?l*r:u-l*r}const jO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function NO(e){const t=jO.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function sS(e,t,n=1){const[r,a]=NO(e);if(!r)return;const l=window.getComputedStyle(t).getPropertyValue(r);if(l){const c=l.trim();return bk(c)?parseFloat(c):c}return cy(a)?sS(a,t,n+1):a}const CO={type:"spring",stiffness:500,damping:25,restSpeed:10},kO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),SO={type:"keyframes",duration:.8},_O={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},EO=(e,{keyframes:t})=>t.length>2?SO:il.has(e)?e.startsWith("scale")?kO(t[1]):CO:_O;function oS(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function xy(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?oS(n,e):n}const PO=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function TO(e){for(const t in e)if(!PO.has(t))return!0;return!1}const gy=(e,t,n,r={},a,l)=>c=>{const u=xy(r,e)||{},f=u.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Jn(f);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-m,onUpdate:v=>{t.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:l?void 0:a};TO(u)||Object.assign(p,EO(e,p)),p.duration&&(p.duration=Jn(p.duration)),p.repeatDelay&&(p.repeatDelay=Jn(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let g=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Kx(p),p.delay===0&&(g=!0)),(Ro.instantAnimations||Ro.skipAnimations||a!=null&&a.shouldSkipAnimations)&&(g=!0,Kx(p),p.delay=0),p.allowFlatten=!u.type&&!u.ease,g&&!l&&t.get()!==void 0){const v=Kf(p.keyframes,u);if(v!==void 0){dt.update(()=>{p.onUpdate(v),p.onComplete()});return}}return u.isSync?new pf(p):new wO(p)};function h1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function yy(e,t,n,r){if(typeof t=="function"){const[a,l]=h1(r);t=t(n!==void 0?n:e.custom,a,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,l]=h1(r);t=t(n!==void 0?n:e.custom,a,l)}return t}function Ea(e,t,n){const r=e.getProps();return yy(r,t,n!==void 0?n:r.custom,e)}const aS=new Set(["width","height","top","left","right","bottom",...al]),p1=30,AO=e=>!isNaN(parseFloat(e));class MO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var l;const a=jn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((l=this.events.change)==null||l.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=jn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=AO(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ay);const r=this.events[t].add(n);return t==="change"?()=>{r(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=jn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>p1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,p1);return Ck(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ui(e,t){return new MO(e,t)}const Yx=e=>Array.isArray(e);function DO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ui(n))}function RO(e){return Yx(e)?e[e.length-1]||0:e}function OO(e,t){const n=Ea(e,t);let{transitionEnd:r={},transition:a={},...l}=n||{};l={...l,...r};for(const c in l){const u=RO(l[c]);DO(e,c,u)}}const rn=e=>!!(e&&e.getVelocity);function IO(e){return!!(rn(e)&&e.add)}function Qx(e,t){const n=e.getValue("willChange");if(IO(n))return n.add(t);if(!n&&Ro.WillChange){const r=new Ro.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function vy(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const LO="framerAppearId",iS="data-"+vy(LO);function lS(e){return e.props[iS]}function FO({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cS(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:l,transitionEnd:c,...u}=t;const f=e.getDefaultTransition();l=l?oS(l,f):f;const m=l==null?void 0:l.reduceMotion;r&&(l=r);const p=[],g=a&&e.animationState&&e.animationState.getState()[a];for(const v in u){const y=e.getValue(v,e.latestValues[v]??null),k=u[v];if(k===void 0||g&&FO(g,v))continue;const j={delay:n,...xy(l||{},v)},N=y.get();if(N!==void 0&&!y.isAnimating&&!Array.isArray(k)&&k===N&&!j.velocity)continue;let _=!1;if(window.MotionHandoffAnimation){const E=lS(e);if(E){const P=window.MotionHandoffAnimation(E,v,dt);P!==null&&(j.startTime=P,_=!0)}}Qx(e,v);const w=m??e.shouldReduceMotion;y.start(gy(v,y,k,w&&aS.has(v)?{type:!1}:j,e,_));const S=y.animation;S&&p.push(S)}if(c){const v=()=>dt.update(()=>{c&&OO(e,c)});p.length?Promise.all(p).then(v):v()}return p}function Gx(e,t,n={}){var f;const r=Ea(e,t,n.type==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const l=r?()=>Promise.all(cS(e,r,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:p=0,staggerChildren:g,staggerDirection:v}=a;return $O(e,t,m,p,g,v,n)}:()=>Promise.resolve(),{when:u}=a;if(u){const[m,p]=u==="beforeChildren"?[l,c]:[c,l];return m().then(()=>p())}else return Promise.all([l(),c(n.delay)])}function $O(e,t,n=0,r=0,a=0,l=1,c){const u=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),u.push(Gx(f,t,{...c,delay:n+(typeof r=="function"?0:r)+rS(e.variantChildren,f,r,a,l)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(u)}function VO(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(l=>Gx(e,l,n));r=Promise.all(a)}else if(typeof t=="string")r=Gx(e,t,n);else{const a=typeof t=="function"?Ea(e,t,n.custom):t;r=Promise.all(cS(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const BO={test:e=>e==="auto",parse:e=>e},uS=e=>t=>t.test(e),dS=[ol,Ne,is,uo,mR,fR,BO],x1=e=>dS.find(uS(e));function zO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jk(e):!0}const WO=new Set(["brightness","contrast","saturate","opacity"]);function UO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(uy)||[];if(!r)return e;const a=n.replace(r,"");let l=WO.has(t)?1:0;return r!==n&&(l*=100),t+"("+l+a+")"}const HO=/\b([a-z-]*)\(.*?\)/gu,Xx={...Ar,getAnimatableNone:e=>{const t=e.match(HO);return t?t.map(UO).join(" "):e}},Zx={...Ar,getAnimatableNone:e=>{const t=Ar.parse(e);return Ar.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},g1={...ol,transform:Math.round},qO={rotate:uo,rotateX:uo,rotateY:uo,rotateZ:uo,scale:gd,scaleX:gd,scaleY:gd,scaleZ:gd,skew:uo,skewX:uo,skewY:uo,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Cc,originX:r1,originY:r1,originZ:Ne},by={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...qO,zIndex:g1,fillOpacity:Cc,strokeOpacity:Cc,numOctaves:g1},KO={...by,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:Xx,WebkitFilter:Xx,mask:Zx,WebkitMask:Zx},fS=e=>KO[e],YO=new Set([Xx,Zx]);function mS(e,t){let n=fS(e);return YO.has(n)||(n=Ar),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const QO=new Set(["auto","none","0"]);function GO(e,t,n){let r=0,a;for(;r<e.length&&!a;){const l=e[r];typeof l=="string"&&!QO.has(l)&&Wi(l).values.length&&(a=e[r]),r++}if(a&&n)for(const l of t)e[l]=mS(n,a)}class XO extends py{constructor(t,n,r,a,l){super(t,n,r,a,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let g=t[p];if(typeof g=="string"&&(g=g.trim(),cy(g))){const v=sS(g,n.current);v!==void 0&&(t[p]=v),p===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!aS.has(r)||t.length!==2)return;const[a,l]=t,c=x1(a),u=x1(l),f=n1(a),m=n1(l);if(f!==m&&Co[r]){this.needsMeasurement=!0;return}if(c!==u)if(d1(c)&&d1(u))for(let p=0;p<t.length;p++){const g=t[p];typeof g=="string"&&(t[p]=parseFloat(g))}else Co[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||zO(t[a]))&&r.push(a);r.length&&GO(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const l=r.length-1,c=r[l];r[l]=Co[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([f,m])=>{t.getValue(f).set(m)}),this.resolveNoneKeyframes()}}function hS(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=(n==null?void 0:n[e])??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(r=>r!=null)}const pS=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function $d(e){return wk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:wy}=Ok(queueMicrotask,!1),Sr={x:!1,y:!1};function xS(){return Sr.x||Sr.y}function ZO(e){return e==="x"||e==="y"?Sr[e]?null:(Sr[e]=!0,()=>{Sr[e]=!1}):Sr.x||Sr.y?null:(Sr.x=Sr.y=!0,()=>{Sr.x=Sr.y=!1})}function gS(e,t){const n=hS(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function JO(e){return!(e.pointerType==="touch"||xS())}function eI(e,t,n={}){const[r,a,l]=gS(e,n);return r.forEach(c=>{let u=!1,f=!1,m;const p=()=>{c.removeEventListener("pointerleave",k)},g=N=>{m&&(m(N),m=void 0),p()},v=N=>{u=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),f&&(f=!1,g(N))},y=()=>{u=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},k=N=>{if(N.pointerType!=="touch"){if(u){f=!0;return}g(N)}},j=N=>{if(!JO(N))return;f=!1;const _=t(c,N);typeof _=="function"&&(m=_,c.addEventListener("pointerleave",k,a))};c.addEventListener("pointerenter",j,a),c.addEventListener("pointerdown",y,a)}),l}const yS=(e,t)=>t?e===t?!0:yS(e,t.parentElement):!1,jy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,tI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nI(e){return tI.has(e.tagName)||e.isContentEditable===!0}const rI=new Set(["INPUT","SELECT","TEXTAREA"]);function sI(e){return rI.has(e.tagName)||e.isContentEditable===!0}const Vd=new WeakSet;function y1(e){return t=>{t.key==="Enter"&&e(t)}}function jp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const oI=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=y1(()=>{if(Vd.has(n))return;jp(n,"down");const a=y1(()=>{jp(n,"up")}),l=()=>jp(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",l,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function v1(e){return jy(e)&&!xS()}const b1=new WeakSet;function aI(e,t,n={}){const[r,a,l]=gS(e,n),c=u=>{const f=u.currentTarget;if(!v1(u)||b1.has(u))return;Vd.add(f),n.stopPropagation&&b1.add(u);const m=t(f,u),p=(y,k)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Vd.has(f)&&Vd.delete(f),v1(y)&&typeof m=="function"&&m(y,{success:k})},g=y=>{p(y,f===window||f===document||n.useGlobalTarget||yS(f,y.target))},v=y=>{p(y,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,a),$d(u)&&(u.addEventListener("focus",m=>oI(m,a)),!nI(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),l}function Ny(e){return wk(e)&&"ownerSVGElement"in e}const Bd=new WeakMap;let fo;const vS=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:Ny(r)&&"getBBox"in r?r.getBBox()[t]:r[n],iI=vS("inline","width","offsetWidth"),lI=vS("block","height","offsetHeight");function cI({target:e,borderBoxSize:t}){var n;(n=Bd.get(e))==null||n.forEach(r=>{r(e,{get width(){return iI(e,t)},get height(){return lI(e,t)}})})}function uI(e){e.forEach(cI)}function dI(){typeof ResizeObserver>"u"||(fo=new ResizeObserver(uI))}function fI(e,t){fo||dI();const n=hS(e);return n.forEach(r=>{let a=Bd.get(r);a||(a=new Set,Bd.set(r,a)),a.add(t),fo==null||fo.observe(r)}),()=>{n.forEach(r=>{const a=Bd.get(r);a==null||a.delete(t),a!=null&&a.size||fo==null||fo.unobserve(r)})}}const zd=new Set;let bi;function mI(){bi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};zd.forEach(t=>t(e))},window.addEventListener("resize",bi)}function hI(e){return zd.add(e),bi||mI(),()=>{zd.delete(e),!zd.size&&typeof bi=="function"&&(window.removeEventListener("resize",bi),bi=void 0)}}function w1(e,t){return typeof e=="function"?hI(e):fI(e,t)}function pI(e){return Ny(e)&&e.tagName==="svg"}const xI=[...dS,It,Ar],gI=e=>xI.find(uS(e)),j1=()=>({translate:0,scale:1,origin:0,originPoint:0}),wi=()=>({x:j1(),y:j1()}),N1=()=>({min:0,max:0}),Vt=()=>({x:N1(),y:N1()}),yI=new WeakMap;function Yf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function kc(e){return typeof e=="string"||Array.isArray(e)}const Cy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ky=["initial",...Cy];function Qf(e){return Yf(e.animate)||ky.some(t=>kc(e[t]))}function bS(e){return!!(Qf(e)||e.variants)}function vI(e,t,n){for(const r in t){const a=t[r],l=n[r];if(rn(a))e.addValue(r,a);else if(rn(l))e.addValue(r,Ui(a,{owner:e}));else if(l!==a)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(r);e.addValue(r,Ui(c!==void 0?c:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Jx={current:null},wS={current:!1},bI=typeof window<"u";function wI(){if(wS.current=!0,!!bI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Jx.current=e.matches;e.addEventListener("change",t),t()}else Jx.current=!1}const C1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xf={};function jS(e){xf=e}function jI(){return xf}class NI{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:l,blockInitialAnimation:c,visualState:u},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=py,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=jn.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,dt.render(this.render,!1,!0))};const{latestValues:m,renderState:p}=u;this.latestValues=m,this.baseTarget={...m},this.initialValues=n.initial?{...m}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=l,this.options=f,this.blockInitialAnimation=!!c,this.isControllingVariants=Qf(n),this.isVariantNode=bS(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const k=v[y];m[y]!==void 0&&rn(k)&&k.set(m[y])}}mount(t){var n,r;if(this.hasBeenMounted)for(const a in this.initialValues)(n=this.values.get(a))==null||n.jump(this.initialValues[a]),this.latestValues[a]=this.initialValues[a];this.current=t,yI.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,l)=>this.bindToMotionValue(l,a)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(wS.current||wI(),this.shouldReduceMotion=Jx.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Oo(this.notifyUpdate),Oo(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&nS.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:f,ease:m,duration:p}=n.accelerate,g=new eS({element:this.current,name:t,keyframes:u,times:f,ease:m,duration:Jn(p)}),v=c(g);this.valueSubscriptions.set(t,()=>{v(),g.cancel()});return}const r=il.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&dt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),l&&l(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in xf){const n=xf[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Vt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<C1.length;r++){const a=C1[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const l="on"+a,c=t[l];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=vI(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ui(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(bk(r)||jk(r))?r=parseFloat(r):!gI(r)&&Ar.test(n)&&(r=mS(t,n)),this.setBaseTarget(t,rn(r)?r.get():r)),rn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var l;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const c=yy(this.props,n,(l=this.presenceContext)==null?void 0:l.custom);c&&(r=c[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!rn(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ay),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){wy.render(this.render)}}class NS extends NI{constructor(){super(...arguments),this.KeyframeResolver=XO}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;rn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class zo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function CS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function CI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function kI(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Np(e){return e===void 0||e===1}function eg({scale:e,scaleX:t,scaleY:n}){return!Np(e)||!Np(t)||!Np(n)}function fa(e){return eg(e)||kS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kS(e){return k1(e.x)||k1(e.y)}function k1(e){return e&&e!=="0%"}function gf(e,t,n){const r=e-n,a=t*r;return n+a}function S1(e,t,n,r,a){return a!==void 0&&(e=gf(e,a,r)),gf(e,n,r)+t}function tg(e,t=0,n=1,r,a){e.min=S1(e.min,t,n,r,a),e.max=S1(e.max,t,n,r,a)}function SS(e,{x:t,y:n}){tg(e.x,t.translate,t.scale,t.originPoint),tg(e.y,n.translate,n.scale,n.originPoint)}const _1=.999999999999,E1=1.0000000000001;function SI(e,t,n,r=!1){var u;const a=n.length;if(!a)return;t.x=t.y=1;let l,c;for(let f=0;f<a;f++){l=n[f],c=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(es(e.x,-l.scroll.offset.x),es(e.y,-l.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,SS(e,c)),r&&fa(l.latestValues)&&Wd(e,l.latestValues,(u=l.layout)==null?void 0:u.layoutBox))}t.x<E1&&t.x>_1&&(t.x=1),t.y<E1&&t.y>_1&&(t.y=1)}function es(e,t){e.min+=t,e.max+=t}function P1(e,t,n,r,a=.5){const l=wt(e.min,e.max,a);tg(e,t,n,l,r)}function T1(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Wd(e,t,n){const r=n??e;P1(e.x,T1(t.x,r.x),t.scaleX,t.scale,t.originX),P1(e.y,T1(t.y,r.y),t.scaleY,t.scale,t.originY)}function _S(e,t){return CS(kI(e.getBoundingClientRect(),t))}function _I(e,t,n){const r=_S(e,n),{scroll:a}=t;return a&&(es(r.x,a.offset.x),es(r.y,a.offset.y)),r}const EI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},PI=al.length;function TI(e,t,n){let r="",a=!0;for(let l=0;l<PI;l++){const c=al[l],u=e[c];if(u===void 0)continue;let f=!0;if(typeof u=="number")f=u===(c.startsWith("scale")?1:0);else{const m=parseFloat(u);f=c.startsWith("scale")?m===1:m===0}if(!f||n){const m=pS(u,by[c]);if(!f){a=!1;const p=EI[c]||c;r+=`${p}(${m}) `}n&&(t[c]=m)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function Sy(e,t,n){const{style:r,vars:a,transformOrigin:l}=e;let c=!1,u=!1;for(const f in t){const m=t[f];if(il.has(f)){c=!0;continue}else if(Lk(f)){a[f]=m;continue}else{const p=pS(m,by[f]);f.startsWith("origin")?(u=!0,l[f]=p):r[f]=p}}if(t.transform||(c||n?r.transform=TI(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:f="50%",originY:m="50%",originZ:p=0}=l;r.transformOrigin=`${f} ${m} ${p}`}}function ES(e,{style:t,vars:n},r,a){const l=e.style;let c;for(c in t)l[c]=t[c];a==null||a.applyProjectionStyles(l,r);for(c in n)l.setProperty(c,n[c])}function A1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ql={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const n=A1(e,t.target.x),r=A1(e,t.target.y);return`${n}% ${r}%`}},AI={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=Ar.parse(e);if(a.length>5)return r;const l=Ar.createTransformer(e),c=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,f=n.y.scale*t.y;a[0+c]/=u,a[1+c]/=f;const m=wt(u,f,.5);return typeof a[2+c]=="number"&&(a[2+c]/=m),typeof a[3+c]=="number"&&(a[3+c]/=m),l(a)}},ng={borderRadius:{...Ql,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ql,borderTopRightRadius:Ql,borderBottomLeftRadius:Ql,borderBottomRightRadius:Ql,boxShadow:AI};function PS(e,{layout:t,layoutId:n}){return il.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ng[e]||e==="opacity")}function _y(e,t,n){var c;const r=e.style,a=t==null?void 0:t.style,l={};if(!r)return l;for(const u in r)(rn(r[u])||a&&rn(a[u])||PS(u,e)||((c=n==null?void 0:n.getValue(u))==null?void 0:c.liveStyle)!==void 0)&&(l[u]=r[u]);return l}function MI(e){return window.getComputedStyle(e)}class DI extends NS{constructor(){super(...arguments),this.type="html",this.renderInstance=ES}readValueFromInstance(t,n){var r;if(il.has(n))return(r=this.projection)!=null&&r.isProjecting?zx(n):JR(t,n);{const a=MI(t),l=(Lk(n)?a.getPropertyValue(n):a[n])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _S(t,n)}build(t,n,r){Sy(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return _y(t,n,r)}}const RI={offset:"stroke-dashoffset",array:"stroke-dasharray"},OI={offset:"strokeDashoffset",array:"strokeDasharray"};function II(e,t,n=1,r=0,a=!0){e.pathLength=1;const l=a?RI:OI;e[l.offset]=`${-r}`,e[l.array]=`${t} ${n}`}const LI=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function TS(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},f,m,p){if(Sy(e,u,m),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete g.transformBox);for(const y of LI)g[y]!==void 0&&(v[y]=g[y],delete g[y]);t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&II(g,a,l,c,!1)}const AS=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),MS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function FI(e,t,n,r){ES(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(AS.has(a)?a:vy(a),t.attrs[a])}function DS(e,t,n){const r=_y(e,t,n);for(const a in e)if(rn(e[a])||rn(t[a])){const l=al.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[l]=e[a]}return r}class $I extends NS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(il.has(n)){const r=fS(n);return r&&r.default||0}return n=AS.has(n)?n:vy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return DS(t,n,r)}build(t,n,r){TS(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){FI(t,n,r,a)}mount(t){this.isSVGTag=MS(t.tagName),super.mount(t)}}const VI=ky.length;function RS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?RS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<VI;n++){const r=ky[n],a=e.props[r];(kc(a)||a===!1)&&(t[r]=a)}return t}function OS(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const BI=[...Cy].reverse(),zI=Cy.length;function WI(e){return t=>Promise.all(t.map(({animation:n,options:r})=>VO(e,n,r)))}function UI(e){let t=WI(e),n=M1(),r=!0,a=!1;const l=m=>(p,g)=>{var y;const v=Ea(e,g,m==="exit"?(y=e.presenceContext)==null?void 0:y.custom:void 0);if(v){const{transition:k,transitionEnd:j,...N}=v;p={...p,...N,...j}}return p};function c(m){t=m(e)}function u(m){const{props:p}=e,g=RS(e.parent)||{},v=[],y=new Set;let k={},j=1/0;for(let _=0;_<zI;_++){const w=BI[_],S=n[w],E=p[w]!==void 0?p[w]:g[w],P=kc(E),T=w===m?S.isActive:null;T===!1&&(j=_);let M=E===g[w]&&E!==p[w]&&P;if(M&&(r||a)&&e.manuallyAnimateOnMount&&(M=!1),S.protectedKeys={...k},!S.isActive&&T===null||!E&&!S.prevProp||Yf(E)||typeof E=="boolean")continue;if(w==="exit"&&S.isActive&&T!==!0){S.prevResolvedValues&&(k={...k,...S.prevResolvedValues});continue}const D=HI(S.prevProp,E);let q=D||w===m&&S.isActive&&!M&&P||_>j&&P,H=!1;const I=Array.isArray(E)?E:[E];let F=I.reduce(l(w),{});T===!1&&(F={});const{prevResolvedValues:te={}}=S,Y={...te,...F},O=R=>{q=!0,y.has(R)&&(H=!0,y.delete(R)),S.needsAnimating[R]=!0;const z=e.getValue(R);z&&(z.liveStyle=!1)};for(const R in Y){const z=F[R],X=te[R];if(k.hasOwnProperty(R))continue;let B=!1;Yx(z)&&Yx(X)?B=!OS(z,X):B=z!==X,B?z!=null?O(R):y.add(R):z!==void 0&&y.has(R)?O(R):S.protectedKeys[R]=!0}S.prevProp=E,S.prevResolvedValues=F,S.isActive&&(k={...k,...F}),(r||a)&&e.blockInitialAnimation&&(q=!1);const U=M&&D;q&&(!U||H)&&v.push(...I.map(R=>{const z={type:w};if(typeof R=="string"&&(r||a)&&!U&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,B=Ea(X,R);if(X.enteringChildren&&B){const{delayChildren:L}=B.transition||{};z.delay=rS(X.enteringChildren,e,L)}}return{animation:R,options:z}}))}if(y.size){const _={};if(typeof p.initial!="boolean"){const w=Ea(e,Array.isArray(p.initial)?p.initial[0]:p.initial);w&&w.transition&&(_.transition=w.transition)}y.forEach(w=>{const S=e.getBaseTarget(w),E=e.getValue(w);E&&(E.liveStyle=!0),_[w]=S??null}),v.push({animation:_})}let N=!!v.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(N=!1),r=!1,a=!1,N?t(v):Promise.resolve()}function f(m,p){var v;if(n[m].isActive===p)return Promise.resolve();(v=e.variantChildren)==null||v.forEach(y=>{var k;return(k=y.animationState)==null?void 0:k.setActive(m,p)}),n[m].isActive=p;const g=u(m);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:u,setActive:f,setAnimateFunction:c,getState:()=>n,reset:()=>{n=M1(),a=!0}}}function HI(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!OS(t,e):!1}function ia(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function M1(){return{animate:ia(!0),whileInView:ia(),whileHover:ia(),whileTap:ia(),whileDrag:ia(),whileFocus:ia(),exit:ia()}}function rg(e,t){e.min=t.min,e.max=t.max}function kr(e,t){rg(e.x,t.x),rg(e.y,t.y)}function D1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const IS=1e-4,qI=1-IS,KI=1+IS,LS=.01,YI=0-LS,QI=0+LS;function Nn(e){return e.max-e.min}function GI(e,t,n){return Math.abs(e-t)<=n}function R1(e,t,n,r=.5){e.origin=r,e.originPoint=wt(t.min,t.max,e.origin),e.scale=Nn(n)/Nn(t),e.translate=wt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=qI&&e.scale<=KI||isNaN(e.scale))&&(e.scale=1),(e.translate>=YI&&e.translate<=QI||isNaN(e.translate))&&(e.translate=0)}function fc(e,t,n,r){R1(e.x,t.x,n.x,r?r.originX:void 0),R1(e.y,t.y,n.y,r?r.originY:void 0)}function O1(e,t,n){e.min=n.min+t.min,e.max=e.min+Nn(t)}function XI(e,t,n){O1(e.x,t.x,n.x),O1(e.y,t.y,n.y)}function I1(e,t,n){e.min=t.min-n.min,e.max=e.min+Nn(t)}function yf(e,t,n){I1(e.x,t.x,n.x),I1(e.y,t.y,n.y)}function L1(e,t,n,r,a){return e-=t,e=gf(e,1/n,r),a!==void 0&&(e=gf(e,1/a,r)),e}function ZI(e,t=0,n=1,r=.5,a,l=e,c=e){if(is.test(t)&&(t=parseFloat(t),t=wt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=wt(l.min,l.max,r);e===l&&(u-=t),e.min=L1(e.min,t,n,u,a),e.max=L1(e.max,t,n,u,a)}function F1(e,t,[n,r,a],l,c){ZI(e,t[n],t[r],t[a],t.scale,l,c)}const JI=["x","scaleX","originX"],eL=["y","scaleY","originY"];function $1(e,t,n,r){F1(e.x,t,JI,n?n.x:void 0,r?r.x:void 0),F1(e.y,t,eL,n?n.y:void 0,r?r.y:void 0)}function V1(e){return e.translate===0&&e.scale===1}function FS(e){return V1(e.x)&&V1(e.y)}function B1(e,t){return e.min===t.min&&e.max===t.max}function tL(e,t){return B1(e.x,t.x)&&B1(e.y,t.y)}function z1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $S(e,t){return z1(e.x,t.x)&&z1(e.y,t.y)}function W1(e){return Nn(e.x)/Nn(e.y)}function U1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Gr(e){return[e("x"),e("y")]}function nL(e,t,n){let r="";const a=e.x.translate/t.x,l=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((a||l||c)&&(r=`translate3d(${a}px, ${l}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:p,rotateX:g,rotateY:v,skewX:y,skewY:k}=n;m&&(r=`perspective(${m}px) ${r}`),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),y&&(r+=`skewX(${y}deg) `),k&&(r+=`skewY(${k}deg) `)}const u=e.x.scale*t.x,f=e.y.scale*t.y;return(u!==1||f!==1)&&(r+=`scale(${u}, ${f})`),r||"none"}const VS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],rL=VS.length,H1=e=>typeof e=="string"?parseFloat(e):e,q1=e=>typeof e=="number"||Ne.test(e);function sL(e,t,n,r,a,l){a?(e.opacity=wt(0,n.opacity??1,oL(r)),e.opacityExit=wt(t.opacity??1,0,aL(r))):l&&(e.opacity=wt(t.opacity??1,n.opacity??1,r));for(let c=0;c<rL;c++){const u=VS[c];let f=K1(t,u),m=K1(n,u);if(f===void 0&&m===void 0)continue;f||(f=0),m||(m=0),f===0||m===0||q1(f)===q1(m)?(e[u]=Math.max(wt(H1(f),H1(m),r),0),(is.test(m)||is.test(f))&&(e[u]+="%")):e[u]=m}(t.rotate||n.rotate)&&(e.rotate=wt(t.rotate||0,n.rotate||0,r))}function K1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const oL=BS(0,.5,Ak),aL=BS(.5,.95,fr);function BS(e,t,n){return r=>r<e?0:r>t?1:n(Nc(e,t,r))}function iL(e,t,n){const r=rn(e)?e:Ui(e);return r.start(gy("",r,t,n)),r.animation}function Sc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const lL=(e,t)=>e.depth-t.depth;class cL{constructor(){this.children=[],this.isDirty=!1}add(t){sy(this.children,t),this.isDirty=!0}remove(t){df(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lL),this.isDirty=!1,this.children.forEach(t)}}function uL(e,t){const n=jn.now(),r=({timestamp:a})=>{const l=a-n;l>=t&&(Oo(r),e(l-t))};return dt.setup(r,!0),()=>Oo(r)}function Ud(e){return rn(e)?e.get():e}class dL{constructor(){this.members=[]}add(t){sy(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const a=r.instance;(!a||a.isConnected===!1)&&!r.snapshot&&(df(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(df(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const a=this.members[r];if(a.isPresent!==!1&&((n=a.instance)==null?void 0:n.isConnected)!==!1)return this.promote(a),!0}return!1}promote(t,n){var a;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:l}=r.options,{layoutDependency:c}=t.options;(l===void 0||l!==c)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(a=t.root)!=null&&a.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,a,l,c;(r=(n=t.options).onExitComplete)==null||r.call(n),(c=(a=t.resumingFrom)==null?void 0:(l=a.options).onExitComplete)==null||c.call(l)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Hd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Cp=["","X","Y","Z"],fL=1e3;let mL=0;function kp(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function zS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(a||l))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zS(r)}function WS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},u=t==null?void 0:t()){this.id=mL++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(xL),this.nodes.forEach(wL),this.nodes.forEach(jL),this.nodes.forEach(gL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new cL)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new ay),this.eventHandlers.get(c).add(u)}notifyListeners(c,...u){const f=this.eventHandlers.get(c);f&&f.notify(...u)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=Ny(c)&&!pI(c),this.instance=c;const{layoutId:u,layout:f,visualElement:m}=this.options;if(m&&!m.current&&m.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||u)&&(this.isLayoutDirty=!0),e){let p,g=0;const v=()=>this.root.updateBlockedByResize=!1;dt.read(()=>{g=window.innerWidth}),e(c,()=>{const y=window.innerWidth;y!==g&&(g=y,this.root.updateBlockedByResize=!0,p&&p(),p=uL(v,250),Hd.hasAnimatedSinceResize&&(Hd.hasAnimatedSinceResize=!1,this.nodes.forEach(G1)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&m&&(u||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||m.getDefaultTransition()||_L,{onLayoutAnimationStart:j,onLayoutAnimationComplete:N}=m.getProps(),_=!this.targetLayout||!$S(this.targetLayout,y),w=!g&&v;if(this.options.layoutRoot||this.resumeFrom||w||g&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...xy(k,"layout"),onPlay:j,onComplete:N};(m.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(p,w)}else g||G1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Oo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(NL),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const g=this.path[p];g.shouldResetTransform=!0,(typeof g.latestValues.x=="string"||typeof g.latestValues.y=="string")&&(g.isLayoutDirty=!0),g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:u,layout:f}=this.options;if(u===void 0&&!f)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Y1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Q1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(vL),this.nodes.forEach(bL),this.nodes.forEach(hL),this.nodes.forEach(pL)):this.nodes.forEach(Q1),this.clearAllSnapshots();const u=jn.now();tn.delta=us(0,1e3/60,u-tn.timestamp),tn.timestamp=u,tn.isProcessing=!0,xp.update.process(tn),xp.preRender.process(tn),xp.render.process(tn),tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yL),this.sharedNodes.forEach(CL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Nn(this.snapshot.measuredBox.x)&&!Nn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Vt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(u=!1),u&&this.instance){const f=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!FS(this.projectionDelta),f=this.getTransformTemplate(),m=f?f(this.latestValues,""):void 0,p=m!==this.prevTransformTemplateValue;c&&this.instance&&(u||fa(this.latestValues)||p)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const u=this.measurePageBox();let f=this.removeElementScroll(u);return c&&(f=this.removeTransform(f)),EL(f),{animationId:this.root.animationId,measuredBox:u,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:c}=this.options;if(!c)return Vt();const u=c.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(PL))){const{scroll:p}=this.root;p&&(es(u.x,p.offset.x),es(u.y,p.offset.y))}return u}removeElementScroll(c){var f;const u=Vt();if(kr(u,c),(f=this.scroll)!=null&&f.wasRoot)return u;for(let m=0;m<this.path.length;m++){const p=this.path[m],{scroll:g,options:v}=p;p!==this.root&&g&&v.layoutScroll&&(g.wasRoot&&kr(u,c),es(u.x,g.offset.x),es(u.y,g.offset.y))}return u}applyTransform(c,u=!1,f){var p,g;const m=f||Vt();kr(m,c);for(let v=0;v<this.path.length;v++){const y=this.path[v];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(es(m.x,-y.scroll.offset.x),es(m.y,-y.scroll.offset.y)),fa(y.latestValues)&&Wd(m,y.latestValues,(p=y.layout)==null?void 0:p.layoutBox)}return fa(this.latestValues)&&Wd(m,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),m}removeTransform(c){var f;const u=Vt();kr(u,c);for(let m=0;m<this.path.length;m++){const p=this.path[m];if(!fa(p.latestValues))continue;let g;p.instance&&(eg(p.latestValues)&&p.updateSnapshot(),g=Vt(),kr(g,p.measurePageBox())),$1(u,p.latestValues,(f=p.snapshot)==null?void 0:f.layoutBox,g)}return fa(this.latestValues)&&$1(u,this.latestValues),u}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==u;if(!(c||f&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:g}=this.options;if(!this.layout||!(p||g))return;this.resolvedRelativeTargetAt=tn.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Vt(),this.targetWithTransforms=Vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),XI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):kr(this.target,this.layout.layoutBox),SS(this.target,this.targetDelta)):kr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||eg(this.parent.latestValues)||kS(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,u,f){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Vt(),this.relativeTargetOrigin=Vt(),yf(this.relativeTargetOrigin,u,f),kr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var k;const c=this.getLead(),u=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||(k=this.parent)!=null&&k.isProjectionDirty)&&(f=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===tn.timestamp&&(f=!1),f)return;const{layout:m,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||p))return;kr(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;SI(this.layoutCorrected,this.treeScale,this.path,u),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Vt());const{target:y}=c;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(D1(this.prevProjectionDelta.x,this.projectionDelta.x),D1(this.prevProjectionDelta.y,this.projectionDelta.y)),fc(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!U1(this.projectionDelta.x,this.prevProjectionDelta.x)||!U1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),c){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wi(),this.projectionDelta=wi(),this.projectionDeltaWithTransform=wi()}setAnimationOrigin(c,u=!1){const f=this.snapshot,m=f?f.latestValues:{},p={...this.latestValues},g=wi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const v=Vt(),y=f?f.source:void 0,k=this.layout?this.layout.source:void 0,j=y!==k,N=this.getStack(),_=!N||N.members.length<=1,w=!!(j&&!_&&this.options.crossfade===!0&&!this.path.some(SL));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const P=E/1e3;X1(g.x,c.x,P),X1(g.y,c.y,P),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yf(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),kL(this.relativeTarget,this.relativeTargetOrigin,v,P),S&&tL(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Vt()),kr(S,this.relativeTarget)),j&&(this.animationValues=p,sL(p,m,this.latestValues,P,w,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var u,f,m;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(m=(f=this.resumingFrom)==null?void 0:f.currentAnimation)==null||m.stop(),this.pendingAnimation&&(Oo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{Hd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ui(0)),this.motionValue.jump(0,!1),this.currentAnimation=iL(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),c.onUpdate&&c.onUpdate(p)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:f,layout:m,latestValues:p}=c;if(!(!u||!f||!m)){if(this!==c&&this.layout&&m&&US(this.options.animationType,this.layout.layoutBox,m.layoutBox)){f=this.target||Vt();const g=Nn(this.layout.layoutBox.x);f.x.min=c.target.x.min,f.x.max=f.x.min+g;const v=Nn(this.layout.layoutBox.y);f.y.min=c.target.y.min,f.y.max=f.y.min+v}kr(u,f),Wd(u,p),fc(this.projectionDeltaWithTransform,this.layoutCorrected,u,p)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new dL),this.sharedNodes.get(c).add(u);const m=u.options.initialPromotionConfig;u.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var u;const{layoutId:c}=this.options;return c?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:c}=this.options;return c?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:f}={}){const m=this.getStack();m&&m.promote(this,f),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:f}=c;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(u=!0),!u)return;const m={};f.z&&kp("z",c,m,this.animationValues);for(let p=0;p<Cp.length;p++)kp(`rotate${Cp[p]}`,c,m,this.animationValues),kp(`skew${Cp[p]}`,c,m,this.animationValues);c.render();for(const p in m)c.setStaticValue(p,m[p]),this.animationValues&&(this.animationValues[p]=m[p]);c.scheduleRender()}applyProjectionStyles(c,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Ud(u==null?void 0:u.pointerEvents)||"",c.transform=f?f(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Ud(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!fa(this.latestValues)&&(c.transform=f?f({},""):"none",this.hasProjected=!1);return}c.visibility="";const p=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=nL(this.projectionDeltaWithTransform,this.treeScale,p);f&&(g=f(p,g)),c.transform=g;const{x:v,y}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${y.origin*100}% 0`,m.animationValues?c.opacity=m===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:c.opacity=m===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const k in ng){if(p[k]===void 0)continue;const{correct:j,applyTo:N,isCSSVariable:_}=ng[k],w=g==="none"?p[k]:j(p[k],m);if(N){const S=N.length;for(let E=0;E<S;E++)c[N[E]]=w}else _?this.options.visualElement.renderState.vars[k]=w:c[k]=w}this.options.layoutId&&(c.pointerEvents=m===this?Ud(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var u;return(u=c.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(Y1),this.root.sharedNodes.clear()}}}function hL(e){e.updateLayout()}function pL(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:a}=e.layout,{animationType:l}=e.options,c=t.source!==e.layout.source;if(l==="size")Gr(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],y=Nn(v);v.min=r[g].min,v.max=v.min+y});else if(l==="x"||l==="y"){const g=l==="x"?"y":"x";rg(c?t.measuredBox[g]:t.layoutBox[g],r[g])}else US(l,t.layoutBox,r)&&Gr(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],y=Nn(r[g]);v.max=v.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+y)});const u=wi();fc(u,r,t.layoutBox);const f=wi();c?fc(f,e.applyTransform(a,!0),t.measuredBox):fc(f,r,t.layoutBox);const m=!FS(u);let p=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:y}=g;if(v&&y){const k=Vt();yf(k,t.layoutBox,v.layoutBox);const j=Vt();yf(j,r,y.layoutBox),$S(k,j)||(p=!0),g.options.layoutRoot&&(e.relativeTarget=j,e.relativeTargetOrigin=k,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:f,layoutDelta:u,hasLayoutChanged:m,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function xL(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function gL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yL(e){e.clearSnapshot()}function Y1(e){e.clearMeasurements()}function Q1(e){e.isLayoutDirty=!1}function vL(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function bL(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function G1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wL(e){e.resolveTargetDelta()}function jL(e){e.calcProjection()}function NL(e){e.resetSkewAndRotation()}function CL(e){e.removeLeadSnapshot()}function X1(e,t,n){e.translate=wt(t.translate,0,n),e.scale=wt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Z1(e,t,n,r){e.min=wt(t.min,n.min,r),e.max=wt(t.max,n.max,r)}function kL(e,t,n,r){Z1(e.x,t.x,n.x,r),Z1(e.y,t.y,n.y,r)}function SL(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _L={duration:.45,ease:[.4,0,.1,1]},J1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ej=J1("applewebkit/")&&!J1("chrome/")?Math.round:fr;function tj(e){e.min=ej(e.min),e.max=ej(e.max)}function EL(e){tj(e.x),tj(e.y)}function US(e,t,n){return e==="position"||e==="preserve-aspect"&&!GI(W1(t),W1(n),.2)}function PL(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const TL=WS({attachResizeListener:(e,t)=>Sc(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Sp={current:void 0},HS=WS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Sp.current){const e=new TL({});e.mount(window),e.setOptions({layoutScroll:!0}),Sp.current=e}return Sp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ey=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function nj(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function AL(...e){return t=>{let n=!1;const r=e.map(a=>{const l=nj(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<r.length;a++){const l=r[a];typeof l=="function"?l():nj(e[a],null)}}}}function ML(...e){return x.useCallback(AL(...e),e)}class DL extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if($d(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,a=$d(r)&&r.offsetWidth||0,l=$d(r)&&r.offsetHeight||0,c=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(c.height),u.width=parseFloat(c.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=a-u.width-u.left,u.bottom=l-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function RL({children:e,isPresent:t,anchorX:n,anchorY:r,root:a,pop:l}){var v;const c=x.useId(),u=x.useRef(null),f=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=x.useContext(Ey),p=((v=e.props)==null?void 0:v.ref)??(e==null?void 0:e.ref),g=ML(u,p);return x.useInsertionEffect(()=>{const{width:y,height:k,top:j,left:N,right:_,bottom:w}=f.current;if(t||l===!1||!u.current||!y||!k)return;const S=n==="left"?`left: ${N}`:`right: ${_}`,E=r==="bottom"?`bottom: ${w}`:`top: ${j}`;u.current.dataset.motionPopId=c;const P=document.createElement("style");m&&(P.nonce=m);const T=a??document.head;return T.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
509
|
+
[data-motion-pop-id="${c}"] {
|
|
510
|
+
position: absolute !important;
|
|
511
|
+
width: ${y}px !important;
|
|
512
|
+
height: ${k}px !important;
|
|
513
|
+
${S}px !important;
|
|
514
|
+
${E}px !important;
|
|
515
|
+
}
|
|
516
|
+
`),()=>{var M;(M=u.current)==null||M.removeAttribute("data-motion-pop-id"),T.contains(P)&&T.removeChild(P)}},[t]),s.jsx(DL,{isPresent:t,childRef:u,sizeRef:f,pop:l,children:l===!1?e:x.cloneElement(e,{ref:g})})}const OL=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u,anchorY:f,root:m})=>{const p=ry(IL),g=x.useId();let v=!0,y=x.useMemo(()=>(v=!1,{id:g,initial:t,isPresent:n,custom:a,onExitComplete:k=>{p.set(k,!0);for(const j of p.values())if(!j)return;r&&r()},register:k=>(p.set(k,!1),()=>p.delete(k))}),[n,p,r]);return l&&v&&(y={...y}),x.useMemo(()=>{p.forEach((k,j)=>p.set(j,!1))},[n]),x.useEffect(()=>{!n&&!p.size&&r&&r()},[n]),e=s.jsx(RL,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:f,root:m,children:e}),s.jsx(qf.Provider,{value:y,children:e})};function IL(){return new Map}function qS(e=!0){const t=x.useContext(qf);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,l=x.useId();x.useEffect(()=>{if(e)return a(l)},[e]);const c=x.useCallback(()=>e&&r&&r(l),[l,r,e]);return!n&&r?[!1,c]:[!0]}const yd=e=>e.key||"";function rj(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const Cn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:u="left",anchorY:f="top",root:m})=>{const[p,g]=qS(c),v=x.useMemo(()=>rj(e),[e]),y=c&&!p?[]:v.map(yd),k=x.useRef(!0),j=x.useRef(v),N=ry(()=>new Map),_=x.useRef(new Set),[w,S]=x.useState(v),[E,P]=x.useState(v);vk(()=>{k.current=!1,j.current=v;for(let D=0;D<E.length;D++){const q=yd(E[D]);y.includes(q)?(N.delete(q),_.current.delete(q)):N.get(q)!==!0&&N.set(q,!1)}},[E,y.length,y.join("-")]);const T=[];if(v!==w){let D=[...v];for(let q=0;q<E.length;q++){const H=E[q],I=yd(H);y.includes(I)||(D.splice(q,0,H),T.push(H))}return l==="wait"&&T.length&&(D=T),P(rj(D)),S(v),null}const{forceRender:M}=x.useContext(ny);return s.jsx(s.Fragment,{children:E.map(D=>{const q=yd(D),H=c&&!p?!1:v===E||y.includes(q),I=()=>{if(_.current.has(q))return;if(N.has(q))_.current.add(q),N.set(q,!0);else return;let F=!0;N.forEach(te=>{te||(F=!1)}),F&&(M==null||M(),P(j.current),c&&(g==null||g()),r&&r())};return s.jsx(OL,{isPresent:H,initial:!k.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:l,root:m,onExitComplete:H?void 0:I,anchorX:u,anchorY:f,children:D},q)})})},KS=x.createContext({strict:!1}),sj={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let oj=!1;function LL(){if(oj)return;const e={};for(const t in sj)e[t]={isEnabled:n=>sj[t].some(r=>!!n[r])};jS(e),oj=!0}function YS(){return LL(),jI()}function FL(e){const t=YS();for(const n in e)t[n]={...t[n],...e[n]};jS(t)}const $L=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$L.has(e)}let QS=e=>!vf(e);function VL(e){typeof e=="function"&&(QS=t=>t.startsWith("on")?!vf(t):e(t))}try{VL(require("@emotion/is-prop-valid").default)}catch{}function BL(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||rn(e[a])||(QS(a)||n===!0&&vf(a)||!t&&!vf(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const Gf=x.createContext({});function zL(e,t){if(Qf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kc(n)?n:void 0,animate:kc(r)?r:void 0}}return e.inherit!==!1?t:{}}function WL(e){const{initial:t,animate:n}=zL(e,x.useContext(Gf));return x.useMemo(()=>({initial:t,animate:n}),[aj(t),aj(n)])}function aj(e){return Array.isArray(e)?e.join(" "):e}const Py=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function GS(e,t,n){for(const r in t)!rn(t[r])&&!PS(r,n)&&(e[r]=t[r])}function UL({transformTemplate:e},t){return x.useMemo(()=>{const n=Py();return Sy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function HL(e,t){const n=e.style||{},r={};return GS(r,n,e),Object.assign(r,UL(e,t)),r}function qL(e,t){const n={},r=HL(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const XS=()=>({...Py(),attrs:{}});function KL(e,t,n,r){const a=x.useMemo(()=>{const l=XS();return TS(l,t,MS(r),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};GS(l,e.style,e),a.style={...l,...a.style}}return a}const YL=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ty(e){return typeof e!="string"||e.includes("-")?!1:!!(YL.indexOf(e)>-1||/[A-Z]/u.test(e))}function QL(e,t,n,{latestValues:r},a,l=!1,c){const f=(c??Ty(e)?KL:qL)(t,r,a,e),m=BL(t,typeof e=="string",l),p=e!==x.Fragment?{...m,...f,ref:n}:{},{children:g}=t,v=x.useMemo(()=>rn(g)?g.get():g,[g]);return x.createElement(e,{...p,children:v})}function GL({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:XL(n,r,a,e),renderState:t()}}function XL(e,t,n,r){const a={},l=r(e,{});for(const v in l)a[v]=Ud(l[v]);let{initial:c,animate:u}=e;const f=Qf(e),m=bS(e);t&&m&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||c===!1;const g=p?u:c;if(g&&typeof g!="boolean"&&!Yf(g)){const v=Array.isArray(g)?g:[g];for(let y=0;y<v.length;y++){const k=yy(e,v[y]);if(k){const{transitionEnd:j,transition:N,..._}=k;for(const w in _){let S=_[w];if(Array.isArray(S)){const E=p?S.length-1:0;S=S[E]}S!==null&&(a[w]=S)}for(const w in j)a[w]=j[w]}}}return a}const ZS=e=>(t,n)=>{const r=x.useContext(Gf),a=x.useContext(qf),l=()=>GL(e,t,r,a);return n?l():ry(l)},ZL=ZS({scrapeMotionValuesFromProps:_y,createRenderState:Py}),JL=ZS({scrapeMotionValuesFromProps:DS,createRenderState:XS}),eF=Symbol.for("motionComponentSymbol");function tF(e,t,n){const r=x.useRef(n);x.useInsertionEffect(()=>{r.current=n});const a=x.useRef(null);return x.useCallback(l=>{var u;l&&((u=e.onMount)==null||u.call(e,l));const c=r.current;if(typeof c=="function")if(l){const f=c(l);typeof f=="function"&&(a.current=f)}else a.current?(a.current(),a.current=null):c(l);else c&&(c.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const JS=x.createContext({});function xi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nF(e,t,n,r,a,l){var S,E;const{visualElement:c}=x.useContext(Gf),u=x.useContext(KS),f=x.useContext(qf),m=x.useContext(Ey),p=m.reducedMotion,g=m.skipAnimations,v=x.useRef(null),y=x.useRef(!1);r=r||u.renderer,!v.current&&r&&(v.current=r(e,{visualState:t,parent:c,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p,skipAnimations:g,isSVG:l}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const k=v.current,j=x.useContext(JS);k&&!k.projection&&a&&(k.type==="html"||k.type==="svg")&&rF(v.current,n,a,j);const N=x.useRef(!1);x.useInsertionEffect(()=>{k&&N.current&&k.update(n,f)});const _=n[iS],w=x.useRef(!!_&&typeof window<"u"&&!((S=window.MotionHandoffIsComplete)!=null&&S.call(window,_))&&((E=window.MotionHasOptimisedAnimation)==null?void 0:E.call(window,_)));return vk(()=>{y.current=!0,k&&(N.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),k.scheduleRenderMicrotask(),w.current&&k.animationState&&k.animationState.animateChanges())}),x.useEffect(()=>{k&&(!w.current&&k.animationState&&k.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,_)}),w.current=!1),k.enteringChildren=void 0)}),k}function rF(e,t,n,r){const{layoutId:a,layout:l,drag:c,dragConstraints:u,layoutScroll:f,layoutRoot:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:e2(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||u&&xi(u),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:f,layoutRoot:m})}function e2(e){if(e)return e.options.allowProjection!==!1?e.projection:e2(e.parent)}function _p(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&FL(r);const l=n?n==="svg":Ty(e),c=l?JL:ZL;function u(m,p){let g;const v={...x.useContext(Ey),...m,layoutId:sF(m)},{isStatic:y}=v,k=WL(m),j=c(m,y);if(!y&&typeof window<"u"){oF();const N=aF(v);g=N.MeasureLayout,k.visualElement=nF(e,j,v,a,N.ProjectionNode,l)}return s.jsxs(Gf.Provider,{value:k,children:[g&&k.visualElement?s.jsx(g,{visualElement:k.visualElement,...v}):null,QL(e,m,tF(j,k.visualElement,p),j,y,t,l)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=x.forwardRef(u);return f[eF]=e,f}function sF({layoutId:e}){const t=x.useContext(ny).id;return t&&e!==void 0?t+"-"+e:e}function oF(e,t){x.useContext(KS).strict}function aF(e){const t=YS(),{drag:n,layout:r}=t;if(!n&&!r)return{};const a={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function iF(e,t){if(typeof Proxy>"u")return _p;const n=new Map,r=(l,c)=>_p(l,c,e,t),a=(l,c)=>r(l,c);return new Proxy(a,{get:(l,c)=>c==="create"?r:(n.has(c)||n.set(c,_p(c,void 0,e,t)),n.get(c))})}const lF=(e,t)=>t.isSVG??Ty(e)?new $I(t):new DI(t,{allowProjection:e!==x.Fragment});class cF extends zo{constructor(t){super(t),t.animationState||(t.animationState=UI(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let uF=0;class dF extends zo{constructor(){super(...arguments),this.id=uF++,this.isExitComplete=!1}update(){var l;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:c,custom:u}=this.node.getProps();if(typeof c=="string"){const f=Ea(this.node,c,u);if(f){const{transition:m,transitionEnd:p,...g}=f;for(const v in g)(l=this.node.getValue(v))==null||l.jump(g[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fF={animation:{Feature:cF},exit:{Feature:dF}};function qc(e){return{point:{x:e.pageX,y:e.pageY}}}const mF=e=>t=>jy(t)&&e(t,qc(t));function mc(e,t,n,r){return Sc(e,t,mF(n),r)}const t2=({current:e})=>e?e.ownerDocument.defaultView:null,ij=(e,t)=>Math.abs(e-t);function hF(e,t){const n=ij(e.x,t.x),r=ij(e.y,t.y);return Math.sqrt(n**2+r**2)}const lj=new Set(["auto","scroll"]);class n2{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vd(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Ep(this.lastMoveEventInfo,this.history),k=this.startEvent!==null,j=hF(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!k&&!j)return;const{point:N}=y,{timestamp:_}=tn;this.history.push({...N,timestamp:_});const{onStart:w,onMove:S}=this.handlers;k||(w&&w(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,y)},this.handlePointerMove=(y,k)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=k,this.lastMoveEventInfo=vd(k,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(y,k)=>{this.end();const{onEnd:j,onSessionEnd:N,resumeAnimation:_}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Ep(y.type==="pointercancel"?this.lastMoveEventInfo:vd(k,this.transformPagePoint),this.history);this.startEvent&&j&&j(y,w),N&&N(y,w)},!jy(t))return;this.dragSnapToOrigin=l,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const f=qc(t),m=vd(f,this.transformPagePoint),{point:p}=m,{timestamp:g}=tn;this.history=[{...p,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,Ep(m,this.history)),this.removeListeners=Wc(mc(this.contextWindow,"pointermove",this.handlePointerMove),mc(this.contextWindow,"pointerup",this.handlePointerUp),mc(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(lj.has(r.overflowX)||lj.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,a=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:a.x-n.x,y:a.y-n.y};l.x===0&&l.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,a),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Oo(this.updatePoint)}}function vd(e,t){return t?{point:t(e.point)}:e}function cj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ep({point:e},t){return{point:e,delta:cj(e,r2(t)),offset:cj(e,pF(t)),velocity:xF(t,.1)}}function pF(e){return e[0]}function r2(e){return e[e.length-1]}function xF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=r2(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Jn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Jn(t)*2&&(r=e[1]);const l=dr(a.timestamp-r.timestamp);if(l===0)return{x:0,y:0};const c={x:(a.x-r.x)/l,y:(a.y-r.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function gF(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?wt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?wt(n,e,r.max):Math.min(e,n)),e}function uj(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function yF(e,{top:t,left:n,bottom:r,right:a}){return{x:uj(e.x,n,a),y:uj(e.y,t,r)}}function dj(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function vF(e,t){return{x:dj(e.x,t.x),y:dj(e.y,t.y)}}function bF(e,t){let n=.5;const r=Nn(e),a=Nn(t);return a>r?n=Nc(t.min,t.max-r,e.min):r>a&&(n=Nc(e.min,e.max-a,t.min)),us(0,1,n)}function wF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const sg=.35;function jF(e=sg){return e===!1?e=0:e===!0&&(e=sg),{x:fj(e,"left","right"),y:fj(e,"top","bottom")}}function fj(e,t,n){return{min:mj(e,t),max:mj(e,n)}}function mj(e,t){return typeof e=="number"?e:e[t]||0}const NF=new WeakMap;class CF{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Vt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const l=g=>{n&&this.snapToCursor(qc(g).point),this.stopAnimation()},c=(g,v)=>{const{drag:y,dragPropagation:k,onDragStart:j}=this.getProps();if(y&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZO(y),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gr(_=>{let w=this.getAxisMotionValue(_).get()||0;if(is.test(w)){const{projection:S}=this.visualElement;if(S&&S.layout){const E=S.layout.layoutBox[_];E&&(w=Nn(E)*(parseFloat(w)/100))}}this.originPoint[_]=w}),j&&dt.update(()=>j(g,v),!1,!0),Qx(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},u=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:k,onDirectionLock:j,onDrag:N}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:_}=v;if(k&&this.currentDirection===null){this.currentDirection=SF(_),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",v.point,_),this.updateAxis("y",v.point,_),this.visualElement.render(),N&&dt.update(()=>N(g,v),!1,!0)},f=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new n2(t,{onSessionStart:l,onStart:c,onMove:u,onSessionEnd:f,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:t2(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(r,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:a}=this.getProps();if(!r||!bd(t,a,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=gF(c,this.constraints[t],this.elastic[t])),l.set(c)}resolveConstraints(){var l;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(l=this.visualElement.projection)==null?void 0:l.layout,a=this.constraints;t&&xi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=yF(r.layoutBox,t):this.constraints=!1,this.elastic=jF(n),a!==this.constraints&&!xi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Gr(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=wF(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xi(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const l=_I(r,a.root,this.visualElement.getTransformPagePoint());let c=vF(a.layout.layoutBox,l);if(n){const u=n(CI(c));this.hasMutatedConstraints=!!u,u&&(c=CS(u))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),f=this.constraints||{},m=Gr(p=>{if(!bd(p,n,this.currentDirection))return;let g=f&&f[p]||{};(c===!0||c===p)&&(g={min:0,max:0});const v=a?200:1e6,y=a?40:1e7,k={type:"inertia",velocity:r?t[p]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...l,...g};return this.startAxisValueAnimation(p,k)});return Promise.all(m).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Qx(this.visualElement,t),r.start(gy(t,r,0,n,this.visualElement,!1))}stopAnimation(){Gr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Gr(n=>{const{drag:r}=this.getProps();if(!bd(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,l=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:u}=a.layout.layoutBox[n],f=l.get()||0;l.set(t[n]-wt(c,u,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xi(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Gr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const f=u.get();a[c]=bF({min:f,max:f},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gr(c=>{if(!bd(c,t,null))return;const u=this.getAxisMotionValue(c),{min:f,max:m}=this.constraints[c];u.set(wt(f,m,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;NF.set(this.visualElement,this);const t=this.visualElement.current,n=mc(t,"pointerdown",m=>{const{drag:p,dragListener:g=!0}=this.getProps(),v=m.target,y=v!==t&&sI(v);p&&g&&!y&&this.start(m)});let r;const a=()=>{const{dragConstraints:m}=this.getProps();xi(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),r||(r=kF(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",a);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),dt.read(a);const u=Sc(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:p})=>{this.isDragging&&p&&(Gr(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=m[g].translate,v.set(v.get()+m[g].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),f&&f(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:l=!1,dragElastic:c=sg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:u}}}function hj(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function kF(e,t,n){const r=w1(e,hj(n)),a=w1(t,hj(n));return()=>{r(),a()}}function bd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function SF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class _F extends zo{constructor(t){super(t),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new CF(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Pp=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class EF extends zo{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(t){this.session=new n2(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:t2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:Pp(t),onStart:Pp(n),onMove:Pp(r),onEnd:(l,c)=>{delete this.session,a&&dt.postRender(()=>a(l,c))}}}mount(){this.removePointerDownListener=mc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Tp=!1;class PF extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:l}=t;l&&(n.group&&n.group.add(l),r&&r.register&&a&&r.register(l),Tp&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Hd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:l}=this.props,{projection:c}=r;return c&&(c.isPresent=l,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Tp=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),wy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;Tp=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s2(e){const[t,n]=qS(),r=x.useContext(ny);return s.jsx(PF,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(JS),isPresent:t,safeToRemove:n})}const TF={pan:{Feature:EF},drag:{Feature:_F,ProjectionNode:HS,MeasureLayout:s2}};function pj(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,l=r[a];l&&dt.postRender(()=>l(t,qc(t)))}class AF extends zo{mount(){const{current:t}=this.node;t&&(this.unmount=eI(t,(n,r)=>(pj(this.node,r,"Start"),a=>pj(this.node,a,"End"))))}unmount(){}}class MF extends zo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Wc(Sc(this.node.current,"focus",()=>this.onFocus()),Sc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function xj(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),l=r[a];l&&dt.postRender(()=>l(t,qc(t)))}class DF extends zo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=aI(t,(a,l)=>(xj(this.node,l,"Start"),(c,{success:u})=>xj(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const og=new WeakMap,Ap=new WeakMap,RF=e=>{const t=og.get(e.target);t&&t(e)},OF=e=>{e.forEach(RF)};function IF({root:e,...t}){const n=e||document;Ap.has(n)||Ap.set(n,{});const r=Ap.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(OF,{root:e,...t})),r[a]}function LF(e,t,n){const r=IF(t);return og.set(e,n),r.observe(e),()=>{og.delete(e),r.unobserve(e)}}const FF={some:0,all:1};class $F extends zo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var f;(f=this.stopObserver)==null||f.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:l}=t,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:FF[a]},u=m=>{const{isIntersecting:p}=m;if(this.isInView===p||(this.isInView=p,l&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:g,onViewportLeave:v}=this.node.getProps(),y=p?g:v;y&&y(m)};this.stopObserver=LF(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(VF(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function VF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const BF={inView:{Feature:$F},tap:{Feature:DF},focus:{Feature:MF},hover:{Feature:AF}},zF={layout:{ProjectionNode:HS,MeasureLayout:s2}},WF={...fF,...BF,...TF,...zF},Fe=iF(WF,lF),gj=e=>{let t;const n=new Set,r=(m,p)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(y=>y(t,v))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>f,subscribe:m=>(n.add(m),()=>n.delete(m))},f=t=e(r,a,u);return u},UF=(e=>e?gj(e):gj),HF=e=>e;function qF(e,t=HF){const n=fe.useSyncExternalStore(e.subscribe,fe.useCallback(()=>t(e.getState()),[e,t]),fe.useCallback(()=>t(e.getInitialState()),[e,t]));return fe.useDebugValue(n),n}const KF=e=>{const t=UF(e),n=r=>qF(t,r);return Object.assign(n,t),n},YF=(e=>KF);function QF(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const c=f=>f===null?null:JSON.parse(f,void 0),u=(l=n.getItem(a))!=null?l:null;return u instanceof Promise?u.then(c):c(u)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const ag=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ag(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ag(r)(n)}}}},GF=(e,t)=>(n,r,a)=>{let l={storage:QF(()=>window.localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...t},c=!1,u=0;const f=new Set,m=new Set;let p=l.storage;if(!p)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...N)},r,a);const g=()=>{const N=l.partialize({...r()});return p.setItem(l.name,{state:N,version:l.version})},v=a.setState;a.setState=(N,_)=>(v(N,_),g());const y=e((...N)=>(n(...N),g()),r,a);a.getInitialState=()=>y;let k;const j=()=>{var N,_;if(!p)return;const w=++u;c=!1,f.forEach(E=>{var P;return E((P=r())!=null?P:y)});const S=((_=l.onRehydrateStorage)==null?void 0:_.call(l,(N=r())!=null?N:y))||void 0;return ag(p.getItem.bind(p))(l.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==l.version){if(l.migrate){const P=l.migrate(E.state,E.version);return P instanceof Promise?P.then(T=>[!0,T]):[!0,P]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var P;if(w!==u)return;const[T,M]=E;if(k=l.merge(M,(P=r())!=null?P:y),n(k,!0),T)return g()}).then(()=>{w===u&&(S==null||S(r(),void 0),k=r(),c=!0,m.forEach(E=>E(k)))}).catch(E=>{w===u&&(S==null||S(void 0,E))})};return a.persist={setOptions:N=>{l={...l,...N},N.storage&&(p=N.storage)},clearStorage:()=>{p==null||p.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>j(),hasHydrated:()=>c,onHydrate:N=>(f.add(N),()=>{f.delete(N)}),onFinishHydration:N=>(m.add(N),()=>{m.delete(N)})},l.skipHydration||j(),k||y},XF=GF,nt=YF()(XF(e=>({sidebarExpanded:!1,setSidebarExpanded:t=>e({sidebarExpanded:t}),toggleSidebar:()=>e(t=>({sidebarExpanded:!t.sidebarExpanded})),drawerOpen:!1,drawerType:null,drawerEntityId:null,openDrawer:(t,n)=>e({drawerOpen:!0,drawerType:t,drawerEntityId:n??null}),closeDrawer:()=>e({drawerOpen:!1,drawerType:null,drawerEntityId:null}),commandPaletteOpen:!1,setCommandPaletteOpen:t=>e({commandPaletteOpen:t}),shortcutsOpen:!1,setShortcutsOpen:t=>e({shortcutsOpen:t}),zenMode:!1,toggleZenMode:()=>e(t=>({zenMode:!t.zenMode})),theme:"dark",setTheme:t=>{const n=document.documentElement;if(n.classList.remove("dark","light"),t==="system"){const r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";n.classList.add(r)}else n.classList.add(t);e({theme:t})},quickAddOpen:!1,quickAddType:null,openQuickAdd:t=>e({quickAddOpen:!0,quickAddType:t}),closeQuickAdd:()=>e({quickAddOpen:!1,quickAddType:null}),aiContext:null,openAIWithContext:t=>e({aiContext:t}),darkVariant:"warm",setDarkVariant:t=>e({darkVariant:t})}),{name:"crmy-app-store",partialize:e=>({sidebarExpanded:e.sidebarExpanded,theme:e.theme,darkVariant:e.darkVariant})})),ZF="/api/v1";function JF(){return localStorage.getItem("crmy_token")}function e6(e){localStorage.setItem("crmy_token",e)}function o2(){localStorage.removeItem("crmy_token"),localStorage.removeItem("crmy_user")}function Xf(){const e=localStorage.getItem("crmy_user");return e?JSON.parse(e):null}function t6(e){localStorage.setItem("crmy_user",JSON.stringify(e))}async function ha(e,t={}){const n=JF(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);let a;try{a=await fetch(e.startsWith("/")?e:`${ZF}/${e}`,{...t,headers:r})}catch{throw new Error("Unable to reach the server. Check your connection and try again.")}if(a.status===401)throw o2(),window.location.href="/app/login",new Error("Unauthorized");if(!a.ok){const l=await a.json().catch(()=>({detail:a.statusText}));throw new Error(l.detail||`HTTP ${a.status}`)}if(a.status!==204)return a.json()}const _e={get:e=>ha(e),post:(e,t)=>ha(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>ha(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),patch:(e,t)=>ha(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>ha(e,{method:"DELETE"})},yj={login:(e,t)=>ha("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})}),register:e=>ha("/auth/register",{method:"POST",body:JSON.stringify(e)})};function Vr(e,t,n){const r=new URLSearchParams;n&&Object.entries(n).forEach(([l,c])=>{c!==void 0&&c!==""&&r.set(l,String(c))});const a=r.toString()?`${t}?${r}`:t;return Lt({queryKey:[e,n],queryFn:()=>_e.get(a)})}function a2(e){return Vr("contacts","contacts",e)}function n6(e){return Lt({queryKey:["contact",e],queryFn:()=>_e.get(`contacts/${e}`),enabled:!!e})}function i2(){const e=He();return We({mutationFn:t=>_e.post("contacts",t),onSuccess:()=>e.invalidateQueries({queryKey:["contacts"]})})}function r6(e){const t=He();return We({mutationFn:n=>_e.patch(`contacts/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["contact",e]}),t.invalidateQueries({queryKey:["contacts"]})}})}function s6(e){const t=He();return We({mutationFn:()=>_e.delete(`contacts/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["contacts"]})})}function Ay(e){return Vr("accounts","accounts",e)}function o6(e){return Lt({queryKey:["account",e],queryFn:()=>_e.get(`accounts/${e}`),enabled:!!e})}function l2(){const e=He();return We({mutationFn:t=>_e.post("accounts",t),onSuccess:()=>e.invalidateQueries({queryKey:["accounts"]})})}function a6(e){const t=He();return We({mutationFn:n=>_e.patch(`accounts/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["account",e]}),t.invalidateQueries({queryKey:["accounts"]})}})}function i6(e){const t=He();return We({mutationFn:()=>_e.delete(`accounts/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["accounts"]})})}function My(e){return Vr("opportunities","opportunities",e)}function l6(e){return Lt({queryKey:["opportunity",e],queryFn:()=>_e.get(`opportunities/${e}`),enabled:!!e})}function c2(){const e=He();return We({mutationFn:t=>_e.post("opportunities",t),onSuccess:()=>e.invalidateQueries({queryKey:["opportunities"]})})}function c6(e){const t=He();return We({mutationFn:n=>_e.patch(`opportunities/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["opportunity",e]}),t.invalidateQueries({queryKey:["opportunities"]})}})}function u6(e){const t=He();return We({mutationFn:()=>_e.delete(`opportunities/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["opportunities"]})})}function u2(e){return Vr("use-cases","use-cases",e)}function d6(e){return Lt({queryKey:["use-case",e],queryFn:()=>_e.get(`use-cases/${e}`),enabled:!!e})}function d2(){const e=He();return We({mutationFn:t=>_e.post("use-cases",t),onSuccess:()=>e.invalidateQueries({queryKey:["use-cases"]})})}function f6(e){const t=He();return We({mutationFn:n=>_e.patch(`use-cases/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["use-case",e]}),t.invalidateQueries({queryKey:["use-cases"]})}})}function m6(e){const t=He();return We({mutationFn:()=>_e.delete(`use-cases/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["use-cases"]})})}function h6(e){return Lt({queryKey:["use-case-timeline",e],queryFn:()=>_e.get(`use-cases/${e}/timeline`),enabled:!!e})}function Dy(e){return Vr("activities","activities",e)}function f2(){const e=He();return We({mutationFn:t=>_e.post("activities",t),onSuccess:()=>e.invalidateQueries({queryKey:["activities"]})})}function Zf(){return Lt({queryKey:["hitl"],queryFn:()=>_e.get("hitl"),refetchInterval:1e4})}function Ry(){const e=He();return We({mutationFn:({id:t,...n})=>_e.post(`hitl/${t}/resolve`,n),onSuccess:()=>e.invalidateQueries({queryKey:["hitl"]})})}function p6(){return Vr("webhooks","webhooks")}function x6(){const e=He();return We({mutationFn:t=>_e.post("webhooks",t),onSuccess:()=>e.invalidateQueries({queryKey:["webhooks"]})})}function g6(){const e=He();return We({mutationFn:t=>_e.delete(`webhooks/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["webhooks"]})})}function ll(e){return Lt({queryKey:["custom-fields",e],queryFn:()=>_e.get(`custom-fields?object_type=${e}`),enabled:!!e})}function y6(){const e=He();return We({mutationFn:t=>_e.post("custom-fields",t),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function v6(){const e=He();return We({mutationFn:({id:t,...n})=>_e.patch(`custom-fields/${t}`,n),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function b6(){const e=He();return We({mutationFn:t=>_e.delete(`custom-fields/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function w6(e){return Lt({queryKey:["search",e],queryFn:()=>_e.get(`search?q=${encodeURIComponent(e)}`),enabled:e.length>=2})}function Jf(){return Lt({queryKey:["admin-users"],queryFn:()=>_e.get("admin/users")})}function j6(){const e=He();return We({mutationFn:t=>_e.post("admin/users",t),onSuccess:()=>e.invalidateQueries({queryKey:["admin-users"]})})}function N6(){return Lt({queryKey:["admin-db-config"],queryFn:()=>_e.get("admin/db-config")})}function C6(){return We({mutationFn:e=>_e.post("admin/db-config/test",{connection_string:e})})}function k6(){const e=He();return We({mutationFn:t=>_e.patch("admin/db-config",{connection_string:t}),onSuccess:()=>e.invalidateQueries({queryKey:["admin-db-config"]})})}function S6(e){return Vr("notes","notes",e)}function _6(){const e=He();return We({mutationFn:t=>_e.post("notes",t),onSuccess:()=>e.invalidateQueries({queryKey:["notes"]})})}function m2(e){const t=e?`?actor_id=${e}`:"";return Lt({queryKey:["api-keys",e],queryFn:()=>_e.get(`/auth/api-keys${t}`)})}function h2(){const e=He();return We({mutationFn:t=>_e.post("/auth/api-keys",t),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function E6(){const e=He();return We({mutationFn:({id:t,...n})=>_e.patch(`/auth/api-keys/${t}`,n),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function p2(){const e=He();return We({mutationFn:t=>_e.delete(`/auth/api-keys/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function P6(){return We({mutationFn:e=>_e.patch("/auth/profile",e)})}function Kc(e){return Vr("actors","actors",e)}function T6(e){return Lt({queryKey:["actor",e],queryFn:()=>_e.get(`actors/${e}`),enabled:!!e})}function A6(){const e=He();return We({mutationFn:t=>_e.post("actors",t),onSuccess:()=>e.invalidateQueries({queryKey:["actors"]})})}function x2(){const e=He();return We({mutationFn:({id:t,...n})=>_e.patch(`actors/${t}`,{patch:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["actors"]}),e.invalidateQueries({queryKey:["actor"]})}})}function g2(){return Lt({queryKey:["actor-whoami"],queryFn:()=>_e.get("actors/whoami")})}function Mp(e){return Vr("assignments","assignments",e)}function M6(e){return Lt({queryKey:["assignment",e],queryFn:()=>_e.get(`assignments/${e}`),enabled:!!e})}function y2(){const e=He();return We({mutationFn:t=>_e.post("assignments",t),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function D6(e){const t=He();return We({mutationFn:n=>_e.patch(`assignments/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["assignment",e]}),t.invalidateQueries({queryKey:["assignments"]})}})}function Oy(){const e=He();return We({mutationFn:t=>_e.post(`assignments/${t}/accept`,{}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Iy(){const e=He();return We({mutationFn:({id:t,...n})=>_e.post(`assignments/${t}/complete`,n),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Ly(){const e=He();return We({mutationFn:({id:t,...n})=>_e.post(`assignments/${t}/decline`,n),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function bf(e){return Vr("context-entries","context",e)}function v2(){const e=He();return We({mutationFn:t=>_e.post(`context/${t}/review`,{}),onSuccess:()=>{e.invalidateQueries({queryKey:["context-entries"]}),e.invalidateQueries({queryKey:["context-stale"]})}})}function R6(e){return Vr("context-stale","context/stale",e)}function Fy(){const e=He();return We({mutationFn:t=>_e.post(`assignments/${t}/start`,{}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function $y(){const e=He();return We({mutationFn:({id:t,reason:n})=>_e.post(`assignments/${t}/block`,{reason:n}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Vy(){const e=He();return We({mutationFn:({id:t,reason:n})=>_e.post(`assignments/${t}/cancel`,{reason:n}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function O6(){var c,u;const{data:e}=g2(),t=e==null?void 0:e.actor_id,n=Zf(),r=Lt({queryKey:["inbox-assignments",t],queryFn:()=>_e.get(`assignments?assigned_to=${encodeURIComponent(t)}&limit=200`),enabled:!!t,refetchInterval:3e4}),a=(((c=n.data)==null?void 0:c.data)??[]).filter(f=>f.status==="pending").length,l=(((u=r.data)==null?void 0:u.assignments)??[]).filter(f=>["pending","accepted","in_progress","blocked"].includes(f.status)).length;return{total:a+l,hitlCount:a,assignCount:l}}function I6(e,t,n){const r=new URLSearchParams;n&&Object.entries(n).forEach(([c,u])=>{u!==void 0&&u!==""&&r.set(c,String(u))});const a=r.toString(),l=`briefing/${e}/${t}${a?`?${a}`:""}`;return Lt({queryKey:["briefing",e,t,n],queryFn:()=>_e.get(l),enabled:!!e&&!!t})}function b2(){return Lt({queryKey:["agent-config"],queryFn:()=>_e.get("agent/config")})}function L6(){const e=He();return We({mutationFn:t=>_e.put("agent/config",t),onSuccess:()=>e.invalidateQueries({queryKey:["agent-config"]})})}function F6(){return We({mutationFn:()=>_e.post("agent/config/test")})}function $6(){return Lt({queryKey:["agent-sessions"],queryFn:()=>_e.get("agent/sessions")})}function V6(){const e=He();return We({mutationFn:t=>_e.post("agent/sessions",t),onSuccess:()=>e.invalidateQueries({queryKey:["agent-sessions"]})})}function B6(){const e=He();return We({mutationFn:()=>_e.delete("agent/sessions"),onSuccess:()=>e.invalidateQueries({queryKey:["agent-sessions"]})})}function z6(e){return Lt({queryKey:["agent-activity",e],queryFn:()=>{const t={};e!=null&&e.user_id&&(t.user_id=e.user_id),e!=null&&e.tool_name&&(t.tool_name=e.tool_name),(e==null?void 0:e.is_error)!==void 0&&(t.is_error=e.is_error),e!=null&&e.since&&(t.since=e.since),e!=null&&e.limit&&(t.limit=e.limit),e!=null&&e.cursor&&(t.cursor=e.cursor);const n=new URLSearchParams(Object.entries(t).filter(([,r])=>r!==void 0).map(([r,a])=>[r,String(a)])).toString();return _e.get(`agent/activity${n?"?"+n:""}`)}})}const w2="/app/assets/crmy-logo-DWN0xBPW.png",kt={dashboard:{text:"text-[#14b8a6]",bg:"bg-[#14b8a6]/15",bar:"bg-[#14b8a6]"},contacts:{text:"text-primary",bg:"bg-primary/15",bar:"bg-primary"},accounts:{text:"text-[#8b5cf6]",bg:"bg-[#8b5cf6]/15",bar:"bg-[#8b5cf6]"},opportunities:{text:"text-accent",bg:"bg-accent/15",bar:"bg-accent"},useCases:{text:"text-success",bg:"bg-success/15",bar:"bg-success"},activities:{text:"text-warning",bg:"bg-warning/15",bar:"bg-warning"},assignments:{text:"text-destructive",bg:"bg-destructive/15",bar:"bg-destructive"},hitl:{text:"text-destructive",bg:"bg-destructive/15",bar:"bg-destructive"},agents:{text:"text-[#6366f1]",bg:"bg-[#6366f1]/15",bar:"bg-[#6366f1]"},context:{text:"text-[#0ea5e9]",bg:"bg-[#0ea5e9]/15",bar:"bg-[#0ea5e9]"}},W6=[{icon:Fc,label:"Memory Hub",path:"/",color:kt.dashboard},{icon:wc,label:"Approvals",path:"/hitl",color:kt.hitl},{icon:fn,label:"Agents",path:"/agents",color:kt.agents},{icon:vc,label:"Context",path:"/context",color:kt.context},{icon:Ff,label:"Handoffs",path:"/assignments",color:kt.assignments}],U6=[{icon:Ma,label:"Contacts",path:"/contacts",color:kt.contacts},{icon:Px,label:"Accounts",path:"/accounts",color:kt.accounts},{icon:nf,label:"Opportunities",path:"/opportunities",color:kt.opportunities},{icon:Tx,label:"Use Cases",path:"/use-cases",color:kt.useCases},{icon:yc,label:"Activities",path:"/activities",color:kt.activities}],H6=[{icon:PC,label:"Settings",path:"/settings"}];function vj({item:e,active:t,badge:n}){const{sidebarExpanded:r}=nt();return s.jsxs(Qn,{to:e.path,className:`group relative flex items-center gap-3 rounded-xl px-2.5 py-2.5 text-sm transition-all
|
|
517
|
+
${t?`${e.color.bg} ${e.color.text}`:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}`,title:r?void 0:e.label,children:[s.jsx(e.icon,{className:"w-5 h-5 flex-shrink-0"}),s.jsx(Cn,{children:r&&s.jsx(Fe.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},className:"whitespace-nowrap overflow-hidden font-medium flex-1",children:e.label})}),n!==void 0&&n>0&&s.jsx("span",{className:`flex-shrink-0 min-w-[18px] h-[18px] px-1 flex items-center justify-center rounded-full bg-destructive text-white text-[10px] font-bold ${r?"":"absolute -top-1 -right-1"}`,children:n>99?"99+":n}),t&&s.jsx(Fe.div,{layoutId:"sidebar-active",className:`absolute -left-2 top-2 w-[3px] h-6 ${e.color.bar} rounded-r-full`,transition:{type:"spring",damping:25,stiffness:300}}),!r&&s.jsx("div",{className:"absolute left-full ml-2 px-2.5 py-1.5 rounded-lg bg-popover text-popover-foreground text-xs shadow-lg opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity whitespace-nowrap z-50 font-medium",children:e.label})]})}function q6(){const e=nr(),{sidebarExpanded:t,setSidebarExpanded:n}=nt(),{hitlCount:r,assignCount:a}=O6();function l(u){return u==="/"?e.pathname==="/":e.pathname.startsWith(u)}function c(u){if(u==="/hitl")return r>0?r:void 0;if(u==="/assignments")return a>0?a:void 0}return s.jsxs(Fe.aside,{className:"hidden md:flex flex-col h-screen bg-sidebar border-r border-sidebar-border flex-shrink-0",animate:{width:t?220:56},transition:{duration:.2,ease:"easeInOut"},children:[s.jsxs("div",{className:"flex items-center h-14 px-3 gap-2 border-b border-sidebar-border",children:[s.jsx("img",{src:w2,alt:"CRMy",className:"w-8 h-8 flex-shrink-0 rounded-lg"}),s.jsx(Cn,{children:t&&s.jsx(Fe.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},className:"font-brand font-bold text-lg text-sidebar-accent-foreground whitespace-nowrap overflow-hidden",children:"CRMy"})})]}),s.jsxs("nav",{className:"flex-1 flex flex-col py-3 gap-1 px-2 overflow-y-auto",children:[W6.map(u=>s.jsx(vj,{item:u,active:l(u.path),badge:c(u.path)},u.path)),s.jsxs("div",{className:"mt-2 mb-1",children:[s.jsx("div",{className:"border-t border-sidebar-border"}),s.jsx(Cn,{children:t&&s.jsx(Fe.p,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"text-[10px] font-semibold text-muted-foreground/60 uppercase tracking-widest px-2.5 pt-2 pb-0.5",children:"Knowledge Base"})})]}),U6.map(u=>s.jsx(vj,{item:u,active:l(u.path)},u.path))]}),s.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-3 border-t border-sidebar-border pt-3",children:[H6.map(u=>{const f=e.pathname.startsWith(u.path);return s.jsxs(Qn,{to:u.path,className:`flex items-center gap-3 rounded-xl px-2.5 py-2.5 text-sm transition-all
|
|
518
|
+
${f?"bg-sidebar-primary/15 text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}`,title:t?void 0:u.label,children:[s.jsx(u.icon,{className:"w-5 h-5 flex-shrink-0"}),s.jsx(Cn,{children:t&&s.jsx(Fe.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},className:"whitespace-nowrap overflow-hidden font-medium",children:u.label})})]},u.path)}),s.jsx("button",{onClick:()=>n(!t),className:"flex items-center justify-center w-8 h-8 rounded-lg text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground mx-auto mt-1 transition-colors",children:t?s.jsx(wA,{className:"w-4 h-4"}):s.jsx(jA,{className:"w-4 h-4"})})]})]})}const K6=[{icon:Fc,label:"Hub",path:"/"},{icon:wc,label:"Approvals",path:"/hitl"},{icon:fn,label:"Agents",path:"/agents"},{icon:vc,label:"Context",path:"/context"},{icon:Ff,label:"Handoffs",path:"/assignments"}];function Y6(){const e=nr();return s.jsx("nav",{className:"md:hidden fixed bottom-0 left-0 right-0 z-40 flex items-center justify-around h-16 bg-card/95 backdrop-blur-md border-t border-border safe-area-bottom",children:K6.map(t=>{const n=t.path==="/"?e.pathname==="/":e.pathname.startsWith(t.path);return s.jsxs(Qn,{to:t.path,className:"relative flex flex-col items-center justify-center py-1 min-w-[56px] min-h-[44px]",children:[n&&s.jsx(Fe.div,{layoutId:"mobile-nav-pill",className:"absolute inset-x-1 -top-0.5 bottom-1 rounded-2xl bg-primary/10",transition:{type:"spring",damping:25,stiffness:300}}),s.jsx(t.icon,{className:`w-6 h-6 relative z-10 transition-colors ${n?"text-primary":"text-muted-foreground"}`}),n&&s.jsx(Fe.span,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"text-[10px] font-display font-semibold text-primary relative z-10 mt-0.5",children:t.label})]},t.path)})})}var bj=1,Q6=.9,G6=.8,X6=.17,Dp=.1,Rp=.999,Z6=.9999,J6=.99,e8=/[\\\/_+.#"@\[\(\{&]/,t8=/[\\\/_+.#"@\[\(\{&]/g,n8=/[\s-]/,j2=/[\s-]/g;function ig(e,t,n,r,a,l,c){if(l===t.length)return a===e.length?bj:J6;var u=`${a},${l}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(l),m=n.indexOf(f,a),p=0,g,v,y,k;m>=0;)g=ig(e,t,n,r,m+1,l+1,c),g>p&&(m===a?g*=bj:e8.test(e.charAt(m-1))?(g*=G6,y=e.slice(a,m-1).match(t8),y&&a>0&&(g*=Math.pow(Rp,y.length))):n8.test(e.charAt(m-1))?(g*=Q6,k=e.slice(a,m-1).match(j2),k&&a>0&&(g*=Math.pow(Rp,k.length))):(g*=X6,a>0&&(g*=Math.pow(Rp,m-a))),e.charAt(m)!==t.charAt(l)&&(g*=Z6)),(g<Dp&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(v=ig(e,t,n,r,m+1,l+2,c),v*Dp>g&&(g=v*Dp)),g>p&&(p=g),m=n.indexOf(f,m+1);return c[u]=p,p}function wj(e){return e.toLowerCase().replace(j2," ")}function r8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ig(e,t,wj(e),wj(t),0,0,{})}var Op="focusScope.autoFocusOnMount",Ip="focusScope.autoFocusOnUnmount",jj={bubbles:!1,cancelable:!0},s8="FocusScope",em=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[u,f]=x.useState(null),m=Mr(a),p=Mr(l),g=x.useRef(null),v=Je(t,j=>f(j)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let j=function(S){if(y.paused||!u)return;const E=S.target;u.contains(E)?g.current=E:mo(g.current,{select:!0})},N=function(S){if(y.paused||!u)return;const E=S.relatedTarget;E!==null&&(u.contains(E)||mo(g.current,{select:!0}))},_=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&mo(u)};document.addEventListener("focusin",j),document.addEventListener("focusout",N);const w=new MutationObserver(_);return u&&w.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),w.disconnect()}}},[r,u,y.paused]),x.useEffect(()=>{if(u){Cj.add(y);const j=document.activeElement;if(!u.contains(j)){const _=new CustomEvent(Op,jj);u.addEventListener(Op,m),u.dispatchEvent(_),_.defaultPrevented||(o8(u8(N2(u)),{select:!0}),document.activeElement===j&&mo(u))}return()=>{u.removeEventListener(Op,m),setTimeout(()=>{const _=new CustomEvent(Ip,jj);u.addEventListener(Ip,p),u.dispatchEvent(_),_.defaultPrevented||mo(j??document.body,{select:!0}),u.removeEventListener(Ip,p),Cj.remove(y)},0)}}},[u,m,p,y]);const k=x.useCallback(j=>{if(!n&&!r||y.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,_=document.activeElement;if(N&&_){const w=j.currentTarget,[S,E]=a8(w);S&&E?!j.shiftKey&&_===E?(j.preventDefault(),n&&mo(S,{select:!0})):j.shiftKey&&_===S&&(j.preventDefault(),n&&mo(E,{select:!0})):_===w&&j.preventDefault()}},[n,r,y.paused]);return s.jsx($e.div,{tabIndex:-1,...c,ref:v,onKeyDown:k})});em.displayName=s8;function o8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mo(r,{select:t}),document.activeElement!==n)return}function a8(e){const t=N2(e),n=Nj(t,e),r=Nj(t.reverse(),e);return[n,r]}function N2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nj(e,t){for(const n of e)if(!i8(n,{upTo:t}))return n}function i8(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 l8(e){return e instanceof HTMLInputElement&&"select"in e}function mo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&l8(e)&&t&&e.select()}}var Cj=c8();function c8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kj(e,t),e.unshift(t)},remove(t){var n;e=kj(e,t),(n=e[0])==null||n.resume()}}}function kj(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function u8(e){return e.filter(t=>t.tagName!=="A")}var Lp=0;function By(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sj()),document.body.insertAdjacentElement("beforeend",e[1]??Sj()),Lp++,()=>{Lp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lp--}},[])}function Sj(){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 ts=function(){return ts=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},ts.apply(this,arguments)};function C2(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function d8(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,l;r<a;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var qd="right-scroll-bar-position",Kd="width-before-scroll-bar",f8="with-scroll-bars-hidden",m8="--removed-body-scroll-bar-size";function Fp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function h8(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var p8=typeof window<"u"?x.useLayoutEffect:x.useEffect,_j=new WeakMap;function x8(e,t){var n=h8(null,function(r){return e.forEach(function(a){return Fp(a,r)})});return p8(function(){var r=_j.get(n);if(r){var a=new Set(r),l=new Set(e),c=n.current;a.forEach(function(u){l.has(u)||Fp(u,null)}),l.forEach(function(u){a.has(u)||Fp(u,c)})}_j.set(n,e)},[e]),n}function g8(e){return e}function y8(e,t){t===void 0&&(t=g8);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(l),c=n}var f=function(){var p=c;c=[],p.forEach(l)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(p){c.push(p),m()},filter:function(p){return c=c.filter(p),n}}}};return a}function v8(e){e===void 0&&(e={});var t=y8(null);return t.options=ts({async:!0,ssr:!1},e),t}var k2=function(e){var t=e.sideCar,n=C2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ts({},n))};k2.isSideCarExport=!0;function b8(e,t){return e.useMedium(t),k2}var S2=v8(),$p=function(){},tm=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:$p,onWheelCapture:$p,onTouchMoveCapture:$p}),a=r[0],l=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,y=e.noRelative,k=e.noIsolation,j=e.inert,N=e.allowPinchZoom,_=e.as,w=_===void 0?"div":_,S=e.gapMode,E=C2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=v,T=x8([n,t]),M=ts(ts({},E),a);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:S2,removeScrollBar:m,shards:g,noRelative:y,noIsolation:k,inert:j,setCallbacks:l,allowPinchZoom:!!N,lockRef:n,gapMode:S}),c?x.cloneElement(x.Children.only(u),ts(ts({},M),{ref:T})):x.createElement(w,ts({},M,{className:f,ref:T}),u))});tm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tm.classNames={fullWidth:Kd,zeroRight:qd};var w8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function j8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=w8();return t&&e.setAttribute("nonce",t),e}function N8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function C8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var k8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=j8())&&(N8(t,n),C8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},S8=function(){var e=k8();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_2=function(){var e=S8(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},_8={left:0,top:0,right:0,gap:0},Vp=function(e){return parseInt(e||"",10)||0},E8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Vp(n),Vp(r),Vp(a)]},P8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _8;var t=E8(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])}},T8=_2(),Si="data-scroll-locked",A8=function(e,t,n,r){var a=e.left,l=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
519
|
+
.`.concat(f8,` {
|
|
520
|
+
overflow: hidden `).concat(r,`;
|
|
521
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
522
|
+
}
|
|
523
|
+
body[`).concat(Si,`] {
|
|
524
|
+
overflow: hidden `).concat(r,`;
|
|
525
|
+
overscroll-behavior: contain;
|
|
526
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
527
|
+
padding-left: `.concat(a,`px;
|
|
528
|
+
padding-top: `).concat(l,`px;
|
|
529
|
+
padding-right: `).concat(c,`px;
|
|
530
|
+
margin-left:0;
|
|
531
|
+
margin-top:0;
|
|
532
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
533
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.`).concat(qd,` {
|
|
537
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.`).concat(Kd,` {
|
|
541
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.`).concat(qd," .").concat(qd,` {
|
|
545
|
+
right: 0 `).concat(r,`;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.`).concat(Kd," .").concat(Kd,` {
|
|
549
|
+
margin-right: 0 `).concat(r,`;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
body[`).concat(Si,`] {
|
|
553
|
+
`).concat(m8,": ").concat(u,`px;
|
|
554
|
+
}
|
|
555
|
+
`)},Ej=function(){var e=parseInt(document.body.getAttribute(Si)||"0",10);return isFinite(e)?e:0},M8=function(){x.useEffect(function(){return document.body.setAttribute(Si,(Ej()+1).toString()),function(){var e=Ej()-1;e<=0?document.body.removeAttribute(Si):document.body.setAttribute(Si,e.toString())}},[])},D8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;M8();var l=x.useMemo(function(){return P8(a)},[a]);return x.createElement(T8,{styles:A8(l,!t,a,n?"":"!important")})},lg=!1;if(typeof window<"u")try{var wd=Object.defineProperty({},"passive",{get:function(){return lg=!0,!0}});window.addEventListener("test",wd,wd),window.removeEventListener("test",wd,wd)}catch{lg=!1}var di=lg?{passive:!1}:!1,R8=function(e){return e.tagName==="TEXTAREA"},E2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!R8(e)&&n[t]==="visible")},O8=function(e){return E2(e,"overflowY")},I8=function(e){return E2(e,"overflowX")},Pj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=P2(e,r);if(a){var l=T2(e,r),c=l[1],u=l[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},L8=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},F8=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},P2=function(e,t){return e==="v"?O8(t):I8(t)},T2=function(e,t){return e==="v"?L8(t):F8(t)},$8=function(e,t){return e==="h"&&t==="rtl"?-1:1},V8=function(e,t,n,r,a){var l=$8(e,window.getComputedStyle(t).direction),c=l*r,u=n.target,f=t.contains(u),m=!1,p=c>0,g=0,v=0;do{if(!u)break;var y=T2(e,u),k=y[0],j=y[1],N=y[2],_=j-N-l*k;(k||_)&&P2(e,u)&&(g+=_,v+=k);var w=u.parentNode;u=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(m=!0),m},jd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tj=function(e){return[e.deltaX,e.deltaY]},Aj=function(e){return e&&"current"in e?e.current:e},B8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},z8=function(e){return`
|
|
556
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
557
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
558
|
+
`)},W8=0,fi=[];function U8(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(W8++)[0],l=x.useState(_2)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=d8([e.lockRef.current],(e.shards||[]).map(Aj),!0).filter(Boolean);return j.forEach(function(N){return N.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(j,N){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var _=jd(j),w=n.current,S="deltaX"in j?j.deltaX:w[0]-_[0],E="deltaY"in j?j.deltaY:w[1]-_[1],P,T=j.target,M=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in j&&M==="h"&&T.type==="range")return!1;var D=window.getSelection(),q=D&&D.anchorNode,H=q?q===T||q.contains(T):!1;if(H)return!1;var I=Pj(M,T);if(!I)return!0;if(I?P=M:(P=M==="v"?"h":"v",I=Pj(M,T)),!I)return!1;if(!r.current&&"changedTouches"in j&&(S||E)&&(r.current=P),!P)return!0;var F=r.current||P;return V8(F,N,j,F==="h"?S:E)},[]),f=x.useCallback(function(j){var N=j;if(!(!fi.length||fi[fi.length-1]!==l)){var _="deltaY"in N?Tj(N):jd(N),w=t.current.filter(function(P){return P.name===N.type&&(P.target===N.target||N.target===P.shadowParent)&&B8(P.delta,_)})[0];if(w&&w.should){N.cancelable&&N.preventDefault();return}if(!w){var S=(c.current.shards||[]).map(Aj).filter(Boolean).filter(function(P){return P.contains(N.target)}),E=S.length>0?u(N,S[0]):!c.current.noIsolation;E&&N.cancelable&&N.preventDefault()}}},[]),m=x.useCallback(function(j,N,_,w){var S={name:j,delta:N,target:_,should:w,shadowParent:H8(_)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),p=x.useCallback(function(j){n.current=jd(j),r.current=void 0},[]),g=x.useCallback(function(j){m(j.type,Tj(j),j.target,u(j,e.lockRef.current))},[]),v=x.useCallback(function(j){m(j.type,jd(j),j.target,u(j,e.lockRef.current))},[]);x.useEffect(function(){return fi.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,di),document.addEventListener("touchmove",f,di),document.addEventListener("touchstart",p,di),function(){fi=fi.filter(function(j){return j!==l}),document.removeEventListener("wheel",f,di),document.removeEventListener("touchmove",f,di),document.removeEventListener("touchstart",p,di)}},[]);var y=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(l,{styles:z8(a)}):null,y?x.createElement(D8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H8(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const q8=b8(S2,U8);var nm=x.forwardRef(function(e,t){return x.createElement(tm,ts({},e,{ref:t,sideCar:q8}))});nm.classNames=tm.classNames;var K8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mi=new WeakMap,Nd=new WeakMap,Cd={},Bp=0,A2=function(e){return e&&(e.host||A2(e.parentNode))},Y8=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=A2(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})},Q8=function(e,t,n,r){var a=Y8(t,Array.isArray(e)?e:[e]);Cd[n]||(Cd[n]=new WeakMap);var l=Cd[n],c=[],u=new Set,f=new Set(a),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};a.forEach(m);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(u.has(v))p(v);else try{var y=v.getAttribute(r),k=y!==null&&y!=="false",j=(mi.get(v)||0)+1,N=(l.get(v)||0)+1;mi.set(v,j),l.set(v,N),c.push(v),j===1&&k&&Nd.set(v,!0),N===1&&v.setAttribute(n,"true"),k||v.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",v,_)}})};return p(t),u.clear(),Bp++,function(){c.forEach(function(g){var v=mi.get(g)-1,y=l.get(g)-1;mi.set(g,v),l.set(g,y),v||(Nd.has(g)||g.removeAttribute(r),Nd.delete(g)),y||g.removeAttribute(n)}),Bp--,Bp||(mi=new WeakMap,mi=new WeakMap,Nd=new WeakMap,Cd={})}},zy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=K8(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Q8(r,a,n,"aria-hidden")):function(){return null}};function G8(e){const t=X8(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,u=x.Children.toArray(l),f=u.find(J8);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function X8(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=t9(a),u=e9(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z8=Symbol("radix.slottable");function J8(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z8}function e9(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function t9(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rm="Dialog",[M2]=Os(rm),[n9,Br]=M2(rm),D2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=x.useRef(null),f=x.useRef(null),[m,p]=Aa({prop:r,defaultProp:a??!1,onChange:l,caller:rm});return s.jsx(n9,{scope:t,triggerRef:u,contentRef:f,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:m,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(g=>!g),[p]),modal:c,children:n})};D2.displayName=rm;var R2="DialogTrigger",r9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Br(R2,n),l=Je(t,a.triggerRef);return s.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Hy(a.open),...r,ref:l,onClick:Ie(e.onClick,a.onOpenToggle)})});r9.displayName=R2;var Wy="DialogPortal",[s9,O2]=M2(Wy,{forceMount:void 0}),I2=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,l=Br(Wy,t);return s.jsx(s9,{scope:t,forceMount:n,children:x.Children.map(r,c=>s.jsx(Is,{present:n||l.open,children:s.jsx(Ic,{asChild:!0,container:a,children:c})}))})};I2.displayName=Wy;var wf="DialogOverlay",L2=x.forwardRef((e,t)=>{const n=O2(wf,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,l=Br(wf,e.__scopeDialog);return l.modal?s.jsx(Is,{present:r||l.open,children:s.jsx(a9,{...a,ref:t})}):null});L2.displayName=wf;var o9=G8("DialogOverlay.RemoveScroll"),a9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Br(wf,n);return s.jsx(nm,{as:o9,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx($e.div,{"data-state":Hy(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ra="DialogContent",F2=x.forwardRef((e,t)=>{const n=O2(Ra,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,l=Br(Ra,e.__scopeDialog);return s.jsx(Is,{present:r||l.open,children:l.modal?s.jsx(i9,{...a,ref:t}):s.jsx(l9,{...a,ref:t})})});F2.displayName=Ra;var i9=x.forwardRef((e,t)=>{const n=Br(Ra,e.__scopeDialog),r=x.useRef(null),a=Je(t,n.contentRef,r);return x.useEffect(()=>{const l=r.current;if(l)return zy(l)},[]),s.jsx($2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&l.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,l=>l.preventDefault())})}),l9=x.forwardRef((e,t)=>{const n=Br(Ra,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return s.jsx($2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),$2=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,u=Br(Ra,n),f=x.useRef(null),m=Je(t,f);return By(),s.jsxs(s.Fragment,{children:[s.jsx(em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:l,children:s.jsx(Zi,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Hy(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(f9,{titleId:u.titleId}),s.jsx(h9,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Uy="DialogTitle",c9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Br(Uy,n);return s.jsx($e.h2,{id:a.titleId,...r,ref:t})});c9.displayName=Uy;var V2="DialogDescription",u9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Br(V2,n);return s.jsx($e.p,{id:a.descriptionId,...r,ref:t})});u9.displayName=V2;var B2="DialogClose",d9=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Br(B2,n);return s.jsx($e.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>a.onOpenChange(!1))})});d9.displayName=B2;function Hy(e){return e?"open":"closed"}var z2="DialogTitleWarning",[MH,W2]=l4(z2,{contentName:Ra,titleName:Uy,docsSlug:"dialog"}),f9=({titleId:e})=>{const t=W2(z2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
559
|
+
|
|
560
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
561
|
+
|
|
562
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},m9="DialogDescriptionWarning",h9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W2(m9).contentName}}.`;return x.useEffect(()=>{var l;const a=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},p9=D2,x9=I2,g9=L2,y9=F2,Gl='[cmdk-group=""]',zp='[cmdk-group-items=""]',v9='[cmdk-group-heading=""]',U2='[cmdk-item=""]',Mj=`${U2}:not([aria-disabled="true"])`,cg="cmdk-item-select",gi="data-value",b9=(e,t,n)=>r8(e,t,n),H2=x.createContext(void 0),Yc=()=>x.useContext(H2),q2=x.createContext(void 0),qy=()=>x.useContext(q2),K2=x.createContext(void 0),Y2=x.forwardRef((e,t)=>{let n=yi(()=>{var L,G;return{search:"",value:(G=(L=e.value)!=null?L:e.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=yi(()=>new Set),a=yi(()=>new Map),l=yi(()=>new Map),c=yi(()=>new Set),u=Q2(e),{label:f,children:m,value:p,onValueChange:g,filter:v,shouldFilter:y,loop:k,disablePointerSelection:j=!1,vimBindings:N=!0,..._}=e,w=Xn(),S=Xn(),E=Xn(),P=x.useRef(null),T=A9();Oa(()=>{if(p!==void 0){let L=p.trim();n.current.value=L,M.emit()}},[p]),Oa(()=>{T(6,te)},[]);let M=x.useMemo(()=>({subscribe:L=>(c.current.add(L),()=>c.current.delete(L)),snapshot:()=>n.current,setState:(L,G,se)=>{var ae,ue,oe,he;if(!Object.is(n.current[L],G)){if(n.current[L]=G,L==="search")F(),H(),T(1,I);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ge=document.getElementById(E);ge?ge.focus():(ae=document.getElementById(w))==null||ae.focus()}if(T(7,()=>{var ge;n.current.selectedItemId=(ge=Y())==null?void 0:ge.id,M.emit()}),se||T(5,te),((ue=u.current)==null?void 0:ue.value)!==void 0){let ge=G??"";(he=(oe=u.current).onValueChange)==null||he.call(oe,ge);return}}M.emit()}},emit:()=>{c.current.forEach(L=>L())}}),[]),D=x.useMemo(()=>({value:(L,G,se)=>{var ae;G!==((ae=l.current.get(L))==null?void 0:ae.value)&&(l.current.set(L,{value:G,keywords:se}),n.current.filtered.items.set(L,q(G,se)),T(2,()=>{H(),M.emit()}))},item:(L,G)=>(r.current.add(L),G&&(a.current.has(G)?a.current.get(G).add(L):a.current.set(G,new Set([L]))),T(3,()=>{F(),H(),n.current.value||I(),M.emit()}),()=>{l.current.delete(L),r.current.delete(L),n.current.filtered.items.delete(L);let se=Y();T(4,()=>{F(),(se==null?void 0:se.getAttribute("id"))===L&&I(),M.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{l.current.delete(L),a.current.delete(L)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:w,inputId:E,labelId:S,listInnerRef:P}),[]);function q(L,G){var se,ae;let ue=(ae=(se=u.current)==null?void 0:se.filter)!=null?ae:b9;return L?ue(L,n.current.search,G):0}function H(){if(!n.current.search||u.current.shouldFilter===!1)return;let L=n.current.filtered.items,G=[];n.current.filtered.groups.forEach(ae=>{let ue=a.current.get(ae),oe=0;ue.forEach(he=>{let ge=L.get(he);oe=Math.max(ge,oe)}),G.push([ae,oe])});let se=P.current;O().sort((ae,ue)=>{var oe,he;let ge=ae.getAttribute("id"),Ce=ue.getAttribute("id");return((oe=L.get(Ce))!=null?oe:0)-((he=L.get(ge))!=null?he:0)}).forEach(ae=>{let ue=ae.closest(zp);ue?ue.appendChild(ae.parentElement===ue?ae:ae.closest(`${zp} > *`)):se.appendChild(ae.parentElement===se?ae:ae.closest(`${zp} > *`))}),G.sort((ae,ue)=>ue[1]-ae[1]).forEach(ae=>{var ue;let oe=(ue=P.current)==null?void 0:ue.querySelector(`${Gl}[${gi}="${encodeURIComponent(ae[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function I(){let L=O().find(se=>se.getAttribute("aria-disabled")!=="true"),G=L==null?void 0:L.getAttribute(gi);M.setState("value",G||void 0)}function F(){var L,G,se,ae;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let oe of r.current){let he=(G=(L=l.current.get(oe))==null?void 0:L.value)!=null?G:"",ge=(ae=(se=l.current.get(oe))==null?void 0:se.keywords)!=null?ae:[],Ce=q(he,ge);n.current.filtered.items.set(oe,Ce),Ce>0&&ue++}for(let[oe,he]of a.current)for(let ge of he)if(n.current.filtered.items.get(ge)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=ue}function te(){var L,G,se;let ae=Y();ae&&(((L=ae.parentElement)==null?void 0:L.firstChild)===ae&&((se=(G=ae.closest(Gl))==null?void 0:G.querySelector(v9))==null||se.scrollIntoView({block:"nearest"})),ae.scrollIntoView({block:"nearest"}))}function Y(){var L;return(L=P.current)==null?void 0:L.querySelector(`${U2}[aria-selected="true"]`)}function O(){var L;return Array.from(((L=P.current)==null?void 0:L.querySelectorAll(Mj))||[])}function U(L){let G=O()[L];G&&M.setState("value",G.getAttribute(gi))}function $(L){var G;let se=Y(),ae=O(),ue=ae.findIndex(he=>he===se),oe=ae[ue+L];(G=u.current)!=null&&G.loop&&(oe=ue+L<0?ae[ae.length-1]:ue+L===ae.length?ae[0]:ae[ue+L]),oe&&M.setState("value",oe.getAttribute(gi))}function R(L){let G=Y(),se=G==null?void 0:G.closest(Gl),ae;for(;se&&!ae;)se=L>0?P9(se,Gl):T9(se,Gl),ae=se==null?void 0:se.querySelector(Mj);ae?M.setState("value",ae.getAttribute(gi)):$(L)}let z=()=>U(O().length-1),X=L=>{L.preventDefault(),L.metaKey?z():L.altKey?R(1):$(1)},B=L=>{L.preventDefault(),L.metaKey?U(0):L.altKey?R(-1):$(-1)};return x.createElement($e.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:L=>{var G;(G=_.onKeyDown)==null||G.call(_,L);let se=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||se))switch(L.key){case"n":case"j":{N&&L.ctrlKey&&X(L);break}case"ArrowDown":{X(L);break}case"p":case"k":{N&&L.ctrlKey&&B(L);break}case"ArrowUp":{B(L);break}case"Home":{L.preventDefault(),U(0);break}case"End":{L.preventDefault(),z();break}case"Enter":{L.preventDefault();let ae=Y();if(ae){let ue=new Event(cg);ae.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:D9},f),sm(e,L=>x.createElement(q2.Provider,{value:M},x.createElement(H2.Provider,{value:D},L))))}),w9=x.forwardRef((e,t)=>{var n,r;let a=Xn(),l=x.useRef(null),c=x.useContext(K2),u=Yc(),f=Q2(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Oa(()=>{if(!m)return u.item(a,c==null?void 0:c.id)},[m]);let p=G2(a,l,[e.value,e.children,l],e.keywords),g=qy(),v=Io(T=>T.value&&T.value===p.current),y=Io(T=>m||u.filter()===!1?!0:T.search?T.filtered.items.get(a)>0:!0);x.useEffect(()=>{let T=l.current;if(!(!T||e.disabled))return T.addEventListener(cg,k),()=>T.removeEventListener(cg,k)},[y,e.onSelect,e.disabled]);function k(){var T,M;j(),(M=(T=f.current).onSelect)==null||M.call(T,p.current)}function j(){g.setState("value",p.current,!0)}if(!y)return null;let{disabled:N,value:_,onSelect:w,forceMount:S,keywords:E,...P}=e;return x.createElement($e.div,{ref:mr(l,t),...P,id:a,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!v,"data-disabled":!!N,"data-selected":!!v,onPointerMove:N||u.getDisablePointerSelection()?void 0:j,onClick:N?void 0:k},e.children)}),j9=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...l}=e,c=Xn(),u=x.useRef(null),f=x.useRef(null),m=Xn(),p=Yc(),g=Io(y=>a||p.filter()===!1?!0:y.search?y.filtered.groups.has(c):!0);Oa(()=>p.group(c),[]),G2(c,u,[e.value,e.heading,f]);let v=x.useMemo(()=>({id:c,forceMount:a}),[a]);return x.createElement($e.div,{ref:mr(u,t),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),sm(e,y=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},x.createElement(K2.Provider,{value:v},y))))}),N9=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),l=Io(c=>!c.search);return!n&&!l?null:x.createElement($e.div,{ref:mr(a,t),...r,"cmdk-separator":"",role:"separator"})}),C9=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,l=qy(),c=Io(m=>m.search),u=Io(m=>m.selectedItemId),f=Yc();return x.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),x.createElement($e.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:a?e.value:c,onChange:m=>{a||l.setState("search",m.target.value),n==null||n(m.target.value)}})}),k9=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,l=x.useRef(null),c=x.useRef(null),u=Io(m=>m.selectedItemId),f=Yc();return x.useEffect(()=>{if(c.current&&l.current){let m=c.current,p=l.current,g,v=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let y=m.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return v.observe(m),()=>{cancelAnimationFrame(g),v.unobserve(m)}}},[]),x.createElement($e.div,{ref:mr(l,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},sm(e,m=>x.createElement("div",{ref:mr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),S9=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:l,container:c,...u}=e;return x.createElement(p9,{open:n,onOpenChange:r},x.createElement(x9,{container:c},x.createElement(g9,{"cmdk-overlay":"",className:a}),x.createElement(y9,{"aria-label":e.label,"cmdk-dialog":"",className:l},x.createElement(Y2,{ref:t,...u}))))}),_9=x.forwardRef((e,t)=>Io(n=>n.filtered.count===0)?x.createElement($e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),E9=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...l}=e;return x.createElement($e.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},sm(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),qt=Object.assign(Y2,{List:k9,Item:w9,Input:C9,Group:j9,Separator:N9,Dialog:S9,Empty:_9,Loading:E9});function P9(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function T9(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Q2(e){let t=x.useRef(e);return Oa(()=>{t.current=e}),t}var Oa=typeof window>"u"?x.useEffect:x.useLayoutEffect;function yi(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Io(e){let t=qy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function G2(e,t,n,r=[]){let a=x.useRef(),l=Yc();return Oa(()=>{var c;let u=(()=>{var m;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(m=p.current.textContent)==null?void 0:m.trim():a.current}})(),f=r.map(m=>m.trim());l.value(e,u,f),(c=t.current)==null||c.setAttribute(gi,u),a.current=u}),a}var A9=()=>{let[e,t]=x.useState(),n=yi(()=>new Map);return Oa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function M9(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function sm({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(M9(t),{ref:t.ref},n(t.props.children)):n(t)}var D9={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Dj=[{bg:"#FB990C"},{bg:"#F8BB59"},{bg:"#C94408"},{bg:"#FDBA74",dark:!0},{bg:"#F59E0B"},{bg:"#EA580C"},{bg:"#FED7AA",dark:!0},{bg:"#FCF1C1",dark:!0}];function R9(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}function O9(e){var n;const t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():(((n=t[0])==null?void 0:n[0])??"?").toUpperCase()}function Ds({name:e,className:t,textClassName:n}){const r=e||"?",a=Dj[R9(r)%Dj.length],l=O9(r);return s.jsx("div",{className:Oe("flex items-center justify-center flex-shrink-0 rounded-xl",t),style:{backgroundColor:a.bg},children:s.jsx("span",{className:Oe("font-display font-bold select-none",a.dark?"text-[#2A2A2E]":"text-white",n),children:r==="?"?"?":l})})}const Wp=768;function om(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Wp-1}px)`),r=()=>{t(window.innerWidth<Wp)};return n.addEventListener("change",r),t(window.innerWidth<Wp),()=>n.removeEventListener("change",r)},[]),!!e}function I9(){const{commandPaletteOpen:e,setCommandPaletteOpen:t,openDrawer:n}=nt(),r=on(),a=x.useRef(null),l=om(),[c,u]=x.useState(""),{data:f}=w6(c),m=(f==null?void 0:f.contacts)??[],p=(f==null?void 0:f.accounts)??[],g=(f==null?void 0:f.opportunities)??[],v=(f==null?void 0:f.activities)??[],y=(f==null?void 0:f.useCases)??[],k=(f==null?void 0:f.assignments)??[];x.useEffect(()=>{e?setTimeout(()=>{var w;return(w=a.current)==null?void 0:w.focus()},50):u("")},[e]);const j=w=>{w(),t(!1)},N=Oe("flex items-center gap-3 px-2 py-2 rounded-md text-sm text-foreground cursor-pointer","data-[selected=true]:bg-primary/15 data-[selected=true]:text-primary",l&&"py-3 px-3"),_=s.jsxs(qt,{className:"bg-card border-x border-border shadow-2xl overflow-hidden",shouldFilter:!1,children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 border-b border-border",children:[s.jsx(el,{className:"w-4 h-4 text-muted-foreground"}),s.jsx(qt.Input,{ref:a,value:c,onValueChange:u,placeholder:"Search contacts, opportunities, or type a command...",className:"flex-1 py-3 text-sm bg-transparent text-foreground placeholder:text-muted-foreground outline-none"})]}),s.jsxs(qt.List,{className:"max-h-[60vh] overflow-y-auto p-2",children:[s.jsx(qt.Empty,{className:"py-6 text-center text-sm text-muted-foreground",children:"No results found."}),!c&&s.jsx(qt.Group,{heading:"Pages",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:[{label:"Dashboard",icon:pA,path:"/",color:kt.dashboard},{label:"Contacts",icon:Ma,path:"/contacts",color:kt.contacts},{label:"Accounts",icon:Px,path:"/accounts",color:kt.accounts},{label:"Opportunities",icon:nf,path:"/opportunities",color:kt.opportunities},{label:"Use Cases",icon:Tx,path:"/use-cases",color:kt.useCases},{label:"Activities",icon:yc,path:"/activities",color:kt.activities},{label:"Assignments",icon:rf,path:"/assignments",color:kt.assignments},{label:"Settings",icon:PC,path:"/settings",color:null}].map(w=>{var S;return s.jsxs(qt.Item,{value:w.label,onSelect:()=>j(()=>r(w.path)),className:N,children:[s.jsx(w.icon,{className:Oe("w-4 h-4",((S=w.color)==null?void 0:S.text)??"text-muted-foreground")}),w.label]},w.path)})}),m.length>0&&s.jsx(qt.Group,{heading:"Contacts",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:m.slice(0,5).map(w=>s.jsxs(qt.Item,{value:`${w.name} ${w.company} ${w.email}`,onSelect:()=>j(()=>{r("/contacts"),n("contact",w.id)}),className:N,children:[s.jsx(Ds,{name:w.name,className:"w-5 h-5 rounded-full text-[8px]"}),s.jsx("span",{children:w.name}),w.company&&s.jsxs("span",{className:"text-muted-foreground text-xs",children:["— ",w.company]})]},w.id))}),p.length>0&&s.jsx(qt.Group,{heading:"Accounts",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:p.slice(0,5).map(w=>s.jsxs(qt.Item,{value:`${w.name} ${w.domain??""}`,onSelect:()=>j(()=>{r("/accounts"),n("account",w.id)}),className:N,children:[s.jsx(Px,{className:Oe("w-4 h-4",kt.accounts.text)}),s.jsx("span",{children:w.name}),w.domain&&s.jsxs("span",{className:"text-muted-foreground text-xs",children:["— ",w.domain]})]},w.id))}),g.length>0&&s.jsx(qt.Group,{heading:"Opportunities",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:g.slice(0,5).map(w=>s.jsxs(qt.Item,{value:`${w.name} ${w.contact_name}`,onSelect:()=>j(()=>{r("/opportunities"),n("opportunity",w.id)}),className:N,children:[s.jsx(nf,{className:Oe("w-4 h-4",kt.opportunities.text)}),s.jsx("span",{children:w.name}),w.amount&&s.jsxs("span",{className:"text-muted-foreground text-xs ml-auto",children:["$",(w.amount/1e3).toFixed(0),"K"]})]},w.id))}),v.length>0&&s.jsx(qt.Group,{heading:"Activities",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:v.slice(0,5).map(w=>{var S;return s.jsxs(qt.Item,{value:`${w.body??""} ${w.activity_type??""}`,onSelect:()=>j(()=>r("/activities")),className:N,children:[s.jsx(yc,{className:Oe("w-4 h-4",kt.activities.text)}),s.jsx("span",{className:"truncate",children:(S=w.body)==null?void 0:S.slice(0,60)})]},w.id)})}),y.length>0&&s.jsx(qt.Group,{heading:"Use Cases",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:y.slice(0,5).map(w=>s.jsxs(qt.Item,{value:`${w.name??""}`,onSelect:()=>j(()=>r("/use-cases")),className:N,children:[s.jsx(Tx,{className:Oe("w-4 h-4",kt.useCases.text)}),s.jsx("span",{children:w.name})]},w.id))}),k.length>0&&s.jsx(qt.Group,{heading:"Assignments",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:k.slice(0,5).map(w=>s.jsxs(qt.Item,{value:`${w.title??""}`,onSelect:()=>j(()=>r("/assignments")),className:N,children:[s.jsx(rf,{className:Oe("w-4 h-4",kt.assignments.text)}),s.jsx("span",{children:w.title})]},w.id))})]}),!l&&s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-border text-xs text-muted-foreground",children:[s.jsx("span",{children:"Navigate with ↑↓ · Select with ↵"}),s.jsx("span",{children:"ESC to close"})]})]});return s.jsx(Cn,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(Fe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[70] bg-black/60 backdrop-blur-sm",onClick:()=>t(!1)}),l?s.jsxs(Fe.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed left-0 right-0 bottom-0 z-[70] flex flex-col max-h-[85vh]",children:[s.jsx("div",{className:"flex justify-center py-2 bg-card rounded-t-2xl border-t border-x border-border",children:s.jsx("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/20"})}),_]}):s.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center px-4 pointer-events-none",children:s.jsx(Fe.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:{duration:.15},className:"w-full max-w-2xl pointer-events-auto",children:s.jsx("div",{className:"rounded-2xl overflow-hidden border border-border shadow-2xl",children:_})})})]})})}const L9=[{group:"Global",items:[{keys:["⌘","K"],label:"Command palette"},{keys:["⌘","⇧","A"],label:"AI Agent panel"},{keys:["⌘","⇧","Z"],label:"Zen mode"},{keys:["?"],label:"Keyboard shortcuts"},{keys:["Esc"],label:"Close drawer / modal"}]},{group:"Navigation",items:[{keys:["G","H"],label:"Go to Dashboard"},{keys:["G","C"],label:"Go to Contacts"},{keys:["G","D"],label:"Go to Opportunities"}]}];function F9(){const{shortcutsOpen:e,setShortcutsOpen:t}=nt();return s.jsx(Cn,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(Fe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",onClick:()=>t(!1)}),s.jsxs(Fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 w-full max-w-md bg-card border border-border rounded-lg shadow-2xl p-6",children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground mb-4",children:"Keyboard Shortcuts"}),L9.map(n=>s.jsxs("div",{className:"mb-4",children:[s.jsx("h3",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider mb-2",children:n.group}),s.jsx("div",{className:"space-y-2",children:n.items.map(r=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm text-foreground",children:r.label}),s.jsx("div",{className:"flex gap-1",children:r.keys.map(a=>s.jsx("kbd",{className:"px-1.5 py-0.5 text-xs font-mono bg-muted text-muted-foreground rounded border border-border",children:a},a))})]},r.label))})]},n.group)),s.jsxs("p",{className:"text-xs text-muted-foreground mt-4",children:["Press ",s.jsx("kbd",{className:"px-1 py-0.5 text-xs font-mono bg-muted rounded border border-border",children:"Esc"})," to close"]})]})]})})}function $9({children:e,title:t}){const{drawerOpen:n,closeDrawer:r}=nt();return s.jsx(Cn,{children:n&&s.jsxs(s.Fragment,{children:[s.jsx(Fe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[65] bg-foreground/20 backdrop-blur-sm",onClick:r}),s.jsxs(Fe.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"hidden md:flex fixed right-0 top-0 h-full w-[480px] z-[70] bg-card border-l border-border shadow-2xl flex-col rounded-l-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between h-14 px-5 border-b border-border",children:[t&&s.jsx("h2",{className:"font-display font-bold text-foreground",children:t}),s.jsx("button",{onClick:r,className:"ml-auto p-2 rounded-xl hover:bg-muted text-muted-foreground transition-colors",children:s.jsx(Sn,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:e})]}),s.jsxs(Fe.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"md:hidden fixed left-0 right-0 bottom-0 z-[70] bg-card border-t border-border shadow-2xl flex flex-col rounded-t-3xl max-h-[90vh]",children:[s.jsx("div",{className:"flex justify-center py-2",children:s.jsx("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/20"})}),s.jsxs("div",{className:"flex items-center justify-between px-5 pb-3 border-b border-border",children:[t&&s.jsx("h2",{className:"font-display font-bold text-foreground",children:t}),s.jsx("button",{onClick:r,className:"ml-auto p-2 rounded-xl hover:bg-muted text-muted-foreground transition-colors",children:s.jsx(Sn,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto pb-safe",children:e})]})]})})}const X2=x.createContext({enabled:!1,config:null,loading:!0});function V9({children:e}){const{data:t,isLoading:n}=b2(),r=(t==null?void 0:t.data)??null,a=(r==null?void 0:r.enabled)??!1;return s.jsx(X2.Provider,{value:{enabled:a,config:r,loading:n},children:e})}function hr(){return x.useContext(X2)}function Me(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function lt(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function nn(e,t){const n=Me(e);return isNaN(t)?lt(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Or(e,t){const n=Me(e);if(isNaN(t))return lt(e,NaN);if(!t)return n;const r=n.getDate(),a=lt(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const l=a.getDate();return r>=l?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}const Ky=6048e5,B9=864e5,Yy=6e4,Qy=36e5,z9=1e3,kd=43200,Rj=1440;let W9={};function Wo(){return W9}function tr(e,t){var u,f,m,p;const n=Wo(),r=(t==null?void 0:t.weekStartsOn)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,a=Me(e),l=a.getDay(),c=(l<r?7:0)+l-r;return a.setDate(a.getDate()-c),a.setHours(0,0,0,0),a}function Rs(e){return tr(e,{weekStartsOn:1})}function Z2(e){const t=Me(e),n=t.getFullYear(),r=lt(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=Rs(r),l=lt(e,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const c=Rs(l);return t.getTime()>=a.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function Hi(e){const t=Me(e);return t.setHours(0,0,0,0),t}function Lo(e){const t=Me(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function os(e,t){const n=Hi(e),r=Hi(t),a=+n-Lo(n),l=+r-Lo(r);return Math.round((a-l)/B9)}function U9(e){const t=Z2(e),n=lt(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Rs(n)}function ug(e,t){const n=t*7;return nn(e,n)}function H9(e,t){return Or(e,t*12)}function q9(e){let t;return e.forEach(function(n){const r=Me(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function K9(e){let t;return e.forEach(n=>{const r=Me(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Yd(e,t){const n=Me(e),r=Me(t),a=n.getTime()-r.getTime();return a<0?-1:a>0?1:a}function Y9(e){return lt(e,Date.now())}function Vn(e,t){const n=Hi(e),r=Hi(t);return+n==+r}function Gy(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Xy(e){if(!Gy(e)&&typeof e!="number")return!1;const t=Me(e);return!isNaN(Number(t))}function qi(e,t){const n=Me(e),r=Me(t),a=n.getFullYear()-r.getFullYear(),l=n.getMonth()-r.getMonth();return a*12+l}function Q9(e,t,n){const r=tr(e,n),a=tr(t,n),l=+r-Lo(r),c=+a-Lo(a);return Math.round((l-c)/Ky)}function G9(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function X9(e,t){return+Me(e)-+Me(t)}function Z9(e){const t=Me(e);return t.setHours(23,59,59,999),t}function am(e){const t=Me(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function J9(e){const t=Me(e);return+Z9(t)==+am(t)}function e$(e,t){const n=Me(e),r=Me(t),a=Yd(n,r),l=Math.abs(qi(n,r));let c;if(l<1)c=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*l);let u=Yd(n,r)===-a;J9(Me(e))&&l===1&&Yd(e,r)===1&&(u=!1),c=a*(l-Number(u))}return c===0?0:c}function t$(e,t,n){const r=X9(e,t)/1e3;return G9(n==null?void 0:n.roundingMethod)(r)}function Bn(e){const t=Me(e);return t.setDate(1),t.setHours(0,0,0,0),t}function J2(e){const t=Me(e),n=lt(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Zy(e,t){var u,f,m,p;const n=Wo(),r=(t==null?void 0:t.weekStartsOn)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,a=Me(e),l=a.getDay(),c=(l<r?-7:0)+6-(l-r);return a.setDate(a.getDate()+c),a.setHours(23,59,59,999),a}function e_(e){return Zy(e,{weekStartsOn:1})}const n$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},r$=(e,t,n)=>{let r;const a=n$[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Up(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const s$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},o$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},a$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},i$={date:Up({formats:s$,defaultWidth:"full"}),time:Up({formats:o$,defaultWidth:"full"}),dateTime:Up({formats:a$,defaultWidth:"full"})},l$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},c$=(e,t,n,r)=>l$[e];function Xl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,u=n!=null&&n.width?String(n.width):c;a=e.formattingValues[u]||e.formattingValues[c]}else{const c=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[u]||e.values[c]}const l=e.argumentCallback?e.argumentCallback(t):t;return a[l]}}const u$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},d$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},f$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},m$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},h$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},p$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x$=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},g$={ordinalNumber:x$,era:Xl({values:u$,defaultWidth:"wide"}),quarter:Xl({values:d$,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xl({values:f$,defaultWidth:"wide"}),day:Xl({values:m$,defaultWidth:"wide"}),dayPeriod:Xl({values:h$,defaultWidth:"wide",formattingValues:p$,defaultFormattingWidth:"wide"})};function Zl(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],l=t.match(a);if(!l)return null;const c=l[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(u)?v$(u,g=>g.test(c)):y$(u,g=>g.test(c));let m;m=e.valueCallback?e.valueCallback(f):f,m=n.valueCallback?n.valueCallback(m):m;const p=t.slice(c.length);return{value:m,rest:p}}}function y$(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function v$(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function b$(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],l=t.match(e.parsePattern);if(!l)return null;let c=e.valueCallback?e.valueCallback(l[0]):l[0];c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}const w$=/^(\d+)(th|st|nd|rd)?/i,j$=/\d+/i,N$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},C$={any:[/^b/i,/^(a|c)/i]},k$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},S$={any:[/1/i,/2/i,/3/i,/4/i]},_$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},E$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},P$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},T$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},A$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},M$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},D$={ordinalNumber:b$({matchPattern:w$,parsePattern:j$,valueCallback:e=>parseInt(e,10)}),era:Zl({matchPatterns:N$,defaultMatchWidth:"wide",parsePatterns:C$,defaultParseWidth:"any"}),quarter:Zl({matchPatterns:k$,defaultMatchWidth:"wide",parsePatterns:S$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Zl({matchPatterns:_$,defaultMatchWidth:"wide",parsePatterns:E$,defaultParseWidth:"any"}),day:Zl({matchPatterns:P$,defaultMatchWidth:"wide",parsePatterns:T$,defaultParseWidth:"any"}),dayPeriod:Zl({matchPatterns:A$,defaultMatchWidth:"any",parsePatterns:M$,defaultParseWidth:"any"})},im={code:"en-US",formatDistance:r$,formatLong:i$,formatRelative:c$,localize:g$,match:D$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R$(e){const t=Me(e);return os(t,J2(t))+1}function Jy(e){const t=Me(e),n=+Rs(t)-+U9(t);return Math.round(n/Ky)+1}function ev(e,t){var p,g,v,y;const n=Me(e),r=n.getFullYear(),a=Wo(),l=(t==null?void 0:t.firstWeekContainsDate)??((g=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((y=(v=a.locale)==null?void 0:v.options)==null?void 0:y.firstWeekContainsDate)??1,c=lt(e,0);c.setFullYear(r+1,0,l),c.setHours(0,0,0,0);const u=tr(c,t),f=lt(e,0);f.setFullYear(r,0,l),f.setHours(0,0,0,0);const m=tr(f,t);return n.getTime()>=u.getTime()?r+1:n.getTime()>=m.getTime()?r:r-1}function O$(e,t){var u,f,m,p;const n=Wo(),r=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,a=ev(e,t),l=lt(e,0);return l.setFullYear(a,0,r),l.setHours(0,0,0,0),tr(l,t)}function tv(e,t){const n=Me(e),r=+tr(n,t)-+O$(n,t);return Math.round(r/Ky)+1}function ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ao={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ot(n+1,2)},d(e,t){return ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ot(e.getHours()%12||12,t.length)},H(e,t){return ot(e.getHours(),t.length)},m(e,t){return ot(e.getMinutes(),t.length)},s(e,t){return ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return ot(a,t.length)}},hi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oj={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return ao.y(e,t)},Y:function(e,t,n,r){const a=ev(e,r),l=a>0?a:1-a;if(t==="YY"){const c=l%100;return ot(c,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):ot(l,t.length)},R:function(e,t){const n=Z2(e);return ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ao.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=tv(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):ot(a,t.length)},I:function(e,t,n){const r=Jy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ao.d(e,t)},D:function(e,t,n){const r=R$(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),l=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return ot(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),l=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return ot(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return ot(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=hi.noon:r===0?a=hi.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=hi.evening:r>=12?a=hi.afternoon:r>=4?a=hi.morning:a=hi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ao.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ao.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ao.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ao.s(e,t)},S:function(e,t){return ao.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Lj(r);case"XXXX":case"XX":return ma(r);case"XXXXX":case"XXX":default:return ma(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Lj(r);case"xxxx":case"xx":return ma(r);case"xxxxx":case"xxx":default:return ma(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ij(r,":");case"OOOO":default:return"GMT"+ma(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ij(r,":");case"zzzz":default:return"GMT"+ma(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return ot(r,t.length)},T:function(e,t,n){const r=e.getTime();return ot(r,t.length)}};function Ij(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),l=r%60;return l===0?n+String(a):n+String(a)+t+ot(l,2)}function Lj(e,t){return e%60===0?(e>0?"-":"+")+ot(Math.abs(e)/60,2):ma(e,t)}function ma(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=ot(Math.trunc(r/60),2),l=ot(r%60,2);return n+a+t+l}const Fj=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},t_=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},I$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Fj(e,t);let l;switch(r){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",Fj(r,t)).replace("{{time}}",t_(a,t))},dg={p:t_,P:I$},L$=/^D+$/,F$=/^Y+$/,$$=["D","DD","YY","YYYY"];function n_(e){return L$.test(e)}function r_(e){return F$.test(e)}function fg(e,t,n){const r=V$(e,t,n);if(console.warn(r),$$.includes(e))throw new RangeError(r)}function V$(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const B$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,z$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,W$=/^'([^]*?)'?$/,U$=/''/g,H$=/[a-zA-Z]/;function Ir(e,t,n){var p,g,v,y,k,j,N,_;const r=Wo(),a=(n==null?void 0:n.locale)??r.locale??im,l=(n==null?void 0:n.firstWeekContainsDate)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((y=(v=r.locale)==null?void 0:v.options)==null?void 0:y.firstWeekContainsDate)??1,c=(n==null?void 0:n.weekStartsOn)??((j=(k=n==null?void 0:n.locale)==null?void 0:k.options)==null?void 0:j.weekStartsOn)??r.weekStartsOn??((_=(N=r.locale)==null?void 0:N.options)==null?void 0:_.weekStartsOn)??0,u=Me(e);if(!Xy(u))throw new RangeError("Invalid time value");let f=t.match(z$).map(w=>{const S=w[0];if(S==="p"||S==="P"){const E=dg[S];return E(w,a.formatLong)}return w}).join("").match(B$).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const S=w[0];if(S==="'")return{isToken:!1,value:q$(w)};if(Oj[S])return{isToken:!0,value:w};if(S.match(H$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(f=a.localize.preprocessor(u,f));const m={firstWeekContainsDate:l,weekStartsOn:c,locale:a};return f.map(w=>{if(!w.isToken)return w.value;const S=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&r_(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&n_(S))&&fg(S,t,String(e));const E=Oj[S[0]];return E(u,S,a.localize,m)}).join("")}function q$(e){const t=e.match(W$);return t?t[1].replace(U$,"'"):e}function K$(e,t,n){const r=Wo(),a=(n==null?void 0:n.locale)??r.locale??im,l=2520,c=Yd(e,t);if(isNaN(c))throw new RangeError("Invalid time value");const u=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:c});let f,m;c>0?(f=Me(t),m=Me(e)):(f=Me(e),m=Me(t));const p=t$(m,f),g=(Lo(m)-Lo(f))/1e3,v=Math.round((p-g)/60);let y;if(v<2)return n!=null&&n.includeSeconds?p<5?a.formatDistance("lessThanXSeconds",5,u):p<10?a.formatDistance("lessThanXSeconds",10,u):p<20?a.formatDistance("lessThanXSeconds",20,u):p<40?a.formatDistance("halfAMinute",0,u):p<60?a.formatDistance("lessThanXMinutes",1,u):a.formatDistance("xMinutes",1,u):v===0?a.formatDistance("lessThanXMinutes",1,u):a.formatDistance("xMinutes",v,u);if(v<45)return a.formatDistance("xMinutes",v,u);if(v<90)return a.formatDistance("aboutXHours",1,u);if(v<Rj){const k=Math.round(v/60);return a.formatDistance("aboutXHours",k,u)}else{if(v<l)return a.formatDistance("xDays",1,u);if(v<kd){const k=Math.round(v/Rj);return a.formatDistance("xDays",k,u)}else if(v<kd*2)return y=Math.round(v/kd),a.formatDistance("aboutXMonths",y,u)}if(y=e$(m,f),y<12){const k=Math.round(v/kd);return a.formatDistance("xMonths",k,u)}else{const k=y%12,j=Math.trunc(y/12);return k<3?a.formatDistance("aboutXYears",j,u):k<9?a.formatDistance("overXYears",j,u):a.formatDistance("almostXYears",j+1,u)}}function lm(e,t){return K$(e,Y9(e),t)}function Y$(e){const t=Me(e),n=t.getFullYear(),r=t.getMonth(),a=lt(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function Q$(){return Object.assign({},Wo())}function G$(e){let n=Me(e).getDay();return n===0&&(n=7),n}function X$(e){return Math.trunc(+Me(e)/1e3)}function Z$(e){const t=Me(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function J$(e,t){return Q9(Z$(e),Bn(e),t)+1}function _c(e,t){const n=Me(e),r=Me(t);return n.getTime()>r.getTime()}function cm(e,t){const n=Me(e),r=Me(t);return+n<+r}function eV(e,t){const n=t instanceof Date?lt(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const tV=10;class s_{constructor(){be(this,"subPriority",0)}validate(t,n){return!0}}class nV extends s_{constructor(t,n,r,a,l){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=a,l&&(this.subPriority=l)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class rV extends s_{constructor(){super(...arguments);be(this,"priority",tV);be(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:lt(n,eV(n,Date))}}class et{run(t,n,r,a){const l=this.parse(t,n,r,a);return l?{setter:new nV(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,r){return!0}}class sV extends et{constructor(){super(...arguments);be(this,"priority",140);be(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,a){switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})||a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"})}}set(n,r,a){return r.era=a,n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}const At={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Mt(e,t){return e&&{value:t(e.value),rest:e.rest}}function jt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function rs(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,a=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,c=n[5]?parseInt(n[5],10):0;return{value:r*(a*Qy+l*Yy+c*z9),rest:t.slice(n[0].length)}}function o_(e){return jt(At.anyDigitsSigned,e)}function _t(e,t){switch(e){case 1:return jt(At.singleDigit,t);case 2:return jt(At.twoDigits,t);case 3:return jt(At.threeDigits,t);case 4:return jt(At.fourDigits,t);default:return jt(new RegExp("^\\d{1,"+e+"}"),t)}}function jf(e,t){switch(e){case 1:return jt(At.singleDigitSigned,t);case 2:return jt(At.twoDigitsSigned,t);case 3:return jt(At.threeDigitsSigned,t);case 4:return jt(At.fourDigitsSigned,t);default:return jt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function nv(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function a_(e,t){const n=t>0,r=n?t:1-t;let a;if(r<=50)a=e||100;else{const l=r+50,c=Math.trunc(l/100)*100,u=e>=l%100;a=e+c-(u?100:0)}return n?a:1-a}function i_(e){return e%400===0||e%4===0&&e%100!==0}class oV extends et{constructor(){super(...arguments);be(this,"priority",130);be(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,a){const l=c=>({year:c,isTwoDigitYear:r==="yy"});switch(r){case"y":return Mt(_t(4,n),l);case"yo":return Mt(a.ordinalNumber(n,{unit:"year"}),l);default:return Mt(_t(r.length,n),l)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a){const l=n.getFullYear();if(a.isTwoDigitYear){const u=a_(a.year,l);return n.setFullYear(u,0,1),n.setHours(0,0,0,0),n}const c=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}}class aV extends et{constructor(){super(...arguments);be(this,"priority",130);be(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,a){const l=c=>({year:c,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Mt(_t(4,n),l);case"Yo":return Mt(a.ordinalNumber(n,{unit:"year"}),l);default:return Mt(_t(r.length,n),l)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a,l){const c=ev(n,l);if(a.isTwoDigitYear){const f=a_(a.year,c);return n.setFullYear(f,0,l.firstWeekContainsDate),n.setHours(0,0,0,0),tr(n,l)}const u=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(u,0,l.firstWeekContainsDate),n.setHours(0,0,0,0),tr(n,l)}}class iV extends et{constructor(){super(...arguments);be(this,"priority",130);be(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return jf(r==="R"?4:r.length,n)}set(n,r,a){const l=lt(n,0);return l.setFullYear(a,0,4),l.setHours(0,0,0,0),Rs(l)}}class lV extends et{constructor(){super(...arguments);be(this,"priority",130);be(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return jf(r==="u"?4:r.length,n)}set(n,r,a){return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class cV extends et{constructor(){super(...arguments);be(this,"priority",120);be(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"Q":case"QQ":return _t(r.length,n);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})||a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class uV extends et{constructor(){super(...arguments);be(this,"priority",120);be(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"q":case"qq":return _t(r.length,n);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})||a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class dV extends et{constructor(){super(...arguments);be(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);be(this,"priority",110)}parse(n,r,a){const l=c=>c-1;switch(r){case"M":return Mt(jt(At.month,n),l);case"MM":return Mt(_t(2,n),l);case"Mo":return Mt(a.ordinalNumber(n,{unit:"month"}),l);case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})||a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}class fV extends et{constructor(){super(...arguments);be(this,"priority",110);be(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,a){const l=c=>c-1;switch(r){case"L":return Mt(jt(At.month,n),l);case"LL":return Mt(_t(2,n),l);case"Lo":return Mt(a.ordinalNumber(n,{unit:"month"}),l);case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})||a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}function mV(e,t,n){const r=Me(e),a=tv(r,n)-t;return r.setDate(r.getDate()-a*7),r}class hV extends et{constructor(){super(...arguments);be(this,"priority",100);be(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,a){switch(r){case"w":return jt(At.week,n);case"wo":return a.ordinalNumber(n,{unit:"week"});default:return _t(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a,l){return tr(mV(n,a,l),l)}}function pV(e,t){const n=Me(e),r=Jy(n)-t;return n.setDate(n.getDate()-r*7),n}class xV extends et{constructor(){super(...arguments);be(this,"priority",100);be(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,a){switch(r){case"I":return jt(At.week,n);case"Io":return a.ordinalNumber(n,{unit:"week"});default:return _t(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a){return Rs(pV(n,a))}}const gV=[31,28,31,30,31,30,31,31,30,31,30,31],yV=[31,29,31,30,31,30,31,31,30,31,30,31];class vV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"subPriority",1);be(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"d":return jt(At.date,n);case"do":return a.ordinalNumber(n,{unit:"date"});default:return _t(r.length,n)}}validate(n,r){const a=n.getFullYear(),l=i_(a),c=n.getMonth();return l?r>=1&&r<=yV[c]:r>=1&&r<=gV[c]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class bV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"subpriority",1);be(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,a){switch(r){case"D":case"DD":return jt(At.dayOfYear,n);case"Do":return a.ordinalNumber(n,{unit:"date"});default:return _t(r.length,n)}}validate(n,r){const a=n.getFullYear();return i_(a)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,a){return n.setMonth(0,a),n.setHours(0,0,0,0),n}}function rv(e,t,n){var g,v,y,k;const r=Wo(),a=(n==null?void 0:n.weekStartsOn)??((v=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((k=(y=r.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=Me(e),c=l.getDay(),f=(t%7+7)%7,m=7-a,p=t<0||t>6?t-(c+m)%7:(f+m)%7-(c+m)%7;return nn(l,p)}class wV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,l){return n=rv(n,a,l),n.setHours(0,0,0,0),n}}class jV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,a,l){const c=u=>{const f=Math.floor((u-1)/7)*7;return(u+l.weekStartsOn+6)%7+f};switch(r){case"e":case"ee":return Mt(_t(r.length,n),c);case"eo":return Mt(a.ordinalNumber(n,{unit:"day"}),c);case"eee":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeeee":return a.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,l){return n=rv(n,a,l),n.setHours(0,0,0,0),n}}class NV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,a,l){const c=u=>{const f=Math.floor((u-1)/7)*7;return(u+l.weekStartsOn+6)%7+f};switch(r){case"c":case"cc":return Mt(_t(r.length,n),c);case"co":return Mt(a.ordinalNumber(n,{unit:"day"}),c);case"ccc":return a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"ccccc":return a.day(n,{width:"narrow",context:"standalone"});case"cccccc":return a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(n,{width:"wide",context:"standalone"})||a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,l){return n=rv(n,a,l),n.setHours(0,0,0,0),n}}function CV(e,t){const n=Me(e),r=G$(n),a=t-r;return nn(n,a)}class kV extends et{constructor(){super(...arguments);be(this,"priority",90);be(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,a){const l=c=>c===0?7:c;switch(r){case"i":case"ii":return _t(r.length,n);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return Mt(a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),l);case"iiiii":return Mt(a.day(n,{width:"narrow",context:"formatting"}),l);case"iiiiii":return Mt(a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),l);case"iiii":default:return Mt(a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),l)}}validate(n,r){return r>=1&&r<=7}set(n,r,a){return n=CV(n,a),n.setHours(0,0,0,0),n}}class SV extends et{constructor(){super(...arguments);be(this,"priority",80);be(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,a){switch(r){case"a":case"aa":case"aaa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(nv(a),0,0,0),n}}class _V extends et{constructor(){super(...arguments);be(this,"priority",80);be(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,a){switch(r){case"b":case"bb":case"bbb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(nv(a),0,0,0),n}}class EV extends et{constructor(){super(...arguments);be(this,"priority",80);be(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,a){switch(r){case"B":case"BB":case"BBB":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(nv(a),0,0,0),n}}class PV extends et{constructor(){super(...arguments);be(this,"priority",70);be(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,a){switch(r){case"h":return jt(At.hour12h,n);case"ho":return a.ordinalNumber(n,{unit:"hour"});default:return _t(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,a){const l=n.getHours()>=12;return l&&a<12?n.setHours(a+12,0,0,0):!l&&a===12?n.setHours(0,0,0,0):n.setHours(a,0,0,0),n}}class TV extends et{constructor(){super(...arguments);be(this,"priority",70);be(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,a){switch(r){case"H":return jt(At.hour23h,n);case"Ho":return a.ordinalNumber(n,{unit:"hour"});default:return _t(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,a){return n.setHours(a,0,0,0),n}}class AV extends et{constructor(){super(...arguments);be(this,"priority",70);be(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,a){switch(r){case"K":return jt(At.hour11h,n);case"Ko":return a.ordinalNumber(n,{unit:"hour"});default:return _t(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.getHours()>=12&&a<12?n.setHours(a+12,0,0,0):n.setHours(a,0,0,0),n}}class MV extends et{constructor(){super(...arguments);be(this,"priority",70);be(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,a){switch(r){case"k":return jt(At.hour24h,n);case"ko":return a.ordinalNumber(n,{unit:"hour"});default:return _t(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,a){const l=a<=24?a%24:a;return n.setHours(l,0,0,0),n}}class DV extends et{constructor(){super(...arguments);be(this,"priority",60);be(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"m":return jt(At.minute,n);case"mo":return a.ordinalNumber(n,{unit:"minute"});default:return _t(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setMinutes(a,0,0),n}}class RV extends et{constructor(){super(...arguments);be(this,"priority",50);be(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"s":return jt(At.second,n);case"so":return a.ordinalNumber(n,{unit:"second"});default:return _t(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setSeconds(a,0),n}}class OV extends et{constructor(){super(...arguments);be(this,"priority",30);be(this,"incompatibleTokens",["t","T"])}parse(n,r){const a=l=>Math.trunc(l*Math.pow(10,-r.length+3));return Mt(_t(r.length,n),a)}set(n,r,a){return n.setMilliseconds(a),n}}class IV extends et{constructor(){super(...arguments);be(this,"priority",10);be(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return rs(ns.basicOptionalMinutes,n);case"XX":return rs(ns.basic,n);case"XXXX":return rs(ns.basicOptionalSeconds,n);case"XXXXX":return rs(ns.extendedOptionalSeconds,n);case"XXX":default:return rs(ns.extended,n)}}set(n,r,a){return r.timestampIsSet?n:lt(n,n.getTime()-Lo(n)-a)}}class LV extends et{constructor(){super(...arguments);be(this,"priority",10);be(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return rs(ns.basicOptionalMinutes,n);case"xx":return rs(ns.basic,n);case"xxxx":return rs(ns.basicOptionalSeconds,n);case"xxxxx":return rs(ns.extendedOptionalSeconds,n);case"xxx":default:return rs(ns.extended,n)}}set(n,r,a){return r.timestampIsSet?n:lt(n,n.getTime()-Lo(n)-a)}}class FV extends et{constructor(){super(...arguments);be(this,"priority",40);be(this,"incompatibleTokens","*")}parse(n){return o_(n)}set(n,r,a){return[lt(n,a*1e3),{timestampIsSet:!0}]}}class $V extends et{constructor(){super(...arguments);be(this,"priority",20);be(this,"incompatibleTokens","*")}parse(n){return o_(n)}set(n,r,a){return[lt(n,a),{timestampIsSet:!0}]}}const VV={G:new sV,y:new oV,Y:new aV,R:new iV,u:new lV,Q:new cV,q:new uV,M:new dV,L:new fV,w:new hV,I:new xV,d:new vV,D:new bV,E:new wV,e:new jV,c:new NV,i:new kV,a:new SV,b:new _V,B:new EV,h:new PV,H:new TV,K:new AV,k:new MV,m:new DV,s:new RV,S:new OV,X:new IV,x:new LV,t:new FV,T:new $V},BV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,WV=/^'([^]*?)'?$/,UV=/''/g,HV=/\S/,qV=/[a-zA-Z]/;function KV(e,t,n,r){var j,N,_,w;const a=Q$(),l=a.locale??im,c=a.firstWeekContainsDate??((N=(j=a.locale)==null?void 0:j.options)==null?void 0:N.firstWeekContainsDate)??1,u=a.weekStartsOn??((w=(_=a.locale)==null?void 0:_.options)==null?void 0:w.weekStartsOn)??0,f={firstWeekContainsDate:c,weekStartsOn:u,locale:l},m=[new rV],p=t.match(zV).map(S=>{const E=S[0];if(E in dg){const P=dg[E];return P(S,l.formatLong)}return S}).join("").match(BV),g=[];for(let S of p){r_(S)&&fg(S,t,e),n_(S)&&fg(S,t,e);const E=S[0],P=VV[E];if(P){const{incompatibleTokens:T}=P;if(Array.isArray(T)){const D=g.find(q=>T.includes(q.token)||q.token===E);if(D)throw new RangeError(`The format string mustn't contain \`${D.fullToken}\` and \`${S}\` at the same time`)}else if(P.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:E,fullToken:S});const M=P.run(e,S,l.match,f);if(!M)return lt(n,NaN);m.push(M.setter),e=M.rest}else{if(E.match(qV))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");if(S==="''"?S="'":E==="'"&&(S=YV(S)),e.indexOf(S)===0)e=e.slice(S.length);else return lt(n,NaN)}}if(e.length>0&&HV.test(e))return lt(n,NaN);const v=m.map(S=>S.priority).sort((S,E)=>E-S).filter((S,E,P)=>P.indexOf(S)===E).map(S=>m.filter(E=>E.priority===S).sort((E,P)=>P.subPriority-E.subPriority)).map(S=>S[0]);let y=Me(n);if(isNaN(y.getTime()))return lt(n,NaN);const k={};for(const S of v){if(!S.validate(y,f))return lt(n,NaN);const E=S.set(y,k,f);Array.isArray(E)?(y=E[0],Object.assign(k,E[1])):y=E}return lt(n,y)}function YV(e){return e.match(WV)[1].replace(UV,"'")}function Qc(e){return+Me(e)<Date.now()}function sv(e,t){const n=Me(e),r=Me(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function QV(e,t){const n=Me(e),r=Me(t);return n.getFullYear()===r.getFullYear()}function Hp(e,t){return nn(e,-t)}function um(e,t){const r=JV(e);let a;if(r.date){const f=eB(r.date,2);a=tB(f.restDateString,f.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const l=a.getTime();let c=0,u;if(r.time&&(c=nB(r.time),isNaN(c)))return new Date(NaN);if(r.timezone){if(u=rB(r.timezone),isNaN(u))return new Date(NaN)}else{const f=new Date(l+c),m=new Date(0);return m.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),m.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),m}return new Date(l+c+u)}const Sd={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},GV=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,XV=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ZV=/^([+-])(\d{2})(?::?(\d{2}))?$/;function JV(e){const t={},n=e.split(Sd.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Sd.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Sd.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=Sd.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function eB(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,l=r[2]?parseInt(r[2]):null;return{year:l===null?a:l*100,restDateString:e.slice((r[1]||r[2]).length)}}function tB(e,t){if(t===null)return new Date(NaN);const n=e.match(GV);if(!n)return new Date(NaN);const r=!!n[4],a=Jl(n[1]),l=Jl(n[2])-1,c=Jl(n[3]),u=Jl(n[4]),f=Jl(n[5])-1;if(r)return lB(t,u,f)?sB(t,u,f):new Date(NaN);{const m=new Date(0);return!aB(t,l,c)||!iB(t,a)?new Date(NaN):(m.setUTCFullYear(t,l,Math.max(a,c)),m)}}function Jl(e){return e?parseInt(e):1}function nB(e){const t=e.match(XV);if(!t)return NaN;const n=qp(t[1]),r=qp(t[2]),a=qp(t[3]);return cB(n,r,a)?n*Qy+r*Yy+a*1e3:NaN}function qp(e){return e&&parseFloat(e.replace(",","."))||0}function rB(e){if(e==="Z")return 0;const t=e.match(ZV);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return uB(r,a)?n*(r*Qy+a*Yy):NaN}function sB(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,l=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+l),r}const oB=[31,null,31,30,31,30,31,31,30,31,30,31];function l_(e){return e%400===0||e%4===0&&e%100!==0}function aB(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(oB[t]||(l_(e)?29:28))}function iB(e,t){return t>=1&&t<=(l_(e)?366:365)}function lB(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function cB(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function uB(e,t){return t>=0&&t<=59}function Kp(e,t){const n=Me(e),r=n.getFullYear(),a=n.getDate(),l=lt(e,0);l.setFullYear(r,t,15),l.setHours(0,0,0,0);const c=Y$(l);return n.setMonth(t,Math.min(a,c)),n}function $j(e,t){const n=Me(e);return isNaN(+n)?lt(e,NaN):(n.setFullYear(t),n)}var dB=Symbol.for("react.lazy"),Nf=Mf[" use ".trim().toString()];function fB(e){return typeof e=="object"&&e!==null&&"then"in e}function c_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===dB&&"_payload"in e&&fB(e._payload)}function mB(e){const t=pB(e),n=x.forwardRef((r,a)=>{let{children:l,...c}=r;c_(l)&&typeof Nf=="function"&&(l=Nf(l._payload));const u=x.Children.toArray(l),f=u.find(gB);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}var hB=mB("Slot");function pB(e){const t=x.forwardRef((n,r)=>{let{children:a,...l}=n;if(c_(a)&&typeof Nf=="function"&&(a=Nf(a._payload)),x.isValidElement(a)){const c=vB(a),u=yB(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xB=Symbol("radix.slottable");function gB(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xB}function yB(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function vB(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const mg=Vg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Tr=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},l)=>{const c=r?hB:"button";return s.jsx(c,{className:Oe(mg({variant:t,size:n,className:e})),ref:l,...a})});Tr.displayName="Button";var Le=function(){return Le=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Le.apply(this,arguments)};function bB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function u_(e,t,n){for(var r=0,a=t.length,l;r<a;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}function Gc(e){return e.mode==="multiple"}function Xc(e){return e.mode==="range"}function dm(e){return e.mode==="single"}var wB={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function jB(e,t){return Ir(e,"LLLL y",t)}function NB(e,t){return Ir(e,"d",t)}function CB(e,t){return Ir(e,"LLLL",t)}function kB(e){return"".concat(e)}function SB(e,t){return Ir(e,"cccccc",t)}function _B(e,t){return Ir(e,"yyyy",t)}var EB=Object.freeze({__proto__:null,formatCaption:jB,formatDay:NB,formatMonthCaption:CB,formatWeekNumber:kB,formatWeekdayName:SB,formatYearCaption:_B}),PB=function(e,t,n){return Ir(e,"do MMMM (EEEE)",n)},TB=function(){return"Month: "},AB=function(){return"Go to next month"},MB=function(){return"Go to previous month"},DB=function(e,t){return Ir(e,"cccc",t)},RB=function(e){return"Week n. ".concat(e)},OB=function(){return"Year: "},IB=Object.freeze({__proto__:null,labelDay:PB,labelMonthDropdown:TB,labelNext:AB,labelPrevious:MB,labelWeekNumber:RB,labelWeekday:DB,labelYearDropdown:OB});function LB(){var e="buttons",t=wB,n=im,r={},a={},l=1,c={},u=new Date;return{captionLayout:e,classNames:t,formatters:EB,labels:IB,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:l,styles:c,today:u,mode:"default"}}function FB(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,l=e.fromDate,c=e.toDate;return r?l=Bn(r):t&&(l=new Date(t,0,1)),a?c=am(a):n&&(c=new Date(n,11,31)),{fromDate:l?Hi(l):void 0,toDate:c?Hi(c):void 0}}var d_=x.createContext(void 0);function $B(e){var t,n=e.initialProps,r=LB(),a=FB(n),l=a.fromDate,c=a.toDate,u=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;u!=="buttons"&&(!l||!c)&&(u="buttons");var f;(dm(n)||Gc(n)||Xc(n))&&(f=n.onSelect);var m=Le(Le(Le({},r),n),{captionLayout:u,classNames:Le(Le({},r.classNames),n.classNames),components:Le({},n.components),formatters:Le(Le({},r.formatters),n.formatters),fromDate:l,labels:Le(Le({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Le(Le({},r.modifiers),n.modifiers),modifiersClassNames:Le(Le({},r.modifiersClassNames),n.modifiersClassNames),onSelect:f,styles:Le(Le({},r.styles),n.styles),toDate:c});return s.jsx(d_.Provider,{value:m,children:e.children})}function ft(){var e=x.useContext(d_);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function f_(e){var t=ft(),n=t.locale,r=t.classNames,a=t.styles,l=t.formatters.formatCaption;return s.jsx("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:l(e.displayMonth,{locale:n})})}function VB(e){return s.jsx("svg",Le({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:s.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function m_(e){var t,n,r=e.onChange,a=e.value,l=e.children,c=e.caption,u=e.className,f=e.style,m=ft(),p=(n=(t=m.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:VB;return s.jsxs("div",{className:u,style:f,children:[s.jsx("span",{className:m.classNames.vhidden,children:e["aria-label"]}),s.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:m.classNames.dropdown,style:m.styles.dropdown,value:a,onChange:r,children:l}),s.jsxs("div",{className:m.classNames.caption_label,style:m.styles.caption_label,"aria-hidden":"true",children:[c,s.jsx(p,{className:m.classNames.dropdown_icon,style:m.styles.dropdown_icon})]})]})}function BB(e){var t,n=ft(),r=n.fromDate,a=n.toDate,l=n.styles,c=n.locale,u=n.formatters.formatMonthCaption,f=n.classNames,m=n.components,p=n.labels.labelMonthDropdown;if(!r)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});var g=[];if(QV(r,a))for(var v=Bn(r),y=r.getMonth();y<=a.getMonth();y++)g.push(Kp(v,y));else for(var v=Bn(new Date),y=0;y<=11;y++)g.push(Kp(v,y));var k=function(N){var _=Number(N.target.value),w=Kp(Bn(e.displayMonth),_);e.onChange(w)},j=(t=m==null?void 0:m.Dropdown)!==null&&t!==void 0?t:m_;return s.jsx(j,{name:"months","aria-label":p(),className:f.dropdown_month,style:l.dropdown_month,onChange:k,value:e.displayMonth.getMonth(),caption:u(e.displayMonth,{locale:c}),children:g.map(function(N){return s.jsx("option",{value:N.getMonth(),children:u(N,{locale:c})},N.getMonth())})})}function zB(e){var t,n=e.displayMonth,r=ft(),a=r.fromDate,l=r.toDate,c=r.locale,u=r.styles,f=r.classNames,m=r.components,p=r.formatters.formatYearCaption,g=r.labels.labelYearDropdown,v=[];if(!a)return s.jsx(s.Fragment,{});if(!l)return s.jsx(s.Fragment,{});for(var y=a.getFullYear(),k=l.getFullYear(),j=y;j<=k;j++)v.push($j(J2(new Date),j));var N=function(w){var S=$j(Bn(n),Number(w.target.value));e.onChange(S)},_=(t=m==null?void 0:m.Dropdown)!==null&&t!==void 0?t:m_;return s.jsx(_,{name:"years","aria-label":g(),className:f.dropdown_year,style:u.dropdown_year,onChange:N,value:n.getFullYear(),caption:p(n,{locale:c}),children:v.map(function(w){return s.jsx("option",{value:w.getFullYear(),children:p(w,{locale:c})},w.getFullYear())})})}function WB(e,t){var n=x.useState(e),r=n[0],a=n[1],l=t===void 0?r:t;return[l,a]}function UB(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,l=e.toDate,c=e.fromDate,u=e.numberOfMonths,f=u===void 0?1:u;if(l&&qi(l,a)<0){var m=-1*(f-1);a=Or(l,m)}return c&&qi(a,c)<0&&(a=c),Bn(a)}function HB(){var e=ft(),t=UB(e),n=WB(t,e.month),r=n[0],a=n[1],l=function(c){var u;if(!e.disableNavigation){var f=Bn(c);a(f),(u=e.onMonthChange)===null||u===void 0||u.call(e,f)}};return[r,l]}function qB(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=Bn(e),l=Bn(Or(a,r)),c=qi(l,a),u=[],f=0;f<c;f++){var m=Or(a,f);u.push(m)}return n&&(u=u.reverse()),u}function KB(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,l=a===void 0?1:a,c=r?l:1,u=Bn(e);if(!n)return Or(u,c);var f=qi(n,e);if(!(f<l))return Or(u,c)}}function YB(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,l=a===void 0?1:a,c=r?l:1,u=Bn(e);if(!n)return Or(u,-c);var f=qi(u,n);if(!(f<=0))return Or(u,-c)}}var h_=x.createContext(void 0);function QB(e){var t=ft(),n=HB(),r=n[0],a=n[1],l=qB(r,t),c=KB(r,t),u=YB(r,t),f=function(g){return l.some(function(v){return sv(g,v)})},m=function(g,v){f(g)||(v&&cm(g,v)?a(Or(g,1+t.numberOfMonths*-1)):a(g))},p={currentMonth:r,displayMonths:l,goToMonth:a,goToDate:m,previousMonth:u,nextMonth:c,isDateDisplayed:f};return s.jsx(h_.Provider,{value:p,children:e.children})}function Zc(){var e=x.useContext(h_);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function Vj(e){var t,n=ft(),r=n.classNames,a=n.styles,l=n.components,c=Zc().goToMonth,u=function(p){c(Or(p,e.displayIndex?-e.displayIndex:0))},f=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:f_,m=s.jsx(f,{id:e.id,displayMonth:e.displayMonth});return s.jsxs("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[s.jsx("div",{className:r.vhidden,children:m}),s.jsx(BB,{onChange:u,displayMonth:e.displayMonth}),s.jsx(zB,{onChange:u,displayMonth:e.displayMonth})]})}function GB(e){return s.jsx("svg",Le({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function XB(e){return s.jsx("svg",Le({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Cf=x.forwardRef(function(e,t){var n=ft(),r=n.classNames,a=n.styles,l=[r.button_reset,r.button];e.className&&l.push(e.className);var c=l.join(" "),u=Le(Le({},a.button_reset),a.button);return e.style&&Object.assign(u,e.style),s.jsx("button",Le({},e,{ref:t,type:"button",className:c,style:u}))});function ZB(e){var t,n,r=ft(),a=r.dir,l=r.locale,c=r.classNames,u=r.styles,f=r.labels,m=f.labelPrevious,p=f.labelNext,g=r.components;if(!e.nextMonth&&!e.previousMonth)return s.jsx(s.Fragment,{});var v=m(e.previousMonth,{locale:l}),y=[c.nav_button,c.nav_button_previous].join(" "),k=p(e.nextMonth,{locale:l}),j=[c.nav_button,c.nav_button_next].join(" "),N=(t=g==null?void 0:g.IconRight)!==null&&t!==void 0?t:XB,_=(n=g==null?void 0:g.IconLeft)!==null&&n!==void 0?n:GB;return s.jsxs("div",{className:c.nav,style:u.nav,children:[!e.hidePrevious&&s.jsx(Cf,{name:"previous-month","aria-label":v,className:y,style:u.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?s.jsx(N,{className:c.nav_icon,style:u.nav_icon}):s.jsx(_,{className:c.nav_icon,style:u.nav_icon})}),!e.hideNext&&s.jsx(Cf,{name:"next-month","aria-label":k,className:j,style:u.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?s.jsx(_,{className:c.nav_icon,style:u.nav_icon}):s.jsx(N,{className:c.nav_icon,style:u.nav_icon})})]})}function Bj(e){var t=ft().numberOfMonths,n=Zc(),r=n.previousMonth,a=n.nextMonth,l=n.goToMonth,c=n.displayMonths,u=c.findIndex(function(k){return sv(e.displayMonth,k)}),f=u===0,m=u===c.length-1,p=t>1&&(f||!m),g=t>1&&(m||!f),v=function(){r&&l(r)},y=function(){a&&l(a)};return s.jsx(ZB,{displayMonth:e.displayMonth,hideNext:p,hidePrevious:g,nextMonth:a,previousMonth:r,onPreviousClick:v,onNextClick:y})}function JB(e){var t,n=ft(),r=n.classNames,a=n.disableNavigation,l=n.styles,c=n.captionLayout,u=n.components,f=(t=u==null?void 0:u.CaptionLabel)!==null&&t!==void 0?t:f_,m;return a?m=s.jsx(f,{id:e.id,displayMonth:e.displayMonth}):c==="dropdown"?m=s.jsx(Vj,{displayMonth:e.displayMonth,id:e.id}):c==="dropdown-buttons"?m=s.jsxs(s.Fragment,{children:[s.jsx(Vj,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(Bj,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):m=s.jsxs(s.Fragment,{children:[s.jsx(f,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(Bj,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:l.caption,children:m})}function e7(e){var t=ft(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?s.jsx("tfoot",{className:a,style:r.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function t7(e,t,n){for(var r=n?Rs(new Date):tr(new Date,{locale:e,weekStartsOn:t}),a=[],l=0;l<7;l++){var c=nn(r,l);a.push(c)}return a}function n7(){var e=ft(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,l=e.weekStartsOn,c=e.ISOWeek,u=e.formatters.formatWeekdayName,f=e.labels.labelWeekday,m=t7(a,l,c);return s.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&s.jsx("td",{style:n.head_cell,className:t.head_cell}),m.map(function(p,g){return s.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":f(p,{locale:a}),children:u(p,{locale:a})},g)})]})}function r7(){var e,t=ft(),n=t.classNames,r=t.styles,a=t.components,l=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:n7;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(l,{})})}function s7(e){var t=ft(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var ov=x.createContext(void 0);function o7(e){if(!Gc(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(ov.Provider,{value:t,children:e.children})}return s.jsx(a7,{initialProps:e.initialProps,children:e.children})}function a7(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,l=t.max,c=function(m,p,g){var v,y;(v=t.onDayClick)===null||v===void 0||v.call(t,m,p,g);var k=!!(p.selected&&a&&(r==null?void 0:r.length)===a);if(!k){var j=!!(!p.selected&&l&&(r==null?void 0:r.length)===l);if(!j){var N=r?u_([],r):[];if(p.selected){var _=N.findIndex(function(w){return Vn(m,w)});N.splice(_,1)}else N.push(m);(y=t.onSelect)===null||y===void 0||y.call(t,N,m,p,g)}}},u={disabled:[]};r&&u.disabled.push(function(m){var p=l&&r.length>l-1,g=r.some(function(v){return Vn(v,m)});return!!(p&&!g)});var f={selected:r,onDayClick:c,modifiers:u};return s.jsx(ov.Provider,{value:f,children:n})}function av(){var e=x.useContext(ov);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function i7(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?Vn(a,e)&&Vn(r,e)?void 0:Vn(a,e)?{from:a,to:void 0}:Vn(r,e)?void 0:_c(r,e)?{from:e,to:a}:{from:r,to:e}:a?_c(e,a)?{from:a,to:e}:{from:e,to:a}:r?cm(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var iv=x.createContext(void 0);function l7(e){if(!Xc(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(iv.Provider,{value:t,children:e.children})}return s.jsx(c7,{initialProps:e.initialProps,children:e.children})}function c7(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},l=a.from,c=a.to,u=t.min,f=t.max,m=function(y,k,j){var N,_;(N=t.onDayClick)===null||N===void 0||N.call(t,y,k,j);var w=i7(y,r);(_=t.onSelect)===null||_===void 0||_.call(t,w,y,k,j)},p={range_start:[],range_end:[],range_middle:[],disabled:[]};if(l?(p.range_start=[l],c?(p.range_end=[c],Vn(l,c)||(p.range_middle=[{after:l,before:c}])):p.range_end=[l]):c&&(p.range_start=[c],p.range_end=[c]),u&&(l&&!c&&p.disabled.push({after:Hp(l,u-1),before:nn(l,u-1)}),l&&c&&p.disabled.push({after:l,before:nn(l,u-1)}),!l&&c&&p.disabled.push({after:Hp(c,u-1),before:nn(c,u-1)})),f){if(l&&!c&&(p.disabled.push({before:nn(l,-f+1)}),p.disabled.push({after:nn(l,f-1)})),l&&c){var g=os(c,l)+1,v=f-g;p.disabled.push({before:Hp(l,v)}),p.disabled.push({after:nn(c,v)})}!l&&c&&(p.disabled.push({before:nn(c,-f+1)}),p.disabled.push({after:nn(c,f-1)}))}return s.jsx(iv.Provider,{value:{selected:r,onDayClick:m,modifiers:p},children:n})}function lv(){var e=x.useContext(iv);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Qd(e){return Array.isArray(e)?u_([],e):e!==void 0?[e]:[]}function u7(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=Qd(a)}),t}var Lr;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Lr||(Lr={}));var d7=Lr.Selected,Ns=Lr.Disabled,f7=Lr.Hidden,m7=Lr.Today,Yp=Lr.RangeEnd,Qp=Lr.RangeMiddle,Gp=Lr.RangeStart,h7=Lr.Outside;function p7(e,t,n){var r,a=(r={},r[d7]=Qd(e.selected),r[Ns]=Qd(e.disabled),r[f7]=Qd(e.hidden),r[m7]=[e.today],r[Yp]=[],r[Qp]=[],r[Gp]=[],r[h7]=[],r);return e.fromDate&&a[Ns].push({before:e.fromDate}),e.toDate&&a[Ns].push({after:e.toDate}),Gc(e)?a[Ns]=a[Ns].concat(t.modifiers[Ns]):Xc(e)&&(a[Ns]=a[Ns].concat(n.modifiers[Ns]),a[Gp]=n.modifiers[Gp],a[Qp]=n.modifiers[Qp],a[Yp]=n.modifiers[Yp]),a}var p_=x.createContext(void 0);function x7(e){var t=ft(),n=av(),r=lv(),a=p7(t,n,r),l=u7(t.modifiers),c=Le(Le({},a),l);return s.jsx(p_.Provider,{value:c,children:e.children})}function x_(){var e=x.useContext(p_);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function g7(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function y7(e){return!!(e&&typeof e=="object"&&"from"in e)}function v7(e){return!!(e&&typeof e=="object"&&"after"in e)}function b7(e){return!!(e&&typeof e=="object"&&"before"in e)}function w7(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function j7(e,t){var n,r=t.from,a=t.to;if(r&&a){var l=os(a,r)<0;l&&(n=[a,r],r=n[0],a=n[1]);var c=os(e,r)>=0&&os(a,e)>=0;return c}return a?Vn(a,e):r?Vn(r,e):!1}function N7(e){return Gy(e)}function C7(e){return Array.isArray(e)&&e.every(Gy)}function k7(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(N7(n))return Vn(e,n);if(C7(n))return n.includes(e);if(y7(n))return j7(e,n);if(w7(n))return n.dayOfWeek.includes(e.getDay());if(g7(n)){var r=os(n.before,e),a=os(n.after,e),l=r>0,c=a<0,u=_c(n.before,n.after);return u?c&&l:l||c}return v7(n)?os(e,n.after)>0:b7(n)?os(n.before,e)>0:typeof n=="function"?n(e):!1})}function cv(e,t,n){var r=Object.keys(t).reduce(function(l,c){var u=t[c];return k7(e,u)&&l.push(c),l},[]),a={};return r.forEach(function(l){return a[l]=!0}),n&&!sv(e,n)&&(a.outside=!0),a}function S7(e,t){for(var n=Bn(e[0]),r=am(e[e.length-1]),a,l,c=n;c<=r;){var u=cv(c,t),f=!u.disabled&&!u.hidden;if(!f){c=nn(c,1);continue}if(u.selected)return c;u.today&&!l&&(l=c),a||(a=c),c=nn(c,1)}return l||a}var _7=365;function g_(e,t){var n=t.moveBy,r=t.direction,a=t.context,l=t.modifiers,c=t.retry,u=c===void 0?{count:0,lastFocused:e}:c,f=a.weekStartsOn,m=a.fromDate,p=a.toDate,g=a.locale,v={day:nn,week:ug,month:Or,year:H9,startOfWeek:function(N){return a.ISOWeek?Rs(N):tr(N,{locale:g,weekStartsOn:f})},endOfWeek:function(N){return a.ISOWeek?e_(N):Zy(N,{locale:g,weekStartsOn:f})}},y=v[n](e,r==="after"?1:-1);r==="before"&&m?y=q9([m,y]):r==="after"&&p&&(y=K9([p,y]));var k=!0;if(l){var j=cv(y,l);k=!j.disabled&&!j.hidden}return k?y:u.count>_7?u.lastFocused:g_(y,{moveBy:n,direction:r,context:a,modifiers:l,retry:Le(Le({},u),{count:u.count+1})})}var y_=x.createContext(void 0);function E7(e){var t=Zc(),n=x_(),r=x.useState(),a=r[0],l=r[1],c=x.useState(),u=c[0],f=c[1],m=S7(t.displayMonths,n),p=a??(u&&t.isDateDisplayed(u))?u:m,g=function(){f(a),l(void 0)},v=function(N){l(N)},y=ft(),k=function(N,_){if(a){var w=g_(a,{moveBy:N,direction:_,context:y,modifiers:n});Vn(a,w)||(t.goToDate(w,a),v(w))}},j={focusedDay:a,focusTarget:p,blur:g,focus:v,focusDayAfter:function(){return k("day","after")},focusDayBefore:function(){return k("day","before")},focusWeekAfter:function(){return k("week","after")},focusWeekBefore:function(){return k("week","before")},focusMonthBefore:function(){return k("month","before")},focusMonthAfter:function(){return k("month","after")},focusYearBefore:function(){return k("year","before")},focusYearAfter:function(){return k("year","after")},focusStartOfWeek:function(){return k("startOfWeek","before")},focusEndOfWeek:function(){return k("endOfWeek","after")}};return s.jsx(y_.Provider,{value:j,children:e.children})}function uv(){var e=x.useContext(y_);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function P7(e,t){var n=x_(),r=cv(e,n,t);return r}var dv=x.createContext(void 0);function T7(e){if(!dm(e.initialProps)){var t={selected:void 0};return s.jsx(dv.Provider,{value:t,children:e.children})}return s.jsx(A7,{initialProps:e.initialProps,children:e.children})}function A7(e){var t=e.initialProps,n=e.children,r=function(l,c,u){var f,m,p;if((f=t.onDayClick)===null||f===void 0||f.call(t,l,c,u),c.selected&&!t.required){(m=t.onSelect)===null||m===void 0||m.call(t,void 0,l,c,u);return}(p=t.onSelect)===null||p===void 0||p.call(t,l,l,c,u)},a={selected:t.selected,onDayClick:r};return s.jsx(dv.Provider,{value:a,children:n})}function v_(){var e=x.useContext(dv);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function M7(e,t){var n=ft(),r=v_(),a=av(),l=lv(),c=uv(),u=c.focusDayAfter,f=c.focusDayBefore,m=c.focusWeekAfter,p=c.focusWeekBefore,g=c.blur,v=c.focus,y=c.focusMonthBefore,k=c.focusMonthAfter,j=c.focusYearBefore,N=c.focusYearAfter,_=c.focusStartOfWeek,w=c.focusEndOfWeek,S=function($){var R,z,X,B;dm(n)?(R=r.onDayClick)===null||R===void 0||R.call(r,e,t,$):Gc(n)?(z=a.onDayClick)===null||z===void 0||z.call(a,e,t,$):Xc(n)?(X=l.onDayClick)===null||X===void 0||X.call(l,e,t,$):(B=n.onDayClick)===null||B===void 0||B.call(n,e,t,$)},E=function($){var R;v(e),(R=n.onDayFocus)===null||R===void 0||R.call(n,e,t,$)},P=function($){var R;g(),(R=n.onDayBlur)===null||R===void 0||R.call(n,e,t,$)},T=function($){var R;(R=n.onDayMouseEnter)===null||R===void 0||R.call(n,e,t,$)},M=function($){var R;(R=n.onDayMouseLeave)===null||R===void 0||R.call(n,e,t,$)},D=function($){var R;(R=n.onDayPointerEnter)===null||R===void 0||R.call(n,e,t,$)},q=function($){var R;(R=n.onDayPointerLeave)===null||R===void 0||R.call(n,e,t,$)},H=function($){var R;(R=n.onDayTouchCancel)===null||R===void 0||R.call(n,e,t,$)},I=function($){var R;(R=n.onDayTouchEnd)===null||R===void 0||R.call(n,e,t,$)},F=function($){var R;(R=n.onDayTouchMove)===null||R===void 0||R.call(n,e,t,$)},te=function($){var R;(R=n.onDayTouchStart)===null||R===void 0||R.call(n,e,t,$)},Y=function($){var R;(R=n.onDayKeyUp)===null||R===void 0||R.call(n,e,t,$)},O=function($){var R;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?u():f();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?f():u();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),m();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),p();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?j():y();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?N():k();break;case"Home":$.preventDefault(),$.stopPropagation(),_();break;case"End":$.preventDefault(),$.stopPropagation(),w();break}(R=n.onDayKeyDown)===null||R===void 0||R.call(n,e,t,$)},U={onClick:S,onFocus:E,onBlur:P,onKeyDown:O,onKeyUp:Y,onMouseEnter:T,onMouseLeave:M,onPointerEnter:D,onPointerLeave:q,onTouchCancel:H,onTouchEnd:I,onTouchMove:F,onTouchStart:te};return U}function D7(){var e=ft(),t=v_(),n=av(),r=lv(),a=dm(e)?t.selected:Gc(e)?n.selected:Xc(e)?r.selected:void 0;return a}function R7(e){return Object.values(Lr).includes(e)}function O7(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var a=e.modifiersClassNames[r];if(a)n.push(a);else if(R7(r)){var l=e.classNames["day_".concat(r)];l&&n.push(l)}}),n}function I7(e,t){var n=Le({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=Le(Le({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function L7(e,t,n){var r,a,l,c=ft(),u=uv(),f=P7(e,t),m=M7(e,f),p=D7(),g=!!(c.onDayClick||c.mode!=="default");x.useEffect(function(){var T;f.outside||u.focusedDay&&g&&Vn(u.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[u.focusedDay,e,n,g,f.outside]);var v=O7(c,f).join(" "),y=I7(c,f),k=!!(f.outside&&!c.showOutsideDays||f.hidden),j=(l=(a=c.components)===null||a===void 0?void 0:a.DayContent)!==null&&l!==void 0?l:s7,N=s.jsx(j,{date:e,displayMonth:t,activeModifiers:f}),_={style:y,className:v,children:N,role:"gridcell"},w=u.focusTarget&&Vn(u.focusTarget,e)&&!f.outside,S=u.focusedDay&&Vn(u.focusedDay,e),E=Le(Le(Le({},_),(r={disabled:f.disabled,role:"gridcell"},r["aria-selected"]=f.selected,r.tabIndex=S||w?0:-1,r)),m),P={isButton:g,isHidden:k,activeModifiers:f,selectedDays:p,buttonProps:E,divProps:_};return P}function F7(e){var t=x.useRef(null),n=L7(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(Cf,Le({name:"day",ref:t},n.buttonProps)):s.jsx("div",Le({},n.divProps))}function $7(e){var t=e.number,n=e.dates,r=ft(),a=r.onWeekNumberClick,l=r.styles,c=r.classNames,u=r.locale,f=r.labels.labelWeekNumber,m=r.formatters.formatWeekNumber,p=m(Number(t),{locale:u});if(!a)return s.jsx("span",{className:c.weeknumber,style:l.weeknumber,children:p});var g=f(Number(t),{locale:u}),v=function(y){a(t,n,y)};return s.jsx(Cf,{name:"week-number","aria-label":g,className:c.weeknumber,style:l.weeknumber,onClick:v,children:p})}function V7(e){var t,n,r=ft(),a=r.styles,l=r.classNames,c=r.showWeekNumber,u=r.components,f=(t=u==null?void 0:u.Day)!==null&&t!==void 0?t:F7,m=(n=u==null?void 0:u.WeekNumber)!==null&&n!==void 0?n:$7,p;return c&&(p=s.jsx("td",{className:l.cell,style:a.cell,children:s.jsx(m,{number:e.weekNumber,dates:e.dates})})),s.jsxs("tr",{className:l.row,style:a.row,children:[p,e.dates.map(function(g){return s.jsx("td",{className:l.cell,style:a.cell,role:"presentation",children:s.jsx(f,{displayMonth:e.displayMonth,date:g})},X$(g))})]})}function zj(e,t,n){for(var r=n!=null&&n.ISOWeek?e_(t):Zy(t,n),a=n!=null&&n.ISOWeek?Rs(e):tr(e,n),l=os(r,a),c=[],u=0;u<=l;u++)c.push(nn(a,u));var f=c.reduce(function(m,p){var g=n!=null&&n.ISOWeek?Jy(p):tv(p,n),v=m.find(function(y){return y.weekNumber===g});return v?(v.dates.push(p),m):(m.push({weekNumber:g,dates:[p]}),m)},[]);return f}function B7(e,t){var n=zj(Bn(e),am(e),t);if(t!=null&&t.useFixedWeeks){var r=J$(e,t);if(r<6){var a=n[n.length-1],l=a.dates[a.dates.length-1],c=ug(l,6-r),u=zj(ug(l,1),c,t);n.push.apply(n,u)}}return n}function z7(e){var t,n,r,a=ft(),l=a.locale,c=a.classNames,u=a.styles,f=a.hideHead,m=a.fixedWeeks,p=a.components,g=a.weekStartsOn,v=a.firstWeekContainsDate,y=a.ISOWeek,k=B7(e.displayMonth,{useFixedWeeks:!!m,ISOWeek:y,locale:l,weekStartsOn:g,firstWeekContainsDate:v}),j=(t=p==null?void 0:p.Head)!==null&&t!==void 0?t:r7,N=(n=p==null?void 0:p.Row)!==null&&n!==void 0?n:V7,_=(r=p==null?void 0:p.Footer)!==null&&r!==void 0?r:e7;return s.jsxs("table",{id:e.id,className:c.table,style:u.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!f&&s.jsx(j,{}),s.jsx("tbody",{className:c.tbody,style:u.tbody,children:k.map(function(w){return s.jsx(N,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),s.jsx(_,{displayMonth:e.displayMonth})]})}function W7(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var U7=W7()?x.useLayoutEffect:x.useEffect,Xp=!1,H7=0;function Wj(){return"react-day-picker-".concat(++H7)}function q7(e){var t,n=e??(Xp?Wj():null),r=x.useState(n),a=r[0],l=r[1];return U7(function(){a===null&&l(Wj())},[]),x.useEffect(function(){Xp===!1&&(Xp=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function K7(e){var t,n,r=ft(),a=r.dir,l=r.classNames,c=r.styles,u=r.components,f=Zc().displayMonths,m=q7(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),p=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,g=[l.month],v=c.month,y=e.displayIndex===0,k=e.displayIndex===f.length-1,j=!y&&!k;a==="rtl"&&(t=[y,k],k=t[0],y=t[1]),y&&(g.push(l.caption_start),v=Le(Le({},v),c.caption_start)),k&&(g.push(l.caption_end),v=Le(Le({},v),c.caption_end)),j&&(g.push(l.caption_between),v=Le(Le({},v),c.caption_between));var N=(n=u==null?void 0:u.Caption)!==null&&n!==void 0?n:JB;return s.jsxs("div",{className:g.join(" "),style:v,children:[s.jsx(N,{id:m,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(z7,{id:p,"aria-labelledby":m,displayMonth:e.displayMonth})]},e.displayIndex)}function Y7(e){var t=ft(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}function Q7(e){var t,n,r=e.initialProps,a=ft(),l=uv(),c=Zc(),u=x.useState(!1),f=u[0],m=u[1];x.useEffect(function(){a.initialFocus&&l.focusTarget&&(f||(l.focus(l.focusTarget),m(!0)))},[a.initialFocus,f,l.focus,l.focusTarget,l]);var p=[a.classNames.root,a.className];a.numberOfMonths>1&&p.push(a.classNames.multiple_months),a.showWeekNumber&&p.push(a.classNames.with_weeknumber);var g=Le(Le({},a.styles.root),a.style),v=Object.keys(r).filter(function(k){return k.startsWith("data-")}).reduce(function(k,j){var N;return Le(Le({},k),(N={},N[j]=r[j],N))},{}),y=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Y7;return s.jsx("div",Le({className:p.join(" "),style:g,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},v,{children:s.jsx(y,{children:c.displayMonths.map(function(k,j){return s.jsx(K7,{displayIndex:j,displayMonth:k},j)})})}))}function G7(e){var t=e.children,n=bB(e,["children"]);return s.jsx($B,{initialProps:n,children:s.jsx(QB,{children:s.jsx(T7,{initialProps:n,children:s.jsx(o7,{initialProps:n,children:s.jsx(l7,{initialProps:n,children:s.jsx(x7,{children:s.jsx(E7,{children:t})})})})})})})}function X7(e){return s.jsx(G7,Le({},e,{children:s.jsx(Q7,{initialProps:e})}))}function fv({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(X7,{showOutsideDays:n,className:Oe("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Oe(mg({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Oe(mg({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"font-bold text-primary",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>s.jsx(Vo,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(Ao,{className:"h-4 w-4"})},...r})}fv.displayName="Calendar";function Z7(e){const t=J7(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,u=x.Children.toArray(l),f=u.find(tz);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function J7(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=rz(a),u=nz(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ez=Symbol("radix.slottable");function tz(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ez}function nz(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function rz(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fm="Popover",[b_]=Os(fm,[sl]),Jc=sl(),[sz,Uo]=b_(fm),w_=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:l,modal:c=!1}=e,u=Jc(t),f=x.useRef(null),[m,p]=x.useState(!1),[g,v]=Aa({prop:r,defaultProp:a??!1,onChange:l,caller:fm});return s.jsx(uk,{...u,children:s.jsx(sz,{scope:t,contentId:Xn(),triggerRef:f,open:g,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:m,onCustomAnchorAdd:x.useCallback(()=>p(!0),[]),onCustomAnchorRemove:x.useCallback(()=>p(!1),[]),modal:c,children:n})})};w_.displayName=fm;var j_="PopoverAnchor",oz=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Uo(j_,n),l=Jc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=a;return x.useEffect(()=>(c(),()=>u()),[c,u]),s.jsx(Wf,{...l,...r,ref:t})});oz.displayName=j_;var N_="PopoverTrigger",C_=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Uo(N_,n),l=Jc(n),c=Je(t,a.triggerRef),u=s.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":P_(a.open),...r,ref:c,onClick:Ie(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:s.jsx(Wf,{asChild:!0,...l,children:u})});C_.displayName=N_;var mv="PopoverPortal",[az,iz]=b_(mv,{forceMount:void 0}),k_=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,l=Uo(mv,t);return s.jsx(az,{scope:t,forceMount:n,children:s.jsx(Is,{present:n||l.open,children:s.jsx(Ic,{asChild:!0,container:a,children:r})})})};k_.displayName=mv;var Ki="PopoverContent",S_=x.forwardRef((e,t)=>{const n=iz(Ki,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,l=Uo(Ki,e.__scopePopover);return s.jsx(Is,{present:r||l.open,children:l.modal?s.jsx(cz,{...a,ref:t}):s.jsx(uz,{...a,ref:t})})});S_.displayName=Ki;var lz=Z7("PopoverContent.RemoveScroll"),cz=x.forwardRef((e,t)=>{const n=Uo(Ki,e.__scopePopover),r=x.useRef(null),a=Je(t,r),l=x.useRef(!1);return x.useEffect(()=>{const c=r.current;if(c)return zy(c)},[]),s.jsx(nm,{as:lz,allowPinchZoom:!0,children:s.jsx(__,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),l.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),uz=x.forwardRef((e,t)=>{const n=Uo(Ki,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(__,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),__=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,...g}=e,v=Uo(Ki,n),y=Jc(n);return By(),s.jsx(em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:l,children:s.jsx(Zi,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>v.onOpenChange(!1),children:s.jsx(Jg,{"data-state":P_(v.open),role:"dialog",id:v.contentId,...y,...g,ref:t,style:{...g.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)"}})})})}),E_="PopoverClose",dz=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Uo(E_,n);return s.jsx($e.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>a.onOpenChange(!1))})});dz.displayName=E_;var fz="PopoverArrow",mz=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Jc(n);return s.jsx(ey,{...a,...r,ref:t})});mz.displayName=fz;function P_(e){return e?"open":"closed"}var hz=w_,pz=C_,xz=k_,T_=S_;const kf=hz,Sf=pz,Ec=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(xz,{children:s.jsx(T_,{ref:a,align:t,sideOffset:n,className:Oe("z-[200] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Ec.displayName=T_.displayName;function mn({value:e,onChange:t,placeholder:n="Pick a date",disabled:r=!1,required:a=!1,minDate:l,maxDate:c,size:u="default",className:f}){const[m,p]=x.useState(!1),g=x.useMemo(()=>{if(!e)return;const N=KV(e,"yyyy-MM-dd",new Date);return Xy(N)?N:void 0},[e]),v=x.useCallback(N=>!!(l&&cm(N,l)||c&&_c(N,c)),[l,c]),y=N=>{t(N?Ir(N,"yyyy-MM-dd"):""),p(!1)},k=N=>{N.stopPropagation(),t("")},j=u==="sm";return s.jsxs(kf,{open:m,onOpenChange:r?void 0:p,children:[s.jsx(Sf,{asChild:!0,children:s.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":m,"aria-required":a,disabled:r,className:Oe("inline-flex w-full items-center gap-2 rounded-md border border-border bg-background","text-foreground outline-none transition-colors","hover:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",j?"h-8 px-2 text-xs":"h-10 px-3 text-sm",f),children:[s.jsx($c,{className:Oe("shrink-0 text-muted-foreground",j?"h-3.5 w-3.5":"h-4 w-4")}),s.jsx("span",{className:Oe("flex-1 text-left",!g&&"text-muted-foreground"),children:g?Ir(g,"MMM d, yyyy"):n}),g&&!a&&s.jsx(Sn,{onClick:k,"aria-label":"Clear date",className:Oe("shrink-0 text-muted-foreground hover:text-foreground",j?"h-3 w-3":"h-3.5 w-3.5")})]})}),s.jsx(Ec,{className:"w-auto p-0 rounded-xl shadow-xl",align:"start",children:s.jsx(fv,{mode:"single",selected:g,onSelect:y,disabled:v,showOutsideDays:!1,initialFocus:!0})})]})}const gz=Array.from({length:12},(e,t)=>t+1),yz=[0,5,10,15,20,25,30,35,40,45,50,55];function vz({value:e,onChange:t,placeholder:n="Pick date & time",disabled:r=!1,required:a=!1,minDate:l,maxDate:c,size:u="default",className:f}){const[m,p]=x.useState(!1),g=x.useMemo(()=>{if(!e)return;const M=new Date(e);return Xy(M)?M:void 0},[e]),v=M=>{t(Ir(M,"yyyy-MM-dd'T'HH:mm:00"))},y=(g==null?void 0:g.getHours())??12,k=y%12||12,j=(g==null?void 0:g.getMinutes())??0,N=y>=12?"PM":"AM",_=M=>{if(!M){t("");return}const D=g?new Date(g):new Date;D.setFullYear(M.getFullYear(),M.getMonth(),M.getDate()),g||D.setHours(12,0,0,0),v(D)},w=(M,D)=>{const q=g?new Date(g):(()=>{const H=new Date;return H.setSeconds(0,0),H})();if(M==="hour"){const H=parseInt(D,10);q.setHours(N==="PM"?H===12?12:H+12:H===12?0:H)}else if(M==="minute")q.setMinutes(parseInt(D,10));else{const H=q.getHours();D==="AM"&&H>=12&&q.setHours(H-12),D==="PM"&&H<12&&q.setHours(H+12)}v(q)},S=x.useCallback(M=>!!(l&&cm(M,l)||c&&_c(M,c)),[l,c]),E=g?Ir(g,"MMM d, yyyy 'at' h:mm a"):null,P=u==="sm",T="h-8 rounded-md border border-border bg-background text-foreground text-xs px-1.5 outline-none focus:ring-1 focus:ring-ring";return s.jsxs(kf,{open:m,onOpenChange:r?void 0:p,children:[s.jsx(Sf,{asChild:!0,children:s.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":m,"aria-required":a,disabled:r,className:Oe("inline-flex w-full items-center gap-2 rounded-md border border-border bg-background","text-foreground outline-none transition-colors","hover:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",P?"h-8 px-2 text-xs":"h-10 px-3 text-sm",f),children:[s.jsx($c,{className:Oe("shrink-0 text-muted-foreground",P?"h-3.5 w-3.5":"h-4 w-4")}),s.jsx("span",{className:Oe("flex-1 text-left",!g&&"text-muted-foreground"),children:E??n}),g&&!a&&s.jsx(Sn,{onClick:M=>{M.stopPropagation(),t("")},"aria-label":"Clear date and time",className:Oe("shrink-0 text-muted-foreground hover:text-foreground",P?"h-3 w-3":"h-3.5 w-3.5")})]})}),s.jsxs(Ec,{className:"w-auto p-0 rounded-xl shadow-xl",align:"start",children:[s.jsx(fv,{mode:"single",selected:g,onSelect:_,disabled:S,showOutsideDays:!1,initialFocus:!0}),s.jsxs("div",{className:"flex items-center gap-2 border-t border-border p-3",children:[s.jsx("span",{className:"mr-1 font-mono text-xs text-muted-foreground",children:"Time"}),s.jsx("select",{value:k,onChange:M=>w("hour",M.target.value),className:T,children:gz.map(M=>s.jsx("option",{value:M,children:String(M).padStart(2,"0")},M))}),s.jsx("span",{className:"select-none text-sm text-muted-foreground",children:":"}),s.jsx("select",{value:j,onChange:M=>w("minute",M.target.value),className:T,children:yz.map(M=>s.jsx("option",{value:M,children:String(M).padStart(2,"0")},M))}),s.jsxs("select",{value:N,onChange:M=>w("ampm",M.target.value),className:T,children:[s.jsx("option",{value:"AM",children:"AM"}),s.jsx("option",{value:"PM",children:"PM"})]})]}),s.jsx("div",{className:"px-3 pb-3",children:s.jsx(Tr,{size:"sm",className:"w-full",onClick:()=>p(!1),children:"Done"})})]})]})}const ko={contact:"Contact",opportunity:"Opportunity","use-case":"Use Case",activity:"Activity",account:"Account",assignment:"Assignment"},Uj={contact:"Hi! Tell me about the new contact — name, email, company, and any other details.",opportunity:"Let's create a new opportunity! What's the name, amount, and who's the contact?","use-case":"Let's set up a new use case. What's the name and which client is it for?",activity:"Log an activity — tell me the type (call, email, meeting, note, demo, proposal, etc.), what it's about, and any outcome or notes.",account:"Let's add a new account. What's the company name and any other details?",assignment:"Let's create a new assignment. What's the title, type (call, email, research, etc.), and who should it be assigned to?"};function bz(e,t){const n=e.toLowerCase(),r={},a=e.match(/(?:name(?:\s+is)?|called|named)\s+([A-Z][^\.,\n]+)/i)||e.match(/^([A-Z][a-z]+ [A-Z][a-z]+)/);a&&(r.name=a[1].trim());const l=e.match(/[\w.-]+@[\w.-]+\.\w+/);l&&(r.email=l[0]);const c=e.match(/\+?[\d\s\-().]{10,}/);c&&(r.phone=c[0].trim());const u=e.match(/(?:at|from|company|works at|with)\s+([A-Z][^\.,\n]+)/i);if(u&&(r.company=u[1].trim()),t==="opportunity"){const f=e.match(/\$?([\d,]+(?:\.\d+)?)\s*[kKmM]?/);if(f){let m=parseFloat(f[1].replace(",",""));(n.includes("k")||n.includes("thousand"))&&(m*=1e3),(n.includes("m")||n.includes("million"))&&(m*=1e6),r.amount=Math.round(m)}r.stage="prospecting"}if(t==="activity"){const m=["call","email","meeting","note","task","demo","proposal","research","handoff","status_update"].find(v=>n.includes(v.replace("_"," "))||n.includes(v));r.type=m??"note",r.description=e;const g=["connected","voicemail","positive","negative","neutral","no show","no_show","follow up needed","follow_up_needed"].find(v=>n.includes(v));g&&(r.outcome=g.replace(/ /g,"_"))}if(t==="use-case"&&(r.stage="discovery"),t==="assignment"){const m=["call","draft","email","follow_up","follow up","research","review","send"].find(p=>n.includes(p));if(m&&(r.assignment_type=m.replace(" ","_")),r.name)r.title=r.name,delete r.name;else{const p=e.split(/[.!?]/)[0].trim();p&&(r.title=p)}n.includes("urgent")?r.priority="urgent":n.includes("high priority")||n.includes("high-priority")?r.priority="high":n.includes("low priority")||n.includes("low-priority")?r.priority="low":r.priority="normal"}return r}function wz({type:e,onClose:t}){const[n,r]=x.useState([{role:"assistant",content:Uj[e]??Uj.contact}]),[a,l]=x.useState(""),[c,u]=x.useState(!1),[f,m]=x.useState(null),[p,g]=x.useState(!1),[v,y]=x.useState(!1),k=x.useRef(null),j=x.useRef(null),N=i2(),_=l2(),w=c2(),S=d2(),E=f2(),P=y2();x.useEffect(()=>{var I;(I=k.current)==null||I.scrollTo({top:k.current.scrollHeight,behavior:"smooth"})},[n]),x.useEffect(()=>{var I;(I=j.current)==null||I.focus()},[]);const T=()=>{if(!a.trim()||c)return;const I=a.trim();l(""),r(Y=>[...Y,{role:"user",content:I}]);const F=bz(I,e);m(Y=>({...Y??{},...F}));const te=Object.entries({...f??{},...F}).filter(([,Y])=>Y!==void 0&&Y!=="").map(([Y,O])=>`• **${Y}**: ${O}`).join(`
|
|
563
|
+
`);r(Y=>[...Y,{role:"assistant",content:te?`Got it! Here's what I'll create:
|
|
564
|
+
|
|
565
|
+
${te}
|
|
566
|
+
|
|
567
|
+
Does this look right? Reply "yes" to confirm or add more details.`:"Thanks! Can you share more details like name, email, or any other relevant information?"}])},M=async()=>{if(!(!f||c)){u(!0);try{e==="contact"?await N.mutateAsync(f):e==="account"?await _.mutateAsync(f):e==="opportunity"?await w.mutateAsync(f):e==="use-case"?await S.mutateAsync(f):e==="activity"?await E.mutateAsync(f):e==="assignment"&&await P.mutateAsync(f),g(!0),xe({title:`${ko[e]} created!`,description:"Successfully added to your CRM."}),setTimeout(t,1200)}catch(I){xe({title:`Failed to create ${ko[e]}`,description:I instanceof Error?I.message:"Please try again.",variant:"destructive"})}finally{u(!1)}}},D=n[n.length-1],q=(D==null?void 0:D.role)==="assistant"&&D.content.includes("Does this look right")&&f!==null&&!p,H=I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),a.toLowerCase().trim()==="yes"||a.toLowerCase().trim()==="confirm"?M():T())};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kn,{className:"w-4 h-4 text-accent"}),s.jsxs("span",{className:"font-display font-bold text-foreground",children:["New ",ko[e]]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>y(!v),className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border transition-colors ${v?"border-border bg-muted text-foreground":"border-border/60 text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[s.jsx(Fa,{className:"w-3 h-3"}),s.jsx("span",{children:"Form"})]}),s.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-muted transition-colors",children:s.jsx(Sn,{className:"w-4 h-4 text-muted-foreground"})})]})]}),v?s.jsx(A_,{type:e,onClose:t,onBack:()=>y(!1),backLabel:"Back to AI chat"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{ref:k,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[n.map((I,F)=>s.jsx("div",{className:`flex ${I.role==="user"?"justify-end":"justify-start"}`,children:s.jsx("div",{className:`max-w-[85%] rounded-2xl px-3.5 py-2.5 text-sm leading-relaxed whitespace-pre-wrap ${I.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:I.content})},F)),p&&s.jsx("div",{className:"flex justify-center",children:s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full bg-success/15 text-success text-sm font-semibold",children:[s.jsx(If,{className:"w-4 h-4"})," Created successfully!"]})})]}),q&&s.jsx("div",{className:"px-4 pb-2",children:s.jsx("button",{onClick:M,disabled:c,className:"w-full py-2.5 rounded-xl bg-success text-success-foreground text-sm font-semibold hover:bg-success/90 transition-colors disabled:opacity-50",children:c?"Creating...":`Confirm & Create ${ko[e]}`})}),s.jsxs("div",{className:"flex items-end gap-2 p-3 border-t border-border",children:[s.jsx("textarea",{ref:j,value:a,onChange:I=>l(I.target.value),onKeyDown:H,placeholder:"Type details or 'yes' to confirm...",rows:1,className:"flex-1 resize-none bg-muted rounded-xl px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-primary/30 min-h-[38px] max-h-28",style:{height:"auto"}}),s.jsx("button",{onClick:()=>{a.toLowerCase().trim()==="yes"||a.toLowerCase().trim()==="confirm"?M():T()},disabled:!a.trim()||c,className:"p-2 rounded-xl bg-primary text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-40",children:s.jsx(zg,{className:"w-4 h-4"})})]})]})]})}const Hj={contact:[{key:"first_name",label:"First Name",placeholder:"First name",required:!0},{key:"last_name",label:"Last Name",placeholder:"Last name"},{key:"email",label:"Email",placeholder:"email@example.com",inputType:"email"},{key:"phone",label:"Phone",placeholder:"(555) 123-4567",inputType:"tel"},{key:"company_name",label:"Company",placeholder:"Company name"}],opportunity:[{key:"name",label:"Opportunity Name",placeholder:"e.g. Acme Enterprise",required:!0},{key:"amount",label:"Amount ($)",placeholder:"850000",inputType:"number"},{key:"close_date",label:"Close Date",inputType:"date"},{key:"description",label:"Description",placeholder:"Optional notes",fieldType:"textarea"}],"use-case":[{key:"name",label:"Name",placeholder:"e.g. Corporate Relocation",required:!0},{key:"account_id",label:"Account",fieldType:"account-select",required:!0},{key:"stage",label:"Stage",fieldType:"select",options:["discovery","poc","production","scaling","sunset"]},{key:"attributed_arr",label:"Attributed ARR ($)",placeholder:"120000",inputType:"number"},{key:"target_prod_date",label:"Target Prod Date",inputType:"date"},{key:"description",label:"Description",placeholder:"Any additional details",fieldType:"textarea"}],activity:[{key:"type",label:"Type",fieldType:"select",options:["call","email","meeting","note","task","demo","proposal","research","handoff"],required:!0},{key:"subject",label:"Subject",placeholder:"What was this activity about?",required:!0},{key:"subject_type",label:"Linked To",fieldType:"subject-type-select",placeholder:"Link to a CRM record (optional)"},{key:"subject_id",label:"Record",fieldType:"entity-select",dependsOn:{key:"subject_type"}},{key:"occurred_at",label:"When",inputType:"datetime-local",placeholder:"When did this happen?"},{key:"outcome",label:"Outcome",fieldType:"datalist",datalistId:"outcome-suggestions",suggestions:["connected","voicemail","positive","negative","neutral","no_show","follow_up_needed"],placeholder:"e.g. connected, positive, voicemail"},{key:"body",label:"Notes",placeholder:"Additional details...",fieldType:"textarea"}],account:[{key:"name",label:"Company Name",placeholder:"e.g. Acme Corp",required:!0},{key:"industry",label:"Industry",placeholder:"e.g. Real Estate, Technology"},{key:"website",label:"Website",placeholder:"https://acme.com",inputType:"url"},{key:"domain",label:"Domain",placeholder:"acme.com"}],assignment:[{key:"title",label:"Title",placeholder:"e.g. Follow up with Acme about contract",required:!0},{key:"assignment_type",label:"Type",fieldType:"select",options:["call","draft","email","follow_up","research","review","send"],required:!0},{key:"assigned_to",label:"Assign To",fieldType:"actor-select",required:!0},{key:"subject_type",label:"Linked To",fieldType:"subject-type-select"},{key:"subject_id",label:"Record",fieldType:"entity-select",dependsOn:{key:"subject_type"}},{key:"priority",label:"Priority",fieldType:"select",options:["low","normal","high","urgent"]},{key:"due_at",label:"Due Date",inputType:"date"},{key:"context",label:"Context",placeholder:"Brief context for the assignee",fieldType:"textarea"},{key:"description",label:"Description",placeholder:"Additional details",fieldType:"textarea"}]},jz=[{value:"",label:"None (no link)"},{value:"contact",label:"Contact"},{value:"account",label:"Account"},{value:"opportunity",label:"Opportunity"},{value:"use_case",label:"Use Case"}];function Nz({subjectType:e,value:t,onChange:n}){const{data:r}=a2(e==="contact"?{limit:100}:void 0),{data:a}=Ay(e==="account"?{limit:100}:void 0),{data:l}=My(e==="opportunity"?{limit:100}:void 0),{data:c}=u2(e==="use_case"?{limit:100}:void 0),u="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring";let f=[];return e==="contact"?f=((r==null?void 0:r.data)??[]).map(m=>({id:m.id,label:`${m.first_name??""} ${m.last_name??""}`.trim()||m.email||m.id})):e==="account"?f=((a==null?void 0:a.data)??[]).map(m=>({id:m.id,label:m.name??m.id})):e==="opportunity"?f=((l==null?void 0:l.data)??[]).map(m=>({id:m.id,label:m.name??m.id})):e==="use_case"&&(f=((c==null?void 0:c.data)??[]).map(m=>({id:m.id,label:m.name??m.id}))),e?s.jsxs("select",{value:t,onChange:m=>n(m.target.value),className:`${u} pr-3`,children:[s.jsxs("option",{value:"",children:["Select ",e.replace("_"," "),"…"]}),f.map(m=>s.jsx("option",{value:m.id,children:m.label},m.id))]}):null}function Cz({value:e,onChange:t}){const{data:n}=Kc({limit:100,is_active:!0}),r=(n==null?void 0:n.data)??(n==null?void 0:n.actors)??[];return s.jsxs("select",{value:e,onChange:l=>t(l.target.value),className:"w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring pr-3",children:[s.jsx("option",{value:"",children:"Select actor…"}),r.map(l=>s.jsxs("option",{value:l.id,children:[l.display_name," (",l.actor_type,")"]},l.id))]})}function A_({type:e,onClose:t,onBack:n,backLabel:r}){const[a,l]=x.useState({}),[c,u]=x.useState(!1),{data:f}=Ay({limit:200}),m=(f==null?void 0:f.data)??[],p=i2(),g=l2(),v=c2(),y=d2(),k=f2(),j=y2(),N=Hj[e]??Hj.contact,_=()=>{var T,M,D,q,H;return e==="contact"?!!((T=a.first_name)!=null&&T.trim()):e==="activity"?!!a.type&&!!((M=a.subject)!=null&&M.trim()):e==="use-case"?!!((D=a.name)!=null&&D.trim())&&!!a.account_id:e==="assignment"?!!((q=a.title)!=null&&q.trim())&&!!a.assignment_type&&!!a.assigned_to:!!((H=a.name)!=null&&H.trim())},w=(T,M)=>l(D=>({...D,[T]:M})),S=async()=>{if(!(!_()||c)){u(!0);try{const T={...a};e==="contact"&&delete T.name,e==="opportunity"&&(a.amount&&(T.amount=parseFloat(a.amount)||0),T.stage="prospecting"),e==="use-case"&&(T.stage||(T.stage="discovery"),a.attributed_arr&&(T.attributed_arr=parseFloat(a.attributed_arr)||0)),e==="account"&&a.website&&(T.website=a.website.startsWith("http")?a.website:`https://${a.website}`),e==="activity"&&(a.occurred_at&&(T.occurred_at=new Date(a.occurred_at).toISOString()),a.subject_type||(delete T.subject_type,delete T.subject_id),a.subject_id||delete T.subject_id,a.outcome||delete T.outcome,a.occurred_at||delete T.occurred_at),e==="assignment"&&(a.due_at&&(T.due_at=new Date(a.due_at+"T00:00:00").toISOString()),a.subject_type||(delete T.subject_type,delete T.subject_id),a.subject_id||delete T.subject_id,a.context||delete T.context,a.description||delete T.description,a.due_at||delete T.due_at,a.priority||(T.priority="normal")),e==="contact"?await p.mutateAsync(T):e==="account"?await g.mutateAsync(T):e==="opportunity"?await v.mutateAsync(T):e==="use-case"?await y.mutateAsync(T):e==="activity"?await k.mutateAsync(T):e==="assignment"&&await j.mutateAsync(T);const M=a.first_name??a.title??a.name??a.subject??ko[e];xe({title:`${ko[e]} created`,description:`${M} has been added.`}),t()}catch(T){xe({title:`Failed to create ${ko[e]}`,description:T instanceof Error?T.message:"Please try again.",variant:"destructive"})}finally{u(!1)}}},E="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",P=T=>{if(!T.dependsOn)return!0;const M=a[T.dependsOn.key];return M?T.dependsOn.values?T.dependsOn.values.includes(M):!0:!1};return s.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[s.jsx("button",{onClick:n,className:"flex items-center gap-1.5 text-xs text-accent hover:underline mb-5",children:r?s.jsxs(s.Fragment,{children:[s.jsx(kn,{className:"w-3 h-3"})," ",r]}):s.jsxs(s.Fragment,{children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]})}),s.jsxs("div",{className:"space-y-4",children:[N.filter(P).map(T=>{var M;return s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:[T.label,T.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),T.fieldType==="select"?s.jsxs("select",{value:a[T.key]||"",onChange:D=>w(T.key,D.target.value),className:`${E} pr-3`,children:[s.jsxs("option",{value:"",children:["Select ",T.label.toLowerCase(),"…"]}),(M=T.options)==null?void 0:M.map(D=>s.jsx("option",{value:D,children:D.replace(/_/g," ").replace(/\b\w/g,q=>q.toUpperCase())},D))]}):T.fieldType==="account-select"?s.jsxs("select",{value:a[T.key]||"",onChange:D=>w(T.key,D.target.value),className:`${E} pr-3`,children:[s.jsx("option",{value:"",children:"Select account…"}),m.map(D=>s.jsx("option",{value:D.id,children:D.name},D.id))]}):T.fieldType==="subject-type-select"?s.jsx("select",{value:a[T.key]||"",onChange:D=>{w(T.key,D.target.value),w("subject_id","")},className:`${E} pr-3`,children:jz.map(D=>s.jsx("option",{value:D.value,children:D.label},D.value))}):T.fieldType==="entity-select"?s.jsx(Nz,{subjectType:a.subject_type||"",value:a[T.key]||"",onChange:D=>w(T.key,D)}):T.fieldType==="actor-select"?s.jsx(Cz,{value:a[T.key]||"",onChange:D=>w(T.key,D)}):T.fieldType==="datalist"?s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"text",value:a[T.key]||"",onChange:D=>w(T.key,D.target.value),placeholder:T.placeholder,list:T.datalistId,className:`${E} pr-3`}),T.datalistId&&T.suggestions&&s.jsx("datalist",{id:T.datalistId,children:T.suggestions.map(D=>s.jsx("option",{value:D},D))})]}):T.fieldType==="textarea"?s.jsx("textarea",{value:a[T.key]||"",onChange:D=>w(T.key,D.target.value),placeholder:T.placeholder,rows:3,className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring resize-none"}):T.inputType==="date"?s.jsx(mn,{value:a[T.key]||"",onChange:D=>w(T.key,D),required:T.required}):T.inputType==="datetime-local"?s.jsx(vz,{value:a[T.key]||"",onChange:D=>w(T.key,D),required:T.required}):s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:T.inputType??"text",value:a[T.key]||"",onChange:D=>w(T.key,D.target.value),placeholder:T.placeholder,className:`${E} pr-8`}),s.jsx(ls,{className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground/40 pointer-events-none"})]})]},T.key)}),s.jsx("button",{onClick:S,disabled:!_()||c,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors mt-2",children:c?"Creating...":`Create ${ko[e]}`})]})]})}function kz(){const{quickAddType:e,closeQuickAdd:t}=nt(),{enabled:n}=hr();return e?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm z-[80]",onClick:t}),s.jsx("div",{className:"fixed right-0 top-0 h-full w-full max-w-md bg-card border-l border-border z-[90] shadow-2xl flex flex-col animate-slide-in-right",children:n?s.jsx(wz,{type:e,onClose:t}):s.jsx(A_,{type:e,onClose:t,onBack:t})})]}):null}const Pc={prospecting:{label:"Prospecting",color:"#94a3b8"},qualification:{label:"Qualification",color:"#60a5fa"},proposal:{label:"Proposal",color:"#a78bfa"},negotiation:{label:"Negotiation",color:"#fb923c"},closed_won:{label:"Won",color:"#4ade80"},closed_lost:{label:"Lost",color:"#f87171"},new:{label:"New",color:"#94a3b8"},contacted:{label:"Contacted",color:"#60a5fa"},qualified:{label:"Qualified",color:"#a78bfa"},active:{label:"Active",color:"#fb923c"},inactive:{label:"Inactive",color:"#f87171"}},Po={discovery:{label:"Discovery",color:"#94a3b8"},poc:{label:"PoC",color:"#60a5fa"},production:{label:"Production",color:"#4ade80"},scaling:{label:"Scaling",color:"#fb923c"},sunset:{label:"Sunset",color:"#f87171"}};function Tc({stage:e}){const t=Pc[e]??{label:e,color:"#94a3b8"};return s.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:t.color+"18",color:t.color},children:t.label})}function Sz({score:e}){const t=e>=80?"hsl(152, 55%, 42%)":e>=50?"hsl(38, 92%, 50%)":"hsl(var(--muted-foreground))";return s.jsx("span",{className:"inline-flex items-center justify-center w-8 h-6 rounded-lg text-xs font-mono font-bold",style:{backgroundColor:t+"18",color:t},children:e})}function _z(){return s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-success animate-pulse-dot"})}function M_(e){switch(e){case"call":return s.jsx(bc,{className:"w-3.5 h-3.5"});case"email":return s.jsx(_C,{className:"w-3.5 h-3.5"});case"meeting":return s.jsx(Ni,{className:"w-3.5 h-3.5"});case"task":return s.jsx(EA,{className:"w-3.5 h-3.5"});case"demo":return s.jsx(CA,{className:"w-3.5 h-3.5"});case"proposal":return s.jsx(Fa,{className:"w-3.5 h-3.5"});case"research":return s.jsx(el,{className:"w-3.5 h-3.5"});case"handoff":return s.jsx(iA,{className:"w-3.5 h-3.5"});case"status_update":return s.jsx(yc,{className:"w-3.5 h-3.5"});case"stage_change":return s.jsx(kA,{className:"w-3.5 h-3.5"});case"health_update":return s.jsx(Lf,{className:"w-3.5 h-3.5"});default:return s.jsx(TC,{className:"w-3.5 h-3.5"})}}const Ez={connected:"hsl(152, 55%, 42%)",positive:"hsl(152, 55%, 42%)",voicemail:"hsl(38, 92%, 50%)",neutral:"hsl(38, 92%, 50%)",follow_up_needed:"hsl(38, 92%, 50%)",negative:"hsl(var(--destructive))",no_show:"hsl(var(--destructive))"};function Pz({outcome:e}){const t=Ez[e]??"hsl(var(--muted-foreground))",n=e.replace(/_/g," ");return s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-md text-[10px] font-medium capitalize",style:{backgroundColor:t+"18",color:t},children:n})}const Tz={contact:"Contact",account:"Account",opportunity:"Opp",use_case:"Use Case"},Az={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};function D_({limit:e,activities:t,filterWindow:n}){const{openDrawer:r}=nt(),a=n?100:e??20,{data:l,isLoading:c}=Dy(t?void 0:{limit:a});let u=t??(l==null?void 0:l.data)??[];if(n){const m=new Date;n==="today"||m.setDate(m.getDate()-7),m.setHours(0,0,0,0),u=u.filter(p=>{const g=p.occurred_at??p.created_at??p.timestamp;return g?new Date(g)>=m:!1})}const f=e?u.slice(0,e):u;return c&&!t?s.jsx("div",{className:"space-y-3",children:[...Array(4)].map((m,p)=>s.jsxs("div",{className:"flex gap-3 animate-pulse",children:[s.jsx("div",{className:"w-7 h-7 rounded-xl bg-muted flex-shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx("div",{className:"h-3 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-2.5 bg-muted rounded w-1/2"})]})]},p))}):f.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet."}):s.jsx("div",{className:"space-y-1",children:f.map(m=>{const p=m.contact_name??m.contactName??"",g=m.description??m.body??m.subject??"",v=m.occurred_at??m.created_at??m.timestamp??"",y=m.contact_id,k=m.subject_type&&m.subject_id,j=k||y,N=()=>{if(k){const w=Az[m.subject_type];w&&r(w,m.subject_id)}else y&&r("contact",y)},_=[];return m.performer_name?_.push(m.performer_name):p&&_.push(p),v&&_.push(new Date(v).toLocaleDateString()),s.jsxs("div",{className:`flex gap-3 py-2 ${j?"cursor-pointer hover:bg-muted/40 rounded-xl px-2 -mx-2 transition-colors":""}`,onClick:j?N:void 0,children:[s.jsx("div",{className:"w-7 h-7 rounded-xl bg-muted flex items-center justify-center text-muted-foreground flex-shrink-0 mt-0.5",children:M_(m.type)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("p",{className:"text-sm text-foreground flex-1 min-w-0 truncate",children:g||`${m.type}${p?` with ${p}`:""}`}),m.outcome&&s.jsx(Pz,{outcome:m.outcome})]}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[k&&s.jsx("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-primary/80 bg-primary/8 px-1.5 py-0.5 rounded",children:Tz[m.subject_type]??m.subject_type}),m.performer_name&&s.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-muted-foreground",children:[m.performed_by?s.jsx(fn,{className:"w-2.5 h-2.5"}):s.jsx(Bc,{className:"w-2.5 h-2.5"}),m.performer_name]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:_.filter(Boolean).join(" · ")})]})]})]},m.id)})})}function Mz(e,t){if(t==null)return"—";if(e==="boolean")return t?"Yes":"No";if(e==="date")try{return new Date(String(t)).toLocaleDateString()}catch{return String(t)}return Array.isArray(t)?t.join(", "):String(t)}function mm({objectType:e,values:t}){const[n,r]=x.useState(!1),{data:a}=ll(e),l=(a==null?void 0:a.fields)??[];return l.length===0?null:s.jsxs("div",{className:"px-4 mx-4 mt-2 border-t border-border pt-3",children:[s.jsxs("button",{onClick:()=>r(!n),className:"flex items-center gap-1.5 w-full text-left",children:[s.jsxs("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide flex-1",children:["Custom Fields",s.jsxs("span",{className:"ml-1.5 font-mono font-normal text-muted-foreground/50",children:["(",l.length,")"]})]}),n?s.jsx($r,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Wn,{className:"w-3.5 h-3.5 text-muted-foreground"})]}),n&&s.jsx("div",{className:"mt-3 space-y-2",children:l.map(c=>{const u=t==null?void 0:t[c.field_key],f=u!=null&&u!=="";return s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[c.label,c.is_required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("span",{className:f?"text-sm text-foreground text-right":"text-xs text-muted-foreground/50",children:f?Mz(c.field_type,u):"—"})]},c.field_key)})})]})}const qj={connected:"hsl(152, 55%, 42%)",positive:"hsl(152, 55%, 42%)",voicemail:"hsl(38, 92%, 50%)",neutral:"hsl(38, 92%, 50%)",follow_up_needed:"hsl(38, 92%, 50%)",negative:"hsl(var(--destructive))",no_show:"hsl(var(--destructive))"},Dz={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};function R_({activities:e,emptyMessage:t="No activity yet."}){const{openDrawer:n}=nt();return e.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:t}):s.jsx("div",{className:"space-y-1",children:e.map((r,a)=>{const l=r.description??r.body??r.note??r.subject??"",c=r.occurred_at??r.created_at??"",u=r.subject_type&&r.subject_id,f=u||!!r.contact_id,m=()=>{if(u){const p=Dz[r.subject_type];p&&n(p,r.subject_id)}else r.contact_id&&n("contact",r.contact_id)};return s.jsxs("div",{className:`flex gap-3 py-2 ${f?"cursor-pointer hover:bg-muted/40 rounded-xl px-2 -mx-2 transition-colors":""}`,onClick:f?m:void 0,children:[s.jsx("div",{className:"w-7 h-7 rounded-xl bg-muted flex items-center justify-center text-muted-foreground flex-shrink-0 mt-0.5",children:M_(r.type)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("p",{className:"text-sm text-foreground flex-1 min-w-0 truncate",children:l||r.type}),r.outcome&&s.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-md text-[10px] font-medium capitalize flex-shrink-0",style:{backgroundColor:(qj[r.outcome]??"hsl(var(--muted-foreground))")+"18",color:qj[r.outcome]??"hsl(var(--muted-foreground))"},children:r.outcome.replace(/_/g," ")})]}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[r.performer_name&&s.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-muted-foreground",children:[s.jsx(fn,{className:"w-2.5 h-2.5"}),r.performer_name]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c?new Date(c).toLocaleDateString():""})]})]})]},r.id??a)})})}const Rz={note:"#6366f1",research:"#8b5cf6",preference:"#ec4899",objection:"#ef4444",competitive_intel:"#f97316",relationship_map:"#14b8a6",meeting_notes:"#3b82f6",summary:"#06b6d4",transcript:"#64748b",agent_reasoning:"#a855f7"};function hm({subjectType:e,subjectId:t}){const[n,r]=x.useState(!0),[a,l]=x.useState(null),{data:c,isLoading:u}=bf({subject_type:e,subject_id:t,is_current:!0,limit:50}),{data:f}=R6({subject_type:e,subject_id:t,limit:10}),m=v2(),p=(c==null?void 0:c.data)??[],g=(f==null?void 0:f.data)??[],v=p.reduce((N,_)=>{const w=_.context_type??"note";return N[w]||(N[w]=[]),N[w].push(_),N},{}),y=Object.keys(v).sort(),k=a?v[a]??[]:p,j=async N=>{await m.mutateAsync(N),xe({title:"Context entry reviewed"})};return u?s.jsxs("div",{className:"space-y-2 animate-pulse",children:[s.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),s.jsx("div",{className:"h-16 bg-muted rounded"}),s.jsx("div",{className:"h-16 bg-muted rounded"})]}):p.length===0&&g.length===0?null:s.jsxs("div",{className:"px-4 mx-4 mt-4",children:[s.jsxs("button",{onClick:()=>r(!n),className:"flex items-center gap-1.5 w-full text-left mb-2",children:[s.jsx(Fc,{className:"w-3.5 h-3.5 text-primary"}),s.jsxs("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide flex-1",children:["Context",s.jsxs("span",{className:"ml-1.5 font-mono font-normal text-muted-foreground/50",children:["(",p.length,")"]})]}),g.length>0&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-warning font-medium",children:[s.jsx(cs,{className:"w-3 h-3"})," ",g.length," stale"]}),n?s.jsx($r,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Wn,{className:"w-3.5 h-3.5 text-muted-foreground"})]}),n&&s.jsxs("div",{className:"space-y-3",children:[y.length>1&&s.jsxs("div",{className:"flex gap-1 flex-wrap",children:[s.jsx("button",{onClick:()=>l(null),className:`px-2 py-0.5 rounded-md text-[10px] font-semibold transition-all ${a?"bg-muted text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary"}`,children:"All"}),y.map(N=>s.jsxs("button",{onClick:()=>l(a===N?null:N),className:`px-2 py-0.5 rounded-md text-[10px] font-semibold transition-all ${a===N?"bg-primary/15 text-primary":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[N.replace(/_/g," "),s.jsx("span",{className:"ml-1 opacity-50",children:v[N].length})]},N))]}),g.length>0&&!a&&s.jsxs("div",{className:"rounded-xl border border-warning/30 bg-warning/5 p-3 space-y-2",children:[s.jsx("p",{className:"text-[10px] font-semibold text-warning uppercase tracking-wide",children:"Needs Review"}),g.map(N=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-foreground truncate",children:N.title??N.context_type}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Expired ",N.valid_until?new Date(N.valid_until).toLocaleDateString():""]})]}),s.jsxs("button",{onClick:()=>j(N.id),disabled:m.isPending,className:"flex items-center gap-1 px-2 py-1 rounded-md text-[10px] font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors",children:[s.jsx(er,{className:"w-3 h-3"})," Review"]})]},N.id))]}),k.map(N=>{const _=Rz[N.context_type]??"#94a3b8",w=N.valid_until&&new Date(N.valid_until)<new Date;return s.jsxs("div",{className:`rounded-xl border p-3 space-y-1.5 ${w?"border-warning/30 bg-warning/5":"border-border bg-card"}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-semibold capitalize",style:{backgroundColor:_+"18",color:_},children:N.context_type.replace(/_/g," ")}),N.confidence!=null&&s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[Math.round(N.confidence*100),"%"]}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(N.created_at).toLocaleDateString()})]}),N.title&&s.jsx("p",{className:"text-sm font-medium text-foreground",children:N.title}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:N.body}),N.tags&&N.tags.length>0&&s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[s.jsx(MC,{className:"w-2.5 h-2.5 text-muted-foreground"}),N.tags.map(S=>s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-muted text-[10px] text-muted-foreground",children:S},S))]}),N.source&&s.jsxs("p",{className:"text-[10px] text-muted-foreground/60",children:["Source: ",N.source]})]},N.id)})]})]})}function pm({subjectType:e,subjectId:t,onClose:n}){var m,p,g;const[r,a]=x.useState(!0),{data:l,isLoading:c,error:u}=I6(e,t,{format:"json",include_stale:r});if(c)return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Zp,{onClose:n}),s.jsxs("div",{className:"flex-1 p-5 space-y-4 animate-pulse",children:[s.jsx("div",{className:"h-6 bg-muted rounded w-1/2"}),s.jsx("div",{className:"h-20 bg-muted rounded"}),s.jsx("div",{className:"h-20 bg-muted rounded"}),s.jsx("div",{className:"h-20 bg-muted rounded"})]})]});if(u)return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Zp,{onClose:n}),s.jsx("div",{className:"p-5 text-sm text-destructive",children:"Failed to load briefing."})]});const f=(l==null?void 0:l.briefing)??l;return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Zp,{onClose:n}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[((m=f==null?void 0:f.staleness_warnings)==null?void 0:m.length)>0&&s.jsx(_d,{icon:s.jsx(cs,{className:"w-3.5 h-3.5 text-warning"}),title:"Stale Context",defaultOpen:!0,children:s.jsx("div",{className:"space-y-2",children:f.staleness_warnings.map(v=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx(cs,{className:"w-3 h-3 text-warning flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-foreground",children:v.title??v.context_type}),s.jsxs("span",{className:"text-muted-foreground ml-1.5",children:["expired ",v.valid_until?new Date(v.valid_until).toLocaleDateString():""]})]})]},v.id))})}),((p=f==null?void 0:f.activities)==null?void 0:p.length)>0&&s.jsx(_d,{icon:s.jsx(yc,{className:"w-3.5 h-3.5 text-primary"}),title:`Recent Activities (${f.activities.length})`,defaultOpen:!0,children:s.jsx("div",{className:"space-y-1.5",children:f.activities.slice(0,10).map(v=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx("span",{className:"w-16 flex-shrink-0 text-muted-foreground",children:new Date(v.occurred_at??v.created_at).toLocaleDateString()}),s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-muted text-[10px] font-medium capitalize flex-shrink-0",children:(v.type??v.activity_type??"").replace(/_/g," ")}),s.jsx("span",{className:"text-foreground truncate",children:v.description??v.body??""})]},v.id))})}),((g=f==null?void 0:f.open_assignments)==null?void 0:g.length)>0&&s.jsx(_d,{icon:s.jsx(rf,{className:"w-3.5 h-3.5 text-primary"}),title:`Open Assignments (${f.open_assignments.length})`,defaultOpen:!0,children:s.jsx("div",{className:"space-y-1.5",children:f.open_assignments.map(v=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx(Oz,{status:v.status}),s.jsx("span",{className:"text-foreground flex-1 truncate",children:v.title}),s.jsx(Iz,{priority:v.priority})]},v.id))})}),(f==null?void 0:f.context_entries)&&Object.keys(f.context_entries).length>0&&s.jsx(_d,{icon:s.jsx(Fc,{className:"w-3.5 h-3.5 text-primary"}),title:"Context",defaultOpen:!0,children:s.jsx("div",{className:"space-y-3",children:Object.entries(f.context_entries).map(([v,y])=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:v.replace(/_/g," ")}),s.jsx("div",{className:"space-y-1.5",children:y.map(k=>s.jsxs("div",{className:"rounded-lg bg-muted/50 p-2",children:[k.title&&s.jsx("p",{className:"text-xs font-medium text-foreground",children:k.title}),s.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-2",children:k.body})]},k.id))})]},v))})}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:v=>a(v.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-primary"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Include stale context"})]})]})]})}function Zp({onClose:e}){return s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsx(Fa,{className:"w-4 h-4 text-primary"}),s.jsx("h2",{className:"font-display font-bold text-foreground flex-1",children:"Briefing"}),s.jsx("button",{onClick:e,className:"p-1 rounded-lg hover:bg-muted transition-colors",children:s.jsx(Sn,{className:"w-4 h-4 text-muted-foreground"})})]})}function _d({icon:e,title:t,children:n,defaultOpen:r=!1}){const[a,l]=x.useState(r);return s.jsxs("div",{className:"rounded-xl border border-border",children:[s.jsxs("button",{onClick:()=>l(!a),className:"flex items-center gap-2 w-full p-3 text-left",children:[e,s.jsx("span",{className:"text-xs font-display font-bold text-foreground flex-1",children:t}),a?s.jsx($r,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Wn,{className:"w-3.5 h-3.5 text-muted-foreground"})]}),a&&s.jsx("div",{className:"px-3 pb-3",children:n})]})}function Oz({status:e}){const n={pending:"#f59e0b",accepted:"#3b82f6",in_progress:"#8b5cf6",blocked:"#ef4444",completed:"#22c55e",declined:"#94a3b8",cancelled:"#94a3b8"}[e]??"#94a3b8";return s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium capitalize flex-shrink-0",style:{backgroundColor:n+"18",color:n},children:e.replace(/_/g," ")})}function Iz({priority:e}){const t={urgent:"#ef4444",high:"#f97316",normal:"#3b82f6",low:"#94a3b8"};return s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:t[e]??"#94a3b8"},title:e})}const io="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",la="text-xs font-mono text-muted-foreground uppercase tracking-wider",Lz=["lead","qualified","opportunity","customer","churned"];function Fz({contact:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[u,f]=x.useState({first_name:e.first_name??"",last_name:e.last_name??"",email:e.email??"",phone:e.phone??"",company_name:e.company_name??"",title:e.title??"",lifecycle_stage:e.lifecycle_stage??"lead",source:e.source??"",owner_id:e.owner_id??""}),[m,p]=x.useState(()=>{const w={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))w[S]=String(E??"");return w}),{data:g}=Jf(),v=(g==null?void 0:g.data)??[],{data:y}=ll("contact"),k=(y==null?void 0:y.fields)??[],j=(w,S)=>f(E=>({...E,[w]:S})),N=(w,S)=>p(E=>({...E,[w]:S})),_=()=>{const w={};for(const[E,P]of Object.entries(u))P!==""&&(w[E]=P);const S={};for(const E of k){const P=m[E.field_key]??"";P!==""&&(E.field_type==="number"?S[E.field_key]=Number(P):E.field_type==="boolean"?S[E.field_key]=P==="true":S[E.field_key]=P)}Object.keys(S).length>0&&(w.custom_fields=S),t(w)};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-accent hover:underline",children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Editing contact"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:la,children:["First Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:u.first_name,onChange:w=>j("first_name",w.target.value),placeholder:"First name",className:io})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:la,children:"Last Name"}),s.jsx("input",{type:"text",value:u.last_name,onChange:w=>j("last_name",w.target.value),placeholder:"Last name",className:io})]})]}),[{key:"email",label:"Email",type:"email",placeholder:"email@example.com"},{key:"phone",label:"Phone",type:"tel",placeholder:"(555) 123-4567"},{key:"company_name",label:"Company",type:"text",placeholder:"Company name"},{key:"title",label:"Title",type:"text",placeholder:"Job title"},{key:"source",label:"Source",type:"text",placeholder:"e.g. inbound, referral"}].map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:la,children:w.label}),s.jsx("input",{type:w.type,value:u[w.key],onChange:S=>j(w.key,S.target.value),placeholder:w.placeholder,className:io})]},w.key)),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:la,children:"Stage"}),s.jsx("select",{value:u.lifecycle_stage,onChange:w=>j("lifecycle_stage",w.target.value),className:`${io} pr-3`,children:Lz.map(w=>s.jsx("option",{value:w,children:w.charAt(0).toUpperCase()+w.slice(1)},w))})]}),v.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:la,children:"Owner"}),s.jsxs("select",{value:u.owner_id,onChange:w=>j("owner_id",w.target.value),className:`${io} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),v.map(w=>s.jsx("option",{value:w.id,children:w.name||w.email},w.id))]})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border pt-2",children:s.jsx("p",{className:la,children:"Custom Fields"})}),k.map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:la,children:[w.label,w.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(w.field_type==="text"||!w.field_type)&&s.jsx("input",{type:"text",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:io}),w.field_type==="number"&&s.jsx("input",{type:"number",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:io}),w.field_type==="date"&&s.jsx(mn,{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S),required:w.required}),w.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[w.field_key]==="true",onChange:S=>N(w.field_key,S.target.checked?"true":"false"),className:"w-4 h-4 rounded border-border accent-primary"}),s.jsx("span",{className:"text-sm text-foreground",children:"Yes"})]}),(w.field_type==="select"||w.field_type==="multi_select")&&s.jsxs("select",{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:`${io} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(w.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},w.field_key))]}),s.jsx("button",{onClick:_,disabled:!u.first_name.trim()||a,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors",children:a?"Saving…":"Save Changes"}),l?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>c(!1),className:"flex-1 h-9 rounded-md border border-border text-sm text-muted-foreground hover:bg-muted/50 transition-colors",children:"Cancel"}),s.jsx("button",{onClick:r,className:"flex-1 h-9 rounded-md bg-destructive text-destructive-foreground text-sm font-medium hover:bg-destructive/90 transition-colors",children:"Confirm Delete"})]}):s.jsxs("button",{onClick:()=>c(!0),className:"w-full h-9 rounded-md border border-destructive/40 text-destructive text-sm font-medium hover:bg-destructive/10 transition-colors flex items-center justify-center gap-1.5",children:[s.jsx(Ts,{className:"w-3.5 h-3.5"})," Delete Contact"]})]})]})}function $z(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=nt(),{enabled:r}=hr(),a=on(),[l,c]=x.useState(!1),[u,f]=x.useState(!1),[m,p]=x.useState(!1),[g,v]=x.useState(""),y=x.useRef(null),{data:k,isLoading:j}=n6(e??""),{data:N}=Dy({contact_id:e??void 0,limit:20}),_=(N==null?void 0:N.data)??[],{data:w}=S6({object_type:"contact",object_id:e??""}),S=(w==null?void 0:w.data)??[],E=_6(),P=r6(e??""),T=s6(e??"");if(j)return s.jsx("div",{className:"flex flex-col gap-4 p-6 animate-pulse",children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-muted"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-3 bg-muted rounded w-1/2"})]})]})});if(!(k!=null&&k.contact))return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Contact not found"});const M=k.contact,D=[M.first_name,M.last_name].filter(Boolean).join(" ")||M.email||"",q=M.company_name??"",H=M.lifecycle_stage??"",I=M.lead_score??0;return u?s.jsx(pm,{subjectType:"contact",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(Fz,{contact:M,onSave:async F=>{try{await P.mutateAsync(F),c(!1),xe({title:"Contact updated"})}catch(te){xe({title:"Failed to update contact",description:te instanceof Error?te.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await T.mutateAsync(),n(),xe({title:"Contact deleted"})}catch(F){xe({title:"Failed to delete contact",description:F instanceof Error?F.message:"Please try again.",variant:"destructive"})}},isSaving:P.isPending}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-border",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx(Ds,{name:D,className:"w-14 h-14 rounded-2xl text-lg"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground",children:D}),q&&s.jsx("p",{className:"text-sm text-muted-foreground",children:q}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[H&&s.jsx(Tc,{stage:H}),I>0&&s.jsx(Sz,{score:I})]})]})]}),s.jsxs("div",{className:"flex gap-2 mt-4",children:[M.phone&&s.jsxs("a",{href:`tel:${M.phone}`,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 transition-all press-scale",children:[s.jsx(bc,{className:"w-3.5 h-3.5"})," Call"]}),M.email&&s.jsxs("a",{href:`mailto:${M.email}`,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(_C,{className:"w-3.5 h-3.5"})," Email"]}),s.jsxs("button",{onClick:()=>{p(F=>!F),setTimeout(()=>{var F;return(F=y.current)==null?void 0:F.focus()},50)},className:`flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all press-scale ${m?"bg-primary text-primary-foreground":"bg-muted text-foreground hover:bg-muted/80"}`,children:[s.jsx(TC,{className:"w-3.5 h-3.5"})," Note"]}),s.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(ls,{className:"w-3.5 h-3.5"})," Edit"]}),s.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(Fa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"contact",id:M.id,name:D,detail:q}),n(),a("/agent")},className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl border border-accent/30 bg-accent/5 text-accent text-sm font-semibold hover:bg-accent/10 transition-all ml-auto press-scale",children:[s.jsx(kn,{className:"w-3.5 h-3.5"})," Chat"]})]})]}),m&&s.jsxs("div",{className:"mx-4 mt-4 rounded-xl border border-border bg-card p-3 space-y-2",children:[s.jsx("textarea",{ref:y,value:g,onChange:F=>v(F.target.value),placeholder:"Write a note…",rows:3,className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring resize-none"}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>{p(!1),v("")},className:"text-xs text-muted-foreground hover:text-foreground",children:"Cancel"}),s.jsxs("button",{disabled:!g.trim()||E.isPending,onClick:async()=>{await E.mutateAsync({object_type:"contact",object_id:e,body:g.trim()}),v(""),p(!1),xe({title:"Note saved"})},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-40 transition-colors",children:[s.jsx(zg,{className:"w-3 h-3"})," Save"]})]})]}),S.length>0&&s.jsxs("div",{className:"p-4 mx-4 mt-4 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Notes"}),S.map(F=>s.jsxs("div",{className:"rounded-xl bg-muted/50 p-3 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[F.pinned&&s.jsx(NA,{className:"w-3 h-3 text-accent"}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(F.created_at).toLocaleDateString()})]}),s.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:F.body}),F.author_type&&s.jsx("p",{className:"text-[10px] text-muted-foreground capitalize",children:F.author_type==="agent"?"AI Agent":F.author_type})]},F.id))]}),s.jsxs("div",{className:"p-4 mx-4 mt-4 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Details"}),[{label:"Email",value:M.email},{label:"Phone",value:M.phone},{label:"Company",value:q},{label:"Source",value:M.source},{label:"Last Contacted",value:M.last_contacted_at?new Date(M.last_contacted_at).toLocaleDateString():void 0},{label:"Created",value:M.created_at?new Date(M.created_at).toLocaleDateString():void 0}].filter(F=>F.value).map(F=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:F.label}),s.jsx("span",{className:"text-sm text-foreground",children:F.value})]},F.label)),M.tags&&M.tags.length>0&&s.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mt-2",children:M.tags.map(F=>s.jsx("span",{className:"px-2.5 py-1 rounded-lg bg-muted text-xs text-muted-foreground font-medium",children:F},F))})]}),s.jsx(mm,{objectType:"contact",values:M.custom_fields??{}}),s.jsx(hm,{subjectType:"contact",subjectId:e}),s.jsxs("div",{className:"p-4 mx-4 mt-4 mb-6",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide mb-3",children:"Timeline"}),s.jsx(R_,{activities:_})]})]})}const ca="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",ua="text-xs font-mono text-muted-foreground uppercase tracking-wider",Vz=["prospecting","qualification","proposal","negotiation","closed_won","closed_lost"];function Bz({opportunity:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[u,f]=x.useState({name:e.name??"",amount:e.amount!=null?String(e.amount):"",stage:e.stage??"prospecting",close_date:e.close_date?e.close_date.slice(0,10):"",probability:e.probability!=null?String(e.probability):"",description:e.description??"",owner_id:e.owner_id??""}),[m,p]=x.useState(()=>{const w={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))w[S]=String(E??"");return w}),{data:g}=Jf(),v=(g==null?void 0:g.data)??[],{data:y}=ll("opportunity"),k=(y==null?void 0:y.fields)??[],j=(w,S)=>f(E=>({...E,[w]:S})),N=(w,S)=>p(E=>({...E,[w]:S})),_=()=>{const w={};for(const[E,P]of Object.entries(u))P!==""&&(E==="amount"||E==="probability"?w[E]=Number(P)||0:w[E]=P);const S={};for(const E of k){const P=m[E.field_key]??"";P!==""&&(E.field_type==="number"?S[E.field_key]=Number(P):E.field_type==="boolean"?S[E.field_key]=P==="true":S[E.field_key]=P)}Object.keys(S).length>0&&(w.custom_fields=S),t(w)};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-accent hover:underline",children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Editing opportunity"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:ua,children:["Opportunity Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:u.name,onChange:w=>j("name",w.target.value),placeholder:"e.g. Acme Enterprise",className:ca})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:ua,children:"Stage"}),s.jsx("select",{value:u.stage,onChange:w=>j("stage",w.target.value),className:`${ca} pr-3`,children:Vz.map(w=>s.jsx("option",{value:w,children:w.replace(/_/g," ").replace(/\b\w/g,S=>S.toUpperCase())},w))})]}),[{key:"amount",label:"Amount ($)",type:"number",placeholder:"50000"},{key:"close_date",label:"Close Date",type:"date",placeholder:""},{key:"probability",label:"Probability (%)",type:"number",placeholder:"50"}].map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:ua,children:w.label}),w.type==="date"?s.jsx(mn,{value:u[w.key]??"",onChange:S=>j(w.key,S),placeholder:"Select close date"}):s.jsx("input",{type:w.type,value:u[w.key],onChange:S=>j(w.key,S.target.value),placeholder:w.placeholder,className:ca})]},w.key)),v.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:ua,children:"Owner"}),s.jsxs("select",{value:u.owner_id,onChange:w=>j("owner_id",w.target.value),className:`${ca} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),v.map(w=>s.jsx("option",{value:w.id,children:w.name||w.email},w.id))]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:ua,children:"Description"}),s.jsx("textarea",{value:u.description,onChange:w=>j("description",w.target.value),placeholder:"Optional notes",rows:3,className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring resize-none"})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border pt-2",children:s.jsx("p",{className:ua,children:"Custom Fields"})}),k.map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:ua,children:[w.label,w.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(w.field_type==="text"||!w.field_type)&&s.jsx("input",{type:"text",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:ca}),w.field_type==="number"&&s.jsx("input",{type:"number",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:ca}),w.field_type==="date"&&s.jsx(mn,{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S),required:w.required}),w.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[w.field_key]==="true",onChange:S=>N(w.field_key,S.target.checked?"true":"false"),className:"w-4 h-4 rounded border-border accent-primary"}),s.jsx("span",{className:"text-sm text-foreground",children:"Yes"})]}),(w.field_type==="select"||w.field_type==="multi_select")&&s.jsxs("select",{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:`${ca} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(w.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},w.field_key))]}),e.created_at&&s.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border mt-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Created"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleDateString()})]}),s.jsx("button",{onClick:_,disabled:!u.name.trim()||a,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors",children:a?"Saving…":"Save Changes"}),l?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>c(!1),className:"flex-1 h-9 rounded-md border border-border text-sm text-muted-foreground hover:bg-muted/50 transition-colors",children:"Cancel"}),s.jsx("button",{onClick:r,className:"flex-1 h-9 rounded-md bg-destructive text-destructive-foreground text-sm font-medium hover:bg-destructive/90 transition-colors",children:"Confirm Delete"})]}):s.jsxs("button",{onClick:()=>c(!0),className:"w-full h-9 rounded-md border border-destructive/40 text-destructive text-sm font-medium hover:bg-destructive/10 transition-colors flex items-center justify-center gap-1.5",children:[s.jsx(Ts,{className:"w-3.5 h-3.5"})," Delete Opportunity"]})]})]})}function zz(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=nt(),{enabled:r}=hr(),a=on(),[l,c]=x.useState(!1),[u,f]=x.useState(!1),{data:m,isLoading:p}=l6(e??""),g=c6(e??""),v=u6(e??"");if(p)return s.jsxs("div",{className:"flex flex-col gap-4 p-6 animate-pulse",children:[s.jsx("div",{className:"h-6 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-4 bg-muted rounded w-1/2"})]});if(!(m!=null&&m.opportunity))return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Opportunity not found"});const y=m.opportunity,k=y.name??"",j=y.amount??0,N=y.stage??"",_=y.probability??0,w=y.forecast_cat??"",S=y.close_date?new Date(y.close_date).toLocaleDateString():"—";return u?s.jsx(pm,{subjectType:"opportunity",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(Bz,{opportunity:y,onSave:async E=>{try{await g.mutateAsync(E),c(!1),xe({title:"Opportunity updated"})}catch(P){xe({title:"Failed to update opportunity",description:P instanceof Error?P.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await v.mutateAsync(),n(),xe({title:"Opportunity deleted"})}catch(E){xe({title:"Failed to delete opportunity",description:E instanceof Error?E.message:"Please try again.",variant:"destructive"})}},isSaving:g.isPending}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-border",children:[s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground",children:k}),s.jsxs("p",{className:"text-3xl font-display font-extrabold text-foreground mt-2",children:["$",j>=1e3?`${(j/1e3).toFixed(0)}K`:j]}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[N&&s.jsx(Tc,{stage:N}),_>0&&s.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-accent/10 text-accent",children:[_,"% probability"]})]}),s.jsxs("div",{className:"flex gap-2 mt-4",children:[s.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(ls,{className:"w-3.5 h-3.5"})," Edit"]}),s.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(Fa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"opportunity",id:y.id,name:k,detail:`$${(j/1e3).toFixed(0)}K`}),n(),a("/agent")},className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl border border-accent/30 bg-accent/5 text-accent text-sm font-semibold hover:bg-accent/10 transition-all ml-auto press-scale",children:[s.jsx(kn,{className:"w-3.5 h-3.5"})," Chat"]})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-3 p-4 mx-4 mt-4",children:[{icon:PA,label:"Probability",value:`${_}%`},{icon:$c,label:"Close Date",value:S},{icon:Bc,label:"Forecast",value:w||"—"}].map(E=>s.jsxs("div",{className:"bg-muted/50 rounded-xl p-3 text-center",children:[s.jsx(E.icon,{className:"w-4 h-4 text-muted-foreground mx-auto mb-1"}),s.jsx("p",{className:"text-sm font-display font-bold text-foreground truncate",children:E.value}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:E.label})]},E.label))}),s.jsxs("div",{className:"p-4 mx-4 mt-2 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Details"}),[{label:"Stage",value:N},{label:"Forecast",value:w||void 0},{label:"Created",value:y.created_at?new Date(y.created_at).toLocaleDateString():void 0}].filter(E=>E.value).map(E=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:E.label}),s.jsx("span",{className:"text-sm text-foreground",children:E.value})]},E.label)),y.notes&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Notes"}),s.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:y.notes})]})]}),s.jsx(mm,{objectType:"opportunity",values:y.custom_fields??{}}),s.jsx(hm,{subjectType:"opportunity",subjectId:e})]})}const In="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",en="text-xs font-mono text-muted-foreground uppercase tracking-wider",Wz=["discovery","poc","production","scaling","sunset"];function Uz({stage:e}){const t=Po[e]??{label:e,color:"#94a3b8"};return s.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:t.color+"18",color:t.color},children:t.label})}function Hz({useCase:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[u,f]=x.useState({name:e.name??"",stage:e.stage??"discovery",description:e.description??"",attributed_arr:e.attributed_arr!=null?String(e.attributed_arr):"",currency_code:e.currency_code??"USD",expansion_potential:e.expansion_potential!=null?String(e.expansion_potential):"",unit_label:e.unit_label??"",consumption_unit:e.consumption_unit??"",consumption_capacity:e.consumption_capacity!=null?String(e.consumption_capacity):"",started_at:e.started_at?e.started_at.slice(0,10):"",target_prod_date:e.target_prod_date?e.target_prod_date.slice(0,10):"",sunset_date:e.sunset_date?e.sunset_date.slice(0,10):"",tags:Array.isArray(e.tags)?e.tags.join(", "):"",opportunity_id:e.opportunity_id??"",owner_id:e.owner_id??""}),[m,p]=x.useState(()=>{const P={};if(e.custom_fields)for(const[T,M]of Object.entries(e.custom_fields))P[T]=String(M??"");return P}),{data:g}=Jf(),v=(g==null?void 0:g.data)??[],{data:y}=My({limit:200}),k=(y==null?void 0:y.data)??[],{data:j}=ll("use_case"),N=(j==null?void 0:j.fields)??[],_=(P,T)=>f(M=>({...M,[P]:T})),w=(P,T)=>p(M=>({...M,[P]:T})),S=()=>{const P={},T=["attributed_arr","expansion_potential","consumption_capacity"];for(const[q,H]of Object.entries(u))q!=="tags"&&H!==""&&(T.includes(q)?P[q]=Number(H)||0:P[q]=H);const M=u.tags.trim();P.tags=M?M.split(",").map(q=>q.trim()).filter(Boolean):[];const D={};for(const q of N){const H=m[q.field_key]??"";H!==""&&(q.field_type==="number"?D[q.field_key]=Number(H):q.field_type==="boolean"?D[q.field_key]=H==="true":D[q.field_key]=H)}Object.keys(D).length>0&&(P.custom_fields=D),t(P)},E=P=>s.jsx("div",{className:"border-t border-border pt-3 mt-1",children:s.jsx("p",{className:en,children:P})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-accent hover:underline",children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Editing use case"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:en,children:["Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:u.name,onChange:P=>_("name",P.target.value),placeholder:"Use case name",className:In})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Stage"}),s.jsx("select",{value:u.stage,onChange:P=>_("stage",P.target.value),className:`${In} pr-3`,children:Wz.map(P=>{var T;return s.jsx("option",{value:P,children:((T=Po[P])==null?void 0:T.label)??P},P)})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Description"}),s.jsx("textarea",{value:u.description,onChange:P=>_("description",P.target.value),placeholder:"Optional description",rows:3,className:"w-full px-3 py-2 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring resize-none"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:en,children:["Tags ",s.jsx("span",{className:"normal-case font-normal",children:"(comma-separated)"})]}),s.jsx("input",{type:"text",value:u.tags,onChange:P=>_("tags",P.target.value),placeholder:"e.g. ai, billing, high-priority",className:In})]}),E("Commercial"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Attributed ARR ($)"}),s.jsx("input",{type:"number",value:u.attributed_arr,onChange:P=>_("attributed_arr",P.target.value),placeholder:"e.g. 120000",className:In})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Expansion Potential ($)"}),s.jsx("input",{type:"number",value:u.expansion_potential,onChange:P=>_("expansion_potential",P.target.value),placeholder:"e.g. 50000",className:In})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Currency"}),s.jsx("input",{type:"text",value:u.currency_code,onChange:P=>_("currency_code",P.target.value.toUpperCase().slice(0,3)),placeholder:"USD",maxLength:3,className:In})]}),E("Consumption"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Unit Label"}),s.jsx("input",{type:"text",value:u.unit_label,onChange:P=>_("unit_label",P.target.value),placeholder:"e.g. API calls, seats, documents",className:In})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Consumption Unit"}),s.jsx("input",{type:"text",value:u.consumption_unit,onChange:P=>_("consumption_unit",P.target.value),placeholder:"e.g. calls/month",className:In})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Consumption Capacity"}),s.jsx("input",{type:"number",value:u.consumption_capacity,onChange:P=>_("consumption_capacity",P.target.value),placeholder:"e.g. 10000",className:In})]}),E("Timeline"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Start Date"}),s.jsx(mn,{value:u.started_at,onChange:P=>_("started_at",P),placeholder:"Select start date"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Production Date"}),s.jsx(mn,{value:u.target_prod_date,onChange:P=>_("target_prod_date",P),placeholder:"Select production date"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Sunset Date"}),s.jsx(mn,{value:u.sunset_date,onChange:P=>_("sunset_date",P),placeholder:"Select sunset date"})]}),E("Ownership"),k.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Linked Opportunity"}),s.jsxs("select",{value:u.opportunity_id,onChange:P=>_("opportunity_id",P.target.value),className:`${In} pr-3`,children:[s.jsx("option",{value:"",children:"None"}),k.map(P=>s.jsx("option",{value:P.id,children:P.name},P.id))]})]}),v.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:en,children:"Owner"}),s.jsxs("select",{value:u.owner_id,onChange:P=>_("owner_id",P.target.value),className:`${In} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),v.map(P=>s.jsx("option",{value:P.id,children:P.name||P.email},P.id))]})]}),N.length>0&&s.jsxs(s.Fragment,{children:[E("Custom Fields"),N.map(P=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:en,children:[P.label,P.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(P.field_type==="text"||!P.field_type)&&s.jsx("input",{type:"text",value:m[P.field_key]??"",onChange:T=>w(P.field_key,T.target.value),className:In}),P.field_type==="number"&&s.jsx("input",{type:"number",value:m[P.field_key]??"",onChange:T=>w(P.field_key,T.target.value),className:In}),P.field_type==="date"&&s.jsx(mn,{value:m[P.field_key]??"",onChange:T=>w(P.field_key,T),required:P.required}),P.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[P.field_key]==="true",onChange:T=>w(P.field_key,T.target.checked?"true":"false"),className:"w-4 h-4 rounded border-border accent-primary"}),s.jsx("span",{className:"text-sm text-foreground",children:"Yes"})]}),(P.field_type==="select"||P.field_type==="multi_select")&&s.jsxs("select",{value:m[P.field_key]??"",onChange:T=>w(P.field_key,T.target.value),className:`${In} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(P.options??[]).map(T=>s.jsx("option",{value:T,children:T},T))]})]},P.field_key))]}),e.created_at&&s.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border mt-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Created"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleDateString()})]}),s.jsx("button",{onClick:S,disabled:!u.name.trim()||a,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors",children:a?"Saving…":"Save Changes"}),l?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>c(!1),className:"flex-1 h-9 rounded-md border border-border text-sm text-muted-foreground hover:bg-muted/50 transition-colors",children:"Cancel"}),s.jsx("button",{onClick:r,className:"flex-1 h-9 rounded-md bg-destructive text-destructive-foreground text-sm font-medium hover:bg-destructive/90 transition-colors",children:"Confirm Delete"})]}):s.jsxs("button",{onClick:()=>c(!0),className:"w-full h-9 rounded-md border border-destructive/40 text-destructive text-sm font-medium hover:bg-destructive/10 transition-colors flex items-center justify-center gap-1.5",children:[s.jsx(Ts,{className:"w-3.5 h-3.5"})," Delete Use Case"]})]})]})}function qz(){var E,P;const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=nt(),{enabled:r}=hr(),a=on(),[l,c]=x.useState(!1),[u,f]=x.useState(!1),{data:m,isLoading:p}=d6(e??""),{data:g}=h6(e??""),v=f6(e??""),y=m6(e??"");if(p)return s.jsxs("div",{className:"flex flex-col gap-4 p-6 animate-pulse",children:[s.jsx("div",{className:"h-6 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-4 bg-muted rounded w-1/2"})]});if(!(m!=null&&m.use_case))return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Use case not found"});const k=m.use_case,j=k.name??"",N=k.stage??"",_=k.attributed_arr??0,w=k.health_score??0,S=(g==null?void 0:g.data)??g??[];return u?s.jsx(pm,{subjectType:"use_case",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(Hz,{useCase:k,onSave:async T=>{try{await v.mutateAsync(T),c(!1),xe({title:"Use case updated"})}catch(M){xe({title:"Failed to update use case",description:M instanceof Error?M.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await y.mutateAsync(),n(),xe({title:"Use case deleted"})}catch(T){xe({title:"Failed to delete use case",description:T instanceof Error?T.message:"Please try again.",variant:"destructive"})}},isSaving:v.isPending}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-border",children:[s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground",children:j}),s.jsx("div",{className:"flex items-center gap-2 mt-3",children:N&&s.jsx(Uz,{stage:N})}),s.jsxs("div",{className:"flex gap-2 mt-4",children:[s.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(ls,{className:"w-3.5 h-3.5"})," Edit"]}),s.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(Fa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"use-case",id:k.id,name:j,detail:N}),n(),a("/agent")},className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl border border-accent/30 bg-accent/5 text-accent text-sm font-semibold hover:bg-accent/10 transition-all ml-auto press-scale",children:[s.jsx(kn,{className:"w-3.5 h-3.5"})," Chat"]})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-3 p-4 mx-4 mt-4",children:[{icon:Bg,label:"Attributed ARR",value:_?`$${(_/1e3).toFixed(0)}K`:"—"},{icon:$c,label:"Stage",value:(((E=Po[N])==null?void 0:E.label)??N)||"—"},{icon:fn,label:"Health",value:w?String(w):"—"}].map(T=>s.jsxs("div",{className:"bg-muted/50 rounded-xl p-3 text-center",children:[s.jsx(T.icon,{className:"w-4 h-4 text-muted-foreground mx-auto mb-1"}),s.jsx("p",{className:"text-sm font-display font-bold text-foreground truncate",children:T.value}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:T.label})]},T.label))}),s.jsxs("div",{className:"p-4 mx-4 mt-2 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Details"}),[{label:"Stage",value:((P=Po[N])==null?void 0:P.label)??N},{label:"Health Score",value:w?String(w):void 0},{label:"Prod Date",value:k.target_prod_date?new Date(k.target_prod_date).toLocaleDateString():void 0},{label:"Created",value:k.created_at?new Date(k.created_at).toLocaleDateString():void 0}].filter(T=>T.value).map(T=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:T.label}),s.jsx("span",{className:"text-sm text-foreground",children:T.value})]},T.label))]}),s.jsx(mm,{objectType:"use_case",values:k.custom_fields??{}}),s.jsx(hm,{subjectType:"use_case",subjectId:e}),S.length>0&&s.jsxs("div",{className:"p-4 mx-4 mt-2 mb-6",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide mb-3",children:"Timeline"}),s.jsx(R_,{activities:S})]})]})}const ec="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",Ed="text-xs font-mono text-muted-foreground uppercase tracking-wider";function Kz({score:e}){const t=e>=80?"text-green-400 bg-green-500/15":e>=50?"text-yellow-400 bg-yellow-500/15":"text-red-400 bg-red-500/15";return s.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-semibold ${t}`,children:[s.jsx(Lf,{className:"w-3 h-3"})," ",e]})}function Yz(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e}`}function Qz({account:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[u,f]=x.useState({name:e.name??"",industry:e.industry??"",website:e.website??"",domain:e.domain??"",employee_count:e.employee_count!=null?String(e.employee_count):"",annual_revenue:e.annual_revenue!=null?String(e.annual_revenue):"",health_score:e.health_score!=null?String(e.health_score):"",owner_id:e.owner_id??""}),[m,p]=x.useState(()=>{const w={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))w[S]=String(E??"");return w}),{data:g}=Jf(),v=(g==null?void 0:g.data)??[],{data:y}=ll("account"),k=(y==null?void 0:y.fields)??[],j=(w,S)=>f(E=>({...E,[w]:S})),N=(w,S)=>p(E=>({...E,[w]:S})),_=()=>{const w={};for(const[E,P]of Object.entries(u))P!==""&&(E==="employee_count"||E==="annual_revenue"||E==="health_score"?w[E]=Number(P)||0:w[E]=P);const S={};for(const E of k){const P=m[E.field_key]??"";P!==""&&(E.field_type==="number"?S[E.field_key]=Number(P):E.field_type==="boolean"?S[E.field_key]=P==="true":S[E.field_key]=P)}Object.keys(S).length>0&&(w.custom_fields=S),t(w)};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-accent hover:underline",children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Editing account"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[[{key:"name",label:"Company Name",type:"text",placeholder:"e.g. Acme Corp",required:!0},{key:"industry",label:"Industry",type:"text",placeholder:"e.g. Technology"},{key:"website",label:"Website",type:"url",placeholder:"https://acme.com"},{key:"domain",label:"Domain",type:"text",placeholder:"acme.com"},{key:"employee_count",label:"Employees",type:"number",placeholder:"250"},{key:"annual_revenue",label:"Annual Revenue ($)",type:"number",placeholder:"5000000"},{key:"health_score",label:"Health Score (0–100)",type:"number",placeholder:"75"}].map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:Ed,children:[w.label,w.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:w.type,value:u[w.key],onChange:S=>j(w.key,S.target.value),placeholder:w.placeholder,className:ec})]},w.key)),v.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Ed,children:"Owner"}),s.jsxs("select",{value:u.owner_id,onChange:w=>j("owner_id",w.target.value),className:`${ec} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),v.map(w=>s.jsx("option",{value:w.id,children:w.name||w.email},w.id))]})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border pt-2",children:s.jsx("p",{className:Ed,children:"Custom Fields"})}),k.map(w=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:Ed,children:[w.label,w.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(w.field_type==="text"||!w.field_type)&&s.jsx("input",{type:"text",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:ec}),w.field_type==="number"&&s.jsx("input",{type:"number",value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:ec}),w.field_type==="date"&&s.jsx(mn,{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S),required:w.required}),w.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[w.field_key]==="true",onChange:S=>N(w.field_key,S.target.checked?"true":"false"),className:"w-4 h-4 rounded border-border accent-primary"}),s.jsx("span",{className:"text-sm text-foreground",children:"Yes"})]}),(w.field_type==="select"||w.field_type==="multi_select")&&s.jsxs("select",{value:m[w.field_key]??"",onChange:S=>N(w.field_key,S.target.value),className:`${ec} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(w.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},w.field_key))]}),s.jsx("button",{onClick:_,disabled:!u.name.trim()||a,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors",children:a?"Saving…":"Save Changes"}),l?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>c(!1),className:"flex-1 h-9 rounded-md border border-border text-sm text-muted-foreground hover:bg-muted/50 transition-colors",children:"Cancel"}),s.jsx("button",{onClick:r,className:"flex-1 h-9 rounded-md bg-destructive text-destructive-foreground text-sm font-medium hover:bg-destructive/90 transition-colors",children:"Confirm Delete"})]}):s.jsxs("button",{onClick:()=>c(!0),className:"w-full h-9 rounded-md border border-destructive/40 text-destructive text-sm font-medium hover:bg-destructive/10 transition-colors flex items-center justify-center gap-1.5",children:[s.jsx(Ts,{className:"w-3.5 h-3.5"})," Delete Account"]})]})]})}function Gz(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=nt(),{enabled:r}=hr(),a=on(),[l,c]=x.useState(!1),[u,f]=x.useState(!1),{data:m,isLoading:p}=o6(e??""),g=a6(e??""),v=i6(e??"");if(p)return s.jsx("div",{className:"flex flex-col gap-4 p-6 animate-pulse",children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-muted"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-3 bg-muted rounded w-1/2"})]})]})});if(!(m!=null&&m.account))return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Account not found"});const y=m.account,k=y.name??"",j=y.industry??"",N=y.website??"",_=y.annual_revenue??0,w=y.employee_count??0,S=y.health_score??0;return u?s.jsx(pm,{subjectType:"account",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(Qz,{account:y,onSave:async E=>{try{await g.mutateAsync(E),c(!1),xe({title:"Account updated"})}catch(P){xe({title:"Failed to update account",description:P instanceof Error?P.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await v.mutateAsync(),n(),xe({title:"Account deleted"})}catch(E){xe({title:"Failed to delete account",description:E instanceof Error?E.message:"Please try again.",variant:"destructive"})}},isSaving:g.isPending}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-border",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx(Ds,{name:k,className:"w-14 h-14 rounded-2xl text-lg"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground",children:k}),j&&s.jsx("p",{className:"text-sm text-muted-foreground",children:j}),s.jsx("div",{className:"flex items-center gap-2 mt-2",children:S>0&&s.jsx(Kz,{score:S})})]})]}),s.jsxs("div",{className:"flex gap-2 mt-4",children:[N&&s.jsxs("a",{href:N.startsWith("http")?N:`https://${N}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(CC,{className:"w-3.5 h-3.5"})," Website"]}),s.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(ls,{className:"w-3.5 h-3.5"})," Edit"]}),s.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(Fa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"account",id:y.id,name:k,detail:j}),n(),a("/agent")},className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl border border-accent/30 bg-accent/5 text-accent text-sm font-semibold hover:bg-accent/10 transition-all ml-auto press-scale",children:[s.jsx(kn,{className:"w-3.5 h-3.5"})," Chat"]})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-3 p-4 mx-4 mt-4",children:[{icon:Bg,label:"Revenue",value:_?Yz(_):"—"},{icon:Ma,label:"Employees",value:w?String(w):"—"},{icon:Lf,label:"Health",value:S?String(S):"—"}].map(E=>s.jsxs("div",{className:"bg-muted/50 rounded-xl p-3 text-center",children:[s.jsx(E.icon,{className:"w-4 h-4 text-muted-foreground mx-auto mb-1"}),s.jsx("p",{className:"text-sm font-display font-bold text-foreground",children:E.value}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:E.label})]},E.label))}),s.jsxs("div",{className:"p-4 mx-4 mt-2 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Details"}),[{label:"Industry",value:j},{label:"Website",value:N},{label:"Created",value:y.created_at?new Date(y.created_at).toLocaleDateString():void 0}].filter(E=>E.value).map(E=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:E.label}),s.jsx("span",{className:"text-sm text-foreground",children:E.value})]},E.label))]}),s.jsx(mm,{objectType:"account",values:y.custom_fields??{}}),s.jsx(hm,{subjectType:"account",subjectId:e}),y.description&&s.jsxs("div",{className:"p-4 mx-4 mt-2 mb-6",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide mb-2",children:"About"}),s.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:y.description})]})]})}const da="w-full h-10 px-3 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",lo="text-xs font-mono text-muted-foreground uppercase tracking-wider",Xz={pending:"#f59e0b",accepted:"#3b82f6",in_progress:"#8b5cf6",blocked:"#ef4444",completed:"#22c55e",declined:"#94a3b8",cancelled:"#94a3b8"},Zz={urgent:"#ef4444",high:"#f97316",normal:"#3b82f6",low:"#94a3b8"},Jz=["call","draft","email","follow_up","research","review","send"],eW=["urgent","high","normal","low"],tW=["contact","account","opportunity","use_case"];function Kj({id:e}){const{data:t}=T6(e),n=t==null?void 0:t.actor;return n?s.jsxs("span",{className:"text-sm text-foreground",children:[n.display_name,s.jsxs("span",{className:"text-xs text-muted-foreground ml-1.5 capitalize",children:["(",n.actor_type,")"]})]}):s.jsx("span",{className:"text-muted-foreground",children:"—"})}function nW({assignment:e,onSave:t,onCancel:n,isSaving:r}){const[a,l]=x.useState({title:e.title??"",assignment_type:e.assignment_type??"",priority:e.priority??"normal",due_at:e.due_at?e.due_at.split("T")[0]:"",context:e.context??"",description:e.description??"",subject_type:e.subject_type??"",subject_id:e.subject_id??""}),c=(f,m)=>l(p=>({...p,[f]:m})),u=()=>{const f={...a};f.due_at||delete f.due_at,f.context||delete f.context,f.description||delete f.description,f.subject_type?f.subject_id||delete f.subject_id:(delete f.subject_type,delete f.subject_id),f.due_at&&(f.due_at=new Date(f.due_at).toISOString()),t(f)};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-xs text-accent hover:underline",children:[s.jsx(Vo,{className:"w-3.5 h-3.5"})," Back"]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Editing assignment"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:lo,children:["Title ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{type:"text",value:a.title,onChange:f=>c("title",f.target.value),placeholder:"e.g. Follow up with Acme about contract",className:da})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:lo,children:["Type ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs("select",{value:a.assignment_type,onChange:f=>c("assignment_type",f.target.value),className:`${da} pr-3`,children:[s.jsx("option",{value:"",children:"Select type…"}),Jz.map(f=>s.jsx("option",{value:f,children:f.replace(/_/g," ").replace(/\b\w/g,m=>m.toUpperCase())},f))]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Priority"}),s.jsx("select",{value:a.priority,onChange:f=>c("priority",f.target.value),className:`${da} pr-3`,children:eW.map(f=>s.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Due Date"}),s.jsx(mn,{value:a.due_at,onChange:f=>c("due_at",f)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Linked To"}),s.jsxs("select",{value:a.subject_type,onChange:f=>{c("subject_type",f.target.value),c("subject_id","")},className:`${da} pr-3`,children:[s.jsx("option",{value:"",children:"None (no link)"}),tW.map(f=>s.jsx("option",{value:f,children:f.replace(/_/g," ").replace(/\b\w/g,m=>m.toUpperCase())},f))]})]}),a.subject_type&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Subject ID"}),s.jsx("input",{type:"text",value:a.subject_id,onChange:f=>c("subject_id",f.target.value),placeholder:"Record ID",className:da})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Context"}),s.jsx("textarea",{value:a.context,onChange:f=>c("context",f.target.value),placeholder:"Brief context for the assignee",rows:3,className:`${da} h-auto py-2 resize-none`})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:lo,children:"Description"}),s.jsx("textarea",{value:a.description,onChange:f=>c("description",f.target.value),placeholder:"Additional details",rows:3,className:`${da} h-auto py-2 resize-none`})]}),s.jsx("button",{onClick:u,disabled:!a.title.trim()||!a.assignment_type||r,className:"w-full h-10 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-40 transition-colors",children:r?"Saving…":"Save Changes"})]})]})}function rW(){const{drawerEntityId:e,openDrawer:t,closeDrawer:n}=nt(),[r,a]=x.useState(!1),{data:l,isLoading:c}=M6(e??""),u=D6(e??""),f=Oy(),m=Fy(),p=Iy(),g=Ly(),v=$y(),y=Vy(),k=async P=>{if(e)try{switch(P){case"accept":await f.mutateAsync(e);break;case"start":await m.mutateAsync(e);break;case"complete":await p.mutateAsync({id:e});break;case"decline":await g.mutateAsync({id:e});break;case"block":await v.mutateAsync({id:e});break;case"cancel":await y.mutateAsync({id:e});break}xe({title:`Assignment ${P}ed`})}catch(T){xe({title:`Failed to ${P} assignment`,description:T instanceof Error?T.message:"Please try again.",variant:"destructive"})}};if(c)return s.jsx("div",{className:"flex flex-col gap-4 p-6 animate-pulse",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),s.jsx("div",{className:"h-5 bg-muted rounded w-3/4"})]})});const j=l==null?void 0:l.assignment;if(!j)return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Assignment not found"});if(r)return s.jsx(nW,{assignment:j,onSave:async P=>{try{await u.mutateAsync(P),a(!1),xe({title:"Assignment updated"})}catch(T){xe({title:"Failed to update assignment",description:T instanceof Error?T.message:"Please try again.",variant:"destructive"})}},onCancel:()=>a(!1),isSaving:u.isPending});const N=Xz[j.status]??"#94a3b8",_=Zz[j.priority]??"#94a3b8",w=j.due_at&&new Date(j.due_at)<new Date&&!["completed","declined","cancelled"].includes(j.status),S=[];switch(j.status){case"pending":S.push({label:"Accept",action:"accept",icon:s.jsx(er,{className:"w-3.5 h-3.5"})}),S.push({label:"Decline",action:"decline",icon:s.jsx($i,{className:"w-3.5 h-3.5"}),variant:"muted"});break;case"accepted":S.push({label:"Start",action:"start",icon:s.jsx(Vi,{className:"w-3.5 h-3.5"})}),S.push({label:"Block",action:"block",icon:s.jsx(Id,{className:"w-3.5 h-3.5"}),variant:"warning"});break;case"in_progress":S.push({label:"Complete",action:"complete",icon:s.jsx(er,{className:"w-3.5 h-3.5"})}),S.push({label:"Block",action:"block",icon:s.jsx(Id,{className:"w-3.5 h-3.5"}),variant:"warning"});break;case"blocked":S.push({label:"Resume",action:"start",icon:s.jsx(Vi,{className:"w-3.5 h-3.5"})}),S.push({label:"Cancel",action:"cancel",icon:s.jsx(Ex,{className:"w-3.5 h-3.5"}),variant:"destructive"});break}["completed","declined","cancelled","blocked"].includes(j.status)||S.find(P=>P.action==="cancel")||S.push({label:"Cancel",action:"cancel",icon:s.jsx(Ex,{className:"w-3.5 h-3.5"}),variant:"destructive"});const E={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-border",children:[s.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(rf,{className:"w-5 h-5 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-semibold capitalize",style:{backgroundColor:N+"18",color:N},children:j.status.replace(/_/g," ")}),s.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:_}}),s.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:j.priority})]}),s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground leading-snug",children:j.title}),j.assignment_type&&s.jsx("span",{className:"text-xs text-muted-foreground capitalize mt-1 inline-block",children:j.assignment_type.replace(/_/g," ")})]})]}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsxs("button",{onClick:()=>a(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-muted text-foreground text-sm font-medium hover:bg-muted/80 transition-all press-scale",children:[s.jsx(ls,{className:"w-3.5 h-3.5"})," Edit"]}),S.map(P=>s.jsxs("button",{onClick:()=>k(P.action),className:`flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all press-scale ${P.variant==="destructive"?"bg-destructive/10 text-destructive hover:bg-destructive/20":P.variant==="warning"?"bg-warning/10 text-warning hover:bg-warning/20":P.variant==="muted"?"bg-muted text-muted-foreground hover:bg-muted/80":"bg-primary/10 text-primary hover:bg-primary/20"}`,children:[P.icon," ",P.label]},P.action))]})]}),s.jsxs("div",{className:"p-4 mx-4 mt-4 space-y-3",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Details"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Assigned To"}),s.jsx(Kj,{id:j.assigned_to})]}),j.assigned_by&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Assigned By"}),s.jsx(Kj,{id:j.assigned_by})]}),j.due_at&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Due"}),s.jsxs("span",{className:`text-sm flex items-center gap-1 ${w?"text-destructive font-medium":"text-foreground"}`,children:[w&&s.jsx(Id,{className:"w-3.5 h-3.5"}),new Date(j.due_at).toLocaleDateString()]})]}),j.subject_type&&E[j.subject_type]&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground capitalize",children:["Linked ",j.subject_type.replace(/_/g," ")]}),s.jsx("button",{onClick:()=>{t(E[j.subject_type],j.subject_id)},className:"text-sm text-primary hover:underline",children:"View"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Created"}),s.jsx("span",{className:"text-sm text-foreground",children:new Date(j.created_at).toLocaleDateString()})]})]}),j.context&&s.jsxs("div",{className:"p-4 mx-4 mt-2",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide mb-2",children:"Context"}),s.jsx("p",{className:"text-sm text-foreground leading-relaxed italic",children:j.context})]}),j.description&&s.jsxs("div",{className:"p-4 mx-4 mt-2 mb-6",children:[s.jsx("h3",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide mb-2",children:"Description"}),s.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:j.description})]})]})}function sW(){const e=on(),t=nr(),{setCommandPaletteOpen:n,openDrawer:r,setShortcutsOpen:a,toggleZenMode:l,openQuickAdd:c}=nt(),u=x.useCallback(f=>{const m=f.target,p=m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable;if((f.metaKey||f.ctrlKey)&&f.key==="k"){f.preventDefault(),n(!0);return}if((f.metaKey||f.ctrlKey)&&f.key==="j"){f.preventDefault(),e("/agent");return}if((f.metaKey||f.ctrlKey)&&f.shiftKey&&f.key==="Z"){f.preventDefault(),l();return}if(f.key==="Escape"){if(t.pathname==="/agent"){f.preventDefault(),e(-1);return}nt.getState().closeDrawer(),nt.getState().closeQuickAdd(),n(!1),a(!1);return}if(!p){if(f.key==="?"){f.preventDefault(),a(!0);return}if((f.key==="n"||f.key==="N")&&t.pathname==="/contacts"){f.preventDefault(),c("contact");return}if(f.key==="d"&&!f.metaKey&&!f.ctrlKey&&t.pathname==="/opportunities"){f.preventDefault(),c("opportunity");return}if(f.key==="g"){const g=v=>{window.removeEventListener("keydown",g),v.key==="h"?e("/"):v.key==="c"?e("/contacts"):v.key==="d"&&e("/opportunities")};window.addEventListener("keydown",g),setTimeout(()=>window.removeEventListener("keydown",g),1e3);return}}},[e,t.pathname,n,r,a,l,c]);x.useEffect(()=>(window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)),[u])}function O_(){const{darkVariant:e}=nt(),[t,n]=x.useState(()=>{const a=localStorage.getItem("theme");return a||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return x.useEffect(()=>{const a=document.documentElement;a.classList.toggle("dark",t==="dark"),a.classList.toggle("charcoal",e==="charcoal"),localStorage.setItem("theme",t)},[t,e]),{theme:t,setTheme:n,toggle:()=>n(a=>a==="dark"?"light":"dark")}}function oW(){const e=nr(),t=on(),{enabled:n}=hr();return e.pathname==="/agent"?null:s.jsx(Cn,{children:n&&s.jsxs(Fe.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:"fixed z-[60] bottom-20 md:bottom-6 right-4 md:right-6 flex flex-col items-center gap-1.5",children:[s.jsx(Fe.button,{onClick:()=>t("/agent"),whileHover:{scale:1.05},whileTap:{scale:.95},className:"w-14 h-14 rounded-2xl flex items-center justify-center shadow-lg bg-gradient-to-br from-primary to-accent text-primary-foreground animate-fab-glow",children:s.jsx(kn,{className:"w-5 h-5"})}),s.jsxs("span",{className:"hidden md:inline-flex items-center gap-0.5 text-[10px] font-mono text-muted-foreground bg-card/80 backdrop-blur-sm border border-border px-1.5 py-0.5 rounded-md shadow-sm",children:[s.jsx(wC,{className:"w-2.5 h-2.5"}),"J"]})]})})}const So=x.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Oe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));So.displayName="Input";const _f=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_f.displayName="Card";const I_=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));I_.displayName="CardHeader";const L_=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));L_.displayName="CardTitle";const F_=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));F_.displayName="CardDescription";const Ef=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));Ef.displayName="CardContent";const aW=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));aW.displayName="CardFooter";const $_=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"One uppercase letter",test:e=>/[A-Z]/.test(e)},{label:"One number",test:e=>/\d/.test(e)},{label:"One special character",test:e=>/[^A-Za-z0-9]/.test(e)}];function Yj(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function Qj(e){return $_.every(t=>t.test(e))}const iW={"--background":"220 10% 32%","--card":"220 14% 18%","--card-foreground":"36 15% 92%","--popover":"220 14% 22%","--popover-foreground":"36 15% 92%","--muted":"220 10% 24%","--muted-foreground":"220 8% 62%","--input":"220 10% 32%","--border":"220 10% 28%","--foreground":"36 15% 92%"},lW={"--background":"15 25% 32%","--card":"15 22% 18%","--card-foreground":"25 100% 95%","--popover":"15 22% 22%","--popover-foreground":"25 100% 95%","--muted":"15 20% 24%","--muted-foreground":"20 15% 62%","--input":"15 20% 32%","--border":"15 20% 28%","--foreground":"25 100% 95%"};function cW(){const e=on(),{darkVariant:t}=nt(),n=t==="charcoal",[r,a]=x.useState("login"),[l,c]=x.useState(""),[u,f]=x.useState(""),[m,p]=x.useState(""),[g,v]=x.useState(""),[y,k]=x.useState(""),[j,N]=x.useState(!1),[_,w]=x.useState({}),[S,E]=x.useState(()=>document.documentElement.classList.contains("dark")),P=()=>{const U=!S;E(U),document.documentElement.classList.toggle("dark",U),localStorage.setItem("crmy_theme",U?"dark":"light")};if(localStorage.getItem("crmy_token"))return s.jsx(Og,{to:"/",replace:!0});const T=U=>w($=>({...$,[U]:!0})),M=_.email&&!Yj(l)?"Enter a valid email address":"",D=_.password&&r==="register"&&!Qj(u)?"Password does not meet requirements":_.password&&!u?"Password is required":"",q=_.name&&r==="register"&&!m.trim()?"Name is required":"",H=_.tenantName&&r==="register"&&!g.trim()?"Organization name is required":"",I=async U=>{if(U.preventDefault(),w({email:!0,password:!0,name:!0,tenantName:!0}),!!Yj(l)&&u&&!(r==="register"&&(!Qj(u)||!m.trim()||!g.trim()))){k(""),N(!0);try{const $=r==="login"?await yj.login(l,u):await yj.register({email:l,password:u,name:m,tenant_name:g});e6($.token),t6($.user),e("/")}catch($){k($ instanceof Error?$.message:"Authentication failed")}finally{N(!1)}}},F=U=>{a(U),w({}),k("")},te=S?"bg-background":n?"bg-[hsl(220_20%_93%)]":"bg-[hsl(30_25%_93%)]",Y=n?"dark charcoal":"dark",O=S?void 0:n?iW:lW;return s.jsxs("div",{className:`flex min-h-screen items-center justify-center p-4 ${te}`,children:[s.jsx("button",{onClick:P,className:"fixed top-4 right-4 p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":"Toggle theme",children:S?s.jsx(AC,{className:"w-5 h-5"}):s.jsx(EC,{className:"w-5 h-5"})}),s.jsx("div",{className:`${Y} w-full max-w-md`,style:O,children:s.jsxs(_f,{className:"w-full",children:[s.jsxs(I_,{className:"text-left",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[s.jsx("img",{src:w2,alt:"CRMy",className:"h-14 w-14 object-contain"}),s.jsx(L_,{className:"font-brand font-bold text-2xl flex-1",children:r==="login"?s.jsxs(s.Fragment,{children:["Sign in to ",s.jsx("span",{className:"text-primary",children:"CRMy"})]}):s.jsx(s.Fragment,{children:"Create your account"})}),r==="register"&&s.jsx("button",{onClick:()=>F("login"),className:"ml-auto p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":"Back to sign in",children:s.jsx(Sn,{className:"w-5 h-5"})})]}),r==="register"&&s.jsx(F_,{className:"text-center",children:"Set up a new tenant and admin account"})]}),s.jsxs(Ef,{children:[s.jsxs("form",{onSubmit:I,className:"space-y-4",noValidate:!0,children:[r==="register"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("label",{className:"mb-1 block text-sm font-medium",children:["Your name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(So,{value:m,onChange:U=>p(U.target.value),onBlur:()=>T("name"),"aria-invalid":!!q}),q&&s.jsx("p",{className:"mt-1 text-xs text-destructive",children:q})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"mb-1 block text-sm font-medium",children:["Organization name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(So,{value:g,onChange:U=>v(U.target.value),onBlur:()=>T("tenantName"),"aria-invalid":!!H}),H&&s.jsx("p",{className:"mt-1 text-xs text-destructive",children:H})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"mb-1 block text-sm font-medium",children:["Email ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(So,{type:"email",value:l,onChange:U=>c(U.target.value),onBlur:()=>T("email"),"aria-invalid":!!M}),M&&s.jsx("p",{className:"mt-1 text-xs text-destructive",children:M})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"mb-1 block text-sm font-medium",children:["Password ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(So,{type:"password",value:u,onChange:U=>f(U.target.value),onBlur:()=>T("password"),"aria-invalid":!!D}),D&&r!=="register"&&s.jsx("p",{className:"mt-1 text-xs text-destructive",children:D}),r==="register"&&_.password&&s.jsx("ul",{className:"mt-2 space-y-1",children:$_.map(U=>{const $=U.test(u);return s.jsxs("li",{className:`flex items-center gap-1.5 text-xs ${$?"text-success":"text-muted-foreground"}`,children:[s.jsx(If,{className:`w-3 h-3 ${$?"opacity-100":"opacity-30"}`}),U.label]},U.label)})})]}),y&&s.jsx("p",{className:"text-sm text-destructive",children:y}),s.jsx(Tr,{type:"submit",className:"w-full",disabled:j,children:j?"Please wait...":r==="login"?"Sign in":"Create account"})]}),s.jsx("div",{className:"mt-4 text-center text-sm text-muted-foreground",children:r==="login"?s.jsxs(s.Fragment,{children:["Don't have an account?"," ",s.jsx("button",{className:"text-primary hover:underline",onClick:()=>F("register"),children:"Register"})]}):s.jsxs(s.Fragment,{children:["Already have an account?"," ",s.jsx("button",{className:"text-primary hover:underline",onClick:()=>F("login"),children:"Sign in"})]})})]})]})})]})}function zn({title:e,children:t}){const{setCommandPaletteOpen:n}=nt(),{theme:r,toggle:a}=O_(),l=on(),c=()=>{o2(),l("/login")};return s.jsxs("header",{className:"sticky top-0 z-30 flex items-center justify-between h-14 px-4 md:px-6 border-b border-border bg-background/80 backdrop-blur-md gap-2",children:[s.jsx("h1",{className:"font-display font-bold text-lg text-foreground truncate hidden md:block",children:e}),s.jsxs("div",{className:"flex items-center gap-1.5 md:ml-auto w-full md:w-auto",children:[t,s.jsx("button",{onClick:a,className:"p-2 rounded-xl text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:r==="dark"?"Switch to light mode":"Switch to dark mode",children:r==="dark"?s.jsx(AC,{className:"w-4 h-4"}):s.jsx(EC,{className:"w-4 h-4"})}),s.jsxs("button",{onClick:()=>n(!0),className:"flex items-center gap-2 flex-1 md:flex-none px-3 py-1.5 rounded-xl bg-muted text-muted-foreground text-sm hover:bg-muted/80 transition-colors min-h-[36px] md:min-h-0",children:[s.jsx(el,{className:"w-4 h-4 md:w-3.5 md:h-3.5 flex-shrink-0"}),s.jsx("span",{className:"text-left flex-1 md:flex-none",children:"Search..."}),s.jsxs("kbd",{className:"hidden md:inline-flex items-center gap-0.5 text-xs font-mono bg-background px-1.5 py-0.5 rounded-md border border-border",children:[s.jsx(wC,{className:"w-3 h-3"}),"K"]})]}),s.jsx("button",{onClick:c,className:"p-2 rounded-xl text-muted-foreground hover:text-destructive hover:bg-muted transition-colors",title:"Sign out",children:s.jsx(yA,{className:"w-4 h-4"})})]})]})}const uW=Vg("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function hc({className:e,variant:t,...n}){return s.jsx("div",{className:Oe(uW({variant:t}),e),...n})}function dW(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Pd({icon:e,label:t,value:n,sub:r,color:a,href:l,delay:c}){return s.jsx(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:c},children:s.jsxs(Qn,{to:l,className:"flex items-start gap-3 p-4 rounded-2xl bg-card border border-border shadow-sm hover:shadow-md hover:border-border/80 transition-all press-scale group",children:[s.jsx("div",{className:`w-9 h-9 rounded-xl ${a} flex items-center justify-center flex-shrink-0 mt-0.5`,children:s.jsx(e,{className:"w-4 h-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:t}),s.jsx("p",{className:"text-2xl font-display font-bold text-foreground leading-tight",children:n}),r&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:r})]}),s.jsx(ji,{className:"w-4 h-4 text-muted-foreground/40 group-hover:text-muted-foreground ml-auto mt-1 transition-colors"})]})})}function fW(){var N;const e=on(),[t,n]=x.useState("today"),[r,a]=x.useState({}),{data:l}=Zf(),c=Ry(),{data:u}=bf({limit:1}),{data:f}=bf({is_current:!1,limit:200}),{data:m}=Kc({actor_type:"agent",limit:10}),g=((l==null?void 0:l.data)??[]).filter(_=>_.status==="pending"),v=(u==null?void 0:u.total)??0,y=((N=f==null?void 0:f.data)==null?void 0:N.length)??0,k=(m==null?void 0:m.data)??[],j=k.filter(_=>_.is_active);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Memory Hub"}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 pb-24 md:pb-6",children:[s.jsxs(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(Fc,{className:"w-5 h-5 text-[#14b8a6]"}),s.jsx("h1",{className:"text-2xl md:text-3xl font-display font-extrabold",children:s.jsx("span",{className:"gradient-text",children:"Memory Hub"})})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your agent memory layer — context, approvals, and active agents at a glance."})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[s.jsx(Pd,{icon:wc,label:"Pending approvals",value:g.length,sub:g.length===1?"needs review":g.length>0?"need review":"all clear",color:"bg-destructive/15 text-destructive",href:"/hitl",delay:.04}),s.jsx(Pd,{icon:kC,label:"Context entries",value:v,sub:y>0?`${y} stale`:"all current",color:"bg-[#0ea5e9]/15 text-[#0ea5e9]",href:"/context",delay:.07}),s.jsx(Pd,{icon:fn,label:"Active agents",value:j.length,sub:k.length>0?`of ${k.length} registered`:"none registered",color:"bg-[#6366f1]/15 text-[#6366f1]",href:"/agents",delay:.1}),s.jsx(Pd,{icon:Ff,label:"Open handoffs",value:"—",sub:"view assignments",color:"bg-destructive/10 text-destructive/70",href:"/assignments",delay:.13})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-4 md:space-y-5",children:[s.jsx(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1},children:s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"font-display font-bold text-foreground flex items-center gap-2",children:[s.jsx(wc,{className:"w-4 h-4 text-destructive"}),"Pending approvals"]}),g.length>0&&s.jsxs(Qn,{to:"/hitl",className:"text-xs text-primary hover:underline flex items-center gap-1",children:["View all ",s.jsx(ji,{className:"w-3 h-3"})]})]}),g.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx(er,{className:"w-10 h-10 text-emerald-500 mb-2"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No pending approvals"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Your agents are running autonomously"})]}):s.jsxs("div",{className:"space-y-3",children:[g.slice(0,3).map(_=>s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(hc,{variant:"outline",className:"text-[11px]",children:_.action_type}),s.jsx("span",{className:"text-xs text-muted-foreground",children:_.agent_id??_.created_by??"agent"}),s.jsxs("span",{className:"text-xs text-muted-foreground ml-auto flex items-center gap-1",children:[s.jsx(Ji,{className:"w-3 h-3"}),dW(_.created_at)]})]}),s.jsx("p",{className:"text-sm text-foreground line-clamp-2",children:_.action_summary}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(So,{placeholder:"Note (optional)",value:r[_.id]??"",onChange:w=>a({...r,[_.id]:w.target.value}),className:"flex-1 h-7 text-xs"}),s.jsx(Tr,{variant:"destructive",size:"sm",className:"h-7 text-xs",onClick:()=>c.mutate({id:_.id,status:"rejected",note:r[_.id]}),disabled:c.isPending,children:"Reject"}),s.jsx(Tr,{size:"sm",className:"h-7 text-xs",onClick:()=>c.mutate({id:_.id,status:"approved",note:r[_.id]}),disabled:c.isPending,children:"Approve"})]})]},_.id)),g.length>3&&s.jsxs("button",{onClick:()=>e("/hitl"),className:"w-full text-xs text-primary hover:underline py-1",children:["+",g.length-3," more — view all approvals"]})]})]})}),s.jsx(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.15},children:s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h3",{className:"font-display font-bold text-foreground",children:"Agent activity"}),s.jsxs("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:[s.jsx("button",{onClick:()=>n("today"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${t==="today"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Today"}),s.jsx("button",{onClick:()=>n("week"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${t==="week"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"This Week"})]})]}),s.jsx(D_,{limit:8,filterWindow:t})]})})]}),s.jsxs("div",{className:"space-y-4 md:space-y-5",children:[s.jsx(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.08},children:s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("h3",{className:"font-display font-bold text-foreground flex items-center gap-2",children:[s.jsx(fn,{className:"w-4 h-4 text-[#6366f1]"}),"Agents"]}),s.jsxs(Qn,{to:"/agents",className:"text-xs text-primary hover:underline flex items-center gap-1",children:["Manage ",s.jsx(ji,{className:"w-3 h-3"})]})]}),k.length===0?s.jsxs("div",{className:"text-center py-6",children:[s.jsx(fn,{className:"w-8 h-8 text-muted-foreground/40 mx-auto mb-2"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents registered yet."}),s.jsx(Qn,{to:"/agents",className:"text-xs text-primary hover:underline mt-1 inline-block",children:"Register your first agent"})]}):s.jsxs("div",{className:"space-y-2",children:[k.slice(0,5).map(_=>s.jsxs("div",{className:"flex items-center gap-2.5 py-1.5",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#6366f1]/15 flex items-center justify-center flex-shrink-0",children:s.jsx(fn,{className:"w-3.5 h-3.5 text-[#6366f1]"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold text-foreground truncate",children:_.display_name}),_.agent_model&&s.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:_.agent_model})]}),s.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${_.is_active?"bg-emerald-500":"bg-muted-foreground/30"}`})]},_.id)),k.length>5&&s.jsxs(Qn,{to:"/agents",className:"text-xs text-muted-foreground hover:text-primary block text-center pt-1",children:["+",k.length-5," more"]})]})]})}),s.jsx(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.11},children:s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("h3",{className:"font-display font-bold text-foreground flex items-center gap-2",children:[s.jsx(vc,{className:"w-4 h-4 text-[#0ea5e9]"}),"Context health"]}),s.jsxs(Qn,{to:"/context",className:"text-xs text-primary hover:underline flex items-center gap-1",children:["Browse ",s.jsx(ji,{className:"w-3 h-3"})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Total entries"}),s.jsx("span",{className:"text-sm font-bold text-foreground",children:v})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[y>0&&s.jsx(Lw,{className:"w-3 h-3 text-destructive"}),"Stale / expired"]}),s.jsx("span",{className:`text-sm font-bold ${y>0?"text-destructive":"text-foreground"}`,children:y})]}),y>0&&s.jsxs(Qn,{to:"/context?stale=true",className:"flex items-center gap-1 text-xs text-destructive hover:underline",children:[s.jsx(Lw,{className:"w-3 h-3"}),"Review stale entries"]}),v===0&&s.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:"Agents write context entries after each interaction."})]})]})})]})]})]})]})}function hv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xm="Checkbox",[mW]=Os(xm),[hW,pv]=mW(xm);function pW(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:l,form:c,name:u,onCheckedChange:f,required:m,value:p="on",internal_do_not_use_render:g}=e,[v,y]=Aa({prop:n,defaultProp:a??!1,onChange:f,caller:xm}),[k,j]=x.useState(null),[N,_]=x.useState(null),w=x.useRef(!1),S=k?!!c||!!k.closest("form"):!0,E={checked:v,disabled:l,setChecked:y,control:k,setControl:j,name:u,form:c,value:p,hasConsumerStoppedPropagationRef:w,required:m,defaultChecked:To(a)?!1:a,isFormControl:S,bubbleInput:N,setBubbleInput:_};return s.jsx(hW,{scope:t,...E,children:xW(g)?g(E):r})}var V_="CheckboxTrigger",B_=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:l,value:c,disabled:u,checked:f,required:m,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:v,isFormControl:y,bubbleInput:k}=pv(V_,e),j=Je(a,p),N=x.useRef(f);return x.useEffect(()=>{const _=l==null?void 0:l.form;if(_){const w=()=>g(N.current);return _.addEventListener("reset",w),()=>_.removeEventListener("reset",w)}},[l,g]),s.jsx($e.button,{type:"button",role:"checkbox","aria-checked":To(f)?"mixed":f,"aria-required":m,"data-state":q_(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:j,onKeyDown:Ie(t,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:Ie(n,_=>{g(w=>To(w)?!0:!w),k&&y&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})});B_.displayName=V_;var xv=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:l,required:c,disabled:u,value:f,onCheckedChange:m,form:p,...g}=e;return s.jsx(pW,{__scopeCheckbox:n,checked:a,defaultChecked:l,disabled:u,required:c,onCheckedChange:m,name:r,form:p,value:f,internal_do_not_use_render:({isFormControl:v})=>s.jsxs(s.Fragment,{children:[s.jsx(B_,{...g,ref:t,__scopeCheckbox:n}),v&&s.jsx(H_,{__scopeCheckbox:n})]})})});xv.displayName=xm;var z_="CheckboxIndicator",W_=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,l=pv(z_,n);return s.jsx(Is,{present:r||To(l.checked)||l.checked===!0,children:s.jsx($e.span,{"data-state":q_(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});W_.displayName=z_;var U_="CheckboxBubbleInput",H_=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:l,defaultChecked:c,required:u,disabled:f,name:m,value:p,form:g,bubbleInput:v,setBubbleInput:y}=pv(U_,e),k=Je(n,y),j=hv(l),N=Gg(r);x.useEffect(()=>{const w=v;if(!w)return;const S=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(S,"checked").set,T=!a.current;if(j!==l&&P){const M=new Event("click",{bubbles:T});w.indeterminate=To(l),P.call(w,To(l)?!1:l),w.dispatchEvent(M)}},[v,j,l,a]);const _=x.useRef(To(l)?!1:l);return s.jsx($e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??_.current,required:u,disabled:f,name:m,value:p,form:g,...t,tabIndex:-1,ref:k,style:{...t.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});H_.displayName=U_;function xW(e){return typeof e=="function"}function To(e){return e==="indeterminate"}function q_(e){return To(e)?"indeterminate":e?"checked":"unchecked"}const K_=x.forwardRef(({className:e,...t},n)=>s.jsx(xv,{ref:n,className:Oe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(W_,{className:Oe("flex items-center justify-center text-current"),children:s.jsx(If,{className:"h-4 w-4"})})}));K_.displayName=xv.displayName;const gW={contacts:"from-primary to-primary/80",accounts:"from-[#8b5cf6] to-[#8b5cf6]/80",opportunities:"from-accent to-accent/80","use cases":"from-success to-success/80",activities:"from-warning to-warning/80",assignments:"from-destructive to-destructive/80"};function Va({searchValue:e,onSearchChange:t,searchPlaceholder:n="Search...",filters:r,activeFilters:a,onFilterChange:l,onClearFilters:c,sortOptions:u,currentSort:f,onSortChange:m,onAdd:p,addLabel:g,entityType:v}){var N;const y=gW[v]??"from-primary to-primary/80",k=x.useRef(null),j=Object.values(a).reduce((_,w)=>_+w.length,0);return x.useEffect(()=>{const _=w=>{var P;const S=w.target,E=S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.isContentEditable;w.key==="/"&&!E&&(w.preventDefault(),(P=k.current)==null||P.focus())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[]),s.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-2 md:py-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 min-w-0 max-w-sm",children:[s.jsx(el,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx("input",{ref:k,value:e,onChange:_=>t(_.target.value),placeholder:n,className:"w-full h-9 pl-9 pr-8 rounded-xl border border-border bg-card text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30 transition-all"}),e&&s.jsx("button",{onClick:()=>t(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-1",children:s.jsx(Sn,{className:"w-3.5 h-3.5 text-muted-foreground hover:text-foreground"})}),!e&&s.jsx("kbd",{className:"absolute right-2.5 top-1/2 -translate-y-1/2 hidden md:inline-flex items-center px-1.5 py-0.5 rounded-md text-[10px] font-mono text-muted-foreground/50 bg-muted border border-border",children:"/"})]}),s.jsxs(kf,{children:[s.jsx(Sf,{asChild:!0,children:s.jsxs("button",{className:"h-9 px-3 flex items-center gap-1.5 rounded-xl border border-border bg-card text-sm text-muted-foreground hover:text-foreground hover:border-primary/30 transition-all flex-shrink-0 press-scale",children:[s.jsx(mA,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Filter"}),j>0&&s.jsx("span",{className:"ml-0.5 px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground text-[10px] font-semibold",children:j})]})}),s.jsxs(Ec,{className:"w-72 p-0 rounded-xl",align:"start",children:[s.jsxs("div",{className:"p-3 border-b border-border flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-display font-bold text-foreground",children:"Filters"}),j>0&&s.jsx("button",{onClick:c,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),s.jsx("div",{className:"p-2 max-h-80 overflow-y-auto space-y-1",children:r.map(_=>s.jsx(yW,{filter:_,selected:a[_.key]||[],onChange:w=>l(_.key,w)},_.key))})]})]}),s.jsxs(kf,{children:[s.jsx(Sf,{asChild:!0,children:s.jsxs("button",{className:"h-9 px-3 flex items-center gap-1.5 rounded-xl border border-border bg-card text-sm text-muted-foreground hover:text-foreground hover:border-primary/30 transition-all flex-shrink-0 press-scale",children:[s.jsx(lA,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:f&&((N=u.find(_=>_.key===f.key))==null?void 0:N.label)||"Sort"}),f&&s.jsx("span",{className:"text-[10px] font-mono",children:f.dir==="asc"?"↑":"↓"})]})}),s.jsx(Ec,{className:"w-48 p-1 rounded-xl",align:"start",children:u.map(_=>s.jsxs("button",{onClick:()=>m(_.key),className:`w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ${(f==null?void 0:f.key)===_.key?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[_.label,(f==null?void 0:f.key)===_.key&&s.jsx("span",{className:"ml-auto float-right text-[10px] font-mono",children:f.dir==="asc"?"↑":"↓"})]},_.key))})]}),s.jsxs("button",{onClick:p,className:`h-9 px-4 flex items-center gap-1.5 rounded-xl bg-gradient-to-r ${y} text-primary-foreground text-sm font-semibold hover:shadow-md transition-all flex-shrink-0 press-scale`,children:[s.jsx(Bo,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden sm:inline",children:g})]})]}),j>0&&s.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Object.entries(a).map(([_,w])=>w.map(S=>{var T;const E=r.find(M=>M.key===_),P=((T=E==null?void 0:E.options.find(M=>M.value===S))==null?void 0:T.label)||S;return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-lg bg-muted text-xs text-foreground",children:[s.jsxs("span",{className:"text-muted-foreground",children:[E==null?void 0:E.label,":"]})," ",P,s.jsx("button",{onClick:()=>l(_,w.filter(M=>M!==S)),className:"ml-0.5 hover:text-destructive p-0.5",children:s.jsx(Sn,{className:"w-3 h-3"})})]},`${_}-${S}`)}))})]})}function yW({filter:e,selected:t,onChange:n}){const[r,a]=x.useState(!0);return s.jsxs("div",{className:"rounded-lg",children:[s.jsxs("button",{onClick:()=>a(!r),className:"w-full flex items-center justify-between px-2 py-2 text-xs font-display font-semibold text-muted-foreground hover:text-foreground",children:[e.label,t.length>0&&s.jsx("span",{className:"text-primary font-sans",children:t.length}),s.jsx(Wn,{className:`w-3 h-3 transition-transform ${r?"":"-rotate-90"}`})]}),r&&s.jsx("div",{className:"space-y-0.5 pl-1 pb-1",children:e.options.map(l=>{const c=t.includes(l.value);return s.jsxs("label",{className:"flex items-center gap-2 px-2 py-2 text-sm text-foreground hover:bg-muted/50 rounded-lg cursor-pointer min-h-[40px]",children:[s.jsx(K_,{checked:c,onCheckedChange:()=>{n(c?t.filter(u=>u!==l.value):[...t,l.value])},className:"w-4 h-4"}),l.label]},l.value)})})]})}const vW=[25,50,100];function bW(e,t){if(t<=7)return Array.from({length:t},(r,a)=>a+1);const n=[1];e>3&&n.push("...");for(let r=Math.max(2,e-1);r<=Math.min(t-1,e+1);r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Fr({page:e,pageSize:t,total:n,onPageChange:r,onPageSizeChange:a,className:l}){if(n<=t)return null;const c=Math.ceil(n/t),u=(e-1)*t+1,f=Math.min(e*t,n),m=bW(e,c);return s.jsxs("div",{className:Oe("flex flex-wrap items-center justify-between gap-3 pt-3 pb-1",l),children:[s.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Showing ",u,"–",f," of ",n]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx("button",{onClick:()=>r(e-1),disabled:e===1,className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Previous page",children:s.jsx(Vo,{className:"w-4 h-4"})}),m.map((p,g)=>p==="..."?s.jsx("span",{className:"w-8 text-center text-xs text-muted-foreground select-none",children:"…"},`ellipsis-${g}`):s.jsx("button",{onClick:()=>r(p),className:Oe("w-8 h-8 rounded-lg text-xs font-semibold transition-colors",e===p?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:p},p)),s.jsx("button",{onClick:()=>r(e+1),disabled:e===c,className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Next page",children:s.jsx(Ao,{className:"w-4 h-4"})})]}),a&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Per page:"}),s.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:vW.map(p=>s.jsx("button",{onClick:()=>{a(p),r(1)},className:Oe("px-2 py-1 rounded-md text-xs font-medium transition-colors",t===p?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:p},p))})]})]})}const wW=[{key:"lifecycle_stage",label:"Stage",options:Object.entries(Pc).map(([e,t])=>({value:e,label:t.label}))}],jW=[{key:"name",label:"Name"},{key:"company",label:"Company"},{key:"created_at",label:"Created"},{key:"lifecycle_stage",label:"Stage"}];function pi(e){const t=[e.first_name,e.last_name].filter(Boolean);return t.length>0?t.join(" "):e.email||e.company_name||"Unknown"}function NW(){const e=on(),t=om(),[n,r]=x.useState("table"),a=t?"cards":n,{openDrawer:l,openQuickAdd:c,openAIWithContext:u}=nt(),{enabled:f}=hr(),[m,p]=x.useState(""),[g,v]=x.useState({}),[y,k]=x.useState(null),[j,N]=x.useState(1),[_,w]=x.useState(25),{data:S,isLoading:E}=a2({q:m||void 0,limit:200}),P=(S==null?void 0:S.data)??[],T=(I,F)=>{v(te=>{const Y={...te};return F.length===0?delete Y[I]:Y[I]=F,Y})},M=I=>{k(F=>(F==null?void 0:F.key)===I?{key:I,dir:F.dir==="asc"?"desc":"asc"}:{key:I,dir:"asc"})},D=x.useMemo(()=>{var F;let I=[...P];return(F=g.lifecycle_stage)!=null&&F.length&&(I=I.filter(te=>g.lifecycle_stage.includes(te.lifecycle_stage))),y&&I.sort((te,Y)=>{const O=te[y.key]??"",U=Y[y.key]??"";return typeof O=="number"&&typeof U=="number"?y.dir==="asc"?O-U:U-O:y.dir==="asc"?String(O).localeCompare(String(U)):String(U).localeCompare(String(O))}),I},[P,g,y]);x.useEffect(()=>{N(1)},[m,g,y]);const q=D.slice((j-1)*_,j*_),H=({label:I,sortKey:F})=>s.jsx("th",{onClick:()=>M(F),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[I,(y==null?void 0:y.key)===F?y.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}):null]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Contacts",children:s.jsxs("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5",children:[s.jsx("button",{onClick:()=>r("table"),className:`p-1.5 rounded-lg text-sm transition-all ${n==="table"?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx($a,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>r("cards"),className:`p-1.5 rounded-lg text-sm transition-all ${n==="cards"?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(Vc,{className:"w-4 h-4"})})]})}),s.jsx(Va,{searchValue:m,onSearchChange:p,searchPlaceholder:"Search contacts...",filters:wW,activeFilters:g,onFilterChange:T,onClearFilters:()=>v({}),sortOptions:jW,currentSort:y,onSortChange:M,onAdd:()=>c("contact"),addLabel:"New Contact",entityType:"contacts"}),s.jsx("div",{className:"flex-1 overflow-y-auto px-4 md:px-6 pb-24 md:pb-6",children:E?s.jsx("div",{className:"space-y-2 pt-2",children:[...Array(5)].map((I,F)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},F))}):D.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx("p",{className:"text-sm",children:"No contacts found."}),s.jsx("button",{onClick:()=>{p(""),v({})},className:"mt-2 text-xs text-primary font-semibold hover:underline",children:"Clear all filters"})]}):a==="table"?s.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(H,{label:"Name",sortKey:"name"}),s.jsx(H,{label:"Company",sortKey:"company"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Phone"}),s.jsx(H,{label:"Stage",sortKey:"lifecycle_stage"}),f&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:q.map((I,F)=>s.jsxs("tr",{onClick:()=>l("contact",I.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer group transition-colors ${F%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ds,{name:pi(I),className:"w-8 h-8 text-xs"}),s.jsx("span",{className:"font-semibold text-foreground",children:pi(I)})]})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:I.company_name||"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:I.phone||"—"}),s.jsx("td",{className:"px-4 py-3",children:I.lifecycle_stage?s.jsx(Tc,{stage:I.lifecycle_stage}):"—"}),f&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:te=>{te.stopPropagation(),u({type:"contact",id:I.id,name:pi(I),detail:I.company_name}),e("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})})]},I.id))})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Fr,{page:j,pageSize:_,total:D.length,onPageChange:N,onPageSizeChange:w})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:q.map((I,F)=>s.jsxs(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:F*.02},onClick:()=>l("contact",I.id),className:"bg-card border border-border rounded-2xl p-4 cursor-pointer hover:shadow-lg hover:border-primary/20 transition-all press-scale group relative",children:[f&&s.jsx("button",{onClick:te=>{te.stopPropagation(),u({type:"contact",id:I.id,name:pi(I),detail:I.company_name}),e("/agent")},className:"absolute top-3 right-3 p-1.5 rounded-lg hover:bg-accent/10 transition-all md:opacity-0 md:group-hover:opacity-100",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})}),s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx(Ds,{name:pi(I),className:"w-11 h-11 rounded-2xl text-sm"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-display font-bold text-foreground",children:pi(I)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:I.company_name||"Individual"})]})]}),s.jsx("div",{className:"flex items-center gap-2 mb-2",children:I.lifecycle_stage&&s.jsx(Tc,{stage:I.lifecycle_stage})}),I.email&&s.jsx("p",{className:"text-xs text-muted-foreground",children:I.email})]},I.id))}),s.jsx(Fr,{page:j,pageSize:_,total:D.length,onPageChange:N,onPageSizeChange:w})]})})]})}const CW=[],kW=[{key:"name",label:"Name"},{key:"annual_revenue",label:"Revenue"},{key:"health_score",label:"Health"},{key:"employee_count",label:"Employees"}];function Gj({score:e}){const t=e>=80?"bg-green-500/15 text-green-400":e>=50?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400";return s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold ${t}`,children:[s.jsx(Lf,{className:"w-3 h-3"}),e]})}function Xj(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e}`}function SW(){const e=om(),[t,n]=x.useState("table"),r=e?"cards":t,{openDrawer:a,openQuickAdd:l,openAIWithContext:c}=nt(),{enabled:u}=hr(),f=on(),[m,p]=x.useState(""),[g,v]=x.useState({}),[y,k]=x.useState(null),[j,N]=x.useState(1),[_,w]=x.useState(25),{data:S,isLoading:E}=Ay({q:m||void 0,limit:200}),P=(S==null?void 0:S.data)??[],T=(I,F)=>{v(te=>{const Y={...te};return F.length===0?delete Y[I]:Y[I]=F,Y})},M=I=>{k(F=>(F==null?void 0:F.key)===I?{key:I,dir:F.dir==="asc"?"desc":"asc"}:{key:I,dir:"asc"})},D=x.useMemo(()=>{var F;let I=[...P];return(F=g.industry)!=null&&F.length&&(I=I.filter(te=>g.industry.includes(te.industry))),y&&I.sort((te,Y)=>{const O=te[y.key]??"",U=Y[y.key]??"";return typeof O=="number"&&typeof U=="number"?y.dir==="asc"?O-U:U-O:y.dir==="asc"?String(O).localeCompare(String(U)):String(U).localeCompare(String(O))}),I},[P,g,y]);x.useEffect(()=>{N(1)},[m,g,y]);const q=D.slice((j-1)*_,j*_),H=({label:I,sortKey:F})=>s.jsx("th",{onClick:()=>M(F),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[I,(y==null?void 0:y.key)===F?y.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}):null]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Accounts",children:s.jsxs("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5",children:[s.jsx("button",{onClick:()=>n("table"),className:`p-1.5 rounded-lg text-sm transition-all ${t==="table"?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx($a,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>n("cards"),className:`p-1.5 rounded-lg text-sm transition-all ${t==="cards"?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(Vc,{className:"w-4 h-4"})})]})}),s.jsx(Va,{searchValue:m,onSearchChange:p,searchPlaceholder:"Search accounts...",filters:CW,activeFilters:g,onFilterChange:T,onClearFilters:()=>v({}),sortOptions:kW,currentSort:y,onSortChange:M,onAdd:()=>l("account"),addLabel:"New Account",entityType:"accounts"}),s.jsx("div",{className:"flex-1 overflow-y-auto px-4 md:px-6 pb-24 md:pb-6",children:E?s.jsx("div",{className:"space-y-2 pt-2",children:[...Array(5)].map((I,F)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},F))}):D.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx("p",{className:"text-sm",children:"No accounts found."}),s.jsx("button",{onClick:()=>{p(""),v({})},className:"mt-2 text-xs text-primary font-semibold hover:underline",children:"Clear all filters"})]}):r==="table"?s.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(H,{label:"Name",sortKey:"name"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Industry"}),s.jsx(H,{label:"Revenue",sortKey:"annual_revenue"}),s.jsx(H,{label:"Employees",sortKey:"employee_count"}),s.jsx(H,{label:"Health",sortKey:"health_score"}),u&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:q.map((I,F)=>s.jsxs("tr",{onClick:()=>a("account",I.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer group transition-colors ${F%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ds,{name:I.name,className:"w-8 h-8 text-xs"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-foreground",children:I.name}),I.website&&s.jsx("p",{className:"text-xs text-muted-foreground",children:I.website})]})]})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:I.industry||"—"}),s.jsx("td",{className:"px-4 py-3 text-foreground font-medium",children:I.annual_revenue?Xj(I.annual_revenue):"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:I.employee_count||"—"}),s.jsx("td",{className:"px-4 py-3",children:I.health_score?s.jsx(Gj,{score:I.health_score}):"—"}),u&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:te=>{te.stopPropagation(),c({type:"account",id:I.id,name:I.name,detail:I.industry}),f("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})})]},I.id))})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Fr,{page:j,pageSize:_,total:D.length,onPageChange:N,onPageSizeChange:w})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:q.map((I,F)=>s.jsxs(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:F*.02},onClick:()=>a("account",I.id),className:"bg-card border border-border rounded-2xl p-4 cursor-pointer hover:shadow-lg hover:border-primary/20 transition-all press-scale group relative",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx(Ds,{name:I.name,className:"w-11 h-11 rounded-2xl text-sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-display font-bold text-foreground truncate",children:I.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:I.industry||"—"})]})]}),s.jsx("div",{className:"flex items-center gap-2 mb-3",children:I.health_score&&s.jsx(Gj,{score:I.health_score})}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[I.annual_revenue&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Bg,{className:"w-3 h-3"}),Xj(I.annual_revenue)]}),I.website&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(CC,{className:"w-3 h-3"}),I.website]})]})]},I.id))}),s.jsx(Fr,{page:j,pageSize:_,total:D.length,onPageChange:N,onPageSizeChange:w})]})})]})}const Gd=["prospecting","qualification","proposal","negotiation","closed_won","closed_lost"],_W=[{value:"all",label:"All"},{value:"today",label:"Today"},{value:"this_week",label:"This Week"},{value:"this_month",label:"This Month"},{value:"this_quarter",label:"This Quarter"},{value:"custom",label:"Custom"}];function EW(e){if(e==="all")return null;const t=new Date;if(e==="today"){const n=new Date(t);n.setHours(0,0,0,0);const r=new Date(t);return r.setHours(23,59,59,999),{start:n,end:r}}if(e==="this_week"){const n=new Date(t),r=n.getDay();n.setDate(n.getDate()+(r===0?-6:1-r)),n.setHours(0,0,0,0);const a=new Date(n);return a.setDate(n.getDate()+6),a.setHours(23,59,59,999),{start:n,end:a}}if(e==="this_month"){const n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);return{start:n,end:r}}if(e==="this_quarter"){const n=Math.floor(t.getMonth()/3),r=new Date(t.getFullYear(),n*3,1),a=new Date(t.getFullYear(),n*3+3,0,23,59,59,999);return{start:r,end:a}}return null}const PW=[{key:"stage",label:"Stage",options:Gd.map(e=>{var t;return{value:e,label:((t=Pc[e])==null?void 0:t.label)??e}})}],TW=[{key:"name",label:"Opportunity Name"},{key:"amount",label:"Amount"},{key:"stage",label:"Stage"},{key:"probability",label:"Probability"},{key:"created_at",label:"Created"}];function AW(){const e=on(),[t,n]=x.useState("table"),{openDrawer:r,openQuickAdd:a,openAIWithContext:l}=nt(),{enabled:c}=hr(),[u,f]=x.useState(""),[m,p]=x.useState({}),[g,v]=x.useState(null),[y,k]=x.useState("this_quarter"),[j,N]=x.useState(1),[_,w]=x.useState(25),[S,E]=x.useState(""),[P,T]=x.useState(""),{data:M,isLoading:D}=My({q:u||void 0,limit:200}),q=(M==null?void 0:M.data)??[],H=(O,U)=>{p($=>{const R={...$};return U.length===0?delete R[O]:R[O]=U,R})},I=O=>{v(U=>(U==null?void 0:U.key)===O?{key:O,dir:U.dir==="asc"?"desc":"asc"}:{key:O,dir:"asc"})},F=x.useMemo(()=>{var U;let O=[...q];if((U=m.stage)!=null&&U.length&&(O=O.filter($=>m.stage.includes($.stage))),y!=="all"){let $,R;if(y==="custom")$=S?new Date(S+"T00:00:00"):new Date(0),R=P?new Date(P+"T23:59:59"):new Date(864e13);else{const z=EW(y);z?($=z.start,R=z.end):($=new Date(0),R=new Date(864e13))}O=O.filter(z=>{if(!z.close_date)return!1;const X=new Date(z.close_date);return X>=$&&X<=R})}return g&&O.sort(($,R)=>{const z=$[g.key]??"",X=R[g.key]??"";return typeof z=="number"&&typeof X=="number"?g.dir==="asc"?z-X:X-z:g.dir==="asc"?String(z).localeCompare(String(X)):String(X).localeCompare(String(z))}),O},[q,m,g]);x.useEffect(()=>{N(1)},[u,m,g,y,S,P]);const te=F.slice((j-1)*_,j*_),Y=({label:O,sortKey:U})=>s.jsx("th",{onClick:()=>I(U),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[O,(g==null?void 0:g.key)===U&&(g.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Opportunities",children:s.jsx("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5",children:[{mode:"kanban",icon:bC},{mode:"table",icon:$a},{mode:"forecast",icon:vC}].map(({mode:O,icon:U})=>s.jsx("button",{onClick:()=>n(O),className:`p-1.5 rounded-lg text-sm transition-all ${t===O?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(U,{className:"w-4 h-4"})},O))})}),s.jsxs("div",{className:"px-4 md:px-6 pt-3 pb-1 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground font-semibold",children:"Close Date:"}),s.jsx("div",{className:"inline-flex rounded-xl border border-border bg-muted/40 p-0.5 gap-0.5",children:_W.map(O=>s.jsx("button",{onClick:()=>k(O.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",y===O.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:O.label},O.value))}),y==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mn,{value:S,onChange:E,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(mn,{value:P,onChange:T,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Va,{searchValue:u,onSearchChange:f,searchPlaceholder:"Search opportunities...",filters:PW,activeFilters:m,onFilterChange:H,onClearFilters:()=>p({}),sortOptions:TW,currentSort:g,onSortChange:I,onAdd:()=>a("opportunity"),addLabel:"New Opportunity",entityType:"opportunities"}),s.jsx("div",{className:"flex-1 overflow-y-auto pb-24 md:pb-6",children:D?s.jsx("div",{className:"flex gap-4 px-4 md:px-6 pt-2",children:[...Array(4)].map((O,U)=>s.jsx("div",{className:"flex-shrink-0 w-72 h-64 bg-muted/50 rounded-2xl animate-pulse"},U))}):t==="kanban"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border mb-4"}),s.jsx("div",{className:"flex gap-3 md:gap-4 px-4 md:px-6 pb-4 overflow-x-auto min-h-full snap-x snap-mandatory md:snap-none no-scrollbar",children:Gd.map(O=>{const U=Pc[O]??{label:O,color:"#94a3b8"},$=F.filter(z=>z.stage===O),R=$.reduce((z,X)=>z+(X.amount||0),0);return s.jsxs("div",{className:"flex-shrink-0 w-[280px] md:w-72 flex flex-col snap-center",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3 px-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"px-2.5 py-1 rounded-lg text-xs font-semibold",style:{backgroundColor:U.color+"20",color:U.color},children:U.label}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.length})]}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["$",(R/1e3).toFixed(0),"K"]})]}),s.jsxs("div",{className:"flex-1 space-y-2",children:[$.map((z,X)=>{const B=z.contact_name??z.contactName??"",L=z.amount??0,G=z.days_in_stage??z.daysInStage??0;return s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:X*.03},onClick:()=>r("opportunity",z.id),className:"bg-card border border-border rounded-2xl p-3.5 cursor-pointer hover:border-primary/30 hover:shadow-md transition-all press-scale group",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsx("p",{className:"text-sm font-display font-bold text-foreground",children:z.name}),c&&s.jsx("button",{onClick:se=>{se.stopPropagation(),l({type:"opportunity",id:z.id,name:z.name,detail:`$${(L/1e3).toFixed(0)}K`}),e("/agent")},className:"p-0.5 rounded-lg md:opacity-0 md:group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})]}),B&&s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(Ds,{name:B,className:"w-5 h-5 rounded-full text-[8px]"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:B})]}),s.jsxs("div",{className:"flex items-center justify-between mt-2.5",children:[s.jsxs("span",{className:"text-sm font-display font-extrabold text-foreground",children:["$",L>=1e3?`${(L/1e3).toFixed(0)}K`:L]}),G>0&&(G>14?s.jsxs("span",{className:"px-2 py-0.5 rounded-lg text-xs bg-destructive/15 text-destructive font-semibold",children:[G,"d"]}):s.jsxs("span",{className:"text-xs text-muted-foreground",children:[G,"d"]}))]})]},z.id)}),s.jsxs("button",{onClick:()=>a("opportunity"),className:"w-full flex items-center justify-center gap-1 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 rounded-xl transition-colors press-scale",children:[s.jsx(Bo,{className:"w-3.5 h-3.5"})," Add Opportunity"]})]})]},O)})})]}):t==="table"?s.jsx("div",{className:"px-4 md:px-6",children:F.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx("p",{className:"text-sm",children:"No opportunities match your filters."}),s.jsx("button",{onClick:()=>{f(""),p({}),k("all")},className:"mt-2 text-xs text-primary font-semibold hover:underline",children:"Clear all filters"})]}):s.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(Y,{label:"Opportunity",sortKey:"name"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Contact"}),s.jsx(Y,{label:"Amount",sortKey:"amount"}),s.jsx(Y,{label:"Stage",sortKey:"stage"}),s.jsx(Y,{label:"Probability",sortKey:"probability"}),s.jsx(Y,{label:"Created",sortKey:"created_at"}),c&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:te.map((O,U)=>{const $=O.contact_name??O.contactName??"",R=O.amount??0;return s.jsxs("tr",{onClick:()=>r("opportunity",O.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer transition-colors group ${U%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:O.name}),s.jsx("td",{className:"px-4 py-3",children:$&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ds,{name:$,className:"w-5 h-5 rounded-full text-[8px]"}),s.jsx("span",{className:"text-muted-foreground",children:$})]})}),s.jsxs("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:["$",R>=1e3?`${(R/1e3).toFixed(0)}K`:R]}),s.jsx("td",{className:"px-4 py-3",children:O.stage&&s.jsx(Tc,{stage:O.stage})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:O.probability?`${O.probability}%`:"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:O.created_at?new Date(O.created_at).toLocaleDateString():"—"}),c&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:z=>{z.stopPropagation(),l({type:"opportunity",id:O.id,name:O.name,detail:`$${(R/1e3).toFixed(0)}K`}),e("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})})]},O.id)})})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Fr,{page:j,pageSize:_,total:F.length,onPageChange:N,onPageSizeChange:w})})]})}):s.jsxs("div",{className:"px-4 md:px-6",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-6",children:[{label:"Weighted Pipeline",value:F.filter(O=>O.stage!=="closed_won"&&O.stage!=="closed_lost").reduce((O,U)=>O+(U.amount||0)*(U.probability||0)/100,0)},{label:"Best Case",value:F.filter(O=>O.stage!=="closed_lost").reduce((O,U)=>O+(U.amount||0),0)},{label:"Closed Won",value:F.filter(O=>O.stage==="closed_won").reduce((O,U)=>O+(U.amount||0),0)}].map(O=>s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground font-display font-semibold",children:O.label}),s.jsxs("p",{className:"text-2xl font-display font-extrabold text-foreground mt-1",children:["$",O.value>=1e6?`${(O.value/1e6).toFixed(2)}M`:`${(O.value/1e3).toFixed(0)}K`]})]},O.label))}),s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsx("h3",{className:"font-display font-bold text-foreground mb-4",children:"Pipeline by stage"}),s.jsx("div",{className:"space-y-4",children:Gd.filter(O=>O!=="closed_lost").map(O=>{const U=Pc[O]??{label:O,color:"#94a3b8"},$=F.filter(z=>z.stage===O).reduce((z,X)=>z+(X.amount||0),0),R=Math.max(...Gd.map(z=>F.filter(X=>X.stage===z).reduce((X,B)=>X+(B.amount||0),0)),1);return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs w-28 truncate font-semibold",style:{color:U.color},children:U.label}),s.jsx("div",{className:"flex-1 h-8 bg-muted rounded-xl overflow-hidden",children:s.jsx(Fe.div,{initial:{width:0},animate:{width:`${$/R*100}%`},transition:{duration:.8,ease:"easeOut"},className:"h-full rounded-xl flex items-center px-3",style:{backgroundColor:U.color+"30"},children:s.jsxs("span",{className:"text-xs font-display font-bold",style:{color:U.color},children:["$",($/1e3).toFixed(0),"K"]})})})]},O)})})]})]})})]})}const Xd=["discovery","poc","production","scaling","sunset"],MW=[{value:"all",label:"All"},{value:"today",label:"Today"},{value:"this_week",label:"This Week"},{value:"this_month",label:"This Month"},{value:"this_quarter",label:"This Quarter"},{value:"custom",label:"Custom"}];function DW(e){if(e==="all")return null;const t=new Date;if(e==="today"){const n=new Date(t);n.setHours(0,0,0,0);const r=new Date(t);return r.setHours(23,59,59,999),{start:n,end:r}}if(e==="this_week"){const n=new Date(t),r=n.getDay();n.setDate(n.getDate()+(r===0?-6:1-r)),n.setHours(0,0,0,0);const a=new Date(n);return a.setDate(n.getDate()+6),a.setHours(23,59,59,999),{start:n,end:a}}if(e==="this_month"){const n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);return{start:n,end:r}}if(e==="this_quarter"){const n=Math.floor(t.getMonth()/3),r=new Date(t.getFullYear(),n*3,1),a=new Date(t.getFullYear(),n*3+3,0,23,59,59,999);return{start:r,end:a}}return null}const RW=[{key:"stage",label:"Stage",options:Xd.map(e=>{var t;return{value:e,label:((t=Po[e])==null?void 0:t.label)??e}})}],OW=[{key:"name",label:"Name"},{key:"stage",label:"Stage"},{key:"attributed_arr",label:"ARR"},{key:"health_score",label:"Health"},{key:"target_prod_date",label:"Prod Date"},{key:"created_at",label:"Created"}];function IW(){const{openDrawer:e,openQuickAdd:t,openAIWithContext:n}=nt(),{enabled:r}=hr(),a=on(),[l,c]=x.useState("table"),[u,f]=x.useState(""),[m,p]=x.useState({}),[g,v]=x.useState(null),[y,k]=x.useState("all"),[j,N]=x.useState(""),[_,w]=x.useState(""),[S,E]=x.useState(1),[P,T]=x.useState(25),{data:M,isLoading:D}=u2({q:u||void 0,limit:200}),q=(M==null?void 0:M.data)??[],H=(O,U)=>{p($=>{const R={...$};return U.length===0?delete R[O]:R[O]=U,R})},I=O=>{v(U=>(U==null?void 0:U.key)===O?{key:O,dir:U.dir==="asc"?"desc":"asc"}:{key:O,dir:"asc"})},F=x.useMemo(()=>{var U;let O=[...q];if((U=m.stage)!=null&&U.length&&(O=O.filter($=>m.stage.includes($.stage))),y!=="all"){let $,R;if(y==="custom")$=j?new Date(j+"T00:00:00"):new Date(0),R=_?new Date(_+"T23:59:59"):new Date(864e13);else{const z=DW(y);z?($=z.start,R=z.end):($=new Date(0),R=new Date(864e13))}O=O.filter(z=>{if(!z.target_prod_date)return!0;const X=new Date(z.target_prod_date);return X>=$&&X<=R})}return g&&O.sort(($,R)=>{const z=$[g.key]??"",X=R[g.key]??"";return typeof z=="number"&&typeof X=="number"?g.dir==="asc"?z-X:X-z:g.dir==="asc"?String(z).localeCompare(String(X)):String(X).localeCompare(String(z))}),O},[q,m,g,y,j,_]);x.useEffect(()=>{E(1)},[u,m,g,y,j,_]);const te=F.slice((S-1)*P,S*P),Y=({label:O,sortKey:U})=>s.jsx("th",{onClick:()=>I(U),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[O,(g==null?void 0:g.key)===U&&(g.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Use Cases",children:s.jsx("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5",children:[{mode:"kanban",icon:bC},{mode:"table",icon:$a},{mode:"dashboard",icon:vC}].map(({mode:O,icon:U})=>s.jsx("button",{onClick:()=>c(O),className:`p-1.5 rounded-lg text-sm transition-all ${l===O?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(U,{className:"w-4 h-4"})},O))})}),s.jsxs("div",{className:"px-4 md:px-6 pt-3 pb-1 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground font-semibold",children:"Prod Date:"}),s.jsx("div",{className:"inline-flex rounded-xl border border-border bg-muted/40 p-0.5 gap-0.5",children:MW.map(O=>s.jsx("button",{onClick:()=>k(O.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",y===O.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:O.label},O.value))}),y==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mn,{value:j,onChange:N,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(mn,{value:_,onChange:w,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Va,{searchValue:u,onSearchChange:f,searchPlaceholder:"Search use cases...",filters:RW,activeFilters:m,onFilterChange:H,onClearFilters:()=>{p({}),k("all")},sortOptions:OW,currentSort:g,onSortChange:I,onAdd:()=>t("use-case"),addLabel:"New Use Case",entityType:"use cases"}),s.jsx("div",{className:"flex-1 overflow-y-auto pb-24 md:pb-6",children:D?s.jsx("div",{className:"flex gap-4 px-4 md:px-6 pt-2",children:[...Array(4)].map((O,U)=>s.jsx("div",{className:"flex-shrink-0 w-72 h-64 bg-muted/50 rounded-2xl animate-pulse"},U))}):l==="kanban"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border mb-4"}),s.jsx("div",{className:"flex gap-3 md:gap-4 px-4 md:px-6 pb-4 overflow-x-auto min-h-full snap-x snap-mandatory md:snap-none no-scrollbar",children:Xd.map(O=>{const U=Po[O]??{label:O,color:"#94a3b8"},$=F.filter(z=>z.stage===O),R=$.reduce((z,X)=>z+(X.attributed_arr||0),0);return s.jsxs("div",{className:"flex-shrink-0 w-[280px] md:w-72 flex flex-col snap-center",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3 px-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"px-2.5 py-1 rounded-lg text-xs font-semibold",style:{backgroundColor:U.color+"20",color:U.color},children:U.label}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.length})]}),R>0&&s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["$",(R/1e3).toFixed(0),"K ARR"]})]}),s.jsxs("div",{className:"flex-1 space-y-2",children:[$.map((z,X)=>{const B=z.account_name??z.client??"",L=z.attributed_arr??0,G=z.health_score??0;return s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:X*.03},onClick:()=>e("use-case",z.id),className:"bg-card border border-border rounded-2xl p-3.5 cursor-pointer hover:border-primary/30 hover:shadow-md transition-all press-scale group",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsx("p",{className:"text-sm font-display font-bold text-foreground",children:z.name}),r&&s.jsx("button",{onClick:se=>{se.stopPropagation(),n({type:"use-case",id:z.id,name:z.name,detail:B}),a("/agent")},className:"p-0.5 rounded-lg md:opacity-0 md:group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})]}),B&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:B}),s.jsxs("div",{className:"flex items-center justify-between mt-2.5",children:[L>0?s.jsxs("span",{className:"text-sm font-display font-extrabold text-foreground",children:["$",L>=1e3?`${(L/1e3).toFixed(0)}K`:L]}):s.jsx("span",{}),G>0&&s.jsx("span",{className:`px-2 py-0.5 rounded-lg text-xs font-semibold ${G>=80?"bg-green-500/15 text-green-400":G>=50?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400"}`,children:G})]})]},z.id)}),s.jsxs("button",{onClick:()=>t("use-case"),className:"w-full flex items-center justify-center gap-1 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 rounded-xl transition-colors press-scale",children:[s.jsx(Bo,{className:"w-3.5 h-3.5"})," Add Use Case"]})]})]},O)})})]}):l==="table"?s.jsx("div",{className:"px-4 md:px-6",children:F.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx("p",{className:"text-sm",children:"No use cases found."}),s.jsx("button",{onClick:()=>{f(""),p({}),k("all")},className:"mt-2 text-xs text-primary font-semibold hover:underline",children:"Clear all filters"})]}):s.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(Y,{label:"Use Case",sortKey:"name"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Client"}),s.jsx(Y,{label:"Stage",sortKey:"stage"}),s.jsx(Y,{label:"ARR",sortKey:"attributed_arr"}),s.jsx(Y,{label:"Health",sortKey:"health_score"}),s.jsx(Y,{label:"Prod Date",sortKey:"target_prod_date"}),s.jsx(Y,{label:"Created",sortKey:"created_at"}),r&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:te.map((O,U)=>{const $=O.stage??"",R=Po[$]??{label:$,color:"#94a3b8"},z=O.attributed_arr??0,X=O.health_score??0,B=O.account_name??O.client??"";return s.jsxs("tr",{onClick:()=>e("use-case",O.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer transition-colors group ${U%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:O.name}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:B||"—"}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:R.color+"18",color:R.color},children:R.label})}),s.jsx("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:z>0?`$${(z/1e3).toFixed(0)}K`:"—"}),s.jsx("td",{className:"px-4 py-3",children:X>0?s.jsx("span",{className:`px-2 py-0.5 rounded-lg text-xs font-semibold ${X>=80?"bg-green-500/15 text-green-400":X>=50?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400"}`,children:X}):"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:O.target_prod_date?new Date(O.target_prod_date).toLocaleDateString():"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:O.created_at?new Date(O.created_at).toLocaleDateString():"—"}),r&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:L=>{L.stopPropagation(),n({type:"use-case",id:O.id,name:O.name,detail:B}),a("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(kn,{className:"w-3.5 h-3.5 text-accent"})})})]},O.id)})})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Fr,{page:S,pageSize:P,total:F.length,onPageChange:E,onPageSizeChange:T})})]})}):s.jsxs("div",{className:"px-4 md:px-6",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-6",children:[{label:"Total ARR",value:F.filter(O=>O.stage!=="sunset").reduce((O,U)=>O+(U.attributed_arr||0),0),isCount:!1},{label:"Production ARR",value:F.filter(O=>O.stage==="production"||O.stage==="scaling").reduce((O,U)=>O+(U.attributed_arr||0),0),isCount:!1},{label:"Active Use Cases",value:F.filter(O=>O.stage!=="sunset").length,isCount:!0}].map(O=>s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsx("p",{className:"text-xs text-muted-foreground font-display font-semibold",children:O.label}),s.jsx("p",{className:"text-2xl font-display font-extrabold text-foreground mt-1",children:O.isCount?O.value:O.value>=1e6?`$${(O.value/1e6).toFixed(2)}M`:`$${(O.value/1e3).toFixed(0)}K`})]},O.label))}),s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsx("h3",{className:"font-display font-bold text-foreground mb-4",children:"ARR by stage"}),s.jsx("div",{className:"space-y-4",children:Xd.map(O=>{const U=Po[O]??{label:O,color:"#94a3b8"},$=F.filter(X=>X.stage===O).reduce((X,B)=>X+(B.attributed_arr||0),0),R=F.filter(X=>X.stage===O).length,z=Math.max(...Xd.map(X=>F.filter(B=>B.stage===X).reduce((B,L)=>B+(L.attributed_arr||0),0)),1);return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs w-24 truncate font-semibold",style:{color:U.color},children:U.label}),s.jsx("div",{className:"flex-1 h-8 bg-muted rounded-xl overflow-hidden",children:s.jsx(Fe.div,{initial:{width:0},animate:{width:$>0?`${$/z*100}%`:"0%"},transition:{duration:.8,ease:"easeOut"},className:"h-full rounded-xl flex items-center px-3",style:{backgroundColor:U.color+"30"},children:$>0&&s.jsxs("span",{className:"text-xs font-display font-bold",style:{color:U.color},children:["$",($/1e3).toFixed(0),"K"]})})}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono w-6 text-right",children:R})]},O)})})]})]})})]})}const LW=[{key:"type",label:"Type",options:[{value:"call",label:"Call"},{value:"email",label:"Email"},{value:"meeting",label:"Meeting"},{value:"note",label:"Note"},{value:"task",label:"Task"},{value:"demo",label:"Demo"},{value:"proposal",label:"Proposal"},{value:"research",label:"Research"},{value:"handoff",label:"Handoff"},{value:"status_update",label:"Status Update"}]},{key:"subject_type",label:"Subject",options:[{value:"contact",label:"Contact"},{value:"account",label:"Account"},{value:"opportunity",label:"Opportunity"},{value:"use_case",label:"Use Case"}]},{key:"outcome",label:"Outcome",options:[{value:"connected",label:"Connected"},{value:"voicemail",label:"Voicemail"},{value:"positive",label:"Positive"},{value:"negative",label:"Negative"},{value:"neutral",label:"Neutral"},{value:"no_show",label:"No Show"},{value:"follow_up_needed",label:"Follow-up Needed"}]}],FW=[{key:"occurred_at",label:"When"},{key:"created_at",label:"Logged"},{key:"type",label:"Type"},{key:"outcome",label:"Outcome"}],$W=[{value:"today",label:"Today"},{value:"this_week",label:"This Week"},{value:"this_month",label:"This Month"},{value:"this_quarter",label:"This Quarter"},{value:"custom",label:"Custom"}];function VW(e){const t=new Date,n=new Date(t);if(n.setHours(23,59,59,999),e==="today"){const r=new Date(t);return r.setHours(0,0,0,0),{start:r,end:n}}if(e==="this_week"){const r=new Date(t),a=r.getDay(),l=a===0?-6:1-a;return r.setDate(r.getDate()+l),r.setHours(0,0,0,0),{start:r,end:n}}if(e==="this_month")return{start:new Date(t.getFullYear(),t.getMonth(),1,0,0,0,0),end:n};if(e==="this_quarter"){const r=Math.floor(t.getMonth()/3);return{start:new Date(t.getFullYear(),r*3,1,0,0,0,0),end:n}}return{start:new Date(0),end:n}}function BW(){const{openQuickAdd:e}=nt(),[t,n]=x.useState(""),[r,a]=x.useState({}),[l,c]=x.useState(null),[u,f]=x.useState("this_week"),[m,p]=x.useState(""),[g,v]=x.useState(""),[y,k]=x.useState(1),j=50,{data:N,isLoading:_}=Dy({limit:200}),w=(N==null?void 0:N.data)??[],S=(M,D)=>{a(q=>{const H={...q};return D.length===0?delete H[M]:H[M]=D,H})},E=M=>{c(D=>(D==null?void 0:D.key)===M?{key:M,dir:D.dir==="asc"?"desc":"asc"}:{key:M,dir:"desc"})},P=x.useMemo(()=>{var H,I,F;let M=[...w],D,q;if(u==="custom"?(D=m?new Date(m+"T00:00:00"):new Date(0),q=g?new Date(g+"T23:59:59"):new Date(864e13)):{start:D,end:q}=VW(u),M=M.filter(te=>{const Y=new Date(te.occurred_at??te.created_at);return Y>=D&&Y<=q}),t){const te=t.toLowerCase();M=M.filter(Y=>{const O=(Y.description??Y.body??Y.subject??"").toLowerCase(),U=(Y.contact_name??"").toLowerCase(),$=(Y.outcome??"").toLowerCase(),R=(Y.subject_type??"").replace(/_/g," ").toLowerCase();return O.includes(te)||U.includes(te)||$.includes(te)||R.includes(te)})}return(H=r.type)!=null&&H.length&&(M=M.filter(te=>r.type.includes(te.type))),(I=r.subject_type)!=null&&I.length&&(M=M.filter(te=>r.subject_type.includes(te.subject_type))),(F=r.outcome)!=null&&F.length&&(M=M.filter(te=>r.outcome.includes(te.outcome))),l&&M.sort((te,Y)=>{let O,U;return l.key==="occurred_at"?(O=te.occurred_at??te.created_at??"",U=Y.occurred_at??Y.created_at??""):(O=te[l.key]??"",U=Y[l.key]??""),l.dir==="asc"?O.localeCompare(U):U.localeCompare(O)}),M},[w,t,r,l,u,m,g]);x.useEffect(()=>{k(1)},[t,r,l,u,m,g]);const T=P.slice((y-1)*j,y*j);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Activities"}),s.jsxs("div",{className:"px-4 md:px-6 pt-3 pb-1 flex flex-wrap items-center gap-2",children:[s.jsx("div",{className:"inline-flex rounded-xl border border-border bg-muted/40 p-0.5 gap-0.5",children:$W.map(M=>s.jsx("button",{onClick:()=>f(M.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",u===M.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:M.label},M.value))}),u==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mn,{value:m,onChange:p,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(mn,{value:g,onChange:v,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Va,{searchValue:t,onSearchChange:n,searchPlaceholder:"Search activities...",filters:LW,activeFilters:r,onFilterChange:S,onClearFilters:()=>a({}),sortOptions:FW,currentSort:l,onSortChange:E,onAdd:()=>e("activity"),addLabel:"Log Activity",entityType:"activities"}),s.jsx("div",{className:"flex-1 overflow-y-auto px-4 md:px-6 pb-24 md:pb-6",children:_?s.jsx("div",{className:"space-y-3 pt-2",children:[...Array(6)].map((M,D)=>s.jsx("div",{className:"h-12 bg-muted/50 rounded-xl animate-pulse"},D))}):s.jsxs("div",{className:"bg-card border border-border rounded-2xl p-4 shadow-sm",children:[s.jsx(D_,{activities:T}),s.jsx(Fr,{page:y,pageSize:j,total:P.length,onPageChange:k})]})})]})}const zW={contact:Bc,opportunity:nf,"use-case":kC,account:cA},Zj={contact:"Contact",opportunity:"Opportunity","use-case":"Use Case",account:"Account"};async function WW(e,t,n,r){const a=localStorage.getItem("crmy_token"),l=await fetch(`/api/v1/agent/sessions/${e}/chat`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify({message:t}),signal:r});if(!l.ok){const m=await l.json().catch(()=>({error:l.statusText}));throw new Error(m.error||m.detail||`HTTP ${l.status}`)}const c=l.body.getReader(),u=new TextDecoder;let f="";for(;;){const{done:m,value:p}=await c.read();if(m)break;f+=u.decode(p,{stream:!0});const g=f.split(`
|
|
568
|
+
`);f=g.pop();for(const v of g)if(v.startsWith("data: "))try{const y=JSON.parse(v.slice(6));n(y)}catch{}}}function UW(){var T;const[e,t]=x.useState([]),[n,r]=x.useState(""),[a,l]=x.useState(!1),[c,u]=x.useState(null),[f,m]=x.useState(null),p=x.useRef(null),g=x.useRef(null),{aiContext:v}=nt(),{enabled:y}=hr(),{data:k,refetch:j}=$6(),N=V6(),_=(k==null?void 0:k.data)??[];x.useEffect(()=>{var M;(M=p.current)==null||M.scrollIntoView({behavior:"smooth"})},[e]),x.useEffect(()=>{v&&(u(v),r(`Update ${v.name}: `),t([{kind:"assistant",content:`I'm ready to help with **${v.name}**${v.detail?` (${v.detail})`:""}. What would you like to do?`}]),m(null),nt.setState({aiContext:null}))},[v]);const w=x.useCallback(async M=>{m(M.id),u(M.context_type?{type:M.context_type,id:M.context_id??"",name:M.context_name??""}:null);const D=localStorage.getItem("crmy_token");try{const q=await fetch(`/api/v1/agent/sessions/${M.id}`,{headers:D?{Authorization:`Bearer ${D}`}:{}});if(q.ok){const{data:H}=await q.json(),I=[];for(const F of H.messages)F.role!=="system"&&(F.role==="user"&&I.push({kind:"user",content:F.content}),F.role==="assistant"&&I.push({kind:"assistant",content:F.content}));t(I)}}catch{}},[]),S=x.useCallback(async()=>{const M=n.trim();if(!M||a)return;r(""),t(q=>[...q,{kind:"user",content:M}]),l(!0);const D=new AbortController;g.current=D;try{let q=f;q||(q=(await N.mutateAsync({context_type:c==null?void 0:c.type,context_id:c==null?void 0:c.id,context_name:c==null?void 0:c.name})).data.id,m(q));let H="",I=!1;await WW(q,M,F=>{switch(F.type){case"delta":H+=F.content,t(te=>{if(!I)return I=!0,[...te,{kind:"assistant",content:H}];const Y=[...te],O=Y[Y.length-1];return(O==null?void 0:O.kind)==="assistant"&&(Y[Y.length-1]={...O,content:H}),Y});break;case"tool_call":H="",I=!1,t(te=>[...te,{kind:"tool_call",id:F.id,name:F.name,arguments:F.arguments}]);break;case"tool_result":t(te=>[...te,{kind:"tool_result",id:F.id,name:F.name,is_error:F.is_error}]);break;case"error":t(te=>[...te,{kind:"error",message:F.message}]);break;case"done":j();break}},D.signal)}catch(q){q.name!=="AbortError"&&t(H=>[...H,{kind:"error",message:q.message}])}finally{l(!1),g.current=null}},[n,a,f,c,N,j]),E=c?[`Update ${((T=Zj[c.type])==null?void 0:T.toLowerCase())??"record"} details`,"Summarize activity","Draft follow-up"]:["Summarize pipeline","Deals needing attention","List my open activities"],P=c?zW[c.type]:null;return y?s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"AI Agent"}),s.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx("div",{className:"px-4 py-3 border-b border-border bg-gradient-to-r from-primary/5 to-accent/5",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_z,{}),s.jsx("span",{className:"text-sm font-display font-bold text-foreground",children:"AI Agent active"}),a&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-primary ml-2",children:[s.jsx(sf,{className:"w-3 h-3 animate-spin"})," Thinking..."]}),s.jsx("button",{onClick:()=>{m(null),t([]),u(null),r("")},className:"text-[10px] text-muted-foreground ml-auto bg-muted px-2 py-0.5 rounded-full hover:bg-muted/80 transition-colors",children:"New chat"})]})}),c&&P&&s.jsx(Fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"px-4 py-2.5 border-b border-border bg-accent/5",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-accent/15 flex items-center justify-center",children:s.jsx(P,{className:"w-3.5 h-3.5 text-accent"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:Zj[c.type]}),s.jsxs("p",{className:"text-sm font-display font-bold text-foreground truncate",children:[c.name,c.detail&&s.jsxs("span",{className:"font-normal text-muted-foreground ml-1.5",children:["· ",c.detail]})]})]}),s.jsx("button",{onClick:()=>u(null),className:"p-1 rounded-md hover:bg-muted transition-colors",children:s.jsx(Sn,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 pb-24 md:pb-4",children:[e.length===0&&s.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[s.jsx(fn,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),s.jsx("p",{className:"text-sm",children:"Start a conversation with your CRM agent."})]}),e.map((M,D)=>s.jsx(HW,{msg:M,index:D},D)),s.jsx("div",{ref:p})]}),e.length===0&&s.jsx("div",{className:"px-4 flex gap-2 flex-wrap",children:E.map(M=>s.jsx("button",{onClick:()=>r(M),className:"px-3.5 py-2 rounded-xl text-xs bg-card border border-border text-muted-foreground hover:bg-primary/5 hover:text-primary hover:border-primary/30 transition-all press-scale",children:M},M))}),s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"flex gap-2 items-end bg-card border border-border rounded-2xl p-2 shadow-sm",children:[s.jsx("textarea",{value:n,onChange:M=>r(M.target.value),onKeyDown:M=>M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),S()),placeholder:"Ask your AI agent...",rows:1,disabled:a,className:"flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none px-2 py-1.5 disabled:opacity-50"}),s.jsx("button",{onClick:S,disabled:!n.trim()||a,className:"p-2.5 rounded-xl bg-gradient-to-br from-primary to-primary/80 text-primary-foreground hover:shadow-md disabled:opacity-40 transition-all press-scale",children:a?s.jsx(sf,{className:"w-4 h-4 animate-spin"}):s.jsx(zg,{className:"w-4 h-4"})})]})})]}),s.jsx("div",{className:"hidden lg:flex flex-col w-80 border-l border-border bg-surface",children:s.jsxs("div",{className:"p-5 flex-1 overflow-y-auto",children:[s.jsx("h3",{className:"font-display font-bold text-foreground text-sm mb-3",children:"Recent sessions"}),_.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversations yet."}),s.jsx("div",{className:"space-y-1.5",children:_.map(M=>s.jsxs("button",{onClick:()=>w(M),className:`w-full flex items-start gap-2.5 px-3 py-2.5 rounded-xl text-left hover:bg-muted/50 transition-colors group ${f===M.id?"bg-muted/50":""}`,children:[s.jsx(Ji,{className:"w-3.5 h-3.5 text-muted-foreground mt-0.5 flex-shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors line-clamp-2",children:M.label||"Untitled conversation"})]},M.id))})]})})]})]}):s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"AI Agent"}),s.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center max-w-md space-y-3",children:[s.jsx(fn,{className:"w-12 h-12 mx-auto text-muted-foreground/40"}),s.jsx("h2",{className:"text-lg font-display font-bold text-foreground",children:"AI Agent is not enabled"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"An administrator needs to enable the AI agent and configure an LLM provider in Settings → AI Agent."})]})})]})}function HW({msg:e,index:t}){if(e.kind==="tool_call")return s.jsxs(Fe.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground",children:[s.jsx(of,{className:"w-3 h-3"}),s.jsxs("span",{children:["Calling ",s.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:e.name})]})]});if(e.kind==="tool_result")return s.jsxs(Fe.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:`flex items-center gap-2 px-3 py-1.5 text-xs ${e.is_error?"text-destructive":"text-muted-foreground"}`,children:[s.jsx(of,{className:"w-3 h-3"}),s.jsxs("span",{children:[e.is_error?"Error from":"Result from"," ",s.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:e.name})]})]});if(e.kind==="error")return s.jsx(Fe.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"px-4 py-2 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm",children:e.message});const n=e.kind==="user";return s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:Math.min(t*.03,.3)},className:`flex ${n?"justify-end":"justify-start"}`,children:[!n&&s.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-br from-primary/20 to-accent/20 flex items-center justify-center mr-2 flex-shrink-0 mt-1",children:s.jsx(fn,{className:"w-4 h-4 text-primary"})}),s.jsx("div",{className:`max-w-[75%] rounded-2xl px-4 py-3 text-sm whitespace-pre-wrap
|
|
569
|
+
${n?"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground rounded-br-md":"bg-card border border-border text-foreground rounded-bl-md shadow-sm"}`,children:e.content})]})}function qW(e){return e===null?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function KW(e){const t=new Date(e),r=Date.now()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()}function YW({entry:e}){const[t,n]=x.useState(!1);return s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden mb-2",children:[s.jsxs("button",{className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/50 transition-colors",onClick:()=>n(r=>!r),children:[s.jsx("span",{className:"text-muted-foreground",children:t?s.jsx(Wn,{className:"w-4 h-4"}):s.jsx(Ao,{className:"w-4 h-4"})}),s.jsxs("span",{className:`flex items-center gap-1.5 font-mono text-sm font-medium ${e.is_error?"text-destructive":"text-foreground"}`,children:[e.is_error?s.jsx(cs,{className:"w-3.5 h-3.5 shrink-0"}):s.jsx(of,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),e.tool_name]}),s.jsx("span",{className:"flex-1"}),s.jsxs("span",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.session_label&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(vA,{className:"w-3 h-3"}),s.jsx("span",{className:"max-w-[120px] truncate",children:e.session_label})]}),e.user_name&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Bc,{className:"w-3 h-3"}),e.user_name]}),e.duration_ms!==null&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ji,{className:"w-3 h-3"}),qW(e.duration_ms)]}),s.jsx("span",{title:new Date(e.created_at).toLocaleString(),children:KW(e.created_at)})]})]}),t&&s.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Arguments"}),s.jsx("pre",{className:"text-xs font-mono bg-background border border-border rounded p-2 overflow-x-auto whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:JSON.stringify(e.tool_args,null,2)})]}),e.tool_result!==null&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:e.is_error?"Error":"Result"}),s.jsx("pre",{className:`text-xs font-mono border rounded p-2 overflow-x-auto whitespace-pre-wrap break-words max-h-48 overflow-y-auto ${e.is_error?"bg-destructive/5 border-destructive/30 text-destructive":"bg-background border-border"}`,children:JSON.stringify(e.tool_result,null,2)})]})]})]})}const QW=["contact_get","contact_search","contact_create","contact_update","account_get","account_search","account_create","opportunity_get","opportunity_list","opportunity_create","opportunity_update","activity_create","activity_complete","activity_update","context_add","context_list","context_extract","context_supersede","briefing_get","assignment_create","assignment_list"];function GW(){const[e,t]=x.useState({}),[n,r]=x.useState(""),[a,l]=x.useState("all"),[c,u]=x.useState(""),f={...e,tool_name:n||void 0,is_error:a==="errors"?!0:void 0,since:c||void 0,limit:50},{data:m,isLoading:p,isError:g}=z6(f),v=(m==null?void 0:m.data)??[],y=(m==null?void 0:m.total)??0;return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Agent Activity"}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-4xl mx-auto w-full",children:[s.jsxs("div",{className:"flex flex-wrap gap-3 mb-6",children:[s.jsxs("select",{className:"h-9 px-3 rounded-md border border-input bg-background text-sm",value:n,onChange:k=>r(k.target.value),children:[s.jsx("option",{value:"",children:"All tools"}),QW.map(k=>s.jsx("option",{value:k,children:k},k))]}),s.jsxs("select",{className:"h-9 px-3 rounded-md border border-input bg-background text-sm",value:a,onChange:k=>l(k.target.value),children:[s.jsx("option",{value:"all",children:"All results"}),s.jsx("option",{value:"errors",children:"Errors only"})]}),s.jsx("input",{type:"date",className:"h-9 px-3 rounded-md border border-input bg-background text-sm",value:c,onChange:k=>u(k.target.value?new Date(k.target.value).toISOString():""),placeholder:"Since date"}),(n||a!=="all"||c)&&s.jsx("button",{className:"h-9 px-3 rounded-md border border-input bg-background text-sm text-muted-foreground hover:text-foreground",onClick:()=>{r(""),l("all"),u("")},children:"Clear filters"}),s.jsxs("span",{className:"ml-auto self-center text-sm text-muted-foreground",children:[y.toLocaleString()," tool call",y!==1?"s":""]})]}),p?s.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((k,j)=>s.jsx("div",{className:"h-12 rounded-lg bg-muted animate-pulse"},j))}):g?s.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[s.jsx(cs,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),s.jsx("p",{children:"Failed to load activity log."})]}):v.length===0?s.jsxs("div",{className:"text-center py-20 text-muted-foreground",children:[s.jsx(of,{className:"w-10 h-10 mx-auto mb-3 opacity-20"}),s.jsx("p",{className:"text-sm",children:"No agent tool calls recorded yet."}),s.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Activity appears here as the agent uses tools in chat sessions."})]}):s.jsxs(s.Fragment,{children:[v.map(k=>s.jsx(YW,{entry:k},k.id)),(m==null?void 0:m.next_cursor)&&s.jsx("button",{className:"w-full mt-2 py-2 text-sm text-muted-foreground hover:text-foreground border border-dashed border-border rounded-lg",onClick:()=>t(k=>({...k,cursor:m.next_cursor})),children:"Load more"})]})]})]})}var gm="Switch",[XW]=Os(gm),[ZW,JW]=XW(gm),Y_=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:l,required:c,disabled:u,value:f="on",onCheckedChange:m,form:p,...g}=e,[v,y]=x.useState(null),k=Je(t,S=>y(S)),j=x.useRef(!1),N=v?p||!!v.closest("form"):!0,[_,w]=Aa({prop:a,defaultProp:l??!1,onChange:m,caller:gm});return s.jsxs(ZW,{scope:n,checked:_,disabled:u,children:[s.jsx($e.button,{type:"button",role:"switch","aria-checked":_,"aria-required":c,"data-state":Z_(_),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:k,onClick:Ie(e.onClick,S=>{w(E=>!E),N&&(j.current=S.isPropagationStopped(),j.current||S.stopPropagation())})}),N&&s.jsx(X_,{control:v,bubbles:!j.current,name:r,value:f,checked:_,required:c,disabled:u,form:p,style:{transform:"translateX(-100%)"}})]})});Y_.displayName=gm;var Q_="SwitchThumb",G_=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=JW(Q_,n);return s.jsx($e.span,{"data-state":Z_(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});G_.displayName=Q_;var eU="SwitchBubbleInput",X_=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},l)=>{const c=x.useRef(null),u=Je(c,l),f=hv(n),m=Gg(t);return x.useEffect(()=>{const p=c.current;if(!p)return;const g=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==n&&y){const k=new Event("click",{bubbles:r});y.call(p,n),p.dispatchEvent(k)}},[f,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});X_.displayName=eU;function Z_(e){return e?"checked":"unchecked"}var J_=Y_,tU=G_;const oc=x.forwardRef(({className:e,...t},n)=>s.jsx(J_,{className:Oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:s.jsx(tU,{className:Oe("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")})}));oc.displayName=J_.displayName;const Jp={anthropic:["claude-sonnet-4-20250514","claude-opus-4-20250514","claude-haiku-4-5-20251001"],openai:["gpt-4o","gpt-4o-mini","o3-mini"],openrouter:["openrouter/auto","anthropic/claude-sonnet-4","openai/gpt-4o","google/gemini-2.0-flash"],ollama:["llama3.2","mistral","deepseek-r1"],custom:[]},ex={anthropic:"https://api.anthropic.com/v1",openai:"https://api.openai.com/v1",openrouter:"https://openrouter.ai/api/v1",ollama:"http://localhost:11434/v1",custom:"https://your-gateway.example.com/v1"},Jj={anthropic:{dot:"bg-amber-500",active:"border-amber-500/50 bg-amber-500/10 text-amber-600 dark:text-amber-400"},openai:{dot:"bg-green-500",active:"border-green-500/50 bg-green-500/10 text-green-600 dark:text-green-400"},openrouter:{dot:"bg-purple-500",active:"border-purple-500/50 bg-purple-500/10 text-purple-600 dark:text-purple-400"},ollama:{dot:"bg-blue-500",active:"border-blue-500/50 bg-blue-500/10 text-blue-600 dark:text-blue-400"},custom:{dot:"bg-gray-400",active:"border-gray-400/50 bg-gray-400/10 text-gray-600 dark:text-gray-400"}},nU={1e3:"~$0.002 / turn at current model pricing",4e3:"~$0.006 / turn at current model pricing",8e3:"~$0.012 / turn at current model pricing",16e3:"~$0.024 / turn at current model pricing"},Td="You are a CRMy AI agent helping manage a CRM pipeline. You have access to contacts, accounts, opportunities, use cases, and activity history via tools. Be concise, accurate, and always confirm before making changes to CRM objects.",Zd="w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",rU=`${Zd} cursor-pointer`,eN="px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 transition-colors disabled:opacity-40",tx="px-3 py-1.5 rounded-lg border border-border text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors",tN="px-3 py-1.5 rounded-lg bg-destructive text-destructive-foreground text-xs font-semibold hover:bg-destructive/90 transition-colors";function sU(){const{data:e,isLoading:t}=b2(),n=L6(),r=F6(),a=B6(),l=e==null?void 0:e.data,[c,u]=x.useState(!1),[f,m]=x.useState("anthropic"),[p,g]=x.useState(ex.anthropic),[v,y]=x.useState(""),[k,j]=x.useState(!1),[N,_]=x.useState("claude-sonnet-4-20250514"),[w,S]=x.useState(""),[E,P]=x.useState(90),[T,M]=x.useState(Td),[D,q]=x.useState(!1),[H,I]=x.useState(Td),[F,te]=x.useState(4e3),[Y,O]=x.useState(!0),[U,$]=x.useState(!0),[R,z]=x.useState(!1),X=x.useRef(null),[B,L]=x.useState(!1),[G,se]=x.useState("");x.useEffect(()=>{var ce;l&&(u(l.enabled),m(l.provider),g(l.base_url),_(l.model),y(l.api_key_enc??""),P(l.history_retention_days),M(l.system_prompt??Td),I(l.system_prompt??Td),te(l.max_tokens_per_turn),O(l.can_create_assignments),$(l.can_log_activities),z(l.can_write_objects),(ce=Jp[l.provider])!=null&&ce.includes(l.model)||S(l.model))},[l]),x.useEffect(()=>{D&&X.current&&X.current.focus()},[D]);const ae=ce=>{m(ce),g(ex[ce]);const Be=Jp[ce];_(Be[0]??""),S("")},ue=async ce=>{u(ce);try{await n.mutateAsync({enabled:ce}),xe({title:ce?"Agent enabled":"Agent disabled"})}catch{u(!ce),xe({title:"Failed to update",variant:"destructive"})}},oe=async()=>{const ce=await r.mutateAsync();ce.ok?xe({title:"Connection successful",description:`Connected to ${f} at ${p}`}):xe({title:"Connection failed",description:ce.error??"Check your API key and base URL.",variant:"destructive"})},he=async()=>{const ce={provider:f,base_url:p,model:f==="custom"?w:N,system_prompt:T,max_tokens_per_turn:F,history_retention_days:E,can_write_objects:R,can_log_activities:U,can_create_assignments:Y};v&&!v.startsWith("sk-")&&(ce.api_key=v);try{await n.mutateAsync(ce),xe({title:"Settings saved",description:"Agent configuration updated."})}catch{xe({title:"Save failed",variant:"destructive"})}},ge=async()=>{L(!1),se("");try{await a.mutateAsync(),xe({title:"Chat histories cleared",description:"All agent chat histories have been deleted."})}catch{xe({title:"Failed to clear histories",variant:"destructive"})}};if(t)return s.jsxs("div",{className:"space-y-5 max-w-2xl",children:[s.jsx("div",{className:"h-8 bg-muted rounded animate-pulse"}),s.jsx("div",{className:"h-48 bg-muted rounded animate-pulse"})]});const Ce=c?"":"opacity-40 pointer-events-none";return s.jsxs("div",{className:"space-y-5 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground mb-1",children:"Local AI Agent"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure the AI agent for your workspace."})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-amber-500/10 flex items-center justify-center",children:s.jsx(kn,{className:"w-4 h-4 text-amber-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Enable In-App AI agent"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Toggle AI features on or off for this workspace"})]})]}),s.jsx(oc,{checked:c,onCheckedChange:ue,"aria-label":"Enable In-App AI agent"})]}),c&&s.jsx("div",{className:"px-5 py-3 flex flex-wrap gap-2",children:[{icon:"✦",label:"Sparkle column (tables)"},{icon:"💬",label:"Chat button (object detail)"},{icon:"◎",label:"Floating AI icon"},{icon:"✎",label:"AI-assist on edit"}].map(ce=>s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium px-2 py-1 rounded-lg bg-muted text-muted-foreground border border-border",children:[s.jsx("span",{children:ce.icon})," ",ce.label]},ce.label))})]}),s.jsxs("div",{className:`rounded-xl border border-border bg-card overflow-hidden transition-opacity ${Ce}`,"aria-disabled":!c,children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-blue-500/10 flex items-center justify-center",children:s.jsx(hA,{className:"w-4 h-4 text-blue-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Provider & model"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to an LLM gateway or direct provider"})]})]}),(l==null?void 0:l.api_key_enc)&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Key configured"})]})]}),s.jsxs("div",{className:"divide-y divide-border px-5",children:[s.jsxs("div",{className:"py-4 space-y-2",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Provider"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:["anthropic","openai","openrouter","ollama","custom"].map(ce=>{const Be=f===ce;return s.jsxs("button",{onClick:()=>ae(ce),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-xs font-semibold transition-colors ${Be?Jj[ce].active+" border":"border-border text-muted-foreground hover:text-foreground bg-muted/40"}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Jj[ce].dot}`}),ce.charAt(0).toUpperCase()+ce.slice(1)]},ce)})})]}),s.jsxs("div",{className:"py-4 space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Base URL"}),s.jsx("input",{value:p,onChange:ce=>g(ce.target.value),placeholder:ex[f],className:Zd})]}),f!=="ollama"?s.jsxs("div",{className:"py-4 space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"API Key"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:k?"text":"password",value:v,onChange:ce=>y(ce.target.value),placeholder:"sk-...",className:Zd+" pr-10"}),s.jsx("button",{type:"button",onClick:()=>j(ce=>!ce),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:k?s.jsx(dA,{className:"w-3.5 h-3.5"}):s.jsx(fA,{className:"w-3.5 h-3.5"})})]})]}):s.jsx("div",{className:"py-4",children:s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Ollama runs locally — no API key required."})}),s.jsxs("div",{className:"py-4 space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Model"}),f==="custom"?s.jsx("input",{value:w,onChange:ce=>S(ce.target.value),placeholder:"e.g. my-custom-model",className:Zd}):s.jsx("select",{value:N,onChange:ce=>_(ce.target.value),className:rU,children:Jp[f].map(ce=>s.jsx("option",{value:ce,children:ce},ce))})]}),s.jsxs("div",{className:"py-4 flex items-center gap-2 flex-wrap",children:[s.jsx("button",{onClick:oe,disabled:r.isPending,className:tx+" disabled:opacity-40",children:r.isPending?"Testing...":"Test connection"}),s.jsx("button",{onClick:he,disabled:n.isPending,className:eN,children:n.isPending?"Saving...":"Save changes"})]})]})]}),s.jsxs("div",{className:`rounded-xl border border-border bg-card overflow-hidden transition-opacity ${Ce}`,"aria-disabled":!c,children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-purple-500/10 flex items-center justify-center",children:s.jsx(Ma,{className:"w-4 h-4 text-purple-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Per-user agent behaviour"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Fine-tune how the agent behaves for this workspace"})]})]}),s.jsxs("div",{className:"divide-y divide-border px-5",children:[s.jsxs("div",{className:"flex items-center justify-between py-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Chat history retention"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"How long to keep conversation history"})]}),s.jsxs("select",{value:E,onChange:ce=>P(Number(ce.target.value)),className:"h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring cursor-pointer",children:[s.jsx("option",{value:30,children:"30 days"}),s.jsx("option",{value:90,children:"90 days"}),s.jsx("option",{value:180,children:"180 days"}),s.jsx("option",{value:0,children:"Forever"})]})]}),s.jsxs("div",{className:"py-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"System prompt"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Instructions sent to the agent at the start of every conversation"})]}),s.jsx("button",{onClick:()=>{I(T),q(!0)},className:"text-xs font-semibold text-primary hover:underline whitespace-nowrap",children:"Edit prompt →"})]}),s.jsx("div",{className:"p-3 rounded-lg bg-muted/30 border border-border",children:s.jsx("p",{className:"text-xs text-muted-foreground font-mono leading-relaxed line-clamp-2",children:T})})]}),s.jsxs("div",{className:"py-3 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Max tokens per turn"})}),s.jsxs("select",{value:F,onChange:ce=>te(Number(ce.target.value)),className:"h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring cursor-pointer",children:[s.jsx("option",{value:1e3,children:"1,000"}),s.jsx("option",{value:4e3,children:"4,000"}),s.jsx("option",{value:8e3,children:"8,000"}),s.jsx("option",{value:16e3,children:"16,000"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:nU[F]})]}),s.jsxs("div",{className:"flex items-center justify-between py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Allow agent to create assignments"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Agent can assign tasks to users and actors"})]}),s.jsx(oc,{checked:Y,onCheckedChange:O,"aria-label":"Allow agent to create assignments"})]}),s.jsxs("div",{className:"flex items-center justify-between py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Allow agent to log activities"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Agent can record calls, notes, and emails"})]}),s.jsx(oc,{checked:U,onCheckedChange:$,"aria-label":"Allow agent to log activities"})]}),s.jsxs("div",{className:"py-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Allow agent to write CRM objects"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Agent can create and edit contacts, accounts, and opportunities"})]}),s.jsx(oc,{checked:R,onCheckedChange:z,"aria-label":"Allow agent to write CRM objects"})]}),R&&s.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[s.jsx(cs,{className:"w-3.5 h-3.5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:"Granting write access means the agent can modify CRM records autonomously. Review agent actions regularly."})]})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center",children:s.jsx(_A,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Observability"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Review what the agent has been doing across the workspace"})]})]}),s.jsx("div",{className:"px-5 py-3",children:s.jsxs(Qn,{to:"/agent/activity",className:"flex items-center justify-between py-1 group",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Agent activity log"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Browse every tool call the agent has made — with arguments, results, session, and timing"})]}),s.jsx(ji,{className:"w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors shrink-0 ml-4"})]})})]}),s.jsxs("div",{className:"rounded-xl border border-red-200 dark:border-red-900/50 bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-red-200 dark:border-red-900/50",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-red-500/10 flex items-center justify-center",children:s.jsx(cs,{className:"w-4 h-4 text-red-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-red-600 dark:text-red-400",children:"Danger zone"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Irreversible actions — proceed with care"})]})]}),s.jsx("div",{className:"divide-y divide-red-100 dark:divide-red-900/30 px-5",children:s.jsxs("div",{className:"flex items-center justify-between py-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Clear all chat histories"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Permanently delete all agent conversation history for this workspace"})]}),s.jsx("button",{onClick:()=>L(!0),className:tN+" whitespace-nowrap",children:"Clear all histories"})]})})]}),D&&s.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-foreground/20 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 max-w-2xl w-full mx-4 shadow-xl space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold text-foreground",children:"Edit system prompt"}),s.jsx("button",{onClick:()=>q(!1),className:"text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(Sn,{className:"w-4 h-4"})})]}),s.jsx("textarea",{ref:X,value:H,onChange:ce=>I(ce.target.value),rows:10,className:"w-full px-3 py-2 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring font-mono resize-none"}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:()=>q(!1),className:tx,children:"Cancel"}),s.jsx("button",{onClick:()=>{M(H),q(!1),xe({title:"System prompt updated"})},className:eN,children:"Save prompt"})]})]})}),B&&s.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-foreground/20 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 max-w-sm w-full mx-4 shadow-xl space-y-4",children:[s.jsx("h3",{className:"font-semibold text-foreground",children:"Clear all chat histories?"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["This is irreversible. Type ",s.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:"CLEAR"})," to confirm."]}),s.jsx("input",{value:G,onChange:ce=>se(ce.target.value),placeholder:"CLEAR",className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm font-mono outline-none focus:ring-1 focus:ring-ring"}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:()=>{L(!1),se("")},className:tx,children:"Cancel"}),s.jsx("button",{disabled:G!=="CLEAR",onClick:ge,className:tN+" disabled:opacity-40",children:"Clear histories"})]})]})})]})}const oU=[{value:"slack",label:"Slack",icon:Ni},{value:"teams",label:"Teams",icon:Ni},{value:"discord",label:"Discord",icon:Ni},{value:"whatsapp",label:"WhatsApp",icon:bc}],nN={owner:"Owner",admin:"Admin",member:"Member"},Ad={owner:"bg-accent/15 text-accent border-accent/30",admin:"bg-primary/15 text-primary border-primary/30",member:"bg-muted text-muted-foreground border-border"},rN={human:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30",agent:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/30"},aU=[{label:"General",scopes:[{value:"read",label:"Read",desc:"Read all CRM data"},{value:"write",label:"Write",desc:"Create and modify CRM data"}]},{label:"Contacts",scopes:[{value:"contacts:read",label:"Read contacts"},{value:"contacts:write",label:"Write contacts"}]},{label:"Accounts",scopes:[{value:"accounts:read",label:"Read accounts"},{value:"accounts:write",label:"Write accounts"}]},{label:"Opportunities",scopes:[{value:"opportunities:read",label:"Read opportunities"},{value:"opportunities:write",label:"Write opportunities"}]},{label:"Activities",scopes:[{value:"activities:read",label:"Read activities"},{value:"activities:write",label:"Write activities"}]},{label:"Assignments",scopes:[{value:"assignments:create",label:"Create assignments"},{value:"assignments:update",label:"Update assignments"}]},{label:"Context",scopes:[{value:"context:read",label:"Read context"},{value:"context:write",label:"Write context"}]}];function sN({actor:e,onClose:t}){const n=x2(),{data:r,isLoading:a}=m2(e.id),l=h2(),c=p2(),[u,f]=x.useState(""),[m,p]=x.useState(null),[g,v]=x.useState(!1),[y,k]=x.useState(!1),[j,N]=x.useState(e.scopes??[]),_=(r==null?void 0:r.data)??[],w=async()=>{if(u.trim())try{const M=await l.mutateAsync({label:u.trim(),scopes:e.scopes??["read"],actor_id:e.id});p(M.key??null),f(""),v(!1),xe({title:"API key created",description:"Copy it now — it won't be shown again."})}catch{xe({title:"Error",description:"Failed to create API key.",variant:"destructive"})}},S=async M=>{try{await c.mutateAsync(M),xe({title:"API key revoked"})}catch{xe({title:"Error",description:"Failed to revoke key.",variant:"destructive"})}},E=M=>{N(D=>D.includes(M)?D.filter(q=>q!==M):[...D,M])},P=async()=>{try{await n.mutateAsync({id:e.id,scopes:j}),k(!1),xe({title:"Permissions updated"})}catch{xe({title:"Error",description:"Failed to update permissions.",variant:"destructive"})}};return s.jsx(Fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:s.jsxs("div",{className:"px-4 py-4 bg-muted/20 border-t border-border space-y-4",children:[s.jsxs("div",{className:"rounded-lg border border-border bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(SA,{className:"w-4 h-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Permissions"}),s.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground border border-border",children:[(e.scopes??[]).length," scopes"]})]}),y?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:P,disabled:n.isPending,className:"px-2.5 py-1 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40",children:n.isPending?"Saving…":"Save"}),s.jsx("button",{onClick:()=>k(!1),className:"px-2.5 py-1 rounded-lg border border-border text-xs font-semibold text-muted-foreground hover:text-foreground",children:"Cancel"})]}):s.jsx("button",{onClick:()=>{k(!0),N(e.scopes??[])},className:"text-xs font-semibold text-primary hover:underline",children:"Edit"})]}),s.jsx("div",{className:"px-4 py-3",children:y?s.jsx("div",{className:"space-y-3",children:aU.map(M=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:M.label}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:M.scopes.map(D=>{const q=j.includes(D.value);return s.jsx("button",{onClick:()=>E(D.value),className:`px-2.5 py-1 rounded-md text-xs font-medium border transition-colors ${q?"bg-primary/10 text-primary border-primary/30":"bg-muted/50 border-border text-muted-foreground hover:text-foreground"}`,children:D.label},D.value)})})]},M.label))}):s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.scopes??[]).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No permissions assigned."}):(e.scopes??[]).map(M=>s.jsx("span",{className:"px-2 py-0.5 rounded-md text-[11px] font-medium bg-primary/10 text-primary border border-primary/20",children:M},M))})})]}),s.jsxs("div",{className:"rounded-lg border border-border bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(cc,{className:"w-4 h-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm font-semibold text-foreground",children:"API Keys"}),s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground border border-border",children:_.length})]}),s.jsxs("button",{onClick:()=>v(!0),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90",children:[s.jsx(Bo,{className:"w-3 h-3"})," New Key"]})]}),s.jsxs("div",{className:"px-4 py-3 space-y-2",children:[m&&s.jsxs("div",{className:"p-3 rounded-lg border border-green-500/30 bg-green-500/5 space-y-2",children:[s.jsx("p",{className:"text-xs font-semibold text-green-600 dark:text-green-400",children:"Copy this key now — it won't be shown again:"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"flex-1 text-xs font-mono bg-background rounded px-2 py-1.5 border border-border truncate",children:m}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(m),xe({title:"Copied!"})},className:"p-1.5 rounded-lg hover:bg-muted transition-colors flex-shrink-0",children:s.jsx(jC,{className:"w-3.5 h-3.5 text-muted-foreground"})})]}),s.jsx("button",{onClick:()=>p(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"Dismiss"})]}),g&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{value:u,onChange:M=>f(M.target.value),placeholder:"Key label (e.g. Production)",className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring"+" max-w-xs",onKeyDown:M=>M.key==="Enter"&&w()}),s.jsx("button",{onClick:w,disabled:!u.trim()||l.isPending,className:"px-2.5 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40",children:"Create"}),s.jsx("button",{onClick:()=>{v(!1),f("")},className:"px-2.5 py-1.5 rounded-lg border border-border text-xs font-semibold text-muted-foreground",children:"Cancel"})]}),a?s.jsx("div",{className:"h-8 bg-muted/50 rounded animate-pulse"}):_.length===0&&!g?s.jsx("p",{className:"text-xs text-muted-foreground py-2",children:"No API keys. Create one to allow this actor to authenticate."}):_.map(M=>s.jsxs("div",{className:"flex items-center gap-3 py-2 border-b border-border last:border-0",children:[s.jsx(cc,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold text-foreground",children:M.label}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[M.last_used_at?`Last used ${new Date(M.last_used_at).toLocaleDateString()}`:"Never used"," · Created ",new Date(M.created_at).toLocaleDateString()]})]}),s.jsx("button",{onClick:()=>S(M.id),className:"p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors flex-shrink-0",children:s.jsx(Ts,{className:"w-3.5 h-3.5"})})]},M.id))]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{onClick:t,className:"px-3 py-1.5 rounded-lg border border-border text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors",children:"Close details"})})]})})}function oN({actor:e,size:t="sm"}){const n=t==="lg"?"w-10 h-10 text-sm":"w-8 h-8 text-xs";if(e.actor_type==="agent")return s.jsx("div",{className:`${n} rounded-xl bg-blue-500/15 flex items-center justify-center flex-shrink-0`,children:s.jsx(fn,{className:t==="lg"?"w-5 h-5 text-blue-500":"w-3.5 h-3.5 text-blue-500"})});const r=e.display_name.trim().split(/\s+/).map(a=>a[0]).slice(0,2).join("").toUpperCase()||"?";return s.jsx("div",{className:`${n} rounded-xl bg-amber-500/15 flex items-center justify-center flex-shrink-0`,children:s.jsx("span",{className:"font-display font-bold text-amber-600 dark:text-amber-400",children:r})})}function tc(e){const t=e==null?void 0:e.contact_channels;return Array.isArray(t)?t:[]}function nx({channels:e,onChange:t}){const n=()=>{t([...e,{channel_type:"slack",handle:"",primary:!1}])},r=l=>{t(e.filter((c,u)=>u!==l))},a=(l,c)=>{t(e.map((u,f)=>f===l?{...u,...c}:u))};return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Messaging Channels"}),s.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 text-xs text-primary hover:text-primary/80 font-medium",children:[s.jsx(Bo,{className:"w-3 h-3"})," Add channel"]})]}),e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground/60 italic",children:"No messaging channels configured"}),s.jsx(Cn,{children:e.map((l,c)=>s.jsxs(Fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"flex items-center gap-2",children:[s.jsx("select",{value:l.channel_type,onChange:u=>a(c,{channel_type:u.target.value}),className:"h-8 px-2 rounded-lg border border-border bg-background text-xs text-foreground outline-none focus:ring-1 focus:ring-ring w-28",children:oU.map(u=>s.jsx("option",{value:u.value,children:u.label},u.value))}),s.jsx("input",{value:l.handle,onChange:u=>a(c,{handle:u.target.value}),placeholder:"@handle or ID",className:"flex-1 h-8 px-2 rounded-lg border border-border bg-background text-xs text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring"}),s.jsx("button",{onClick:()=>r(c),className:"p-1 rounded text-muted-foreground hover:text-destructive transition-colors",children:s.jsx(Sn,{className:"w-3.5 h-3.5"})})]},c))})]})}const rx=()=>({name:"",email:"",phone:"",role:"member",password:"",channels:[],createAuthUser:!0}),sx=()=>({display_name:"",agent_identifier:"",agent_model:""});function e5(){const e=Xf(),t=om(),[n,r]=x.useState("table"),a=t?"cards":n,{data:l,isLoading:c}=Kc({limit:200}),u=(l==null?void 0:l.data)??[],f=A6(),m=x2(),p=j6(),[g,v]=x.useState("all"),[y,k]=x.useState(""),[j,N]=x.useState({}),[_,w]=x.useState(null),[S,E]=x.useState(1),[P,T]=x.useState(25),[M,D]=x.useState(null),[q,H]=x.useState(null),[I,F]=x.useState(rx()),[te,Y]=x.useState(sx()),[O,U]=x.useState(null),[$,R]=x.useState(""),[z,X]=x.useState(""),[B,L]=x.useState(""),[G,se]=x.useState([]),ae=x.useMemo(()=>{var Pe,Ye;let Z=[...u];if(g!=="all"&&(Z=Z.filter(rt=>rt.actor_type===g)),(Pe=j.status)!=null&&Pe.length){const rt=j.status.includes("active"),Rt=j.status.includes("inactive");rt&&!Rt&&(Z=Z.filter(ht=>ht.is_active)),Rt&&!rt&&(Z=Z.filter(ht=>!ht.is_active))}if((Ye=j.role)!=null&&Ye.length&&(Z=Z.filter(rt=>rt.role&&j.role.includes(rt.role))),y){const rt=y.toLowerCase();Z=Z.filter(Rt=>Rt.display_name.toLowerCase().includes(rt)||(Rt.email??"").toLowerCase().includes(rt)||(Rt.phone??"").toLowerCase().includes(rt)||(Rt.agent_identifier??"").toLowerCase().includes(rt))}return _&&Z.sort((rt,Rt)=>{const ht=String(rt[_.key]??""),Gt=String(Rt[_.key]??"");return _.dir==="asc"?ht.localeCompare(Gt):Gt.localeCompare(ht)}),Z},[u,g,y,j,_]);x.useEffect(()=>{E(1)},[g,y,j,_]);const ue=ae.slice((S-1)*P,S*P),oe=u.filter(Z=>Z.actor_type==="human").length,he=u.filter(Z=>Z.actor_type==="agent").length,ge=[{key:"status",label:"Status",options:[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"}]},{key:"role",label:"Role",options:[{value:"owner",label:"Owner"},{value:"admin",label:"Admin"},{value:"member",label:"Member"}]}],Ce=[{key:"display_name",label:"Name"},{key:"email",label:"Email"},{key:"actor_type",label:"Type"},{key:"created_at",label:"Created"}],ce=(Z,Pe)=>{N(Ye=>{const rt={...Ye};return Pe.length===0?delete rt[Z]:rt[Z]=Pe,rt})},Be=Z=>{w(Pe=>(Pe==null?void 0:Pe.key)===Z?{key:Z,dir:Pe.dir==="asc"?"desc":"asc"}:{key:Z,dir:"asc"})},at=async()=>{if(!(!I.name.trim()||!I.email.trim()))try{if(I.createAuthUser&&I.password)await p.mutateAsync({name:I.name.trim(),email:I.email.trim(),password:I.password,role:I.role});else{const Z={};I.channels.length>0&&(Z.contact_channels=I.channels.filter(Pe=>Pe.handle.trim())),await f.mutateAsync({actor_type:"human",display_name:I.name.trim(),email:I.email.trim(),phone:I.phone.trim()||void 0,role:I.role,metadata:Z})}H(null),F(rx()),xe({title:"Human actor created"})}catch(Z){xe({title:"Error",description:Z instanceof Error?Z.message:"Failed to create",variant:"destructive"})}},Et=async()=>{if(te.display_name.trim())try{await f.mutateAsync({actor_type:"agent",display_name:te.display_name.trim(),agent_identifier:te.agent_identifier.trim()||void 0,agent_model:te.agent_model.trim()||void 0,metadata:{}}),H(null),Y(sx()),xe({title:"Agent registered"})}catch(Z){xe({title:"Error",description:Z instanceof Error?Z.message:"Failed to register",variant:"destructive"})}},Yt=Z=>{U(Z.id),L(Z.display_name),R(Z.phone??""),X(Z.role??"member"),se(tc(Z.metadata))},Qt=async()=>{if(O)try{const Z={};G.length>0&&(Z.contact_channels=G.filter(Pe=>Pe.handle.trim())),await m.mutateAsync({id:O,display_name:B.trim(),phone:$.trim()||null,role:z||null,metadata:Z}),U(null),xe({title:"Actor updated"})}catch(Z){xe({title:"Error",description:Z instanceof Error?Z.message:"Failed to update",variant:"destructive"})}},zt=Z=>{D(Pe=>Pe===Z?null:Z)},Un=async Z=>{try{await m.mutateAsync({id:Z.id,is_active:!Z.is_active}),xe({title:Z.is_active?"Actor deactivated":"Actor activated"})}catch(Pe){xe({title:"Error",description:Pe instanceof Error?Pe.message:"Failed",variant:"destructive"})}},hn=({label:Z,sortKey:Pe})=>s.jsx("th",{onClick:()=>Be(Pe),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[Z,(_==null?void 0:_.key)===Pe?_.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}):null]})}),mt="w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring";return s.jsxs("div",{className:"-mx-6 -my-6 flex flex-col",children:[s.jsxs("div",{className:"flex items-start justify-between px-6 pt-6 pb-3",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground",children:"Actors"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage humans and AI agents with access to your CRMy workspace."})]}),s.jsxs("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5 mt-0.5",children:[s.jsx("button",{onClick:()=>r("table"),className:`p-1.5 rounded-lg text-sm transition-all ${n==="table"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.jsx($a,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>r("cards"),className:`p-1.5 rounded-lg text-sm transition-all ${n==="cards"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.jsx(Vc,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pb-2",children:[{key:"all",label:"All",count:u.length},{key:"human",label:"Humans",count:oe,icon:Ma},{key:"agent",label:"Agents",count:he,icon:fn}].map(Z=>s.jsxs("button",{onClick:()=>v(Z.key),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors ${g===Z.key?"bg-primary/15 text-primary":"bg-muted/50 text-muted-foreground hover:text-foreground"}`,children:["icon"in Z&&Z.icon&&s.jsx(Z.icon,{className:"w-3 h-3"}),Z.label,s.jsx("span",{className:"text-[10px] opacity-60",children:Z.count})]},Z.key))}),s.jsx(Va,{searchValue:y,onSearchChange:k,searchPlaceholder:"Search actors...",filters:ge,activeFilters:j,onFilterChange:ce,onClearFilters:()=>N({}),sortOptions:Ce,currentSort:_,onSortChange:Be,onAdd:()=>H(g==="agent"?"agent":"human"),addLabel:g==="agent"?"Register Agent":"Add Human",entityType:"actors"}),s.jsxs("div",{className:"px-4 md:px-6 pb-8 space-y-3 mt-1",children:[s.jsxs(Cn,{children:[q==="human"&&s.jsxs(Fe.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"p-4 rounded-xl border border-border bg-muted/30 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"New Human Actor"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:I.createAuthUser,onChange:Z=>F(Pe=>({...Pe,createAuthUser:Z.target.checked})),className:"rounded"}),"Create login account"]})})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{value:I.name,onChange:Z=>F(Pe=>({...Pe,name:Z.target.value})),placeholder:"Jane Smith",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{type:"email",value:I.email,onChange:Z=>F(Pe=>({...Pe,email:Z.target.value})),placeholder:"jane@company.com",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Phone"}),s.jsx("input",{value:I.phone,onChange:Z=>F(Pe=>({...Pe,phone:Z.target.value})),placeholder:"+1 (555) 123-4567",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),s.jsxs("select",{value:I.role,onChange:Z=>F(Pe=>({...Pe,role:Z.target.value})),className:`${mt} cursor-pointer`,children:[s.jsx("option",{value:"member",children:"Member"}),s.jsx("option",{value:"admin",children:"Admin"}),(e==null?void 0:e.role)==="owner"&&s.jsx("option",{value:"owner",children:"Owner"})]})]})]}),I.createAuthUser&&s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Password ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{type:"password",value:I.password,onChange:Z=>F(Pe=>({...Pe,password:Z.target.value})),placeholder:"Min. 8 characters",className:mt})]})}),s.jsx(nx,{channels:I.channels,onChange:Z=>F(Pe=>({...Pe,channels:Z}))}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:at,disabled:f.isPending||p.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:f.isPending||p.isPending?"Creating...":"Create Human Actor"}),s.jsx("button",{onClick:()=>{H(null),F(rx())},className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]}),q==="agent"&&s.jsxs(Fe.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"p-4 rounded-xl border border-border bg-muted/30 space-y-4",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"Register Agent"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Display Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{value:te.display_name,onChange:Z=>Y(Pe=>({...Pe,display_name:Z.target.value})),placeholder:"Outreach Bot",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Identifier"}),s.jsx("input",{value:te.agent_identifier,onChange:Z=>Y(Pe=>({...Pe,agent_identifier:Z.target.value})),placeholder:"custom/outreach-v1",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Model"}),s.jsx("input",{value:te.agent_model,onChange:Z=>Y(Pe=>({...Pe,agent_model:Z.target.value})),placeholder:"claude-sonnet-4-20250514",className:mt})]})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:Et,disabled:f.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:f.isPending?"Registering...":"Register Agent"}),s.jsx("button",{onClick:()=>{H(null),Y(sx())},className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]})]}),c?s.jsx("div",{className:"space-y-2",children:[...Array(5)].map((Z,Pe)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},Pe))}):ae.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx(Ma,{className:"w-8 h-8 mb-3 opacity-30"}),s.jsx("p",{className:"text-sm",children:"No actors found."}),(y||Object.keys(j).length>0||g!=="all")&&s.jsx("button",{onClick:()=>{k(""),N({}),v("all")},className:"mt-2 text-xs text-primary font-semibold hover:underline",children:"Clear filters"})]}):a==="table"?s.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(hn,{label:"Name",sortKey:"display_name"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Type"}),s.jsx(hn,{label:"Email",sortKey:"email"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Contact"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Role / Model"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Status"}),s.jsx("th",{className:"px-2 py-3 w-20"})]})}),s.jsx("tbody",{children:ue.map((Z,Pe)=>s.jsx(fe.Fragment,{children:O===Z.id?s.jsx("tr",{children:s.jsxs("td",{colSpan:7,className:"p-4 bg-muted/20 border-b border-border last:border-0",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Edit Actor"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),s.jsx("input",{value:B,onChange:Ye=>L(Ye.target.value),className:mt})]}),Z.actor_type==="human"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Phone"}),s.jsx("input",{value:$,onChange:Ye=>R(Ye.target.value),placeholder:"+1 (555) 123-4567",className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),s.jsxs("select",{value:z,onChange:Ye=>X(Ye.target.value),className:`${mt} cursor-pointer`,children:[s.jsx("option",{value:"member",children:"Member"}),s.jsx("option",{value:"admin",children:"Admin"}),(e==null?void 0:e.role)==="owner"&&s.jsx("option",{value:"owner",children:"Owner"})]})]})]})]}),Z.actor_type==="human"&&s.jsx(nx,{channels:G,onChange:se}),s.jsxs("div",{className:"flex gap-2 pt-3",children:[s.jsx("button",{onClick:Qt,disabled:m.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:m.isPending?"Saving...":"Save Changes"}),s.jsx("button",{onClick:()=>U(null),className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`border-b border-border last:border-0 hover:bg-primary/5 transition-colors group cursor-pointer ${Pe%2===1?"bg-surface-sunken/30":""}`,onClick:()=>zt(Z.id),children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(oN,{actor:Z}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-foreground",children:Z.display_name}),Z.user_id&&s.jsx("span",{className:"ml-1.5 text-[10px] font-mono bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"auth"})]})]})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded border capitalize ${rN[Z.actor_type]}`,children:Z.actor_type})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:Z.email||"—"}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[Z.phone&&s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(bc,{className:"w-3 h-3"})," ",Z.phone]}),tc(Z.metadata).slice(0,2).map((Ye,rt)=>s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(Ni,{className:"w-3 h-3"})," ",Ye.channel_type,": ",Ye.handle]},rt)),!Z.phone&&tc(Z.metadata).length===0&&s.jsx("span",{className:"text-xs text-muted-foreground/40",children:"—"})]})}),s.jsx("td",{className:"px-4 py-3",children:Z.actor_type==="human"?Z.role?s.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full border ${Ad[Z.role]??Ad.member}`,children:nN[Z.role]??Z.role}):s.jsx("span",{className:"text-xs text-muted-foreground/40",children:"—"}):s.jsxs("div",{className:"text-xs text-muted-foreground",children:[Z.agent_identifier&&s.jsx("div",{className:"font-mono",children:Z.agent_identifier}),Z.agent_model&&s.jsx("div",{className:"text-muted-foreground/60",children:Z.agent_model}),!Z.agent_identifier&&!Z.agent_model&&"—"]})}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${Z.is_active?"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/30":"bg-muted text-muted-foreground border-border"}`,children:[s.jsx(Fw,{className:"w-2.5 h-2.5"}),Z.is_active?"Active":"Inactive"]})}),s.jsx("td",{className:"px-2 py-3",onClick:Ye=>Ye.stopPropagation(),children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[s.jsx("button",{onClick:()=>zt(Z.id),className:`p-1.5 rounded-lg transition-colors ${M===Z.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Permissions & Keys",children:s.jsx(Ao,{className:`w-3.5 h-3.5 transition-transform ${M===Z.id?"rotate-90":""}`})}),s.jsx("button",{onClick:()=>Yt(Z),className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors opacity-0 group-hover:opacity-100",title:"Edit",children:s.jsx(ls,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>Un(Z),className:`p-1.5 rounded-lg transition-colors opacity-0 group-hover:opacity-100 ${Z.is_active?"text-muted-foreground hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-green-600 hover:bg-green-500/10"}`,title:Z.is_active?"Deactivate":"Activate",children:Z.is_active?s.jsx($w,{className:"w-3.5 h-3.5"}):s.jsx(Vw,{className:"w-3.5 h-3.5"})})]})})]}),s.jsx(Cn,{children:M===Z.id&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:s.jsx(sN,{actor:Z,onClose:()=>D(null)})})})})]})},Z.id))})]})}),s.jsx(Fr,{page:S,pageSize:P,total:ae.length,onPageChange:E,onPageSizeChange:T,className:"px-4"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:ue.map((Z,Pe)=>O===Z.id?s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"col-span-full bg-card border border-border rounded-2xl p-4 space-y-4",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"Edit Actor"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),s.jsx("input",{value:B,onChange:Ye=>L(Ye.target.value),className:mt})]}),Z.actor_type==="human"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Phone"}),s.jsx("input",{value:$,onChange:Ye=>R(Ye.target.value),className:mt})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),s.jsxs("select",{value:z,onChange:Ye=>X(Ye.target.value),className:`${mt} cursor-pointer`,children:[s.jsx("option",{value:"member",children:"Member"}),s.jsx("option",{value:"admin",children:"Admin"}),(e==null?void 0:e.role)==="owner"&&s.jsx("option",{value:"owner",children:"Owner"})]})]})]})]}),Z.actor_type==="human"&&s.jsx(nx,{channels:G,onChange:se}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:Qt,disabled:m.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:m.isPending?"Saving...":"Save Changes"}),s.jsx("button",{onClick:()=>U(null),className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]},Z.id):s.jsxs(Fe.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:Pe*.02},className:`bg-card border rounded-2xl p-4 hover:shadow-md transition-all group relative ${Z.is_active?"border-border hover:border-primary/20":"border-border/50 opacity-60"}`,children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(oN,{actor:Z,size:"lg"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx("p",{className:"font-display font-bold text-foreground",children:Z.display_name}),s.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded border capitalize ${rN[Z.actor_type]}`,children:Z.actor_type}),Z.user_id&&s.jsx("span",{className:"text-[10px] font-mono bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"auth"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:Z.email||(Z.agent_identifier??"No email")})]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{onClick:()=>zt(Z.id),className:`p-1.5 rounded-lg transition-colors ${M===Z.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Permissions & Keys",children:s.jsx(Ao,{className:`w-3.5 h-3.5 transition-transform ${M===Z.id?"rotate-90":""}`})}),s.jsx("button",{onClick:()=>Yt(Z),className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors md:opacity-0 md:group-hover:opacity-100",children:s.jsx(ls,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>Un(Z),className:`p-1.5 rounded-lg transition-colors md:opacity-0 md:group-hover:opacity-100 ${Z.is_active?"text-muted-foreground hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-green-600 hover:bg-green-500/10"}`,children:Z.is_active?s.jsx($w,{className:"w-3.5 h-3.5"}):s.jsx(Vw,{className:"w-3.5 h-3.5"})})]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between flex-wrap gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Z.actor_type==="human"&&Z.role&&s.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full border ${Ad[Z.role]??Ad.member}`,children:nN[Z.role]??Z.role}),Z.actor_type==="agent"&&Z.agent_model&&s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:Z.agent_model}),s.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${Z.is_active?"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/30":"bg-muted text-muted-foreground border-border"}`,children:[s.jsx(Fw,{className:"w-2.5 h-2.5"}),Z.is_active?"Active":"Inactive"]})]}),Z.created_at&&s.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(Z.created_at).toLocaleDateString()})]}),(Z.phone||tc(Z.metadata).length>0)&&s.jsxs("div",{className:"mt-2 pt-2 border-t border-border flex flex-wrap gap-x-3 gap-y-1",children:[Z.phone&&s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(bc,{className:"w-3 h-3"})," ",Z.phone]}),tc(Z.metadata).map((Ye,rt)=>s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(Ni,{className:"w-3 h-3"})," ",Ye.channel_type,": ",Ye.handle]},rt))]}),s.jsx(Cn,{children:M===Z.id&&s.jsx("div",{className:"mt-3 -mx-4 -mb-4",children:s.jsx(sN,{actor:Z,onClose:()=>D(null)})})})]},Z.id))}),s.jsx(Fr,{page:S,pageSize:P,total:ae.length,onPageChange:E,onPageSizeChange:T})]})]})]})}const iU=[{icon:uA,label:"Profile",path:"/settings",roles:["member","admin","owner"]},{icon:bA,label:"Appearance",path:"/settings/appearance",roles:["member","admin","owner"]},{icon:SC,label:"API Keys",path:"/settings/api-keys",roles:["member","admin","owner"]},{icon:xA,label:"Webhooks",path:"/settings/webhooks",roles:["admin","owner"]},{icon:gA,label:"Custom Fields",path:"/settings/custom-fields",roles:["admin","owner"]},{icon:Ma,label:"Actors",path:"/settings/actors",roles:["admin","owner"]},{icon:fn,label:"Local AI Agent",path:"/settings/agent",roles:["admin","owner"]},{icon:NC,label:"Database",path:"/settings/database",roles:["admin","owner"]}];function lU(){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground",children:[s.jsx(SC,{className:"w-8 h-8 opacity-25"}),s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Access restricted"}),s.jsx("p",{className:"text-xs",children:"You don't have permission to view this section."})]})}function nc({roles:e,children:t}){const n=Xf();return!n||!e.includes(n.role)?s.jsx(lU,{}):s.jsx(s.Fragment,{children:t})}function cU(){const e=Xf(),t=P6(),[n,r]=x.useState((e==null?void 0:e.name)??""),[a,l]=x.useState((e==null?void 0:e.email)??""),[c,u]=x.useState(""),[f,m]=x.useState(""),[p,g]=x.useState(""),[v,y]=x.useState(!1),[k,j]=x.useState(!1),N=(e==null?void 0:e.role)==="owner",_=(e==null?void 0:e.role)==="admin"||N,w="w-full h-10 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring transition-colors",S="w-full h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-sm text-foreground",E=async()=>{if(f&&f!==p){xe({title:"Passwords do not match",variant:"destructive"});return}if(f&&f.length<8){xe({title:"Password too short",description:"Must be at least 8 characters.",variant:"destructive"});return}try{const T={};if(n.trim()&&n.trim()!==(e==null?void 0:e.name)&&(T.name=n.trim()),a.trim()&&a.trim()!==(e==null?void 0:e.email)&&(T.email=a.trim()),f&&(T.current_password=c,T.new_password=f),Object.keys(T).length===0){xe({title:"No changes to save"});return}const M=await t.mutateAsync(T),D=localStorage.getItem("crmy_user");if(D){const q=JSON.parse(D);localStorage.setItem("crmy_user",JSON.stringify({...q,name:M.name,email:M.email}))}u(""),m(""),g(""),j(!0),setTimeout(()=>j(!1),3e3),xe({title:"Profile updated"})}catch(T){xe({title:"Failed to update profile",description:T instanceof Error?T.message:"Please try again.",variant:"destructive"})}},P={owner:"bg-accent/15 text-accent border-accent/30",admin:"bg-primary/15 text-primary border-primary/30",member:"bg-muted text-muted-foreground border-border"};return s.jsxs("div",{className:"max-w-lg",children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground mb-1",children:"Profile"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Update your name, email, and password."}),s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Role"}),s.jsx("div",{className:S,children:s.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full border capitalize ${P[(e==null?void 0:e.role)??"member"]??P.member}`,children:(e==null?void 0:e.role)??"—"})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Name"}),s.jsx("input",{value:n,onChange:T=>r(T.target.value),className:w,placeholder:"Your full name"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2",children:["Email",!_&&s.jsx("span",{className:"text-[10px] text-muted-foreground/60 normal-case font-normal",children:"contact an admin to change"})]}),_?s.jsx("input",{type:"email",value:a,onChange:T=>l(T.target.value),className:w,placeholder:"you@example.com"}):s.jsx("div",{className:S,children:e==null?void 0:e.email})]}),s.jsxs("div",{className:"pt-2 border-t border-border space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Change Password"}),s.jsx("button",{onClick:()=>y(T=>!T),className:"text-xs text-primary hover:underline",children:v?"Cancel":"Change"})]}),v&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Current Password"}),s.jsx("input",{type:"password",value:c,onChange:T=>u(T.target.value),className:w,placeholder:"Enter current password"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"New Password"}),s.jsx("input",{type:"password",value:f,onChange:T=>m(T.target.value),className:w,placeholder:"Min. 8 characters"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Confirm New Password"}),s.jsx("input",{type:"password",value:p,onChange:T=>g(T.target.value),className:w,placeholder:"Repeat new password",onKeyDown:T=>T.key==="Enter"&&E()}),f&&p&&f!==p&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:"Passwords do not match"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[s.jsx("button",{onClick:E,disabled:t.isPending,className:"px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:t.isPending?"Saving…":"Save Changes"}),k&&s.jsxs("span",{className:"text-xs text-success flex items-center gap-1",children:[s.jsx(er,{className:"w-3.5 h-3.5"})," Saved"]})]})]})]})}function uU(){const{darkVariant:e,setDarkVariant:t}=nt(),n=[{key:"warm",label:"Warm Brown",description:"Dark theme with warm, earthy brown tones",preview:"bg-[hsl(15,25%,7%)]"},{key:"charcoal",label:"Charcoal",description:"Dark theme with cool, navy-charcoal tones",preview:"bg-[hsl(220,16%,8%)]"}];return s.jsxs("div",{children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground mb-2",children:"Appearance"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Choose your preferred dark mode style."}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 max-w-md",children:n.map(r=>s.jsxs("button",{onClick:()=>t(r.key),className:`flex flex-col gap-3 p-4 rounded-xl border-2 transition-all text-left ${e===r.key?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/30"}`,children:[s.jsx("div",{className:`w-full h-16 rounded-lg ${r.preview} border border-border/30 flex items-end p-2`,children:s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"w-6 h-2 rounded-full bg-[hsl(24,95%,53%)]"}),s.jsx("div",{className:"w-4 h-2 rounded-full bg-white/20"})]})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:r.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]},r.key))})]})}const hg=[{label:"General",scopes:[{value:"read",label:"Read all"},{value:"write",label:"Write all"}]},{label:"Contacts",scopes:[{value:"contacts:read",label:"Read"},{value:"contacts:write",label:"Write"}]},{label:"Accounts",scopes:[{value:"accounts:read",label:"Read"},{value:"accounts:write",label:"Write"}]},{label:"Opportunities",scopes:[{value:"opportunities:read",label:"Read"},{value:"opportunities:write",label:"Write"}]},{label:"Activities",scopes:[{value:"activities:read",label:"Read"},{value:"activities:write",label:"Write"}]},{label:"Assignments",scopes:[{value:"assignments:create",label:"Create"},{value:"assignments:update",label:"Update"}]},{label:"Context",scopes:[{value:"context:read",label:"Read"},{value:"context:write",label:"Write"}]}],dU=hg.flatMap(e=>e.scopes);function fU(){const{data:e,isLoading:t}=m2(),{data:n}=Kc({is_active:!0,limit:100}),r=h2(),a=E6(),l=p2(),[c,u]=x.useState("table"),[f,m]=x.useState(""),[p,g]=x.useState(""),[v,y]=x.useState("all"),[k,j]=x.useState({key:"created_at",dir:"desc"}),[N,_]=x.useState(1),[w,S]=x.useState(!1),[E,P]=x.useState(""),[T,M]=x.useState(["read","write"]),[D,q]=x.useState(""),[H,I]=x.useState(""),[F,te]=x.useState(null),[Y,O]=x.useState(null),[U,$]=x.useState(null),[R,z]=x.useState(null),[X,B]=x.useState(""),[L,G]=x.useState(""),[se,ae]=x.useState(""),[ue,oe]=x.useState([]),[he,ge]=x.useState(null),Ce=10,ce=(e==null?void 0:e.data)??[],Be=(n==null?void 0:n.data)??[],at=x.useMemo(()=>{let ne=[...ce];if(f){const ke=f.toLowerCase();ne=ne.filter(Ae=>{var pn,_n;return((pn=Ae.label)==null?void 0:pn.toLowerCase().includes(ke))||((_n=Ae.actor_name)==null?void 0:_n.toLowerCase().includes(ke))})}return p&&(ne=ne.filter(ke=>{var Ae;return(Ae=ke.scopes)==null?void 0:Ae.includes(p)})),v==="used"&&(ne=ne.filter(ke=>!!ke.last_used_at)),v==="never"&&(ne=ne.filter(ke=>!ke.last_used_at)),ne.sort((ke,Ae)=>{const pn=k.key==="label"?ke.label??"":ke[k.key]??"",_n=k.key==="label"?Ae.label??"":Ae[k.key]??"";return k.dir==="asc"?pn.localeCompare(_n):_n.localeCompare(pn)}),ne},[ce,f,p,v,k]),Et=at.slice((N-1)*Ce,N*Ce),Yt=()=>{S(!1),P(""),M(["read","write"]),q(""),I("")},Qt=async()=>{if(!(!E.trim()||T.length===0))try{const ne={label:E.trim(),scopes:T};D&&(ne.actor_id=D),H&&(ne.expires_at=new Date(H).toISOString());const ke=await r.mutateAsync(ne);te(ke.key??null),Yt(),xe({title:"API key created",description:"Copy and store it safely — it won't be shown again."})}catch(ne){xe({title:"Failed to create API key",description:ne instanceof Error?ne.message:"Please try again.",variant:"destructive"})}},zt=async ne=>{try{await l.mutateAsync(ne),O(null),xe({title:"API key revoked"})}catch(ke){xe({title:"Failed to revoke key",description:ke instanceof Error?ke.message:"Please try again.",variant:"destructive"})}},Un=ne=>{z(ne.id),B(ne.label??""),G(ne.actor_id??""),ae(ne.expires_at?new Date(ne.expires_at).toISOString().slice(0,10):""),$(null)},hn=()=>{z(null)},mt=async()=>{if(!(!R||!X.trim()))try{const ne={id:R,label:X.trim()};ne.actor_id=L||null,ne.expires_at=se?new Date(se).toISOString():null,await a.mutateAsync(ne),z(null),xe({title:"API key updated"})}catch(ne){xe({title:"Failed to update API key",description:ne instanceof Error?ne.message:"Please try again.",variant:"destructive"})}},Z=ne=>{ge(ne.id),oe(ne.scopes??[])},Pe=async ne=>{try{await a.mutateAsync({id:ne,scopes:ue}),ge(null),xe({title:"Scopes updated"})}catch(ke){xe({title:"Failed to update scopes",description:ke instanceof Error?ke.message:"Please try again.",variant:"destructive"})}},Ye=ne=>M(ke=>ke.includes(ne)?ke.filter(Ae=>Ae!==ne):[...ke,ne]),rt=ne=>oe(ke=>ke.includes(ne)?ke.filter(Ae=>Ae!==ne):[...ke,ne]),Rt=ne=>ne?new Date(ne).toLocaleDateString():null,ht=ne=>{if(!ne)return"Never used";const ke=Math.floor((Date.now()-new Date(ne).getTime())/864e5);return ke===0?"Used today":ke===1?"Used yesterday":ke<30?`Used ${ke}d ago`:`Used ${Rt(ne)}`},Gt=({sk:ne,label:ke})=>s.jsxs("button",{onClick:()=>{j(Ae=>Ae.key===ne?{key:ne,dir:Ae.dir==="asc"?"desc":"asc"}:{key:ne,dir:"desc"}),_(1)},className:"flex items-center gap-1 text-xs font-mono text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors",children:[ke,k.key===ne&&(k.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}))]}),fs=({name:ne,type:ke})=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-sm text-foreground truncate",children:ne}),s.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border capitalize flex-shrink-0 ${ke==="agent"?"bg-blue-500/10 text-blue-500 border-blue-500/30":"bg-amber-500/10 text-amber-600 border-amber-500/30"}`,children:ke})]});return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground",children:"API Keys"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage access tokens for the CRMy REST API and MCP server."})]}),F&&s.jsxs("div",{className:"p-4 rounded-xl border border-success/30 bg-success/5",children:[s.jsx("p",{className:"text-xs font-semibold text-success mb-2",children:"Your new API key — copy it now, it won't be shown again:"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"flex-1 text-xs font-mono bg-background rounded px-2 py-1.5 border border-border truncate",children:F}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(F),xe({title:"Copied!"})},className:"p-1.5 rounded-lg hover:bg-muted transition-colors flex-shrink-0",children:s.jsx(jC,{className:"w-3.5 h-3.5 text-muted-foreground"})})]}),s.jsx("button",{onClick:()=>te(null),className:"mt-2 text-xs text-muted-foreground hover:text-foreground",children:"Dismiss"})]}),w&&s.jsxs("div",{className:"p-5 rounded-xl border border-border bg-card space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Create new API key"}),s.jsx("button",{onClick:Yt,className:"p-1.5 rounded-lg hover:bg-muted text-muted-foreground transition-colors",children:s.jsx(Sn,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:["Label ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{value:E,onChange:ne=>P(ne.target.value),placeholder:"e.g. Production, CI/CD",className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",onKeyDown:ne=>ne.key==="Enter"&&Qt(),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Bind to Actor (optional)"}),s.jsxs("select",{value:D,onChange:ne=>q(ne.target.value),className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring",children:[s.jsx("option",{value:"",children:"No actor binding"}),Be.map(ne=>s.jsxs("option",{value:ne.id,children:[ne.display_name," (",ne.actor_type,")"]},ne.id))]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Expires (optional)"}),s.jsx("input",{type:"date",value:H,onChange:ne=>I(ne.target.value),className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:["Scopes ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-3",children:hg.map(ne=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:ne.label}),ne.scopes.map(ke=>s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:T.includes(ke.value),onChange:()=>Ye(ke.value),className:"w-3.5 h-3.5 rounded border-border accent-primary"}),s.jsx("span",{className:"text-xs text-foreground",children:ke.label})]},ke.value))]},ne.label))})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:Qt,disabled:!E.trim()||T.length===0||r.isPending,className:"px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:r.isPending?"Creating…":"Create Key"}),s.jsx("button",{onClick:Yt,className:"px-4 py-2 rounded-lg border border-border text-sm text-muted-foreground hover:bg-muted transition-colors",children:"Cancel"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("div",{className:"relative flex-1 min-w-0 max-w-xs",children:[s.jsx(el,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx("input",{value:f,onChange:ne=>{m(ne.target.value),_(1)},placeholder:"Search keys…",className:"w-full h-9 pl-9 pr-3 rounded-xl border border-border bg-card text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30 transition-all"})]}),s.jsxs("select",{value:p,onChange:ne=>{g(ne.target.value),_(1)},className:"h-9 px-3 rounded-xl border border-border bg-card text-sm text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30 flex-shrink-0",children:[s.jsx("option",{value:"",children:"All scopes"}),dU.map(ne=>s.jsx("option",{value:ne.value,children:ne.label},ne.value))]}),s.jsxs("select",{value:v,onChange:ne=>{y(ne.target.value),_(1)},className:"h-9 px-3 rounded-xl border border-border bg-card text-sm text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30 flex-shrink-0",children:[s.jsx("option",{value:"all",children:"All usage"}),s.jsx("option",{value:"used",children:"Used"}),s.jsx("option",{value:"never",children:"Never used"})]}),s.jsxs("select",{value:`${k.key}_${k.dir}`,onChange:ne=>{const[ke,Ae]=ne.target.value.split("_");j({key:ke,dir:Ae}),_(1)},className:"h-9 px-3 rounded-xl border border-border bg-card text-sm text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30 flex-shrink-0",children:[s.jsx("option",{value:"created_at_desc",children:"Newest first"}),s.jsx("option",{value:"created_at_asc",children:"Oldest first"}),s.jsx("option",{value:"label_asc",children:"Label A–Z"}),s.jsx("option",{value:"label_desc",children:"Label Z–A"}),s.jsx("option",{value:"last_used_at_desc",children:"Recently used"}),s.jsx("option",{value:"last_used_at_asc",children:"Least used"})]}),s.jsxs("div",{className:"flex items-center border border-border rounded-xl overflow-hidden flex-shrink-0",children:[s.jsx("button",{onClick:()=>u("table"),className:`p-2 transition-colors ${c==="table"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:s.jsx($a,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>u("card"),className:`p-2 transition-colors ${c==="card"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:s.jsx(Vc,{className:"w-4 h-4"})})]}),s.jsxs("button",{onClick:()=>S(!0),disabled:w,className:"h-9 px-4 flex items-center gap-1.5 rounded-xl bg-gradient-to-r from-primary to-primary/80 text-primary-foreground text-sm font-semibold hover:shadow-md transition-all flex-shrink-0 press-scale disabled:opacity-50",children:[s.jsx(Bo,{className:"w-4 h-4"})," New Key"]})]}),t?s.jsx("div",{className:"space-y-2",children:[...Array(3)].map((ne,ke)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-2xl animate-pulse"},ke))}):at.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-14 text-center",children:[s.jsx(cc,{className:"w-8 h-8 text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:ce.length===0?"No API keys yet. Create one to get started.":"No keys match your filters."}),ce.length===0&&s.jsx("button",{onClick:()=>S(!0),className:"mt-3 text-xs text-primary hover:underline",children:"Create your first key"})]}):c==="table"?s.jsx("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:s.jsx(Gt,{sk:"label",label:"Label"})}),s.jsx("th",{className:"text-left px-4 py-3 hidden md:table-cell text-xs font-display font-semibold text-muted-foreground",children:"Scopes"}),s.jsx("th",{className:"text-left px-4 py-3 hidden lg:table-cell text-xs font-display font-semibold text-muted-foreground",children:"Actor"}),s.jsx("th",{className:"text-left px-4 py-3 hidden sm:table-cell text-xs font-display font-semibold text-muted-foreground",children:s.jsx(Gt,{sk:"last_used_at",label:"Last Used"})}),s.jsx("th",{className:"text-left px-4 py-3 hidden lg:table-cell text-xs font-display font-semibold text-muted-foreground",children:s.jsx(Gt,{sk:"created_at",label:"Created"})}),s.jsx("th",{className:"px-2 py-3 w-20"})]})}),s.jsx("tbody",{children:Et.map((ne,ke)=>s.jsx(fe.Fragment,{children:R===ne.id?s.jsx("tr",{className:"border-b border-border",children:s.jsxs("td",{colSpan:6,className:"p-4 bg-muted/20",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Edit API Key"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Label ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{value:X,onChange:Ae=>B(Ae.target.value),className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Bind to Actor"}),s.jsxs("select",{value:L,onChange:Ae=>G(Ae.target.value),className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring",children:[s.jsx("option",{value:"",children:"No actor binding"}),Be.map(Ae=>s.jsxs("option",{value:Ae.id,children:[Ae.display_name," (",Ae.actor_type,")"]},Ae.id))]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Expires"}),s.jsx("input",{type:"date",value:se,onChange:Ae=>ae(Ae.target.value),className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground outline-none focus:ring-1 focus:ring-ring"})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:mt,disabled:!X.trim()||a.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:a.isPending?"Saving…":"Save Changes"}),s.jsx("button",{onClick:hn,className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`border-b border-border last:border-0 hover:bg-primary/5 transition-colors group cursor-pointer ${ke%2===1?"bg-surface-sunken/30":""}`,onClick:()=>{$(Ae=>Ae===ne.id?null:ne.id),ge(null)},children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(cc,{className:"w-3.5 h-3.5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-foreground",children:ne.label}),s.jsxs("p",{className:"text-[10px] font-mono text-muted-foreground",children:[ne.id.slice(0,14),"…"]})]})]})}),s.jsx("td",{className:"px-4 py-3 hidden md:table-cell",onClick:Ae=>Ae.stopPropagation(),children:s.jsxs("button",{onClick:()=>{$(Ae=>Ae===ne.id?null:ne.id),ge(null)},className:"flex items-center gap-1.5 hover:text-foreground transition-colors",children:[s.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground border border-border font-mono",children:[(ne.scopes??[]).length," scope",(ne.scopes??[]).length!==1?"s":""]}),s.jsx(Ao,{className:`w-3 h-3 text-muted-foreground transition-transform ${U===ne.id?"rotate-90":""}`})]})}),s.jsx("td",{className:"px-4 py-3 hidden lg:table-cell",children:ne.actor_name?s.jsx(fs,{name:ne.actor_name,type:ne.actor_type}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})}),s.jsx("td",{className:"px-4 py-3 hidden sm:table-cell",children:s.jsx("span",{className:`text-xs ${ne.last_used_at?"text-foreground":"text-muted-foreground"}`,children:ht(ne.last_used_at)})}),s.jsxs("td",{className:"px-4 py-3 hidden lg:table-cell",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:Rt(ne.created_at)}),ne.expires_at&&s.jsxs("p",{className:`text-[10px] mt-0.5 ${new Date(ne.expires_at)<new Date?"text-destructive":"text-muted-foreground"}`,children:["Exp: ",Rt(ne.expires_at)]})]}),s.jsx("td",{className:"px-2 py-3",onClick:Ae=>Ae.stopPropagation(),children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[Y===ne.id?s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Revoke?"}),s.jsx("button",{onClick:()=>zt(ne.id),className:"px-2 py-1 rounded bg-destructive text-destructive-foreground text-xs font-semibold hover:bg-destructive/90 transition-colors",children:"Yes"}),s.jsx("button",{onClick:()=>O(null),className:"px-2 py-1 rounded bg-muted text-muted-foreground text-xs hover:bg-muted/80 transition-colors",children:"No"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>Un(ne),className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors opacity-0 group-hover:opacity-100",title:"Edit",children:s.jsx(ls,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>O(ne.id),className:"p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors opacity-0 group-hover:opacity-100",title:"Revoke",children:s.jsx(Ts,{className:"w-3.5 h-3.5"})})]}),s.jsx("button",{onClick:()=>{$(Ae=>Ae===ne.id?null:ne.id),ge(null)},className:`p-1.5 rounded-lg transition-colors ${U===ne.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:s.jsx(Ao,{className:`w-3.5 h-3.5 transition-transform ${U===ne.id?"rotate-90":""}`})})]})})]}),s.jsx(Cn,{children:U===ne.id&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"p-0 border-b border-border last:border-0",children:s.jsx(Fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:s.jsx("div",{className:"px-4 py-4 bg-muted/20",children:s.jsxs("div",{className:"rounded-lg border border-border bg-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Scopes"}),s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground border border-border",children:(ne.scopes??[]).length})]}),he!==ne.id?s.jsx("button",{onClick:()=>Z(ne),className:"text-xs font-semibold text-primary hover:underline",children:"Edit"}):s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>Pe(ne.id),disabled:a.isPending,className:"px-2.5 py-1 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40",children:a.isPending?"Saving…":"Save"}),s.jsx("button",{onClick:()=>ge(null),className:"px-2.5 py-1 rounded-lg border border-border text-xs font-semibold text-muted-foreground hover:text-foreground",children:"Cancel"})]})]}),s.jsx("div",{className:"px-4 py-3",children:he===ne.id?s.jsx("div",{className:"space-y-3",children:hg.map(Ae=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:Ae.label}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ae.scopes.map(pn=>{const _n=ue.includes(pn.value);return s.jsx("button",{onClick:()=>rt(pn.value),className:`px-2.5 py-1 rounded-md text-xs font-medium border transition-colors ${_n?"bg-primary/10 text-primary border-primary/30":"bg-muted/50 border-border text-muted-foreground hover:text-foreground"}`,children:pn.label},pn.value)})})]},Ae.label))}):s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(ne.scopes??[]).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scopes assigned."}):(ne.scopes??[]).map(Ae=>s.jsx("span",{className:"px-2 py-0.5 rounded-md text-[11px] font-medium bg-primary/10 text-primary border border-primary/20",children:Ae},Ae))})})]})})})})})})]})},ne.id))})]})})}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Et.map(ne=>s.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 space-y-3 hover:shadow-md transition-shadow group",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(cc,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:ne.label}),s.jsxs("p",{className:"text-[10px] font-mono text-muted-foreground",children:[ne.id.slice(0,14),"…"]})]})]}),Y===ne.id?s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{onClick:()=>zt(ne.id),className:"px-2 py-0.5 rounded bg-destructive text-destructive-foreground text-[10px] font-semibold",children:"Revoke"}),s.jsx("button",{onClick:()=>O(null),className:"px-2 py-0.5 rounded bg-muted text-muted-foreground text-[10px]",children:"✕"})]}):s.jsx("button",{onClick:()=>O(ne.id),className:"p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors opacity-0 group-hover:opacity-100 flex-shrink-0",children:s.jsx(Ts,{className:"w-3.5 h-3.5"})})]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:(ne.scopes??[]).map(ke=>s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono bg-muted text-muted-foreground border border-border",children:ke},ke))}),s.jsxs("div",{className:"space-y-1.5 pt-2 border-t border-border",children:[ne.actor_name&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground w-16 flex-shrink-0",children:"Actor"}),s.jsx(fs,{name:ne.actor_name,type:ne.actor_type})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground w-16 flex-shrink-0",children:"Last used"}),s.jsx("span",{className:`text-xs ${ne.last_used_at?"text-foreground":"text-muted-foreground"}`,children:ht(ne.last_used_at)})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground w-16 flex-shrink-0",children:"Created"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Rt(ne.created_at)})]}),ne.expires_at&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-muted-foreground w-16 flex-shrink-0",children:"Expires"}),s.jsx("span",{className:`text-xs ${new Date(ne.expires_at)<new Date?"text-destructive font-medium":"text-foreground"}`,children:Rt(ne.expires_at)})]})]})]},ne.id))}),s.jsx(Fr,{page:N,pageSize:Ce,total:at.length,onPageChange:_})]})}function mU(){const{data:e,isLoading:t}=p6(),n=x6(),r=g6(),[a,l]=x.useState(!1),[c,u]=x.useState(""),f=(e==null?void 0:e.data)??[],m=async()=>{if(c.trim())try{await n.mutateAsync({url:c.trim(),events:["contact.created","opportunity.updated"]}),u(""),l(!1),xe({title:"Webhook created"})}catch{xe({title:"Error",description:"Failed to create webhook.",variant:"destructive"})}},p=async g=>{try{await r.mutateAsync(g),xe({title:"Webhook deleted"})}catch{xe({title:"Error",description:"Failed to delete webhook.",variant:"destructive"})}};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground",children:"Webhooks"}),s.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 transition-colors",children:[s.jsx(Bo,{className:"w-3.5 h-3.5"})," New Webhook"]})]}),a&&s.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-border bg-muted/30 flex items-center gap-2 max-w-lg",children:[s.jsx("input",{value:c,onChange:g=>u(g.target.value),placeholder:"https://your-server.com/webhook",className:"flex-1 h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",onKeyDown:g=>g.key==="Enter"&&m()}),s.jsx("button",{onClick:m,disabled:!c.trim()||n.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:"Create"}),s.jsx("button",{onClick:()=>{l(!1),u("")},className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold",children:"Cancel"})]}),s.jsx("div",{className:"space-y-2 max-w-2xl",children:t?s.jsx("div",{className:"space-y-2",children:[...Array(2)].map((g,v)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},v))}):f.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No webhooks configured."}):f.map(g=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl border border-border bg-card",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:g.url}),g.events&&s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.events.map(v=>s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono bg-muted text-muted-foreground",children:v},v))})]}),s.jsx("button",{onClick:()=>p(g.id),className:"p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",children:s.jsx(Ts,{className:"w-3.5 h-3.5"})})]},g.id))})]})}const hU=[{key:"contact",label:"Contact"},{key:"account",label:"Account"},{key:"opportunity",label:"Opportunity"},{key:"use_case",label:"Use Case"},{key:"activity",label:"Activity"}],gv=[{value:"text",label:"Text",color:"bg-blue-500/10 text-blue-400 border-blue-500/20"},{value:"number",label:"Number",color:"bg-purple-500/10 text-purple-400 border-purple-500/20"},{value:"boolean",label:"Checkbox",color:"bg-green-500/10 text-green-400 border-green-500/20"},{value:"date",label:"Date",color:"bg-orange-500/10 text-orange-400 border-orange-500/20"},{value:"select",label:"Dropdown",color:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20"},{value:"multi_select",label:"Multi-select",color:"bg-pink-500/10 text-pink-400 border-pink-500/20"}];function pU(e){var t;return((t=gv.find(n=>n.value===e))==null?void 0:t.color)??"bg-muted text-muted-foreground border-border"}function xU(e){var t;return((t=gv.find(n=>n.value===e))==null?void 0:t.label)??e}function aN(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function gU(){const[e,t]=x.useState("contact"),[n,r]=x.useState(!1),[a,l]=x.useState(""),[c,u]=x.useState("text"),[f,m]=x.useState(!1),[p,g]=x.useState(""),[v,y]=x.useState(null),[k,j]=x.useState(""),[N,_]=x.useState(!1),[w,S]=x.useState(""),[E,P]=x.useState(null),{data:T,isLoading:M}=ll(e),D=y6(),q=v6(),H=b6(),I=(T==null?void 0:T.fields)??[],F=async()=>{if(a.trim())try{const R=(c==="select"||c==="multi_select")&&p.trim()?p.split(",").map(z=>z.trim()).filter(Boolean):void 0;await D.mutateAsync({label:a.trim(),field_name:aN(a),field_type:c,object_type:e,required:f,...R?{options:R}:{}}),l(""),u("text"),m(!1),g(""),r(!1),xe({title:"Custom field created"})}catch{xe({title:"Error",description:"Failed to create field.",variant:"destructive"})}},te=$=>{y($.id),j($.label??""),_($.is_required??!1),S(Array.isArray($.options)?$.options.join(", "):""),r(!1)},Y=async()=>{if(!(!v||!k.trim()))try{const $=I.find(X=>X.id===v),z=(($==null?void 0:$.field_type)==="select"||($==null?void 0:$.field_type)==="multi_select")&&w.trim()?w.split(",").map(X=>X.trim()).filter(Boolean):void 0;await q.mutateAsync({id:v,label:k.trim(),required:N,...z!==void 0?{options:z}:{}}),y(null),xe({title:"Custom field updated"})}catch{xe({title:"Error",description:"Failed to update field.",variant:"destructive"})}},O=async $=>{try{await H.mutateAsync($),P(null),xe({title:"Custom field deleted"})}catch{xe({title:"Error",description:"Failed to delete field.",variant:"destructive"})}},U="w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring";return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground",children:"Custom Fields"}),s.jsxs("button",{onClick:()=>{r(!0),y(null),P(null)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 transition-colors",children:[s.jsx(Bo,{className:"w-3.5 h-3.5"})," New Field"]})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-5",children:"Define custom fields per object type. Values are type-checked and required fields are enforced by the server."}),s.jsx("div",{className:"flex gap-1 mb-5 overflow-x-auto no-scrollbar bg-muted rounded-xl p-0.5",children:hU.map($=>s.jsx("button",{onClick:()=>{t($.key),r(!1),y(null),P(null)},className:`px-3 py-1.5 rounded-lg text-xs font-semibold whitespace-nowrap transition-all ${e===$.key?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:$.label},$.key))}),n&&s.jsxs("div",{className:"mb-5 p-4 rounded-xl border border-border bg-muted/30 space-y-3 max-w-lg",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"New Field"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Label ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("input",{value:a,onChange:$=>l($.target.value),placeholder:"e.g. Preferred Language",className:U,onKeyDown:$=>$.key==="Enter"&&F()}),a.trim()&&s.jsxs("p",{className:"text-[11px] text-muted-foreground font-mono",children:["key: ",aN(a)]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Type"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:gv.map($=>s.jsx("button",{onClick:()=>u($.value),className:`px-2.5 py-1 rounded-md text-xs font-medium border transition-colors ${c===$.value?$.color:"bg-muted/50 border-border text-muted-foreground hover:text-foreground"}`,children:$.label},$.value))})]}),(c==="select"||c==="multi_select")&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Options ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(comma-separated)"})]}),s.jsx("input",{value:p,onChange:$=>g($.target.value),placeholder:"Option A, Option B, Option C",className:U})]}),s.jsxs("button",{type:"button",onClick:()=>m(!f),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg border text-xs font-semibold transition-all ${f?"bg-primary/10 border-primary/40 text-primary":"bg-muted border-border text-muted-foreground hover:text-foreground"}`,children:[s.jsx("span",{className:`w-3.5 h-3.5 rounded-sm border flex items-center justify-center flex-shrink-0 transition-all ${f?"bg-primary border-primary":"border-border"}`,children:f&&s.jsx("svg",{viewBox:"0 0 10 8",className:"w-2.5 h-2.5 fill-none stroke-white stroke-[1.5]",children:s.jsx("polyline",{points:"1,4 4,7 9,1"})})}),"Required field"]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:F,disabled:!a.trim()||D.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:D.isPending?"Creating…":"Create Field"}),s.jsx("button",{onClick:()=>{r(!1),l(""),m(!1),g("")},className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]}),s.jsx("div",{className:"space-y-2 max-w-2xl",children:M?s.jsx("div",{className:"space-y-2",children:[...Array(3)].map(($,R)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},R))}):I.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No custom fields for this object type yet."}):I.map($=>s.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:v===$.id?s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"Edit Field"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx("input",{value:k,onChange:R=>j(R.target.value),className:U})]}),($.field_type==="select"||$.field_type==="multi_select")&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Options ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(comma-separated)"})]}),s.jsx("input",{value:w,onChange:R=>S(R.target.value),placeholder:"Option A, Option B",className:U})]}),s.jsxs("button",{type:"button",onClick:()=>_(!N),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg border text-xs font-semibold transition-all ${N?"bg-primary/10 border-primary/40 text-primary":"bg-muted border-border text-muted-foreground hover:text-foreground"}`,children:[s.jsx("span",{className:`w-3.5 h-3.5 rounded-sm border flex items-center justify-center flex-shrink-0 transition-all ${N?"bg-primary border-primary":"border-border"}`,children:N&&s.jsx("svg",{viewBox:"0 0 10 8",className:"w-2.5 h-2.5 fill-none stroke-white stroke-[1.5]",children:s.jsx("polyline",{points:"1,4 4,7 9,1"})})}),"Required field"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:Y,disabled:!k.trim()||q.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:q.isPending?"Saving…":"Save"}),s.jsx("button",{onClick:()=>y(null),className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]})]}):E===$.id?s.jsxs("div",{className:"p-4 flex items-center gap-3 flex-wrap",children:[s.jsxs("p",{className:"text-sm text-foreground flex-1",children:["Delete ",s.jsx("strong",{children:$.label}),"? Existing values will remain but won't be validated."]}),s.jsx("button",{onClick:()=>O($.id),disabled:H.isPending,className:"px-3 py-1.5 rounded-lg bg-destructive text-destructive-foreground text-xs font-semibold hover:bg-destructive/90 disabled:opacity-40 transition-colors",children:H.isPending?"Deleting…":"Confirm Delete"}),s.jsx("button",{onClick:()=>P(null),className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold",children:"Cancel"})]}):s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:$.label}),$.is_required&&s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded border bg-destructive/10 text-destructive border-destructive/20 font-semibold",children:"Required"})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[s.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-mono font-medium ${pU($.field_type)}`,children:xU($.field_type)}),s.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:$.field_key}),Array.isArray($.options)&&$.options.length>0&&s.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[$.options.slice(0,3).join(", "),$.options.length>3?` +${$.options.length-3}`:""]})]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{onClick:()=>{te($),P(null)},className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:s.jsx(ls,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>{P($.id),y(null)},className:"p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",children:s.jsx(Ts,{className:"w-3.5 h-3.5"})})]})]})},$.id))})]})}function yU(){const{data:e,isLoading:t}=N6(),n=C6(),r=k6(),[a,l]=x.useState(!1),[c,u]=x.useState(""),[f,m]=x.useState("idle"),[p,g]=x.useState(""),[v,y]=x.useState(""),k=e,j=async()=>{m("testing"),g(""),y("");try{await n.mutateAsync(c),m("ok")}catch(_){m("fail"),g(_ instanceof Error?_.message:"Connection failed")}},N=async()=>{try{const _=await r.mutateAsync(c);y(_.message),l(!1),u(""),m("idle"),xe({title:"Database config saved",description:_.message})}catch(_){xe({title:"Error",description:_ instanceof Error?_.message:"Failed to save",variant:"destructive"})}};return s.jsxs("div",{children:[s.jsx("h2",{className:"font-display font-bold text-lg text-foreground mb-2",children:"Database Connection"}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:["View and update the PostgreSQL database connection. Changes are saved to ",s.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:".env.db"})," and take effect after a server restart."]}),s.jsxs("div",{className:"space-y-4 max-w-lg",children:[t?s.jsx("div",{className:"space-y-2",children:[...Array(3)].map((_,w)=>s.jsx("div",{className:"h-10 bg-muted/50 rounded-lg animate-pulse"},w))}):s.jsxs("div",{className:"p-4 rounded-xl border border-border bg-card space-y-3",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Current Connection"}),[{label:"Host",value:(k==null?void 0:k.host)||"—"},{label:"Port",value:(k==null?void 0:k.port)||"—"},{label:"Database",value:(k==null?void 0:k.database)||"—"},{label:"User",value:(k==null?void 0:k.user)||"—"},{label:"SSL",value:(k==null?void 0:k.ssl)||"default"}].map(_=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground w-20 flex-shrink-0",children:_.label}),s.jsx("code",{className:"text-sm font-mono text-foreground",children:_.value})]},_.label))]}),v&&s.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-xl border border-success/30 bg-success/5 text-sm text-success",children:[s.jsx(er,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:v})]}),a?s.jsxs("div",{className:"space-y-3 p-4 rounded-xl border border-border bg-muted/30",children:[s.jsx("p",{className:"text-xs font-display font-semibold text-muted-foreground uppercase tracking-wider",children:"New Connection String"}),s.jsx("input",{value:c,onChange:_=>{u(_.target.value),m("idle"),g("")},placeholder:"postgresql://user:password@host:5432/dbname",className:"w-full h-9 px-3 rounded-lg border border-border bg-background text-sm text-foreground placeholder:text-muted-foreground font-mono outline-none focus:ring-1 focus:ring-ring"}),f==="ok"&&s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-success",children:[s.jsx(er,{className:"w-3.5 h-3.5"})," Connection successful"]}),f==="fail"&&s.jsxs("div",{className:"flex items-start gap-1.5 text-xs text-destructive",children:[s.jsx($i,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5"})," ",p]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("button",{onClick:j,disabled:!c.trim()||n.isPending,className:"px-3 py-1.5 rounded-lg border border-border text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-foreground/30 disabled:opacity-40 transition-colors",children:n.isPending?"Testing...":"Test Connection"}),s.jsx("button",{onClick:N,disabled:!c.trim()||f!=="ok"||r.isPending,className:"px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 disabled:opacity-40 transition-colors",children:r.isPending?"Saving...":"Save"}),s.jsx("button",{onClick:()=>{l(!1),u(""),m("idle"),g("")},className:"px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs font-semibold hover:bg-muted/80 transition-colors",children:"Cancel"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Test the connection before saving. Save is only enabled after a successful test."})]}):s.jsxs("button",{onClick:()=>{l(!0),y(""),m("idle")},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:bg-primary/90 transition-colors",children:[s.jsx(NC,{className:"w-3.5 h-3.5"})," Edit Connection"]})]})]})}function vU(){const e=nr(),t=Xf(),n=(t==null?void 0:t.role)??"member",r=iU.filter(l=>l.roles.includes(n)),{enabled:a}=hr();return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Settings"}),s.jsx("div",{className:"md:hidden flex gap-1 overflow-x-auto no-scrollbar px-4 pt-3 pb-1 border-b border-border",children:r.map(l=>{const c=l.path==="/settings"?e.pathname==="/settings":e.pathname.startsWith(l.path);return s.jsxs(Qn,{to:l.path,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold whitespace-nowrap transition-colors ${c?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:[s.jsx(l.icon,{className:"w-3.5 h-3.5"}),l.label,l.path==="/settings/agent"&&s.jsx("span",{className:`w-2 h-2 rounded-full ${a?"bg-amber-500":"bg-muted-foreground/40"}`})]},l.path)})}),s.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[s.jsx("nav",{className:"hidden md:flex flex-col w-48 border-r border-border bg-muted p-2 gap-0.5",children:r.map(l=>{const c=l.path==="/settings"?e.pathname==="/settings":e.pathname.startsWith(l.path);return s.jsxs(Qn,{to:l.path,className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${c?"bg-primary/15 text-primary":"text-foreground/60 hover:bg-muted hover:text-foreground"}`,children:[s.jsx(l.icon,{className:"w-4 h-4"}),l.label,l.path==="/settings/agent"&&s.jsx("span",{className:`ml-auto w-2 h-2 rounded-full ${a?"bg-amber-500":"bg-muted-foreground/40"}`})]},l.path)})}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6 pb-20 md:pb-6",children:s.jsxs(Ig,{children:[s.jsx(ut,{index:!0,element:s.jsx(cU,{})}),s.jsx(ut,{path:"appearance",element:s.jsx(uU,{})}),s.jsx(ut,{path:"api-keys",element:s.jsx(fU,{})}),s.jsx(ut,{path:"webhooks",element:s.jsx(nc,{roles:["admin","owner"],children:s.jsx(mU,{})})}),s.jsx(ut,{path:"custom-fields",element:s.jsx(nc,{roles:["admin","owner"],children:s.jsx(gU,{})})}),s.jsx(ut,{path:"actors",element:s.jsx(nc,{roles:["admin","owner"],children:s.jsx(e5,{})})}),s.jsx(ut,{path:"agent",element:s.jsx(nc,{roles:["admin","owner"],children:s.jsx(sU,{})})}),s.jsx(ut,{path:"database",element:s.jsx(nc,{roles:["admin","owner"],children:s.jsx(yU,{})})})]})})]})]})}const bU=()=>{const e=nr();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};function wU(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function jU(){const{data:e,isLoading:t}=Zf(),n=Ry(),[r,a]=x.useState({}),[l,c]=x.useState({}),u=(e==null?void 0:e.data)??[];return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Approvals"}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 pb-24 md:pb-6 space-y-4",children:t?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):u.length===0?s.jsx(_f,{children:s.jsxs(Ef,{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx(wc,{className:"h-14 w-14 text-emerald-500 mb-4"}),s.jsx("p",{className:"text-lg font-display font-semibold",children:"No pending approvals"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your agents are running autonomously"})]})}):u.map(f=>s.jsx(_f,{children:s.jsxs(Ef,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx(hc,{variant:"outline",children:f.action_type}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Agent action pending approval"}),s.jsxs("span",{className:"text-xs text-muted-foreground ml-auto flex items-center gap-1",children:[s.jsx(Ji,{className:"w-3 h-3"}),wU(f.created_at)]}),f.expires_at&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Expires ",new Date(f.expires_at).toLocaleString()]})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-xs text-muted-foreground mb-0.5",children:["Submitted by ",f.agent_id??f.created_by??"agent"]}),s.jsx("p",{className:"text-sm text-foreground",children:f.action_summary})]}),s.jsxs("div",{children:[s.jsx("button",{className:"text-xs text-primary hover:underline",onClick:()=>c({...l,[f.id]:!l[f.id]}),children:l[f.id]?"Hide payload":"Show payload"}),l[f.id]&&s.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded bg-muted p-3 text-xs",children:JSON.stringify(f.action_payload,null,2)})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(So,{placeholder:"Note (optional)",value:r[f.id]??"",onChange:m=>a({...r,[f.id]:m.target.value}),className:"flex-1"}),s.jsx(Tr,{variant:"destructive",size:"sm",onClick:()=>n.mutate({id:f.id,status:"rejected",note:r[f.id]}),disabled:n.isPending,children:"Reject"}),s.jsx(Tr,{size:"sm",onClick:()=>n.mutate({id:f.id,status:"approved",note:r[f.id]}),disabled:n.isPending,children:"Approve"})]})]})},f.id))})]})}const Pf={urgent:"bg-destructive/15 text-destructive",high:"bg-orange-500/15 text-orange-500",normal:"bg-primary/10 text-primary",low:"bg-muted text-muted-foreground"},t5={pending:"bg-amber-500/15 text-amber-600",accepted:"bg-blue-500/15 text-blue-600",in_progress:"bg-violet-500/15 text-violet-600",blocked:"bg-destructive/15 text-destructive",completed:"bg-success/15 text-success",declined:"bg-muted text-muted-foreground",cancelled:"bg-muted text-muted-foreground"},Tf=["pending","accepted","in_progress","blocked"],NU=[{key:"needs_attention",label:"Needs Attention"},{key:"delegated",label:"Delegated"},{key:"all",label:"All"}],CU=[{key:"status",label:"Status",options:[{value:"pending",label:"Pending"},{value:"accepted",label:"Accepted"},{value:"in_progress",label:"In Progress"},{value:"blocked",label:"Blocked"},{value:"completed",label:"Completed"},{value:"declined",label:"Declined"},{value:"cancelled",label:"Cancelled"}]},{key:"priority",label:"Priority",options:[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"normal",label:"Normal"},{value:"low",label:"Low"}]},{key:"assignment_type",label:"Type",options:[{value:"call",label:"Call"},{value:"draft",label:"Draft"},{value:"email",label:"Email"},{value:"follow_up",label:"Follow Up"},{value:"research",label:"Research"},{value:"review",label:"Review"},{value:"send",label:"Send"}]}],kU=[{key:"created_at",label:"Created"},{key:"due_at",label:"Due Date"},{key:"priority",label:"Priority"},{key:"status",label:"Status"},{key:"title",label:"Title"}],Md={urgent:0,high:1,normal:2,low:3};function yv(e){try{return lm(um(e),{addSuffix:!0})}catch{return""}}function SU(e){if(!e)return null;try{const t=um(e);return Qc(t)?{label:"Expired",urgent:!0}:{label:`Expires ${lm(t,{addSuffix:!0})}`,urgent:t.getTime()-Date.now()<1800*1e3}}catch{return null}}function _U({req:e}){const t=Ry(),[n,r]=x.useState(""),[a,l]=x.useState(!1),[c,u]=x.useState(null),f=SU(e.expires_at);async function m(p){u(p==="approved"?"approve":"reject");try{await t.mutateAsync({id:e.id,status:p,note:n.trim()||void 0}),xe({title:p==="approved"?"Approved":"Rejected",description:e.action_summary})}catch{xe({title:"Error",description:"Could not resolve request.",variant:"destructive"})}finally{u(null)}}return s.jsxs("div",{className:"bg-card border border-border rounded-2xl shadow-sm overflow-hidden",children:[s.jsxs("div",{className:"flex items-start gap-3 p-4",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-violet-500/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(fn,{className:"w-4 h-4 text-violet-500"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[s.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full bg-violet-500/15 text-violet-600",children:"Approval Request"}),s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground font-mono",children:e.action_type}),f&&s.jsxs("span",{className:`text-xs flex items-center gap-1 ${f.urgent?"text-destructive":"text-muted-foreground"}`,children:[s.jsx(Ji,{className:"w-3 h-3"}),f.label]})]}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:e.action_summary}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:yv(e.created_at)})]})]}),s.jsxs("div",{className:"px-4 pb-2",children:[s.jsxs("button",{onClick:()=>l(!a),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Ao,{className:`w-3.5 h-3.5 transition-transform ${a?"rotate-90":""}`}),"View payload"]}),s.jsx(Cn,{children:a&&s.jsx(Fe.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden",children:s.jsx("pre",{className:"mt-2 p-3 rounded-xl bg-muted/50 text-xs text-muted-foreground overflow-x-auto max-h-48",children:JSON.stringify(e.action_payload,null,2)})})})]}),s.jsxs("div",{className:"border-t border-border p-3 flex flex-col sm:flex-row gap-2 items-end bg-surface-sunken/30",children:[s.jsx("input",{value:n,onChange:p=>r(p.target.value),placeholder:"Add a note (optional)...",className:"flex-1 h-8 px-3 rounded-lg border border-border bg-card text-xs text-foreground placeholder:text-muted-foreground outline-none focus:ring-2 focus:ring-primary/30"}),s.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[s.jsx(wn,{label:"Reject",icon:s.jsx($i,{className:"w-3.5 h-3.5"}),onClick:()=>m("rejected"),loading:c==="reject",color:"destructive"}),s.jsx(wn,{label:"Approve",icon:s.jsx(er,{className:"w-3.5 h-3.5"}),onClick:()=>m("approved"),loading:c==="approve",color:"success"})]})]})]})}function EU({task:e,actorMap:t}){const n=Oy(),r=Fy(),a=Iy(),l=Ly(),c=$y(),u=Vy(),[f,m]=x.useState(null);async function p(y){m(y);try{y==="accept"?await n.mutateAsync(e.id):y==="start"?await r.mutateAsync(e.id):y==="complete"?await a.mutateAsync({id:e.id}):y==="decline"?await l.mutateAsync({id:e.id}):y==="block"?await c.mutateAsync({id:e.id}):y==="cancel"&&await u.mutateAsync({id:e.id}),xe({title:`Assignment ${y}ed`})}catch{xe({title:"Error",description:`Could not ${y} assignment.`,variant:"destructive"})}finally{m(null)}}const g=e.due_at&&Qc(um(e.due_at))&&!["completed","cancelled","declined"].includes(e.status),v=t.get(e.assigned_by)??e.assigned_by.slice(0,8)+"…";return s.jsxs("div",{className:"bg-card border border-border rounded-2xl shadow-sm overflow-hidden",children:[s.jsxs("div",{className:"flex items-start gap-3 p-4",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(Bc,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[s.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${Pf[e.priority]??Pf.normal}`,children:e.priority}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${t5[e.status]??"bg-muted text-muted-foreground"}`,children:e.status.replace("_"," ")}),s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground font-mono",children:e.assignment_type.replace("_"," ")}),g&&s.jsxs("span",{className:"text-xs flex items-center gap-1 text-destructive",children:[s.jsx(cs,{className:"w-3 h-3"}),"Overdue"]})]}),s.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:e.title}),s.jsxs("div",{className:"flex items-center gap-3 mt-1 flex-wrap",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(ji,{className:"w-3 h-3"}),"from ",v]}),e.due_at&&s.jsxs("span",{className:`text-xs flex items-center gap-1 ${g?"text-destructive":"text-muted-foreground"}`,children:[s.jsx($c,{className:"w-3 h-3"}),yv(e.due_at)]})]}),e.context&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.context})]})]}),Tf.includes(e.status)&&s.jsxs("div",{className:"border-t border-border px-3 py-2 flex gap-2 flex-wrap bg-surface-sunken/30",children:[e.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(wn,{label:"Accept",icon:s.jsx(er,{className:"w-3.5 h-3.5"}),onClick:()=>p("accept"),loading:f==="accept",color:"success"}),s.jsx(wn,{label:"Decline",icon:s.jsx($i,{className:"w-3.5 h-3.5"}),onClick:()=>p("decline"),loading:f==="decline",color:"destructive"})]}),e.status==="accepted"&&s.jsxs(s.Fragment,{children:[s.jsx(wn,{label:"Start",icon:s.jsx(Vi,{className:"w-3.5 h-3.5"}),onClick:()=>p("start"),loading:f==="start",color:"primary"}),s.jsx(wn,{label:"Decline",icon:s.jsx($i,{className:"w-3.5 h-3.5"}),onClick:()=>p("decline"),loading:f==="decline",color:"ghost"})]}),e.status==="in_progress"&&s.jsxs(s.Fragment,{children:[s.jsx(wn,{label:"Complete",icon:s.jsx(er,{className:"w-3.5 h-3.5"}),onClick:()=>p("complete"),loading:f==="complete",color:"success"}),s.jsx(wn,{label:"Block",icon:s.jsx(Ex,{className:"w-3.5 h-3.5"}),onClick:()=>p("block"),loading:f==="block",color:"warning"})]}),e.status==="blocked"&&s.jsxs(s.Fragment,{children:[s.jsx(wn,{label:"Resume",icon:s.jsx(Vi,{className:"w-3.5 h-3.5"}),onClick:()=>p("start"),loading:f==="start",color:"primary"}),s.jsx(wn,{label:"Cancel",icon:s.jsx(Id,{className:"w-3.5 h-3.5"}),onClick:()=>p("cancel"),loading:f==="cancel",color:"ghost"})]})]})]})}function wn({label:e,icon:t,onClick:n,loading:r,color:a}){const l={success:"bg-success text-white hover:bg-success/90",destructive:"border border-destructive/30 text-destructive hover:bg-destructive/10",primary:"bg-primary text-primary-foreground hover:bg-primary/90",warning:"border border-amber-500/30 text-amber-600 hover:bg-amber-500/10",ghost:"border border-border text-muted-foreground hover:bg-muted/50"};return s.jsxs("button",{onClick:n,disabled:r,className:`h-7 px-2.5 flex items-center gap-1.5 rounded-lg text-xs font-semibold transition-all disabled:opacity-50 ${l[a]}`,children:[r?s.jsx(sf,{className:"w-3.5 h-3.5 animate-spin"}):t,e]})}function PU({task:e,actorMap:t,index:n}){const r=Oy(),a=Fy(),l=Iy(),c=Ly(),u=$y(),f=Vy(),[m,p]=x.useState(null);async function g(j){p(j);try{j==="accept"?await r.mutateAsync(e.id):j==="start"?await a.mutateAsync(e.id):j==="complete"?await l.mutateAsync({id:e.id}):j==="decline"?await c.mutateAsync({id:e.id}):j==="block"?await u.mutateAsync({id:e.id}):j==="cancel"&&await f.mutateAsync({id:e.id}),xe({title:`Assignment ${j}ed`})}catch{xe({title:"Error",description:`Could not ${j} assignment.`,variant:"destructive"})}finally{p(null)}}const v=e.due_at&&Qc(um(e.due_at))&&!["completed","cancelled","declined"].includes(e.status),y=t.get(e.assigned_by)??e.assigned_by.slice(0,8)+"…",k=t.get(e.assigned_to)??e.assigned_to.slice(0,8)+"…";return s.jsxs("tr",{className:`border-b border-border hover:bg-primary/5 transition-colors group ${n%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full ${Pf[e.priority]??Pf.normal}`,children:e.priority})}),s.jsxs("td",{className:"px-4 py-3 max-w-xs",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e.title}),e.context&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.context})]}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground font-mono",children:e.assignment_type.replace("_"," ")})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${t5[e.status]??"bg-muted text-muted-foreground"}`,children:e.status.replace("_"," ")})}),s.jsx("td",{className:"px-4 py-3 text-xs text-muted-foreground",children:k}),s.jsx("td",{className:"px-4 py-3 text-xs text-muted-foreground",children:y}),s.jsx("td",{className:`px-4 py-3 text-xs ${v?"text-destructive font-medium":"text-muted-foreground"}`,children:e.due_at?yv(e.due_at):"—"}),s.jsx("td",{className:"px-4 py-3",children:Tf.includes(e.status)&&s.jsxs("div",{className:"flex gap-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(wn,{label:"Accept",icon:s.jsx(er,{className:"w-3 h-3"}),onClick:()=>g("accept"),loading:m==="accept",color:"success"}),s.jsx(wn,{label:"Decline",icon:s.jsx($i,{className:"w-3 h-3"}),onClick:()=>g("decline"),loading:m==="decline",color:"ghost"})]}),e.status==="accepted"&&s.jsx(wn,{label:"Start",icon:s.jsx(Vi,{className:"w-3 h-3"}),onClick:()=>g("start"),loading:m==="start",color:"primary"}),e.status==="in_progress"&&s.jsx(wn,{label:"Complete",icon:s.jsx(er,{className:"w-3 h-3"}),onClick:()=>g("complete"),loading:m==="complete",color:"success"}),e.status==="blocked"&&s.jsx(wn,{label:"Resume",icon:s.jsx(Vi,{className:"w-3 h-3"}),onClick:()=>g("start"),loading:m==="start",color:"primary"})]})})]})}function iN({tab:e}){const t={needs_attention:{title:"All clear!",sub:"No approvals or tasks waiting for your action."},delegated:{title:"Nothing delegated",sub:"Assignments you create will appear here."},all:{title:"Nothing here yet",sub:"Assignments will appear as they are created."}};return s.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-muted/50 flex items-center justify-center mb-4",children:s.jsx(Ff,{className:"w-7 h-7 text-muted-foreground/50"})}),s.jsx("p",{className:"text-base font-semibold text-foreground",children:t[e].title}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t[e].sub})]})}function TU(){var X,B,L;const[e,t]=x.useState("needs_attention"),[n,r]=x.useState("card"),[a,l]=x.useState(""),[c,u]=x.useState({}),[f,m]=x.useState({key:"created_at",dir:"desc"}),[p,g]=x.useState(1),v=25,{openQuickAdd:y}=nt(),{data:k}=g2(),j=k==null?void 0:k.actor_id,N=Zf(),_=Mp(j?{assigned_to:j,limit:200}:void 0),w=Mp(j?{assigned_by:j,limit:200}:void 0),S=Mp({limit:200}),E=Kc({limit:100}),P=x.useMemo(()=>{var se,ae;const G=new Map;return(((se=E.data)==null?void 0:se.actors)??((ae=E.data)==null?void 0:ae.data)??[]).forEach(ue=>{G.set(ue.id,ue.display_name??ue.name??ue.email??ue.id)}),G},[E.data]),T=x.useMemo(()=>{var G;return(((G=N.data)==null?void 0:G.data)??[]).filter(se=>se.status==="pending")},[N.data]),M=((X=_.data)==null?void 0:X.assignments)??[],D=((B=w.data)==null?void 0:B.assignments)??[],q=((L=S.data)==null?void 0:L.assignments)??[],H=x.useMemo(()=>M.filter(G=>Tf.includes(G.status)),[M]),I=x.useMemo(()=>D.filter(G=>Tf.includes(G.status)&&G.assigned_to!==j),[D,j]),F=x.useMemo(()=>e==="needs_attention"?H:e==="delegated"?I:q,[e,H,I,q]),te=x.useMemo(()=>{var se,ae,ue;let G=[...F];if(a.trim()){const oe=a.toLowerCase();G=G.filter(he=>he.title.toLowerCase().includes(oe)||(he.context??"").toLowerCase().includes(oe)||(he.description??"").toLowerCase().includes(oe))}return(se=c.status)!=null&&se.length&&(G=G.filter(oe=>c.status.includes(oe.status))),(ae=c.priority)!=null&&ae.length&&(G=G.filter(oe=>c.priority.includes(oe.priority))),(ue=c.assignment_type)!=null&&ue.length&&(G=G.filter(oe=>c.assignment_type.includes(oe.assignment_type))),f&&G.sort((oe,he)=>{if(f.key==="priority")return f.dir==="asc"?(Md[oe.priority]??2)-(Md[he.priority]??2):(Md[he.priority]??2)-(Md[oe.priority]??2);const ge=oe[f.key]??"",Ce=he[f.key]??"";return f.dir==="asc"?String(ge).localeCompare(String(Ce)):String(Ce).localeCompare(String(ge))}),G},[F,a,c,f]);x.useEffect(()=>{g(1)},[e,a,c,f]);const Y=te.slice((p-1)*v,p*v),O=T.length+H.length,U=N.isLoading||_.isLoading||S.isLoading,$=(G,se)=>{u(ae=>{const ue={...ae};return se.length===0?delete ue[G]:ue[G]=se,ue})},R=G=>{m(se=>(se==null?void 0:se.key)===G?{key:G,dir:se.dir==="asc"?"desc":"asc"}:{key:G,dir:"asc"})},z=({label:G,sortKey:se})=>s.jsx("th",{onClick:()=>R(se),className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground cursor-pointer hover:text-foreground transition-colors select-none",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[G,(f==null?void 0:f.key)===se&&(f.dir==="asc"?s.jsx($r,{className:"w-3 h-3"}):s.jsx(Wn,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsx(zn,{title:"Assignments",children:s.jsx("div",{className:"hidden md:flex items-center gap-1 bg-muted rounded-xl p-0.5",children:[{mode:"card",icon:Vc},{mode:"table",icon:$a}].map(({mode:G,icon:se})=>s.jsx("button",{onClick:()=>r(G),className:`p-1.5 rounded-lg transition-all ${n===G?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(se,{className:"w-4 h-4"})},G))})}),s.jsx("div",{className:"px-4 md:px-6 pt-3 pb-1 flex flex-wrap items-center gap-2",children:s.jsx("div",{className:"inline-flex rounded-xl border border-border bg-muted/40 p-0.5 gap-0.5",children:NU.map(G=>s.jsxs("button",{onClick:()=>t(G.key),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all flex items-center gap-1.5",e===G.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:[G.label,G.key==="needs_attention"&&O>0&&s.jsx("span",{className:`min-w-[16px] h-4 px-1 rounded-full text-[10px] font-bold flex items-center justify-center ${e===G.key?"bg-destructive text-white":"bg-muted-foreground/20 text-muted-foreground"}`,children:O})]},G.key))})}),s.jsx(Va,{searchValue:a,onSearchChange:l,searchPlaceholder:"Search assignments...",filters:CU,activeFilters:c,onFilterChange:$,onClearFilters:()=>u({}),sortOptions:kU,currentSort:f,onSortChange:R,onAdd:()=>y("assignment"),addLabel:"New Assignment",entityType:"assignments"}),s.jsx("div",{className:"flex-1 overflow-y-auto pb-24 md:pb-6",children:U?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(sf,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):s.jsxs(s.Fragment,{children:[e==="needs_attention"&&T.length>0&&s.jsxs("div",{className:"px-4 md:px-6 pt-4 pb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"Approval Requests"}),s.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground text-[10px] font-semibold",children:T.length}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:T.map(G=>s.jsx(_U,{req:G},G.id))})]}),Y.length===0&&T.length===0?s.jsx(iN,{tab:e}):Y.length===0&&e==="needs_attention"?null:Y.length===0?s.jsx(iN,{tab:e}):n==="card"?s.jsxs("div",{className:"px-4 md:px-6 pt-4 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[e==="needs_attention"&&Y.length>0&&s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-xs font-display font-bold text-muted-foreground uppercase tracking-wide",children:"My Tasks"}),s.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground text-[10px] font-semibold",children:Y.length}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),Y.map(G=>s.jsx(EU,{task:G,actorMap:P},G.id))]}):s.jsx("div",{className:"px-4 md:px-6 pt-4 overflow-x-auto",children:s.jsx("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-surface-sunken/50",children:[s.jsx(z,{label:"Priority",sortKey:"priority"}),s.jsx(z,{label:"Title",sortKey:"title"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Type"}),s.jsx(z,{label:"Status",sortKey:"status"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Assigned To"}),s.jsx("th",{className:"text-left px-4 py-3 text-xs font-display font-semibold text-muted-foreground",children:"Assigned By"}),s.jsx(z,{label:"Due",sortKey:"due_at"}),s.jsx("th",{className:"px-4 py-3"})]})}),s.jsx("tbody",{children:Y.map((G,se)=>s.jsx(PU,{task:G,actorMap:P,index:se},G.id))})]})})}),te.length>v&&s.jsx("div",{className:"px-4 md:px-6 pt-4",children:s.jsx(Fr,{page:p,pageSize:v,total:te.length,onPageChange:g,onPageSizeChange:()=>{}})})]})})]})}function lN(e,[t,n]){return Math.min(n,Math.max(t,e))}var AU=x.createContext(void 0);function MU(e){const t=x.useContext(AU);return e||t||"ltr"}function DU(e){const t=RU(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,u=x.Children.toArray(l),f=u.find(IU);if(f){const m=f.props.children,p=u.map(g=>g===f?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:g);return s.jsx(t,{...c,ref:a,children:x.isValidElement(m)?x.cloneElement(m,void 0,p):null})}return s.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function RU(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=FU(a),u=LU(l,a.props);return a.type!==x.Fragment&&(u.ref=r?mr(r,c):c),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OU=Symbol("radix.slottable");function IU(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OU}function LU(e,t){const n={...t};for(const r in t){const a=e[r],l=t[r];/^on[A-Z]/.test(r)?a&&l?n[r]=(...u)=>{const f=l(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function FU(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $U=[" ","Enter","ArrowUp","ArrowDown"],VU=[" ","Enter"],Ia="Select",[ym,vm,BU]=HN(Ia),[cl]=Os(Ia,[BU,sl]),bm=sl(),[zU,Ho]=cl(Ia),[WU,UU]=cl(Ia),n5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:l,value:c,defaultValue:u,onValueChange:f,dir:m,name:p,autoComplete:g,disabled:v,required:y,form:k}=e,j=bm(t),[N,_]=x.useState(null),[w,S]=x.useState(null),[E,P]=x.useState(!1),T=MU(m),[M,D]=Aa({prop:r,defaultProp:a??!1,onChange:l,caller:Ia}),[q,H]=Aa({prop:c,defaultProp:u,onChange:f,caller:Ia}),I=x.useRef(null),F=N?k||!!N.closest("form"):!0,[te,Y]=x.useState(new Set),O=Array.from(te).map(U=>U.props.value).join(";");return s.jsx(uk,{...j,children:s.jsxs(zU,{required:y,scope:t,trigger:N,onTriggerChange:_,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:E,onValueNodeHasChildrenChange:P,contentId:Xn(),value:q,onValueChange:H,open:M,onOpenChange:D,dir:T,triggerPointerDownPosRef:I,disabled:v,children:[s.jsx(ym.Provider,{scope:t,children:s.jsx(WU,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(U=>{Y($=>new Set($).add(U))},[]),onNativeOptionRemove:x.useCallback(U=>{Y($=>{const R=new Set($);return R.delete(U),R})},[]),children:n})}),F?s.jsxs(S5,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:q,onChange:U=>H(U.target.value),disabled:v,form:k,children:[q===void 0?s.jsx("option",{value:""}):null,Array.from(te)]},O):null]})})};n5.displayName=Ia;var r5="SelectTrigger",s5=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,l=bm(n),c=Ho(r5,n),u=c.disabled||r,f=Je(t,c.onTriggerChange),m=vm(n),p=x.useRef("touch"),[g,v,y]=E5(j=>{const N=m().filter(S=>!S.disabled),_=N.find(S=>S.value===c.value),w=P5(N,j,_);w!==void 0&&c.onValueChange(w.value)}),k=j=>{u||(c.onOpenChange(!0),y()),j&&(c.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return s.jsx(Wf,{asChild:!0,...l,children:s.jsx($e.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":_5(c.value)?"":void 0,...a,ref:f,onClick:Ie(a.onClick,j=>{j.currentTarget.focus(),p.current!=="mouse"&&k(j)}),onPointerDown:Ie(a.onPointerDown,j=>{p.current=j.pointerType;const N=j.target;N.hasPointerCapture(j.pointerId)&&N.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(k(j),j.preventDefault())}),onKeyDown:Ie(a.onKeyDown,j=>{const N=g.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&v(j.key),!(N&&j.key===" ")&&$U.includes(j.key)&&(k(),j.preventDefault())})})})});s5.displayName=r5;var o5="SelectValue",a5=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:l,placeholder:c="",...u}=e,f=Ho(o5,n),{onValueNodeHasChildrenChange:m}=f,p=l!==void 0,g=Je(t,f.onValueNodeChange);return sn(()=>{m(p)},[m,p]),s.jsx($e.span,{...u,ref:g,style:{pointerEvents:"none"},children:_5(f.value)?s.jsx(s.Fragment,{children:c}):l})});a5.displayName=o5;var HU="SelectIcon",i5=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx($e.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});i5.displayName=HU;var qU="SelectPortal",l5=e=>s.jsx(Ic,{asChild:!0,...e});l5.displayName=qU;var La="SelectContent",c5=x.forwardRef((e,t)=>{const n=Ho(La,e.__scopeSelect),[r,a]=x.useState();if(sn(()=>{a(new DocumentFragment)},[]),!n.open){const l=r;return l?Qi.createPortal(s.jsx(u5,{scope:e.__scopeSelect,children:s.jsx(ym.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx(d5,{...e,ref:t})});c5.displayName=La;var _r=10,[u5,qo]=cl(La),KU="SelectContentImpl",YU=DU("SelectContent.RemoveScroll"),d5=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:l,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:y,sticky:k,hideWhenDetached:j,avoidCollisions:N,..._}=e,w=Ho(La,n),[S,E]=x.useState(null),[P,T]=x.useState(null),M=Je(t,oe=>E(oe)),[D,q]=x.useState(null),[H,I]=x.useState(null),F=vm(n),[te,Y]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(S)return zy(S)},[S]),By();const U=x.useCallback(oe=>{const[he,...ge]=F().map(Be=>Be.ref.current),[Ce]=ge.slice(-1),ce=document.activeElement;for(const Be of oe)if(Be===ce||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===he&&P&&(P.scrollTop=0),Be===Ce&&P&&(P.scrollTop=P.scrollHeight),Be==null||Be.focus(),document.activeElement!==ce))return},[F,P]),$=x.useCallback(()=>U([D,S]),[U,D,S]);x.useEffect(()=>{te&&$()},[te,$]);const{onOpenChange:R,triggerPointerDownPosRef:z}=w;x.useEffect(()=>{if(S){let oe={x:0,y:0};const he=Ce=>{var ce,Be;oe={x:Math.abs(Math.round(Ce.pageX)-(((ce=z.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((Be=z.current)==null?void 0:Be.y)??0))}},ge=Ce=>{oe.x<=10&&oe.y<=10?Ce.preventDefault():S.contains(Ce.target)||R(!1),document.removeEventListener("pointermove",he),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",ge,{capture:!0})}}},[S,R,z]),x.useEffect(()=>{const oe=()=>R(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[R]);const[X,B]=E5(oe=>{const he=F().filter(ce=>!ce.disabled),ge=he.find(ce=>ce.ref.current===document.activeElement),Ce=P5(he,oe,ge);Ce&&setTimeout(()=>Ce.ref.current.focus())}),L=x.useCallback((oe,he,ge)=>{const Ce=!O.current&&!ge;(w.value!==void 0&&w.value===he||Ce)&&(q(oe),Ce&&(O.current=!0))},[w.value]),G=x.useCallback(()=>S==null?void 0:S.focus(),[S]),se=x.useCallback((oe,he,ge)=>{const Ce=!O.current&&!ge;(w.value!==void 0&&w.value===he||Ce)&&I(oe)},[w.value]),ae=r==="popper"?pg:f5,ue=ae===pg?{side:u,sideOffset:f,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:y,sticky:k,hideWhenDetached:j,avoidCollisions:N}:{};return s.jsx(u5,{scope:n,content:S,viewport:P,onViewportChange:T,itemRefCallback:L,selectedItem:D,onItemLeave:G,itemTextRefCallback:se,focusSelectedItem:$,selectedItemText:H,position:r,isPositioned:te,searchRef:X,children:s.jsx(nm,{as:YU,allowPinchZoom:!0,children:s.jsx(em,{asChild:!0,trapped:w.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Ie(a,oe=>{var he;(he=w.trigger)==null||he.focus({preventScroll:!0}),oe.preventDefault()}),children:s.jsx(Zi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:s.jsx(ae,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:oe=>oe.preventDefault(),..._,...ue,onPlaced:()=>Y(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Ie(_.onKeyDown,oe=>{const he=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!he&&oe.key.length===1&&B(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let Ce=F().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ce=oe.target,Be=Ce.indexOf(ce);Ce=Ce.slice(Be+1)}setTimeout(()=>U(Ce)),oe.preventDefault()}})})})})})})});d5.displayName=KU;var QU="SelectItemAlignedPosition",f5=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,l=Ho(La,n),c=qo(La,n),[u,f]=x.useState(null),[m,p]=x.useState(null),g=Je(t,M=>p(M)),v=vm(n),y=x.useRef(!1),k=x.useRef(!0),{viewport:j,selectedItem:N,selectedItemText:_,focusSelectedItem:w}=c,S=x.useCallback(()=>{if(l.trigger&&l.valueNode&&u&&m&&j&&N&&_){const M=l.trigger.getBoundingClientRect(),D=m.getBoundingClientRect(),q=l.valueNode.getBoundingClientRect(),H=_.getBoundingClientRect();if(l.dir!=="rtl"){const ce=H.left-D.left,Be=q.left-ce,at=M.left-Be,Et=M.width+at,Yt=Math.max(Et,D.width),Qt=window.innerWidth-_r,zt=lN(Be,[_r,Math.max(_r,Qt-Yt)]);u.style.minWidth=Et+"px",u.style.left=zt+"px"}else{const ce=D.right-H.right,Be=window.innerWidth-q.right-ce,at=window.innerWidth-M.right-Be,Et=M.width+at,Yt=Math.max(Et,D.width),Qt=window.innerWidth-_r,zt=lN(Be,[_r,Math.max(_r,Qt-Yt)]);u.style.minWidth=Et+"px",u.style.right=zt+"px"}const I=v(),F=window.innerHeight-_r*2,te=j.scrollHeight,Y=window.getComputedStyle(m),O=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),$=parseInt(Y.borderBottomWidth,10),R=parseInt(Y.paddingBottom,10),z=O+U+te+R+$,X=Math.min(N.offsetHeight*5,z),B=window.getComputedStyle(j),L=parseInt(B.paddingTop,10),G=parseInt(B.paddingBottom,10),se=M.top+M.height/2-_r,ae=F-se,ue=N.offsetHeight/2,oe=N.offsetTop+ue,he=O+U+oe,ge=z-he;if(he<=se){const ce=I.length>0&&N===I[I.length-1].ref.current;u.style.bottom="0px";const Be=m.clientHeight-j.offsetTop-j.offsetHeight,at=Math.max(ae,ue+(ce?G:0)+Be+$),Et=he+at;u.style.height=Et+"px"}else{const ce=I.length>0&&N===I[0].ref.current;u.style.top="0px";const at=Math.max(se,O+j.offsetTop+(ce?L:0)+ue)+ge;u.style.height=at+"px",j.scrollTop=he-se+j.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=X+"px",u.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[v,l.trigger,l.valueNode,u,m,j,N,_,l.dir,r]);sn(()=>S(),[S]);const[E,P]=x.useState();sn(()=>{m&&P(window.getComputedStyle(m).zIndex)},[m]);const T=x.useCallback(M=>{M&&k.current===!0&&(S(),w==null||w(),k.current=!1)},[S,w]);return s.jsx(XU,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:T,children:s.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx($e.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});f5.displayName=QU;var GU="SelectPopperPosition",pg=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=_r,...l}=e,c=bm(n);return s.jsx(Jg,{...c,...l,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...l.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)"}})});pg.displayName=GU;var[XU,vv]=cl(La,{}),xg="SelectViewport",m5=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,l=qo(xg,n),c=vv(xg,n),u=Je(t,l.onViewportChange),f=x.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(ym.Slot,{scope:n,children:s.jsx($e.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ie(a.onScroll,m=>{const p=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:v}=c;if(v!=null&&v.current&&g){const y=Math.abs(f.current-p.scrollTop);if(y>0){const k=window.innerHeight-_r*2,j=parseFloat(g.style.minHeight),N=parseFloat(g.style.height),_=Math.max(j,N);if(_<k){const w=_+y,S=Math.min(k,w),E=w-S;g.style.height=S+"px",g.style.bottom==="0px"&&(p.scrollTop=E>0?E:0,g.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});m5.displayName=xg;var h5="SelectGroup",[ZU,JU]=cl(h5),eH=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Xn();return s.jsx(ZU,{scope:n,id:a,children:s.jsx($e.div,{role:"group","aria-labelledby":a,...r,ref:t})})});eH.displayName=h5;var p5="SelectLabel",x5=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=JU(p5,n);return s.jsx($e.div,{id:a.id,...r,ref:t})});x5.displayName=p5;var Af="SelectItem",[tH,g5]=cl(Af),y5=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:l,...c}=e,u=Ho(Af,n),f=qo(Af,n),m=u.value===r,[p,g]=x.useState(l??""),[v,y]=x.useState(!1),k=Je(t,w=>{var S;return(S=f.itemRefCallback)==null?void 0:S.call(f,w,r,a)}),j=Xn(),N=x.useRef("touch"),_=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(tH,{scope:n,value:r,disabled:a,textId:j,isSelected:m,onItemTextChange:x.useCallback(w=>{g(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:s.jsx(ym.ItemSlot,{scope:n,value:r,disabled:a,textValue:p,children:s.jsx($e.div,{role:"option","aria-labelledby":j,"data-highlighted":v?"":void 0,"aria-selected":m&&v,"data-state":m?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:k,onFocus:Ie(c.onFocus,()=>y(!0)),onBlur:Ie(c.onBlur,()=>y(!1)),onClick:Ie(c.onClick,()=>{N.current!=="mouse"&&_()}),onPointerUp:Ie(c.onPointerUp,()=>{N.current==="mouse"&&_()}),onPointerDown:Ie(c.onPointerDown,w=>{N.current=w.pointerType}),onPointerMove:Ie(c.onPointerMove,w=>{var S;N.current=w.pointerType,a?(S=f.onItemLeave)==null||S.call(f):N.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(c.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=f.onItemLeave)==null||S.call(f))}),onKeyDown:Ie(c.onKeyDown,w=>{var E;((E=f.searchRef)==null?void 0:E.current)!==""&&w.key===" "||(VU.includes(w.key)&&_(),w.key===" "&&w.preventDefault())})})})})});y5.displayName=Af;var ac="SelectItemText",v5=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...l}=e,c=Ho(ac,n),u=qo(ac,n),f=g5(ac,n),m=UU(ac,n),[p,g]=x.useState(null),v=Je(t,_=>g(_),f.onItemTextChange,_=>{var w;return(w=u.itemTextRefCallback)==null?void 0:w.call(u,_,f.value,f.disabled)}),y=p==null?void 0:p.textContent,k=x.useMemo(()=>s.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:j,onNativeOptionRemove:N}=m;return sn(()=>(j(k),()=>N(k)),[j,N,k]),s.jsxs(s.Fragment,{children:[s.jsx($e.span,{id:f.textId,...l,ref:v}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Qi.createPortal(l.children,c.valueNode):null]})});v5.displayName=ac;var b5="SelectItemIndicator",w5=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g5(b5,n).isSelected?s.jsx($e.span,{"aria-hidden":!0,...r,ref:t}):null});w5.displayName=b5;var gg="SelectScrollUpButton",j5=x.forwardRef((e,t)=>{const n=qo(gg,e.__scopeSelect),r=vv(gg,e.__scopeSelect),[a,l]=x.useState(!1),c=Je(t,r.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;l(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?s.jsx(C5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});j5.displayName=gg;var yg="SelectScrollDownButton",N5=x.forwardRef((e,t)=>{const n=qo(yg,e.__scopeSelect),r=vv(yg,e.__scopeSelect),[a,l]=x.useState(!1),c=Je(t,r.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<m;l(p)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?s.jsx(C5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});N5.displayName=yg;var C5=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,l=qo("SelectScrollButton",n),c=x.useRef(null),u=vm(n),f=x.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return x.useEffect(()=>()=>f(),[f]),sn(()=>{var p;const m=u().find(g=>g.ref.current===document.activeElement);(p=m==null?void 0:m.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),s.jsx($e.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ie(a.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ie(a.onPointerMove,()=>{var m;(m=l.onItemLeave)==null||m.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ie(a.onPointerLeave,()=>{f()})})}),nH="SelectSeparator",k5=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx($e.div,{"aria-hidden":!0,...r,ref:t})});k5.displayName=nH;var vg="SelectArrow",rH=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=bm(n),l=Ho(vg,n),c=qo(vg,n);return l.open&&c.position==="popper"?s.jsx(ey,{...a,...r,ref:t}):null});rH.displayName=vg;var sH="SelectBubbleInput",S5=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),l=Je(r,a),c=hv(t);return x.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&p){const g=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(g)}},[c,t]),s.jsx($e.select,{...n,style:{...GN,...n.style},ref:l,defaultValue:t})});S5.displayName=sH;function _5(e){return e===""||e===void 0}function E5(e){const t=Mr(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(c=>{const u=n.current+c;t(u),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),l=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,l]}function P5(e,t,n){const a=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=oH(e,Math.max(l,0));a.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function oH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aH=n5,T5=s5,iH=a5,lH=i5,cH=l5,A5=c5,uH=m5,M5=x5,D5=y5,dH=v5,fH=w5,R5=j5,O5=N5,I5=k5;const cN=aH,uN=iH,bg=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(T5,{ref:r,className:Oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(lH,{asChild:!0,children:s.jsx(Wn,{className:"h-4 w-4 opacity-50"})})]}));bg.displayName=T5.displayName;const L5=x.forwardRef(({className:e,...t},n)=>s.jsx(R5,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx($r,{className:"h-4 w-4"})}));L5.displayName=R5.displayName;const F5=x.forwardRef(({className:e,...t},n)=>s.jsx(O5,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Wn,{className:"h-4 w-4"})}));F5.displayName=O5.displayName;const wg=x.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(cH,{children:s.jsxs(A5,{ref:a,className:Oe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(L5,{}),s.jsx(uH,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(F5,{})]})}));wg.displayName=A5.displayName;const mH=x.forwardRef(({className:e,...t},n)=>s.jsx(M5,{ref:n,className:Oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));mH.displayName=M5.displayName;const ic=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(D5,{ref:r,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fH,{children:s.jsx(If,{className:"h-4 w-4"})})}),s.jsx(dH,{children:t})]}));ic.displayName=D5.displayName;const hH=x.forwardRef(({className:e,...t},n)=>s.jsx(I5,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));hH.displayName=I5.displayName;const pH=["contact","account","opportunity","use_case"],xH=["transcript","objection","summary","research","note","action_plan","competitor_intel","stakeholder_map"];function gH({value:e}){if(e==null)return null;const t=Math.round(e*100),n=t>=80?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":t>=50?"bg-warning/15 text-warning":"bg-destructive/15 text-destructive";return s.jsxs("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold ${n}`,children:[t,"%"]})}function yH({date:e}){if(!e)return null;const t=Qc(new Date(e));return s.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium ${t?"text-destructive":"text-muted-foreground"}`,children:[t&&s.jsx(cs,{className:"w-3 h-3"}),t?"Expired ":"Valid until ",lm(new Date(e),{addSuffix:!0})]})}function dN(e){return e==="use_case"?"Use Case":e.charAt(0).toUpperCase()+e.slice(1)}function vH(){const[e,t]=ET(),[n,r]=x.useState(""),[a,l]=x.useState(e.get("subject_type")??""),[c,u]=x.useState(""),[f,m]=x.useState(e.get("stale")==="true"),p=v2(),g=x.useMemo(()=>({subject_type:a||void 0,context_type:c||void 0,is_current:f?!1:void 0,limit:50}),[a,c,f]),{data:v,isLoading:y,refetch:k}=bf(g),j=(v==null?void 0:v.data)??[],N=(v==null?void 0:v.total)??0,_=x.useMemo(()=>{if(!n.trim())return j;const E=n.toLowerCase();return j.filter(P=>(P.title??"").toLowerCase().includes(E)||(P.body??"").toLowerCase().includes(E)||(P.tags??[]).some(T=>T.toLowerCase().includes(E)))},[j,n]);function w(){l(""),u(""),m(!1),r(""),t({})}const S=a||c||f||n;return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Context"}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 pb-24 md:pb-6",children:[s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"mb-5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(vc,{className:"w-5 h-5 text-[#0ea5e9]"}),s.jsx("h1",{className:"text-xl font-display font-bold text-foreground",children:"Context entries"}),N>0&&s.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:[N.toLocaleString()," total"]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Structured memory written by agents after every interaction. Used to power briefings."})]}),s.jsxs(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.04},className:"flex flex-wrap gap-2 mb-4",children:[s.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[s.jsx(el,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none"}),s.jsx(So,{placeholder:"Search title, body, tags…",value:n,onChange:E=>r(E.target.value),className:"pl-8 h-8 text-sm"})]}),s.jsxs(cN,{value:a,onValueChange:l,children:[s.jsx(bg,{className:"h-8 w-[140px] text-sm",children:s.jsx(uN,{placeholder:"Subject type"})}),s.jsxs(wg,{children:[s.jsx(ic,{value:"",children:"All subjects"}),pH.map(E=>s.jsx(ic,{value:E,children:dN(E)},E))]})]}),s.jsxs(cN,{value:c,onValueChange:u,children:[s.jsx(bg,{className:"h-8 w-[150px] text-sm",children:s.jsx(uN,{placeholder:"Context type"})}),s.jsxs(wg,{children:[s.jsx(ic,{value:"",children:"All types"}),xH.map(E=>s.jsx(ic,{value:E,children:E.replace(/_/g," ")},E))]})]}),s.jsxs(Tr,{variant:f?"destructive":"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>m(!f),children:[s.jsx(cs,{className:"w-3 h-3"}),"Stale only"]}),S&&s.jsxs(Tr,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1",onClick:w,children:[s.jsx(Sn,{className:"w-3 h-3"}),"Clear"]})]}),y?s.jsx("div",{className:"text-sm text-muted-foreground py-8 text-center",children:"Loading…"}):_.length===0?s.jsxs(Fe.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col items-center justify-center py-20 text-center",children:[s.jsx(vc,{className:"w-14 h-14 text-muted-foreground/30 mb-4"}),s.jsx("p",{className:"text-base font-display font-semibold text-foreground mb-1",children:S?"No entries match your filters":"No context entries yet"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:S?"Try adjusting your search or filters.":"Agents write context entries after every interaction. They power the briefings returned by briefing_get."}),S&&s.jsx(Tr,{variant:"outline",size:"sm",className:"mt-4",onClick:w,children:"Clear filters"})]}):s.jsx("div",{className:"space-y-2",children:_.map((E,P)=>{var M;const T=E.valid_until?Qc(new Date(E.valid_until)):!1;return s.jsx(Fe.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:P*.02},className:`bg-card border rounded-xl p-4 transition-colors ${T?"border-destructive/30":"border-border"}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[E.title&&s.jsx("span",{className:"text-sm font-semibold text-foreground truncate max-w-xs",children:E.title}),E.context_type&&s.jsx(hc,{variant:"outline",className:"text-[10px] capitalize",children:E.context_type.replace(/_/g," ")}),E.subject_type&&s.jsx(hc,{variant:"secondary",className:"text-[10px]",children:dN(E.subject_type)}),E.is_current===!1&&s.jsx(hc,{variant:"outline",className:"text-[10px] text-muted-foreground border-muted",children:"superseded"}),s.jsx(gH,{value:E.confidence_score})]}),E.body&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:E.body}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[((M=E.tags)==null?void 0:M.length)>0&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[s.jsx(MC,{className:"w-3 h-3"}),E.tags.slice(0,4).join(", "),E.tags.length>4&&` +${E.tags.length-4}`]}),s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[s.jsx(Ji,{className:"w-3 h-3"}),lm(new Date(E.created_at),{addSuffix:!0})]}),s.jsx(yH,{date:E.valid_until})]})]}),s.jsxs("div",{className:"flex flex-col gap-1.5 flex-shrink-0",children:[T&&s.jsx(Tr,{variant:"outline",size:"sm",className:"h-6 text-[10px] text-destructive border-destructive/30 hover:bg-destructive/10",onClick:()=>p.mutate(E.id),disabled:p.isPending,children:"Mark reviewed"}),!T&&E.is_current&&s.jsx(er,{className:"w-4 h-4 text-emerald-500 mt-0.5"})]})]})},E.id)})})]})]})}function bH(){return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(zn,{title:"Agents"}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 pb-24 md:pb-6",children:s.jsx(e5,{})})]})}function wH(){const{darkVariant:e}=nt();return O_(),x.useEffect(()=>{const t=document.documentElement;e==="charcoal"?t.classList.add("charcoal"):t.classList.remove("charcoal")},[e]),null}function jH({children:e}){return localStorage.getItem("crmy_token")?s.jsx(s.Fragment,{children:e}):s.jsx(Og,{to:"/login",replace:!0})}function NH(){const e=nr();return s.jsx(Cn,{mode:"wait",children:s.jsx(Fe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15,ease:"easeOut"},className:"flex-1 flex flex-col overflow-hidden",children:s.jsxs(Ig,{location:e,children:[s.jsx(ut,{path:"/",element:s.jsx(fW,{})}),s.jsx(ut,{path:"/contacts",element:s.jsx(NW,{})}),s.jsx(ut,{path:"/accounts",element:s.jsx(SW,{})}),s.jsx(ut,{path:"/opportunities",element:s.jsx(AW,{})}),s.jsx(ut,{path:"/use-cases",element:s.jsx(IW,{})}),s.jsx(ut,{path:"/activities",element:s.jsx(BW,{})}),s.jsx(ut,{path:"/assignments",element:s.jsx(TU,{})}),s.jsx(ut,{path:"/inbox",element:s.jsx(Og,{to:"/assignments",replace:!0})}),s.jsx(ut,{path:"/hitl",element:s.jsx(jU,{})}),s.jsx(ut,{path:"/context",element:s.jsx(vH,{})}),s.jsx(ut,{path:"/agents",element:s.jsx(bH,{})}),s.jsx(ut,{path:"/agent",element:s.jsx(UW,{})}),s.jsx(ut,{path:"/agent/activity",element:s.jsx(GW,{})}),s.jsx(ut,{path:"/settings/*",element:s.jsx(vU,{})}),s.jsx(ut,{path:"*",element:s.jsx(bU,{})})]})},e.pathname)})}function CH(){sW();const{drawerType:e,zenMode:t}=nt(),n=e==="contact"?"Contact Details":e==="opportunity"?"Opportunity Details":e==="use-case"?"Use Case Details":e==="account"?"Account Details":e==="assignment"?"Assignment Details":"";return s.jsxs("div",{className:"flex h-screen w-full overflow-hidden",children:[!t&&s.jsx(q6,{}),s.jsx("main",{className:"flex-1 flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:s.jsx(NH,{})})}),!t&&s.jsx(Y6,{}),s.jsxs($9,{title:n,children:[e==="contact"&&s.jsx($z,{}),e==="opportunity"&&s.jsx(zz,{}),e==="use-case"&&s.jsx(qz,{}),e==="account"&&s.jsx(Gz,{}),e==="assignment"&&s.jsx(rW,{})]}),s.jsx(I9,{}),s.jsx(F9,{}),s.jsx(kz,{}),s.jsx(oW,{})]})}function kH(){return s.jsx(V9,{children:s.jsxs(HD,{children:[s.jsx(dM,{}),s.jsx(n4,{}),s.jsxs(CT,{basename:"/app",children:[s.jsx(wH,{}),s.jsxs(Ig,{children:[s.jsx(ut,{path:"/login",element:s.jsx(cW,{})}),s.jsx(ut,{path:"/*",element:s.jsx(jH,{children:s.jsx(CH,{})})})]})]})]})})}const SH=new mP({defaultOptions:{queries:{staleTime:3e4,retry:1}}});W3.createRoot(document.getElementById("root")).render(s.jsx(fe.StrictMode,{children:s.jsx(hP,{client:SH,children:s.jsx(kH,{})})}));
|