@crmy/web 0.5.5 → 0.5.6
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.
- package/dist/assets/index-CskfWp8E.js +560 -0
- package/dist/assets/index-D763l57m.css +1 -0
- package/{index.html → dist/index.html} +2 -1
- package/package.json +4 -1
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -158
- package/src/api/client.ts +0 -82
- package/src/api/hooks.ts +0 -689
- package/src/components/CustomFields.tsx +0 -240
- package/src/components/NavLink.tsx +0 -28
- package/src/components/crm/AIFab.tsx +0 -37
- package/src/components/crm/AccountDrawer.tsx +0 -372
- package/src/components/crm/ActivityTimeline.tsx +0 -115
- package/src/components/crm/AssignmentDrawer.tsx +0 -396
- package/src/components/crm/BriefingPanel.tsx +0 -217
- package/src/components/crm/CommandPalette.tsx +0 -254
- package/src/components/crm/ContactAvatar.tsx +0 -49
- package/src/components/crm/ContactDrawer.tsx +0 -438
- package/src/components/crm/ContextPanel.tsx +0 -200
- package/src/components/crm/CrmWidgets.tsx +0 -417
- package/src/components/crm/DrawerShell.tsx +0 -77
- package/src/components/crm/ListToolbar.tsx +0 -252
- package/src/components/crm/OpportunityDrawer.tsx +0 -372
- package/src/components/crm/PaginationBar.tsx +0 -111
- package/src/components/crm/QuickAddDrawer.tsx +0 -652
- package/src/components/crm/ShortcutsOverlay.tsx +0 -65
- package/src/components/crm/UseCaseDrawer.tsx +0 -454
- package/src/components/layout/MobileNav.tsx +0 -49
- package/src/components/layout/Sidebar.tsx +0 -157
- package/src/components/layout/TopBar.tsx +0 -54
- package/src/components/settings/ActorsSettings.tsx +0 -1190
- package/src/components/ui/accordion.tsx +0 -52
- package/src/components/ui/alert-dialog.tsx +0 -104
- package/src/components/ui/alert.tsx +0 -43
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.tsx +0 -38
- package/src/components/ui/badge.tsx +0 -29
- package/src/components/ui/breadcrumb.tsx +0 -90
- package/src/components/ui/button.tsx +0 -47
- package/src/components/ui/calendar.tsx +0 -54
- package/src/components/ui/card.tsx +0 -43
- package/src/components/ui/carousel.tsx +0 -224
- package/src/components/ui/chart.tsx +0 -303
- package/src/components/ui/checkbox.tsx +0 -26
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/command.tsx +0 -132
- package/src/components/ui/context-menu.tsx +0 -178
- package/src/components/ui/date-picker.tsx +0 -313
- package/src/components/ui/dialog.tsx +0 -95
- package/src/components/ui/drawer.tsx +0 -87
- package/src/components/ui/dropdown-menu.tsx +0 -179
- package/src/components/ui/form.tsx +0 -129
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/input-otp.tsx +0 -61
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/label.tsx +0 -17
- package/src/components/ui/menubar.tsx +0 -207
- package/src/components/ui/navigation-menu.tsx +0 -120
- package/src/components/ui/pagination.tsx +0 -81
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -23
- package/src/components/ui/radio-group.tsx +0 -36
- package/src/components/ui/resizable.tsx +0 -37
- package/src/components/ui/scroll-area.tsx +0 -38
- package/src/components/ui/select.tsx +0 -143
- package/src/components/ui/separator.tsx +0 -20
- package/src/components/ui/sheet.tsx +0 -107
- package/src/components/ui/sidebar.tsx +0 -637
- package/src/components/ui/skeleton.tsx +0 -7
- package/src/components/ui/slider.tsx +0 -23
- package/src/components/ui/sonner.tsx +0 -24
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -72
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -21
- package/src/components/ui/toast.tsx +0 -111
- package/src/components/ui/toaster.tsx +0 -24
- package/src/components/ui/toggle-group.tsx +0 -49
- package/src/components/ui/toggle.tsx +0 -37
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/components/ui/use-toast.ts +0 -1
- package/src/components/ui/utils.ts +0 -9
- package/src/contexts/AgentSettingsContext.tsx +0 -24
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-toast.ts +0 -186
- package/src/hooks/useKeyboardShortcuts.ts +0 -95
- package/src/hooks/useTheme.ts +0 -24
- package/src/index.css +0 -245
- package/src/lib/entityColors.ts +0 -18
- package/src/lib/stageConfig.ts +0 -32
- package/src/lib/utils.ts +0 -6
- package/src/main.tsx +0 -25
- package/src/pages/Accounts.tsx +0 -205
- package/src/pages/Activities.tsx +0 -251
- package/src/pages/Agent.tsx +0 -237
- package/src/pages/AgentSettings.tsx +0 -544
- package/src/pages/Assignments.tsx +0 -750
- package/src/pages/Contacts.tsx +0 -200
- package/src/pages/Dashboard.tsx +0 -143
- package/src/pages/Inbox.tsx +0 -615
- package/src/pages/NotFound.tsx +0 -24
- package/src/pages/Opportunities.tsx +0 -386
- package/src/pages/SearchResults.tsx +0 -49
- package/src/pages/Settings.tsx +0 -1884
- package/src/pages/UseCases.tsx +0 -396
- package/src/pages/auth/Login.tsx +0 -261
- package/src/pages/hitl/HITL.tsx +0 -101
- package/src/store/appStore.ts +0 -103
- package/src/vite-env.d.ts +0 -14
- package/tailwind.config.js +0 -121
- package/tsconfig.json +0 -24
- package/vite.config.ts +0 -27
- /package/{public → dist}/android-chrome-192x192.png +0 -0
- /package/{public → dist}/android-chrome-512x512.png +0 -0
- /package/{public → dist}/apple-touch-icon.png +0 -0
- /package/{src/assets/crmy-logo.png → dist/assets/crmy-logo-DWN0xBPW.png} +0 -0
- /package/{public → dist}/favicon-16x16.png +0 -0
- /package/{public → dist}/favicon-32x32.png +0 -0
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/favicon.svg +0 -0
- /package/{public → dist}/site.webmanifest +0 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
var c_=Object.defineProperty;var cb=e=>{throw TypeError(e)};var u_=(e,t,n)=>t in e?c_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>u_(e,typeof t!="symbol"?t+"":t,n),Eh=(e,t,n)=>t.has(e)||cb("Cannot "+n);var z=(e,t,n)=>(Eh(e,t,"read from private field"),n?n.call(e):t.get(e)),Ee=(e,t,n)=>t.has(e)?cb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,r)=>(Eh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$e=(e,t,n)=>(Eh(e,t,"access private method"),n);var Hu=(e,t,n,r)=>({set _(a){ge(e,t,a,n)},get _(){return z(e,t,r)}});function d_(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 Ig(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ph={exports:{}},Rl={},Th={exports:{}},Be={};/**
|
|
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 ub;function f_(){if(ub)return Be;ub=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"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(V){return V===null||typeof V!="object"?null:(V=g&&V[g]||V["@@iterator"],typeof V=="function"?V:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,N={};function w(V,O,Q){this.props=V,this.context=O,this.refs=N,this.updater=Q||y}w.prototype.isReactComponent={},w.prototype.setState=function(V,O){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,O,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function _(){}_.prototype=w.prototype;function j(V,O,Q){this.props=V,this.context=O,this.refs=N,this.updater=Q||y}var S=j.prototype=new _;S.constructor=j,k(S,w.prototype),S.isPureReactComponent=!0;var E=Array.isArray,P=Object.prototype.hasOwnProperty,A={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function D(V,O,Q){var re,oe={},de=null,le=null;if(O!=null)for(re in O.ref!==void 0&&(le=O.ref),O.key!==void 0&&(de=""+O.key),O)P.call(O,re)&&!M.hasOwnProperty(re)&&(oe[re]=O[re]);var be=arguments.length-2;if(be===1)oe.children=Q;else if(1<be){for(var we=Array(be),pe=0;pe<be;pe++)we[pe]=arguments[pe+2];oe.children=we}if(V&&V.defaultProps)for(re in be=V.defaultProps,be)oe[re]===void 0&&(oe[re]=be[re]);return{$$typeof:e,type:V,key:de,ref:le,props:oe,_owner:A.current}}function Y(V,O){return{$$typeof:e,type:V.type,key:O,ref:V.ref,props:V.props,_owner:V._owner}}function q(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function F(V){var O={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(Q){return O[Q]})}var B=/\/+/g;function se(V,O){return typeof V=="object"&&V!==null&&V.key!=null?F(""+V.key):O.toString(36)}function G(V,O,Q,re,oe){var de=typeof V;(de==="undefined"||de==="boolean")&&(V=null);var le=!1;if(V===null)le=!0;else switch(de){case"string":case"number":le=!0;break;case"object":switch(V.$$typeof){case e:case t:le=!0}}if(le)return le=V,oe=oe(le),V=re===""?"."+se(le,0):re,E(oe)?(Q="",V!=null&&(Q=V.replace(B,"$&/")+"/"),G(oe,O,Q,"",function(pe){return pe})):oe!=null&&(q(oe)&&(oe=Y(oe,Q+(!oe.key||le&&le.key===oe.key?"":(""+oe.key).replace(B,"$&/")+"/")+V)),O.push(oe)),1;if(le=0,re=re===""?".":re+":",E(V))for(var be=0;be<V.length;be++){de=V[be];var we=re+se(de,be);le+=G(de,O,Q,we,oe)}else if(we=b(V),typeof we=="function")for(V=we.call(V),be=0;!(de=V.next()).done;)de=de.value,we=re+se(de,be++),le+=G(de,O,Q,we,oe);else if(de==="object")throw O=String(V),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return le}function L(V,O,Q){if(V==null)return V;var re=[],oe=0;return G(V,re,"","",function(de){return O.call(Q,de,oe++)}),re}function H(V){if(V._status===-1){var O=V._result;O=O(),O.then(function(Q){(V._status===0||V._status===-1)&&(V._status=1,V._result=Q)},function(Q){(V._status===0||V._status===-1)&&(V._status=2,V._result=Q)}),V._status===-1&&(V._status=0,V._result=O)}if(V._status===1)return V._result.default;throw V._result}var $={current:null},R={transition:null},W={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:R,ReactCurrentOwner:A};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Be.Children={map:L,forEach:function(V,O,Q){L(V,function(){O.apply(this,arguments)},Q)},count:function(V){var O=0;return L(V,function(){O++}),O},toArray:function(V){return L(V,function(O){return O})||[]},only:function(V){if(!q(V))throw Error("React.Children.only expected to receive a single React element child.");return V}},Be.Component=w,Be.Fragment=n,Be.Profiler=a,Be.PureComponent=j,Be.StrictMode=r,Be.Suspense=f,Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,Be.act=Z,Be.cloneElement=function(V,O,Q){if(V==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+V+".");var re=k({},V.props),oe=V.key,de=V.ref,le=V._owner;if(O!=null){if(O.ref!==void 0&&(de=O.ref,le=A.current),O.key!==void 0&&(oe=""+O.key),V.type&&V.type.defaultProps)var be=V.type.defaultProps;for(we in O)P.call(O,we)&&!M.hasOwnProperty(we)&&(re[we]=O[we]===void 0&&be!==void 0?be[we]:O[we])}var we=arguments.length-2;if(we===1)re.children=Q;else if(1<we){be=Array(we);for(var pe=0;pe<we;pe++)be[pe]=arguments[pe+2];re.children=be}return{$$typeof:e,type:V.type,key:oe,ref:de,props:re,_owner:le}},Be.createContext=function(V){return V={$$typeof:c,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},V.Provider={$$typeof:l,_context:V},V.Consumer=V},Be.createElement=D,Be.createFactory=function(V){var O=D.bind(null,V);return O.type=V,O},Be.createRef=function(){return{current:null}},Be.forwardRef=function(V){return{$$typeof:d,render:V}},Be.isValidElement=q,Be.lazy=function(V){return{$$typeof:p,_payload:{_status:-1,_result:V},_init:H}},Be.memo=function(V,O){return{$$typeof:m,type:V,compare:O===void 0?null:O}},Be.startTransition=function(V){var O=R.transition;R.transition={};try{V()}finally{R.transition=O}},Be.unstable_act=Z,Be.useCallback=function(V,O){return $.current.useCallback(V,O)},Be.useContext=function(V){return $.current.useContext(V)},Be.useDebugValue=function(){},Be.useDeferredValue=function(V){return $.current.useDeferredValue(V)},Be.useEffect=function(V,O){return $.current.useEffect(V,O)},Be.useId=function(){return $.current.useId()},Be.useImperativeHandle=function(V,O,Q){return $.current.useImperativeHandle(V,O,Q)},Be.useInsertionEffect=function(V,O){return $.current.useInsertionEffect(V,O)},Be.useLayoutEffect=function(V,O){return $.current.useLayoutEffect(V,O)},Be.useMemo=function(V,O){return $.current.useMemo(V,O)},Be.useReducer=function(V,O,Q){return $.current.useReducer(V,O,Q)},Be.useRef=function(V){return $.current.useRef(V)},Be.useState=function(V){return $.current.useState(V)},Be.useSyncExternalStore=function(V,O,Q){return $.current.useSyncExternalStore(V,O,Q)},Be.useTransition=function(){return $.current.useTransition()},Be.version="18.3.1",Be}var db;function Fg(){return db||(db=1,Th.exports=f_()),Th.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 fb;function m_(){if(fb)return Rl;fb=1;var e=Fg(),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(d,f,m){var p,g={},b=null,y=null;m!==void 0&&(b=""+m),f.key!==void 0&&(b=""+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(d&&d.defaultProps)for(p in f=d.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:t,type:d,key:b,ref:y,props:g,_owner:a.current}}return Rl.Fragment=n,Rl.jsx=c,Rl.jsxs=c,Rl}var mb;function h_(){return mb||(mb=1,Ph.exports=m_()),Ph.exports}var s=h_(),x=Fg();const ue=Ig(x),lf=d_({__proto__:null,default:ue},[x]);var qu={},Ah={exports:{}},En={},Mh={exports:{}},Dh={};/**
|
|
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 hb;function p_(){return hb||(hb=1,(function(e){function t(R,W){var Z=R.length;R.push(W);e:for(;0<Z;){var V=Z-1>>>1,O=R[V];if(0<a(O,W))R[V]=W,R[Z]=O,Z=V;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var W=R[0],Z=R.pop();if(Z!==W){R[0]=Z;e:for(var V=0,O=R.length,Q=O>>>1;V<Q;){var re=2*(V+1)-1,oe=R[re],de=re+1,le=R[de];if(0>a(oe,Z))de<O&&0>a(le,oe)?(R[V]=le,R[de]=Z,V=de):(R[V]=oe,R[re]=Z,V=re);else if(de<O&&0>a(le,Z))R[V]=le,R[de]=Z,V=de;else break e}}return W}function a(R,W){var Z=R.sortIndex-W.sortIndex;return Z!==0?Z:R.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],m=[],p=1,g=null,b=3,y=!1,k=!1,N=!1,w=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,j=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 W=n(m);W!==null;){if(W.callback===null)r(m);else if(W.startTime<=R)r(m),W.sortIndex=W.expirationTime,t(f,W);else break;W=n(m)}}function E(R){if(N=!1,S(R),!k)if(n(f)!==null)k=!0,H(P);else{var W=n(m);W!==null&&$(E,W.startTime-R)}}function P(R,W){k=!1,N&&(N=!1,_(D),D=-1),y=!0;var Z=b;try{for(S(W),g=n(f);g!==null&&(!(g.expirationTime>W)||R&&!F());){var V=g.callback;if(typeof V=="function"){g.callback=null,b=g.priorityLevel;var O=V(g.expirationTime<=W);W=e.unstable_now(),typeof O=="function"?g.callback=O:g===n(f)&&r(f),S(W)}else r(f);g=n(f)}if(g!==null)var Q=!0;else{var re=n(m);re!==null&&$(E,re.startTime-W),Q=!1}return Q}finally{g=null,b=Z,y=!1}}var A=!1,M=null,D=-1,Y=5,q=-1;function F(){return!(e.unstable_now()-q<Y)}function B(){if(M!==null){var R=e.unstable_now();q=R;var W=!0;try{W=M(!0,R)}finally{W?se():(A=!1,M=null)}}else A=!1}var se;if(typeof j=="function")se=function(){j(B)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,L=G.port2;G.port1.onmessage=B,se=function(){L.postMessage(null)}}else se=function(){w(B,0)};function H(R){M=R,A||(A=!0,se())}function $(R,W){D=w(function(){R(e.unstable_now())},W)}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,H(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"):Y=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(R){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var Z=b;b=W;try{return R()}finally{b=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,W){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var Z=b;b=R;try{return W()}finally{b=Z}},e.unstable_scheduleCallback=function(R,W,Z){var V=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?V+Z:V):Z=V,R){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Z+O,R={id:p++,callback:W,priorityLevel:R,startTime:Z,expirationTime:O,sortIndex:-1},Z>V?(R.sortIndex=Z,t(m,R),n(f)===null&&R===n(m)&&(N?(_(D),D=-1):N=!0,$(E,Z-V))):(R.sortIndex=O,t(f,R),k||y||(k=!0,H(P))),R},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(R){var W=b;return function(){var Z=b;b=W;try{return R.apply(this,arguments)}finally{b=Z}}}})(Dh)),Dh}var pb;function g_(){return pb||(pb=1,Mh.exports=p_()),Mh.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 gb;function x_(){if(gb)return En;gb=1;var e=Fg(),t=g_();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u]);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 d=!(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 b(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,u,h){if(u!==null&&u.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function k(o,i,u,h){if(i===null||typeof i>"u"||y(o,i,u,h))return!0;if(h)return!1;if(u!==null)switch(u.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 N(o,i,u,h,v,C,T){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=v,this.mustUseProperty=u,this.propertyName=o,this.type=i,this.sanitizeURL=C,this.removeEmptyString=T}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new N(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var i=o[0];w[i]=new N(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new N(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new N(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){w[o]=new N(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new N(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new N(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new N(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new N(o,5,!1,o.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function j(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(_,j);w[i]=new N(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(_,j);w[i]=new N(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(_,j);w[i]=new N(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new N(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new N(o,1,!1,o.toLowerCase(),null,!0,!0)});function S(o,i,u,h){var v=w.hasOwnProperty(i)?w[i]:null;(v!==null?v.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(k(i,u,v,h)&&(u=null),h||v===null?b(i)&&(u===null?o.removeAttribute(i):o.setAttribute(i,""+u)):v.mustUseProperty?o[v.propertyName]=u===null?v.type===3?!1:"":u:(i=v.attributeName,h=v.attributeNamespace,u===null?o.removeAttribute(i):(v=v.type,u=v===3||v===4&&u===!0?"":""+u,h?o.setAttributeNS(h,i,u):o.setAttribute(i,u))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),A=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),F=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),R=Symbol.iterator;function W(o){return o===null||typeof o!="object"?null:(o=R&&o[R]||o["@@iterator"],typeof o=="function"?o:null)}var Z=Object.assign,V;function O(o){if(V===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);V=i&&i[1]||""}return`
|
|
34
|
+
`+V+o}var Q=!1;function re(o,i){if(!o||Q)return"";Q=!0;var u=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(ne){var h=ne}Reflect.construct(o,[],i)}else{try{i.call()}catch(ne){h=ne}o.call(i.prototype)}else{try{throw Error()}catch(ne){h=ne}o()}}catch(ne){if(ne&&h&&typeof ne.stack=="string"){for(var v=ne.stack.split(`
|
|
35
|
+
`),C=h.stack.split(`
|
|
36
|
+
`),T=v.length-1,I=C.length-1;1<=T&&0<=I&&v[T]!==C[I];)I--;for(;1<=T&&0<=I;T--,I--)if(v[T]!==C[I]){if(T!==1||I!==1)do if(T--,I--,0>I||v[T]!==C[I]){var U=`
|
|
37
|
+
`+v[T].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=T&&0<=I);break}}}finally{Q=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?O(o):""}function oe(o){switch(o.tag){case 5:return O(o.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return o=re(o.type,!1),o;case 11:return o=re(o.type.render,!1),o;case 1:return o=re(o.type,!0),o;default:return""}}function de(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 A:return"Portal";case Y:return"Profiler";case D:return"StrictMode";case se:return"Suspense";case G:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case F:return(o.displayName||"Context")+".Consumer";case q:return(o._context.displayName||"Context")+".Provider";case B:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case L:return i=o.displayName||null,i!==null?i:de(o.type)||"Memo";case H:i=o._payload,o=o._init;try{return de(o(i))}catch{}}return null}function le(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 de(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 be(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function we(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function pe(o){var i=we(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),h=""+o[i];if(!o.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var v=u.get,C=u.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return v.call(this)},set:function(T){h=""+T,C.call(this,T)}}),Object.defineProperty(o,i,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function mt(o){o._valueTracker||(o._valueTracker=pe(o))}function on(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return o&&(h=we(o)?o.checked?"true":"false":o.value),o=h,o!==u?(i.setValue(o),!0):!1}function Dt(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 In(o,i){var u=i.checked;return Z({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function Fn(o,i){var u=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;u=be(i.value!=null?i.value:u),o._wrapperState={initialChecked:h,initialValue:u,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function $n(o,i){i=i.checked,i!=null&&S(o,"checked",i,!1)}function vn(o,i){$n(o,i);var u=be(i.value),h=i.type;if(u!=null)h==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(h==="submit"||h==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?an(o,i.type,u):i.hasOwnProperty("defaultValue")&&an(o,i.type,be(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function Vn(o,i,u){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,u||i===o.value||(o.value=i),o.defaultValue=i}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function an(o,i,u){(i!=="number"||Dt(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var lt=Array.isArray;function X(o,i,u,h){if(o=o.options,i){i={};for(var v=0;v<u.length;v++)i["$"+u[v]]=!0;for(u=0;u<o.length;u++)v=i.hasOwnProperty("$"+o[u].value),o[u].selected!==v&&(o[u].selected=v),v&&h&&(o[u].defaultSelected=!0)}else{for(u=""+be(u),i=null,v=0;v<o.length;v++){if(o[v].value===u){o[v].selected=!0,h&&(o[v].defaultSelected=!0);return}i!==null||o[v].disabled||(i=o[v])}i!==null&&(i.selected=!0)}}function _e(o,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},i,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function Ue(o,i){var u=i.value;if(u==null){if(u=i.children,i=i.defaultValue,u!=null){if(i!=null)throw Error(n(92));if(lt(u)){if(1<u.length)throw Error(n(93));u=u[0]}i=u}i==null&&(i=""),u=i}o._wrapperState={initialValue:be(u)}}function et(o,i){var u=be(i.value),h=be(i.defaultValue);u!=null&&(u=""+u,u!==o.value&&(o.value=u),i.defaultValue==null&&o.defaultValue!==u&&(o.defaultValue=u)),h!=null&&(o.defaultValue=""+h)}function Tt(o){var i=o.textContent;i===o._wrapperState.initialValue&&i!==""&&i!==null&&(o.value=i)}function ct(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 Ut(o,i){return o==null||o==="http://www.w3.org/1999/xhtml"?ct(i):o==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var as,te=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,u,h,v){MSApp.execUnsafeLocalFunction(function(){return o(i,u,h,v)})}:o})(function(o,i){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=i;else{for(as=as||document.createElement("div"),as.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=as.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;i.firstChild;)o.appendChild(i.firstChild)}});function Ce(o,i){if(i){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=i;return}}o.textContent=i}var Te={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},ln=["Webkit","ms","Moz","O"];Object.keys(Te).forEach(function(o){ln.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),Te[i]=Te[o]})});function bn(o,i,u){return i==null||typeof i=="boolean"||i===""?"":u||typeof i!="number"||i===0||Te.hasOwnProperty(o)&&Te[o]?(""+i).trim():i+"px"}function is(o,i){o=o.style;for(var u in i)if(i.hasOwnProperty(u)){var h=u.indexOf("--")===0,v=bn(u,i[u],h);u==="float"&&(u="cssFloat"),h?o.setProperty(u,v):o[u]=v}}var Lc=Z({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 Rr(o,i){if(i){if(Lc[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 Zi(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 Ji=null;function Ma(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Da=null,Rs=null,Or=null;function ir(o){if(o=vl(o)){if(typeof Da!="function")throw Error(n(280));var i=o.stateNode;i&&(i=au(i),Da(o.stateNode,o.type,i))}}function Ic(o){Rs?Or?Or.push(o):Or=[o]:Rs=o}function Le(){if(Rs){var o=Rs,i=Or;if(Or=Rs=null,ir(o),i)for(o=0;o<i.length;o++)ir(i[o])}}function Ge(o,i){return o(i)}function rt(){}var cn=!1;function wn(o,i,u){if(cn)return o(i,u);cn=!0;try{return Ge(o,i,u)}finally{cn=!1,(Rs!==null||Or!==null)&&(rt(),Le())}}function jn(o,i){var u=o.stateNode;if(u===null)return null;var h=au(u);if(h===null)return null;u=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(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var lr=!1;if(d)try{var Ht={};Object.defineProperty(Ht,"passive",{get:function(){lr=!0}}),window.addEventListener("test",Ht,Ht),window.removeEventListener("test",Ht,Ht)}catch{lr=!1}function Lr(o,i,u,h,v,C,T,I,U){var ne=Array.prototype.slice.call(arguments,3);try{i.apply(u,ne)}catch(ie){this.onError(ie)}}var el=!1,Fc=null,$c=!1,Kf=null,g5={onError:function(o){el=!0,Fc=o}};function x5(o,i,u,h,v,C,T,I,U){el=!1,Fc=null,Lr.apply(g5,arguments)}function y5(o,i,u,h,v,C,T,I,U){if(x5.apply(this,arguments),el){if(el){var ne=Fc;el=!1,Fc=null}else throw Error(n(198));$c||($c=!0,Kf=ne)}}function Bo(o){var i=o,u=o;if(o.alternate)for(;i.return;)i=i.return;else{o=i;do i=o,(i.flags&4098)!==0&&(u=i.return),o=i.return;while(o)}return i.tag===3?u:null}function My(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 Dy(o){if(Bo(o)!==o)throw Error(n(188))}function v5(o){var i=o.alternate;if(!i){if(i=Bo(o),i===null)throw Error(n(188));return i!==o?null:o}for(var u=o,h=i;;){var v=u.return;if(v===null)break;var C=v.alternate;if(C===null){if(h=v.return,h!==null){u=h;continue}break}if(v.child===C.child){for(C=v.child;C;){if(C===u)return Dy(v),o;if(C===h)return Dy(v),i;C=C.sibling}throw Error(n(188))}if(u.return!==h.return)u=v,h=C;else{for(var T=!1,I=v.child;I;){if(I===u){T=!0,u=v,h=C;break}if(I===h){T=!0,h=v,u=C;break}I=I.sibling}if(!T){for(I=C.child;I;){if(I===u){T=!0,u=C,h=v;break}if(I===h){T=!0,h=C,u=v;break}I=I.sibling}if(!T)throw Error(n(189))}}if(u.alternate!==h)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?o:i}function Ry(o){return o=v5(o),o!==null?Oy(o):null}function Oy(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var i=Oy(o);if(i!==null)return i;o=o.sibling}return null}var Ly=t.unstable_scheduleCallback,Iy=t.unstable_cancelCallback,b5=t.unstable_shouldYield,w5=t.unstable_requestPaint,Ct=t.unstable_now,j5=t.unstable_getCurrentPriorityLevel,Yf=t.unstable_ImmediatePriority,Fy=t.unstable_UserBlockingPriority,Vc=t.unstable_NormalPriority,N5=t.unstable_LowPriority,$y=t.unstable_IdlePriority,Bc=null,Ir=null;function C5(o){if(Ir&&typeof Ir.onCommitFiberRoot=="function")try{Ir.onCommitFiberRoot(Bc,o,void 0,(o.current.flags&128)===128)}catch{}}var cr=Math.clz32?Math.clz32:_5,k5=Math.log,S5=Math.LN2;function _5(o){return o>>>=0,o===0?32:31-(k5(o)/S5|0)|0}var zc=64,Wc=4194304;function tl(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 Uc(o,i){var u=o.pendingLanes;if(u===0)return 0;var h=0,v=o.suspendedLanes,C=o.pingedLanes,T=u&268435455;if(T!==0){var I=T&~v;I!==0?h=tl(I):(C&=T,C!==0&&(h=tl(C)))}else T=u&~v,T!==0?h=tl(T):C!==0&&(h=tl(C));if(h===0)return 0;if(i!==0&&i!==h&&(i&v)===0&&(v=h&-h,C=i&-i,v>=C||v===16&&(C&4194240)!==0))return i;if((h&4)!==0&&(h|=u&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=h;0<i;)u=31-cr(i),v=1<<u,h|=o[u],i&=~v;return h}function E5(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 P5(o,i){for(var u=o.suspendedLanes,h=o.pingedLanes,v=o.expirationTimes,C=o.pendingLanes;0<C;){var T=31-cr(C),I=1<<T,U=v[T];U===-1?((I&u)===0||(I&h)!==0)&&(v[T]=E5(I,i)):U<=i&&(o.expiredLanes|=I),C&=~I}}function Qf(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Vy(){var o=zc;return zc<<=1,(zc&4194240)===0&&(zc=64),o}function Gf(o){for(var i=[],u=0;31>u;u++)i.push(o);return i}function nl(o,i,u){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-cr(i),o[i]=u}function T5(o,i){var u=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<u;){var v=31-cr(u),C=1<<v;i[v]=0,h[v]=-1,o[v]=-1,u&=~C}}function Xf(o,i){var u=o.entangledLanes|=i;for(o=o.entanglements;u;){var h=31-cr(u),v=1<<h;v&i|o[h]&i&&(o[h]|=i),u&=~v}}var tt=0;function By(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var zy,Zf,Wy,Uy,Hy,Jf=!1,Hc=[],Os=null,Ls=null,Is=null,rl=new Map,sl=new Map,Fs=[],A5="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 qy(o,i){switch(o){case"focusin":case"focusout":Os=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":rl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":sl.delete(i.pointerId)}}function ol(o,i,u,h,v,C){return o===null||o.nativeEvent!==C?(o={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:C,targetContainers:[v]},i!==null&&(i=vl(i),i!==null&&Zf(i)),o):(o.eventSystemFlags|=h,i=o.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),o)}function M5(o,i,u,h,v){switch(i){case"focusin":return Os=ol(Os,o,i,u,h,v),!0;case"dragenter":return Ls=ol(Ls,o,i,u,h,v),!0;case"mouseover":return Is=ol(Is,o,i,u,h,v),!0;case"pointerover":var C=v.pointerId;return rl.set(C,ol(rl.get(C)||null,o,i,u,h,v)),!0;case"gotpointercapture":return C=v.pointerId,sl.set(C,ol(sl.get(C)||null,o,i,u,h,v)),!0}return!1}function Ky(o){var i=zo(o.target);if(i!==null){var u=Bo(i);if(u!==null){if(i=u.tag,i===13){if(i=My(u),i!==null){o.blockedOn=i,Hy(o.priority,function(){Wy(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function qc(o){if(o.blockedOn!==null)return!1;for(var i=o.targetContainers;0<i.length;){var u=tm(o.domEventName,o.eventSystemFlags,i[0],o.nativeEvent);if(u===null){u=o.nativeEvent;var h=new u.constructor(u.type,u);Ji=h,u.target.dispatchEvent(h),Ji=null}else return i=vl(u),i!==null&&Zf(i),o.blockedOn=u,!1;i.shift()}return!0}function Yy(o,i,u){qc(o)&&u.delete(i)}function D5(){Jf=!1,Os!==null&&qc(Os)&&(Os=null),Ls!==null&&qc(Ls)&&(Ls=null),Is!==null&&qc(Is)&&(Is=null),rl.forEach(Yy),sl.forEach(Yy)}function al(o,i){o.blockedOn===i&&(o.blockedOn=null,Jf||(Jf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D5)))}function il(o){function i(v){return al(v,o)}if(0<Hc.length){al(Hc[0],o);for(var u=1;u<Hc.length;u++){var h=Hc[u];h.blockedOn===o&&(h.blockedOn=null)}}for(Os!==null&&al(Os,o),Ls!==null&&al(Ls,o),Is!==null&&al(Is,o),rl.forEach(i),sl.forEach(i),u=0;u<Fs.length;u++)h=Fs[u],h.blockedOn===o&&(h.blockedOn=null);for(;0<Fs.length&&(u=Fs[0],u.blockedOn===null);)Ky(u),u.blockedOn===null&&Fs.shift()}var Ra=E.ReactCurrentBatchConfig,Kc=!0;function R5(o,i,u,h){var v=tt,C=Ra.transition;Ra.transition=null;try{tt=1,em(o,i,u,h)}finally{tt=v,Ra.transition=C}}function O5(o,i,u,h){var v=tt,C=Ra.transition;Ra.transition=null;try{tt=4,em(o,i,u,h)}finally{tt=v,Ra.transition=C}}function em(o,i,u,h){if(Kc){var v=tm(o,i,u,h);if(v===null)ym(o,i,h,Yc,u),qy(o,h);else if(M5(v,o,i,u,h))h.stopPropagation();else if(qy(o,h),i&4&&-1<A5.indexOf(o)){for(;v!==null;){var C=vl(v);if(C!==null&&zy(C),C=tm(o,i,u,h),C===null&&ym(o,i,h,Yc,u),C===v)break;v=C}v!==null&&h.stopPropagation()}else ym(o,i,h,null,u)}}var Yc=null;function tm(o,i,u,h){if(Yc=null,o=Ma(h),o=zo(o),o!==null)if(i=Bo(o),i===null)o=null;else if(u=i.tag,u===13){if(o=My(i),o!==null)return o;o=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null);return Yc=o,null}function Qy(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(j5()){case Yf:return 1;case Fy:return 4;case Vc:case N5:return 16;case $y:return 536870912;default:return 16}default:return 16}}var $s=null,nm=null,Qc=null;function Gy(){if(Qc)return Qc;var o,i=nm,u=i.length,h,v="value"in $s?$s.value:$s.textContent,C=v.length;for(o=0;o<u&&i[o]===v[o];o++);var T=u-o;for(h=1;h<=T&&i[u-h]===v[C-h];h++);return Qc=v.slice(o,1<h?1-h:void 0)}function Gc(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 Xc(){return!0}function Xy(){return!1}function Bn(o){function i(u,h,v,C,T){this._reactName=u,this._targetInst=v,this.type=h,this.nativeEvent=C,this.target=T,this.currentTarget=null;for(var I in o)o.hasOwnProperty(I)&&(u=o[I],this[I]=u?u(C):C[I]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Xc:Xy,this.isPropagationStopped=Xy,this}return Z(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Xc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Xc)},persist:function(){},isPersistent:Xc}),i}var Oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=Bn(Oa),ll=Z({},Oa,{view:0,detail:0}),L5=Bn(ll),sm,om,cl,Zc=Z({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:im,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!==cl&&(cl&&o.type==="mousemove"?(sm=o.screenX-cl.screenX,om=o.screenY-cl.screenY):om=sm=0,cl=o),sm)},movementY:function(o){return"movementY"in o?o.movementY:om}}),Zy=Bn(Zc),I5=Z({},Zc,{dataTransfer:0}),F5=Bn(I5),$5=Z({},ll,{relatedTarget:0}),am=Bn($5),V5=Z({},Oa,{animationName:0,elapsedTime:0,pseudoElement:0}),B5=Bn(V5),z5=Z({},Oa,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),W5=Bn(z5),U5=Z({},Oa,{data:0}),Jy=Bn(U5),H5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q5={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"},K5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y5(o){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(o):(o=K5[o])?!!i[o]:!1}function im(){return Y5}var Q5=Z({},ll,{key:function(o){if(o.key){var i=H5[o.key]||o.key;if(i!=="Unidentified")return i}return o.type==="keypress"?(o=Gc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?q5[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:im,charCode:function(o){return o.type==="keypress"?Gc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Gc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),G5=Bn(Q5),X5=Z({},Zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ev=Bn(X5),Z5=Z({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:im}),J5=Bn(Z5),e3=Z({},Oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),t3=Bn(e3),n3=Z({},Zc,{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}),r3=Bn(n3),s3=[9,13,27,32],lm=d&&"CompositionEvent"in window,ul=null;d&&"documentMode"in document&&(ul=document.documentMode);var o3=d&&"TextEvent"in window&&!ul,tv=d&&(!lm||ul&&8<ul&&11>=ul),nv=" ",rv=!1;function sv(o,i){switch(o){case"keyup":return s3.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ov(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var La=!1;function a3(o,i){switch(o){case"compositionend":return ov(i);case"keypress":return i.which!==32?null:(rv=!0,nv);case"textInput":return o=i.data,o===nv&&rv?null:o;default:return null}}function i3(o,i){if(La)return o==="compositionend"||!lm&&sv(o,i)?(o=Gy(),Qc=nm=$s=null,La=!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 tv&&i.locale!=="ko"?null:i.data;default:return null}}var l3={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 av(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i==="input"?!!l3[o.type]:i==="textarea"}function iv(o,i,u,h){Ic(h),i=ru(i,"onChange"),0<i.length&&(u=new rm("onChange","change",null,u,h),o.push({event:u,listeners:i}))}var dl=null,fl=null;function c3(o){kv(o,0)}function Jc(o){var i=Ba(o);if(on(i))return o}function u3(o,i){if(o==="change")return i}var lv=!1;if(d){var cm;if(d){var um="oninput"in document;if(!um){var cv=document.createElement("div");cv.setAttribute("oninput","return;"),um=typeof cv.oninput=="function"}cm=um}else cm=!1;lv=cm&&(!document.documentMode||9<document.documentMode)}function uv(){dl&&(dl.detachEvent("onpropertychange",dv),fl=dl=null)}function dv(o){if(o.propertyName==="value"&&Jc(fl)){var i=[];iv(i,fl,o,Ma(o)),wn(c3,i)}}function d3(o,i,u){o==="focusin"?(uv(),dl=i,fl=u,dl.attachEvent("onpropertychange",dv)):o==="focusout"&&uv()}function f3(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Jc(fl)}function m3(o,i){if(o==="click")return Jc(i)}function h3(o,i){if(o==="input"||o==="change")return Jc(i)}function p3(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var ur=typeof Object.is=="function"?Object.is:p3;function ml(o,i){if(ur(o,i))return!0;if(typeof o!="object"||o===null||typeof i!="object"||i===null)return!1;var u=Object.keys(o),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var v=u[h];if(!f.call(i,v)||!ur(o[v],i[v]))return!1}return!0}function fv(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mv(o,i){var u=fv(o);o=0;for(var h;u;){if(u.nodeType===3){if(h=o+u.textContent.length,o<=i&&h>=i)return{node:u,offset:i-o};o=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=fv(u)}}function hv(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?hv(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function pv(){for(var o=window,i=Dt();i instanceof o.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)o=i.contentWindow;else break;i=Dt(o.document)}return i}function dm(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 g3(o){var i=pv(),u=o.focusedElem,h=o.selectionRange;if(i!==u&&u&&u.ownerDocument&&hv(u.ownerDocument.documentElement,u)){if(h!==null&&dm(u)){if(i=h.start,o=h.end,o===void 0&&(o=i),"selectionStart"in u)u.selectionStart=i,u.selectionEnd=Math.min(o,u.value.length);else if(o=(i=u.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var v=u.textContent.length,C=Math.min(h.start,v);h=h.end===void 0?C:Math.min(h.end,v),!o.extend&&C>h&&(v=h,h=C,C=v),v=mv(u,C);var T=mv(u,h);v&&T&&(o.rangeCount!==1||o.anchorNode!==v.node||o.anchorOffset!==v.offset||o.focusNode!==T.node||o.focusOffset!==T.offset)&&(i=i.createRange(),i.setStart(v.node,v.offset),o.removeAllRanges(),C>h?(o.addRange(i),o.extend(T.node,T.offset)):(i.setEnd(T.node,T.offset),o.addRange(i)))}}for(i=[],o=u;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<i.length;u++)o=i[u],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var x3=d&&"documentMode"in document&&11>=document.documentMode,Ia=null,fm=null,hl=null,mm=!1;function gv(o,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;mm||Ia==null||Ia!==Dt(h)||(h=Ia,"selectionStart"in h&&dm(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}),hl&&ml(hl,h)||(hl=h,h=ru(fm,"onSelect"),0<h.length&&(i=new rm("onSelect","select",null,i,u),o.push({event:i,listeners:h}),i.target=Ia)))}function eu(o,i){var u={};return u[o.toLowerCase()]=i.toLowerCase(),u["Webkit"+o]="webkit"+i,u["Moz"+o]="moz"+i,u}var Fa={animationend:eu("Animation","AnimationEnd"),animationiteration:eu("Animation","AnimationIteration"),animationstart:eu("Animation","AnimationStart"),transitionend:eu("Transition","TransitionEnd")},hm={},xv={};d&&(xv=document.createElement("div").style,"AnimationEvent"in window||(delete Fa.animationend.animation,delete Fa.animationiteration.animation,delete Fa.animationstart.animation),"TransitionEvent"in window||delete Fa.transitionend.transition);function tu(o){if(hm[o])return hm[o];if(!Fa[o])return o;var i=Fa[o],u;for(u in i)if(i.hasOwnProperty(u)&&u in xv)return hm[o]=i[u];return o}var yv=tu("animationend"),vv=tu("animationiteration"),bv=tu("animationstart"),wv=tu("transitionend"),jv=new Map,Nv="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 Vs(o,i){jv.set(o,i),l(i,[o])}for(var pm=0;pm<Nv.length;pm++){var gm=Nv[pm],y3=gm.toLowerCase(),v3=gm[0].toUpperCase()+gm.slice(1);Vs(y3,"on"+v3)}Vs(yv,"onAnimationEnd"),Vs(vv,"onAnimationIteration"),Vs(bv,"onAnimationStart"),Vs("dblclick","onDoubleClick"),Vs("focusin","onFocus"),Vs("focusout","onBlur"),Vs(wv,"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 pl="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(" "),b3=new Set("cancel close invalid load scroll toggle".split(" ").concat(pl));function Cv(o,i,u){var h=o.type||"unknown-event";o.currentTarget=u,y5(h,i,void 0,o),o.currentTarget=null}function kv(o,i){i=(i&4)!==0;for(var u=0;u<o.length;u++){var h=o[u],v=h.event;h=h.listeners;e:{var C=void 0;if(i)for(var T=h.length-1;0<=T;T--){var I=h[T],U=I.instance,ne=I.currentTarget;if(I=I.listener,U!==C&&v.isPropagationStopped())break e;Cv(v,I,ne),C=U}else for(T=0;T<h.length;T++){if(I=h[T],U=I.instance,ne=I.currentTarget,I=I.listener,U!==C&&v.isPropagationStopped())break e;Cv(v,I,ne),C=U}}}if($c)throw o=Kf,$c=!1,Kf=null,o}function ut(o,i){var u=i[Cm];u===void 0&&(u=i[Cm]=new Set);var h=o+"__bubble";u.has(h)||(Sv(i,o,2,!1),u.add(h))}function xm(o,i,u){var h=0;i&&(h|=4),Sv(u,o,h,i)}var nu="_reactListening"+Math.random().toString(36).slice(2);function gl(o){if(!o[nu]){o[nu]=!0,r.forEach(function(u){u!=="selectionchange"&&(b3.has(u)||xm(u,!1,o),xm(u,!0,o))});var i=o.nodeType===9?o:o.ownerDocument;i===null||i[nu]||(i[nu]=!0,xm("selectionchange",!1,i))}}function Sv(o,i,u,h){switch(Qy(i)){case 1:var v=R5;break;case 4:v=O5;break;default:v=em}u=v.bind(null,i,u,o),v=void 0,!lr||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),h?v!==void 0?o.addEventListener(i,u,{capture:!0,passive:v}):o.addEventListener(i,u,!0):v!==void 0?o.addEventListener(i,u,{passive:v}):o.addEventListener(i,u,!1)}function ym(o,i,u,h,v){var C=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var T=h.tag;if(T===3||T===4){var I=h.stateNode.containerInfo;if(I===v||I.nodeType===8&&I.parentNode===v)break;if(T===4)for(T=h.return;T!==null;){var U=T.tag;if((U===3||U===4)&&(U=T.stateNode.containerInfo,U===v||U.nodeType===8&&U.parentNode===v))return;T=T.return}for(;I!==null;){if(T=zo(I),T===null)return;if(U=T.tag,U===5||U===6){h=C=T;continue e}I=I.parentNode}}h=h.return}wn(function(){var ne=C,ie=Ma(u),ce=[];e:{var ae=jv.get(o);if(ae!==void 0){var xe=rm,je=o;switch(o){case"keypress":if(Gc(u)===0)break e;case"keydown":case"keyup":xe=G5;break;case"focusin":je="focus",xe=am;break;case"focusout":je="blur",xe=am;break;case"beforeblur":case"afterblur":xe=am;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Zy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=F5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=J5;break;case yv:case vv:case bv:xe=B5;break;case wv:xe=t3;break;case"scroll":xe=L5;break;case"wheel":xe=r3;break;case"copy":case"cut":case"paste":xe=W5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=ev}var ke=(i&4)!==0,kt=!ke&&o==="scroll",J=ke?ae!==null?ae+"Capture":null:ae;ke=[];for(var K=ne,ee;K!==null;){ee=K;var fe=ee.stateNode;if(ee.tag===5&&fe!==null&&(ee=fe,J!==null&&(fe=jn(K,J),fe!=null&&ke.push(xl(K,fe,ee)))),kt)break;K=K.return}0<ke.length&&(ae=new xe(ae,je,null,u,ie),ce.push({event:ae,listeners:ke}))}}if((i&7)===0){e:{if(ae=o==="mouseover"||o==="pointerover",xe=o==="mouseout"||o==="pointerout",ae&&u!==Ji&&(je=u.relatedTarget||u.fromElement)&&(zo(je)||je[ls]))break e;if((xe||ae)&&(ae=ie.window===ie?ie:(ae=ie.ownerDocument)?ae.defaultView||ae.parentWindow:window,xe?(je=u.relatedTarget||u.toElement,xe=ne,je=je?zo(je):null,je!==null&&(kt=Bo(je),je!==kt||je.tag!==5&&je.tag!==6)&&(je=null)):(xe=null,je=ne),xe!==je)){if(ke=Zy,fe="onMouseLeave",J="onMouseEnter",K="mouse",(o==="pointerout"||o==="pointerover")&&(ke=ev,fe="onPointerLeave",J="onPointerEnter",K="pointer"),kt=xe==null?ae:Ba(xe),ee=je==null?ae:Ba(je),ae=new ke(fe,K+"leave",xe,u,ie),ae.target=kt,ae.relatedTarget=ee,fe=null,zo(ie)===ne&&(ke=new ke(J,K+"enter",je,u,ie),ke.target=ee,ke.relatedTarget=kt,fe=ke),kt=fe,xe&&je)t:{for(ke=xe,J=je,K=0,ee=ke;ee;ee=$a(ee))K++;for(ee=0,fe=J;fe;fe=$a(fe))ee++;for(;0<K-ee;)ke=$a(ke),K--;for(;0<ee-K;)J=$a(J),ee--;for(;K--;){if(ke===J||J!==null&&ke===J.alternate)break t;ke=$a(ke),J=$a(J)}ke=null}else ke=null;xe!==null&&_v(ce,ae,xe,ke,!1),je!==null&&kt!==null&&_v(ce,kt,je,ke,!0)}}e:{if(ae=ne?Ba(ne):window,xe=ae.nodeName&&ae.nodeName.toLowerCase(),xe==="select"||xe==="input"&&ae.type==="file")var Se=u3;else if(av(ae))if(lv)Se=h3;else{Se=f3;var Me=d3}else(xe=ae.nodeName)&&xe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Se=m3);if(Se&&(Se=Se(o,ne))){iv(ce,Se,u,ie);break e}Me&&Me(o,ae,ne),o==="focusout"&&(Me=ae._wrapperState)&&Me.controlled&&ae.type==="number"&&an(ae,"number",ae.value)}switch(Me=ne?Ba(ne):window,o){case"focusin":(av(Me)||Me.contentEditable==="true")&&(Ia=Me,fm=ne,hl=null);break;case"focusout":hl=fm=Ia=null;break;case"mousedown":mm=!0;break;case"contextmenu":case"mouseup":case"dragend":mm=!1,gv(ce,u,ie);break;case"selectionchange":if(x3)break;case"keydown":case"keyup":gv(ce,u,ie)}var De;if(lm)e:{switch(o){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else La?sv(o,u)&&(Oe="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(Oe="onCompositionStart");Oe&&(tv&&u.locale!=="ko"&&(La||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&La&&(De=Gy()):($s=ie,nm="value"in $s?$s.value:$s.textContent,La=!0)),Me=ru(ne,Oe),0<Me.length&&(Oe=new Jy(Oe,o,null,u,ie),ce.push({event:Oe,listeners:Me}),De?Oe.data=De:(De=ov(u),De!==null&&(Oe.data=De)))),(De=o3?a3(o,u):i3(o,u))&&(ne=ru(ne,"onBeforeInput"),0<ne.length&&(ie=new Jy("onBeforeInput","beforeinput",null,u,ie),ce.push({event:ie,listeners:ne}),ie.data=De))}kv(ce,i)})}function xl(o,i,u){return{instance:o,listener:i,currentTarget:u}}function ru(o,i){for(var u=i+"Capture",h=[];o!==null;){var v=o,C=v.stateNode;v.tag===5&&C!==null&&(v=C,C=jn(o,u),C!=null&&h.unshift(xl(o,C,v)),C=jn(o,i),C!=null&&h.push(xl(o,C,v))),o=o.return}return h}function $a(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function _v(o,i,u,h,v){for(var C=i._reactName,T=[];u!==null&&u!==h;){var I=u,U=I.alternate,ne=I.stateNode;if(U!==null&&U===h)break;I.tag===5&&ne!==null&&(I=ne,v?(U=jn(u,C),U!=null&&T.unshift(xl(u,U,I))):v||(U=jn(u,C),U!=null&&T.push(xl(u,U,I)))),u=u.return}T.length!==0&&o.push({event:i,listeners:T})}var w3=/\r\n?/g,j3=/\u0000|\uFFFD/g;function Ev(o){return(typeof o=="string"?o:""+o).replace(w3,`
|
|
38
|
+
`).replace(j3,"")}function su(o,i,u){if(i=Ev(i),Ev(o)!==i&&u)throw Error(n(425))}function ou(){}var vm=null,bm=null;function wm(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 jm=typeof setTimeout=="function"?setTimeout:void 0,N3=typeof clearTimeout=="function"?clearTimeout:void 0,Pv=typeof Promise=="function"?Promise:void 0,C3=typeof queueMicrotask=="function"?queueMicrotask:typeof Pv<"u"?function(o){return Pv.resolve(null).then(o).catch(k3)}:jm;function k3(o){setTimeout(function(){throw o})}function Nm(o,i){var u=i,h=0;do{var v=u.nextSibling;if(o.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"){if(h===0){o.removeChild(v),il(i);return}h--}else u!=="$"&&u!=="$?"&&u!=="$!"||h++;u=v}while(u);il(i)}function Bs(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 Tv(o){o=o.previousSibling;for(var i=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return o;i--}else u==="/$"&&i++}o=o.previousSibling}return null}var Va=Math.random().toString(36).slice(2),Fr="__reactFiber$"+Va,yl="__reactProps$"+Va,ls="__reactContainer$"+Va,Cm="__reactEvents$"+Va,S3="__reactListeners$"+Va,_3="__reactHandles$"+Va;function zo(o){var i=o[Fr];if(i)return i;for(var u=o.parentNode;u;){if(i=u[ls]||u[Fr]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(o=Tv(o);o!==null;){if(u=o[Fr])return u;o=Tv(o)}return i}o=u,u=o.parentNode}return null}function vl(o){return o=o[Fr]||o[ls],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ba(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function au(o){return o[yl]||null}var km=[],za=-1;function zs(o){return{current:o}}function dt(o){0>za||(o.current=km[za],km[za]=null,za--)}function ot(o,i){za++,km[za]=o.current,o.current=i}var Ws={},Jt=zs(Ws),Nn=zs(!1),Wo=Ws;function Wa(o,i){var u=o.type.contextTypes;if(!u)return Ws;var h=o.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var v={},C;for(C in u)v[C]=i[C];return h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=v),v}function Cn(o){return o=o.childContextTypes,o!=null}function iu(){dt(Nn),dt(Jt)}function Av(o,i,u){if(Jt.current!==Ws)throw Error(n(168));ot(Jt,i),ot(Nn,u)}function Mv(o,i,u){var h=o.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return u;h=h.getChildContext();for(var v in h)if(!(v in i))throw Error(n(108,le(o)||"Unknown",v));return Z({},u,h)}function lu(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ws,Wo=Jt.current,ot(Jt,o),ot(Nn,Nn.current),!0}function Dv(o,i,u){var h=o.stateNode;if(!h)throw Error(n(169));u?(o=Mv(o,i,Wo),h.__reactInternalMemoizedMergedChildContext=o,dt(Nn),dt(Jt),ot(Jt,o)):dt(Nn),ot(Nn,u)}var cs=null,cu=!1,Sm=!1;function Rv(o){cs===null?cs=[o]:cs.push(o)}function E3(o){cu=!0,Rv(o)}function Us(){if(!Sm&&cs!==null){Sm=!0;var o=0,i=tt;try{var u=cs;for(tt=1;o<u.length;o++){var h=u[o];do h=h(!0);while(h!==null)}cs=null,cu=!1}catch(v){throw cs!==null&&(cs=cs.slice(o+1)),Ly(Yf,Us),v}finally{tt=i,Sm=!1}}return null}var Ua=[],Ha=0,uu=null,du=0,Qn=[],Gn=0,Uo=null,us=1,ds="";function Ho(o,i){Ua[Ha++]=du,Ua[Ha++]=uu,uu=o,du=i}function Ov(o,i,u){Qn[Gn++]=us,Qn[Gn++]=ds,Qn[Gn++]=Uo,Uo=o;var h=us;o=ds;var v=32-cr(h)-1;h&=~(1<<v),u+=1;var C=32-cr(i)+v;if(30<C){var T=v-v%5;C=(h&(1<<T)-1).toString(32),h>>=T,v-=T,us=1<<32-cr(i)+v|u<<v|h,ds=C+o}else us=1<<C|u<<v|h,ds=o}function _m(o){o.return!==null&&(Ho(o,1),Ov(o,1,0))}function Em(o){for(;o===uu;)uu=Ua[--Ha],Ua[Ha]=null,du=Ua[--Ha],Ua[Ha]=null;for(;o===Uo;)Uo=Qn[--Gn],Qn[Gn]=null,ds=Qn[--Gn],Qn[Gn]=null,us=Qn[--Gn],Qn[Gn]=null}var zn=null,Wn=null,ht=!1,dr=null;function Lv(o,i){var u=er(5,null,null,0);u.elementType="DELETED",u.stateNode=i,u.return=o,i=o.deletions,i===null?(o.deletions=[u],o.flags|=16):i.push(u)}function Iv(o,i){switch(o.tag){case 5:var u=o.type;return i=i.nodeType!==1||u.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(o.stateNode=i,zn=o,Wn=Bs(i.firstChild),!0):!1;case 6:return i=o.pendingProps===""||i.nodeType!==3?null:i,i!==null?(o.stateNode=i,zn=o,Wn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(u=Uo!==null?{id:us,overflow:ds}:null,o.memoizedState={dehydrated:i,treeContext:u,retryLane:1073741824},u=er(18,null,null,0),u.stateNode=i,u.return=o,o.child=u,zn=o,Wn=null,!0):!1;default:return!1}}function Pm(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Tm(o){if(ht){var i=Wn;if(i){var u=i;if(!Iv(o,i)){if(Pm(o))throw Error(n(418));i=Bs(u.nextSibling);var h=zn;i&&Iv(o,i)?Lv(h,u):(o.flags=o.flags&-4097|2,ht=!1,zn=o)}}else{if(Pm(o))throw Error(n(418));o.flags=o.flags&-4097|2,ht=!1,zn=o}}}function Fv(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;zn=o}function fu(o){if(o!==zn)return!1;if(!ht)return Fv(o),ht=!0,!1;var i;if((i=o.tag!==3)&&!(i=o.tag!==5)&&(i=o.type,i=i!=="head"&&i!=="body"&&!wm(o.type,o.memoizedProps)),i&&(i=Wn)){if(Pm(o))throw $v(),Error(n(418));for(;i;)Lv(o,i),i=Bs(i.nextSibling)}if(Fv(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 u=o.data;if(u==="/$"){if(i===0){Wn=Bs(o.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++}o=o.nextSibling}Wn=null}}else Wn=zn?Bs(o.stateNode.nextSibling):null;return!0}function $v(){for(var o=Wn;o;)o=Bs(o.nextSibling)}function qa(){Wn=zn=null,ht=!1}function Am(o){dr===null?dr=[o]:dr.push(o)}var P3=E.ReactCurrentBatchConfig;function bl(o,i,u){if(o=u.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var h=u.stateNode}if(!h)throw Error(n(147,o));var v=h,C=""+o;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===C?i.ref:(i=function(T){var I=v.refs;T===null?delete I[C]:I[C]=T},i._stringRef=C,i)}if(typeof o!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,o))}return o}function mu(o,i){throw o=Object.prototype.toString.call(i),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":o))}function Vv(o){var i=o._init;return i(o._payload)}function Bv(o){function i(J,K){if(o){var ee=J.deletions;ee===null?(J.deletions=[K],J.flags|=16):ee.push(K)}}function u(J,K){if(!o)return null;for(;K!==null;)i(J,K),K=K.sibling;return null}function h(J,K){for(J=new Map;K!==null;)K.key!==null?J.set(K.key,K):J.set(K.index,K),K=K.sibling;return J}function v(J,K){return J=Zs(J,K),J.index=0,J.sibling=null,J}function C(J,K,ee){return J.index=ee,o?(ee=J.alternate,ee!==null?(ee=ee.index,ee<K?(J.flags|=2,K):ee):(J.flags|=2,K)):(J.flags|=1048576,K)}function T(J){return o&&J.alternate===null&&(J.flags|=2),J}function I(J,K,ee,fe){return K===null||K.tag!==6?(K=jh(ee,J.mode,fe),K.return=J,K):(K=v(K,ee),K.return=J,K)}function U(J,K,ee,fe){var Se=ee.type;return Se===M?ie(J,K,ee.props.children,fe,ee.key):K!==null&&(K.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===H&&Vv(Se)===K.type)?(fe=v(K,ee.props),fe.ref=bl(J,K,ee),fe.return=J,fe):(fe=Iu(ee.type,ee.key,ee.props,null,J.mode,fe),fe.ref=bl(J,K,ee),fe.return=J,fe)}function ne(J,K,ee,fe){return K===null||K.tag!==4||K.stateNode.containerInfo!==ee.containerInfo||K.stateNode.implementation!==ee.implementation?(K=Nh(ee,J.mode,fe),K.return=J,K):(K=v(K,ee.children||[]),K.return=J,K)}function ie(J,K,ee,fe,Se){return K===null||K.tag!==7?(K=Jo(ee,J.mode,fe,Se),K.return=J,K):(K=v(K,ee),K.return=J,K)}function ce(J,K,ee){if(typeof K=="string"&&K!==""||typeof K=="number")return K=jh(""+K,J.mode,ee),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case P:return ee=Iu(K.type,K.key,K.props,null,J.mode,ee),ee.ref=bl(J,null,K),ee.return=J,ee;case A:return K=Nh(K,J.mode,ee),K.return=J,K;case H:var fe=K._init;return ce(J,fe(K._payload),ee)}if(lt(K)||W(K))return K=Jo(K,J.mode,ee,null),K.return=J,K;mu(J,K)}return null}function ae(J,K,ee,fe){var Se=K!==null?K.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Se!==null?null:I(J,K,""+ee,fe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case P:return ee.key===Se?U(J,K,ee,fe):null;case A:return ee.key===Se?ne(J,K,ee,fe):null;case H:return Se=ee._init,ae(J,K,Se(ee._payload),fe)}if(lt(ee)||W(ee))return Se!==null?null:ie(J,K,ee,fe,null);mu(J,ee)}return null}function xe(J,K,ee,fe,Se){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return J=J.get(ee)||null,I(K,J,""+fe,Se);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case P:return J=J.get(fe.key===null?ee:fe.key)||null,U(K,J,fe,Se);case A:return J=J.get(fe.key===null?ee:fe.key)||null,ne(K,J,fe,Se);case H:var Me=fe._init;return xe(J,K,ee,Me(fe._payload),Se)}if(lt(fe)||W(fe))return J=J.get(ee)||null,ie(K,J,fe,Se,null);mu(K,fe)}return null}function je(J,K,ee,fe){for(var Se=null,Me=null,De=K,Oe=K=0,Bt=null;De!==null&&Oe<ee.length;Oe++){De.index>Oe?(Bt=De,De=null):Bt=De.sibling;var Ye=ae(J,De,ee[Oe],fe);if(Ye===null){De===null&&(De=Bt);break}o&&De&&Ye.alternate===null&&i(J,De),K=C(Ye,K,Oe),Me===null?Se=Ye:Me.sibling=Ye,Me=Ye,De=Bt}if(Oe===ee.length)return u(J,De),ht&&Ho(J,Oe),Se;if(De===null){for(;Oe<ee.length;Oe++)De=ce(J,ee[Oe],fe),De!==null&&(K=C(De,K,Oe),Me===null?Se=De:Me.sibling=De,Me=De);return ht&&Ho(J,Oe),Se}for(De=h(J,De);Oe<ee.length;Oe++)Bt=xe(De,J,Oe,ee[Oe],fe),Bt!==null&&(o&&Bt.alternate!==null&&De.delete(Bt.key===null?Oe:Bt.key),K=C(Bt,K,Oe),Me===null?Se=Bt:Me.sibling=Bt,Me=Bt);return o&&De.forEach(function(Js){return i(J,Js)}),ht&&Ho(J,Oe),Se}function ke(J,K,ee,fe){var Se=W(ee);if(typeof Se!="function")throw Error(n(150));if(ee=Se.call(ee),ee==null)throw Error(n(151));for(var Me=Se=null,De=K,Oe=K=0,Bt=null,Ye=ee.next();De!==null&&!Ye.done;Oe++,Ye=ee.next()){De.index>Oe?(Bt=De,De=null):Bt=De.sibling;var Js=ae(J,De,Ye.value,fe);if(Js===null){De===null&&(De=Bt);break}o&&De&&Js.alternate===null&&i(J,De),K=C(Js,K,Oe),Me===null?Se=Js:Me.sibling=Js,Me=Js,De=Bt}if(Ye.done)return u(J,De),ht&&Ho(J,Oe),Se;if(De===null){for(;!Ye.done;Oe++,Ye=ee.next())Ye=ce(J,Ye.value,fe),Ye!==null&&(K=C(Ye,K,Oe),Me===null?Se=Ye:Me.sibling=Ye,Me=Ye);return ht&&Ho(J,Oe),Se}for(De=h(J,De);!Ye.done;Oe++,Ye=ee.next())Ye=xe(De,J,Oe,Ye.value,fe),Ye!==null&&(o&&Ye.alternate!==null&&De.delete(Ye.key===null?Oe:Ye.key),K=C(Ye,K,Oe),Me===null?Se=Ye:Me.sibling=Ye,Me=Ye);return o&&De.forEach(function(l_){return i(J,l_)}),ht&&Ho(J,Oe),Se}function kt(J,K,ee,fe){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 Se=ee.key,Me=K;Me!==null;){if(Me.key===Se){if(Se=ee.type,Se===M){if(Me.tag===7){u(J,Me.sibling),K=v(Me,ee.props.children),K.return=J,J=K;break e}}else if(Me.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===H&&Vv(Se)===Me.type){u(J,Me.sibling),K=v(Me,ee.props),K.ref=bl(J,Me,ee),K.return=J,J=K;break e}u(J,Me);break}else i(J,Me);Me=Me.sibling}ee.type===M?(K=Jo(ee.props.children,J.mode,fe,ee.key),K.return=J,J=K):(fe=Iu(ee.type,ee.key,ee.props,null,J.mode,fe),fe.ref=bl(J,K,ee),fe.return=J,J=fe)}return T(J);case A:e:{for(Me=ee.key;K!==null;){if(K.key===Me)if(K.tag===4&&K.stateNode.containerInfo===ee.containerInfo&&K.stateNode.implementation===ee.implementation){u(J,K.sibling),K=v(K,ee.children||[]),K.return=J,J=K;break e}else{u(J,K);break}else i(J,K);K=K.sibling}K=Nh(ee,J.mode,fe),K.return=J,J=K}return T(J);case H:return Me=ee._init,kt(J,K,Me(ee._payload),fe)}if(lt(ee))return je(J,K,ee,fe);if(W(ee))return ke(J,K,ee,fe);mu(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,K!==null&&K.tag===6?(u(J,K.sibling),K=v(K,ee),K.return=J,J=K):(u(J,K),K=jh(ee,J.mode,fe),K.return=J,J=K),T(J)):u(J,K)}return kt}var Ka=Bv(!0),zv=Bv(!1),hu=zs(null),pu=null,Ya=null,Mm=null;function Dm(){Mm=Ya=pu=null}function Rm(o){var i=hu.current;dt(hu),o._currentValue=i}function Om(o,i,u){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===u)break;o=o.return}}function Qa(o,i){pu=o,Mm=Ya=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(kn=!0),o.firstContext=null)}function Xn(o){var i=o._currentValue;if(Mm!==o)if(o={context:o,memoizedValue:i,next:null},Ya===null){if(pu===null)throw Error(n(308));Ya=o,pu.dependencies={lanes:0,firstContext:o}}else Ya=Ya.next=o;return i}var qo=null;function Lm(o){qo===null?qo=[o]:qo.push(o)}function Wv(o,i,u,h){var v=i.interleaved;return v===null?(u.next=u,Lm(i)):(u.next=v.next,v.next=u),i.interleaved=u,fs(o,h)}function fs(o,i){o.lanes|=i;var u=o.alternate;for(u!==null&&(u.lanes|=i),u=o,o=o.return;o!==null;)o.childLanes|=i,u=o.alternate,u!==null&&(u.childLanes|=i),u=o,o=o.return;return u.tag===3?u.stateNode:null}var Hs=!1;function Im(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uv(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 ms(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function qs(o,i,u){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Ke&2)!==0){var v=h.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),h.pending=i,fs(o,u)}return v=h.interleaved,v===null?(i.next=i,Lm(h)):(i.next=v.next,v.next=i),h.interleaved=i,fs(o,u)}function gu(o,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194240)!==0)){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,Xf(o,u)}}function Hv(o,i){var u=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var v=null,C=null;if(u=u.firstBaseUpdate,u!==null){do{var T={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};C===null?v=C=T:C=C.next=T,u=u.next}while(u!==null);C===null?v=C=i:C=C.next=i}else v=C=i;u={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:C,shared:h.shared,effects:h.effects},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=i:o.next=i,u.lastBaseUpdate=i}function xu(o,i,u,h){var v=o.updateQueue;Hs=!1;var C=v.firstBaseUpdate,T=v.lastBaseUpdate,I=v.shared.pending;if(I!==null){v.shared.pending=null;var U=I,ne=U.next;U.next=null,T===null?C=ne:T.next=ne,T=U;var ie=o.alternate;ie!==null&&(ie=ie.updateQueue,I=ie.lastBaseUpdate,I!==T&&(I===null?ie.firstBaseUpdate=ne:I.next=ne,ie.lastBaseUpdate=U))}if(C!==null){var ce=v.baseState;T=0,ie=ne=U=null,I=C;do{var ae=I.lane,xe=I.eventTime;if((h&ae)===ae){ie!==null&&(ie=ie.next={eventTime:xe,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var je=o,ke=I;switch(ae=i,xe=u,ke.tag){case 1:if(je=ke.payload,typeof je=="function"){ce=je.call(xe,ce,ae);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,ae=typeof je=="function"?je.call(xe,ce,ae):je,ae==null)break e;ce=Z({},ce,ae);break e;case 2:Hs=!0}}I.callback!==null&&I.lane!==0&&(o.flags|=64,ae=v.effects,ae===null?v.effects=[I]:ae.push(I))}else xe={eventTime:xe,lane:ae,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ie===null?(ne=ie=xe,U=ce):ie=ie.next=xe,T|=ae;if(I=I.next,I===null){if(I=v.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,v.lastBaseUpdate=ae,v.shared.pending=null}}while(!0);if(ie===null&&(U=ce),v.baseState=U,v.firstBaseUpdate=ne,v.lastBaseUpdate=ie,i=v.shared.interleaved,i!==null){v=i;do T|=v.lane,v=v.next;while(v!==i)}else C===null&&(v.shared.lanes=0);Qo|=T,o.lanes=T,o.memoizedState=ce}}function qv(o,i,u){if(o=i.effects,i.effects=null,o!==null)for(i=0;i<o.length;i++){var h=o[i],v=h.callback;if(v!==null){if(h.callback=null,h=u,typeof v!="function")throw Error(n(191,v));v.call(h)}}}var wl={},$r=zs(wl),jl=zs(wl),Nl=zs(wl);function Ko(o){if(o===wl)throw Error(n(174));return o}function Fm(o,i){switch(ot(Nl,i),ot(jl,o),ot($r,wl),o=i.nodeType,o){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:Ut(null,"");break;default:o=o===8?i.parentNode:i,i=o.namespaceURI||null,o=o.tagName,i=Ut(i,o)}dt($r),ot($r,i)}function Ga(){dt($r),dt(jl),dt(Nl)}function Kv(o){Ko(Nl.current);var i=Ko($r.current),u=Ut(i,o.type);i!==u&&(ot(jl,o),ot($r,u))}function $m(o){jl.current===o&&(dt($r),dt(jl))}var pt=zs(0);function yu(o){for(var i=o;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.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 Vm=[];function Bm(){for(var o=0;o<Vm.length;o++)Vm[o]._workInProgressVersionPrimary=null;Vm.length=0}var vu=E.ReactCurrentDispatcher,zm=E.ReactCurrentBatchConfig,Yo=0,gt=null,Rt=null,$t=null,bu=!1,Cl=!1,kl=0,T3=0;function en(){throw Error(n(321))}function Wm(o,i){if(i===null)return!1;for(var u=0;u<i.length&&u<o.length;u++)if(!ur(o[u],i[u]))return!1;return!0}function Um(o,i,u,h,v,C){if(Yo=C,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,vu.current=o===null||o.memoizedState===null?R3:O3,o=u(h,v),Cl){C=0;do{if(Cl=!1,kl=0,25<=C)throw Error(n(301));C+=1,$t=Rt=null,i.updateQueue=null,vu.current=L3,o=u(h,v)}while(Cl)}if(vu.current=Nu,i=Rt!==null&&Rt.next!==null,Yo=0,$t=Rt=gt=null,bu=!1,i)throw Error(n(300));return o}function Hm(){var o=kl!==0;return kl=0,o}function Vr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?gt.memoizedState=$t=o:$t=$t.next=o,$t}function Zn(){if(Rt===null){var o=gt.alternate;o=o!==null?o.memoizedState:null}else o=Rt.next;var i=$t===null?gt.memoizedState:$t.next;if(i!==null)$t=i,Rt=o;else{if(o===null)throw Error(n(310));Rt=o,o={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},$t===null?gt.memoizedState=$t=o:$t=$t.next=o}return $t}function Sl(o,i){return typeof i=="function"?i(o):i}function qm(o){var i=Zn(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=Rt,v=h.baseQueue,C=u.pending;if(C!==null){if(v!==null){var T=v.next;v.next=C.next,C.next=T}h.baseQueue=v=C,u.pending=null}if(v!==null){C=v.next,h=h.baseState;var I=T=null,U=null,ne=C;do{var ie=ne.lane;if((Yo&ie)===ie)U!==null&&(U=U.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),h=ne.hasEagerState?ne.eagerState:o(h,ne.action);else{var ce={lane:ie,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};U===null?(I=U=ce,T=h):U=U.next=ce,gt.lanes|=ie,Qo|=ie}ne=ne.next}while(ne!==null&&ne!==C);U===null?T=h:U.next=I,ur(h,i.memoizedState)||(kn=!0),i.memoizedState=h,i.baseState=T,i.baseQueue=U,u.lastRenderedState=h}if(o=u.interleaved,o!==null){v=o;do C=v.lane,gt.lanes|=C,Qo|=C,v=v.next;while(v!==o)}else v===null&&(u.lanes=0);return[i.memoizedState,u.dispatch]}function Km(o){var i=Zn(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var h=u.dispatch,v=u.pending,C=i.memoizedState;if(v!==null){u.pending=null;var T=v=v.next;do C=o(C,T.action),T=T.next;while(T!==v);ur(C,i.memoizedState)||(kn=!0),i.memoizedState=C,i.baseQueue===null&&(i.baseState=C),u.lastRenderedState=C}return[C,h]}function Yv(){}function Qv(o,i){var u=gt,h=Zn(),v=i(),C=!ur(h.memoizedState,v);if(C&&(h.memoizedState=v,kn=!0),h=h.queue,Ym(Zv.bind(null,u,h,o),[o]),h.getSnapshot!==i||C||$t!==null&&$t.memoizedState.tag&1){if(u.flags|=2048,_l(9,Xv.bind(null,u,h,v,i),void 0,null),Vt===null)throw Error(n(349));(Yo&30)!==0||Gv(u,i,v)}return v}function Gv(o,i,u){o.flags|=16384,o={getSnapshot:i,value:u},i=gt.updateQueue,i===null?(i={lastEffect:null,stores:null},gt.updateQueue=i,i.stores=[o]):(u=i.stores,u===null?i.stores=[o]:u.push(o))}function Xv(o,i,u,h){i.value=u,i.getSnapshot=h,Jv(i)&&e0(o)}function Zv(o,i,u){return u(function(){Jv(i)&&e0(o)})}function Jv(o){var i=o.getSnapshot;o=o.value;try{var u=i();return!ur(o,u)}catch{return!0}}function e0(o){var i=fs(o,1);i!==null&&pr(i,o,1,-1)}function t0(o){var i=Vr();return typeof o=="function"&&(o=o()),i.memoizedState=i.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:o},i.queue=o,o=o.dispatch=D3.bind(null,gt,o),[i.memoizedState,o]}function _l(o,i,u,h){return o={tag:o,create:i,destroy:u,deps:h,next:null},i=gt.updateQueue,i===null?(i={lastEffect:null,stores:null},gt.updateQueue=i,i.lastEffect=o.next=o):(u=i.lastEffect,u===null?i.lastEffect=o.next=o:(h=u.next,u.next=o,o.next=h,i.lastEffect=o)),o}function n0(){return Zn().memoizedState}function wu(o,i,u,h){var v=Vr();gt.flags|=o,v.memoizedState=_l(1|i,u,void 0,h===void 0?null:h)}function ju(o,i,u,h){var v=Zn();h=h===void 0?null:h;var C=void 0;if(Rt!==null){var T=Rt.memoizedState;if(C=T.destroy,h!==null&&Wm(h,T.deps)){v.memoizedState=_l(i,u,C,h);return}}gt.flags|=o,v.memoizedState=_l(1|i,u,C,h)}function r0(o,i){return wu(8390656,8,o,i)}function Ym(o,i){return ju(2048,8,o,i)}function s0(o,i){return ju(4,2,o,i)}function o0(o,i){return ju(4,4,o,i)}function a0(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 i0(o,i,u){return u=u!=null?u.concat([o]):null,ju(4,4,a0.bind(null,i,o),u)}function Qm(){}function l0(o,i){var u=Zn();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&Wm(i,h[1])?h[0]:(u.memoizedState=[o,i],o)}function c0(o,i){var u=Zn();i=i===void 0?null:i;var h=u.memoizedState;return h!==null&&i!==null&&Wm(i,h[1])?h[0]:(o=o(),u.memoizedState=[o,i],o)}function u0(o,i,u){return(Yo&21)===0?(o.baseState&&(o.baseState=!1,kn=!0),o.memoizedState=u):(ur(u,i)||(u=Vy(),gt.lanes|=u,Qo|=u,o.baseState=!0),i)}function A3(o,i){var u=tt;tt=u!==0&&4>u?u:4,o(!0);var h=zm.transition;zm.transition={};try{o(!1),i()}finally{tt=u,zm.transition=h}}function d0(){return Zn().memoizedState}function M3(o,i,u){var h=Gs(o);if(u={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null},f0(o))m0(i,u);else if(u=Wv(o,i,u,h),u!==null){var v=dn();pr(u,o,h,v),h0(u,i,h)}}function D3(o,i,u){var h=Gs(o),v={lane:h,action:u,hasEagerState:!1,eagerState:null,next:null};if(f0(o))m0(i,v);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=i.lastRenderedReducer,C!==null))try{var T=i.lastRenderedState,I=C(T,u);if(v.hasEagerState=!0,v.eagerState=I,ur(I,T)){var U=i.interleaved;U===null?(v.next=v,Lm(i)):(v.next=U.next,U.next=v),i.interleaved=v;return}}catch{}finally{}u=Wv(o,i,v,h),u!==null&&(v=dn(),pr(u,o,h,v),h0(u,i,h))}}function f0(o){var i=o.alternate;return o===gt||i!==null&&i===gt}function m0(o,i){Cl=bu=!0;var u=o.pending;u===null?i.next=i:(i.next=u.next,u.next=i),o.pending=i}function h0(o,i,u){if((u&4194240)!==0){var h=i.lanes;h&=o.pendingLanes,u|=h,i.lanes=u,Xf(o,u)}}var Nu={readContext:Xn,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useInsertionEffect:en,useLayoutEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useMutableSource:en,useSyncExternalStore:en,useId:en,unstable_isNewReconciler:!1},R3={readContext:Xn,useCallback:function(o,i){return Vr().memoizedState=[o,i===void 0?null:i],o},useContext:Xn,useEffect:r0,useImperativeHandle:function(o,i,u){return u=u!=null?u.concat([o]):null,wu(4194308,4,a0.bind(null,i,o),u)},useLayoutEffect:function(o,i){return wu(4194308,4,o,i)},useInsertionEffect:function(o,i){return wu(4,2,o,i)},useMemo:function(o,i){var u=Vr();return i=i===void 0?null:i,o=o(),u.memoizedState=[o,i],o},useReducer:function(o,i,u){var h=Vr();return i=u!==void 0?u(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=M3.bind(null,gt,o),[h.memoizedState,o]},useRef:function(o){var i=Vr();return o={current:o},i.memoizedState=o},useState:t0,useDebugValue:Qm,useDeferredValue:function(o){return Vr().memoizedState=o},useTransition:function(){var o=t0(!1),i=o[0];return o=A3.bind(null,o[1]),Vr().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,u){var h=gt,v=Vr();if(ht){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),Vt===null)throw Error(n(349));(Yo&30)!==0||Gv(h,i,u)}v.memoizedState=u;var C={value:u,getSnapshot:i};return v.queue=C,r0(Zv.bind(null,h,C,o),[o]),h.flags|=2048,_l(9,Xv.bind(null,h,C,u,i),void 0,null),u},useId:function(){var o=Vr(),i=Vt.identifierPrefix;if(ht){var u=ds,h=us;u=(h&~(1<<32-cr(h)-1)).toString(32)+u,i=":"+i+"R"+u,u=kl++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=T3++,i=":"+i+"r"+u.toString(32)+":";return o.memoizedState=i},unstable_isNewReconciler:!1},O3={readContext:Xn,useCallback:l0,useContext:Xn,useEffect:Ym,useImperativeHandle:i0,useInsertionEffect:s0,useLayoutEffect:o0,useMemo:c0,useReducer:qm,useRef:n0,useState:function(){return qm(Sl)},useDebugValue:Qm,useDeferredValue:function(o){var i=Zn();return u0(i,Rt.memoizedState,o)},useTransition:function(){var o=qm(Sl)[0],i=Zn().memoizedState;return[o,i]},useMutableSource:Yv,useSyncExternalStore:Qv,useId:d0,unstable_isNewReconciler:!1},L3={readContext:Xn,useCallback:l0,useContext:Xn,useEffect:Ym,useImperativeHandle:i0,useInsertionEffect:s0,useLayoutEffect:o0,useMemo:c0,useReducer:Km,useRef:n0,useState:function(){return Km(Sl)},useDebugValue:Qm,useDeferredValue:function(o){var i=Zn();return Rt===null?i.memoizedState=o:u0(i,Rt.memoizedState,o)},useTransition:function(){var o=Km(Sl)[0],i=Zn().memoizedState;return[o,i]},useMutableSource:Yv,useSyncExternalStore:Qv,useId:d0,unstable_isNewReconciler:!1};function fr(o,i){if(o&&o.defaultProps){i=Z({},i),o=o.defaultProps;for(var u in o)i[u]===void 0&&(i[u]=o[u]);return i}return i}function Gm(o,i,u,h){i=o.memoizedState,u=u(h,i),u=u==null?i:Z({},i,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var Cu={isMounted:function(o){return(o=o._reactInternals)?Bo(o)===o:!1},enqueueSetState:function(o,i,u){o=o._reactInternals;var h=dn(),v=Gs(o),C=ms(h,v);C.payload=i,u!=null&&(C.callback=u),i=qs(o,C,v),i!==null&&(pr(i,o,v,h),gu(i,o,v))},enqueueReplaceState:function(o,i,u){o=o._reactInternals;var h=dn(),v=Gs(o),C=ms(h,v);C.tag=1,C.payload=i,u!=null&&(C.callback=u),i=qs(o,C,v),i!==null&&(pr(i,o,v,h),gu(i,o,v))},enqueueForceUpdate:function(o,i){o=o._reactInternals;var u=dn(),h=Gs(o),v=ms(u,h);v.tag=2,i!=null&&(v.callback=i),i=qs(o,v,h),i!==null&&(pr(i,o,h,u),gu(i,o,h))}};function p0(o,i,u,h,v,C,T){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,C,T):i.prototype&&i.prototype.isPureReactComponent?!ml(u,h)||!ml(v,C):!0}function g0(o,i,u){var h=!1,v=Ws,C=i.contextType;return typeof C=="object"&&C!==null?C=Xn(C):(v=Cn(i)?Wo:Jt.current,h=i.contextTypes,C=(h=h!=null)?Wa(o,v):Ws),i=new i(u,C),o.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Cu,o.stateNode=i,i._reactInternals=o,h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=C),i}function x0(o,i,u,h){o=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==o&&Cu.enqueueReplaceState(i,i.state,null)}function Xm(o,i,u,h){var v=o.stateNode;v.props=u,v.state=o.memoizedState,v.refs={},Im(o);var C=i.contextType;typeof C=="object"&&C!==null?v.context=Xn(C):(C=Cn(i)?Wo:Jt.current,v.context=Wa(o,C)),v.state=o.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(Gm(o,i,C,u),v.state=o.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(i=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),i!==v.state&&Cu.enqueueReplaceState(v,v.state,null),xu(o,u,v,h),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function Xa(o,i){try{var u="",h=i;do u+=oe(h),h=h.return;while(h);var v=u}catch(C){v=`
|
|
39
|
+
Error generating stack: `+C.message+`
|
|
40
|
+
`+C.stack}return{value:o,source:i,stack:v,digest:null}}function Zm(o,i,u){return{value:o,source:null,stack:u??null,digest:i??null}}function Jm(o,i){try{console.error(i.value)}catch(u){setTimeout(function(){throw u})}}var I3=typeof WeakMap=="function"?WeakMap:Map;function y0(o,i,u){u=ms(-1,u),u.tag=3,u.payload={element:null};var h=i.value;return u.callback=function(){Au||(Au=!0,hh=h),Jm(o,i)},u}function v0(o,i,u){u=ms(-1,u),u.tag=3;var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var v=i.value;u.payload=function(){return h(v)},u.callback=function(){Jm(o,i)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(u.callback=function(){Jm(o,i),typeof h!="function"&&(Ys===null?Ys=new Set([this]):Ys.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})}),u}function b0(o,i,u){var h=o.pingCache;if(h===null){h=o.pingCache=new I3;var v=new Set;h.set(i,v)}else v=h.get(i),v===void 0&&(v=new Set,h.set(i,v));v.has(u)||(v.add(u),o=X3.bind(null,o,i,u),i.then(o,o))}function w0(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 j0(o,i,u,h,v){return(o.mode&1)===0?(o===i?o.flags|=65536:(o.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(i=ms(-1,1),i.tag=2,qs(u,i,1))),u.lanes|=1),o):(o.flags|=65536,o.lanes=v,o)}var F3=E.ReactCurrentOwner,kn=!1;function un(o,i,u,h){i.child=o===null?zv(i,null,u,h):Ka(i,o.child,u,h)}function N0(o,i,u,h,v){u=u.render;var C=i.ref;return Qa(i,v),h=Um(o,i,u,h,C,v),u=Hm(),o!==null&&!kn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~v,hs(o,i,v)):(ht&&u&&_m(i),i.flags|=1,un(o,i,h,v),i.child)}function C0(o,i,u,h,v){if(o===null){var C=u.type;return typeof C=="function"&&!wh(C)&&C.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(i.tag=15,i.type=C,k0(o,i,C,h,v)):(o=Iu(u.type,null,h,i,i.mode,v),o.ref=i.ref,o.return=i,i.child=o)}if(C=o.child,(o.lanes&v)===0){var T=C.memoizedProps;if(u=u.compare,u=u!==null?u:ml,u(T,h)&&o.ref===i.ref)return hs(o,i,v)}return i.flags|=1,o=Zs(C,h),o.ref=i.ref,o.return=i,i.child=o}function k0(o,i,u,h,v){if(o!==null){var C=o.memoizedProps;if(ml(C,h)&&o.ref===i.ref)if(kn=!1,i.pendingProps=h=C,(o.lanes&v)!==0)(o.flags&131072)!==0&&(kn=!0);else return i.lanes=o.lanes,hs(o,i,v)}return eh(o,i,u,h,v)}function S0(o,i,u){var h=i.pendingProps,v=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},ot(Ja,Un),Un|=u;else{if((u&1073741824)===0)return o=C!==null?C.baseLanes|u:u,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:o,cachePool:null,transitions:null},i.updateQueue=null,ot(Ja,Un),Un|=o,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=C!==null?C.baseLanes:u,ot(Ja,Un),Un|=h}else C!==null?(h=C.baseLanes|u,i.memoizedState=null):h=u,ot(Ja,Un),Un|=h;return un(o,i,v,u),i.child}function _0(o,i){var u=i.ref;(o===null&&u!==null||o!==null&&o.ref!==u)&&(i.flags|=512,i.flags|=2097152)}function eh(o,i,u,h,v){var C=Cn(u)?Wo:Jt.current;return C=Wa(i,C),Qa(i,v),u=Um(o,i,u,h,C,v),h=Hm(),o!==null&&!kn?(i.updateQueue=o.updateQueue,i.flags&=-2053,o.lanes&=~v,hs(o,i,v)):(ht&&h&&_m(i),i.flags|=1,un(o,i,u,v),i.child)}function E0(o,i,u,h,v){if(Cn(u)){var C=!0;lu(i)}else C=!1;if(Qa(i,v),i.stateNode===null)Su(o,i),g0(i,u,h),Xm(i,u,h,v),h=!0;else if(o===null){var T=i.stateNode,I=i.memoizedProps;T.props=I;var U=T.context,ne=u.contextType;typeof ne=="object"&&ne!==null?ne=Xn(ne):(ne=Cn(u)?Wo:Jt.current,ne=Wa(i,ne));var ie=u.getDerivedStateFromProps,ce=typeof ie=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==h||U!==ne)&&x0(i,T,h,ne),Hs=!1;var ae=i.memoizedState;T.state=ae,xu(i,h,T,v),U=i.memoizedState,I!==h||ae!==U||Nn.current||Hs?(typeof ie=="function"&&(Gm(i,u,ie,h),U=i.memoizedState),(I=Hs||p0(i,u,I,h,ae,U,ne))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(i.flags|=4194308)):(typeof T.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=U),T.props=h,T.state=U,T.context=ne,h=I):(typeof T.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{T=i.stateNode,Uv(o,i),I=i.memoizedProps,ne=i.type===i.elementType?I:fr(i.type,I),T.props=ne,ce=i.pendingProps,ae=T.context,U=u.contextType,typeof U=="object"&&U!==null?U=Xn(U):(U=Cn(u)?Wo:Jt.current,U=Wa(i,U));var xe=u.getDerivedStateFromProps;(ie=typeof xe=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==ce||ae!==U)&&x0(i,T,h,U),Hs=!1,ae=i.memoizedState,T.state=ae,xu(i,h,T,v);var je=i.memoizedState;I!==ce||ae!==je||Nn.current||Hs?(typeof xe=="function"&&(Gm(i,u,xe,h),je=i.memoizedState),(ne=Hs||p0(i,u,ne,h,ae,je,U)||!1)?(ie||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(h,je,U),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(h,je,U)),typeof T.componentDidUpdate=="function"&&(i.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof T.componentDidUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(i.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=je),T.props=h,T.state=je,T.context=U,h=ne):(typeof T.componentDidUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(i.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&ae===o.memoizedState||(i.flags|=1024),h=!1)}return th(o,i,u,h,C,v)}function th(o,i,u,h,v,C){_0(o,i);var T=(i.flags&128)!==0;if(!h&&!T)return v&&Dv(i,u,!1),hs(o,i,C);h=i.stateNode,F3.current=i;var I=T&&typeof u.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,o!==null&&T?(i.child=Ka(i,o.child,null,C),i.child=Ka(i,null,I,C)):un(o,i,I,C),i.memoizedState=h.state,v&&Dv(i,u,!0),i.child}function P0(o){var i=o.stateNode;i.pendingContext?Av(o,i.pendingContext,i.pendingContext!==i.context):i.context&&Av(o,i.context,!1),Fm(o,i.containerInfo)}function T0(o,i,u,h,v){return qa(),Am(v),i.flags|=256,un(o,i,u,h),i.child}var nh={dehydrated:null,treeContext:null,retryLane:0};function rh(o){return{baseLanes:o,cachePool:null,transitions:null}}function A0(o,i,u){var h=i.pendingProps,v=pt.current,C=!1,T=(i.flags&128)!==0,I;if((I=T)||(I=o!==null&&o.memoizedState===null?!1:(v&2)!==0),I?(C=!0,i.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),ot(pt,v&1),o===null)return Tm(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):(T=h.children,o=h.fallback,C?(h=i.mode,C=i.child,T={mode:"hidden",children:T},(h&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=T):C=Fu(T,h,0,null),o=Jo(o,h,u,null),C.return=i,o.return=i,C.sibling=o,i.child=C,i.child.memoizedState=rh(u),i.memoizedState=nh,o):sh(i,T));if(v=o.memoizedState,v!==null&&(I=v.dehydrated,I!==null))return $3(o,i,T,h,I,v,u);if(C){C=h.fallback,T=i.mode,v=o.child,I=v.sibling;var U={mode:"hidden",children:h.children};return(T&1)===0&&i.child!==v?(h=i.child,h.childLanes=0,h.pendingProps=U,i.deletions=null):(h=Zs(v,U),h.subtreeFlags=v.subtreeFlags&14680064),I!==null?C=Zs(I,C):(C=Jo(C,T,u,null),C.flags|=2),C.return=i,h.return=i,h.sibling=C,i.child=h,h=C,C=i.child,T=o.child.memoizedState,T=T===null?rh(u):{baseLanes:T.baseLanes|u,cachePool:null,transitions:T.transitions},C.memoizedState=T,C.childLanes=o.childLanes&~u,i.memoizedState=nh,h}return C=o.child,o=C.sibling,h=Zs(C,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=u),h.return=i,h.sibling=null,o!==null&&(u=i.deletions,u===null?(i.deletions=[o],i.flags|=16):u.push(o)),i.child=h,i.memoizedState=null,h}function sh(o,i){return i=Fu({mode:"visible",children:i},o.mode,0,null),i.return=o,o.child=i}function ku(o,i,u,h){return h!==null&&Am(h),Ka(i,o.child,null,u),o=sh(i,i.pendingProps.children),o.flags|=2,i.memoizedState=null,o}function $3(o,i,u,h,v,C,T){if(u)return i.flags&256?(i.flags&=-257,h=Zm(Error(n(422))),ku(o,i,T,h)):i.memoizedState!==null?(i.child=o.child,i.flags|=128,null):(C=h.fallback,v=i.mode,h=Fu({mode:"visible",children:h.children},v,0,null),C=Jo(C,v,T,null),C.flags|=2,h.return=i,C.return=i,h.sibling=C,i.child=h,(i.mode&1)!==0&&Ka(i,o.child,null,T),i.child.memoizedState=rh(T),i.memoizedState=nh,C);if((i.mode&1)===0)return ku(o,i,T,null);if(v.data==="$!"){if(h=v.nextSibling&&v.nextSibling.dataset,h)var I=h.dgst;return h=I,C=Error(n(419)),h=Zm(C,h,void 0),ku(o,i,T,h)}if(I=(T&o.childLanes)!==0,kn||I){if(h=Vt,h!==null){switch(T&-T){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(h.suspendedLanes|T))!==0?0:v,v!==0&&v!==C.retryLane&&(C.retryLane=v,fs(o,v),pr(h,o,v,-1))}return bh(),h=Zm(Error(n(421))),ku(o,i,T,h)}return v.data==="$?"?(i.flags|=128,i.child=o.child,i=Z3.bind(null,o),v._reactRetry=i,null):(o=C.treeContext,Wn=Bs(v.nextSibling),zn=i,ht=!0,dr=null,o!==null&&(Qn[Gn++]=us,Qn[Gn++]=ds,Qn[Gn++]=Uo,us=o.id,ds=o.overflow,Uo=i),i=sh(i,h.children),i.flags|=4096,i)}function M0(o,i,u){o.lanes|=i;var h=o.alternate;h!==null&&(h.lanes|=i),Om(o.return,i,u)}function oh(o,i,u,h,v){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:v}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=h,C.tail=u,C.tailMode=v)}function D0(o,i,u){var h=i.pendingProps,v=h.revealOrder,C=h.tail;if(un(o,i,h.children,u),h=pt.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&&M0(o,u,i);else if(o.tag===19)M0(o,u,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(ot(pt,h),(i.mode&1)===0)i.memoizedState=null;else switch(v){case"forwards":for(u=i.child,v=null;u!==null;)o=u.alternate,o!==null&&yu(o)===null&&(v=u),u=u.sibling;u=v,u===null?(v=i.child,i.child=null):(v=u.sibling,u.sibling=null),oh(i,!1,v,u,C);break;case"backwards":for(u=null,v=i.child,i.child=null;v!==null;){if(o=v.alternate,o!==null&&yu(o)===null){i.child=v;break}o=v.sibling,v.sibling=u,u=v,v=o}oh(i,!0,u,null,C);break;case"together":oh(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Su(o,i){(i.mode&1)===0&&o!==null&&(o.alternate=null,i.alternate=null,i.flags|=2)}function hs(o,i,u){if(o!==null&&(i.dependencies=o.dependencies),Qo|=i.lanes,(u&i.childLanes)===0)return null;if(o!==null&&i.child!==o.child)throw Error(n(153));if(i.child!==null){for(o=i.child,u=Zs(o,o.pendingProps),i.child=u,u.return=i;o.sibling!==null;)o=o.sibling,u=u.sibling=Zs(o,o.pendingProps),u.return=i;u.sibling=null}return i.child}function V3(o,i,u){switch(i.tag){case 3:P0(i),qa();break;case 5:Kv(i);break;case 1:Cn(i.type)&&lu(i);break;case 4:Fm(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,v=i.memoizedProps.value;ot(hu,h._currentValue),h._currentValue=v;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(ot(pt,pt.current&1),i.flags|=128,null):(u&i.child.childLanes)!==0?A0(o,i,u):(ot(pt,pt.current&1),o=hs(o,i,u),o!==null?o.sibling:null);ot(pt,pt.current&1);break;case 19:if(h=(u&i.childLanes)!==0,(o.flags&128)!==0){if(h)return D0(o,i,u);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),ot(pt,pt.current),h)break;return null;case 22:case 23:return i.lanes=0,S0(o,i,u)}return hs(o,i,u)}var R0,ah,O0,L0;R0=function(o,i){for(var u=i.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)break;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},ah=function(){},O0=function(o,i,u,h){var v=o.memoizedProps;if(v!==h){o=i.stateNode,Ko($r.current);var C=null;switch(u){case"input":v=In(o,v),h=In(o,h),C=[];break;case"select":v=Z({},v,{value:void 0}),h=Z({},h,{value:void 0}),C=[];break;case"textarea":v=_e(o,v),h=_e(o,h),C=[];break;default:typeof v.onClick!="function"&&typeof h.onClick=="function"&&(o.onclick=ou)}Rr(u,h);var T;u=null;for(ne in v)if(!h.hasOwnProperty(ne)&&v.hasOwnProperty(ne)&&v[ne]!=null)if(ne==="style"){var I=v[ne];for(T in I)I.hasOwnProperty(T)&&(u||(u={}),u[T]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(a.hasOwnProperty(ne)?C||(C=[]):(C=C||[]).push(ne,null));for(ne in h){var U=h[ne];if(I=v!=null?v[ne]:void 0,h.hasOwnProperty(ne)&&U!==I&&(U!=null||I!=null))if(ne==="style")if(I){for(T in I)!I.hasOwnProperty(T)||U&&U.hasOwnProperty(T)||(u||(u={}),u[T]="");for(T in U)U.hasOwnProperty(T)&&I[T]!==U[T]&&(u||(u={}),u[T]=U[T])}else u||(C||(C=[]),C.push(ne,u)),u=U;else ne==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,I=I?I.__html:void 0,U!=null&&I!==U&&(C=C||[]).push(ne,U)):ne==="children"?typeof U!="string"&&typeof U!="number"||(C=C||[]).push(ne,""+U):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(a.hasOwnProperty(ne)?(U!=null&&ne==="onScroll"&&ut("scroll",o),C||I===U||(C=[])):(C=C||[]).push(ne,U))}u&&(C=C||[]).push("style",u);var ne=C;(i.updateQueue=ne)&&(i.flags|=4)}},L0=function(o,i,u,h){u!==h&&(i.flags|=4)};function El(o,i){if(!ht)switch(o.tailMode){case"hidden":i=o.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function tn(o){var i=o.alternate!==null&&o.alternate.child===o.child,u=0,h=0;if(i)for(var v=o.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags&14680064,h|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=h,o.childLanes=u,i}function B3(o,i,u){var h=i.pendingProps;switch(Em(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(i),null;case 1:return Cn(i.type)&&iu(),tn(i),null;case 3:return h=i.stateNode,Ga(),dt(Nn),dt(Jt),Bm(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(fu(i)?i.flags|=4:o===null||o.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,dr!==null&&(xh(dr),dr=null))),ah(o,i),tn(i),null;case 5:$m(i);var v=Ko(Nl.current);if(u=i.type,o!==null&&i.stateNode!=null)O0(o,i,u,h,v),o.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(n(166));return tn(i),null}if(o=Ko($r.current),fu(i)){h=i.stateNode,u=i.type;var C=i.memoizedProps;switch(h[Fr]=i,h[yl]=C,o=(i.mode&1)!==0,u){case"dialog":ut("cancel",h),ut("close",h);break;case"iframe":case"object":case"embed":ut("load",h);break;case"video":case"audio":for(v=0;v<pl.length;v++)ut(pl[v],h);break;case"source":ut("error",h);break;case"img":case"image":case"link":ut("error",h),ut("load",h);break;case"details":ut("toggle",h);break;case"input":Fn(h,C),ut("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!C.multiple},ut("invalid",h);break;case"textarea":Ue(h,C),ut("invalid",h)}Rr(u,C),v=null;for(var T in C)if(C.hasOwnProperty(T)){var I=C[T];T==="children"?typeof I=="string"?h.textContent!==I&&(C.suppressHydrationWarning!==!0&&su(h.textContent,I,o),v=["children",I]):typeof I=="number"&&h.textContent!==""+I&&(C.suppressHydrationWarning!==!0&&su(h.textContent,I,o),v=["children",""+I]):a.hasOwnProperty(T)&&I!=null&&T==="onScroll"&&ut("scroll",h)}switch(u){case"input":mt(h),Vn(h,C,!0);break;case"textarea":mt(h),Tt(h);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(h.onclick=ou)}h=v,i.updateQueue=h,h!==null&&(i.flags|=4)}else{T=v.nodeType===9?v:v.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ct(u)),o==="http://www.w3.org/1999/xhtml"?u==="script"?(o=T.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof h.is=="string"?o=T.createElement(u,{is:h.is}):(o=T.createElement(u),u==="select"&&(T=o,h.multiple?T.multiple=!0:h.size&&(T.size=h.size))):o=T.createElementNS(o,u),o[Fr]=i,o[yl]=h,R0(o,i,!1,!1),i.stateNode=o;e:{switch(T=Zi(u,h),u){case"dialog":ut("cancel",o),ut("close",o),v=h;break;case"iframe":case"object":case"embed":ut("load",o),v=h;break;case"video":case"audio":for(v=0;v<pl.length;v++)ut(pl[v],o);v=h;break;case"source":ut("error",o),v=h;break;case"img":case"image":case"link":ut("error",o),ut("load",o),v=h;break;case"details":ut("toggle",o),v=h;break;case"input":Fn(o,h),v=In(o,h),ut("invalid",o);break;case"option":v=h;break;case"select":o._wrapperState={wasMultiple:!!h.multiple},v=Z({},h,{value:void 0}),ut("invalid",o);break;case"textarea":Ue(o,h),v=_e(o,h),ut("invalid",o);break;default:v=h}Rr(u,v),I=v;for(C in I)if(I.hasOwnProperty(C)){var U=I[C];C==="style"?is(o,U):C==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&te(o,U)):C==="children"?typeof U=="string"?(u!=="textarea"||U!=="")&&Ce(o,U):typeof U=="number"&&Ce(o,""+U):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(a.hasOwnProperty(C)?U!=null&&C==="onScroll"&&ut("scroll",o):U!=null&&S(o,C,U,T))}switch(u){case"input":mt(o),Vn(o,h,!1);break;case"textarea":mt(o),Tt(o);break;case"option":h.value!=null&&o.setAttribute("value",""+be(h.value));break;case"select":o.multiple=!!h.multiple,C=h.value,C!=null?X(o,!!h.multiple,C,!1):h.defaultValue!=null&&X(o,!!h.multiple,h.defaultValue,!0);break;default:typeof v.onClick=="function"&&(o.onclick=ou)}switch(u){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 tn(i),null;case 6:if(o&&i.stateNode!=null)L0(o,i,o.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(n(166));if(u=Ko(Nl.current),Ko($r.current),fu(i)){if(h=i.stateNode,u=i.memoizedProps,h[Fr]=i,(C=h.nodeValue!==u)&&(o=zn,o!==null))switch(o.tag){case 3:su(h.nodeValue,u,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&su(h.nodeValue,u,(o.mode&1)!==0)}C&&(i.flags|=4)}else h=(u.nodeType===9?u:u.ownerDocument).createTextNode(h),h[Fr]=i,i.stateNode=h}return tn(i),null;case 13:if(dt(pt),h=i.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(ht&&Wn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)$v(),qa(),i.flags|=98560,C=!1;else if(C=fu(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[Fr]=i}else qa(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;tn(i),C=!1}else dr!==null&&(xh(dr),dr=null),C=!0;if(!C)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=u,i):(h=h!==null,h!==(o!==null&&o.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(o===null||(pt.current&1)!==0?Ot===0&&(Ot=3):bh())),i.updateQueue!==null&&(i.flags|=4),tn(i),null);case 4:return Ga(),ah(o,i),o===null&&gl(i.stateNode.containerInfo),tn(i),null;case 10:return Rm(i.type._context),tn(i),null;case 17:return Cn(i.type)&&iu(),tn(i),null;case 19:if(dt(pt),C=i.memoizedState,C===null)return tn(i),null;if(h=(i.flags&128)!==0,T=C.rendering,T===null)if(h)El(C,!1);else{if(Ot!==0||o!==null&&(o.flags&128)!==0)for(o=i.child;o!==null;){if(T=yu(o),T!==null){for(i.flags|=128,El(C,!1),h=T.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=u,u=i.child;u!==null;)C=u,o=h,C.flags&=14680066,T=C.alternate,T===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=T.childLanes,C.lanes=T.lanes,C.child=T.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=T.memoizedProps,C.memoizedState=T.memoizedState,C.updateQueue=T.updateQueue,C.type=T.type,o=T.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),u=u.sibling;return ot(pt,pt.current&1|2),i.child}o=o.sibling}C.tail!==null&&Ct()>ei&&(i.flags|=128,h=!0,El(C,!1),i.lanes=4194304)}else{if(!h)if(o=yu(T),o!==null){if(i.flags|=128,h=!0,u=o.updateQueue,u!==null&&(i.updateQueue=u,i.flags|=4),El(C,!0),C.tail===null&&C.tailMode==="hidden"&&!T.alternate&&!ht)return tn(i),null}else 2*Ct()-C.renderingStartTime>ei&&u!==1073741824&&(i.flags|=128,h=!0,El(C,!1),i.lanes=4194304);C.isBackwards?(T.sibling=i.child,i.child=T):(u=C.last,u!==null?u.sibling=T:i.child=T,C.last=T)}return C.tail!==null?(i=C.tail,C.rendering=i,C.tail=i.sibling,C.renderingStartTime=Ct(),i.sibling=null,u=pt.current,ot(pt,h?u&1|2:u&1),i):(tn(i),null);case 22:case 23:return vh(),h=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(Un&1073741824)!==0&&(tn(i),i.subtreeFlags&6&&(i.flags|=8192)):tn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function z3(o,i){switch(Em(i),i.tag){case 1:return Cn(i.type)&&iu(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return Ga(),dt(Nn),dt(Jt),Bm(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return $m(i),null;case 13:if(dt(pt),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));qa()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return dt(pt),null;case 4:return Ga(),null;case 10:return Rm(i.type._context),null;case 22:case 23:return vh(),null;case 24:return null;default:return null}}var _u=!1,nn=!1,W3=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Za(o,i){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(h){bt(o,i,h)}else u.current=null}function ih(o,i,u){try{u()}catch(h){bt(o,i,h)}}var I0=!1;function U3(o,i){if(vm=Kc,o=pv(),dm(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var v=h.anchorOffset,C=h.focusNode;h=h.focusOffset;try{u.nodeType,C.nodeType}catch{u=null;break e}var T=0,I=-1,U=-1,ne=0,ie=0,ce=o,ae=null;t:for(;;){for(var xe;ce!==u||v!==0&&ce.nodeType!==3||(I=T+v),ce!==C||h!==0&&ce.nodeType!==3||(U=T+h),ce.nodeType===3&&(T+=ce.nodeValue.length),(xe=ce.firstChild)!==null;)ae=ce,ce=xe;for(;;){if(ce===o)break t;if(ae===u&&++ne===v&&(I=T),ae===C&&++ie===h&&(U=T),(xe=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=xe}u=I===-1||U===-1?null:{start:I,end:U}}else u=null}u=u||{start:0,end:0}}else u=null;for(bm={focusedElem:o,selectionRange:u},Kc=!1,ve=i;ve!==null;)if(i=ve,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,ve=o;else for(;ve!==null;){i=ve;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 ke=je.memoizedProps,kt=je.memoizedState,J=i.stateNode,K=J.getSnapshotBeforeUpdate(i.elementType===i.type?ke:fr(i.type,ke),kt);J.__reactInternalSnapshotBeforeUpdate=K}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(fe){bt(i,i.return,fe)}if(o=i.sibling,o!==null){o.return=i.return,ve=o;break}ve=i.return}return je=I0,I0=!1,je}function Pl(o,i,u){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var v=h=h.next;do{if((v.tag&o)===o){var C=v.destroy;v.destroy=void 0,C!==void 0&&ih(i,u,C)}v=v.next}while(v!==h)}}function Eu(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&o)===o){var h=u.create;u.destroy=h()}u=u.next}while(u!==i)}}function lh(o){var i=o.ref;if(i!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof i=="function"?i(o):i.current=o}}function F0(o){var i=o.alternate;i!==null&&(o.alternate=null,F0(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[Fr],delete i[yl],delete i[Cm],delete i[S3],delete i[_3])),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 $0(o){return o.tag===5||o.tag===3||o.tag===4}function V0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||$0(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 ch(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(o,i):u.insertBefore(o,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(o,u)):(i=u,i.appendChild(o)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=ou));else if(h!==4&&(o=o.child,o!==null))for(ch(o,i,u),o=o.sibling;o!==null;)ch(o,i,u),o=o.sibling}function uh(o,i,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,i?u.insertBefore(o,i):u.appendChild(o);else if(h!==4&&(o=o.child,o!==null))for(uh(o,i,u),o=o.sibling;o!==null;)uh(o,i,u),o=o.sibling}var qt=null,mr=!1;function Ks(o,i,u){for(u=u.child;u!==null;)B0(o,i,u),u=u.sibling}function B0(o,i,u){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(Bc,u)}catch{}switch(u.tag){case 5:nn||Za(u,i);case 6:var h=qt,v=mr;qt=null,Ks(o,i,u),qt=h,mr=v,qt!==null&&(mr?(o=qt,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):qt.removeChild(u.stateNode));break;case 18:qt!==null&&(mr?(o=qt,u=u.stateNode,o.nodeType===8?Nm(o.parentNode,u):o.nodeType===1&&Nm(o,u),il(o)):Nm(qt,u.stateNode));break;case 4:h=qt,v=mr,qt=u.stateNode.containerInfo,mr=!0,Ks(o,i,u),qt=h,mr=v;break;case 0:case 11:case 14:case 15:if(!nn&&(h=u.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){v=h=h.next;do{var C=v,T=C.destroy;C=C.tag,T!==void 0&&((C&2)!==0||(C&4)!==0)&&ih(u,i,T),v=v.next}while(v!==h)}Ks(o,i,u);break;case 1:if(!nn&&(Za(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=u.memoizedProps,h.state=u.memoizedState,h.componentWillUnmount()}catch(I){bt(u,i,I)}Ks(o,i,u);break;case 21:Ks(o,i,u);break;case 22:u.mode&1?(nn=(h=nn)||u.memoizedState!==null,Ks(o,i,u),nn=h):Ks(o,i,u);break;default:Ks(o,i,u)}}function z0(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new W3),i.forEach(function(h){var v=J3.bind(null,o,h);u.has(h)||(u.add(h),h.then(v,v))})}}function hr(o,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var v=u[h];try{var C=o,T=i,I=T;e:for(;I!==null;){switch(I.tag){case 5:qt=I.stateNode,mr=!1;break e;case 3:qt=I.stateNode.containerInfo,mr=!0;break e;case 4:qt=I.stateNode.containerInfo,mr=!0;break e}I=I.return}if(qt===null)throw Error(n(160));B0(C,T,v),qt=null,mr=!1;var U=v.alternate;U!==null&&(U.return=null),v.return=null}catch(ne){bt(v,i,ne)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)W0(i,o),i=i.sibling}function W0(o,i){var u=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(hr(i,o),Br(o),h&4){try{Pl(3,o,o.return),Eu(3,o)}catch(ke){bt(o,o.return,ke)}try{Pl(5,o,o.return)}catch(ke){bt(o,o.return,ke)}}break;case 1:hr(i,o),Br(o),h&512&&u!==null&&Za(u,u.return);break;case 5:if(hr(i,o),Br(o),h&512&&u!==null&&Za(u,u.return),o.flags&32){var v=o.stateNode;try{Ce(v,"")}catch(ke){bt(o,o.return,ke)}}if(h&4&&(v=o.stateNode,v!=null)){var C=o.memoizedProps,T=u!==null?u.memoizedProps:C,I=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{I==="input"&&C.type==="radio"&&C.name!=null&&$n(v,C),Zi(I,T);var ne=Zi(I,C);for(T=0;T<U.length;T+=2){var ie=U[T],ce=U[T+1];ie==="style"?is(v,ce):ie==="dangerouslySetInnerHTML"?te(v,ce):ie==="children"?Ce(v,ce):S(v,ie,ce,ne)}switch(I){case"input":vn(v,C);break;case"textarea":et(v,C);break;case"select":var ae=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!C.multiple;var xe=C.value;xe!=null?X(v,!!C.multiple,xe,!1):ae!==!!C.multiple&&(C.defaultValue!=null?X(v,!!C.multiple,C.defaultValue,!0):X(v,!!C.multiple,C.multiple?[]:"",!1))}v[yl]=C}catch(ke){bt(o,o.return,ke)}}break;case 6:if(hr(i,o),Br(o),h&4){if(o.stateNode===null)throw Error(n(162));v=o.stateNode,C=o.memoizedProps;try{v.nodeValue=C}catch(ke){bt(o,o.return,ke)}}break;case 3:if(hr(i,o),Br(o),h&4&&u!==null&&u.memoizedState.isDehydrated)try{il(i.containerInfo)}catch(ke){bt(o,o.return,ke)}break;case 4:hr(i,o),Br(o);break;case 13:hr(i,o),Br(o),v=o.child,v.flags&8192&&(C=v.memoizedState!==null,v.stateNode.isHidden=C,!C||v.alternate!==null&&v.alternate.memoizedState!==null||(mh=Ct())),h&4&&z0(o);break;case 22:if(ie=u!==null&&u.memoizedState!==null,o.mode&1?(nn=(ne=nn)||ie,hr(i,o),nn=ne):hr(i,o),Br(o),h&8192){if(ne=o.memoizedState!==null,(o.stateNode.isHidden=ne)&&!ie&&(o.mode&1)!==0)for(ve=o,ie=o.child;ie!==null;){for(ce=ve=ie;ve!==null;){switch(ae=ve,xe=ae.child,ae.tag){case 0:case 11:case 14:case 15:Pl(4,ae,ae.return);break;case 1:Za(ae,ae.return);var je=ae.stateNode;if(typeof je.componentWillUnmount=="function"){h=ae,u=ae.return;try{i=h,je.props=i.memoizedProps,je.state=i.memoizedState,je.componentWillUnmount()}catch(ke){bt(h,u,ke)}}break;case 5:Za(ae,ae.return);break;case 22:if(ae.memoizedState!==null){q0(ce);continue}}xe!==null?(xe.return=ae,ve=xe):q0(ce)}ie=ie.sibling}e:for(ie=null,ce=o;;){if(ce.tag===5){if(ie===null){ie=ce;try{v=ce.stateNode,ne?(C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(I=ce.stateNode,U=ce.memoizedProps.style,T=U!=null&&U.hasOwnProperty("display")?U.display:null,I.style.display=bn("display",T))}catch(ke){bt(o,o.return,ke)}}}else if(ce.tag===6){if(ie===null)try{ce.stateNode.nodeValue=ne?"":ce.memoizedProps}catch(ke){bt(o,o.return,ke)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===o)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===o)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===o)break e;ie===ce&&(ie=null),ce=ce.return}ie===ce&&(ie=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:hr(i,o),Br(o),h&4&&z0(o);break;case 21:break;default:hr(i,o),Br(o)}}function Br(o){var i=o.flags;if(i&2){try{e:{for(var u=o.return;u!==null;){if($0(u)){var h=u;break e}u=u.return}throw Error(n(160))}switch(h.tag){case 5:var v=h.stateNode;h.flags&32&&(Ce(v,""),h.flags&=-33);var C=V0(o);uh(o,C,v);break;case 3:case 4:var T=h.stateNode.containerInfo,I=V0(o);ch(o,I,T);break;default:throw Error(n(161))}}catch(U){bt(o,o.return,U)}o.flags&=-3}i&4096&&(o.flags&=-4097)}function H3(o,i,u){ve=o,U0(o)}function U0(o,i,u){for(var h=(o.mode&1)!==0;ve!==null;){var v=ve,C=v.child;if(v.tag===22&&h){var T=v.memoizedState!==null||_u;if(!T){var I=v.alternate,U=I!==null&&I.memoizedState!==null||nn;I=_u;var ne=nn;if(_u=T,(nn=U)&&!ne)for(ve=v;ve!==null;)T=ve,U=T.child,T.tag===22&&T.memoizedState!==null?K0(v):U!==null?(U.return=T,ve=U):K0(v);for(;C!==null;)ve=C,U0(C),C=C.sibling;ve=v,_u=I,nn=ne}H0(o)}else(v.subtreeFlags&8772)!==0&&C!==null?(C.return=v,ve=C):H0(o)}}function H0(o){for(;ve!==null;){var i=ve;if((i.flags&8772)!==0){var u=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:nn||Eu(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!nn)if(u===null)h.componentDidMount();else{var v=i.elementType===i.type?u.memoizedProps:fr(i.type,u.memoizedProps);h.componentDidUpdate(v,u.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var C=i.updateQueue;C!==null&&qv(i,C,h);break;case 3:var T=i.updateQueue;if(T!==null){if(u=null,i.child!==null)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}qv(i,T,u)}break;case 5:var I=i.stateNode;if(u===null&&i.flags&4){u=I;var U=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&u.focus();break;case"img":U.src&&(u.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var ne=i.alternate;if(ne!==null){var ie=ne.memoizedState;if(ie!==null){var ce=ie.dehydrated;ce!==null&&il(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}nn||i.flags&512&&lh(i)}catch(ae){bt(i,i.return,ae)}}if(i===o){ve=null;break}if(u=i.sibling,u!==null){u.return=i.return,ve=u;break}ve=i.return}}function q0(o){for(;ve!==null;){var i=ve;if(i===o){ve=null;break}var u=i.sibling;if(u!==null){u.return=i.return,ve=u;break}ve=i.return}}function K0(o){for(;ve!==null;){var i=ve;try{switch(i.tag){case 0:case 11:case 15:var u=i.return;try{Eu(4,i)}catch(U){bt(i,u,U)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var v=i.return;try{h.componentDidMount()}catch(U){bt(i,v,U)}}var C=i.return;try{lh(i)}catch(U){bt(i,C,U)}break;case 5:var T=i.return;try{lh(i)}catch(U){bt(i,T,U)}}}catch(U){bt(i,i.return,U)}if(i===o){ve=null;break}var I=i.sibling;if(I!==null){I.return=i.return,ve=I;break}ve=i.return}}var q3=Math.ceil,Pu=E.ReactCurrentDispatcher,dh=E.ReactCurrentOwner,Jn=E.ReactCurrentBatchConfig,Ke=0,Vt=null,At=null,Kt=0,Un=0,Ja=zs(0),Ot=0,Tl=null,Qo=0,Tu=0,fh=0,Al=null,Sn=null,mh=0,ei=1/0,ps=null,Au=!1,hh=null,Ys=null,Mu=!1,Qs=null,Du=0,Ml=0,ph=null,Ru=-1,Ou=0;function dn(){return(Ke&6)!==0?Ct():Ru!==-1?Ru:Ru=Ct()}function Gs(o){return(o.mode&1)===0?1:(Ke&2)!==0&&Kt!==0?Kt&-Kt:P3.transition!==null?(Ou===0&&(Ou=Vy()),Ou):(o=tt,o!==0||(o=window.event,o=o===void 0?16:Qy(o.type)),o)}function pr(o,i,u,h){if(50<Ml)throw Ml=0,ph=null,Error(n(185));nl(o,u,h),((Ke&2)===0||o!==Vt)&&(o===Vt&&((Ke&2)===0&&(Tu|=u),Ot===4&&Xs(o,Kt)),_n(o,h),u===1&&Ke===0&&(i.mode&1)===0&&(ei=Ct()+500,cu&&Us()))}function _n(o,i){var u=o.callbackNode;P5(o,i);var h=Uc(o,o===Vt?Kt:0);if(h===0)u!==null&&Iy(u),o.callbackNode=null,o.callbackPriority=0;else if(i=h&-h,o.callbackPriority!==i){if(u!=null&&Iy(u),i===1)o.tag===0?E3(Q0.bind(null,o)):Rv(Q0.bind(null,o)),C3(function(){(Ke&6)===0&&Us()}),u=null;else{switch(By(h)){case 1:u=Yf;break;case 4:u=Fy;break;case 16:u=Vc;break;case 536870912:u=$y;break;default:u=Vc}u=rb(u,Y0.bind(null,o))}o.callbackPriority=i,o.callbackNode=u}}function Y0(o,i){if(Ru=-1,Ou=0,(Ke&6)!==0)throw Error(n(327));var u=o.callbackNode;if(ti()&&o.callbackNode!==u)return null;var h=Uc(o,o===Vt?Kt:0);if(h===0)return null;if((h&30)!==0||(h&o.expiredLanes)!==0||i)i=Lu(o,h);else{i=h;var v=Ke;Ke|=2;var C=X0();(Vt!==o||Kt!==i)&&(ps=null,ei=Ct()+500,Xo(o,i));do try{Q3();break}catch(I){G0(o,I)}while(!0);Dm(),Pu.current=C,Ke=v,At!==null?i=0:(Vt=null,Kt=0,i=Ot)}if(i!==0){if(i===2&&(v=Qf(o),v!==0&&(h=v,i=gh(o,v))),i===1)throw u=Tl,Xo(o,0),Xs(o,h),_n(o,Ct()),u;if(i===6)Xs(o,h);else{if(v=o.current.alternate,(h&30)===0&&!K3(v)&&(i=Lu(o,h),i===2&&(C=Qf(o),C!==0&&(h=C,i=gh(o,C))),i===1))throw u=Tl,Xo(o,0),Xs(o,h),_n(o,Ct()),u;switch(o.finishedWork=v,o.finishedLanes=h,i){case 0:case 1:throw Error(n(345));case 2:Zo(o,Sn,ps);break;case 3:if(Xs(o,h),(h&130023424)===h&&(i=mh+500-Ct(),10<i)){if(Uc(o,0)!==0)break;if(v=o.suspendedLanes,(v&h)!==h){dn(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=jm(Zo.bind(null,o,Sn,ps),i);break}Zo(o,Sn,ps);break;case 4:if(Xs(o,h),(h&4194240)===h)break;for(i=o.eventTimes,v=-1;0<h;){var T=31-cr(h);C=1<<T,T=i[T],T>v&&(v=T),h&=~C}if(h=v,h=Ct()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*q3(h/1960))-h,10<h){o.timeoutHandle=jm(Zo.bind(null,o,Sn,ps),h);break}Zo(o,Sn,ps);break;case 5:Zo(o,Sn,ps);break;default:throw Error(n(329))}}}return _n(o,Ct()),o.callbackNode===u?Y0.bind(null,o):null}function gh(o,i){var u=Al;return o.current.memoizedState.isDehydrated&&(Xo(o,i).flags|=256),o=Lu(o,i),o!==2&&(i=Sn,Sn=u,i!==null&&xh(i)),o}function xh(o){Sn===null?Sn=o:Sn.push.apply(Sn,o)}function K3(o){for(var i=o;;){if(i.flags&16384){var u=i.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var h=0;h<u.length;h++){var v=u[h],C=v.getSnapshot;v=v.value;try{if(!ur(C(),v))return!1}catch{return!1}}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;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 Xs(o,i){for(i&=~fh,i&=~Tu,o.suspendedLanes|=i,o.pingedLanes&=~i,o=o.expirationTimes;0<i;){var u=31-cr(i),h=1<<u;o[u]=-1,i&=~h}}function Q0(o){if((Ke&6)!==0)throw Error(n(327));ti();var i=Uc(o,0);if((i&1)===0)return _n(o,Ct()),null;var u=Lu(o,i);if(o.tag!==0&&u===2){var h=Qf(o);h!==0&&(i=h,u=gh(o,h))}if(u===1)throw u=Tl,Xo(o,0),Xs(o,i),_n(o,Ct()),u;if(u===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=i,Zo(o,Sn,ps),_n(o,Ct()),null}function yh(o,i){var u=Ke;Ke|=1;try{return o(i)}finally{Ke=u,Ke===0&&(ei=Ct()+500,cu&&Us())}}function Go(o){Qs!==null&&Qs.tag===0&&(Ke&6)===0&&ti();var i=Ke;Ke|=1;var u=Jn.transition,h=tt;try{if(Jn.transition=null,tt=1,o)return o()}finally{tt=h,Jn.transition=u,Ke=i,(Ke&6)===0&&Us()}}function vh(){Un=Ja.current,dt(Ja)}function Xo(o,i){o.finishedWork=null,o.finishedLanes=0;var u=o.timeoutHandle;if(u!==-1&&(o.timeoutHandle=-1,N3(u)),At!==null)for(u=At.return;u!==null;){var h=u;switch(Em(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&iu();break;case 3:Ga(),dt(Nn),dt(Jt),Bm();break;case 5:$m(h);break;case 4:Ga();break;case 13:dt(pt);break;case 19:dt(pt);break;case 10:Rm(h.type._context);break;case 22:case 23:vh()}u=u.return}if(Vt=o,At=o=Zs(o.current,null),Kt=Un=i,Ot=0,Tl=null,fh=Tu=Qo=0,Sn=Al=null,qo!==null){for(i=0;i<qo.length;i++)if(u=qo[i],h=u.interleaved,h!==null){u.interleaved=null;var v=h.next,C=u.pending;if(C!==null){var T=C.next;C.next=v,h.next=T}u.pending=h}qo=null}return o}function G0(o,i){do{var u=At;try{if(Dm(),vu.current=Nu,bu){for(var h=gt.memoizedState;h!==null;){var v=h.queue;v!==null&&(v.pending=null),h=h.next}bu=!1}if(Yo=0,$t=Rt=gt=null,Cl=!1,kl=0,dh.current=null,u===null||u.return===null){Ot=1,Tl=i,At=null;break}e:{var C=o,T=u.return,I=u,U=i;if(i=Kt,I.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var ne=U,ie=I,ce=ie.tag;if((ie.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=ie.alternate;ae?(ie.updateQueue=ae.updateQueue,ie.memoizedState=ae.memoizedState,ie.lanes=ae.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var xe=w0(T);if(xe!==null){xe.flags&=-257,j0(xe,T,I,C,i),xe.mode&1&&b0(C,ne,i),i=xe,U=ne;var je=i.updateQueue;if(je===null){var ke=new Set;ke.add(U),i.updateQueue=ke}else je.add(U);break e}else{if((i&1)===0){b0(C,ne,i),bh();break e}U=Error(n(426))}}else if(ht&&I.mode&1){var kt=w0(T);if(kt!==null){(kt.flags&65536)===0&&(kt.flags|=256),j0(kt,T,I,C,i),Am(Xa(U,I));break e}}C=U=Xa(U,I),Ot!==4&&(Ot=2),Al===null?Al=[C]:Al.push(C),C=T;do{switch(C.tag){case 3:C.flags|=65536,i&=-i,C.lanes|=i;var J=y0(C,U,i);Hv(C,J);break e;case 1:I=U;var K=C.type,ee=C.stateNode;if((C.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Ys===null||!Ys.has(ee)))){C.flags|=65536,i&=-i,C.lanes|=i;var fe=v0(C,I,i);Hv(C,fe);break e}}C=C.return}while(C!==null)}J0(u)}catch(Se){i=Se,At===u&&u!==null&&(At=u=u.return);continue}break}while(!0)}function X0(){var o=Pu.current;return Pu.current=Nu,o===null?Nu:o}function bh(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Vt===null||(Qo&268435455)===0&&(Tu&268435455)===0||Xs(Vt,Kt)}function Lu(o,i){var u=Ke;Ke|=2;var h=X0();(Vt!==o||Kt!==i)&&(ps=null,Xo(o,i));do try{Y3();break}catch(v){G0(o,v)}while(!0);if(Dm(),Ke=u,Pu.current=h,At!==null)throw Error(n(261));return Vt=null,Kt=0,Ot}function Y3(){for(;At!==null;)Z0(At)}function Q3(){for(;At!==null&&!b5();)Z0(At)}function Z0(o){var i=nb(o.alternate,o,Un);o.memoizedProps=o.pendingProps,i===null?J0(o):At=i,dh.current=null}function J0(o){var i=o;do{var u=i.alternate;if(o=i.return,(i.flags&32768)===0){if(u=B3(u,i,Un),u!==null){At=u;return}}else{if(u=z3(u,i),u!==null){u.flags&=32767,At=u;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Ot=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=o}while(i!==null);Ot===0&&(Ot=5)}function Zo(o,i,u){var h=tt,v=Jn.transition;try{Jn.transition=null,tt=1,G3(o,i,u,h)}finally{Jn.transition=v,tt=h}return null}function G3(o,i,u,h){do ti();while(Qs!==null);if((Ke&6)!==0)throw Error(n(327));u=o.finishedWork;var v=o.finishedLanes;if(u===null)return null;if(o.finishedWork=null,o.finishedLanes=0,u===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=u.lanes|u.childLanes;if(T5(o,C),o===Vt&&(At=Vt=null,Kt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Mu||(Mu=!0,rb(Vc,function(){return ti(),null})),C=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||C){C=Jn.transition,Jn.transition=null;var T=tt;tt=1;var I=Ke;Ke|=4,dh.current=null,U3(o,u),W0(u,o),g3(bm),Kc=!!vm,bm=vm=null,o.current=u,H3(u),w5(),Ke=I,tt=T,Jn.transition=C}else o.current=u;if(Mu&&(Mu=!1,Qs=o,Du=v),C=o.pendingLanes,C===0&&(Ys=null),C5(u.stateNode),_n(o,Ct()),i!==null)for(h=o.onRecoverableError,u=0;u<i.length;u++)v=i[u],h(v.value,{componentStack:v.stack,digest:v.digest});if(Au)throw Au=!1,o=hh,hh=null,o;return(Du&1)!==0&&o.tag!==0&&ti(),C=o.pendingLanes,(C&1)!==0?o===ph?Ml++:(Ml=0,ph=o):Ml=0,Us(),null}function ti(){if(Qs!==null){var o=By(Du),i=Jn.transition,u=tt;try{if(Jn.transition=null,tt=16>o?16:o,Qs===null)var h=!1;else{if(o=Qs,Qs=null,Du=0,(Ke&6)!==0)throw Error(n(331));var v=Ke;for(Ke|=4,ve=o.current;ve!==null;){var C=ve,T=C.child;if((ve.flags&16)!==0){var I=C.deletions;if(I!==null){for(var U=0;U<I.length;U++){var ne=I[U];for(ve=ne;ve!==null;){var ie=ve;switch(ie.tag){case 0:case 11:case 15:Pl(8,ie,C)}var ce=ie.child;if(ce!==null)ce.return=ie,ve=ce;else for(;ve!==null;){ie=ve;var ae=ie.sibling,xe=ie.return;if(F0(ie),ie===ne){ve=null;break}if(ae!==null){ae.return=xe,ve=ae;break}ve=xe}}}var je=C.alternate;if(je!==null){var ke=je.child;if(ke!==null){je.child=null;do{var kt=ke.sibling;ke.sibling=null,ke=kt}while(ke!==null)}}ve=C}}if((C.subtreeFlags&2064)!==0&&T!==null)T.return=C,ve=T;else e:for(;ve!==null;){if(C=ve,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Pl(9,C,C.return)}var J=C.sibling;if(J!==null){J.return=C.return,ve=J;break e}ve=C.return}}var K=o.current;for(ve=K;ve!==null;){T=ve;var ee=T.child;if((T.subtreeFlags&2064)!==0&&ee!==null)ee.return=T,ve=ee;else e:for(T=K;ve!==null;){if(I=ve,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:Eu(9,I)}}catch(Se){bt(I,I.return,Se)}if(I===T){ve=null;break e}var fe=I.sibling;if(fe!==null){fe.return=I.return,ve=fe;break e}ve=I.return}}if(Ke=v,Us(),Ir&&typeof Ir.onPostCommitFiberRoot=="function")try{Ir.onPostCommitFiberRoot(Bc,o)}catch{}h=!0}return h}finally{tt=u,Jn.transition=i}}return!1}function eb(o,i,u){i=Xa(u,i),i=y0(o,i,1),o=qs(o,i,1),i=dn(),o!==null&&(nl(o,1,i),_n(o,i))}function bt(o,i,u){if(o.tag===3)eb(o,o,u);else for(;i!==null;){if(i.tag===3){eb(i,o,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ys===null||!Ys.has(h))){o=Xa(u,o),o=v0(i,o,1),i=qs(i,o,1),o=dn(),i!==null&&(nl(i,1,o),_n(i,o));break}}i=i.return}}function X3(o,i,u){var h=o.pingCache;h!==null&&h.delete(i),i=dn(),o.pingedLanes|=o.suspendedLanes&u,Vt===o&&(Kt&u)===u&&(Ot===4||Ot===3&&(Kt&130023424)===Kt&&500>Ct()-mh?Xo(o,0):fh|=u),_n(o,i)}function tb(o,i){i===0&&((o.mode&1)===0?i=1:(i=Wc,Wc<<=1,(Wc&130023424)===0&&(Wc=4194304)));var u=dn();o=fs(o,i),o!==null&&(nl(o,i,u),_n(o,u))}function Z3(o){var i=o.memoizedState,u=0;i!==null&&(u=i.retryLane),tb(o,u)}function J3(o,i){var u=0;switch(o.tag){case 13:var h=o.stateNode,v=o.memoizedState;v!==null&&(u=v.retryLane);break;case 19:h=o.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(i),tb(o,u)}var nb;nb=function(o,i,u){if(o!==null)if(o.memoizedProps!==i.pendingProps||Nn.current)kn=!0;else{if((o.lanes&u)===0&&(i.flags&128)===0)return kn=!1,V3(o,i,u);kn=(o.flags&131072)!==0}else kn=!1,ht&&(i.flags&1048576)!==0&&Ov(i,du,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;Su(o,i),o=i.pendingProps;var v=Wa(i,Jt.current);Qa(i,u),v=Um(null,i,h,o,v,u);var C=Hm();return i.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,Cn(h)?(C=!0,lu(i)):C=!1,i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,Im(i),v.updater=Cu,i.stateNode=v,v._reactInternals=i,Xm(i,h,o,u),i=th(null,i,h,!0,C,u)):(i.tag=0,ht&&C&&_m(i),un(null,i,v,u),i=i.child),i;case 16:h=i.elementType;e:{switch(Su(o,i),o=i.pendingProps,v=h._init,h=v(h._payload),i.type=h,v=i.tag=t_(h),o=fr(h,o),v){case 0:i=eh(null,i,h,o,u);break e;case 1:i=E0(null,i,h,o,u);break e;case 11:i=N0(null,i,h,o,u);break e;case 14:i=C0(null,i,h,fr(h.type,o),u);break e}throw Error(n(306,h,""))}return i;case 0:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:fr(h,v),eh(o,i,h,v,u);case 1:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:fr(h,v),E0(o,i,h,v,u);case 3:e:{if(P0(i),o===null)throw Error(n(387));h=i.pendingProps,C=i.memoizedState,v=C.element,Uv(o,i),xu(i,h,null,u);var T=i.memoizedState;if(h=T.element,C.isDehydrated)if(C={element:h,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},i.updateQueue.baseState=C,i.memoizedState=C,i.flags&256){v=Xa(Error(n(423)),i),i=T0(o,i,h,u,v);break e}else if(h!==v){v=Xa(Error(n(424)),i),i=T0(o,i,h,u,v);break e}else for(Wn=Bs(i.stateNode.containerInfo.firstChild),zn=i,ht=!0,dr=null,u=zv(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(qa(),h===v){i=hs(o,i,u);break e}un(o,i,h,u)}i=i.child}return i;case 5:return Kv(i),o===null&&Tm(i),h=i.type,v=i.pendingProps,C=o!==null?o.memoizedProps:null,T=v.children,wm(h,v)?T=null:C!==null&&wm(h,C)&&(i.flags|=32),_0(o,i),un(o,i,T,u),i.child;case 6:return o===null&&Tm(i),null;case 13:return A0(o,i,u);case 4:return Fm(i,i.stateNode.containerInfo),h=i.pendingProps,o===null?i.child=Ka(i,null,h,u):un(o,i,h,u),i.child;case 11:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:fr(h,v),N0(o,i,h,v,u);case 7:return un(o,i,i.pendingProps,u),i.child;case 8:return un(o,i,i.pendingProps.children,u),i.child;case 12:return un(o,i,i.pendingProps.children,u),i.child;case 10:e:{if(h=i.type._context,v=i.pendingProps,C=i.memoizedProps,T=v.value,ot(hu,h._currentValue),h._currentValue=T,C!==null)if(ur(C.value,T)){if(C.children===v.children&&!Nn.current){i=hs(o,i,u);break e}}else for(C=i.child,C!==null&&(C.return=i);C!==null;){var I=C.dependencies;if(I!==null){T=C.child;for(var U=I.firstContext;U!==null;){if(U.context===h){if(C.tag===1){U=ms(-1,u&-u),U.tag=2;var ne=C.updateQueue;if(ne!==null){ne=ne.shared;var ie=ne.pending;ie===null?U.next=U:(U.next=ie.next,ie.next=U),ne.pending=U}}C.lanes|=u,U=C.alternate,U!==null&&(U.lanes|=u),Om(C.return,u,i),I.lanes|=u;break}U=U.next}}else if(C.tag===10)T=C.type===i.type?null:C.child;else if(C.tag===18){if(T=C.return,T===null)throw Error(n(341));T.lanes|=u,I=T.alternate,I!==null&&(I.lanes|=u),Om(T,u,i),T=C.sibling}else T=C.child;if(T!==null)T.return=C;else for(T=C;T!==null;){if(T===i){T=null;break}if(C=T.sibling,C!==null){C.return=T.return,T=C;break}T=T.return}C=T}un(o,i,v.children,u),i=i.child}return i;case 9:return v=i.type,h=i.pendingProps.children,Qa(i,u),v=Xn(v),h=h(v),i.flags|=1,un(o,i,h,u),i.child;case 14:return h=i.type,v=fr(h,i.pendingProps),v=fr(h.type,v),C0(o,i,h,v,u);case 15:return k0(o,i,i.type,i.pendingProps,u);case 17:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:fr(h,v),Su(o,i),i.tag=1,Cn(h)?(o=!0,lu(i)):o=!1,Qa(i,u),g0(i,h,v),Xm(i,h,v,u),th(null,i,h,!0,o,u);case 19:return D0(o,i,u);case 22:return S0(o,i,u)}throw Error(n(156,i.tag))};function rb(o,i){return Ly(o,i)}function e_(o,i,u,h){this.tag=o,this.key=u,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 er(o,i,u,h){return new e_(o,i,u,h)}function wh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function t_(o){if(typeof o=="function")return wh(o)?1:0;if(o!=null){if(o=o.$$typeof,o===B)return 11;if(o===L)return 14}return 2}function Zs(o,i){var u=o.alternate;return u===null?(u=er(o.tag,i,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=i,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,i=o.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function Iu(o,i,u,h,v,C){var T=2;if(h=o,typeof o=="function")wh(o)&&(T=1);else if(typeof o=="string")T=5;else e:switch(o){case M:return Jo(u.children,v,C,i);case D:T=8,v|=8;break;case Y:return o=er(12,u,i,v|2),o.elementType=Y,o.lanes=C,o;case se:return o=er(13,u,i,v),o.elementType=se,o.lanes=C,o;case G:return o=er(19,u,i,v),o.elementType=G,o.lanes=C,o;case $:return Fu(u,v,C,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case q:T=10;break e;case F:T=9;break e;case B:T=11;break e;case L:T=14;break e;case H:T=16,h=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=er(T,u,i,v),i.elementType=o,i.type=h,i.lanes=C,i}function Jo(o,i,u,h){return o=er(7,o,h,i),o.lanes=u,o}function Fu(o,i,u,h){return o=er(22,o,h,i),o.elementType=$,o.lanes=u,o.stateNode={isHidden:!1},o}function jh(o,i,u){return o=er(6,o,null,i),o.lanes=u,o}function Nh(o,i,u){return i=er(4,o.children!==null?o.children:[],o.key,i),i.lanes=u,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function n_(o,i,u,h,v){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=Gf(0),this.expirationTimes=Gf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gf(0),this.identifierPrefix=h,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Ch(o,i,u,h,v,C,T,I,U){return o=new n_(o,i,u,I,U),i===1?(i=1,C===!0&&(i|=8)):i=0,C=er(3,null,null,i),o.current=C,C.stateNode=o,C.memoizedState={element:h,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Im(C),o}function r_(o,i,u){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:h==null?null:""+h,children:o,containerInfo:i,implementation:u}}function sb(o){if(!o)return Ws;o=o._reactInternals;e:{if(Bo(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(Cn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(o.tag===1){var u=o.type;if(Cn(u))return Mv(o,u,i)}return i}function ob(o,i,u,h,v,C,T,I,U){return o=Ch(u,h,!0,o,v,C,T,I,U),o.context=sb(null),u=o.current,h=dn(),v=Gs(u),C=ms(h,v),C.callback=i??null,qs(u,C,v),o.current.lanes=v,nl(o,v,h),_n(o,h),o}function $u(o,i,u,h){var v=i.current,C=dn(),T=Gs(v);return u=sb(u),i.context===null?i.context=u:i.pendingContext=u,i=ms(C,T),i.payload={element:o},h=h===void 0?null:h,h!==null&&(i.callback=h),o=qs(v,i,T),o!==null&&(pr(o,v,T,C),gu(o,v,T)),T}function Vu(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 ab(o,i){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<i?u:i}}function kh(o,i){ab(o,i),(o=o.alternate)&&ab(o,i)}function s_(){return null}var ib=typeof reportError=="function"?reportError:function(o){console.error(o)};function Sh(o){this._internalRoot=o}Bu.prototype.render=Sh.prototype.render=function(o){var i=this._internalRoot;if(i===null)throw Error(n(409));$u(o,i,null,null)},Bu.prototype.unmount=Sh.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var i=o.containerInfo;Go(function(){$u(null,o,null,null)}),i[ls]=null}};function Bu(o){this._internalRoot=o}Bu.prototype.unstable_scheduleHydration=function(o){if(o){var i=Uy();o={blockedOn:null,target:o,priority:i};for(var u=0;u<Fs.length&&i!==0&&i<Fs[u].priority;u++);Fs.splice(u,0,o),u===0&&Ky(o)}};function _h(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function zu(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function lb(){}function o_(o,i,u,h,v){if(v){if(typeof h=="function"){var C=h;h=function(){var ne=Vu(T);C.call(ne)}}var T=ob(i,h,o,0,null,!1,!1,"",lb);return o._reactRootContainer=T,o[ls]=T.current,gl(o.nodeType===8?o.parentNode:o),Go(),T}for(;v=o.lastChild;)o.removeChild(v);if(typeof h=="function"){var I=h;h=function(){var ne=Vu(U);I.call(ne)}}var U=Ch(o,0,!1,null,null,!1,!1,"",lb);return o._reactRootContainer=U,o[ls]=U.current,gl(o.nodeType===8?o.parentNode:o),Go(function(){$u(i,U,u,h)}),U}function Wu(o,i,u,h,v){var C=u._reactRootContainer;if(C){var T=C;if(typeof v=="function"){var I=v;v=function(){var U=Vu(T);I.call(U)}}$u(i,T,o,v)}else T=o_(u,i,o,v,h);return Vu(T)}zy=function(o){switch(o.tag){case 3:var i=o.stateNode;if(i.current.memoizedState.isDehydrated){var u=tl(i.pendingLanes);u!==0&&(Xf(i,u|1),_n(i,Ct()),(Ke&6)===0&&(ei=Ct()+500,Us()))}break;case 13:Go(function(){var h=fs(o,1);if(h!==null){var v=dn();pr(h,o,1,v)}}),kh(o,1)}},Zf=function(o){if(o.tag===13){var i=fs(o,134217728);if(i!==null){var u=dn();pr(i,o,134217728,u)}kh(o,134217728)}},Wy=function(o){if(o.tag===13){var i=Gs(o),u=fs(o,i);if(u!==null){var h=dn();pr(u,o,i,h)}kh(o,i)}},Uy=function(){return tt},Hy=function(o,i){var u=tt;try{return tt=o,i()}finally{tt=u}},Da=function(o,i,u){switch(i){case"input":if(vn(o,u),i=u.name,u.type==="radio"&&i!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==o&&h.form===o.form){var v=au(h);if(!v)throw Error(n(90));on(h),vn(h,v)}}}break;case"textarea":et(o,u);break;case"select":i=u.value,i!=null&&X(o,!!u.multiple,i,!1)}},Ge=yh,rt=Go;var a_={usingClientEntryPoint:!1,Events:[vl,Ba,au,Ic,Le,yh]},Dl={findFiberByHostInstance:zo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},i_={bundleType:Dl.bundleType,version:Dl.version,rendererPackageName:Dl.rendererPackageName,rendererConfig:Dl.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=Ry(o),o===null?null:o.stateNode},findFiberByHostInstance:Dl.findFiberByHostInstance||s_,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 Uu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uu.isDisabled&&Uu.supportsFiber)try{Bc=Uu.inject(i_),Ir=Uu}catch{}}return En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a_,En.createPortal=function(o,i){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_h(i))throw Error(n(200));return r_(o,i,null,u)},En.createRoot=function(o,i){if(!_h(o))throw Error(n(299));var u=!1,h="",v=ib;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=Ch(o,1,!1,null,null,u,!1,h,v),o[ls]=i.current,gl(o.nodeType===8?o.parentNode:o),new Sh(i)},En.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=Ry(i),o=o===null?null:o.stateNode,o},En.flushSync=function(o){return Go(o)},En.hydrate=function(o,i,u){if(!zu(i))throw Error(n(200));return Wu(null,o,i,!0,u)},En.hydrateRoot=function(o,i,u){if(!_h(o))throw Error(n(405));var h=u!=null&&u.hydratedSources||null,v=!1,C="",T=ib;if(u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(C=u.identifierPrefix),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),i=ob(i,null,o,1,u??null,v,!1,C,T),o[ls]=i.current,gl(o),h)for(o=0;o<h.length;o++)u=h[o],v=u._getVersion,v=v(u._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[u,v]:i.mutableSourceEagerHydrationData.push(u,v);return new Bu(i)},En.render=function(o,i,u){if(!zu(i))throw Error(n(200));return Wu(null,o,i,!1,u)},En.unmountComponentAtNode=function(o){if(!zu(o))throw Error(n(40));return o._reactRootContainer?(Go(function(){Wu(null,null,o,!1,function(){o._reactRootContainer=null,o[ls]=null})}),!0):!1},En.unstable_batchedUpdates=yh,En.unstable_renderSubtreeIntoContainer=function(o,i,u,h){if(!zu(u))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Wu(o,i,u,!1,h)},En.version="18.3.1-next-f1338f8080-20240426",En}var xb;function Aj(){if(xb)return Ah.exports;xb=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(),Ah.exports=x_(),Ah.exports}var yb;function y_(){if(yb)return qu;yb=1;var e=Aj();return qu.createRoot=e.createRoot,qu.hydrateRoot=e.hydrateRoot,qu}var v_=y_();const b_=Ig(v_);var zi=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(){}},w_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},co,Lg,bj,j_=(bj=class{constructor(){Ee(this,co,w_);Ee(this,Lg,!1)}setTimeoutProvider(e){ge(this,co,e)}setTimeout(e,t){return z(this,co).setTimeout(e,t)}clearTimeout(e){z(this,co).clearTimeout(e)}setInterval(e,t){return z(this,co).setInterval(e,t)}clearInterval(e){z(this,co).clearInterval(e)}},co=new WeakMap,Lg=new WeakMap,bj),la=new j_;function N_(e){setTimeout(e,0)}var ja=typeof window>"u"||"Deno"in globalThis;function mn(){}function C_(e,t){return typeof e=="function"?e(t):e}function Pp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jo(e,t){return typeof e=="function"?e(t):e}function nr(e,t){return typeof e=="function"?e(t):e}function vb(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:l,queryKey:c,stale:d}=e;if(c){if(r){if(t.queryHash!==$g(c,t.options))return!1}else if(!tc(t.queryKey,c))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||a&&a!==t.state.fetchStatus||l&&!l(t))}function bb(e,t){const{exact:n,status:r,predicate:a,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Na(t.options.mutationKey)!==Na(l))return!1}else if(!tc(t.options.mutationKey,l))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function $g(e,t){return((t==null?void 0:t.queryKeyHashFn)||Na)(e)}function Na(e){return JSON.stringify(e,(t,n)=>Tp(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function tc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>tc(e[n],t[n])):!1}var k_=Object.prototype.hasOwnProperty;function Dj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=wb(e)&&wb(t);if(!r&&!(Tp(e)&&Tp(t)))return t;const l=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),d=c.length,f=r?new Array(d):{};let m=0;for(let p=0;p<d;p++){const g=r?p:c[p],b=e[g],y=t[g];if(b===y){f[g]=b,(r?p<l:k_.call(e,g))&&m++;continue}if(b===null||y===null||typeof b!="object"||typeof y!="object"){f[g]=y;continue}const k=Dj(b,y,n+1);f[g]=k,k===b&&m++}return l===d&&m===l?e:f}function Dd(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 wb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tp(e){if(!jb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jb(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jb(e){return Object.prototype.toString.call(e)==="[object Object]"}function S_(e){return new Promise(t=>{la.setTimeout(t,e)})}function Ap(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Dj(e,t):t}function __(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vg=Symbol();function Rj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Bg(e,t){return typeof e=="function"?e(...t):!!e}function P_(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 da,uo,yi,wj,T_=(wj=class extends zi{constructor(){super();Ee(this,da);Ee(this,uo);Ee(this,yi);ge(this,yi,t=>{if(!ja&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,uo)||this.setEventListener(z(this,yi))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,uo))==null||t.call(this),ge(this,uo,void 0))}setEventListener(t){var n;ge(this,yi,t),(n=z(this,uo))==null||n.call(this),ge(this,uo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){z(this,da)!==t&&(ge(this,da,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof z(this,da)=="boolean"?z(this,da):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},da=new WeakMap,uo=new WeakMap,yi=new WeakMap,wj),zg=new T_;function Mp(){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 A_=N_;function M_(){let e=[],t=0,n=d=>{d()},r=d=>{d()},a=A_;const l=d=>{t?e.push(d):a(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&a(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||c()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d},setScheduler:d=>{a=d}}}var Ft=M_(),vi,fo,bi,jj,D_=(jj=class extends zi{constructor(){super();Ee(this,vi,!0);Ee(this,fo);Ee(this,bi);ge(this,bi,t=>{if(!ja&&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(){z(this,fo)||this.setEventListener(z(this,bi))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,fo))==null||t.call(this),ge(this,fo,void 0))}setEventListener(t){var n;ge(this,bi,t),(n=z(this,fo))==null||n.call(this),ge(this,fo,t(this.setOnline.bind(this)))}setOnline(t){z(this,vi)!==t&&(ge(this,vi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return z(this,vi)}},vi=new WeakMap,fo=new WeakMap,bi=new WeakMap,jj),Rd=new D_;function R_(e){return Math.min(1e3*2**e,3e4)}function Oj(e){return(e??"online")==="online"?Rd.isOnline():!0}var Dp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Lj(e){let t=!1,n=0,r;const a=Mp(),l=()=>a.status!=="pending",c=N=>{var w;if(!l()){const _=new Dp(N);b(_),(w=e.onCancel)==null||w.call(e,_)}},d=()=>{t=!0},f=()=>{t=!1},m=()=>zg.isFocused()&&(e.networkMode==="always"||Rd.isOnline())&&e.canRun(),p=()=>Oj(e.networkMode)&&e.canRun(),g=N=>{l()||(r==null||r(),a.resolve(N))},b=N=>{l()||(r==null||r(),a.reject(N))},y=()=>new Promise(N=>{var w;r=_=>{(l()||m())&&N(_)},(w=e.onPause)==null||w.call(e)}).then(()=>{var N;r=void 0,l()||(N=e.onContinue)==null||N.call(e)}),k=()=>{if(l())return;let N;const w=n===0?e.initialPromise:void 0;try{N=w??e.fn()}catch(_){N=Promise.reject(_)}Promise.resolve(N).then(g).catch(_=>{var A;if(l())return;const j=e.retry??(ja?0:3),S=e.retryDelay??R_,E=typeof S=="function"?S(n,_):S,P=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,_);if(t||!P){b(_);return}n++,(A=e.onFail)==null||A.call(e,n,_),S_(E).then(()=>m()?void 0:y()).then(()=>{t?b(_):k()})})};return{promise:a,status:()=>a.status,cancel:c,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:f,canStart:p,start:()=>(p()?k():y().then(k),a)}}var fa,Nj,Ij=(Nj=class{constructor(){Ee(this,fa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pp(this.gcTime)&&ge(this,fa,la.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ja?1/0:300*1e3))}clearGcTimeout(){z(this,fa)&&(la.clearTimeout(z(this,fa)),ge(this,fa,void 0))}},fa=new WeakMap,Nj),ma,wi,tr,ha,Wt,hc,pa,br,ys,Cj,O_=(Cj=class extends Ij{constructor(t){super();Ee(this,br);Ee(this,ma);Ee(this,wi);Ee(this,tr);Ee(this,ha);Ee(this,Wt);Ee(this,hc);Ee(this,pa);ge(this,pa,!1),ge(this,hc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,ha,t.client),ge(this,tr,z(this,ha).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,ma,Cb(this.options)),this.state=t.state??z(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,Wt))==null?void 0:t.promise}setOptions(t){if(this.options={...z(this,hc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Cb(this.options);n.data!==void 0&&(this.setState(Nb(n.data,n.dataUpdatedAt)),ge(this,ma,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,tr).remove(this)}setData(t,n){const r=Ap(this.state.data,t,this.options);return $e(this,br,ys).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){$e(this,br,ys).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=z(this,Wt))==null?void 0:r.promise;return(a=z(this,Wt))==null||a.cancel(t),n?n.then(mn).catch(mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(z(this,ma))}isActive(){return this.observers.some(t=>nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>jo(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:!Mj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Wt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Wt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,tr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(z(this,Wt)&&(z(this,pa)?z(this,Wt).cancel({revert:!0}):z(this,Wt).cancelRetry()),this.scheduleGc()),z(this,tr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,br,ys).call(this,{type:"invalidate"})}async fetch(t,n){var f,m,p,g,b,y,k,N,w,_,j,S;if(this.state.fetchStatus!=="idle"&&((f=z(this,Wt))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,Wt))return z(this,Wt).continueRetry(),z(this,Wt).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:()=>(ge(this,pa,!0),r.signal)})},l=()=>{const E=Rj(this.options,n),A=(()=>{const M={client:z(this,ha),queryKey:this.queryKey,meta:this.meta};return a(M),M})();return ge(this,pa,!1),this.options.persister?this.options.persister(E,A,this):E(A)},d=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,ha),state:this.state,fetchFn:l};return a(E),E})();(m=this.options.behavior)==null||m.onFetch(d,this),ge(this,wi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=d.fetchOptions)==null?void 0:p.meta))&&$e(this,br,ys).call(this,{type:"fetch",meta:(g=d.fetchOptions)==null?void 0:g.meta}),ge(this,Wt,Lj({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:E=>{E instanceof Dp&&E.revert&&this.setState({...z(this,wi),fetchStatus:"idle"}),r.abort()},onFail:(E,P)=>{$e(this,br,ys).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{$e(this,br,ys).call(this,{type:"pause"})},onContinue:()=>{$e(this,br,ys).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const E=await z(this,Wt).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(y=(b=z(this,tr).config).onSuccess)==null||y.call(b,E,this),(N=(k=z(this,tr).config).onSettled)==null||N.call(k,E,this.state.error,this),E}catch(E){if(E instanceof Dp){if(E.silent)return z(this,Wt).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw $e(this,br,ys).call(this,{type:"error",error:E}),(_=(w=z(this,tr).config).onError)==null||_.call(w,E,this),(S=(j=z(this,tr).config).onSettled)==null||S.call(j,this.state.data,E,this),E}finally{this.scheduleGc()}}},ma=new WeakMap,wi=new WeakMap,tr=new WeakMap,ha=new WeakMap,Wt=new WeakMap,hc=new WeakMap,pa=new WeakMap,br=new WeakSet,ys=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,...Fj(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...Nb(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,wi,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),Ft.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,tr).notify({query:this,type:"updated",action:t})})},Cj);function Fj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Nb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Cb(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 Tn,He,pc,fn,ga,ji,vs,mo,gc,Ni,Ci,xa,ya,ho,ki,Ze,Hl,Rp,Op,Lp,Ip,Fp,$p,Vp,$j,kj,L_=(kj=class extends zi{constructor(t,n){super();Ee(this,Ze);Ee(this,Tn);Ee(this,He);Ee(this,pc);Ee(this,fn);Ee(this,ga);Ee(this,ji);Ee(this,vs);Ee(this,mo);Ee(this,gc);Ee(this,Ni);Ee(this,Ci);Ee(this,xa);Ee(this,ya);Ee(this,ho);Ee(this,ki,new Set);this.options=n,ge(this,Tn,t),ge(this,mo,null),ge(this,vs,Mp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,He).addObserver(this),kb(z(this,He),this.options)?$e(this,Ze,Hl).call(this):this.updateResult(),$e(this,Ze,Ip).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bp(z(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bp(z(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,Ze,Fp).call(this),$e(this,Ze,$p).call(this),z(this,He).removeObserver(this)}setOptions(t){const n=this.options,r=z(this,He);if(this.options=z(this,Tn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nr(this.options.enabled,z(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,Ze,Vp).call(this),z(this,He).setOptions(this.options),n._defaulted&&!Dd(this.options,n)&&z(this,Tn).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,He),observer:this});const a=this.hasListeners();a&&Sb(z(this,He),r,this.options,n)&&$e(this,Ze,Hl).call(this),this.updateResult(),a&&(z(this,He)!==r||nr(this.options.enabled,z(this,He))!==nr(n.enabled,z(this,He))||jo(this.options.staleTime,z(this,He))!==jo(n.staleTime,z(this,He)))&&$e(this,Ze,Rp).call(this);const l=$e(this,Ze,Op).call(this);a&&(z(this,He)!==r||nr(this.options.enabled,z(this,He))!==nr(n.enabled,z(this,He))||l!==z(this,ho))&&$e(this,Ze,Lp).call(this,l)}getOptimisticResult(t){const n=z(this,Tn).getQueryCache().build(z(this,Tn),t),r=this.createResult(n,t);return F_(this,r)&&(ge(this,fn,r),ge(this,ji,this.options),ge(this,ga,z(this,He).state)),r}getCurrentResult(){return z(this,fn)}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&&z(this,vs).status==="pending"&&z(this,vs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){z(this,ki).add(t)}getCurrentQuery(){return z(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=z(this,Tn).defaultQueryOptions(t),r=z(this,Tn).getQueryCache().build(z(this,Tn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return $e(this,Ze,Hl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,fn)))}createResult(t,n){var Y;const r=z(this,He),a=this.options,l=z(this,fn),c=z(this,ga),d=z(this,ji),m=t!==r?t.state:z(this,pc),{state:p}=t;let g={...p},b=!1,y;if(n._optimisticResults){const q=this.hasListeners(),F=!q&&kb(t,n),B=q&&Sb(t,r,n,a);(F||B)&&(g={...g,...Fj(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:N,status:w}=g;y=g.data;let _=!1;if(n.placeholderData!==void 0&&y===void 0&&w==="pending"){let q;l!=null&&l.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(q=l.data,_=!0):q=typeof n.placeholderData=="function"?n.placeholderData((Y=z(this,Ci))==null?void 0:Y.state.data,z(this,Ci)):n.placeholderData,q!==void 0&&(w="success",y=Ap(l==null?void 0:l.data,q,n),b=!0)}if(n.select&&y!==void 0&&!_)if(l&&y===(c==null?void 0:c.data)&&n.select===z(this,gc))y=z(this,Ni);else try{ge(this,gc,n.select),y=n.select(y),y=Ap(l==null?void 0:l.data,y,n),ge(this,Ni,y),ge(this,mo,null)}catch(q){ge(this,mo,q)}z(this,mo)&&(k=z(this,mo),y=z(this,Ni),N=Date.now(),w="error");const j=g.fetchStatus==="fetching",S=w==="pending",E=w==="error",P=S&&j,A=y!==void 0,D={status:w,fetchStatus:g.fetchStatus,isPending:S,isSuccess:w==="success",isError:E,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:N,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:j,isRefetching:j&&!S,isLoadingError:E&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:E&&A,isStale:Wg(t,n),refetch:this.refetch,promise:z(this,vs),isEnabled:nr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=D.data!==void 0,F=D.status==="error"&&!q,B=L=>{F?L.reject(D.error):q&&L.resolve(D.data)},se=()=>{const L=ge(this,vs,D.promise=Mp());B(L)},G=z(this,vs);switch(G.status){case"pending":t.queryHash===r.queryHash&&B(G);break;case"fulfilled":(F||D.data!==G.value)&&se();break;case"rejected":(!F||D.error!==G.reason)&&se();break}}return D}updateResult(){const t=z(this,fn),n=this.createResult(z(this,He),this.options);if(ge(this,ga,z(this,He).state),ge(this,ji,this.options),z(this,ga).data!==void 0&&ge(this,Ci,z(this,He)),Dd(n,t))return;ge(this,fn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!z(this,ki).size)return!0;const c=new Set(l??z(this,ki));return this.options.throwOnError&&c.add("error"),Object.keys(z(this,fn)).some(d=>{const f=d;return z(this,fn)[f]!==t[f]&&c.has(f)})};$e(this,Ze,$j).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,Ze,Ip).call(this)}},Tn=new WeakMap,He=new WeakMap,pc=new WeakMap,fn=new WeakMap,ga=new WeakMap,ji=new WeakMap,vs=new WeakMap,mo=new WeakMap,gc=new WeakMap,Ni=new WeakMap,Ci=new WeakMap,xa=new WeakMap,ya=new WeakMap,ho=new WeakMap,ki=new WeakMap,Ze=new WeakSet,Hl=function(t){$e(this,Ze,Vp).call(this);let n=z(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(mn)),n},Rp=function(){$e(this,Ze,Fp).call(this);const t=jo(this.options.staleTime,z(this,He));if(ja||z(this,fn).isStale||!Pp(t))return;const r=Mj(z(this,fn).dataUpdatedAt,t)+1;ge(this,xa,la.setTimeout(()=>{z(this,fn).isStale||this.updateResult()},r))},Op=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,He)):this.options.refetchInterval)??!1},Lp=function(t){$e(this,Ze,$p).call(this),ge(this,ho,t),!(ja||nr(this.options.enabled,z(this,He))===!1||!Pp(z(this,ho))||z(this,ho)===0)&&ge(this,ya,la.setInterval(()=>{(this.options.refetchIntervalInBackground||zg.isFocused())&&$e(this,Ze,Hl).call(this)},z(this,ho)))},Ip=function(){$e(this,Ze,Rp).call(this),$e(this,Ze,Lp).call(this,$e(this,Ze,Op).call(this))},Fp=function(){z(this,xa)&&(la.clearTimeout(z(this,xa)),ge(this,xa,void 0))},$p=function(){z(this,ya)&&(la.clearInterval(z(this,ya)),ge(this,ya,void 0))},Vp=function(){const t=z(this,Tn).getQueryCache().build(z(this,Tn),this.options);if(t===z(this,He))return;const n=z(this,He);ge(this,He,t),ge(this,pc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},$j=function(t){Ft.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(z(this,fn))}),z(this,Tn).getQueryCache().notify({query:z(this,He),type:"observerResultsUpdated"})})},kj);function I_(e,t){return nr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function kb(e,t){return I_(e,t)||e.state.data!==void 0&&Bp(e,t,t.refetchOnMount)}function Bp(e,t,n){if(nr(t.enabled,e)!==!1&&jo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Wg(e,t)}return!1}function Sb(e,t,n,r){return(e!==t||nr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Wg(e,n)}function Wg(e,t){return nr(t.enabled,e)!==!1&&e.isStaleByTime(jo(t.staleTime,e))}function F_(e,t){return!Dd(e.getCurrentResult(),t)}function _b(e){return{onFetch:(t,n)=>{var p,g,b,y,k;const r=t.options,a=(b=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,l=((y=t.state.data)==null?void 0:y.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const m=async()=>{let N=!1;const w=S=>{P_(S,()=>t.signal,()=>N=!0)},_=Rj(t.options,t.fetchOptions),j=async(S,E,P)=>{if(N)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const M=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:E,direction:P?"backward":"forward",meta:t.options.meta};return w(F),F})(),D=await _(M),{maxPages:Y}=t.options,q=P?E_:__;return{pages:q(S.pages,D,Y),pageParams:q(S.pageParams,E,Y)}};if(a&&l.length){const S=a==="backward",E=S?$_:Eb,P={pages:l,pageParams:c},A=E(r,P);d=await j(P,A,S)}else{const S=e??l.length;do{const E=f===0?c[0]??r.initialPageParam:Eb(r,d);if(f>0&&E==null)break;d=await j(d,E),f++}while(f<S)}return d};t.options.persister?t.fetchFn=()=>{var N,w;return(w=(N=t.options).persister)==null?void 0:w.call(N,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=m}}}function Eb(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 $_(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 xc,Wr,rn,va,Ur,oo,Sj,V_=(Sj=class extends Ij{constructor(t){super();Ee(this,Ur);Ee(this,xc);Ee(this,Wr);Ee(this,rn);Ee(this,va);ge(this,xc,t.client),this.mutationId=t.mutationId,ge(this,rn,t.mutationCache),ge(this,Wr,[]),this.state=t.state||Vj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Wr).includes(t)||(z(this,Wr).push(t),this.clearGcTimeout(),z(this,rn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,Wr,z(this,Wr).filter(n=>n!==t)),this.scheduleGc(),z(this,rn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Wr).length||(this.state.status==="pending"?this.scheduleGc():z(this,rn).remove(this))}continue(){var t;return((t=z(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,d,f,m,p,g,b,y,k,N,w,_,j,S,E,P,A,M;const n=()=>{$e(this,Ur,oo).call(this,{type:"continue"})},r={client:z(this,xc),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,va,Lj({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,Y)=>{$e(this,Ur,oo).call(this,{type:"failed",failureCount:D,error:Y})},onPause:()=>{$e(this,Ur,oo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,rn).canRun(this)}));const a=this.state.status==="pending",l=!z(this,va).canStart();try{if(a)n();else{$e(this,Ur,oo).call(this,{type:"pending",variables:t,isPaused:l}),z(this,rn).config.onMutate&&await z(this,rn).config.onMutate(t,this,r);const Y=await((d=(c=this.options).onMutate)==null?void 0:d.call(c,t,r));Y!==this.state.context&&$e(this,Ur,oo).call(this,{type:"pending",context:Y,variables:t,isPaused:l})}const D=await z(this,va).start();return await((m=(f=z(this,rn).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=(b=z(this,rn).config).onSettled)==null?void 0:y.call(b,D,null,this.state.variables,this.state.context,this,r)),await((N=(k=this.options).onSettled)==null?void 0:N.call(k,D,null,t,this.state.context,r)),$e(this,Ur,oo).call(this,{type:"success",data:D}),D}catch(D){try{await((_=(w=z(this,rn).config).onError)==null?void 0:_.call(w,D,t,this.state.context,this,r))}catch(Y){Promise.reject(Y)}try{await((S=(j=this.options).onError)==null?void 0:S.call(j,D,t,this.state.context,r))}catch(Y){Promise.reject(Y)}try{await((P=(E=z(this,rn).config).onSettled)==null?void 0:P.call(E,void 0,D,this.state.variables,this.state.context,this,r))}catch(Y){Promise.reject(Y)}try{await((M=(A=this.options).onSettled)==null?void 0:M.call(A,void 0,D,t,this.state.context,r))}catch(Y){Promise.reject(Y)}throw $e(this,Ur,oo).call(this,{type:"error",error:D}),D}finally{z(this,rn).runNext(this)}}},xc=new WeakMap,Wr=new WeakMap,rn=new WeakMap,va=new WeakMap,Ur=new WeakSet,oo=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),Ft.batch(()=>{z(this,Wr).forEach(r=>{r.onMutationUpdate(t)}),z(this,rn).notify({mutation:this,type:"updated",action:t})})},Sj);function Vj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bs,wr,yc,_j,B_=(_j=class extends zi{constructor(t={}){super();Ee(this,bs);Ee(this,wr);Ee(this,yc);this.config=t,ge(this,bs,new Set),ge(this,wr,new Map),ge(this,yc,0)}build(t,n,r){const a=new V_({client:t,mutationCache:this,mutationId:++Hu(this,yc)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){z(this,bs).add(t);const n=Ku(t);if(typeof n=="string"){const r=z(this,wr).get(n);r?r.push(t):z(this,wr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,bs).delete(t)){const n=Ku(t);if(typeof n=="string"){const r=z(this,wr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&z(this,wr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ku(t);if(typeof n=="string"){const r=z(this,wr).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=Ku(t);if(typeof n=="string"){const a=(r=z(this,wr).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(){Ft.batch(()=>{z(this,bs).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,bs).clear(),z(this,wr).clear()})}getAll(){return Array.from(z(this,bs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bb(n,r))}findAll(t={}){return this.getAll().filter(n=>bb(t,n))}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ft.batch(()=>Promise.all(t.map(n=>n.continue().catch(mn))))}},bs=new WeakMap,wr=new WeakMap,yc=new WeakMap,_j);function Ku(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ws,po,An,js,Cs,md,zp,Ej,z_=(Ej=class extends zi{constructor(n,r){super();Ee(this,Cs);Ee(this,ws);Ee(this,po);Ee(this,An);Ee(this,js);ge(this,ws,n),this.setOptions(r),this.bindMethods(),$e(this,Cs,md).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=z(this,ws).defaultMutationOptions(n),Dd(this.options,r)||z(this,ws).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,An),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Na(r.mutationKey)!==Na(this.options.mutationKey)?this.reset():((a=z(this,An))==null?void 0:a.state.status)==="pending"&&z(this,An).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=z(this,An))==null||n.removeObserver(this)}onMutationUpdate(n){$e(this,Cs,md).call(this),$e(this,Cs,zp).call(this,n)}getCurrentResult(){return z(this,po)}reset(){var n;(n=z(this,An))==null||n.removeObserver(this),ge(this,An,void 0),$e(this,Cs,md).call(this),$e(this,Cs,zp).call(this)}mutate(n,r){var a;return ge(this,js,r),(a=z(this,An))==null||a.removeObserver(this),ge(this,An,z(this,ws).getMutationCache().build(z(this,ws),this.options)),z(this,An).addObserver(this),z(this,An).execute(n)}},ws=new WeakMap,po=new WeakMap,An=new WeakMap,js=new WeakMap,Cs=new WeakSet,md=function(){var r;const n=((r=z(this,An))==null?void 0:r.state)??Vj();ge(this,po,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},zp=function(n){Ft.batch(()=>{var r,a,l,c,d,f,m,p;if(z(this,js)&&this.hasListeners()){const g=z(this,po).variables,b=z(this,po).context,y={client:z(this,ws),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=z(this,js)).onSuccess)==null||a.call(r,n.data,g,b,y)}catch(k){Promise.reject(k)}try{(c=(l=z(this,js)).onSettled)==null||c.call(l,n.data,null,g,b,y)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(f=(d=z(this,js)).onError)==null||f.call(d,n.error,g,b,y)}catch(k){Promise.reject(k)}try{(p=(m=z(this,js)).onSettled)==null||p.call(m,void 0,n.error,g,b,y)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(z(this,po))})})},Ej),Hr,Pj,W_=(Pj=class extends zi{constructor(t={}){super();Ee(this,Hr);this.config=t,ge(this,Hr,new Map)}build(t,n,r){const a=n.queryKey,l=n.queryHash??$g(a,n);let c=this.get(l);return c||(c=new O_({client:t,queryKey:a,queryHash:l,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(c)),c}add(t){z(this,Hr).has(t.queryHash)||(z(this,Hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=z(this,Hr).get(t.queryHash);n&&(t.destroy(),n===t&&z(this,Hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,Hr).get(t)}getAll(){return[...z(this,Hr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vb(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>vb(t,r)):n}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Hr=new WeakMap,Pj),wt,go,xo,Si,_i,yo,Ei,Pi,Tj,U_=(Tj=class{constructor(e={}){Ee(this,wt);Ee(this,go);Ee(this,xo);Ee(this,Si);Ee(this,_i);Ee(this,yo);Ee(this,Ei);Ee(this,Pi);ge(this,wt,e.queryCache||new W_),ge(this,go,e.mutationCache||new B_),ge(this,xo,e.defaultOptions||{}),ge(this,Si,new Map),ge(this,_i,new Map),ge(this,yo,0)}mount(){Hu(this,yo)._++,z(this,yo)===1&&(ge(this,Ei,zg.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,wt).onFocus())})),ge(this,Pi,Rd.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,wt).onOnline())})))}unmount(){var e,t;Hu(this,yo)._--,z(this,yo)===0&&((e=z(this,Ei))==null||e.call(this),ge(this,Ei,void 0),(t=z(this,Pi))==null||t.call(this),ge(this,Pi,void 0))}isFetching(e){return z(this,wt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,go).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,wt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=z(this,wt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(jo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return z(this,wt).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=z(this,wt).get(r.queryHash),l=a==null?void 0:a.state.data,c=C_(t,l);if(c!==void 0)return z(this,wt).build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Ft.batch(()=>z(this,wt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,wt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=z(this,wt);Ft.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=z(this,wt);return Ft.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ft.batch(()=>z(this,wt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(mn).catch(mn)}invalidateQueries(e,t={}){return Ft.batch(()=>(z(this,wt).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=Ft.batch(()=>z(this,wt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let l=a.fetch(void 0,n);return n.throwOnError||(l=l.catch(mn)),a.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=z(this,wt).build(this,t);return n.isStaleByTime(jo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(mn).catch(mn)}fetchInfiniteQuery(e){return e.behavior=_b(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(mn).catch(mn)}ensureInfiniteQueryData(e){return e.behavior=_b(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rd.isOnline()?z(this,go).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,wt)}getMutationCache(){return z(this,go)}getDefaultOptions(){return z(this,xo)}setDefaultOptions(e){ge(this,xo,e)}setQueryDefaults(e,t){z(this,Si).set(Na(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,Si).values()],n={};return t.forEach(r=>{tc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){z(this,_i).set(Na(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,_i).values()],n={};return t.forEach(r=>{tc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,xo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$g(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===Vg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,xo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,wt).clear(),z(this,go).clear()}},wt=new WeakMap,go=new WeakMap,xo=new WeakMap,Si=new WeakMap,_i=new WeakMap,yo=new WeakMap,Ei=new WeakMap,Pi=new WeakMap,Tj),Bj=x.createContext(void 0),ze=e=>{const t=x.useContext(Bj);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},H_=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Bj.Provider,{value:e,children:t})),zj=x.createContext(!1),q_=()=>x.useContext(zj);zj.Provider;function K_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Y_=x.createContext(K_()),Q_=()=>x.useContext(Y_),G_=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Bg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},X_=e=>{x.useEffect(()=>{e.clearReset()},[e])},Z_=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Bg(n,[e.error,r])),J_=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))}},eE=(e,t)=>e.isLoading&&e.isFetching&&!t,tE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Pb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nE(e,t,n){var b,y,k,N;const r=q_(),a=Q_(),l=ze(),c=l.defaultQueryOptions(e);(y=(b=l.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||y.call(b,c);const d=l.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",J_(c),G_(c,a,d),X_(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(w=>{const _=g?m.subscribe(Ft.batchCalls(w)):mn;return m.updateResult(),_},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(c)},[c,m]),tE(c,p))throw Pb(c,m,a);if(Z_({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw p.error;if((N=(k=l.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||N.call(k,c,p),c.experimental_prefetchInRender&&!ja&&eE(p,r)){const w=f?Pb(c,m,a):d==null?void 0:d.promise;w==null||w.catch(mn).finally(()=>{m.updateResult()})}return c.notifyOnChangeProps?p:m.trackResult(p)}function Zt(e,t){return nE(e,L_)}function We(e,t){const n=ze(),[r]=x.useState(()=>new z_(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(c=>r.subscribe(Ft.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=x.useCallback((c,d)=>{r.mutate(c,d).catch(mn)},[r]);if(a.error&&Bg(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}var cf=Aj();const Wj=Ig(cf);/**
|
|
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 nc(){return nc=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},nc.apply(this,arguments)}var vo;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(vo||(vo={}));const Tb="popstate";function rE(e){e===void 0&&(e={});function t(r,a){let{pathname:l,search:c,hash:d}=r.location;return Wp("",{pathname:l,search:c,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Od(a)}return oE(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ug(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sE(){return Math.random().toString(36).substr(2,8)}function Ab(e,t){return{usr:e.state,key:e.key,idx:t}}function Wp(e,t,n,r){return n===void 0&&(n=null),nc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Wi(t):t,{state:n,key:t&&t.key||r||sE()})}function Od(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 Wi(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 oE(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:l=!1}=r,c=a.history,d=vo.Pop,f=null,m=p();m==null&&(m=0,c.replaceState(nc({},c.state,{idx:m}),""));function p(){return(c.state||{idx:null}).idx}function g(){d=vo.Pop;let w=p(),_=w==null?null:w-m;m=w,f&&f({action:d,location:N.location,delta:_})}function b(w,_){d=vo.Push;let j=Wp(N.location,w,_);m=p()+1;let S=Ab(j,m),E=N.createHref(j);try{c.pushState(S,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(E)}l&&f&&f({action:d,location:N.location,delta:1})}function y(w,_){d=vo.Replace;let j=Wp(N.location,w,_);m=p();let S=Ab(j,m),E=N.createHref(j);c.replaceState(S,"",E),l&&f&&f({action:d,location:N.location,delta:0})}function k(w){let _=a.location.origin!=="null"?a.location.origin:a.location.href,j=typeof w=="string"?w:Od(w);return j=j.replace(/ $/,"%20"),Et(_,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,_)}let N={get action(){return d},get location(){return e(a,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Tb,g),f=w,()=>{a.removeEventListener(Tb,g),f=null}},createHref(w){return t(a,w)},createURL:k,encodeLocation(w){let _=k(w);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:y,go(w){return c.go(w)}};return N}var Mb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mb||(Mb={}));function aE(e,t,n){return n===void 0&&(n="/"),iE(e,t,n)}function iE(e,t,n,r){let a=typeof t=="string"?Wi(t):t,l=Hg(a.pathname||"/",n);if(l==null)return null;let c=Uj(e);lE(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let m=bE(l);d=xE(c[f],m)}return d}function Uj(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(l,c,d)=>{let f={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};f.relativePath.startsWith("/")&&(Et(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=No([r,f.relativePath]),p=n.concat(f);l.children&&l.children.length>0&&(Et(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),Uj(l.children,t,p,m)),!(l.path==null&&!l.index)&&t.push({path:m,score:pE(m,l.index),routesMeta:p})};return e.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,c);else for(let f of Hj(l.path))a(l,c,f)}),t}function Hj(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=Hj(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),a&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function lE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const cE=/^:[\w-]+$/,uE=3,dE=2,fE=1,mE=10,hE=-2,Db=e=>e==="*";function pE(e,t){let n=e.split("/"),r=n.length;return n.some(Db)&&(r+=hE),t&&(r+=dE),n.filter(a=>!Db(a)).reduce((a,l)=>a+(cE.test(l)?uE:l===""?fE:mE),r)}function gE(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 xE(e,t,n){let{routesMeta:r}=e,a={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],m=d===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=yE({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},p),b=f.route;if(!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:No([l,g.pathname]),pathnameBase:kE(No([l,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(l=No([l,g.pathnameBase]))}return c}function yE(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=vE(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((m,p,g)=>{let{paramName:b,isOptional:y}=p;if(b==="*"){let N=d[g]||"";c=l.slice(0,l.length-N.length).replace(/(.)\/+$/,"$1")}const k=d[g];return y&&!k?m[b]=void 0:m[b]=(k||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function vE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ug(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,d,f)=>(r.push({paramName:d,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 bE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ug(!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 Hg(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 wE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jE=e=>wE.test(e);function NE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Wi(e):e,l;if(n)if(jE(n))l=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Ug(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+n))}n.startsWith("/")?l=Rb(n.substring(1),"/"):l=Rb(n,t)}else l=t;return{pathname:l,search:SE(r),hash:_E(a)}}function Rb(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 Rh(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 CE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qg(e,t){let n=CE(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Kg(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Wi(e):(a=nc({},e),Et(!a.pathname||!a.pathname.includes("?"),Rh("?","pathname","search",a)),Et(!a.pathname||!a.pathname.includes("#"),Rh("#","pathname","hash",a)),Et(!a.search||!a.search.includes("#"),Rh("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;a.pathname=b.join("/")}d=g>=0?t[g]:"/"}let f=NE(a,d),m=c&&c!=="/"&&c.endsWith("/"),p=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||p)&&(f.pathname+="/"),f}const No=e=>e.join("/").replace(/\/\/+/g,"/"),kE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),SE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_E=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function EE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qj=["post","put","patch","delete"];new Set(qj);const PE=["get",...qj];new Set(PE);/**
|
|
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 rc(){return rc=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},rc.apply(this,arguments)}const Yg=x.createContext(null),TE=x.createContext(null),Mo=x.createContext(null),uf=x.createContext(null),Do=x.createContext({outlet:null,matches:[],isDataRoute:!1}),Kj=x.createContext(null);function AE(e,t){let{relative:n}=t===void 0?{}:t;Ui()||Et(!1);let{basename:r,navigator:a}=x.useContext(Mo),{hash:l,pathname:c,search:d}=Qj(e,{relative:n}),f=c;return r!=="/"&&(f=c==="/"?r:No([r,c])),a.createHref({pathname:f,search:d,hash:l})}function Ui(){return x.useContext(uf)!=null}function or(){return Ui()||Et(!1),x.useContext(uf).location}function Yj(e){x.useContext(Mo).static||x.useLayoutEffect(e)}function yn(){let{isDataRoute:e}=x.useContext(Do);return e?UE():ME()}function ME(){Ui()||Et(!1);let e=x.useContext(Yg),{basename:t,future:n,navigator:r}=x.useContext(Mo),{matches:a}=x.useContext(Do),{pathname:l}=or(),c=JSON.stringify(qg(a,n.v7_relativeSplatPath)),d=x.useRef(!1);return Yj(()=>{d.current=!0}),x.useCallback(function(m,p){if(p===void 0&&(p={}),!d.current)return;if(typeof m=="number"){r.go(m);return}let g=Kg(m,JSON.parse(c),l,p.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:No([t,g.pathname])),(p.replace?r.replace:r.push)(g,p.state,p)},[t,r,c,l,e])}function Qj(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(Mo),{matches:a}=x.useContext(Do),{pathname:l}=or(),c=JSON.stringify(qg(a,r.v7_relativeSplatPath));return x.useMemo(()=>Kg(e,JSON.parse(c),l,n==="path"),[e,c,l,n])}function DE(e,t){return RE(e,t)}function RE(e,t,n,r){Ui()||Et(!1);let{navigator:a}=x.useContext(Mo),{matches:l}=x.useContext(Do),c=l[l.length-1],d=c?c.params:{};c&&c.pathname;let f=c?c.pathnameBase:"/";c&&c.route;let m=or(),p;if(t){var g;let w=typeof t=="string"?Wi(t):t;f==="/"||(g=w.pathname)!=null&&g.startsWith(f)||Et(!1),p=w}else p=m;let b=p.pathname||"/",y=b;if(f!=="/"){let w=f.replace(/^\//,"").split("/");y="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let k=aE(e,{pathname:y}),N=$E(k&&k.map(w=>Object.assign({},w,{params:Object.assign({},d,w.params),pathname:No([f,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:No([f,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),l,n,r);return t&&N?x.createElement(uf.Provider,{value:{location:rc({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:vo.Pop}},N):N}function OE(){let e=WE(),t=EE(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 LE=x.createElement(OE,null);class IE 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(Do.Provider,{value:this.props.routeContext},x.createElement(Kj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FE(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(Yg);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Do.Provider,{value:t},r)}function $E(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,d=(a=n)==null?void 0:a.errors;if(d!=null){let p=c.findIndex(g=>g.route.id&&(d==null?void 0:d[g.route.id])!==void 0);p>=0||Et(!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:b,errors:y}=n,k=g.route.loader&&b[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,b)=>{let y,k=!1,N=null,w=null;n&&(y=d&&g.route.id?d[g.route.id]:void 0,N=g.route.errorElement||LE,f&&(m<0&&b===0?(HE("route-fallback"),k=!0,w=null):m===b&&(k=!0,w=g.route.hydrateFallbackElement||null)));let _=t.concat(c.slice(0,b+1)),j=()=>{let S;return y?S=N:k?S=w:g.route.Component?S=x.createElement(g.route.Component,null):g.route.element?S=g.route.element:S=p,x.createElement(FE,{match:g,routeContext:{outlet:p,matches:_,isDataRoute:n!=null},children:S})};return n&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(IE,{location:n.location,revalidation:n.revalidation,component:N,error:y,children:j(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):j()},null)}var Gj=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Gj||{}),Xj=(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})(Xj||{});function VE(e){let t=x.useContext(Yg);return t||Et(!1),t}function BE(e){let t=x.useContext(TE);return t||Et(!1),t}function zE(e){let t=x.useContext(Do);return t||Et(!1),t}function Zj(e){let t=zE(),n=t.matches[t.matches.length-1];return n.route.id||Et(!1),n.route.id}function WE(){var e;let t=x.useContext(Kj),n=BE(),r=Zj();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function UE(){let{router:e}=VE(Gj.UseNavigateStable),t=Zj(Xj.UseNavigateStable),n=x.useRef(!1);return Yj(()=>{n.current=!0}),x.useCallback(function(a,l){l===void 0&&(l={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,rc({fromRouteId:t},l)))},[e,t])}const Ob={};function HE(e,t,n){Ob[e]||(Ob[e]=!0)}function qE(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ld(e){let{to:t,replace:n,state:r,relative:a}=e;Ui()||Et(!1);let{future:l,static:c}=x.useContext(Mo),{matches:d}=x.useContext(Do),{pathname:f}=or(),m=yn(),p=Kg(t,qg(d,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 xt(e){Et(!1)}function KE(e){let{basename:t="/",children:n=null,location:r,navigationType:a=vo.Pop,navigator:l,static:c=!1,future:d}=e;Ui()&&Et(!1);let f=t.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:c,future:rc({v7_relativeSplatPath:!1},d)}),[f,d,l,c]);typeof r=="string"&&(r=Wi(r));let{pathname:p="/",search:g="",hash:b="",state:y=null,key:k="default"}=r,N=x.useMemo(()=>{let w=Hg(p,f);return w==null?null:{location:{pathname:w,search:g,hash:b,state:y,key:k},navigationType:a}},[f,p,g,b,y,k,a]);return N==null?null:x.createElement(Mo.Provider,{value:m},x.createElement(uf.Provider,{children:n,value:N}))}function Qg(e){let{children:t,location:n}=e;return DE(Up(t),n)}new Promise(()=>{});function Up(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,Up(r.props.children,l));return}r.type!==xt&&Et(!1),!r.props.index||!r.props.children||Et(!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=Up(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 Hp(){return Hp=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},Hp.apply(this,arguments)}function YE(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 QE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GE(e,t){return e.button===0&&(!t||t==="_self")&&!QE(e)}const XE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ZE="6";try{window.__reactRouterVersion=ZE}catch{}const JE="startTransition",Lb=lf[JE];function eP(e){let{basename:t,children:n,future:r,window:a}=e,l=x.useRef();l.current==null&&(l.current=rE({window:a,v5Compat:!0}));let c=l.current,[d,f]=x.useState({action:c.action,location:c.location}),{v7_startTransition:m}=r||{},p=x.useCallback(g=>{m&&Lb?Lb(()=>f(g)):f(g)},[f,m]);return x.useLayoutEffect(()=>c.listen(p),[c,p]),x.useEffect(()=>qE(r),[r]),x.createElement(KE,{basename:t,children:n,location:d.location,navigationType:d.action,navigator:c,future:r})}const tP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sc=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:l,replace:c,state:d,target:f,to:m,preventScrollReset:p,viewTransition:g}=t,b=YE(t,XE),{basename:y}=x.useContext(Mo),k,N=!1;if(typeof m=="string"&&nP.test(m)&&(k=m,tP))try{let S=new URL(window.location.href),E=m.startsWith("//")?new URL(S.protocol+m):new URL(m),P=Hg(E.pathname,y);E.origin===S.origin&&P!=null?m=P+E.search+E.hash:N=!0}catch{}let w=AE(m,{relative:a}),_=rP(m,{replace:c,state:d,target:f,preventScrollReset:p,relative:a,viewTransition:g});function j(S){r&&r(S),S.defaultPrevented||_(S)}return x.createElement("a",Hp({},b,{href:k||w,onClick:N||l?r:j,ref:n,target:f}))});var Ib;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ib||(Ib={}));var Fb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fb||(Fb={}));function rP(e,t){let{target:n,replace:r,state:a,preventScrollReset:l,relative:c,viewTransition:d}=t===void 0?{}:t,f=yn(),m=or(),p=Qj(e,{relative:c});return x.useCallback(g=>{if(GE(g,n)){g.preventDefault();let b=r!==void 0?r:Od(m)===Od(p);f(e,{replace:b,state:a,preventScrollReset:l,relative:c,viewTransition:d})}},[m,f,p,r,a,n,e,l,c,d])}var sP=e=>{switch(e){case"success":return iP;case"info":return cP;case"warning":return lP;case"error":return uP;default:return null}},oP=Array(12).fill(0),aP=({visible:e,className:t})=>ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},oP.map((n,r)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),iP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),lP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.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"})),cP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),uP=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),dP=ue.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"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fP=()=>{let[e,t]=ue.useState(document.hidden);return ue.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},qp=1,mP=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:qp++,l=this.toasts.find(d=>d.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(d=>d.id===a?(this.publish({...d,...e,id:a,title:n}),{...d,...e,id:a,dismissible:c,title:n}):d):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],ue.isValidElement(f))a=!1,this.create({id:n,type:"default",message:f});else if(pP(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)}),d=()=>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:d}:Object.assign(n,{unwrap:d})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||qp++;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}},Mn=new mP,hP=(e,t)=>{let n=(t==null?void 0:t.id)||qp++;return Mn.addToast({title:e,...t,id:n}),n},pP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",gP=hP,xP=()=>Mn.toasts,yP=()=>Mn.getActiveToasts();Object.assign(gP,{success:Mn.success,info:Mn.info,warning:Mn.warning,error:Mn.error,custom:Mn.custom,message:Mn.message,promise:Mn.promise,dismiss:Mn.dismiss,loading:Mn.loading},{getHistory:xP,getToasts:yP});function vP(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))}vP(`: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 Yu(e){return e.label!==void 0}var bP=3,wP="32px",jP="16px",$b=4e3,NP=356,CP=14,kP=20,SP=200;function gr(...e){return e.filter(Boolean).join(" ")}function _P(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var EP=e=>{var t,n,r,a,l,c,d,f,m,p,g;let{invert:b,toast:y,unstyled:k,interacting:N,setHeights:w,visibleToasts:_,heights:j,index:S,toasts:E,expanded:P,removeToast:A,defaultRichColors:M,closeButton:D,style:Y,cancelButtonStyle:q,actionButtonStyle:F,className:B="",descriptionClassName:se="",duration:G,position:L,gap:H,loadingIcon:$,expandByDefault:R,classNames:W,icons:Z,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:O}=e,[Q,re]=ue.useState(null),[oe,de]=ue.useState(null),[le,be]=ue.useState(!1),[we,pe]=ue.useState(!1),[mt,on]=ue.useState(!1),[Dt,In]=ue.useState(!1),[Fn,$n]=ue.useState(!1),[vn,Vn]=ue.useState(0),[an,lt]=ue.useState(0),X=ue.useRef(y.duration||G||$b),_e=ue.useRef(null),Ue=ue.useRef(null),et=S===0,Tt=S+1<=_,ct=y.type,Ut=y.dismissible!==!1,as=y.className||"",te=y.descriptionClassName||"",Ce=ue.useMemo(()=>j.findIndex(Le=>Le.toastId===y.id)||0,[j,y.id]),Te=ue.useMemo(()=>{var Le;return(Le=y.closeButton)!=null?Le:D},[y.closeButton,D]),ln=ue.useMemo(()=>y.duration||G||$b,[y.duration,G]),bn=ue.useRef(0),is=ue.useRef(0),Lc=ue.useRef(0),Rr=ue.useRef(null),[Zi,Ji]=L.split("-"),Ma=ue.useMemo(()=>j.reduce((Le,Ge,rt)=>rt>=Ce?Le:Le+Ge.height,0),[j,Ce]),Da=fP(),Rs=y.invert||b,Or=ct==="loading";is.current=ue.useMemo(()=>Ce*H+Ma,[Ce,Ma]),ue.useEffect(()=>{X.current=ln},[ln]),ue.useEffect(()=>{be(!0)},[]),ue.useEffect(()=>{let Le=Ue.current;if(Le){let Ge=Le.getBoundingClientRect().height;return lt(Ge),w(rt=>[{toastId:y.id,height:Ge,position:y.position},...rt]),()=>w(rt=>rt.filter(cn=>cn.toastId!==y.id))}},[w,y.id]),ue.useLayoutEffect(()=>{if(!le)return;let Le=Ue.current,Ge=Le.style.height;Le.style.height="auto";let rt=Le.getBoundingClientRect().height;Le.style.height=Ge,lt(rt),w(cn=>cn.find(wn=>wn.toastId===y.id)?cn.map(wn=>wn.toastId===y.id?{...wn,height:rt}:wn):[{toastId:y.id,height:rt,position:y.position},...cn])},[le,y.title,y.description,w,y.id]);let ir=ue.useCallback(()=>{pe(!0),Vn(is.current),w(Le=>Le.filter(Ge=>Ge.toastId!==y.id)),setTimeout(()=>{A(y)},SP)},[y,A,w,is]);ue.useEffect(()=>{if(y.promise&&ct==="loading"||y.duration===1/0||y.type==="loading")return;let Le;return P||N||O&&Da?(()=>{if(Lc.current<bn.current){let Ge=new Date().getTime()-bn.current;X.current=X.current-Ge}Lc.current=new Date().getTime()})():X.current!==1/0&&(bn.current=new Date().getTime(),Le=setTimeout(()=>{var Ge;(Ge=y.onAutoClose)==null||Ge.call(y,y),ir()},X.current)),()=>clearTimeout(Le)},[P,N,y,ct,O,Da,ir]),ue.useEffect(()=>{y.delete&&ir()},[ir,y.delete]);function Ic(){var Le,Ge,rt;return Z!=null&&Z.loading?ue.createElement("div",{className:gr(W==null?void 0:W.loader,(Le=y==null?void 0:y.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":ct==="loading"},Z.loading):$?ue.createElement("div",{className:gr(W==null?void 0:W.loader,(Ge=y==null?void 0:y.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":ct==="loading"},$):ue.createElement(aP,{className:gr(W==null?void 0:W.loader,(rt=y==null?void 0:y.classNames)==null?void 0:rt.loader),visible:ct==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Ue,className:gr(B,as,W==null?void 0:W.toast,(t=y==null?void 0:y.classNames)==null?void 0:t.toast,W==null?void 0:W.default,W==null?void 0:W[ct],(n=y==null?void 0:y.classNames)==null?void 0:n[ct]),"data-sonner-toast":"","data-rich-colors":(r=y.richColors)!=null?r:M,"data-styled":!(y.jsx||y.unstyled||k),"data-mounted":le,"data-promise":!!y.promise,"data-swiped":Fn,"data-removed":we,"data-visible":Tt,"data-y-position":Zi,"data-x-position":Ji,"data-index":S,"data-front":et,"data-swiping":mt,"data-dismissible":Ut,"data-type":ct,"data-invert":Rs,"data-swipe-out":Dt,"data-swipe-direction":oe,"data-expanded":!!(P||R&&le),style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${we?vn:is.current}px`,"--initial-height":R?"auto":`${an}px`,...Y,...y.style},onDragEnd:()=>{on(!1),re(null),Rr.current=null},onPointerDown:Le=>{Or||!Ut||(_e.current=new Date,Vn(is.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(on(!0),Rr.current={x:Le.clientX,y:Le.clientY}))},onPointerUp:()=>{var Le,Ge,rt,cn;if(Dt||!Ut)return;Rr.current=null;let wn=Number(((Le=Ue.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jn=Number(((Ge=Ue.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lr=new Date().getTime()-((rt=_e.current)==null?void 0:rt.getTime()),Ht=Q==="x"?wn:jn,Lr=Math.abs(Ht)/lr;if(Math.abs(Ht)>=kP||Lr>.11){Vn(is.current),(cn=y.onDismiss)==null||cn.call(y,y),de(Q==="x"?wn>0?"right":"left":jn>0?"down":"up"),ir(),In(!0),$n(!1);return}on(!1),re(null)},onPointerMove:Le=>{var Ge,rt,cn,wn;if(!Rr.current||!Ut||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;let jn=Le.clientY-Rr.current.y,lr=Le.clientX-Rr.current.x,Ht=(rt=e.swipeDirections)!=null?rt:_P(L);!Q&&(Math.abs(lr)>1||Math.abs(jn)>1)&&re(Math.abs(lr)>Math.abs(jn)?"x":"y");let Lr={x:0,y:0};Q==="y"?(Ht.includes("top")||Ht.includes("bottom"))&&(Ht.includes("top")&&jn<0||Ht.includes("bottom")&&jn>0)&&(Lr.y=jn):Q==="x"&&(Ht.includes("left")||Ht.includes("right"))&&(Ht.includes("left")&&lr<0||Ht.includes("right")&&lr>0)&&(Lr.x=lr),(Math.abs(Lr.x)>0||Math.abs(Lr.y)>0)&&$n(!0),(cn=Ue.current)==null||cn.style.setProperty("--swipe-amount-x",`${Lr.x}px`),(wn=Ue.current)==null||wn.style.setProperty("--swipe-amount-y",`${Lr.y}px`)}},Te&&!y.jsx?ue.createElement("button",{"aria-label":V,"data-disabled":Or,"data-close-button":!0,onClick:Or||!Ut?()=>{}:()=>{var Le;ir(),(Le=y.onDismiss)==null||Le.call(y,y)},className:gr(W==null?void 0:W.closeButton,(a=y==null?void 0:y.classNames)==null?void 0:a.closeButton)},(l=Z==null?void 0:Z.close)!=null?l:dP):null,y.jsx||x.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:ue.createElement(ue.Fragment,null,ct||y.icon||y.promise?ue.createElement("div",{"data-icon":"",className:gr(W==null?void 0:W.icon,(c=y==null?void 0:y.classNames)==null?void 0:c.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||Ic():null,y.type!=="loading"?y.icon||(Z==null?void 0:Z[ct])||sP(ct):null):null,ue.createElement("div",{"data-content":"",className:gr(W==null?void 0:W.content,(d=y==null?void 0:y.classNames)==null?void 0:d.content)},ue.createElement("div",{"data-title":"",className:gr(W==null?void 0:W.title,(f=y==null?void 0:y.classNames)==null?void 0:f.title)},typeof y.title=="function"?y.title():y.title),y.description?ue.createElement("div",{"data-description":"",className:gr(se,te,W==null?void 0:W.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&&Yu(y.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||q,onClick:Le=>{var Ge,rt;Yu(y.cancel)&&Ut&&((rt=(Ge=y.cancel).onClick)==null||rt.call(Ge,Le),ir())},className:gr(W==null?void 0:W.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&&Yu(y.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||F,onClick:Le=>{var Ge,rt;Yu(y.action)&&((rt=(Ge=y.action).onClick)==null||rt.call(Ge,Le),!Le.defaultPrevented&&ir())},className:gr(W==null?void 0:W.actionButton,(g=y==null?void 0:y.classNames)==null?void 0:g.actionButton)},y.action.label):null))};function Vb(){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 PP(e,t){let n={};return[e,t].forEach((r,a)=>{let l=a===1,c=l?"--mobile-offset":"--offset",d=l?jP:wP;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}`]=d:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(d)}),n}var TP=x.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:m,theme:p="light",richColors:g,duration:b,style:y,visibleToasts:k=bP,toastOptions:N,dir:w=Vb(),gap:_=CP,loadingIcon:j,icons:S,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:P}=e,[A,M]=ue.useState([]),D=ue.useMemo(()=>Array.from(new Set([r].concat(A.filter(O=>O.position).map(O=>O.position)))),[A,r]),[Y,q]=ue.useState([]),[F,B]=ue.useState(!1),[se,G]=ue.useState(!1),[L,H]=ue.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ue.useRef(null),R=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ue.useRef(null),Z=ue.useRef(!1),V=ue.useCallback(O=>{M(Q=>{var re;return(re=Q.find(oe=>oe.id===O.id))!=null&&re.delete||Mn.dismiss(O.id),Q.filter(({id:oe})=>oe!==O.id)})},[]);return ue.useEffect(()=>Mn.subscribe(O=>{if(O.dismiss){M(Q=>Q.map(re=>re.id===O.id?{...re,delete:!0}:re));return}setTimeout(()=>{Wj.flushSync(()=>{M(Q=>{let re=Q.findIndex(oe=>oe.id===O.id);return re!==-1?[...Q.slice(0,re),{...Q[re],...O},...Q.slice(re+1)]:[O,...Q]})})})}),[]),ue.useEffect(()=>{if(p!=="system"){H(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:Q})=>{H(Q?"dark":"light")})}catch{O.addListener(({matches:re})=>{try{H(re?"dark":"light")}catch(oe){console.error(oe)}})}},[p]),ue.useEffect(()=>{A.length<=1&&B(!1)},[A]),ue.useEffect(()=>{let O=Q=>{var re,oe;a.every(de=>Q[de]||Q.code===de)&&(B(!0),(re=$.current)==null||re.focus()),Q.code==="Escape"&&(document.activeElement===$.current||(oe=$.current)!=null&&oe.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),ue.useEffect(()=>{if($.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,Z.current=!1)}},[$.current]),ue.createElement("section",{ref:t,"aria-label":`${E} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((O,Q)=>{var re;let[oe,de]=O.split("-");return A.length?ue.createElement("ol",{key:O,dir:w==="auto"?Vb():w,tabIndex:-1,ref:$,className:d,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":oe,"data-lifted":F&&A.length>1&&!l,"data-x-position":de,style:{"--front-toast-height":`${((re=Y[0])==null?void 0:re.height)||0}px`,"--width":`${NP}px`,"--gap":`${_}px`,...y,...PP(f,m)},onBlur:le=>{Z.current&&!le.currentTarget.contains(le.relatedTarget)&&(Z.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,W.current=le.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{se||B(!1)},onDragEnd:()=>B(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},A.filter(le=>!le.position&&Q===0||le.position===O).map((le,be)=>{var we,pe;return ue.createElement(EP,{key:le.id,icons:S,index:be,toast:le,defaultRichColors:g,duration:(we=N==null?void 0:N.duration)!=null?we:b,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:n,visibleToasts:k,closeButton:(pe=N==null?void 0:N.closeButton)!=null?pe:c,interacting:se,position:O,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,removeToast:V,toasts:A.filter(mt=>mt.position==le.position),heights:Y.filter(mt=>mt.position==le.position),setHeights:q,expandByDefault:l,gap:_,loadingIcon:j,expanded:F,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const AP=({...e})=>s.jsx(TP,{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}),MP=1,DP=1e6;let Oh=0;function RP(){return Oh=(Oh+1)%Number.MAX_SAFE_INTEGER,Oh.toString()}const Lh=new Map,Bb=e=>{if(Lh.has(e))return;const t=setTimeout(()=>{Lh.delete(e),Ql({type:"REMOVE_TOAST",toastId:e})},DP);Lh.set(e,t)},OP=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MP)};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?Bb(n):e.toasts.forEach(r=>{Bb(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)}}},hd=[];let pd={toasts:[]};function Ql(e){pd=OP(pd,e),hd.forEach(t=>{t(pd)})}function he({...e}){const t=RP(),n=a=>Ql({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Ql({type:"DISMISS_TOAST",toastId:t});return Ql({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function LP(){const[e,t]=x.useState(pd);return x.useEffect(()=>(hd.push(t),()=>{const n=hd.indexOf(t);n>-1&&hd.splice(n,1)}),[e]),{...e,toast:he,dismiss:n=>Ql({type:"DISMISS_TOAST",toastId:n})}}function Qe(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 zb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nr(...e){return t=>{let n=!1;const r=e.map(a=>{const l=zb(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():zb(e[a],null)}}}}function Pt(...e){return x.useCallback(Nr(...e),e)}function IP(e,t){const n=x.createContext(t),r=l=>{const{children:c,...d}=l,f=x.useMemo(()=>d,Object.values(d));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 Ro(e,t=[]){let n=[];function r(l,c){const d=x.createContext(c),f=n.length;n=[...n,c];const m=g=>{var _;const{scope:b,children:y,...k}=g,N=((_=b==null?void 0:b[e])==null?void 0:_[f])||d,w=x.useMemo(()=>k,Object.values(k));return s.jsx(N.Provider,{value:w,children:y})};m.displayName=l+"Provider";function p(g,b){var N;const y=((N=b==null?void 0:b[e])==null?void 0:N[f])||d,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(d){const f=(d==null?void 0:d[e])||l;return x.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return a.scopeName=e,[r,FP(a,...t)]}function FP(...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((d,{useScope:f,scopeName:m})=>{const g=f(l)[`__scope${m}`];return{...d,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Wb(e){const t=$P(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,d=x.Children.toArray(l),f=d.find(BP);if(f){const m=f.props.children,p=d.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 $P(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=WP(a),d=zP(l,a.props);return a.type!==x.Fragment&&(d.ref=r?Nr(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VP=Symbol("radix.slottable");function BP(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VP}function zP(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function WP(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 UP(e){const t=e+"CollectionProvider",[n,r]=Ro(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=N=>{const{scope:w,children:_}=N,j=ue.useRef(null),S=ue.useRef(new Map).current;return s.jsx(a,{scope:w,itemMap:S,collectionRef:j,children:_})};c.displayName=t;const d=e+"CollectionSlot",f=Wb(d),m=ue.forwardRef((N,w)=>{const{scope:_,children:j}=N,S=l(d,_),E=Pt(w,S.collectionRef);return s.jsx(f,{ref:E,children:j})});m.displayName=d;const p=e+"CollectionItemSlot",g="data-radix-collection-item",b=Wb(p),y=ue.forwardRef((N,w)=>{const{scope:_,children:j,...S}=N,E=ue.useRef(null),P=Pt(w,E),A=l(p,_);return ue.useEffect(()=>(A.itemMap.set(E,{ref:E,...S}),()=>void A.itemMap.delete(E))),s.jsx(b,{[g]:"",ref:P,children:j})});y.displayName=p;function k(N){const w=l(e+"CollectionConsumer",N);return ue.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const S=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((A,M)=>S.indexOf(A.ref.current)-S.indexOf(M.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:y},k,r]}function HP(e){const t=qP(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,d=x.Children.toArray(l),f=d.find(YP);if(f){const m=f.props.children,p=d.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 qP(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=GP(a),d=QP(l,a.props);return a.type!==x.Fragment&&(d.ref=r?Nr(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KP=Symbol("radix.slottable");function YP(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KP}function QP(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function GP(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 XP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=XP.reduce((e,t)=>{const n=HP(`Primitive.${t}`),r=x.forwardRef((a,l)=>{const{asChild:c,...d}=a,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Jj(e,t){e&&cf.flushSync(()=>e.dispatchEvent(t))}function ts(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 ZP(e,t=globalThis==null?void 0:globalThis.document){const n=ts(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 JP="DismissableLayer",Kp="dismissableLayer.update",eT="dismissableLayer.pointerDownOutside",tT="dismissableLayer.focusOutside",Ub,eN=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vc=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,m=x.useContext(eN),[p,g]=x.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),k=Pt(t,M=>g(M)),N=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=N.indexOf(w),j=p?N.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,E=j>=_,P=rT(M=>{const D=M.target,Y=[...m.branches].some(q=>q.contains(D));!E||Y||(a==null||a(M),c==null||c(M),M.defaultPrevented||d==null||d())},b),A=sT(M=>{const D=M.target;[...m.branches].some(q=>q.contains(D))||(l==null||l(M),c==null||c(M),M.defaultPrevented||d==null||d())},b);return ZP(M=>{j===m.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&d&&(M.preventDefault(),d()))},b),x.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ub=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Hb(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Ub)}},[p,b,n,m]),x.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Hb())},[p,m]),x.useEffect(()=>{const M=()=>y({});return document.addEventListener(Kp,M),()=>document.removeEventListener(Kp,M)},[]),s.jsx(qe.div,{...f,ref:k,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Qe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Qe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Qe(e.onPointerDownCapture,P.onPointerDownCapture)})});vc.displayName=JP;var nT="DismissableLayerBranch",tN=x.forwardRef((e,t)=>{const n=x.useContext(eN),r=x.useRef(null),a=Pt(t,r);return x.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx(qe.div,{...e,ref:a})});tN.displayName=nT;function rT(e,t=globalThis==null?void 0:globalThis.document){const n=ts(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){nN(eT,n,m,{discrete:!0})};const m={originalEvent:d};d.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 sT(e,t=globalThis==null?void 0:globalThis.document){const n=ts(e),r=x.useRef(!1);return x.useEffect(()=>{const a=l=>{l.target&&!r.current&&nN(tT,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 Hb(){const e=new CustomEvent(Kp);document.dispatchEvent(e)}function nN(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?Jj(a,l):a.dispatchEvent(l)}var oT=vc,aT=tN,ks=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},iT="Portal",df=x.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[a,l]=x.useState(!1);ks(()=>l(!0),[]);const c=n||a&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?Wj.createPortal(s.jsx(qe.div,{...r,ref:t}),c):null});df.displayName=iT;function lT(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var As=e=>{const{present:t,children:n}=e,r=cT(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),l=Pt(r.ref,uT(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:l}):null};As.displayName="Presence";function cT(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),l=x.useRef("none"),c=e?"mounted":"unmounted",[d,f]=lT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const m=Qu(r.current);l.current=d==="mounted"?m:"none"},[d]),ks(()=>{const m=r.current,p=a.current;if(p!==e){const b=l.current,y=Qu(m);e?f("MOUNT"):y==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(p&&b!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),ks(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=y=>{const N=Qu(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&N&&(f("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},b=y=>{y.target===t&&(l.current=Qu(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:x.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function Qu(e){return(e==null?void 0:e.animationName)||"none"}function uT(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 dT=lf[" useInsertionEffect ".trim().toString()]||ks;function bc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,l,c]=fT({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:a;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const g=p.current;g!==d&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${d?"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=d},[d,r])}const m=x.useCallback(p=>{var g;if(d){const b=mT(p)?p(e):p;b!==e&&((g=c.current)==null||g.call(c,b))}else l(p)},[d,e,l,c]);return[f,m]}function fT({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),l=x.useRef(t);return dT(()=>{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 mT(e){return typeof e=="function"}var hT=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"}),pT="VisuallyHidden",ff=x.forwardRef((e,t)=>s.jsx(qe.span,{...e,ref:t,style:{...hT,...e.style}}));ff.displayName=pT;var gT=ff,Gg="ToastProvider",[Xg,xT,yT]=UP("Toast"),[rN]=Ro("Toast",[yT]),[vT,mf]=rN(Gg),sN=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:l=50,children:c}=e,[d,f]=x.useState(null),[m,p]=x.useState(0),g=x.useRef(!1),b=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gg}\`. Expected non-empty \`string\`.`),s.jsx(Xg.Provider,{scope:t,children:s.jsx(vT,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:l,toastCount:m,viewport:d,onViewportChange:f,onToastAdd:x.useCallback(()=>p(y=>y+1),[]),onToastRemove:x.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:b,children:c})})};sN.displayName=Gg;var oN="ToastViewport",bT=["F8"],Yp="toast.viewportPause",Qp="toast.viewportResume",aN=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=bT,label:a="Notifications ({hotkey})",...l}=e,c=mf(oN,n),d=xT(n),f=x.useRef(null),m=x.useRef(null),p=x.useRef(null),g=x.useRef(null),b=Pt(t,g,c.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=c.toastCount>0;x.useEffect(()=>{const w=_=>{var S;r.length!==0&&r.every(E=>_[E]||_.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),x.useEffect(()=>{const w=f.current,_=g.current;if(k&&w&&_){const j=()=>{if(!c.isClosePausedRef.current){const A=new CustomEvent(Yp);_.dispatchEvent(A),c.isClosePausedRef.current=!0}},S=()=>{if(c.isClosePausedRef.current){const A=new CustomEvent(Qp);_.dispatchEvent(A),c.isClosePausedRef.current=!1}},E=A=>{!w.contains(A.relatedTarget)&&S()},P=()=>{w.contains(document.activeElement)||S()};return w.addEventListener("focusin",j),w.addEventListener("focusout",E),w.addEventListener("pointermove",j),w.addEventListener("pointerleave",P),window.addEventListener("blur",j),window.addEventListener("focus",S),()=>{w.removeEventListener("focusin",j),w.removeEventListener("focusout",E),w.removeEventListener("pointermove",j),w.removeEventListener("pointerleave",P),window.removeEventListener("blur",j),window.removeEventListener("focus",S)}}},[k,c.isClosePausedRef]);const N=x.useCallback(({tabbingDirection:w})=>{const j=d().map(S=>{const E=S.ref.current,P=[E,...DT(E)];return w==="forwards"?P:P.reverse()});return(w==="forwards"?j.reverse():j).flat()},[d]);return x.useEffect(()=>{const w=g.current;if(w){const _=j=>{var P,A,M;const S=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!S){const D=document.activeElement,Y=j.shiftKey;if(j.target===w&&Y){(P=m.current)==null||P.focus();return}const B=N({tabbingDirection:Y?"backwards":"forwards"}),se=B.findIndex(G=>G===D);Ih(B.slice(se+1))?j.preventDefault():Y?(A=m.current)==null||A.focus():(M=p.current)==null||M.focus()}};return w.addEventListener("keydown",_),()=>w.removeEventListener("keydown",_)}},[d,N]),s.jsxs(aT,{ref:f,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:k?void 0:"none"},children:[k&&s.jsx(Gp,{ref:m,onFocusFromOutsideViewport:()=>{const w=N({tabbingDirection:"forwards"});Ih(w)}}),s.jsx(Xg.Slot,{scope:n,children:s.jsx(qe.ol,{tabIndex:-1,...l,ref:b})}),k&&s.jsx(Gp,{ref:p,onFocusFromOutsideViewport:()=>{const w=N({tabbingDirection:"backwards"});Ih(w)}})]})});aN.displayName=oN;var iN="ToastFocusProxy",Gp=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,l=mf(iN,n);return s.jsx(ff,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var m;const d=c.relatedTarget;!((m=l.viewport)!=null&&m.contains(d))&&r()}})});Gp.displayName=iN;var wc="Toast",wT="toast.swipeStart",jT="toast.swipeMove",NT="toast.swipeCancel",CT="toast.swipeEnd",lN=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:l,...c}=e,[d,f]=bc({prop:r,defaultProp:a??!0,onChange:l,caller:wc});return s.jsx(As,{present:n||d,children:s.jsx(_T,{open:d,...c,ref:t,onClose:()=>f(!1),onPause:ts(e.onPause),onResume:ts(e.onResume),onSwipeStart:Qe(e.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Qe(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:Qe(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:Qe(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)})})})});lN.displayName=wc;var[kT,ST]=rN(wc,{onClose(){}}),_T=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:l,onClose:c,onEscapeKeyDown:d,onPause:f,onResume:m,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:b,onSwipeEnd:y,...k}=e,N=mf(wc,n),[w,_]=x.useState(null),j=Pt(t,G=>_(G)),S=x.useRef(null),E=x.useRef(null),P=a||N.duration,A=x.useRef(0),M=x.useRef(P),D=x.useRef(0),{onToastAdd:Y,onToastRemove:q}=N,F=ts(()=>{var L;(w==null?void 0:w.contains(document.activeElement))&&((L=N.viewport)==null||L.focus()),c()}),B=x.useCallback(G=>{!G||G===1/0||(window.clearTimeout(D.current),A.current=new Date().getTime(),D.current=window.setTimeout(F,G))},[F]);x.useEffect(()=>{const G=N.viewport;if(G){const L=()=>{B(M.current),m==null||m()},H=()=>{const $=new Date().getTime()-A.current;M.current=M.current-$,window.clearTimeout(D.current),f==null||f()};return G.addEventListener(Yp,H),G.addEventListener(Qp,L),()=>{G.removeEventListener(Yp,H),G.removeEventListener(Qp,L)}}},[N.viewport,P,f,m,B]),x.useEffect(()=>{l&&!N.isClosePausedRef.current&&B(P)},[l,P,N.isClosePausedRef,B]),x.useEffect(()=>(Y(),()=>q()),[Y,q]);const se=x.useMemo(()=>w?pN(w):null,[w]);return N.viewport?s.jsxs(s.Fragment,{children:[se&&s.jsx(ET,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:se}),s.jsx(kT,{scope:n,onClose:F,children:cf.createPortal(s.jsx(Xg.ItemSlot,{scope:n,children:s.jsx(oT,{asChild:!0,onEscapeKeyDown:Qe(d,()=>{N.isFocusedToastEscapeKeyDownRef.current||F(),N.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(qe.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":N.swipeDirection,...k,ref:j,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Qe(e.onKeyDown,G=>{G.key==="Escape"&&(d==null||d(G.nativeEvent),G.nativeEvent.defaultPrevented||(N.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:Qe(e.onPointerDown,G=>{G.button===0&&(S.current={x:G.clientX,y:G.clientY})}),onPointerMove:Qe(e.onPointerMove,G=>{if(!S.current)return;const L=G.clientX-S.current.x,H=G.clientY-S.current.y,$=!!E.current,R=["left","right"].includes(N.swipeDirection),W=["left","up"].includes(N.swipeDirection)?Math.min:Math.max,Z=R?W(0,L):0,V=R?0:W(0,H),O=G.pointerType==="touch"?10:2,Q={x:Z,y:V},re={originalEvent:G,delta:Q};$?(E.current=Q,Gu(jT,g,re,{discrete:!1})):qb(Q,N.swipeDirection,O)?(E.current=Q,Gu(wT,p,re,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(L)>O||Math.abs(H)>O)&&(S.current=null)}),onPointerUp:Qe(e.onPointerUp,G=>{const L=E.current,H=G.target;if(H.hasPointerCapture(G.pointerId)&&H.releasePointerCapture(G.pointerId),E.current=null,S.current=null,L){const $=G.currentTarget,R={originalEvent:G,delta:L};qb(L,N.swipeDirection,N.swipeThreshold)?Gu(CT,y,R,{discrete:!0}):Gu(NT,b,R,{discrete:!0}),$.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),N.viewport)})]}):null}),ET=e=>{const{__scopeToast:t,children:n,...r}=e,a=mf(wc,t),[l,c]=x.useState(!1),[d,f]=x.useState(!1);return AT(()=>c(!0)),x.useEffect(()=>{const m=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(m)},[]),d?null:s.jsx(df,{asChild:!0,children:s.jsx(ff,{...r,children:l&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},PT="ToastTitle",cN=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});cN.displayName=PT;var TT="ToastDescription",uN=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});uN.displayName=TT;var dN="ToastAction",fN=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(hN,{altText:n,asChild:!0,children:s.jsx(Zg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${dN}\`. Expected non-empty \`string\`.`),null)});fN.displayName=dN;var mN="ToastClose",Zg=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=ST(mN,n);return s.jsx(hN,{asChild:!0,children:s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Qe(e.onClick,a.onClose)})})});Zg.displayName=mN;var hN=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(qe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function pN(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),MT(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(...pN(r))}}),t}function Gu(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?Jj(a,l):a.dispatchEvent(l)}var qb=(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 AT(e=()=>{}){const t=ts(e);ks(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function MT(e){return e.nodeType===e.ELEMENT_NODE}function DT(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 Ih(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var RT=sN,gN=aN,xN=lN,yN=cN,vN=uN,bN=fN,wN=Zg;function jN(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=jN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function NN(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=jN(e))&&(r&&(r+=" "),r+=t);return r}const Kb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yb=NN,CN=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Yb(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 b=Kb(p)||Kb(g);return a[m][b]}),d=n&&Object.entries(n).reduce((m,p)=>{let[g,b]=p;return b===void 0||(m[g]=b),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,p)=>{let{class:g,className:b,...y}=p;return Object.entries(y).every(k=>{let[N,w]=k;return Array.isArray(w)?w.includes({...l,...d}[N]):{...l,...d}[N]===w})?[...m,g,b]:m},[]);return Yb(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 OT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kN=(...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 LT={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 IT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:l,iconNode:c,...d},f)=>x.createElement("svg",{ref:f,...LT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kN("lucide",a),...d},[...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 me=(e,t)=>{const n=x.forwardRef(({className:r,...a},l)=>x.createElement(IT,{ref:l,iconNode:t,className:kN(`lucide-${OT(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 Ca=me("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 FT=me("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 SN=me("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 $T=me("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 Xp=me("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 Oo=me("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 _N=me("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 Ti=me("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 Id=me("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 VT=me("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 jc=me("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 EN=me("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 Jg=me("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 Ar=me("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 Lo=me("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 ka=me("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 ss=me("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 BT=me("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
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 Cr=me("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 Qb=me("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 zT=me("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 Ai=me("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 Fd=me("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 PN=me("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 TN=me("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 AN=me("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 MN=me("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 DN=me("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 ex=me("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 WT=me("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 UT=me("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 Pa=me("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 HT=me("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 $d=me("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 RN=me("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 hf=me("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 ON=me("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 qT=me("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 Gl=me("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 KT=me("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 tx=me("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 Nc=me("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 YT=me("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"}]]);/**
|
|
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 QT=me("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
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 Ta=me("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"}]]);/**
|
|
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 LN=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 IN=me("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"}]]);/**
|
|
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 GT=me("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"}]]);/**
|
|
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 FN=me("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"}]]);/**
|
|
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 hi=me("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"}]]);/**
|
|
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 $N=me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 gd=me("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"}]]);/**
|
|
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 XT=me("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"}]]);/**
|
|
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 ZT=me("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"}]]);/**
|
|
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 JT=me("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 ns=me("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"}]]);/**
|
|
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 oc=me("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"}]]);/**
|
|
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 e4=me("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"}]]);/**
|
|
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 Mi=me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 Io=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Gb=me("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"}]]);/**
|
|
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 Xb=me("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
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 t4=me("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"}]]);/**
|
|
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 n4=me("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"}]]);/**
|
|
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 Cc=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 nx=me("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"}]]);/**
|
|
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 rx=me("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"}]]);/**
|
|
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 r4=me("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"}]]);/**
|
|
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 xn=me("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"}]]);/**
|
|
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 s4=me("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"}]]);/**
|
|
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 VN=me("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"}]]);/**
|
|
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 BN=me("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"}]]);/**
|
|
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 o4=me("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"}]]);/**
|
|
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 Ss=me("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"}]]);/**
|
|
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 zN=me("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"}]]);/**
|
|
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 Di=me("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"}]]);/**
|
|
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 a4=me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
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 pf=me("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"}]]);/**
|
|
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 ko=me("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"}]]);/**
|
|
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 Ln=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sx="-",i4=e=>{const t=c4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(sx);return d[0]===""&&d.length!==1&&d.shift(),WN(d,t)||l4(c)},getConflictingClassGroupIds:(c,d)=>{const f=n[c]||[];return d&&r[c]?[...f,...r[c]]:f}}},WN=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?WN(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(sx);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},Zb=/^\[(.+)\]$/,l4=e=>{if(Zb.test(e)){const t=Zb.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},c4=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return d4(Object.entries(e.classGroups),n).forEach(([l,c])=>{Zp(c,r,l,t)}),r},Zp=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:Jb(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(u4(a)){Zp(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Zp(c,Jb(t,l),n,r)})})},Jb=(e,t)=>{let n=e;return t.split(sx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},u4=e=>e.isThemeGetter,d4=(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,d])=>[t+c,d])):l);return[n,a]}):e,f4=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)}}},UN="!",m4=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],l=t.length,c=d=>{const f=[];let m=0,p=0,g;for(let w=0;w<d.length;w++){let _=d[w];if(m===0){if(_===a&&(r||d.slice(w,w+l)===t)){f.push(d.slice(p,w)),p=w+l;continue}if(_==="/"){g=w;continue}}_==="["?m++:_==="]"&&m--}const b=f.length===0?d:d.substring(p),y=b.startsWith(UN),k=y?b.substring(1):b,N=g&&g>p?g-p:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:k,maybePostfixModifierPosition:N}};return n?d=>n({className:d,parseClassName:c}):c},h4=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},p4=e=>({cache:f4(e.cacheSize),parseClassName:m4(e),...i4(e)}),g4=/\s+/,x4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(g4);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{modifiers:p,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=n(m);let k=!!y,N=r(k?b.substring(0,y):b);if(!N){if(!k){d=m+(d.length>0?" "+d:d);continue}if(N=r(b),!N){d=m+(d.length>0?" "+d:d);continue}k=!1}const w=h4(p).join(":"),_=g?w+UN:w,j=_+N;if(l.includes(j))continue;l.push(j);const S=a(N,k);for(let E=0;E<S.length;++E){const P=S[E];l.push(_+P)}d=m+(d.length>0?" "+d:d)}return d};function y4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=HN(t))&&(r&&(r+=" "),r+=n);return r}const HN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=HN(e[r]))&&(n&&(n+=" "),n+=t);return n};function v4(e,...t){let n,r,a,l=c;function c(f){const m=t.reduce((p,g)=>g(p),e());return n=p4(m),r=n.cache.get,a=n.cache.set,l=d,d(f)}function d(f){const m=r(f);if(m)return m;const p=x4(f,n);return a(f,p),p}return function(){return l(y4.apply(null,arguments))}}const ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qN=/^\[(?:([a-z-]+):)?(.+)\]$/i,b4=/^\d+\/\d+$/,w4=new Set(["px","full","screen"]),j4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N4=/\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$/,C4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,k4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,S4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gs=e=>pi(e)||w4.has(e)||b4.test(e),eo=e=>Hi(e,"length",R4),pi=e=>!!e&&!Number.isNaN(Number(e)),Fh=e=>Hi(e,"number",pi),Ol=e=>!!e&&Number.isInteger(Number(e)),_4=e=>e.endsWith("%")&&pi(e.slice(0,-1)),Fe=e=>qN.test(e),to=e=>j4.test(e),E4=new Set(["length","size","percentage"]),P4=e=>Hi(e,E4,KN),T4=e=>Hi(e,"position",KN),A4=new Set(["image","url"]),M4=e=>Hi(e,A4,L4),D4=e=>Hi(e,"",O4),Ll=()=>!0,Hi=(e,t,n)=>{const r=qN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},R4=e=>N4.test(e)&&!C4.test(e),KN=()=>!1,O4=e=>k4.test(e),L4=e=>S4.test(e),I4=()=>{const e=ft("colors"),t=ft("spacing"),n=ft("blur"),r=ft("brightness"),a=ft("borderColor"),l=ft("borderRadius"),c=ft("borderSpacing"),d=ft("borderWidth"),f=ft("contrast"),m=ft("grayscale"),p=ft("hueRotate"),g=ft("invert"),b=ft("gap"),y=ft("gradientColorStops"),k=ft("gradientColorStopPositions"),N=ft("inset"),w=ft("margin"),_=ft("opacity"),j=ft("padding"),S=ft("saturate"),E=ft("scale"),P=ft("sepia"),A=ft("skew"),M=ft("space"),D=ft("translate"),Y=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",Fe,t],B=()=>[Fe,t],se=()=>["",gs,eo],G=()=>["auto",pi,Fe],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["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"],W=()=>["","0",Fe],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[pi,Fe];return{cacheSize:500,separator:":",theme:{colors:[Ll],spacing:[gs,eo],blur:["none","",to,Fe],brightness:V(),borderColor:[e],borderRadius:["none","","full",to,Fe],borderSpacing:B(),borderWidth:se(),contrast:V(),grayscale:W(),hueRotate:V(),invert:W(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[_4,eo],inset:F(),margin:F(),opacity:V(),padding:B(),saturate:V(),scale:V(),sepia:W(),skew:V(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Fe]}],container:["container"],columns:[{columns:[to]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...L(),Fe]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ol,Fe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Fe]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Ol,Fe]}],"grid-cols":[{"grid-cols":[Ll]}],"col-start-end":[{col:["auto",{span:["full",Ol,Fe]},Fe]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[Ll]}],"row-start-end":[{row:["auto",{span:[Ol,Fe]},Fe]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Fe]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"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:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"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",Fe,t]}],"min-w":[{"min-w":[Fe,t,"min","max","fit"]}],"max-w":[{"max-w":[Fe,t,"none","full","min","max","fit","prose",{screen:[to]},to]}],h:[{h:[Fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",to,eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fh]}],"font-family":[{font:[Ll]}],"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",Fe]}],"line-clamp":[{"line-clamp":["none",pi,Fh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gs,Fe]}],"list-image":[{"list-image":["none",Fe]}],"list-style-type":[{list:["none","disc","decimal",Fe]}],"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:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gs,eo]}],"underline-offset":[{"underline-offset":["auto",gs,Fe]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Fe]}],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",Fe]}],"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:[...L(),T4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},M4]}],"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:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:H()}],"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:["",...H()]}],"outline-offset":[{"outline-offset":[gs,Fe]}],"outline-w":[{outline:[gs,eo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[gs,eo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",to,D4]}],"shadow-color":[{shadow:[Ll]}],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",to,Fe]}],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",Fe]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",Fe]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",Fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Ol,Fe]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Fe]}],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",Fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gs,eo,Fh]}],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"]}}},F4=v4(I4);function Ie(...e){return F4(NN(e))}const $4=RT,YN=x.forwardRef(({className:e,...t},n)=>s.jsx(gN,{ref:n,className:Ie("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}));YN.displayName=gN.displayName;const V4=CN("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"}}),QN=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(xN,{ref:r,className:Ie(V4({variant:t}),e),...n}));QN.displayName=xN.displayName;const B4=x.forwardRef(({className:e,...t},n)=>s.jsx(bN,{ref:n,className:Ie("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}));B4.displayName=bN.displayName;const GN=x.forwardRef(({className:e,...t},n)=>s.jsx(wN,{ref:n,className:Ie("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(Ln,{className:"h-4 w-4"})}));GN.displayName=wN.displayName;const XN=x.forwardRef(({className:e,...t},n)=>s.jsx(yN,{ref:n,className:Ie("text-sm font-semibold",e),...t}));XN.displayName=yN.displayName;const ZN=x.forwardRef(({className:e,...t},n)=>s.jsx(vN,{ref:n,className:Ie("text-sm opacity-90",e),...t}));ZN.displayName=vN.displayName;function z4(){const{toasts:e}=LP();return s.jsxs($4,{children:[e.map(function({id:t,title:n,description:r,action:a,...l}){return s.jsxs(QN,{...l,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(XN,{children:n}),r&&s.jsx(ZN,{children:r})]}),a,s.jsx(GN,{})]},t)}),s.jsx(YN,{})]})}var W4=lf[" useId ".trim().toString()]||(()=>{}),U4=0;function Zr(e){const[t,n]=x.useState(W4());return ks(()=>{n(r=>r??String(U4++))},[e]),e||(t?`radix-${t}`:"")}const H4=["top","right","bottom","left"],So=Math.min,Hn=Math.max,Vd=Math.round,Xu=Math.floor,Jr=e=>({x:e,y:e}),q4={left:"right",right:"left",bottom:"top",top:"bottom"};function Jp(e,t,n){return Hn(e,So(t,n))}function _s(e,t){return typeof e=="function"?e(t):e}function Es(e){return e.split("-")[0]}function qi(e){return e.split("-")[1]}function ox(e){return e==="x"?"y":"x"}function ax(e){return e==="y"?"height":"width"}function Gr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ix(e){return ox(Gr(e))}function K4(e,t,n){n===void 0&&(n=!1);const r=qi(e),a=ix(e),l=ax(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Bd(c)),[c,Bd(c)]}function Y4(e){const t=Bd(e);return[eg(e),t,eg(t)]}function eg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ew=["left","right"],tw=["right","left"],Q4=["top","bottom"],G4=["bottom","top"];function X4(e,t,n){switch(e){case"top":case"bottom":return n?t?tw:ew:t?ew:tw;case"left":case"right":return t?Q4:G4;default:return[]}}function Z4(e,t,n,r){const a=qi(e);let l=X4(Es(e),n==="start",r);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(eg)))),l}function Bd(e){const t=Es(e);return q4[t]+e.slice(t.length)}function J4(e){return{top:0,right:0,bottom:0,left:0,...e}}function JN(e){return typeof e!="number"?J4(e):{top:e,right:e,bottom:e,left:e}}function zd(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 nw(e,t,n){let{reference:r,floating:a}=e;const l=Gr(t),c=ix(t),d=ax(c),f=Es(t),m=l==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[d]/2-a[d]/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(qi(t)){case"start":y[c]-=b*(n&&m?-1:1);break;case"end":y[c]+=b*(n&&m?-1:1);break}return y}async function eA(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:b=!1,padding:y=0}=_s(t,e),k=JN(y),w=d[b?g==="floating"?"reference":"floating":g],_=zd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(w)))==null||n?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:p,strategy:f})),j=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(d.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=zd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:S,strategy:f}):j);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 tA=50,nA=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:eA},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}=nw(m,r,f),b=r,y=0;const k={};for(let N=0;N<l.length;N++){const w=l[N];if(!w)continue;const{name:_,fn:j}=w,{x:S,y:E,data:P,reset:A}=await j({x:p,y:g,initialPlacement:r,placement:b,strategy:a,middlewareData:k,rects:m,platform:d,elements:{reference:e,floating:t}});p=S??p,g=E??g,k[_]={...k[_],...P},A&&y<tA&&(y++,typeof A=="object"&&(A.placement&&(b=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:p,y:g}=nw(m,b,f)),N=-1)}return{x:p,y:g,placement:b,strategy:a,middlewareData:k}},rA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:m,padding:p=0}=_s(e,t)||{};if(m==null)return{};const g=JN(p),b={x:n,y:r},y=ix(a),k=ax(y),N=await c.getDimensions(m),w=y==="y",_=w?"top":"left",j=w?"bottom":"right",S=w?"clientHeight":"clientWidth",E=l.reference[k]+l.reference[y]-b[y]-l.floating[k],P=b[y]-l.reference[y],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let M=A?A[S]:0;(!M||!await(c.isElement==null?void 0:c.isElement(A)))&&(M=d.floating[S]||l.floating[k]);const D=E/2-P/2,Y=M/2-N[k]/2-1,q=So(g[_],Y),F=So(g[j],Y),B=q,se=M-N[k]-F,G=M/2-N[k]/2+D,L=Jp(B,G,se),H=!f.arrow&&qi(a)!=null&&G!==L&&l.reference[k]/2-(G<B?q:F)-N[k]/2<0,$=H?G<B?G-B:G-se:0;return{[y]:b[y]+$,data:{[y]:L,centerOffset:G-L-$,...H&&{alignmentOffset:$}},reset:H}}}),sA=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:d,platform:f,elements:m}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:N=!0,...w}=_s(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const _=Es(a),j=Gr(d),S=Es(d)===d,E=await(f.isRTL==null?void 0:f.isRTL(m.floating)),P=b||(S||!N?[Bd(d)]:Y4(d)),A=k!=="none";!b&&A&&P.push(...Z4(d,N,k,E));const M=[d,...P],D=await f.detectOverflow(t,w),Y=[];let q=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Y.push(D[_]),g){const G=K4(a,c,E);Y.push(D[G[0]],D[G[1]])}if(q=[...q,{placement:a,overflows:Y}],!Y.every(G=>G<=0)){var F,B;const G=(((F=l.flip)==null?void 0:F.index)||0)+1,L=M[G];if(L&&(!(g==="alignment"?j!==Gr(L):!1)||q.every(R=>Gr(R.placement)===j?R.overflows[0]>0:!0)))return{data:{index:G,overflows:q},reset:{placement:L}};let H=(B=q.filter($=>$.overflows[0]<=0).sort(($,R)=>$.overflows[1]-R.overflows[1])[0])==null?void 0:B.placement;if(!H)switch(y){case"bestFit":{var se;const $=(se=q.filter(R=>{if(A){const W=Gr(R.placement);return W===j||W==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(W=>W>0).reduce((W,Z)=>W+Z,0)]).sort((R,W)=>R[1]-W[1])[0])==null?void 0:se[0];$&&(H=$);break}case"initialPlacement":H=d;break}if(a!==H)return{reset:{placement:H}}}return{}}}};function rw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sw(e){return H4.some(t=>e[t]>=0)}const oA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...l}=_s(e,t);switch(a){case"referenceHidden":{const c=await r.detectOverflow(t,{...l,elementContext:"reference"}),d=rw(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:sw(d)}}}case"escaped":{const c=await r.detectOverflow(t,{...l,altBoundary:!0}),d=rw(c,n.floating);return{data:{escapedOffsets:d,escaped:sw(d)}}}default:return{}}}}},eC=new Set(["left","top"]);async function aA(e,t){const{placement:n,platform:r,elements:a}=e,l=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Es(n),d=qi(n),f=Gr(n)==="y",m=eC.has(c)?-1:1,p=l&&f?-1:1,g=_s(t,e);let{mainAxis:b,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 d&&typeof k=="number"&&(y=d==="end"?k*-1:k),f?{x:y*p,y:b*m}:{x:b*m,y:y*p}}const iA=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:d}=t,f=await aA(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:l+f.y,data:{...f,placement:c}}}}},lA=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:d=!1,limiter:f={fn:_=>{let{x:j,y:S}=_;return{x:j,y:S}}},...m}=_s(e,t),p={x:n,y:r},g=await l.detectOverflow(t,m),b=Gr(Es(a)),y=ox(b);let k=p[y],N=p[b];if(c){const _=y==="y"?"top":"left",j=y==="y"?"bottom":"right",S=k+g[_],E=k-g[j];k=Jp(S,k,E)}if(d){const _=b==="y"?"top":"left",j=b==="y"?"bottom":"right",S=N+g[_],E=N-g[j];N=Jp(S,N,E)}const w=f.fn({...t,[y]:k,[b]:N});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[y]:c,[b]:d}}}}}},cA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=_s(e,t),p={x:n,y:r},g=Gr(a),b=ox(g);let y=p[b],k=p[g];const N=_s(d,t),w=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(f){const S=b==="y"?"height":"width",E=l.reference[b]-l.floating[S]+w.mainAxis,P=l.reference[b]+l.reference[S]-w.mainAxis;y<E?y=E:y>P&&(y=P)}if(m){var _,j;const S=b==="y"?"width":"height",E=eC.has(Es(a)),P=l.reference[g]-l.floating[S]+(E&&((_=c.offset)==null?void 0:_[g])||0)+(E?0:w.crossAxis),A=l.reference[g]+l.reference[S]+(E?0:((j=c.offset)==null?void 0:j[g])||0)-(E?w.crossAxis:0);k<P?k=P:k>A&&(k=A)}return{[b]:y,[g]:k}}}},uA=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:d}=t,{apply:f=()=>{},...m}=_s(e,t),p=await c.detectOverflow(t,m),g=Es(a),b=qi(a),y=Gr(a)==="y",{width:k,height:N}=l.floating;let w,_;g==="top"||g==="bottom"?(w=g,_=b===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(_=g,w=b==="end"?"top":"bottom");const j=N-p.top-p.bottom,S=k-p.left-p.right,E=So(N-p[w],j),P=So(k-p[_],S),A=!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=j),A&&!b){const q=Hn(p.left,0),F=Hn(p.right,0),B=Hn(p.top,0),se=Hn(p.bottom,0);y?D=k-2*(q!==0||F!==0?q+F:Hn(p.left,p.right)):M=N-2*(B!==0||se!==0?B+se:Hn(p.top,p.bottom))}await f({...t,availableWidth:D,availableHeight:M});const Y=await c.getDimensions(d.floating);return k!==Y.width||N!==Y.height?{reset:{rects:!0}}:{}}}};function gf(){return typeof window<"u"}function Ki(e){return tC(e)?(e.nodeName||"").toLowerCase():"#document"}function qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function os(e){var t;return(t=(tC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tC(e){return gf()?e instanceof Node||e instanceof qn(e).Node:!1}function kr(e){return gf()?e instanceof Element||e instanceof qn(e).Element:!1}function Ms(e){return gf()?e instanceof HTMLElement||e instanceof qn(e).HTMLElement:!1}function ow(e){return!gf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qn(e).ShadowRoot}function kc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function dA(e){return/^(table|td|th)$/.test(Ki(e))}function xf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fA=/transform|translate|scale|rotate|perspective|filter/,mA=/paint|layout|strict|content/,ea=e=>!!e&&e!=="none";let $h;function lx(e){const t=kr(e)?Sr(e):e;return ea(t.transform)||ea(t.translate)||ea(t.scale)||ea(t.rotate)||ea(t.perspective)||!cx()&&(ea(t.backdropFilter)||ea(t.filter))||fA.test(t.willChange||"")||mA.test(t.contain||"")}function hA(e){let t=_o(e);for(;Ms(t)&&!Ri(t);){if(lx(t))return t;if(xf(t))return null;t=_o(t)}return null}function cx(){return $h==null&&($h=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$h}function Ri(e){return/^(html|body|#document)$/.test(Ki(e))}function Sr(e){return qn(e).getComputedStyle(e)}function yf(e){return kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _o(e){if(Ki(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ow(e)&&e.host||os(e);return ow(t)?t.host:t}function nC(e){const t=_o(e);return Ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ms(t)&&kc(t)?t:nC(t)}function ac(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=nC(e),l=a===((r=e.ownerDocument)==null?void 0:r.body),c=qn(a);if(l){const d=tg(c);return t.concat(c,c.visualViewport||[],kc(a)?a:[],d&&n?ac(d):[])}else return t.concat(a,ac(a,[],n))}function tg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rC(e){const t=Sr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ms(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:r,d=Vd(n)!==l||Vd(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function ux(e){return kr(e)?e:e.contextElement}function gi(e){const t=ux(e);if(!Ms(t))return Jr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:l}=rC(t);let c=(l?Vd(n.width):n.width)/r,d=(l?Vd(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const pA=Jr(0);function sC(e){const t=qn(e);return!cx()||!t.visualViewport?pA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qn(e)?!1:t}function Sa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=ux(e);let c=Jr(1);t&&(r?kr(r)&&(c=gi(r)):c=gi(e));const d=gA(l,n,r)?sC(l):Jr(0);let f=(a.left+d.x)/c.x,m=(a.top+d.y)/c.y,p=a.width/c.x,g=a.height/c.y;if(l){const b=qn(l),y=r&&kr(r)?qn(r):r;let k=b,N=tg(k);for(;N&&r&&y!==k;){const w=gi(N),_=N.getBoundingClientRect(),j=Sr(N),S=_.left+(N.clientLeft+parseFloat(j.paddingLeft))*w.x,E=_.top+(N.clientTop+parseFloat(j.paddingTop))*w.y;f*=w.x,m*=w.y,p*=w.x,g*=w.y,f+=S,m+=E,k=qn(N),N=tg(k)}}return zd({width:p,height:g,x:f,y:m})}function vf(e,t){const n=yf(e).scrollLeft;return t?t.left+n:Sa(os(e)).left+n}function oC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-vf(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function xA(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const l=a==="fixed",c=os(r),d=t?xf(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},m=Jr(1);const p=Jr(0),g=Ms(r);if((g||!g&&!l)&&((Ki(r)!=="body"||kc(c))&&(f=yf(r)),g)){const y=Sa(r);m=gi(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const b=c&&!g&&!l?oC(c,f):Jr(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+p.x+b.x,y:n.y*m.y-f.scrollTop*m.y+p.y+b.y}}function yA(e){return Array.from(e.getClientRects())}function vA(e){const t=os(e),n=yf(e),r=e.ownerDocument.body,a=Hn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Hn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+vf(e);const d=-n.scrollTop;return Sr(r).direction==="rtl"&&(c+=Hn(t.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:d}}const aw=25;function bA(e,t){const n=qn(e),r=os(e),a=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(a){l=a.width,c=a.height;const p=cx();(!p||p&&t==="fixed")&&(d=a.offsetLeft,f=a.offsetTop)}const m=vf(r);if(m<=0){const p=r.ownerDocument,g=p.body,b=getComputedStyle(g),y=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,k=Math.abs(r.clientWidth-g.clientWidth-y);k<=aw&&(l-=k)}else m<=aw&&(l+=m);return{width:l,height:c,x:d,y:f}}function wA(e,t){const n=Sa(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,l=Ms(e)?gi(e):Jr(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=a*l.x,m=r*l.y;return{width:c,height:d,x:f,y:m}}function iw(e,t,n){let r;if(t==="viewport")r=bA(e,n);else if(t==="document")r=vA(os(e));else if(kr(t))r=wA(t,n);else{const a=sC(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return zd(r)}function aC(e,t){const n=_o(e);return n===t||!kr(n)||Ri(n)?!1:Sr(n).position==="fixed"||aC(n,t)}function jA(e,t){const n=t.get(e);if(n)return n;let r=ac(e,[],!1).filter(d=>kr(d)&&Ki(d)!=="body"),a=null;const l=Sr(e).position==="fixed";let c=l?_o(e):e;for(;kr(c)&&!Ri(c);){const d=Sr(c),f=lx(c);!f&&d.position==="fixed"&&(a=null),(l?!f&&!a:!f&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||kc(c)&&!f&&aC(e,c))?r=r.filter(p=>p!==c):a=d,c=_o(c)}return t.set(e,r),r}function NA(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?xf(t)?[]:jA(t,this._c):[].concat(n),r],d=iw(t,c[0],a);let f=d.top,m=d.right,p=d.bottom,g=d.left;for(let b=1;b<c.length;b++){const y=iw(t,c[b],a);f=Hn(y.top,f),m=So(y.right,m),p=So(y.bottom,p),g=Hn(y.left,g)}return{width:m-g,height:p-f,x:g,y:f}}function CA(e){const{width:t,height:n}=rC(e);return{width:t,height:n}}function kA(e,t,n){const r=Ms(t),a=os(t),l=n==="fixed",c=Sa(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Jr(0);function m(){f.x=vf(a)}if(r||!r&&!l)if((Ki(t)!=="body"||kc(a))&&(d=yf(t)),r){const y=Sa(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?oC(a,d):Jr(0),g=c.left+d.scrollLeft-f.x-p.x,b=c.top+d.scrollTop-f.y-p.y;return{x:g,y:b,width:c.width,height:c.height}}function Vh(e){return Sr(e).position==="static"}function lw(e,t){if(!Ms(e)||Sr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return os(e)===n&&(n=n.ownerDocument.body),n}function iC(e,t){const n=qn(e);if(xf(e))return n;if(!Ms(e)){let a=_o(e);for(;a&&!Ri(a);){if(kr(a)&&!Vh(a))return a;a=_o(a)}return n}let r=lw(e,t);for(;r&&dA(r)&&Vh(r);)r=lw(r,t);return r&&Ri(r)&&Vh(r)&&!lx(r)?n:r||hA(e)||n}const SA=async function(e){const t=this.getOffsetParent||iC,n=this.getDimensions,r=await n(e.floating);return{reference:kA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _A(e){return Sr(e).direction==="rtl"}const EA={convertOffsetParentRelativeRectToViewportRelativeRect:xA,getDocumentElement:os,getClippingRect:NA,getOffsetParent:iC,getElementRects:SA,getClientRects:yA,getDimensions:CA,getScale:gi,isElement:kr,isRTL:_A};function lC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function PA(e,t){let n=null,r;const a=os(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:p,top:g,width:b,height:y}=m;if(d||t(),!b||!y)return;const k=Xu(g),N=Xu(a.clientWidth-(p+b)),w=Xu(a.clientHeight-(g+y)),_=Xu(p),S={rootMargin:-k+"px "+-N+"px "+-w+"px "+-_+"px",threshold:Hn(0,So(1,f))||1};let E=!0;function P(A){const M=A[0].intersectionRatio;if(M!==f){if(!E)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!lC(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 TA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=ux(e),p=a||l?[...m?ac(m):[],...t?ac(t):[]]:[];p.forEach(_=>{a&&_.addEventListener("scroll",n,{passive:!0}),l&&_.addEventListener("resize",n)});const g=m&&d?PA(m,n):null;let b=-1,y=null;c&&(y=new ResizeObserver(_=>{let[j]=_;j&&j.target===m&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var S;(S=y)==null||S.observe(t)})),n()}),m&&!f&&y.observe(m),t&&y.observe(t));let k,N=f?Sa(e):null;f&&w();function w(){const _=Sa(e);N&&!lC(N,_)&&n(),N=_,k=requestAnimationFrame(w)}return n(),()=>{var _;p.forEach(j=>{a&&j.removeEventListener("scroll",n),l&&j.removeEventListener("resize",n)}),g==null||g(),(_=y)==null||_.disconnect(),y=null,f&&cancelAnimationFrame(k)}}const AA=iA,MA=lA,DA=sA,RA=uA,OA=oA,cw=rA,LA=cA,IA=(e,t,n)=>{const r=new Map,a={platform:EA,...n},l={...a.platform,_c:r};return nA(e,t,{...a,platform:l})};var FA=typeof document<"u",$A=function(){},xd=FA?x.useLayoutEffect:$A;function Wd(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(!Wd(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)&&!Wd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function cC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uw(e,t){const n=cC(e);return Math.round(t*n)/n}function Bh(e){const t=x.useRef(e);return xd(()=>{t.current=e}),t}function VA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:m}=e,[p,g]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,y]=x.useState(r);Wd(b,r)||y(r);const[k,N]=x.useState(null),[w,_]=x.useState(null),j=x.useCallback(R=>{R!==A.current&&(A.current=R,N(R))},[]),S=x.useCallback(R=>{R!==M.current&&(M.current=R,_(R))},[]),E=l||k,P=c||w,A=x.useRef(null),M=x.useRef(null),D=x.useRef(p),Y=f!=null,q=Bh(f),F=Bh(a),B=Bh(m),se=x.useCallback(()=>{if(!A.current||!M.current)return;const R={placement:t,strategy:n,middleware:b};F.current&&(R.platform=F.current),IA(A.current,M.current,R).then(W=>{const Z={...W,isPositioned:B.current!==!1};G.current&&!Wd(D.current,Z)&&(D.current=Z,cf.flushSync(()=>{g(Z)}))})},[b,t,n,F,B]);xd(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(R=>({...R,isPositioned:!1})))},[m]);const G=x.useRef(!1);xd(()=>(G.current=!0,()=>{G.current=!1}),[]),xd(()=>{if(E&&(A.current=E),P&&(M.current=P),E&&P){if(q.current)return q.current(E,P,se);se()}},[E,P,se,q,Y]);const L=x.useMemo(()=>({reference:A,floating:M,setReference:j,setFloating:S}),[j,S]),H=x.useMemo(()=>({reference:E,floating:P}),[E,P]),$=x.useMemo(()=>{const R={position:n,left:0,top:0};if(!H.floating)return R;const W=uw(H.floating,p.x),Z=uw(H.floating,p.y);return d?{...R,transform:"translate("+W+"px, "+Z+"px)",...cC(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:Z}},[n,d,H.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:se,refs:L,elements:H,floatingStyles:$}),[p,se,L,H,$])}const BA=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?cw({element:r.current,padding:a}).fn(n):{}:r?cw({element:r,padding:a}).fn(n):{}}}},zA=(e,t)=>{const n=AA(e);return{name:n.name,fn:n.fn,options:[e,t]}},WA=(e,t)=>{const n=MA(e);return{name:n.name,fn:n.fn,options:[e,t]}},UA=(e,t)=>({fn:LA(e).fn,options:[e,t]}),HA=(e,t)=>{const n=DA(e);return{name:n.name,fn:n.fn,options:[e,t]}},qA=(e,t)=>{const n=RA(e);return{name:n.name,fn:n.fn,options:[e,t]}},KA=(e,t)=>{const n=OA(e);return{name:n.name,fn:n.fn,options:[e,t]}},YA=(e,t)=>{const n=BA(e);return{name:n.name,fn:n.fn,options:[e,t]}};var QA="Arrow",uC=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...l}=e;return s.jsx(qe.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"})})});uC.displayName=QA;var GA=uC;function dx(e){const[t,n]=x.useState(void 0);return ks(()=>{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,d;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var fx="Popper",[dC,bf]=Ro(fx),[XA,fC]=dC(fx),mC=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return s.jsx(XA,{scope:t,anchor:r,onAnchorChange:a,children:n})};mC.displayName=fx;var hC="PopperAnchor",pC=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,l=fC(hC,n),c=x.useRef(null),d=Pt(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(qe.div,{...a,ref:d})});pC.displayName=hC;var mx="PopperContent",[ZA,JA]=dC(mx),gC=x.forwardRef((e,t)=>{var le,be,we,pe,mt,on;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:k,...N}=e,w=fC(mx,n),[_,j]=x.useState(null),S=Pt(t,Dt=>j(Dt)),[E,P]=x.useState(null),A=dx(E),M=(A==null?void 0:A.width)??0,D=(A==null?void 0:A.height)??0,Y=r+(l!=="center"?"-"+l:""),q=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(m)?m:[m],B=F.length>0,se={padding:q,boundary:F.filter(tM),altBoundary:B},{refs:G,floatingStyles:L,placement:H,isPositioned:$,middlewareData:R}=VA({strategy:"fixed",placement:Y,whileElementsMounted:(...Dt)=>TA(...Dt,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[zA({mainAxis:a+D,alignmentAxis:c}),f&&WA({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?UA():void 0,...se}),f&&HA({...se}),qA({...se,apply:({elements:Dt,rects:In,availableWidth:Fn,availableHeight:$n})=>{const{width:vn,height:Vn}=In.reference,an=Dt.floating.style;an.setProperty("--radix-popper-available-width",`${Fn}px`),an.setProperty("--radix-popper-available-height",`${$n}px`),an.setProperty("--radix-popper-anchor-width",`${vn}px`),an.setProperty("--radix-popper-anchor-height",`${Vn}px`)}}),E&&YA({element:E,padding:d}),nM({arrowWidth:M,arrowHeight:D}),b&&KA({strategy:"referenceHidden",...se})]}),[W,Z]=vC(H),V=ts(k);ks(()=>{$&&(V==null||V())},[$,V]);const O=(le=R.arrow)==null?void 0:le.x,Q=(be=R.arrow)==null?void 0:be.y,re=((we=R.arrow)==null?void 0:we.centerOffset)!==0,[oe,de]=x.useState();return ks(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),s.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:$?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(pe=R.transformOrigin)==null?void 0:pe.x,(mt=R.transformOrigin)==null?void 0:mt.y].join(" "),...((on=R.hide)==null?void 0:on.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(ZA,{scope:n,placedSide:W,onArrowChange:P,arrowX:O,arrowY:Q,shouldHideArrow:re,children:s.jsx(qe.div,{"data-side":W,"data-align":Z,...N,ref:S,style:{...N.style,animation:$?void 0:"none"}})})})});gC.displayName=mx;var xC="PopperArrow",eM={top:"bottom",right:"left",bottom:"top",left:"right"},yC=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,l=JA(xC,r),c=eM[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(GA,{...a,ref:n,style:{...a.style,display:"block"}})})});yC.displayName=xC;function tM(e){return e!==null}var nM=e=>({name:"transformOrigin",options:e,fn(t){var w,_,j;const{placement:n,rects:r,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,p]=vC(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((_=a.arrow)==null?void 0:_.x)??0)+d/2,y=(((j=a.arrow)==null?void 0:j.y)??0)+f/2;let k="",N="";return m==="bottom"?(k=c?g:`${b}px`,N=`${-f}px`):m==="top"?(k=c?g:`${b}px`,N=`${r.floating.height+f}px`):m==="right"?(k=`${-f}px`,N=c?g:`${y}px`):m==="left"&&(k=`${r.floating.width+f}px`,N=c?g:`${y}px`),{data:{x:k,y:N}}}});function vC(e){const[t,n="center"]=e.split("-");return[t,n]}var rM=mC,hx=pC,bC=gC,wC=yC,sM=Symbol("radix.slottable");function oM(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sM,t}var[wf]=Ro("Tooltip",[bf]),px=bf(),jC="TooltipProvider",aM=700,dw="tooltip.open",[iM,NC]=wf(jC),CC=e=>{const{__scopeTooltip:t,delayDuration:n=aM,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:l}=e,c=x.useRef(!0),d=x.useRef(!1),f=x.useRef(0);return x.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),s.jsx(iM,{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:d,onPointerInTransitChange:x.useCallback(m=>{d.current=m},[]),disableHoverableContent:a,children:l})};CC.displayName=jC;var kC="Tooltip",[lW,jf]=wf(kC),ng="TooltipTrigger",lM=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=jf(ng,n),l=NC(ng,n),c=px(n),d=x.useRef(null),f=Pt(t,d,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(hx,{asChild:!0,...c,children:s.jsx(qe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:f,onPointerMove:Qe(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:Qe(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:Qe(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Qe(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:Qe(e.onBlur,a.onClose),onClick:Qe(e.onClick,a.onClose)})})});lM.displayName=ng;var cM="TooltipPortal",[cW,uM]=wf(cM,{forceMount:void 0}),Oi="TooltipContent",SC=x.forwardRef((e,t)=>{const n=uM(Oi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...l}=e,c=jf(Oi,e.__scopeTooltip);return s.jsx(As,{present:r||c.open,children:c.disableHoverableContent?s.jsx(_C,{side:a,...l,ref:t}):s.jsx(dM,{side:a,...l,ref:t})})}),dM=x.forwardRef((e,t)=>{const n=jf(Oi,e.__scopeTooltip),r=NC(Oi,e.__scopeTooltip),a=x.useRef(null),l=Pt(t,a),[c,d]=x.useState(null),{trigger:f,onClose:m}=n,p=a.current,{onPointerInTransitChange:g}=r,b=x.useCallback(()=>{d(null),g(!1)},[g]),y=x.useCallback((k,N)=>{const w=k.currentTarget,_={x:k.clientX,y:k.clientY},j=gM(_,w.getBoundingClientRect()),S=xM(_,j),E=yM(N.getBoundingClientRect()),P=bM([...S,...E]);d(P),g(!0)},[g]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(f&&p){const k=w=>y(w,p),N=w=>y(w,f);return f.addEventListener("pointerleave",k),p.addEventListener("pointerleave",N),()=>{f.removeEventListener("pointerleave",k),p.removeEventListener("pointerleave",N)}}},[f,p,y,b]),x.useEffect(()=>{if(c){const k=N=>{const w=N.target,_={x:N.clientX,y:N.clientY},j=(f==null?void 0:f.contains(w))||(p==null?void 0:p.contains(w)),S=!vM(_,c);j?b():S&&(b(),m())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[f,p,c,m,b]),s.jsx(_C,{...e,ref:l})}),[fM,mM]=wf(kC,{isInside:!1}),hM=oM("TooltipContent"),_C=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=jf(Oi,n),m=px(n),{onClose:p}=f;return x.useEffect(()=>(document.addEventListener(dw,p),()=>document.removeEventListener(dw,p)),[p]),x.useEffect(()=>{if(f.trigger){const g=b=>{const y=b.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(vc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:s.jsxs(bC,{"data-state":f.stateAttribute,...m,...d,ref:t,style:{...d.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(hM,{children:r}),s.jsx(fM,{scope:n,isInside:!0,children:s.jsx(gT,{id:f.contentId,role:"tooltip",children:a||r})})]})})});SC.displayName=Oi;var EC="TooltipArrow",pM=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=px(n);return mM(EC,n).isInside?null:s.jsx(wC,{...a,...r,ref:t})});pM.displayName=EC;function gM(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 xM(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 yM(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 vM(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 d=t[l],f=t[c],m=d.x,p=d.y,g=f.x,b=f.y;p>r!=b>r&&n<(g-m)*(r-p)/(b-p)+m&&(a=!a)}return a}function bM(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),wM(t)}function wM(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 jM=CC,PC=SC;const NM=jM,CM=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(PC,{ref:r,sideOffset:t,className:Ie("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}));CM.displayName=PC.displayName;const gx=x.createContext({});function xx(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kM=typeof window<"u",TC=kM?x.useLayoutEffect:x.useEffect,Nf=x.createContext(null);function yx(e,t){e.indexOf(t)===-1&&e.push(t)}function Ud(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const rs=(e,t,n)=>n>t?t:n<e?e:n;let vx=()=>{};const Eo={},AC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function MC(e){return typeof e=="object"&&e!==null}const DC=e=>/^0[^.\s]+$/u.test(e);function RC(e){let t;return()=>(t===void 0&&(t=e()),t)}const sr=e=>e,SM=(e,t)=>n=>t(e(n)),Sc=(...e)=>e.reduce(SM),ic=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class bx{constructor(){this.subscriptions=[]}add(t){return yx(this.subscriptions,t),()=>Ud(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 Kn=e=>e*1e3,rr=e=>e/1e3;function OC(e,t){return t?e*(1e3/t):0}const LC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,_M=1e-7,EM=12;function PM(e,t,n,r,a){let l,c,d=0;do c=t+(n-t)/2,l=LC(c,r,a)-e,l>0?n=c:t=c;while(Math.abs(l)>_M&&++d<EM);return c}function _c(e,t,n,r){if(e===t&&n===r)return sr;const a=l=>PM(l,0,1,e,n);return l=>l===0||l===1?l:LC(a(l),t,r)}const IC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,FC=e=>t=>1-e(1-t),$C=_c(.33,1.53,.69,.99),wx=FC($C),VC=IC(wx),BC=e=>e>=1?1:(e*=2)<1?.5*wx(e):.5*(2-Math.pow(2,-10*(e-1))),jx=e=>1-Math.sin(Math.acos(e)),zC=FC(jx),WC=IC(jx),TM=_c(.42,0,1,1),AM=_c(0,0,.58,1),UC=_c(.42,0,.58,1),MM=e=>Array.isArray(e)&&typeof e[0]!="number",HC=e=>Array.isArray(e)&&typeof e[0]=="number",DM={linear:sr,easeIn:TM,easeInOut:UC,easeOut:AM,circIn:jx,circInOut:WC,circOut:zC,backIn:wx,backInOut:VC,backOut:$C,anticipate:BC},RM=e=>typeof e=="string",fw=e=>{if(HC(e)){vx(e.length===4);const[t,n,r,a]=e;return _c(t,n,r,a)}else if(RM(e))return DM[e];return e},Zu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function OM(e,t){let n=new Set,r=new Set,a=!1,l=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function f(p){c.has(p)&&(m.schedule(p),e()),p(d)}const m={schedule:(p,g=!1,b=!1)=>{const k=b&&a?n:r;return g&&c.add(p),k.add(p),p},cancel:p=>{r.delete(p),c.delete(p)},process:p=>{if(d=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 LM=40;function qC(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>n=!0,c=Zu.reduce((S,E)=>(S[E]=OM(l),S),{}),{setup:d,read:f,resolveKeyframes:m,preUpdate:p,update:g,preRender:b,render:y,postRender:k}=c,N=()=>{const S=Eo.useManualTiming,E=S?a.timestamp:performance.now();n=!1,S||(a.delta=r?1e3/60:Math.max(Math.min(E-a.timestamp,LM),1)),a.timestamp=E,a.isProcessing=!0,d.process(a),f.process(a),m.process(a),p.process(a),g.process(a),b.process(a),y.process(a),k.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(N))},w=()=>{n=!0,r=!0,a.isProcessing||e(N)};return{schedule:Zu.reduce((S,E)=>{const P=c[E];return S[E]=(A,M=!1,D=!1)=>(n||w(),P.schedule(A,M,D)),S},{}),cancel:S=>{for(let E=0;E<Zu.length;E++)c[Zu[E]].cancel(S)},state:a,steps:c}}const{schedule:at,cancel:Po,state:Qt,steps:zh}=qC(typeof requestAnimationFrame<"u"?requestAnimationFrame:sr,!0);let yd;function IM(){yd=void 0}const pn={now:()=>(yd===void 0&&pn.set(Qt.isProcessing||Eo.useManualTiming?Qt.timestamp:performance.now()),yd),set:e=>{yd=e,queueMicrotask(IM)}},KC=e=>t=>typeof t=="string"&&t.startsWith(e),YC=KC("--"),FM=KC("var(--"),Nx=e=>FM(e)?$M.test(e.split("/*")[0].trim()):!1,$M=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mw(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Yi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},lc={...Yi,transform:e=>rs(0,1,e)},Ju={...Yi,default:1},Xl=e=>Math.round(e*1e5)/1e5,Cx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function VM(e){return e==null}const BM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kx=(e,t)=>n=>!!(typeof n=="string"&&BM.test(n)&&n.startsWith(e)||t&&!VM(n)&&Object.prototype.hasOwnProperty.call(n,t)),QC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,l,c,d]=r.match(Cx);return{[e]:parseFloat(a),[t]:parseFloat(l),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},zM=e=>rs(0,255,e),Wh={...Yi,transform:e=>Math.round(zM(e))},ca={test:kx("rgb","red"),parse:QC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Wh.transform(e)+", "+Wh.transform(t)+", "+Wh.transform(n)+", "+Xl(lc.transform(r))+")"};function WM(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 rg={test:kx("#"),parse:WM,transform:ca.transform},Ec=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ao=Ec("deg"),es=Ec("%"),Ne=Ec("px"),UM=Ec("vh"),HM=Ec("vw"),hw={...es,parse:e=>es.parse(e)/100,transform:e=>es.transform(e*100)},ui={test:kx("hsl","hue"),parse:QC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+es.transform(Xl(t))+", "+es.transform(Xl(n))+", "+Xl(lc.transform(r))+")"},Mt={test:e=>ca.test(e)||rg.test(e)||ui.test(e),parse:e=>ca.test(e)?ca.parse(e):ui.test(e)?ui.parse(e):rg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ca.transform(e):ui.transform(e),getAnimatableNone:e=>{const t=Mt.parse(e);return t.alpha=0,Mt.transform(t)}},qM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function KM(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Cx))==null?void 0:t.length)||0)+(((n=e.match(qM))==null?void 0:n.length)||0)>0}const GC="number",XC="color",YM="var",QM="var(",pw="${}",GM=/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 Li(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let l=0;const d=t.replace(GM,f=>(Mt.test(f)?(r.color.push(l),a.push(XC),n.push(Mt.parse(f))):f.startsWith(QM)?(r.var.push(l),a.push(YM),n.push(f)):(r.number.push(l),a.push(GC),n.push(parseFloat(f))),++l,pw)).split(pw);return{values:n,split:d,indexes:r,types:a}}function XM(e){return Li(e).values}function ZC({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===GC?a+=Xl(r[l]):c===XC?a+=Mt.transform(r[l]):a+=r[l]}return a}}function ZM(e){return ZC(Li(e))}const JM=e=>typeof e=="number"?0:Mt.test(e)?Mt.getAnimatableNone(e):e,eD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:JM(e);function tD(e){const t=Li(e);return ZC(t)(t.values.map((r,a)=>eD(r,t.split[a])))}const jr={test:KM,parse:XM,createTransformer:ZM,getAnimatableNone:tD};function Uh(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 nD({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 d=n<.5?n*(1+t):n+t-n*t,f=2*n-d;a=Uh(f,d,e+1/3),l=Uh(f,d,e),c=Uh(f,d,e-1/3)}return{red:Math.round(a*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:r}}function Hd(e,t){return n=>n>0?t:e}const yt=(e,t,n)=>e+(t-e)*n,Hh=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},rD=[rg,ca,ui],sD=e=>rD.find(t=>t.test(e));function gw(e){const t=sD(e);if(!t)return!1;let n=t.parse(e);return t===ui&&(n=nD(n)),n}const xw=(e,t)=>{const n=gw(e),r=gw(t);if(!n||!r)return Hd(e,t);const a={...n};return l=>(a.red=Hh(n.red,r.red,l),a.green=Hh(n.green,r.green,l),a.blue=Hh(n.blue,r.blue,l),a.alpha=yt(n.alpha,r.alpha,l),ca.transform(a))},sg=new Set(["none","hidden"]);function oD(e,t){return sg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function aD(e,t){return n=>yt(e,t,n)}function Sx(e){return typeof e=="number"?aD:typeof e=="string"?Nx(e)?Hd:Mt.test(e)?xw:cD:Array.isArray(e)?JC:typeof e=="object"?Mt.test(e)?xw:iD:Hd}function JC(e,t){const n=[...e],r=n.length,a=e.map((l,c)=>Sx(l)(l,t[c]));return l=>{for(let c=0;c<r;c++)n[c]=a[c](l);return n}}function iD(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=Sx(e[a])(e[a],t[a]));return a=>{for(const l in r)n[l]=r[l](a);return n}}function lD(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]],d=e.values[c]??0;n[a]=d,r[l]++}return n}const cD=(e,t)=>{const n=jr.createTransformer(t),r=Li(e),a=Li(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?sg.has(e)&&!a.values.length||sg.has(t)&&!r.values.length?oD(e,t):Sc(JC(lD(r,a),a.values),n):Hd(e,t)};function ek(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?yt(e,t,n):Sx(e)(e,t)}const uD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>at.update(t,n),stop:()=>Po(t),now:()=>Qt.isProcessing?Qt.timestamp:pn.now()}},tk=(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)})`},qd=2e4;function _x(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<qd;)t+=n,r=e.next(t);return t>=qd?1/0:t}function dD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(_x(r),qd);return{type:"keyframes",ease:l=>r.next(a*l).value/t,duration:rr(a)}}const jt={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 og(e,t){return e*Math.sqrt(1-t*t)}const fD=12;function mD(e,t,n){let r=n;for(let a=1;a<fD;a++)r=r-e(r)/t(r);return r}const qh=.001;function hD({duration:e=jt.duration,bounce:t=jt.bounce,velocity:n=jt.velocity,mass:r=jt.mass}){let a,l,c=1-t;c=rs(jt.minDamping,jt.maxDamping,c),e=rs(jt.minDuration,jt.maxDuration,rr(e)),c<1?(a=m=>{const p=m*c,g=p*e,b=p-n,y=og(m,c),k=Math.exp(-g);return qh-b/y*k},l=m=>{const g=m*c*e,b=g*n+n,y=Math.pow(c,2)*Math.pow(m,2)*e,k=Math.exp(-g),N=og(Math.pow(m,2),c);return(-a(m)+qh>0?-1:1)*((b-y)*k)/N}):(a=m=>{const p=Math.exp(-m*e),g=(m-n)*e+1;return-qh+p*g},l=m=>{const p=Math.exp(-m*e),g=(n-m)*(e*e);return p*g});const d=5/e,f=mD(a,l,d);if(e=Kn(e),isNaN(f))return{stiffness:jt.stiffness,damping:jt.damping,duration:e};{const m=Math.pow(f,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:e}}}const pD=["duration","bounce"],gD=["stiffness","damping","mass"];function yw(e,t){return t.some(n=>e[n]!==void 0)}function xD(e){let t={velocity:jt.velocity,stiffness:jt.stiffness,damping:jt.damping,mass:jt.mass,isResolvedFromDuration:!1,...e};if(!yw(e,gD)&&yw(e,pD))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,l=2*rs(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:jt.mass,stiffness:a,damping:l}}else{const n=hD({...e,velocity:0});t={...t,...n,mass:jt.mass},t.isResolvedFromDuration=!0}return t}function Kd(e=jt.visualDuration,t=jt.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],d={done:!1,value:l},{stiffness:f,damping:m,mass:p,duration:g,velocity:b,isResolvedFromDuration:y}=xD({...n,velocity:-rr(n.velocity||0)}),k=b||0,N=m/(2*Math.sqrt(f*p)),w=c-l,_=rr(Math.sqrt(f/p)),j=Math.abs(w)<5;r||(r=j?jt.restSpeed.granular:jt.restSpeed.default),a||(a=j?jt.restDelta.granular:jt.restDelta.default);let S,E,P,A,M,D;if(N<1)P=og(_,N),A=(k+N*_*w)/P,S=q=>{const F=Math.exp(-N*_*q);return c-F*(A*Math.sin(P*q)+w*Math.cos(P*q))},M=N*_*A+w*P,D=N*_*w-A*P,E=q=>Math.exp(-N*_*q)*(M*Math.sin(P*q)+D*Math.cos(P*q));else if(N===1){S=F=>c-Math.exp(-_*F)*(w+(k+_*w)*F);const q=k+_*w;E=F=>Math.exp(-_*F)*(_*q*F-k)}else{const q=_*Math.sqrt(N*N-1);S=G=>{const L=Math.exp(-N*_*G),H=Math.min(q*G,300);return c-L*((k+N*_*w)*Math.sinh(H)+q*w*Math.cosh(H))/q};const F=(k+N*_*w)/q,B=N*_*F-w*q,se=N*_*w-F*q;E=G=>{const L=Math.exp(-N*_*G),H=Math.min(q*G,300);return L*(B*Math.sinh(H)+se*Math.cosh(H))}}const Y={calculatedDuration:y&&g||null,velocity:q=>Kn(E(q)),next:q=>{if(!y&&N<1){const B=Math.exp(-N*_*q),se=Math.sin(P*q),G=Math.cos(P*q),L=c-B*(A*se+w*G),H=Kn(B*(M*se+D*G));return d.done=Math.abs(H)<=r&&Math.abs(c-L)<=a,d.value=d.done?c:L,d}const F=S(q);if(y)d.done=q>=g;else{const B=Kn(E(q));d.done=Math.abs(B)<=r&&Math.abs(c-F)<=a}return d.value=d.done?c:F,d},toString:()=>{const q=Math.min(_x(Y),qd),F=tk(B=>Y.next(q*B).value,q,30);return q+"ms "+F},toTransition:()=>{}};return Y}Kd.applyToOptions=e=>{const t=dD(e,100,Kd);return e.ease=t.ease,e.duration=Kn(t.duration),e.type="keyframes",e};const yD=5;function nk(e,t,n){const r=Math.max(t-yD,0);return OC(n-e(r),t-r)}function ag({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:l=500,modifyTarget:c,min:d,max:f,restDelta:m=.5,restSpeed:p}){const g=e[0],b={done:!1,value:g},y=D=>d!==void 0&&D<d||f!==void 0&&D>f,k=D=>d===void 0?f:f===void 0||Math.abs(d-D)<Math.abs(f-D)?d:f;let N=n*t;const w=g+N,_=c===void 0?w:c(w);_!==w&&(N=_-g);const j=D=>-N*Math.exp(-D/r),S=D=>_+j(D),E=D=>{const Y=j(D),q=S(D);b.done=Math.abs(Y)<=m,b.value=b.done?_:q};let P,A;const M=D=>{y(b.value)&&(P=D,A=Kd({keyframes:[b.value,k(b.value)],velocity:nk(S,D,b.value),damping:a,stiffness:l,restDelta:m,restSpeed:p}))};return M(0),{calculatedDuration:null,next:D=>{let Y=!1;return!A&&P===void 0&&(Y=!0,E(D),M(D)),P!==void 0&&D>=P?A.next(D-P):(!Y&&E(D),b)}}}function vD(e,t,n){const r=[],a=n||Eo.mix||ek,l=e.length-1;for(let c=0;c<l;c++){let d=a(e[c],e[c+1]);if(t){const f=Array.isArray(t)?t[c]||sr:t;d=Sc(f,d)}r.push(d)}return r}function bD(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const l=e.length;if(vx(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 d=vD(t,r,a),f=d.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 b=ic(e[g],e[g+1],p);return d[g](b)};return n?p=>m(rs(e[0],e[l-1],p)):m}function wD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=ic(0,t,r);e.push(yt(n,1,a))}}function jD(e){const t=[0];return wD(t,e.length-1),t}function ND(e,t){return e.map(n=>n*t)}function CD(e,t){return e.map(()=>t||UC).splice(0,e.length-1)}function Zl({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=MM(r)?r.map(fw):fw(r),l={done:!1,value:t[0]},c=ND(n&&n.length===t.length?n:jD(t),e),d=bD(c,t,{ease:Array.isArray(a)?a:CD(t,a)});return{calculatedDuration:e,next:f=>(l.value=d(f),l.done=f>=e,l)}}const kD=e=>e!==null;function Cf(e,{repeat:t,repeatType:n="loop"},r,a=1){const l=e.filter(kD),d=a<0||t&&n!=="loop"&&t%2===1?0:l.length-1;return!d||r===void 0?l[d]:r}const SD={decay:ag,inertia:ag,tween:Zl,keyframes:Zl,spring:Kd};function rk(e){typeof e.type=="string"&&(e.type=SD[e.type])}class Ex{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 _D=e=>e/100;class Yd extends Ex{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!==pn.now()&&this.tick(pn.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;rk(t);const{type:n=Zl,repeat:r=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:d}=t;const f=n||Zl;f!==Zl&&typeof d[0]!="number"&&(this.mixKeyframes=Sc(_D,ek(d[0],d[1])),d=[0,100]);const m=f({...t,keyframes:d});l==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...d].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=_x(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:d,calculatedDuration:f}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:p,repeat:g,repeatType:b,repeatDelay:y,type:k,onUpdate:N,finalKeyframe:w}=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),j=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)/d;let Y=Math.floor(D),q=D%1;!q&&D>=1&&(q=1),q===1&&Y--,Y=Math.min(Y,g+1),!!(Y%2)&&(b==="reverse"?(q=1-q,y&&(q-=y/d)):b==="mirror"&&(E=c)),S=rs(0,1,q)*d}let P;j?(this.delayState.value=p[0],P=this.delayState):P=E.next(S),l&&!j&&(P.value=l(P.value));let{done:A}=P;!j&&f!==null&&(A=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&k!==ag&&(P.value=Cf(p,this.options,w,this.speed)),N&&N(P.value),M&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return rr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rr(t)}get time(){return rr(this.currentTime)}set time(t){t=Kn(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 nk(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(pn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=rr(this.currentTime))}play(){var a,l;if(this.isStopped)return;const{driver:t=uD,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(pn.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 ED(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ua=e=>e*180/Math.PI,ig=e=>{const t=ua(Math.atan2(e[1],e[0]));return lg(t)},PD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ig,rotateZ:ig,skewX:e=>ua(Math.atan(e[1])),skewY:e=>ua(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},lg=e=>(e=e%360,e<0&&(e+=360),e),vw=ig,bw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ww=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),TD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bw,scaleY:ww,scale:e=>(bw(e)+ww(e))/2,rotateX:e=>lg(ua(Math.atan2(e[6],e[5]))),rotateY:e=>lg(ua(Math.atan2(-e[2],e[0]))),rotateZ:vw,rotate:vw,skewX:e=>ua(Math.atan(e[4])),skewY:e=>ua(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cg(e){return e.includes("scale")?1:0}function ug(e,t){if(!e||e==="none")return cg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=TD,a=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=PD,a=d}if(!a)return cg(t);const l=r[t],c=a[1].split(",").map(MD);return typeof l=="function"?l(c):c[l]}const AD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ug(n,t)};function MD(e){return parseFloat(e.trim())}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gi=new Set(Qi),jw=e=>e===Yi||e===Ne,DD=new Set(["x","y","z"]),RD=Qi.filter(e=>!DD.has(e));function OD(e){const t=[];return RD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bo={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})=>ug(t,"x"),y:(e,{transform:t})=>ug(t,"y")};bo.translateX=bo.x;bo.translateY=bo.y;const ba=new Set;let dg=!1,fg=!1,mg=!1;function sk(){if(fg){const e=Array.from(ba).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=OD(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 d;(d=r.getValue(l))==null||d.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fg=!1,dg=!1,ba.forEach(e=>e.complete(mg)),ba.clear()}function ok(){ba.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fg=!0)})}function LD(){mg=!0,ok(),sk(),mg=!1}class Px{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?(ba.add(this),dg||(dg=!0,at.read(ok),at.resolveKeyframes(sk))):(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 d=r.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),a&&l===void 0&&a.set(t[0])}ED(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ba.delete(this)}cancel(){this.state==="scheduled"&&(ba.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ID=e=>e.startsWith("--");function ak(e,t,n){ID(t)?e.style.setProperty(t,n):e.style[t]=n}const FD={};function ik(e,t){const n=RC(e);return()=>FD[t]??n()}const $D=ik(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),lk=ik(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ql=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ql([0,.65,.55,1]),circOut:ql([.55,0,1,.45]),backIn:ql([.31,.01,.66,-.59]),backOut:ql([.33,1.53,.69,.99])};function ck(e,t){if(e)return typeof e=="function"?lk()?tk(e,t):"ease-out":HC(e)?ql(e):Array.isArray(e)?e.map(n=>ck(n,t)||Nw.easeOut):Nw[e]}function VD(e,t,n,{delay:r=0,duration:a=300,repeat:l=0,repeatType:c="loop",ease:d="easeOut",times:f}={},m=void 0){const p={[t]:n};f&&(p.offset=f);const g=ck(d,a);Array.isArray(g)&&(p.easing=g);const b={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(p,b)}function uk(e){return typeof e=="function"&&"applyToOptions"in e}function BD({type:e,...t}){return uk(e)&&lk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class dk extends Ex{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:d,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,vx(typeof t.type!="string");const m=BD(t);this.animation=VD(n,r,a,m,l),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const p=Cf(a,this.options,d,this.speed);this.updateMotionValue&&this.updateMotionValue(p),ak(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 rr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+rr(t)}get time(){return rr(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Kn(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&&$D()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),sr):a(this)}}const fk={anticipate:BC,backInOut:VC,circInOut:WC};function zD(e){return e in fk}function WD(e){typeof e.ease=="string"&&zD(e.ease)&&(e.ease=fk[e.ease])}const Kh=10;class UD extends dk{constructor(t){WD(t),rk(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 d=new Yd({...c,autoplay:!1}),f=Math.max(Kh,pn.now()-this.startTime),m=rs(0,Kh,f-Kh),p=d.sample(f).value,{name:g}=this.options;l&&g&&ak(l,g,p),n.setWithVelocity(d.sample(Math.max(0,f-m)).value,p,m),d.stop()}}const Cw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(jr.test(e)||e==="0")&&!e.startsWith("url("));function HD(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 qD(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=Cw(a,t),d=Cw(l,t);return!c||!d?!1:HD(e)||(n==="spring"||uk(n))&&r}function hg(e){e.duration=0,e.type="keyframes"}const mk=new Set(["opacity","clipPath","filter","transform"]),KD=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function YD(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&KD.test(e[t]))return!0;return!1}const QD=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),GD=RC(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function XD(e){var g;const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:l,type:c,keyframes:d}=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 GD()&&n&&(mk.has(n)||QD.has(n)&&YD(d))&&(n!=="transform"||!p)&&!m&&!r&&a!=="mirror"&&l!==0&&c!=="inertia"}const ZD=40;class JD extends Ex{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:l=0,repeatType:c="loop",keyframes:d,name:f,motionValue:m,element:p,...g}){var k;super(),this.stop=()=>{var N,w;this._animation&&(this._animation.stop(),(N=this.stopTimeline)==null||N.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=pn.now();const b={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)||Px;this.keyframeResolver=new y(d,(N,w,_)=>this.onKeyframesResolved(N,w,b,!_),f,m,p),(k=this.keyframeResolver)==null||k.scheduleResolve()}onKeyframesResolved(t,n,r,a){var _,j;this.keyframeResolver=void 0;const{name:l,type:c,velocity:d,delay:f,isHandoff:m,onUpdate:p}=r;this.resolvedAt=pn.now();let g=!0;qD(t,l,c,d)||(g=!1,(Eo.instantAnimations||!f)&&(p==null||p(Cf(t,r,n))),t[0]=t[t.length-1],hg(r),r.repeat=0);const y={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>ZD?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},k=g&&!m&&XD(y),N=(j=(_=y.motionValue)==null?void 0:_.owner)==null?void 0:j.current;let w;if(k)try{w=new UD({...y,element:N})}catch{w=new Yd(y)}else w=new Yd(y);w.finished.then(()=>{this.notifyFinished()}).catch(sr),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}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(),LD()),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 hk(e,t,n,r=0,a=1){const l=Array.from(e).sort((m,p)=>m.sortNodePosition(p)).indexOf(t),c=e.size,d=(c-1)*r;return typeof n=="function"?n(l,c):a===1?l*r:d-l*r}const eR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tR(e){const t=eR.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function pk(e,t,n=1){const[r,a]=tR(e);if(!r)return;const l=window.getComputedStyle(t).getPropertyValue(r);if(l){const c=l.trim();return AC(c)?parseFloat(c):c}return Nx(a)?pk(a,t,n+1):a}const nR={type:"spring",stiffness:500,damping:25,restSpeed:10},rR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sR={type:"keyframes",duration:.8},oR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},aR=(e,{keyframes:t})=>t.length>2?sR:Gi.has(e)?e.startsWith("scale")?rR(t[1]):nR:oR;function gk(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Tx(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?gk(n,e):n}const iR=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function lR(e){for(const t in e)if(!iR.has(t))return!0;return!1}const Ax=(e,t,n,r={},a,l)=>c=>{const d=Tx(r,e)||{},f=d.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Kn(f);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:l?void 0:a};lR(d)||Object.assign(p,aR(e,p)),p.duration&&(p.duration=Kn(p.duration)),p.repeatDelay&&(p.repeatDelay=Kn(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let g=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(hg(p),p.delay===0&&(g=!0)),(Eo.instantAnimations||Eo.skipAnimations||a!=null&&a.shouldSkipAnimations)&&(g=!0,hg(p),p.delay=0),p.allowFlatten=!d.type&&!d.ease,g&&!l&&t.get()!==void 0){const b=Cf(p.keyframes,d);if(b!==void 0){at.update(()=>{p.onUpdate(b),p.onComplete()});return}}return d.isSync?new Yd(p):new JD(p)};function kw(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Mx(e,t,n,r){if(typeof t=="function"){const[a,l]=kw(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]=kw(r);t=t(n!==void 0?n:e.custom,a,l)}return t}function wa(e,t,n){const r=e.getProps();return Mx(r,t,n!==void 0?n:r.custom,e)}const xk=new Set(["width","height","top","left","right","bottom",...Qi]),Sw=30,cR=e=>!isNaN(parseFloat(e));class uR{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var l;const a=pn.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=pn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=cR(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 bx);const r=this.events[t].add(n);return t==="change"?()=>{r(),at.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=pn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sw);return OC(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 Ii(e,t){return new uR(e,t)}const pg=e=>Array.isArray(e);function dR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ii(n))}function fR(e){return pg(e)?e[e.length-1]||0:e}function mR(e,t){const n=wa(e,t);let{transitionEnd:r={},transition:a={},...l}=n||{};l={...l,...r};for(const c in l){const d=fR(l[c]);dR(e,c,d)}}const Xt=e=>!!(e&&e.getVelocity);function hR(e){return!!(Xt(e)&&e.add)}function gg(e,t){const n=e.getValue("willChange");if(hR(n))return n.add(t);if(!n&&Eo.WillChange){const r=new Eo.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Dx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const pR="framerAppearId",yk="data-"+Dx(pR);function vk(e){return e.props[yk]}function gR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bk(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:l,transitionEnd:c,...d}=t;const f=e.getDefaultTransition();l=l?gk(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 b in d){const y=e.getValue(b,e.latestValues[b]??null),k=d[b];if(k===void 0||g&&gR(g,b))continue;const N={delay:n,...Tx(l||{},b)},w=y.get();if(w!==void 0&&!y.isAnimating&&!Array.isArray(k)&&k===w&&!N.velocity)continue;let _=!1;if(window.MotionHandoffAnimation){const E=vk(e);if(E){const P=window.MotionHandoffAnimation(E,b,at);P!==null&&(N.startTime=P,_=!0)}}gg(e,b);const j=m??e.shouldReduceMotion;y.start(Ax(b,y,k,j&&xk.has(b)?{type:!1}:N,e,_));const S=y.animation;S&&p.push(S)}if(c){const b=()=>at.update(()=>{c&&mR(e,c)});p.length?Promise.all(p).then(b):b()}return p}function xg(e,t,n={}){var f;const r=wa(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(bk(e,r,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:p=0,staggerChildren:g,staggerDirection:b}=a;return xR(e,t,m,p,g,b,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[m,p]=d==="beforeChildren"?[l,c]:[c,l];return m().then(()=>p())}else return Promise.all([l(),c(n.delay)])}function xR(e,t,n=0,r=0,a=0,l=1,c){const d=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),d.push(xg(f,t,{...c,delay:n+(typeof r=="function"?0:r)+hk(e.variantChildren,f,r,a,l)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(d)}function yR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(l=>xg(e,l,n));r=Promise.all(a)}else if(typeof t=="string")r=xg(e,t,n);else{const a=typeof t=="function"?wa(e,t,n.custom):t;r=Promise.all(bk(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const vR={test:e=>e==="auto",parse:e=>e},wk=e=>t=>t.test(e),jk=[Yi,Ne,es,ao,HM,UM,vR],_w=e=>jk.find(wk(e));function bR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DC(e):!0}const wR=new Set(["brightness","contrast","saturate","opacity"]);function jR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Cx)||[];if(!r)return e;const a=n.replace(r,"");let l=wR.has(t)?1:0;return r!==n&&(l*=100),t+"("+l+a+")"}const NR=/\b([a-z-]*)\(.*?\)/gu,yg={...jr,getAnimatableNone:e=>{const t=e.match(NR);return t?t.map(jR).join(" "):e}},vg={...jr,getAnimatableNone:e=>{const t=jr.parse(e);return jr.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Ew={...Yi,transform:Math.round},CR={rotate:ao,rotateX:ao,rotateY:ao,rotateZ:ao,scale:Ju,scaleX:Ju,scaleY:Ju,scaleZ:Ju,skew:ao,skewX:ao,skewY:ao,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:lc,originX:hw,originY:hw,originZ:Ne},Rx={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,...CR,zIndex:Ew,fillOpacity:lc,strokeOpacity:lc,numOctaves:Ew},kR={...Rx,color:Mt,backgroundColor:Mt,outlineColor:Mt,fill:Mt,stroke:Mt,borderColor:Mt,borderTopColor:Mt,borderRightColor:Mt,borderBottomColor:Mt,borderLeftColor:Mt,filter:yg,WebkitFilter:yg,mask:vg,WebkitMask:vg},Nk=e=>kR[e],SR=new Set([yg,vg]);function Ck(e,t){let n=Nk(e);return SR.has(n)||(n=jr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _R=new Set(["auto","none","0"]);function ER(e,t,n){let r=0,a;for(;r<e.length&&!a;){const l=e[r];typeof l=="string"&&!_R.has(l)&&Li(l).values.length&&(a=e[r]),r++}if(a&&n)for(const l of t)e[l]=Ck(n,a)}class PR extends Px{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(),Nx(g))){const b=pk(g,n.current);b!==void 0&&(t[p]=b),p===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!xk.has(r)||t.length!==2)return;const[a,l]=t,c=_w(a),d=_w(l),f=mw(a),m=mw(l);if(f!==m&&bo[r]){this.needsMeasurement=!0;return}if(c!==d)if(jw(c)&&jw(d))for(let p=0;p<t.length;p++){const g=t[p];typeof g=="string"&&(t[p]=parseFloat(g))}else bo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||bR(t[a]))&&r.push(a);r.length&&ER(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=bo[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 d;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]=bo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(d=this.removedTransforms)!=null&&d.length&&this.removedTransforms.forEach(([f,m])=>{t.getValue(f).set(m)}),this.resolveNoneKeyframes()}}function kk(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 Sk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function vd(e){return MC(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Ox}=qC(queueMicrotask,!1),vr={x:!1,y:!1};function _k(){return vr.x||vr.y}function TR(e){return e==="x"||e==="y"?vr[e]?null:(vr[e]=!0,()=>{vr[e]=!1}):vr.x||vr.y?null:(vr.x=vr.y=!0,()=>{vr.x=vr.y=!1})}function Ek(e,t){const n=kk(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function AR(e){return!(e.pointerType==="touch"||_k())}function MR(e,t,n={}){const[r,a,l]=Ek(e,n);return r.forEach(c=>{let d=!1,f=!1,m;const p=()=>{c.removeEventListener("pointerleave",k)},g=w=>{m&&(m(w),m=void 0),p()},b=w=>{d=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),f&&(f=!1,g(w))},y=()=>{d=!0,window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",b,a)},k=w=>{if(w.pointerType!=="touch"){if(d){f=!0;return}g(w)}},N=w=>{if(!AR(w))return;f=!1;const _=t(c,w);typeof _=="function"&&(m=_,c.addEventListener("pointerleave",k,a))};c.addEventListener("pointerenter",N,a),c.addEventListener("pointerdown",y,a)}),l}const Pk=(e,t)=>t?e===t?!0:Pk(e,t.parentElement):!1,Lx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,DR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function RR(e){return DR.has(e.tagName)||e.isContentEditable===!0}const OR=new Set(["INPUT","SELECT","TEXTAREA"]);function LR(e){return OR.has(e.tagName)||e.isContentEditable===!0}const bd=new WeakSet;function Pw(e){return t=>{t.key==="Enter"&&e(t)}}function Yh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const IR=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Pw(()=>{if(bd.has(n))return;Yh(n,"down");const a=Pw(()=>{Yh(n,"up")}),l=()=>Yh(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 Tw(e){return Lx(e)&&!_k()}const Aw=new WeakSet;function FR(e,t,n={}){const[r,a,l]=Ek(e,n),c=d=>{const f=d.currentTarget;if(!Tw(d)||Aw.has(d))return;bd.add(f),n.stopPropagation&&Aw.add(d);const m=t(f,d),p=(y,k)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",b),bd.has(f)&&bd.delete(f),Tw(y)&&typeof m=="function"&&m(y,{success:k})},g=y=>{p(y,f===window||f===document||n.useGlobalTarget||Pk(f,y.target))},b=y=>{p(y,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",b,a)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),vd(d)&&(d.addEventListener("focus",m=>IR(m,a)),!RR(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),l}function Ix(e){return MC(e)&&"ownerSVGElement"in e}const wd=new WeakMap;let io;const Tk=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:Ix(r)&&"getBBox"in r?r.getBBox()[t]:r[n],$R=Tk("inline","width","offsetWidth"),VR=Tk("block","height","offsetHeight");function BR({target:e,borderBoxSize:t}){var n;(n=wd.get(e))==null||n.forEach(r=>{r(e,{get width(){return $R(e,t)},get height(){return VR(e,t)}})})}function zR(e){e.forEach(BR)}function WR(){typeof ResizeObserver>"u"||(io=new ResizeObserver(zR))}function UR(e,t){io||WR();const n=kk(e);return n.forEach(r=>{let a=wd.get(r);a||(a=new Set,wd.set(r,a)),a.add(t),io==null||io.observe(r)}),()=>{n.forEach(r=>{const a=wd.get(r);a==null||a.delete(t),a!=null&&a.size||io==null||io.unobserve(r)})}}const jd=new Set;let di;function HR(){di=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jd.forEach(t=>t(e))},window.addEventListener("resize",di)}function qR(e){return jd.add(e),di||HR(),()=>{jd.delete(e),!jd.size&&typeof di=="function"&&(window.removeEventListener("resize",di),di=void 0)}}function Mw(e,t){return typeof e=="function"?qR(e):UR(e,t)}function KR(e){return Ix(e)&&e.tagName==="svg"}const YR=[...jk,Mt,jr],QR=e=>YR.find(wk(e)),Dw=()=>({translate:0,scale:1,origin:0,originPoint:0}),fi=()=>({x:Dw(),y:Dw()}),Rw=()=>({min:0,max:0}),Lt=()=>({x:Rw(),y:Rw()}),GR=new WeakMap;function kf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function cc(e){return typeof e=="string"||Array.isArray(e)}const Fx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$x=["initial",...Fx];function Sf(e){return kf(e.animate)||$x.some(t=>cc(e[t]))}function Ak(e){return!!(Sf(e)||e.variants)}function XR(e,t,n){for(const r in t){const a=t[r],l=n[r];if(Xt(a))e.addValue(r,a);else if(Xt(l))e.addValue(r,Ii(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,Ii(c!==void 0?c:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const bg={current:null},Mk={current:!1},ZR=typeof window<"u";function JR(){if(Mk.current=!0,!!ZR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>bg.current=e.matches;e.addEventListener("change",t),t()}else bg.current=!1}const Ow=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qd={};function Dk(e){Qd=e}function eO(){return Qd}class tO{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:l,blockInitialAnimation:c,visualState:d},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=Px,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=pn.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,at.render(this.render,!1,!0))};const{latestValues:m,renderState:p}=d;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=Sf(n),this.isVariantNode=Ak(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in b){const k=b[y];m[y]!==void 0&&Xt(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,GR.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:(Mk.current||JR(),this.shouldReduceMotion=bg.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(),Po(this.notifyUpdate),Po(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&&mk.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:d,times:f,ease:m,duration:p}=n.accelerate,g=new dk({element:this.current,name:t,keyframes:d,times:f,ease:m,duration:Kn(p)}),b=c(g);this.valueSubscriptions.set(t,()=>{b(),g.cancel()});return}const r=Gi.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&at.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 Qd){const n=Qd[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):Lt()}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<Ow.length;r++){const a=Ow[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=XR(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=Ii(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"&&(AC(r)||DC(r))?r=parseFloat(r):!QR(r)&&jr.test(n)&&(r=Ck(t,n)),this.setBaseTarget(t,Xt(r)?r.get():r)),Xt(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=Mx(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&&!Xt(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 bx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ox.render(this.render)}}class Rk extends tO{constructor(){super(...arguments),this.KeyframeResolver=PR}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;Xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Fo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ok({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rO(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 Qh(e){return e===void 0||e===1}function wg({scale:e,scaleX:t,scaleY:n}){return!Qh(e)||!Qh(t)||!Qh(n)}function aa(e){return wg(e)||Lk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lk(e){return Lw(e.x)||Lw(e.y)}function Lw(e){return e&&e!=="0%"}function Gd(e,t,n){const r=e-n,a=t*r;return n+a}function Iw(e,t,n,r,a){return a!==void 0&&(e=Gd(e,a,r)),Gd(e,n,r)+t}function jg(e,t=0,n=1,r,a){e.min=Iw(e.min,t,n,r,a),e.max=Iw(e.max,t,n,r,a)}function Ik(e,{x:t,y:n}){jg(e.x,t.translate,t.scale,t.originPoint),jg(e.y,n.translate,n.scale,n.originPoint)}const Fw=.999999999999,$w=1.0000000000001;function sO(e,t,n,r=!1){var d;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&&(qr(e.x,-l.scroll.offset.x),qr(e.y,-l.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Ik(e,c)),r&&aa(l.latestValues)&&Nd(e,l.latestValues,(d=l.layout)==null?void 0:d.layoutBox))}t.x<$w&&t.x>Fw&&(t.x=1),t.y<$w&&t.y>Fw&&(t.y=1)}function qr(e,t){e.min+=t,e.max+=t}function Vw(e,t,n,r,a=.5){const l=yt(e.min,e.max,a);jg(e,t,n,l,r)}function Bw(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Nd(e,t,n){const r=n??e;Vw(e.x,Bw(t.x,r.x),t.scaleX,t.scale,t.originX),Vw(e.y,Bw(t.y,r.y),t.scaleY,t.scale,t.originY)}function Fk(e,t){return Ok(rO(e.getBoundingClientRect(),t))}function oO(e,t,n){const r=Fk(e,n),{scroll:a}=t;return a&&(qr(r.x,a.offset.x),qr(r.y,a.offset.y)),r}const aO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iO=Qi.length;function lO(e,t,n){let r="",a=!0;for(let l=0;l<iO;l++){const c=Qi[l],d=e[c];if(d===void 0)continue;let f=!0;if(typeof d=="number")f=d===(c.startsWith("scale")?1:0);else{const m=parseFloat(d);f=c.startsWith("scale")?m===1:m===0}if(!f||n){const m=Sk(d,Rx[c]);if(!f){a=!1;const p=aO[c]||c;r+=`${p}(${m}) `}n&&(t[c]=m)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function Vx(e,t,n){const{style:r,vars:a,transformOrigin:l}=e;let c=!1,d=!1;for(const f in t){const m=t[f];if(Gi.has(f)){c=!0;continue}else if(YC(f)){a[f]=m;continue}else{const p=Sk(m,Rx[f]);f.startsWith("origin")?(d=!0,l[f]=p):r[f]=p}}if(t.transform||(c||n?r.transform=lO(t,e.transform,n):r.transform&&(r.transform="none")),d){const{originX:f="50%",originY:m="50%",originZ:p=0}=l;r.transformOrigin=`${f} ${m} ${p}`}}function $k(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 zw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Il={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const n=zw(e,t.target.x),r=zw(e,t.target.y);return`${n}% ${r}%`}},cO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=jr.parse(e);if(a.length>5)return r;const l=jr.createTransformer(e),c=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,f=n.y.scale*t.y;a[0+c]/=d,a[1+c]/=f;const m=yt(d,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:{...Il,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Il,borderTopRightRadius:Il,borderBottomLeftRadius:Il,borderBottomRightRadius:Il,boxShadow:cO};function Vk(e,{layout:t,layoutId:n}){return Gi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ng[e]||e==="opacity")}function Bx(e,t,n){var c;const r=e.style,a=t==null?void 0:t.style,l={};if(!r)return l;for(const d in r)(Xt(r[d])||a&&Xt(a[d])||Vk(d,e)||((c=n==null?void 0:n.getValue(d))==null?void 0:c.liveStyle)!==void 0)&&(l[d]=r[d]);return l}function uO(e){return window.getComputedStyle(e)}class dO extends Rk{constructor(){super(...arguments),this.type="html",this.renderInstance=$k}readValueFromInstance(t,n){var r;if(Gi.has(n))return(r=this.projection)!=null&&r.isProjecting?cg(n):AD(t,n);{const a=uO(t),l=(YC(n)?a.getPropertyValue(n):a[n])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fk(t,n)}build(t,n,r){Vx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Bx(t,n,r)}}const fO={offset:"stroke-dashoffset",array:"stroke-dasharray"},mO={offset:"strokeDashoffset",array:"strokeDasharray"};function hO(e,t,n=1,r=0,a=!0){e.pathLength=1;const l=a?fO:mO;e[l.offset]=`${-r}`,e[l.array]=`${t} ${n}`}const pO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Bk(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...d},f,m,p){if(Vx(e,d,m),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;g.transform&&(b.transform=g.transform,delete g.transform),(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete g.transformBox);for(const y of pO)g[y]!==void 0&&(b[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&&hO(g,a,l,c,!1)}const zk=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"]),Wk=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gO(e,t,n,r){$k(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(zk.has(a)?a:Dx(a),t.attrs[a])}function Uk(e,t,n){const r=Bx(e,t,n);for(const a in e)if(Xt(e[a])||Xt(t[a])){const l=Qi.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[l]=e[a]}return r}class xO extends Rk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Lt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gi.has(n)){const r=Nk(n);return r&&r.default||0}return n=zk.has(n)?n:Dx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Uk(t,n,r)}build(t,n,r){Bk(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){gO(t,n,r,a)}mount(t){this.isSVGTag=Wk(t.tagName),super.mount(t)}}const yO=$x.length;function Hk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Hk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<yO;n++){const r=$x[n],a=e.props[r];(cc(a)||a===!1)&&(t[r]=a)}return t}function qk(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 vO=[...Fx].reverse(),bO=Fx.length;function wO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>yR(e,n,r)))}function jO(e){let t=wO(e),n=Ww(),r=!0,a=!1;const l=m=>(p,g)=>{var y;const b=wa(e,g,m==="exit"?(y=e.presenceContext)==null?void 0:y.custom:void 0);if(b){const{transition:k,transitionEnd:N,...w}=b;p={...p,...w,...N}}return p};function c(m){t=m(e)}function d(m){const{props:p}=e,g=Hk(e.parent)||{},b=[],y=new Set;let k={},N=1/0;for(let _=0;_<bO;_++){const j=vO[_],S=n[j],E=p[j]!==void 0?p[j]:g[j],P=cc(E),A=j===m?S.isActive:null;A===!1&&(N=_);let M=E===g[j]&&E!==p[j]&&P;if(M&&(r||a)&&e.manuallyAnimateOnMount&&(M=!1),S.protectedKeys={...k},!S.isActive&&A===null||!E&&!S.prevProp||kf(E)||typeof E=="boolean")continue;if(j==="exit"&&S.isActive&&A!==!0){S.prevResolvedValues&&(k={...k,...S.prevResolvedValues});continue}const D=NO(S.prevProp,E);let Y=D||j===m&&S.isActive&&!M&&P||_>N&&P,q=!1;const F=Array.isArray(E)?E:[E];let B=F.reduce(l(j),{});A===!1&&(B={});const{prevResolvedValues:se={}}=S,G={...se,...B},L=R=>{Y=!0,y.has(R)&&(q=!0,y.delete(R)),S.needsAnimating[R]=!0;const W=e.getValue(R);W&&(W.liveStyle=!1)};for(const R in G){const W=B[R],Z=se[R];if(k.hasOwnProperty(R))continue;let V=!1;pg(W)&&pg(Z)?V=!qk(W,Z):V=W!==Z,V?W!=null?L(R):y.add(R):W!==void 0&&y.has(R)?L(R):S.protectedKeys[R]=!0}S.prevProp=E,S.prevResolvedValues=B,S.isActive&&(k={...k,...B}),(r||a)&&e.blockInitialAnimation&&(Y=!1);const H=M&&D;Y&&(!H||q)&&b.push(...F.map(R=>{const W={type:j};if(typeof R=="string"&&(r||a)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,V=wa(Z,R);if(Z.enteringChildren&&V){const{delayChildren:O}=V.transition||{};W.delay=hk(Z.enteringChildren,e,O)}}return{animation:R,options:W}}))}if(y.size){const _={};if(typeof p.initial!="boolean"){const j=wa(e,Array.isArray(p.initial)?p.initial[0]:p.initial);j&&j.transition&&(_.transition=j.transition)}y.forEach(j=>{const S=e.getBaseTarget(j),E=e.getValue(j);E&&(E.liveStyle=!0),_[j]=S??null}),b.push({animation:_})}let w=!!b.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,a=!1,w?t(b):Promise.resolve()}function f(m,p){var b;if(n[m].isActive===p)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(y=>{var k;return(k=y.animationState)==null?void 0:k.setActive(m,p)}),n[m].isActive=p;const g=d(m);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:d,setActive:f,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Ww(),a=!0}}}function NO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!qk(t,e):!1}function ta(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ww(){return{animate:ta(!0),whileInView:ta(),whileHover:ta(),whileTap:ta(),whileDrag:ta(),whileFocus:ta(),exit:ta()}}function Cg(e,t){e.min=t.min,e.max=t.max}function xr(e,t){Cg(e.x,t.x),Cg(e.y,t.y)}function Uw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Kk=1e-4,CO=1-Kk,kO=1+Kk,Yk=.01,SO=0-Yk,_O=0+Yk;function gn(e){return e.max-e.min}function EO(e,t,n){return Math.abs(e-t)<=n}function Hw(e,t,n,r=.5){e.origin=r,e.originPoint=yt(t.min,t.max,e.origin),e.scale=gn(n)/gn(t),e.translate=yt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CO&&e.scale<=kO||isNaN(e.scale))&&(e.scale=1),(e.translate>=SO&&e.translate<=_O||isNaN(e.translate))&&(e.translate=0)}function Jl(e,t,n,r){Hw(e.x,t.x,n.x,r?r.originX:void 0),Hw(e.y,t.y,n.y,r?r.originY:void 0)}function qw(e,t,n){e.min=n.min+t.min,e.max=e.min+gn(t)}function PO(e,t,n){qw(e.x,t.x,n.x),qw(e.y,t.y,n.y)}function Kw(e,t,n){e.min=t.min-n.min,e.max=e.min+gn(t)}function Xd(e,t,n){Kw(e.x,t.x,n.x),Kw(e.y,t.y,n.y)}function Yw(e,t,n,r,a){return e-=t,e=Gd(e,1/n,r),a!==void 0&&(e=Gd(e,1/a,r)),e}function TO(e,t=0,n=1,r=.5,a,l=e,c=e){if(es.test(t)&&(t=parseFloat(t),t=yt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=yt(l.min,l.max,r);e===l&&(d-=t),e.min=Yw(e.min,t,n,d,a),e.max=Yw(e.max,t,n,d,a)}function Qw(e,t,[n,r,a],l,c){TO(e,t[n],t[r],t[a],t.scale,l,c)}const AO=["x","scaleX","originX"],MO=["y","scaleY","originY"];function Gw(e,t,n,r){Qw(e.x,t,AO,n?n.x:void 0,r?r.x:void 0),Qw(e.y,t,MO,n?n.y:void 0,r?r.y:void 0)}function Xw(e){return e.translate===0&&e.scale===1}function Qk(e){return Xw(e.x)&&Xw(e.y)}function Zw(e,t){return e.min===t.min&&e.max===t.max}function DO(e,t){return Zw(e.x,t.x)&&Zw(e.y,t.y)}function Jw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gk(e,t){return Jw(e.x,t.x)&&Jw(e.y,t.y)}function e1(e){return gn(e.x)/gn(e.y)}function t1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function zr(e){return[e("x"),e("y")]}function RO(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:b,skewX:y,skewY:k}=n;m&&(r=`perspective(${m}px) ${r}`),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),b&&(r+=`rotateY(${b}deg) `),y&&(r+=`skewX(${y}deg) `),k&&(r+=`skewY(${k}deg) `)}const d=e.x.scale*t.x,f=e.y.scale*t.y;return(d!==1||f!==1)&&(r+=`scale(${d}, ${f})`),r||"none"}const Xk=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],OO=Xk.length,n1=e=>typeof e=="string"?parseFloat(e):e,r1=e=>typeof e=="number"||Ne.test(e);function LO(e,t,n,r,a,l){a?(e.opacity=yt(0,n.opacity??1,IO(r)),e.opacityExit=yt(t.opacity??1,0,FO(r))):l&&(e.opacity=yt(t.opacity??1,n.opacity??1,r));for(let c=0;c<OO;c++){const d=Xk[c];let f=s1(t,d),m=s1(n,d);if(f===void 0&&m===void 0)continue;f||(f=0),m||(m=0),f===0||m===0||r1(f)===r1(m)?(e[d]=Math.max(yt(n1(f),n1(m),r),0),(es.test(m)||es.test(f))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=yt(t.rotate||0,n.rotate||0,r))}function s1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const IO=Zk(0,.5,zC),FO=Zk(.5,.95,sr);function Zk(e,t,n){return r=>r<e?0:r>t?1:n(ic(e,t,r))}function $O(e,t,n){const r=Xt(e)?e:Ii(e);return r.start(Ax("",r,t,n)),r.animation}function uc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const VO=(e,t)=>e.depth-t.depth;class BO{constructor(){this.children=[],this.isDirty=!1}add(t){yx(this.children,t),this.isDirty=!0}remove(t){Ud(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VO),this.isDirty=!1,this.children.forEach(t)}}function zO(e,t){const n=pn.now(),r=({timestamp:a})=>{const l=a-n;l>=t&&(Po(r),e(l-t))};return at.setup(r,!0),()=>Po(r)}function Cd(e){return Xt(e)?e.get():e}class WO{constructor(){this.members=[]}add(t){yx(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&&(Ud(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Ud(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 kd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Gh=["","X","Y","Z"],UO=1e3;let HO=0;function Xh(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Jk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(a||l))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Jk(r)}function e2({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},d=t==null?void 0:t()){this.id=HO++,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(YO),this.nodes.forEach(JO),this.nodes.forEach(eL),this.nodes.forEach(QO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new BO)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new bx),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const f=this.eventHandlers.get(c);f&&f.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=Ix(c)&&!KR(c),this.instance=c;const{layoutId:d,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||d)&&(this.isLayoutDirty=!0),e){let p,g=0;const b=()=>this.root.updateBlockedByResize=!1;at.read(()=>{g=window.innerWidth}),e(c,()=>{const y=window.innerWidth;y!==g&&(g=y,this.root.updateBlockedByResize=!0,p&&p(),p=zO(b,250),kd.hasAnimatedSinceResize&&(kd.hasAnimatedSinceResize=!1,this.nodes.forEach(i1)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||m.getDefaultTransition()||oL,{onLayoutAnimationStart:N,onLayoutAnimationComplete:w}=m.getProps(),_=!this.targetLayout||!Gk(this.targetLayout,y),j=!g&&b;if(this.options.layoutRoot||this.resumeFrom||j||g&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...Tx(k,"layout"),onPlay:N,onComplete:w};(m.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(p,j)}else g||i1(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(),Po(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(tL),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&&Jk(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:d,layout:f}=this.options;if(d===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(o1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(a1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(XO),this.nodes.forEach(ZO),this.nodes.forEach(qO),this.nodes.forEach(KO)):this.nodes.forEach(a1),this.clearAllSnapshots();const d=pn.now();Qt.delta=rs(0,1e3/60,d-Qt.timestamp),Qt.timestamp=d,Qt.isProcessing=!0,zh.update.process(Qt),zh.preRender.process(Qt),zh.render.process(Qt),Qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ox.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(GO),this.sharedNodes.forEach(nL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gn(this.snapshot.measuredBox.x)&&!gn(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=Lt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&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,d=this.projectionDelta&&!Qk(this.projectionDelta),f=this.getTransformTemplate(),m=f?f(this.latestValues,""):void 0,p=m!==this.prevTransformTemplateValue;c&&this.instance&&(d||aa(this.latestValues)||p)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let f=this.removeElementScroll(d);return c&&(f=this.removeTransform(f)),aL(f),{animationId:this.root.animationId,measuredBox:d,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:c}=this.options;if(!c)return Lt();const d=c.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(iL))){const{scroll:p}=this.root;p&&(qr(d.x,p.offset.x),qr(d.y,p.offset.y))}return d}removeElementScroll(c){var f;const d=Lt();if(xr(d,c),(f=this.scroll)!=null&&f.wasRoot)return d;for(let m=0;m<this.path.length;m++){const p=this.path[m],{scroll:g,options:b}=p;p!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&xr(d,c),qr(d.x,g.offset.x),qr(d.y,g.offset.y))}return d}applyTransform(c,d=!1,f){var p,g;const m=f||Lt();xr(m,c);for(let b=0;b<this.path.length;b++){const y=this.path[b];!d&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(qr(m.x,-y.scroll.offset.x),qr(m.y,-y.scroll.offset.y)),aa(y.latestValues)&&Nd(m,y.latestValues,(p=y.layout)==null?void 0:p.layoutBox)}return aa(this.latestValues)&&Nd(m,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),m}removeTransform(c){var f;const d=Lt();xr(d,c);for(let m=0;m<this.path.length;m++){const p=this.path[m];if(!aa(p.latestValues))continue;let g;p.instance&&(wg(p.latestValues)&&p.updateSnapshot(),g=Lt(),xr(g,p.measurePageBox())),Gw(d,p.latestValues,(f=p.snapshot)==null?void 0:f.layoutBox,g)}return aa(this.latestValues)&&Gw(d,this.latestValues),d}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!==Qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var y;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;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=Qt.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Lt(),this.targetWithTransforms=Lt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PO(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xr(this.target,this.layout.layoutBox),Ik(this.target,this.targetDelta)):xr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||wg(this.parent.latestValues)||Lk(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,d,f){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Lt(),this.relativeTargetOrigin=Lt(),Xd(this.relativeTargetOrigin,d,f),xr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var k;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||(k=this.parent)!=null&&k.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Qt.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;xr(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,b=this.treeScale.y;sO(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Lt());const{target:y}=c;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Uw(this.prevProjectionDelta.x,this.projectionDelta.x),Uw(this.prevProjectionDelta.y,this.projectionDelta.y)),Jl(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==b||!t1(this.projectionDelta.x,this.prevProjectionDelta.x)||!t1(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 d;if((d=this.options.visualElement)==null||d.scheduleRender(),c){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fi(),this.projectionDelta=fi(),this.projectionDeltaWithTransform=fi()}setAnimationOrigin(c,d=!1){const f=this.snapshot,m=f?f.latestValues:{},p={...this.latestValues},g=fi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=Lt(),y=f?f.source:void 0,k=this.layout?this.layout.source:void 0,N=y!==k,w=this.getStack(),_=!w||w.members.length<=1,j=!!(N&&!_&&this.options.crossfade===!0&&!this.path.some(sL));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const P=E/1e3;l1(g.x,c.x,P),l1(g.y,c.y,P),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xd(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rL(this.relativeTarget,this.relativeTargetOrigin,b,P),S&&DO(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Lt()),xr(S,this.relativeTarget)),N&&(this.animationValues=p,LO(p,m,this.latestValues,P,j,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,f,m;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(m=(f=this.resumingFrom)==null?void 0:f.currentAnimation)==null||m.stop(),this.pendingAnimation&&(Po(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{kd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ii(0)),this.motionValue.jump(0,!1),this.currentAnimation=$O(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(UO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:f,layout:m,latestValues:p}=c;if(!(!d||!f||!m)){if(this!==c&&this.layout&&m&&t2(this.options.animationType,this.layout.layoutBox,m.layoutBox)){f=this.target||Lt();const g=gn(this.layout.layoutBox.x);f.x.min=c.target.x.min,f.x.max=f.x.min+g;const b=gn(this.layout.layoutBox.y);f.y.min=c.target.y.min,f.y.max=f.y.min+b}xr(d,f),Nd(d,p),Jl(this.projectionDeltaWithTransform,this.layoutCorrected,d,p)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new WO),this.sharedNodes.get(c).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:f}={}){const m=this.getStack();m&&m.promote(this,f),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:f}=c;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(d=!0),!d)return;const m={};f.z&&Xh("z",c,m,this.animationValues);for(let p=0;p<Gh.length;p++)Xh(`rotate${Gh[p]}`,c,m,this.animationValues),Xh(`skew${Gh[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,d){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=Cd(d==null?void 0:d.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=Cd(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!aa(this.latestValues)&&(c.transform=f?f({},""):"none",this.hasProjected=!1);return}c.visibility="";const p=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=RO(this.projectionDeltaWithTransform,this.treeScale,p);f&&(g=f(p,g)),c.transform=g;const{x:b,y}=this.projectionDelta;c.transformOrigin=`${b.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:N,applyTo:w,isCSSVariable:_}=Ng[k],j=g==="none"?p[k]:N(p[k],m);if(w){const S=w.length;for(let E=0;E<S;E++)c[w[E]]=j}else _?this.options.visualElement.renderState.vars[k]=j:c[k]=j}this.options.layoutId&&(c.pointerEvents=m===this?Cd(d==null?void 0:d.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var d;return(d=c.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(o1),this.root.sharedNodes.clear()}}}function qO(e){e.updateLayout()}function KO(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")zr(g=>{const b=c?t.measuredBox[g]:t.layoutBox[g],y=gn(b);b.min=r[g].min,b.max=b.min+y});else if(l==="x"||l==="y"){const g=l==="x"?"y":"x";Cg(c?t.measuredBox[g]:t.layoutBox[g],r[g])}else t2(l,t.layoutBox,r)&&zr(g=>{const b=c?t.measuredBox[g]:t.layoutBox[g],y=gn(r[g]);b.max=b.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+y)});const d=fi();Jl(d,r,t.layoutBox);const f=fi();c?Jl(f,e.applyTransform(a,!0),t.measuredBox):Jl(f,r,t.layoutBox);const m=!Qk(d);let p=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:y}=g;if(b&&y){const k=Lt();Xd(k,t.layoutBox,b.layoutBox);const N=Lt();Xd(N,r,y.layoutBox),Gk(k,N)||(p=!0),g.options.layoutRoot&&(e.relativeTarget=N,e.relativeTargetOrigin=k,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:f,layoutDelta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function YO(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 QO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GO(e){e.clearSnapshot()}function o1(e){e.clearMeasurements()}function a1(e){e.isLayoutDirty=!1}function XO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ZO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function JO(e){e.resolveTargetDelta()}function eL(e){e.calcProjection()}function tL(e){e.resetSkewAndRotation()}function nL(e){e.removeLeadSnapshot()}function l1(e,t,n){e.translate=yt(t.translate,0,n),e.scale=yt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function c1(e,t,n,r){e.min=yt(t.min,n.min,r),e.max=yt(t.max,n.max,r)}function rL(e,t,n,r){c1(e.x,t.x,n.x,r),c1(e.y,t.y,n.y,r)}function sL(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const oL={duration:.45,ease:[.4,0,.1,1]},u1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),d1=u1("applewebkit/")&&!u1("chrome/")?Math.round:sr;function f1(e){e.min=d1(e.min),e.max=d1(e.max)}function aL(e){f1(e.x),f1(e.y)}function t2(e,t,n){return e==="position"||e==="preserve-aspect"&&!EO(e1(t),e1(n),.2)}function iL(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lL=e2({attachResizeListener:(e,t)=>uc(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}),Zh={current:void 0},n2=e2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zh.current){const e=new lL({});e.mount(window),e.setOptions({layoutScroll:!0}),Zh.current=e}return Zh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zx=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function m1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cL(...e){return t=>{let n=!1;const r=e.map(a=>{const l=m1(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():m1(e[a],null)}}}}function uL(...e){return x.useCallback(cL(...e),e)}class dL extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(vd(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,a=vd(r)&&r.offsetWidth||0,l=vd(r)&&r.offsetHeight||0,c=getComputedStyle(n),d=this.props.sizeRef.current;d.height=parseFloat(c.height),d.width=parseFloat(c.width),d.top=n.offsetTop,d.left=n.offsetLeft,d.right=a-d.width-d.left,d.bottom=l-d.height-d.top}return null}componentDidUpdate(){}render(){return this.props.children}}function fL({children:e,isPresent:t,anchorX:n,anchorY:r,root:a,pop:l}){var b;const c=x.useId(),d=x.useRef(null),f=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=x.useContext(zx),p=((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref),g=uL(d,p);return x.useInsertionEffect(()=>{const{width:y,height:k,top:N,left:w,right:_,bottom:j}=f.current;if(t||l===!1||!d.current||!y||!k)return;const S=n==="left"?`left: ${w}`:`right: ${_}`,E=r==="bottom"?`bottom: ${j}`:`top: ${N}`;d.current.dataset.motionPopId=c;const P=document.createElement("style");m&&(P.nonce=m);const A=a??document.head;return A.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
489
|
+
[data-motion-pop-id="${c}"] {
|
|
490
|
+
position: absolute !important;
|
|
491
|
+
width: ${y}px !important;
|
|
492
|
+
height: ${k}px !important;
|
|
493
|
+
${S}px !important;
|
|
494
|
+
${E}px !important;
|
|
495
|
+
}
|
|
496
|
+
`),()=>{var M;(M=d.current)==null||M.removeAttribute("data-motion-pop-id"),A.contains(P)&&A.removeChild(P)}},[t]),s.jsx(dL,{isPresent:t,childRef:d,sizeRef:f,pop:l,children:l===!1?e:x.cloneElement(e,{ref:g})})}const mL=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:l,mode:c,anchorX:d,anchorY:f,root:m})=>{const p=xx(hL),g=x.useId();let b=!0,y=x.useMemo(()=>(b=!1,{id:g,initial:t,isPresent:n,custom:a,onExitComplete:k=>{p.set(k,!0);for(const N of p.values())if(!N)return;r&&r()},register:k=>(p.set(k,!1),()=>p.delete(k))}),[n,p,r]);return l&&b&&(y={...y}),x.useMemo(()=>{p.forEach((k,N)=>p.set(N,!1))},[n]),x.useEffect(()=>{!n&&!p.size&&r&&r()},[n]),e=s.jsx(fL,{pop:c==="popLayout",isPresent:n,anchorX:d,anchorY:f,root:m,children:e}),s.jsx(Nf.Provider,{value:y,children:e})};function hL(){return new Map}function r2(e=!0){const t=x.useContext(Nf);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 ed=e=>e.key||"";function h1(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const Rn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:d="left",anchorY:f="top",root:m})=>{const[p,g]=r2(c),b=x.useMemo(()=>h1(e),[e]),y=c&&!p?[]:b.map(ed),k=x.useRef(!0),N=x.useRef(b),w=xx(()=>new Map),_=x.useRef(new Set),[j,S]=x.useState(b),[E,P]=x.useState(b);TC(()=>{k.current=!1,N.current=b;for(let D=0;D<E.length;D++){const Y=ed(E[D]);y.includes(Y)?(w.delete(Y),_.current.delete(Y)):w.get(Y)!==!0&&w.set(Y,!1)}},[E,y.length,y.join("-")]);const A=[];if(b!==j){let D=[...b];for(let Y=0;Y<E.length;Y++){const q=E[Y],F=ed(q);y.includes(F)||(D.splice(Y,0,q),A.push(q))}return l==="wait"&&A.length&&(D=A),P(h1(D)),S(b),null}const{forceRender:M}=x.useContext(gx);return s.jsx(s.Fragment,{children:E.map(D=>{const Y=ed(D),q=c&&!p?!1:b===E||y.includes(Y),F=()=>{if(_.current.has(Y))return;if(w.has(Y))_.current.add(Y),w.set(Y,!0);else return;let B=!0;w.forEach(se=>{se||(B=!1)}),B&&(M==null||M(),P(N.current),c&&(g==null||g()),r&&r())};return s.jsx(mL,{isPresent:q,initial:!k.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:l,root:m,onExitComplete:q?void 0:F,anchorX:d,anchorY:f,children:D},Y)})})},s2=x.createContext({strict:!1}),p1={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 g1=!1;function pL(){if(g1)return;const e={};for(const t in p1)e[t]={isEnabled:n=>p1[t].some(r=>!!n[r])};Dk(e),g1=!0}function o2(){return pL(),eO()}function gL(e){const t=o2();for(const n in e)t[n]={...t[n],...e[n]};Dk(t)}const xL=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 Zd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xL.has(e)}let a2=e=>!Zd(e);function yL(e){typeof e=="function"&&(a2=t=>t.startsWith("on")?!Zd(t):e(t))}try{yL(require("@emotion/is-prop-valid").default)}catch{}function vL(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||Xt(e[a])||(a2(a)||n===!0&&Zd(a)||!t&&!Zd(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const _f=x.createContext({});function bL(e,t){if(Sf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||cc(n)?n:void 0,animate:cc(r)?r:void 0}}return e.inherit!==!1?t:{}}function wL(e){const{initial:t,animate:n}=bL(e,x.useContext(_f));return x.useMemo(()=>({initial:t,animate:n}),[x1(t),x1(n)])}function x1(e){return Array.isArray(e)?e.join(" "):e}const Wx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function i2(e,t,n){for(const r in t)!Xt(t[r])&&!Vk(r,n)&&(e[r]=t[r])}function jL({transformTemplate:e},t){return x.useMemo(()=>{const n=Wx();return Vx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NL(e,t){const n=e.style||{},r={};return i2(r,n,e),Object.assign(r,jL(e,t)),r}function CL(e,t){const n={},r=NL(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 l2=()=>({...Wx(),attrs:{}});function kL(e,t,n,r){const a=x.useMemo(()=>{const l=l2();return Bk(l,t,Wk(r),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};i2(l,e.style,e),a.style={...l,...a.style}}return a}const SL=["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 Ux(e){return typeof e!="string"||e.includes("-")?!1:!!(SL.indexOf(e)>-1||/[A-Z]/u.test(e))}function _L(e,t,n,{latestValues:r},a,l=!1,c){const f=(c??Ux(e)?kL:CL)(t,r,a,e),m=vL(t,typeof e=="string",l),p=e!==x.Fragment?{...m,...f,ref:n}:{},{children:g}=t,b=x.useMemo(()=>Xt(g)?g.get():g,[g]);return x.createElement(e,{...p,children:b})}function EL({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:PL(n,r,a,e),renderState:t()}}function PL(e,t,n,r){const a={},l=r(e,{});for(const b in l)a[b]=Cd(l[b]);let{initial:c,animate:d}=e;const f=Sf(e),m=Ak(e);t&&m&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let p=n?n.initial===!1:!1;p=p||c===!1;const g=p?d:c;if(g&&typeof g!="boolean"&&!kf(g)){const b=Array.isArray(g)?g:[g];for(let y=0;y<b.length;y++){const k=Mx(e,b[y]);if(k){const{transitionEnd:N,transition:w,..._}=k;for(const j in _){let S=_[j];if(Array.isArray(S)){const E=p?S.length-1:0;S=S[E]}S!==null&&(a[j]=S)}for(const j in N)a[j]=N[j]}}}return a}const c2=e=>(t,n)=>{const r=x.useContext(_f),a=x.useContext(Nf),l=()=>EL(e,t,r,a);return n?l():xx(l)},TL=c2({scrapeMotionValuesFromProps:Bx,createRenderState:Wx}),AL=c2({scrapeMotionValuesFromProps:Uk,createRenderState:l2}),ML=Symbol.for("motionComponentSymbol");function DL(e,t,n){const r=x.useRef(n);x.useInsertionEffect(()=>{r.current=n});const a=x.useRef(null);return x.useCallback(l=>{var d;l&&((d=e.onMount)==null||d.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 u2=x.createContext({});function ii(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function RL(e,t,n,r,a,l){var S,E;const{visualElement:c}=x.useContext(_f),d=x.useContext(s2),f=x.useContext(Nf),m=x.useContext(zx),p=m.reducedMotion,g=m.skipAnimations,b=x.useRef(null),y=x.useRef(!1);r=r||d.renderer,!b.current&&r&&(b.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&&b.current&&(b.current.manuallyAnimateOnMount=!0));const k=b.current,N=x.useContext(u2);k&&!k.projection&&a&&(k.type==="html"||k.type==="svg")&&OL(b.current,n,a,N);const w=x.useRef(!1);x.useInsertionEffect(()=>{k&&w.current&&k.update(n,f)});const _=n[yk],j=x.useRef(!!_&&typeof window<"u"&&!((S=window.MotionHandoffIsComplete)!=null&&S.call(window,_))&&((E=window.MotionHasOptimisedAnimation)==null?void 0:E.call(window,_)));return TC(()=>{y.current=!0,k&&(w.current=!0,window.MotionIsMounted=!0,k.updateFeatures(),k.scheduleRenderMicrotask(),j.current&&k.animationState&&k.animationState.animateChanges())}),x.useEffect(()=>{k&&(!j.current&&k.animationState&&k.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,_)}),j.current=!1),k.enteringChildren=void 0)}),k}function OL(e,t,n,r){const{layoutId:a,layout:l,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:d2(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||d&&ii(d),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:f,layoutRoot:m})}function d2(e){if(e)return e.options.allowProjection!==!1?e.projection:d2(e.parent)}function Jh(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&gL(r);const l=n?n==="svg":Ux(e),c=l?AL:TL;function d(m,p){let g;const b={...x.useContext(zx),...m,layoutId:LL(m)},{isStatic:y}=b,k=wL(m),N=c(m,y);if(!y&&typeof window<"u"){IL();const w=FL(b);g=w.MeasureLayout,k.visualElement=RL(e,N,b,a,w.ProjectionNode,l)}return s.jsxs(_f.Provider,{value:k,children:[g&&k.visualElement?s.jsx(g,{visualElement:k.visualElement,...b}):null,_L(e,m,DL(N,k.visualElement,p),N,y,t,l)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=x.forwardRef(d);return f[ML]=e,f}function LL({layoutId:e}){const t=x.useContext(gx).id;return t&&e!==void 0?t+"-"+e:e}function IL(e,t){x.useContext(s2).strict}function FL(e){const t=o2(),{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 $L(e,t){if(typeof Proxy>"u")return Jh;const n=new Map,r=(l,c)=>Jh(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,Jh(c,void 0,e,t)),n.get(c))})}const VL=(e,t)=>t.isSVG??Ux(e)?new xO(t):new dO(t,{allowProjection:e!==x.Fragment});class BL extends Fo{constructor(t){super(t),t.animationState||(t.animationState=jO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();kf(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 zL=0;class WL extends Fo{constructor(){super(...arguments),this.id=zL++,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:d}=this.node.getProps();if(typeof c=="string"){const f=wa(this.node,c,d);if(f){const{transition:m,transitionEnd:p,...g}=f;for(const b in g)(l=this.node.getValue(b))==null||l.jump(g[b])}}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 UL={animation:{Feature:BL},exit:{Feature:WL}};function Pc(e){return{point:{x:e.pageX,y:e.pageY}}}const HL=e=>t=>Lx(t)&&e(t,Pc(t));function ec(e,t,n,r){return uc(e,t,HL(n),r)}const f2=({current:e})=>e?e.ownerDocument.defaultView:null,y1=(e,t)=>Math.abs(e-t);function qL(e,t){const n=y1(e.x,t.x),r=y1(e.y,t.y);return Math.sqrt(n**2+r**2)}const v1=new Set(["auto","scroll"]);class m2{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3,element:d}={}){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=td(this.lastRawMoveEventInfo,this.transformPagePoint));const y=ep(this.lastMoveEventInfo,this.history),k=this.startEvent!==null,N=qL(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!k&&!N)return;const{point:w}=y,{timestamp:_}=Qt;this.history.push({...w,timestamp:_});const{onStart:j,onMove:S}=this.handlers;k||(j&&j(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,y)},this.handlePointerMove=(y,k)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=k,this.lastMoveEventInfo=td(k,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(y,k)=>{this.end();const{onEnd:N,onSessionEnd:w,resumeAnimation:_}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=ep(y.type==="pointercancel"?this.lastMoveEventInfo:td(k,this.transformPagePoint),this.history);this.startEvent&&N&&N(y,j),w&&w(y,j)},!Lx(t))return;this.dragSnapToOrigin=l,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const f=Pc(t),m=td(f,this.transformPagePoint),{point:p}=m,{timestamp:g}=Qt;this.history=[{...p,timestamp:g}];const{onSessionStart:b}=n;b&&b(t,ep(m,this.history)),this.removeListeners=Sc(ec(this.contextWindow,"pointermove",this.handlePointerMove),ec(this.contextWindow,"pointerup",this.handlePointerUp),ec(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(v1.has(r.overflowX)||v1.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),at.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Po(this.updatePoint)}}function td(e,t){return t?{point:t(e.point)}:e}function b1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ep({point:e},t){return{point:e,delta:b1(e,h2(t)),offset:b1(e,KL(t)),velocity:YL(t,.1)}}function KL(e){return e[0]}function h2(e){return e[e.length-1]}function YL(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=h2(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Kn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Kn(t)*2&&(r=e[1]);const l=rr(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 QL(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?yt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?yt(n,e,r.max):Math.min(e,n)),e}function w1(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 GL(e,{top:t,left:n,bottom:r,right:a}){return{x:w1(e.x,n,a),y:w1(e.y,t,r)}}function j1(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 XL(e,t){return{x:j1(e.x,t.x),y:j1(e.y,t.y)}}function ZL(e,t){let n=.5;const r=gn(e),a=gn(t);return a>r?n=ic(t.min,t.max-r,e.min):r>a&&(n=ic(e.min,e.max-a,t.min)),rs(0,1,n)}function JL(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 kg=.35;function eI(e=kg){return e===!1?e=0:e===!0&&(e=kg),{x:N1(e,"left","right"),y:N1(e,"top","bottom")}}function N1(e,t,n){return{min:C1(e,t),max:C1(e,n)}}function C1(e,t){return typeof e=="number"?e:e[t]||0}const tI=new WeakMap;class nI{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=Lt(),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(Pc(g).point),this.stopAnimation()},c=(g,b)=>{const{drag:y,dragPropagation:k,onDragStart:N}=this.getProps();if(y&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=TR(y),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zr(_=>{let j=this.getAxisMotionValue(_).get()||0;if(es.test(j)){const{projection:S}=this.visualElement;if(S&&S.layout){const E=S.layout.layoutBox[_];E&&(j=gn(E)*(parseFloat(j)/100))}}this.originPoint[_]=j}),N&&at.update(()=>N(g,b),!1,!0),gg(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:y,dragDirectionLock:k,onDirectionLock:N,onDrag:w}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:_}=b;if(k&&this.currentDirection===null){this.currentDirection=sI(_),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),w&&at.update(()=>w(g,b),!1,!0)},f=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),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 m2(t,{onSessionStart:l,onStart:c,onMove:d,onSessionEnd:f,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:f2(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:d}=this.getProps();d&&at.postRender(()=>d(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||!nd(t,a,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=QL(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&&ii(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=GL(r.layoutBox,t):this.constraints=!1,this.elastic=eI(n),a!==this.constraints&&!ii(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&zr(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=JL(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ii(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const l=oO(r,a.root,this.visualElement.getTransformPagePoint());let c=XL(a.layout.layoutBox,l);if(n){const d=n(nO(c));this.hasMutatedConstraints=!!d,d&&(c=Ok(d))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),f=this.constraints||{},m=zr(p=>{if(!nd(p,n,this.currentDirection))return;let g=f&&f[p]||{};(c===!0||c===p)&&(g={min:0,max:0});const b=a?200:1e6,y=a?40:1e7,k={type:"inertia",velocity:r?t[p]:0,bounceStiffness:b,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...l,...g};return this.startAxisValueAnimation(p,k)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return gg(this.visualElement,t),r.start(Ax(t,r,0,n,this.visualElement,!1))}stopAnimation(){zr(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){zr(n=>{const{drag:r}=this.getProps();if(!nd(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,l=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:d}=a.layout.layoutBox[n],f=l.get()||0;l.set(t[n]-yt(c,d,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ii(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};zr(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const f=d.get();a[c]=ZL({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(),zr(c=>{if(!nd(c,t,null))return;const d=this.getAxisMotionValue(c),{min:f,max:m}=this.constraints[c];d.set(yt(f,m,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;tI.set(this.visualElement,this);const t=this.visualElement.current,n=ec(t,"pointerdown",m=>{const{drag:p,dragListener:g=!0}=this.getProps(),b=m.target,y=b!==t&&LR(b);p&&g&&!y&&this.start(m)});let r;const a=()=>{const{dragConstraints:m}=this.getProps();ii(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),r||(r=rI(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",a);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),at.read(a);const d=uc(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:p})=>{this.isDragging&&p&&(zr(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=m[g].translate,b.set(b.get()+m[g].translate))}),this.visualElement.render())}));return()=>{d(),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=kg,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:d}}}function k1(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function rI(e,t,n){const r=Mw(e,k1(n)),a=Mw(t,k1(n));return()=>{r(),a()}}function nd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function sI(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oI extends Fo{constructor(t){super(t),this.removeGroupControls=sr,this.removeListeners=sr,this.controls=new nI(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sr}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 tp=e=>(t,n)=>{e&&at.update(()=>e(t,n),!1,!0)};class aI extends Fo{constructor(){super(...arguments),this.removePointerDownListener=sr}onPointerDown(t){this.session=new m2(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:f2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:tp(t),onStart:tp(n),onMove:tp(r),onEnd:(l,c)=>{delete this.session,a&&at.postRender(()=>a(l,c))}}}mount(){this.removePointerDownListener=ec(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 np=!1;class iI 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),np&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),kd.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}),np=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||at.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ox.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;np=!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 p2(e){const[t,n]=r2(),r=x.useContext(gx);return s.jsx(iI,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(u2),isPresent:t,safeToRemove:n})}const lI={pan:{Feature:aI},drag:{Feature:oI,ProjectionNode:n2,MeasureLayout:p2}};function S1(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&&at.postRender(()=>l(t,Pc(t)))}class cI extends Fo{mount(){const{current:t}=this.node;t&&(this.unmount=MR(t,(n,r)=>(S1(this.node,r,"Start"),a=>S1(this.node,a,"End"))))}unmount(){}}class uI extends Fo{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=Sc(uc(this.node.current,"focus",()=>this.onFocus()),uc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _1(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&&at.postRender(()=>l(t,Pc(t)))}class dI extends Fo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=FR(t,(a,l)=>(_1(this.node,l,"Start"),(c,{success:d})=>_1(this.node,c,d?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Sg=new WeakMap,rp=new WeakMap,fI=e=>{const t=Sg.get(e.target);t&&t(e)},mI=e=>{e.forEach(fI)};function hI({root:e,...t}){const n=e||document;rp.has(n)||rp.set(n,{});const r=rp.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(mI,{root:e,...t})),r[a]}function pI(e,t,n){const r=hI(t);return Sg.set(e,n),r.observe(e),()=>{Sg.delete(e),r.unobserve(e)}}const gI={some:0,all:1};class xI extends Fo{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:gI[a]},d=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:b}=this.node.getProps(),y=p?g:b;y&&y(m)};this.stopObserver=pI(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yI(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function yI({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vI={inView:{Feature:xI},tap:{Feature:dI},focus:{Feature:uI},hover:{Feature:cI}},bI={layout:{ProjectionNode:n2,MeasureLayout:p2}},wI={...UL,...vI,...lI,...bI},Ve=$L(wI,VL),E1=e=>{let t;const n=new Set,r=(m,p)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(y=>y(t,b))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>f,subscribe:m=>(n.add(m),()=>n.delete(m))},f=t=e(r,a,d);return d},jI=(e=>e?E1(e):E1),NI=e=>e;function CI(e,t=NI){const n=ue.useSyncExternalStore(e.subscribe,ue.useCallback(()=>t(e.getState()),[e,t]),ue.useCallback(()=>t(e.getInitialState()),[e,t]));return ue.useDebugValue(n),n}const kI=e=>{const t=jI(e),n=r=>CI(t,r);return Object.assign(n,t),n},SI=(e=>kI);function _I(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),d=(l=n.getItem(a))!=null?l:null;return d instanceof Promise?d.then(c):c(d)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const _g=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return _g(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return _g(r)(n)}}}},EI=(e,t)=>(n,r,a)=>{let l={storage:_I(()=>window.localStorage),partialize:w=>w,version:0,merge:(w,_)=>({..._,...w}),...t},c=!1,d=0;const f=new Set,m=new Set;let p=l.storage;if(!p)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...w)},r,a);const g=()=>{const w=l.partialize({...r()});return p.setItem(l.name,{state:w,version:l.version})},b=a.setState;a.setState=(w,_)=>(b(w,_),g());const y=e((...w)=>(n(...w),g()),r,a);a.getInitialState=()=>y;let k;const N=()=>{var w,_;if(!p)return;const j=++d;c=!1,f.forEach(E=>{var P;return E((P=r())!=null?P:y)});const S=((_=l.onRehydrateStorage)==null?void 0:_.call(l,(w=r())!=null?w:y))||void 0;return _g(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(A=>[!0,A]):[!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(j!==d)return;const[A,M]=E;if(k=l.merge(M,(P=r())!=null?P:y),n(k,!0),A)return g()}).then(()=>{j===d&&(S==null||S(r(),void 0),k=r(),c=!0,m.forEach(E=>E(k)))}).catch(E=>{j===d&&(S==null||S(void 0,E))})};return a.persist={setOptions:w=>{l={...l,...w},w.storage&&(p=w.storage)},clearStorage:()=>{p==null||p.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>N(),hasHydrated:()=>c,onHydrate:w=>(f.add(w),()=>{f.delete(w)}),onFinishHydration:w=>(m.add(w),()=>{m.delete(w)})},l.skipHydration||N(),k||y},PI=EI,Je=SI()(PI(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})})),TI="/api/v1";function AI(){return localStorage.getItem("crmy_token")}function MI(e){localStorage.setItem("crmy_token",e)}function g2(){localStorage.removeItem("crmy_token"),localStorage.removeItem("crmy_user")}function Ef(){const e=localStorage.getItem("crmy_user");return e?JSON.parse(e):null}function DI(e){localStorage.setItem("crmy_user",JSON.stringify(e))}async function mi(e,t={}){const n=AI(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);let a;try{a=await fetch(e.startsWith("/")?e:`${TI}/${e}`,{...t,headers:r})}catch{throw new Error("Unable to reach the server. Check your connection and try again.")}if(a.status===401)throw g2(),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 Pe={get:e=>mi(e),post:(e,t)=>mi(e,{method:"POST",body:t?JSON.stringify(t):void 0}),patch:(e,t)=>mi(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>mi(e,{method:"DELETE"})},P1={login:(e,t)=>mi("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})}),register:e=>mi("/auth/register",{method:"POST",body:JSON.stringify(e)})};function Mr(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 Zt({queryKey:[e,n],queryFn:()=>Pe.get(a)})}function x2(e){return Mr("contacts","contacts",e)}function RI(e){return Zt({queryKey:["contact",e],queryFn:()=>Pe.get(`contacts/${e}`),enabled:!!e})}function y2(){const e=ze();return We({mutationFn:t=>Pe.post("contacts",t),onSuccess:()=>e.invalidateQueries({queryKey:["contacts"]})})}function OI(e){const t=ze();return We({mutationFn:n=>Pe.patch(`contacts/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["contact",e]}),t.invalidateQueries({queryKey:["contacts"]})}})}function LI(e){const t=ze();return We({mutationFn:()=>Pe.delete(`contacts/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["contacts"]})})}function Pf(e){return Mr("accounts","accounts",e)}function II(e){return Zt({queryKey:["account",e],queryFn:()=>Pe.get(`accounts/${e}`),enabled:!!e})}function v2(){const e=ze();return We({mutationFn:t=>Pe.post("accounts",t),onSuccess:()=>e.invalidateQueries({queryKey:["accounts"]})})}function FI(e){const t=ze();return We({mutationFn:n=>Pe.patch(`accounts/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["account",e]}),t.invalidateQueries({queryKey:["accounts"]})}})}function $I(e){const t=ze();return We({mutationFn:()=>Pe.delete(`accounts/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["accounts"]})})}function Tc(e){return Mr("opportunities","opportunities",e)}function VI(e){return Zt({queryKey:["opportunity",e],queryFn:()=>Pe.get(`opportunities/${e}`),enabled:!!e})}function b2(){const e=ze();return We({mutationFn:t=>Pe.post("opportunities",t),onSuccess:()=>e.invalidateQueries({queryKey:["opportunities"]})})}function BI(e){const t=ze();return We({mutationFn:n=>Pe.patch(`opportunities/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["opportunity",e]}),t.invalidateQueries({queryKey:["opportunities"]})}})}function zI(e){const t=ze();return We({mutationFn:()=>Pe.delete(`opportunities/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["opportunities"]})})}function Hx(e){return Mr("use-cases","use-cases",e)}function WI(e){return Zt({queryKey:["use-case",e],queryFn:()=>Pe.get(`use-cases/${e}`),enabled:!!e})}function w2(){const e=ze();return We({mutationFn:t=>Pe.post("use-cases",t),onSuccess:()=>e.invalidateQueries({queryKey:["use-cases"]})})}function UI(e){const t=ze();return We({mutationFn:n=>Pe.patch(`use-cases/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["use-case",e]}),t.invalidateQueries({queryKey:["use-cases"]})}})}function HI(e){const t=ze();return We({mutationFn:()=>Pe.delete(`use-cases/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:["use-cases"]})})}function qI(e){return Zt({queryKey:["use-case-timeline",e],queryFn:()=>Pe.get(`use-cases/${e}/timeline`),enabled:!!e})}function qx(e){return Mr("activities","activities",e)}function j2(){const e=ze();return We({mutationFn:t=>Pe.post("activities",t),onSuccess:()=>e.invalidateQueries({queryKey:["activities"]})})}function N2(){return Zt({queryKey:["hitl"],queryFn:()=>Pe.get("hitl"),refetchInterval:1e4})}function KI(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.post(`hitl/${t}/resolve`,n),onSuccess:()=>e.invalidateQueries({queryKey:["hitl"]})})}function YI(){return Mr("webhooks","webhooks")}function QI(){const e=ze();return We({mutationFn:t=>Pe.post("webhooks",t),onSuccess:()=>e.invalidateQueries({queryKey:["webhooks"]})})}function GI(){const e=ze();return We({mutationFn:t=>Pe.delete(`webhooks/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["webhooks"]})})}function Xi(e){return Zt({queryKey:["custom-fields",e],queryFn:()=>Pe.get(`custom-fields?object_type=${e}`),enabled:!!e})}function XI(){const e=ze();return We({mutationFn:t=>Pe.post("custom-fields",t),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function ZI(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.patch(`custom-fields/${t}`,n),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function JI(){const e=ze();return We({mutationFn:t=>Pe.delete(`custom-fields/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["custom-fields"]})})}function eF(e){return Zt({queryKey:["search",e],queryFn:()=>Pe.get(`search?q=${encodeURIComponent(e)}`),enabled:e.length>=2})}function Tf(){return Zt({queryKey:["admin-users"],queryFn:()=>Pe.get("admin/users")})}function tF(){const e=ze();return We({mutationFn:t=>Pe.post("admin/users",t),onSuccess:()=>e.invalidateQueries({queryKey:["admin-users"]})})}function nF(){return Zt({queryKey:["admin-db-config"],queryFn:()=>Pe.get("admin/db-config")})}function rF(){return We({mutationFn:e=>Pe.post("admin/db-config/test",{connection_string:e})})}function sF(){const e=ze();return We({mutationFn:t=>Pe.patch("admin/db-config",{connection_string:t}),onSuccess:()=>e.invalidateQueries({queryKey:["admin-db-config"]})})}function oF(e){return Mr("notes","notes",e)}function aF(){const e=ze();return We({mutationFn:t=>Pe.post("notes",t),onSuccess:()=>e.invalidateQueries({queryKey:["notes"]})})}function C2(e){const t=e?`?actor_id=${e}`:"";return Zt({queryKey:["api-keys",e],queryFn:()=>Pe.get(`/auth/api-keys${t}`)})}function k2(){const e=ze();return We({mutationFn:t=>Pe.post("/auth/api-keys",t),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function iF(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.patch(`/auth/api-keys/${t}`,n),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function S2(){const e=ze();return We({mutationFn:t=>Pe.delete(`/auth/api-keys/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:["api-keys"]})})}function lF(){return We({mutationFn:e=>Pe.patch("/auth/profile",e)})}function Af(e){return Mr("actors","actors",e)}function cF(e){return Zt({queryKey:["actor",e],queryFn:()=>Pe.get(`actors/${e}`),enabled:!!e})}function uF(){const e=ze();return We({mutationFn:t=>Pe.post("actors",t),onSuccess:()=>e.invalidateQueries({queryKey:["actors"]})})}function _2(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.patch(`actors/${t}`,{patch:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["actors"]}),e.invalidateQueries({queryKey:["actor"]})}})}function E2(){return Zt({queryKey:["actor-whoami"],queryFn:()=>Pe.get("actors/whoami")})}function sp(e){return Mr("assignments","assignments",e)}function dF(e){return Zt({queryKey:["assignment",e],queryFn:()=>Pe.get(`assignments/${e}`),enabled:!!e})}function P2(){const e=ze();return We({mutationFn:t=>Pe.post("assignments",t),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function fF(e){const t=ze();return We({mutationFn:n=>Pe.patch(`assignments/${e}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:["assignment",e]}),t.invalidateQueries({queryKey:["assignments"]})}})}function Kx(){const e=ze();return We({mutationFn:t=>Pe.post(`assignments/${t}/accept`,{}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Yx(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.post(`assignments/${t}/complete`,n),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Qx(){const e=ze();return We({mutationFn:({id:t,...n})=>Pe.post(`assignments/${t}/decline`,n),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function mF(e){return Mr("context-entries","context",e)}function hF(){const e=ze();return We({mutationFn:t=>Pe.post(`context/${t}/review`,{}),onSuccess:()=>{e.invalidateQueries({queryKey:["context-entries"]}),e.invalidateQueries({queryKey:["context-stale"]})}})}function pF(e){return Mr("context-stale","context/stale",e)}function Gx(){const e=ze();return We({mutationFn:t=>Pe.post(`assignments/${t}/start`,{}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Xx(){const e=ze();return We({mutationFn:({id:t,reason:n})=>Pe.post(`assignments/${t}/block`,{reason:n}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function Zx(){const e=ze();return We({mutationFn:({id:t,reason:n})=>Pe.post(`assignments/${t}/cancel`,{reason:n}),onSuccess:()=>e.invalidateQueries({queryKey:["assignments"]})})}function gF(){var c,d;const{data:e}=E2(),t=e==null?void 0:e.actor_id,n=N2(),r=Zt({queryKey:["inbox-assignments",t],queryFn:()=>Pe.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=(((d=r.data)==null?void 0:d.assignments)??[]).filter(f=>["pending","accepted","in_progress","blocked"].includes(f.status)).length;return{total:a+l,hitlCount:a,assignCount:l}}function xF(e,t,n){const r=new URLSearchParams;n&&Object.entries(n).forEach(([c,d])=>{d!==void 0&&d!==""&&r.set(c,String(d))});const a=r.toString(),l=`briefing/${e}/${t}${a?`?${a}`:""}`;return Zt({queryKey:["briefing",e,t,n],queryFn:()=>Pe.get(l),enabled:!!e&&!!t})}const T2="/app/assets/crmy-logo-DWN0xBPW.png",It={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"},inbox:{text:"text-destructive",bg:"bg-destructive/15",bar:"bg-destructive"}},yF=[{icon:tx,label:"Dashboard",path:"/",color:It.dashboard},{icon:ko,label:"Contacts",path:"/contacts",color:It.contacts},{icon:Id,label:"Accounts",path:"/accounts",color:It.accounts},{icon:Ti,label:"Opportunities",path:"/opportunities",color:It.opportunities},{icon:$d,label:"Use Cases",path:"/use-cases",color:It.useCases},{icon:Ca,label:"Activities",path:"/activities",color:It.activities},{icon:ON,label:"Assignments",path:"/assignments",color:It.inbox}],vF=[{icon:rx,label:"Settings",path:"/settings"}];function bF(){const e=or(),{sidebarExpanded:t,setSidebarExpanded:n}=Je(),{total:r}=gF();return s.jsxs(Ve.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:T2,alt:"CRMy",className:"w-8 h-8 flex-shrink-0 rounded-lg"}),s.jsx(Rn,{children:t&&s.jsx(Ve.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.jsx("nav",{className:"flex-1 flex flex-col py-3 gap-1 px-2",children:yF.map(a=>{const l=a.path==="/"?e.pathname==="/":e.pathname.startsWith(a.path);return s.jsxs(sc,{to:a.path,className:`group relative flex items-center gap-3 rounded-xl px-2.5 py-2.5 text-sm transition-all
|
|
497
|
+
${l?`${a.color.bg} ${a.color.text}`:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}`,title:t?void 0:a.label,children:[s.jsx(a.icon,{className:"w-5 h-5 flex-shrink-0"}),s.jsx(Rn,{children:t&&s.jsx(Ve.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:a.label})}),a.path==="/assignments"&&r>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 ${t?"":"absolute -top-1 -right-1"}`,children:r>99?"99+":r}),l&&s.jsx(Ve.div,{layoutId:"sidebar-active",className:`absolute -left-2 top-2 w-[3px] h-6 ${a.color.bar} rounded-r-full`,transition:{type:"spring",damping:25,stiffness:300}}),!t&&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:a.label})]},a.path)})}),s.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-3 border-t border-sidebar-border pt-3",children:[vF.map(a=>{const l=e.pathname.startsWith(a.path);return s.jsxs(sc,{to:a.path,className:`flex items-center gap-3 rounded-xl px-2.5 py-2.5 text-sm transition-all
|
|
498
|
+
${l?"bg-sidebar-primary/15 text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}`,title:t?void 0:a.label,children:[s.jsx(a.icon,{className:"w-5 h-5 flex-shrink-0"}),s.jsx(Rn,{children:t&&s.jsx(Ve.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},className:"whitespace-nowrap overflow-hidden font-medium",children:a.label})})]},a.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(ZT,{className:"w-4 h-4"}):s.jsx(JT,{className:"w-4 h-4"})})]})]})}const wF=[{icon:tx,label:"Home",path:"/"},{icon:ko,label:"Contacts",path:"/contacts"},{icon:Id,label:"Accounts",path:"/accounts"},{icon:Ti,label:"Opps",path:"/opportunities"},{icon:Ca,label:"Activity",path:"/activities"},{icon:rx,label:"Settings",path:"/settings"}];function jF(){const e=or();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:wF.map(t=>{const n=t.path==="/"?e.pathname==="/":e.pathname.startsWith(t.path);return s.jsxs(sc,{to:t.path,className:"relative flex flex-col items-center justify-center py-1 min-w-[56px] min-h-[44px]",children:[n&&s.jsx(Ve.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(Ve.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 T1=1,NF=.9,CF=.8,kF=.17,op=.1,ap=.999,SF=.9999,_F=.99,EF=/[\\\/_+.#"@\[\(\{&]/,PF=/[\\\/_+.#"@\[\(\{&]/g,TF=/[\s-]/,A2=/[\s-]/g;function Eg(e,t,n,r,a,l,c){if(l===t.length)return a===e.length?T1:_F;var d=`${a},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),m=n.indexOf(f,a),p=0,g,b,y,k;m>=0;)g=Eg(e,t,n,r,m+1,l+1,c),g>p&&(m===a?g*=T1:EF.test(e.charAt(m-1))?(g*=CF,y=e.slice(a,m-1).match(PF),y&&a>0&&(g*=Math.pow(ap,y.length))):TF.test(e.charAt(m-1))?(g*=NF,k=e.slice(a,m-1).match(A2),k&&a>0&&(g*=Math.pow(ap,k.length))):(g*=kF,a>0&&(g*=Math.pow(ap,m-a))),e.charAt(m)!==t.charAt(l)&&(g*=SF)),(g<op&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(b=Eg(e,t,n,r,m+1,l+2,c),b*op>g&&(g=b*op)),g>p&&(p=g),m=n.indexOf(f,m+1);return c[d]=p,p}function A1(e){return e.toLowerCase().replace(A2," ")}function AF(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Eg(e,t,A1(e),A1(t),0,0,{})}var ip="focusScope.autoFocusOnMount",lp="focusScope.autoFocusOnUnmount",M1={bubbles:!1,cancelable:!0},MF="FocusScope",Jx=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[d,f]=x.useState(null),m=ts(a),p=ts(l),g=x.useRef(null),b=Pt(t,N=>f(N)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let N=function(S){if(y.paused||!d)return;const E=S.target;d.contains(E)?g.current=E:lo(g.current,{select:!0})},w=function(S){if(y.paused||!d)return;const E=S.relatedTarget;E!==null&&(d.contains(E)||lo(g.current,{select:!0}))},_=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&lo(d)};document.addEventListener("focusin",N),document.addEventListener("focusout",w);const j=new MutationObserver(_);return d&&j.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",w),j.disconnect()}}},[r,d,y.paused]),x.useEffect(()=>{if(d){R1.add(y);const N=document.activeElement;if(!d.contains(N)){const _=new CustomEvent(ip,M1);d.addEventListener(ip,m),d.dispatchEvent(_),_.defaultPrevented||(DF(FF(M2(d)),{select:!0}),document.activeElement===N&&lo(d))}return()=>{d.removeEventListener(ip,m),setTimeout(()=>{const _=new CustomEvent(lp,M1);d.addEventListener(lp,p),d.dispatchEvent(_),_.defaultPrevented||lo(N??document.body,{select:!0}),d.removeEventListener(lp,p),R1.remove(y)},0)}}},[d,m,p,y]);const k=x.useCallback(N=>{if(!n&&!r||y.paused)return;const w=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,_=document.activeElement;if(w&&_){const j=N.currentTarget,[S,E]=RF(j);S&&E?!N.shiftKey&&_===E?(N.preventDefault(),n&&lo(S,{select:!0})):N.shiftKey&&_===S&&(N.preventDefault(),n&&lo(E,{select:!0})):_===j&&N.preventDefault()}},[n,r,y.paused]);return s.jsx(qe.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});Jx.displayName=MF;function DF(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(lo(r,{select:t}),document.activeElement!==n)return}function RF(e){const t=M2(e),n=D1(t,e),r=D1(t.reverse(),e);return[n,r]}function M2(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 D1(e,t){for(const n of e)if(!OF(n,{upTo:t}))return n}function OF(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 LF(e){return e instanceof HTMLInputElement&&"select"in e}function lo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LF(e)&&t&&e.select()}}var R1=IF();function IF(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=O1(e,t),e.unshift(t)},remove(t){var n;e=O1(e,t),(n=e[0])==null||n.resume()}}}function O1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function FF(e){return e.filter(t=>t.tagName!=="A")}var cp=0;function D2(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??L1()),document.body.insertAdjacentElement("beforeend",e[1]??L1()),cp++,()=>{cp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cp--}},[])}function L1(){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 Kr=function(){return Kr=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},Kr.apply(this,arguments)};function R2(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 $F(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 Sd="right-scroll-bar-position",_d="width-before-scroll-bar",VF="with-scroll-bars-hidden",BF="--removed-body-scroll-bar-size";function up(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zF(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 WF=typeof window<"u"?x.useLayoutEffect:x.useEffect,I1=new WeakMap;function UF(e,t){var n=zF(null,function(r){return e.forEach(function(a){return up(a,r)})});return WF(function(){var r=I1.get(n);if(r){var a=new Set(r),l=new Set(e),c=n.current;a.forEach(function(d){l.has(d)||up(d,null)}),l.forEach(function(d){a.has(d)||up(d,c)})}I1.set(n,e)},[e]),n}function HF(e){return e}function qF(e,t){t===void 0&&(t=HF);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(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.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 KF(e){e===void 0&&(e={});var t=qF(null);return t.options=Kr({async:!0,ssr:!1},e),t}var O2=function(e){var t=e.sideCar,n=R2(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,Kr({},n))};O2.isSideCarExport=!0;function YF(e,t){return e.useMedium(t),O2}var L2=KF(),dp=function(){},Mf=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:dp,onWheelCapture:dp,onTouchMoveCapture:dp}),a=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,m=e.removeScrollBar,p=e.enabled,g=e.shards,b=e.sideCar,y=e.noRelative,k=e.noIsolation,N=e.inert,w=e.allowPinchZoom,_=e.as,j=_===void 0?"div":_,S=e.gapMode,E=R2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=b,A=UF([n,t]),M=Kr(Kr({},E),a);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:L2,removeScrollBar:m,shards:g,noRelative:y,noIsolation:k,inert:N,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:S}),c?x.cloneElement(x.Children.only(d),Kr(Kr({},M),{ref:A})):x.createElement(j,Kr({},M,{className:f,ref:A}),d))});Mf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mf.classNames={fullWidth:_d,zeroRight:Sd};var QF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QF();return t&&e.setAttribute("nonce",t),e}function XF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var JF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GF())&&(XF(t,n),ZF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},e6=function(){var e=JF();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},I2=function(){var e=e6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},t6={left:0,top:0,right:0,gap:0},fp=function(e){return parseInt(e||"",10)||0},n6=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[fp(n),fp(r),fp(a)]},r6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return t6;var t=n6(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])}},s6=I2(),xi="data-scroll-locked",o6=function(e,t,n,r){var a=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
499
|
+
.`.concat(VF,` {
|
|
500
|
+
overflow: hidden `).concat(r,`;
|
|
501
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
502
|
+
}
|
|
503
|
+
body[`).concat(xi,`] {
|
|
504
|
+
overflow: hidden `).concat(r,`;
|
|
505
|
+
overscroll-behavior: contain;
|
|
506
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
507
|
+
padding-left: `.concat(a,`px;
|
|
508
|
+
padding-top: `).concat(l,`px;
|
|
509
|
+
padding-right: `).concat(c,`px;
|
|
510
|
+
margin-left:0;
|
|
511
|
+
margin-top:0;
|
|
512
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
513
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.`).concat(Sd,` {
|
|
517
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.`).concat(_d,` {
|
|
521
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.`).concat(Sd," .").concat(Sd,` {
|
|
525
|
+
right: 0 `).concat(r,`;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.`).concat(_d," .").concat(_d,` {
|
|
529
|
+
margin-right: 0 `).concat(r,`;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
body[`).concat(xi,`] {
|
|
533
|
+
`).concat(BF,": ").concat(d,`px;
|
|
534
|
+
}
|
|
535
|
+
`)},F1=function(){var e=parseInt(document.body.getAttribute(xi)||"0",10);return isFinite(e)?e:0},a6=function(){x.useEffect(function(){return document.body.setAttribute(xi,(F1()+1).toString()),function(){var e=F1()-1;e<=0?document.body.removeAttribute(xi):document.body.setAttribute(xi,e.toString())}},[])},i6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;a6();var l=x.useMemo(function(){return r6(a)},[a]);return x.createElement(s6,{styles:o6(l,!t,a,n?"":"!important")})},Pg=!1;if(typeof window<"u")try{var rd=Object.defineProperty({},"passive",{get:function(){return Pg=!0,!0}});window.addEventListener("test",rd,rd),window.removeEventListener("test",rd,rd)}catch{Pg=!1}var ni=Pg?{passive:!1}:!1,l6=function(e){return e.tagName==="TEXTAREA"},F2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!l6(e)&&n[t]==="visible")},c6=function(e){return F2(e,"overflowY")},u6=function(e){return F2(e,"overflowX")},$1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=$2(e,r);if(a){var l=V2(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},d6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},f6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$2=function(e,t){return e==="v"?c6(t):u6(t)},V2=function(e,t){return e==="v"?d6(t):f6(t)},m6=function(e,t){return e==="h"&&t==="rtl"?-1:1},h6=function(e,t,n,r,a){var l=m6(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),m=!1,p=c>0,g=0,b=0;do{if(!d)break;var y=V2(e,d),k=y[0],N=y[1],w=y[2],_=N-w-l*k;(k||_)&&$2(e,d)&&(g+=_,b+=k);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(m=!0),m},sd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V1=function(e){return[e.deltaX,e.deltaY]},B1=function(e){return e&&"current"in e?e.current:e},p6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},g6=function(e){return`
|
|
536
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
537
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
538
|
+
`)},x6=0,ri=[];function y6(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(x6++)[0],l=x.useState(I2)[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 N=$F([e.lockRef.current],(e.shards||[]).map(B1),!0).filter(Boolean);return N.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),N.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=x.useCallback(function(N,w){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!c.current.allowPinchZoom;var _=sd(N),j=n.current,S="deltaX"in N?N.deltaX:j[0]-_[0],E="deltaY"in N?N.deltaY:j[1]-_[1],P,A=N.target,M=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in N&&M==="h"&&A.type==="range")return!1;var D=window.getSelection(),Y=D&&D.anchorNode,q=Y?Y===A||Y.contains(A):!1;if(q)return!1;var F=$1(M,A);if(!F)return!0;if(F?P=M:(P=M==="v"?"h":"v",F=$1(M,A)),!F)return!1;if(!r.current&&"changedTouches"in N&&(S||E)&&(r.current=P),!P)return!0;var B=r.current||P;return h6(B,w,N,B==="h"?S:E)},[]),f=x.useCallback(function(N){var w=N;if(!(!ri.length||ri[ri.length-1]!==l)){var _="deltaY"in w?V1(w):sd(w),j=t.current.filter(function(P){return P.name===w.type&&(P.target===w.target||w.target===P.shadowParent)&&p6(P.delta,_)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var S=(c.current.shards||[]).map(B1).filter(Boolean).filter(function(P){return P.contains(w.target)}),E=S.length>0?d(w,S[0]):!c.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),m=x.useCallback(function(N,w,_,j){var S={name:N,delta:w,target:_,should:j,shadowParent:v6(_)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),p=x.useCallback(function(N){n.current=sd(N),r.current=void 0},[]),g=x.useCallback(function(N){m(N.type,V1(N),N.target,d(N,e.lockRef.current))},[]),b=x.useCallback(function(N){m(N.type,sd(N),N.target,d(N,e.lockRef.current))},[]);x.useEffect(function(){return ri.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",f,ni),document.addEventListener("touchmove",f,ni),document.addEventListener("touchstart",p,ni),function(){ri=ri.filter(function(N){return N!==l}),document.removeEventListener("wheel",f,ni),document.removeEventListener("touchmove",f,ni),document.removeEventListener("touchstart",p,ni)}},[]);var y=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(l,{styles:g6(a)}):null,y?x.createElement(i6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function v6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const b6=YF(L2,y6);var ey=x.forwardRef(function(e,t){return x.createElement(Mf,Kr({},e,{ref:t,sideCar:b6}))});ey.classNames=Mf.classNames;var w6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},si=new WeakMap,od=new WeakMap,ad={},mp=0,B2=function(e){return e&&(e.host||B2(e.parentNode))},j6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=B2(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})},N6=function(e,t,n,r){var a=j6(t,Array.isArray(e)?e:[e]);ad[n]||(ad[n]=new WeakMap);var l=ad[n],c=[],d=new Set,f=new Set(a),m=function(g){!g||d.has(g)||(d.add(g),m(g.parentNode))};a.forEach(m);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(b){if(d.has(b))p(b);else try{var y=b.getAttribute(r),k=y!==null&&y!=="false",N=(si.get(b)||0)+1,w=(l.get(b)||0)+1;si.set(b,N),l.set(b,w),c.push(b),N===1&&k&&od.set(b,!0),w===1&&b.setAttribute(n,"true"),k||b.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",b,_)}})};return p(t),d.clear(),mp++,function(){c.forEach(function(g){var b=si.get(g)-1,y=l.get(g)-1;si.set(g,b),l.set(g,y),b||(od.has(g)||g.removeAttribute(r),od.delete(g)),y||g.removeAttribute(n)}),mp--,mp||(si=new WeakMap,si=new WeakMap,od=new WeakMap,ad={})}},z2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=w6(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),N6(r,a,n,"aria-hidden")):function(){return null}};function C6(e){const t=k6(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,d=x.Children.toArray(l),f=d.find(_6);if(f){const m=f.props.children,p=d.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 k6(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=P6(a),d=E6(l,a.props);return a.type!==x.Fragment&&(d.ref=r?Nr(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S6=Symbol("radix.slottable");function _6(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S6}function E6(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function P6(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 Df="Dialog",[W2]=Ro(Df),[T6,Dr]=W2(Df),U2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=x.useRef(null),f=x.useRef(null),[m,p]=bc({prop:r,defaultProp:a??!1,onChange:l,caller:Df});return s.jsx(T6,{scope:t,triggerRef:d,contentRef:f,contentId:Zr(),titleId:Zr(),descriptionId:Zr(),open:m,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(g=>!g),[p]),modal:c,children:n})};U2.displayName=Df;var H2="DialogTrigger",A6=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Dr(H2,n),l=Pt(t,a.triggerRef);return s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ry(a.open),...r,ref:l,onClick:Qe(e.onClick,a.onOpenToggle)})});A6.displayName=H2;var ty="DialogPortal",[M6,q2]=W2(ty,{forceMount:void 0}),K2=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,l=Dr(ty,t);return s.jsx(M6,{scope:t,forceMount:n,children:x.Children.map(r,c=>s.jsx(As,{present:n||l.open,children:s.jsx(df,{asChild:!0,container:a,children:c})}))})};K2.displayName=ty;var Jd="DialogOverlay",Y2=x.forwardRef((e,t)=>{const n=q2(Jd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,l=Dr(Jd,e.__scopeDialog);return l.modal?s.jsx(As,{present:r||l.open,children:s.jsx(R6,{...a,ref:t})}):null});Y2.displayName=Jd;var D6=C6("DialogOverlay.RemoveScroll"),R6=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Dr(Jd,n);return s.jsx(ey,{as:D6,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(qe.div,{"data-state":ry(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),_a="DialogContent",Q2=x.forwardRef((e,t)=>{const n=q2(_a,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,l=Dr(_a,e.__scopeDialog);return s.jsx(As,{present:r||l.open,children:l.modal?s.jsx(O6,{...a,ref:t}):s.jsx(L6,{...a,ref:t})})});Q2.displayName=_a;var O6=x.forwardRef((e,t)=>{const n=Dr(_a,e.__scopeDialog),r=x.useRef(null),a=Pt(t,n.contentRef,r);return x.useEffect(()=>{const l=r.current;if(l)return z2(l)},[]),s.jsx(G2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qe(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Qe(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Qe(e.onFocusOutside,l=>l.preventDefault())})}),L6=x.forwardRef((e,t)=>{const n=Dr(_a,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(G2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.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()}})}),G2=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,d=Dr(_a,n),f=x.useRef(null),m=Pt(t,f);return D2(),s.jsxs(s.Fragment,{children:[s.jsx(Jx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:l,children:s.jsx(vc,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ry(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(V6,{titleId:d.titleId}),s.jsx(z6,{contentRef:f,descriptionId:d.descriptionId})]})]})}),ny="DialogTitle",I6=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Dr(ny,n);return s.jsx(qe.h2,{id:a.titleId,...r,ref:t})});I6.displayName=ny;var X2="DialogDescription",F6=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Dr(X2,n);return s.jsx(qe.p,{id:a.descriptionId,...r,ref:t})});F6.displayName=X2;var Z2="DialogClose",$6=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Dr(Z2,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Qe(e.onClick,()=>a.onOpenChange(!1))})});$6.displayName=Z2;function ry(e){return e?"open":"closed"}var J2="DialogTitleWarning",[dW,eS]=IP(J2,{contentName:_a,titleName:ny,docsSlug:"dialog"}),V6=({titleId:e})=>{const t=eS(J2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
539
|
+
|
|
540
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
541
|
+
|
|
542
|
+
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},B6="DialogDescriptionWarning",z6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eS(B6).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},W6=U2,U6=K2,H6=Y2,q6=Q2,Fl='[cmdk-group=""]',hp='[cmdk-group-items=""]',K6='[cmdk-group-heading=""]',tS='[cmdk-item=""]',z1=`${tS}:not([aria-disabled="true"])`,Tg="cmdk-item-select",li="data-value",Y6=(e,t,n)=>AF(e,t,n),nS=x.createContext(void 0),Ac=()=>x.useContext(nS),rS=x.createContext(void 0),sy=()=>x.useContext(rS),sS=x.createContext(void 0),oS=x.forwardRef((e,t)=>{let n=ci(()=>{var O,Q;return{search:"",value:(Q=(O=e.value)!=null?O:e.defaultValue)!=null?Q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=ci(()=>new Set),a=ci(()=>new Map),l=ci(()=>new Map),c=ci(()=>new Set),d=aS(e),{label:f,children:m,value:p,onValueChange:g,filter:b,shouldFilter:y,loop:k,disablePointerSelection:N=!1,vimBindings:w=!0,..._}=e,j=Zr(),S=Zr(),E=Zr(),P=x.useRef(null),A=o8();Ea(()=>{if(p!==void 0){let O=p.trim();n.current.value=O,M.emit()}},[p]),Ea(()=>{A(6,se)},[]);let M=x.useMemo(()=>({subscribe:O=>(c.current.add(O),()=>c.current.delete(O)),snapshot:()=>n.current,setState:(O,Q,re)=>{var oe,de,le,be;if(!Object.is(n.current[O],Q)){if(n.current[O]=Q,O==="search")B(),q(),A(1,F);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let we=document.getElementById(E);we?we.focus():(oe=document.getElementById(j))==null||oe.focus()}if(A(7,()=>{var we;n.current.selectedItemId=(we=G())==null?void 0:we.id,M.emit()}),re||A(5,se),((de=d.current)==null?void 0:de.value)!==void 0){let we=Q??"";(be=(le=d.current).onValueChange)==null||be.call(le,we);return}}M.emit()}},emit:()=>{c.current.forEach(O=>O())}}),[]),D=x.useMemo(()=>({value:(O,Q,re)=>{var oe;Q!==((oe=l.current.get(O))==null?void 0:oe.value)&&(l.current.set(O,{value:Q,keywords:re}),n.current.filtered.items.set(O,Y(Q,re)),A(2,()=>{q(),M.emit()}))},item:(O,Q)=>(r.current.add(O),Q&&(a.current.has(Q)?a.current.get(Q).add(O):a.current.set(Q,new Set([O]))),A(3,()=>{B(),q(),n.current.value||F(),M.emit()}),()=>{l.current.delete(O),r.current.delete(O),n.current.filtered.items.delete(O);let re=G();A(4,()=>{B(),(re==null?void 0:re.getAttribute("id"))===O&&F(),M.emit()})}),group:O=>(a.current.has(O)||a.current.set(O,new Set),()=>{l.current.delete(O),a.current.delete(O)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:j,inputId:E,labelId:S,listInnerRef:P}),[]);function Y(O,Q){var re,oe;let de=(oe=(re=d.current)==null?void 0:re.filter)!=null?oe:Y6;return O?de(O,n.current.search,Q):0}function q(){if(!n.current.search||d.current.shouldFilter===!1)return;let O=n.current.filtered.items,Q=[];n.current.filtered.groups.forEach(oe=>{let de=a.current.get(oe),le=0;de.forEach(be=>{let we=O.get(be);le=Math.max(we,le)}),Q.push([oe,le])});let re=P.current;L().sort((oe,de)=>{var le,be;let we=oe.getAttribute("id"),pe=de.getAttribute("id");return((le=O.get(pe))!=null?le:0)-((be=O.get(we))!=null?be:0)}).forEach(oe=>{let de=oe.closest(hp);de?de.appendChild(oe.parentElement===de?oe:oe.closest(`${hp} > *`)):re.appendChild(oe.parentElement===re?oe:oe.closest(`${hp} > *`))}),Q.sort((oe,de)=>de[1]-oe[1]).forEach(oe=>{var de;let le=(de=P.current)==null?void 0:de.querySelector(`${Fl}[${li}="${encodeURIComponent(oe[0])}"]`);le==null||le.parentElement.appendChild(le)})}function F(){let O=L().find(re=>re.getAttribute("aria-disabled")!=="true"),Q=O==null?void 0:O.getAttribute(li);M.setState("value",Q||void 0)}function B(){var O,Q,re,oe;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let le of r.current){let be=(Q=(O=l.current.get(le))==null?void 0:O.value)!=null?Q:"",we=(oe=(re=l.current.get(le))==null?void 0:re.keywords)!=null?oe:[],pe=Y(be,we);n.current.filtered.items.set(le,pe),pe>0&&de++}for(let[le,be]of a.current)for(let we of be)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=de}function se(){var O,Q,re;let oe=G();oe&&(((O=oe.parentElement)==null?void 0:O.firstChild)===oe&&((re=(Q=oe.closest(Fl))==null?void 0:Q.querySelector(K6))==null||re.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function G(){var O;return(O=P.current)==null?void 0:O.querySelector(`${tS}[aria-selected="true"]`)}function L(){var O;return Array.from(((O=P.current)==null?void 0:O.querySelectorAll(z1))||[])}function H(O){let Q=L()[O];Q&&M.setState("value",Q.getAttribute(li))}function $(O){var Q;let re=G(),oe=L(),de=oe.findIndex(be=>be===re),le=oe[de+O];(Q=d.current)!=null&&Q.loop&&(le=de+O<0?oe[oe.length-1]:de+O===oe.length?oe[0]:oe[de+O]),le&&M.setState("value",le.getAttribute(li))}function R(O){let Q=G(),re=Q==null?void 0:Q.closest(Fl),oe;for(;re&&!oe;)re=O>0?r8(re,Fl):s8(re,Fl),oe=re==null?void 0:re.querySelector(z1);oe?M.setState("value",oe.getAttribute(li)):$(O)}let W=()=>H(L().length-1),Z=O=>{O.preventDefault(),O.metaKey?W():O.altKey?R(1):$(1)},V=O=>{O.preventDefault(),O.metaKey?H(0):O.altKey?R(-1):$(-1)};return x.createElement(qe.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:O=>{var Q;(Q=_.onKeyDown)==null||Q.call(_,O);let re=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||re))switch(O.key){case"n":case"j":{w&&O.ctrlKey&&Z(O);break}case"ArrowDown":{Z(O);break}case"p":case"k":{w&&O.ctrlKey&&V(O);break}case"ArrowUp":{V(O);break}case"Home":{O.preventDefault(),H(0);break}case"End":{O.preventDefault(),W();break}case"Enter":{O.preventDefault();let oe=G();if(oe){let de=new Event(Tg);oe.dispatchEvent(de)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:i8},f),Rf(e,O=>x.createElement(rS.Provider,{value:M},x.createElement(nS.Provider,{value:D},O))))}),Q6=x.forwardRef((e,t)=>{var n,r;let a=Zr(),l=x.useRef(null),c=x.useContext(sS),d=Ac(),f=aS(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Ea(()=>{if(!m)return d.item(a,c==null?void 0:c.id)},[m]);let p=iS(a,l,[e.value,e.children,l],e.keywords),g=sy(),b=To(A=>A.value&&A.value===p.current),y=To(A=>m||d.filter()===!1?!0:A.search?A.filtered.items.get(a)>0:!0);x.useEffect(()=>{let A=l.current;if(!(!A||e.disabled))return A.addEventListener(Tg,k),()=>A.removeEventListener(Tg,k)},[y,e.onSelect,e.disabled]);function k(){var A,M;N(),(M=(A=f.current).onSelect)==null||M.call(A,p.current)}function N(){g.setState("value",p.current,!0)}if(!y)return null;let{disabled:w,value:_,onSelect:j,forceMount:S,keywords:E,...P}=e;return x.createElement(qe.div,{ref:Nr(l,t),...P,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!b,"data-disabled":!!w,"data-selected":!!b,onPointerMove:w||d.getDisablePointerSelection()?void 0:N,onClick:w?void 0:k},e.children)}),G6=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...l}=e,c=Zr(),d=x.useRef(null),f=x.useRef(null),m=Zr(),p=Ac(),g=To(y=>a||p.filter()===!1?!0:y.search?y.filtered.groups.has(c):!0);Ea(()=>p.group(c),[]),iS(c,d,[e.value,e.heading,f]);let b=x.useMemo(()=>({id:c,forceMount:a}),[a]);return x.createElement(qe.div,{ref:Nr(d,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),Rf(e,y=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},x.createElement(sS.Provider,{value:b},y))))}),X6=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),l=To(c=>!c.search);return!n&&!l?null:x.createElement(qe.div,{ref:Nr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Z6=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,l=sy(),c=To(m=>m.search),d=To(m=>m.selectedItemId),f=Ac();return x.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),x.createElement(qe.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":d,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)}})}),J6=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,l=x.useRef(null),c=x.useRef(null),d=To(m=>m.selectedItemId),f=Ac();return x.useEffect(()=>{if(c.current&&l.current){let m=c.current,p=l.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let y=m.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return b.observe(m),()=>{cancelAnimationFrame(g),b.unobserve(m)}}},[]),x.createElement(qe.div,{ref:Nr(l,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},Rf(e,m=>x.createElement("div",{ref:Nr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),e8=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:l,container:c,...d}=e;return x.createElement(W6,{open:n,onOpenChange:r},x.createElement(U6,{container:c},x.createElement(H6,{"cmdk-overlay":"",className:a}),x.createElement(q6,{"aria-label":e.label,"cmdk-dialog":"",className:l},x.createElement(oS,{ref:t,...d}))))}),t8=x.forwardRef((e,t)=>To(n=>n.filtered.count===0)?x.createElement(qe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),n8=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...l}=e;return x.createElement(qe.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Rf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),zt=Object.assign(oS,{List:J6,Item:Q6,Input:Z6,Group:G6,Separator:X6,Dialog:e8,Empty:t8,Loading:n8});function r8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function s8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function aS(e){let t=x.useRef(e);return Ea(()=>{t.current=e}),t}var Ea=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ci(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function To(e){let t=sy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function iS(e,t,n,r=[]){let a=x.useRef(),l=Ac();return Ea(()=>{var c;let d=(()=>{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,d,f),(c=t.current)==null||c.setAttribute(li,d),a.current=d}),a}var o8=()=>{let[e,t]=x.useState(),n=ci(()=>new Map);return Ea(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function a8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(a8(t),{ref:t.ref},n(t.props.children)):n(t)}var i8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const W1=[{bg:"#FB990C"},{bg:"#F8BB59"},{bg:"#C94408"},{bg:"#FDBA74",dark:!0},{bg:"#F59E0B"},{bg:"#EA580C"},{bg:"#FED7AA",dark:!0},{bg:"#FCF1C1",dark:!0}];function l8(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}function c8(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 Ps({name:e,className:t,textClassName:n}){const r=e||"?",a=W1[l8(r)%W1.length],l=c8(r);return s.jsx("div",{className:Ie("flex items-center justify-center flex-shrink-0 rounded-xl",t),style:{backgroundColor:a.bg},children:s.jsx("span",{className:Ie("font-display font-bold select-none",a.dark?"text-[#2A2A2E]":"text-white",n),children:r==="?"?"?":l})})}const pp=768;function Of(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${pp-1}px)`),r=()=>{t(window.innerWidth<pp)};return n.addEventListener("change",r),t(window.innerWidth<pp),()=>n.removeEventListener("change",r)},[]),!!e}function u8(){const{commandPaletteOpen:e,setCommandPaletteOpen:t,openDrawer:n}=Je(),r=yn(),a=x.useRef(null),l=Of(),[c,d]=x.useState(""),{data:f}=eF(c),m=(f==null?void 0:f.contacts)??[],p=(f==null?void 0:f.accounts)??[],g=(f==null?void 0:f.opportunities)??[],b=(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 j;return(j=a.current)==null?void 0:j.focus()},50):d("")},[e]);const N=j=>{j(),t(!1)},w=Ie("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(zt,{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(Cc,{className:"w-4 h-4 text-muted-foreground"}),s.jsx(zt.Input,{ref:a,value:c,onValueChange:d,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(zt.List,{className:"max-h-[60vh] overflow-y-auto p-2",children:[s.jsx(zt.Empty,{className:"py-6 text-center text-sm text-muted-foreground",children:"No results found."}),!c&&s.jsx(zt.Group,{heading:"Pages",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:[{label:"Dashboard",icon:tx,path:"/",color:It.dashboard},{label:"Contacts",icon:ko,path:"/contacts",color:It.contacts},{label:"Accounts",icon:Id,path:"/accounts",color:It.accounts},{label:"Opportunities",icon:Ti,path:"/opportunities",color:It.opportunities},{label:"Use Cases",icon:$d,path:"/use-cases",color:It.useCases},{label:"Activities",icon:Ca,path:"/activities",color:It.activities},{label:"Assignments",icon:Fd,path:"/assignments",color:It.assignments},{label:"Settings",icon:rx,path:"/settings",color:null}].map(j=>{var S;return s.jsxs(zt.Item,{value:j.label,onSelect:()=>N(()=>r(j.path)),className:w,children:[s.jsx(j.icon,{className:Ie("w-4 h-4",((S=j.color)==null?void 0:S.text)??"text-muted-foreground")}),j.label]},j.path)})}),m.length>0&&s.jsx(zt.Group,{heading:"Contacts",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:m.slice(0,5).map(j=>s.jsxs(zt.Item,{value:`${j.name} ${j.company} ${j.email}`,onSelect:()=>N(()=>{r("/contacts"),n("contact",j.id)}),className:w,children:[s.jsx(Ps,{name:j.name,className:"w-5 h-5 rounded-full text-[8px]"}),s.jsx("span",{children:j.name}),j.company&&s.jsxs("span",{className:"text-muted-foreground text-xs",children:["— ",j.company]})]},j.id))}),p.length>0&&s.jsx(zt.Group,{heading:"Accounts",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:p.slice(0,5).map(j=>s.jsxs(zt.Item,{value:`${j.name} ${j.domain??""}`,onSelect:()=>N(()=>{r("/accounts"),n("account",j.id)}),className:w,children:[s.jsx(Id,{className:Ie("w-4 h-4",It.accounts.text)}),s.jsx("span",{children:j.name}),j.domain&&s.jsxs("span",{className:"text-muted-foreground text-xs",children:["— ",j.domain]})]},j.id))}),g.length>0&&s.jsx(zt.Group,{heading:"Opportunities",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:g.slice(0,5).map(j=>s.jsxs(zt.Item,{value:`${j.name} ${j.contact_name}`,onSelect:()=>N(()=>{r("/opportunities"),n("opportunity",j.id)}),className:w,children:[s.jsx(Ti,{className:Ie("w-4 h-4",It.opportunities.text)}),s.jsx("span",{children:j.name}),j.amount&&s.jsxs("span",{className:"text-muted-foreground text-xs ml-auto",children:["$",(j.amount/1e3).toFixed(0),"K"]})]},j.id))}),b.length>0&&s.jsx(zt.Group,{heading:"Activities",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:b.slice(0,5).map(j=>{var S;return s.jsxs(zt.Item,{value:`${j.body??""} ${j.activity_type??""}`,onSelect:()=>N(()=>r("/activities")),className:w,children:[s.jsx(Ca,{className:Ie("w-4 h-4",It.activities.text)}),s.jsx("span",{className:"truncate",children:(S=j.body)==null?void 0:S.slice(0,60)})]},j.id)})}),y.length>0&&s.jsx(zt.Group,{heading:"Use Cases",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:y.slice(0,5).map(j=>s.jsxs(zt.Item,{value:`${j.name??""}`,onSelect:()=>N(()=>r("/use-cases")),className:w,children:[s.jsx($d,{className:Ie("w-4 h-4",It.useCases.text)}),s.jsx("span",{children:j.name})]},j.id))}),k.length>0&&s.jsx(zt.Group,{heading:"Assignments",className:"text-xs text-muted-foreground px-2 py-1.5 font-display",children:k.slice(0,5).map(j=>s.jsxs(zt.Item,{value:`${j.title??""}`,onSelect:()=>N(()=>r("/assignments")),className:w,children:[s.jsx(Fd,{className:Ie("w-4 h-4",It.assignments.text)}),s.jsx("span",{children:j.title})]},j.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(Rn,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(Ve.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(Ve.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(Ve.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 d8=[{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 f8(){const{shortcutsOpen:e,setShortcutsOpen:t}=Je();return s.jsx(Rn,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(Ve.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(Ve.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"}),d8.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 m8({children:e,title:t}){const{drawerOpen:n,closeDrawer:r}=Je();return s.jsx(Rn,{children:n&&s.jsxs(s.Fragment,{children:[s.jsx(Ve.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(Ve.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(Ln,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:e})]}),s.jsxs(Ve.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(Ln,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto pb-safe",children:e})]})]})})}const lS=x.createContext({enabled:!1,setEnabled:()=>{}});function h8({children:e}){const[t,n]=x.useState(!1);return s.jsx(lS.Provider,{value:{enabled:t,setEnabled:n},children:e})}function ar(){return x.useContext(lS)}function Ae(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 st(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Gt(e,t){const n=Ae(e);return isNaN(t)?st(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function _r(e,t){const n=Ae(e);if(isNaN(t))return st(e,NaN);if(!t)return n;const r=n.getDate(),a=st(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 oy=6048e5,p8=864e5,ay=6e4,iy=36e5,g8=1e3,id=43200,U1=1440;let x8={};function $o(){return x8}function Yn(e,t){var d,f,m,p;const n=$o(),r=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,a=Ae(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 Ts(e){return Yn(e,{weekStartsOn:1})}function cS(e){const t=Ae(e),n=t.getFullYear(),r=st(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=Ts(r),l=st(e,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const c=Ts(l);return t.getTime()>=a.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function Fi(e){const t=Ae(e);return t.setHours(0,0,0,0),t}function Ao(e){const t=Ae(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 Xr(e,t){const n=Fi(e),r=Fi(t),a=+n-Ao(n),l=+r-Ao(r);return Math.round((a-l)/p8)}function y8(e){const t=cS(e),n=st(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ts(n)}function Ag(e,t){const n=t*7;return Gt(e,n)}function v8(e,t){return _r(e,t*12)}function b8(e){let t;return e.forEach(function(n){const r=Ae(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function w8(e){let t;return e.forEach(n=>{const r=Ae(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Ed(e,t){const n=Ae(e),r=Ae(t),a=n.getTime()-r.getTime();return a<0?-1:a>0?1:a}function j8(e){return st(e,Date.now())}function Dn(e,t){const n=Fi(e),r=Fi(t);return+n==+r}function ly(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function cy(e){if(!ly(e)&&typeof e!="number")return!1;const t=Ae(e);return!isNaN(Number(t))}function $i(e,t){const n=Ae(e),r=Ae(t),a=n.getFullYear()-r.getFullYear(),l=n.getMonth()-r.getMonth();return a*12+l}function N8(e,t,n){const r=Yn(e,n),a=Yn(t,n),l=+r-Ao(r),c=+a-Ao(a);return Math.round((l-c)/oy)}function C8(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function k8(e,t){return+Ae(e)-+Ae(t)}function S8(e){const t=Ae(e);return t.setHours(23,59,59,999),t}function Lf(e){const t=Ae(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function _8(e){const t=Ae(e);return+S8(t)==+Lf(t)}function E8(e,t){const n=Ae(e),r=Ae(t),a=Ed(n,r),l=Math.abs($i(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 d=Ed(n,r)===-a;_8(Ae(e))&&l===1&&Ed(e,r)===1&&(d=!1),c=a*(l-Number(d))}return c===0?0:c}function P8(e,t,n){const r=k8(e,t)/1e3;return C8(n==null?void 0:n.roundingMethod)(r)}function On(e){const t=Ae(e);return t.setDate(1),t.setHours(0,0,0,0),t}function uS(e){const t=Ae(e),n=st(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uy(e,t){var d,f,m,p;const n=$o(),r=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,a=Ae(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 dS(e){return uy(e,{weekStartsOn:1})}const T8={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"}},A8=(e,t,n)=>{let r;const a=T8[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 gp(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const M8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},D8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},O8={date:gp({formats:M8,defaultWidth:"full"}),time:gp({formats:D8,defaultWidth:"full"}),dateTime:gp({formats:R8,defaultWidth:"full"})},L8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I8=(e,t,n,r)=>L8[e];function $l(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,d=n!=null&&n.width?String(n.width):c;a=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[d]||e.values[c]}const l=e.argumentCallback?e.argumentCallback(t):t;return a[l]}}const F8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},V8={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"]},B8={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"]},z8={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"}},W8={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"}},U8=(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"},H8={ordinalNumber:U8,era:$l({values:F8,defaultWidth:"wide"}),quarter:$l({values:$8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$l({values:V8,defaultWidth:"wide"}),day:$l({values:B8,defaultWidth:"wide"}),dayPeriod:$l({values:z8,defaultWidth:"wide",formattingValues:W8,defaultFormattingWidth:"wide"})};function Vl(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],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(d)?K8(d,g=>g.test(c)):q8(d,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 q8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function K8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Y8(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 d=t.slice(a.length);return{value:c,rest:d}}}const Q8=/^(\d+)(th|st|nd|rd)?/i,G8=/\d+/i,X8={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},Z8={any:[/^b/i,/^(a|c)/i]},J8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},e9={any:[/1/i,/2/i,/3/i,/4/i]},t9={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},n9={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]},r9={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},s9={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]},o9={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},a9={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}},i9={ordinalNumber:Y8({matchPattern:Q8,parsePattern:G8,valueCallback:e=>parseInt(e,10)}),era:Vl({matchPatterns:X8,defaultMatchWidth:"wide",parsePatterns:Z8,defaultParseWidth:"any"}),quarter:Vl({matchPatterns:J8,defaultMatchWidth:"wide",parsePatterns:e9,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vl({matchPatterns:t9,defaultMatchWidth:"wide",parsePatterns:n9,defaultParseWidth:"any"}),day:Vl({matchPatterns:r9,defaultMatchWidth:"wide",parsePatterns:s9,defaultParseWidth:"any"}),dayPeriod:Vl({matchPatterns:o9,defaultMatchWidth:"any",parsePatterns:a9,defaultParseWidth:"any"})},If={code:"en-US",formatDistance:A8,formatLong:O8,formatRelative:I8,localize:H8,match:i9,options:{weekStartsOn:0,firstWeekContainsDate:1}};function l9(e){const t=Ae(e);return Xr(t,uS(t))+1}function dy(e){const t=Ae(e),n=+Ts(t)-+y8(t);return Math.round(n/oy)+1}function fy(e,t){var p,g,b,y;const n=Ae(e),r=n.getFullYear(),a=$o(),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=(b=a.locale)==null?void 0:b.options)==null?void 0:y.firstWeekContainsDate)??1,c=st(e,0);c.setFullYear(r+1,0,l),c.setHours(0,0,0,0);const d=Yn(c,t),f=st(e,0);f.setFullYear(r,0,l),f.setHours(0,0,0,0);const m=Yn(f,t);return n.getTime()>=d.getTime()?r+1:n.getTime()>=m.getTime()?r:r-1}function c9(e,t){var d,f,m,p;const n=$o(),r=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,a=fy(e,t),l=st(e,0);return l.setFullYear(a,0,r),l.setHours(0,0,0,0),Yn(l,t)}function my(e,t){const n=Ae(e),r=+Yn(n,t)-+c9(n,t);return Math.round(r/oy)+1}function nt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const no={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return nt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):nt(n+1,2)},d(e,t){return nt(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 nt(e.getHours()%12||12,t.length)},H(e,t){return nt(e.getHours(),t.length)},m(e,t){return nt(e.getMinutes(),t.length)},s(e,t){return nt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return nt(a,t.length)}},oi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H1={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 no.y(e,t)},Y:function(e,t,n,r){const a=fy(e,r),l=a>0?a:1-a;if(t==="YY"){const c=l%100;return nt(c,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):nt(l,t.length)},R:function(e,t){const n=cS(e);return nt(n,t.length)},u:function(e,t){const n=e.getFullYear();return nt(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 nt(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 nt(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 no.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 nt(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=my(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):nt(a,t.length)},I:function(e,t,n){const r=dy(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):nt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):no.d(e,t)},D:function(e,t,n){const r=l9(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):nt(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 nt(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 nt(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 nt(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=oi.noon:r===0?a=oi.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=oi.evening:r>=12?a=oi.afternoon:r>=4?a=oi.morning:a=oi.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 no.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):no.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):nt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):nt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):no.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):no.s(e,t)},S:function(e,t){return no.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return K1(r);case"XXXX":case"XX":return ia(r);case"XXXXX":case"XXX":default:return ia(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return K1(r);case"xxxx":case"xx":return ia(r);case"xxxxx":case"xxx":default:return ia(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+q1(r,":");case"OOOO":default:return"GMT"+ia(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+q1(r,":");case"zzzz":default:return"GMT"+ia(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return nt(r,t.length)},T:function(e,t,n){const r=e.getTime();return nt(r,t.length)}};function q1(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+nt(l,2)}function K1(e,t){return e%60===0?(e>0?"-":"+")+nt(Math.abs(e)/60,2):ia(e,t)}function ia(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=nt(Math.trunc(r/60),2),l=nt(r%60,2);return n+a+t+l}const Y1=(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"})}},fS=(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"})}},u9=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Y1(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}}",Y1(r,t)).replace("{{time}}",fS(a,t))},Mg={p:fS,P:u9},d9=/^D+$/,f9=/^Y+$/,m9=["D","DD","YY","YYYY"];function mS(e){return d9.test(e)}function hS(e){return f9.test(e)}function Dg(e,t,n){const r=h9(e,t,n);if(console.warn(r),m9.includes(e))throw new RangeError(r)}function h9(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 p9=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g9=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x9=/^'([^]*?)'?$/,y9=/''/g,v9=/[a-zA-Z]/;function Er(e,t,n){var p,g,b,y,k,N,w,_;const r=$o(),a=(n==null?void 0:n.locale)??r.locale??If,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=(b=r.locale)==null?void 0:b.options)==null?void 0:y.firstWeekContainsDate)??1,c=(n==null?void 0:n.weekStartsOn)??((N=(k=n==null?void 0:n.locale)==null?void 0:k.options)==null?void 0:N.weekStartsOn)??r.weekStartsOn??((_=(w=r.locale)==null?void 0:w.options)==null?void 0:_.weekStartsOn)??0,d=Ae(e);if(!cy(d))throw new RangeError("Invalid time value");let f=t.match(g9).map(j=>{const S=j[0];if(S==="p"||S==="P"){const E=Mg[S];return E(j,a.formatLong)}return j}).join("").match(p9).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const S=j[0];if(S==="'")return{isToken:!1,value:b9(j)};if(H1[S])return{isToken:!0,value:j};if(S.match(v9))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:j}});a.localize.preprocessor&&(f=a.localize.preprocessor(d,f));const m={firstWeekContainsDate:l,weekStartsOn:c,locale:a};return f.map(j=>{if(!j.isToken)return j.value;const S=j.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&hS(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&mS(S))&&Dg(S,t,String(e));const E=H1[S[0]];return E(d,S,a.localize,m)}).join("")}function b9(e){const t=e.match(x9);return t?t[1].replace(y9,"'"):e}function w9(e,t,n){const r=$o(),a=(n==null?void 0:n.locale)??r.locale??If,l=2520,c=Ed(e,t);if(isNaN(c))throw new RangeError("Invalid time value");const d=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:c});let f,m;c>0?(f=Ae(t),m=Ae(e)):(f=Ae(e),m=Ae(t));const p=P8(m,f),g=(Ao(m)-Ao(f))/1e3,b=Math.round((p-g)/60);let y;if(b<2)return n!=null&&n.includeSeconds?p<5?a.formatDistance("lessThanXSeconds",5,d):p<10?a.formatDistance("lessThanXSeconds",10,d):p<20?a.formatDistance("lessThanXSeconds",20,d):p<40?a.formatDistance("halfAMinute",0,d):p<60?a.formatDistance("lessThanXMinutes",1,d):a.formatDistance("xMinutes",1,d):b===0?a.formatDistance("lessThanXMinutes",1,d):a.formatDistance("xMinutes",b,d);if(b<45)return a.formatDistance("xMinutes",b,d);if(b<90)return a.formatDistance("aboutXHours",1,d);if(b<U1){const k=Math.round(b/60);return a.formatDistance("aboutXHours",k,d)}else{if(b<l)return a.formatDistance("xDays",1,d);if(b<id){const k=Math.round(b/U1);return a.formatDistance("xDays",k,d)}else if(b<id*2)return y=Math.round(b/id),a.formatDistance("aboutXMonths",y,d)}if(y=E8(m,f),y<12){const k=Math.round(b/id);return a.formatDistance("xMonths",k,d)}else{const k=y%12,N=Math.trunc(y/12);return k<3?a.formatDistance("aboutXYears",N,d):k<9?a.formatDistance("overXYears",N,d):a.formatDistance("almostXYears",N+1,d)}}function pS(e,t){return w9(e,j8(e),t)}function j9(e){const t=Ae(e),n=t.getFullYear(),r=t.getMonth(),a=st(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function N9(){return Object.assign({},$o())}function C9(e){let n=Ae(e).getDay();return n===0&&(n=7),n}function k9(e){return Math.trunc(+Ae(e)/1e3)}function S9(e){const t=Ae(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function _9(e,t){return N8(S9(e),On(e),t)+1}function dc(e,t){const n=Ae(e),r=Ae(t);return n.getTime()>r.getTime()}function Ff(e,t){const n=Ae(e),r=Ae(t);return+n<+r}function E9(e,t){const n=t instanceof Date?st(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 P9=10;class gS{constructor(){ye(this,"subPriority",0)}validate(t,n){return!0}}class T9 extends gS{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 A9 extends gS{constructor(){super(...arguments);ye(this,"priority",P9);ye(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:st(n,E9(n,Date))}}class Xe{run(t,n,r,a){const l=this.parse(t,n,r,a);return l?{setter:new T9(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,r){return!0}}class M9 extends Xe{constructor(){super(...arguments);ye(this,"priority",140);ye(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 St={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}/},Yr={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 _t(e,t){return e&&{value:t(e.value),rest:e.rest}}function vt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Qr(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*iy+l*ay+c*g8),rest:t.slice(n[0].length)}}function xS(e){return vt(St.anyDigitsSigned,e)}function Nt(e,t){switch(e){case 1:return vt(St.singleDigit,t);case 2:return vt(St.twoDigits,t);case 3:return vt(St.threeDigits,t);case 4:return vt(St.fourDigits,t);default:return vt(new RegExp("^\\d{1,"+e+"}"),t)}}function ef(e,t){switch(e){case 1:return vt(St.singleDigitSigned,t);case 2:return vt(St.twoDigitsSigned,t);case 3:return vt(St.threeDigitsSigned,t);case 4:return vt(St.fourDigitsSigned,t);default:return vt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function hy(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 yS(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,d=e>=l%100;a=e+c-(d?100:0)}return n?a:1-a}function vS(e){return e%400===0||e%4===0&&e%100!==0}class D9 extends Xe{constructor(){super(...arguments);ye(this,"priority",130);ye(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 _t(Nt(4,n),l);case"yo":return _t(a.ordinalNumber(n,{unit:"year"}),l);default:return _t(Nt(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 d=yS(a.year,l);return n.setFullYear(d,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 R9 extends Xe{constructor(){super(...arguments);ye(this,"priority",130);ye(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 _t(Nt(4,n),l);case"Yo":return _t(a.ordinalNumber(n,{unit:"year"}),l);default:return _t(Nt(r.length,n),l)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a,l){const c=fy(n,l);if(a.isTwoDigitYear){const f=yS(a.year,c);return n.setFullYear(f,0,l.firstWeekContainsDate),n.setHours(0,0,0,0),Yn(n,l)}const d=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(d,0,l.firstWeekContainsDate),n.setHours(0,0,0,0),Yn(n,l)}}class O9 extends Xe{constructor(){super(...arguments);ye(this,"priority",130);ye(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return ef(r==="R"?4:r.length,n)}set(n,r,a){const l=st(n,0);return l.setFullYear(a,0,4),l.setHours(0,0,0,0),Ts(l)}}class L9 extends Xe{constructor(){super(...arguments);ye(this,"priority",130);ye(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return ef(r==="u"?4:r.length,n)}set(n,r,a){return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class I9 extends Xe{constructor(){super(...arguments);ye(this,"priority",120);ye(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 Nt(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 F9 extends Xe{constructor(){super(...arguments);ye(this,"priority",120);ye(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 Nt(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 $9 extends Xe{constructor(){super(...arguments);ye(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ye(this,"priority",110)}parse(n,r,a){const l=c=>c-1;switch(r){case"M":return _t(vt(St.month,n),l);case"MM":return _t(Nt(2,n),l);case"Mo":return _t(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 V9 extends Xe{constructor(){super(...arguments);ye(this,"priority",110);ye(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 _t(vt(St.month,n),l);case"LL":return _t(Nt(2,n),l);case"Lo":return _t(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 B9(e,t,n){const r=Ae(e),a=my(r,n)-t;return r.setDate(r.getDate()-a*7),r}class z9 extends Xe{constructor(){super(...arguments);ye(this,"priority",100);ye(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,a){switch(r){case"w":return vt(St.week,n);case"wo":return a.ordinalNumber(n,{unit:"week"});default:return Nt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a,l){return Yn(B9(n,a,l),l)}}function W9(e,t){const n=Ae(e),r=dy(n)-t;return n.setDate(n.getDate()-r*7),n}class U9 extends Xe{constructor(){super(...arguments);ye(this,"priority",100);ye(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 vt(St.week,n);case"Io":return a.ordinalNumber(n,{unit:"week"});default:return Nt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a){return Ts(W9(n,a))}}const H9=[31,28,31,30,31,30,31,31,30,31,30,31],q9=[31,29,31,30,31,30,31,31,30,31,30,31];class K9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(this,"subPriority",1);ye(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"d":return vt(St.date,n);case"do":return a.ordinalNumber(n,{unit:"date"});default:return Nt(r.length,n)}}validate(n,r){const a=n.getFullYear(),l=vS(a),c=n.getMonth();return l?r>=1&&r<=q9[c]:r>=1&&r<=H9[c]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class Y9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(this,"subpriority",1);ye(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 vt(St.dayOfYear,n);case"Do":return a.ordinalNumber(n,{unit:"date"});default:return Nt(r.length,n)}}validate(n,r){const a=n.getFullYear();return vS(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 py(e,t,n){var g,b,y,k;const r=$o(),a=(n==null?void 0:n.weekStartsOn)??((b=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((k=(y=r.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=Ae(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 Gt(l,p)}class Q9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(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=py(n,a,l),n.setHours(0,0,0,0),n}}class G9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,a,l){const c=d=>{const f=Math.floor((d-1)/7)*7;return(d+l.weekStartsOn+6)%7+f};switch(r){case"e":case"ee":return _t(Nt(r.length,n),c);case"eo":return _t(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=py(n,a,l),n.setHours(0,0,0,0),n}}class X9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,a,l){const c=d=>{const f=Math.floor((d-1)/7)*7;return(d+l.weekStartsOn+6)%7+f};switch(r){case"c":case"cc":return _t(Nt(r.length,n),c);case"co":return _t(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=py(n,a,l),n.setHours(0,0,0,0),n}}function Z9(e,t){const n=Ae(e),r=C9(n),a=t-r;return Gt(n,a)}class J9 extends Xe{constructor(){super(...arguments);ye(this,"priority",90);ye(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 Nt(r.length,n);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return _t(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 _t(a.day(n,{width:"narrow",context:"formatting"}),l);case"iiiiii":return _t(a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),l);case"iiii":default:return _t(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=Z9(n,a),n.setHours(0,0,0,0),n}}class e$ extends Xe{constructor(){super(...arguments);ye(this,"priority",80);ye(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(hy(a),0,0,0),n}}class t$ extends Xe{constructor(){super(...arguments);ye(this,"priority",80);ye(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(hy(a),0,0,0),n}}class n$ extends Xe{constructor(){super(...arguments);ye(this,"priority",80);ye(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(hy(a),0,0,0),n}}class r$ extends Xe{constructor(){super(...arguments);ye(this,"priority",70);ye(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,a){switch(r){case"h":return vt(St.hour12h,n);case"ho":return a.ordinalNumber(n,{unit:"hour"});default:return Nt(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 s$ extends Xe{constructor(){super(...arguments);ye(this,"priority",70);ye(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,a){switch(r){case"H":return vt(St.hour23h,n);case"Ho":return a.ordinalNumber(n,{unit:"hour"});default:return Nt(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,a){return n.setHours(a,0,0,0),n}}class o$ extends Xe{constructor(){super(...arguments);ye(this,"priority",70);ye(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,a){switch(r){case"K":return vt(St.hour11h,n);case"Ko":return a.ordinalNumber(n,{unit:"hour"});default:return Nt(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 a$ extends Xe{constructor(){super(...arguments);ye(this,"priority",70);ye(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,a){switch(r){case"k":return vt(St.hour24h,n);case"ko":return a.ordinalNumber(n,{unit:"hour"});default:return Nt(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 i$ extends Xe{constructor(){super(...arguments);ye(this,"priority",60);ye(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"m":return vt(St.minute,n);case"mo":return a.ordinalNumber(n,{unit:"minute"});default:return Nt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setMinutes(a,0,0),n}}class l$ extends Xe{constructor(){super(...arguments);ye(this,"priority",50);ye(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"s":return vt(St.second,n);case"so":return a.ordinalNumber(n,{unit:"second"});default:return Nt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setSeconds(a,0),n}}class c$ extends Xe{constructor(){super(...arguments);ye(this,"priority",30);ye(this,"incompatibleTokens",["t","T"])}parse(n,r){const a=l=>Math.trunc(l*Math.pow(10,-r.length+3));return _t(Nt(r.length,n),a)}set(n,r,a){return n.setMilliseconds(a),n}}class u$ extends Xe{constructor(){super(...arguments);ye(this,"priority",10);ye(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Qr(Yr.basicOptionalMinutes,n);case"XX":return Qr(Yr.basic,n);case"XXXX":return Qr(Yr.basicOptionalSeconds,n);case"XXXXX":return Qr(Yr.extendedOptionalSeconds,n);case"XXX":default:return Qr(Yr.extended,n)}}set(n,r,a){return r.timestampIsSet?n:st(n,n.getTime()-Ao(n)-a)}}class d$ extends Xe{constructor(){super(...arguments);ye(this,"priority",10);ye(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Qr(Yr.basicOptionalMinutes,n);case"xx":return Qr(Yr.basic,n);case"xxxx":return Qr(Yr.basicOptionalSeconds,n);case"xxxxx":return Qr(Yr.extendedOptionalSeconds,n);case"xxx":default:return Qr(Yr.extended,n)}}set(n,r,a){return r.timestampIsSet?n:st(n,n.getTime()-Ao(n)-a)}}class f$ extends Xe{constructor(){super(...arguments);ye(this,"priority",40);ye(this,"incompatibleTokens","*")}parse(n){return xS(n)}set(n,r,a){return[st(n,a*1e3),{timestampIsSet:!0}]}}class m$ extends Xe{constructor(){super(...arguments);ye(this,"priority",20);ye(this,"incompatibleTokens","*")}parse(n){return xS(n)}set(n,r,a){return[st(n,a),{timestampIsSet:!0}]}}const h$={G:new M9,y:new D9,Y:new R9,R:new O9,u:new L9,Q:new I9,q:new F9,M:new $9,L:new V9,w:new z9,I:new U9,d:new K9,D:new Y9,E:new Q9,e:new G9,c:new X9,i:new J9,a:new e$,b:new t$,B:new n$,h:new r$,H:new s$,K:new o$,k:new a$,m:new i$,s:new l$,S:new c$,X:new u$,x:new d$,t:new f$,T:new m$},p$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,g$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x$=/^'([^]*?)'?$/,y$=/''/g,v$=/\S/,b$=/[a-zA-Z]/;function w$(e,t,n,r){var N,w,_,j;const a=N9(),l=a.locale??If,c=a.firstWeekContainsDate??((w=(N=a.locale)==null?void 0:N.options)==null?void 0:w.firstWeekContainsDate)??1,d=a.weekStartsOn??((j=(_=a.locale)==null?void 0:_.options)==null?void 0:j.weekStartsOn)??0,f={firstWeekContainsDate:c,weekStartsOn:d,locale:l},m=[new A9],p=t.match(g$).map(S=>{const E=S[0];if(E in Mg){const P=Mg[E];return P(S,l.formatLong)}return S}).join("").match(p$),g=[];for(let S of p){hS(S)&&Dg(S,t,e),mS(S)&&Dg(S,t,e);const E=S[0],P=h$[E];if(P){const{incompatibleTokens:A}=P;if(Array.isArray(A)){const D=g.find(Y=>A.includes(Y.token)||Y.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 st(n,NaN);m.push(M.setter),e=M.rest}else{if(E.match(b$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");if(S==="''"?S="'":E==="'"&&(S=j$(S)),e.indexOf(S)===0)e=e.slice(S.length);else return st(n,NaN)}}if(e.length>0&&v$.test(e))return st(n,NaN);const b=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=Ae(n);if(isNaN(y.getTime()))return st(n,NaN);const k={};for(const S of b){if(!S.validate(y,f))return st(n,NaN);const E=S.set(y,k,f);Array.isArray(E)?(y=E[0],Object.assign(k,E[1])):y=E}return st(n,y)}function j$(e){return e.match(x$)[1].replace(y$,"'")}function gy(e){return+Ae(e)<Date.now()}function xy(e,t){const n=Ae(e),r=Ae(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function N$(e,t){const n=Ae(e),r=Ae(t);return n.getFullYear()===r.getFullYear()}function xp(e,t){return Gt(e,-t)}function $f(e,t){const r=_$(e);let a;if(r.date){const f=E$(r.date,2);a=P$(f.restDateString,f.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const l=a.getTime();let c=0,d;if(r.time&&(c=T$(r.time),isNaN(c)))return new Date(NaN);if(r.timezone){if(d=A$(r.timezone),isNaN(d))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+d)}const ld={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},C$=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,k$=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,S$=/^([+-])(\d{2})(?::?(\d{2}))?$/;function _$(e){const t={},n=e.split(ld.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],ld.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ld.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=ld.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function E$(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 P$(e,t){if(t===null)return new Date(NaN);const n=e.match(C$);if(!n)return new Date(NaN);const r=!!n[4],a=Bl(n[1]),l=Bl(n[2])-1,c=Bl(n[3]),d=Bl(n[4]),f=Bl(n[5])-1;if(r)return L$(t,d,f)?M$(t,d,f):new Date(NaN);{const m=new Date(0);return!R$(t,l,c)||!O$(t,a)?new Date(NaN):(m.setUTCFullYear(t,l,Math.max(a,c)),m)}}function Bl(e){return e?parseInt(e):1}function T$(e){const t=e.match(k$);if(!t)return NaN;const n=yp(t[1]),r=yp(t[2]),a=yp(t[3]);return I$(n,r,a)?n*iy+r*ay+a*1e3:NaN}function yp(e){return e&&parseFloat(e.replace(",","."))||0}function A$(e){if(e==="Z")return 0;const t=e.match(S$);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return F$(r,a)?n*(r*iy+a*ay):NaN}function M$(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 D$=[31,null,31,30,31,30,31,31,30,31,30,31];function bS(e){return e%400===0||e%4===0&&e%100!==0}function R$(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(D$[t]||(bS(e)?29:28))}function O$(e,t){return t>=1&&t<=(bS(e)?366:365)}function L$(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function I$(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function F$(e,t){return t>=0&&t<=59}function vp(e,t){const n=Ae(e),r=n.getFullYear(),a=n.getDate(),l=st(e,0);l.setFullYear(r,t,15),l.setHours(0,0,0,0);const c=j9(l);return n.setMonth(t,Math.min(a,c)),n}function Q1(e,t){const n=Ae(e);return isNaN(+n)?st(e,NaN):(n.setFullYear(t),n)}var $$=Symbol.for("react.lazy"),tf=lf[" use ".trim().toString()];function V$(e){return typeof e=="object"&&e!==null&&"then"in e}function wS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$$&&"_payload"in e&&V$(e._payload)}function B$(e){const t=W$(e),n=x.forwardRef((r,a)=>{let{children:l,...c}=r;wS(l)&&typeof tf=="function"&&(l=tf(l._payload));const d=x.Children.toArray(l),f=d.find(H$);if(f){const m=f.props.children,p=d.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 z$=B$("Slot");function W$(e){const t=x.forwardRef((n,r)=>{let{children:a,...l}=n;if(wS(a)&&typeof tf=="function"&&(a=tf(a._payload)),x.isValidElement(a)){const c=K$(a),d=q$(l,a.props);return a.type!==x.Fragment&&(d.ref=r?Nr(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U$=Symbol("radix.slottable");function H$(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U$}function q$(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function K$(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 Rg=CN("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"}}),yy=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},l)=>{const c=r?z$:"button";return s.jsx(c,{className:Ie(Rg({variant:t,size:n,className:e})),ref:l,...a})});yy.displayName="Button";var Re=function(){return Re=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},Re.apply(this,arguments)};function Y$(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 jS(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 Mc(e){return e.mode==="multiple"}function Dc(e){return e.mode==="range"}function Vf(e){return e.mode==="single"}var Q$={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 G$(e,t){return Er(e,"LLLL y",t)}function X$(e,t){return Er(e,"d",t)}function Z$(e,t){return Er(e,"LLLL",t)}function J$(e){return"".concat(e)}function eV(e,t){return Er(e,"cccccc",t)}function tV(e,t){return Er(e,"yyyy",t)}var nV=Object.freeze({__proto__:null,formatCaption:G$,formatDay:X$,formatMonthCaption:Z$,formatWeekNumber:J$,formatWeekdayName:eV,formatYearCaption:tV}),rV=function(e,t,n){return Er(e,"do MMMM (EEEE)",n)},sV=function(){return"Month: "},oV=function(){return"Go to next month"},aV=function(){return"Go to previous month"},iV=function(e,t){return Er(e,"cccc",t)},lV=function(e){return"Week n. ".concat(e)},cV=function(){return"Year: "},uV=Object.freeze({__proto__:null,labelDay:rV,labelMonthDropdown:sV,labelNext:oV,labelPrevious:aV,labelWeekNumber:lV,labelWeekday:iV,labelYearDropdown:cV});function dV(){var e="buttons",t=Q$,n=If,r={},a={},l=1,c={},d=new Date;return{captionLayout:e,classNames:t,formatters:nV,labels:uV,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:l,styles:c,today:d,mode:"default"}}function fV(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,l=e.fromDate,c=e.toDate;return r?l=On(r):t&&(l=new Date(t,0,1)),a?c=Lf(a):n&&(c=new Date(n,11,31)),{fromDate:l?Fi(l):void 0,toDate:c?Fi(c):void 0}}var NS=x.createContext(void 0);function mV(e){var t,n=e.initialProps,r=dV(),a=fV(n),l=a.fromDate,c=a.toDate,d=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;d!=="buttons"&&(!l||!c)&&(d="buttons");var f;(Vf(n)||Mc(n)||Dc(n))&&(f=n.onSelect);var m=Re(Re(Re({},r),n),{captionLayout:d,classNames:Re(Re({},r.classNames),n.classNames),components:Re({},n.components),formatters:Re(Re({},r.formatters),n.formatters),fromDate:l,labels:Re(Re({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Re(Re({},r.modifiers),n.modifiers),modifiersClassNames:Re(Re({},r.modifiersClassNames),n.modifiersClassNames),onSelect:f,styles:Re(Re({},r.styles),n.styles),toDate:c});return s.jsx(NS.Provider,{value:m,children:e.children})}function it(){var e=x.useContext(NS);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function CS(e){var t=it(),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 hV(e){return s.jsx("svg",Re({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 kS(e){var t,n,r=e.onChange,a=e.value,l=e.children,c=e.caption,d=e.className,f=e.style,m=it(),p=(n=(t=m.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:hV;return s.jsxs("div",{className:d,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 pV(e){var t,n=it(),r=n.fromDate,a=n.toDate,l=n.styles,c=n.locale,d=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(N$(r,a))for(var b=On(r),y=r.getMonth();y<=a.getMonth();y++)g.push(vp(b,y));else for(var b=On(new Date),y=0;y<=11;y++)g.push(vp(b,y));var k=function(w){var _=Number(w.target.value),j=vp(On(e.displayMonth),_);e.onChange(j)},N=(t=m==null?void 0:m.Dropdown)!==null&&t!==void 0?t:kS;return s.jsx(N,{name:"months","aria-label":p(),className:f.dropdown_month,style:l.dropdown_month,onChange:k,value:e.displayMonth.getMonth(),caption:d(e.displayMonth,{locale:c}),children:g.map(function(w){return s.jsx("option",{value:w.getMonth(),children:d(w,{locale:c})},w.getMonth())})})}function gV(e){var t,n=e.displayMonth,r=it(),a=r.fromDate,l=r.toDate,c=r.locale,d=r.styles,f=r.classNames,m=r.components,p=r.formatters.formatYearCaption,g=r.labels.labelYearDropdown,b=[];if(!a)return s.jsx(s.Fragment,{});if(!l)return s.jsx(s.Fragment,{});for(var y=a.getFullYear(),k=l.getFullYear(),N=y;N<=k;N++)b.push(Q1(uS(new Date),N));var w=function(j){var S=Q1(On(n),Number(j.target.value));e.onChange(S)},_=(t=m==null?void 0:m.Dropdown)!==null&&t!==void 0?t:kS;return s.jsx(_,{name:"years","aria-label":g(),className:f.dropdown_year,style:d.dropdown_year,onChange:w,value:n.getFullYear(),caption:p(n,{locale:c}),children:b.map(function(j){return s.jsx("option",{value:j.getFullYear(),children:p(j,{locale:c})},j.getFullYear())})})}function xV(e,t){var n=x.useState(e),r=n[0],a=n[1],l=t===void 0?r:t;return[l,a]}function yV(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,l=e.toDate,c=e.fromDate,d=e.numberOfMonths,f=d===void 0?1:d;if(l&&$i(l,a)<0){var m=-1*(f-1);a=_r(l,m)}return c&&$i(a,c)<0&&(a=c),On(a)}function vV(){var e=it(),t=yV(e),n=xV(t,e.month),r=n[0],a=n[1],l=function(c){var d;if(!e.disableNavigation){var f=On(c);a(f),(d=e.onMonthChange)===null||d===void 0||d.call(e,f)}};return[r,l]}function bV(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=On(e),l=On(_r(a,r)),c=$i(l,a),d=[],f=0;f<c;f++){var m=_r(a,f);d.push(m)}return n&&(d=d.reverse()),d}function wV(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,d=On(e);if(!n)return _r(d,c);var f=$i(n,e);if(!(f<l))return _r(d,c)}}function jV(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,d=On(e);if(!n)return _r(d,-c);var f=$i(d,n);if(!(f<=0))return _r(d,-c)}}var SS=x.createContext(void 0);function NV(e){var t=it(),n=vV(),r=n[0],a=n[1],l=bV(r,t),c=wV(r,t),d=jV(r,t),f=function(g){return l.some(function(b){return xy(g,b)})},m=function(g,b){f(g)||(b&&Ff(g,b)?a(_r(g,1+t.numberOfMonths*-1)):a(g))},p={currentMonth:r,displayMonths:l,goToMonth:a,goToDate:m,previousMonth:d,nextMonth:c,isDateDisplayed:f};return s.jsx(SS.Provider,{value:p,children:e.children})}function Rc(){var e=x.useContext(SS);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function G1(e){var t,n=it(),r=n.classNames,a=n.styles,l=n.components,c=Rc().goToMonth,d=function(p){c(_r(p,e.displayIndex?-e.displayIndex:0))},f=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:CS,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(pV,{onChange:d,displayMonth:e.displayMonth}),s.jsx(gV,{onChange:d,displayMonth:e.displayMonth})]})}function CV(e){return s.jsx("svg",Re({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 kV(e){return s.jsx("svg",Re({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 nf=x.forwardRef(function(e,t){var n=it(),r=n.classNames,a=n.styles,l=[r.button_reset,r.button];e.className&&l.push(e.className);var c=l.join(" "),d=Re(Re({},a.button_reset),a.button);return e.style&&Object.assign(d,e.style),s.jsx("button",Re({},e,{ref:t,type:"button",className:c,style:d}))});function SV(e){var t,n,r=it(),a=r.dir,l=r.locale,c=r.classNames,d=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 b=m(e.previousMonth,{locale:l}),y=[c.nav_button,c.nav_button_previous].join(" "),k=p(e.nextMonth,{locale:l}),N=[c.nav_button,c.nav_button_next].join(" "),w=(t=g==null?void 0:g.IconRight)!==null&&t!==void 0?t:kV,_=(n=g==null?void 0:g.IconLeft)!==null&&n!==void 0?n:CV;return s.jsxs("div",{className:c.nav,style:d.nav,children:[!e.hidePrevious&&s.jsx(nf,{name:"previous-month","aria-label":b,className:y,style:d.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?s.jsx(w,{className:c.nav_icon,style:d.nav_icon}):s.jsx(_,{className:c.nav_icon,style:d.nav_icon})}),!e.hideNext&&s.jsx(nf,{name:"next-month","aria-label":k,className:N,style:d.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?s.jsx(_,{className:c.nav_icon,style:d.nav_icon}):s.jsx(w,{className:c.nav_icon,style:d.nav_icon})})]})}function X1(e){var t=it().numberOfMonths,n=Rc(),r=n.previousMonth,a=n.nextMonth,l=n.goToMonth,c=n.displayMonths,d=c.findIndex(function(k){return xy(e.displayMonth,k)}),f=d===0,m=d===c.length-1,p=t>1&&(f||!m),g=t>1&&(m||!f),b=function(){r&&l(r)},y=function(){a&&l(a)};return s.jsx(SV,{displayMonth:e.displayMonth,hideNext:p,hidePrevious:g,nextMonth:a,previousMonth:r,onPreviousClick:b,onNextClick:y})}function _V(e){var t,n=it(),r=n.classNames,a=n.disableNavigation,l=n.styles,c=n.captionLayout,d=n.components,f=(t=d==null?void 0:d.CaptionLabel)!==null&&t!==void 0?t:CS,m;return a?m=s.jsx(f,{id:e.id,displayMonth:e.displayMonth}):c==="dropdown"?m=s.jsx(G1,{displayMonth:e.displayMonth,id:e.id}):c==="dropdown-buttons"?m=s.jsxs(s.Fragment,{children:[s.jsx(G1,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(X1,{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(X1,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:l.caption,children:m})}function EV(e){var t=it(),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 PV(e,t,n){for(var r=n?Ts(new Date):Yn(new Date,{locale:e,weekStartsOn:t}),a=[],l=0;l<7;l++){var c=Gt(r,l);a.push(c)}return a}function TV(){var e=it(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,l=e.weekStartsOn,c=e.ISOWeek,d=e.formatters.formatWeekdayName,f=e.labels.labelWeekday,m=PV(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:d(p,{locale:a})},g)})]})}function AV(){var e,t=it(),n=t.classNames,r=t.styles,a=t.components,l=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:TV;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(l,{})})}function MV(e){var t=it(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var vy=x.createContext(void 0);function DV(e){if(!Mc(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(vy.Provider,{value:t,children:e.children})}return s.jsx(RV,{initialProps:e.initialProps,children:e.children})}function RV(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,l=t.max,c=function(m,p,g){var b,y;(b=t.onDayClick)===null||b===void 0||b.call(t,m,p,g);var k=!!(p.selected&&a&&(r==null?void 0:r.length)===a);if(!k){var N=!!(!p.selected&&l&&(r==null?void 0:r.length)===l);if(!N){var w=r?jS([],r):[];if(p.selected){var _=w.findIndex(function(j){return Dn(m,j)});w.splice(_,1)}else w.push(m);(y=t.onSelect)===null||y===void 0||y.call(t,w,m,p,g)}}},d={disabled:[]};r&&d.disabled.push(function(m){var p=l&&r.length>l-1,g=r.some(function(b){return Dn(b,m)});return!!(p&&!g)});var f={selected:r,onDayClick:c,modifiers:d};return s.jsx(vy.Provider,{value:f,children:n})}function by(){var e=x.useContext(vy);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function OV(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?Dn(a,e)&&Dn(r,e)?void 0:Dn(a,e)?{from:a,to:void 0}:Dn(r,e)?void 0:dc(r,e)?{from:e,to:a}:{from:r,to:e}:a?dc(e,a)?{from:a,to:e}:{from:e,to:a}:r?Ff(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var wy=x.createContext(void 0);function LV(e){if(!Dc(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(wy.Provider,{value:t,children:e.children})}return s.jsx(IV,{initialProps:e.initialProps,children:e.children})}function IV(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},l=a.from,c=a.to,d=t.min,f=t.max,m=function(y,k,N){var w,_;(w=t.onDayClick)===null||w===void 0||w.call(t,y,k,N);var j=OV(y,r);(_=t.onSelect)===null||_===void 0||_.call(t,j,y,k,N)},p={range_start:[],range_end:[],range_middle:[],disabled:[]};if(l?(p.range_start=[l],c?(p.range_end=[c],Dn(l,c)||(p.range_middle=[{after:l,before:c}])):p.range_end=[l]):c&&(p.range_start=[c],p.range_end=[c]),d&&(l&&!c&&p.disabled.push({after:xp(l,d-1),before:Gt(l,d-1)}),l&&c&&p.disabled.push({after:l,before:Gt(l,d-1)}),!l&&c&&p.disabled.push({after:xp(c,d-1),before:Gt(c,d-1)})),f){if(l&&!c&&(p.disabled.push({before:Gt(l,-f+1)}),p.disabled.push({after:Gt(l,f-1)})),l&&c){var g=Xr(c,l)+1,b=f-g;p.disabled.push({before:xp(l,b)}),p.disabled.push({after:Gt(c,b)})}!l&&c&&(p.disabled.push({before:Gt(c,-f+1)}),p.disabled.push({after:Gt(c,f-1)}))}return s.jsx(wy.Provider,{value:{selected:r,onDayClick:m,modifiers:p},children:n})}function jy(){var e=x.useContext(wy);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Pd(e){return Array.isArray(e)?jS([],e):e!==void 0?[e]:[]}function FV(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=Pd(a)}),t}var Pr;(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"})(Pr||(Pr={}));var $V=Pr.Selected,xs=Pr.Disabled,VV=Pr.Hidden,BV=Pr.Today,bp=Pr.RangeEnd,wp=Pr.RangeMiddle,jp=Pr.RangeStart,zV=Pr.Outside;function WV(e,t,n){var r,a=(r={},r[$V]=Pd(e.selected),r[xs]=Pd(e.disabled),r[VV]=Pd(e.hidden),r[BV]=[e.today],r[bp]=[],r[wp]=[],r[jp]=[],r[zV]=[],r);return e.fromDate&&a[xs].push({before:e.fromDate}),e.toDate&&a[xs].push({after:e.toDate}),Mc(e)?a[xs]=a[xs].concat(t.modifiers[xs]):Dc(e)&&(a[xs]=a[xs].concat(n.modifiers[xs]),a[jp]=n.modifiers[jp],a[wp]=n.modifiers[wp],a[bp]=n.modifiers[bp]),a}var _S=x.createContext(void 0);function UV(e){var t=it(),n=by(),r=jy(),a=WV(t,n,r),l=FV(t.modifiers),c=Re(Re({},a),l);return s.jsx(_S.Provider,{value:c,children:e.children})}function ES(){var e=x.useContext(_S);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function HV(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function qV(e){return!!(e&&typeof e=="object"&&"from"in e)}function KV(e){return!!(e&&typeof e=="object"&&"after"in e)}function YV(e){return!!(e&&typeof e=="object"&&"before"in e)}function QV(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function GV(e,t){var n,r=t.from,a=t.to;if(r&&a){var l=Xr(a,r)<0;l&&(n=[a,r],r=n[0],a=n[1]);var c=Xr(e,r)>=0&&Xr(a,e)>=0;return c}return a?Dn(a,e):r?Dn(r,e):!1}function XV(e){return ly(e)}function ZV(e){return Array.isArray(e)&&e.every(ly)}function JV(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(XV(n))return Dn(e,n);if(ZV(n))return n.includes(e);if(qV(n))return GV(e,n);if(QV(n))return n.dayOfWeek.includes(e.getDay());if(HV(n)){var r=Xr(n.before,e),a=Xr(n.after,e),l=r>0,c=a<0,d=dc(n.before,n.after);return d?c&&l:l||c}return KV(n)?Xr(e,n.after)>0:YV(n)?Xr(n.before,e)>0:typeof n=="function"?n(e):!1})}function Ny(e,t,n){var r=Object.keys(t).reduce(function(l,c){var d=t[c];return JV(e,d)&&l.push(c),l},[]),a={};return r.forEach(function(l){return a[l]=!0}),n&&!xy(e,n)&&(a.outside=!0),a}function eB(e,t){for(var n=On(e[0]),r=Lf(e[e.length-1]),a,l,c=n;c<=r;){var d=Ny(c,t),f=!d.disabled&&!d.hidden;if(!f){c=Gt(c,1);continue}if(d.selected)return c;d.today&&!l&&(l=c),a||(a=c),c=Gt(c,1)}return l||a}var tB=365;function PS(e,t){var n=t.moveBy,r=t.direction,a=t.context,l=t.modifiers,c=t.retry,d=c===void 0?{count:0,lastFocused:e}:c,f=a.weekStartsOn,m=a.fromDate,p=a.toDate,g=a.locale,b={day:Gt,week:Ag,month:_r,year:v8,startOfWeek:function(w){return a.ISOWeek?Ts(w):Yn(w,{locale:g,weekStartsOn:f})},endOfWeek:function(w){return a.ISOWeek?dS(w):uy(w,{locale:g,weekStartsOn:f})}},y=b[n](e,r==="after"?1:-1);r==="before"&&m?y=b8([m,y]):r==="after"&&p&&(y=w8([p,y]));var k=!0;if(l){var N=Ny(y,l);k=!N.disabled&&!N.hidden}return k?y:d.count>tB?d.lastFocused:PS(y,{moveBy:n,direction:r,context:a,modifiers:l,retry:Re(Re({},d),{count:d.count+1})})}var TS=x.createContext(void 0);function nB(e){var t=Rc(),n=ES(),r=x.useState(),a=r[0],l=r[1],c=x.useState(),d=c[0],f=c[1],m=eB(t.displayMonths,n),p=a??(d&&t.isDateDisplayed(d))?d:m,g=function(){f(a),l(void 0)},b=function(w){l(w)},y=it(),k=function(w,_){if(a){var j=PS(a,{moveBy:w,direction:_,context:y,modifiers:n});Dn(a,j)||(t.goToDate(j,a),b(j))}},N={focusedDay:a,focusTarget:p,blur:g,focus:b,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(TS.Provider,{value:N,children:e.children})}function Cy(){var e=x.useContext(TS);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function rB(e,t){var n=ES(),r=Ny(e,n,t);return r}var ky=x.createContext(void 0);function sB(e){if(!Vf(e.initialProps)){var t={selected:void 0};return s.jsx(ky.Provider,{value:t,children:e.children})}return s.jsx(oB,{initialProps:e.initialProps,children:e.children})}function oB(e){var t=e.initialProps,n=e.children,r=function(l,c,d){var f,m,p;if((f=t.onDayClick)===null||f===void 0||f.call(t,l,c,d),c.selected&&!t.required){(m=t.onSelect)===null||m===void 0||m.call(t,void 0,l,c,d);return}(p=t.onSelect)===null||p===void 0||p.call(t,l,l,c,d)},a={selected:t.selected,onDayClick:r};return s.jsx(ky.Provider,{value:a,children:n})}function AS(){var e=x.useContext(ky);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function aB(e,t){var n=it(),r=AS(),a=by(),l=jy(),c=Cy(),d=c.focusDayAfter,f=c.focusDayBefore,m=c.focusWeekAfter,p=c.focusWeekBefore,g=c.blur,b=c.focus,y=c.focusMonthBefore,k=c.focusMonthAfter,N=c.focusYearBefore,w=c.focusYearAfter,_=c.focusStartOfWeek,j=c.focusEndOfWeek,S=function($){var R,W,Z,V;Vf(n)?(R=r.onDayClick)===null||R===void 0||R.call(r,e,t,$):Mc(n)?(W=a.onDayClick)===null||W===void 0||W.call(a,e,t,$):Dc(n)?(Z=l.onDayClick)===null||Z===void 0||Z.call(l,e,t,$):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,$)},E=function($){var R;b(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,$)},A=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,$)},Y=function($){var R;(R=n.onDayPointerLeave)===null||R===void 0||R.call(n,e,t,$)},q=function($){var R;(R=n.onDayTouchCancel)===null||R===void 0||R.call(n,e,t,$)},F=function($){var R;(R=n.onDayTouchEnd)===null||R===void 0||R.call(n,e,t,$)},B=function($){var R;(R=n.onDayTouchMove)===null||R===void 0||R.call(n,e,t,$)},se=function($){var R;(R=n.onDayTouchStart)===null||R===void 0||R.call(n,e,t,$)},G=function($){var R;(R=n.onDayKeyUp)===null||R===void 0||R.call(n,e,t,$)},L=function($){var R;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?d():f();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?f():d();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),m();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),p();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?N():y();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?w():k();break;case"Home":$.preventDefault(),$.stopPropagation(),_();break;case"End":$.preventDefault(),$.stopPropagation(),j();break}(R=n.onDayKeyDown)===null||R===void 0||R.call(n,e,t,$)},H={onClick:S,onFocus:E,onBlur:P,onKeyDown:L,onKeyUp:G,onMouseEnter:A,onMouseLeave:M,onPointerEnter:D,onPointerLeave:Y,onTouchCancel:q,onTouchEnd:F,onTouchMove:B,onTouchStart:se};return H}function iB(){var e=it(),t=AS(),n=by(),r=jy(),a=Vf(e)?t.selected:Mc(e)?n.selected:Dc(e)?r.selected:void 0;return a}function lB(e){return Object.values(Pr).includes(e)}function cB(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(lB(r)){var l=e.classNames["day_".concat(r)];l&&n.push(l)}}),n}function uB(e,t){var n=Re({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=Re(Re({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function dB(e,t,n){var r,a,l,c=it(),d=Cy(),f=rB(e,t),m=aB(e,f),p=iB(),g=!!(c.onDayClick||c.mode!=="default");x.useEffect(function(){var A;f.outside||d.focusedDay&&g&&Dn(d.focusedDay,e)&&((A=n.current)===null||A===void 0||A.focus())},[d.focusedDay,e,n,g,f.outside]);var b=cB(c,f).join(" "),y=uB(c,f),k=!!(f.outside&&!c.showOutsideDays||f.hidden),N=(l=(a=c.components)===null||a===void 0?void 0:a.DayContent)!==null&&l!==void 0?l:MV,w=s.jsx(N,{date:e,displayMonth:t,activeModifiers:f}),_={style:y,className:b,children:w,role:"gridcell"},j=d.focusTarget&&Dn(d.focusTarget,e)&&!f.outside,S=d.focusedDay&&Dn(d.focusedDay,e),E=Re(Re(Re({},_),(r={disabled:f.disabled,role:"gridcell"},r["aria-selected"]=f.selected,r.tabIndex=S||j?0:-1,r)),m),P={isButton:g,isHidden:k,activeModifiers:f,selectedDays:p,buttonProps:E,divProps:_};return P}function fB(e){var t=x.useRef(null),n=dB(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(nf,Re({name:"day",ref:t},n.buttonProps)):s.jsx("div",Re({},n.divProps))}function mB(e){var t=e.number,n=e.dates,r=it(),a=r.onWeekNumberClick,l=r.styles,c=r.classNames,d=r.locale,f=r.labels.labelWeekNumber,m=r.formatters.formatWeekNumber,p=m(Number(t),{locale:d});if(!a)return s.jsx("span",{className:c.weeknumber,style:l.weeknumber,children:p});var g=f(Number(t),{locale:d}),b=function(y){a(t,n,y)};return s.jsx(nf,{name:"week-number","aria-label":g,className:c.weeknumber,style:l.weeknumber,onClick:b,children:p})}function hB(e){var t,n,r=it(),a=r.styles,l=r.classNames,c=r.showWeekNumber,d=r.components,f=(t=d==null?void 0:d.Day)!==null&&t!==void 0?t:fB,m=(n=d==null?void 0:d.WeekNumber)!==null&&n!==void 0?n:mB,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})},k9(g))})]})}function Z1(e,t,n){for(var r=n!=null&&n.ISOWeek?dS(t):uy(t,n),a=n!=null&&n.ISOWeek?Ts(e):Yn(e,n),l=Xr(r,a),c=[],d=0;d<=l;d++)c.push(Gt(a,d));var f=c.reduce(function(m,p){var g=n!=null&&n.ISOWeek?dy(p):my(p,n),b=m.find(function(y){return y.weekNumber===g});return b?(b.dates.push(p),m):(m.push({weekNumber:g,dates:[p]}),m)},[]);return f}function pB(e,t){var n=Z1(On(e),Lf(e),t);if(t!=null&&t.useFixedWeeks){var r=_9(e,t);if(r<6){var a=n[n.length-1],l=a.dates[a.dates.length-1],c=Ag(l,6-r),d=Z1(Ag(l,1),c,t);n.push.apply(n,d)}}return n}function gB(e){var t,n,r,a=it(),l=a.locale,c=a.classNames,d=a.styles,f=a.hideHead,m=a.fixedWeeks,p=a.components,g=a.weekStartsOn,b=a.firstWeekContainsDate,y=a.ISOWeek,k=pB(e.displayMonth,{useFixedWeeks:!!m,ISOWeek:y,locale:l,weekStartsOn:g,firstWeekContainsDate:b}),N=(t=p==null?void 0:p.Head)!==null&&t!==void 0?t:AV,w=(n=p==null?void 0:p.Row)!==null&&n!==void 0?n:hB,_=(r=p==null?void 0:p.Footer)!==null&&r!==void 0?r:EV;return s.jsxs("table",{id:e.id,className:c.table,style:d.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!f&&s.jsx(N,{}),s.jsx("tbody",{className:c.tbody,style:d.tbody,children:k.map(function(j){return s.jsx(w,{displayMonth:e.displayMonth,dates:j.dates,weekNumber:j.weekNumber},j.weekNumber)})}),s.jsx(_,{displayMonth:e.displayMonth})]})}function xB(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var yB=xB()?x.useLayoutEffect:x.useEffect,Np=!1,vB=0;function J1(){return"react-day-picker-".concat(++vB)}function bB(e){var t,n=e??(Np?J1():null),r=x.useState(n),a=r[0],l=r[1];return yB(function(){a===null&&l(J1())},[]),x.useEffect(function(){Np===!1&&(Np=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function wB(e){var t,n,r=it(),a=r.dir,l=r.classNames,c=r.styles,d=r.components,f=Rc().displayMonths,m=bB(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],b=c.month,y=e.displayIndex===0,k=e.displayIndex===f.length-1,N=!y&&!k;a==="rtl"&&(t=[y,k],k=t[0],y=t[1]),y&&(g.push(l.caption_start),b=Re(Re({},b),c.caption_start)),k&&(g.push(l.caption_end),b=Re(Re({},b),c.caption_end)),N&&(g.push(l.caption_between),b=Re(Re({},b),c.caption_between));var w=(n=d==null?void 0:d.Caption)!==null&&n!==void 0?n:_V;return s.jsxs("div",{className:g.join(" "),style:b,children:[s.jsx(w,{id:m,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(gB,{id:p,"aria-labelledby":m,displayMonth:e.displayMonth})]},e.displayIndex)}function jB(e){var t=it(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}function NB(e){var t,n,r=e.initialProps,a=it(),l=Cy(),c=Rc(),d=x.useState(!1),f=d[0],m=d[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=Re(Re({},a.styles.root),a.style),b=Object.keys(r).filter(function(k){return k.startsWith("data-")}).reduce(function(k,N){var w;return Re(Re({},k),(w={},w[N]=r[N],w))},{}),y=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:jB;return s.jsx("div",Re({className:p.join(" "),style:g,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},b,{children:s.jsx(y,{children:c.displayMonths.map(function(k,N){return s.jsx(wB,{displayIndex:N,displayMonth:k},N)})})}))}function CB(e){var t=e.children,n=Y$(e,["children"]);return s.jsx(mV,{initialProps:n,children:s.jsx(NV,{children:s.jsx(sB,{initialProps:n,children:s.jsx(DV,{initialProps:n,children:s.jsx(LV,{initialProps:n,children:s.jsx(UV,{children:s.jsx(nB,{children:t})})})})})})})}function kB(e){return s.jsx(CB,Re({},e,{children:s.jsx(NB,{initialProps:e})}))}function Sy({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(kB,{showOutsideDays:n,className:Ie("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:Ie(Rg({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:Ie(Rg({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(Lo,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(ka,{className:"h-4 w-4"})},...r})}Sy.displayName="Calendar";function SB(e){const t=_B(e),n=x.forwardRef((r,a)=>{const{children:l,...c}=r,d=x.Children.toArray(l),f=d.find(PB);if(f){const m=f.props.children,p=d.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 _B(e){const t=x.forwardRef((n,r)=>{const{children:a,...l}=n;if(x.isValidElement(a)){const c=AB(a),d=TB(l,a.props);return a.type!==x.Fragment&&(d.ref=r?Nr(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EB=Symbol("radix.slottable");function PB(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EB}function TB(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]=(...d)=>{const f=l(...d);return a(...d),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...l}:r==="className"&&(n[r]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function AB(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 Bf="Popover",[MS]=Ro(Bf,[bf]),Oc=bf(),[MB,Vo]=MS(Bf),DS=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:l,modal:c=!1}=e,d=Oc(t),f=x.useRef(null),[m,p]=x.useState(!1),[g,b]=bc({prop:r,defaultProp:a??!1,onChange:l,caller:Bf});return s.jsx(rM,{...d,children:s.jsx(MB,{scope:t,contentId:Zr(),triggerRef:f,open:g,onOpenChange:b,onOpenToggle:x.useCallback(()=>b(y=>!y),[b]),hasCustomAnchor:m,onCustomAnchorAdd:x.useCallback(()=>p(!0),[]),onCustomAnchorRemove:x.useCallback(()=>p(!1),[]),modal:c,children:n})})};DS.displayName=Bf;var RS="PopoverAnchor",DB=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vo(RS,n),l=Oc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=a;return x.useEffect(()=>(c(),()=>d()),[c,d]),s.jsx(hx,{...l,...r,ref:t})});DB.displayName=RS;var OS="PopoverTrigger",LS=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vo(OS,n),l=Oc(n),c=Pt(t,a.triggerRef),d=s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":BS(a.open),...r,ref:c,onClick:Qe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?d:s.jsx(hx,{asChild:!0,...l,children:d})});LS.displayName=OS;var _y="PopoverPortal",[RB,OB]=MS(_y,{forceMount:void 0}),IS=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,l=Vo(_y,t);return s.jsx(RB,{scope:t,forceMount:n,children:s.jsx(As,{present:n||l.open,children:s.jsx(df,{asChild:!0,container:a,children:r})})})};IS.displayName=_y;var Vi="PopoverContent",FS=x.forwardRef((e,t)=>{const n=OB(Vi,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,l=Vo(Vi,e.__scopePopover);return s.jsx(As,{present:r||l.open,children:l.modal?s.jsx(IB,{...a,ref:t}):s.jsx(FB,{...a,ref:t})})});FS.displayName=Vi;var LB=SB("PopoverContent.RemoveScroll"),IB=x.forwardRef((e,t)=>{const n=Vo(Vi,e.__scopePopover),r=x.useRef(null),a=Pt(t,r),l=x.useRef(!1);return x.useEffect(()=>{const c=r.current;if(c)return z2(c)},[]),s.jsx(ey,{as:LB,allowPinchZoom:!0,children:s.jsx($S,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qe(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Qe(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Qe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),FB=x.forwardRef((e,t)=>{const n=Vo(Vi,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return s.jsx($S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.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()}})}),$S=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,...g}=e,b=Vo(Vi,n),y=Oc(n);return D2(),s.jsx(Jx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:l,children:s.jsx(vc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>b.onOpenChange(!1),children:s.jsx(bC,{"data-state":BS(b.open),role:"dialog",id:b.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)"}})})})}),VS="PopoverClose",$B=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vo(VS,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Qe(e.onClick,()=>a.onOpenChange(!1))})});$B.displayName=VS;var VB="PopoverArrow",BB=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Oc(n);return s.jsx(wC,{...a,...r,ref:t})});BB.displayName=VB;function BS(e){return e?"open":"closed"}var zB=DS,WB=LS,UB=IS,zS=FS;const rf=zB,sf=WB,fc=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(UB,{children:s.jsx(zS,{ref:a,align:t,sideOffset:n,className:Ie("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})}));fc.displayName=zS.displayName;function sn({value:e,onChange:t,placeholder:n="Pick a date",disabled:r=!1,required:a=!1,minDate:l,maxDate:c,size:d="default",className:f}){const[m,p]=x.useState(!1),g=x.useMemo(()=>{if(!e)return;const w=w$(e,"yyyy-MM-dd",new Date);return cy(w)?w:void 0},[e]),b=x.useCallback(w=>!!(l&&Ff(w,l)||c&&dc(w,c)),[l,c]),y=w=>{t(w?Er(w,"yyyy-MM-dd"):""),p(!1)},k=w=>{w.stopPropagation(),t("")},N=d==="sm";return s.jsxs(rf,{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:Ie("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",N?"h-8 px-2 text-xs":"h-10 px-3 text-sm",f),children:[s.jsx(jc,{className:Ie("shrink-0 text-muted-foreground",N?"h-3.5 w-3.5":"h-4 w-4")}),s.jsx("span",{className:Ie("flex-1 text-left",!g&&"text-muted-foreground"),children:g?Er(g,"MMM d, yyyy"):n}),g&&!a&&s.jsx(Ln,{onClick:k,"aria-label":"Clear date",className:Ie("shrink-0 text-muted-foreground hover:text-foreground",N?"h-3 w-3":"h-3.5 w-3.5")})]})}),s.jsx(fc,{className:"w-auto p-0 rounded-xl shadow-xl",align:"start",children:s.jsx(Sy,{mode:"single",selected:g,onSelect:y,disabled:b,showOutsideDays:!1,initialFocus:!0})})]})}const HB=Array.from({length:12},(e,t)=>t+1),qB=[0,5,10,15,20,25,30,35,40,45,50,55];function KB({value:e,onChange:t,placeholder:n="Pick date & time",disabled:r=!1,required:a=!1,minDate:l,maxDate:c,size:d="default",className:f}){const[m,p]=x.useState(!1),g=x.useMemo(()=>{if(!e)return;const M=new Date(e);return cy(M)?M:void 0},[e]),b=M=>{t(Er(M,"yyyy-MM-dd'T'HH:mm:00"))},y=(g==null?void 0:g.getHours())??12,k=y%12||12,N=(g==null?void 0:g.getMinutes())??0,w=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),b(D)},j=(M,D)=>{const Y=g?new Date(g):(()=>{const q=new Date;return q.setSeconds(0,0),q})();if(M==="hour"){const q=parseInt(D,10);Y.setHours(w==="PM"?q===12?12:q+12:q===12?0:q)}else if(M==="minute")Y.setMinutes(parseInt(D,10));else{const q=Y.getHours();D==="AM"&&q>=12&&Y.setHours(q-12),D==="PM"&&q<12&&Y.setHours(q+12)}b(Y)},S=x.useCallback(M=>!!(l&&Ff(M,l)||c&&dc(M,c)),[l,c]),E=g?Er(g,"MMM d, yyyy 'at' h:mm a"):null,P=d==="sm",A="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(rf,{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:Ie("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(jc,{className:Ie("shrink-0 text-muted-foreground",P?"h-3.5 w-3.5":"h-4 w-4")}),s.jsx("span",{className:Ie("flex-1 text-left",!g&&"text-muted-foreground"),children:E??n}),g&&!a&&s.jsx(Ln,{onClick:M=>{M.stopPropagation(),t("")},"aria-label":"Clear date and time",className:Ie("shrink-0 text-muted-foreground hover:text-foreground",P?"h-3 w-3":"h-3.5 w-3.5")})]})}),s.jsxs(fc,{className:"w-auto p-0 rounded-xl shadow-xl",align:"start",children:[s.jsx(Sy,{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=>j("hour",M.target.value),className:A,children:HB.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:N,onChange:M=>j("minute",M.target.value),className:A,children:qB.map(M=>s.jsx("option",{value:M,children:String(M).padStart(2,"0")},M))}),s.jsxs("select",{value:w,onChange:M=>j("ampm",M.target.value),className:A,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(yy,{size:"sm",className:"w-full",onClick:()=>p(!1),children:"Done"})})]})]})}const wo={contact:"Contact",opportunity:"Opportunity","use-case":"Use Case",activity:"Activity",account:"Account",assignment:"Assignment"},ej={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 YB(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 d=e.match(/(?:at|from|company|works at|with)\s+([A-Z][^\.,\n]+)/i);if(d&&(r.company=d[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(b=>n.includes(b.replace("_"," "))||n.includes(b));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(b=>n.includes(b));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 QB({type:e,onClose:t}){const[n,r]=x.useState([{role:"assistant",content:ej[e]??ej.contact}]),[a,l]=x.useState(""),[c,d]=x.useState(!1),[f,m]=x.useState(null),[p,g]=x.useState(!1),[b,y]=x.useState(!1),k=x.useRef(null),N=x.useRef(null),w=y2(),_=v2(),j=b2(),S=w2(),E=j2(),P=P2();x.useEffect(()=>{var F;(F=k.current)==null||F.scrollTo({top:k.current.scrollHeight,behavior:"smooth"})},[n]),x.useEffect(()=>{var F;(F=N.current)==null||F.focus()},[]);const A=()=>{if(!a.trim()||c)return;const F=a.trim();l(""),r(G=>[...G,{role:"user",content:F}]);const B=YB(F,e);m(G=>({...G??{},...B}));const se=Object.entries({...f??{},...B}).filter(([,G])=>G!==void 0&&G!=="").map(([G,L])=>`• **${G}**: ${L}`).join(`
|
|
543
|
+
`);r(G=>[...G,{role:"assistant",content:se?`Got it! Here's what I'll create:
|
|
544
|
+
|
|
545
|
+
${se}
|
|
546
|
+
|
|
547
|
+
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)){d(!0);try{e==="contact"?await w.mutateAsync(f):e==="account"?await _.mutateAsync(f):e==="opportunity"?await j.mutateAsync(f):e==="use-case"?await S.mutateAsync(f):e==="activity"?await E.mutateAsync(f):e==="assignment"&&await P.mutateAsync(f),g(!0),he({title:`${wo[e]} created!`,description:"Successfully added to your CRM."}),setTimeout(t,1200)}catch(F){he({title:`Failed to create ${wo[e]}`,description:F instanceof Error?F.message:"Please try again.",variant:"destructive"})}finally{d(!1)}}},D=n[n.length-1],Y=(D==null?void 0:D.role)==="assistant"&&D.content.includes("Does this look right")&&f!==null&&!p,q=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),a.toLowerCase().trim()==="yes"||a.toLowerCase().trim()==="confirm"?M():A())};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(xn,{className:"w-4 h-4 text-accent"}),s.jsxs("span",{className:"font-display font-bold text-foreground",children:["New ",wo[e]]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>y(!b),className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border transition-colors ${b?"border-border bg-muted text-foreground":"border-border/60 text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[s.jsx(Pa,{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(Ln,{className:"w-4 h-4 text-muted-foreground"})})]})]}),b?s.jsx(WS,{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((F,B)=>s.jsx("div",{className:`flex ${F.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 ${F.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:F.content})},B)),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(Jg,{className:"w-4 h-4"})," Created successfully!"]})})]}),Y&&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 ${wo[e]}`})}),s.jsxs("div",{className:"flex items-end gap-2 p-3 border-t border-border",children:[s.jsx("textarea",{ref:N,value:a,onChange:F=>l(F.target.value),onKeyDown:q,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():A()},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(nx,{className:"w-4 h-4"})})]})]})]})}const tj={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"}]},GB=[{value:"",label:"None (no link)"},{value:"contact",label:"Contact"},{value:"account",label:"Account"},{value:"opportunity",label:"Opportunity"},{value:"use_case",label:"Use Case"}];function XB({subjectType:e,value:t,onChange:n}){const{data:r}=x2(e==="contact"?{limit:100}:void 0),{data:a}=Pf(e==="account"?{limit:100}:void 0),{data:l}=Tc(e==="opportunity"?{limit:100}:void 0),{data:c}=Hx(e==="use_case"?{limit:100}:void 0),d="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:`${d} 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 ZB({value:e,onChange:t}){const{data:n}=Af({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 WS({type:e,onClose:t,onBack:n,backLabel:r}){const[a,l]=x.useState({}),[c,d]=x.useState(!1),{data:f}=Pf({limit:200}),m=(f==null?void 0:f.data)??[],p=y2(),g=v2(),b=b2(),y=w2(),k=j2(),N=P2(),w=tj[e]??tj.contact,_=()=>{var A,M,D,Y,q;return e==="contact"?!!((A=a.first_name)!=null&&A.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"?!!((Y=a.title)!=null&&Y.trim())&&!!a.assignment_type&&!!a.assigned_to:!!((q=a.name)!=null&&q.trim())},j=(A,M)=>l(D=>({...D,[A]:M})),S=async()=>{if(!(!_()||c)){d(!0);try{const A={...a};e==="contact"&&delete A.name,e==="opportunity"&&(a.amount&&(A.amount=parseFloat(a.amount)||0),A.stage="prospecting"),e==="use-case"&&(A.stage||(A.stage="discovery"),a.attributed_arr&&(A.attributed_arr=parseFloat(a.attributed_arr)||0)),e==="account"&&a.website&&(A.website=a.website.startsWith("http")?a.website:`https://${a.website}`),e==="activity"&&(a.occurred_at&&(A.occurred_at=new Date(a.occurred_at).toISOString()),a.subject_type||(delete A.subject_type,delete A.subject_id),a.subject_id||delete A.subject_id,a.outcome||delete A.outcome,a.occurred_at||delete A.occurred_at),e==="assignment"&&(a.due_at&&(A.due_at=new Date(a.due_at+"T00:00:00").toISOString()),a.subject_type||(delete A.subject_type,delete A.subject_id),a.subject_id||delete A.subject_id,a.context||delete A.context,a.description||delete A.description,a.due_at||delete A.due_at,a.priority||(A.priority="normal")),e==="contact"?await p.mutateAsync(A):e==="account"?await g.mutateAsync(A):e==="opportunity"?await b.mutateAsync(A):e==="use-case"?await y.mutateAsync(A):e==="activity"?await k.mutateAsync(A):e==="assignment"&&await N.mutateAsync(A);const M=a.first_name??a.title??a.name??a.subject??wo[e];he({title:`${wo[e]} created`,description:`${M} has been added.`}),t()}catch(A){he({title:`Failed to create ${wo[e]}`,description:A instanceof Error?A.message:"Please try again.",variant:"destructive"})}finally{d(!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=A=>{if(!A.dependsOn)return!0;const M=a[A.dependsOn.key];return M?A.dependsOn.values?A.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(xn,{className:"w-3 h-3"})," ",r]}):s.jsxs(s.Fragment,{children:[s.jsx(Lo,{className:"w-3.5 h-3.5"})," Back"]})}),s.jsxs("div",{className:"space-y-4",children:[w.filter(P).map(A=>{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:[A.label,A.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),A.fieldType==="select"?s.jsxs("select",{value:a[A.key]||"",onChange:D=>j(A.key,D.target.value),className:`${E} pr-3`,children:[s.jsxs("option",{value:"",children:["Select ",A.label.toLowerCase(),"…"]}),(M=A.options)==null?void 0:M.map(D=>s.jsx("option",{value:D,children:D.replace(/_/g," ").replace(/\b\w/g,Y=>Y.toUpperCase())},D))]}):A.fieldType==="account-select"?s.jsxs("select",{value:a[A.key]||"",onChange:D=>j(A.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))]}):A.fieldType==="subject-type-select"?s.jsx("select",{value:a[A.key]||"",onChange:D=>{j(A.key,D.target.value),j("subject_id","")},className:`${E} pr-3`,children:GB.map(D=>s.jsx("option",{value:D.value,children:D.label},D.value))}):A.fieldType==="entity-select"?s.jsx(XB,{subjectType:a.subject_type||"",value:a[A.key]||"",onChange:D=>j(A.key,D)}):A.fieldType==="actor-select"?s.jsx(ZB,{value:a[A.key]||"",onChange:D=>j(A.key,D)}):A.fieldType==="datalist"?s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"text",value:a[A.key]||"",onChange:D=>j(A.key,D.target.value),placeholder:A.placeholder,list:A.datalistId,className:`${E} pr-3`}),A.datalistId&&A.suggestions&&s.jsx("datalist",{id:A.datalistId,children:A.suggestions.map(D=>s.jsx("option",{value:D},D))})]}):A.fieldType==="textarea"?s.jsx("textarea",{value:a[A.key]||"",onChange:D=>j(A.key,D.target.value),placeholder:A.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"}):A.inputType==="date"?s.jsx(sn,{value:a[A.key]||"",onChange:D=>j(A.key,D),required:A.required}):A.inputType==="datetime-local"?s.jsx(KB,{value:a[A.key]||"",onChange:D=>j(A.key,D),required:A.required}):s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:A.inputType??"text",value:a[A.key]||"",onChange:D=>j(A.key,D.target.value),placeholder:A.placeholder,className:`${E} pr-8`}),s.jsx(ns,{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"})]})]},A.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 ${wo[e]}`})]})]})}function JB(){const{quickAddType:e,closeQuickAdd:t}=Je(),{enabled:n}=ar();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(QB,{type:e,onClose:t}):s.jsx(WS,{type:e,onClose:t,onBack:t})})]}):null}const Bi={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"}},Ns={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 mc({stage:e}){const t=Bi[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 e7({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 t7(){return s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-success animate-pulse-dot"})}function US(e){switch(e){case"call":return s.jsx(oc,{className:"w-3.5 h-3.5"});case"email":return s.jsx(FN,{className:"w-3.5 h-3.5"});case"meeting":return s.jsx(hi,{className:"w-3.5 h-3.5"});case"task":return s.jsx(s4,{className:"w-3.5 h-3.5"});case"demo":return s.jsx(t4,{className:"w-3.5 h-3.5"});case"proposal":return s.jsx(Pa,{className:"w-3.5 h-3.5"});case"research":return s.jsx(Cc,{className:"w-3.5 h-3.5"});case"handoff":return s.jsx(FT,{className:"w-3.5 h-3.5"});case"status_update":return s.jsx(Ca,{className:"w-3.5 h-3.5"});case"stage_change":return s.jsx(n4,{className:"w-3.5 h-3.5"});case"health_update":return s.jsx(hf,{className:"w-3.5 h-3.5"});default:return s.jsx(VN,{className:"w-3.5 h-3.5"})}}const n7={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 r7({outcome:e}){const t=n7[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 s7={contact:"Contact",account:"Account",opportunity:"Opp",use_case:"Use Case"},o7={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};function HS({limit:e,activities:t,filterWindow:n}){const{openDrawer:r}=Je(),a=n?100:e??20,{data:l,isLoading:c}=qx(t?void 0:{limit:a});let d=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),d=d.filter(p=>{const g=p.occurred_at??p.created_at??p.timestamp;return g?new Date(g)>=m:!1})}const f=e?d.slice(0,e):d;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??"",b=m.occurred_at??m.created_at??m.timestamp??"",y=m.contact_id,k=m.subject_type&&m.subject_id,N=k||y,w=()=>{if(k){const j=o7[m.subject_type];j&&r(j,m.subject_id)}else y&&r("contact",y)},_=[];return m.performer_name?_.push(m.performer_name):p&&_.push(p),b&&_.push(new Date(b).toLocaleDateString()),s.jsxs("div",{className:`flex gap-3 py-2 ${N?"cursor-pointer hover:bg-muted/40 rounded-xl px-2 -mx-2 transition-colors":""}`,onClick:N?w: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:US(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(r7,{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:s7[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(Oo,{className:"w-2.5 h-2.5"}):s.jsx(pf,{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 a7(){const[e,t]=x.useState("opportunities"),{data:n}=Tc({limit:200}),{data:r}=Hx({limit:200}),a=(n==null?void 0:n.data)??[],l=(r==null?void 0:r.data)??[],c=["prospecting","qualification","proposal","negotiation","closed_won","closed_lost"],d=["discovery","poc","production","scaling","sunset"],f=c.map(y=>{const k=a.filter(w=>w.stage===y),N=Bi[y]??{label:y,color:"#94a3b8"};return{key:y,label:N.label,color:N.color,count:k.length,total:k.reduce((w,_)=>w+(parseFloat(String(_.amount??0))||0),0)}}),m=d.map(y=>{const k=l.filter(w=>w.stage===y),N=Ns[y]??{label:y,color:"#94a3b8"};return{key:y,label:N.label,color:N.color,count:k.length,total:k.reduce((w,_)=>w+(parseFloat(String(_.attributed_arr??0))||0),0)}}),p=e==="opportunities"?f:m,g=Math.max(...p.map(y=>y.total),1),b=y=>!isFinite(y)||isNaN(y)||y<=0?"$0":y>=1e12?`$${(y/1e12).toFixed(1)}T`:y>=1e9?`$${y>=1e10?Math.round(y/1e9):(y/1e9).toFixed(1)}B`:y>=1e6?`$${y>=1e7?Math.round(y/1e6):(y/1e6).toFixed(1)}M`:y>=1e3?`$${y>=1e4?Math.round(y/1e3):(y/1e3).toFixed(1)}K`:`$${Math.round(y)}`;return 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.jsx("h3",{className:"font-display font-bold text-foreground",children:"Pipeline health"}),s.jsxs("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:[s.jsx("button",{onClick:()=>t("opportunities"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${e==="opportunities"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Opps"}),s.jsx("button",{onClick:()=>t("use-cases"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${e==="use-cases"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Use Cases"})]})]}),s.jsx("div",{className:"flex gap-3 overflow-x-auto no-scrollbar md:hidden pb-1 -mx-1 px-1",children:p.map(y=>s.jsxs("div",{className:"flex-shrink-0 w-28 rounded-xl p-3 border border-border",style:{backgroundColor:y.color+"08"},children:[s.jsx("div",{className:"w-3 h-3 rounded-full mb-2",style:{backgroundColor:y.color}}),s.jsx("p",{className:"text-[10px] text-muted-foreground font-medium truncate",children:y.label}),s.jsx("p",{className:"text-lg font-display font-bold text-foreground",children:y.count}),s.jsx("p",{className:"text-[10px] text-muted-foreground font-mono truncate",children:b(y.total)})]},y.key))}),s.jsx("div",{className:"hidden md:block space-y-3",children:p.map(y=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs w-24 flex-shrink-0 truncate font-medium",style:{color:y.color},children:y.label}),s.jsx("div",{className:"flex-1 min-w-0 h-2.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${y.total/g*100}%`,backgroundColor:y.color}})}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono w-6 flex-shrink-0 text-right",children:y.count}),s.jsx("span",{className:"text-xs text-foreground font-mono w-[4.5rem] flex-shrink-0 text-right truncate",children:b(y.total)})]},y.key))})]})}function i7(){const{data:e}=Pf({limit:200}),t=(e==null?void 0:e.data)??[],n=t.filter(d=>(d.health_score??0)>=80),r=t.filter(d=>{const f=d.health_score??0;return f>=50&&f<80}),a=t.filter(d=>(d.health_score??0)<50),l=t.length,c=[{label:"Healthy",count:n.length,color:"hsl(152, 55%, 42%)"},{label:"At Risk",count:r.length,color:"hsl(38, 92%, 50%)"},{label:"Critical",count:a.length,color:"hsl(var(--destructive))"}];return 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:"Account health"}),s.jsx("div",{className:"flex gap-3 overflow-x-auto no-scrollbar md:hidden pb-1 -mx-1 px-1",children:c.map(d=>s.jsxs("div",{className:"flex-shrink-0 w-28 rounded-xl p-3 border border-border",style:{backgroundColor:d.color+"08"},children:[s.jsx("div",{className:"w-3 h-3 rounded-full mb-2",style:{backgroundColor:d.color}}),s.jsx("p",{className:"text-[10px] text-muted-foreground font-medium truncate",children:d.label}),s.jsx("p",{className:"text-lg font-display font-bold text-foreground",children:d.count}),s.jsxs("p",{className:"text-[10px] text-muted-foreground font-mono",children:[l>0?Math.round(d.count/l*100):0,"%"]})]},d.label))}),s.jsx("div",{className:"hidden md:block space-y-3",children:c.map(d=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs w-28 truncate font-medium",style:{color:d.color},children:d.label}),s.jsx("div",{className:"flex-1 h-2.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:l>0?`${d.count/l*100}%`:"0%",backgroundColor:d.color}})}),s.jsx("span",{className:"text-xs text-foreground font-mono",children:d.count})]},d.label))})]})}function l7(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 zf({objectType:e,values:t}){const[n,r]=x.useState(!1),{data:a}=Xi(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(ss,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Ar,{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 d=t==null?void 0:t[c.field_key],f=d!=null&&d!=="";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?l7(c.field_type,d):"—"})]},c.field_key)})})]})}const nj={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))"},c7={contact:"contact",account:"account",opportunity:"opportunity",use_case:"use-case"};function qS({activities:e,emptyMessage:t="No activity yet."}){const{openDrawer:n}=Je();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??"",d=r.subject_type&&r.subject_id,f=d||!!r.contact_id,m=()=>{if(d){const p=c7[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:US(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:(nj[r.outcome]??"hsl(var(--muted-foreground))")+"18",color:nj[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(Oo,{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 u7={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 Wf({subjectType:e,subjectId:t}){const[n,r]=x.useState(!0),[a,l]=x.useState(null),{data:c,isLoading:d}=mF({subject_type:e,subject_id:t,is_current:!0,limit:50}),{data:f}=pF({subject_type:e,subject_id:t,limit:10}),m=hF(),p=(c==null?void 0:c.data)??[],g=(f==null?void 0:f.data)??[],b=p.reduce((w,_)=>{const j=_.context_type??"note";return w[j]||(w[j]=[]),w[j].push(_),w},{}),y=Object.keys(b).sort(),k=a?b[a]??[]:p,N=async w=>{await m.mutateAsync(w),he({title:"Context entry reviewed"})};return d?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(_N,{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(Di,{className:"w-3 h-3"})," ",g.length," stale"]}),n?s.jsx(ss,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Ar,{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(w=>s.jsxs("button",{onClick:()=>l(a===w?null:w),className:`px-2 py-0.5 rounded-md text-[10px] font-semibold transition-all ${a===w?"bg-primary/15 text-primary":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[w.replace(/_/g," "),s.jsx("span",{className:"ml-1 opacity-50",children:b[w].length})]},w))]}),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(w=>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:w.title??w.context_type}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Expired ",w.valid_until?new Date(w.valid_until).toLocaleDateString():""]})]}),s.jsxs("button",{onClick:()=>N(w.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(Cr,{className:"w-3 h-3"})," Review"]})]},w.id))]}),k.map(w=>{const _=u7[w.context_type]??"#94a3b8",j=w.valid_until&&new Date(w.valid_until)<new Date;return s.jsxs("div",{className:`rounded-xl border p-3 space-y-1.5 ${j?"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:w.context_type.replace(/_/g," ")}),w.confidence!=null&&s.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[Math.round(w.confidence*100),"%"]}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(w.created_at).toLocaleDateString()})]}),w.title&&s.jsx("p",{className:"text-sm font-medium text-foreground",children:w.title}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:w.body}),w.tags&&w.tags.length>0&&s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[s.jsx(o4,{className:"w-2.5 h-2.5 text-muted-foreground"}),w.tags.map(S=>s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-muted text-[10px] text-muted-foreground",children:S},S))]}),w.source&&s.jsxs("p",{className:"text-[10px] text-muted-foreground/60",children:["Source: ",w.source]})]},w.id)})]})]})}function Uf({subjectType:e,subjectId:t,onClose:n}){var m,p,g;const[r,a]=x.useState(!0),{data:l,isLoading:c,error:d}=xF(e,t,{format:"json",include_stale:r});if(c)return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Cp,{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(d)return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Cp,{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(Cp,{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(cd,{icon:s.jsx(Di,{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(b=>s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx(Di,{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:b.title??b.context_type}),s.jsxs("span",{className:"text-muted-foreground ml-1.5",children:["expired ",b.valid_until?new Date(b.valid_until).toLocaleDateString():""]})]})]},b.id))})}),((p=f==null?void 0:f.activities)==null?void 0:p.length)>0&&s.jsx(cd,{icon:s.jsx(Ca,{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(b=>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(b.occurred_at??b.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:(b.type??b.activity_type??"").replace(/_/g," ")}),s.jsx("span",{className:"text-foreground truncate",children:b.description??b.body??""})]},b.id))})}),((g=f==null?void 0:f.open_assignments)==null?void 0:g.length)>0&&s.jsx(cd,{icon:s.jsx(Fd,{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(b=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx(d7,{status:b.status}),s.jsx("span",{className:"text-foreground flex-1 truncate",children:b.title}),s.jsx(f7,{priority:b.priority})]},b.id))})}),(f==null?void 0:f.context_entries)&&Object.keys(f.context_entries).length>0&&s.jsx(cd,{icon:s.jsx(_N,{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(([b,y])=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:b.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))})]},b))})}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:b=>a(b.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 Cp({onClose:e}){return s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-border",children:[s.jsx(Pa,{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(Ln,{className:"w-4 h-4 text-muted-foreground"})})]})}function cd({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(ss,{className:"w-3.5 h-3.5 text-muted-foreground"}):s.jsx(Ar,{className:"w-3.5 h-3.5 text-muted-foreground"})]}),a&&s.jsx("div",{className:"px-3 pb-3",children:n})]})}function d7({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 f7({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 ro="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",na="text-xs font-mono text-muted-foreground uppercase tracking-wider",m7=["lead","qualified","opportunity","customer","churned"];function h7({contact:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[d,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 j={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))j[S]=String(E??"");return j}),{data:g}=Tf(),b=(g==null?void 0:g.data)??[],{data:y}=Xi("contact"),k=(y==null?void 0:y.fields)??[],N=(j,S)=>f(E=>({...E,[j]:S})),w=(j,S)=>p(E=>({...E,[j]:S})),_=()=>{const j={};for(const[E,P]of Object.entries(d))P!==""&&(j[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&&(j.custom_fields=S),t(j)};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(Lo,{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:na,children:["First Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:d.first_name,onChange:j=>N("first_name",j.target.value),placeholder:"First name",className:ro})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:na,children:"Last Name"}),s.jsx("input",{type:"text",value:d.last_name,onChange:j=>N("last_name",j.target.value),placeholder:"Last name",className:ro})]})]}),[{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(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:na,children:j.label}),s.jsx("input",{type:j.type,value:d[j.key],onChange:S=>N(j.key,S.target.value),placeholder:j.placeholder,className:ro})]},j.key)),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:na,children:"Stage"}),s.jsx("select",{value:d.lifecycle_stage,onChange:j=>N("lifecycle_stage",j.target.value),className:`${ro} pr-3`,children:m7.map(j=>s.jsx("option",{value:j,children:j.charAt(0).toUpperCase()+j.slice(1)},j))})]}),b.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:na,children:"Owner"}),s.jsxs("select",{value:d.owner_id,onChange:j=>N("owner_id",j.target.value),className:`${ro} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),b.map(j=>s.jsx("option",{value:j.id,children:j.name||j.email},j.id))]})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border pt-2",children:s.jsx("p",{className:na,children:"Custom Fields"})}),k.map(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:na,children:[j.label,j.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(j.field_type==="text"||!j.field_type)&&s.jsx("input",{type:"text",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:ro}),j.field_type==="number"&&s.jsx("input",{type:"number",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:ro}),j.field_type==="date"&&s.jsx(sn,{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S),required:j.required}),j.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[j.field_key]==="true",onChange:S=>w(j.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"})]}),(j.field_type==="select"||j.field_type==="multi_select")&&s.jsxs("select",{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:`${ro} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(j.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},j.field_key))]}),s.jsx("button",{onClick:_,disabled:!d.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(Ss,{className:"w-3.5 h-3.5"})," Delete Contact"]})]})]})}function p7(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=Je(),{enabled:r}=ar(),a=yn(),[l,c]=x.useState(!1),[d,f]=x.useState(!1),[m,p]=x.useState(!1),[g,b]=x.useState(""),y=x.useRef(null),{data:k,isLoading:N}=RI(e??""),{data:w}=qx({contact_id:e??void 0,limit:20}),_=(w==null?void 0:w.data)??[],{data:j}=oF({object_type:"contact",object_id:e??""}),S=(j==null?void 0:j.data)??[],E=aF(),P=OI(e??""),A=LI(e??"");if(N)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||"",Y=M.company_name??"",q=M.lifecycle_stage??"",F=M.lead_score??0;return d?s.jsx(Uf,{subjectType:"contact",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(h7,{contact:M,onSave:async B=>{try{await P.mutateAsync(B),c(!1),he({title:"Contact updated"})}catch(se){he({title:"Failed to update contact",description:se instanceof Error?se.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await A.mutateAsync(),n(),he({title:"Contact deleted"})}catch(B){he({title:"Failed to delete contact",description:B instanceof Error?B.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(Ps,{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}),Y&&s.jsx("p",{className:"text-sm text-muted-foreground",children:Y}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[q&&s.jsx(mc,{stage:q}),F>0&&s.jsx(e7,{score:F})]})]})]}),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(oc,{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(FN,{className:"w-3.5 h-3.5"})," Email"]}),s.jsxs("button",{onClick:()=>{p(B=>!B),setTimeout(()=>{var B;return(B=y.current)==null?void 0:B.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(VN,{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(ns,{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(Pa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"contact",id:M.id,name:D,detail:Y}),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(xn,{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:B=>b(B.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),b("")},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()}),b(""),p(!1),he({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(nx,{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(B=>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:[B.pinned&&s.jsx(e4,{className:"w-3 h-3 text-accent"}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(B.created_at).toLocaleDateString()})]}),s.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:B.body}),B.author_type&&s.jsx("p",{className:"text-[10px] text-muted-foreground capitalize",children:B.author_type==="agent"?"AI Agent":B.author_type})]},B.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:Y},{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(B=>B.value).map(B=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:B.label}),s.jsx("span",{className:"text-sm text-foreground",children:B.value})]},B.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(B=>s.jsx("span",{className:"px-2.5 py-1 rounded-lg bg-muted text-xs text-muted-foreground font-medium",children:B},B))})]}),s.jsx(zf,{objectType:"contact",values:M.custom_fields??{}}),s.jsx(Wf,{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(qS,{activities:_})]})]})}const ra="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",sa="text-xs font-mono text-muted-foreground uppercase tracking-wider",g7=["prospecting","qualification","proposal","negotiation","closed_won","closed_lost"];function x7({opportunity:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[d,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 j={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))j[S]=String(E??"");return j}),{data:g}=Tf(),b=(g==null?void 0:g.data)??[],{data:y}=Xi("opportunity"),k=(y==null?void 0:y.fields)??[],N=(j,S)=>f(E=>({...E,[j]:S})),w=(j,S)=>p(E=>({...E,[j]:S})),_=()=>{const j={};for(const[E,P]of Object.entries(d))P!==""&&(E==="amount"||E==="probability"?j[E]=Number(P)||0:j[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&&(j.custom_fields=S),t(j)};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(Lo,{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:sa,children:["Opportunity Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:d.name,onChange:j=>N("name",j.target.value),placeholder:"e.g. Acme Enterprise",className:ra})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:sa,children:"Stage"}),s.jsx("select",{value:d.stage,onChange:j=>N("stage",j.target.value),className:`${ra} pr-3`,children:g7.map(j=>s.jsx("option",{value:j,children:j.replace(/_/g," ").replace(/\b\w/g,S=>S.toUpperCase())},j))})]}),[{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(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:sa,children:j.label}),j.type==="date"?s.jsx(sn,{value:d[j.key]??"",onChange:S=>N(j.key,S),placeholder:"Select close date"}):s.jsx("input",{type:j.type,value:d[j.key],onChange:S=>N(j.key,S.target.value),placeholder:j.placeholder,className:ra})]},j.key)),b.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:sa,children:"Owner"}),s.jsxs("select",{value:d.owner_id,onChange:j=>N("owner_id",j.target.value),className:`${ra} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),b.map(j=>s.jsx("option",{value:j.id,children:j.name||j.email},j.id))]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:sa,children:"Description"}),s.jsx("textarea",{value:d.description,onChange:j=>N("description",j.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:sa,children:"Custom Fields"})}),k.map(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:sa,children:[j.label,j.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(j.field_type==="text"||!j.field_type)&&s.jsx("input",{type:"text",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:ra}),j.field_type==="number"&&s.jsx("input",{type:"number",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:ra}),j.field_type==="date"&&s.jsx(sn,{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S),required:j.required}),j.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[j.field_key]==="true",onChange:S=>w(j.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"})]}),(j.field_type==="select"||j.field_type==="multi_select")&&s.jsxs("select",{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:`${ra} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(j.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},j.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:!d.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(Ss,{className:"w-3.5 h-3.5"})," Delete Opportunity"]})]})]})}function y7(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=Je(),{enabled:r}=ar(),a=yn(),[l,c]=x.useState(!1),[d,f]=x.useState(!1),{data:m,isLoading:p}=VI(e??""),g=BI(e??""),b=zI(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??"",N=y.amount??0,w=y.stage??"",_=y.probability??0,j=y.forecast_cat??"",S=y.close_date?new Date(y.close_date).toLocaleDateString():"—";return d?s.jsx(Uf,{subjectType:"opportunity",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(x7,{opportunity:y,onSave:async E=>{try{await g.mutateAsync(E),c(!1),he({title:"Opportunity updated"})}catch(P){he({title:"Failed to update opportunity",description:P instanceof Error?P.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await b.mutateAsync(),n(),he({title:"Opportunity deleted"})}catch(E){he({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:["$",N>=1e3?`${(N/1e3).toFixed(0)}K`:N]}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[w&&s.jsx(mc,{stage:w}),_>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(ns,{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(Pa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"opportunity",id:y.id,name:k,detail:`$${(N/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(xn,{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:zN,label:"Probability",value:`${_}%`},{icon:jc,label:"Close Date",value:S},{icon:pf,label:"Forecast",value:j||"—"}].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:w},{label:"Forecast",value:j||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(zf,{objectType:"opportunity",values:y.custom_fields??{}}),s.jsx(Wf,{subjectType:"opportunity",subjectId:e})]})}const Pn="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",Yt="text-xs font-mono text-muted-foreground uppercase tracking-wider",v7=["discovery","poc","production","scaling","sunset"];function b7({stage:e}){const t=Ns[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 w7({useCase:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[d,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[A,M]of Object.entries(e.custom_fields))P[A]=String(M??"");return P}),{data:g}=Tf(),b=(g==null?void 0:g.data)??[],{data:y}=Tc({limit:200}),k=(y==null?void 0:y.data)??[],{data:N}=Xi("use_case"),w=(N==null?void 0:N.fields)??[],_=(P,A)=>f(M=>({...M,[P]:A})),j=(P,A)=>p(M=>({...M,[P]:A})),S=()=>{const P={},A=["attributed_arr","expansion_potential","consumption_capacity"];for(const[Y,q]of Object.entries(d))Y!=="tags"&&q!==""&&(A.includes(Y)?P[Y]=Number(q)||0:P[Y]=q);const M=d.tags.trim();P.tags=M?M.split(",").map(Y=>Y.trim()).filter(Boolean):[];const D={};for(const Y of w){const q=m[Y.field_key]??"";q!==""&&(Y.field_type==="number"?D[Y.field_key]=Number(q):Y.field_type==="boolean"?D[Y.field_key]=q==="true":D[Y.field_key]=q)}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:Yt,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(Lo,{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:Yt,children:["Name",s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:"text",value:d.name,onChange:P=>_("name",P.target.value),placeholder:"Use case name",className:Pn})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Stage"}),s.jsx("select",{value:d.stage,onChange:P=>_("stage",P.target.value),className:`${Pn} pr-3`,children:v7.map(P=>{var A;return s.jsx("option",{value:P,children:((A=Ns[P])==null?void 0:A.label)??P},P)})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Description"}),s.jsx("textarea",{value:d.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:Yt,children:["Tags ",s.jsx("span",{className:"normal-case font-normal",children:"(comma-separated)"})]}),s.jsx("input",{type:"text",value:d.tags,onChange:P=>_("tags",P.target.value),placeholder:"e.g. ai, billing, high-priority",className:Pn})]}),E("Commercial"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Attributed ARR ($)"}),s.jsx("input",{type:"number",value:d.attributed_arr,onChange:P=>_("attributed_arr",P.target.value),placeholder:"e.g. 120000",className:Pn})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Expansion Potential ($)"}),s.jsx("input",{type:"number",value:d.expansion_potential,onChange:P=>_("expansion_potential",P.target.value),placeholder:"e.g. 50000",className:Pn})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Currency"}),s.jsx("input",{type:"text",value:d.currency_code,onChange:P=>_("currency_code",P.target.value.toUpperCase().slice(0,3)),placeholder:"USD",maxLength:3,className:Pn})]}),E("Consumption"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Unit Label"}),s.jsx("input",{type:"text",value:d.unit_label,onChange:P=>_("unit_label",P.target.value),placeholder:"e.g. API calls, seats, documents",className:Pn})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Consumption Unit"}),s.jsx("input",{type:"text",value:d.consumption_unit,onChange:P=>_("consumption_unit",P.target.value),placeholder:"e.g. calls/month",className:Pn})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Consumption Capacity"}),s.jsx("input",{type:"number",value:d.consumption_capacity,onChange:P=>_("consumption_capacity",P.target.value),placeholder:"e.g. 10000",className:Pn})]}),E("Timeline"),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Start Date"}),s.jsx(sn,{value:d.started_at,onChange:P=>_("started_at",P),placeholder:"Select start date"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Production Date"}),s.jsx(sn,{value:d.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:Yt,children:"Sunset Date"}),s.jsx(sn,{value:d.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:Yt,children:"Linked Opportunity"}),s.jsxs("select",{value:d.opportunity_id,onChange:P=>_("opportunity_id",P.target.value),className:`${Pn} pr-3`,children:[s.jsx("option",{value:"",children:"None"}),k.map(P=>s.jsx("option",{value:P.id,children:P.name},P.id))]})]}),b.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:Yt,children:"Owner"}),s.jsxs("select",{value:d.owner_id,onChange:P=>_("owner_id",P.target.value),className:`${Pn} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),b.map(P=>s.jsx("option",{value:P.id,children:P.name||P.email},P.id))]})]}),w.length>0&&s.jsxs(s.Fragment,{children:[E("Custom Fields"),w.map(P=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:Yt,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:A=>j(P.field_key,A.target.value),className:Pn}),P.field_type==="number"&&s.jsx("input",{type:"number",value:m[P.field_key]??"",onChange:A=>j(P.field_key,A.target.value),className:Pn}),P.field_type==="date"&&s.jsx(sn,{value:m[P.field_key]??"",onChange:A=>j(P.field_key,A),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:A=>j(P.field_key,A.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:A=>j(P.field_key,A.target.value),className:`${Pn} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(P.options??[]).map(A=>s.jsx("option",{value:A,children:A},A))]})]},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:!d.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(Ss,{className:"w-3.5 h-3.5"})," Delete Use Case"]})]})]})}function j7(){var E,P;const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=Je(),{enabled:r}=ar(),a=yn(),[l,c]=x.useState(!1),[d,f]=x.useState(!1),{data:m,isLoading:p}=WI(e??""),{data:g}=qI(e??""),b=UI(e??""),y=HI(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,N=k.name??"",w=k.stage??"",_=k.attributed_arr??0,j=k.health_score??0,S=(g==null?void 0:g.data)??g??[];return d?s.jsx(Uf,{subjectType:"use_case",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(w7,{useCase:k,onSave:async A=>{try{await b.mutateAsync(A),c(!1),he({title:"Use case updated"})}catch(M){he({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(),he({title:"Use case deleted"})}catch(A){he({title:"Failed to delete use case",description:A instanceof Error?A.message:"Please try again.",variant:"destructive"})}},isSaving:b.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:N}),s.jsx("div",{className:"flex items-center gap-2 mt-3",children:w&&s.jsx(b7,{stage:w})}),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(ns,{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(Pa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"use-case",id:k.id,name:N,detail:w}),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(xn,{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:ex,label:"Attributed ARR",value:_?`$${(_/1e3).toFixed(0)}K`:"—"},{icon:jc,label:"Stage",value:(((E=Ns[w])==null?void 0:E.label)??w)||"—"},{icon:Oo,label:"Health",value:j?String(j):"—"}].map(A=>s.jsxs("div",{className:"bg-muted/50 rounded-xl p-3 text-center",children:[s.jsx(A.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:A.value}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:A.label})]},A.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=Ns[w])==null?void 0:P.label)??w},{label:"Health Score",value:j?String(j):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(A=>A.value).map(A=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:A.label}),s.jsx("span",{className:"text-sm text-foreground",children:A.value})]},A.label))]}),s.jsx(zf,{objectType:"use_case",values:k.custom_fields??{}}),s.jsx(Wf,{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(qS,{activities:S})]})]})}const zl="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",ud="text-xs font-mono text-muted-foreground uppercase tracking-wider";function N7({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(hf,{className:"w-3 h-3"})," ",e]})}function C7(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e}`}function k7({account:e,onSave:t,onCancel:n,onDelete:r,isSaving:a}){const[l,c]=x.useState(!1),[d,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 j={};if(e.custom_fields)for(const[S,E]of Object.entries(e.custom_fields))j[S]=String(E??"");return j}),{data:g}=Tf(),b=(g==null?void 0:g.data)??[],{data:y}=Xi("account"),k=(y==null?void 0:y.fields)??[],N=(j,S)=>f(E=>({...E,[j]:S})),w=(j,S)=>p(E=>({...E,[j]:S})),_=()=>{const j={};for(const[E,P]of Object.entries(d))P!==""&&(E==="employee_count"||E==="annual_revenue"||E==="health_score"?j[E]=Number(P)||0:j[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&&(j.custom_fields=S),t(j)};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(Lo,{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(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:ud,children:[j.label,j.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),s.jsx("input",{type:j.type,value:d[j.key],onChange:S=>N(j.key,S.target.value),placeholder:j.placeholder,className:zl})]},j.key)),b.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:ud,children:"Owner"}),s.jsxs("select",{value:d.owner_id,onChange:j=>N("owner_id",j.target.value),className:`${zl} pr-3`,children:[s.jsx("option",{value:"",children:"Unassigned"}),b.map(j=>s.jsx("option",{value:j.id,children:j.name||j.email},j.id))]})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-border pt-2",children:s.jsx("p",{className:ud,children:"Custom Fields"})}),k.map(j=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:ud,children:[j.label,j.required&&s.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),(j.field_type==="text"||!j.field_type)&&s.jsx("input",{type:"text",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:zl}),j.field_type==="number"&&s.jsx("input",{type:"number",value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:zl}),j.field_type==="date"&&s.jsx(sn,{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S),required:j.required}),j.field_type==="boolean"&&s.jsxs("div",{className:"flex items-center gap-2 h-10",children:[s.jsx("input",{type:"checkbox",checked:m[j.field_key]==="true",onChange:S=>w(j.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"})]}),(j.field_type==="select"||j.field_type==="multi_select")&&s.jsxs("select",{value:m[j.field_key]??"",onChange:S=>w(j.field_key,S.target.value),className:`${zl} pr-3`,children:[s.jsx("option",{value:"",children:"Select…"}),(j.options??[]).map(S=>s.jsx("option",{value:S,children:S},S))]})]},j.field_key))]}),s.jsx("button",{onClick:_,disabled:!d.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(Ss,{className:"w-3.5 h-3.5"})," Delete Account"]})]})]})}function S7(){const{drawerEntityId:e,openAIWithContext:t,closeDrawer:n}=Je(),{enabled:r}=ar(),a=yn(),[l,c]=x.useState(!1),[d,f]=x.useState(!1),{data:m,isLoading:p}=II(e??""),g=FI(e??""),b=$I(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??"",N=y.industry??"",w=y.website??"",_=y.annual_revenue??0,j=y.employee_count??0,S=y.health_score??0;return d?s.jsx(Uf,{subjectType:"account",subjectId:e,onClose:()=>f(!1)}):l?s.jsx(k7,{account:y,onSave:async E=>{try{await g.mutateAsync(E),c(!1),he({title:"Account updated"})}catch(P){he({title:"Failed to update account",description:P instanceof Error?P.message:"Please try again.",variant:"destructive"})}},onCancel:()=>c(!1),onDelete:async()=>{try{await b.mutateAsync(),n(),he({title:"Account deleted"})}catch(E){he({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(Ps,{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}),N&&s.jsx("p",{className:"text-sm text-muted-foreground",children:N}),s.jsx("div",{className:"flex items-center gap-2 mt-2",children:S>0&&s.jsx(N7,{score:S})})]})]}),s.jsxs("div",{className:"flex gap-2 mt-4",children:[w&&s.jsxs("a",{href:w.startsWith("http")?w:`https://${w}`,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(RN,{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(ns,{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(Pa,{className:"w-3.5 h-3.5"})," Brief"]}),r&&s.jsxs("button",{onClick:()=>{t({type:"account",id:y.id,name:k,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(xn,{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:ex,label:"Revenue",value:_?C7(_):"—"},{icon:ko,label:"Employees",value:j?String(j):"—"},{icon:hf,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:N},{label:"Website",value:w},{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(zf,{objectType:"account",values:y.custom_fields??{}}),s.jsx(Wf,{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 oa="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",so="text-xs font-mono text-muted-foreground uppercase tracking-wider",_7={pending:"#f59e0b",accepted:"#3b82f6",in_progress:"#8b5cf6",blocked:"#ef4444",completed:"#22c55e",declined:"#94a3b8",cancelled:"#94a3b8"},E7={urgent:"#ef4444",high:"#f97316",normal:"#3b82f6",low:"#94a3b8"},P7=["call","draft","email","follow_up","research","review","send"],T7=["urgent","high","normal","low"],A7=["contact","account","opportunity","use_case"];function rj({id:e}){const{data:t}=cF(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 M7({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})),d=()=>{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(Lo,{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:so,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:oa})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:so,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:`${oa} pr-3`,children:[s.jsx("option",{value:"",children:"Select type…"}),P7.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:so,children:"Priority"}),s.jsx("select",{value:a.priority,onChange:f=>c("priority",f.target.value),className:`${oa} pr-3`,children:T7.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:so,children:"Due Date"}),s.jsx(sn,{value:a.due_at,onChange:f=>c("due_at",f)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:so,children:"Linked To"}),s.jsxs("select",{value:a.subject_type,onChange:f=>{c("subject_type",f.target.value),c("subject_id","")},className:`${oa} pr-3`,children:[s.jsx("option",{value:"",children:"None (no link)"}),A7.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:so,children:"Subject ID"}),s.jsx("input",{type:"text",value:a.subject_id,onChange:f=>c("subject_id",f.target.value),placeholder:"Record ID",className:oa})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:so,children:"Context"}),s.jsx("textarea",{value:a.context,onChange:f=>c("context",f.target.value),placeholder:"Brief context for the assignee",rows:3,className:`${oa} h-auto py-2 resize-none`})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:so,children:"Description"}),s.jsx("textarea",{value:a.description,onChange:f=>c("description",f.target.value),placeholder:"Additional details",rows:3,className:`${oa} h-auto py-2 resize-none`})]}),s.jsx("button",{onClick:d,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 D7(){const{drawerEntityId:e,openDrawer:t,closeDrawer:n}=Je(),[r,a]=x.useState(!1),{data:l,isLoading:c}=dF(e??""),d=fF(e??""),f=Kx(),m=Gx(),p=Yx(),g=Qx(),b=Xx(),y=Zx(),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 b.mutateAsync({id:e});break;case"cancel":await y.mutateAsync({id:e});break}he({title:`Assignment ${P}ed`})}catch(A){he({title:`Failed to ${P} assignment`,description:A instanceof Error?A.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 N=l==null?void 0:l.assignment;if(!N)return s.jsx("div",{className:"p-4 text-muted-foreground",children:"Assignment not found"});if(r)return s.jsx(M7,{assignment:N,onSave:async P=>{try{await d.mutateAsync(P),a(!1),he({title:"Assignment updated"})}catch(A){he({title:"Failed to update assignment",description:A instanceof Error?A.message:"Please try again.",variant:"destructive"})}},onCancel:()=>a(!1),isSaving:d.isPending});const w=_7[N.status]??"#94a3b8",_=E7[N.priority]??"#94a3b8",j=N.due_at&&new Date(N.due_at)<new Date&&!["completed","declined","cancelled"].includes(N.status),S=[];switch(N.status){case"pending":S.push({label:"Accept",action:"accept",icon:s.jsx(Cr,{className:"w-3.5 h-3.5"})}),S.push({label:"Decline",action:"decline",icon:s.jsx(Ai,{className:"w-3.5 h-3.5"}),variant:"muted"});break;case"accepted":S.push({label:"Start",action:"start",icon:s.jsx(Mi,{className:"w-3.5 h-3.5"})}),S.push({label:"Block",action:"block",icon:s.jsx(gd,{className:"w-3.5 h-3.5"}),variant:"warning"});break;case"in_progress":S.push({label:"Complete",action:"complete",icon:s.jsx(Cr,{className:"w-3.5 h-3.5"})}),S.push({label:"Block",action:"block",icon:s.jsx(gd,{className:"w-3.5 h-3.5"}),variant:"warning"});break;case"blocked":S.push({label:"Resume",action:"start",icon:s.jsx(Mi,{className:"w-3.5 h-3.5"})}),S.push({label:"Cancel",action:"cancel",icon:s.jsx(Xp,{className:"w-3.5 h-3.5"}),variant:"destructive"});break}["completed","declined","cancelled","blocked"].includes(N.status)||S.find(P=>P.action==="cancel")||S.push({label:"Cancel",action:"cancel",icon:s.jsx(Xp,{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(Fd,{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:w+"18",color:w},children:N.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:N.priority})]}),s.jsx("h2",{className:"font-display font-extrabold text-xl text-foreground leading-snug",children:N.title}),N.assignment_type&&s.jsx("span",{className:"text-xs text-muted-foreground capitalize mt-1 inline-block",children:N.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(ns,{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(rj,{id:N.assigned_to})]}),N.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(rj,{id:N.assigned_by})]}),N.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 ${j?"text-destructive font-medium":"text-foreground"}`,children:[j&&s.jsx(gd,{className:"w-3.5 h-3.5"}),new Date(N.due_at).toLocaleDateString()]})]}),N.subject_type&&E[N.subject_type]&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground capitalize",children:["Linked ",N.subject_type.replace(/_/g," ")]}),s.jsx("button",{onClick:()=>{t(E[N.subject_type],N.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(N.created_at).toLocaleDateString()})]})]}),N.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:N.context})]}),N.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:N.description})]})]})}function R7(){const e=yn(),t=or(),{setCommandPaletteOpen:n,openDrawer:r,setShortcutsOpen:a,toggleZenMode:l,openQuickAdd:c}=Je(),d=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}Je.getState().closeDrawer(),Je.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=b=>{window.removeEventListener("keydown",g),b.key==="h"?e("/"):b.key==="c"?e("/contacts"):b.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",d),()=>window.removeEventListener("keydown",d)),[d])}function KS(){const{darkVariant:e}=Je(),[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 O7(){const e=or(),t=yn(),{enabled:n}=ar();return e.pathname==="/agent"?null:s.jsx(Rn,{children:n&&s.jsxs(Ve.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(Ve.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(xn,{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(AN,{className:"w-2.5 h-2.5"}),"J"]})]})})}const Kl=x.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Ie("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}));Kl.displayName="Input";const YS=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));YS.displayName="Card";const QS=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ie("flex flex-col space-y-1.5 p-6",e),...t}));QS.displayName="CardHeader";const GS=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));GS.displayName="CardTitle";const XS=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Ie("text-sm text-muted-foreground",e),...t}));XS.displayName="CardDescription";const ZS=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ie("p-6 pt-0",e),...t}));ZS.displayName="CardContent";const L7=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ie("flex items-center p-6 pt-0",e),...t}));L7.displayName="CardFooter";const JS=[{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 sj(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function oj(e){return JS.every(t=>t.test(e))}const I7={"--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%"},F7={"--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 $7(){const e=yn(),{darkVariant:t}=Je(),n=t==="charcoal",[r,a]=x.useState("login"),[l,c]=x.useState(""),[d,f]=x.useState(""),[m,p]=x.useState(""),[g,b]=x.useState(""),[y,k]=x.useState(""),[N,w]=x.useState(!1),[_,j]=x.useState({}),[S,E]=x.useState(()=>document.documentElement.classList.contains("dark")),P=()=>{const H=!S;E(H),document.documentElement.classList.toggle("dark",H),localStorage.setItem("crmy_theme",H?"dark":"light")};if(localStorage.getItem("crmy_token"))return s.jsx(Ld,{to:"/",replace:!0});const A=H=>j($=>({...$,[H]:!0})),M=_.email&&!sj(l)?"Enter a valid email address":"",D=_.password&&r==="register"&&!oj(d)?"Password does not meet requirements":_.password&&!d?"Password is required":"",Y=_.name&&r==="register"&&!m.trim()?"Name is required":"",q=_.tenantName&&r==="register"&&!g.trim()?"Organization name is required":"",F=async H=>{if(H.preventDefault(),j({email:!0,password:!0,name:!0,tenantName:!0}),!!sj(l)&&d&&!(r==="register"&&(!oj(d)||!m.trim()||!g.trim()))){k(""),w(!0);try{const $=r==="login"?await P1.login(l,d):await P1.register({email:l,password:d,name:m,tenant_name:g});MI($.token),DI($.user),e("/")}catch($){k($ instanceof Error?$.message:"Authentication failed")}finally{w(!1)}}},B=H=>{a(H),j({}),k("")},se=S?"bg-background":n?"bg-[hsl(220_20%_93%)]":"bg-[hsl(30_25%_93%)]",G=n?"dark charcoal":"dark",L=S?void 0:n?I7:F7;return s.jsxs("div",{className:`flex min-h-screen items-center justify-center p-4 ${se}`,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(BN,{className:"w-5 h-5"}):s.jsx($N,{className:"w-5 h-5"})}),s.jsx("div",{className:`${G} w-full max-w-md`,style:L,children:s.jsxs(YS,{className:"w-full",children:[s.jsxs(QS,{className:"text-left",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[s.jsx("img",{src:T2,alt:"CRMy",className:"h-14 w-14 object-contain"}),s.jsx(GS,{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:()=>B("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(Ln,{className:"w-5 h-5"})})]}),r==="register"&&s.jsx(XS,{className:"text-center",children:"Set up a new tenant and admin account"})]}),s.jsxs(ZS,{children:[s.jsxs("form",{onSubmit:F,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(Kl,{value:m,onChange:H=>p(H.target.value),onBlur:()=>A("name"),"aria-invalid":!!Y}),Y&&s.jsx("p",{className:"mt-1 text-xs text-destructive",children:Y})]}),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(Kl,{value:g,onChange:H=>b(H.target.value),onBlur:()=>A("tenantName"),"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:["Email ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(Kl,{type:"email",value:l,onChange:H=>c(H.target.value),onBlur:()=>A("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(Kl,{type:"password",value:d,onChange:H=>f(H.target.value),onBlur:()=>A("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:JS.map(H=>{const $=H.test(d);return s.jsxs("li",{className:`flex items-center gap-1.5 text-xs ${$?"text-success":"text-muted-foreground"}`,children:[s.jsx(Jg,{className:`w-3 h-3 ${$?"opacity-100":"opacity-30"}`}),H.label]},H.label)})})]}),y&&s.jsx("p",{className:"text-sm text-destructive",children:y}),s.jsx(yy,{type:"submit",className:"w-full",disabled:N,children:N?"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:()=>B("register"),children:"Register"})]}):s.jsxs(s.Fragment,{children:["Already have an account?"," ",s.jsx("button",{className:"text-primary hover:underline",onClick:()=>B("login"),children:"Sign in"})]})})]})]})})]})}function Ds({title:e,children:t}){const{setCommandPaletteOpen:n}=Je(),{theme:r,toggle:a}=KS(),l=yn(),c=()=>{g2(),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(BN,{className:"w-4 h-4"}):s.jsx($N,{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(Cc,{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(AN,{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(GT,{className:"w-4 h-4"})})]})]})}function V7(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}function B7(){const{openDrawer:e,openQuickAdd:t}=Je(),[n,r]=x.useState("today"),{data:a}=Tc({limit:10}),c=((a==null?void 0:a.data)??[]).filter(d=>d.stage==="negotiation"||d.stage==="proposal"&&d.probability>50).slice(0,3);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{title:"Dashboard"}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 pb-24 md:pb-6",children:[s.jsxs(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"mb-6",children:[s.jsx("h1",{className:"text-2xl md:text-3xl font-display font-extrabold",children:s.jsx("span",{className:"gradient-text",children:V7()})}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Here's what needs your attention today."})]}),s.jsx(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.05},className:"grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-3 mb-6",children:[{icon:a4,label:"New Contact",gradient:"from-primary/15 to-primary/5",color:"text-primary",action:()=>t("contact")},{icon:zN,label:"New Opportunity",gradient:"from-accent/15 to-accent/5",color:"text-accent",action:()=>t("opportunity")},{icon:$d,label:"New Use Case",gradient:"from-success/15 to-success/5",color:"text-success",action:()=>t("use-case")},{icon:Ca,label:"Log Activity",gradient:"from-warning/15 to-warning/5",color:"text-warning",action:()=>t("activity")}].map(d=>s.jsxs("button",{onClick:d.action,className:`flex items-center gap-3 p-3 md:p-4 rounded-2xl bg-gradient-to-br ${d.gradient} border border-border/50 hover:shadow-md transition-all press-scale`,children:[s.jsx(d.icon,{className:`w-5 h-5 ${d.color}`}),s.jsx("span",{className:"text-sm font-display font-semibold text-foreground",children:d.label})]},d.label))}),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:[c.length>0&&s.jsxs(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-card border border-border rounded-2xl p-5 shadow-sm",children:[s.jsx("h2",{className:"font-display font-bold text-foreground mb-4",children:"Today's focus"}),s.jsx("div",{className:"space-y-2",children:c.map(d=>{const f=d.contact_name??d.contactName??"",m=d.amount??0;return s.jsxs("div",{onClick:()=>e("opportunity",d.id),className:"flex items-center gap-3 p-3 rounded-xl bg-surface hover:bg-surface-sunken cursor-pointer transition-all press-scale",children:[s.jsx("div",{className:"w-8 h-8 rounded-xl bg-accent/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Ti,{className:"w-4 h-4 text-accent"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:d.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["$",m>=1e3?`${(m/1e3).toFixed(0)}K`:m," · ",f]})]}),s.jsx(SN,{className:"w-4 h-4 text-muted-foreground"})]},d.id)})})]}),s.jsx(Ve.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:"Recent activity"}),s.jsxs("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:[s.jsx("button",{onClick:()=>r("today"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${n==="today"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"Today"}),s.jsx("button",{onClick:()=>r("week"),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${n==="week"?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"This Week"})]})]}),s.jsx(HS,{limit:8,filterWindow:n})]})})]}),s.jsxs("div",{className:"space-y-4 md:space-y-5",children:[s.jsx(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.08},children:s.jsx(a7,{})}),s.jsx(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.11},children:s.jsx(i7,{})})]})]})]})]})}function e5(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 Hf="Checkbox",[z7]=Ro(Hf),[W7,Ey]=z7(Hf);function U7(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:l,form:c,name:d,onCheckedChange:f,required:m,value:p="on",internal_do_not_use_render:g}=e,[b,y]=bc({prop:n,defaultProp:a??!1,onChange:f,caller:Hf}),[k,N]=x.useState(null),[w,_]=x.useState(null),j=x.useRef(!1),S=k?!!c||!!k.closest("form"):!0,E={checked:b,disabled:l,setChecked:y,control:k,setControl:N,name:d,form:c,value:p,hasConsumerStoppedPropagationRef:j,required:m,defaultChecked:Co(a)?!1:a,isFormControl:S,bubbleInput:w,setBubbleInput:_};return s.jsx(W7,{scope:t,...E,children:H7(g)?g(E):r})}var t5="CheckboxTrigger",n5=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:l,value:c,disabled:d,checked:f,required:m,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:b,isFormControl:y,bubbleInput:k}=Ey(t5,e),N=Pt(a,p),w=x.useRef(f);return x.useEffect(()=>{const _=l==null?void 0:l.form;if(_){const j=()=>g(w.current);return _.addEventListener("reset",j),()=>_.removeEventListener("reset",j)}},[l,g]),s.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":Co(f)?"mixed":f,"aria-required":m,"data-state":i5(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:N,onKeyDown:Qe(t,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:Qe(n,_=>{g(j=>Co(j)?!0:!j),k&&y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})});n5.displayName=t5;var Py=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:m,form:p,...g}=e;return s.jsx(U7,{__scopeCheckbox:n,checked:a,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:p,value:f,internal_do_not_use_render:({isFormControl:b})=>s.jsxs(s.Fragment,{children:[s.jsx(n5,{...g,ref:t,__scopeCheckbox:n}),b&&s.jsx(a5,{__scopeCheckbox:n})]})})});Py.displayName=Hf;var r5="CheckboxIndicator",s5=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,l=Ey(r5,n);return s.jsx(As,{present:r||Co(l.checked)||l.checked===!0,children:s.jsx(qe.span,{"data-state":i5(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});s5.displayName=r5;var o5="CheckboxBubbleInput",a5=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:l,defaultChecked:c,required:d,disabled:f,name:m,value:p,form:g,bubbleInput:b,setBubbleInput:y}=Ey(o5,e),k=Pt(n,y),N=e5(l),w=dx(r);x.useEffect(()=>{const j=b;if(!j)return;const S=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(S,"checked").set,A=!a.current;if(N!==l&&P){const M=new Event("click",{bubbles:A});j.indeterminate=Co(l),P.call(j,Co(l)?!1:l),j.dispatchEvent(M)}},[b,N,l,a]);const _=x.useRef(Co(l)?!1:l);return s.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??_.current,required:d,disabled:f,name:m,value:p,form:g,...t,tabIndex:-1,ref:k,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});a5.displayName=o5;function H7(e){return typeof e=="function"}function Co(e){return e==="indeterminate"}function i5(e){return Co(e)?"indeterminate":e?"checked":"unchecked"}const l5=x.forwardRef(({className:e,...t},n)=>s.jsx(Py,{ref:n,className:Ie("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(s5,{className:Ie("flex items-center justify-center text-current"),children:s.jsx(Jg,{className:"h-4 w-4"})})}));l5.displayName=Py.displayName;const q7={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 Aa({searchValue:e,onSearchChange:t,searchPlaceholder:n="Search...",filters:r,activeFilters:a,onFilterChange:l,onClearFilters:c,sortOptions:d,currentSort:f,onSortChange:m,onAdd:p,addLabel:g,entityType:b}){var w;const y=q7[b]??"from-primary to-primary/80",k=x.useRef(null),N=Object.values(a).reduce((_,j)=>_+j.length,0);return x.useEffect(()=>{const _=j=>{var P;const S=j.target,E=S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.isContentEditable;j.key==="/"&&!E&&(j.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(Cc,{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(Ln,{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(rf,{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(HT,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Filter"}),N>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:N})]})}),s.jsxs(fc,{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"}),N>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(K7,{filter:_,selected:a[_.key]||[],onChange:j=>l(_.key,j)},_.key))})]})]}),s.jsxs(rf,{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($T,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:f&&((w=d.find(_=>_.key===f.key))==null?void 0:w.label)||"Sort"}),f&&s.jsx("span",{className:"text-[10px] font-mono",children:f.dir==="asc"?"↑":"↓"})]})}),s.jsx(fc,{className:"w-48 p-1 rounded-xl",align:"start",children:d.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(Io,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden sm:inline",children:g})]})]}),N>0&&s.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Object.entries(a).map(([_,j])=>j.map(S=>{var A;const E=r.find(M=>M.key===_),P=((A=E==null?void 0:E.options.find(M=>M.value===S))==null?void 0:A.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(_,j.filter(M=>M!==S)),className:"ml-0.5 hover:text-destructive p-0.5",children:s.jsx(Ln,{className:"w-3 h-3"})})]},`${_}-${S}`)}))})]})}function K7({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(Ar,{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(l5,{checked:c,onCheckedChange:()=>{n(c?t.filter(d=>d!==l.value):[...t,l.value])},className:"w-4 h-4"}),l.label]},l.value)})})]})}const Y7=[25,50,100];function Q7(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 Tr({page:e,pageSize:t,total:n,onPageChange:r,onPageSizeChange:a,className:l}){if(n<=t)return null;const c=Math.ceil(n/t),d=(e-1)*t+1,f=Math.min(e*t,n),m=Q7(e,c);return s.jsxs("div",{className:Ie("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 ",d,"–",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(Lo,{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:Ie("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(ka,{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:Y7.map(p=>s.jsx("button",{onClick:()=>{a(p),r(1)},className:Ie("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 G7=[{key:"lifecycle_stage",label:"Stage",options:Object.entries(Bi).map(([e,t])=>({value:e,label:t.label}))}],X7=[{key:"name",label:"Name"},{key:"company",label:"Company"},{key:"created_at",label:"Created"},{key:"lifecycle_stage",label:"Stage"}];function ai(e){const t=[e.first_name,e.last_name].filter(Boolean);return t.length>0?t.join(" "):e.email||e.company_name||"Unknown"}function Z7(){const e=yn(),t=Of(),[n,r]=x.useState("table"),a=t?"cards":n,{openDrawer:l,openQuickAdd:c,openAIWithContext:d}=Je(),{enabled:f}=ar(),[m,p]=x.useState(""),[g,b]=x.useState({}),[y,k]=x.useState(null),[N,w]=x.useState(1),[_,j]=x.useState(25),{data:S,isLoading:E}=x2({q:m||void 0,limit:200}),P=(S==null?void 0:S.data)??[],A=(F,B)=>{b(se=>{const G={...se};return B.length===0?delete G[F]:G[F]=B,G})},M=F=>{k(B=>(B==null?void 0:B.key)===F?{key:F,dir:B.dir==="asc"?"desc":"asc"}:{key:F,dir:"asc"})},D=x.useMemo(()=>{var B;let F=[...P];return(B=g.lifecycle_stage)!=null&&B.length&&(F=F.filter(se=>g.lifecycle_stage.includes(se.lifecycle_stage))),y&&F.sort((se,G)=>{const L=se[y.key]??"",H=G[y.key]??"";return typeof L=="number"&&typeof H=="number"?y.dir==="asc"?L-H:H-L:y.dir==="asc"?String(L).localeCompare(String(H)):String(H).localeCompare(String(L))}),F},[P,g,y]);x.useEffect(()=>{w(1)},[m,g,y]);const Y=D.slice((N-1)*_,N*_),q=({label:F,sortKey:B})=>s.jsx("th",{onClick:()=>M(B),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:[F,(y==null?void 0:y.key)===B?y.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}):null]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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(Ta,{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(Nc,{className:"w-4 h-4"})})]})}),s.jsx(Aa,{searchValue:m,onSearchChange:p,searchPlaceholder:"Search contacts...",filters:G7,activeFilters:g,onFilterChange:A,onClearFilters:()=>b({}),sortOptions:X7,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((F,B)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},B))}):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(""),b({})},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(q,{label:"Name",sortKey:"name"}),s.jsx(q,{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(q,{label:"Stage",sortKey:"lifecycle_stage"}),f&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:Y.map((F,B)=>s.jsxs("tr",{onClick:()=>l("contact",F.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer group transition-colors ${B%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(Ps,{name:ai(F),className:"w-8 h-8 text-xs"}),s.jsx("span",{className:"font-semibold text-foreground",children:ai(F)})]})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:F.company_name||"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:F.phone||"—"}),s.jsx("td",{className:"px-4 py-3",children:F.lifecycle_stage?s.jsx(mc,{stage:F.lifecycle_stage}):"—"}),f&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:se=>{se.stopPropagation(),d({type:"contact",id:F.id,name:ai(F),detail:F.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(xn,{className:"w-3.5 h-3.5 text-accent"})})})]},F.id))})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Tr,{page:N,pageSize:_,total:D.length,onPageChange:w,onPageSizeChange:j})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:Y.map((F,B)=>s.jsxs(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:B*.02},onClick:()=>l("contact",F.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:se=>{se.stopPropagation(),d({type:"contact",id:F.id,name:ai(F),detail:F.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(xn,{className:"w-3.5 h-3.5 text-accent"})}),s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx(Ps,{name:ai(F),className:"w-11 h-11 rounded-2xl text-sm"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-display font-bold text-foreground",children:ai(F)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:F.company_name||"Individual"})]})]}),s.jsx("div",{className:"flex items-center gap-2 mb-2",children:F.lifecycle_stage&&s.jsx(mc,{stage:F.lifecycle_stage})}),F.email&&s.jsx("p",{className:"text-xs text-muted-foreground",children:F.email})]},F.id))}),s.jsx(Tr,{page:N,pageSize:_,total:D.length,onPageChange:w,onPageSizeChange:j})]})})]})}const J7=[],ez=[{key:"name",label:"Name"},{key:"annual_revenue",label:"Revenue"},{key:"health_score",label:"Health"},{key:"employee_count",label:"Employees"}];function aj({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(hf,{className:"w-3 h-3"}),e]})}function ij(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e}`}function tz(){const e=Of(),[t,n]=x.useState("table"),r=e?"cards":t,{openDrawer:a,openQuickAdd:l,openAIWithContext:c}=Je(),{enabled:d}=ar(),f=yn(),[m,p]=x.useState(""),[g,b]=x.useState({}),[y,k]=x.useState(null),[N,w]=x.useState(1),[_,j]=x.useState(25),{data:S,isLoading:E}=Pf({q:m||void 0,limit:200}),P=(S==null?void 0:S.data)??[],A=(F,B)=>{b(se=>{const G={...se};return B.length===0?delete G[F]:G[F]=B,G})},M=F=>{k(B=>(B==null?void 0:B.key)===F?{key:F,dir:B.dir==="asc"?"desc":"asc"}:{key:F,dir:"asc"})},D=x.useMemo(()=>{var B;let F=[...P];return(B=g.industry)!=null&&B.length&&(F=F.filter(se=>g.industry.includes(se.industry))),y&&F.sort((se,G)=>{const L=se[y.key]??"",H=G[y.key]??"";return typeof L=="number"&&typeof H=="number"?y.dir==="asc"?L-H:H-L:y.dir==="asc"?String(L).localeCompare(String(H)):String(H).localeCompare(String(L))}),F},[P,g,y]);x.useEffect(()=>{w(1)},[m,g,y]);const Y=D.slice((N-1)*_,N*_),q=({label:F,sortKey:B})=>s.jsx("th",{onClick:()=>M(B),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:[F,(y==null?void 0:y.key)===B?y.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}):null]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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(Ta,{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(Nc,{className:"w-4 h-4"})})]})}),s.jsx(Aa,{searchValue:m,onSearchChange:p,searchPlaceholder:"Search accounts...",filters:J7,activeFilters:g,onFilterChange:A,onClearFilters:()=>b({}),sortOptions:ez,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((F,B)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},B))}):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(""),b({})},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(q,{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(q,{label:"Revenue",sortKey:"annual_revenue"}),s.jsx(q,{label:"Employees",sortKey:"employee_count"}),s.jsx(q,{label:"Health",sortKey:"health_score"}),d&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:Y.map((F,B)=>s.jsxs("tr",{onClick:()=>a("account",F.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer group transition-colors ${B%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(Ps,{name:F.name,className:"w-8 h-8 text-xs"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-foreground",children:F.name}),F.website&&s.jsx("p",{className:"text-xs text-muted-foreground",children:F.website})]})]})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:F.industry||"—"}),s.jsx("td",{className:"px-4 py-3 text-foreground font-medium",children:F.annual_revenue?ij(F.annual_revenue):"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:F.employee_count||"—"}),s.jsx("td",{className:"px-4 py-3",children:F.health_score?s.jsx(aj,{score:F.health_score}):"—"}),d&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:se=>{se.stopPropagation(),c({type:"account",id:F.id,name:F.name,detail:F.industry}),f("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(xn,{className:"w-3.5 h-3.5 text-accent"})})})]},F.id))})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Tr,{page:N,pageSize:_,total:D.length,onPageChange:w,onPageSizeChange:j})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:Y.map((F,B)=>s.jsxs(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:B*.02},onClick:()=>a("account",F.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(Ps,{name:F.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:F.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:F.industry||"—"})]})]}),s.jsx("div",{className:"flex items-center gap-2 mb-3",children:F.health_score&&s.jsx(aj,{score:F.health_score})}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[F.annual_revenue&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(ex,{className:"w-3 h-3"}),ij(F.annual_revenue)]}),F.website&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(RN,{className:"w-3 h-3"}),F.website]})]})]},F.id))}),s.jsx(Tr,{page:N,pageSize:_,total:D.length,onPageChange:w,onPageSizeChange:j})]})})]})}const Td=["prospecting","qualification","proposal","negotiation","closed_won","closed_lost"],nz=[{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 rz(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 sz=[{key:"stage",label:"Stage",options:Td.map(e=>{var t;return{value:e,label:((t=Bi[e])==null?void 0:t.label)??e}})}],oz=[{key:"name",label:"Opportunity Name"},{key:"amount",label:"Amount"},{key:"stage",label:"Stage"},{key:"probability",label:"Probability"},{key:"created_at",label:"Created"}];function az(){const e=yn(),[t,n]=x.useState("table"),{openDrawer:r,openQuickAdd:a,openAIWithContext:l}=Je(),{enabled:c}=ar(),[d,f]=x.useState(""),[m,p]=x.useState({}),[g,b]=x.useState(null),[y,k]=x.useState("this_quarter"),[N,w]=x.useState(1),[_,j]=x.useState(25),[S,E]=x.useState(""),[P,A]=x.useState(""),{data:M,isLoading:D}=Tc({q:d||void 0,limit:200}),Y=(M==null?void 0:M.data)??[],q=(L,H)=>{p($=>{const R={...$};return H.length===0?delete R[L]:R[L]=H,R})},F=L=>{b(H=>(H==null?void 0:H.key)===L?{key:L,dir:H.dir==="asc"?"desc":"asc"}:{key:L,dir:"asc"})},B=x.useMemo(()=>{var H;let L=[...Y];if((H=m.stage)!=null&&H.length&&(L=L.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 W=rz(y);W?($=W.start,R=W.end):($=new Date(0),R=new Date(864e13))}L=L.filter(W=>{if(!W.close_date)return!1;const Z=new Date(W.close_date);return Z>=$&&Z<=R})}return g&&L.sort(($,R)=>{const W=$[g.key]??"",Z=R[g.key]??"";return typeof W=="number"&&typeof Z=="number"?g.dir==="asc"?W-Z:Z-W:g.dir==="asc"?String(W).localeCompare(String(Z)):String(Z).localeCompare(String(W))}),L},[Y,m,g]);x.useEffect(()=>{w(1)},[d,m,g,y,S,P]);const se=B.slice((N-1)*_,N*_),G=({label:L,sortKey:H})=>s.jsx("th",{onClick:()=>F(H),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:[L,(g==null?void 0:g.key)===H&&(g.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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:TN},{mode:"table",icon:Ta},{mode:"forecast",icon:EN}].map(({mode:L,icon:H})=>s.jsx("button",{onClick:()=>n(L),className:`p-1.5 rounded-lg text-sm transition-all ${t===L?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(H,{className:"w-4 h-4"})},L))})}),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:nz.map(L=>s.jsx("button",{onClick:()=>k(L.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",y===L.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:L.label},L.value))}),y==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sn,{value:S,onChange:E,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(sn,{value:P,onChange:A,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Aa,{searchValue:d,onSearchChange:f,searchPlaceholder:"Search opportunities...",filters:sz,activeFilters:m,onFilterChange:q,onClearFilters:()=>p({}),sortOptions:oz,currentSort:g,onSortChange:F,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((L,H)=>s.jsx("div",{className:"flex-shrink-0 w-72 h-64 bg-muted/50 rounded-2xl animate-pulse"},H))}):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:Td.map(L=>{const H=Bi[L]??{label:L,color:"#94a3b8"},$=B.filter(W=>W.stage===L),R=$.reduce((W,Z)=>W+(Z.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:H.color+"20",color:H.color},children:H.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((W,Z)=>{const V=W.contact_name??W.contactName??"",O=W.amount??0,Q=W.days_in_stage??W.daysInStage??0;return s.jsxs(Ve.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:Z*.03},onClick:()=>r("opportunity",W.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:W.name}),c&&s.jsx("button",{onClick:re=>{re.stopPropagation(),l({type:"opportunity",id:W.id,name:W.name,detail:`$${(O/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(xn,{className:"w-3.5 h-3.5 text-accent"})})]}),V&&s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(Ps,{name:V,className:"w-5 h-5 rounded-full text-[8px]"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:V})]}),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:["$",O>=1e3?`${(O/1e3).toFixed(0)}K`:O]}),Q>0&&(Q>14?s.jsxs("span",{className:"px-2 py-0.5 rounded-lg text-xs bg-destructive/15 text-destructive font-semibold",children:[Q,"d"]}):s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Q,"d"]}))]})]},W.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(Io,{className:"w-3.5 h-3.5"})," Add Opportunity"]})]})]},L)})})]}):t==="table"?s.jsx("div",{className:"px-4 md:px-6",children:B.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(G,{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(G,{label:"Amount",sortKey:"amount"}),s.jsx(G,{label:"Stage",sortKey:"stage"}),s.jsx(G,{label:"Probability",sortKey:"probability"}),s.jsx(G,{label:"Created",sortKey:"created_at"}),c&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:se.map((L,H)=>{const $=L.contact_name??L.contactName??"",R=L.amount??0;return s.jsxs("tr",{onClick:()=>r("opportunity",L.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer transition-colors group ${H%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:L.name}),s.jsx("td",{className:"px-4 py-3",children:$&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ps,{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:L.stage&&s.jsx(mc,{stage:L.stage})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:L.probability?`${L.probability}%`:"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:L.created_at?new Date(L.created_at).toLocaleDateString():"—"}),c&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:W=>{W.stopPropagation(),l({type:"opportunity",id:L.id,name:L.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(xn,{className:"w-3.5 h-3.5 text-accent"})})})]},L.id)})})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Tr,{page:N,pageSize:_,total:B.length,onPageChange:w,onPageSizeChange:j})})]})}):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:B.filter(L=>L.stage!=="closed_won"&&L.stage!=="closed_lost").reduce((L,H)=>L+(H.amount||0)*(H.probability||0)/100,0)},{label:"Best Case",value:B.filter(L=>L.stage!=="closed_lost").reduce((L,H)=>L+(H.amount||0),0)},{label:"Closed Won",value:B.filter(L=>L.stage==="closed_won").reduce((L,H)=>L+(H.amount||0),0)}].map(L=>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:L.label}),s.jsxs("p",{className:"text-2xl font-display font-extrabold text-foreground mt-1",children:["$",L.value>=1e6?`${(L.value/1e6).toFixed(2)}M`:`${(L.value/1e3).toFixed(0)}K`]})]},L.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:Td.filter(L=>L!=="closed_lost").map(L=>{const H=Bi[L]??{label:L,color:"#94a3b8"},$=B.filter(W=>W.stage===L).reduce((W,Z)=>W+(Z.amount||0),0),R=Math.max(...Td.map(W=>B.filter(Z=>Z.stage===W).reduce((Z,V)=>Z+(V.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:H.color},children:H.label}),s.jsx("div",{className:"flex-1 h-8 bg-muted rounded-xl overflow-hidden",children:s.jsx(Ve.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:H.color+"30"},children:s.jsxs("span",{className:"text-xs font-display font-bold",style:{color:H.color},children:["$",($/1e3).toFixed(0),"K"]})})})]},L)})})]})]})})]})}const Ad=["discovery","poc","production","scaling","sunset"],iz=[{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 lz(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 cz=[{key:"stage",label:"Stage",options:Ad.map(e=>{var t;return{value:e,label:((t=Ns[e])==null?void 0:t.label)??e}})}],uz=[{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 dz(){const{openDrawer:e,openQuickAdd:t,openAIWithContext:n}=Je(),{enabled:r}=ar(),a=yn(),[l,c]=x.useState("table"),[d,f]=x.useState(""),[m,p]=x.useState({}),[g,b]=x.useState(null),[y,k]=x.useState("all"),[N,w]=x.useState(""),[_,j]=x.useState(""),[S,E]=x.useState(1),[P,A]=x.useState(25),{data:M,isLoading:D}=Hx({q:d||void 0,limit:200}),Y=(M==null?void 0:M.data)??[],q=(L,H)=>{p($=>{const R={...$};return H.length===0?delete R[L]:R[L]=H,R})},F=L=>{b(H=>(H==null?void 0:H.key)===L?{key:L,dir:H.dir==="asc"?"desc":"asc"}:{key:L,dir:"asc"})},B=x.useMemo(()=>{var H;let L=[...Y];if((H=m.stage)!=null&&H.length&&(L=L.filter($=>m.stage.includes($.stage))),y!=="all"){let $,R;if(y==="custom")$=N?new Date(N+"T00:00:00"):new Date(0),R=_?new Date(_+"T23:59:59"):new Date(864e13);else{const W=lz(y);W?($=W.start,R=W.end):($=new Date(0),R=new Date(864e13))}L=L.filter(W=>{if(!W.target_prod_date)return!0;const Z=new Date(W.target_prod_date);return Z>=$&&Z<=R})}return g&&L.sort(($,R)=>{const W=$[g.key]??"",Z=R[g.key]??"";return typeof W=="number"&&typeof Z=="number"?g.dir==="asc"?W-Z:Z-W:g.dir==="asc"?String(W).localeCompare(String(Z)):String(Z).localeCompare(String(W))}),L},[Y,m,g,y,N,_]);x.useEffect(()=>{E(1)},[d,m,g,y,N,_]);const se=B.slice((S-1)*P,S*P),G=({label:L,sortKey:H})=>s.jsx("th",{onClick:()=>F(H),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:[L,(g==null?void 0:g.key)===H&&(g.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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:TN},{mode:"table",icon:Ta},{mode:"dashboard",icon:EN}].map(({mode:L,icon:H})=>s.jsx("button",{onClick:()=>c(L),className:`p-1.5 rounded-lg text-sm transition-all ${l===L?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(H,{className:"w-4 h-4"})},L))})}),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:iz.map(L=>s.jsx("button",{onClick:()=>k(L.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",y===L.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:L.label},L.value))}),y==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sn,{value:N,onChange:w,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(sn,{value:_,onChange:j,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Aa,{searchValue:d,onSearchChange:f,searchPlaceholder:"Search use cases...",filters:cz,activeFilters:m,onFilterChange:q,onClearFilters:()=>{p({}),k("all")},sortOptions:uz,currentSort:g,onSortChange:F,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((L,H)=>s.jsx("div",{className:"flex-shrink-0 w-72 h-64 bg-muted/50 rounded-2xl animate-pulse"},H))}):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:Ad.map(L=>{const H=Ns[L]??{label:L,color:"#94a3b8"},$=B.filter(W=>W.stage===L),R=$.reduce((W,Z)=>W+(Z.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:H.color+"20",color:H.color},children:H.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((W,Z)=>{const V=W.account_name??W.client??"",O=W.attributed_arr??0,Q=W.health_score??0;return s.jsxs(Ve.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:Z*.03},onClick:()=>e("use-case",W.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:W.name}),r&&s.jsx("button",{onClick:re=>{re.stopPropagation(),n({type:"use-case",id:W.id,name:W.name,detail:V}),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(xn,{className:"w-3.5 h-3.5 text-accent"})})]}),V&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:V}),s.jsxs("div",{className:"flex items-center justify-between mt-2.5",children:[O>0?s.jsxs("span",{className:"text-sm font-display font-extrabold text-foreground",children:["$",O>=1e3?`${(O/1e3).toFixed(0)}K`:O]}):s.jsx("span",{}),Q>0&&s.jsx("span",{className:`px-2 py-0.5 rounded-lg text-xs font-semibold ${Q>=80?"bg-green-500/15 text-green-400":Q>=50?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400"}`,children:Q})]})]},W.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(Io,{className:"w-3.5 h-3.5"})," Add Use Case"]})]})]},L)})})]}):l==="table"?s.jsx("div",{className:"px-4 md:px-6",children:B.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(G,{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(G,{label:"Stage",sortKey:"stage"}),s.jsx(G,{label:"ARR",sortKey:"attributed_arr"}),s.jsx(G,{label:"Health",sortKey:"health_score"}),s.jsx(G,{label:"Prod Date",sortKey:"target_prod_date"}),s.jsx(G,{label:"Created",sortKey:"created_at"}),r&&s.jsx("th",{className:"px-2 py-3 w-8"})]})}),s.jsx("tbody",{children:se.map((L,H)=>{const $=L.stage??"",R=Ns[$]??{label:$,color:"#94a3b8"},W=L.attributed_arr??0,Z=L.health_score??0,V=L.account_name??L.client??"";return s.jsxs("tr",{onClick:()=>e("use-case",L.id),className:`border-b border-border last:border-0 hover:bg-primary/5 cursor-pointer transition-colors group ${H%2===1?"bg-surface-sunken/30":""}`,children:[s.jsx("td",{className:"px-4 py-3 font-display font-bold text-foreground",children:L.name}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:V||"—"}),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:W>0?`$${(W/1e3).toFixed(0)}K`:"—"}),s.jsx("td",{className:"px-4 py-3",children:Z>0?s.jsx("span",{className:`px-2 py-0.5 rounded-lg text-xs font-semibold ${Z>=80?"bg-green-500/15 text-green-400":Z>=50?"bg-yellow-500/15 text-yellow-400":"bg-red-500/15 text-red-400"}`,children:Z}):"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:L.target_prod_date?new Date(L.target_prod_date).toLocaleDateString():"—"}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:L.created_at?new Date(L.created_at).toLocaleDateString():"—"}),r&&s.jsx("td",{className:"px-2 py-3",children:s.jsx("button",{onClick:O=>{O.stopPropagation(),n({type:"use-case",id:L.id,name:L.name,detail:V}),a("/agent")},className:"p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-accent/10 transition-all",children:s.jsx(xn,{className:"w-3.5 h-3.5 text-accent"})})})]},L.id)})})]})}),s.jsx("div",{className:"px-4",children:s.jsx(Tr,{page:S,pageSize:P,total:B.length,onPageChange:E,onPageSizeChange:A})})]})}):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:B.filter(L=>L.stage!=="sunset").reduce((L,H)=>L+(H.attributed_arr||0),0),isCount:!1},{label:"Production ARR",value:B.filter(L=>L.stage==="production"||L.stage==="scaling").reduce((L,H)=>L+(H.attributed_arr||0),0),isCount:!1},{label:"Active Use Cases",value:B.filter(L=>L.stage!=="sunset").length,isCount:!0}].map(L=>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:L.label}),s.jsx("p",{className:"text-2xl font-display font-extrabold text-foreground mt-1",children:L.isCount?L.value:L.value>=1e6?`$${(L.value/1e6).toFixed(2)}M`:`$${(L.value/1e3).toFixed(0)}K`})]},L.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:Ad.map(L=>{const H=Ns[L]??{label:L,color:"#94a3b8"},$=B.filter(Z=>Z.stage===L).reduce((Z,V)=>Z+(V.attributed_arr||0),0),R=B.filter(Z=>Z.stage===L).length,W=Math.max(...Ad.map(Z=>B.filter(V=>V.stage===Z).reduce((V,O)=>V+(O.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:H.color},children:H.label}),s.jsx("div",{className:"flex-1 h-8 bg-muted rounded-xl overflow-hidden",children:s.jsx(Ve.div,{initial:{width:0},animate:{width:$>0?`${$/W*100}%`:"0%"},transition:{duration:.8,ease:"easeOut"},className:"h-full rounded-xl flex items-center px-3",style:{backgroundColor:H.color+"30"},children:$>0&&s.jsxs("span",{className:"text-xs font-display font-bold",style:{color:H.color},children:["$",($/1e3).toFixed(0),"K"]})})}),s.jsx("span",{className:"text-xs text-muted-foreground font-mono w-6 text-right",children:R})]},L)})})]})]})})]})}const fz=[{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"}]}],mz=[{key:"occurred_at",label:"When"},{key:"created_at",label:"Logged"},{key:"type",label:"Type"},{key:"outcome",label:"Outcome"}],hz=[{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 pz(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 gz(){const{openQuickAdd:e}=Je(),[t,n]=x.useState(""),[r,a]=x.useState({}),[l,c]=x.useState(null),[d,f]=x.useState("this_week"),[m,p]=x.useState(""),[g,b]=x.useState(""),[y,k]=x.useState(1),N=50,{data:w,isLoading:_}=qx({limit:200}),j=(w==null?void 0:w.data)??[],S=(M,D)=>{a(Y=>{const q={...Y};return D.length===0?delete q[M]:q[M]=D,q})},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 q,F,B;let M=[...j],D,Y;if(d==="custom"?(D=m?new Date(m+"T00:00:00"):new Date(0),Y=g?new Date(g+"T23:59:59"):new Date(864e13)):{start:D,end:Y}=pz(d),M=M.filter(se=>{const G=new Date(se.occurred_at??se.created_at);return G>=D&&G<=Y}),t){const se=t.toLowerCase();M=M.filter(G=>{const L=(G.description??G.body??G.subject??"").toLowerCase(),H=(G.contact_name??"").toLowerCase(),$=(G.outcome??"").toLowerCase(),R=(G.subject_type??"").replace(/_/g," ").toLowerCase();return L.includes(se)||H.includes(se)||$.includes(se)||R.includes(se)})}return(q=r.type)!=null&&q.length&&(M=M.filter(se=>r.type.includes(se.type))),(F=r.subject_type)!=null&&F.length&&(M=M.filter(se=>r.subject_type.includes(se.subject_type))),(B=r.outcome)!=null&&B.length&&(M=M.filter(se=>r.outcome.includes(se.outcome))),l&&M.sort((se,G)=>{let L,H;return l.key==="occurred_at"?(L=se.occurred_at??se.created_at??"",H=G.occurred_at??G.created_at??""):(L=se[l.key]??"",H=G[l.key]??""),l.dir==="asc"?L.localeCompare(H):H.localeCompare(L)}),M},[j,t,r,l,d,m,g]);x.useEffect(()=>{k(1)},[t,r,l,d,m,g]);const A=P.slice((y-1)*N,y*N);return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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:hz.map(M=>s.jsx("button",{onClick:()=>f(M.value),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all",d===M.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:M.label},M.value))}),d==="custom"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sn,{value:m,onChange:p,size:"sm",placeholder:"From",className:"w-36"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"to"}),s.jsx(sn,{value:g,onChange:b,size:"sm",placeholder:"To",className:"w-36"})]})]}),s.jsx(Aa,{searchValue:t,onSearchChange:n,searchPlaceholder:"Search activities...",filters:fz,activeFilters:r,onFilterChange:S,onClearFilters:()=>a({}),sortOptions:mz,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(HS,{activities:A}),s.jsx(Tr,{page:y,pageSize:N,total:P.length,onPageChange:k})]})})]})}const xz=[{role:"agent",content:`Good morning! I've reviewed your pipeline overnight. Here's what needs attention:
|
|
548
|
+
|
|
549
|
+
1. **Sarah Chen's deal** — appraisal should arrive today. I'll draft a follow-up email once it's in.
|
|
550
|
+
2. **Hannah Williams** — her Brooklyn viewings are stale (16 days). I suggest scheduling new showings.
|
|
551
|
+
3. **Sacramento listing** for Maria Santos has been in lead stage for 22 days. Consider a nurture sequence.
|
|
552
|
+
|
|
553
|
+
Want me to take action on any of these?`}],yz={contact:pf,opportunity:Ti,"use-case":KT,account:VT},lj={contact:"Contact",opportunity:"Opportunity","use-case":"Use Case",account:"Account"},vz=[{id:"1",label:"Follow-up for Sarah Chen",messages:[{role:"agent",content:"I drafted a follow-up email for **Sarah Chen** regarding the appraisal results. Ready for your review."},{role:"user",content:"Looks good, send it."},{role:"agent",content:"✅ Email sent to Sarah Chen."}],context:{type:"opportunity",id:"d1",name:"Sarah Chen's Opportunity",detail:"$850K"}},{id:"2",label:"Nurture sequence for Maria Santos",messages:[{role:"agent",content:"I created a 4-email nurture sequence for **Maria Santos**. Starting with a home value assessment offer."},{role:"user",content:"Add a market trends email as step 2."},{role:"agent",content:"✅ Updated. The sequence now includes market trends as step 2."}],context:{type:"contact",id:"c3",name:"Maria Santos",detail:"Sacramento"}},{id:"3",label:"Pipeline review — Q1",messages:[{role:"agent",content:`Here's your Q1 pipeline summary:
|
|
554
|
+
|
|
555
|
+
• **Weighted pipeline**: $1.2M
|
|
556
|
+
• **Best case**: $2.1M
|
|
557
|
+
• **3 deals** stale >14 days
|
|
558
|
+
|
|
559
|
+
Want me to flag the stale deals?`}],context:null}];function bz(){const[e,t]=x.useState(xz),[n,r]=x.useState(""),[a,l]=x.useState(null),{aiContext:c}=Je();x.useEffect(()=>{c&&(l(c),r(`Update ${c.name}: `),t([{role:"agent",content:`I'm ready to help with **${c.name}**${c.detail?` (${c.detail})`:""}. What would you like to update?`}]),Je.setState({aiContext:null}))},[c]);const d=()=>{n.trim()&&(t([...e,{role:"user",content:n}]),r(""),setTimeout(()=>{t(p=>[...p,{role:"agent",content:"I'm processing your request. In a real implementation, this would connect to an AI model to take actions on your CRM data. 🚀"}])},1e3))},f=a?[`Update ${lj[a.type].toLowerCase()} details`,"Summarize activity","Draft follow-up"]:["Summarize pipeline","Draft follow-up for Sarah","Deals needing attention"],m=a?yz[a.type]:null;return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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(t7,{}),s.jsx("span",{className:"text-sm font-display font-bold text-foreground",children:"AI Agent active"}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto bg-muted px-2 py-0.5 rounded-full",children:"Synced 2m ago"})]})}),a&&m&&s.jsx(Ve.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(m,{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:lj[a.type]}),s.jsxs("p",{className:"text-sm font-display font-bold text-foreground truncate",children:[a.name,a.detail&&s.jsxs("span",{className:"font-normal text-muted-foreground ml-1.5",children:["· ",a.detail]})]})]}),s.jsx("button",{onClick:()=>l(null),className:"p-1 rounded-md hover:bg-muted transition-colors",children:s.jsx(Ln,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 pb-24 md:pb-4",children:e.map((p,g)=>s.jsxs(Ve.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:g*.05},className:`flex ${p.role==="user"?"justify-end":"justify-start"}`,children:[p.role==="agent"&&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(Oo,{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
|
|
560
|
+
${p.role==="user"?"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:p.content})]},g))}),s.jsx("div",{className:"px-4 flex gap-2 flex-wrap",children:f.map(p=>s.jsx("button",{onClick:()=>r(p),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:p},p))}),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:p=>r(p.target.value),onKeyDown:p=>p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),d()),placeholder:"Ask your AI agent...",rows:1,className:"flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none px-2 py-1.5"}),s.jsx("button",{onClick:d,disabled:!n.trim(),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:s.jsx(nx,{className:"w-4 h-4"})})]})})]}),s.jsxs("div",{className:"hidden lg:flex flex-col w-80 border-l border-border bg-surface",children:[s.jsxs("div",{className:"p-5 border-b border-border",children:[s.jsx("h3",{className:"font-display font-bold text-foreground text-sm mb-3",children:"Connected tools"}),s.jsx("div",{className:"space-y-2.5",children:[{name:"Google Calendar",status:!0},{name:"Email (Gmail)",status:!0},{name:"MCP Server",status:!0}].map(p=>s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-foreground",children:p.name}),p.status?s.jsx(BT,{className:"w-4 h-4 text-success"}):s.jsx("span",{className:"text-[10px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:"Not connected"})]},p.name))})]}),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"}),s.jsx("div",{className:"space-y-1.5",children:vz.map(p=>s.jsxs("button",{onClick:()=>{t(p.messages),l(p.context),r("")},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",children:[s.jsx(PN,{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:p.label})]},p.id))})]})]})]})]})}var qf="Switch",[wz]=Ro(qf),[jz,Nz]=wz(qf),c5=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:m,form:p,...g}=e,[b,y]=x.useState(null),k=Pt(t,S=>y(S)),N=x.useRef(!1),w=b?p||!!b.closest("form"):!0,[_,j]=bc({prop:a,defaultProp:l??!1,onChange:m,caller:qf});return s.jsxs(jz,{scope:n,checked:_,disabled:d,children:[s.jsx(qe.button,{type:"button",role:"switch","aria-checked":_,"aria-required":c,"data-state":m5(_),"data-disabled":d?"":void 0,disabled:d,value:f,...g,ref:k,onClick:Qe(e.onClick,S=>{j(E=>!E),w&&(N.current=S.isPropagationStopped(),N.current||S.stopPropagation())})}),w&&s.jsx(f5,{control:b,bubbles:!N.current,name:r,value:f,checked:_,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});c5.displayName=qf;var u5="SwitchThumb",d5=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Nz(u5,n);return s.jsx(qe.span,{"data-state":m5(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});d5.displayName=u5;var Cz="SwitchBubbleInput",f5=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},l)=>{const c=x.useRef(null),d=Pt(c,l),f=e5(n),m=dx(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:d,style:{...a.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});f5.displayName=Cz;function m5(e){return e?"checked":"unchecked"}var h5=c5,kz=d5;const Yl=x.forwardRef(({className:e,...t},n)=>s.jsx(h5,{className:Ie("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(kz,{className:Ie("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")})}));Yl.displayName=h5.displayName;const cj={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:[]},uj={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"},dj={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"}},Sz={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"},yr={provider:"anthropic",baseUrl:"https://api.anthropic.com/v1",apiKey:"sk-ant-api03-••••••••••••••••••••••••••••••••",model:"claude-sonnet-4-20250514",historyRetentionDays:90,systemPrompt:"You are a CRMy AI agent helping [User Name] manage their real estate/mortgage/insurance pipeline. You have access to their contacts, accounts, opportunities, use cases, and activity history via MCP tools. Be concise, accurate, and always confirm before making changes to CRM objects.",maxTokensPerTurn:4e3,canCreateAssignments:!0,canLogActivities:!0,canWriteObjects:!1},Md="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",_z=`${Md} cursor-pointer`,fj="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",kp="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",mj="px-3 py-1.5 rounded-lg bg-destructive text-destructive-foreground text-xs font-semibold hover:bg-destructive/90 transition-colors";function Ez(){const{enabled:e,setEnabled:t}=ar(),[n,r]=x.useState(yr.provider),[a,l]=x.useState(yr.baseUrl),[c,d]=x.useState(yr.apiKey),[f,m]=x.useState(!1),[p,g]=x.useState(yr.model),[b,y]=x.useState(""),[k,N]=x.useState(!1),[w,_]=x.useState(!1),[j,S]=x.useState(!1),[E,P]=x.useState(yr.historyRetentionDays),[A,M]=x.useState(yr.systemPrompt),[D,Y]=x.useState(!1),[q,F]=x.useState(yr.systemPrompt),[B,se]=x.useState(yr.maxTokensPerTurn),[G,L]=x.useState(yr.canCreateAssignments),[H,$]=x.useState(yr.canLogActivities),[R,W]=x.useState(yr.canWriteObjects),Z=x.useRef(null),[V,O]=x.useState(!1),[Q,re]=x.useState("");x.useEffect(()=>{D&&Z.current&&Z.current.focus()},[D]);const oe=pe=>{r(pe),l(uj[pe]);const mt=cj[pe];g(mt[0]??""),y(""),S(!1)},de=async()=>{N(!0),await new Promise(pe=>setTimeout(pe,1200)),N(!1),Math.random()>.3?he({title:"Connection successful",description:`Connected to ${n} at ${a}`}):he({title:"Connection failed",description:"Could not reach the provider. Check your API key and base URL.",variant:"destructive"})},le=async()=>{_(!0),await new Promise(pe=>setTimeout(pe,1500)),_(!1),S(!0),he({title:"Settings saved",description:"Provider configuration updated."}),setTimeout(()=>S(!1),3e3)},be=()=>{O(!1),re(""),he({title:"Chat histories cleared",description:"All agent chat histories have been deleted."})},we=e?"":"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(xn,{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.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full border bg-muted text-muted-foreground border-border",children:"Coming soon"}),s.jsx(Yl,{checked:!1,onCheckedChange:()=>{},disabled:!0,"aria-label":"Enable In-App AI agent"})]})]}),s.jsx("div",{className:"px-5 py-3 bg-muted/40 border-b border-border",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Backend support for the AI agent is not yet available. This toggle will be enabled once the agent service is configured and deployed."})}),e&&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(pe=>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:pe.icon})," ",pe.label]},pe.label))})]}),s.jsxs("div",{className:`rounded-xl border border-border bg-card overflow-hidden transition-opacity ${we}`,"aria-disabled":!e,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(qT,{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"})]})]}),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:"Connected"})]})]}),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(pe=>{const mt=n===pe;return s.jsxs("button",{onClick:()=>oe(pe),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-xs font-semibold transition-colors ${mt?dj[pe].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 ${dj[pe].dot}`}),pe.charAt(0).toUpperCase()+pe.slice(1)]},pe)})})]}),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:a,onChange:pe=>l(pe.target.value),placeholder:uj[n],className:Md})]}),n!=="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:f?"text":"password",value:c,onChange:pe=>d(pe.target.value),placeholder:"sk-...",className:Md+" pr-10"}),s.jsx("button",{type:"button",onClick:()=>m(pe=>!pe),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:f?s.jsx(WT,{className:"w-3.5 h-3.5"}):s.jsx(UT,{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"}),n==="custom"?s.jsx("input",{value:b,onChange:pe=>y(pe.target.value),placeholder:"e.g. my-custom-model",className:Md}):s.jsx("select",{value:p,onChange:pe=>g(pe.target.value),className:_z,children:cj[n].map(pe=>s.jsx("option",{value:pe,children:pe},pe))})]}),s.jsxs("div",{className:"py-4 flex items-center gap-2 flex-wrap",children:[s.jsx("button",{onClick:de,disabled:k,className:kp+" disabled:opacity-40",children:k?"Testing…":"Test connection"}),s.jsx("button",{onClick:le,disabled:w,className:fj,children:w?"Saving…":j?"Saved ✓":"Save changes"})]})]})]}),s.jsxs("div",{className:`rounded-xl border border-border bg-card overflow-hidden transition-opacity ${we}`,"aria-disabled":!e,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(ko,{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:pe=>P(Number(pe.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:()=>{F(A),Y(!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:A})})]}),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:B,onChange:pe=>se(Number(pe.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:Sz[B]})]}),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(Yl,{checked:G,onCheckedChange:L,"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(Yl,{checked:H,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(Yl,{checked:R,onCheckedChange:W,"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(Di,{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-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(Di,{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:()=>O(!0),className:mj+" 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:()=>Y(!1),className:"text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(Ln,{className:"w-4 h-4"})})]}),s.jsx("textarea",{ref:Z,value:q,onChange:pe=>F(pe.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:()=>Y(!1),className:kp,children:"Cancel"}),s.jsx("button",{onClick:()=>{M(q),Y(!1),he({title:"System prompt saved"})},className:fj,children:"Save prompt"})]})]})}),V&&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:Q,onChange:pe=>re(pe.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:()=>{O(!1),re("")},className:kp,children:"Cancel"}),s.jsx("button",{disabled:Q!=="CLEAR",onClick:be,className:mj+" disabled:opacity-40",children:"Clear histories"})]})]})})]})}const Pz=[{value:"slack",label:"Slack",icon:hi},{value:"teams",label:"Teams",icon:hi},{value:"discord",label:"Discord",icon:hi},{value:"whatsapp",label:"WhatsApp",icon:oc}],hj={owner:"Owner",admin:"Admin",member:"Member"},dd={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"},pj={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"},Tz=[{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 gj({actor:e,onClose:t}){const n=_2(),{data:r,isLoading:a}=C2(e.id),l=k2(),c=S2(),[d,f]=x.useState(""),[m,p]=x.useState(null),[g,b]=x.useState(!1),[y,k]=x.useState(!1),[N,w]=x.useState(e.scopes??[]),_=(r==null?void 0:r.data)??[],j=async()=>{if(d.trim())try{const M=await l.mutateAsync({label:d.trim(),scopes:e.scopes??["read"],actor_id:e.id});p(M.key??null),f(""),b(!1),he({title:"API key created",description:"Copy it now — it won't be shown again."})}catch{he({title:"Error",description:"Failed to create API key.",variant:"destructive"})}},S=async M=>{try{await c.mutateAsync(M),he({title:"API key revoked"})}catch{he({title:"Error",description:"Failed to revoke key.",variant:"destructive"})}},E=M=>{w(D=>D.includes(M)?D.filter(Y=>Y!==M):[...D,M])},P=async()=>{try{await n.mutateAsync({id:e.id,scopes:N}),k(!1),he({title:"Permissions updated"})}catch{he({title:"Error",description:"Failed to update permissions.",variant:"destructive"})}};return s.jsx(Ve.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(r4,{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),w(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:Tz.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 Y=N.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 ${Y?"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(Gl,{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:()=>b(!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(Io,{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),he({title:"Copied!"})},className:"p-1.5 rounded-lg hover:bg-muted transition-colors flex-shrink-0",children:s.jsx(MN,{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:d,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"&&j()}),s.jsx("button",{onClick:j,disabled:!d.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:()=>{b(!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(Gl,{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(Ss,{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 xj({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(Oo,{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 Wl(e){const t=e==null?void 0:e.contact_channels;return Array.isArray(t)?t:[]}function Sp({channels:e,onChange:t}){const n=()=>{t([...e,{channel_type:"slack",handle:"",primary:!1}])},r=l=>{t(e.filter((c,d)=>d!==l))},a=(l,c)=>{t(e.map((d,f)=>f===l?{...d,...c}:d))};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(Io,{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(Rn,{children:e.map((l,c)=>s.jsxs(Ve.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:d=>a(c,{channel_type:d.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:Pz.map(d=>s.jsx("option",{value:d.value,children:d.label},d.value))}),s.jsx("input",{value:l.handle,onChange:d=>a(c,{handle:d.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(Ln,{className:"w-3.5 h-3.5"})})]},c))})]})}const _p=()=>({name:"",email:"",phone:"",role:"member",password:"",channels:[],createAuthUser:!0}),Ep=()=>({display_name:"",agent_identifier:"",agent_model:""});function Az(){const e=Ef(),t=Of(),[n,r]=x.useState("table"),a=t?"cards":n,{data:l,isLoading:c}=Af({limit:200}),d=(l==null?void 0:l.data)??[],f=uF(),m=_2(),p=tF(),[g,b]=x.useState("all"),[y,k]=x.useState(""),[N,w]=x.useState({}),[_,j]=x.useState(null),[S,E]=x.useState(1),[P,A]=x.useState(25),[M,D]=x.useState(null),[Y,q]=x.useState(null),[F,B]=x.useState(_p()),[se,G]=x.useState(Ep()),[L,H]=x.useState(null),[$,R]=x.useState(""),[W,Z]=x.useState(""),[V,O]=x.useState(""),[Q,re]=x.useState([]),oe=x.useMemo(()=>{var _e,Ue;let X=[...d];if(g!=="all"&&(X=X.filter(et=>et.actor_type===g)),(_e=N.status)!=null&&_e.length){const et=N.status.includes("active"),Tt=N.status.includes("inactive");et&&!Tt&&(X=X.filter(ct=>ct.is_active)),Tt&&!et&&(X=X.filter(ct=>!ct.is_active))}if((Ue=N.role)!=null&&Ue.length&&(X=X.filter(et=>et.role&&N.role.includes(et.role))),y){const et=y.toLowerCase();X=X.filter(Tt=>Tt.display_name.toLowerCase().includes(et)||(Tt.email??"").toLowerCase().includes(et)||(Tt.phone??"").toLowerCase().includes(et)||(Tt.agent_identifier??"").toLowerCase().includes(et))}return _&&X.sort((et,Tt)=>{const ct=String(et[_.key]??""),Ut=String(Tt[_.key]??"");return _.dir==="asc"?ct.localeCompare(Ut):Ut.localeCompare(ct)}),X},[d,g,y,N,_]);x.useEffect(()=>{E(1)},[g,y,N,_]);const de=oe.slice((S-1)*P,S*P),le=d.filter(X=>X.actor_type==="human").length,be=d.filter(X=>X.actor_type==="agent").length,we=[{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"}]}],pe=[{key:"display_name",label:"Name"},{key:"email",label:"Email"},{key:"actor_type",label:"Type"},{key:"created_at",label:"Created"}],mt=(X,_e)=>{w(Ue=>{const et={...Ue};return _e.length===0?delete et[X]:et[X]=_e,et})},on=X=>{j(_e=>(_e==null?void 0:_e.key)===X?{key:X,dir:_e.dir==="asc"?"desc":"asc"}:{key:X,dir:"asc"})},Dt=async()=>{if(!(!F.name.trim()||!F.email.trim()))try{if(F.createAuthUser&&F.password)await p.mutateAsync({name:F.name.trim(),email:F.email.trim(),password:F.password,role:F.role});else{const X={};F.channels.length>0&&(X.contact_channels=F.channels.filter(_e=>_e.handle.trim())),await f.mutateAsync({actor_type:"human",display_name:F.name.trim(),email:F.email.trim(),phone:F.phone.trim()||void 0,role:F.role,metadata:X})}q(null),B(_p()),he({title:"Human actor created"})}catch(X){he({title:"Error",description:X instanceof Error?X.message:"Failed to create",variant:"destructive"})}},In=async()=>{if(se.display_name.trim())try{await f.mutateAsync({actor_type:"agent",display_name:se.display_name.trim(),agent_identifier:se.agent_identifier.trim()||void 0,agent_model:se.agent_model.trim()||void 0,metadata:{}}),q(null),G(Ep()),he({title:"Agent registered"})}catch(X){he({title:"Error",description:X instanceof Error?X.message:"Failed to register",variant:"destructive"})}},Fn=X=>{H(X.id),O(X.display_name),R(X.phone??""),Z(X.role??"member"),re(Wl(X.metadata))},$n=async()=>{if(L)try{const X={};Q.length>0&&(X.contact_channels=Q.filter(_e=>_e.handle.trim())),await m.mutateAsync({id:L,display_name:V.trim(),phone:$.trim()||null,role:W||null,metadata:X}),H(null),he({title:"Actor updated"})}catch(X){he({title:"Error",description:X instanceof Error?X.message:"Failed to update",variant:"destructive"})}},vn=X=>{D(_e=>_e===X?null:X)},Vn=async X=>{try{await m.mutateAsync({id:X.id,is_active:!X.is_active}),he({title:X.is_active?"Actor deactivated":"Actor activated"})}catch(_e){he({title:"Error",description:_e instanceof Error?_e.message:"Failed",variant:"destructive"})}},an=({label:X,sortKey:_e})=>s.jsx("th",{onClick:()=>on(_e),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:[X,(_==null?void 0:_.key)===_e?_.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}):null]})}),lt="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(Ta,{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(Nc,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"flex items-center gap-1 px-6 pb-2",children:[{key:"all",label:"All",count:d.length},{key:"human",label:"Humans",count:le,icon:ko},{key:"agent",label:"Agents",count:be,icon:Oo}].map(X=>s.jsxs("button",{onClick:()=>b(X.key),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors ${g===X.key?"bg-primary/15 text-primary":"bg-muted/50 text-muted-foreground hover:text-foreground"}`,children:["icon"in X&&X.icon&&s.jsx(X.icon,{className:"w-3 h-3"}),X.label,s.jsx("span",{className:"text-[10px] opacity-60",children:X.count})]},X.key))}),s.jsx(Aa,{searchValue:y,onSearchChange:k,searchPlaceholder:"Search actors...",filters:we,activeFilters:N,onFilterChange:mt,onClearFilters:()=>w({}),sortOptions:pe,currentSort:_,onSortChange:on,onAdd:()=>q(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(Rn,{children:[Y==="human"&&s.jsxs(Ve.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:F.createAuthUser,onChange:X=>B(_e=>({..._e,createAuthUser:X.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:F.name,onChange:X=>B(_e=>({..._e,name:X.target.value})),placeholder:"Jane Smith",className:lt})]}),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:F.email,onChange:X=>B(_e=>({..._e,email:X.target.value})),placeholder:"jane@company.com",className:lt})]}),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:F.phone,onChange:X=>B(_e=>({..._e,phone:X.target.value})),placeholder:"+1 (555) 123-4567",className:lt})]}),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:F.role,onChange:X=>B(_e=>({..._e,role:X.target.value})),className:`${lt} 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"})]})]})]}),F.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:F.password,onChange:X=>B(_e=>({..._e,password:X.target.value})),placeholder:"Min. 8 characters",className:lt})]})}),s.jsx(Sp,{channels:F.channels,onChange:X=>B(_e=>({..._e,channels:X}))}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:Dt,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:()=>{q(null),B(_p())},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"})]})]}),Y==="agent"&&s.jsxs(Ve.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:se.display_name,onChange:X=>G(_e=>({..._e,display_name:X.target.value})),placeholder:"Outreach Bot",className:lt})]}),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:se.agent_identifier,onChange:X=>G(_e=>({..._e,agent_identifier:X.target.value})),placeholder:"custom/outreach-v1",className:lt})]}),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:se.agent_model,onChange:X=>G(_e=>({..._e,agent_model:X.target.value})),placeholder:"claude-sonnet-4-20250514",className:lt})]})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:In,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:()=>{q(null),G(Ep())},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((X,_e)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},_e))}):oe.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[s.jsx(ko,{className:"w-8 h-8 mb-3 opacity-30"}),s.jsx("p",{className:"text-sm",children:"No actors found."}),(y||Object.keys(N).length>0||g!=="all")&&s.jsx("button",{onClick:()=>{k(""),w({}),b("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(an,{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(an,{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:de.map((X,_e)=>s.jsx(ue.Fragment,{children:L===X.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:V,onChange:Ue=>O(Ue.target.value),className:lt})]}),X.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:Ue=>R(Ue.target.value),placeholder:"+1 (555) 123-4567",className:lt})]}),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:W,onChange:Ue=>Z(Ue.target.value),className:`${lt} 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"})]})]})]})]}),X.actor_type==="human"&&s.jsx(Sp,{channels:Q,onChange:re}),s.jsxs("div",{className:"flex gap-2 pt-3",children:[s.jsx("button",{onClick:$n,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:()=>H(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 ${_e%2===1?"bg-surface-sunken/30":""}`,onClick:()=>vn(X.id),children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(xj,{actor:X}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-foreground",children:X.display_name}),X.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 ${pj[X.actor_type]}`,children:X.actor_type})}),s.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:X.email||"—"}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[X.phone&&s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(oc,{className:"w-3 h-3"})," ",X.phone]}),Wl(X.metadata).slice(0,2).map((Ue,et)=>s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(hi,{className:"w-3 h-3"})," ",Ue.channel_type,": ",Ue.handle]},et)),!X.phone&&Wl(X.metadata).length===0&&s.jsx("span",{className:"text-xs text-muted-foreground/40",children:"—"})]})}),s.jsx("td",{className:"px-4 py-3",children:X.actor_type==="human"?X.role?s.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full border ${dd[X.role]??dd.member}`,children:hj[X.role]??X.role}):s.jsx("span",{className:"text-xs text-muted-foreground/40",children:"—"}):s.jsxs("div",{className:"text-xs text-muted-foreground",children:[X.agent_identifier&&s.jsx("div",{className:"font-mono",children:X.agent_identifier}),X.agent_model&&s.jsx("div",{className:"text-muted-foreground/60",children:X.agent_model}),!X.agent_identifier&&!X.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 ${X.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(Qb,{className:"w-2.5 h-2.5"}),X.is_active?"Active":"Inactive"]})}),s.jsx("td",{className:"px-2 py-3",onClick:Ue=>Ue.stopPropagation(),children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[s.jsx("button",{onClick:()=>vn(X.id),className:`p-1.5 rounded-lg transition-colors ${M===X.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Permissions & Keys",children:s.jsx(ka,{className:`w-3.5 h-3.5 transition-transform ${M===X.id?"rotate-90":""}`})}),s.jsx("button",{onClick:()=>Fn(X),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(ns,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>Vn(X),className:`p-1.5 rounded-lg transition-colors opacity-0 group-hover:opacity-100 ${X.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:X.is_active?"Deactivate":"Activate",children:X.is_active?s.jsx(Gb,{className:"w-3.5 h-3.5"}):s.jsx(Xb,{className:"w-3.5 h-3.5"})})]})})]}),s.jsx(Rn,{children:M===X.id&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:s.jsx(gj,{actor:X,onClose:()=>D(null)})})})})]})},X.id))})]})}),s.jsx(Tr,{page:S,pageSize:P,total:oe.length,onPageChange:E,onPageSizeChange:A,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:de.map((X,_e)=>L===X.id?s.jsxs(Ve.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:V,onChange:Ue=>O(Ue.target.value),className:lt})]}),X.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:Ue=>R(Ue.target.value),className:lt})]}),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:W,onChange:Ue=>Z(Ue.target.value),className:`${lt} 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"})]})]})]})]}),X.actor_type==="human"&&s.jsx(Sp,{channels:Q,onChange:re}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:$n,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:()=>H(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"})]})]},X.id):s.jsxs(Ve.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:_e*.02},className:`bg-card border rounded-2xl p-4 hover:shadow-md transition-all group relative ${X.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(xj,{actor:X,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:X.display_name}),s.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded border capitalize ${pj[X.actor_type]}`,children:X.actor_type}),X.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:X.email||(X.agent_identifier??"No email")})]})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{onClick:()=>vn(X.id),className:`p-1.5 rounded-lg transition-colors ${M===X.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Permissions & Keys",children:s.jsx(ka,{className:`w-3.5 h-3.5 transition-transform ${M===X.id?"rotate-90":""}`})}),s.jsx("button",{onClick:()=>Fn(X),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(ns,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>Vn(X),className:`p-1.5 rounded-lg transition-colors md:opacity-0 md:group-hover:opacity-100 ${X.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:X.is_active?s.jsx(Gb,{className:"w-3.5 h-3.5"}):s.jsx(Xb,{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:[X.actor_type==="human"&&X.role&&s.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full border ${dd[X.role]??dd.member}`,children:hj[X.role]??X.role}),X.actor_type==="agent"&&X.agent_model&&s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:X.agent_model}),s.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${X.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(Qb,{className:"w-2.5 h-2.5"}),X.is_active?"Active":"Inactive"]})]}),X.created_at&&s.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(X.created_at).toLocaleDateString()})]}),(X.phone||Wl(X.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:[X.phone&&s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(oc,{className:"w-3 h-3"})," ",X.phone]}),Wl(X.metadata).map((Ue,et)=>s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(hi,{className:"w-3 h-3"})," ",Ue.channel_type,": ",Ue.handle]},et))]}),s.jsx(Rn,{children:M===X.id&&s.jsx("div",{className:"mt-3 -mx-4 -mb-4",children:s.jsx(gj,{actor:X,onClose:()=>D(null)})})})]},X.id))}),s.jsx(Tr,{page:S,pageSize:P,total:oe.length,onPageChange:E,onPageSizeChange:A})]})]})]})}const Mz=[{icon:zT,label:"Profile",path:"/settings",roles:["member","admin","owner"]},{icon:XT,label:"Appearance",path:"/settings/appearance",roles:["member","admin","owner"]},{icon:IN,label:"API Keys",path:"/settings/api-keys",roles:["member","admin","owner"]},{icon:YT,label:"Webhooks",path:"/settings/webhooks",roles:["admin","owner"]},{icon:QT,label:"Custom Fields",path:"/settings/custom-fields",roles:["admin","owner"]},{icon:ko,label:"Actors",path:"/settings/actors",roles:["admin","owner"]},{icon:Oo,label:"Local AI Agent",path:"/settings/agent",roles:["admin","owner"]},{icon:DN,label:"Database",path:"/settings/database",roles:["admin","owner"]}];function Dz(){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground",children:[s.jsx(IN,{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 Ul({roles:e,children:t}){const n=Ef();return!n||!e.includes(n.role)?s.jsx(Dz,{}):s.jsx(s.Fragment,{children:t})}function Rz(){const e=Ef(),t=lF(),[n,r]=x.useState((e==null?void 0:e.name)??""),[a,l]=x.useState((e==null?void 0:e.email)??""),[c,d]=x.useState(""),[f,m]=x.useState(""),[p,g]=x.useState(""),[b,y]=x.useState(!1),[k,N]=x.useState(!1),w=(e==null?void 0:e.role)==="owner",_=(e==null?void 0:e.role)==="admin"||w,j="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){he({title:"Passwords do not match",variant:"destructive"});return}if(f&&f.length<8){he({title:"Password too short",description:"Must be at least 8 characters.",variant:"destructive"});return}try{const A={};if(n.trim()&&n.trim()!==(e==null?void 0:e.name)&&(A.name=n.trim()),a.trim()&&a.trim()!==(e==null?void 0:e.email)&&(A.email=a.trim()),f&&(A.current_password=c,A.new_password=f),Object.keys(A).length===0){he({title:"No changes to save"});return}const M=await t.mutateAsync(A),D=localStorage.getItem("crmy_user");if(D){const Y=JSON.parse(D);localStorage.setItem("crmy_user",JSON.stringify({...Y,name:M.name,email:M.email}))}d(""),m(""),g(""),N(!0),setTimeout(()=>N(!1),3e3),he({title:"Profile updated"})}catch(A){he({title:"Failed to update profile",description:A instanceof Error?A.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:A=>r(A.target.value),className:j,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:A=>l(A.target.value),className:j,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(A=>!A),className:"text-xs text-primary hover:underline",children:b?"Cancel":"Change"})]}),b&&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:A=>d(A.target.value),className:j,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:A=>m(A.target.value),className:j,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:A=>g(A.target.value),className:j,placeholder:"Repeat new password",onKeyDown:A=>A.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(Cr,{className:"w-3.5 h-3.5"})," Saved"]})]})]})]})}function Oz(){const{darkVariant:e,setDarkVariant:t}=Je(),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 Og=[{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"}]}],Lz=Og.flatMap(e=>e.scopes);function Iz(){const{data:e,isLoading:t}=C2(),{data:n}=Af({is_active:!0,limit:100}),r=k2(),a=iF(),l=S2(),[c,d]=x.useState("table"),[f,m]=x.useState(""),[p,g]=x.useState(""),[b,y]=x.useState("all"),[k,N]=x.useState({key:"created_at",dir:"desc"}),[w,_]=x.useState(1),[j,S]=x.useState(!1),[E,P]=x.useState(""),[A,M]=x.useState(["read","write"]),[D,Y]=x.useState(""),[q,F]=x.useState(""),[B,se]=x.useState(null),[G,L]=x.useState(null),[H,$]=x.useState(null),[R,W]=x.useState(null),[Z,V]=x.useState(""),[O,Q]=x.useState(""),[re,oe]=x.useState(""),[de,le]=x.useState([]),[be,we]=x.useState(null),pe=10,mt=(e==null?void 0:e.data)??[],on=(n==null?void 0:n.data)??[],Dt=x.useMemo(()=>{let te=[...mt];if(f){const Ce=f.toLowerCase();te=te.filter(Te=>{var ln,bn;return((ln=Te.label)==null?void 0:ln.toLowerCase().includes(Ce))||((bn=Te.actor_name)==null?void 0:bn.toLowerCase().includes(Ce))})}return p&&(te=te.filter(Ce=>{var Te;return(Te=Ce.scopes)==null?void 0:Te.includes(p)})),b==="used"&&(te=te.filter(Ce=>!!Ce.last_used_at)),b==="never"&&(te=te.filter(Ce=>!Ce.last_used_at)),te.sort((Ce,Te)=>{const ln=k.key==="label"?Ce.label??"":Ce[k.key]??"",bn=k.key==="label"?Te.label??"":Te[k.key]??"";return k.dir==="asc"?ln.localeCompare(bn):bn.localeCompare(ln)}),te},[mt,f,p,b,k]),In=Dt.slice((w-1)*pe,w*pe),Fn=()=>{S(!1),P(""),M(["read","write"]),Y(""),F("")},$n=async()=>{if(!(!E.trim()||A.length===0))try{const te={label:E.trim(),scopes:A};D&&(te.actor_id=D),q&&(te.expires_at=new Date(q).toISOString());const Ce=await r.mutateAsync(te);se(Ce.key??null),Fn(),he({title:"API key created",description:"Copy and store it safely — it won't be shown again."})}catch(te){he({title:"Failed to create API key",description:te instanceof Error?te.message:"Please try again.",variant:"destructive"})}},vn=async te=>{try{await l.mutateAsync(te),L(null),he({title:"API key revoked"})}catch(Ce){he({title:"Failed to revoke key",description:Ce instanceof Error?Ce.message:"Please try again.",variant:"destructive"})}},Vn=te=>{W(te.id),V(te.label??""),Q(te.actor_id??""),oe(te.expires_at?new Date(te.expires_at).toISOString().slice(0,10):""),$(null)},an=()=>{W(null)},lt=async()=>{if(!(!R||!Z.trim()))try{const te={id:R,label:Z.trim()};te.actor_id=O||null,te.expires_at=re?new Date(re).toISOString():null,await a.mutateAsync(te),W(null),he({title:"API key updated"})}catch(te){he({title:"Failed to update API key",description:te instanceof Error?te.message:"Please try again.",variant:"destructive"})}},X=te=>{we(te.id),le(te.scopes??[])},_e=async te=>{try{await a.mutateAsync({id:te,scopes:de}),we(null),he({title:"Scopes updated"})}catch(Ce){he({title:"Failed to update scopes",description:Ce instanceof Error?Ce.message:"Please try again.",variant:"destructive"})}},Ue=te=>M(Ce=>Ce.includes(te)?Ce.filter(Te=>Te!==te):[...Ce,te]),et=te=>le(Ce=>Ce.includes(te)?Ce.filter(Te=>Te!==te):[...Ce,te]),Tt=te=>te?new Date(te).toLocaleDateString():null,ct=te=>{if(!te)return"Never used";const Ce=Math.floor((Date.now()-new Date(te).getTime())/864e5);return Ce===0?"Used today":Ce===1?"Used yesterday":Ce<30?`Used ${Ce}d ago`:`Used ${Tt(te)}`},Ut=({sk:te,label:Ce})=>s.jsxs("button",{onClick:()=>{N(Te=>Te.key===te?{key:te,dir:Te.dir==="asc"?"desc":"asc"}:{key:te,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:[Ce,k.key===te&&(k.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}))]}),as=({name:te,type:Ce})=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-sm text-foreground truncate",children:te}),s.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded border capitalize flex-shrink-0 ${Ce==="agent"?"bg-blue-500/10 text-blue-500 border-blue-500/30":"bg-amber-500/10 text-amber-600 border-amber-500/30"}`,children:Ce})]});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."})]}),B&&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:B}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(B),he({title:"Copied!"})},className:"p-1.5 rounded-lg hover:bg-muted transition-colors flex-shrink-0",children:s.jsx(MN,{className:"w-3.5 h-3.5 text-muted-foreground"})})]}),s.jsx("button",{onClick:()=>se(null),className:"mt-2 text-xs text-muted-foreground hover:text-foreground",children:"Dismiss"})]}),j&&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:Fn,className:"p-1.5 rounded-lg hover:bg-muted text-muted-foreground transition-colors",children:s.jsx(Ln,{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:te=>P(te.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:te=>te.key==="Enter"&&$n(),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:te=>Y(te.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"}),on.map(te=>s.jsxs("option",{value:te.id,children:[te.display_name," (",te.actor_type,")"]},te.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:q,onChange:te=>F(te.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:Og.map(te=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:te.label}),te.scopes.map(Ce=>s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:A.includes(Ce.value),onChange:()=>Ue(Ce.value),className:"w-3.5 h-3.5 rounded border-border accent-primary"}),s.jsx("span",{className:"text-xs text-foreground",children:Ce.label})]},Ce.value))]},te.label))})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{onClick:$n,disabled:!E.trim()||A.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:Fn,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(Cc,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx("input",{value:f,onChange:te=>{m(te.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:te=>{g(te.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"}),Lz.map(te=>s.jsx("option",{value:te.value,children:te.label},te.value))]}),s.jsxs("select",{value:b,onChange:te=>{y(te.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:te=>{const[Ce,Te]=te.target.value.split("_");N({key:Ce,dir:Te}),_(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:()=>d("table"),className:`p-2 transition-colors ${c==="table"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:s.jsx(Ta,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>d("card"),className:`p-2 transition-colors ${c==="card"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:s.jsx(Nc,{className:"w-4 h-4"})})]}),s.jsxs("button",{onClick:()=>S(!0),disabled:j,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(Io,{className:"w-4 h-4"})," New Key"]})]}),t?s.jsx("div",{className:"space-y-2",children:[...Array(3)].map((te,Ce)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-2xl animate-pulse"},Ce))}):Dt.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-14 text-center",children:[s.jsx(Gl,{className:"w-8 h-8 text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:mt.length===0?"No API keys yet. Create one to get started.":"No keys match your filters."}),mt.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(Ut,{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(Ut,{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(Ut,{sk:"created_at",label:"Created"})}),s.jsx("th",{className:"px-2 py-3 w-20"})]})}),s.jsx("tbody",{children:In.map((te,Ce)=>s.jsx(ue.Fragment,{children:R===te.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:Z,onChange:Te=>V(Te.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:O,onChange:Te=>Q(Te.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"}),on.map(Te=>s.jsxs("option",{value:Te.id,children:[Te.display_name," (",Te.actor_type,")"]},Te.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:re,onChange:Te=>oe(Te.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:lt,disabled:!Z.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:an,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 ${Ce%2===1?"bg-surface-sunken/30":""}`,onClick:()=>{$(Te=>Te===te.id?null:te.id),we(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(Gl,{className:"w-3.5 h-3.5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-foreground",children:te.label}),s.jsxs("p",{className:"text-[10px] font-mono text-muted-foreground",children:[te.id.slice(0,14),"…"]})]})]})}),s.jsx("td",{className:"px-4 py-3 hidden md:table-cell",onClick:Te=>Te.stopPropagation(),children:s.jsxs("button",{onClick:()=>{$(Te=>Te===te.id?null:te.id),we(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:[(te.scopes??[]).length," scope",(te.scopes??[]).length!==1?"s":""]}),s.jsx(ka,{className:`w-3 h-3 text-muted-foreground transition-transform ${H===te.id?"rotate-90":""}`})]})}),s.jsx("td",{className:"px-4 py-3 hidden lg:table-cell",children:te.actor_name?s.jsx(as,{name:te.actor_name,type:te.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 ${te.last_used_at?"text-foreground":"text-muted-foreground"}`,children:ct(te.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:Tt(te.created_at)}),te.expires_at&&s.jsxs("p",{className:`text-[10px] mt-0.5 ${new Date(te.expires_at)<new Date?"text-destructive":"text-muted-foreground"}`,children:["Exp: ",Tt(te.expires_at)]})]}),s.jsx("td",{className:"px-2 py-3",onClick:Te=>Te.stopPropagation(),children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[G===te.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:()=>vn(te.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:()=>L(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:()=>Vn(te),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(ns,{className:"w-3.5 h-3.5"})}),s.jsx("button",{onClick:()=>L(te.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(Ss,{className:"w-3.5 h-3.5"})})]}),s.jsx("button",{onClick:()=>{$(Te=>Te===te.id?null:te.id),we(null)},className:`p-1.5 rounded-lg transition-colors ${H===te.id?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:s.jsx(ka,{className:`w-3.5 h-3.5 transition-transform ${H===te.id?"rotate-90":""}`})})]})})]}),s.jsx(Rn,{children:H===te.id&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"p-0 border-b border-border last:border-0",children:s.jsx(Ve.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:(te.scopes??[]).length})]}),be!==te.id?s.jsx("button",{onClick:()=>X(te),className:"text-xs font-semibold text-primary hover:underline",children:"Edit"}):s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>_e(te.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:()=>we(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:be===te.id?s.jsx("div",{className:"space-y-3",children:Og.map(Te=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:Te.label}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:Te.scopes.map(ln=>{const bn=de.includes(ln.value);return s.jsx("button",{onClick:()=>et(ln.value),className:`px-2.5 py-1 rounded-md text-xs font-medium border transition-colors ${bn?"bg-primary/10 text-primary border-primary/30":"bg-muted/50 border-border text-muted-foreground hover:text-foreground"}`,children:ln.label},ln.value)})})]},Te.label))}):s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(te.scopes??[]).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scopes assigned."}):(te.scopes??[]).map(Te=>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:Te},Te))})})]})})})})})})]})},te.id))})]})})}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:In.map(te=>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(Gl,{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:te.label}),s.jsxs("p",{className:"text-[10px] font-mono text-muted-foreground",children:[te.id.slice(0,14),"…"]})]})]}),G===te.id?s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{onClick:()=>vn(te.id),className:"px-2 py-0.5 rounded bg-destructive text-destructive-foreground text-[10px] font-semibold",children:"Revoke"}),s.jsx("button",{onClick:()=>L(null),className:"px-2 py-0.5 rounded bg-muted text-muted-foreground text-[10px]",children:"✕"})]}):s.jsx("button",{onClick:()=>L(te.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(Ss,{className:"w-3.5 h-3.5"})})]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:(te.scopes??[]).map(Ce=>s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono bg-muted text-muted-foreground border border-border",children:Ce},Ce))}),s.jsxs("div",{className:"space-y-1.5 pt-2 border-t border-border",children:[te.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(as,{name:te.actor_name,type:te.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 ${te.last_used_at?"text-foreground":"text-muted-foreground"}`,children:ct(te.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:Tt(te.created_at)})]}),te.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(te.expires_at)<new Date?"text-destructive font-medium":"text-foreground"}`,children:Tt(te.expires_at)})]})]})]},te.id))}),s.jsx(Tr,{page:w,pageSize:pe,total:Dt.length,onPageChange:_})]})}function Fz(){const{data:e,isLoading:t}=YI(),n=QI(),r=GI(),[a,l]=x.useState(!1),[c,d]=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"]}),d(""),l(!1),he({title:"Webhook created"})}catch{he({title:"Error",description:"Failed to create webhook.",variant:"destructive"})}},p=async g=>{try{await r.mutateAsync(g),he({title:"Webhook deleted"})}catch{he({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(Io,{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=>d(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),d("")},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,b)=>s.jsx("div",{className:"h-14 bg-muted/50 rounded-xl animate-pulse"},b))}):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(b=>s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono bg-muted text-muted-foreground",children:b},b))})]}),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(Ss,{className:"w-3.5 h-3.5"})})]},g.id))})]})}const $z=[{key:"contact",label:"Contact"},{key:"account",label:"Account"},{key:"opportunity",label:"Opportunity"},{key:"use_case",label:"Use Case"},{key:"activity",label:"Activity"}],Ty=[{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 Vz(e){var t;return((t=Ty.find(n=>n.value===e))==null?void 0:t.color)??"bg-muted text-muted-foreground border-border"}function Bz(e){var t;return((t=Ty.find(n=>n.value===e))==null?void 0:t.label)??e}function yj(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function zz(){const[e,t]=x.useState("contact"),[n,r]=x.useState(!1),[a,l]=x.useState(""),[c,d]=x.useState("text"),[f,m]=x.useState(!1),[p,g]=x.useState(""),[b,y]=x.useState(null),[k,N]=x.useState(""),[w,_]=x.useState(!1),[j,S]=x.useState(""),[E,P]=x.useState(null),{data:A,isLoading:M}=Xi(e),D=XI(),Y=ZI(),q=JI(),F=(A==null?void 0:A.fields)??[],B=async()=>{if(a.trim())try{const R=(c==="select"||c==="multi_select")&&p.trim()?p.split(",").map(W=>W.trim()).filter(Boolean):void 0;await D.mutateAsync({label:a.trim(),field_name:yj(a),field_type:c,object_type:e,required:f,...R?{options:R}:{}}),l(""),d("text"),m(!1),g(""),r(!1),he({title:"Custom field created"})}catch{he({title:"Error",description:"Failed to create field.",variant:"destructive"})}},se=$=>{y($.id),N($.label??""),_($.is_required??!1),S(Array.isArray($.options)?$.options.join(", "):""),r(!1)},G=async()=>{if(!(!b||!k.trim()))try{const $=F.find(Z=>Z.id===b),W=(($==null?void 0:$.field_type)==="select"||($==null?void 0:$.field_type)==="multi_select")&&j.trim()?j.split(",").map(Z=>Z.trim()).filter(Boolean):void 0;await Y.mutateAsync({id:b,label:k.trim(),required:w,...W!==void 0?{options:W}:{}}),y(null),he({title:"Custom field updated"})}catch{he({title:"Error",description:"Failed to update field.",variant:"destructive"})}},L=async $=>{try{await q.mutateAsync($),P(null),he({title:"Custom field deleted"})}catch{he({title:"Error",description:"Failed to delete field.",variant:"destructive"})}},H="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(Io,{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:$z.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:H,onKeyDown:$=>$.key==="Enter"&&B()}),a.trim()&&s.jsxs("p",{className:"text-[11px] text-muted-foreground font-mono",children:["key: ",yj(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:Ty.map($=>s.jsx("button",{onClick:()=>d($.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:H})]}),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:B,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))}):F.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No custom fields for this object type yet."}):F.map($=>s.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:b===$.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=>N(R.target.value),className:H})]}),($.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:j,onChange:R=>S(R.target.value),placeholder:"Option A, Option B",className:H})]}),s.jsxs("button",{type:"button",onClick:()=>_(!w),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg border text-xs font-semibold transition-all ${w?"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 ${w?"bg-primary border-primary":"border-border"}`,children:w&&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:G,disabled:!k.trim()||Y.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:Y.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:()=>L($.id),disabled:q.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:q.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 ${Vz($.field_type)}`,children:Bz($.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:()=>{se($),P(null)},className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:s.jsx(ns,{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(Ss,{className:"w-3.5 h-3.5"})})]})]})},$.id))})]})}function Wz(){const{data:e,isLoading:t}=nF(),n=rF(),r=sF(),[a,l]=x.useState(!1),[c,d]=x.useState(""),[f,m]=x.useState("idle"),[p,g]=x.useState(""),[b,y]=x.useState(""),k=e,N=async()=>{m("testing"),g(""),y("");try{await n.mutateAsync(c),m("ok")}catch(_){m("fail"),g(_ instanceof Error?_.message:"Connection failed")}},w=async()=>{try{const _=await r.mutateAsync(c);y(_.message),l(!1),d(""),m("idle"),he({title:"Database config saved",description:_.message})}catch(_){he({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((_,j)=>s.jsx("div",{className:"h-10 bg-muted/50 rounded-lg animate-pulse"},j))}):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))]}),b&&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(Cr,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:b})]}),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:_=>{d(_.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(Cr,{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(Ai,{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:N,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:w,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),d(""),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(DN,{className:"w-3.5 h-3.5"})," Edit Connection"]})]})]})}function Uz(){const e=or(),t=Ef(),n=(t==null?void 0:t.role)??"member",r=Mz.filter(l=>l.roles.includes(n)),{enabled:a}=ar();return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx(Ds,{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(sc,{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(sc,{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(Qg,{children:[s.jsx(xt,{index:!0,element:s.jsx(Rz,{})}),s.jsx(xt,{path:"appearance",element:s.jsx(Oz,{})}),s.jsx(xt,{path:"api-keys",element:s.jsx(Iz,{})}),s.jsx(xt,{path:"webhooks",element:s.jsx(Ul,{roles:["admin","owner"],children:s.jsx(Fz,{})})}),s.jsx(xt,{path:"custom-fields",element:s.jsx(Ul,{roles:["admin","owner"],children:s.jsx(zz,{})})}),s.jsx(xt,{path:"actors",element:s.jsx(Ul,{roles:["admin","owner"],children:s.jsx(Az,{})})}),s.jsx(xt,{path:"agent",element:s.jsx(Ul,{roles:["admin","owner"],children:s.jsx(Ez,{})})}),s.jsx(xt,{path:"database",element:s.jsx(Ul,{roles:["admin","owner"],children:s.jsx(Wz,{})})})]})})]})]})}const Hz=()=>{const e=or();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"})]})})},of={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"},p5={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"},af=["pending","accepted","in_progress","blocked"],qz=[{key:"needs_attention",label:"Needs Attention"},{key:"delegated",label:"Delegated"},{key:"all",label:"All"}],Kz=[{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"}]}],Yz=[{key:"created_at",label:"Created"},{key:"due_at",label:"Due Date"},{key:"priority",label:"Priority"},{key:"status",label:"Status"},{key:"title",label:"Title"}],fd={urgent:0,high:1,normal:2,low:3};function Ay(e){try{return pS($f(e),{addSuffix:!0})}catch{return""}}function Qz(e){if(!e)return null;try{const t=$f(e);return gy(t)?{label:"Expired",urgent:!0}:{label:`Expires ${pS(t,{addSuffix:!0})}`,urgent:t.getTime()-Date.now()<1800*1e3}}catch{return null}}function Gz({req:e}){const t=KI(),[n,r]=x.useState(""),[a,l]=x.useState(!1),[c,d]=x.useState(null),f=Qz(e.expires_at);async function m(p){d(p==="approved"?"approve":"reject");try{await t.mutateAsync({id:e.id,status:p,note:n.trim()||void 0}),he({title:p==="approved"?"Approved":"Rejected",description:e.action_summary})}catch{he({title:"Error",description:"Could not resolve request.",variant:"destructive"})}finally{d(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(Oo,{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(PN,{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:Ay(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(ka,{className:`w-3.5 h-3.5 transition-transform ${a?"rotate-90":""}`}),"View payload"]}),s.jsx(Rn,{children:a&&s.jsx(Ve.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(hn,{label:"Reject",icon:s.jsx(Ai,{className:"w-3.5 h-3.5"}),onClick:()=>m("rejected"),loading:c==="reject",color:"destructive"}),s.jsx(hn,{label:"Approve",icon:s.jsx(Cr,{className:"w-3.5 h-3.5"}),onClick:()=>m("approved"),loading:c==="approve",color:"success"})]})]})]})}function Xz({task:e,actorMap:t}){const n=Kx(),r=Gx(),a=Yx(),l=Qx(),c=Xx(),d=Zx(),[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 d.mutateAsync({id:e.id}),he({title:`Assignment ${y}ed`})}catch{he({title:"Error",description:`Could not ${y} assignment.`,variant:"destructive"})}finally{m(null)}}const g=e.due_at&&gy($f(e.due_at))&&!["completed","cancelled","declined"].includes(e.status),b=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(pf,{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 ${of[e.priority]??of.normal}`,children:e.priority}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${p5[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(Di,{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(SN,{className:"w-3 h-3"}),"from ",b]}),e.due_at&&s.jsxs("span",{className:`text-xs flex items-center gap-1 ${g?"text-destructive":"text-muted-foreground"}`,children:[s.jsx(jc,{className:"w-3 h-3"}),Ay(e.due_at)]})]}),e.context&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.context})]})]}),af.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(hn,{label:"Accept",icon:s.jsx(Cr,{className:"w-3.5 h-3.5"}),onClick:()=>p("accept"),loading:f==="accept",color:"success"}),s.jsx(hn,{label:"Decline",icon:s.jsx(Ai,{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(hn,{label:"Start",icon:s.jsx(Mi,{className:"w-3.5 h-3.5"}),onClick:()=>p("start"),loading:f==="start",color:"primary"}),s.jsx(hn,{label:"Decline",icon:s.jsx(Ai,{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(hn,{label:"Complete",icon:s.jsx(Cr,{className:"w-3.5 h-3.5"}),onClick:()=>p("complete"),loading:f==="complete",color:"success"}),s.jsx(hn,{label:"Block",icon:s.jsx(Xp,{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(hn,{label:"Resume",icon:s.jsx(Mi,{className:"w-3.5 h-3.5"}),onClick:()=>p("start"),loading:f==="start",color:"primary"}),s.jsx(hn,{label:"Cancel",icon:s.jsx(gd,{className:"w-3.5 h-3.5"}),onClick:()=>p("cancel"),loading:f==="cancel",color:"ghost"})]})]})]})}function hn({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(LN,{className:"w-3.5 h-3.5 animate-spin"}):t,e]})}function Zz({task:e,actorMap:t,index:n}){const r=Kx(),a=Gx(),l=Yx(),c=Qx(),d=Xx(),f=Zx(),[m,p]=x.useState(null);async function g(N){p(N);try{N==="accept"?await r.mutateAsync(e.id):N==="start"?await a.mutateAsync(e.id):N==="complete"?await l.mutateAsync({id:e.id}):N==="decline"?await c.mutateAsync({id:e.id}):N==="block"?await d.mutateAsync({id:e.id}):N==="cancel"&&await f.mutateAsync({id:e.id}),he({title:`Assignment ${N}ed`})}catch{he({title:"Error",description:`Could not ${N} assignment.`,variant:"destructive"})}finally{p(null)}}const b=e.due_at&&gy($f(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 ${of[e.priority]??of.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 ${p5[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 ${b?"text-destructive font-medium":"text-muted-foreground"}`,children:e.due_at?Ay(e.due_at):"—"}),s.jsx("td",{className:"px-4 py-3",children:af.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(hn,{label:"Accept",icon:s.jsx(Cr,{className:"w-3 h-3"}),onClick:()=>g("accept"),loading:m==="accept",color:"success"}),s.jsx(hn,{label:"Decline",icon:s.jsx(Ai,{className:"w-3 h-3"}),onClick:()=>g("decline"),loading:m==="decline",color:"ghost"})]}),e.status==="accepted"&&s.jsx(hn,{label:"Start",icon:s.jsx(Mi,{className:"w-3 h-3"}),onClick:()=>g("start"),loading:m==="start",color:"primary"}),e.status==="in_progress"&&s.jsx(hn,{label:"Complete",icon:s.jsx(Cr,{className:"w-3 h-3"}),onClick:()=>g("complete"),loading:m==="complete",color:"success"}),e.status==="blocked"&&s.jsx(hn,{label:"Resume",icon:s.jsx(Mi,{className:"w-3 h-3"}),onClick:()=>g("start"),loading:m==="start",color:"primary"})]})})]})}function vj({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(ON,{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 Jz(){var Z,V,O;const[e,t]=x.useState("needs_attention"),[n,r]=x.useState("card"),[a,l]=x.useState(""),[c,d]=x.useState({}),[f,m]=x.useState({key:"created_at",dir:"desc"}),[p,g]=x.useState(1),b=25,{openQuickAdd:y}=Je(),{data:k}=E2(),N=k==null?void 0:k.actor_id,w=N2(),_=sp(N?{assigned_to:N,limit:200}:void 0),j=sp(N?{assigned_by:N,limit:200}:void 0),S=sp({limit:200}),E=Af({limit:100}),P=x.useMemo(()=>{var re,oe;const Q=new Map;return(((re=E.data)==null?void 0:re.actors)??((oe=E.data)==null?void 0:oe.data)??[]).forEach(de=>{Q.set(de.id,de.display_name??de.name??de.email??de.id)}),Q},[E.data]),A=x.useMemo(()=>{var Q;return(((Q=w.data)==null?void 0:Q.data)??[]).filter(re=>re.status==="pending")},[w.data]),M=((Z=_.data)==null?void 0:Z.assignments)??[],D=((V=j.data)==null?void 0:V.assignments)??[],Y=((O=S.data)==null?void 0:O.assignments)??[],q=x.useMemo(()=>M.filter(Q=>af.includes(Q.status)),[M]),F=x.useMemo(()=>D.filter(Q=>af.includes(Q.status)&&Q.assigned_to!==N),[D,N]),B=x.useMemo(()=>e==="needs_attention"?q:e==="delegated"?F:Y,[e,q,F,Y]),se=x.useMemo(()=>{var re,oe,de;let Q=[...B];if(a.trim()){const le=a.toLowerCase();Q=Q.filter(be=>be.title.toLowerCase().includes(le)||(be.context??"").toLowerCase().includes(le)||(be.description??"").toLowerCase().includes(le))}return(re=c.status)!=null&&re.length&&(Q=Q.filter(le=>c.status.includes(le.status))),(oe=c.priority)!=null&&oe.length&&(Q=Q.filter(le=>c.priority.includes(le.priority))),(de=c.assignment_type)!=null&&de.length&&(Q=Q.filter(le=>c.assignment_type.includes(le.assignment_type))),f&&Q.sort((le,be)=>{if(f.key==="priority")return f.dir==="asc"?(fd[le.priority]??2)-(fd[be.priority]??2):(fd[be.priority]??2)-(fd[le.priority]??2);const we=le[f.key]??"",pe=be[f.key]??"";return f.dir==="asc"?String(we).localeCompare(String(pe)):String(pe).localeCompare(String(we))}),Q},[B,a,c,f]);x.useEffect(()=>{g(1)},[e,a,c,f]);const G=se.slice((p-1)*b,p*b),L=A.length+q.length,H=w.isLoading||_.isLoading||S.isLoading,$=(Q,re)=>{d(oe=>{const de={...oe};return re.length===0?delete de[Q]:de[Q]=re,de})},R=Q=>{m(re=>(re==null?void 0:re.key)===Q?{key:Q,dir:re.dir==="asc"?"desc":"asc"}:{key:Q,dir:"asc"})},W=({label:Q,sortKey:re})=>s.jsx("th",{onClick:()=>R(re),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:[Q,(f==null?void 0:f.key)===re&&(f.dir==="asc"?s.jsx(ss,{className:"w-3 h-3"}):s.jsx(Ar,{className:"w-3 h-3"}))]})});return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsx(Ds,{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:Nc},{mode:"table",icon:Ta}].map(({mode:Q,icon:re})=>s.jsx("button",{onClick:()=>r(Q),className:`p-1.5 rounded-lg transition-all ${n===Q?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:s.jsx(re,{className:"w-4 h-4"})},Q))})}),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:qz.map(Q=>s.jsxs("button",{onClick:()=>t(Q.key),className:["px-3 py-1.5 text-xs font-medium rounded-lg transition-all flex items-center gap-1.5",e===Q.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"].join(" "),children:[Q.label,Q.key==="needs_attention"&&L>0&&s.jsx("span",{className:`min-w-[16px] h-4 px-1 rounded-full text-[10px] font-bold flex items-center justify-center ${e===Q.key?"bg-destructive text-white":"bg-muted-foreground/20 text-muted-foreground"}`,children:L})]},Q.key))})}),s.jsx(Aa,{searchValue:a,onSearchChange:l,searchPlaceholder:"Search assignments...",filters:Kz,activeFilters:c,onFilterChange:$,onClearFilters:()=>d({}),sortOptions:Yz,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:H?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(LN,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):s.jsxs(s.Fragment,{children:[e==="needs_attention"&&A.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:A.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:A.map(Q=>s.jsx(Gz,{req:Q},Q.id))})]}),G.length===0&&A.length===0?s.jsx(vj,{tab:e}):G.length===0&&e==="needs_attention"?null:G.length===0?s.jsx(vj,{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"&&G.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:G.length}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),G.map(Q=>s.jsx(Xz,{task:Q,actorMap:P},Q.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(W,{label:"Priority",sortKey:"priority"}),s.jsx(W,{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(W,{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(W,{label:"Due",sortKey:"due_at"}),s.jsx("th",{className:"px-4 py-3"})]})}),s.jsx("tbody",{children:G.map((Q,re)=>s.jsx(Zz,{task:Q,actorMap:P,index:re},Q.id))})]})})}),se.length>b&&s.jsx("div",{className:"px-4 md:px-6 pt-4",children:s.jsx(Tr,{page:p,pageSize:b,total:se.length,onPageChange:g,onPageSizeChange:()=>{}})})]})})]})}function eW(){const{darkVariant:e}=Je();return KS(),x.useEffect(()=>{const t=document.documentElement;e==="charcoal"?t.classList.add("charcoal"):t.classList.remove("charcoal")},[e]),null}function tW({children:e}){return localStorage.getItem("crmy_token")?s.jsx(s.Fragment,{children:e}):s.jsx(Ld,{to:"/login",replace:!0})}function nW(){const e=or();return s.jsx(Rn,{mode:"wait",children:s.jsx(Ve.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(Qg,{location:e,children:[s.jsx(xt,{path:"/",element:s.jsx(B7,{})}),s.jsx(xt,{path:"/contacts",element:s.jsx(Z7,{})}),s.jsx(xt,{path:"/accounts",element:s.jsx(tz,{})}),s.jsx(xt,{path:"/opportunities",element:s.jsx(az,{})}),s.jsx(xt,{path:"/use-cases",element:s.jsx(dz,{})}),s.jsx(xt,{path:"/activities",element:s.jsx(gz,{})}),s.jsx(xt,{path:"/assignments",element:s.jsx(Jz,{})}),s.jsx(xt,{path:"/inbox",element:s.jsx(Ld,{to:"/assignments",replace:!0})}),s.jsx(xt,{path:"/hitl",element:s.jsx(Ld,{to:"/assignments",replace:!0})}),s.jsx(xt,{path:"/agent",element:s.jsx(bz,{})}),s.jsx(xt,{path:"/settings/*",element:s.jsx(Uz,{})}),s.jsx(xt,{path:"*",element:s.jsx(Hz,{})})]})},e.pathname)})}function rW(){R7();const{drawerType:e,zenMode:t}=Je(),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(bF,{}),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(nW,{})})}),!t&&s.jsx(jF,{}),s.jsxs(m8,{title:n,children:[e==="contact"&&s.jsx(p7,{}),e==="opportunity"&&s.jsx(y7,{}),e==="use-case"&&s.jsx(j7,{}),e==="account"&&s.jsx(S7,{}),e==="assignment"&&s.jsx(D7,{})]}),s.jsx(u8,{}),s.jsx(f8,{}),s.jsx(JB,{}),s.jsx(O7,{})]})}function sW(){return s.jsx(h8,{children:s.jsxs(NM,{children:[s.jsx(z4,{}),s.jsx(AP,{}),s.jsxs(eP,{basename:"/app",children:[s.jsx(eW,{}),s.jsxs(Qg,{children:[s.jsx(xt,{path:"/login",element:s.jsx($7,{})}),s.jsx(xt,{path:"/*",element:s.jsx(tW,{children:s.jsx(rW,{})})})]})]})]})})}const oW=new U_({defaultOptions:{queries:{staleTime:3e4,retry:1}}});b_.createRoot(document.getElementById("root")).render(s.jsx(ue.StrictMode,{children:s.jsx(H_,{client:oW,children:s.jsx(sW,{})})}));
|