PageSourceSearch

https://vidareo.com/assets/index-C85hEJ9_.js

js vidareo.com collected 2026-10-02 01:47:43 UTC 3,055,184 bytes, 1,325 lines download raw bytes

vendor: 5,966 bytes, lines 1-17
1var F3=e=>{throw TypeError(e)};var TC=(e,t,n)=>t.has(e)||F3("Cannot "+n);var he=(e,t,n)=>(TC(e,t,"read from private field"),n?n.call(e):t.get(e)),sr=(e,t,n)=>t.has(e)?F3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Et=(e,t,n,s)=>(TC(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),Ur=(e,t,n)=>(TC(e,t,"access private method"),n);var Bw=(e,t,n,s)=>({set _(a){Et(e,t,a,n)},get _(){return he(e,t,s)}});function ooe(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(s,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>s[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"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var zw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var m9={exports:{}},i_={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and 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 loe=Symbol.for("react.transitional.element"),coe=Symbol.for("react.fragment");function h9(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:loe,type:e,key:s,ref:t!==void 0?t:null,props:n}}i_.Fragment=coe;i_.jsx=h9;i_.jsxs=h9;m9.exports=i_;var r=m9.exports,f9={exports:{}},Or={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and 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 TP=Symbol.for("react.transitional.element"),doe=Symbol.for("react.portal"),uoe=Symbol.for("react.fragment"),moe=Symbol.for("react.strict_mode"),hoe=Symbol.for("react.profiler"),foe=Symbol.for("react.consumer"),poe=Symbol.for("react.context"),xoe=Symbol.for("react.forward_ref"),goe=Symbol.for("react.suspense"),voe=Symbol.for("react.memo"),p9=Symbol.for("react.lazy"),yoe=Symbol.for("react.activity"),B3=Symbol.iterator;function boe(e){return e===null||typeof e!="object"?null:(e=B3&&e[B3]||e["@@iterator"],typeof e=="function"?e:null)}var x9={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g9=Object.assign,v9={};function Jg(e,t,n){this.props=e,this.context=t,this.refs=v9,this.updater=n||x9}Jg.prototype.isReactComponent={};Jg.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Jg.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function y9(){}y9.prototype=Jg.prototype;function RP(e,t,n){this.props=e,this.context=t,this.refs=v9,this.updater=n||x9}var OP=RP.prototype=new y9;OP.constructor=RP;g9(OP,Jg.prototype);OP.isPureReactComponent=!0;var z3=Array.isArray;function cA(){}var gs={H:null,A:null,T:null,S:null},b9=Object.prototype.hasOwnProperty;function PP(e,t,n){var s=n.ref;return{$$typeof:TP,type:e,key:t,ref:s!==void 0?s:null,props:n}}function woe(e,t){return PP(e.type,t,e.props)}function DP(e){return typeof e=="object"&&e!==null&&e.$$typeof===TP}function joe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var q3=/\/+/g;function RC(e,t){return typeof e=="object"&&e!==null&&e.key!=null?joe(""+e.key):t.toString(36)}function Noe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(cA,cA):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ip(e,t,n,s,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case TP:case doe:o=!0;break;case p9:return o=e._init,Ip(o(e._payload),t,n,s,a)}}if(o)return a=a(e),o=s===""?"."+RC(e,0):s,z3(a)?(n="",o!=null&&(n=o.replace(q3,"$&/")+"/"),Ip(a,t,n,"",function(d){return d})):a!=null&&(DP(a)&&(a=woe(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(q3,"$&/")+"/")+o)),t.push(a)),1;o=0;var l=s===""?".":s+":";if(z3(e))for(var c=0;c<e.length;c++)s=e[c],i=l+RC(s,c),o+=Ip(s,t,n,i,a);else if(c=boe(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+RC(s,c++),o+=Ip(s,t,n,i,a);else if(i==="object"){if(typeof e.then=="function")return Ip(Noe(e),t,n,s,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}
vendor: 5,025 bytes, lines 17-25
17function qw(e,t,n){if(e==null)return e;var s=[],a=0;return Ip(e,s,"","",function(i){return t.call(n,i,a++)}),s}function Soe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var H3=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_oe={map:qw,forEach:function(e,t,n){qw(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return qw(e,function(){t++}),t},toArray:function(e){return qw(e,function(t){return t})||[]},only:function(e){if(!DP(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Or.Activity=yoe;Or.Children=_oe;Or.Component=Jg;Or.Fragment=uoe;Or.Profiler=hoe;Or.PureComponent=RP;Or.StrictMode=moe;Or.Suspense=goe;Or.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=gs;Or.__COMPILER_RUNTIME={__proto__:null,c:function(e){return gs.H.useMemoCache(e)}};Or.cache=function(e){return function(){return e.apply(null,arguments)}};Or.cacheSignal=function(){return null};Or.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=g9({},e.props),a=e.key;if(t!=null)for(i in t.key!==void 0&&(a=""+t.key),t)!b9.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];s.children=o}return PP(e.type,a,s)};Or.createContext=function(e){return e={$$typeof:poe,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:foe,_context:e},e};Or.createElement=function(e,t,n){var s,a={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)b9.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(a[s]=t[s]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];a.children=l}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)a[s]===void 0&&(a[s]=o[s]);return PP(e,i,a)};Or.createRef=function(){return{current:null}};Or.forwardRef=function(e){return{$$typeof:xoe,render:e}};Or.isValidElement=DP;Or.lazy=function(e){return{$$typeof:p9,_payload:{_status:-1,_result:e},_init:Soe}};Or.memo=function(e,t){return{$$typeof:voe,type:e,compare:t===void 0?null:t}};Or.startTransition=function(e){var t=gs.T,n={};gs.T=n;try{var s=e(),a=gs.S;a!==null&&a(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(cA,H3)}catch(i){H3(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),gs.T=t}};Or.unstable_useCacheRefresh=function(){return gs.H.useCacheRefresh()};Or.use=function(e){return gs.H.use(e)};Or.useActionState=function(e,t,n){return gs.H.useActionState(e,t,n)};Or.useCallback=function(e,t){return gs.H.useCallback(e,t)};Or.useContext=function(e){return gs.H.useContext(e)};Or.useDebugValue=function(){};Or.useDeferredValue=function(e,t){return gs.H.useDeferredValue(e,t)};Or.useEffect=function(e,t){return gs.H.useEffect(e,t)};Or.useEffectEvent=function(e){return gs.H.useEffectEvent(e)};Or.useId=function(){return gs.H.useId()};Or.useImperativeHandle=function(e,t,n){return gs.H.useImperativeHandle(e,t,n)};Or.useInsertionEffect=function(e,t){return gs.H.useInsertionEffect(e,t)};Or.useLayoutEffect=function(e,t){return gs.H.useLayoutEffect(e,t)};Or.useMemo=function(e,t){return gs.H.useMemo(e,t)};Or.useOptimistic=function(e,t){return gs.H.useOptimistic(e,t)};Or.useReducer=function(e,t,n){return gs.H.useReducer(e,t,n)};Or.useRef=function(e){return gs.H.useRef(e)};Or.useState=function(e){return gs.H.useState(e)};Or.useSyncExternalStore=function(e,t,n){return gs.H.useSyncExternalStore(e,t,n)};Or.useTransition=function(){return gs.H.useTransition()};Or.version="19.2.1";f9.exports=Or;var h=f9.exports;const Y=Mn(h),MP=ooe({__proto__:null,default:Y},[h]);var w9={exports:{}},o_={},j9={exports:{}},N9={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(U,O){var M=U.length;U.push(O);e:for(;0<M;){var $=M-1>>>1,I=U[$];if(0<a(I,O))U[$]=O,U[M]=I,M=$;else break e}}function n(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var O=U[0],M=U.pop();if(M!==O){U[0]=M;e:for(var $=0,I=U.length,B=I>>>1;$<B;){var K=2*($+1)-1,Z=U[K],q=K+1,H=U[q];if(0>
vendor: 11,021 bytes, lines 25-41
25a(Z,M))q<I&&0>a(H,Z)?(U[$]=H,U[q]=M,$=q):(U[$]=Z,U[K]=M,$=K);else if(q<I&&0>a(H,M))U[$]=H,U[q]=M,$=q;else break e}}return O}function a(U,O){var M=U.sortIndex-O.sortIndex;return M!==0?M:U.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,m=null,f=3,p=!1,x=!1,g=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function S(U){for(var O=n(d);O!==null;){if(O.callback===null)s(d);else if(O.startTime<=U)s(d),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(d)}}function j(U){if(g=!1,S(U),!x)if(n(c)!==null)x=!0,N||(N=!0,T());else{var O=n(d);O!==null&&V(j,O.startTime-U)}}var N=!1,_=-1,C=5,k=-1;function E(){return v?!0:!(e.unstable_now()-k<C)}function R(){if(v=!1,N){var U=e.unstable_now();k=U;var O=!0;try{e:{x=!1,g&&(g=!1,b(_),_=-1),p=!0;var M=f;try{t:{for(S(U),m=n(c);m!==null&&!(m.expirationTime>U&&E());){var $=m.callback;if(typeof $=="function"){m.callback=null,f=m.priorityLevel;var I=$(m.expirationTime<=U);if(U=e.unstable_now(),typeof I=="function"){m.callback=I,S(U),O=!0;break t}m===n(c)&&s(c),S(U)}else s(c);m=n(c)}if(m!==null)O=!0;else{var B=n(d);B!==null&&V(j,B.startTime-U),O=!1}}break e}finally{m=null,f=M,p=!1}O=void 0}}finally{O?T():N=!1}}}var T;if(typeof w=="function")T=function(){w(R)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,A=D.port2;D.port1.onmessage=R,T=function(){A.postMessage(null)}}else T=function(){y(R,0)};function V(U,O){_=y(function(){U(e.unstable_now())},O)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(U){switch(f){case 1:case 2:case 3:var O=3;break;default:O=f}var M=f;f=O;try{return U()}finally{f=M}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(U,O){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var M=f;f=U;try{return O()}finally{f=M}},e.unstable_scheduleCallback=function(U,O,M){var $=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?$+M:$):M=$,U){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=M+I,U={id:u++,callback:O,priorityLevel:U,startTime:M,expirationTime:I,sortIndex:-1},M>$?(U.sortIndex=M,t(d,U),n(c)===null&&U===n(d)&&(g?(b(_),_=-1):g=!0,V(j,M-$))):(U.sortIndex=I,t(c,U),x||p||(x=!0,N||(N=!0,T()))),U},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(U){var O=f;return function(){var M=f;f=O;try{return U.apply(this,arguments)}finally{f=M}}}})(N9);j9.exports=N9;var Coe=j9.exports,S9={exports:{}},Li={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and 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 koe=h;function _9(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ku(){}var Oi={d:{f:ku,r:function(){throw Error(_9(522))},D:ku,C:ku,L:ku,m:ku,X:ku,S:ku,M:ku},p:0,findDOMNode:null},Eoe=Symbol.for("react.portal");function Aoe(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Eoe,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var $y=koe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l_(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Li.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Oi;Li.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(_9(299));return Aoe(e,t,null,n)};Li.flushSync=function(e){var t=$y.T,n=Oi.p;try{if($y.T=null,Oi.p=2,e)return e()}finally{$y.T=t,Oi.p=n,Oi.d.f()}};Li.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Oi.d.C(e,t))};Li.prefetchDNS=function(e){typeof e=="string"&&Oi.d.D(e)};Li.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=l_(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Oi.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:a,fetchPriority:i}):n==="script"&&Oi.d.X(e,{crossOrigin:s,integrity:a,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Li.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=l_(t.as,t.crossOrigin);Oi.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Oi.d.M(e)};Li.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=l_(n,t.crossOrigin);Oi.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Li.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=l_(t.as,t.crossOrigin);Oi.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Oi.d.m(e)};Li.requestFormReset=function(e){Oi.d.r(e)};Li.unstable_batchedUpdates=function(e,t){return e(t)};Li.useFormState=function(e,t,n){return $y.H.useFormState(e,t,n)};Li.useFormStatus=function(){return $y.H.useHostTransitionStatus()};Li.version="19.2.1";function C9(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C9)}catch(e){console.error(e)}}C9(),S9.exports=Li;var $d=S9.exports;const IP=Mn($d);/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var Ma=Coe,k9=h,Toe=$d;function Je(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function E9(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function X0(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function A9(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function T9(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function W3(e){if(X0(e)!==e)throw Error(Je(188))}function Roe(e){var t=e.alternate;if(!t){if(t=X0(e),t===null)throw Error(Je(188));return t!==e?null:e}for(var n=e,s=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(s=a.return,s!==null){n=s;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return W3(a),e;if(i===s)return W3(a),t;i=i.sibling}throw Error(Je(188))}if(n.return!==s.return)n=a,s=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o)throw Error(Je(189))}}if(n.alternate!==s)throw Error(Je(190))}if(n.tag!==3)throw Error(Je(188));return n.stateNode.current===n?e:t}function R9(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=R9(e),t!==null)return t;e=e.sibling}return null}var ws=Object.assign,Ooe=Symbol.for("react.element"),Hw=Symbol.for("react.transitional.element"),Sy=Symbol.for("react.portal"),qp=Symbol.for("react.fragment"),O9=Symbol.for("react.strict_mode"),dA=Symbol.for("react.profiler"),P9=Symbol.for("react.consumer"),wd=Symbol.for("react.context"),LP=Symbol.for("react.forward_ref"),uA=Symbol.for("react.suspense"),mA=Symbol.for("react.suspense_list"),$P=Symbol.for("react.memo"),Lu=Symbol.for("react.lazy"),hA=Symbol.for("react.activity"),Poe=Symbol.for("react.memo_cache_sentinel"),Y3=Symbol.iterator;function Yv(e){return e===null||typeof e!="object"?null:(e=Y3&&e[Y3]||e["@@iterator"],typeof e=="function"?e:null)}var Doe=Symbol.for("react.client.reference");function fA(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Doe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qp:return"Fragment";case dA:return"Profiler";case O9:return"StrictMode";case uA:return"Suspense";case mA:return"SuspenseList";case hA:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Sy:return"Portal";case wd:return e.displayName||"Context";case P9:return(e._context.displayName||"Context")+".Consumer";case LP:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $P:return t=e.displayName||null,t!==null?t:fA(e.type)||"Memo";case Lu:t=e._payload,e=e._init;try{return fA(e(t))}catch{}}return null}var _y=Array.isArray,br=k9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yn=Toe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,cf={pending:!1,data:null,method:null,action:null},pA=[],Hp=-1;function Bc(e){return{current:e}}function Ha(e){0>Hp||(e.current=pA[Hp],pA[Hp]=null,Hp--)}function os(e,t){Hp++,pA[Hp]=e.current,e.current=t}var _c=Bc(null),gb=Bc(null),xm=Bc(null),D1=Bc(null);function M1(e,t){switch(os(xm,t),os(gb,e),os(_c,null),t.nodeType){case 9:case 11:e=(e
vendor: 12,080 bytes, lines 41-48
41=t.documentElement)&&(e=e.namespaceURI)?JI(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=JI(t),e=Jq(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ha(_c),os(_c,e)}function Yx(){Ha(_c),Ha(gb),Ha(xm)}function xA(e){e.memoizedState!==null&&os(D1,e);var t=_c.current,n=Jq(t,e.type);t!==n&&(os(gb,e),os(_c,n))}function I1(e){gb.current===e&&(Ha(_c),Ha(gb)),D1.current===e&&(Ha(D1),Eb._currentValue=cf)}var OC,G3;function Ah(e){if(OC===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);OC=t&&t[1]||"",G3=-1<n.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+OC+e+G3}var PC=!1;function DC(e,t){if(!e||PC)return"";PC=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(p){var f=p}Reflect.construct(e,[],m)}else{try{m.call()}catch(p){f=p}e.call(m.prototype)}}else{try{throw Error()}catch(p){f=p}(m=e())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack=="string")return[p.stack,f.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
44`),d=l.split(`
45`);for(a=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;a<d.length&&!d[a].includes("DetermineComponentFrameRoot");)a++;if(s===c.length||a===d.length)for(s=c.length-1,a=d.length-1;1<=s&&0<=a&&c[s]!==d[a];)a--;for(;1<=s&&0<=a;s--,a--)if(c[s]!==d[a]){if(s!==1||a!==1)do if(s--,a--,0>a||c[s]!==d[a]){var u=`
46`+c[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{PC=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ah(n):""}function Moe(e,t){switch(e.tag){case 26:case 27:case 5:return Ah(e.type);case 16:return Ah("Lazy");case 13:return e.child!==t&&t!==null?Ah("Suspense Fallback"):Ah("Suspense");case 19:return Ah("SuspenseList");case 0:case 15:return DC(e.type,!1);case 11:return DC(e.type.render,!1);case 1:return DC(e.type,!0);case 31:return Ah("Activity");default:return""}}function K3(e){try{var t="",n=null;do t+=Moe(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47Error generating stack: `+s.message+`
48`+s.stack}}var gA=Object.prototype.hasOwnProperty,VP=Ma.unstable_scheduleCallback,MC=Ma.unstable_cancelCallback,Ioe=Ma.unstable_shouldYield,Loe=Ma.unstable_requestPaint,_o=Ma.unstable_now,$oe=Ma.unstable_getCurrentPriorityLevel,D9=Ma.unstable_ImmediatePriority,M9=Ma.unstable_UserBlockingPriority,L1=Ma.unstable_NormalPriority,Voe=Ma.unstable_LowPriority,I9=Ma.unstable_IdlePriority,Uoe=Ma.log,Foe=Ma.unstable_setDisableYieldValue,Z0=null,Co=null;function am(e){if(typeof Uoe=="function"&&Foe(e),Co&&typeof Co.setStrictMode=="function")try{Co.setStrictMode(Z0,e)}catch{}}var ko=Math.clz32?Math.clz32:qoe,Boe=Math.log,zoe=Math.LN2;function qoe(e){return e>>>=0,e===0?32:31-(Boe(e)/zoe|0)|0}var Ww=256,Yw=262144,Gw=4194304;function Th(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function c_(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var a=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?a=Th(s):(o&=l,o!==0?a=Th(o):n||(n=l&~e,n!==0&&(a=Th(n))))):(l=s&~i,l!==0?a=Th(l):o!==0?a=Th(o):n||(n=s&~e,n!==0&&(a=Th(n)))),a===0?0:t!==0&&t!==a&&!(t&i)&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Q0(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hoe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function L9(){var e=Gw;return Gw<<=1,!(Gw&62914560)&&(Gw=4194304),e}function IC(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function J0(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Woe(e,t,n,s,a,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ko(n),m=1<<u;l[u]=0,c[u]=-1;var f=d[u];if(f!==null)for(d[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~m}s!==0&&$9(e,s,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function $9(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ko(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function V9(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ko(n),a=1<<s;a&t|e[s]&t&&(e[s]|=t),n&=~a}}function U9(e,t){var n=t&-t;return n=n&42?1:UP(n),n&(e.suspendedLanes|t)?0:n}function UP(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function FP(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function F9(){var e=yn.p;return e!==0?e:(e=window.event,e===void 0?32:dH(e.type))}function X3(e,t){var n=yn.p;try{return yn.p=e,t()}finally{yn.p=n}}var Xm=Math.random().toString(36).slice(2),ii="__reactFiber$"+Xm,no="__reactProps$"+Xm,ev="__reactContainer$"+Xm,vA="__reactEvents$"+Xm,Yoe="__reactListeners$"+Xm,Goe="__reactHandles$"+Xm,Z3="__reactResources$"+Xm,ew="__reactMarker$"+Xm;function BP(e){delete e[ii],delete e[no],delete e[vA],delete e[Yoe],delete e[Goe]}function Wp(e){var t=e[ii];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ev]||n[ii]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=sL(e);e!==null;){if(n=e[ii])return n;e=sL(e)}return t}e=n,n=e.parentNode}return null}function tv(e){if(e=e[ii]||e[ev]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Cy(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Je(33))}function xx(e){var t=e[Z3];return t||(t=e[Z3]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function za(e){e[ew]=!0}var B9=new Set,z9={};function Zf(e,t){Gx(e,t),Gx(e+"Capture",t)}function Gx(e,t){for(z9[e]=t,e=0;e<t.length;e++)B9.add(t[e])}var Koe=RegExp("^[: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]*$"),Q3={},J3={};function Xoe(e){return gA.call(J3,e)?!0:gA.call(Q3,e)?!1:Koe.test(e)?J3[e]=!0:(Q3[e]=!0,!1)}function Qj(e,t,n){if(Xoe(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Kw(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function sd(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function Yo(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function q9(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zoe(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var a=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yA(e){if(!e._valueTracker){var t=q9(e)?"checked":"value";e._valueTracker=Zoe(e,t,""+e[t])}}function H9(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=q9(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function $1(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qoe=/[\n"\\]/g;function Xo(e){return e.replace(Qoe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bA(e,t,n,s,a,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Yo(t)):e.value!==""+Yo(t)&&(e.value=""+Yo(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?wA(e,o,Yo(t)):n!=null?wA(e,o,Yo(n)):s!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Yo(l):e.removeAttribute("name")}function W9(e,t,n,s,a,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){yA(e);return}n=n!=null?""+Yo(n):"",t=t!=null?""+Yo(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??a,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),yA(e)}function wA(e,t,n){t==="number"&&$1(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function gx(e,t,n,s){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Yo(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,s&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Y9(e,t,n){if(t!=null&&(t=""+Yo(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Yo(n):""}function G9(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(Je(92));if(_y(s)){if(1<s.length)throw Error(Je(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=Yo(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),yA(e)}function Kx(e,t){if(t){var n=e.firstChild;
vendor: 4,144 bytes, line 48
48if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Joe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function eI(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||Joe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function K9(e,t,n){if(t!=null&&typeof t!="object")throw Error(Je(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var a in t)s=t[a],t.hasOwnProperty(a)&&n[a]!==s&&eI(e,a,s)}else for(var i in t)t.hasOwnProperty(i)&&eI(e,i,t[i])}function zP(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ele=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
48-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tle=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jj(e){return tle.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function jd(){}var jA=null;function qP(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yp=null,vx=null;function tI(e){var t=tv(e);if(t&&(e=t.stateNode)){var n=e[no]||null;e:switch(e=t.stateNode,t.type){case"input":if(bA(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Xo(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var a=s[no]||null;if(!a)throw Error(Je(90));bA(s,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&H9(s)}break e;case"textarea":Y9(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&gx(e,!!n.multiple,t,!1)}}}var LC=!1;function X9(e,t,n){if(LC)return e(t,n);LC=!0;try{var s=e(t);return s}finally{if(LC=!1,(Yp!==null||vx!==null)&&(w_(),Yp&&(t=Yp,e=vx,vx=Yp=null,tI(t),e)))for(t=0;t<e.length;t++)tI(e[t])}}function vb(e,t){var n=e.stateNode;if(n===null)return null;var s=n[no]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Je(231,t,typeof n));return n}var Vd=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),NA=!1;if(Vd)try{var Gv={};Object.defineProperty(Gv,"passive",{get:function(){NA=!0}}),window.addEventListener("test",Gv,Gv),window.removeEventListener("test",Gv,Gv)}catch{NA=!1}var im=null,HP=null,e1=null;function Z9(){if(e1)return e1;var e,t=HP,n=t.length,s,a="value"in im?im.value:im.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===a[i-s];s++);return e1=a.slice(e,1<s?1-s:void 0)}function t1(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xw(){return!0}function rI(){return!1}function ao(e){function t(n,s,a,i,o){this._reactName=n,this._targetInst=a,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xw:rI,this.isPropagationStopped=rI,this}return ws(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xw)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xw)},persist:function(){},isPersistent:Xw}),t}var Qf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},d_=ao(Qf),tw=ws({},Qf,{view:0,detail:0}),rle=ao(tw),$C,VC,Kv,u_=ws({},tw,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:WP,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kv&&(Kv&&e.type==="mousemove"?($C=e.screenX-Kv.screenX,VC=e.screenY-Kv.screenY):VC=$C=0,Kv=e),$C)},movementY:function(e){return"movementY"in e?e.movementY:VC}}),nI=ao(u_),nle=ws({},u_,{dataTransfer:0}),sle=ao(nle),ale=ws({},tw,{relatedTarget:0}),UC=ao(ale),ile=ws({},Qf,{animationName:0,elapsedTime:0,pseudoElement:0}),ole=ao(ile),lle=ws({},Qf,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cle=ao(lle),dle=ws({},Qf,{data:0}),sI=ao(dle),ule={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mle={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"},hle={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fle(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hle[e])?!!t[e]:!1}function WP(){return fle}var ple=ws({},tw,{key:function(e){if(e.key){var t=ule[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 5,224 bytes, line 48
48return e.type==="keypress"?(e=t1(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mle[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:WP,charCode:function(e){return e.type==="keypress"?t1(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?t1(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xle=ao(ple),gle=ws({},u_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aI=ao(gle),vle=ws({},tw,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:WP}),yle=ao(vle),ble=ws({},Qf,{propertyName:0,elapsedTime:0,pseudoElement:0}),wle=ao(ble),jle=ws({},u_,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Nle=ao(jle),Sle=ws({},Qf,{newState:0,oldState:0}),_le=ao(Sle),Cle=[9,13,27,32],YP=Vd&&"CompositionEvent"in window,Vy=null;Vd&&"documentMode"in document&&(Vy=document.documentMode);var kle=Vd&&"TextEvent"in window&&!Vy,Q9=Vd&&(!YP||Vy&&8<Vy&&11>=Vy),iI=" ",oI=!1;function J9(e,t){switch(e){case"keyup":return Cle.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gp=!1;function Ele(e,t){switch(e){case"compositionend":return e7(t);case"keypress":return t.which!==32?null:(oI=!0,iI);case"textInput":return e=t.data,e===iI&&oI?null:e;default:return null}}function Ale(e,t){if(Gp)return e==="compositionend"||!YP&&J9(e,t)?(e=Z9(),e1=HP=im=null,Gp=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Q9&&t.locale!=="ko"?null:t.data;default:return null}}var Tle={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 lI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tle[e.type]:t==="textarea"}function t7(e,t,n,s){Yp?vx?vx.push(s):vx=[s]:Yp=s,t=rN(t,"onChange"),0<t.length&&(n=new d_("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Uy=null,yb=null;function Rle(e){Xq(e,0)}function m_(e){var t=Cy(e);if(H9(t))return e}function cI(e,t){if(e==="change")return t}var r7=!1;if(Vd){var FC;if(Vd){var BC="oninput"in document;if(!BC){var dI=document.createElement("div");dI.setAttribute("oninput","return;"),BC=typeof dI.oninput=="function"}FC=BC}else FC=!1;r7=FC&&(!document.documentMode||9<document.documentMode)}function uI(){Uy&&(Uy.detachEvent("onpropertychange",n7),yb=Uy=null)}function n7(e){if(e.propertyName==="value"&&m_(yb)){var t=[];t7(t,yb,e,qP(e)),X9(Rle,t)}}function Ole(e,t,n){e==="focusin"?(uI(),Uy=t,yb=n,Uy.attachEvent("onpropertychange",n7)):e==="focusout"&&uI()}function Ple(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return m_(yb)}function Dle(e,t){if(e==="click")return m_(t)}function Mle(e,t){if(e==="input"||e==="change")return m_(t)}function Ile(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ro=typeof Object.is=="function"?Object.is:Ile;function bb(e,t){if(Ro(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var a=n[s];if(!gA.call(t,a)||!Ro(e[a],t[a]))return!1}return!0}function mI(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hI(e,t){var n=mI(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mI(n)}}function s7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?s7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function a7(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$1(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$1(e.document)}return t}function GP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Lle=Vd&&"documentMode"in document&&11>=document.documentMode,Kp=null,SA=null,Fy=null,_A=!1;function fI(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_A||Kp==null||Kp!==$1(s)||(s=Kp,"selectionStart"in s&&GP(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focu
vendor: 18,660 bytes, line 48
48sNode:s.focusNode,focusOffset:s.focusOffset}),Fy&&bb(Fy,s)||(Fy=s,s=rN(SA,"onSelect"),0<s.length&&(t=new d_("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Kp)))}function yh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xp={animationend:yh("Animation","AnimationEnd"),animationiteration:yh("Animation","AnimationIteration"),animationstart:yh("Animation","AnimationStart"),transitionrun:yh("Transition","TransitionRun"),transitionstart:yh("Transition","TransitionStart"),transitioncancel:yh("Transition","TransitionCancel"),transitionend:yh("Transition","TransitionEnd")},zC={},i7={};Vd&&(i7=document.createElement("div").style,"AnimationEvent"in window||(delete Xp.animationend.animation,delete Xp.animationiteration.animation,delete Xp.animationstart.animation),"TransitionEvent"in window||delete Xp.transitionend.transition);function Jf(e){if(zC[e])return zC[e];if(!Xp[e])return e;var t=Xp[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in i7)return zC[e]=t[n];return e}var o7=Jf("animationend"),l7=Jf("animationiteration"),c7=Jf("animationstart"),$le=Jf("transitionrun"),Vle=Jf("transitionstart"),Ule=Jf("transitioncancel"),d7=Jf("transitionend"),u7=new Map,CA="abort auxClick beforeToggle 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(" ");CA.push("scrollEnd");function Zl(e,t){u7.set(e,t),Zf(t,[e])}var V1=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qo=[],Zp=0,KP=0;function h_(){for(var e=Zp,t=KP=Zp=0;t<e;){var n=qo[t];qo[t++]=null;var s=qo[t];qo[t++]=null;var a=qo[t];qo[t++]=null;var i=qo[t];if(qo[t++]=null,s!==null&&a!==null){var o=s.pending;o===null?a.next=a:(a.next=o.next,o.next=a),s.pending=a}i!==0&&m7(n,a,i)}}function f_(e,t,n,s){qo[Zp++]=e,qo[Zp++]=t,qo[Zp++]=n,qo[Zp++]=s,KP|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function XP(e,t,n,s){return f_(e,t,n,s),U1(e)}function ep(e,t){return f_(e,null,null,t),U1(e)}function m7(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-ko(n),e=i.hiddenUpdates,s=e[a],s===null?e[a]=[t]:s.push(t),t.lane=n|536870912),i):null}function U1(e){if(50<Xy)throw Xy=0,YA=null,Error(Je(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qp={};function Fle(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vo(e,t,n,s){return new Fle(e,t,n,s)}function ZP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cd(e,t){var n=e.alternate;return n===null?(n=vo(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function h7(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function r1(e,t,n,s,a,i){var o=0;if(s=e,typeof e=="function")ZP(e)&&(o=1);else if(typeof e=="string")o=Wce(e,n,_c.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case hA:return e=vo(31,n,t,a),e.elementType=hA,e.lanes=i,e;case qp:return df(n.children,a,i,t);case O9:o=8,a|=24;break;case dA:return e=vo(12,n,t,a|2),e.elementType=dA,e.lanes=i,e;case uA:return e=vo(13,n,t,a),e.elementType=uA,e.lanes=i,e;case mA:return e=vo(19,n,t,a),e.elementType=mA,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case wd:o=10;break e;case P9:o=9;break e;case LP:o=11;break e;case $P:o=14;break e;case Lu:o=16,s=null;break e}o=29,n=Error(Je(130,e===null?"null":typeof e,"")),s=null}return t=vo(o,n,t,a),t.elementType=e,t.type=s,t.lanes=i,t}function df(e,t,n,s){return e=vo(7,e,s,t),e.lanes=n,e}function qC(e,t,n){return e=vo(6,e,null,t),e.lanes=n,e}function f7(e){var t=vo(18,null,null,0);return t.stateNode=e,t}function HC(e,t,n){return t=vo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pI=new WeakMap;function Zo(e,t){if(typeof e=="object"&&e!==null){var n=pI.get(e);return n!==void 0?n:(t={value:e,source:t,stack:K3(t)},pI.set(e,t),t)}return{value:e,source:t,stack:K3(t)}}var Jp=[],ex=0,F1=null,wb=0,Go=[],Ko=0,Tm=null,xc=1,gc="";function gd(e,t){Jp[ex++]=wb,Jp[ex++]=F1,F1=e,wb=t}function p7(e,t,n){Go[Ko++]=xc,Go[Ko++]=gc,Go[Ko++]=Tm,Tm=e;var s=xc;e=gc;var a=32-ko(s)-1;s&=~(1<<a),n+=1;var i=32-ko(t)+a;if(30<i){var o=a-a%5;i=(s&(1<<o)-1).toString(32),s>>=o,a-=o,xc=1<<32-ko(t)+a|n<<a|s,gc=i+e}else xc=1<<i|n<<a|s,gc=e}function QP(e){e.return!==null&&(gd(e,1),p7(e,1,0))}function JP(e){for(;e===F1;)F1=Jp[--ex],Jp[ex]=null,wb=Jp[--ex],Jp[ex]=null;for(;e===Tm;)Tm=Go[--Ko],Go[Ko]=null,gc=Go[--Ko],Go[Ko]=null,xc=Go[--Ko],Go[Ko]=null}function x7(e,t){Go[Ko++]=xc,Go[Ko++]=gc,Go[Ko++]=Tm,xc=t.id,gc=t.overflow,Tm=e}var oi=null,xs=null,rn=!1,gm=null,Qo=!1,kA=Error(Je(519));function Rm(e){var t=Error(Je(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jb(Zo(t,e)),kA}function xI(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[ii]=e,t[no]=s,n){case"dialog":Wr("cancel",t),Wr("close",t);break;case"iframe":case"object":case"embed":Wr("load",t);break;case"video":case"audio":for(n=0;n<Cb.length;n++)Wr(Cb[n],t);break;case"source":Wr("error",t);break;case"img":case"image":case"link":Wr("error",t),Wr("load",t);break;case"details":Wr("toggle",t);break;case"input":Wr("invalid",t),W9(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Wr("invalid",t);break;case"textarea":Wr("invalid",t),G9(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||Qq(t.textContent,n)?(s.popover!=null&&(Wr("beforetoggle",t),Wr("toggle",t)),s.onScroll!=null&&Wr("scroll",t),s.onScrollEnd!=null&&Wr("scrollend",t),s.onClick!=null&&(t.onclick=jd),t=!0):t=!1,t||Rm(e,!0)}function gI(e){for(oi=e.return;oi;)switch(oi.tag){case 5:case 31:case 13:Qo=!1;return;case 27:case 3:Qo=!0;return;default:oi=oi.return}}function xp(e){if(e!==oi)return!1;if(!rn)return gI(e),rn=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||QA(e.type,e.memoizedProps)),n=!n),n&&xs&&Rm(e),gI(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Je(317));xs=nL(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Je(317));xs=nL(e)}else t===27?(t=xs,Zm(e.type)?(e=rT,rT=null,xs=e):xs=t):xs=oi?ll(e.stateNode.nextSibling):null;return!0}function wf(){xs=oi=null,rn=!1}function WC(){var e=gm;return e!==null&&(Ki===null?Ki=e:Ki.push.apply(Ki,e),gm=null),e}function jb(e){gm===null?gm=[e]:gm.push(e)}var EA=Bc(null),tp=null,Nd=null;function zu(e,t,n){os(EA,t._currentValue),t._currentValue=n}function kd(e){e._currentValue=EA.current,Ha(EA)}function AA(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function TA(e,t,n,s){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var o=a.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),AA(i.return,n,e),s||(o=null);break e}i=l.next}}else if(a.tag===18){if(o=a.return,o===null)throw Error(Je(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),AA(o,n,e),o=null}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}}function rv(e,t,n,s){e=null;for(var a=t,i=!1;a!==null;){if(!i){if(a.flags&524288)i=!0;else if(a.flags&262144)break}if(a.tag===10){var o=a.alternate;if(o===null)throw Error(Je(387));if(o=o.memoizedProps,o!==null){var l=a.type;Ro(a.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(a===D1.current){if(o=a.alternate,o===null)throw Error(Je(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Eb):e=[Eb])}a=a.return}e!==null&&TA(t,e,n,s),t.flags|=262144}function B1(e){for(e=e.firstContext;e!==null;){if(!Ro(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jf(e){tp=e,Nd=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function li(e){return g7(tp,e)}function Zw(e,t){return tp===null&&jf(e),g7(e,t)}function g7(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Nd===null){if(e===null)throw Error(Je(308));Nd=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Nd=Nd.next=t;return n}var Ble=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},zle=Ma.unstable_scheduleCallback,qle=Ma.unstable_NormalPriority,xa={$$typeof:wd,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function e4(){return{controller:new Ble,data:new Map,refCount:0}}function rw(e){e.refCount--,e.refCount===0&&zle(qle,function(){e.controller.abort()})}var By=null,RA=0,Xx=0,yx=null;function Hle(e,t){if(By===null){var n=By=[];RA=0,Xx=_4(),yx={status:"pending",value:void 0,then:function(s){n.push(s)}}}return RA++,t.then(vI,vI),t}function vI(){if(--RA===0&&By!==null){yx!==null&&(yx.status="fulfilled");var e=By;By=null,Xx=0,yx=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wle(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(s.status="rejected",s.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),s}var yI=br.S;br.S=function(e,t){Rq=_o(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Hle(e,t),yI!==null&&yI(e,t)};var uf=Bc(null);function t4(){var e=uf.current;return e!==null?e:Gn.pooledCache}function n1(e,t){t===null?os(uf,uf.current):os(uf,t.pool)}function v7(){var e=t4();return e===null?null:{parent:xa._currentValue,pool:e}}var nv=Error(Je(460)),r4=Error(Je(474)),p_=Error(Je(542)),z1={then:function(){}};function bI(e){return e=e.status,e==="fulfilled"||e==="rejected"}function y7(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(jd,jd),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jI(e),e;default:if(typeof t.status=="string")t.then(jd,jd);else{if(e=Gn,e!==null&&100<e.shellSuspendCounter)throw Error(Je(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=s}},function(s){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jI(e),e}throw mf=t,nv}}function Rh(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(mf=n,nv):n}}var mf=null;function wI(){if(mf===null)throw Error(Je(459));var e=mf;return mf=null,e}function jI(e){if(e===nv||e===p_)throw Error(Je(483))}var bx=null,Nb=0;function Qw(e){var t=Nb;return Nb+=1,bx===null&&(bx=[]),y7(bx,e,t)}function Xv(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Jw(e,t){throw t.$$typeof===Ooe?Error(Je(525)):(e=Object.prototype.toString.call(t),Error(Je(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function b7(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function s(y){for(var b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function a(y,b){return y=Cd(y,b),y.index=0,y.sibling=null,y}function i(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=67108866,b):w):(y.flags|=67108866,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function l(y,b,w,S){return b===null||b.tag!==6?(b=qC(w,y.mode,S),b.return=y,b):(b=a(b,w),b.return=y,b)}function c(y,b,w,S){var j=w.type;return j===qp?u(y,b,w.props.children,S,w.key):b!==null&&(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Lu&&Rh(j)===b.type)?(b=a(b,w.props),Xv(b,w),b.return=y,b):(b=r1(w.type,w.key,w.props,null,y.mode,S),Xv(b,w),b.return=y,b)}function d(y,b,w,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=HC(w,y.mode,S),b.return=y,b):(b=a(b,w.children||[]),b.return=y,b)}function u(y,b,w,S,j){return b===null||b.tag!==7?(b=df(w,y.mode,S,j),b.return=y,b):(b=a(b,w),b.return=y,b)}function m(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=qC(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Hw:return w=r1(b.type,b.key,b.props,null,y.mode,w),Xv(w,b),w.return=y,w;case Sy:return b=HC(b,y.mode,w),b.return=y,b;case Lu:return b=Rh(b),m(y,b,w)}if(_y(b)||Yv(b))return b=df(b,y.mode,w,null),b.return=y,b;if(typeof b.then=="function")return m(y,Qw(b),w);if(b.$$typeof===wd)return m(y,Zw(y,b),w);Jw(y,b)}return null}function f(y,b,w,S){var j=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return j!==null?null:l(y,b,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Hw:return w.key===j?c(y,b,w,S):null;case Sy:return w.key===j?d(y,b,w,S):null;case Lu:return w=Rh(w),f(y,b,w,S)}if(_y(w)||Yv(w))return j!==null?null:u(y,b,w,S,null);if(typeof w.then=="function")return f(y,b,Qw(w),S);if(w.$$typeof===wd)return f(y,b,Zw(y,w),S);Jw(y,w)}return null}function p(y,b,w,S,j){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return y=y.get(w)||null,l(b,y,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Hw:return y=y.get(S.key===null?w:S.key)||null,c(b,y,S,j);case Sy:return y=y.get(S.key===null?w:S.key)||null,d(b,y,S,j);case Lu:return S=Rh(S),p(y,b,w,S,j)}if(_y(S)||Yv(S))return y=y.get(w)||null,u(b,y,S,j,null);if(typeof S.then=="function")return p(y,b,w,Qw(S),j);if(S.$$typeof===wd)return p(y,b,w,Zw(b,S),j);Jw(b,S)}return null}function x(y,b,w,S){for(var j=null,N=null,_=b,C=b=0,k=null;_!==null&&C<w.length;C++){_.index>C?(k=_,_=null):k=_.sibling;var E=f(y,_,w[C],S);if(E===null){_===null&&(_=k);break}e&&_&&E.alternate===null&&t(y,_),b=i(E,b,C),N===null?j=E:N.sibling=E,N=E,_=k}if(C===w.length)return n(y,_),rn&&gd(y,C),j;if(_===null){for(;C<w.length;C++)_=m(y,w[C],S),_!==null&&(b=i(_,b,C),N===null?j=_:N.sibling=_,N=_);return rn&&gd(y,C),j}for(_=s(_);C<w.length;C++)k=p(_,y,C,w[C],S),k!==null&&(e&&k.alternate!==null&&_.delete(k.key===null?C:k.key),b=i(k,b,C),N===null?j=k:N.sibling=k,N=k);return e&&_.forEach(function(R){return t(y,R)}),rn&&gd(y,C),j}function g(y,b,w,S){if(w==null)throw Error(Je(151));for(var j=null,N=null,_=b,C=b=0,k=null,E=w.next();_!==null&&!E.done;C++,E=w.next()){_.index>C?(k=_,_=null):k=_.sibling;var R=f(y,_,E.value,S);if(R===null){_===null&&(_=k);break}e&&_&&R.alternate===null&&t(y,_),b=i(R,b,C),N===null?j=R:N.sibling=R,N=R,_=k}if(E.done)return n(y,_),rn&&gd(y,C),j;if(_===null){for(;!E.done;C++,E=w.next())E=m(y,E.value,S),E!==null&&(b=i(E,b,C),N===null?j=E:N.sibling=E,N=E);return rn&&gd(y,C),j}for(_=s(_);!E.done;C++,E=w.next())E=p(_,y,C,E.value,S),E!==null&&(e&&E.alternate!==null&&_.delete(E.key===null?C:E.key),b=i(E,b,C),N===null?j=E:N.sibling=E,N=E);return e&&_.forEach(function(T){return t(y,T)}),rn&&gd(y,C),j}function v(y,b,w,S){if(typeof w=="object"&&w!==null&&w.type===qp&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Hw:e:{for(var j=w.key;b!==null;){if(b.key===j){if(j=w.type,j===qp){if(b.tag===7){n(y,b.sibling),S=a(b,w.props.children),S.return=y,y=S;break e}}else if(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Lu&&Rh(j)===b.type){n(y,b.sibling),S=a(b,w.props),Xv(S,w),S.return=y,y=S;break e}n(y,b);break}else t(y,b);b=b.sibling}w.type===qp?(S=df(w.props.children,y.mode,S,w.key),S.return=y,y=S):(S=r1(w.type,w.key,w.props,null,y.mode,S),Xv(S,w),S.return=y,y=S)}return o(y);case Sy:e:{for(j=w.key;b!==null;){if(b.key===j)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),S=a(b,w.children||[]),S.return=y,y=S;break e}else{n(y,b);break}else t(y,b);b=b.sibling}S=HC(w,y.mode,S),S.return=y,y=S}return o(y);case Lu:return w=Rh(w),v(y,b,w,S)}if(_y(w))return x(y,b,w,S);
vendor: 4,553 bytes, line 48
48if(Yv(w)){if(j=Yv(w),typeof j!="function")throw Error(Je(150));return w=j.call(w),g(y,b,w,S)}if(typeof w.then=="function")return v(y,b,Qw(w),S);if(w.$$typeof===wd)return v(y,b,Zw(y,w),S);Jw(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),S=a(b,w),S.return=y,y=S):(n(y,b),S=qC(w,y.mode,S),S.return=y,y=S),o(y)):n(y,b)}return function(y,b,w,S){try{Nb=0;var j=v(y,b,w,S);return bx=null,j}catch(_){if(_===nv||_===p_)throw _;var N=vo(29,_,null,y.mode);return N.lanes=S,N.return=y,N}finally{}}}var Nf=b7(!0),w7=b7(!1),$u=!1;function n4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function OA(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vm(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ym(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,vn&2){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,t=U1(e),m7(e,null,n),t}return f_(e,s,t,n),U1(e)}function zy(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,V9(e,n)}}function YC(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var PA=!1;function qy(){if(PA){var e=yx;if(e!==null)throw e}}function Hy(e,t,n,s){PA=!1;var a=e.updateQueue;$u=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var m=a.baseState;o=0,u=d=c=null,l=i;do{var f=l.lane&-536870913,p=f!==l.lane;if(p?(Kr&f)===f:(s&f)===f){f!==0&&f===Xx&&(PA=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var x=e,g=l;f=t;var v=n;switch(g.tag){case 1:if(x=g.payload,typeof x=="function"){m=x.call(v,m,f);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,f=typeof x=="function"?x.call(v,m,f):x,f==null)break e;m=ws({},m,f);break e;case 2:$u=!0}}f=l.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=a.callbacks,p===null?a.callbacks=[f]:p.push(f))}else p={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=p,c=m):u=u.next=p,o|=f;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;p=l,l=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);u===null&&(c=m),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,i===null&&(a.shared.lanes=0),Pm|=o,e.lanes=o,e.memoizedState=m}}function j7(e,t){if(typeof e!="function")throw Error(Je(191,e));e.call(t)}function N7(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)j7(n[e],t)}var Zx=Bc(null),q1=Bc(0);function NI(e,t){e=zd,os(q1,e),os(Zx,t),zd=e|t.baseLanes}function DA(){os(q1,zd),os(Zx,Zx.current)}function s4(){zd=q1.current,Ha(Zx),Ha(q1)}var Oo=Bc(null),ol=null;function qu(e){var t=e.alternate;os(ra,ra.current&1),os(Oo,e),ol===null&&(t===null||Zx.current!==null||t.memoizedState!==null)&&(ol=e)}function MA(e){os(ra,ra.current),os(Oo,e),ol===null&&(ol=e)}function S7(e){e.tag===22?(os(ra,ra.current),os(Oo,e),ol===null&&(ol=e)):Hu()}function Hu(){os(ra,ra.current),os(Oo,Oo.current)}function po(e){Ha(Oo),ol===e&&(ol=null),Ha(ra)}var ra=Bc(0);function H1(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||eT(n)||tT(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}
vendor: 12,291 bytes, line 48
48var Ud=0,Pr=null,Bn=null,ha=null,W1=!1,wx=!1,Sf=!1,Y1=0,Sb=0,jx=null,Yle=0;function zs(){throw Error(Je(321))}function a4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ro(e[n],t[n]))return!1;return!0}function i4(e,t,n,s,a,i){return Ud=i,Pr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,br.H=e===null||e.memoizedState===null?tq:g4,Sf=!1,i=n(s,a),Sf=!1,wx&&(i=C7(t,n,s,a)),_7(e),i}function _7(e){br.H=_b;var t=Bn!==null&&Bn.next!==null;if(Ud=0,ha=Bn=Pr=null,W1=!1,Sb=0,jx=null,t)throw Error(Je(300));e===null||va||(e=e.dependencies,e!==null&&B1(e)&&(va=!0))}function C7(e,t,n,s){Pr=e;var a=0;do{if(wx&&(jx=null),Sb=0,wx=!1,25<=a)throw Error(Je(301));if(a+=1,ha=Bn=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}br.H=rq,i=t(n,s)}while(wx);return i}function Gle(){var e=br.H,t=e.useState()[0];return t=typeof t.then=="function"?nw(t):t,e=e.useState()[0],(Bn!==null?Bn.memoizedState:null)!==e&&(Pr.flags|=1024),t}function o4(){var e=Y1!==0;return Y1=0,e}function l4(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function c4(e){if(W1){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}W1=!1}Ud=0,ha=Bn=Pr=null,wx=!1,Sb=Y1=0,jx=null}function Ai(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ha===null?Pr.memoizedState=ha=e:ha=ha.next=e,ha}function sa(){if(Bn===null){var e=Pr.alternate;e=e!==null?e.memoizedState:null}else e=Bn.next;var t=ha===null?Pr.memoizedState:ha.next;if(t!==null)ha=t,Bn=e;else{if(e===null)throw Pr.alternate===null?Error(Je(467)):Error(Je(310));Bn=e,e={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},ha===null?Pr.memoizedState=ha=e:ha=ha.next=e}return ha}function x_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nw(e){var t=Sb;return Sb+=1,jx===null&&(jx=[]),e=y7(jx,e,t),t=Pr,(ha===null?t.memoizedState:ha.next)===null&&(t=t.alternate,br.H=t===null||t.memoizedState===null?tq:g4),e}function g_(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return nw(e);if(e.$$typeof===wd)return li(e)}throw Error(Je(438,String(e)))}function d4(e){var t=null,n=Pr.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Pr.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=x_(),Pr.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=Poe;return t.index++,n}function Fd(e,t){return typeof t=="function"?t(e):t}function s1(e){var t=sa();return u4(t,Bn,e)}function u4(e,t,n){var s=e.queue;if(s===null)throw Error(Je(311));s.lastRenderedReducer=n;var a=e.baseQueue,i=s.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}t.baseQueue=a=i,s.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var l=o=null,c=null,d=t,u=!1;do{var m=d.lane&-536870913;if(m!==d.lane?(Kr&m)===m:(Ud&m)===m){var f=d.revertLane;if(f===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),m===Xx&&(u=!0);else if((Ud&f)===f){d=d.next,f===Xx&&(u=!0);continue}else m={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(l=c=m,o=i):c=c.next=m,Pr.lanes|=f,Pm|=f;m=d.action,Sf&&n(i,m),i=d.hasEagerState?d.eagerState:n(i,m)}else f={lane:m,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(l=c=f,o=i):c=c.next=f,Pr.lanes|=m,Pm|=m;d=d.next}while(d!==null&&d!==t);if(c===null?o=i:c.next=l,!Ro(i,e.memoizedState)&&(va=!0,u&&(n=yx,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,s.lastRenderedState=i}return a===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function GC(e){var t=sa(),n=t.queue;if(n===null)throw Error(Je(311));n.lastRenderedReducer=e;var s=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Ro(i,t.memoizedState)||(va=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function k7(e,t,n){var s=Pr,a=sa(),i=rn;if(i){if(n===void 0)throw Error(Je(407));n=n()}else n=t();var o=!Ro((Bn||a).memoizedState,n);if(o&&(a.memoizedState=n,va=!0),a=a.queue,m4(T7.bind(null,s,a,e),[e]),a.getSnapshot!==t||o||ha!==null&&ha.memoizedState.tag&1){if(s.flags|=2048,Qx(9,{destroy:void 0},A7.bind(null,s,a,n,t),null),Gn===null)throw Error(Je(349));i||Ud&127||E7(s,t,n)}return n}function E7(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pr.updateQueue,t===null?(t=x_(),Pr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function A7(e,t,n,s){t.value=n,t.getSnapshot=s,R7(t)&&O7(e)}function T7(e,t,n){return n(function(){R7(t)&&O7(e)})}function R7(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ro(e,n)}catch{return!0}}function O7(e){var t=ep(e,2);t!==null&&to(t,e,2)}function IA(e){var t=Ai();if(typeof e=="function"){var n=e;if(e=n(),Sf){am(!0);try{n()}finally{am(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fd,lastRenderedState:e},t}function P7(e,t,n,s){return e.baseState=n,u4(e,Bn,typeof s=="function"?s:Fd)}function Kle(e,t,n,s,a){if(y_(e))throw Error(Je(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};br.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,D7(t,i)):(i.next=n.next,t.pending=n.next=i)}}function D7(e,t){var n=t.action,s=t.payload,a=e.state;if(t.isTransition){var i=br.T,o={};br.T=o;try{var l=n(a,s),c=br.S;c!==null&&c(o,l),SI(e,t,l)}catch(d){LA(e,t,d)}finally{i!==null&&o.types!==null&&(i.types=o.types),br.T=i}}else try{i=n(a,s),SI(e,t,i)}catch(d){LA(e,t,d)}}function SI(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){_I(e,t,s)},function(s){return LA(e,t,s)}):_I(e,t,n)}function _I(e,t,n){t.status="fulfilled",t.value=n,M7(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,D7(e,n)))}function LA(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,M7(t),t=t.next;while(t!==s)}e.action=null}function M7(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function I7(e,t){return t}function CI(e,t){if(rn){var n=Gn.formState;if(n!==null){e:{var s=Pr;if(rn){if(xs){t:{for(var a=xs,i=Qo;a.nodeType!==8;){if(!i){a=null;break t}if(a=ll(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){xs=ll(a.nextSibling),s=a.data==="F!";break e}}Rm(s)}s=!1}s&&(t=n[0])}}return n=Ai(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:I7,lastRenderedState:t},n.queue=s,n=Q7.bind(null,Pr,s),s.dispatch=n,s=IA(!1),i=x4.bind(null,Pr,!1,s.queue),s=Ai(),a={state:t,dispatch:null,action:e,pending:null},s.queue=a,n=Kle.bind(null,Pr,a,i,n),a.dispatch=n,s.memoizedState=e,[t,n,!1]}function kI(e){var t=sa();return L7(t,Bn,e)}function L7(e,t,n){if(t=u4(e,t,I7)[0],e=s1(Fd)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=nw(t)}catch(o){throw o===nv?p_:o}else s=t;t=sa();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Pr.flags|=2048,Qx(9,{destroy:void 0},Xle.bind(null,a,n),null)),[s,i,e]}function Xle(e,t){e.action=t}function EI(e){var t=sa(),n=Bn;if(n!==null)return L7(t,n,e);sa(),t=t.memoizedState,n=sa();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Qx(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Pr.updateQueue,t===null&&(t=x_(),Pr.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function $7(){return sa().memoizedState}function a1(e,t,n,s){var a=Ai();Pr.flags|=e,a.memoizedState=Qx(1|t,{destroy:void 0},n,s===void 0?null:s)}function v_(e,t,n,s){var a=sa();s=s===void 0?null:s;var i=a.memoizedState.inst;Bn!==null&&s!==null&&a4(s,Bn.memoizedState.deps)?a.memoizedState=Qx(t,i,n,s):(Pr.flags|=e,a.memoizedState=Qx(1|t,i,n,s))}function AI(e,t){a1(8390656,8,e,t)}function m4(e,t){v_(2048,8,e,t)}function Zle(e){Pr.flags|=4;var t=Pr.updateQueue;if(t===null)t=x_(),Pr.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function V7(e){var t=sa().memoizedState;return Zle({ref:t,nextImpl:e}),function(){if(vn&2)throw Error(Je(440));return t.impl.apply(void 0,arguments)}}function U7(e,t){return v_(4,2,e,t)}function F7(e,t){return v_(4,4,e,t)}function B7(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function z7(e,t,n){n=n!=null?n.concat([e]):null,v_(4,4,B7.bind(null,t,e),n)}function h4(){}function q7(e,t){var n=sa();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&a4(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function H7(e,t){var n=sa();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&a4(t,s[1]))return s[0];if(s=e(),Sf){am(!0);try{e()}finally{am(!1)}}return n.memoizedState=[s,t],s}function f4(e,t,n){return n===void 0||Ud&1073741824&&!(Kr&261930)?e.memoizedState=t:(e.memoizedState=n,e=Pq(),Pr.lanes|=e,Pm|=e,n)}function W7(e,t,n,s){return Ro(n,t)?n:Zx.current!==null?(e=f4(e,n,s),Ro(e,t)||(va=!0),e):!(Ud&42)||Ud&1073741824&&!(Kr&261930)?(va=!0,e.memoizedState=n):(e=Pq(),Pr.lanes|=e,Pm|=e,t)}function Y7(e,t,n,s,a){var i=yn.p;yn.p=i!==0&&8>i?i:8;var o=br.T,l={};br.T=l,x4(e,!1,t,n);try{var c=a(),d=br.S;if(d!==null&&d(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=Wle(c,s);Wy(e,t,u,Eo(e))}else Wy(e,t,s,Eo(e))}catch(m){Wy(e,t,{then:function(){},status:"rejected",reason:m},Eo())}finally{yn.p=i,o!==null&&l.types!==null&&(o.types=l.types),br.T=o}}function Qle(){}function $A(e,t,n,s){if(e.tag!==5)throw Error(Je(476));var a=G7(e).queue;Y7(e,a,t,cf,n===null?Qle:function(){return K7(e),n(s)})}function G7(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:cf,baseState:cf,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fd,lastRenderedState:cf},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fd,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function K7(e){var t=G7(e);t.next===null&&(t=e.alternate.memoizedState),Wy(e,t.next.queue,{},Eo())}function p4(){return li(Eb)}function X7(){return sa().memoizedState}function Z7(){return sa().memoizedState}function Jle(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Eo();e=vm(n);var s=ym(t,e,n);s!==null&&(to(s,t,n),zy(s,t,n)),t={cache:e4()},e.payload=t;return}t=t.return}}function ece(e,t,n){var s=Eo();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},y_(e)?J7(t,n):(n=XP(e,t,n,s),n!==null&&(to(n,e,s),eq(n,t,s)))}function Q7(e,t,n){var s=Eo();Wy(e,t,n,s)}function Wy(e,t,n,s){var a={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(y_(e))J7(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,Ro(l,o))return f_(e,t,a,0),Gn===null&&h_(),!1}catch{}finally{}if(n=XP(e,t,a,s),n!==null)return to(n,e,s),eq(n,t,s),!0}return!1}function x4(e,t,n,s){if(s={lane:2,revertLane:_4(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},y_(e)){if(t)throw Error(Je(479))}else t=XP(e,n,s,2),t!==null&&to(t,e,2)}function y_(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function J7(e,t){wx=W1=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eq(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,V9(e,n)}}var _b={readContext:li,use:g_,useCallback:zs,useContext:zs,useEffect:zs,useImperativeHandle:zs,useLayoutEffect:zs,useInsertionEffect:zs,useMemo:zs,useReducer:zs,useRef
vendor: 9,482 bytes, line 48
48:zs,useState:zs,useDebugValue:zs,useDeferredValue:zs,useTransition:zs,useSyncExternalStore:zs,useId:zs,useHostTransitionStatus:zs,useFormState:zs,useActionState:zs,useOptimistic:zs,useMemoCache:zs,useCacheRefresh:zs};_b.useEffectEvent=zs;var tq={readContext:li,use:g_,useCallback:function(e,t){return Ai().memoizedState=[e,t===void 0?null:t],e},useContext:li,useEffect:AI,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,a1(4194308,4,B7.bind(null,t,e),n)},useLayoutEffect:function(e,t){return a1(4194308,4,e,t)},useInsertionEffect:function(e,t){a1(4,2,e,t)},useMemo:function(e,t){var n=Ai();t=t===void 0?null:t;var s=e();if(Sf){am(!0);try{e()}finally{am(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Ai();if(n!==void 0){var a=n(t);if(Sf){am(!0);try{n(t)}finally{am(!1)}}}else a=t;return s.memoizedState=s.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},s.queue=e,e=e.dispatch=ece.bind(null,Pr,e),[s.memoizedState,e]},useRef:function(e){var t=Ai();return e={current:e},t.memoizedState=e},useState:function(e){e=IA(e);var t=e.queue,n=Q7.bind(null,Pr,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:h4,useDeferredValue:function(e,t){var n=Ai();return f4(n,e,t)},useTransition:function(){var e=IA(!1);return e=Y7.bind(null,Pr,e.queue,!0,!1),Ai().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Pr,a=Ai();if(rn){if(n===void 0)throw Error(Je(407));n=n()}else{if(n=t(),Gn===null)throw Error(Je(349));Kr&127||E7(s,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,AI(T7.bind(null,s,i,e),[e]),s.flags|=2048,Qx(9,{destroy:void 0},A7.bind(null,s,i,n,t),null),n},useId:function(){var e=Ai(),t=Gn.identifierPrefix;if(rn){var n=gc,s=xc;n=(s&~(1<<32-ko(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Y1++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Yle++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:p4,useFormState:CI,useActionState:CI,useOptimistic:function(e){var t=Ai();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=x4.bind(null,Pr,!0,n),n.dispatch=t,[e,t]},useMemoCache:d4,useCacheRefresh:function(){return Ai().memoizedState=Jle.bind(null,Pr)},useEffectEvent:function(e){var t=Ai(),n={impl:e};return t.memoizedState=n,function(){if(vn&2)throw Error(Je(440));return n.impl.apply(void 0,arguments)}}},g4={readContext:li,use:g_,useCallback:q7,useContext:li,useEffect:m4,useImperativeHandle:z7,useInsertionEffect:U7,useLayoutEffect:F7,useMemo:H7,useReducer:s1,useRef:$7,useState:function(){return s1(Fd)},useDebugValue:h4,useDeferredValue:function(e,t){var n=sa();return W7(n,Bn.memoizedState,e,t)},useTransition:function(){var e=s1(Fd)[0],t=sa().memoizedState;return[typeof e=="boolean"?e:nw(e),t]},useSyncExternalStore:k7,useId:X7,useHostTransitionStatus:p4,useFormState:kI,useActionState:kI,useOptimistic:function(e,t){var n=sa();return P7(n,Bn,e,t)},useMemoCache:d4,useCacheRefresh:Z7};g4.useEffectEvent=V7;var rq={readContext:li,use:g_,useCallback:q7,useContext:li,useEffect:m4,useImperativeHandle:z7,useInsertionEffect:U7,useLayoutEffect:F7,useMemo:H7,useReducer:GC,useRef:$7,useState:function(){return GC(Fd)},useDebugValue:h4,useDeferredValue:function(e,t){var n=sa();return Bn===null?f4(n,e,t):W7(n,Bn.memoizedState,e,t)},useTransition:function(){var e=GC(Fd)[0],t=sa().memoizedState;return[typeof e=="boolean"?e:nw(e),t]},useSyncExternalStore:k7,useId:X7,useHostTransitionStatus:p4,useFormState:EI,useActionState:EI,useOptimistic:function(e,t){var n=sa();return Bn!==null?P7(n,Bn,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:d4,useCacheRefresh:Z7};rq.useEffectEvent=V7;function KC(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ws({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var VA={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Eo(),a=vm(s);a.payload=t,n!=null&&(a.callback=n),t=ym(e,a,s),t!==null&&(to(t,e,s),zy(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Eo(),a=vm(s);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ym(e,a,s),t!==null&&(to(t,e,s),zy(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Eo(),s=vm(n);s.tag=2,t!=null&&(s.callback=t),t=ym(e,s,n),t!==null&&(to(t,e,n),zy(t,e,n))}};function TI(e,t,n,s,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!bb(n,s)||!bb(a,i):!0}function RI(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&VA.enqueueReplaceState(t,t.state,null)}function _f(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=ws({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function nq(e){V1(e)}function sq(e){console.error(e)}function aq(e){V1(e)}function G1(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function OI(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function UA(e,t,n){return n=vm(n),n.tag=3,n.payload={element:null},n.callback=function(){G1(e,t)},n}function iq(e){return e=vm(e),e.tag=3,e}function oq(e,t,n,s){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=s.value;e.payload=function(){return a(i)},e.callback=function(){OI(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){OI(t,n,s),typeof a!="function"&&(bm===null?bm=new Set([this]):bm.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function tce(e,t,n,s,a){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&rv(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:return ol===null?J1():n.alternate===null&&Xs===0&&(Xs=3),n.flags&=-257,n.flags|=65536,n.lanes=a,s===z1?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),ik(e,s,a)),!1;case 22:return n.flags|=65536,s===z1?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),ik(e,s,a)),!1}throw Error(Je(435,n.tag))}return ik(e,s,a),J1(),!1}if(rn)return t=Oo.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,s!==kA&&(e=Error(Je(422),{cause:s}),jb(Zo(e,n)))):(s!==kA&&(t=Error(Je(423),{cause:s}),jb(Zo(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,s=Zo(s,n),a=UA(e.stateNode,s,a),YC(e,a),Xs!==4&&(Xs=2)),!1;var i=Error(Je(520),{cause:s});if(i=Zo(i,n),Ky===null?Ky=[i]:Ky.push(i),Xs!==4&&(Xs=2),t===null)return!0;s=Zo(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=UA(n.stateNode,s,e),YC(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(bm===null||!bm.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=iq(a),oq(a,e,n,s),YC(n,a),!1}n=n.return}while(n!==null);return!1}var v4=Error(Je(461)),va=!1;function ai(e,t,n,s){t.child=e===null?w7(t,null,n,s):Nf(t,e.child,n,s)}function PI(e,t,n,s,a){n=n.render;var i=t.ref;if("ref"in s){var o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}else o=s;return jf(t),s=i4(e,t,n,o,i,a),l=o4(),e!==null&&!va?(l4(e,t,a),Bd(e,t,a)):(rn&&l&&QP(t),t.flags|=1,ai(e,t,s,a),t.child)}function DI(e,t,n,s,a){if(e===null){var i=n.type;return typeof i=="function"&&!ZP(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,lq(e,t,i,s,a)):(e=r1(n.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!y4(e,a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:bb,n(o,s)&&e.ref===t.ref)return Bd(e,t,a)}return t.flags|=1,e=Cd(i,s),e.ref=t.ref,e.return=t,t.child=e}function lq(e,t,n,s,a){if(e!==null){var i=e.memoizedProps;if(bb(i,s)&&e.ref===t.ref)if(va=!1,t.pendingProps=s=i,y4(e,a))e.flags&131072&&(va=!0);else return t.lanes=e.lanes,Bd(e,t,a)}return FA(e,t,n,s,a)}function cq(e,t,n,s){var a=s.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(s=t.child=e.child,a=0;s!==null;)a=a|s.lanes|s.childLanes,s=s.sibling;s=a&~i}else s=0,t.child=null;return MI(e,t,i,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&n1(t,i!==null?i.cachePool:null),i!==null?NI(t,i):DA(),S7(t);else return s=t.lanes=536870912,MI(e,t,i!==null?i.baseLanes|n:n,n,s)}else i!==null?(n1(t,i.cachePool),NI(t,i),Hu(),t.memoizedState=null):(e!==null&&n1(t,null),DA(),Hu());return ai(e,t,a,n),t.child}function ky(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function MI(e,t,n,s,a){var i=t4();return i=i===null?null:{parent:xa._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&n1(t,null),DA(),S7(t),e!==null&&rv(e,t,s,!0),t.childLanes=a,null}function i1(e,t){return t=K1({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}
vendor: 4,311 bytes, line 48
48function II(e,t,n){return Nf(t,e.child,null,n),e=i1(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function rce(e,t,n){var s=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(rn){if(s.mode==="hidden")return e=i1(t,s),t.lanes=536870912,ky(null,e);if(MA(t),(e=xs)?(e=tH(e,Qo),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tm!==null?{id:xc,overflow:gc}:null,retryLane:536870912,hydrationErrors:null},n=f7(e),n.return=t,t.child=n,oi=t,xs=null)):e=null,e===null)throw Rm(t);return t.lanes=536870912,null}return i1(t,s)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(MA(t),a)if(t.flags&256)t.flags&=-257,t=II(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Je(558));else if(va||rv(e,t,n,!1),a=(n&e.childLanes)!==0,va||a){if(s=Gn,s!==null&&(o=U9(s,n),o!==0&&o!==i.retryLane))throw i.retryLane=o,ep(e,o),to(s,e,o),v4;J1(),t=II(e,t,n)}else e=i.treeContext,xs=ll(o.nextSibling),oi=t,rn=!0,gm=null,Qo=!1,e!==null&&x7(t,e),t=i1(t,s),t.flags|=4096;return t}return e=Cd(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function o1(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(Je(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function FA(e,t,n,s,a){return jf(t),n=i4(e,t,n,s,void 0,a),s=o4(),e!==null&&!va?(l4(e,t,a),Bd(e,t,a)):(rn&&s&&QP(t),t.flags|=1,ai(e,t,n,a),t.child)}function LI(e,t,n,s,a,i){return jf(t),t.updateQueue=null,n=C7(t,s,n,a),_7(e),s=o4(),e!==null&&!va?(l4(e,t,i),Bd(e,t,i)):(rn&&s&&QP(t),t.flags|=1,ai(e,t,n,i),t.child)}function $I(e,t,n,s,a){if(jf(t),t.stateNode===null){var i=Qp,o=n.contextType;typeof o=="object"&&o!==null&&(i=li(o)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=VA,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},n4(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?li(o):Qp,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(KC(t,n,o,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&VA.enqueueReplaceState(i,i.state,null),Hy(t,s,i,a),qy(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=_f(n,l);i.props=c;var d=i.context,u=n.contextType;o=Qp,typeof u=="object"&&u!==null&&(o=li(u));var m=n.getDerivedStateFromProps;u=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,u||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||d!==o)&&RI(t,i,s,o),$u=!1;var f=t.memoizedState;i.state=f,Hy(t,s,i,a),qy(),d=t.memoizedState,l||f!==d||$u?(typeof m=="function"&&(KC(t,n,m,s),d=t.memoizedState),(c=$u||TI(t,n,c,s,f,d,o))?(u||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=d),i.props=s,i.state=d,i.context=o,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,OA(e,t),o=t.memoizedProps,u=_f(n,o),i.props=u,m=t.pendingProps,f=i.context,d=n.contextType,c=Qp,typeof d=="object"&&d!==null&&(c=li(d)),l=n.getDerivedStateFromProps,(d=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==m||f!==c)&&RI(t,i,s,c),$u=!1,f=t.memoizedState,i.state=f,Hy(t,s,i,a),qy();var p=t.memoizedState;o!==m||f!==p||$u||e!==null&&e.dependencies!==null&&B1(e.dependencies)?(typeof l=="function"&&(KC(t,n,l,s),p=t.memoizedState),(u=$u||TI(t,n,u,s,f,p,
vendor: 3,401 bytes, line 48
48c)||e!==null&&e.dependencies!==null&&B1(e.dependencies))?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,p,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,p,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=p),i.props=s,i.state=p,i.context=c,s=u):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,o1(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=Nf(t,e.child,null,a),t.child=Nf(t,null,n,a)):ai(e,t,n,a),t.memoizedState=i.state,e=t.child):e=Bd(e,t,a),e}function VI(e,t,n,s){return wf(),t.flags|=256,ai(e,t,n,s),t.child}var XC={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ZC(e){return{baseLanes:e,cachePool:v7()}}function QC(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=No),e}function dq(e,t,n){var s=t.pendingProps,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(ra.current&2)!==0),o&&(a=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(rn){if(a?qu(t):Hu(),(e=xs)?(e=tH(e,Qo),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tm!==null?{id:xc,overflow:gc}:null,retryLane:536870912,hydrationErrors:null},n=f7(e),n.return=t,t.child=n,oi=t,xs=null)):e=null,e===null)throw Rm(t);return tT(e)?t.lanes=32:t.lanes=536870912,null}var l=s.children;return s=s.fallback,a?(Hu(),a=t.mode,l=K1({mode:"hidden",children:l},a),s=df(s,a,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,s=t.child,s.memoizedState=ZC(n),s.childLanes=QC(e,o,n),t.memoizedState=XC,ky(null,s)):(qu(t),BA(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(qu(t),t.flags&=-257,t=JC(e,t,n)):t.memoizedState!==null?(Hu(),t.child=e.child,t.flags|=128,t=null):(Hu(),l=s.fallback,a=t.mode,s=K1({mode:"visible",children:s.children},a),l=df(l,a,n,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,Nf(t,e.child,null,n),s=t.child,s.memoizedState=ZC(n),s.childLanes=QC(e,o,n),t.memoizedState=XC,t=ky(null,s));else if(qu(t),tT(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var d=o.dgst;o=d,s=Error(Je(419)),s.stack="",s.digest=o,jb({value:s,source:null,stack:null}),t=JC(e,t,n)}else if(va||rv(e,t,n,!1),o=(n&e.childLanes)!==0,va||o){if(o=Gn,o!==null&&(s=U9(o,n),s!==0&&s!==c.retryLane))throw c.retryLane=s,ep(e,s),to(o,e,s),v4;eT(l)||J1(),t=JC(e,t,n)}else eT(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,xs=ll(l.nextSibling),oi=t,rn=!0,gm=null,Qo=!1,e!==null&&x7(t,e),t=BA(t,s.children),t.flags|=4096);return t}return a?(Hu(),l=s.fallback,a=t.mode,c=e.child,d=c.sibling,s=Cd(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,d!==null?l=Cd(d,l):(l=df(l,a,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,ky(null,
vendor: 5,720 bytes, line 48
48s),s=t.child,l=e.child.memoizedState,l===null?l=ZC(n):(a=l.cachePool,a!==null?(c=xa._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=v7(),l={baseLanes:l.baseLanes|n,cachePool:a}),s.memoizedState=l,s.childLanes=QC(e,o,n),t.memoizedState=XC,ky(e.child,s)):(qu(t),n=e.child,e=n.sibling,n=Cd(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function BA(e,t){return t=K1({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function K1(e,t){return e=vo(22,e,null,t),e.lanes=0,e}function JC(e,t,n){return Nf(t,e.child,null,n),e=BA(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function UI(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),AA(e.return,t,n)}function ek(e,t,n,s,a,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:a,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=n,o.tailMode=a,o.treeForkCount=i)}function uq(e,t,n){var s=t.pendingProps,a=s.revealOrder,i=s.tail;s=s.children;var o=ra.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,os(ra,o),ai(e,t,s,n),s=rn?wb:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&UI(e,n,t);else if(e.tag===19)UI(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&H1(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ek(t,!1,a,n,i,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&H1(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ek(t,!0,n,null,i,s);break;case"together":ek(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Bd(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Pm|=t.lanes,!(n&t.childLanes))if(e!==null){if(rv(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Je(153));if(t.child!==null){for(e=t.child,n=Cd(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cd(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function y4(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&B1(e)))}function nce(e,t,n){switch(t.tag){case 3:M1(t,t.stateNode.containerInfo),zu(t,xa,e.memoizedState.cache),wf();break;case 27:case 5:xA(t);break;case 4:M1(t,t.stateNode.containerInfo);break;case 10:zu(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,MA(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(qu(t),t.flags|=128,null):n&t.child.childLanes?dq(e,t,n):(qu(t),e=Bd(e,t,n),e!==null?e.sibling:null);qu(t);break;case 19:var a=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(rv(e,t,n,!1),s=(n&t.childLanes)!==0),a){if(s)return uq(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),os(ra,ra.current),s)break;return null;case 22:return t.lanes=0,cq(e,t,n,t.pendingProps);case 24:zu(t,xa,e.memoizedState.cache)}return Bd(e,t,n)}function mq(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)va=!0;else{if(!y4(e,n)&&!(t.flags&128))return va=!1,nce(e,t,n);va=!!(e.flags&131072)}else va=!1,rn&&t.flags&1048576&&p7(t,wb,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Rh(t.elementType),t.type=e,typeof e=="function")ZP(e)?(s=_f(e,s),t.tag=1,t=$I(null,t,e,s,n)):(t.tag=0,t=FA(null,t,e,s,n));else{if(e!=null){var a=e.$$typeof;if(a===LP){t.tag=11,t=PI(null,t,e,s,n);break e}else if(a===$P){t.tag=14,t=DI(null,t,e,s,n);break e}}throw t=fA(e)||e,Error(Je(306,t,""))}}return t;case 0:return FA(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,a=_f(s,t.pendingProps),$I(e,t,s,a,n);case 3:e:{if(M1(t,t.stateNode.containerInfo),e===null)throw Error(Je(387));s=t.pendingProps;var i=t.memoizedState;a=i.element,OA(e,t),Hy(t,s,null,n);var o=t.memoizedState;if(s=o.cache,zu(t,xa,s),s!==i.cache&&TA(t,[xa],n,!0),qy(),s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=VI(e,t,s,n);break e}else if(s!==a){a=Zo(Error(Je(424)),t),jb(a),t=VI(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(xs=ll(e.firstChild),oi=t,rn=!0,gm=null,Qo=!0,n=w7(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(wf(),s===a){t=Bd(e,t,n);break e}ai(e,t,s,n)}t=t.child}return t;case 26:return o1(e,t),e===null?(n=iL(t.type,null,t.pendingProps,null))?t.memoizedState=n:rn||(n=t.type,e=t.pendingProps,s=nN(xm.current).createElement(n),s[ii]=t,s[no]=e,di(s,n,e),za(s),t.stateNode=s):t.memoizedState=iL(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xA(t),e===null&&rn&&(s=t.stateNode=rH(t.type,t.pendingProps,xm.current),oi=t,Qo=!0,a=xs,Zm(t.type)?(rT=a,xs=ll(s.firstChild)):xs=a),ai(e,t,t.pendingProps.children,n),o1(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&rn&&((a=s=xs)&&(s=Pce(s,t.type,t.pendingProps,Qo),s!==null?(t.stateNode=s,oi=t,xs=ll(s.firstChild),Qo=!1,a=!0):a=!1),a||Rm(t)),xA(t),a=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,QA(a,i)?s=null:o!==null&&QA(a,o)&&(t.flags|=32),t.memoizedState!==null&&(a=i4(e,t,Gle,null,null,n),Eb._currentValue=a),o1(e,t),ai(e,t,s,n),t.child;
vendor: 4,179 bytes, line 48
48case 6:return e===null&&rn&&((e=n=xs)&&(n=Dce(n,t.pendingProps,Qo),n!==null?(t.stateNode=n,oi=t,xs=null,e=!0):e=!1),e||Rm(t)),null;case 13:return dq(e,t,n);case 4:return M1(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Nf(t,null,s,n):ai(e,t,s,n),t.child;case 11:return PI(e,t,t.type,t.pendingProps,n);case 7:return ai(e,t,t.pendingProps,n),t.child;case 8:return ai(e,t,t.pendingProps.children,n),t.child;case 12:return ai(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,zu(t,t.type,s.value),ai(e,t,s.children,n),t.child;case 9:return a=t.type._context,s=t.pendingProps.children,jf(t),a=li(a),s=s(a),t.flags|=1,ai(e,t,s,n),t.child;case 14:return DI(e,t,t.type,t.pendingProps,n);case 15:return lq(e,t,t.type,t.pendingProps,n);case 19:return uq(e,t,n);case 31:return rce(e,t,n);case 22:return cq(e,t,n,t.pendingProps);case 24:return jf(t),s=li(xa),e===null?(a=t4(),a===null&&(a=Gn,i=e4(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:s,cache:a},n4(t),zu(t,xa,a)):(e.lanes&n&&(OA(e,t),Hy(t,null,null,n),qy()),a=e.memoizedState,i=t.memoizedState,a.parent!==s?(a={parent:s,cache:s},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),zu(t,xa,s)):(s=i.cache,zu(t,xa,s),s!==a.cache&&TA(t,[xa],n,!0))),ai(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Je(156,t.tag))}function ad(e){e.flags|=4}function tk(e,t,n,s,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Iq())e.flags|=8192;else throw mf=z1,r4}else e.flags&=-16777217}function FI(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!aH(t))if(Iq())e.flags|=8192;else throw mf=z1,r4}function ej(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?L9():536870912,e.lanes|=t,Jx|=t)}function Zv(e,t){if(!rn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function ms(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags&65011712,s|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function sce(e,t,n){var s=t.pendingProps;switch(JP(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ms(t),null;case 1:return ms(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),kd(xa),Yx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xp(t)?ad(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,WC())),ms(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(ad(t),i!==null?(ms(t),FI(t,i)):(ms(t),tk(t,a,null,s,n))):i?i!==e.memoizedState?(ad(t),ms(t),FI(t,i)):(ms(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ad(t),ms(t),tk(t,a,e,s,n)),null;case 27:if(I1(t),n=xm.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ad(t);else{if(!s){if(t.stateNode===null)throw Error(Je(166));return ms(t),null}e=_c.current,xp(t)?xI(t):(e=rH(a,s,n),t.stateNode=e,ad(t))}return ms(t),null;case 5:if(I1(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ad(t);else{if(!s){if(t.stateNode===null)throw Error(Je(166));return ms(t),null}if(i=_c.current,xp(t))xI(t);else{var o=nN(xm.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;
vendor: 4,505 bytes, line 48
48case"select":i=typeof s.is=="string"?o.createElement("select",{is:s.is}):o.createElement("select"),s.multiple?i.multiple=!0:s.size&&(i.size=s.size);break;default:i=typeof s.is=="string"?o.createElement(a,{is:s.is}):o.createElement(a)}}i[ii]=t,i[no]=s;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(di(i,a,s),a){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ad(t)}}return ms(t),tk(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ad(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Je(166));if(e=xm.current,xp(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,a=oi,a!==null)switch(a.tag){case 27:case 5:s=a.memoizedProps}e[ii]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||Qq(e.nodeValue,n)),e||Rm(t,!0)}else e=nN(e).createTextNode(s),e[ii]=t,t.stateNode=e}return ms(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=xp(t),n!==null){if(e===null){if(!s)throw Error(Je(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Je(557));e[ii]=t}else wf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ms(t),e=!1}else n=WC(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(Je(558))}return ms(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=xp(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(Je(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Je(317));a[ii]=t}else wf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ms(t),a=!1}else a=WC(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,a=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(a=s.alternate.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==a&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ej(t,t.updateQueue),ms(t),null);case 4:return Yx(),e===null&&C4(t.stateNode.containerInfo),ms(t),null;case 10:return kd(t.type),ms(t),null;case 19:if(Ha(ra),s=t.memoizedState,s===null)return ms(t),null;if(a=(t.flags&128)!==0,i=s.rendering,i===null)if(a)Zv(s,!1);else{if(Xs!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=H1(e),i!==null){for(t.flags|=128,Zv(s,!1),e=i.updateQueue,t.updateQueue=e,ej(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)h7(n,e),n=n.sibling;return os(ra,ra.current&1|2),rn&&gd(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&_o()>Z1&&(t.flags|=128,a=!0,Zv(s,!1),t.lanes=4194304)}else{if(!a)if(e=H1(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ej(t,e),Zv(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!rn)return ms(t),null}else 2*_o()-s.renderingStartTime>Z1&&n!==536870912&&(t.flags|=128,a=!0,Zv(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(e=s.last,e!==null?e.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=_o(),e.sibling=null,n=ra.current,os(ra,a?n&1|2:n&1),rn&&gd(t,s.treeForkCount),e):(ms(t),null);case 22:case 23:return po(t),s4(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(ms(t),t.subtreeFlags&6&&(t.flags|=8192)):ms(t),n=t.updateQueue,n!==null&&ej(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Ha(uf),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),kd(xa),ms(t),null;case 25:return null;case 30:return null}throw Error(Je(156,t.tag))}function ace(e,t){switch(JP(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 5,796 bytes, line 48
48case 3:return kd(xa),Yx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return I1(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(Je(340));wf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Je(340));wf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ha(ra),null;case 4:return Yx(),null;case 10:return kd(t.type),null;case 22:case 23:return po(t),s4(),e!==null&&Ha(uf),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return kd(xa),null;case 25:return null;default:return null}}function hq(e,t){switch(JP(t),t.tag){case 3:kd(xa),Yx();break;case 26:case 27:case 5:I1(t);break;case 4:Yx();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:Ha(ra);break;case 10:kd(t.type);break;case 22:case 23:po(t),s4(),e!==null&&Ha(uf);break;case 24:kd(xa)}}function sw(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var a=s.next;n=a;do{if((n.tag&e)===e){s=void 0;var i=n.create,o=n.inst;s=i(),o.destroy=s}n=n.next}while(n!==a)}}catch(l){Pn(t,t.return,l)}}function Om(e,t,n){try{var s=t.updateQueue,a=s!==null?s.lastEffect:null;if(a!==null){var i=a.next;s=i;do{if((s.tag&e)===e){var o=s.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,a=t;var c=n,d=l;try{d()}catch(u){Pn(a,c,u)}}}s=s.next}while(s!==i)}}catch(u){Pn(t,t.return,u)}}function fq(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{N7(t,n)}catch(s){Pn(e,e.return,s)}}}function pq(e,t,n){n.props=_f(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Pn(e,t,s)}}function Yy(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(a){Pn(e,t,a)}}function vc(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(a){Pn(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){Pn(e,t,a)}else n.current=null}function xq(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(a){Pn(e,e.return,a)}}function rk(e,t,n){try{var s=e.stateNode;kce(s,e.type,n,t),s[no]=t}catch(a){Pn(e,e.return,a)}}function gq(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zm(e.type)||e.tag===4}function nk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gq(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zm(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zA(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jd));else if(s!==4&&(s===27&&Zm(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(zA(e,t,n),e=e.sibling;e!==null;)zA(e,t,n),e=e.sibling}function X1(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Zm(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(X1(e,t,n),e=e.sibling;e!==null;)X1(e,t,n),e=e.sibling}function vq(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);di(t,s,n),t[ii]=e,t[no]=n}catch(i){Pn(e,e.return,i)}}var bd=!1,fa=!1,sk=!1,BI=typeof WeakSet=="function"?WeakSet:Set,Ba=null;function ice(e,t){if(e=e.containerInfo,XA=oN,e=a7(e),GP(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var a=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,u=0,m=e,f=null;t:for(;;){for(var p;m!==n||a!==0&&m.nodeType!==3||(l=o+a),m!==i||s!==0&&m.nodeType!==3||(c=o+s),m.nodeType===3&&(o+=m.nodeValue.length),(p=m.firstChild)!==null;)f=m,m=p;for(;;){if(m===e)break t;if(f===n&&++d===a&&(l=o),f===i&&++u===s&&(c=o),(p=m.nextSibling)!==null)break;m=f,f=m.parentNode}m=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ZA={focusedElem:e,selectionRange:n},oN=!1,Ba=t;Ba!==null;)if(t=Ba,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ba=e;else for(;Ba!==null;){switch(t=Ba,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var x=_f(n.type,a);e=s.getSnapshotBeforeUpdate(x,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(g){Pn(n,n.return,g)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)JA(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":JA(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(Je(163))}if(e=t.sibling,e!==null){e.return=t.return,Ba=e;break}Ba=t.return}}function yq(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:od(e,n),s&4&&sw(5,n);break;case 1:if(od(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){Pn(n,n.return,o)}else{var a=_f(n.type,t.memoizedProps);t=t.memoizedState;
vendor: 19,421 bytes, line 48
48try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Pn(n,n.return,o)}}s&64&&fq(n),s&512&&Yy(n,n.return);break;case 3:if(od(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{N7(e,t)}catch(o){Pn(n,n.return,o)}}break;case 27:t===null&&s&4&&vq(n);case 26:case 5:od(e,n),t===null&&s&4&&xq(n),s&512&&Yy(n,n.return);break;case 12:od(e,n);break;case 31:od(e,n),s&4&&jq(e,n);break;case 13:od(e,n),s&4&&Nq(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=pce.bind(null,n),Mce(e,n))));break;case 22:if(s=n.memoizedState!==null||bd,!s){t=t!==null&&t.memoizedState!==null||fa,a=bd;var i=fa;bd=s,(fa=t)&&!i?hd(e,n,(n.subtreeFlags&8772)!==0):od(e,n),bd=a,fa=i}break;case 30:break;default:od(e,n)}}function bq(e){var t=e.alternate;t!==null&&(e.alternate=null,bq(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&BP(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Cs=null,Yi=!1;function id(e,t,n){for(n=n.child;n!==null;)wq(e,t,n),n=n.sibling}function wq(e,t,n){if(Co&&typeof Co.onCommitFiberUnmount=="function")try{Co.onCommitFiberUnmount(Z0,n)}catch{}switch(n.tag){case 26:fa||vc(n,t),id(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:fa||vc(n,t);var s=Cs,a=Yi;Zm(n.type)&&(Cs=n.stateNode,Yi=!1),id(e,t,n),Zy(n.stateNode),Cs=s,Yi=a;break;case 5:fa||vc(n,t);case 6:if(s=Cs,a=Yi,Cs=null,id(e,t,n),Cs=s,Yi=a,Cs!==null)if(Yi)try{(Cs.nodeType===9?Cs.body:Cs.nodeName==="HTML"?Cs.ownerDocument.body:Cs).removeChild(n.stateNode)}catch(i){Pn(n,t,i)}else try{Cs.removeChild(n.stateNode)}catch(i){Pn(n,t,i)}break;case 18:Cs!==null&&(Yi?(e=Cs,tL(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ng(e)):tL(Cs,n.stateNode));break;case 4:s=Cs,a=Yi,Cs=n.stateNode.containerInfo,Yi=!0,id(e,t,n),Cs=s,Yi=a;break;case 0:case 11:case 14:case 15:Om(2,n,t),fa||Om(4,n,t),id(e,t,n);break;case 1:fa||(vc(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&pq(n,t,s)),id(e,t,n);break;case 21:id(e,t,n);break;case 22:fa=(s=fa)||n.memoizedState!==null,id(e,t,n),fa=s;break;default:id(e,t,n)}}function jq(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ng(e)}catch(n){Pn(t,t.return,n)}}}function Nq(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ng(e)}catch(n){Pn(t,t.return,n)}}function oce(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new BI),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new BI),t;default:throw Error(Je(435,e.tag))}}function tj(e,t){var n=oce(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var a=xce.bind(null,e,s);s.then(a,a)}})}function Bi(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var a=n[s],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Zm(l.type)){Cs=l.stateNode,Yi=!1;break e}break;case 5:Cs=l.stateNode,Yi=!1;break e;case 3:case 4:Cs=l.stateNode.containerInfo,Yi=!0;break e}l=l.return}if(Cs===null)throw Error(Je(160));wq(i,o,a),Cs=null,Yi=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sq(t,e),t=t.sibling}var Ml=null;function Sq(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Bi(t,e),zi(e),s&4&&(Om(3,e,e.return),sw(3,e),Om(5,e,e.return));break;case 1:Bi(t,e),zi(e),s&512&&(fa||n===null||vc(n,n.return)),s&64&&bd&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var a=Ml;if(Bi(t,e),zi(e),s&512&&(fa||n===null||vc(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(s){case"title":i=a.getElementsByTagName("title")[0],(!i||i[ew]||i[ii]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(s),a.head.insertBefore(i,a.querySelector("head > title"))),di(i,s,n),i[ii]=e,za(i),s=i;break e;case"link":var o=lL("link","href",a).get(s+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}i=a.createElement(s),di(i,s,n),a.head.appendChild(i);break;case"meta":if(o=lL("meta","content",a).get(s+(n.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}i=a.createElement(s),di(i,s,n),a.head.appendChild(i);break;default:throw Error(Je(468,s))}i[ii]=e,za(i),s=i}e.stateNode=s}else cL(a,e.type,e.stateNode);else e.stateNode=oL(a,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?cL(a,e.type,e.stateNode):oL(a,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rk(e,e.memoizedProps,n.memoizedProps)}break;case 27:Bi(t,e),zi(e),s&512&&(fa||n===null||vc(n,n.return)),n!==null&&s&4&&rk(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Bi(t,e),zi(e),s&512&&(fa||n===null||vc(n,n.return)),e.flags&32){a=e.stateNode;try{Kx(a,"")}catch(x){Pn(e,e.return,x)}}s&4&&e.stateNode!=null&&(a=e.memoizedProps,rk(e,a,n!==null?n.memoizedProps:a)),s&1024&&(sk=!0);break;case 6:if(Bi(t,e),zi(e),s&4){if(e.stateNode===null)throw Error(Je(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(x){Pn(e,e.return,x)}}break;case 3:if(d1=null,a=Ml,Ml=sN(t.containerInfo),Bi(t,e),Ml=a,zi(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ng(t.containerInfo)}catch(x){Pn(e,e.return,x)}sk&&(sk=!1,_q(e));break;case 4:s=Ml,Ml=sN(e.stateNode.containerInfo),Bi(t,e),zi(e),Ml=s;break;case 12:Bi(t,e),zi(e);break;case 31:Bi(t,e),zi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tj(e,s)));break;case 13:Bi(t,e),zi(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(b_=_o()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tj(e,s)));break;case 22:a=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=bd,u=fa;if(bd=d||a,fa=u||c,Bi(t,e),fa=u,bd=d,zi(e),s&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||c||bd||fa||Oh(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,a)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var m=c.memoizedProps.style,f=m!=null&&m.hasOwnProperty("display")?m.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(x){Pn(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(x){Pn(c,c.return,x)}}}else if(t.tag===18){if(n===null){c=t;try{var p=c.stateNode;a?rL(p,!0):rL(c.stateNode,!1)}catch(x){Pn(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,tj(e,n))));break;case 19:Bi(t,e),zi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tj(e,s)));break;case 30:break;case 21:break;default:Bi(t,e),zi(e)}}function zi(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(gq(s)){n=s;break}s=s.return}if(n==null)throw Error(Je(160));switch(n.tag){case 27:var a=n.stateNode,i=nk(e);X1(e,i,a);break;case 5:var o=n.stateNode;n.flags&32&&(Kx(o,""),n.flags&=-33);var l=nk(e);X1(e,l,o);break;case 3:case 4:var c=n.stateNode.containerInfo,d=nk(e);zA(e,d,c);break;default:throw Error(Je(161))}}catch(u){Pn(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _q(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_q(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function od(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yq(e,t.alternate,t),t=t.sibling}function Oh(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Om(4,t,t.return),Oh(t);break;case 1:vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&pq(t,t.return,n),Oh(t);break;case 27:Zy(t.stateNode);case 26:case 5:vc(t,t.return),Oh(t);break;case 22:t.memoizedState===null&&Oh(t);break;case 30:Oh(t);break;default:Oh(t)}e=e.sibling}}function hd(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,a=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:hd(a,i,n),sw(4,i);break;case 1:if(hd(a,i,n),s=i,a=s.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(d){Pn(s,s.return,d)}if(s=i,a=s.updateQueue,a!==null){var l=s.stateNode;try{var c=a.shared.hiddenCallbacks;if(c!==null)for(a.shared.hiddenCallbacks=null,a=0;a<c.length;a++)j7(c[a],l)}catch(d){Pn(s,s.return,d)}}n&&o&64&&fq(i),Yy(i,i.return);break;case 27:vq(i);case 26:case 5:hd(a,i,n),n&&s===null&&o&4&&xq(i),Yy(i,i.return);break;case 12:hd(a,i,n);break;case 31:hd(a,i,n),n&&o&4&&jq(a,i);break;case 13:hd(a,i,n),n&&o&4&&Nq(a,i);break;case 22:i.memoizedState===null&&hd(a,i,n),Yy(i,i.return);break;case 30:break;default:hd(a,i,n)}t=t.sibling}}function b4(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&rw(n))}function w4(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rw(e))}function Sl(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cq(e,t,n,s),t=t.sibling}function Cq(e,t,n,s){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,s),a&2048&&sw(9,t);break;case 1:Sl(e,t,n,s);break;case 3:Sl(e,t,n,s),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rw(e)));break;case 12:if(a&2048){Sl(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Pn(t,t.return,c)}}else Sl(e,t,n,s);break;case 31:Sl(e,t,n,s);break;case 13:Sl(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Sl(e,t,n,s):Gy(e,t):i._visibility&2?Sl(e,t,n,s):(i._visibility|=2,Lp(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),a&2048&&b4(o,t);break;case 24:Sl(e,t,n,s),a&2048&&w4(t.alternate,t);break;default:Sl(e,t,n,s)}}function Lp(e,t,n,s,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=n,c=s,d=o.flags;switch(o.tag){case 0:case 11:case 15:Lp(i,o,l,c,a),sw(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?Lp(i,o,l,c,a):Gy(i,o):(u._visibility|=2,Lp(i,o,l,c,a)),a&&d&2048&&b4(o.alternate,o);break;case 24:Lp(i,o,l,c,a),a&&d&2048&&w4(o.alternate,o);break;default:Lp(i,o,l,c,a)}t=t.sibling}}function Gy(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,a=s.flags;switch(s.tag){case 22:Gy(n,s),a&2048&&b4(s.alternate,s);break;case 24:Gy(n,s),a&2048&&w4(s.alternate,s);break;default:Gy(n,s)}t=t.sibling}}var Ey=8192;function gp(e,t,n){if(e.subtreeFlags&Ey)for(e=e.child;e!==null;)kq(e,t,n),e=e.sibling}function kq(e,t,n){switch(e.tag){case 26:gp(e,t,n),e.flags&Ey&&e.memoizedState!==null&&Yce(n,Ml,e.memoizedState,e.memoizedProps);break;case 5:gp(e,t,n);break;case 3:case 4:var s=Ml;Ml=sN(e.stateNode.containerInfo),gp(e,t,n),Ml=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ey,Ey=16777216,gp(e,t,n),Ey=s):gp(e,t,n));break;default:gp(e,t,n)}}function Eq(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qv(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Ba=s,Tq(s,e)}Eq(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Aq(e),e=e.sibling}function Aq(e){switch(e.tag){case 0:case 11:case 15:Qv(e),e.flags&2048&&Om(9,e,e.return);break;case 3:Qv(e);break;case 12:Qv(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,l1(e)):Qv(e);break;default:Qv(e)}}function l1(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Ba=s,Tq(s,e)}Eq(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Om(8,t,t.return),l1(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,l1(t));break;default:l1(t)}e=e.sibling}}function Tq(e,t){for(;Ba!==null;){var n=Ba;switch(n.tag){case 0:case 11:case 15:Om(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:rw(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Ba=s;else e:for(n=e;Ba!==null;){s=Ba;var a=s.sibling,i=s.return;if(bq(s),s===n){Ba=null;break e}if(a!==null){a.return=i,Ba=a;break e}Ba=i}}}var lce={getCacheForType:function(e){var t=li(xa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return li(xa).controller.signal}},cce=typeof WeakMap=="function"?WeakMap:Map,vn=0,Gn=null,Yr=null,Kr=0,On=0,ho=null,om=!1,sv=!1,j4=!1,zd=0,Xs=0,Pm=0,hf=0,N4=0,No=0,Jx=0,Ky=null,Ki=null,qA=!1,b_=0,Rq=0,Z1=1/0,Q1=null,bm=null,Oa=0,wm=null,eg=null,Ed=0,HA=0,WA=null,Oq=null,Xy=0,YA=null;function Eo(){return vn&2&&Kr!==0?Kr&-Kr:br.T!==null?_4():F9()}function Pq(){if(No===0)if(!(Kr&536870912)||rn){var e=Yw;Yw<<=1,!(Yw&3932160)&&(Yw=262144),No=e}else No=536870912;return e=Oo.current,e!==null&&(e.flags|=32),No}function to(e,t,n){(e===Gn&&(On===2||On===9)||e.cancelPendingCommit!==null)&&(tg(e,0),lm(e,Kr,No,!1)),J0(e,n),(!(vn&2)||e!==Gn)&&(e===Gn&&(!(vn&2)&&(hf|=n),Xs===4&&lm(e,Kr,No,!1)),zc(e))}function Dq(e,t,n){if(vn&6)throw Error(Je(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Q0(e,t),a=s?mce(e,t):ak(e,t,!0),i=s;do{if(a===0){sv&&!s&&lm(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!dce(n)){a=ak(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;a=Ky;var c=l.current.memoizedState.isDehydrated;if(c&&(tg(l,o).flags|=256),o=ak(l,o,!1),o!==2){if(j4&&!c){l.errorRecoveryDisabledLanes|=i,hf|=i,a=4;break e}i=Ki,Ki=a,i!==null&&(Ki===null?Ki=i:Ki.push.apply(Ki,i))}a=o}if(i=!1,a!==2)continue}}if(a===1){tg(e,0),lm(e,t,0,!0);break}e:{switch(s=e,i=a,i){case 0:case 1:throw Error(Je(345));case 4:if((t&4194048)!==t)break;case 6:lm(s,t,No,!om);break e;case 2:Ki=null;break;case 3:case 5:break;default:throw Error(Je(329))}if((t&62914560)===t&&(a=b_+300-_o(),10<a)){if(lm(s,t,No,!om),c_(s,0,!0)!==0)break e;Ed=t,s.timeoutHandle=eH(zI.bind(null,s,n,Ki,Q1,qA,t,No,hf,Jx,om,i,"Throttled",-0,0),a);break e}zI(s,n,Ki,Q1,qA,t,No,hf,Jx,om,i,null,-0,0)}}break}while(!0);zc(e)}function zI(e,t,n,s,a,i,o,l,c,d,u,m,f,p){if(e.timeoutHandle=-1,m=t.subtreeFlags,m&8192||(m&16785408)===16785408){m={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jd},kq(t,i,m);var x=(i&62914560)===i?b_-_o():(i&4194048)===i?Rq-_o():0;if(x=Gce(m,x),x!==null){Ed=i,e.cancelPendingCommit=x(HI.bind(null,e,t,i,n,s,a,o,l,c,u,m,null,f,p)),lm(e,i,o,!d);return}}HI(e,t,i,n,s,a,o,l,c)}function dce(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var a=n[s],i=a.getSnapshot;a=a.value;try{if(!Ro(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function lm(e,t,n,s){t&=~N4,t&=~hf,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var a=t;0<a;){var i=31-ko(a),o=1<<i;s[i]=-1,a&=~o}n!==0&&$9(e,n,t)}function w_(){return vn&6?!0:(aw(0),!1)}function S4(){if(Yr!==null){if(On===0)var e=Yr.return;else e=Yr,Nd=tp=null,c4(e),bx=null,Nb=0,e=Yr;for(;e!==null;)hq(e.alternate,e),e=e.return;Yr=null}}function tg(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Tce(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,S4(),Gn=e,Yr=n=Cd(e.current,null),Kr=t,On=0,ho=null,om=!1,sv=Q0(e,t),j4=!1,Jx=No=N4=hf=Pm=Xs=0,Ki=Ky=null,qA=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var a=31-ko(s),i=1<<a;t|=e[a],s&=~i}return zd=t,h_(),n}function Mq(e,t){Pr=null,br.H=_b,t===nv||t===p_?(t=wI(),On=3):t===r4?(t=wI(),On=4):On=t===v4?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ho=t,Yr===null&&(Xs=1,G1(e,Zo(t,e.current)))}function Iq(){var e=Oo.current;return e===null?!0:(Kr&4194048)===Kr?ol===null:(Kr&62914560)===Kr||Kr&536870912?e===ol:!1}function Lq(){var e=br.H;return br.H=_b,e===null?_b:e}function $q(){var e=br.A;return br.A=lce,e}function J1(){Xs=4,om||(Kr&4194048)!==Kr&&Oo.current!==null||(sv=!0),!(Pm&134217727)&&!(hf&134217727)||Gn===null||lm(Gn,Kr,No,!1)}function ak(e,t,n){var s=vn;vn|=2;var a=Lq(),i=$q();(Gn!==e||Kr!==t)&&(Q1=null,tg(e,t)),t=!1;var o=Xs;e:do try{if(On!==0&&Yr!==null){var l=Yr,c=ho;switch(On){case 8:S4(),o=6;break e;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var d=On;if(On=0,ho=null,tx(e,l,c,d),n&&sv){o=0;break e}break;default:d=On,On=0,ho=null,tx(e,l,c,d)}}uce(),o=Xs;break}catch(u){Mq(e,u)}while(!0);return t&&e.shellSuspendCounter++,Nd=tp=null,vn=s,br.H=a,br.A=i,Yr===null&&(Gn=null,Kr=0,h_()),o}function uce(){for(;Yr!==null;)Vq(Yr)}function mce(e,t){var n=vn;vn|=2;var s=Lq(),a=$q();Gn!==e||Kr!==t?(Q1=null,Z1=_o()+500,tg(e,t)):sv=Q0(e,t);e:do try{if(On!==0&&Yr!==null){t=Yr;var i=ho;t:switch(On){case 1:On=0,ho=null,tx(e,t,i,1);break;case 2:case 9:if(bI(i)){On=0,ho=null,qI(t);break}t=function(){On!==2&&On!==9||Gn!==e||(On=7),zc(e)},i.then(t,t);break e;case 3:On=7;break e;case 4:On=5;break e;case 7:bI(i)?(On=0,ho=null,qI(t)):(On=0,ho=null,tx(e,t,i,7));break;case 5:var o=null;switch(Yr.tag){case 26:o=Yr.memoizedState;case 5:case 27:var l=Yr;if(o?aH(o):l.stateNode.complete){On=0,ho=null;var c=l.sibling;if(c!==null)Yr=c;else{var d=l.return;d!==null?(Yr=d,j_(d)):Yr=null}break t}}On=0,ho=null,tx(e,t,i,5);break;case 6:On=0,ho=null,tx(e,t,i,6);break;case 8:S4(),Xs=6;break e;default:throw Error(Je(462))}}hce();break}catch(u){Mq(e,u)}while(!0);return Nd=tp=null,br.H=s,br.A=a,vn=n,Yr!==null?0:(Gn=null,Kr=0,h_(),Xs)}function hce(){for(;
vendor: 5,152 bytes, line 48
48Yr!==null&&!Ioe();)Vq(Yr)}function Vq(e){var t=mq(e.alternate,e,zd);e.memoizedProps=e.pendingProps,t===null?j_(e):Yr=t}function qI(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=LI(n,t,t.pendingProps,t.type,void 0,Kr);break;case 11:t=LI(n,t,t.pendingProps,t.type.render,t.ref,Kr);break;case 5:c4(t);default:hq(n,t),t=Yr=h7(t,zd),t=mq(n,t,zd)}e.memoizedProps=e.pendingProps,t===null?j_(e):Yr=t}function tx(e,t,n,s){Nd=tp=null,c4(t),bx=null,Nb=0;var a=t.return;try{if(tce(e,a,t,n,Kr)){Xs=1,G1(e,Zo(n,e.current)),Yr=null;return}}catch(i){if(a!==null)throw Yr=a,i;Xs=1,G1(e,Zo(n,e.current)),Yr=null;return}t.flags&32768?(rn||s===1?e=!0:sv||Kr&536870912?e=!1:(om=e=!0,(s===2||s===9||s===3||s===6)&&(s=Oo.current,s!==null&&s.tag===13&&(s.flags|=16384))),Uq(t,e)):j_(t)}function j_(e){var t=e;do{if(t.flags&32768){Uq(t,om);return}e=t.return;var n=sce(t.alternate,t,zd);if(n!==null){Yr=n;return}if(t=t.sibling,t!==null){Yr=t;return}Yr=t=e}while(t!==null);Xs===0&&(Xs=5)}function Uq(e,t){do{var n=ace(e.alternate,e);if(n!==null){n.flags&=32767,Yr=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Yr=e;return}Yr=e=n}while(e!==null);Xs=6,Yr=null}function HI(e,t,n,s,a,i,o,l,c){e.cancelPendingCommit=null;do N_();while(Oa!==0);if(vn&6)throw Error(Je(327));if(t!==null){if(t===e.current)throw Error(Je(177));if(i=t.lanes|t.childLanes,i|=KP,Woe(e,n,i,o,l,c),e===Gn&&(Yr=Gn=null,Kr=0),eg=t,wm=e,Ed=n,HA=i,WA=a,Oq=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,gce(L1,function(){return Hq(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=br.T,br.T=null,a=yn.p,yn.p=2,o=vn,vn|=4;try{ice(e,t,n)}finally{vn=o,yn.p=a,br.T=s}}Oa=1,Fq(),Bq(),zq()}}function Fq(){if(Oa===1){Oa=0;var e=wm,t=eg,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=br.T,br.T=null;var s=yn.p;yn.p=2;var a=vn;vn|=4;try{Sq(t,e);var i=ZA,o=a7(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&s7(l.ownerDocument.documentElement,l)){if(c!==null&&GP(l)){var d=c.start,u=c.end;if(u===void 0&&(u=d),"selectionStart"in l)l.selectionStart=d,l.selectionEnd=Math.min(u,l.value.length);else{var m=l.ownerDocument||document,f=m&&m.defaultView||window;if(f.getSelection){var p=f.getSelection(),x=l.textContent.length,g=Math.min(c.start,x),v=c.end===void 0?g:Math.min(c.end,x);!p.extend&&g>v&&(o=v,v=g,g=o);var y=hI(l,g),b=hI(l,v);if(y&&b&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var w=m.createRange();w.setStart(y.node,y.offset),p.removeAllRanges(),g>v?(p.addRange(w),p.extend(b.node,b.offset)):(w.setEnd(b.node,b.offset),p.addRange(w))}}}}for(m=[],p=l;p=p.parentNode;)p.nodeType===1&&m.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<m.length;l++){var S=m[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}oN=!!XA,ZA=XA=null}finally{vn=a,yn.p=s,br.T=n}}e.current=t,Oa=2}}function Bq(){if(Oa===2){Oa=0;var e=wm,t=eg,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=br.T,br.T=null;var s=yn.p;yn.p=2;var a=vn;vn|=4;try{yq(e,t.alternate,t)}finally{vn=a,yn.p=s,br.T=n}}Oa=3}}function zq(){if(Oa===4||Oa===3){Oa=0,Loe();var e=wm,t=eg,n=Ed,s=Oq;t.subtreeFlags&10256||t.flags&10256?Oa=5:(Oa=0,eg=wm=null,qq(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(bm=null),FP(n),t=t.stateNode,Co&&typeof Co.onCommitFiberRoot=="function")try{Co.onCommitFiberRoot(Z0,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=br.T,a=yn.p,yn.p=2,br.T=null;try{for(var i=e.onRecoverableError,o=0;o<s.length;o++){var l=s[o];i(l.value,{componentStack:l.stack})}}finally{br.T=t,yn.p=a}}Ed&3&&N_(),zc(e),a=e.pendingLanes,n&261930&&a&42?e===YA?Xy++:(Xy=0,YA=e):Xy=0,aw(0)}}function qq(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rw(t)))}function N_(){return Fq(),Bq(),zq(),Hq()}function Hq(){if(Oa!==5)return!1;var e=wm,t=HA;HA=0;var n=FP(Ed),s=br.T,a=yn.p;try{yn.p=32>n?32:n,br.T=null,n=WA,WA=null;var i=wm,o=Ed;if(Oa=0,eg=wm=null,Ed=0,vn&6)throw Error(Je(331));var l=vn;if(vn|=4,Aq(i.current),Cq(i,i.current,o,n),vn=l,aw(0,!1),Co&&typeof Co.onPostCommitFiberRoot=="function")try{Co.onPostCommitFiberRoot(Z0,i)}catch{}return!0}finally{yn.p=a,br.T=s,qq(e,t)}}function WI(e,t,n){t=Zo(n,t),t=UA(e.stateNode,t,2),e=ym(e,t,2),e!==null&&(J0(e,2),zc(e))}function Pn(e,t,n){if(e.tag===3)WI(e,e,n);else for(;t!==null;){if(t.tag===3){WI(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bm===null||!bm.has(s))){e=Zo(n,e),n=iq(2),s=ym(t,n,2),s!==null&&(oq(n,s,t,e),J0(s,2),zc(s));break}}t=t.return}}function ik(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new cce;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(n)||(j4=!0,a.add(n),e=fce.bind(null,e,t,n),t.then(e,e))}function fce(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gn===e&&(Kr&n)===n&&(Xs===4||Xs===3&&(Kr&62914560)===Kr&&300>
vendor: 4,139 bytes, line 48
48_o()-b_?!(vn&2)&&tg(e,0):N4|=n,Jx===Kr&&(Jx=0)),zc(e)}function Wq(e,t){t===0&&(t=L9()),e=ep(e,t),e!==null&&(J0(e,t),zc(e))}function pce(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wq(e,n)}function xce(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(Je(314))}s!==null&&s.delete(t),Wq(e,n)}function gce(e,t){return VP(e,t)}var eN=null,$p=null,GA=!1,tN=!1,ok=!1,cm=0;function zc(e){e!==$p&&e.next===null&&($p===null?eN=$p=e:$p=$p.next=e),tN=!0,GA||(GA=!0,yce())}function aw(e,t){if(!ok&&tN){ok=!0;do for(var n=!1,s=eN;s!==null;){if(e!==0){var a=s.pendingLanes;if(a===0)var i=0;else{var o=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-ko(42|e)+1)-1,i&=a&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,YI(s,i))}else i=Kr,i=c_(s,s===Gn?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Q0(s,i)||(n=!0,YI(s,i));s=s.next}while(n);ok=!1}}function vce(){Yq()}function Yq(){tN=GA=!1;var e=0;cm!==0&&Ace()&&(e=cm);for(var t=_o(),n=null,s=eN;s!==null;){var a=s.next,i=Gq(s,t);i===0?(s.next=null,n===null?eN=a:n.next=a,a===null&&($p=n)):(n=s,(e!==0||i&3)&&(tN=!0)),s=a}Oa!==0&&Oa!==5||aw(e),cm!==0&&(cm=0)}function Gq(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-ko(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&s)&&(a[o]=Hoe(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Gn,n=Kr,n=c_(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(On===2||On===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&MC(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Q0(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&MC(s),FP(n)){case 2:case 8:n=M9;break;case 32:n=L1;break;case 268435456:n=I9;break;default:n=L1}return s=Kq.bind(null,e),n=VP(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&MC(s),e.callbackPriority=2,e.callbackNode=null,2}function Kq(e,t){if(Oa!==0&&Oa!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(N_()&&e.callbackNode!==n)return null;var s=Kr;return s=c_(e,e===Gn?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Dq(e,s,t),Gq(e,_o()),e.callbackNode!=null&&e.callbackNode===n?Kq.bind(null,e):null)}function YI(e,t){if(N_())return null;Dq(e,t,!0)}function yce(){Rce(function(){vn&6?VP(D9,vce):Yq()})}function _4(){if(cm===0){var e=Xx;e===0&&(e=Ww,Ww<<=1,!(Ww&261888)&&(Ww=256)),cm=e}return cm}function GI(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jj(""+e)}function KI(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function bce(e,t,n,s,a){if(t==="submit"&&n&&n.stateNode===a){var i=GI((a[no]||null).action),o=s.submitter;o&&(t=(t=o[no]||null)?GI(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new d_("action","action",null,s,a);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(cm!==0){var c=o?KI(a,o):new FormData(a);$A(n,{pending:!0,data:c,method:a.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?KI(a,o):new FormData(a),$A(n,{pending:!0,data:c,method:a.method,action:i},i,c))},currentTarget:a}]})}}for(var lk=0;lk<CA.length;lk++){var ck=CA[lk],wce=ck.toLowerCase(),jce=ck[0].toUpperCase()+ck.slice(1);Zl(wce,"on"+jce)}Zl(o7,"onAnimationEnd");Zl(l7,"onAnimationIteration");Zl(c7,"onAnimationStart");Zl("dblclick","onDoubleClick");Zl("focusin","onFocus");Zl("focusout","onBlur");Zl($le,"onTransitionRun");Zl(Vle,"onTransitionStart");Zl(Ule,"onTransitionCancel");Zl(d7,"onTransitionEnd");Gx("onMouseEnter",["mouseout","mouseover"]);Gx("onMouseLeave",["mouseout","mouseover"]);Gx("onPointerEnter",["pointerout","pointerover"]);Gx("onPointerLeave",["pointerout","pointerover"]);Zf("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,834 bytes, line 48
48Zf("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zf("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zf("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zf("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zf("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cb="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(" "),Nce=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cb));function Xq(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],a=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;i=l,a.currentTarget=d;try{i(a)}catch(u){V1(u)}a.currentTarget=null,i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;i=l,a.currentTarget=d;try{i(a)}catch(u){V1(u)}a.currentTarget=null,i=c}}}}function Wr(e,t){var n=t[vA];n===void 0&&(n=t[vA]=new Set);var s=e+"__bubble";n.has(s)||(Zq(t,e,2,!1),n.add(s))}function dk(e,t,n){var s=0;t&&(s|=4),Zq(n,e,s,t)}var rj="_reactListening"+Math.random().toString(36).slice(2);function C4(e){if(!e[rj]){e[rj]=!0,B9.forEach(function(n){n!=="selectionchange"&&(Nce.has(n)||dk(n,!1,e),dk(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rj]||(t[rj]=!0,dk("selectionchange",!1,t))}}function Zq(e,t,n,s){switch(dH(t)){case 2:var a=Zce;break;case 8:a=Qce;break;default:a=T4}n=a.bind(null,t,n,e),a=void 0,!NA||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),s?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function uk(e,t,n,s,a){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===a)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===a)return;o=o.return}for(;l!==null;){if(o=Wp(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){s=i=o;continue e}l=l.parentNode}}s=s.return}X9(function(){var d=i,u=qP(n),m=[];e:{var f=u7.get(e);if(f!==void 0){var p=d_,x=e;switch(e){case"keypress":if(t1(n)===0)break e;case"keydown":case"keyup":p=xle;break;case"focusin":x="focus",p=UC;break;case"focusout":x="blur",p=UC;break;case"beforeblur":case"afterblur":p=UC;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=nI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=sle;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=yle;break;case o7:case l7:case c7:p=ole;break;case d7:p=wle;break;case"scroll":case"scrollend":p=rle;break;case"wheel":p=Nle;break;case"copy":case"cut":case"paste":p=cle;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=aI;break;case"toggle":case"beforetoggle":p=_le}var g=(t&4)!==0,v=!g&&(e==="scroll"||e==="scrollend"),y=g?f!==null?f+"Capture":null:f;g=[];for(var b=d,w;b!==null;){var S=b;if(w=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||w===null||y===null||(S=vb(b,y),S!=null&&g.push(kb(b,S,w))),v)break;b=b.return}0<g.length&&(f=new p(f,x,null,n,u),m.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==jA&&(x=n.relatedTarget||n.fromElement)&&(Wp(x)||x[ev]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=d,x=x?Wp(x):null,x!==null&&(v=X0(x),g=x.tag,x!==v||g!==5&&g!==27&&g!==6)&&(x=null)):(p=null,x=d),p!==x)){if(g=nI,S="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(g=aI,S="onPointerLeave",y="onPointerEnter",b="pointer"),v=p==null?f:Cy(p),w=x==null?f:Cy(x),f=new g(S,b+"leave",p,n,u),f.target=v,f.relatedTarget=w,S=null,Wp(u)===d&&(g=new g(y,b+"enter",x,n,u),g.target=w,g.relatedTarget=v,S=g),v=S,p&&x)t:{for(g=Sce,y=p,b=x,w=0,S=y;S;S=g(S))w++;S=0;for(var j=b;j;j=g(j))S++;for(;0<w-S;)y=g(y),w--;for(;0<S-w;)b=g(b),S--;for(;w--;){if(y===b||b!==null&&y===b.alternate){g=y;break t}y=g(y),b=g(b)}g=null}else g=null;p!==null&&XI(m,f,p,g,!1),x!==null&&v!==null&&XI(m,v,x,g,!0)}}
vendor: 5,156 bytes, lines 48-49
48e:{if(f=d?Cy(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var N=cI;else if(lI(f))if(r7)N=Mle;else{N=Ple;var _=Ole}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?d&&zP(d.elementType)&&(N=cI):N=Dle;if(N&&(N=N(e,d))){t7(m,N,n,u);break e}_&&_(e,f,d),e==="focusout"&&d&&f.type==="number"&&d.memoizedProps.value!=null&&wA(f,"number",f.value)}switch(_=d?Cy(d):window,e){case"focusin":(lI(_)||_.contentEditable==="true")&&(Kp=_,SA=d,Fy=null);break;case"focusout":Fy=SA=Kp=null;break;case"mousedown":_A=!0;break;case"contextmenu":case"mouseup":case"dragend":_A=!1,fI(m,n,u);break;case"selectionchange":if(Lle)break;case"keydown":case"keyup":fI(m,n,u)}var C;if(YP)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Gp?J9(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Q9&&n.locale!=="ko"&&(Gp||k!=="onCompositionStart"?k==="onCompositionEnd"&&Gp&&(C=Z9()):(im=u,HP="value"in im?im.value:im.textContent,Gp=!0)),_=rN(d,k),0<_.length&&(k=new sI(k,e,null,n,u),m.push({event:k,listeners:_}),C?k.data=C:(C=e7(n),C!==null&&(k.data=C)))),(C=kle?Ele(e,n):Ale(e,n))&&(k=rN(d,"onBeforeInput"),0<k.length&&(_=new sI("onBeforeInput","beforeinput",null,n,u),m.push({event:_,listeners:k}),_.data=C)),bce(m,e,d,n,u)}Xq(m,t)})}function kb(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rN(e,t){for(var n=t+"Capture",s=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=vb(e,n),a!=null&&s.unshift(kb(e,a,i)),a=vb(e,t),a!=null&&s.push(kb(e,a,i))),e.tag===3)return s;e=e.return}return[]}function Sce(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function XI(e,t,n,s,a){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,d=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||d===null||(c=d,a?(d=vb(n,i),d!=null&&o.unshift(kb(n,d,c))):a||(d=vb(n,i),d!=null&&o.push(kb(n,d,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var _ce=/\r\n?/g,Cce=/\u0000|\uFFFD/g;function ZI(e){return(typeof e=="string"?e:""+e).replace(_ce,`
49`).replace(Cce,"")}function Qq(e,t){return t=ZI(t),ZI(e)===t}function Vn(e,t,n,s,a,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Kx(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Kx(e,""+s);break;case"className":Kw(e,"class",s);break;case"tabIndex":Kw(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Kw(e,n,s);break;case"style":K9(e,s,i);break;case"data":if(t!=="object"){Kw(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Jj(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&Vn(e,t,"name",a.name,a,null),Vn(e,t,"formEncType",a.formEncType,a,null),Vn(e,t,"formMethod",a.formMethod,a,null),Vn(e,t,"formTarget",a.formTarget,a,null)):(Vn(e,t,"encType",a.encType,a,null),Vn(e,t,"method",a.method,a,null),Vn(e,t,"target",a.target,a,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Jj(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=jd);break;case"onScroll":s!=null&&Wr("scroll",e);break;case"onScrollEnd":s!=null&&Wr("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(Je(61));if(n=s.__html,n!=null){if(a.children!=null)throw Error(Je(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Jj(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Wr("beforetoggle",e),Wr("toggle",e),Qj(e,"popover",s);break;case"xlinkActuate":sd(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":sd(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":sd(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":sd(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":sd(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":sd(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":sd(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":sd(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":sd(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qj(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ele.get(n)||n,Qj(e,n,s))}}function KA(e,t,n,s,a,i){switch(n){case"style":K9(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(Je(61));if(n=s.__html,n!=null){if(a.children!=null)throw Error(Je(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Kx(e,s):(typeof s=="number"||typeof s=="bigint")&&Kx(e,""+s);break;case"onScroll":s!=null&&Wr("scroll",e);break;case"onScrollEnd":s!=null&&Wr("scrollend",e);break;case"onClick":s!=null&&(e.onclick=jd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!z9.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[no]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,a);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Qj(e,n,s)}}}function di(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Wr("error",e),Wr("load",e);var s=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Je(137,t));default:Vn(e,t,i,o,n,null)}}a&&Vn(e,t,"srcSet",n.srcSet,n,null),s&&Vn(e,t,"src",n.src,n,null);return;case"input":Wr("invalid",e);var l=i=o=a=null,c=null,d=null;for(s in n)if(n.hasOwnProperty(s)){var u=n[s];if(u!=null)switch(s){case"name":a=u;break;case"type":o=u;break;case"checked":c=u;break;case"defaultChecked":d=u;break;case"value":i=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(Je(137,t));break;default:Vn(e,t,s,u,n,null)}}W9(e,i,l,c,d,o,a,!1);return;case"select":Wr("invalid",e),s=o=i=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:Vn(e,t,a,l,n,null)}t=i,n=o,e.multiple=!!s,t!=null?gx(e,!!s,t,!1):n!=null&&gx(e,!!s,n,!0);return;case"textarea":Wr("invalid",e),i=a=s=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":s=l;break;case"defaultValue":a=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Je(91));break;default:Vn(e,t,o,l,n,null)}G9(e,s,a,i);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Vn(e,t,c,s,n,null)}return;case"dialog":Wr("beforetoggle",e),Wr("toggle",e),Wr("cancel",e),Wr("close",e);break;case"iframe":case"object":Wr("load",e);break;case"video":case"audio":for(s=0;s<Cb.length;s++)Wr(Cb[s],e);break;case"image":Wr("error",e),Wr("load",e);break;case"details":Wr("toggle",e);break;case"embed":case"source":case"link":Wr("error",e),Wr("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in n)if(n.hasOwnProperty(d)&&(s=n[d],s!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(Je(137,t));default:Vn(e,t,d,s,n,null)}return;default:if(zP(t)){for(u in n)n.hasOwnProperty(u)&&(s=n[u],s!==void 0&&KA(e,t,u,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&Vn(e,t,l,s,n,null))}function kce(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,o=null,l=null,c=null,d=null,u=null;for(p in n){var m=n[p];if(n.hasOwnProperty(p)&&m!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=m;
vendor: 5,597 bytes, line 49
49default:s.hasOwnProperty(p)||Vn(e,t,p,null,s,m)}}for(var f in s){var p=s[f];if(m=n[f],s.hasOwnProperty(f)&&(p!=null||m!=null))switch(f){case"type":i=p;break;case"name":a=p;break;case"checked":d=p;break;case"defaultChecked":u=p;break;case"value":o=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Je(137,t));break;default:p!==m&&Vn(e,t,f,p,s,m)}}bA(e,o,l,c,d,u,i,a);return;case"select":p=o=l=f=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":p=c;default:s.hasOwnProperty(i)||Vn(e,t,i,null,s,c)}for(a in s)if(i=s[a],c=n[a],s.hasOwnProperty(a)&&(i!=null||c!=null))switch(a){case"value":f=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&Vn(e,t,a,i,s,c)}t=l,n=o,s=p,f!=null?gx(e,!!n,f,!1):!!s!=!!n&&(t!=null?gx(e,!!n,t,!0):gx(e,!!n,n?[]:"",!1));return;case"textarea":p=f=null;for(l in n)if(a=n[l],n.hasOwnProperty(l)&&a!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Vn(e,t,l,null,s,a)}for(o in s)if(a=s[o],i=n[o],s.hasOwnProperty(o)&&(a!=null||i!=null))switch(o){case"value":f=a;break;case"defaultValue":p=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(Je(91));break;default:a!==i&&Vn(e,t,o,a,s,i)}Y9(e,f,p);return;case"option":for(var x in n)if(f=n[x],n.hasOwnProperty(x)&&f!=null&&!s.hasOwnProperty(x))switch(x){case"selected":e.selected=!1;break;default:Vn(e,t,x,null,s,f)}for(c in s)if(f=s[c],p=n[c],s.hasOwnProperty(c)&&f!==p&&(f!=null||p!=null))switch(c){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Vn(e,t,c,f,s,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!s.hasOwnProperty(g)&&Vn(e,t,g,null,s,f);for(d in s)if(f=s[d],p=n[d],s.hasOwnProperty(d)&&f!==p&&(f!=null||p!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(Je(137,t));break;default:Vn(e,t,d,f,s,p)}return;default:if(zP(t)){for(var v in n)f=n[v],n.hasOwnProperty(v)&&f!==void 0&&!s.hasOwnProperty(v)&&KA(e,t,v,void 0,s,f);for(u in s)f=s[u],p=n[u],!s.hasOwnProperty(u)||f===p||f===void 0&&p===void 0||KA(e,t,u,f,s,p);return}}for(var y in n)f=n[y],n.hasOwnProperty(y)&&f!=null&&!s.hasOwnProperty(y)&&Vn(e,t,y,null,s,f);for(m in s)f=s[m],p=n[m],!s.hasOwnProperty(m)||f===p||f==null&&p==null||Vn(e,t,m,f,s,p)}function QI(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ece(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var a=n[s],i=a.transferSize,o=a.initiatorType,l=a.duration;if(i&&l&&QI(o)){for(o=0,l=a.responseEnd,s+=1;s<n.length;s++){var c=n[s],d=c.startTime;if(d>l)break;var u=c.transferSize,m=c.initiatorType;u&&QI(m)&&(c=c.responseEnd,o+=u*(c<l?1:(l-d)/(c-d)))}if(--s,t+=8*(i+o)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var XA=null,ZA=null;function nN(e){return e.nodeType===9?e:e.ownerDocument}function JI(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Jq(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function QA(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mk=null;function Ace(){var e=window.event;return e&&e.type==="popstate"?e===mk?!1:(mk=e,!0):(mk=null,!1)}var eH=typeof setTimeout=="function"?setTimeout:void 0,Tce=typeof clearTimeout=="function"?clearTimeout:void 0,eL=typeof Promise=="function"?Promise:void 0,Rce=typeof queueMicrotask=="function"?queueMicrotask:typeof eL<"u"?function(e){return eL.resolve(null).then(e).catch(Oce)}:eH;function Oce(e){setTimeout(function(){throw e})}function Zm(e){return e==="head"}function tL(e,t){var n=t,s=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(a),ng(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")Zy(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Zy(n);for(var i=n.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[ew]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}else n==="body"&&Zy(e.ownerDocument.body);n=a}while(n);ng(t)}function rL(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function JA(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":JA(n),BP(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Pce(e,t,n,s){for(;
vendor: 9,626 bytes, line 49
49e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ew])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ll(e.nextSibling),e===null)break}return null}function Dce(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ll(e.nextSibling),e===null))return null;return e}function tH(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ll(e.nextSibling),e===null))return null;return e}function eT(e){return e.data==="$?"||e.data==="$~"}function tT(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Mce(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function ll(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var rT=null;function nL(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ll(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function sL(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function rH(e,t,n){switch(t=nN(n),e){case"html":if(e=t.documentElement,!e)throw Error(Je(452));return e;case"head":if(e=t.head,!e)throw Error(Je(453));return e;case"body":if(e=t.body,!e)throw Error(Je(454));return e;default:throw Error(Je(451))}}function Zy(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);BP(e)}var hl=new Map,aL=new Set;function sN(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ru=yn.d;yn.d={f:Ice,r:Lce,D:$ce,C:Vce,L:Uce,m:Fce,X:zce,S:Bce,M:qce};function Ice(){var e=ru.f(),t=w_();return e||t}function Lce(e){var t=tv(e);t!==null&&t.tag===5&&t.type==="form"?K7(t):ru.r(e)}var av=typeof document>"u"?null:document;function nH(e,t,n){var s=av;if(s&&typeof t=="string"&&t){var a=Xo(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),aL.has(a)||(aL.add(a),e={rel:e,crossOrigin:n,href:t},s.querySelector(a)===null&&(t=s.createElement("link"),di(t,"link",e),za(t),s.head.appendChild(t)))}}function $ce(e){ru.D(e),nH("dns-prefetch",e,null)}function Vce(e,t){ru.C(e,t),nH("preconnect",e,t)}function Uce(e,t,n){ru.L(e,t,n);var s=av;if(s&&e&&t){var a='link[rel="preload"][as="'+Xo(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Xo(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Xo(n.imageSizes)+'"]')):a+='[href="'+Xo(e)+'"]';var i=a;switch(t){case"style":i=rg(e);break;case"script":i=iv(e)}hl.has(i)||(e=ws({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),hl.set(i,e),s.querySelector(a)!==null||t==="style"&&s.querySelector(iw(i))||t==="script"&&s.querySelector(ow(i))||(t=s.createElement("link"),di(t,"link",e),za(t),s.head.appendChild(t)))}}function Fce(e,t){ru.m(e,t);var n=av;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Xo(s)+'"][href="'+Xo(e)+'"]',i=a;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=iv(e)}if(!hl.has(i)&&(e=ws({rel:"modulepreload",href:e},t),hl.set(i,e),n.querySelector(a)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ow(i)))return}s=n.createElement("link"),di(s,"link",e),za(s),n.head.appendChild(s)}}}function Bce(e,t,n){ru.S(e,t,n);var s=av;if(s&&e){var a=xx(s).hoistableStyles,i=rg(e);t=t||"default";var o=a.get(i);if(!o){var l={loading:0,preload:null};if(o=s.querySelector(iw(i)))l.loading=5;else{e=ws({rel:"stylesheet",href:e,"data-precedence":t},n),(n=hl.get(i))&&k4(e,n);var c=o=s.createElement("link");za(c),di(c,"link",e),c._p=new Promise(function(d,u){c.onload=d,c.onerror=u}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,c1(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:l},a.set(i,o)}}}function zce(e,t){ru.X(e,t);var n=av;if(n&&e){var s=xx(n).hoistableScripts,a=iv(e),i=s.get(a);i||(i=n.querySelector(ow(a)),i||(e=ws({src:e,async:!0},t),(t=hl.get(a))&&E4(e,t),i=n.createElement("script"),za(i),di(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(a,i))}}function qce(e,t){ru.M(e,t);var n=av;if(n&&e){var s=xx(n).hoistableScripts,a=iv(e),i=s.get(a);i||(i=n.querySelector(ow(a)),i||(e=ws({src:e,async:!0,type:"module"},t),(t=hl.get(a))&&E4(e,t),i=n.createElement("script"),za(i),di(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(a,i))}}function iL(e,t,n,s){var a=(a=xm.current)?sN(a):null;if(!a)throw Error(Je(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=rg(n.href),n=xx(a).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=rg(n.href);var i=xx(a).hoistableStyles,o=i.get(e);if(o||(a=a.ownerDocument||a,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=a.querySelector(iw(e)))&&!i._p&&(o.instance=i,o.state.loading=5),hl.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hl.set(e,n),i||Hce(a,e,n,o.state))),t&&s===null)throw Error(Je(528,""));return o}if(t&&s!==null)throw Error(Je(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=iv(n),n=xx(a).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(Je(444,e))}}function rg(e){return'href="'+Xo(e)+'"'}function iw(e){return'link[rel="stylesheet"]['+e+"]"}function sH(e){return ws({},e,{"data-precedence":e.precedence,precedence:null})}function Hce(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),di(t,"link",n),za(t),e.head.appendChild(t))}function iv(e){return'[src="'+Xo(e)+'"]'}function ow(e){return"script[async]"+e}function oL(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Xo(n.href)+'"]');if(s)return t.instance=s,za(s),s;var a=ws({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),za(s),di(s,"style",a),c1(s,n.precedence,e),t.instance=s;case"stylesheet":a=rg(n.href);var i=e.querySelector(iw(a));if(i)return t.state.loading|=4,t.instance=i,za(i),i;s=sH(n),(a=hl.get(a))&&k4(s,a),i=(e.ownerDocument||e).createElement("link"),za(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),di(i,"link",s),t.state.loading|=4,c1(i,n.precedence,e),t.instance=i;case"script":return i=iv(n.src),(a=e.querySelector(ow(i)))?(t.instance=a,za(a),a):(s=n,(a=hl.get(i))&&(s=ws({},n),E4(s,a)),e=e.ownerDocument||e,a=e.createElement("script"),za(a),di(a,"link",s),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(Je(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,c1(s,n.precedence,e));return t.instance}function c1(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=s.length?s[s.length-1]:null,i=a,o=0;o<s.length;o++){var l=s[o];if(l.dataset.precedence===t)i=l;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function k4(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function E4(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var d1=null;
vendor: 1,262 bytes, line 49
49function lL(e,t,n){if(d1===null){var s=new Map,a=d1=new Map;a.set(n,s)}else a=d1,s=a.get(n),s||(s=new Map,a.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[ew]||i[ii]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=s.get(o);l?l.push(i):s.set(o,[i])}}return s}function cL(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Wce(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function aH(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function Yce(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&
vendor: 5,093 bytes, line 49
49!(n.state.loading&4)){if(n.instance===null){var a=rg(s.href),i=t.querySelector(iw(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=aN.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,za(i);return}i=t.ownerDocument||t,s=sH(s),(a=hl.get(a))&&k4(s,a),i=i.createElement("link"),za(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),di(i,"link",s),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=aN.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var hk=0;function Gce(e,t){return e.stylesheets&&e.count===0&&u1(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&u1(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&hk===0&&(hk=62500*Ece());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&u1(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>hk?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(a)}}:null}function aN(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u1(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var iN=null;function u1(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,iN=new Map,t.forEach(Kce,e),iN=null,aN.call(e))}function Kce(e,t){if(!(t.state.loading&4)){var n=iN.get(e);if(n)var s=n.get(null);else{n=new Map,iN.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var o=a[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}a=t.instance,o=a.getAttribute("data-precedence"),i=n.get(o)||s,i===s&&n.set(null,a),n.set(o,a),this.count++,s=aN.bind(this),a.addEventListener("load",s),a.addEventListener("error",s),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Eb={$$typeof:wd,Provider:null,Consumer:null,_currentValue:cf,_currentValue2:cf,_threadCount:0};function Xce(e,t,n,s,a,i,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=IC(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=IC(0),this.hiddenUpdates=IC(null),this.identifierPrefix=s,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function iH(e,t,n,s,a,i,o,l,c,d,u,m){return e=new Xce(e,t,n,o,c,d,u,m,l),t=1,i===!0&&(t|=24),i=vo(3,null,null,t),e.current=i,i.stateNode=e,t=e4(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},n4(i),e}function oH(e){return e?(e=Qp,e):Qp}function lH(e,t,n,s,a,i){a=oH(a),s.context===null?s.context=a:s.pendingContext=a,s=vm(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=ym(e,s,t),n!==null&&(to(n,e,t),zy(n,e,t))}function dL(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function A4(e,t){dL(e,t),(e=e.alternate)&&dL(e,t)}function cH(e){if(e.tag===13||e.tag===31){var t=ep(e,67108864);t!==null&&to(t,e,67108864),A4(e,67108864)}}function uL(e){if(e.tag===13||e.tag===31){var t=Eo();t=UP(t);var n=ep(e,t);n!==null&&to(n,e,t),A4(e,t)}}var oN=!0;function Zce(e,t,n,s){var a=br.T;br.T=null;var i=yn.p;try{yn.p=2,T4(e,t,n,s)}finally{yn.p=i,br.T=a}}function Qce(e,t,n,s){var a=br.T;br.T=null;var i=yn.p;try{yn.p=8,T4(e,t,n,s)}finally{yn.p=i,br.T=a}}function T4(e,t,n,s){if(oN){var a=nT(s);if(a===null)uk(e,t,s,lN,n),mL(e,s);else if(ede(a,e,t,n,s))s.stopPropagation();else if(mL(e,s),t&4&&-1<Jce.indexOf(e)){for(;a!==null;){var i=tv(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Th(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-ko(o);l.entanglements[1]|=c,o&=~c}zc(i),!(vn&6)&&(Z1=_o()+500,aw(0))}}break;case 31:case 13:l=ep(i,2),l!==null&&to(l,i,2),w_(),A4(i,2)}if(i=nT(s),i===null&&uk(e,t,s,lN,n),i===a)break;a=i}a!==null&&s.stopPropagation()}else uk(e,t,s,null,n)}}function nT(e){return e=qP(e),R4(e)}var lN=null;function R4(e){if(lN=null,e=Wp(e),e!==null){var t=X0(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=A9(t),e!==null)return e;e=null}else if(n===31){if(e=T9(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lN=e,null}function dH(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close"
vendor: 6,280 bytes, line 49
49: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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($oe()){case D9:return 2;case M9:return 8;case L1:case Voe:return 32;case I9:return 268435456;default:return 32}default:return 32}}var sT=!1,jm=null,Nm=null,Sm=null,Ab=new Map,Tb=new Map,Wu=[],Jce="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".split(" ");function mL(e,t){switch(e){case"focusin":case"focusout":jm=null;break;case"dragenter":case"dragleave":Nm=null;break;case"mouseover":case"mouseout":Sm=null;break;case"pointerover":case"pointerout":Ab.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tb.delete(t.pointerId)}}function Jv(e,t,n,s,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[a]},t!==null&&(t=tv(t),t!==null&&cH(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function ede(e,t,n,s,a){switch(t){case"focusin":return jm=Jv(jm,e,t,n,s,a),!0;case"dragenter":return Nm=Jv(Nm,e,t,n,s,a),!0;case"mouseover":return Sm=Jv(Sm,e,t,n,s,a),!0;case"pointerover":var i=a.pointerId;return Ab.set(i,Jv(Ab.get(i)||null,e,t,n,s,a)),!0;case"gotpointercapture":return i=a.pointerId,Tb.set(i,Jv(Tb.get(i)||null,e,t,n,s,a)),!0}return!1}function uH(e){var t=Wp(e.target);if(t!==null){var n=X0(t);if(n!==null){if(t=n.tag,t===13){if(t=A9(n),t!==null){e.blockedOn=t,X3(e.priority,function(){uL(n)});return}}else if(t===31){if(t=T9(n),t!==null){e.blockedOn=t,X3(e.priority,function(){uL(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function m1(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=nT(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);jA=s,n.target.dispatchEvent(s),jA=null}else return t=tv(n),t!==null&&cH(t),e.blockedOn=n,!1;t.shift()}return!0}function hL(e,t,n){m1(e)&&n.delete(t)}function tde(){sT=!1,jm!==null&&m1(jm)&&(jm=null),Nm!==null&&m1(Nm)&&(Nm=null),Sm!==null&&m1(Sm)&&(Sm=null),Ab.forEach(hL),Tb.forEach(hL)}function nj(e,t){e.blockedOn===t&&(e.blockedOn=null,sT||(sT=!0,Ma.unstable_scheduleCallback(Ma.unstable_NormalPriority,tde)))}var sj=null;function fL(e){sj!==e&&(sj=e,Ma.unstable_scheduleCallback(Ma.unstable_NormalPriority,function(){sj===e&&(sj=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],a=e[t+2];if(typeof s!="function"){if(R4(s||n)===null)continue;break}var i=tv(n);i!==null&&(e.splice(t,3),t-=3,$A(i,{pending:!0,data:a,method:n.method,action:s},s,a))}}))}function ng(e){function t(c){return nj(c,e)}jm!==null&&nj(jm,e),Nm!==null&&nj(Nm,e),Sm!==null&&nj(Sm,e),Ab.forEach(t),Tb.forEach(t);for(var n=0;n<Wu.length;n++){var s=Wu[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Wu.length&&(n=Wu[0],n.blockedOn===null);)uH(n),n.blockedOn===null&&Wu.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var a=n[s],i=n[s+1],o=a[no]||null;if(typeof i=="function")o||fL(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(a=i,o=i[no]||null)l=o.formAction;else if(R4(a)!==null)continue}else l=o.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),fL(n)}}}function mH(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return a=o})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function O4(e){this._internalRoot=e}S_.prototype.render=O4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Je(409));var n=t.current,s=Eo();lH(n,s,e,t,null,null)};S_.prototype.unmount=O4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lH(e.current,2,null,e,null,null),w_(),t[ev]=null}};function S_(e){this._internalRoot=e}S_.prototype.unstable_scheduleHydration=function(e){if(e){var t=F9();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wu.length&&t!==0&&t<Wu[n].priority;n++);Wu.splice(n,0,e),n===0&&uH(e)}};var pL=k9.version;if(pL!=="19.2.1")throw Error(Je(527,pL,"19.2.1"));yn.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Je(188)):(e=Object.keys(e).join(","),Error(Je(268,e)));return e=Roe(t),e=e!==null?R9(e):null,e=e===null?null:e.stateNode,e};var rde={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:br,reconcilerVersion:"19.2.1"};
49if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var aj=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!aj.isDisabled&&aj.supportsFiber)try{Z0=aj.inject(rde),Co=aj}catch{}}o_.createRoot=function(e,t){if(!E9(e))throw Error(Je(299));var n=!1,s="",a=nq,i=sq,o=aq;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=iH(e,1,!1,null,null,n,s,null,a,i,o,mH),e[ev]=t.current,C4(e),new O4(t)};o_.hydrateRoot=function(e,t,n){if(!E9(e))throw Error(Je(299));var s=!1,a="",i=nq,o=sq,l=aq,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=iH(e,1,!0,t,n??null,s,a,c,i,o,l,mH),t.context=oH(null),n=t.current,s=Eo(),s=UP(s),a=vm(s),a.callback=null,ym(n,a,s),n=s,t.current.lanes=n,J0(t,n),zc(t),e[ev]=t.current,C4(e),new S_(t)};o_.version="19.2.1";function hH(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hH)}catch(e){console.error(e)}}hH(),w9.exports=o_;var nde=w9.exports;const sde=1,ade=1e6;let fk=0;function ide(){return fk=(fk+1)%Number.MAX_SAFE_INTEGER,fk.toString()}const pk=new Map,xL=e=>{if(pk.has(e))return;const t=setTimeout(()=>{pk.delete(e),Qy({type:"REMOVE_TOAST",toastId:e})},ade);pk.set(e,t)},ode=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,sde)};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?xL(n):e.toasts.forEach(s=>{xL(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},h1=[];let f1={toasts:[]};function Qy(e){f1=ode(f1,e),h1.forEach(t=>{t(f1)})}function Rt({...e}){const t=ide(),n=a=>Qy({type:"UPDATE_TOAST",toast:{...a,id:t}}),s=()=>Qy({type:"DISMISS_TOAST",toastId:t});return Qy({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||s()}}}),{id:t,dismiss:s,update:n}}function Gr(){const[e,t]=h.useState(f1);return h.useEffect(()=>(h1.push(t),()=>{const n=h1.indexOf(t);n>-1&&h1.splice(n,1)}),[e]),{...e,toast:Rt,dismiss:n=>Qy({type:"DISMISS_TOAST",toastId:n})}}function We(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 gL(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lw(...e){return t=>{let n=!1;const s=e.map(a=>{const i=gL(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<s.length;a++){const i=s[a];typeof i=="function"?i():gL(e[a],null)}}}}function Ht(...e){return h.useCallback(lw(...e),e)}function lde(e,t){const n=h.createContext(t),s=i=>{const{children:o,...l}=i,c=h.useMemo(()=>l,Object.values(l));return r.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function a(i){const o=h.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,a]}function Ss(e,t=[]){let n=[];function s(i,o){const l=h.createContext(o),c=n.length;n=[...n,o];const d=m=>{var y;const{scope:f,children:p,...x}=m,g=((y=f==null?void 0:f[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return r.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(m,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=n.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[s,cde(a,...t)]}function cde(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));
vendor: 10,740 bytes, line 49
49return function(i){const o=s.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Dm(e){const t=ude(e),n=h.forwardRef((s,a)=>{const{children:i,...o}=s,l=h.Children.toArray(i),c=l.find(mde);if(c){const d=c.props.children,u=l.map(m=>m===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:m);return r.jsx(t,{...o,ref:a,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return r.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var dde=Dm("Slot");function ude(e){const t=h.forwardRef((n,s)=>{const{children:a,...i}=n;if(h.isValidElement(a)){const o=fde(a),l=hde(i,a.props);return a.type!==h.Fragment&&(l.ref=s?lw(s,o):o),h.cloneElement(a,l)}return h.Children.count(a)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fH=Symbol("radix.slottable");function pH(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=fH,t}function mde(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fH}function hde(e,t){const n={...t};for(const s in t){const a=e[s],i=t[s];/^on[A-Z]/.test(s)?a&&i?n[s]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[s]=a):s==="style"?n[s]={...a,...i}:s==="className"&&(n[s]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function fde(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.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 Qm(e){const t=e+"CollectionProvider",[n,s]=Ss(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:v,children:y}=g,b=Y.useRef(null),w=Y.useRef(new Map).current;return r.jsx(a,{scope:v,itemMap:w,collectionRef:b,children:y})};o.displayName=t;const l=e+"CollectionSlot",c=Dm(l),d=Y.forwardRef((g,v)=>{const{scope:y,children:b}=g,w=i(l,y),S=Ht(v,w.collectionRef);return r.jsx(c,{ref:S,children:b})});d.displayName=l;const u=e+"CollectionItemSlot",m="data-radix-collection-item",f=Dm(u),p=Y.forwardRef((g,v)=>{const{scope:y,children:b,...w}=g,S=Y.useRef(null),j=Ht(v,S),N=i(u,y);return Y.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),r.jsx(f,{[m]:"",ref:j,children:b})});p.displayName=u;function x(g){const v=i(e+"CollectionConsumer",g);return Y.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((N,_)=>w.indexOf(N.ref.current)-w.indexOf(_.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:d,ItemSlot:p},x,s]}var pde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=pde.reduce((e,t)=>{const n=Dm(`Primitive.${t}`),s=h.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function Rb(e,t){e&&$d.flushSync(()=>e.dispatchEvent(t))}function Dn(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function xde(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e);h.useEffect(()=>{const s=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var gde="DismissableLayer",aT="dismissableLayer.update",vde="dismissableLayer.pointerDownOutside",yde="dismissableLayer.focusOutside",vL,xH=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),nu=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=h.useContext(xH),[u,m]=h.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),x=Ht(t,_=>m(_)),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=u?g.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,j=wde(_=>{const C=_.target,k=[...d.branches].some(E=>E.contains(C));!S||k||(a==null||a(_),o==null||o(_),_.defaultPrevented||l==null||l())},f),N=jde(_=>{const C=_.target;[...d.branches].some(E=>E.contains(C))||(i==null||i(_),o==null||o(_),_.defaultPrevented||l==null||l())},f);return xde(_=>{b===d.layers.size-1&&(s==null||s(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},f),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(vL=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),yL(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=vL)}},[u,f,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),yL())},[u,d]),h.useEffect(()=>{const _=()=>p({});return document.addEventListener(aT,_),()=>document.removeEventListener(aT,_)},[]),r.jsx(ut.div,{...c,ref:x,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,N.onFocusCapture),onBlurCapture:We(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,j.onPointerDownCapture)})});nu.displayName=gde;var bde="DismissableLayerBranch",gH=h.forwardRef((e,t)=>{const n=h.useContext(xH),s=h.useRef(null),a=Ht(t,s);return h.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),r.jsx(ut.div,{...e,ref:a})});gH.displayName=bde;function wde(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e),s=h.useRef(!1),a=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){vH(vde,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function jde(e,t=globalThis==null?void 0:globalThis.document){const n=Dn(e),s=h.useRef(!1);return h.useEffect(()=>{const a=i=>{i.target&&!s.current&&vH(yde,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function yL(){const e=new CustomEvent(aT);document.dispatchEvent(e)}function vH(e,t,n,{discrete:s}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?Rb(a,i):a.dispatchEvent(i)}var Nde=nu,Sde=gH,js=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},_de="Portal",ov=h.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[a,i]=h.useState(!1);js(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?IP.createPortal(r.jsx(ut.div,{...s,ref:t}),o):null});ov.displayName=_de;function Cde(e,t){return h.useReducer((n,s)=>t[n][s]??n,e)}var _s=e=>{const{present:t,children:n}=e,s=kde(t),a=typeof n=="function"?n({present:s.isPresent}):h.Children.only(n),i=Ht(s.ref,Ede(a));return typeof n=="function"||s.isPresent?h.cloneElement(a,{ref:i}):null};_s.displayName="Presence";function kde(e){const[t,n]=h.useState(),s=h.useRef(null),a=h.useRef(e),i=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Cde(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ij(s.current);i.current=l==="mounted"?d:"none"},[l]),js(()=>{const d=s.current,u=a.current;if(u!==e){const f=i.current,p=ij(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),js(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,m=p=>{const g=ij(s.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!a.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=p=>{p.target===t&&(i.current=ij(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{s.current=d?getComputedStyle(d):null,n(d)},[])}}function ij(e){return(e==null?void 0:e.animationName)||"none"}function Ede(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.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 Ade=MP[" useInsertionEffect ".trim().toString()]||js;function Zs({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[a,i,o]=Tde({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const m=u.current;m!==l&&console.warn(`${s} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,s])}const d=h.useCallback(u=>{var m;if(l){const f=Rde(u)?u(e):u;f!==e&&((m=o.current)==null||m.call(o,f))}else i(u)},[l,e,i,o]);return[c,d]}function Tde({defaultProp:e,onChange:t}){const[n,s]=h.useState(e),a=h.useRef(n),i=h.useRef(t);return Ade(()=>{i.current=t},[t]),h.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,s,i]}function Rde(e){return typeof e=="function"}var yH=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"}),Ode="VisuallyHidden",__=h.forwardRef((e,t)=>
49r.jsx(ut.span,{...e,ref:t,style:{...yH,...e.style}}));__.displayName=Ode;var bH=__,P4="ToastProvider",[D4,Pde,Dde]=Qm("Toast"),[wH,Xat]=Ss("Toast",[Dde]),[Mde,C_]=wH(P4),jH=e=>{const{__scopeToast:t,label:n="Notification",duration:s=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=h.useState(null),[d,u]=h.useState(0),m=h.useRef(!1),f=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${P4}\`. Expected non-empty \`string\`.`),r.jsx(D4.Provider,{scope:t,children:r.jsx(Mde,{scope:t,label:n,duration:s,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>u(p=>p+1),[]),onToastRemove:h.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:f,children:o})})};jH.displayName=P4;var NH="ToastViewport",Ide=["F8"],iT="toast.viewportPause",oT="toast.viewportResume",SH=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:s=Ide,label:a="Notifications ({hotkey})",...i}=e,o=C_(NH,n),l=Pde(n),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),m=h.useRef(null),f=Ht(t,m,o.onViewportChange),p=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=o.toastCount>0;h.useEffect(()=>{const v=y=>{var w;s.length!==0&&s.every(S=>y[S]||y.code===S)&&((w=m.current)==null||w.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[s]),h.useEffect(()=>{const v=c.current,y=m.current;if(x&&v&&y){const b=()=>{if(!o.isClosePausedRef.current){const N=new CustomEvent(iT);y.dispatchEvent(N),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(oT);y.dispatchEvent(N),o.isClosePausedRef.current=!1}},S=N=>{!v.contains(N.relatedTarget)&&w()},j=()=>{v.contains(document.activeElement)||w()};return v.addEventListener("focusin",b),v.addEventListener("focusout",S),v.addEventListener("pointermove",b),v.addEventListener("pointerleave",j),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{v.removeEventListener("focusin",b),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",b),v.removeEventListener("pointerleave",j),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[x,o.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:v})=>{const b=l().map(w=>{const S=w.ref.current,j=[S,...Kde(S)];return v==="forwards"?j:j.reverse()});return(v==="forwards"?b.reverse():b).flat()},[l]);return h.useEffect(()=>{const v=m.current;if(v){const y=b=>{var j,N,_;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const C=document.activeElement,k=b.shiftKey;if(b.target===v&&k){(j=d.current)==null||j.focus();return}const T=g({tabbingDirection:k?"backwards":"forwards"}),D=T.findIndex(A=>A===C);xk(T.slice(D+1))?b.preventDefault():k?(N=d.current)==null||N.focus():(_=u.current)==null||_.focus()}};return v.addEventListener("keydown",y),()=>v.removeEventListener("keydown",y)}},[l,g]),r.jsxs(Sde,{ref:c,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&r.jsx(lT,{ref:d,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"forwards"});xk(v)}}),r.jsx(D4.Slot,{scope:n,children:r.jsx(ut.ol,{tabIndex:-1,...i,ref:f})}),x&&r.jsx(lT,{ref:u,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"backwards"});xk(v)}})]})});SH.displayName=NH;var _H="ToastFocusProxy",lT=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:s,...a}=e,i=C_(_H,n);return r.jsx(__,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&s()}})});lT.displayName=_H;var cw="Toast",Lde="toast.swipeStart",$de="toast.swipeMove",Vde="toast.swipeCancel",Ude="toast.swipeEnd",CH=h.forwardRef((e,t)=>{const{forceMount:n,open:s,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=Zs({prop:s,defaultProp:a??!0,onChange:i,caller:cw});return r.jsx(_s,{present:n||l,children:r.jsx(zde,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Dn(e.onPause),onResume:Dn(e.onResume),onSwipeStart:We(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:We(e.onSwipeMove,d=>{const{x:u,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:We(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:We(e.onSwipeEnd,d=>{const{x:u,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});CH.displayName=cw;var[Fde,Bde]=wH(cw,{onClose(){}}),zde=h.forwardRef((e,t)=>
49{const{__scopeToast:n,type:s="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:m,onSwipeCancel:f,onSwipeEnd:p,...x}=e,g=C_(cw,n),[v,y]=h.useState(null),b=Ht(t,A=>y(A)),w=h.useRef(null),S=h.useRef(null),j=a||g.duration,N=h.useRef(0),_=h.useRef(j),C=h.useRef(0),{onToastAdd:k,onToastRemove:E}=g,R=Dn(()=>{var V;(v==null?void 0:v.contains(document.activeElement))&&((V=g.viewport)==null||V.focus()),o()}),T=h.useCallback(A=>{!A||A===1/0||(window.clearTimeout(C.current),N.current=new Date().getTime(),C.current=window.setTimeout(R,A))},[R]);h.useEffect(()=>{const A=g.viewport;if(A){const V=()=>{T(_.current),d==null||d()},U=()=>{const O=new Date().getTime()-N.current;_.current=_.current-O,window.clearTimeout(C.current),c==null||c()};return A.addEventListener(iT,U),A.addEventListener(oT,V),()=>{A.removeEventListener(iT,U),A.removeEventListener(oT,V)}}},[g.viewport,j,c,d,T]),h.useEffect(()=>{i&&!g.isClosePausedRef.current&&T(j)},[i,j,g.isClosePausedRef,T]),h.useEffect(()=>(k(),()=>E()),[k,E]);const D=h.useMemo(()=>v?PH(v):null,[v]);return g.viewport?r.jsxs(r.Fragment,{children:[D&&r.jsx(qde,{__scopeToast:n,role:"status","aria-live":s==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),r.jsx(Fde,{scope:n,onClose:R,children:$d.createPortal(r.jsx(D4.ItemSlot,{scope:n,children:r.jsx(Nde,{asChild:!0,onEscapeKeyDown:We(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||R(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(ut.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:We(e.onKeyDown,A=>{A.key==="Escape"&&(l==null||l(A.nativeEvent),A.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:We(e.onPointerDown,A=>{A.button===0&&(w.current={x:A.clientX,y:A.clientY})}),onPointerMove:We(e.onPointerMove,A=>{if(!w.current)return;const V=A.clientX-w.current.x,U=A.clientY-w.current.y,O=!!S.current,M=["left","right"].includes(g.swipeDirection),$=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,I=M?$(0,V):0,B=M?0:$(0,U),K=A.pointerType==="touch"?10:2,Z={x:I,y:B},q={originalEvent:A,delta:Z};O?(S.current=Z,oj($de,m,q,{discrete:!1})):bL(Z,g.swipeDirection,K)?(S.current=Z,oj(Lde,u,q,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>K||Math.abs(U)>K)&&(w.current=null)}),onPointerUp:We(e.onPointerUp,A=>{const V=S.current,U=A.target;if(U.hasPointerCapture(A.pointerId)&&U.releasePointerCapture(A.pointerId),S.current=null,w.current=null,V){const O=A.currentTarget,M={originalEvent:A,delta:V};bL(V,g.swipeDirection,g.swipeThreshold)?oj(Ude,p,M,{discrete:!0}):oj(Vde,f,M,{discrete:!0}),O.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),qde=e=>{const{__scopeToast:t,children:n,...s}=e,a=C_(cw,t),[i,o]=h.useState(!1),[l,c]=h.useState(!1);return Yde(()=>o(!0)),h.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:r.jsx(ov,{asChild:!0,children:r.jsx(__,{...s,children:i&&r.jsxs(r.Fragment,{children:[a.label," ",n]})})})},Hde="ToastTitle",kH=h.forwardRef((e,t)=>{const{__scopeToast:n,...s}=e;return r.jsx(ut.div,{...s,ref:t})});kH.displayName=Hde;var Wde="ToastDescription",EH=h.forwardRef((e,t)=>{const{__scopeToast:n,...s}=e;return r.jsx(ut.div,{...s,ref:t})});EH.displayName=Wde;var AH="ToastAction",TH=h.forwardRef((e,t)=>{const{altText:n,...s}=e;return n.trim()?r.jsx(OH,{altText:n,asChild:!0,children:r.jsx(M4,{...s,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${AH}\`. Expected non-empty \`string\`.`),null)});TH.displayName=AH;var RH="ToastClose",M4=h.forwardRef((e,t)=>{const{__scopeToast:n,...s}=e,a=Bde(RH,n);return r.jsx(OH,{asChild:!0,children:r.jsx(ut.button,{type:"button",...s,ref:t,onClick:We(e.onClick,a.onClose)})})});M4.displayName=RH;var OH=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:s,...a}=e;return r.jsx(ut.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...a,ref:t})});function PH(e){const t=[];
vendor: 8,452 bytes, lines 49-124
49return Array.from(e.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&t.push(s.textContent),Gde(s)){const a=s.ariaHidden||s.hidden||s.style.display==="none",i=s.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=s.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...PH(s))}}),t}function oj(e,t,n,{discrete:s}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),s?Rb(a,i):a.dispatchEvent(i)}var bL=(e,t,n=0)=>{const s=Math.abs(e.x),a=Math.abs(e.y),i=s>a;return t==="left"||t==="right"?i&&s>n:!i&&a>n};function Yde(e=()=>{}){const t=Dn(e);js(()=>{let n=0,s=0;return n=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(s)}},[t])}function Gde(e){return e.nodeType===e.ELEMENT_NODE}function Kde(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xk(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Xde=jH,DH=SH,MH=CH,IH=kH,LH=EH,$H=TH,VH=M4;function UH(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=UH(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Tr(){for(var e,t,n=0,s="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=UH(e))&&(s&&(s+=" "),s+=t);return s}const wL=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jL=Tr,Jm=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return jL(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const u=n==null?void 0:n[d],m=i==null?void 0:i[d];if(u===null)return null;const f=wL(u)||wL(m);return a[d][f]}),l=n&&Object.entries(n).reduce((d,u)=>{let[m,f]=u;return f===void 0||(d[m]=f),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,u)=>{let{class:m,className:f,...p}=u;return Object.entries(p).every(x=>{let[g,v]=x;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...d,m,f]:d},[]);return jL(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
50 * @license lucide-react v0.462.0 - ISC
51 *
52 * This source code is licensed under the ISC license.
53 * See the LICENSE file in the root directory of this source tree.
54 */const Zde=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FH=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
55 * @license lucide-react v0.462.0 - ISC
56 *
57 * This source code is licensed under the ISC license.
58 * See the LICENSE file in the root directory of this source tree.
59 */var Qde={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"};/**
60 * @license lucide-react v0.462.0 - ISC
61 *
62 * This source code is licensed under the ISC license.
63 * See the LICENSE file in the root directory of this source tree.
64 */const Jde=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...Qde,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:FH("lucide",a),...l},[...o.map(([d,u])=>h.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
65 * @license lucide-react v0.462.0 - ISC
66 *
67 * This source code is licensed under the ISC license.
68 * See the LICENSE file in the root directory of this source tree.
69 */const je=(e,t)=>{const n=h.forwardRef(({className:s,...a},i)=>h.createElement(Jde,{ref:i,iconNode:t,className:FH(`lucide-${Zde(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
70 * @license lucide-react v0.462.0 - ISC
71 *
72 * This source code is licensed under the ISC license.
73 * See the LICENSE file in the root directory of this source tree.
74 */const eue=je("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/**
75 * @license lucide-react v0.462.0 - ISC
76 *
77 * This source code is licensed under the ISC license.
78 * See the LICENSE file in the root directory of this source tree.
79 */const BH=je("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
80 * @license lucide-react v0.462.0 - ISC
81 *
82 * This source code is licensed under the ISC license.
83 * See the LICENSE file in the root directory of this source tree.
84 */const aa=je("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
85 * @license lucide-react v0.462.0 - ISC
86 *
87 * This source code is licensed under the ISC license.
88 * See the LICENSE file in the root directory of this source tree.
89 */const Ya=je("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
90 * @license lucide-react v0.462.0 - ISC
91 *
92 * This source code is licensed under the ISC license.
93 * See the LICENSE file in the root directory of this source tree.
94 */const Ay=je("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
95 * @license lucide-react v0.462.0 - ISC
96 *
97 * This source code is licensed under the ISC license.
98 * See the LICENSE file in the root directory of this source tree.
99 */const tue=je("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
100 * @license lucide-react v0.462.0 - ISC
101 *
102 * This source code is licensed under the ISC license.
103 * See the LICENSE file in the root directory of this source tree.
104 */const zl=je("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
105 * @license lucide-react v0.462.0 - ISC
106 *
107 * This source code is licensed under the ISC license.
108 * See the LICENSE file in the root directory of this source tree.
109 */const zH=je("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
110 * @license lucide-react v0.462.0 - ISC
111 *
112 * This source code is licensed under the ISC license.
113 * See the LICENSE file in the root directory of this source tree.
114 */const qH=je("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"}]]);/**
115 * @license lucide-react v0.462.0 - ISC
116 *
117 * This source code is licensed under the ISC license.
118 * See the LICENSE file in the root directory of this source tree.
119 */const I4=je("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"}]]);/**
120 * @license lucide-react v0.462.0 - ISC
121 *
122 * This source code is licensed under the ISC license.
123 * See the LICENSE file in the root directory of this source tree.
124 */const Nx=je("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"}
124],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
125 * @license lucide-react v0.462.0 - ISC
126 *
127 * This source code is licensed under the ISC license.
128 * See the LICENSE file in the root directory of this source tree.
129 */const Ga=je("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"}]]);/**
130 * @license lucide-react v0.462.0 - ISC
131 *
132 * This source code is licensed under the ISC license.
133 * See the LICENSE file in the root directory of this source tree.
134 */const ga=je("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
135 * @license lucide-react v0.462.0 - ISC
136 *
137 * This source code is licensed under the ISC license.
138 * See the LICENSE file in the root directory of this source tree.
139 */const qd=je("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"}]]);/**
140 * @license lucide-react v0.462.0 - ISC
141 *
142 * This source code is licensed under the ISC license.
143 * See the LICENSE file in the root directory of this source tree.
144 */const nt=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
145 * @license lucide-react v0.462.0 - ISC
146 *
147 * This source code is licensed under the ISC license.
148 * See the LICENSE file in the root directory of this source tree.
149 */const Qs=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
150 * @license lucide-react v0.462.0 - ISC
151 *
152 * This source code is licensed under the ISC license.
153 * See the LICENSE file in the root directory of this source tree.
154 */const L4=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
155 * @license lucide-react v0.462.0 - ISC
156 *
157 * This source code is licensed under the ISC license.
158 * See the LICENSE file in the root directory of this source tree.
159 */const Hl=je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
160 * @license lucide-react v0.462.0 - ISC
161 *
162 * This source code is licensed under the ISC license.
163 * See the LICENSE file in the root directory of this source tree.
164 */const Mm=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
165 * @license lucide-react v0.462.0 - ISC
166 *
167 * This source code is licensed under the ISC license.
168 * See the LICENSE file in the root directory of this source tree.
169 */const $4=je("Chrome",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["line",{x1:"21.17",x2:"12",y1:"8",y2:"8",key:"a0cw5f"}],["line",{x1:"3.95",x2:"8.54",y1:"6.06",y2:"14",key:"1kftof"}],["line",{x1:"10.88",x2:"15.46",y1:"21.94",y2:"14",key:"1ymyh8"}]]);/**
170 * @license lucide-react v0.462.0 - ISC
171 *
172 * This source code is licensed under the ISC license.
173 * See the LICENSE file in the root directory of this source tree.
174 */const Im=je("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
175 * @license lucide-react v0.462.0 - ISC
176 *
177 * This source code is licensed under the ISC license.
178 * See the LICENSE file in the root directory of this source tree.
179 */const NL=je("CircleArrowDown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]);/**
180 * @license lucide-react v0.462.0 - ISC
181 *
182 * This source code is licensed under the ISC license.
183 * See the LICENSE file in the root directory of this source tree.
184 */const cT=je("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
185 * @license lucide-react v0.462.0 - ISC
186 *
187 * This source code is licensed under the ISC license.
188 * See the LICENSE file in the root directory of this source tree.
189 */const Lm=je("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
190 * @license lucide-react v0.462.0 - ISC
191 *
192 * This source code is licensed under the ISC license.
193 * See the LICENSE file in the root directory of this source tree.
194 */const cl=je("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
195 * @license lucide-react v0.462.0 - ISC
196 *
197 * This source code is licensed under the ISC license.
198 * See the LICENSE file in the root directory of this source tree.
199 */const ff=je("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
200 * @license lucide-react v0.462.0 - ISC
201 *
202 * This source code is licensed under the ISC license.
203 * See the LICENSE file in the root directory of this source tree.
204 */const rue=je("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
205 * @license lucide-react v0.462.0 - ISC
206 *
207 * This source code is licensed under the ISC license.
208 * See the LICENSE file in the root directory of this source tree.
209 */const sg=je("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"}]]);/**
210 * @license lucide-react v0.462.0 - ISC
211 *
212 * This source code is licensed under the ISC license.
213 * See the LICENSE file in the root directory of this source tree.
214 */const Ob=je("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
215 * @license lucide-react v0.462.0 - ISC
216 *
217 * This source code is licensed under the ISC license.
218 * See the LICENSE file in the root directory of this source tree.
219 */const nue=je("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
220 * @license lucide-react v0.462.0 - ISC
221 *
222 * This source code is licensed under the ISC license.
223 * See the LICENSE file in the root directory of this source tree.
224 */const fr=je("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
225 * @license lucide-react v0.462.0 - ISC
226 *
227 * This source code is licensed under the ISC license.
228 * See the LICENSE file in the root directory of this source tree.
229 */const sue=je("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
230 * @license lucide-react v0.462.0 - ISC
231 *
232 * This source code is licensed under the ISC license.
233 * See the LICENSE file in the root directory of this source tree.
234 */const dT=je("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
235 * @license lucide-react v0.462.0 - ISC
236 *
237 * This source code is licensed under the ISC license.
238 * See the LICENSE file in the root directory of this source tree.
239 */const aue=je("ContactRound",[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M17.915 22a6 6 0 0 0-12 0",key:"suqz9p"}
239],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]]);/**
240 * @license lucide-react v0.462.0 - ISC
241 *
242 * This source code is licensed under the ISC license.
243 * See the LICENSE file in the root directory of this source tree.
244 */const ui=je("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"}]]);/**
245 * @license lucide-react v0.462.0 - ISC
246 *
247 * This source code is licensed under the ISC license.
248 * See the LICENSE file in the root directory of this source tree.
249 */const vi=je("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
250 * @license lucide-react v0.462.0 - ISC
251 *
252 * This source code is licensed under the ISC license.
253 * See the LICENSE file in the root directory of this source tree.
254 */const $m=je("Crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]);/**
255 * @license lucide-react v0.462.0 - ISC
256 *
257 * This source code is licensed under the ISC license.
258 * See the LICENSE file in the root directory of this source tree.
259 */const Ms=je("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
260 * @license lucide-react v0.462.0 - ISC
261 *
262 * This source code is licensed under the ISC license.
263 * See the LICENSE file in the root directory of this source tree.
264 */const iue=je("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"}]]);/**
265 * @license lucide-react v0.462.0 - ISC
266 *
267 * This source code is licensed under the ISC license.
268 * See the LICENSE file in the root directory of this source tree.
269 */const dw=je("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"}]]);/**
270 * @license lucide-react v0.462.0 - ISC
271 *
272 * This source code is licensed under the ISC license.
273 * See the LICENSE file in the root directory of this source tree.
274 */const HH=je("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/**
275 * @license lucide-react v0.462.0 - ISC
276 *
277 * This source code is licensed under the ISC license.
278 * See the LICENSE file in the root directory of this source tree.
279 */const lv=je("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
280 * @license lucide-react v0.462.0 - ISC
281 *
282 * This source code is licensed under the ISC license.
283 * See the LICENSE file in the root directory of this source tree.
284 */const oue=je("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/**
285 * @license lucide-react v0.462.0 - ISC
286 *
287 * This source code is licensed under the ISC license.
288 * See the LICENSE file in the root directory of this source tree.
289 */const dm=je("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
290 * @license lucide-react v0.462.0 - ISC
291 *
292 * This source code is licensed under the ISC license.
293 * See the LICENSE file in the root directory of this source tree.
294 */const bn=je("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
295 * @license lucide-react v0.462.0 - ISC
296 *
297 * This source code is licensed under the ISC license.
298 * See the LICENSE file in the root directory of this source tree.
299 */const Pb=je("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"}]]);/**
300 * @license lucide-react v0.462.0 - ISC
301 *
302 * This source code is licensed under the ISC license.
303 * See the LICENSE file in the root directory of this source tree.
304 */const wr=je("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"}]]);/**
305 * @license lucide-react v0.462.0 - ISC
306 *
307 * This source code is licensed under the ISC license.
308 * See the LICENSE file in the root directory of this source tree.
309 */const ey=je("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
310 * @license lucide-react v0.462.0 - ISC
311 *
312 * This source code is licensed under the ISC license.
313 * See the LICENSE file in the root directory of this source tree.
314 */const lue=je("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",ke
314y:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
315 * @license lucide-react v0.462.0 - ISC
316 *
317 * This source code is licensed under the ISC license.
318 * See the LICENSE file in the root directory of this source tree.
319 */const el=je("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"}]]);/**
320 * @license lucide-react v0.462.0 - ISC
321 *
322 * This source code is licensed under the ISC license.
323 * See the LICENSE file in the root directory of this source tree.
324 */const lj=je("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
325 * @license lucide-react v0.462.0 - ISC
326 *
327 * This source code is licensed under the ISC license.
328 * See the LICENSE file in the root directory of this source tree.
329 */const bi=je("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/**
330 * @license lucide-react v0.462.0 - ISC
331 *
332 * This source code is licensed under the ISC license.
333 * See the LICENSE file in the root directory of this source tree.
334 */const WH=je("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
335 * @license lucide-react v0.462.0 - ISC
336 *
337 * This source code is licensed under the ISC license.
338 * See the LICENSE file in the root directory of this source tree.
339 */const SL=je("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
340 * @license lucide-react v0.462.0 - ISC
341 *
342 * This source code is licensed under the ISC license.
343 * See the LICENSE file in the root directory of this source tree.
344 */const cue=je("FlipHorizontal",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3",key:"1i73f7"}],["path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3",key:"saxlbk"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]]);/**
345 * @license lucide-react v0.462.0 - ISC
346 *
347 * This source code is licensed under the ISC license.
348 * See the LICENSE file in the root directory of this source tree.
349 */const uT=je("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
350 * @license lucide-react v0.462.0 - ISC
351 *
352 * This source code is licensed under the ISC license.
353 * See the LICENSE file in the root directory of this source tree.
354 */const gk=je("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
355 * @license lucide-react v0.462.0 - ISC
356 *
357 * This source code is licensed under the ISC license.
358 * See the LICENSE file in the root directory of this source tree.
359 */const cN=je("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
360 * @license lucide-react v0.462.0 - ISC
361 *
362 * This source code is licensed under the ISC license.
363 * See the LICENSE file in the root directory of this source tree.
364 */const due=je("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
365 * @license lucide-react v0.462.0 - ISC
366 *
367 * This source code is licensed under the ISC license.
368 * See the LICENSE file in the root directory of this source tree.
369 */const mT=je("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
370 * @license lucide-react v0.462.0 - ISC
371 *
372 * This source code is licensed under the ISC license.
373 * See the LICENSE file in the root directory of this source tree.
374 */const k_=je("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"}]]);/**
375 * @license lucide-react v0.462.0 - ISC
376 *
377 * This source code is licensed under the ISC license.
378 * See the LICENSE file in the root directory of this source tree.
379 */const uue=je("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
380 * @license lucide-react v0.462.0 - ISC
381 *
382 * This source code is licensed under the ISC license.
383 * See the LICENSE file in the root directory of this source tree.
384 */const mue=je("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
385 * @license lucide-react v0.462.0 - ISC
386 *
387 * This source code is licensed under the ISC license.
388 * See the LICENSE file in the root directory of this source tree.
389 */const YH=je("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
390 * @license lucide-react v0.462.0 - ISC
391 *
392 * This source code is licensed under the ISC license.
393 * See the LICENSE file in the root directory of this source tree.
394 */const hue=je("HeartHandshake",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/**
395 * @license lucide-react v0.462.0 - ISC
396 *
397 * This source code is licensed under the ISC license.
398 * See the LICENSE file in the root directory of this source tree.
399 */const V4=je("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"}]]);/**
400 * @license lucide-react v0.462.0 - ISC
401 *
402 * This source code is licensed under the ISC license.
403 * See the LICENSE file in the root directory of this source tree.
404 */const Cf=je("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
405 * @license lucide-react v0.462.0 - ISC
406 *
407 * This source code is licensed under the ISC license.
408 * See the LICENSE file in the root directory of this source tree.
409 */const fue=je("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
410 * @license lucide-react v0.462.0 - ISC
411 *
412 * This source code is licensed under the ISC license.
413 * See the LICENSE file in the root directory of this source tree.
414 */const GH=je("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
415 * @license lucide-react v0.462.0 - ISC
416 *
417 * This source code is licensed under the ISC license.
418 * See the LICENSE file in the root directory of this source tree.
419 */const wi=je("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
420 * @license lucide-react v0.462.0 - ISC
421 *
422 * This source code is licensed under the ISC license.
423 * See the LICENSE file in the root directory of this source tree.
424 */const KH=je("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"}]]);/**
425 * @license lucide-react v0.462.0 - ISC
426 *
427 * This source code is licensed under the ISC license.
428 * See the LICENSE file in the root directory of this source tree.
429 */const ql=je("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
430 * @license lucide-react v0.462.0 - ISC
431 *
432 * This source code is licensed under the ISC license.
433 * See the LICENSE file in the root directory of this source tree.
434 */const pue=je("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
435 * @license lucide-react v0.462.0 - ISC
436 *
437 * This source code is licensed under the ISC license.
438 * See the LICENSE file in the root directory of this source tree.
439 */const xue=je("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
440 * @license lucide-react v0.462.0 - ISC
441 *
442 * This source code is licensed under the ISC license.
443 * See the LICENSE file in the root directory of this source tree.
444 */const gue=je("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
445 * @license lucide-react v0.462.0 - ISC
446 *
447 * This source code is licensed under the ISC license.
448 * See the LICENSE file in the root directory of this source tree.
449 */const XH=je("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"}]]);/**
450 * @license lucide-react v0.462.0 - ISC
451 *
452 * This source code is licensed under the ISC license.
453 * See the LICENSE file in the root directory of this source tree.
454 */const vue=je("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["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"}]]);/**
455 * @license lucide-react v0.462.0 - ISC
456 *
457 * This source code is licensed under the ISC license.
458 * See the LICENSE file in the root directory of this source tree.
459 */const yue=je("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"}]]);/**
460 * @license lucide-react v0.462.0 - ISC
461 *
462 * This source code is licensed under the ISC license.
463 * See the LICENSE file in the root directory of this source tree.
464 */const Wl=je("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
465 * @license lucide-react v0.462.0 - ISC
466 *
467 * This source code is licensed under the ISC license.
468 * See the LICENSE file in the root directory of this source tree.
469 */const bue=je("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
470 * @license lucide-react v0.462.0 - ISC
471 *
472 * This source code is licensed under the ISC license.
473 * See the LICENSE file in the root directory of this source tree.
474 */const ty=je("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
475 * @license lucide-react v0.462.0 - ISC
476 *
477 * This source code is licensed under the ISC license.
478 * See the LICENSE file in the root directory of this source tree.
479 */const wue=je("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"}]]);/**
480 * @license lucide-react v0.462.0 - ISC
481 *
482 * This source code is licensed under the ISC license.
483 * See the LICENSE file in the root directory of this source tree.
484 */const Me=je("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
485 * @license lucide-react v0.462.0 - ISC
486 *
487 * This source code is licensed under the ISC license.
488 * See the LICENSE file in the root directory of this source tree.
489 */const Ni=je("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"}]]);/**
490 * @license lucide-react v0.462.0 - ISC
491 *
492 * This source code is licensed under the ISC license.
493 * See the LICENSE file in the root directory of this source tree.
494 */const _L=je("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
495 * @license lucide-react v0.462.0 - ISC
496 *
497 * This source code is licensed under the ISC license.
498 * See the LICENSE file in the root directory of this source tree.
499 */const dN=je("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"}]]);/**
500 * @license lucide-react v0.462.0 - ISC
501 *
502 * This source code is licensed under the ISC license.
503 * See the LICENSE file in the root directory of this source tree.
504 */const Vh=je("MailOpen",[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]);/**
505 * @license lucide-react v0.462.0 - ISC
506 *
507 * This source code is licensed under the ISC license.
508 * See the LICENSE file in the root directory of this source tree.
509 */const zr=je("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"}]]);/**
510 * @license lucide-react v0.462.0 - ISC
511 *
512 * This source code is licensed under the ISC license.
513 * See the LICENSE file in the root directory of this source tree.
514 */const jue=je("Mails",[["rect",{width:"16",height:"13",x:"6",y:"4",rx:"2",key:"1drq3f"}],["path",{d:"m22 7-7.1 3.78c-.57.3-1.23.3-1.8 0L6 7",key:"xn252p"}],["path",{d:"M2 8v11c0 1.1.9 2 2 2h14",key:"n13cji"}]]);/**
515 * @license lucide-react v0.462.0 - ISC
516 *
517 * This source code is licensed under the ISC license.
518 * See the LICENSE file in the root directory of this source tree.
519 */const Nue=je("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
520 * @license lucide-react v0.462.0 - ISC
521 *
522 * This source code is licensed under the ISC license.
523 * See the LICENSE file in the root directory of this source tree.
524 */const Sue=je("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
525 * @license lucide-react v0.462.0 - ISC
526 *
527 * This source code is licensed under the ISC license.
528 * See the LICENSE file in the root directory of this source tree.
529 */const _ue=je("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
530 * @license lucide-react v0.462.0 - ISC
531 *
532 * This source code is licensed under the ISC license.
533 * See the LICENSE file in the root directory of this source tree.
534 */const Jy=je("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
535 * @license lucide-react v0.462.0 - ISC
536 *
537 * This source code is licensed under the ISC license.
538 * See the LICENSE file in the root directory of this source tree.
539 */const Cue=je("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
540 * @license lucide-react v0.462.0 - ISC
541 *
542 * This source code is licensed under the ISC license.
543 * See the LICENSE file in the root directory of this source tree.
544 */const kue=je("MessageSquareHeart",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M14.8 7.5a1.84 1.84 0 0 0-2.6 0l-.2.3-.3-.3a1.84 1.84 0 1 0-2.4 2.8L12 13l2.7-2.7c.9-.9.8-2.1.1-2.8",ke
544y:"1blaws"}]]);/**
545 * @license lucide-react v0.462.0 - ISC
546 *
547 * This source code is licensed under the ISC license.
548 * See the LICENSE file in the root directory of this source tree.
549 */const Wa=je("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"}]]);/**
550 * @license lucide-react v0.462.0 - ISC
551 *
552 * This source code is licensed under the ISC license.
553 * See the LICENSE file in the root directory of this source tree.
554 */const cv=je("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
555 * @license lucide-react v0.462.0 - ISC
556 *
557 * This source code is licensed under the ISC license.
558 * See the LICENSE file in the root directory of this source tree.
559 */const Hd=je("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
560 * @license lucide-react v0.462.0 - ISC
561 *
562 * This source code is licensed under the ISC license.
563 * See the LICENSE file in the root directory of this source tree.
564 */const ag=je("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
565 * @license lucide-react v0.462.0 - ISC
566 *
567 * This source code is licensed under the ISC license.
568 * See the LICENSE file in the root directory of this source tree.
569 */const Eue=je("MonitorOff",[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
570 * @license lucide-react v0.462.0 - ISC
571 *
572 * This source code is licensed under the ISC license.
573 * See the LICENSE file in the root directory of this source tree.
574 */const CL=je("MonitorUp",[["path",{d:"m9 10 3-3 3 3",key:"11gsxs"}],["path",{d:"M12 13V7",key:"h0r20n"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]);/**
575 * @license lucide-react v0.462.0 - ISC
576 *
577 * This source code is licensed under the ISC license.
578 * See the LICENSE file in the root directory of this source tree.
579 */const Vs=je("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
580 * @license lucide-react v0.462.0 - ISC
581 *
582 * This source code is licensed under the ISC license.
583 * See the LICENSE file in the root directory of this source tree.
584 */const Aue=je("Move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);/**
585 * @license lucide-react v0.462.0 - ISC
586 *
587 * This source code is licensed under the ISC license.
588 * See the LICENSE file in the root directory of this source tree.
589 */const kL=je("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"}]]);/**
590 * @license lucide-react v0.462.0 - ISC
591 *
592 * This source code is licensed under the ISC license.
593 * See the LICENSE file in the root directory of this source tree.
594 */const Tue=je("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
595 * @license lucide-react v0.462.0 - ISC
596 *
597 * This source code is licensed under the ISC license.
598 * See the LICENSE file in the root directory of this source tree.
599 */const Rue=je("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/**
600 * @license lucide-react v0.462.0 - ISC
601 *
602 * This source code is licensed under the ISC license.
603 * See the LICENSE file in the root directory of this source tree.
604 */const ig=je("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
605 * @license lucide-react v0.462.0 - ISC
606 *
607 * This source code is licensed under the ISC license.
608 * See the LICENSE file in the root directory of this source tree.
609 */const Oue=je("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
610 * @license lucide-react v0.462.0 - ISC
611 *
612 * This source code is licensed under the ISC license.
613 * See the LICENSE file in the root directory of this source tree.
614 */const ZH=je("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
615 * @license lucide-react v0.462.0 - ISC
616 *
617 * This source code is licensed under the ISC license.
618 * See the LICENSE file in the root directory of this source tree.
619 */const tl=je("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"}]]);/**
620 * @license lucide-react v0.462.0 - ISC
621 *
622 * This source code is licensed under the ISC license.
623 * See the LICENSE file in the root directory of this source tree.
624 */const Pue=je("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
625 * @license lucide-react v0.462.0 - ISC
626 *
627 * This source code is licensed under the ISC license.
628 * See the LICENSE file in the root directory of this source tree.
629 */const og=je("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
630 * @license lucide-react v0.462.0 - ISC
631 *
632 * This source code is licensed under the ISC license.
633 * See the LICENSE file in the root directory of this source tree.
634 */const Due=je("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m
634-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/**
635 * @license lucide-react v0.462.0 - ISC
636 *
637 * This source code is licensed under the ISC license.
638 * See the LICENSE file in the root directory of this source tree.
639 */const U4=je("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"}]]);/**
640 * @license lucide-react v0.462.0 - ISC
641 *
642 * This source code is licensed under the ISC license.
643 * See the LICENSE file in the root directory of this source tree.
644 */const EL=je("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"}]]);/**
645 * @license lucide-react v0.462.0 - ISC
646 *
647 * This source code is licensed under the ISC license.
648 * See the LICENSE file in the root directory of this source tree.
649 */const Js=je("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
650 * @license lucide-react v0.462.0 - ISC
651 *
652 * This source code is licensed under the ISC license.
653 * See the LICENSE file in the root directory of this source tree.
654 */const AL=je("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
655 * @license lucide-react v0.462.0 - ISC
656 *
657 * This source code is licensed under the ISC license.
658 * See the LICENSE file in the root directory of this source tree.
659 */const Ns=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
660 * @license lucide-react v0.462.0 - ISC
661 *
662 * This source code is licensed under the ISC license.
663 * See the LICENSE file in the root directory of this source tree.
664 */const kf=je("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"}]]);/**
665 * @license lucide-react v0.462.0 - ISC
666 *
667 * This source code is licensed under the ISC license.
668 * See the LICENSE file in the root directory of this source tree.
669 */const TL=je("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
670 * @license lucide-react v0.462.0 - ISC
671 *
672 * This source code is licensed under the ISC license.
673 * See the LICENSE file in the root directory of this source tree.
674 */const E_=je("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
675 * @license lucide-react v0.462.0 - ISC
676 *
677 * This source code is licensed under the ISC license.
678 * See the LICENSE file in the root directory of this source tree.
679 */const vs=je("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"}]]);/**
680 * @license lucide-react v0.462.0 - ISC
681 *
682 * This source code is licensed under the ISC license.
683 * See the LICENSE file in the root directory of this source tree.
684 */const F4=je("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
685 * @license lucide-react v0.462.0 - ISC
686 *
687 * This source code is licensed under the ISC license.
688 * See the LICENSE file in the root directory of this source tree.
689 */const hT=je("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
689],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
690 * @license lucide-react v0.462.0 - ISC
691 *
692 * This source code is licensed under the ISC license.
693 * See the LICENSE file in the root directory of this source tree.
694 */const lg=je("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
695 * @license lucide-react v0.462.0 - ISC
696 *
697 * This source code is licensed under the ISC license.
698 * See the LICENSE file in the root directory of this source tree.
699 */const Wd=je("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
700 * @license lucide-react v0.462.0 - ISC
701 *
702 * This source code is licensed under the ISC license.
703 * See the LICENSE file in the root directory of this source tree.
704 */const Db=je("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
705 * @license lucide-react v0.462.0 - ISC
706 *
707 * This source code is licensed under the ISC license.
708 * See the LICENSE file in the root directory of this source tree.
709 */const Mue=je("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
710 * @license lucide-react v0.462.0 - ISC
711 *
712 * This source code is licensed under the ISC license.
713 * See the LICENSE file in the root directory of this source tree.
714 */const A_=je("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
715 * @license lucide-react v0.462.0 - ISC
716 *
717 * This source code is licensed under the ISC license.
718 * See the LICENSE file in the root directory of this source tree.
719 */const Iue=je("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
720 * @license lucide-react v0.462.0 - ISC
721 *
722 * This source code is licensed under the ISC license.
723 * See the LICENSE file in the root directory of this source tree.
724 */const Fl=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
725 * @license lucide-react v0.462.0 - ISC
726 *
727 * This source code is licensed under the ISC license.
728 * See the LICENSE file in the root directory of this source tree.
729 */const Es=je("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"}]]);/**
730 * @license lucide-react v0.462.0 - ISC
731 *
732 * This source code is licensed under the ISC license.
733 * See the LICENSE file in the root directory of this source tree.
734 */const QH=je("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
735 * @license lucide-react v0.462.0 - ISC
736 *
737 * This source code is licensed under the ISC license.
738 * See the LICENSE file in the root directory of this source tree.
739 */const Vm=je("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"}]]);/**
740 * @license lucide-react v0.462.0 - ISC
741 *
742 * This source code is licensed under the ISC license.
743 * See the LICENSE file in the root directory of this source tree.
744 */const dv=je("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
745 * @license lucide-react v0.462.0 - ISC
746 *
747 * This source code is licensed under the ISC license.
748 * See the LICENSE file in the root directory of this source tree.
749 */const Mb=je("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
749y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
750 * @license lucide-react v0.462.0 - ISC
751 *
752 * This source code is licensed under the ISC license.
753 * See the LICENSE file in the root directory of this source tree.
754 */const rp=je("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
755 * @license lucide-react v0.462.0 - ISC
756 *
757 * This source code is licensed under the ISC license.
758 * See the LICENSE file in the root directory of this source tree.
759 */const Lue=je("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
760 * @license lucide-react v0.462.0 - ISC
761 *
762 * This source code is licensed under the ISC license.
763 * See the LICENSE file in the root directory of this source tree.
764 */const RL=je("ShieldX",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
765 * @license lucide-react v0.462.0 - ISC
766 *
767 * This source code is licensed under the ISC license.
768 * See the LICENSE file in the root directory of this source tree.
769 */const mi=je("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"}]]);/**
770 * @license lucide-react v0.462.0 - ISC
771 *
772 * This source code is licensed under the ISC license.
773 * See the LICENSE file in the root directory of this source tree.
774 */const $ue=je("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
775 * @license lucide-react v0.462.0 - ISC
776 *
777 * This source code is licensed under the ISC license.
778 * See the LICENSE file in the root directory of this source tree.
779 */const qc=je("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
780 * @license lucide-react v0.462.0 - ISC
781 *
782 * This source code is licensed under the ISC license.
783 * See the LICENSE file in the root directory of this source tree.
784 */const _n=je("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"}]]);/**
785 * @license lucide-react v0.462.0 - ISC
786 *
787 * This source code is licensed under the ISC license.
788 * See the LICENSE file in the root directory of this source tree.
789 */const fT=je("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"}]]);/**
790 * @license lucide-react v0.462.0 - ISC
791 *
792 * This source code is licensed under the ISC license.
793 * See the LICENSE file in the root directory of this source tree.
794 */const B4=je("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
795 * @license lucide-react v0.462.0 - ISC
796 *
797 * This source code is licensed under the ISC license.
798 * See the LICENSE file in the root directory of this source tree.
799 */const Um=je("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
800 * @license lucide-react v0.462.0 - ISC
801 *
802 * This source code is licensed under the ISC license.
803 * See the LICENSE file in the root directory of this source tree.
804 */const Ib=je("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
805 * @license lucide-react v0.462.0 - ISC
806 *
807 * This source code is licensed under the ISC license.
808 * See the LICENSE file in the root directory of this source tree.
809 */const Vue=je("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
810 * @license lucide-react v0.462.0 - ISC
811 *
812 * This source code is licensed under the ISC license.
813 * See the LICENSE file in the root directory of this source tree.
814 */const z4=je("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
815 * @license lucide-react v0.462.0 - ISC
816 *
817 * This source code is licensed under the ISC license.
818 * See the LICENSE file in the root directory of this source tree.
819 */const Ef=je("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"}]]);/**
820 * @license lucide-react v0.462.0 - ISC
821 *
822 * This source code is licensed under the ISC license.
823 * See the LICENSE file in the root directory of this source tree.
824 */const Uue=je("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/**
825 * @license lucide-react v0.462.0 - ISC
826 *
827 * This source code is licensed under the ISC license.
828 * See the LICENSE file in the root directory of this source tree.
829 */const JH=je("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
830 * @license lucide-react v0.462.0 - ISC
831 *
832 * This source code is licensed under the ISC license.
833 * See the LICENSE file in the root directory of this source tree.
834 */const pT=je("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/**
835 * @license lucide-react v0.462.0 - ISC
836 *
837 * This source code is licensed under the ISC license.
838 * See the LICENSE file in the root directory of this source tree.
839 */const OL=je("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
840 * @license lucide-react v0.462.0 - ISC
841 *
842 * This source code is licensed under the ISC license.
843 * See the LICENSE file in the root directory of this source tree.
844 */const Xr=je("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"}]]);/**
845 * @license lucide-react v0.462.0 - ISC
846 *
847 * This source code is licensed under the ISC license.
848 * See the LICENSE file in the root directory of this source tree.
849 */const Fue=je("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
850 * @license lucide-react v0.462.0 - ISC
851 *
852 * This source code is licensed under the ISC license.
853 * See the LICENSE file in the root directory of this source tree.
854 */const Po=je("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"}]]);/**
855 * @license lucide-react v0.462.0 - ISC
856 *
857 * This source code is licensed under the ISC license.
858 * See the LICENSE file in the root directory of this source tree.
859 */const wa=je("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"}]]);/**
860 * @license lucide-react v0.462.0 - ISC
861 *
862 * This source code is licensed under the ISC license.
863 * See the LICENSE file in the root directory of this source tree.
864 */const Bue=je("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
865 * @license lucide-react v0.462.0 - ISC
866 *
867 * This source code is licensed under the ISC license.
868 * See the LICENSE file in the root directory of this source tree.
869 */const zue=je("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
870 * @license lucide-react v0.462.0 - ISC
871 *
872 * This source code is licensed under the ISC license.
873 * See the LICENSE file in the root directory of this source tree.
874 */const que=je("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
875 * @license lucide-react v0.462.0 - ISC
876 *
877 * This source code is licensed under the ISC license.
878 * See the LICENSE file in the root directory of this source tree.
879 */const na=je("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
880 * @license lucide-react v0.462.0 - ISC
881 *
882 * This source code is licensed under the ISC license.
883 * See the LICENSE file in the root directory of this source tree.
884 */const vk=je("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
884],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
885 * @license lucide-react v0.462.0 - ISC
886 *
887 * This source code is licensed under the ISC license.
888 * See the LICENSE file in the root directory of this source tree.
889 */const eb=je("UserMinus",[["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:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
890 * @license lucide-react v0.462.0 - ISC
891 *
892 * This source code is licensed under the ISC license.
893 * See the LICENSE file in the root directory of this source tree.
894 */const yk=je("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"}]]);/**
895 * @license lucide-react v0.462.0 - ISC
896 *
897 * This source code is licensed under the ISC license.
898 * See the LICENSE file in the root directory of this source tree.
899 */const Hue=je("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
900 * @license lucide-react v0.462.0 - ISC
901 *
902 * This source code is licensed under the ISC license.
903 * See the LICENSE file in the root directory of this source tree.
904 */const Cc=je("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"}]]);/**
905 * @license lucide-react v0.462.0 - ISC
906 *
907 * This source code is licensed under the ISC license.
908 * See the LICENSE file in the root directory of this source tree.
909 */const Wue=je("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
910 * @license lucide-react v0.462.0 - ISC
911 *
912 * This source code is licensed under the ISC license.
913 * See the LICENSE file in the root directory of this source tree.
914 */const jr=je("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"}]]);/**
915 * @license lucide-react v0.462.0 - ISC
916 *
917 * This source code is licensed under the ISC license.
918 * See the LICENSE file in the root directory of this source tree.
919 */const q4=je("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
920 * @license lucide-react v0.462.0 - ISC
921 *
922 * This source code is licensed under the ISC license.
923 * See the LICENSE file in the root directory of this source tree.
924 */const cr=je("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
925 * @license lucide-react v0.462.0 - ISC
926 *
927 * This source code is licensed under the ISC license.
928 * See the LICENSE file in the root directory of this source tree.
929 */const eW=je("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
930 * @license lucide-react v0.462.0 - ISC
931 *
932 * This source code is licensed under the ISC license.
933 * See the LICENSE file in the root directory of this source tree.
934 */const Yue=je("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
935 * @license lucide-react v0.462.0 - ISC
936 *
937 * This source code is licensed under the ISC license.
938 * See the LICENSE file in the root directory of this source tree.
939 */const zt=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,480 bytes, lines 939-959
939],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
940 * @license lucide-react v0.462.0 - ISC
941 *
942 * This source code is licensed under the ISC license.
943 * See the LICENSE file in the root directory of this source tree.
944 */const xT=je("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
945 * @license lucide-react v0.462.0 - ISC
946 *
947 * This source code is licensed under the ISC license.
948 * See the LICENSE file in the root directory of this source tree.
949 */const ya=je("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
950 * @license lucide-react v0.462.0 - ISC
951 *
952 * This source code is licensed under the ISC license.
953 * See the LICENSE file in the root directory of this source tree.
954 */const tW=je("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
955 * @license lucide-react v0.462.0 - ISC
956 *
957 * This source code is licensed under the ISC license.
958 * See the LICENSE file in the root directory of this source tree.
959 */const rW=je("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),H4="-",Gue=e=>{const t=Xue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(H4);return l[0]===""&&l.length!==1&&l.shift(),nW(l,t)||Kue(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},nW=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),a=s?nW(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(H4);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},PL=/^\[(.+)\]$/,Kue=e=>{if(PL.test(e)){const t=PL.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Xue=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Que(Object.entries(e.classGroups),n).forEach(([i,o])=>{gT(o,s,i,t)}),s},gT=(e,t,n,s)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:DL(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(Zue(a)){gT(a(s),t,n,s);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{gT(o,DL(t,i),n,s)})})},DL=(e,t)=>{let n=e;return t.split(H4).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},Zue=e=>e.isThemeGetter,Que=(e,t)=>t?e.map(([n,s])=>{const a=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,Jue=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},sW="!",eme=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,m;for(let v=0;v<l.length;v++){let y=l[v];if(d===0){if(y===a&&(s||l.slice(v,v+i)===t)){c.push(l.slice(u,v)),u=v+i;continue}if(y==="/"){m=v;continue}}y==="["?d++:y==="]"&&d--}const f=c.length===0?l:l.substring(u),p=f.startsWith(sW),x=p?f.substring(1):f,g=m&&m>u?m-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},tme=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},rme=e=>({cache:Jue(e.cacheSize),parseClassName:eme(e),...Gue(e)}),nme=/\s+/,sme=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(nme);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:p}=n(d);let x=!!p,g=s(x?f.substring(0,p):f);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=s(f),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const v=tme(u).join(":"),y=m?v+sW:v,b=y+g;if(i.includes(b))continue;i.push(b);const w=a(g,x);for(let S=0;S<w.length;++S){const j=w[S];i.push(y+j)}l=d+(l.length>0?" "+l:l)}return l};function ame(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=aW(t))&&(s&&(s+=" "),s+=n);return s}const aW=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=aW(e[s]))&&(n&&(n+=" "),n+=t);return n};function ime(e,...t){let n,s,a,i=o;function o(c){const d=t.reduce((u,m)=>m(u),e());return n=rme(d),s=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=s(c);if(d)return d;const u=sme(c,n);return a(c,u),u}return function(){return i(ame.apply(null,arguments))}}const hs=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},iW=/^\[(?:([a-z-]+):)?(.+)\]$/i,ome=/^\d+\/\d+$/,lme=new Set(["px","full","screen"]),cme=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dme=/\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$/,ume=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mme=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hme=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ld=e=>Sx(e)||lme.has(e)||ome.test(e),Eu=e=>uv(e,"length",wme),Sx=e=>!!e&&!Number.isNaN(Number(e)),bk=e=>uv(e,"number",Sx),ry=e=>!!e&&Number.isInteger(Number(e)),fme=e=>e.endsWith("%")&&Sx(e.slice(0,-1)),Lr=e=>iW.test(e),Au=e=>cme.test(e),pme=new Set(["length","size","percentage"]),xme=e=>uv(e,pme,oW),gme=e=>uv(e,"position",oW),vme=new Set(["image","url"]),yme=e=>uv(e,vme,Nme),bme=e=>uv(e,"",jme),ny=()=>!0,uv=(e,t,n)=>{const s=iW.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},wme=e=>dme.test(e)&&!ume.test(e),oW=()=>!1,jme=e=>mme.test(e),Nme=e=>hme.test(e),Sme=()=>{const e=hs("colors"),t=hs("spacing"),n=hs("blur"),s=hs("brightness"),a=hs("borderColor"),i=hs("borderRadius"),o=hs("borderSpacing"),l=hs("borderWidth"),c=hs("c
959ontrast"),d=hs("grayscale"),u=hs("hueRotate"),m=hs("invert"),f=hs("gap"),p=hs("gradientColorStops"),x=hs("gradientColorStopPositions"),g=hs("inset"),v=hs("margin"),y=hs("opacity"),b=hs("padding"),w=hs("saturate"),S=hs("scale"),j=hs("sepia"),N=hs("skew"),_=hs("space"),C=hs("translate"),k=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Lr,t],T=()=>[Lr,t],D=()=>["",ld,Eu],A=()=>["auto",Sx,Lr],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Lr],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Sx,Lr];return{cacheSize:500,separator:":",theme:{colors:[ny],spacing:[ld,Eu],blur:["none","",Au,Lr],brightness:B(),borderColor:[e],borderRadius:["none","","full",Au,Lr],borderSpacing:T(),borderWidth:D(),contrast:B(),grayscale:$(),hueRotate:B(),invert:$(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[fme,Eu],inset:R(),margin:R(),opacity:B(),padding:T(),saturate:B(),scale:B(),sepia:$(),skew:B(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Lr]}],container:["container"],columns:[{columns:[Au]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),Lr]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ry,Lr]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Lr]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",ry,Lr]}],"grid-cols":[{"grid-cols":[ny]}],"col-start-end":[{col:["auto",{span:["full",ry,Lr]},Lr]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[ny]}],"row-start-end":[{row:["auto",{span:[ry,Lr]},Lr]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Lr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Lr]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Lr,t]}],"min-w":[{"min-w":[Lr,t,"min","max","fit"]}],"max-w":[{"max-w":[Lr,t,"none","full","min","max","fit","prose",{screen:[Au]},Au]}],h:[{h:[Lr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Lr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Lr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Lr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Au,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bk]}],"font-family":[{font:[ny]}],"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",Lr]}],"line-clamp":[{"line-clamp":["none",Sx,bk]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ld,Lr]}],"list-image":[{"list-image":["none",Lr]}],"list-style-type":[{list:["none","disc","decimal",Lr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ld,Eu]}],"underline-offset":[{"underline-offset":["auto",ld,Lr]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Lr]}],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",Lr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),gme]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xme]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yme]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}
959],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,468 bytes, line 959
959],"divide-style":[{divide:U()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[ld,Lr]}],"outline-w":[{outline:[ld,Eu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ld,Eu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Au,bme]}],"shadow-color":[{shadow:[ny]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Au,Lr]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Lr]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Lr]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Lr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ry,Lr]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Lr]}],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",Lr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Lr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ld,Eu,bk]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
959none"]}]},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"]}}},_me=ime(Sme);function ge(...e){return _me(Tr(e))}const Cme=Xde,lW=h.forwardRef(({className:e,...t},n)=>r.jsx(DH,{ref:n,className:ge("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}));lW.displayName=DH.displayName;const kme=Jm("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"}}),cW=h.forwardRef(({className:e,variant:t,...n},s)=>r.jsx(MH,{ref:s,className:ge(kme({variant:t}),e),...n}));cW.displayName=MH.displayName;const Eme=h.forwardRef(({className:e,...t},n)=>r.jsx($H,{ref:n,className:ge("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}));Eme.displayName=$H.displayName;const dW=h.forwardRef(({className:e,...t},n)=>r.jsx(VH,{ref:n,className:ge("absolute right-2 top-2 rounded-md p-1 text-foreground
959/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:r.jsx(zt,{className:"h-4 w-4"})}));dW.displayName=VH.displayName;const uW=h.forwardRef(({className:e,...t},n)=>r.jsx(IH,{ref:n,className:ge("text-sm font-semibold",e),...t}));uW.displayName=IH.displayName;const mW=h.forwardRef(({className:e,...t},n)=>r.jsx(LH,{ref:n,className:ge("text-sm opacity-90",e),...t}));mW.displayName=LH.displayName;function Ame(){const{toasts:e}=Gr();return r.jsxs(Cme,{children:[e.map(function({id:t,title:n,description:s,action:a,...i}){return r.jsxs(cW,{...i,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(uW,{children:n}),s&&r.jsx(mW,{children:s})]}),a,r.jsx(dW,{})]},t)}),r.jsx(lW,{})]})}var Tme=(e,t,n,s,a,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&i?a.map(y=>i[y]||y):a;g?(c.classList.remove(...v),c.classList.add(i&&i[p]?i[p]:p)):c.setAttribute(x,p)}),m(p)}function m(p){l&&d.includes(p)&&(c.style.colorScheme=p)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)u(s);else try{let p=localStorage.getItem(t)||n,x=o&&p==="system"?f():p;u(x)}catch{}},ML=["light","dark"],hW="(prefers-color-scheme: dark)",Rme=typeof window>"u",W4=h.createContext(void 0),Ome={setTheme:e=>{},themes:[]},Y4=()=>{var e;return(e=h.useContext(W4))!=null?e:Ome},Pme=e=>h.useContext(W4)?h.createElement(h.Fragment,null,e.children):h.createElement(Mme,{...e}),Dme=["light","dark"],Mme=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:s=!0,storageKey:a="theme",themes:i=Dme,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:m})=>{let[f,p]=h.useState(()=>Lme(a,o)),[x,g]=h.useState(()=>f==="system"?wk():f),v=c?Object.values(c):i,y=h.useCallback(j=>{let N=j;if(!N)return;j==="system"&&n&&(N=wk());let _=c?c[N]:N,C=t?$me(u):null,k=document.documentElement,E=R=>{R==="class"?(k.classList.remove(...v),_&&k.classList.add(_)):R.startsWith("data-")&&(_?k.setAttribute(R,_):k.removeAttribute(R))};if(Array.isArray(l)?l.forEach(E):E(l),s){let R=ML.includes(o)?o:null,T=ML.includes(N)?N:R;k.style.colorScheme=T}C==null||C()},[u]),b=h.useCallback(j=>{let N=typeof j=="function"?j(f):j;p(N);try{localStorage.setItem(a,N)}catch{}},[f]),w=h.useCallback(j=>{let N=wk(j);g(N),f==="system"&&n&&!e&&y("system")},[f,e]);h.useEffect(()=>{let j=window.matchMedia(hW);return j.addListener(w),w(j),()=>j.removeListener(w)},[w]),h.useEffect(()=>{let j=N=>{N.key===a&&(N.newValue?p(N.newValue):b(o))};return window.addEventListener("storage",j),()=>window.removeEventListener("storage",j)},[b]),h.useEffect(()=>{y(e??f)},[e,f]);let S=h.useMemo(()=>({theme:f,setTheme:b,forcedTheme:e,resolvedTheme:f==="system"?x:f,themes:n?[...i,"system"]:i,systemTheme:n?x:void 0}),[f,b,e,x,n,i]);return h.createElement(W4.Provider,{value:S},h.createElement(Ime,{forcedTheme:e,storageKey:a,attribute:l,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:m}),d)},Ime=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:o,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([n,t,i,e,l,o,s,a]).slice(1,-1);return h.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Tme.toString()})(${u})`}})}),Lme=(e,t)=>{if(Rme)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},$me=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},wk=e=>
959(e||(e=window.matchMedia(hW)),e.matches?"dark":"light"),Vme=e=>{switch(e){case"success":return Bme;case"info":return qme;case"warning":return zme;case"error":return Hme;default:return null}},Ume=Array(12).fill(0),Fme=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},Ume.map((n,s)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Bme=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),zme=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),qme=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),Hme=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),Wme=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Yme=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},vT=1,Gme=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,...s}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:vT++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,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)=>
959this.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 s=e instanceof Promise?e:e(),a=n!==void 0,i,o=s.then(async c=>{if(i=["resolve",c],Y.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Xme(c)&&!c.ok){a=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){a=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||vT++;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}},Xi=new Gme,Kme=(e,t)=>{let n=(t==null?void 0:t.id)||vT++;return Xi.addToast({title:e,...t,id:n}),n},Xme=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Zme=Kme,Qme=()=>Xi.toasts,Jme=()=>Xi.getActiveToasts(),Pe=Object.assign(Zme,{success:Xi.success,info:Xi.info,warning:Xi.warning,error:Xi.error,custom:Xi.custom,message:Xi.message,promise:Xi.promise,dismiss:Xi.dismiss,loading:Xi.loading},{getHistory:Qme,getToasts:Jme});function ehe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}ehe(`: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;
959left: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}
959: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%);
959--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%)}
960`);function cj(e){return e.label!==void 0}var the=3,rhe="32px",nhe="16px",IL=4e3,she=356,ahe=14,ihe=20,ohe=200;function _l(...e){return e.filter(Boolean).join(" ")}function lhe(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var che=e=>{var t,n,s,a,i,o,l,c,d,u,m;let{invert:f,toast:p,unstyled:x,interacting:g,setHeights:v,visibleToasts:y,heights:b,index:w,toasts:S,expanded:j,removeToast:N,defaultRichColors:_,closeButton:C,style:k,cancelButtonStyle:E,actionButtonStyle:R,className:T="",descriptionClassName:D="",duration:A,position:V,gap:U,loadingIcon:O,expandByDefault:M,classNames:$,icons:I,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:K}=e,[Z,q]=Y.useState(null),[H,X]=Y.useState(null),[G,ee]=Y.useState(!1),[re,W]=Y.useState(!1),[Q,L]=Y.useState(!1),[te,ae]=Y.useState(!1),[ne,se]=Y.useState(!1),[ue,Ne]=Y.useState(0),[Qe,J]=Y.useState(0),de=Y.useRef(p.duration||A||IL),ve=Y.useRef(null),Le=Y.useRef(null),$e=w===0,De=w+1<=y,oe=p.type,xe=p.dismissible!==!1,Ze=p.className||"",it=p.descriptionClassName||"",ct=Y.useMemo(()=>b.findIndex(Ve=>Ve.toastId===p.id)||0,[b,p.id]),Oe=Y.useMemo(()=>{var Ve;return(Ve=p.closeButton)!=null?Ve:C},[p.closeButton,C]),pe=Y.useMemo(()=>p.duration||A||IL,[p.duration,A]),le=Y.useRef(0),ke=Y.useRef(0),Ee=Y.useRef(0),ot=Y.useRef(null),[gt,Nt]=V.split("-"),Ct=Y.useMemo(()=>b.reduce((Ve,et,Ge)=>Ge>=ct?Ve:Ve+et.height,0),[b,ct]),dt=Yme(),tt=p.invert||f,Re=oe==="loading";ke.current=Y.useMemo(()=>ct*U+Ct,[ct,Ct]),Y.useEffect(()=>{de.current=pe},[pe]),Y.useEffect(()=>{ee(!0)},[]),Y.useEffect(()=>{let Ve=Le.current;if(Ve){let et=Ve.getBoundingClientRect().height;return J(et),v(Ge=>[{toastId:p.id,height:et,position:p.position},...Ge]),()=>v(Ge=>Ge.filter(St=>St.toastId!==p.id))}},[v,p.id]),Y.useLayoutEffect(()=>{if(!G)return;let Ve=Le.current,et=Ve.style.height;Ve.style.height="auto";let Ge=Ve.getBoundingClientRect().height;Ve.style.height=et,J(Ge),v(St=>St.find(Tt=>Tt.toastId===p.id)?St.map(Tt=>
960Tt.toastId===p.id?{...Tt,height:Ge}:Tt):[{toastId:p.id,height:Ge,position:p.position},...St])},[G,p.title,p.description,v,p.id]);let Fe=Y.useCallback(()=>{W(!0),Ne(ke.current),v(Ve=>Ve.filter(et=>et.toastId!==p.id)),setTimeout(()=>{N(p)},ohe)},[p,N,v,ke]);Y.useEffect(()=>{if(p.promise&&oe==="loading"||p.duration===1/0||p.type==="loading")return;let Ve;return j||g||K&&dt?(()=>{if(Ee.current<le.current){let et=new Date().getTime()-le.current;de.current=de.current-et}Ee.current=new Date().getTime()})():de.current!==1/0&&(le.current=new Date().getTime(),Ve=setTimeout(()=>{var et;(et=p.onAutoClose)==null||et.call(p,p),Fe()},de.current)),()=>clearTimeout(Ve)},[j,g,p,oe,K,dt,Fe]),Y.useEffect(()=>{p.delete&&Fe()},[Fe,p.delete]);function Ae(){var Ve,et,Ge;return I!=null&&I.loading?Y.createElement("div",{className:_l($==null?void 0:$.loader,(Ve=p==null?void 0:p.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":oe==="loading"},I.loading):O?Y.createElement("div",{className:_l($==null?void 0:$.loader,(et=p==null?void 0:p.classNames)==null?void 0:et.loader,"sonner-loader"),"data-visible":oe==="loading"},O):Y.createElement(Fme,{className:_l($==null?void 0:$.loader,(Ge=p==null?void 0:p.classNames)==null?void 0:Ge.loader),visible:oe==="loading"})}return Y.createElement("li",{tabIndex:0,ref:Le,className:_l(T,Ze,$==null?void 0:$.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,$==null?void 0:$.default,$==null?void 0:$[oe],(n=p==null?void 0:p.classNames)==null?void 0:n[oe]),"data-sonner-toast":"","data-rich-colors":(s=p.richColors)!=null?s:_,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":G,"data-promise":!!p.promise,"data-swiped":ne,"data-removed":re,"data-visible":De,"data-y-position":gt,"data-x-position":Nt,"data-index":w,"data-front":$e,"data-swiping":Q,"data-dismissible":xe,"data-type":oe,"data-invert":tt,"data-swipe-out":te,"data-swipe-direction":H,"data-expanded":!!(j||M&&G),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${re?ue:ke.current}px`,"--initial-height":M?"auto":`${Qe}px`,...k,...p.style},onDragEnd:()=>{L(!1),q(null),ot.current=null},onPointerDown:Ve=>{Re||!xe||(ve.current=new Date,Ne(ke.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(L(!0),ot.current={x:Ve.clientX,y:Ve.clientY}))},onPointerUp:()=>{var Ve,et,Ge,St;if(te||!xe)return;ot.current=null;let Tt=Number(((Ve=Le.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zt=Number(((et=Le.current)==null?void 0:et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((Ge=ve.current)==null?void 0:Ge.getTime()),Wt=Z==="x"?Tt:Zt,Xe=Math.abs(Wt)/bt;if(Math.abs(Wt)>=ihe||Xe>.11){Ne(ke.current),(St=p.onDismiss)==null||St.call(p,p),X(Z==="x"?Tt>0?"right":"left":Zt>0?"down":"up"),Fe(),ae(!0),se(!1);return}L(!1),q(null)},onPointerMove:Ve=>{var et,Ge,St,Tt;if(!ot.current||!xe||((et=window.getSelection())==null?void 0:et.toString().length)>0)return;let Zt=Ve.clientY-ot.current.y,bt=Ve.clientX-ot.current.x,Wt=(Ge=e.swipeDirections)!=null?Ge:lhe(V);!Z&&(Math.abs(bt)>1||Math.abs(Zt)>1)&&q(Math.abs(bt)>Math.abs(Zt)?"x":"y");let Xe={x:0,y:0};Z==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Zt<0||Wt.includes("bottom")&&Zt>0)&&(Xe.y=Zt):Z==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&bt<0||Wt.includes("right")&&bt>0)&&(Xe.x=bt),(Math.abs(Xe.x)>0||Math.abs(Xe.y)>0)&&se(!0),(St=Le.current)==null||St.style.setProperty("--swipe-amount-x",`${Xe.x}px`),(Tt=Le.current)==null||Tt.style.setProperty("--swipe-amount-y",`${Xe.y}px`)}},Oe&&!p.jsx?Y.createElement("button",{"aria-label":B,"data-disabled":Re,"data-close-button":!0,onClick:Re||!xe?()=>{}:()=>{var Ve;Fe(),(Ve=p.onDismiss)==null||Ve.call(p,p)},className:_l($==null?void 0:$.closeButton,(a=p==null?void 0:p.classNames)==null?void 0:a.closeButton)},(i=I==null?void 0:I.close)!=null?i:Wme):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Y.createElement(Y.Fragment,null,oe||p.icon||p.promise?Y.createElement("div",{"data-icon":"",className:_l($==null?void 0:$.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)}
960,p.promise||p.type==="loading"&&!p.icon?p.icon||Ae():null,p.type!=="loading"?p.icon||(I==null?void 0:I[oe])||Vme(oe):null):null,Y.createElement("div",{"data-content":"",className:_l($==null?void 0:$.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},Y.createElement("div",{"data-title":"",className:_l($==null?void 0:$.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?Y.createElement("div",{"data-description":"",className:_l(D,it,$==null?void 0:$.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&cj(p.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||E,onClick:Ve=>{var et,Ge;cj(p.cancel)&&xe&&((Ge=(et=p.cancel).onClick)==null||Ge.call(et,Ve),Fe())},className:_l($==null?void 0:$.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&cj(p.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||R,onClick:Ve=>{var et,Ge;cj(p.action)&&((Ge=(et=p.action).onClick)==null||Ge.call(et,Ve),!Ve.defaultPrevented&&Fe())},className:_l($==null?void 0:$.actionButton,(m=p==null?void 0:p.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function LL(){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 dhe(e,t){let n={};return[e,t].forEach((s,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?nhe:rhe;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):c(l)}),n}var uhe=h.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:m,duration:f,style:p,visibleToasts:x=the,toastOptions:g,dir:v=LL(),gap:y=ahe,loadingIcon:b,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:j}=e,[N,_]=Y.useState([]),C=Y.useMemo(()=>Array.from(new Set([s].concat(N.filter(K=>K.position).map(K=>K.position)))),[N,s]),[k,E]=Y.useState([]),[R,T]=Y.useState(!1),[D,A]=Y.useState(!1),[V,U]=Y.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),O=Y.useRef(null),M=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=Y.useRef(null),I=Y.useRef(!1),B=Y.useCallback(K=>{_(Z=>{var q;return(q=Z.find(H=>H.id===K.id))!=null&&q.delete||Xi.dismiss(K.id),Z.filter(({id:H})=>H!==K.id)})},[]);return Y.useEffect(()=>Xi.subscribe(K=>{if(K.dismiss){_(Z=>Z.map(q=>q.id===K.id?{...q,delete:!0}:q));return}setTimeout(()=>{IP.flushSync(()=>{_(Z=>{let q=Z.findIndex(H=>H.id===K.id);return q!==-1?[...Z.slice(0,q),{...Z[q],...K},...Z.slice(q+1)]:[K,...Z]})})})}),[]),Y.useEffect(()=>{if(u!=="system"){U(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Z})=>{U(Z?"dark":"light")})}catch{K.addListener(({matches:q})=>{try{U(q?"dark":"light")}catch(H){console.error(H)}})}},[u]),Y.useEffect(()=>{N.length<=1&&T(!1)},[N]),Y.useEffect(()=>{let K=Z=>{var q,H;a.every(X=>Z[X]||Z.code===X)&&(T(!0),(q=O.current)==null||q.focus()),Z.code==="Escape"&&(document.activeElement===O.current||(H=O.current)!=null&&H.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[a]),Y.useEffect(()=>{if(O.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,I.current=!1)}},[O.current]),Y.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((K,Z)=>{var q;let[H,X]=K.split("-");return N.length?Y.createElement("ol",{key:K,dir:v==="auto"?LL():v,tabIndex:-1,ref:O,className:l,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":H,"data-lifted":R&&N.length>1&&!i,"data-x-position":X,style:{"--front-toast-height":`${((q=k[0])==null?void 0:q.height)||0}px`,"--width":`${she}px`,"--gap":`${y}px`,...p,...dhe(c,d)},onBlur:G=>{I.current&&!G.currentTarget.contains(G.relatedTarget)&&(I.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||I.current||(I.current=!0,$.current=G.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{D||T(!1)},onDragEnd:()=>T(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},N.filter(G=>!G.position&&Z===0||G.position===K).map((G,ee)=>{var re,W;return Y.createElement(che,{key:G.id,icons:w,index:ee,toast:G,defaultRichColors:m,duration:(re=g==null?void 0:g.duration)!=null?re:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:x,closeButton:(W=g==null?void 0:g.closeButton)!=null?W:o,interacting:D,position:K,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:B,toasts:N.filter(Q=>Q.position==G.position),heights:k.filter(Q=>Q.position==G.position),setHeights:E,expandByDefault:i,gap:y,loadingIcon:b,expanded:R,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const mhe=({...e})=>{const{theme:t="system"}=Y4();return r.jsx(uhe,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var hhe=MP[" useId ".trim().toString()]||(()=>{}),fhe=0;function ji(e){const[t,n]=h.useState(hhe());return js(()=>{n(s=>s??String(fhe++))},[e]),t?`radix-${t}`:""}const phe=["top","right","bottom","left"],Fm=Math.min,xo=Math.max,uN=Math.round,dj=Math.floor,kc=e=>({x:e,y:e}
vendor: 11,840 bytes, line 960
960),xhe={left:"right",right:"left",bottom:"top",top:"bottom"},ghe={start:"end",end:"start"};function yT(e,t,n){return xo(e,Fm(t,n))}function Yd(e,t){return typeof e=="function"?e(t):e}function Gd(e){return e.split("-")[0]}function mv(e){return e.split("-")[1]}function G4(e){return e==="x"?"y":"x"}function K4(e){return e==="y"?"height":"width"}const vhe=new Set(["top","bottom"]);function yc(e){return vhe.has(Gd(e))?"y":"x"}function X4(e){return G4(yc(e))}function yhe(e,t,n){n===void 0&&(n=!1);const s=mv(e),a=X4(e),i=K4(a);let o=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=mN(o)),[o,mN(o)]}function bhe(e){const t=mN(e);return[bT(e),t,bT(t)]}function bT(e){return e.replace(/start|end/g,t=>ghe[t])}const $L=["left","right"],VL=["right","left"],whe=["top","bottom"],jhe=["bottom","top"];function Nhe(e,t,n){switch(e){case"top":case"bottom":return n?t?VL:$L:t?$L:VL;case"left":case"right":return t?whe:jhe;default:return[]}}function She(e,t,n,s){const a=mv(e);let i=Nhe(Gd(e),n==="start",s);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(bT)))),i}function mN(e){return e.replace(/left|right|bottom|top/g,t=>xhe[t])}function _he(e){return{top:0,right:0,bottom:0,left:0,...e}}function fW(e){return typeof e!="number"?_he(e):{top:e,right:e,bottom:e,left:e}}function hN(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}function UL(e,t,n){let{reference:s,floating:a}=e;const i=yc(t),o=X4(t),l=K4(o),c=Gd(t),d=i==="y",u=s.x+s.width/2-a.width/2,m=s.y+s.height/2-a.height/2,f=s[l]/2-a[l]/2;let p;switch(c){case"top":p={x:u,y:s.y-a.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:m};break;case"left":p={x:s.x-a.width,y:m};break;default:p={x:s.x,y:s.y}}switch(mv(t)){case"start":p[o]-=f*(n&&d?-1:1);break;case"end":p[o]+=f*(n&&d?-1:1);break}return p}const Che=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:m}=UL(d,s,c),f=s,p={},x=0;for(let g=0;g<l.length;g++){const{name:v,fn:y}=l[g],{x:b,y:w,data:S,reset:j}=await y({x:u,y:m,initialPlacement:s,placement:f,strategy:a,middlewareData:p,rects:d,platform:o,elements:{reference:e,floating:t}});u=b??u,m=w??m,p={...p,[v]:{...p[v],...S}},j&&x<=50&&(x++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(d=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):j.rects),{x:u,y:m}=UL(d,f,c)),g=-1)}return{x:u,y:m,placement:f,strategy:a,middlewareData:p}};async function Lb(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:f=!1,padding:p=0}=Yd(t,e),x=fW(p),v=l[f?m==="floating"?"reference":"floating":m],y=hN(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=m==="floating"?{x:s,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=hN(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(y.top-j.top+x.top)/S.y,bottom:(j.bottom-y.bottom+x.bottom)/S.y,left:(y.left-j.left+x.left)/S.x,right:(j.right-y.right+x.right)/S.x}}const khe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Yd(e,t)||{};if(d==null)return{};const m=fW(u),f={x:n,y:s},p=X4(a),x=K4(p),g=await o.getDimensions(d),v=p==="y",y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[p]-f[p]-i.floating[x],j=f[p]-i.reference[p],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let _=N?N[w]:0;(!_||!await(o.isElement==null?void 0:o.isElement(N)))&&(_=l.floating[w]||i.floating[x]);const C=S/2-j/2,k=_/2-g[x]/2-1,E=Fm(m[y],k),R=Fm(m[b],k),T=E,D=_-g[x]-R,A=_/2-g[x]/2+C,V=yT(T,A,D),U=!c.arrow&&mv(a)!=null&&A!==V&&i.reference[x]/2-(A<T?E:R)-g[x]/2<0,O=U?A<T?A-T:A-D:0;return{[p]:f[p]+O,data:{[p]:V,centerOffset:A-V-O,...U&&{alignmentOffset:O}},reset:U}}}),Ehe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...v}=Yd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Gd(a),b=yc(l),w=Gd(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=f||(w||!g?[mN(l)]:bhe(l)),N=x!=="none";!f&&N&&j.push(...She(l,g,x,S));const _=[l,...j],C=await Lb(t,v),k=[];let E=((s=i.flip)==null?void 0:s.overflows)||[];if(u&&k.push(C[y]),m){const A=yhe(a,o,S);k.push(C[A[0]],C[A[1]])}if(E=[...E,{placement:a,overflows:k}],!k.every(A=>A<=0)){var R,T;const A=(((R=i.flip)==null?void 0:R.index)||0)+1,V=_[A];if(V&&(!(m==="alignment"?b!==yc(V):!1)||E.every(M=>M.overflows[0]>0&&yc(M.placement)===b)))return{data:{index:A,overflows:E},reset:{placement:V}};let U=(T=E.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!U)switch(p){case"bestFit":{var D;const O=(D=E.filter(M=>{if(N){const $=yc(M.placement);return $===b||$==="y"}return!0}).map(M=>[M.placement,M.overflows.filter($=>$>0).reduce(($,I)=>$+I,0)]).sort((M,$)=>M[1]-$[1])[0])==null?void 0:D[0];O&&(U=O);break}case"initialPlacement":U=l;break}if(a!==U)return{reset:{placement:U}}}return{}}}};function FL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BL(e){return phe.some(t=>e[t]>=0)}const Ahe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...a}=Yd(e,t);switch(s){case"referenceHidden":{const i=await Lb(t,{...a,elementContext:"reference"}),o=FL(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:BL(o)}}}case"escaped":{const i=await Lb(t,{...a,altBoundary:!0}),o=FL(i,n.floating);return{data:{escapedOffsets:o,escaped:BL(o)}}}default:return{}}}}},pW=new Set(["left","top"]);async function The(e,t){const{placement:n,platform:s,elements:a}=e,i=await(s.isRTL==null?void 0:s.isRTL(a.floating)),o=Gd(n),l=mv(n),c=yc(n)==="y",d=pW.has(o)?-1:1,u=i&&c?-1:1,m=Yd(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*u,y:f*d}:{x:f*d,y:p*u}}const Rhe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await The(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},Ohe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=Yd(e,t),d={x:n,y:s},u=await Lb(t,c),m=yc(Gd(a)),f=G4(m);let p=d[f],x=d[m];if(i){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[v],w=p-u[y];p=yT(b,p,w)}if(o){const v=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=x+u[v],w=x-u[y];x=yT(b,x,w)}const g=l.fn({...t,[f]:p,[m]:x});return{...g,data:{x:g.x-n,y:g.y-s,enabled:{[f]:i,[m]:o}}}}}},Phe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Yd(e,t),u={x:n,y:s},m=yc(a),f=G4(m);let p=u[f],x=u[m];const g=Yd(l,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=f==="y"?"height":"width",S=i.reference[f]-i.floating[w]+v.mainAxis,j=i.reference[f]+i.reference[w]-v.mainAxis;p<S?p=S:p>j&&(p=j)}if(d){var y,b;const w=f==="y"?"width":"height",S=pW.has(Gd(a)),j=i.reference[m]-i.floating[w]+(S&&((y=o.offset)==null?void 0:y[m])||0)+(S?0:v.crossAxis),N=i.reference[m]+i.reference[w]+(S?0:((b=o.offset)==null?void 0:b[m])||0)-(S?v.crossAxis:0);x<j?x=j:x>N&&(x=N)}return{[f]:p,[m]:x}}}},Dhe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Yd(e,t),u=await Lb(t,d),m=Gd(a),f=mv(a),p=yc(a)==="y",{width:x,height:g}=i.floating;let v,y;m==="top"||m==="bottom"?(v=m,y=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=m,v=f==="end"?"top":"bottom");const b=g-u.top-u.bottom,w=x-u.left-u.right,S=Fm(g-u[v],b),j=Fm(x-u[y],w),N=!t.middlewareData.shift;let _=S,C=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=w),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(_=b),N&&!f){const E=xo(u.left,0),R=xo(u.right,0),T=xo(u.top,0),D=xo(u.bottom,0);p?C=x-2*(E!==0||R!==0?E+R:xo(u.left,u.right)):_=g-2*(T!==0||D!==0?T+D:xo(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:_});const k=await o.getDimensions(l.floating);return x!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}};function T_(){return typeof window<"u"}function hv(e){return xW(e)?(e.nodeName||"").toLowerCase():"#document"}function Ao(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hc(e){var t;return(t=(xW(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xW(e){return T_()?e instanceof Node||e instanceof Ao(e).Node:!1}function Yl(e){return T_()?e instanceof Element||e instanceof Ao(e).Element:!1}function Mc(e){return T_()?e instanceof HTMLElement||e instanceof Ao(e).HTMLElement:!1}function zL(e){return!T_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ao(e).ShadowRoot}const Mhe=new Set(["inline","contents"]);function uw(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=Gl(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!Mhe.has(a)}const Ihe=new Set(["table","td","th"]);function Lhe(e){return Ihe.has(hv(e))}const $he=[":popover-open",":modal"];function R_(e){return $he.some(t=>{try{return e.matches(t)}catch{return!1}})}const Vhe=["transform","translate","scale","rotate","perspective"],Uhe=["transform","translate","scale","rotate","perspective","filter"],Fhe=["paint","layout","strict","content"];function Z4(e){const t=Q4(),n=Yl(e)?Gl(e):e;return Vhe.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Uhe.some(s=>(n.willChange||"").includes(s))||Fhe.some(s=>(n.contain||"").includes(s))}function Bhe(e){let t=Bm(e);for(;Mc(t)&&!cg(t);){if(Z4(t))return t;if(R_(t))return null;t=Bm(t)}return null}function Q4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zhe=new Set(["html","body","#document"]);function cg(e){return zhe.has(hv(e))}function Gl(e){return Ao(e).getComputedStyle(e)}function O_(e){return Yl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bm(e){if(hv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zL(e)&&e.host||Hc(e);return zL(t)?t.host:t}function gW(e){const t=Bm(e);return cg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mc(t)&&uw(t)?t:gW(t)}function $b(e,t,n){var s;
vendor: 4,101 bytes, line 960
960t===void 0&&(t=[]),n===void 0&&(n=!0);const a=gW(e),i=a===((s=e.ownerDocument)==null?void 0:s.body),o=Ao(a);if(i){const l=wT(o);return t.concat(o,o.visualViewport||[],uw(a)?a:[],l&&n?$b(l):[])}return t.concat(a,$b(a,[],n))}function wT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vW(e){const t=Gl(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=Mc(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:s,l=uN(n)!==i||uN(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function J4(e){return Yl(e)?e:e.contextElement}function _x(e){const t=J4(e);if(!Mc(t))return kc(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:i}=vW(t);let o=(i?uN(n.width):n.width)/s,l=(i?uN(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const qhe=kc(0);function yW(e){const t=Ao(e);return!Q4()||!t.visualViewport?qhe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hhe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ao(e)?!1:t}function Af(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=J4(e);let o=kc(1);t&&(s?Yl(s)&&(o=_x(s)):o=_x(e));const l=Hhe(i,n,s)?yW(i):kc(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,m=a.height/o.y;if(i){const f=Ao(i),p=s&&Yl(s)?Ao(s):s;let x=f,g=wT(x);for(;g&&s&&p!==x;){const v=_x(g),y=g.getBoundingClientRect(),b=Gl(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,d*=v.y,u*=v.x,m*=v.y,c+=w,d+=S,x=Ao(g),g=wT(x)}}return hN({width:u,height:m,x:c,y:d})}function e5(e,t){const n=O_(e).scrollLeft;return t?t.left+n:Af(Hc(e)).left+n}function bW(e,t,n){n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=s.left+t.scrollLeft-(n?0:e5(e,s)),i=s.top+t.scrollTop;return{x:a,y:i}}function Whe(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const i=a==="fixed",o=Hc(s),l=t?R_(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=kc(1);const u=kc(0),m=Mc(s);if((m||!m&&!i)&&((hv(s)!=="body"||uw(o))&&(c=O_(s)),Mc(s))){const p=Af(s);d=_x(s),u.x=p.x+s.clientLeft,u.y=p.y+s.clientTop}const f=o&&!m&&!i?bW(o,c,!0):kc(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+f.x,y:n.y*d.y-c.scrollTop*d.y+u.y+f.y}}function Yhe(e){return Array.from(e.getClientRects())}function Ghe(e){const t=Hc(e),n=O_(e),s=e.ownerDocument.body,a=xo(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=xo(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+e5(e);const l=-n.scrollTop;return Gl(s).direction==="rtl"&&(o+=xo(t.clientWidth,s.clientWidth)-a),{width:a,height:i,x:o,y:l}}function Khe(e,t){const n=Ao(e),s=Hc(e),a=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=Q4();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}const Xhe=new Set(["absolute","fixed"]);function Zhe(e,t){const n=Af(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,i=Mc(e)?_x(e):kc(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=s*i.y;return{width:o,height:l,x:c,y:d}}function qL(e,t,n){let s;if(t==="viewport")s=Khe(e,n);else if(t==="document")s=Ghe(Hc(e));else if(Yl(t))s=Zhe(t,n);else{const a=yW(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return hN(s)}function wW(e,t){const n=Bm(e);return n===t||!Yl(n)||cg(n)?!1:Gl(n).position==="fixed"||wW(n,t)}function Qhe(e,t){const n=t.get(e);if(n)return n;let s=$b(e,[],!1).filter(l=>Yl(l)&&hv(l)!=="body"),a=null;const i=Gl(e).position==="fixed";let o=i?Bm(e):e;for(;Yl(o)&&!cg(o);){const l=Gl(o),c=Z4(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&Xhe.has(a.position)||uw(o)&&!c&&wW(e,o))?s=s.filter(u=>u!==o):a=l,o=Bm(o)}return t.set(e,s),s}function Jhe(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const o=[...n==="clippingAncestors"?R_(t)?[]:Qhe(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((d,u)=>{const m=qL(t,u,a);return d.top=xo(m.top,d.top),d.right=Fm(m.right,d.right),d.bottom=Fm(m.bottom,d.bottom),d.left
vendor: 10,015 bytes, line 960
960=xo(m.left,d.left),d},qL(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function efe(e){const{width:t,height:n}=vW(e);return{width:t,height:n}}function tfe(e,t,n){const s=Mc(t),a=Hc(t),i=n==="fixed",o=Af(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=kc(0);function d(){c.x=e5(a)}if(s||!s&&!i)if((hv(t)!=="body"||uw(a))&&(l=O_(t)),s){const p=Af(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&d();i&&!s&&a&&d();const u=a&&!s&&!i?bW(a,l):kc(0),m=o.left+l.scrollLeft-c.x-u.x,f=o.top+l.scrollTop-c.y-u.y;return{x:m,y:f,width:o.width,height:o.height}}function jk(e){return Gl(e).position==="static"}function HL(e,t){if(!Mc(e)||Gl(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hc(e)===n&&(n=n.ownerDocument.body),n}function jW(e,t){const n=Ao(e);if(R_(e))return n;if(!Mc(e)){let a=Bm(e);for(;a&&!cg(a);){if(Yl(a)&&!jk(a))return a;a=Bm(a)}return n}let s=HL(e,t);for(;s&&Lhe(s)&&jk(s);)s=HL(s,t);return s&&cg(s)&&jk(s)&&!Z4(s)?n:s||Bhe(e)||n}const rfe=async function(e){const t=this.getOffsetParent||jW,n=this.getDimensions,s=await n(e.floating);return{reference:tfe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function nfe(e){return Gl(e).direction==="rtl"}const sfe={convertOffsetParentRelativeRectToViewportRelativeRect:Whe,getDocumentElement:Hc,getClippingRect:Jhe,getOffsetParent:jW,getElementRects:rfe,getClientRects:Yhe,getDimensions:efe,getScale:_x,isElement:Yl,isRTL:nfe};function NW(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function afe(e,t){let n=null,s;const a=Hc(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:m,width:f,height:p}=d;if(l||t(),!f||!p)return;const x=dj(m),g=dj(a.clientWidth-(u+f)),v=dj(a.clientHeight-(m+p)),y=dj(u),w={rootMargin:-x+"px "+-g+"px "+-v+"px "+-y+"px",threshold:xo(0,Fm(1,c))||1};let S=!0;function j(N){const _=N[0].intersectionRatio;if(_!==c){if(!S)return o();_?o(!1,_):s=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!NW(d,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(j,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(j,w)}n.observe(e)}return o(!0),i}function ife(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=J4(e),u=a||i?[...d?$b(d):[],...$b(t)]:[];u.forEach(y=>{a&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=d&&l?afe(d,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let x,g=c?Af(e):null;c&&v();function v(){const y=Af(e);g&&!NW(g,y)&&n(),g=y,x=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{a&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),m==null||m(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const ofe=Rhe,lfe=Ohe,cfe=Ehe,dfe=Dhe,ufe=Ahe,WL=khe,mfe=Phe,hfe=(e,t,n)=>{const s=new Map,a={platform:sfe,...n},i={...a.platform,_c:s};return Che(e,t,{...a,platform:i})};var ffe=typeof document<"u",pfe=function(){},p1=ffe?h.useLayoutEffect:pfe;function fN(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,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!fN(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const i=a[s];if(!(i==="_owner"&&e.$$typeof)&&!fN(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function SW(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YL(e,t){const n=SW(e);return Math.round(t*n)/n}function Nk(e){const t=h.useRef(e);return p1(()=>{t.current=e}),t}function xfe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,m]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(s);fN(f,s)||p(s);const[x,g]=h.useState(null),[v,y]=h.useState(null),b=h.useCallback(M=>{M!==N.current&&(N.current=M,g(M))},[]),w=h.useCallback(M=>{M!==_.current&&(_.current=M,y(M))},[]),S=i||x,j=o||v,N=h.useRef(null),_=h.useRef(null),C=h.useRef(u),k=c!=null,E=Nk(c),R=Nk(a),T=Nk(d),D=h.useCallback(()=>{if(!N.current||!_.current)return;const M={placement:t,strategy:n,middleware:f};R.current&&(M.platform=R.current),hfe(N.current,_.current,M).then($=>{const I={...$,isPositioned:T.current!==!1};A.current&&!fN(C.current,I)&&(C.current=I,$d.flushSync(()=>{m(I)}))})},[f,t,n,R,T]);p1(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,m(M=>({...M,isPositioned:!1})))},[d]);const A=h.useRef(!1);p1(()=>(A.current=!0,()=>{A.current=!1}),[]),p1(()=>{if(S&&(N.current=S),j&&(_.current=j),S&&j){if(E.current)return E.current(S,j,D);D()}},[S,j,D,E,k]);const V=h.useMemo(()=>({reference:N,floating:_,setReference:b,setFloating:w}),[b,w]),U=h.useMemo(()=>({reference:S,floating:j}),[S,j]),O=h.useMemo(()=>{const M={position:n,left:0,top:0};if(!U.floating)return M;const $=YL(U.floating,u.x),I=YL(U.floating,u.y);return l?{...M,transform:"translate("+$+"px, "+I+"px)",...SW(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:I}},[n,l,U.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:D,refs:V,elements:U,floatingStyles:O}),[u,D,V,U,O])}const gfe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:a}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?WL({element:s.current,padding:a}).fn(n):{}:s?WL({element:s,padding:a}).fn(n):{}}}},vfe=(e,t)=>({...ofe(e),options:[e,t]}),yfe=(e,t)=>({...lfe(e),options:[e,t]}),bfe=(e,t)=>({...mfe(e),options:[e,t]}),wfe=(e,t)=>({...cfe(e),options:[e,t]}),jfe=(e,t)=>({...dfe(e),options:[e,t]}),Nfe=(e,t)=>({...ufe(e),options:[e,t]}),Sfe=(e,t)=>({...gfe(e),options:[e,t]});var _fe="Arrow",_W=h.forwardRef((e,t)=>{const{children:n,width:s=10,height:a=5,...i}=e;return r.jsx(ut.svg,{...i,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});_W.displayName=_fe;var Cfe=_W;function mw(e){const[t,n]=h.useState(void 0);return js(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var t5="Popper",[CW,Wc]=Ss(t5),[kfe,kW]=CW(t5),EW=e=>{const{__scopePopper:t,children:n}=e,[s,a]=h.useState(null);return r.jsx(kfe,{scope:t,anchor:s,onAnchorChange:a,children:n})};EW.displayName=t5;var AW="PopperAnchor",TW=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...a}=e,i=kW(AW,n),o=h.useRef(null),l=Ht(t,o);return h.useEffect(()=>{i.onAnchorChange((s==null?void 0:s.current)||o.current)}),s?null:r.jsx(ut.div,{...a,ref:l})});TW.displayName=AW;var r5="PopperContent",[Efe,Afe]=CW(r5),RW=h.forwardRef((e,t)=>{var G,ee,re,W,Q,L;const{__scopePopper:n,side:s="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:x,...g}=e,v=kW(r5,n),[y,b]=h.useState(null),w=Ht(t,te=>b(te)),[S,j]=h.useState(null),N=mw(S),_=(N==null?void 0:N.width)??0,C=(N==null?void 0:N.height)??0,k=s+(i!=="center"?"-"+i:""),E=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],T=R.length>0,D={padding:E,boundary:R.filter(Rfe),altBoundary:T},{refs:A,floatingStyles:V,placement:U,isPositioned:O,middlewareData:M}=xfe({strategy:"fixed",placement:k,whileElementsMounted:(...te)=>ife(...te,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[vfe({mainAxis:a+C,alignmentAxis:o}),c&&yfe({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?bfe():void 0,...D}),c&&wfe({...D}),jfe({...D,apply:({elements:te,rects:ae,availableWidth:ne,availableHeight:se})=>{const{width:ue,height:Ne}=ae.reference,Qe=te.floating.style;Qe.setProperty("--radix-popper-available-width",`${ne}px`),Qe.setProperty("--radix-popper-available-height",`${se}px`),Qe.setProperty("--radix-popper-anchor-width",`${ue}px`),Qe.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),S&&Sfe({element:S,padding:l}),Ofe({arrowWidth:_,arrowHeight:C}),f&&Nfe({strategy:"referenceHidden",...D})]}),[$,I]=DW(U),B=Dn(x);js(()=>{O&&(B==null||B())},[O,B]);const K=(G=M.arrow)==null?void 0:G.x,Z=(ee=M.arrow)==null?void 0:ee.y,q=((re=M.arrow)==null?void 0:re.centerOffset)!==0,[H,X]=h.useState();return js(()=>{y&&X(window.getComputedStyle(y).zIndex)},[y]),r.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:O?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(W=M.transformOrigin)==null?void 0:W.x,(Q=M.transformOrigin)==null?void 0:Q.y].join(" "),...((L=M.hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(Efe,{scope:n,placedSide:$,onArrowChange:j,arrowX:K,arrowY:Z,shouldHideArrow:q,children:r.jsx(ut.div,{"data-side":$,"data-align":I,...g,ref:w,style:{...g.style,animation:O?void 0:"none"}})})})});RW.displayName=r5;var OW="PopperArrow",Tfe={top:"bottom",right:"left",bottom:"top",left:"r
960ight"},PW=h.forwardRef(function(t,n){const{__scopePopper:s,...a}=t,i=Afe(OW,s),o=Tfe[i.placedSide];return r.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:r.jsx(Cfe,{...a,ref:n,style:{...a.style,display:"block"}})})});PW.displayName=OW;function Rfe(e){return e!==null}var Ofe=e=>({name:"transformOrigin",options:e,fn(t){var v,y,b;const{placement:n,rects:s,middlewareData:a}=t,o=((v=a.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=DW(n),m={start:"0%",center:"50%",end:"100%"}[u],f=(((y=a.arrow)==null?void 0:y.x)??0)+l/2,p=(((b=a.arrow)==null?void 0:b.y)??0)+c/2;let x="",g="";return d==="bottom"?(x=o?m:`${f}px`,g=`${-c}px`):d==="top"?(x=o?m:`${f}px`,g=`${s.floating.height+c}px`):d==="right"?(x=`${-c}px`,g=o?m:`${p}px`):d==="left"&&(x=`${s.floating.width+c}px`,g=o?m:`${p}px`),{data:{x,y:g}}}});function DW(e){const[t,n="center"]=e.split("-");return[t,n]}var hw=EW,fv=TW,fw=RW,pw=PW,[P_,Zat]=Ss("Tooltip",[Wc]),D_=Wc(),MW="TooltipProvider",Pfe=700,jT="tooltip.open",[Dfe,n5]=P_(MW),IW=e=>{const{__scopeTooltip:t,delayDuration:n=Pfe,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:i}=e,o=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),r.jsx(Dfe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};IW.displayName=MW;var Vb="Tooltip",[Mfe,M_]=P_(Vb),LW=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=n5(Vb,e.__scopeTooltip),d=D_(t),[u,m]=h.useState(null),f=ji(),p=h.useRef(0),x=o??c.disableHoverableContent,g=l??c.delayDuration,v=h.useRef(!1),[y,b]=Zs({prop:s,defaultProp:a??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(jT))):c.onClose(),i==null||i(_)},caller:Vb}),w=h.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,b(!0)},[b]),j=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),N=h.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,b(!0),p.current=0},g)},[g,b]);return h.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),r.jsx(hw,{...d,children:r.jsx(Mfe,{scope:t,contentId:f,open:y,stateAttribute:w,trigger:u,onTriggerChange:m,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:h.useCallback(()=>{x?j():(window.clearTimeout(p.current),p.current=0)},[j,x]),onOpen:S,onClose:j,disableHoverableContent:x,children:n})})};LW.displayName=Vb;var NT="TooltipTrigger",$W=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=M_(NT,n),i=n5(NT,n),o=D_(n),l=h.useRef(null),c=Ht(t,l,a.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),m=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),r.jsx(fv,{asChild:!0,...o,children:r.jsx(ut.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:c,onPointerMove:We(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:We(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:We(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});$W.displayName=NT;var Ife="TooltipPortal",[Qat,Lfe]=P_(Ife,{forceMount:void 0}),dg="TooltipContent",VW=h.forwardRef((e,t)=>
vendor: 3,031 bytes, line 960
960{const n=Lfe(dg,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...i}=e,o=M_(dg,e.__scopeTooltip);return r.jsx(_s,{present:s||o.open,children:o.disableHoverableContent?r.jsx(UW,{side:a,...i,ref:t}):r.jsx($fe,{side:a,...i,ref:t})})}),$fe=h.forwardRef((e,t)=>{const n=M_(dg,e.__scopeTooltip),s=n5(dg,e.__scopeTooltip),a=h.useRef(null),i=Ht(t,a),[o,l]=h.useState(null),{trigger:c,onClose:d}=n,u=a.current,{onPointerInTransitChange:m}=s,f=h.useCallback(()=>{l(null),m(!1)},[m]),p=h.useCallback((x,g)=>{const v=x.currentTarget,y={x:x.clientX,y:x.clientY},b=zfe(y,v.getBoundingClientRect()),w=qfe(y,b),S=Hfe(g.getBoundingClientRect()),j=Yfe([...w,...S]);l(j),m(!0)},[m]);return h.useEffect(()=>()=>f(),[f]),h.useEffect(()=>{if(c&&u){const x=v=>p(v,u),g=v=>p(v,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",g)}}},[c,u,p,f]),h.useEffect(()=>{if(o){const x=g=>{const v=g.target,y={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(v))||(u==null?void 0:u.contains(v)),w=!Wfe(y,o);b?f():w&&(f(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,o,d,f]),r.jsx(UW,{...e,ref:i})}),[Vfe,Ufe]=P_(Vb,{isInside:!1}),Ffe=pH("TooltipContent"),UW=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=M_(dg,n),d=D_(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(jT,u),()=>document.removeEventListener(jT,u)),[u]),h.useEffect(()=>{if(c.trigger){const m=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,u]),r.jsx(nu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:m=>m.preventDefault(),onDismiss:u,children:r.jsxs(fw,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(Ffe,{children:s}),r.jsx(Vfe,{scope:n,isInside:!0,children:r.jsx(bH,{id:c.contentId,role:"tooltip",children:a||s})})]})})});VW.displayName=dg;var FW="TooltipArrow",Bfe=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,a=D_(n);return Ufe(FW,n).isInside?null:r.jsx(pw,{...a,...s,ref:t})});Bfe.displayName=FW;function zfe(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,a,i)){case i:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function qfe(e,t,n=5){const s=[];
960switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function Hfe(e){const{top:t,right:n,bottom:s,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:s},{x:a,y:s}]}function Wfe(e,t){const{x:n,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,m=c.x,f=c.y;u>s!=f>s&&n<(m-d)*(s-u)/(f-u)+d&&(a=!a)}return a}function Yfe(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),Gfe(t)}function Gfe(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.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 Kfe=IW,Xfe=LW,BW=$W,zW=VW;/*! Capacitor: https://capacitorjs.com/ - MIT License */var ug;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ug||(ug={}));class Sk extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const Zfe=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},Qfe=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},s=n.Plugins=n.Plugins||{},a=()=>t!==null?t.name:Zfe(e),i=()=>a()!=="web",o=m=>{const f=d.get(m);return!!(f!=null&&f.platforms.has(a())||l(m))},l=m=>{var f;return(f=n.PluginHeaders)===null||f===void 0?void 0:f.find(p=>p.name===m)},c=m=>e.console.error(m),d=new Map,u=(m,f={})=>{const p=d.get(m);if(p)return console.warn(`Capacitor plugin "${m}" already registered. Cannot register plugins twice.`),p.proxy;const x=a(),g=l(m);let v;const y=async()=>(!v&&x in f?v=typeof f[x]=="function"?v=await f[x]():v=f[x]:t!==null&&!v&&"web"in f&&(v=typeof f.web=="function"?v=await f.web():v=f.web),v),b=(C,k)=>{var E,R;if(g){const T=g==null?void 0:g.methods.find(D=>k===D.name);if(T)return T.rtype==="promise"?D=>n.nativePromise(m,k.toString(),D):(D,A)=>n.nativeCallback(m,k.toString(),D,A);if(C)return(E=C[k])===null||E===void 0?void 0:E.bind(C)}else{if(C)return(R=C[k])===null||R===void 0?void 0:R.bind(C);throw new Sk(`"${m}" plugin is not implemented on ${x}`,ug.Unimplemented)}},w=C=>{let k;const E=(...R)=>{const T=y().then(D=>{const A=b(D,C);if(A){const V=A(...R);return k=V==null?void 0:V.remove,V}else throw new Sk(`"${m}.${C}()" is not implemented on ${x}`,ug.Unimplemented)});return C==="addListener"&&(T.remove=async()=>k()),T};return E.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(E,"name",{value:C,writable:!1,configurable:!1}),E},S=w("addListener"),j=w("removeListener"),N=(C,k)=>{const E=S({eventName:C},k),R=async()=>{const D=await E;j({eventName:C,callbackId:D},k)},T=new Promise(D=>E.then(()=>D({remove:R})));return T.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await R()},T},_=new Proxy({},{get(C,k){switch(k){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?N:S;case"removeListener":return j;default:return w(k)}}});return s[m]=_,d.set(m,{name:m,proxy:_,platforms:new Set([...Object.keys(f),...g?[x]:[]])}),_};return n.convertFileSrc||(n.convertFileSrc=m=>m),n.getPlatform=a,n.handleError=c,n.isNativePlatform=i,n.isPluginAvailable=o,n.registerPlugin=u,n.Exception=Sk,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},Jfe=e=>e.Capacitor=Qfe(e),Ic=Jfe(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),xw=Ic.registerPlugin;class s5{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const i=this.windowListeners[t];i&&!i.registered&&this.addWindowListener(i),s&&this.sendRetainedArgumentsForEvent(t);const o=async()=>this.removeListener(t,n);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const a=this.listeners[t];if(!a){if(s){let i=this.retainedEventArguments[t];i||(i=[]),i.push(n),this.retainedEventArguments[t]=i}return}
960a.forEach(i=>i(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new Ic.Exception(t,ug.Unimplemented)}unavailable(t="not available"){return new Ic.Exception(t,ug.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const a=s.indexOf(n);this.listeners[t].splice(a,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const GL=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),KL=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class epe extends s5{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[a,i]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=KL(a).trim(),i=KL(i).trim(),n[a]=i}),n}async setCookie(t){try{const n=GL(t.key),s=GL(t.value),a=`; expires=${(t.expires||"").replace("expires=","")}`,i=(t.path||"/").replace("path=",""),o=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${a}; path=${i}; ${o};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}xw("CapacitorCookies",{web:()=>new epe});const tpe=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const a=s.result;t(a.indexOf(",")>=0?a.split(",")[1]:a)},s.onerror=a=>n(a),s.readAsDataURL(e)}),rpe=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(a=>a.toLocaleLowerCase()).reduce((a,i,o)=>(a[i]=e[t[o]],a),{})},npe=(e,t=!0)=>e?Object.entries(e).reduce((s,a)=>{const[i,o]=a;let l,c;return Array.isArray(o)?(c="",o.forEach(d=>{l=t?encodeURIComponent(d):d,c+=`${i}=${l}&`}),c.slice(0,-1)):(l=t?encodeURIComponent(o):o,c=`${i}=${l}`),`${s}&${c}`},"").substr(1):null,spe=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),a=rpe(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(a.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[o,l]of Object.entries(e.data||{}))i.set(o,l);n.body=i.toString()}else if(a.includes("multipart/form-data")||e.data instanceof FormData){const i=new FormData;if(e.data instanceof FormData)e.data.forEach((l,c)=>{i.append(c,l)});else for(const l of Object.keys(e.data))i.append(l,e.data[l]);n.body=i;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(a.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class ape extends s5{async request(t){const n=spe(t,t.webFetchExtra),s=npe(t.params,t.shouldEncodeUrlParams),a=s?`${t.url}?${s}`:t.url,i=await fetch(a,n),o=i.headers.get("content-type")||"";let{responseType:l="text"}=i.ok?t:{};o.includes("application/json")&&(l="json");let c,d;switch(l){case"arraybuffer":case"blob":d=await i.blob(),c=await tpe(d);break;case"json":c=await i.json();break;case"document":case"text":default:c=await i.text()}const u={};return i.headers.forEach((m,f)=>{u[f]=m}),{data:c,headers:u,status:i.status,url:i.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}xw("CapacitorHttp",{web:()=>new ape});var XL;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(XL||(XL={}));var ZL;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(ZL||(ZL={}));class ipe extends s5{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}xw("SystemBars",{web:()=>new ipe});function _r(){return Ic.isNativePlatform()}const ope=Object.freeze(Object.defineProperty({__proto__:null,isNativeApp:_r},Symbol.toStringTag,{value:"Module"})),ys=({children:e,...t})=>_r()?r.jsx(r.Fragment,{children:e}):r.jsx(Kfe,{...t,children:e}),wt=({children:e,...t})=>_r()?r.jsx(r.Fragment,{children:e}):r.jsx(Xfe,{...t,children:e}),vt=h.forwardRef(({children:e,asChild:t,...n},s)=>_r()?t&&h.isValidElement(e)?e:r.jsx("span",{ref:s,...n,children:e}):r.jsx(BW,{ref:s,asChild:t,...n,children:e}));vt.displayName=BW.displayName;const yt=h.forwardRef(({className:e,sideOffset:t=4,...n},s)=>_r()?null:r.jsx(zW,{ref:s,sideOffset:t,className:ge("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]:sli
960de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));yt.displayName=zW.displayName;var pv=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(){}},Tf=typeof window>"u"||"Deno"in globalThis;function Ti(){}function lpe(e,t){return typeof e=="function"?e(t):e}function ST(e){return typeof e=="number"&&e>=0&&e!==1/0}function qW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _m(e,t){return typeof e=="function"?e(t):e}function Ho(e,t){return typeof e=="function"?e(t):e}function QL(e,t){const{type:n="all",exact:s,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(s){if(t.queryHash!==a5(o,t.options))return!1}else if(!Ub(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function JL(e,t){const{exact:n,status:s,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Rf(t.options.mutationKey)!==Rf(i))return!1}else if(!Ub(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||a&&!a(t))}function a5(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rf)(e)}function Rf(e){return JSON.stringify(e,(t,n)=>_T(n)?Object.keys(n).sort().reduce((s,a)=>(s[a]=n[a],s),{}):n)}function Ub(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ub(e[n],t[n])):!1}function HW(e,t){if(e===t)return e;const n=e$(e)&&e$(t);if(n||_T(e)&&_T(t)){const s=n?e:Object.keys(e),a=s.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{},c=new Set(s);let d=0;for(let u=0;u<o;u++){const m=n?u:i[u];(!n&&c.has(m)||n)&&e[m]===void 0&&t[m]===void 0?(l[m]=void 0,d++):(l[m]=HW(e[m],t[m]),l[m]===e[m]&&e[m]!==void 0&&d++)}return a===o&&d===a?e:l}return t}function pN(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 e$(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _T(e){if(!t$(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!t$(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function t$(e){return Object.prototype.toString.call(e)==="[object Object]"}function cpe(e){return new Promise(t=>{setTimeout(t,e)})}function CT(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?HW(e,t):t}function dpe(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function upe(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var i5=Symbol();function WW(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===i5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function YW(e,t){return typeof e=="function"?e(...t):!!e}var Jh,Ku,Mx,e9,mpe=(e9=class extends pv{constructor(){super();sr(this,Jh);sr(this,Ku);sr(this,Mx);Et(this,Mx,t=>{if(!Tf&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){he(this,Ku)||this.setEventListener(he(this,Mx))}onUnsubscribe(){var t;this.hasListeners()||((t=he(this,Ku))==null||t.call(this),Et(this,Ku,void 0))}setEventListener(t){var n;Et(this,Mx,t),(n=he(this,Ku))==null||n.call(this),Et(this,Ku,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){he(this,Jh)!==t&&(Et(this,Jh,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof he(this,Jh)=="boolean"?he(this,Jh):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jh=new WeakMap,Ku=new WeakMap,Mx=new WeakMap,e9),o5=new mpe,Ix,Xu,Lx,t9,hpe=(t9=class extends pv{constructor(){super();sr(this,Ix,!0);sr(this,Xu);sr(this,Lx);Et(this,Lx,t=>{if(!Tf&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){he(this,Xu)||this.setEventListener(he(this,Lx))}onUnsubscribe(){var t;this.hasListeners()||((t=he(this,Xu))==null||t.call(this),Et(this,Xu,void 0))}setEventListener(t){var n;Et(this,Lx,t),(n=he(this,Xu))==null||n.call(this),Et(this,Xu,t(this.setOnline.bind(this)))}setOnline(t){he(this,Ix)!==t&&(Et(this,Ix,t),this.listeners.forEac
vendor: 32,059 bytes, line 960
960h(s=>{s(t)}))}isOnline(){return he(this,Ix)}},Ix=new WeakMap,Xu=new WeakMap,Lx=new WeakMap,t9),xN=new hpe;function kT(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function s(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},n.reject=a=>{s({status:"rejected",reason:a}),t(a)},n}function fpe(e){return Math.min(1e3*2**e,3e4)}function GW(e){return(e??"online")==="online"?xN.isOnline():!0}var KW=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function _k(e){return e instanceof KW}function XW(e){let t=!1,n=0,s=!1,a;const i=kT(),o=g=>{var v;s||(f(new KW(g)),(v=e.abort)==null||v.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>o5.isFocused()&&(e.networkMode==="always"||xN.isOnline())&&e.canRun(),u=()=>GW(e.networkMode)&&e.canRun(),m=g=>{var v;s||(s=!0,(v=e.onSuccess)==null||v.call(e,g),a==null||a(),i.resolve(g))},f=g=>{var v;s||(s=!0,(v=e.onError)==null||v.call(e,g),a==null||a(),i.reject(g))},p=()=>new Promise(g=>{var v;a=y=>{(s||d())&&g(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;a=void 0,s||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(s)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(m).catch(y=>{var N;if(s)return;const b=e.retry??(Tf?0:3),w=e.retryDelay??fpe,S=typeof w=="function"?w(n,y):w,j=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,y);if(t||!j){f(y);return}n++,(N=e.onFail)==null||N.call(e,n,y),cpe(S).then(()=>d()?void 0:p()).then(()=>{t?f(y):x()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?x():p().then(x),i)}}var ppe=e=>setTimeout(e,0);function xpe(){let e=[],t=0,n=l=>{l()},s=l=>{l()},a=ppe;const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{s(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{a=l}}}var Ra=xpe(),ef,r9,ZW=(r9=class{constructor(){sr(this,ef)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ST(this.gcTime)&&Et(this,ef,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tf?1/0:5*60*1e3))}clearGcTimeout(){he(this,ef)&&(clearTimeout(he(this,ef)),Et(this,ef,void 0))}},ef=new WeakMap,r9),$x,tf,zo,rf,pi,W0,nf,Pl,fd,n9,gpe=(n9=class extends ZW{constructor(t){super();sr(this,Pl);sr(this,$x);sr(this,tf);sr(this,zo);sr(this,rf);sr(this,pi);sr(this,W0);sr(this,nf);Et(this,nf,!1),Et(this,W0,t.defaultOptions),this.setOptions(t.options),this.observers=[],Et(this,rf,t.client),Et(this,zo,he(this,rf).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Et(this,$x,vpe(this.options)),this.state=t.state??he(this,$x),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=he(this,pi))==null?void 0:t.promise}setOptions(t){this.options={...he(this,W0),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&he(this,zo).remove(this)}setData(t,n){const s=CT(this.state.data,t,this.options);return Ur(this,Pl,fd).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t,n){Ur(this,Pl,fd).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var s,a;const n=(s=he(this,pi))==null?void 0:s.promise;return(a=he(this,pi))==null||a.cancel(t),n?n.then(Ti).catch(Ti):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(he(this,$x))}isActive(){return this.observers.some(t=>Ho(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i5||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>_m(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:!qW(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=he(this,pi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=he(this,pi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),he(this,zo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(he(this,pi)&&(he(this,nf)?he(this,pi).cancel({revert:!0}):he(this,pi).cancelRetry()),this.scheduleGc()),he(this,zo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ur(this,Pl,fd).call(this,{type:"invalidate"})}fetch(t,n){var d,u,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(he(this,pi))return he(this,pi).continueRetry(),he(this,pi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Et(this,nf,!0),s.signal)})},i=()=>{const f=WW(this.options,n),x=(()=>{const g={client:he(this,rf),queryKey:this.queryKey,meta:this.meta};return a(g),g})();return Et(this,nf,!1),this.options.persister?this.options.persister(f,x,this):f(x)},l=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:he(this,rf),state:this.state,fetchFn:i};return a(f),f})();(d=this.options.behavior)==null||d.onFetch(l,this),Et(this,tf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&Ur(this,Pl,fd).call(this,{type:"fetch",meta:(m=l.fetchOptions)==null?void 0:m.meta});const c=f=>{var p,x,g,v;_k(f)&&f.silent||Ur(this,Pl,fd).call(this,{type:"error",error:f}),_k(f)||((x=(p=he(this,zo).config).onError)==null||x.call(p,f,this),(v=(g=he(this,zo).config).onSettled)==null||v.call(g,this.state.data,f,this)),this.scheduleGc()};return Et(this,pi,XW({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:s.abort.bind(s),onSuccess:f=>{var p,x,g,v;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){c(y);return}(x=(p=he(this,zo).config).onSuccess)==null||x.call(p,f,this),(v=(g=he(this,zo).config).onSettled)==null||v.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,p)=>{Ur(this,Pl,fd).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Ur(this,Pl,fd).call(this,{type:"pause"})},onContinue:()=>{Ur(this,Pl,fd).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),he(this,pi).start()}},$x=new WeakMap,tf=new WeakMap,zo=new WeakMap,rf=new WeakMap,pi=new WeakMap,W0=new WeakMap,nf=new WeakMap,Pl=new WeakSet,fd=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...QW(s.data,this.options),fetchMeta:t.meta??null};case"success":return Et(this,tf,void 0),{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return _k(a)&&a.revert&&he(this,tf)?{...he(this,tf),fetchStatus:"idle"}:{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),Ra.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),he(this,zo).notify({query:this,type:"updated",action:t})})},n9);function QW(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GW(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vpe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mc,s9,ype=(s9=class extends pv{constructor(t={}){super();sr(this,mc);this.config=t,Et(this,mc,new Map)}build(t,n,s){const a=n.queryKey,i=n.queryHash??a5(a,n);let o=this.get(i);return o||(o=new gpe({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){he(this,mc).has(t.queryHash)||(he(this,mc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=he(this,mc).get(t.queryHash);n&&(t.destroy(),n===t&&he(this,mc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ra.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return he(this,mc).get(t)}getAll(){return[...he(this,mc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>QL(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>QL(t,s)):n}notify(t){Ra.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ra.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ra.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mc=new WeakMap,s9),hc,ki,sf,fc,Ou,a9,bpe=(a9=class extends ZW{constructor(t){super();sr(this,fc);sr(this,hc);sr(this,ki);sr(this,sf);this.mutationId=t.mutationId,Et(this,ki,t.mutationCache),Et(this,hc,[]),this.state=t.state||JW(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){he(this,hc).includes(t)||(he(this,hc).push(t),this.clearGcTimeout(),he(this,ki).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Et(this,hc,he(this,hc).filter(n=>n!==t)),this.scheduleGc(),he(this,ki).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){he(this,hc).length||(this.state.status==="pending"?this.scheduleGc():he(this,ki).remove(this))}continue(){var t;return((t=he(this,sf))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,d,u,m,f,p,x,g,v,y,b,w,S,j,N,_,C;const n=()=>{Ur(this,fc,Ou).call(this,{type:"continue"})};Et(this,sf,XW({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,E)=>{Ur(this,fc,Ou).call(this,{type:"failed",failureCount:k,error:E})},onPause:()=>{Ur(this,fc,Ou).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>he(this,ki).canRun(this)}));const s=this.state.status==="pending",a=!he(this,sf).canStart();try{if(s)n();else{Ur(this,fc,Ou).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=he(this,ki).config).onMutate)==null?void 0:o.call(i,t,this));const E=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));E!==this.state.context&&Ur(this,fc,Ou).call(this,{type:"pending",context:E,variables:t,isPaused:a})}const k=await he(this,sf).start();return await((u=(d=he(this,ki).config).onSuccess)==null?void 0:u.call(d,k,t,this.state.context,this)),await((f=(m=this.options).onSuccess)==null?void 0:f.call(m,k,t,this.state.context)),await((x=(p=he(this,ki).config).onSettled)==null?void 0:x.call(p,k,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,k,null,t,this.state.context)),Ur(this,fc,Ou).call(this,{type:"success",data:k}),k}catch(k){try{throw await((b=(y=he(this,ki).config).onError)==null?void 0:b.call(y,k,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,k,t,this.state.context)),await((N=(j=he(this,ki).config).onSettled)==null?void 0:N.call(j,void 0,k,this.state.variables,this.state.context,this)),await((C=(_=this.options).onSettled)==null?void 0:C.call(_,void 0,k,t,this.state.context)),k}finally{Ur(this,fc,Ou).call(this,{type:"error",error:k})}}finally{he(this,ki).runNext(this)}}},hc=new WeakMap,ki=new WeakMap,sf=new WeakMap,fc=new WeakSet,Ou=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ra.batch(()=>{he(this,hc).forEach(s=>{s.onMutationUpdate(t)}),he(this,ki).notify({mutation:this,type:"updated",action:t})})},a9);function JW(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vd,Dl,Y0,i9,wpe=(i9=class extends pv{constructor(t={}){super();sr(this,vd);sr(this,Dl);sr(this,Y0);this.config=t,Et(this,vd,new Set),Et(this,Dl,new Map),Et(this,Y0,0)}build(t,n,s){const a=new bpe({mutationCache:this,mutationId:++Bw(this,Y0)._,options:t.defaultMutationOptions(n),state:s});return this.add(a),a}add(t){he(this,vd).add(t);const n=uj(t);if(typeof n=="string"){const s=he(this,Dl).get(n);s?s.push(t):he(this,Dl).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(he(this,vd).delete(t)){const n=uj(t);if(typeof n=="string"){const s=he(this,Dl).get(n);if(s)if(s.length>1){const a=s.indexOf(t);a!==-1&&s.splice(a,1)}else s[0]===t&&he(this,Dl).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=uj(t);if(typeof n=="string"){const s=he(this,Dl).get(n),a=s==null?void 0:s.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var s;const n=uj(t);if(typeof n=="string"){const a=(s=he(this,Dl).get(n))==null?void 0:s.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ra.batch(()=>{he(this,vd).forEach(t=>{this.notify({type:"removed",mutation:t})}),he(this,vd).clear(),he(this,Dl).clear()})}getAll(){return Array.from(he(this,vd))}find(t){const n={exact:!0,...t};return this.getAll().find(s=>JL(n,s))}findAll(t={}){return this.getAll().filter(n=>JL(t,n))}notify(t){Ra.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ra.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ti))))}},vd=new WeakMap,Dl=new WeakMap,Y0=new WeakMap,i9);function uj(e){var t;return(t=e.options.scope)==null?void 0:t.id}function r$(e){return{onFetch:(t,n)=>{var u,m,f,p,x;const s=t.options,a=(f=(m=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:m.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=WW(t.options,t.fetchOptions),b=async(w,S,j)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const _=(()=>{const R={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return v(R),R})(),C=await y(_),{maxPages:k}=t.options,E=j?upe:dpe;return{pages:E(w.pages,C,k),pageParams:E(w.pageParams,S,k)}};if(a&&i.length){const w=a==="backward",S=w?jpe:n$,j={pages:i,pageParams:o},N=S(s,j);l=await b(j,N,w)}else{const w=e??i.length;do{const S=c===0?o[0]??s.initialPageParam:n$(s,l);if(c>0&&S==null)break;l=await b(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function n$(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function jpe(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var Hs,Zu,Qu,Vx,Ux,Ju,Fx,Bx,o9,Npe=(o9=class{constructor(e={}){sr(this,Hs);sr(this,Zu);sr(this,Qu);sr(this,Vx);sr(this,Ux);sr(this,Ju);sr(this,Fx);sr(this,Bx);Et(this,Hs,e.queryCache||new ype),Et(this,Zu,e.mutationCache||new wpe),Et(this,Qu,e.defaultOptions||{}),Et(this,Vx,new Map),Et(this,Ux,new Map),Et(this,Ju,0)}mount(){Bw(this,Ju)._++,he(this,Ju)===1&&(Et(this,Fx,o5.subscribe(async e=>{e&&(await this.resumePausedMutations(),he(this,Hs).onFocus())})),Et(this,Bx,xN.subscribe(async e=>{e&&(await this.resumePausedMutations(),he(this,Hs).onOnline())})))}unmount(){var e,t;Bw(this,Ju)._--,he(this,Ju)===0&&((e=he(this,Fx))==null||e.call(this),Et(this,Fx,void 0),(t=he(this,Bx))==null||t.call(this),Et(this,Bx,void 0))}isFetching(e){return he(this,Hs).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return he(this,Zu).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=he(this,Hs).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=he(this,Hs).build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_m(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return he(this,Hs).findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),a=he(this,Hs).get(s.queryHash),i=a==null?void 0:a.state.data,o=lpe(t,i);if(o!==void 0)return he(this,Hs).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ra.batch(()=>he(this,Hs).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=he(this,Hs).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=he(this,Hs);Ra.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=he(this,Hs);return Ra.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ra.batch(()=>he(this,Hs).findAll(e).map(a=>a.cancel(n)));return Promise.all(s).then(Ti).catch(Ti)}invalidateQueries(e,t={}){return Ra.batch(()=>(he(this,Hs).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},s=Ra.batch(()=>he(this,Hs).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ti)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(Ti)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=he(this,Hs).build(this,t);return n.isStaleByTime(_m(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ti).catch(Ti)}fetchInfiniteQuery(e){return e.behavior=r$(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ti).catch(Ti)}ensureInfiniteQueryData(e){return e.behavior=r$(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xN.isOnline()?he(this,Zu).resumePausedMutations():Promise.resolve()}getQueryCache(){return he(this,Hs)}getMutationCache(){return he(this,Zu)}getDefaultOptions(){return he(this,Qu)}setDefaultOptions(e){Et(this,Qu,e)}setQueryDefaults(e,t){he(this,Vx).set(Rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...he(this,Vx).values()],n={};return t.forEach(s=>{Ub(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){he(this,Ux).set(Rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...he(this,Ux).values()],n={};return t.forEach(s=>{Ub(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...he(this,Qu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=a5(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===i5&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...he(this,Qu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){he(this,Hs).clear(),he(this,Zu).clear()}},Hs=new WeakMap,Zu=new WeakMap,Qu=new WeakMap,Vx=new WeakMap,Ux=new WeakMap,Ju=new WeakMap,Fx=new WeakMap,Bx=new WeakMap,o9),Hi,en,G0,Ei,af,zx,em,tm,K0,qx,Hx,of,lf,rm,Wx,Cn,Ty,ET,AT,TT,RT,OT,PT,DT,eY,l9,Spe=(l9=class extends pv{constructor(t,n){super();sr(this,Cn);sr(this,Hi);sr(this,en);sr(this,G0);sr(this,Ei);sr(this,af);sr(this,zx);sr(this,em);sr(this,tm);sr(this,K0);sr(this,qx);sr(this,Hx);sr(this,of);sr(this,lf);sr(this,rm);sr(this,Wx,new Set);this.options=n,Et(this,Hi,t),Et(this,tm,null),Et(this,em,kT()),this.options.experimental_prefetchInRender||he(this,em).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(he(this,en).addObserver(this),s$(he(this,en),this.options)?Ur(this,Cn,Ty).call(this):this.updateResult(),Ur(this,Cn,RT).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return MT(he(this,en),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return MT(he(this,en),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ur(this,Cn,OT).call(this),Ur(this,Cn,PT).call(this),he(this,en).removeObserver(this)}setOptions(t){const n=this.options,s=he(this,en);if(this.options=he(this,Hi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ho(this.options.enabled,he(this,en))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ur(this,Cn,DT).call(this),he(this,en).setOptions(this.options),n._defaulted&&!pN(this.options,n)&&he(this,Hi).getQueryCache().notify({type:"observerOptionsUpdated",query:he(this,en),observer:this});const a=this.hasListeners();a&&a$(he(this,en),s,this.options,n)&&Ur(this,Cn,Ty).call(this),this.updateResult(),a&&(he(this,en)!==s||Ho(this.options.enabled,he(this,en))!==Ho(n.enabled,he(this,en))||_m(this.options.staleTime,he(this,en))!==_m(n.staleTime,he(this,en)))&&Ur(this,Cn,ET).call(this);const i=Ur(this,Cn,AT).call(this);a&&(he(this,en)!==s||Ho(this.options.enabled,he(this,en))!==Ho(n.enabled,he(this,en))||i!==he(this,rm))&&Ur(this,Cn,TT).call(this,i)}getOptimisticResult(t){const n=he(this,Hi).getQueryCache().build(he(this,Hi),t),s=this.createResult(n,t);return Cpe(this,s)&&(Et(this,Ei,s),Et(this,zx,this.options),Et(this,af,he(this,en).state)),s}getCurrentResult(){return he(this,Ei)}trackResult(t,n){return new Proxy(t,{get:(s,a)=>(this.trackProp(a),n==null||n(a),Reflect.get(s,a))})}trackProp(t){he(this,Wx).add(t)}getCurrentQuery(){return he(this,en)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=he(this,Hi).defaultQueryOptions(t),s=he(this,Hi).getQueryCache().build(he(this,Hi),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(t){return Ur(this,Cn,Ty).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),he(this,Ei)))}createResult(t,n){var k;const s=he(this,en),a=this.options,i=he(this,Ei),o=he(this,af),l=he(this,zx),d=t!==s?t.state:he(this,G0),{state:u}=t;let m={...u},f=!1,p;if(n._optimisticResults){const E=this.hasListeners(),R=!E&&s$(t,n),T=E&&a$(t,s,n,a);(R||T)&&(m={...m,...QW(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:x,errorUpdatedAt:g,status:v}=m;p=m.data;let y=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let E;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(E=i.data,y=!0):E=typeof n.placeholderData=="function"?n.placeholderData((k=he(this,Hx))==null?void 0:k.state.data,he(this,Hx)):n.placeholderData,E!==void 0&&(v="success",p=CT(i==null?void 0:i.data,E,n),f=!0)}if(n.select&&p!==void 0&&!y)if(i&&p===(o==null?void 0:o.data)&&n.select===he(this,K0))p=he(this,qx);else try{Et(this,K0,n.select),p=n.select(p),p=CT(i==null?void 0:i.data,p,n),Et(this,qx,p),Et(this,tm,null)}catch(E){Et(this,tm,E)}he(this,tm)&&(x=he(this,tm),p=he(this,qx),g=Date.now(),v="error");const b=m.fetchStatus==="fetching",w=v==="pending",S=v==="error",j=w&&b,N=p!==void 0,C={status:v,fetchStatus:m.fetchStatus,isPending:w,isSuccess:v==="success",isError:S,isInitialLoading:j,isLoading:j,data:p,dataUpdatedAt:m.dataUpdatedAt,error:x,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:S&&!N,isPaused:m.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&N,isStale:l5(t,n),refetch:this.refetch,promise:he(this,em),isEnabled:Ho(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=D=>{C.status==="error"?D.reject(C.error):C.data!==void 0&&D.resolve(C.data)},R=()=>{const D=Et(this,em,C.promise=kT());E(D)},T=he(this,em);switch(T.status){case"pending":t.queryHash===s.queryHash&&E(T);break;case"fulfilled":(C.status==="error"||C.data!==T.value)&&R();break;case"rejected":(C.status!=="error"||C.error!==T.reason)&&R();break}}return C}updateResult(){const t=he(this,Ei),n=this.createResult(he(this,en),this.options);if(Et(this,af,he(this,en).state),Et(this,zx,this.options),he(this,af).data!==void 0&&Et(this,Hx,he(this,en)),pN(n,t))return;Et(this,Ei,n);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!he(this,Wx).size)return!0;const o=new Set(i??he(this,Wx));return this.options.throwOnError&&o.add("error"),Object.keys(he(this,Ei)).some(l=>{const c=l;return he(this,Ei)[c]!==t[c]&&o.has(c)})};Ur(this,Cn,eY).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ur(this,Cn,RT).call(this)}},Hi=new WeakMap,en=new WeakMap,G0=new WeakMap,Ei=new WeakMap,af=new WeakMap,zx=new WeakMap,em=new WeakMap,tm=new WeakMap,K0=new WeakMap,qx=new WeakMap,Hx=new WeakMap,of=new WeakMap,lf=new WeakMap,rm=new WeakMap,Wx=new WeakMap,Cn=new WeakSet,Ty=function(t){Ur(this,Cn,DT).call(this);let n=he(this,en).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ti)),n},ET=function(){Ur(this,Cn,OT).call(this);const t=_m(this.options.staleTime,he(this,en));if(Tf||he(this,Ei).isStale||!ST(t))return;const s=qW(he(this,Ei).dataUpdatedAt,t)+1;Et(this,of,setTimeout(()=>{he(this,Ei).isStale||this.updateResult()},s))},AT=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(he(this,en)):this.options.refetchInterval)??!1},TT=function(t){Ur(this,Cn,PT).call(this),Et(this,rm,t),!(Tf||Ho(this.options.enabled,he(this,en))===!1||!ST(he(this,rm))||he(this,rm)===0)&&Et(this,lf,setInterval(()=>{(this.options.refetchIntervalInBackground||o5.isFocused())&&Ur(this,Cn,Ty).call(this)},he(this,rm)))},RT=function(){Ur(this,Cn,ET).call(this),Ur(this,Cn,TT).call(this,Ur(this,Cn,AT).call(this))},OT=function(){he(this,of)&&(clearTimeout(he(this,of)),Et(this,of,void 0))},PT=function(){he(this,lf)&&(clearInterval(he(this,lf)),Et(this,lf,void 0))},DT=function(){const t=he(this,Hi).getQueryCache().build(he(this,Hi),this.options);if(t===he(this,en))return;const n=he(this,en);Et(this,en,t),Et(this,G0,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},eY=function(t){Ra.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(he(this,Ei))}),he(this,Hi).getQueryCache().notify({query:he(this,en),type:"observerResultsUpdated"})})},l9);function _pe(e,t){return Ho(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s$(e,t){return _pe(e,t)||e.state.data!==void 0&&MT(e,t,t.refetchOnMount)}function MT(e,t,n){if(Ho(t.enabled,e)!==!1&&_m(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&l5(e,t)}return!1}function a$(e,t,n,s){return(e!==t||Ho(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&l5(e,n)}function l5(e,t){return Ho(t.enabled,e)!==!1&&e.isStaleByTime(_m(t.staleTime,e))}function Cpe(e,t){return!pN(e.getCurrentResult(),t)}var nm,sm,Wi,yd,Ld,x1,IT,c9,kpe=(c9=class extends pv{constructor(n,s){super();sr(this,Ld);sr(this,nm);sr(this,sm);sr(this,Wi);sr(this,yd);Et(this,nm,n),this.setOptions(s),this.bindMethods(),Ur(this,Ld,x1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const s=this.options;this.options=he(this,nm).defaultMutationOptions(n),pN(this.options,s)||he(this,nm).getMutationCache().notify({type:"observerOptionsUpdated",mutation:he(this,Wi),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Rf(s.mutationKey)!==Rf(this.options.mutationKey)?this.reset():((a=he(this,Wi))==null?void 0:a.state.status)==="pending"&&he(this,Wi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=he(this,Wi))==null||n.removeObserver(this)}onMutationUpdate(n){Ur(this,Ld,x1).call(this),Ur(this,Ld,IT).call(this,n)}getCurrentResult(){return he(this,sm)}reset(){var n;(n=he(this,Wi))==null||n.removeObserver(this),Et(this,Wi,void 0),Ur(this,Ld,x1).call(this),Ur(this,Ld,IT).call(this)}mutate(n,s){var a;return Et(this,yd,s),(a=he(this,Wi))==null||a.removeObserver(this),Et(this,Wi,he(this,nm).getMutationCache().build(he(this,nm),this.options)),he(this,Wi).addObserver(this),he(this,Wi).execute(n)}},nm=new WeakMap,sm=new WeakMap,Wi=new WeakMap,yd=new WeakMap,Ld=new WeakSet,x1=function(){var s;const n=((s=he(this,Wi))==null?void 0:s.state)??JW();Et(this,sm,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},IT=function(n){Ra.batch(()=>{var s,a,i,o,l,c,d,u;if(he(this,yd)&&this.hasListeners()){const m=he(this,sm).variables,f=he(this,sm).context;(n==null?void 0:n.type)==="success"?((a=(s=he(this,yd)).onSuccess)==null||a.call(s,n.data,m,f),(o=(i=he(this,yd)).onSettled)==null||o.call(i,n.data,null,m,f)):(n==null?void 0:n.type)==="error"&&((c=(l=he(this,yd)).onError)==null||c.call(l,n.error,m,f),(u=(d=he(this,yd)).onSettled)==null||u.call(d,void 0,n.error,m,f))}
960this.listeners.forEach(m=>{m(he(this,sm))})})},c9),tY=h.createContext(void 0),c5=e=>{const t=h.useContext(tY);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Epe=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),r.jsx(tY.Provider,{value:e,children:t})),rY=h.createContext(!1),Ape=()=>h.useContext(rY);rY.Provider;function Tpe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rpe=h.createContext(Tpe()),Ope=()=>h.useContext(Rpe),Ppe=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Dpe=e=>{h.useEffect(()=>{e.clearReset()},[e])},Mpe=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||YW(n,[e.error,s])),Ipe=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>t(n(...s)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Lpe=(e,t)=>e.isLoading&&e.isFetching&&!t,$pe=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,i$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Vpe(e,t,n){var m,f,p,x,g;const s=Ape(),a=Ope(),i=c5(),o=i.defaultQueryOptions(e);(f=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||f.call(m,o),o._optimisticResults=s?"isRestoring":"optimistic",Ipe(o),Ppe(o,a),Dpe(a);const l=!i.getQueryCache().get(o.queryHash),[c]=h.useState(()=>new t(i,o)),d=c.getOptimisticResult(o),u=!s&&e.subscribed!==!1;if(h.useSyncExternalStore(h.useCallback(v=>{const y=u?c.subscribe(Ra.batchCalls(v)):Ti;return c.updateResult(),y},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setOptions(o)},[o,c]),$pe(o,d))throw i$(o,c,a);if(Mpe({result:d,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if((x=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||x.call(p,o,d),o.experimental_prefetchInRender&&!Tf&&Lpe(d,s)){const v=l?i$(o,c,a):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;v==null||v.catch(Ti).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function Upe(e,t){return Vpe(e,Spe)}function Ck(e,t){const n=c5(),[s]=h.useState(()=>new kpe(n,e));h.useEffect(()=>{s.setOptions(e)},[s,e]);const a=h.useSyncExternalStore(h.useCallback(o=>s.subscribe(Ra.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=h.useCallback((o,l)=>{s.mutate(o,l).catch(Ti)},[s]);if(a.error&&YW(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
961 * @remix-run/router v1.23.0
962 *
963 * Copyright (c) Remix Software Inc.
964 *
965 * This source code is licensed under the MIT license found in the
966 * LICENSE.md file in the root directory of this source tree.
967 *
968 * @license MIT
969 */function Fb(){return Fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fb.apply(this,arguments)}var um;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(um||(um={}));const o$="popstate";function Fpe(e){e===void 0&&(e={});function t(s,a){let{pathname:i,search:o,hash:l}=s.location;return LT("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(s,a){return typeof a=="string"?a:gN(a)}return zpe(t,n,null,e)}function Ls(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nY(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Bpe(){return Math.random().toString(36).substr(2,8)}function l$(e,t){return{usr:e.state,key:e.key,idx:t}}function LT(e,t,n,s){return n===void 0&&(n=null),Fb({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xv(t):t,{state:n,key:t&&t.key||s||Bpe()})}function gN(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function xv(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function zpe(e,t,n,s){s===void 0&&(s={});let{window:a=document.defaultView,v5Compat:i=!1}=s,o=a.history,l=um.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Fb({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function m(){l=um.Pop;
vendor: 3,541 bytes, line 969
969let v=u(),y=v==null?null:v-d;d=v,c&&c({action:l,location:g.location,delta:y})}function f(v,y){l=um.Push;let b=LT(g.location,v,y);d=u()+1;let w=l$(b,d),S=g.createHref(b);try{o.pushState(w,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:g.location,delta:1})}function p(v,y){l=um.Replace;let b=LT(g.location,v,y);d=u();let w=l$(b,d),S=g.createHref(b);o.replaceState(w,"",S),i&&c&&c({action:l,location:g.location,delta:0})}function x(v){let y=a.location.origin!=="null"?a.location.origin:a.location.href,b=typeof v=="string"?v:gN(v);return b=b.replace(/ $/,"%20"),Ls(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let g={get action(){return l},get location(){return e(a,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(o$,m),c=v,()=>{a.removeEventListener(o$,m),c=null}},createHref(v){return t(a,v)},createURL:x,encodeLocation(v){let y=x(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(v){return o.go(v)}};return g}var c$;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(c$||(c$={}));function qpe(e,t,n){return n===void 0&&(n="/"),Hpe(e,t,n,!1)}function Hpe(e,t,n,s){let a=typeof t=="string"?xv(t):t,i=mg(a.pathname||"/",n);if(i==null)return null;let o=sY(e);Wpe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=nxe(i);l=txe(o[c],d,s)}return l}function sY(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Ls(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let d=Cm([s,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(Ls(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),sY(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:Jpe(d,i.index),routesMeta:u})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of aY(i.path))a(i,o,c)}),t}function aY(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return a?[i,""]:[i];let o=aY(s.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Wpe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:exe(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Ype=/^:[\w-]+$/,Gpe=3,Kpe=2,Xpe=1,Zpe=10,Qpe=-2,d$=e=>e==="*";function Jpe(e,t){let n=e.split("/"),s=n.length;return n.some(d$)&&(s+=Qpe),t&&(s+=Kpe),n.filter(a=>!d$(a)).reduce((a,i)=>a+(Ype.test(i)?Gpe:i===""?Xpe:Zpe),s)}function exe(e,t){return e.length===t.length&&e.slice(0,-1).every((s,a)=>s===t[a])?e[e.length-1]-t[t.length-1]:0}function txe(e,t,n){let{routesMeta:s}=e,a={},i="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],d=l===s.length-1,u=i==="/"?t:t.slice(i.length)||"/",m=vN({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),f=c.route;if(!m&&d&&n&&!s[s.length-1].route.index&&(m=vN({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!m)return null;
vendor: 9,533 bytes, lines 969-978
969Object.assign(a,m.params),o.push({params:a,pathname:Cm([i,m.pathname]),pathnameBase:oxe(Cm([i,m.pathnameBase])),route:f}),m.pathnameBase!=="/"&&(i=Cm([i,m.pathnameBase]))}return o}function vN(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=rxe(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:s.reduce((d,u,m)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let g=l[m]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[m];return p&&!x?d[f]=void 0:d[f]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function rxe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),nY(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 s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),s]}function nxe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nY(!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 mg(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function sxe(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:a=""}=typeof e=="string"?xv(e):e;return{pathname:n?n.startsWith("/")?n:axe(n,t):t,search:lxe(s),hash:cxe(a)}}function axe(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 kk(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"].  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 ixe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function d5(e,t){let n=ixe(e);return t?n.map((s,a)=>a===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function u5(e,t,n,s){s===void 0&&(s=!1);let a;typeof e=="string"?a=xv(e):(a=Fb({},e),Ls(!a.pathname||!a.pathname.includes("?"),kk("?","pathname","search",a)),Ls(!a.pathname||!a.pathname.includes("#"),kk("#","pathname","hash",a)),Ls(!a.search||!a.search.includes("#"),kk("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let m=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),m-=1;a.pathname=f.join("/")}l=m>=0?t[m]:"/"}let c=sxe(a,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Cm=e=>e.join("/").replace(/\/\/+/g,"/"),oxe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lxe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cxe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function dxe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const iY=["post","put","patch","delete"];new Set(iY);const uxe=["get",...iY];new Set(uxe);/**
970 * React Router v6.30.1
971 *
972 * Copyright (c) Remix Software Inc.
973 *
974 * This source code is licensed under the MIT license found in the
975 * LICENSE.md file in the root directory of this source tree.
976 *
977 * @license MIT
978 */function Bb(){return Bb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Bb.apply(this,arguments)}const I_=h.createContext(null),oY=h.createContext(null),su=h.createContext(null),L_=h.createContext(null),au=h.createContext({outlet:null,matches:[],isDataRoute:!1}),lY=h.createContext(null);function mxe(e,t){let{relative:n}=t===void 0?{}:t;gv()||Ls(!1);let{basename:s,navigator:a}=h.useContext(su),{hash:i,pathname:o,search:l}=$_(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Cm([s,o])),a.createHref({pathname:c,search:l,hash:i})}function gv(){return h.useContext(L_)!=null}function ja(){return gv()||Ls(!1),h.useContext(L_).location}function cY(e){h.useContext(su).static||h.useLayoutEffect(e)}function Sr(){let{isDataRoute:e}=h.useContext(au);return e?_xe():hxe()}function hxe(){gv()||Ls(!1);let e=h.useContext(I_),{basename:t,future:n,navigator:s}=h.useContext(su),{matches:a}=h.useContext(au),{pathname:i}=ja(),o=JSON.stringify(d5(a,n.v7_relativeSplatPath)),l=h.useRef(!1);return cY(()=>{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){s.go(d);return}let m=u5(d,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Cm([t,m.pathname])),(u.replace?s.replace:s.push)(m,u.state,u)},[t,s,o,i,e])}function eh(){let{matches:e}=h.useContext(au),t=e[e.length-1];return t?t.params:{}}function $_(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=h.useContext(su),{matches:a}=h.useContext(au),{pathname:i}=ja(),o=JSON.stringify(d5(a,s.v7_relativeSplatPath));return h.useMemo(()=>u5(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function fxe(e,t){return pxe(e,t)}function pxe(e,t,n,s){gv()||Ls(!1);let{navigator:a}=h.useContext(su),{matches:i}=h.useContext(au),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=ja(),u;if(t){var m;let v=typeof t=="string"?xv(t):t;c==="/"||(m=v.pathname)!=null&&m.startsWith(c)||Ls(!1),u=v}else u=d;let f=u.pathname||"/",p=f;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=qpe(e,{pathname:p}),g=bxe(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Cm([c,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Cm([c,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,s);return t&&g?h.createElement(L_.Provider,{value:{location:Bb({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:um.Pop}},g):g}function xxe(){let e=Sxe(),t=dxe(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 h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:a},n):null,null)}const gxe=h.createElement(xxe,null);class vxe extends h.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?h.createElement(au.Provider,{value:this.props.routeContext},h.createElement(lY.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yxe(e){let{routeContext:t,match:n,children:s}=e,a=h.useContext(I_);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(au.Provider,{value:t},s)}function bxe(e,t,n,s){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let u=o.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);u>=0||Ls(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(n&&s&&s.v7_partialHydration)for(let u=0;u<o.length;u++){let m=o[u];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=u),m.route.id){let{loaderData:f,errors:p}=n,x=m.route.loader&&f[m.route.id]===void 0&&(!p||p[m.route.id]===void 0);if(m.route.lazy||x){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,m,f)=>{let p,x=!1,g=null,v=null;n&&(p=l&&m.route.id?l[m.route.id]:void 0,g=m.route.errorElement||gxe,c&&(d<0&&f===0?(x=!0,v=null):d===f&&(x=!0,v=m.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,f+1)),b=()=>{let w;return p?w=g:x?w=v:m.route.Component?w=h.createElement(m.route.Component,null):m.route.element?w=m.route.element:w=u,h.createElement(yxe,{match:m,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:w})};return n&&(m.route.ErrorBoundary||m.route.errorElement||f===0)?h.createElement(vxe,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:b(),routeC
978ontext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var dY=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(dY||{}),yN=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}(yN||{});function wxe(e){let t=h.useContext(I_);return t||Ls(!1),t}function jxe(e){let t=h.useContext(oY);return t||Ls(!1),t}function Nxe(e){let t=h.useContext(au);return t||Ls(!1),t}function uY(e){let t=Nxe(),n=t.matches[t.matches.length-1];return n.route.id||Ls(!1),n.route.id}function Sxe(){var e;let t=h.useContext(lY),n=jxe(yN.UseRouteError),s=uY(yN.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function _xe(){let{router:e}=wxe(dY.UseNavigateStable),t=uY(yN.UseNavigateStable),n=h.useRef(!1);return cY(()=>{n.current=!0}),h.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Bb({fromRouteId:t},i)))},[e,t])}function Cxe(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Of(e){let{to:t,replace:n,state:s,relative:a}=e;gv()||Ls(!1);let{future:i,static:o}=h.useContext(su),{matches:l}=h.useContext(au),{pathname:c}=ja(),d=Sr(),u=u5(t,d5(l,i.v7_relativeSplatPath),c,a==="path"),m=JSON.stringify(u);return h.useEffect(()=>d(JSON.parse(m),{replace:n,state:s,relative:a}),[d,m,a,n,s]),null}function dr(e){Ls(!1)}function kxe(e){let{basename:t="/",children:n=null,location:s,navigationType:a=um.Pop,navigator:i,static:o=!1,future:l}=e;gv()&&Ls(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:o,future:Bb({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof s=="string"&&(s=xv(s));let{pathname:u="/",search:m="",hash:f="",state:p=null,key:x="default"}=s,g=h.useMemo(()=>{let v=mg(u,c);return v==null?null:{location:{pathname:v,search:m,hash:f,state:p,key:x},navigationType:a}},[c,u,m,f,p,x,a]);return g==null?null:h.createElement(su.Provider,{value:d},h.createElement(L_.Provider,{children:n,value:g}))}function Exe(e){let{children:t,location:n}=e;return fxe($T(t),n)}new Promise(()=>{});function $T(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(s,a)=>{if(!h.isValidElement(s))return;let i=[...t,a];if(s.type===h.Fragment){n.push.apply(n,$T(s.props.children,i));return}s.type!==dr&&Ls(!1),!s.props.index||!s.props.children||Ls(!1);let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=$T(s.props.children,i)),n.push(o)}),n}/**
979 * React Router DOM v6.30.1
980 *
981 * Copyright (c) Remix Software Inc.
982 *
983 * This source code is licensed under the MIT license found in the
984 * LICENSE.md file in the root directory of this source tree.
985 *
986 * @license MIT
987 */function bN(){return bN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},bN.apply(this,arguments)}function mY(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Axe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Txe(e,t){return e.button===0&&(!t||t==="_self")&&!Axe(e)}function VT(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(a=>[n,a]):[[n,s]])},[]))}function Rxe(e,t){let n=VT(e);return t&&t.forEach((s,a)=>
987{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const Oxe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Pxe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Dxe="6";try{window.__reactRouterVersion=Dxe}catch{}const Mxe=h.createContext({isTransitioning:!1}),Ixe="startTransition",u$=MP[Ixe];function Lxe(e){let{basename:t,children:n,future:s,window:a}=e,i=h.useRef();i.current==null&&(i.current=Fpe({window:a,v5Compat:!0}));let o=i.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:d}=s||{},u=h.useCallback(m=>{d&&u$?u$(()=>c(m)):c(m)},[c,d]);return h.useLayoutEffect(()=>o.listen(u),[o,u]),h.useEffect(()=>Cxe(s),[s]),h.createElement(kxe,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const $xe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vxe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cr=h.forwardRef(function(t,n){let{onClick:s,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:m}=t,f=mY(t,Oxe),{basename:p}=h.useContext(su),x,g=!1;if(typeof d=="string"&&Vxe.test(d)&&(x=d,$xe))try{let w=new URL(window.location.href),S=d.startsWith("//")?new URL(w.protocol+d):new URL(d),j=mg(S.pathname,p);S.origin===w.origin&&j!=null?d=j+S.search+S.hash:g=!0}catch{}let v=mxe(d,{relative:a}),y=Bxe(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:m});function b(w){s&&s(w),w.defaultPrevented||y(w)}return h.createElement("a",bN({},f,{href:x||v,onClick:g||i?s:b,ref:n,target:c}))}),Uxe=h.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:a=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:d,children:u}=t,m=mY(t,Pxe),f=$_(c,{relative:m.relative}),p=ja(),x=h.useContext(oY),{navigator:g,basename:v}=h.useContext(su),y=x!=null&&zxe(f)&&d===!0,b=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,w=p.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(w=w.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&v&&(S=mg(S,v)||S);const j=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let N=w===b||!o&&w.startsWith(b)&&w.charAt(j)==="/",_=S!=null&&(S===b||!o&&S.startsWith(b)&&S.charAt(b.length)==="/"),C={isActive:N,isPending:_,isTransitioning:y},k=N?s:void 0,E;typeof i=="function"?E=i(C):E=[i,N?"active":null,_?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let R=typeof l=="function"?l(C):l;return h.createElement(Cr,bN({},m,{"aria-current":k,className:E,ref:n,style:R,to:c,viewTransition:d}),typeof u=="function"?u(C):u)});var UT;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(UT||(UT={}));var m$;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(m$||(m$={}));function Fxe(e){let t=h.useContext(I_);return t||Ls(!1),t}function Bxe(e,t){let{target:n,replace:s,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Sr(),d=ja(),u=$_(e,{relative:o});return h.useCallback(m=>{if(Txe(m,n)){m.preventDefault();let f=s!==void 0?s:gN(d)===gN(u);c(e,{replace:f,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,u,s,a,n,e,i,o,l])}function iu(e){let t=h.useRef(VT(e)),n=h.useRef(!1),s=ja(),a=h.useMemo(()=>Rxe(s.search,n.current?null:t.current),[s.search]),i=Sr(),o=h.useCallback((l,c)=>{const d=VT(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}function zxe(e,t){t===void 0&&(t={});let n=h.useContext(Mxe);n==null&&Ls(!1);let{basename:s}=Fxe(UT.useViewTransitionState),a=$_(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=mg(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=mg(n.nextLocation.pathname,s)||n.nextLocation.pathname;return vN(a.pathname,o)!=null||vN(a.pathname,i)!=null}var FT=function(e,t){return FT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])},FT(e,t)};function eit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");FT(e,t);function n(){this.constructor=e}
987e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var pc=function(){return pc=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},pc.apply(this,arguments)};function vv(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function qxe(e,t,n,s){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(s.next(u))}catch(m){o(m)}}function c(u){try{d(s.throw(u))}catch(m){o(m)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((s=s.apply(e,t||[])).next())})}function tit(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,a,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(d){return function(u){return c([d,u])}}function c(d){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(n=0)),n;)try{if(s=1,a&&(i=d[0]&2?a.return:d[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,d[1])).done)return i;switch(a=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){n.label=d[1];break}if(d[0]===6&&n.label<i[1]){n.label=i[1],i=d;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(d);break}i[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(u){d=[6,u],a=0}finally{s=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Hxe(e,t,n){if(n||arguments.length===2)for(var s=0,a=t.length,i;s<a;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}const Wxe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class m5 extends Error{constructor(t,n="FunctionsError",s){super(t),this.name=n,this.context=s}}class Yxe extends m5{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class h$ extends m5{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class f$ extends m5{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var BT;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(BT||(BT={}));class Gxe{constructor(t,{headers:n={},customFetch:s,region:a=BT.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=Wxe(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return qxe(this,arguments,void 0,function*(n,s={}){var a;let i,o;try{const{headers:l,method:c,body:d,signal:u,timeout:m}=s;let f={},{region:p}=s;p||(p=this.region);const x=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,x.searchParams.set("forceFunctionRegion",p));let g;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=d):typeof d=="string"?(f["Content-Type"]="text/plain",g=d):typeof FormData<"u"&&d instanceof FormData?g=d:(f["Content-Type"]="application/json",g=JSON.stringify(d)):g=d;let v=u;m&&(o=new AbortController,i=setTimeout(()=>o.abort(),m),u?(v=o.signal,u.addEventListener("abort",()=>o.abort())):v=o.signal);const y=yield this.fetch(x.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),l),body:g,signal:v}).catch(j=>{throw new Yxe(j)}),b=y.headers.get("x-relay-error");
987if(b&&b==="true")throw new h$(y);if(!y.ok)throw new f$(y);let w=((a=y.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield y.json():w==="application/octet-stream"||w==="application/pdf"?S=yield y.blob():w==="text/event-stream"?S=y:w==="multipart/form-data"?S=yield y.formData():S=yield y.text(),{data:S,error:null,response:y}}catch(l){return{data:null,error:l,response:l instanceof f$||l instanceof h$?l.context:void 0}}finally{i&&clearTimeout(i)}})}}var Kxe=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},Xxe=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const s=this.fetch;let a=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{let o=null,l=null,c=null,d=i.status,u=i.statusText;if(i.ok){var m,f;if(n.method!=="HEAD"){var p;const y=await i.text();y===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=y:l=JSON.parse(y))}const g=(m=n.headers.get("Prefer"))===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),v=(f=i.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");g&&v&&v.length>1&&(c=parseInt(v[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(l)&&(l.length>1?(o={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,d=406,u="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var x;const g=await i.text();try{o=JSON.parse(g),Array.isArray(o)&&i.status===404&&(l=[],o=null,d=200,u="OK")}catch{i.status===404&&g===""?(d=204,u="No Content"):o={message:g}}if(o&&n.isMaybeSingle&&(!(o==null||(x=o.details)===null||x===void 0)&&x.includes("0 rows"))&&(o=null,d=200,u="OK"),o&&n.shouldThrowOnError)throw new Kxe(o)}return{error:o,data:l,count:c,status:d,statusText:u}});return this.shouldThrowOnError||(a=a.catch(i=>{var o;let l="";const c=i==null?void 0:i.cause;if(c){var d,u,m,f;const x=(d=c==null?void 0:c.message)!==null&&d!==void 0?d:"",g=(u=c==null?void 0:c.code)!==null&&u!==void 0?u:"";l=`${(m=i==null?void 0:i.name)!==null&&m!==void 0?m:"FetchError"}: ${i==null?void 0:i.message}`,l+=`
988
989Caused by: ${(f=c==null?void 0:c.name)!==null&&f!==void 0?f:"Error"}: ${x}`,g&&(l+=` (${g})`),c!=null&&c.stack&&(l+=`
990${c.stack}`)}else{var p;l=(p=i==null?void 0:i.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:l,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),a.then(e,t)}returns(){return this}overrideTypes(){return this}},Zxe=class extends Xxe{select(e){let t=!1;const n=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:s,referencedTable:a=s}={}){const i=a?`${a}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const s=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:s=n}={}){const a=typeof s>"u"?"offset":`${s}.offset`,i=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
990explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:s=!1,wal:a=!1,format:i="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,s?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const p$=new RegExp("[,()]");var Vp=class extends Zxe{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(s=>typeof s=="string"&&p$.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(s=>typeof s=="string"&&p$.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:s}={}){let a="";s==="plain"?a="pl":s==="phrase"?a="ph":s==="websearch"&&(a="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${a}fts${i}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const s=n?`${n}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Qxe=class{constructor(e,{headers:t={},schema:n,fetch:s}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=s}select(e,t){const{head:n=!1,count:s}=t??{},a=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),s&&this.headers.append("Prefer",`count=${s}`),new Vp({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var s;const a="POST";if(t&&this.headers.append("Prefer",`count=${t}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const i=e.reduce((o,l)=>o.concat(Object.keys(l)),[]);if(i.length>
9900){const o=[...new Set(i)].map(l=>`"${l}"`);this.url.searchParams.set("columns",o.join(","))}}return new Vp({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:s,defaultToNull:a=!0}={}){var i;const o="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&this.url.searchParams.set("on_conflict",t),s&&this.headers.append("Prefer",`count=${s}`),a||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(l.length>0){const c=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",c.join(","))}}return new Vp({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(e,{count:t}={}){var n;const s="PATCH";return t&&this.headers.append("Prefer",`count=${t}`),new Vp({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var t;const n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new Vp({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},Jxe=class hY{constructor(t,{headers:n={},schema:s,fetch:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=s,this.fetch=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Qxe(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new hY(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:s=!1,get:a=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;s||a?(l=s?"HEAD":"GET",Object.entries(n).filter(([m,f])=>f!==void 0).map(([m,f])=>[m,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([m,f])=>{c.searchParams.append(m,f)})):(l="POST",d=n);const u=new Headers(this.headers);return i&&u.set("Prefer",`count=${i}`),new Vp({method:l,url:c,headers:u,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};class ege{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const s=n.node,a=parseInt(s.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
991import ws from "ws"
992new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
993
994Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const s=this.getWebSocketConstructor();return new s(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const tge="2.89.0",rge=`realtime-js/${tge}`,fY="1.0.0",nge="2.0.0",x$=fY,zT=1e4,sge=1e3,age=100;var Vu;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Vu||(Vu={}));var Aa;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Aa||(Aa={}));var Il;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Il||(Il={}));var qT;(function(e){e.websocket="websocket"})(qT||(qT={}));var Uh;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Uh||(Uh={}));class ige{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,s;const a=(s=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(t){var n,s;const a=(s=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&s!==void 0?s:{},o=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,s){var a,i;const o=t.topic,l=(a=t.ref)!==null&&a!==void 0?a:"",c=(i=t.join_ref)!==null&&i!==void 0?i:"",d=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},m=Object.keys(u).length===0?"":JSON.stringify(u);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+d.length+m.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let x=new DataView(p),g=0;x.setUint8(g++,this.KINDS.userBroadcastPush),x.setUint8(g++,c.length),x.setUint8(g++,l.length),x.setUint8(g++,o.length),x.setUint8(g++,d.length),x.setUint8(g++,m.length),x.setUint8(g++,n),Array.from(c,y=>
994x.setUint8(g++,y.charCodeAt(0))),Array.from(l,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(o,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(d,y=>x.setUint8(g++,y.charCodeAt(0))),Array.from(m,y=>x.setUint8(g++,y.charCodeAt(0)));var v=new Uint8Array(p.byteLength+s.byteLength);return v.set(new Uint8Array(p),0),v.set(new Uint8Array(s),p.byteLength),v.buffer}decode(t,n){if(this._isArrayBuffer(t)){let s=this._binaryDecode(t);return n(s)}if(typeof t=="string"){const s=JSON.parse(t),[a,i,o,l,c]=s;return n({join_ref:a,ref:i,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),s=n.getUint8(0),a=new TextDecoder;switch(s){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,a)}}_decodeUserBroadcast(t,n,s){const a=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const d=s.decode(t.slice(c,c+a));c=c+a;const u=s.decode(t.slice(c,c+i));c=c+i;const m=s.decode(t.slice(c,c+o));c=c+o;const f=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(s.decode(f)):f,x={type:this.BROADCAST_EVENT,event:u,payload:p};return o>0&&(x.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([s])=>n.includes(s)))}}class pY{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var ns;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(ns||(ns={}));const g$=(e,t,n={})=>{var s;const a=(s=n.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=oge(o,e,t,a),i),{}):{}},oge=(e,t,n,s)=>{const a=t.find(l=>
994l.name===e),i=a==null?void 0:a.type,o=n[e];return i&&!s.includes(i)?xY(i,o):HT(o)},xY=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return uge(t,n)}switch(e){case ns.bool:return lge(t);case ns.float4:case ns.float8:case ns.int2:case ns.int4:case ns.int8:case ns.numeric:case ns.oid:return cge(t);case ns.json:case ns.jsonb:return dge(t);case ns.timestamp:return mge(t);case ns.abstime:case ns.date:case ns.daterange:case ns.int4range:case ns.int8range:case ns.money:case ns.reltime:case ns.text:case ns.time:case ns.timestamptz:case ns.timetz:case ns.tsrange:case ns.tstzrange:return HT(t);default:return HT(t)}},HT=e=>e,lge=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},cge=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},dge=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},uge=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,s=e[n];if(e[0]==="{"&&s==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>xY(t,l))}return e},mge=e=>typeof e=="string"?e.replace(" ","T"):e,gY=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Ek{constructor(t,n,s={},a=zT){this.channel=t,this.event=n,this.payload=s,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var s;return this._hasReceived(t)&&n((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var v$;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(v$||(v$={}));class tb{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=tb.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=tb.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(s.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=tb.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,s,a){const i=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(i,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const m=i[d];if(m){const f=u.map(v=>v.presence_ref),p=m.map(v=>v.presence_ref),x=u.filter(v=>p.indexOf(v.presence_ref)<0),g=m.filter(v=>f.indexOf(v.presence_ref)<0);x.length>0&&(l[d]=x),g.length>0&&(c[d]=g)}else l[d]=u}),this.syncDiff(i,{joins:l,leaves:c},s,a)}static syncDiff(t,n,s,a){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return s||(s=()=>{}),a||(a=()=>{}),this.map(i,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const m=t[l].map(p=>p.presence_ref),f=u.filter(p=>m.indexOf(p.presence_ref)<0);t[l].unshift(...f)}s(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(m=>m.presence_ref);d=d.filter(m=>u.indexOf(m.presence_ref)<0),t[l]=d,a(l,d,c),d.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(s=>n(s,t[s]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,s)=>{const a=t[s];return"metas"in a?n[s]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[s]=a,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var y$;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(y$||(y$={}));var rb;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(rb||(rb={}));var pd;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(pd||(pd={}));class rx{constructor(t,n={config:{}},s){var a,i;if(this.topic=t,this.params=n,this.socket=s,this.bindings={},this.state=Aa.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Ek(this,Il.join,this.params,this.timeout),this.rejoinTimer=new pY(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Aa.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Aa.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Il.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new tb(this),this.broadcastEndpointURL=gY(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var s,a,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Aa.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,d=(a=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(p=>p.filter))!==null&&a!==void 0?a:[],u=!!this.bindings[rb.PRESENCE]&&this.bindings[rb.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,m={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:u}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(pd.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(pd.CLOSED)),this.updateJoinPayload(Object.assign({config:f},m)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var x;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(pd.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,v=(x=g==null?void 0:g.length)!==null&&x!==void 0?x:0,y=[];for(let b=0;b<v;b++){const w=g[b],{filter:{event:S,schema:j,table:N,filter:_}}=w,C=p&&p[b];if(C&&C.event===S&&rx.isFilterValueEqual(C.schema,j)&&rx.isFilterValueEqual(C.table,N)&&rx.isFilterValueEqual(C.filter,_))y.push(Object.assign(Object.assign({},w),{id:C.id}));else{this.unsubscribe(),this.state=Aa.errored,t==null||t(pd.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(pd.SUBSCRIBED);return}}).receive("error",p=>{this.state=Aa.errored,t==null||t(pd.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(pd.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,s){return this.state===Aa.joined&&t===rb.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,s)}async httpSend(t,n,s={}){var a;if(n==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(a=s.timeout)!==null&&a!==void 0?a:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
994try{const d=await l.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var s,a;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);return await((a=d.body)===null||a===void 0?void 0:a.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const d=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Aa.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Il.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(a=>{s=new Ek(this,Il.leave,{},t),s.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s==null||s.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Aa.closed,this.bindings={}}async _fetchWithTimeout(t,n,s){const a=new AbortController,i=setTimeout(()=>a.abort(),s),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),o}_push(t,n,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new Ek(this,t,n,s);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>age){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,s){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,s){var a,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=Il;if(s&&[l,c,d,u].indexOf(o)>=0&&s!==this._joinRef())return;let f=this._onMessage(o,n,s);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(p=>{var x,g,v;return((x=p.filter)===null||x===void 0?void 0:x.event)==="*"||((v=(g=p.filter)===null||g===void 0?void 0:g.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===o}).map(p=>p.callback(f,s)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var x,g,v,y,b,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const S=p.id,j=(x=p.filter)===null||x===void 0?void 0:x.event;return S&&((g=n.ids)===null||g===void 0?void 0:g.includes(S))&&(j==="*"||(j==null?void 0:j.toLocaleLowerCase())===((v=n.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const S=(b=(y=p==null?void 0:p.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return S==="*"||S===((w=n==null?void 0:n.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const x=f.data,{schema:g,table:v,commit_timestamp:y,type:b,errors:w}=x;f=Object.assign(Object.assign({},{schema:g,table:v,commit_timestamp:y,eventType:b,new:{},old:{},errors:w}),this._getPayloadRecords(x))}
994p.callback(f,s)})}_isClosed(){return this.state===Aa.closed}_isJoined(){return this.state===Aa.joined}_isJoining(){return this.state===Aa.joining}_isLeaving(){return this.state===Aa.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,s){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:s};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const s=t.toLocaleLowerCase();return this.bindings[s]&&(this.bindings[s]=this.bindings[s].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&rx.isEqual(a.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const s in t)if(t[s]!==n[s])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Il.close,{},t)}_onError(t){this._on(Il.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Aa.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=g$(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=g$(t.columns,t.old_record)),n}}const Ak=()=>{},mj={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},hge=[1e3,2e3,5e3,1e4],fge=1e4,pge=`
995  addEventListener("message", (e) => {
996    if (e.data.event === "start") {
997      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
998    }
999  });`;class xge{constructor(t,n){var s;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=zT,this.transport=null,this.heartbeatIntervalMs=mj.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Ak,this.ref=0,this.reconnectTimer=null,this.vsn=x$,this.logger=Ak,this.conn=null,this.sendBuffer=[],this.serializer=new ige,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=a=>a?(...i)=>a(...i):(...i)=>fetch(...i),!(!((s=n==null?void 0:n.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${qT.websocket}`,this.httpEndpoint=gY(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=ege.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
1000
1001To use Realtime in Node.js, you need to provide a WebSocket implementation:
1002
1003Option 1: Use Node.js 22+ which has native WebSocket support
1004Option 2: Install and provide the "ws" package:
1005
1006  npm install ws
1007
1008  import ws from "ws"
1009  const client = new RealtimeClient(url, {
1010    ...options,
1011    transport: ws
1012  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const s=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(s),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,s){this.logger(t,n,s)}connectionState(){switch(this.conn&&this.conn.readyState){case Vu.connecting:return Uh.Connecting;case Vu.open:return Uh.Open;case Vu.closing:return Uh.Closing;default:return Uh.Closed}}isConnected(){return this.connectionState()===Uh.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}
1012channel(t,n={config:{}}){const s=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===s);if(a)return a;{const i=new rx(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:s,payload:a,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${s} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(sge,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},mj.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(s=>s.topic===t&&(s._isJoined()||s._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(d){this.log("error","error in heartbeat callback",d)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:s,event:a,payload:i,ref:o}=n,l=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${s} ${a} ${l}`.trim(),i),this.channels.filter(d=>d._isMember(s)).forEach(d=>d._trigger(a,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===Vu.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Vu.open||this.conn.readyState===Vu.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}
1012_triggerChanError(){this.channels.forEach(t=>t._trigger(Il.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const s=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${s}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const s=new Blob([pge],{type:"application/javascript"});n=URL.createObjectURL(s)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,s=!1;if(t)n=t,s=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),n=this.accessTokenValue}else n=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(a=>{const i={access_token:n,version:rge};n&&a.updateJoinPayload(i),a.joinedOnce&&a._isJoined()&&a._push(Il.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(s=>{try{s(n)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(s){this.log("error",`error triggering ${t} callbacks`,s)}}_setupReconnectionTimer(){this.reconnectTimer=new pY(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},mj.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,s,a,i,o,l,c,d,u,m,f,p;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:zT,this.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:mj.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:Ak,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:x$,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:x=>hge[x-1]||fge,this.vsn){case fY:this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(x,g)=>g(JSON.stringify(x)),this.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:(x,g)=>g(JSON.parse(x));break;case nge:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var zb=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function gge(e,t,n){const s=new URL(t,e);if(n)for(const[a,i]of Object.entries(n))i!==void 0&&s.searchParams.set(a,i);return s.toString()}async function vge(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function yge(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:s,query:a,body:i,headers:o}){const l=gge(e.baseUrl,s,a),c=await vge(e.auth),d=await t(l,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),u=await d.text(),m=(d.headers.get("content-type")||"").includes("application/json"),f=m&&u?JSON.parse(u):u;if(!d.ok){const p=m?f:void 0,x=p==null?void 0:p.error;throw new zb((x==null?void 0:x.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:p})}return{status:d.status,headers:d.headers,data:f}}}}function hj(e){return e.join("�")}var bge=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:hj(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${hj(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${hj(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${hj(e.namespace)}`}),!0}catch(t){if(t instanceof zb&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof zb&&n.status===409)return;throw n}}};function vp(e){return e.join("�")}var wge=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${vp(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof zb&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof zb&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},jge=class{constructor(e){var s;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=yge({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(s=e.accessDelegation)==null?void 0:s.join(","),this.namespaceOps=new bge(this.client,t),this.tableOps=new wge(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
1012async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},V_=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function Ds(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Nge=class extends V_{constructor(e,t,n){super(e),this.name="StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},WT=class extends V_{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};const h5=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Sge=()=>Response,YT=e=>{if(Array.isArray(e))return e.map(n=>YT(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,s])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=YT(s)}),t},_ge=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cge=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function qb(e){"@babel/helpers - typeof";return qb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qb(e)}function kge(e,t){if(qb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(qb(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ege(e){var t=kge(e,"string");return qb(t)=="symbol"?t:t+""}function Age(e,t,n){return(t=Ege(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b$(Object(n),!0).forEach(function(s){Age(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b$(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}const Tk=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},Tge=async(e,t,n)=>{e instanceof await Sge()&&!(n!=null&&n.noResolveJson)?e.json().then(s=>{const a=e.status||500,i=(s==null?void 0:s.statusCode)||a+"";t(new Nge(Tk(s),a,i))}).catch(s=>{t(new WT(Tk(s),s))}):t(new WT(Tk(e),e))},Rge=(e,t,n,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!s?a:(_ge(s)?(a.headers=hr({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(s)):a.body=s,t!=null&&t.duplex&&(a.duplex=t.duplex),hr(hr({},a),n))};async function gw(e,t,n,s,a,i){return new Promise((o,l)=>{e(n,Rge(t,s,a,i)).then(c=>{if(!c.ok)throw c;return s!=null&&s.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>Tge(c,l,s))})}async function Hb(e,t,n,s){return gw(e,"GET",t,n,s)}async function Ol(e,t,n,s,a){return gw(e,"POST",t,s,a,n)}async function GT(e,t,n,s,a){return gw(e,"PUT",t,s,a,n)}async function Oge(e,t,n,s){return gw(e,"HEAD",t,hr(hr({},n),{},{noResolveJson:!0}),s)}async function f5(e,t,n,s,a){return gw(e,"DELETE",t,s,a,n)}var Pge=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ds(t))return{data:null,error:t};throw t}}};let vY;vY=Symbol.toStringTag;var Dge=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[vY]="BlobDownloadBuilder",this.promise=null}asStream(){return new Pge(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ds(t))return{data:null,error:t};throw t}}};const Mge={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},w$={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Ige=class{constructor(e,t={},n,s){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=n,this.fetch=h5(s)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,n,s){var a=this;try{let i;const o=hr(hr({},w$),s);let l=hr(hr({},a.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",a.encodeMetadata(c)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",a.encodeMetadata(c))):(i=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=a.toBase64(a.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers&&(l=hr(hr({},l),s.headers));const d=a._removeEmptyFolders(t),u=a._getFinalPath(d),m=await(e=="PUT"?GT:Ol)(a.fetch,`${a.url}/object/${u}`,i,hr({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:m.Id,fullPath:m.Key},error:null}}catch(i){if(a.shouldThrowOnError)throw i;if(Ds(i))return{data:null,error:i};throw i}}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,s){var a=this;const i=a._removeEmptyFolders(e),o=a._getFinalPath(i),l=new URL(a.url+`/object/upload/sign/${o}`);l.searchParams.set("token",t);try{let c;const d=hr({upsert:w$.upsert},s),u=hr(hr({},a.headers),{"x-upsert":String(d.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",d.cacheControl)):(c=n,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType),{data:{path:i,fullPath:(await GT(a.fetch,l.toString(),c,{headers:u})).Key},error:null}}catch(c){if(a.shouldThrowOnError)throw c;if(Ds(c))return{data:null,error:c};throw c}}async createSignedUploadUrl(e,t){var n=this;try{let s=n._getFinalPath(e);const a=hr({},n.headers);t!=null&&t.upsert&&(a["x-upsert"]="true");const i=await Ol(n.fetch,`${n.url}/object/upload/sign/${s}`,{},{headers:a}),o=new URL(n.url+i.url),l=o.searchParams.get("token");if(!l)throw new V_("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:l},error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(Ds(s))return{data:null,error:s};throw s}}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var s=this;try{return{data:await Ol(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,de
1012stinationBucket:n==null?void 0:n.destinationBucket},{headers:s.headers}),error:null}}catch(a){if(s.shouldThrowOnError)throw a;if(Ds(a))return{data:null,error:a};throw a}}async copy(e,t,n){var s=this;try{return{data:{path:(await Ol(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:s.headers})).Key},error:null}}catch(a){if(s.shouldThrowOnError)throw a;if(Ds(a))return{data:null,error:a};throw a}}async createSignedUrl(e,t,n){var s=this;try{let a=s._getFinalPath(e),i=await Ol(s.fetch,`${s.url}/object/sign/${a}`,hr({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:s.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${s.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(s.shouldThrowOnError)throw a;if(Ds(a))return{data:null,error:a};throw a}}async createSignedUrls(e,t,n){var s=this;try{const a=await Ol(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:t,paths:e},{headers:s.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:a.map(o=>hr(hr({},o),{},{signedUrl:o.signedURL?encodeURI(`${s.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(s.shouldThrowOnError)throw a;if(Ds(a))return{data:null,error:a};throw a}}download(e,t){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=s?`?${s}`:"",i=this._getFinalPath(e),o=()=>Hb(this.fetch,`${this.url}/${n}/${i}${a}`,{headers:this.headers,noResolveJson:!0});return new Dge(o,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);try{return{data:YT(await Hb(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})),error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Ds(s))return{data:null,error:s};throw s}}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await Oge(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Ds(s)&&s instanceof WT){const a=s.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),s=[],a=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";a!==""&&s.push(a);const i=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&s.push(o);let l=s.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}${l}`)}}}async remove(e){var t=this;try{return{data:await f5(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async list(e,t,n){var s=this;try{const a=hr(hr(hr({},Mge),t),{},{prefix:e||""});return{data:await Ol(s.fetch,`${s.url}/object/list/${s.bucketId}`,a,{headers:s.headers},n),error:null}}catch(a){if(s.shouldThrowOnError)throw a;if(Ds(a))return{data:null,error:a};throw a}}async listV2(e,t){var n=this;try{const s=hr({},e);return{data:await Ol(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,s,{headers:n.headers},t),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(Ds(s))return{data:null,error:s};throw s}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const yY="2.89.0",bY={"X-Client-Info":`storage-js/${yY}`};var Lge=class{constructor(e,t={},n,s){this.shouldThrowOnError=!1;const a=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=hr(hr({},bY),t),this.fetch=h5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{const n=t.listBucketOptionsToQueryString(e);return{data:await Hb(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async getBucket(e){var t=this;try{return{data:await Hb(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async createBucket(e,t={public:!1}){var n=this;try{return{data:await Ol(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(Ds(s))return{data:null,error:s};throw s}}async updateBucket(e,t){var n=this;try{return{data:await GT(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(Ds(s))return{data:null,error:s};throw s}}async emptyBucket(e){var t=this;try{return{data:await Ol(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await f5(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},$ge=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=hr(hr({},bY),t),this.fetch=h5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Ol(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async listBuckets(e){var t=this;try{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const s=n.toString(),a=s?`${t.url}/bucket?${s}`:`${t.url}/bucket`;return{data:await Hb(t.fetch,a,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await f5(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ds(n))return{data:null,error:n};throw n}}from(e){var t=this;if(!Cge(e))throw new V_("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new jge({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(n,{get(a,i){const o=a[i];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(a,l),error:null}}catch(c){if(s)throw c;return{data:null,error:c}}}}})}};const p5={"X-Client-Info":`storage-js/${yY}`,"Content-Type":"application/json"};
1012var wY=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function yo(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Rk=class extends wY{constructor(e,t,n){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Vge=class extends wY{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};const x5=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Uge=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},j$=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Fge=async(e,t,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const s=e.status||500,a=e;if(typeof a.json=="function")a.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||s+"";t(new Rk(j$(i),s,o))}).catch(()=>{const i=s+"";t(new Rk(a.statusText||`HTTP ${s} error`,s,i))});else{const i=s+"";t(new Rk(a.statusText||`HTTP ${s} error`,s,i))}}else t(new Vge(j$(e),e))},Bge=(e,t,n,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return s?(Uge(s)?(a.headers=hr({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(s)):a.body=s,hr(hr({},a),n)):a};async function zge(e,t,n,s,a,i){return new Promise((o,l)=>{e(n,Bge(t,s,a,i)).then(c=>{if(!c.ok)throw c;if(s!=null&&s.noResolveJson)return c;const d=c.headers.get("content-type");return!d||!d.includes("application/json")?{}:c.json()}).then(c=>o(c)).catch(c=>Fge(c,l,s))})}async function bo(e,t,n,s,a){return zge(e,"POST",t,s,a,n)}var qge=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=hr(hr({},p5),t),this.fetch=x5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async getIndex(e,t){var n=this;try{return{data:await bo(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(yo(s))return{data:null,error:s};throw s}}async listIndexes(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async deleteIndex(e,t){var n=this;try{return{data:await bo(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{},error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(yo(s))return{data:null,error:s};throw s}}},Hge=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=hr(hr({},p5),t),this.fetch=x5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await bo(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async getVectors(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await bo(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async queryVectors(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>
1012500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await bo(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}},Wge=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=hr(hr({},p5),t),this.fetch=x5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async getBucket(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async listBuckets(e={}){var t=this;try{return{data:await bo(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await bo(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(yo(n))return{data:null,error:n};throw n}}},Yge=class extends Wge{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Gge(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Gge=class extends qge{constructor(e,t,n,s){super(e,t,s),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Kge(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Kge=class extends Hge{constructor(e,t,n,s,a){super(e,t,a),this.vectorBucketName=n,this.indexName=s}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,hr(hr({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Xge=class extends Lge{constructor(e,t={},n,s){super(e,t,n,s)}from(e){return new Ige(this.url,this.headers,e,this.fetch)}get vectors(){return new Yge(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new $ge(this.url+"/iceberg",this.headers,this.fetch)}};const jY="2.89.0",Up=30*1e3,KT=3,Ok=KT*Up,Zge="http://localhost:9999",Qge="supabase.auth.token",Jge={"X-Client-Info":`gotrue-js/${jY}`},XT="X-Supabase-Api-Version",NY={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},eve=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,tve=10*60*1e3;class Wb extends Error{constructor(t,n,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=s}}function Jt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class rve extends Wb{constructor(t,n,s){super(t,n,s),this.name="AuthApiError",this.status=n,this.code=s}}function nve(e){return Jt(e)&&e.name==="AuthApiError"}class Fh extends Wb{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class ou extends Wb{constructor(t,n,s,a){super(t,s,a),this.name=n,this.status=s}}class uo extends ou{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function sve(e){return Jt(e)&&e.name==="AuthSessionMissingError"}class yp extends ou{constructor(){super("Auth session or user missing","AuthInvalidToken
1012ResponseError",500,void 0)}}class fj extends ou{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class pj extends ou{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function ave(e){return Jt(e)&&e.name==="AuthImplicitGrantRedirectError"}class N$ extends ou{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class ive extends ou{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class ZT extends ou{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Pk(e){return Jt(e)&&e.name==="AuthRetryableFetchError"}class S$ extends ou{constructor(t,n,s){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=s}}class QT extends ou{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const wN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),_$=` 	
1013\r=`.split(""),ove=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<_$.length;t+=1)e[_$[t].charCodeAt(0)]=-2;for(let t=0;t<wN.length;t+=1)e[wN[t].charCodeAt(0)]=t;return e})();function C$(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;n(wN[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;n(wN[s]),t.queuedBits-=6}}function SY(e,t,n){const s=ove[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function k$(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},s={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{dve(o,s,n)};for(let o=0;o<e.length;o+=1)SY(e.charCodeAt(o),a,i);return t.join("")}function lve(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function cve(e,t){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>55295&&s<=56319){const a=(s-55296)*1024&65535;s=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}lve(s,t)}}function dve(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let s=1;s<6;s+=1)if(!(e>>7-s&1)){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Cx(e){const t=[],n={queue:0,queuedBits:0},s=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)SY(e.charCodeAt(a),n,s);return new Uint8Array(t)}function uve(e){const t=[];return cve(e,n=>t.push(n)),new Uint8Array(t)}function qh(e){const t=[],n={queue:0,queuedBits:0},s=a=>{t.push(a)};return e.forEach(a=>C$(a,n,s)),C$(null,n,s),t.join("")}function mve(e){return Math.round(Date.now()/1e3)+e}function hve(){return Symbol("auth-callback")}const ri=()=>typeof window<"u"&&typeof document<"u",bh={tested:!1,writable:!1},_Y=()=>{if(!ri())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(bh.tested)return bh.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),bh.tested=!0,bh.writable=!0}catch{bh.tested=!0,bh.writable=!1}return bh.writable};function fve(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
1013h((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((s,a)=>{t[a]=s}),t}const CY=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),pve=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Fp=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},wh=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},ti=async(e,t)=>{await e.removeItem(t)};class U_{constructor(){this.promise=new U_.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}U_.promiseConstructor=Promise;function Dk(e){const t=e.split(".");if(t.length!==3)throw new QT("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!eve.test(t[s]))throw new QT("JWT not in base64url format");return{header:JSON.parse(k$(t[0])),payload:JSON.parse(k$(t[1])),signature:Cx(t[2]),raw:{header:t[0],payload:t[1]}}}async function xve(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function gve(e,t){return new Promise((s,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){s(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function vve(e){return("0"+e.toString(16)).substr(-2)}function yve(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*s));return a}return crypto.getRandomValues(t),Array.from(t,vve).join("")}async function bve(e){const n=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",n),a=new Uint8Array(s);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function wve(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await bve(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function bp(e,t,n=!1){const s=yve();let a=s;n&&(a+="/PASSWORD_RECOVERY"),await Fp(e,`${t}-code-verifier`,a);const i=await wve(s);return[i,s===i?"plain":"s256"]}const jve=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Nve(e){const t=e.headers.get(XT);if(!t||!t.match(jve))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function Sve(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function _ve(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Cve=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function wp(e){if(!Cve.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Mk(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const s=n.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function kve(e,t){return new Proxy(e,{get:(n,s,a)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const i=s.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,s,a)}return!t.value&&typeof s=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,s,a)}})}function E$(e){return JSON.parse(JSON.stringify(e))}const Ph=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Eve=[502,503,504];async function A$(e){var t;if(!pve(e))throw new ZT(Ph(e),0);if(Eve.includes(e.status))throw new ZT(Ph(e),e.status);let n;try{n=await e.json()}catch(i){throw new Fh(Ph(i),i)}let s;const a=Nve(e);
1013if(a&&a.getTime()>=NY["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?s=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(s=n.error_code),s){if(s==="weak_password")throw new S$(Ph(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new uo}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new S$(Ph(n),e.status,n.weak_password.reasons);throw new rve(Ph(n),e.status||500,s)}const Ave=(e,t,n,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(s),Object.assign(Object.assign({},a),n))};async function mr(e,t,n,s){var a;const i=Object.assign({},s==null?void 0:s.headers);i[XT]||(i[XT]=NY["2024-01-01"].name),s!=null&&s.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(a=s==null?void 0:s.query)!==null&&a!==void 0?a:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await Tve(e,t,n+l,{headers:i,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(c):{data:Object.assign({},c),error:null}}async function Tve(e,t,n,s,a,i){const o=Ave(t,s,a,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new ZT(Ph(c),0)}if(l.ok||await A$(l),s!=null&&s.noResolveJson)return l;try{return await l.json()}catch(c){await A$(c)}}function El(e){var t;let n=null;Pve(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=mve(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:s},error:null}}function T$(e){const t=El(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Yu(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function Rve(e){return{data:e,error:null}}function Ove(e){const{action_link:t,email_otp:n,hashed_token:s,redirect_to:a,verification_type:i}=e,o=vv(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:s,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function R$(e){return e}function Pve(e){return e.access_token&&e.refresh_token&&e.expires_in}const Ik=["global","local","others"];class Dve{constructor({url:t="",headers:n={},fetch:s}){this.url=t,this.headers=n,this.fetch=CY(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=Ik[0]){if(Ik.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ik.join(", ")}`);try{return await mr(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Jt(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,n={}){try{return await mr(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Yu})}catch(s){if(Jt(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:n}=t,s=vv(t,["options"]),a=Object.assign(Object.assign({},s),n);return"newEmail"in s&&(a.new_email=s==null?void 0:s.newEmail,delete a.newEmail),await mr(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:Ove,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Jt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await mr(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Yu})}catch(n){if(Jt(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,s,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await mr(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:R$});if(u.error)throw u.error;const m=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
10130&&(p.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(x.split(";")[1].split("=")[1]);d[`${v}Page`]=g}),d.total=parseInt(f)),{data:Object.assign(Object.assign({},m),d),error:null}}catch(d){if(Jt(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){wp(t);try{return await mr(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Yu})}catch(n){if(Jt(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){wp(t);try{return await mr(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Yu})}catch(s){if(Jt(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,n=!1){wp(t);try{return await mr(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Yu})}catch(s){if(Jt(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){wp(t.userId);try{const{data:n,error:s}=await mr(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:s}}catch(n){if(Jt(n))return{data:null,error:n};throw n}}async _deleteFactor(t){wp(t.userId),wp(t.id);try{return{data:await mr(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Jt(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,s,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await mr(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:R$});if(u.error)throw u.error;const m=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(x.split(";")[1].split("=")[1]);d[`${v}Page`]=g}),d.total=parseInt(f)),{data:Object.assign(Object.assign({},m),d),error:null}}catch(d){if(Jt(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await mr(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Jt(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await mr(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Jt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await mr(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(Jt(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(t){try{return await mr(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Jt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await mr(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Jt(n))return{data:null,error:n};throw n}}}function O$(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const jp={debug:!!(globalThis&&_Y()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class kY extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Mve extends kY{}async function Ive(e,t,n){jp.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;return t>0&&setTimeout(()=>{s.abort(),jp.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async a=>{if(a){jp.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{jp.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw jp.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Mve(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(jp.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}function Lve(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function EY(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
1013" is invalid.`);return e.toLowerCase()}function $ve(e){return parseInt(e,16)}function Vve(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function Uve(e){var t;const{chainId:n,domain:s,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:d,scheme:u,uri:m,version:f}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
1014`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=EY(e.address),x=u?`${u}://${s}`:s,g=e.statement?`${e.statement}
1015`:"",v=`${x} wants you to sign in with your Ethereum account:
1016${p}
1017
1018${g}`;let y=`URI: ${m}
1019Version: ${f}
1020Chain ID: ${n}${o?`
1021Nonce: ${o}`:""}
1022Issued At: ${i.toISOString()}`;if(a&&(y+=`
1023Expiration Time: ${a.toISOString()}`),l&&(y+=`
1024Not Before: ${l.toISOString()}`),c&&(y+=`
1025Request ID: ${c}`),d){let b=`
1026Resources:`;for(const w of d){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);b+=`
1027- ${w}`}y+=b}return`${v}
1028${y}`}
1028class ua extends Error{constructor({message:t,code:n,cause:s,name:a}){var i;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(i=a??(s instanceof Error?s.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class jN extends ua{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function Fve({error:e,options:t}){var n,s,a;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ua({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new ua({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ua({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new ua({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ua({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ua({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new ua({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ua({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(AY(o)){if(i.rp.id!==o)return new ua({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new ua({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Bve({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ua({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ua({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(AY(s)){if(n.rpId!==s)return new ua({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class zve{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const qve=new zve;function Hve(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:s}=e,a=vv(e,["challenge","user","excludeCredentials"]),i=Cx(t).buffer,o=Object.assign(Object.assign({},n),{id:Cx(n.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,user:o});if(s&&s.length>0){l.excludeCredentials=new Array(s.length);for(let c=0;c<s.length;c++){const d=s[c];l.excludeCredentials[c]=Object.assign(Object.assign({},d),{id:Cx(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function Wve(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,s=vv(e,["challenge","allowCredentials"]),a=Cx(t).buffer,i=Object.assign(Object.assign({}
1028,s),{challenge:a});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const l=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Cx(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function Yve(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:qh(new Uint8Array(e.response.attestationObject)),clientDataJSON:qh(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Gve(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,s=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:qh(new Uint8Array(a.authenticatorData)),clientDataJSON:qh(new Uint8Array(a.clientDataJSON)),signature:qh(new Uint8Array(a.signature)),userHandle:a.userHandle?qh(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function AY(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function P$(){var e,t;return!!(ri()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Kve(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new jN("Browser returned unexpected credential type",t)}:{data:null,error:new jN("Empty credential response",t)}}catch(t){return{data:null,error:Fve({error:t,options:e})}}}async function Xve(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new jN("Browser returned unexpected credential type",t)}:{data:null,error:new jN("Empty credential response",t)}}catch(t){return{data:null,error:Bve({error:t,options:e})}}}const Zve={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Qve={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function NN(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),n=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),s={};for(const a of e)if(a)for(const i in a){const o=a[i];if(o!==void 0)if(Array.isArray(o))s[i]=o;else if(n(o))s[i]=o;else if(t(o)){const l=s[i];t(l)?s[i]=NN(l,o):s[i]=NN(o)}else s[i]=o}return s}function Jve(e,t){return NN(Zve,e,t||{})}function eye(e,t){return NN(Qve,e,t||{})}class tye{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:s,signal:a},i){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!o)return{data:null,error:l};const c=a??qve.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;d.name||(d.name=`${d.id}:${s}`),d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=Jve(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:u,error:m}=await Kve({publicKey:d,signal:c});return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:m}}case"request":{const d=eye(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:u,error:m}=await Xve(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:c}));return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:m}}}}catch(o){return Jt(o)?{data:null,error:o}:{data:null,error:new Fh("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:n,webauthn:s}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!n)return{data:null,error:new Wb("rpId is required for WebAuthn authentication")};try{if(!P$())return{data:null,error:new Fh("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:s},signal:a},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:s,credential_response:c.credential_response}})}catch(o){return Jt(o)?{data:null,error:o}:{data:null,error:new Fh("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!n)return{data:null,error:new Wb("rpId is required for WebAuthn registration")};try{if(!P$())return{data:null,error:new Fh("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(u=>{var m;return(m=u.data)===null||m===void 0?void 0:m.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:s},signal:a},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:s,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:d}}catch(o){return Jt(o)?{data:null,error:o}:{data:null,error:new Fh("Unexpected error in register",o)}}}}Lve();const rye={url:Zge,storageKey:Qge,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Jge,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function D$(e,t,n){return await n()}const Np={};class Yb{get jwks(){var t,n;return(n=(t=Np[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Np[this.storageKey]=Object.assign(Object.assign({},Np[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Np[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Np[this.storageKey]=Object.assign(Object.assign({},Np[this.storageKey]),{cachedAt:t})}constructor(t){var n,s,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},rye),t);if(this.storageKey=i.storageKey,this.instanceID=(n=Yb.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Yb.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&ri()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new Dve({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=CY(i.fetch),this.lock=i.lock||D$,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:this.persistSession&&ri()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=Ive:this.lock=D$,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new tye(this)}
1028,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:_Y()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=O$(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=O$(this.memoryStorage)),ri()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${jY}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},s="none";if(ri()&&(n=fve(window.location.href),this._isImplicitGrantCallback(n)?s="implicit":await this._isPKCECallback(n)&&(s="pkce")),ri()&&this.detectSessionInUrl&&s!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),ave(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Jt(n)?this._returnResult({error:n}):this._returnResult({error:new Fh("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,s,a;try{const i=await mr(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:El}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(i){if(Jt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,s,a;try{let i;if("email"in t){const{email:u,password:m,options:f}=t;let p=null,x=null;this.flowType==="pkce"&&([p,x]=await bp(this.storage,this.storageKey)),i=await mr(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:m,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:x},xform:El})}else if("phone"in t){const{phone:u,password:m,options:f}=t;i=await mr(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:m,data:(s=f==null?void 0:f.data)!==null&&s!==void 0?s:{},channel:(a=f==null?void 0:f.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:El})}else throw new fj("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return await ti(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(i){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:l}=t;n=await mr(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:T$})}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await mr(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:T$})}else throw new fj("You must provide either an email or phone number and a password");const{data:s,error:a}=n;
1028if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!s||!s.session||!s.user){const i=new yp;return this._returnResult({data:{user:null,session:null},error:i})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:a})}catch(n){if(Jt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,s,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,s,a,i,o,l,c,d,u,m,f;let p,x;if("message"in t)p=t.message,x=t.signature;else{const{chain:g,wallet:v,statement:y,options:b}=t;let w;if(ri())if(typeof v=="object")w=v;else{const k=window;if("ethereum"in k&&typeof k.ethereum=="object"&&"request"in k.ethereum&&typeof k.ethereum.request=="function")w=k.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=v}const S=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),j=await w.request({method:"eth_requestAccounts"}).then(k=>k).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const N=EY(j[0]);let _=(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!_){const k=await w.request({method:"eth_chainId"});_=$ve(k)}const C={domain:S.host,address:N,statement:y,uri:S.href,version:"1",chainId:_,nonce:(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(o=(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.resources};p=Uve(C),x=await w.request({method:"personal_sign",params:[Vve(p),N]})}try{const{data:g,error:v}=await mr(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:x},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:El});if(v)throw v;if(!g||!g.session||!g.user){const y=new yp;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:v})}catch(g){if(Jt(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,s,a,i,o,l,c,d,u,m,f,p;let x,g;if("message"in t)x=t.message,g=t.signature;else{const{chain:v,wallet:y,statement:b,options:w}=t;let S;if(ri())if(typeof y=="object")S=y;else{const N=window;if("solana"in N&&typeof N.solana=="object"&&("signIn"in N.solana&&typeof N.solana.signIn=="function"||"signMessage"in N.solana&&typeof N.solana.signMessage=="function"))S=N.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const j=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const N=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),b?{statement:b}:null));let _;if(Array.isArray(N)&&N[0]&&typeof N[0]=="object")_=N[0];else if(N&&typeof N=="object"&&"signedMessage"in N&&"signature"in N)_=N;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)x=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),g=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${j.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(a=(s=w==null?void 0:w.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((d=w==null?void 0:w.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((m=(u=w==null?void 0:w.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||m===void 0)&&m.length?["Resources",...w.sign
1028InWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
1029`);const N=await S.signMessage(new TextEncoder().encode(x),"utf8");if(!N||!(N instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=N}}try{const{data:v,error:y}=await mr(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:qh(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:El});if(y)throw y;if(!v||!v.session||!v.user){const b=new yp;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:y})}catch(v){if(Jt(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const n=await wh(this.storage,`${this.storageKey}-code-verifier`),[s,a]=(n??"").split("/");try{if(!s&&this.flowType==="pkce")throw new ive;const{data:i,error:o}=await mr(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:El});if(await ti(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new yp;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:s,token:a,access_token:i,nonce:o}=t,l=await mr(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:El}),{data:c,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user){const u=new yp;return this._returnResult({data:{user:null,session:null},error:u})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:d})}catch(n){if(Jt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,s,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await bp(this.storage,this.storageKey));const{error:m}=await mr(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await mr(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u})}throw new fj("You must provide either an email or phone number.")}catch(l){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,s;try{let a,i;"options"in t&&(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:l}=await mr(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:El});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(Jt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var n,s,a,i,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await bp(this.storage,this.storageKey));const d=await mr(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&s!==void 0?s:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:Rve});return!((i=d.data)===null||i===void 0)&&i.url&&ri()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)throw s;if(!n)throw new uo;const{error:a}=await mr(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(Jt(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:s,type:a,options:i}=t,{error:o}=await mr(this.fetch,"POST",n,{headers:this.headers,body:{email:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:s,type:a,options:i}=t,{data:o,error:l}=await mr(this.fetch,"POST",n,{headers:this.headers,body:{phone:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new fj("You must provide either an email or phone number and a type")}catch(n){if(Jt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await s,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=n();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await wh(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
1029id"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<Ok:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const o=await wh(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Mk()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=kve(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(-1,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await mr(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Yu}):await this._useSession(async n=>{var s,a,i;const{data:o,error:l}=n;if(l)throw l;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new uo}:await mr(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:Yu})})}catch(n){if(Jt(n))return sve(n)&&(await this._removeSession(),await ti(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async s=>{const{data:a,error:i}=s;if(i)throw i;if(!a.session)throw new uo;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await bp(this.storage,this.storageKey));const{data:d,error:u}=await mr(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Yu});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(s){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new uo;const n=Date.now()/1e3;let s=n,a=!0,i=null;const{payload:o}=Dk(t.access_token);if(o.exp&&(s=o.exp,a=s<=n),a){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:s-n,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(Jt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var s;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new uo;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Jt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!ri())throw new pj("No browser detected.");
1029if(t.error||t.error_description||t.error_code)throw new pj(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new N$("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new pj("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new N$("No code detected.");const{data:b,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!i||!l||!o||!d)throw new pj("No session defined in URL");const u=Math.round(Date.now()/1e3),m=parseInt(l);let f=u+m;c&&(f=parseInt(c));const p=f-u;p*1e3<=Up&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${m}s`);const x=f-m;u-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,u):u-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,f,u);const{data:g,error:v}=await this._getUser(i);if(v)throw v;const y={provider_token:s,provider_refresh_token:a,access_token:i,expires_in:m,expires_at:f,refresh_token:o,token_type:d,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(s){if(Jt(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await wh(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var s;const{data:a,error:i}=n;if(i)return this._returnResult({error:i});const o=(s=a.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(nve(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await ti(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=hve(),s={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async n=>{var s,a;try{const{data:{session:i},error:o}=n;if(o)throw o;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let s=null,a=null;this.flowType==="pkce"&&([s,a]=await bp(this.storage,this.storageKey,!0));try{return await mr(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:s,error:a}=await this._useSession(async i=>{var o,l,c,d,u;const{data:m,error:f}=i;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await mr(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(d=m.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(a)throw a;return ri()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),this._returnResult({data:{provider:t.provider,url:s==null?void 0:s.url},error:null})}catch(s){if(Jt(s))return this._returnResult({data:{provider:t.provider,url:null},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var s;try{const{error:a,data:{session:i}}=n;
1029if(a)throw a;const{options:o,provider:l,token:c,access_token:d,nonce:u}=t,m=await mr(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=i==null?void 0:i.access_token)!==null&&s!==void 0?s:void 0,body:{provider:l,id_token:c,access_token:d,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:El}),{data:f,error:p}=m;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new yp}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(a){if(await ti(this.storage,`${this.storageKey}-code-verifier`),Jt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var s,a;const{data:i,error:o}=n;if(o)throw o;return await mr(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const s=Date.now();return await gve(async a=>(a>0&&await xve(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await mr(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:El})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Pk(i)&&Date.now()+o-s<Up})}catch(s){if(this._debug(n,"error",s),Jt(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",s),ri()&&!n.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,n;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const a=await wh(this.storage,this.storageKey);if(a&&this.userStorage){let o=await wh(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Fp(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Mk()}else if(a&&!a.user&&!a.user){const o=await wh(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await ti(this.storage,this.storageKey+"-user"),await Fp(this.storage,this.storageKey,a)):a.user=Mk()}if(this._debug(s,"session from storage",a),!this._isValidSession(a)){this._debug(s,"session is not valid"),a!==null&&await this._removeSession();return}const i=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Ok;if(this._debug(s,`session has${i?"":" not"} expired with margin of ${Ok}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),Pk(o)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(s,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(s,"error",a),console.error(a);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var n,s;if(!t)throw new uo;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new U_;
1029const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new uo;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={data:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),Jt(i)){const o={data:null,error:i};return Pk(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,n,s=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",n,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await ti(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),s=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&n.user&&await Fp(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const i=E$(a);await Fp(this.storage,this.storageKey,i)}else{const a=E$(n);await Fp(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ti(this.storage,this.storageKey),await ti(this.storage,this.storageKey+"-code-verifier"),await ti(this.storage,this.storageKey+"-user"),this.userStorage&&await ti(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ri()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Up);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:s}}=n;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((s.expires_at*1e3-t)/Up);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Up}ms, refresh threshold is ${KT} ticks`),a<=KT&&await this._callRefreshToken(s.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof kY)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ri()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>
1029{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,s){const a=[`provider=${encodeURIComponent(n)}`];if(s!=null&&s.redirectTo&&a.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&a.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await bp(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(s!=null&&s.queryParams){const i=new URLSearchParams(s.queryParams);a.push(i.toString())}return s!=null&&s.skipBrowserRedirect&&a.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;return i?this._returnResult({data:null,error:i}):await mr(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token})})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var s,a;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:d}=await mr(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return d?this._returnResult({data:null,error:d}):(t.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Yve(t.webauthn.credential_response):Gve(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await mr(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var s;const{data:a,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await mr(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:Hve(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:Wve(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:s}=await this._challenge({factorId:t.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:s}=await this.getUser();if(s)return{data:null,error:s};const a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var t,n;const{data:{session:s},error:a}
1029=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=Dk(s.access_token);let o=null;i.aal&&(o=i.aal);let l=o;((n=(t=s.user.factors)===null||t===void 0?void 0:t.filter(u=>u.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(l="aal2");const d=i.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;return a?this._returnResult({data:null,error:a}):s?await mr(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:s.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new uo})})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async s=>{const{data:{session:a},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new uo});const o=await mr(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&ri()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(s){if(Jt(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(t,n){try{return await this._useSession(async s=>{const{data:{session:a},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new uo});const o=await mr(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&ri()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(s){if(Jt(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;return s?this._returnResult({data:null,error:s}):n?await mr(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new uo})})}catch(t){if(Jt(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;return a?this._returnResult({data:null,error:a}):s?(await mr(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new uo})})}catch(n){if(Jt(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let s=n.keys.find(l=>l.kid===t);if(s)return s;const a=Date.now();if(s=this.jwks.keys.find(l=>l.kid===t),s&&this.jwks_cached_at+tve>a)return s;const{data:i,error:o}=await mr(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,s=i.keys.find(l=>l.kid===t),!s)?null:s}async getClaims(t,n={}){try{let s=t;if(!s){const{data:p,error:x}
1029=await this.getSession();if(x||!p.session)return this._returnResult({data:null,error:x});s=p.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Dk(s);n!=null&&n.allowExpired||Sve(i.exp);const d=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:p}=await this.getUser(s);if(p)throw p;return{data:{claims:i,header:a,signature:o},error:null}}const u=_ve(a.alg),m=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,m,o,uve(`${l}.${c}`)))throw new QT("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(s){if(Jt(s))return this._returnResult({data:null,error:s});throw s}}}Yb.nextInstanceID={};const nye=Yb,sye="2.89.0";let Ry="";typeof Deno<"u"?Ry="deno":typeof document<"u"?Ry="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ry="react-native":Ry="node";const aye={"X-Client-Info":`supabase-js-${Ry}/${sye}`},iye={headers:aye},oye={schema:"public"},lye={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},cye={};function Gb(e){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gb(e)}function dye(e,t){if(Gb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Gb(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uye(e){var t=dye(e,"string");return Gb(t)=="symbol"?t:t+""}function mye(e,t,n){return(t=uye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ws(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M$(Object(n),!0).forEach(function(s){mye(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M$(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}const hye=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),fye=()=>Headers,pye=(e,t,n)=>{const s=hye(n),a=fye();return async(i,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let d=new a(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),s(i,Ws(Ws({},o),{},{headers:d}))}};function xye(e){return e.endsWith("/")?e:e+"/"}function gye(e,t){var n,s;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:m}=t,f={db:Ws(Ws({},c),a),auth:Ws(Ws({},d),i),realtime:Ws(Ws({},u),o),storage:{},global:Ws(Ws(Ws({},m),l),{},{headers:Ws(Ws({},(n=m==null?void 0:m.headers)!==null&&n!==void 0?n:{}),(s=l==null?void 0:l.headers)!==null&&s!==void 0?s:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function vye(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(xye(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var yye=class extends nye{constructor(e){super(e)}},bye=class{constructor(e,t,n){var s,a;this.supabaseUrl=e,this.supabaseKey=t;const i=vye(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,l={db:oye,realtime:cye,auth:Ws(Ws({},lye),{},{storageKey:o}),global:iye},c=gye(n??{},l);if(this.storageKey=(s=c.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(u,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=c.auth)!==null&&d!==void 0?d:{},this.headers,c.global.fetch)}this.fetch=pye(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Ws({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&this.accessToken().then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new Jxe(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Xge(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Gxe(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
1029channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(t=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:s,userStorage:a,storageKey:i,flowType:o,lock:l,debug:c,throwOnError:d},u,m){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new yye({url:this.authUrl.href,headers:Ws(Ws({},f),u),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:s,userStorage:a,flowType:o,lock:l,debug:c,throwOnError:d,fetch:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new xge(this.realtimeUrl.href,Ws(Ws({},e),{},{params:Ws(Ws({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const wye=(e,t,n)=>new bye(e,t,n);function jye(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}jye()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function Nye(){var v,y;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(b=>e===b||e.endsWith("."+b)),s="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=n?((v=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+s+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((y=e.match(new RegExp("^("+s+")(?=[.-])","i")))==null?void 0:y[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),d=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",m=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(b,w,S)=>new Promise(j=>{const N=f();let _=!1,C;const k=T=>{_||(_=!0,clearTimeout(C),window.removeEventListener("message",E),j(T))},E=T=>{if(d.indexOf(T.origin)<0)return;const D=T.data;D&&D.type===u&&D.requestId===N&&k(D)};window.addEventListener("message",E);const R={type:b,requestId:N,projectId:a,key:w};S!==void 0&&(R.value=S);for(const T of d)window.parent.postMessage(R,T);C=setTimeout(()=>k(null),m)});let x=!0;const g=250;return{getItem:async b=>{let w=await p("lovable-preview-auth:get",b);return!w&&x&&(await new Promise(S=>setTimeout(S,g)),w=await p("lovable-preview-auth:get",b)),x=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(b),null):w.value:localStorage.getItem(b)},setItem:(b,w)=>(localStorage.setItem(b,w),p("lovable-preview-auth:set",b,w).then(S=>{S&&S.ok&&typeof S.value=="string"&&localStorage.getItem(b)===w&&(S.value===""?localStorage.removeItem(b):localStorage.setItem(b,S.value))})),removeItem:b=>(localStorage.removeItem(b),p("lovable-preview-auth:remove",b).then(()=>{}))}}const Sye="https://lmytxuxvkybtzkbdljha.supabase.co",_ye="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxteXR4dXh2a3lidHprYmRsamhhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjYwNzg1MDUsImV4cCI6MjA4MTY1NDUwNX0.EaGmm5FgmYqcSSnt2SIcRaQuoTB3p1u__C2Vz6DUs4E",F=wye(Sye,_ye,{auth:{storage:Nye(),persistSession:!0,autoRefreshToken:!0}}),Cye=Object.freeze(Object.defineProperty({__proto__:null,supabase:F},Symbol.toStringTag,{value:"Module"})),nx="lmaaoeofdlnjfenacdmdffepkniggkng";function kye(e,t){var n;if(!(typeof chrome>"u"||!((n=chrome==null?void 0:chrome.runtime)!=null&&n.sendMessage)||!nx))try{chrome.runtime.sendMessage(nx,{type:"SYNC_AUTH",accessToken:e??null,refreshToken:t??null,supabaseUrl:"https://lmytxuxvkybtzkbdljha.supabase.co",supabaseAnonKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxteXR4dXh2a3lidHprYmRsamhhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjYwNzg1MDUsImV4cCI6MjA4MTY1NDUwNX0.EaGmm5FgmYqcSSnt2SIcRaQuoTB3p1u__C2Vz6DUs4E"},()=>{chrome.runtime.lastError})}catch{}}function yv(){const[e,t]=h.useState(!1),[n,s]=h.useState(!0),a=h.useRef(!1),i=h.useCallback(()=>new Promise(c=>{var d;if(typeof chrome>"u"||!((d=chrome==null?void 0:chrome.runtime)!=null&&d.sendMessage)||!nx)return c(!1);try{const u=setTimeout(()=>c(!1),2e3);chrome.runtime.sendMessage(nx,{type:"PING"},m=>{if(clearTimeout(u),chrome.runtime.lastError)return c(!1);c((m==null?void 0:m.installed)===!0)})}catch{c(!1)}}),[]);h.useEffect(()=>{a.current||(a.current=!0,i().then(c=>{t(c),s(!1)}))},[i]);const o=h.useCallback(async()=>{s(!0);const c=await i();return t(c),s(!1),c},[i]),l=h.useCallback(async c=>!e||!nx?!1:new Promise(d=>{try{chrome.runtime.sendMessage(nx,{type:"START_SCREEN_RECORDING",mode:c.mode,accessToken:c.accessToken,refreshToken:c.refreshToken,micDeviceId:c.micDeviceId,videoDeviceId:c.videoDeviceId,watermark:c.watermark,supabaseUrl:"https://lmytxuxvkybtzkbdljha.supabase.co",supabaseAnonKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxteXR4dXh2a3lidHprYmRsamhhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjYwNzg1MDUsImV4cCI6MjA4MTY1NDUwNX0.EaGmm5FgmYqcSSnt2SIcRaQuoTB3p1u__C2Vz6DUs4E"},u=>{if(chrome.runtime.lastError){d(!1);return}d((u==null?void 0:u.success)===!0)})}catch{d(!1)}}),[e]);return{isExtensionAvailable:e,isChecking:n,startExtensionRecording:l,recheckExtension:o}}let g1=[];function Eye(e){return g1.push(e),()=>{g1=g1.filter(t=>t!==e)}}typeof window<"u"&&window.addEventListener("message",e=>{var t;((t=e.data)==null?void 0:t.type)==="VIDAREO_RECORDING_COMPLETE"&&g1.forEac
1029h(n=>n({videoId:e.data.videoId,shareUrl:e.data.shareUrl,title:e.data.title}))});function lr(){try{return Ic.isNativePlatform()&&Ic.getPlatform()==="ios"}catch{return!1}}function Aye(){return lr()}const g5="https://apps.apple.com/app/vidareo/id6764375498",Tye="https://play.google.com/store/search?q=vidareo&c=apps";function v5(){try{if(Ic.isNativePlatform()||typeof navigator>"u")return!1;const e=navigator.userAgent||"",t=/Macintosh/.test(e)&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1;return/iPhone|iPod|iPad|Android|Mobile|Tablet|Silk|Kindle|PlayBook|BB10|BlackBerry|Opera Mini|IEMobile/i.test(e)||t}catch{return!1}}function Rye(){try{if(Ic.isNativePlatform()||typeof navigator>"u")return!1;const e=navigator.userAgent||"",t=/iPhone|iPod|iPad/i.test(e),n=/Macintosh/.test(e)&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1;return t||n}catch{return!1}}function Oye(){return Rye()}const Pye="modulepreload",Dye=function(e){return"/"+e},I$={},Si=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=Dye(c),c in I$)return;I$[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Pye,d||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((f,p)=>{m.addEventListener("load",f),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},TY={pro_monthly:"com.vidareo.pro.monthly",pro_annual:"com.vidareo.pro.annual",addon_extended_video_30:"com.vidareo.addon.extendedvideo30.monthly.v2",addon_extended_video_60:"com.vidareo.addon.extendedvideo60.monthly.v2"},Mye="appl_bQaTszvwZVSPNCzTaCRngocKDEP";let Lk=null,JT=!1,v1=null;async function vw(){return lr()?(Lk||(Lk=Si(()=>import("./index-lti0ufq3.js"),[]).catch(e=>(console.error("[RevenueCat] Failed to load SDK",e),null))),Lk):null}async function Iye(e){const t=await vw();if(!t)return;const{Purchases:n,LOG_LEVEL:s}=t;try{JT?v1!==e&&(await n.logIn({appUserID:e}),v1=e):(await n.setLogLevel({level:s.WARN}),await n.configure({apiKey:Mye,appUserID:e}),JT=!0,v1=e)}catch(a){console.error("[RevenueCat] configure/logIn failed",a)}}async function Lye(){const e=await vw();if(!(!e||!JT))try{await e.Purchases.logOut(),v1=null}catch(t){console.warn("[RevenueCat] logOut",t)}}async function RY(){const e=await vw();if(!e)return null;try{return(await e.Purchases.getOfferings()).current??null}catch(t){return console.error("[RevenueCat] getOfferings failed",t),null}}let Sp=null;async function $ye(e=!1){var a,i;if(!lr())return{};if(Sp&&!e)return Sp;const t=await RY();if(!t)return Sp={},Sp;const n={},s=new Map;for(const o of t.availablePackages??[]){const l=(a=o.product)==null?void 0:a.priceString;(i=o.product)!=null&&i.identifier&&l&&s.set(o.product.identifier,l)}for(const[o,l]of Object.entries(TY)){const c=s.get(l);c&&(n[o]=c)}return Sp=n,Sp}class OY extends Error{constructor(t,n){super(`Product not in current RevenueCat offering: ${t}`),this.productIdentifier=t,this.availableIds=n,this.name="OfferingMissingProductError"}}async function Vye(e){const t=await vw();if(!t)throw new Error("IAP unavailable");const n=await RY(),s=n==null?void 0:n.availablePackages.find(i=>i.product.identifier===e);if(!s){const i=((n==null?void 0:n.availablePackages)??[]).map(o=>o.product.identifier);throw console.error("[RevenueCat] Product not in current offering",{requested:e,available:i}),new OY(e,i)}return await t.Purchases.purchasePackage({aPackage:s})}async function Uye(){const e=await vw();if(!e)throw new Error("IAP unavailable");return e.Purchases.restorePurchases()}const Fye="https://apps.apple.com/account/subscriptions",PY=h.createContext(void 0);function Bye({children:e}){const[t,n]=h.useState(null),[s,a]=h.useState(null),[i,o]=h.useState(!0),l=h.useRef(!1);h.useEffect(()=>{let m=!0,f=!1;const p=g=>{var v;m&&(a(g),n((g==null?void 0:g.user)??null),kye((g==null?void 0:g.access_token)??null,(g==null?void 0:g.refresh_token)??null),lr()&&((v=g==null?void 0:g.user)!=null&&v.id?Iye(g.user.id).catch(()=>{}):Lye().catch(()=>{})))},{data:{subscription:x}}=F.auth.onAuthStateChange((g,v)=>{(g==="TOKEN_REFRESHED"||g==="SIGNED_IN")&&(f=!0),v&&(f=!0),p(v),o(!1),g==="SIGNED_OUT"&&f&&!v&&(l.current?l.current=!1:setTimeout(async()=>{try{const{data:y}=await F.auth.getSession();if(y.session){p(y.session);return}}catch{}Pe.info("Your session has expired. Please sign in again.",{duration:6e3})},0))});return(async()=>{const{data:{session:g}}=await F.auth.getSession();if(!m)return;if(!g){p(null),o(!1);return}const{data:v,error:y}=await F.auth.getUser();if(m){if(y||!v.user){await F.auth.signOut(),p(null),o(!1);return}p(g),o(!1)}})(),()=>{m=!1,x.unsubscribe()}},[]);const c=async(m,f,p)=>{try{const{data:x,error:g}=await F.functions.invoke("signup-user",{body:{email:m,password:f,fullName:p}});return g?{error:new Error(g.message),user:null}:x!=null&&x.error?{error:new Error(x.error),user:null}:{error:null,user:x!=null&&x.user?{id:x.user.id,email:x.user.email}:null}}catch(x){return{error:new Error(x.message||"Signup failed"),user:null}}},d=async(m,f)=>{const{error:p}=await F.auth.signInWithPassword({email:m,password:f});return{error:p}},u=async()=>{l.current=!0,await F.auth.signOut()};return r.jsx(PY.Provider,{value:{user:t,session:s,loading:i,signUp:c,signIn:d,signOut:u},children:e})}function nr(){const e=h.useContext(PY);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const DY=h.createContext(void 0);function zye({children:e}){const{user:t}=nr(),[n,s]=h.useState(null),[a,i]=h.useState(null),o=h.useCallback(async(d,u)=>{if(!t){Pe.error("You must be logged in to impersonate users");return}try{const{data:m,error:f}=await F.from("profiles").select("user_id, email, full_name, avatar_url").eq("user_id",d).single();if(f)throw f;const{data:p,error:x}
1029=await F.from("admin_impersonation_logs").insert({admin_id:t.id,impersonated_user_id:d,reason:u||"Customer support"}).select("id").single();if(x)throw x;s({id:m.user_id,email:m.email,full_name:m.full_name,avatar_url:m.avatar_url}),i(p.id),Pe.success(`Now viewing as ${m.full_name||m.email}`)}catch(m){console.error("Error starting impersonation:",m),Pe.error("Failed to start impersonation")}},[t]),l=h.useCallback(async()=>{if(a)try{await F.from("admin_impersonation_logs").update({ended_at:new Date().toISOString()}).eq("id",a)}catch(d){console.error("Error updating impersonation log:",d)}s(null),i(null),Pe.success("Stopped impersonation - back to your account")},[a]),c=h.useCallback(async d=>{if(!n||!a)return null;try{const{data:u,error:m}=await F.functions.invoke("admin-view-user-data",{body:{targetUserId:n.id,dataType:d,impersonationLogId:a}});return m?(console.error("Error fetching impersonated data:",m),Pe.error("Failed to fetch data - impersonation session may be invalid"),null):u==null?void 0:u.data}catch(u){return console.error("Error in fetchImpersonatedData:",u),null}},[n,a]);return r.jsx(DY.Provider,{value:{isImpersonating:!!n,impersonatedUser:n,impersonationLogId:a,startImpersonation:o,stopImpersonation:l,fetchImpersonatedData:c},children:e})}function th(){const e=h.useContext(DY);if(e===void 0)throw new Error("useImpersonation must be used within an ImpersonationProvider");return e}const MY=h.createContext(null);function qye({children:e}){const[t,n]=h.useState(!1),[s,a]=h.useState(void 0),[i,o]=h.useState(!1),[l,c]=h.useState(!1),d=h.useRef(null),u=h.useCallback(g=>{a(g),n(!0)},[]),m=h.useCallback(()=>{n(!1),a(void 0),c(!1)},[]),f=h.useCallback(g=>{c(g)},[]),p=h.useCallback(g=>{d.current=g},[]),x=h.useCallback(g=>{var v;n(!1),a(void 0),c(!1),(v=d.current)==null||v.call(d,g)},[]);return h.useEffect(()=>Eye(g=>{var v,y;o(!1),(y=d.current)==null||y.call(d,{videoId:g.videoId,title:g.title,thumbnailUrl:null,videoUrl:"",duration:0,shareToken:((v=g.shareUrl)==null?void 0:v.split("/").pop())||null})}),[]),r.jsx(MY.Provider,{value:{isOpen:t,initialMode:s,extensionRecordingActive:i,isScreenRecording:l,openRecording:u,closeRecording:m,setScreenRecording:f,registerSaveHandler:p,onSaveComplete:x},children:e})}function bv(){const e=h.useContext(MY);if(!e)throw new Error("useRecording must be used within RecordingProvider");return e}const Hye=1,Wye="e453a553-4197-4562-971e-f85cf386f8d7",Yye="d9ab4435-9e2d-4855-a8a5-c5694de7ad03",Gye="/__l5e/assets-v1/e453a553-4197-4562-971e-f85cf386f8d7/ffmpeg-core.wasm",Kye="a/v1/d9ab4435-9e2d-4855-a8a5-c5694de7ad03/e453a553-4197-4562-971e-f85cf386f8d7/ffmpeg-core.wasm",Xye="ffmpeg-core.wasm",Zye=32232419,Qye="application/wasm",Jye="2026-07-05T19:11:34Z",$k={version:Hye,asset_id:Wye,project_id:Yye,url:Gye,r2_key:Kye,original_filename:Xye,size:Zye,content_type:Qye,created_at:Jye},IY=$k.url.startsWith("http")?$k.url:`https://vidareo.com${$k.url}`,LY=h.createContext({job:null,startProcessing:()=>{}}),$Y=()=>h.useContext(LY),VY="/ffmpeg",L$=`${VY}/worker.js`,ebe=["https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm","https://unpkg.com/@ffmpeg/[email protected]/dist/esm","https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm","https://unpkg.com/@ffmpeg/[email protected]/dist/esm"],tbe=3e4,$$=18e4,rbe=e=>{const t=e.split("?")[0].toLowerCase();return t.endsWith(".mp4")?"mp4":t.endsWith(".mov")||t.endsWith(".qt")?"mov":"webm"},nbe=e=>e==="webm"?{ext:"webm",mime:"video/webm"}:{ext:"mp4",mime:"video/mp4"},sbe=e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"unknown"}},V$=async(e,t,n,s)=>{let a;const i=new Promise((o,l)=>{a=setTimeout(()=>{n(),l(new Error(`${s} timed out. Please refresh and try again.`))},t)});try{return await Promise.race([e,i])}finally{a&&clearTimeout(a)}},abe=({children:e})=>{const[t,n]=h.useState(null),s=h.useRef(null),a=h.useCallback(async()=>{const[{FFmpeg:l},c]=await Promise.all([Si(()=>import("./index-BWXEABTF.js"),[]),Si(()=>import("./index-2s2JVvo1.js"),[])]),{toBlobURL:d,fetchFile:u}=c;if(s.current)return{ffmpeg:s.current,fetchFile:u};const m=new l;m.on("log",({message:x})=>{console.log("[ffmpeg]",x)});let f=null;const p=async(x,g,v,y)=>{const b=new AbortController;return await V$(m.load({coreURL:x,wasmURL:g,classWorkerURL:y},{signal:b.signal}),tbe,()=>{b.abort(),m.terminate()},v),s.current=m,m};try{const[x,g]=await Promise.all([d(`${VY}/ffmpeg-core.js`,"text/javascript"),d(IY,"application/wasm")]);return{ffmpeg:await p(x,g,"Loading the video editor",L$),fetchFile:u}}
1029catch(x){console.warn("[VideoProcessing] Local FFmpeg load failed, trying CDN fallback",x),f=x}for(const x of ebe)try{const[g,v]=await Promise.all([d(`${x}/ffmpeg-core.js`,"text/javascript"),d(`${x}/ffmpeg-core.wasm`,"application/wasm")]);return{ffmpeg:await p(g,v,"Loading the fallback video editor",L$),fetchFile:u}}catch(g){console.warn("[VideoProcessing] FFmpeg load failed from",x,g),f=g}throw new Error(`Could not load video editor: ${sbe(f)}`)},[]),i=h.useCallback(async(l,c,d,u,m)=>{var B,K;const f=async Z=>{if(m)try{await F.from("video_edit_jobs").update({...Z,updated_at:new Date().toISOString()}).eq("id",m)}catch(q){console.warn("[VideoProcessing] failed to update job row",q)}};n({videoTitle:l.title,progress:5,stage:"Loading editor…",serverSide:!1}),await f({stage:"Loading editor…",progress:5});const{ffmpeg:p,fetchFile:x}=await a();n({videoTitle:l.title,progress:15,stage:"Downloading video…",serverSide:!1}),await f({stage:"Downloading video…",progress:15});const g=await x(l.video_url),v=rbe(l.video_url),y=nbe(v),b=`input.${v}`;await p.writeFile(b,g);const w=async(Z,q)=>{const H=new AbortController,X=await V$(p.exec(Z,$$,{signal:H.signal}),$$+1e4,()=>{H.abort(),p.terminate(),s.current=null},q);if(typeof X=="number"&&X!==0)throw new Error(`${q} failed. Try a shorter edit or save this video as MP4 first.`)},S=c.reduce((Z,q)=>Z+(q.end-q.start),0)||1;let j=30,N=50;const _=({progress:Z})=>{const q=Math.max(0,Math.min(1,Z));n(H=>H&&{...H,progress:j+Math.round(q*N)})};(B=p.on)==null||B.call(p,"progress",_),n({videoTitle:l.title,progress:30,stage:"Copying edited sections…",serverSide:!1}),await f({stage:"Copying edited sections…",progress:30});const C=`output.${y.ext}`,k=["-map","0:v:0","-map","0:a:0?","-c","copy"],E=y.ext==="mp4"?["-avoid_negative_ts","make_zero","-movflags","+faststart"]:["-avoid_negative_ts","make_zero"];try{if(c.length===1){const Z=c[0];await w(["-ss",Z.start.toFixed(3),"-i",b,"-t",(Z.end-Z.start).toFixed(3),...k,...E,"-y",C],"Saving edited section")}else{const Z=[];let q=0;for(let X=0;X<c.length;X++){const G=c[X],ee=G.end-G.start;j=30+Math.round(q/S*40),N=Math.max(1,Math.round(ee/S*40));const re=`part${X}.${y.ext}`;await w(["-ss",G.start.toFixed(3),"-i",b,"-t",ee.toFixed(3),...k,...E,"-y",re],`Saving edited section ${X+1}`),Z.push(re),q+=ee,n({videoTitle:l.title,progress:30+Math.round(q/S*40),stage:`Trimmed segment ${X+1}/${c.length}`,serverSide:!1})}const H=Z.map(X=>`file '${X}'`).join(`
1030`);await p.writeFile("filelist.txt",new TextEncoder().encode(H)),j=70,N=10,n({videoTitle:l.title,progress:70,stage:"Joining segments…",serverSide:!1}),await f({stage:"Joining segments…",progress:70}),await w(["-f","concat","-safe","0","-i","filelist.txt","-c","copy",...y.ext==="mp4"?["-movflags","+faststart"]:[],"-y",C],"Joining edited sections")}}finally{(K=p.off)==null||K.call(p,"progress",_)}n({videoTitle:l.title,progress:85,stage:"Uploading…",serverSide:!1}),await f({stage:"Uploading…",progress:85});const R=await p.readFile(C),T=R instanceof Uint8Array?R:new TextEncoder().encode(R);if(T.length===0)throw new Error("Edited video came back empty");const D=`${u}/${Date.now()}_edited.${y.ext}`,A=new ArrayBuffer(T.byteLength);new Uint8Array(A).set(T);const V=new Blob([A],{type:y.mime}),{error:U}=await F.storage.from("videos").upload(D,V,{contentType:y.mime,upsert:!1});if(U)throw U;const{data:O}=F.storage.from("videos").getPublicUrl(D),M=O.publicUrl,$=c.reduce((Z,q)=>Z+(q.end-q.start),0);n({videoTitle:l.title,progress:95,stage:"Saving…",serverSide:!1}),await f({stage:"Saving…",progress:95});let I=null;if(d){const{data:Z,error:q}=await F.from("videos").insert({user_id:u,title:`${l.title} (edited)`,video_url:M,duration:Math.round($),file_size:T.length}).select("id").single();if(q)throw q;I=(Z==null?void 0:Z.id)??null}else{const{error:Z}=await F.from("videos").update({video_url:M,duration:Math.round($),updated_at:new Date().toISOString()}).eq("id",l.id);if(Z)throw Z}try{await p.deleteFile(b),await p.deleteFile(C)}catch{}await f({stage:"Completed",progress:100,status:"completed",new_video_id:I}),Pe.success("Video saved!",{description:d?"A new edited copy was created.":"Your video has been updated."}),window.dispatchEvent(new CustomEvent("video-processing-complete",{detail:{videoId:l.id,saveAsCopy:d}}))},[a]),o=h.useCallback((l,c,d,u)=>{const m=c.filter(f=>!f.deleted).map(f=>({start:f.start,end:f.end}));if(m.length===0){Pe.error("No segments to keep");return}n({videoTitle:l.title,progress:-1,stage:"Starting…",serverSide:!1}),(async()=>{let f=null;try{const{data:p,error:x}=await F.from("video_edit_jobs").insert({user_id:u,video_id:l.id,status:"processing",stage:"Starting…",progress:0,save_as_copy:d}).select("id").single();x?console.warn("[VideoProcessing] could not create job row",x):f=(p==null?void 0:p.id)??null,await i(l,m,d,u,f)}catch(p){console.error("[VideoProcessing] Failed:",p);const x=p instanceof Error?p.message:"Processing failed";if(f)try{await F.from("video_edit_jobs").update({status:"failed",error:x,updated_at:new Date().toISOString()}).eq("id",f)}catch(g){console.warn("[VideoProcessing] failed to mark job failed",g)}Pe.error("Video processing failed",{description:x,duration:1e4})}finally{n(null)}})()},[i]);return r.jsx(LY.Provider,{value:{job:t,startProcessing:o},children:e})},Kb=Jm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold ring-offset-background transition-all duration-200 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 touch-manipulation active:scale-[0.97] select-none group",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80 shadow-md hover:shadow-lg hover:shadow-
1030primary/25",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80 hover:shadow-lg hover:shadow-destructive/25",outline:"border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground active:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 active:bg-secondary/80 shadow-md hover:shadow-lg",ghost:"text-foreground hover:bg-muted active:bg-muted/80",link:"text-primary underline-offset-4 hover:underline",hero:"gradient-primary text-primary-foreground shadow-lg hover:shadow-xl hover:shadow-primary/30 active:scale-[0.98] animate-pulse-glow hover:animate-none","hero-outline":"border-2 border-foreground/20 text-foreground bg-card/50 backdrop-blur-sm hover:bg-card hover:border-primary hover:text-primary active:bg-card/80",success:"bg-green-600 text-white hover:bg-green-700 active:bg-green-800 shadow-md hover:shadow-lg hover:shadow-green-600/25",glow:"bg-primary text-primary-foreground shadow-lg shadow-primary/30 hover:shadow-xl hover:shadow-primary/40 animate-pulse-glow"},size:{default:"h-11 px-5 py-2 min-h-[44px]",sm:"h-9 rounded-md px-4 min-h-[36px]",lg:"h-14 roun
1030ded-xl px-8 text-base min-h-[44px]",xl:"h-16 rounded-xl px-10 text-lg min-h-[48px]",icon:"h-10 w-10 min-h-[44px] min-w-[44px]"}},defaultVariants:{variant:"default",size:"default"}}),P=h.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...a},i)=>{const o=s?dde:"button";return r.jsx(o,{className:ge(Kb({variant:t,size:n,className:e})),ref:i,...a})});P.displayName="Button";var UY={exports:{}},FY={};/**
1031 * @license React
1032 * use-sync-external-store-shim.production.js
1033 *
1034 * Copyright (c) Meta Platforms, Inc. and affiliates.
1035 *
1036 * This source code is licensed under the MIT license found in the
1037 * LICENSE file in the root directory of this source tree.
1038 */var hg=h;function ibe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var obe=typeof Object.is=="function"?Object.is:ibe,lbe=hg.useState,cbe=hg.useEffect,dbe=hg.useLayoutEffect,ube=hg.useDebugValue;function mbe(e,t){var n=t(),s=lbe({inst:{value:n,getSnapshot:t}}),a=s[0].inst,i=s[1];return dbe(function(){a.value=n,a.getSnapshot=t,Vk(a)&&i({inst:a})},[e,n,t]),cbe(function(){return Vk(a)&&i({inst:a}),e(function(){Vk(a)&&i({inst:a})})},[e]),ube(n),n}function Vk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!obe(e,n)}catch{return!0}}function hbe(e,t){return t()}var fbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hbe:mbe;FY.useSyncExternalStore=hg.useSyncExternalStore!==void 0?hg.useSyncExternalStore:fbe;UY.exports=FY;var pbe=UY.exports;function xbe(){return pbe.useSyncExternalStore(gbe,()=>!0,()=>!1)}function gbe(){return()=>{}}var y5="Avatar",[vbe,rit]=Ss(y5),[ybe,BY]=vbe(y5),zY=h.forwardRef((e,t)=>{const{__scopeAvatar:n,...s}=e,[a,i]=h.useState("idle");return r.jsx(ybe,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:r.jsx(ut.span,{...s,ref:t})})});zY.displayName=y5;var qY="AvatarImage",HY=h.forwardRef((e,t)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:a=()=>{},...i}=e,o=BY(qY,n),l=bbe(s,i),c=Dn(d=>{a(d),o.onImageLoadingStatusChange(d)});return js(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?r.jsx(ut.img,{...i,ref:t,src:s}):null});HY.displayName=qY;var WY="AvatarFallback",YY=h.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:s,...a}=e,i=BY(WY,n),[o,l]=h.useState(s===void 0);return h.useEffect(()=>{if(s!==void 0){const c=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(c)}},[s]),o&&i.imageLoadingStatus!=="loaded"?r.jsx(ut.span,{...a,ref:t}):null});YY.displayName=WY;function U$(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function bbe(e,{referrerPolicy:t,crossOrigin:n}
1038){const s=xbe(),a=h.useRef(null),i=s?(a.current||(a.current=new window.Image),a.current):null,[o,l]=h.useState(()=>U$(i,e));return js(()=>{l(U$(i,e))},[i,e]),js(()=>{const c=m=>()=>{l(m)};if(!i)return;const d=c("loaded"),u=c("error");return i.addEventListener("load",d),i.addEventListener("error",u),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",d),i.removeEventListener("error",u)}},[i,n,t]),o}var GY=zY,KY=HY,XY=YY;const an=h.forwardRef(({className:e,...t},n)=>r.jsx(GY,{ref:n,className:ge("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));an.displayName=GY.displayName;const gn=h.forwardRef(({className:e,...t},n)=>r.jsx(KY,{ref:n,className:ge("aspect-square h-full w-full",e),...t}));gn.displayName=KY.displayName;const on=h.forwardRef(({className:e,...t},n)=>r.jsx(XY,{ref:n,className:ge("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));on.displayName=XY.displayName;function wbe(){const{isImpersonating:e,impersonatedUser:t,stopImpersonation:n}=th();return!e||!t?null:r.jsx("div",{className:"fixed top-0 left-0 right-0 z-[100] bg-amber-500 text-amber-950 px-4 py-2 shadow-lg",children:r.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2 bg-amber-600/30 px-3 py-1 rounded-full",children:[r.jsx(wr,{className:"h-4 w-4"}),r.jsx("span",{className:"font-semibold text-sm",children:"VIEW-ONLY MODE"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(an,{className:"h-6 w-6 border border-amber-600",children:[r.jsx(gn,{src:t.avatar_url||void 0}),r.jsx(on,{className:"bg-amber-600 text-amber-100 text-xs",children:r.jsx(Cc,{className:"h-3 w-3"})})]}),r.jsxs("span",{className:"text-sm",children:["Viewing as ",r.jsx("strong",{children:t.full_name||t.email||"Unknown User"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs opacity-75 hidden sm:block",children:"Actions are disabled while impersonating"}),r.jsxs(P,{size:"sm",variant:"secondary",onClick:n,className:"bg-amber-100 hover:bg-amber-200 text-amber-900 border-0",children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"Exit"]})]})]})})}const jbe=()=>{const{job:e}=$Y();if(!e)return null;const t=e.progress<0,n=Math.max(0,Math.min(100,e.progress));return r.jsxs("div",{className:"fixed bottom-24 right-4 z-[200] w-80 rounded-lg border-2 border-primary bg-card p-4 shadow-2xl animate-in slide-in-from-bottom-5",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-card-foreground mb-2",children:[r.jsx(Me,{className:"w-4 h-4 animate-spin text-primary"}),r.jsxs("span",{className:"truncate",children:["Processing '",e.videoTitle,"'"]})]}),r.jsx("div",{className:"h-2 w-full bg-muted rounded-full overflow-hidden",children:r.jsx("div",{className:`h-full bg-primary rounded-full ${t?"animate-pulse":"transition-all"}`,style:{width:t?"100%":`${n}%`}})}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[e.stage,t?"":` (${n}%)`]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1 italic",children:e.serverSide===!1?"Keep this browser tab open until done.":"You can close this tab - we'll keep processing in the background."})]})},Nbe=6e4,Sbe=5e3,_be=()=>{const{user:e}=nr(),t=h.useRef(0),n=h.useCallback(async()=>{if(!e)return;const s=Date.now();if(!(s-t.current<Sbe)){t.current=s;try{await F.from("profiles").update({last_active:new Date().toISOString()}).eq("user_id",e.id)}catch(a){console.error("Failed to update last active:",a)}}},[e]);h.useEffect(()=>{if(!e)return;n();const s=setInterval(n,Nbe),a=()=>n();return window.addEventListener("focus",a),window.addEventListener("click",a),window.addEventListener("keydown",a),()=>{clearInterval(s),window.removeEventListener("focus",a),window.removeEventListener("click",a),window.removeEventListener("keydown",a)}},[e,n])},Cbe=e=>{if(!e)return"Never";const t=new Date,n=new Date(e),s=t.getTime()-n.getTime(),a=Math.floor(s/6e4),i=Math.floor(s/36e5),o=Math.floor(s/864e5);return a<2?"Online now":a<60?`${a} min ago`:i<24?`${i}h ago`:o<7?`${o}d ago`:n.toLocaleDateString()},xj=e=>{if(!e)return"offline";const n=(Date.now()-new Date(e).getTime())/6e4;return n<2?"online":n<15?"recent":n<60?"away":"offline"},kbe=5*60*1e3,Ebe=()=>{const{toast:e}=Gr(),{user:t}=nr(),n=h.useRef(null),s=h.useRef(!1),[a,i]=h.useState(null);h.useEffect(()=>{t&&F.from("profiles").select("full_name").eq("user_id",t.id).single().then(({data:o})=>{o!=null&&o.full_name&&i(o.full_name)})},[t]),h.useEffect(()=>{if(!t)return;const o=()=>{var l,c;if(document.visibilityState==="hidden")n.current=Date.now(),s.current=!1;else if(document.visibilityState==="visible"&&n.current){if(Date.now()-n.current>=kbe&&!s.current){s.current=!0;const u=(a==null?void 0:a.split(" ")[0])||((c=(l=t.user_metadata)==null?void 0:l.full_name)==null?void 0:c.split(" ")[0])||"back";e({title:`Welcome back${u!=="back"?`, ${u}`:""}! 👋`,description:"Ready to create something amazing?"})}n.current=null}};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[t,e,a])},Abe=4*60*60*1e3,Tbe=4*60*60*1e3+5*60*1e3,F$=["mousedown","keydown","scroll","touchstart","mousemove"];function Rbe(){const{user:e,signOut:t}=nr(),[n,s]=h.useState(!1),[a,i]=h.useState(300),o=h.useRef(),l=h.useRef(),c=h.useRef(),d=h.useRef(Date.now()),u=h.useCallback(()=>{d.current=Date.now(),s(!1),o.current&&clearTimeout(o.current),l.current&&clearTimeout(l.current),c.current&&clearInterval(c.current),e&&(o.current=setTimeout(()=>{s(!0),i(300),c.current=setInterval(()=>{i(f=>f<=1?(clearInterval(c.current),0):f-1)},1e3)},Abe),l.current=setTimeout(()=>{t()},Tbe))},[e,t]),m=h.useCallback(()=>{u()},[u]);return h.useEffect(()=>{if(!e){s(!1);return}u();const f=()=>{n||u()};return F$.forEach(p=>window.addEventListener(p,f,{passive:!0})),()=>{F$.forEach(p=>window.removeEventListener(p,f)),o.current&&clearTimeout(o.current),l.current&&clearTimeout(l.current),c.current&&clearInterval(c.current)}},[e,u,n]),{showWarning:n,secondsLeft:a,continueSession:m}}var Uk="focusScope.autoFocusOnMount",Fk="focusScope.autoFocusOnUnmount",B$={bubbles:!1,cancelable:!0},Obe="FocusScope",yw=h.forwardRef((e,t)=>
vendor: 4,320 bytes, line 1038
1038{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=h.useState(null),d=Dn(a),u=Dn(i),m=h.useRef(null),f=Ht(t,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(s){let g=function(w){if(p.paused||!l)return;const S=w.target;l.contains(S)?m.current=S:Pu(m.current,{select:!0})},v=function(w){if(p.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Pu(m.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Pu(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const b=new MutationObserver(y);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),b.disconnect()}}},[s,l,p.paused]),h.useEffect(()=>{if(l){q$.add(p);const g=document.activeElement;if(!l.contains(g)){const y=new CustomEvent(Uk,B$);l.addEventListener(Uk,d),l.dispatchEvent(y),y.defaultPrevented||(Pbe($be(ZY(l)),{select:!0}),document.activeElement===g&&Pu(l))}return()=>{l.removeEventListener(Uk,d),setTimeout(()=>{const y=new CustomEvent(Fk,B$);l.addEventListener(Fk,u),l.dispatchEvent(y),y.defaultPrevented||Pu(g??document.body,{select:!0}),l.removeEventListener(Fk,u),q$.remove(p)},0)}}},[l,d,u,p]);const x=h.useCallback(g=>{if(!n&&!s||p.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(v&&y){const b=g.currentTarget,[w,S]=Dbe(b);w&&S?!g.shiftKey&&y===S?(g.preventDefault(),n&&Pu(w,{select:!0})):g.shiftKey&&y===w&&(g.preventDefault(),n&&Pu(S,{select:!0})):y===b&&g.preventDefault()}},[n,s,p.paused]);return r.jsx(ut.div,{tabIndex:-1,...o,ref:f,onKeyDown:x})});yw.displayName=Obe;function Pbe(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Pu(s,{select:t}),document.activeElement!==n)return}function Dbe(e){const t=ZY(e),n=z$(t,e),s=z$(t.reverse(),e);return[n,s]}function ZY(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function z$(e,t){for(const n of e)if(!Mbe(n,{upTo:t}))return n}function Mbe(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 Ibe(e){return e instanceof HTMLInputElement&&"select"in e}function Pu(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ibe(e)&&t&&e.select()}}var q$=Lbe();function Lbe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=H$(e,t),e.unshift(t)},remove(t){var n;e=H$(e,t),(n=e[0])==null||n.resume()}}}function H$(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function $be(e){return e.filter(t=>t.tagName!=="A")}var Bk=0;function F_(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??W$()),document.body.insertAdjacentElement("beforeend",e[1]??W$()),Bk++,()=>{Bk===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bk--}},[])}function W$(){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 y1="right-scroll-bar-position",b1="width-before-scroll-bar",Vbe="with-scroll-bars-hidden",Ube="--removed-body-scroll-bar-size";function zk(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Fbe(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var a=n.value;a!==s&&(n.value=s,n.callback(s,a))}}}})[0];return n.callback=t,n.facade}var Bbe=typeof window<"u"?h.useLayoutEffect:h.useEffect,Y$=new WeakMap;function zbe(e,t){var n=Fbe(null,function(s){return e.forEach(function(a){return zk(a,s)})});return Bbe(function(){var s=Y$.get(n);if(s){var a=new Set(s),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||zk(l,null)}
vendor: 4,181 bytes, lines 1038-1053
1038),i.forEach(function(l){a.has(l)||zk(l,o)})}Y$.set(n,e)},[e]),n}function qbe(e){return e}function Hbe(e,t){t===void 0&&(t=qbe);var n=[],s=!1,a={read:function(){if(s)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(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),n}}}};return a}function Wbe(e){e===void 0&&(e={});var t=Hbe(null);return t.options=pc({async:!0,ssr:!1},e),t}var QY=function(e){var t=e.sideCar,n=vv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return h.createElement(s,pc({},n))};QY.isSideCarExport=!0;function Ybe(e,t){return e.useMedium(t),QY}var JY=Wbe(),qk=function(){},B_=h.forwardRef(function(e,t){var n=h.useRef(null),s=h.useState({onScrollCapture:qk,onWheelCapture:qk,onTouchMoveCapture:qk}),a=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,m=e.shards,f=e.sideCar,p=e.noRelative,x=e.noIsolation,g=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,S=vv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,N=zbe([n,t]),_=pc(pc({},S),a);return h.createElement(h.Fragment,null,u&&h.createElement(j,{sideCar:JY,removeScrollBar:d,shards:m,noRelative:p,noIsolation:x,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),o?h.cloneElement(h.Children.only(l),pc(pc({},_),{ref:N})):h.createElement(b,pc({},_,{className:c,ref:N}),l))});B_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};B_.classNames={fullWidth:b1,zeroRight:y1};var Gbe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kbe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Gbe();return t&&e.setAttribute("nonce",t),e}function Xbe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zbe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Qbe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Kbe())&&(Xbe(t,n),Zbe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jbe=function(){var e=Qbe();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},eG=function(){var e=Jbe(),t=function(n){var s=n.styles,a=n.dynamic;return e(s,a),null};return t},e0e={left:0,top:0,right:0,gap:0},Hk=function(e){return parseInt(e||"",10)||0},t0e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Hk(n),Hk(s),Hk(a)]},r0e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return e0e;var t=t0e(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},n0e=eG(),kx="data-scroll-locked",s0e=function(e,t,n,s){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
1039  .`.concat(Vbe,` {
1040   overflow: hidden `).concat(s,`;
1041   padding-right: `).concat(l,"px ").concat(s,`;
1042  }
1043  body[`).concat(kx,`] {
1044    overflow: hidden `).concat(s,`;
1045    overscroll-behavior: contain;
1046    `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
1047    padding-left: `.concat(a,`px;
1048    padding-top: `).concat(i,`px;
1049    padding-right: `).concat(o,`px;
1050    margin-left:0;
1051    margin-top:0;
1052    margin-right: `).concat(l,"px ").concat(s,`;
1053    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";
1053")].filter(Boolean).join(""),`
1054  }
1055  
1056  .`).concat(y1,` {
1057    right: `).concat(l,"px ").concat(s,`;
1058  }
1059  
1060  .`).concat(b1,` {
1061    margin-right: `).concat(l,"px ").concat(s,`;
1062  }
1063  
1064  .`).concat(y1," .").concat(y1,` {
1065    right: 0 `).concat(s,`;
1066  }
1067  
1068  .`).concat(b1," .").concat(b1,` {
1069    margin-right: 0 `).concat(s,`;
1070  }
1071  
1072  body[`).concat(kx,`] {
1073    `).concat(Ube,": ").concat(l,`px;
1074  }
1075`)},G$=function(){var e=parseInt(document.body.getAttribute(kx)||"0",10);return isFinite(e)?e:0},a0e=function(){h.useEffect(function(){return document.body.setAttribute(kx,(G$()+1).toString()),function(){var e=G$()-1;e<=0?document.body.removeAttribute(kx):document.body.setAttribute(kx,e.toString())}},[])},i0e=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;a0e();var i=h.useMemo(function(){return r0e(a)},[a]);return h.createElement(n0e,{styles:s0e(i,!t,a,n?"":"!important")})},eR=!1;if(typeof window<"u")try{var gj=Object.defineProperty({},"passive",{get:function(){return eR=!0,!0}});window.addEventListener("test",gj,gj),window.removeEventListener("test",gj,gj)}catch{eR=!1}var _p=eR?{passive:!1}:!1,o0e=function(e){return e.tagName==="TEXTAREA"},tG=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!o0e(e)&&n[t]==="visible")},l0e=function(e){return tG(e,"overflowY")},c0e=function(e){return tG(e,"overflowX")},K$=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=rG(e,s);if(a){var i=nG(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},d0e=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},u0e=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},rG=function(e,t){return e==="v"?l0e(t):c0e(t)},nG=function(e,t){return e==="v"?d0e(t):u0e(t)},m0e=function(e,t){return e==="h"&&t==="rtl"?-1:1},h0e=function(e,t,n,s,a){var i=m0e(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),d=!1,u=o>0,m=0,f=0;do{if(!l)break;var p=nG(e,l),x=p[0],g=p[1],v=p[2],y=g-v-i*x;(x||y)&&rG(e,l)&&(m+=y,f+=x);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(m)<1||!a)||!u&&(Math.abs(f)<1||!a))&&(d=!0),d},vj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},X$=function(e){return[e.deltaX,e.deltaY]},Z$=function(e){return e&&"current"in e?e.current:e},f0e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p0e=function(e){return`
1076  .block-interactivity-`.concat(e,` {pointer-events: none;}
1077  .allow-interactivity-`).concat(e,` {pointer-events: all;}
1078`)},x0e=0,Cp=[];function g0e(e){var t=h.useRef([]),n=h.useRef([0,0]),s=h.useRef(),a=h.useState(x0e++)[0],i=h.useState(eG)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=Hxe([e.lockRef.current],(e.shards||[]).map(Z$),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=vj(g),b=n.current,w="deltaX"in g?g.deltaX:b[0]-y[0],S="deltaY"in g?g.deltaY:b[1]-y[1],j,N=g.target,_=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&_==="h"&&N.type==="range")return!1;var C=K$(_,N);if(!C)return!0;if(C?j=_:(j=_==="v"?"h":"v",C=K$(_,N)),!C)return!1;if(!s.current&&"changedTouches"in g&&(w||S)&&(s.current=j),!j)return!0;var k=s.current||j;return h0e(k,v,g,k==="h"?w:S,!0)},[]),c=h.useCallback(function(g){var v=g;if(!(!Cp.length||Cp[Cp.length-1]!==i)){var y="deltaY"in v?X$(v):vj(v),b=t.current.filter(function(j){return j.name===v.type&&(j.target===v.target||v.target===j.shadowParent)&&f0e(j.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}
vendor: 4,289 bytes, line 1078
1078if(!b){var w=(o.current.shards||[]).map(Z$).filter(Boolean).filter(function(j){return j.contains(v.target)}),S=w.length>0?l(v,w[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=h.useCallback(function(g,v,y,b){var w={name:g,delta:v,target:y,should:b,shadowParent:v0e(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(g){n.current=vj(g),s.current=void 0},[]),m=h.useCallback(function(g){d(g.type,X$(g),g.target,l(g,e.lockRef.current))},[]),f=h.useCallback(function(g){d(g.type,vj(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return Cp.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:f}),document.addEventListener("wheel",c,_p),document.addEventListener("touchmove",c,_p),document.addEventListener("touchstart",u,_p),function(){Cp=Cp.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,_p),document.removeEventListener("touchmove",c,_p),document.removeEventListener("touchstart",u,_p)}},[]);var p=e.removeScrollBar,x=e.inert;return h.createElement(h.Fragment,null,x?h.createElement(i,{styles:p0e(a)}):null,p?h.createElement(i0e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function v0e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const y0e=Ybe(JY,g0e);var bw=h.forwardRef(function(e,t){return h.createElement(B_,pc({},e,{ref:t,sideCar:y0e}))});bw.classNames=B_.classNames;var b0e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},kp=new WeakMap,yj=new WeakMap,bj={},Wk=0,sG=function(e){return e&&(e.host||sG(e.parentNode))},w0e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=sG(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},j0e=function(e,t,n,s){var a=w0e(t,Array.isArray(e)?e:[e]);bj[n]||(bj[n]=new WeakMap);var i=bj[n],o=[],l=new Set,c=new Set(a),d=function(m){!m||l.has(m)||(l.add(m),d(m.parentNode))};a.forEach(d);var u=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(f){if(l.has(f))u(f);else try{var p=f.getAttribute(s),x=p!==null&&p!=="false",g=(kp.get(f)||0)+1,v=(i.get(f)||0)+1;kp.set(f,g),i.set(f,v),o.push(f),g===1&&x&&yj.set(f,!0),v===1&&f.setAttribute(n,"true"),x||f.setAttribute(s,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(t),l.clear(),Wk++,function(){o.forEach(function(m){var f=kp.get(m)-1,p=i.get(m)-1;kp.set(m,f),i.set(m,p),f||(yj.has(m)||m.removeAttribute(s),yj.delete(m)),p||m.removeAttribute(n)}),Wk--,Wk||(kp=new WeakMap,kp=new WeakMap,yj=new WeakMap,bj={})}},z_=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=b0e(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live]"))),j0e(s,a,n,"aria-hidden")):function(){return null}},q_="Dialog",[aG,iG]=Ss(q_),[N0e,Ql]=aG(q_),oG=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[d,u]=Zs({prop:s,defaultProp:a??!1,onChange:i,caller:q_});return r.jsx(N0e,{scope:t,triggerRef:l,contentRef:c,contentId:ji(),titleId:ji(),descriptionId:ji(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(m=>!m),[u]),modal:o,children:n})};oG.displayName=q_;var lG="DialogTrigger",cG=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ql(lG,n),i=Ht(t,a.triggerRef);return r.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":j5(a.open),...s,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});cG.displayName=lG;var b5="DialogPortal",[S0e,dG]=aG(b5,{forceMount:void 0}),uG=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:a}=e,i=Ql(b5,t);return r.jsx(S0e,{scope:t,forceMount:n,children:h.Children.map(s,o=>r.jsx(_s,{present:n||i.open,children:r.jsx(ov,{asChild:!0,container:a,children:o})}))})};uG.displayName=b5;var SN="DialogOverlay",mG=h.forwardRef((e,t)=>{const n=dG(SN,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,i=Ql(SN,e.__scopeDialog);return i.modal?r.jsx(_s,{present:s||i.open,children:r.jsx(C0e,{...a,ref:t})}):null});mG.displayName=SN;
vendor: 4,720 bytes, lines 1078-1082
1078var _0e=Dm("DialogOverlay.RemoveScroll"),C0e=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ql(SN,n);return r.jsx(bw,{as:_0e,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(ut.div,{"data-state":j5(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Pf="DialogContent",hG=h.forwardRef((e,t)=>{const n=dG(Pf,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,i=Ql(Pf,e.__scopeDialog);return r.jsx(_s,{present:s||i.open,children:i.modal?r.jsx(k0e,{...a,ref:t}):r.jsx(E0e,{...a,ref:t})})});hG.displayName=Pf;var k0e=h.forwardRef((e,t)=>{const n=Ql(Pf,e.__scopeDialog),s=h.useRef(null),a=Ht(t,n.contentRef,s);return h.useEffect(()=>{const i=s.current;if(i)return z_(i)},[]),r.jsx(fG,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),E0e=h.forwardRef((e,t)=>{const n=Ql(Pf,e.__scopeDialog),s=h.useRef(!1),a=h.useRef(!1);return r.jsx(fG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),fG=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=Ql(Pf,n),c=h.useRef(null),d=Ht(t,c);return F_(),r.jsxs(r.Fragment,{children:[r.jsx(yw,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:r.jsx(nu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":j5(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(T0e,{titleId:l.titleId}),r.jsx(O0e,{contentRef:c,descriptionId:l.descriptionId})]})]})}),w5="DialogTitle",pG=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ql(w5,n);return r.jsx(ut.h2,{id:a.titleId,...s,ref:t})});pG.displayName=w5;var xG="DialogDescription",gG=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ql(xG,n);return r.jsx(ut.p,{id:a.descriptionId,...s,ref:t})});gG.displayName=xG;var vG="DialogClose",yG=h.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,a=Ql(vG,n);return r.jsx(ut.button,{type:"button",...s,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});yG.displayName=vG;function j5(e){return e?"open":"closed"}var bG="DialogTitleWarning",[A0e,wG]=lde(bG,{contentName:Pf,titleName:w5,docsSlug:"dialog"}),T0e=({titleId:e})=>{const t=wG(bG),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1079
1080If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1081
1082For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},R0e="DialogDescriptionWarning",O0e=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wG(R0e).contentName}}.`;return h.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},jG=oG,NG=cG,SG=uG,N5=mG,S5=hG,_5=pG,C5=gG,k5=yG;const It=jG,wv=NG,P0e=SG,_G=h.forwardRef(({className:e,...t},n)=>r.jsx(N5,{ref:n,className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));_G.displayName=N5.displayName;const Dt=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(P0e,{children:[r.jsx(_G,{}),r.jsxs(S5,{ref:s,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
1082nded-lg max-h-[90vh] overflow-y-auto",e),...n,children:[t,r.jsxs(k5,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[r.jsx(zt,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Dt.displayName=S5.displayName;const Lt=({className:e,...t})=>r.jsx("div",{className:ge("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Lt.displayName="DialogHeader";const Fr=({className:e,...t})=>r.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fr.displayName="DialogFooter";const Mt=h.forwardRef(({className:e,...t},n)=>r.jsx(_5,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));Mt.displayName=_5.displayName;const $r=h.forwardRef(({className:e,...t},n)=>r.jsx(C5,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));$r.displayName=C5.displayName;const D0e=({open:e,secondsLeft:t,onContinue:n})=>{const{signOut:s}=nr(),a=Math.floor(t/60),i=t%60;return r.jsx(It,{open:e,onOpenChange:()=>{},children:r.jsxs(Dt,{className:"sm:max-w-md",onInteractOutside:o=>o.preventDefault(),children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(fr,{className:"h-5 w-5 text-amber-500"}),"Session Expiring Soon"]}),r.jsxs($r,{children:["You've been inactive for a while. For your security, you'll be signed out in"," ",r.jsxs("span",{className:"font-semibold text-foreground",children:[a,":",i.toString().padStart(2,"0")]}),"."]})]}),r.jsxs(Fr,{className:"flex gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:()=>s(),className:"gap-2",children:[r.jsx(dN,{className:"h-4 w-4"}),"Sign Out"]}),r.jsx(P,{onClick:n,children:"Continue Session"})]})]})})},M0e={"/":"Home","/record":"Record Video","/videos":"My Videos","/profile":"Profile","/settings":"Settings","/admin":"Admin","/terms":"Terms of Service","/privacy":"Privacy Policy","/auth":"Sign In","/pricing":"Pricing","/contact":"Contact","/analytics":"Analytics"},Q$="https://vidareo.com",I0e=()=>{const e=ja();h.useEffect(()=>{if(e.pathname==="/")return;const t=e.pathname.split("/").filter(l=>l),n=[];n.push({name:"Home",url:Q$});let s="";t.forEach(l=>{s+=`/${l}`;const c=M0e[s]||l.charAt(0).toUpperCase()+l.slice(1);n.push({name:c,url:`${Q$}${s}`})});const a={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n.map((l,c)=>({"@type":"ListItem",position:c+1,name:l.name,item:l.url}))},i=document.querySelector("script[data-breadcrumb-jsonld]");i&&i.remove();const o=document.createElement("script");return o.type="application/ld+json",o.setAttribute("data-breadcrumb-jsonld","true"),o.textContent=JSON.stringify(a),document.head.appendChild(o),()=>{const l=document.querySelector("script[data-breadcrumb-jsonld]");l&&l.remove()}},[e.pathname])},L0e="https://vidareo.com",$0e=["/watch/","/embed/","/admin","/dashboard","/videos","/profile","/settings","/billing","/analytics","/team","/contacts","/mail","/meet","/record","/editor","/join","/accept-invite","/reset-password","/camera-test"],V0e=()=>{const e=ja();h.useEffect(()=>{if(document.querySelectorAll('link[rel="canonical"]').forEach(n=>n.remove()),!$0e.some(n=>e.pathname===n||e.pathname.startsWith(n+"/")||e.pathname.startsWith(n))){const n=document.createElement("link");n.rel="canonical",n.href=`${L0e}${e.pathname==="/"?"":e.pathname}`,document.head.appendChild(n)}},[e.pathname])},J$="https://vidareo.com",U0e=[{code:"en",region:"en-US",label:"English (US)"}],F0e=new Set(["/","/pricing","/auth","/contact","/terms","/privacy","/accessibility"]),B0e=()=>{const e=ja();h.useEffect(()=>{if(document.querySelectorAll("link[hreflang]").forEach(a=>a.remove()),!F0e.has(e.pathname))return;const n=e.pathname==="/"?"":e.pathname;U0e.forEach(a=>{const i=document.createElement("link");i.rel="alternate",i.hreflang=a.region,i.href=`${J$}${n}`,document.head.appendChild(i)});const s=document.createElement("link");return s.rel="alternate",s.hreflang="x-default",s.href=`${J$}${n}`,document.head.appendChild(s),()=>{document.querySelectorAll("link[hreflang]").forEach(i=>
1082i.remove())}},[e.pathname])};function z0e(){h.useEffect(()=>{const e=window.location.hash;if(!e)return;const t=new URLSearchParams(e.substring(1)),n=t.get("access_token"),s=t.get("refresh_token");n&&s&&F.auth.setSession({access_token:n,refresh_token:s}).then(({error:a})=>{a||window.history.replaceState(null,"",window.location.pathname+window.location.search)})},[])}function q0e(){const e=Sr();h.useEffect(()=>{if(!_r())return;let t;return(async()=>{try{const{App:s}=await Si(async()=>{const{App:i}=await Promise.resolve().then(()=>yJe);return{App:i}},void 0),a=await s.addListener("appUrlOpen",i=>{const o=new URL(i.url),l=o.pathname,c=o.hash;if(o.hostname==="share.vidareo.com"&&l&&l!=="/"){const d=l.replace(/^\//,"");e(`/watch/${d}`);return}if(o.hostname==="meet.vidareo.com"&&l&&l!=="/"){const d=l.replace(/^\//,"");e(`/meet/${d}`);return}if(c&&(c.includes("access_token")||c.includes("type=signup")||c.includes("type=recovery"))){e(`/auth${c}`);return}if(o.hostname==="vidareo.com"||o.hostname==="www.vidareo.com"){e(l+o.search+c);return}l&&l!=="/"&&e(l+o.search+c)});t=()=>a.remove()}catch(s){console.warn("Failed to set up deep links:",s)}})(),()=>t==null?void 0:t()},[e])}function H0e(){const{resolvedTheme:e}=Y4();h.useEffect(()=>{if(!_r())return;(async()=>{try{const{StatusBar:n,Style:s}=await Si(async()=>{const{StatusBar:a,Style:i}=await import("./index-KPnTHsIw.js");return{StatusBar:a,Style:i}},[]);await n.setStyle({style:e==="dark"?s.Dark:s.Light}),await n.setOverlaysWebView({overlay:!0})}catch(n){console.warn("StatusBar plugin not available:",n)}})()},[e])}const e6=xw("ScreenOrientation",{web:()=>Si(()=>import("./web-YzgrHpyo.js"),[]).then(e=>new e.ScreenOrientationWeb)});function W0e(){h.useEffect(()=>{if(_r())return e6.lock({orientation:"portrait"}).catch(()=>{}),()=>{e6.unlock().catch(()=>{})}},[])}const qi=({children:e})=>{const{user:t,loading:n}=nr();return n?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):t?r.jsx(r.Fragment,{children:e}):r.jsx(Of,{to:"/auth",replace:!0})},CG=e=>{if(!e)return;const t=()=>{if(!Number.isFinite(e.duration)||Number.isNaN(e.duration)||e.duration===0){const n=Number.isFinite(e.currentTime)?e.currentTime:0,s=()=>{e.removeEventListener("timeupdate",s);try{e.currentTime=n}catch{e.currentTime=0}};e.addEventListener("timeupdate",s,{once:!0});try{e.currentTime=Number.MAX_SAFE_INTEGER}catch{e.removeEventListener("timeupdate",s)}}};e.readyState>=1?!e.paused&&e.currentTime>0?t():e.addEventListener("playing",t,{once:!0}):e.addEventListener("loadedmetadata",()=>{e.addEventListener("playing",t,{once:!0})},{once:!0})},_N=e=>{e&&CG(e)},rl=(e,t,n=640)=>{const s=e>0?e:640,a=t>0?t:360;if(s>=a){const o=Math.min(n,s);return{width:o,height:Math.max(1,Math.round(o*a/s))}}const i=Math.min(n,a);return{width:Math.max(1,Math.round(i*s/a)),height:i}};var Y0e="Label",kG=h.forwardRef((e,t)=>r.jsx(ut.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kG.displayName=Y0e;var EG=kG;const G0e=Jm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ye=h.forwardRef(({className:e,...t},n)=>r.jsx(EG,{ref:n,className:ge(G0e(),e),...t}));ye.displayName=EG.displayName;const He=h.forwardRef(({className:e,type:t,...n},s)=>r.jsx("input",{type:t,className:ge("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...n}));He.displayName="Input";const $s=h.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{className:ge("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1082ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));$s.displayName="Textarea";const K0e=Jm("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Se({className:e,variant:t,...n}){return r.jsx("div",{className:ge(K0e({variant:t}),e),...n})}function Xb(e,[t,n]){return Math.min(n,Math.max(t,e))}var X0e=h.createContext(void 0);function Yc(e){const t=h.useContext(X0e);return e||t||"ltr"}function jv(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Z0e=[" ","Enter","ArrowUp","ArrowDown"],Q0e=[" ","Enter"],Df="Select",[H_,W_,J0e]=Qm(Df),[Nv,nit]=Ss(Df,[J0e,Wc]),Y_=Wc(),[ewe,rh]=Nv(Df),[twe,rwe]=Nv(Df),AG=e=>{const{__scopeSelect:t,children:n,open:s,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:m,disabled:f,required:p,form:x}=e,g=Y_(t),[v,y]=h.useState(null),[b,w]=h.useState(null),[S,j]=h.useState(!1),N=Yc(d),[_,C]=Zs({prop:s,defaultProp:a??!1,onChange:i,caller:Df}),[k,E]=Zs({prop:o,defaultProp:l,onChange:c,caller:Df}),R=h.useRef(null),T=v?x||!!v.closest("form"):!0,[D,A]=h.useState(new Set),V=Array.from(D).map(U=>U.props.value).join(";");return r.jsx(hw,{...g,children:r.jsxs(ewe,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:ji(),value:k,onValueChange:E,open:_,onOpenChange:C,dir:N,triggerPointerDownPosRef:R,disabled:f,children:[r.jsx(H_.Provider,{scope:t,children:r.jsx(twe,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(U=>{A(O=>new Set(O).add(U))},[]),onNativeOptionRemove:h.useCallback(U=>{A(O=>{const M=new Set(O);return M.delete(U),M})},[]),children:n})}),T?r.jsxs(JG,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:m,value:k,onChange:U=>E(U.target.value),disabled:f,form:x,children:[k===void 0?r.jsx("option",{value:""}):null,Array.from(D)]},V):null]})})};AG.displayName=Df;var TG="SelectTrigger",RG=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:s=!1,...a}=e,i=Y_(n),o=rh(TG,n),l=o.disabled||s,c=Ht(t,o.onTriggerChange),d=W_(n),u=h.useRef("touch"),[m,f,p]=tK(g=>{const v=d().filter(w=>!w.disabled),y=v.find(w=>w.value===o.value),b=rK(v,g,y);b!==void 0&&o.onValueChange(b.value)}),x=g=>{l||(o.onOpenChange(!0),p()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return r.jsx(fv,{asChild:!0,...i,children:r.jsx(ut.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":eK(o.value)?"":void 0,...a,ref:c,onClick:We(a.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&x(g)}),onPointerDown:We(a.onPointerDown,g=>{u.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:We(a.onKeyDown,g=>{const v=m.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(v&&g.key===" ")&&Z0e.includes(g.key)&&(x(),g.preventDefault())})})})});RG.displayName=TG;var OG="SelectValue",PG=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:a,children:i,placeholder:o="",...l}=e,c=rh(OG,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,m=Ht(t,c.onValueNodeChange);return js(()=>{d(u)},[d,u]),r.jsx(ut.span,{...l,ref:m,style:{pointerEvents:"none"},children:eK(c.value)?r.jsx(r.Fragment,{children:o}):i})});PG.displayName=OG;var nwe="SelectIcon",DG=h.forwardRef((e,t)=>
vendor: 15,128 bytes, line 1082
1082{const{__scopeSelect:n,children:s,...a}=e;return r.jsx(ut.span,{"aria-hidden":!0,...a,ref:t,children:s||"▼"})});DG.displayName=nwe;var swe="SelectPortal",MG=e=>r.jsx(ov,{asChild:!0,...e});MG.displayName=swe;var Mf="SelectContent",IG=h.forwardRef((e,t)=>{const n=rh(Mf,e.__scopeSelect),[s,a]=h.useState();if(js(()=>{a(new DocumentFragment)},[]),!n.open){const i=s;return i?$d.createPortal(r.jsx(LG,{scope:e.__scopeSelect,children:r.jsx(H_.Slot,{scope:e.__scopeSelect,children:r.jsx("div",{children:e.children})})}),i):null}return r.jsx($G,{...e,ref:t})});IG.displayName=Mf;var Tl=10,[LG,nh]=Nv(Mf),awe="SelectContentImpl",iwe=Dm("SelectContent.RemoveScroll"),$G=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:v,...y}=e,b=rh(Mf,n),[w,S]=h.useState(null),[j,N]=h.useState(null),_=Ht(t,G=>S(G)),[C,k]=h.useState(null),[E,R]=h.useState(null),T=W_(n),[D,A]=h.useState(!1),V=h.useRef(!1);h.useEffect(()=>{if(w)return z_(w)},[w]),F_();const U=h.useCallback(G=>{const[ee,...re]=T().map(L=>L.ref.current),[W]=re.slice(-1),Q=document.activeElement;for(const L of G)if(L===Q||(L==null||L.scrollIntoView({block:"nearest"}),L===ee&&j&&(j.scrollTop=0),L===W&&j&&(j.scrollTop=j.scrollHeight),L==null||L.focus(),document.activeElement!==Q))return},[T,j]),O=h.useCallback(()=>U([C,w]),[U,C,w]);h.useEffect(()=>{D&&O()},[D,O]);const{onOpenChange:M,triggerPointerDownPosRef:$}=b;h.useEffect(()=>{if(w){let G={x:0,y:0};const ee=W=>{var Q,L;G={x:Math.abs(Math.round(W.pageX)-(((Q=$.current)==null?void 0:Q.x)??0)),y:Math.abs(Math.round(W.pageY)-(((L=$.current)==null?void 0:L.y)??0))}},re=W=>{G.x<=10&&G.y<=10?W.preventDefault():w.contains(W.target)||M(!1),document.removeEventListener("pointermove",ee),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",re,{capture:!0})}}},[w,M,$]),h.useEffect(()=>{const G=()=>M(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[M]);const[I,B]=tK(G=>{const ee=T().filter(Q=>!Q.disabled),re=ee.find(Q=>Q.ref.current===document.activeElement),W=rK(ee,G,re);W&&setTimeout(()=>W.ref.current.focus())}),K=h.useCallback((G,ee,re)=>{const W=!V.current&&!re;(b.value!==void 0&&b.value===ee||W)&&(k(G),W&&(V.current=!0))},[b.value]),Z=h.useCallback(()=>w==null?void 0:w.focus(),[w]),q=h.useCallback((G,ee,re)=>{const W=!V.current&&!re;(b.value!==void 0&&b.value===ee||W)&&R(G)},[b.value]),H=s==="popper"?tR:VG,X=H===tR?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:v}:{};return r.jsx(LG,{scope:n,content:w,viewport:j,onViewportChange:N,itemRefCallback:K,selectedItem:C,onItemLeave:Z,itemTextRefCallback:q,focusSelectedItem:O,selectedItemText:E,position:s,isPositioned:D,searchRef:I,children:r.jsx(bw,{as:iwe,allowPinchZoom:!0,children:r.jsx(yw,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:We(a,G=>{var ee;(ee=b.trigger)==null||ee.focus({preventScroll:!0}),G.preventDefault()}),children:r.jsx(nu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:r.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault(),...y,...X,onPlaced:()=>A(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:We(y.onKeyDown,G=>{const ee=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ee&&G.key.length===1&&B(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let W=T().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(G.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const Q=G.target,L=W.indexOf(Q);W=W.slice(L+1)}setTimeout(()=>U(W)),G.preventDefault()}})})})})})})});$G.displayName=awe;var owe="SelectItemAlignedPosition",VG=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:s,...a}=e,i=rh(Mf,n),o=nh(Mf,n),[l,c]=h.useState(null),[d,u]=h.useState(null),m=Ht(t,_=>u(_)),f=W_(n),p=h.useRef(!1),x=h.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&g&&v&&y){const _=i.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(i.dir!=="rtl"){const Q=E.left-C.left,L=k.left-Q,te=_.left-L,ae=_.width+te,ne=Math.max(ae,C.width),se=window.innerWidth-Tl,ue=Xb(L,[Tl,Math.max(Tl,se-ne)]);l.style.minWidth=ae+"px",l.style.left=ue+"px"}else{const Q=C.right-E.right,L=window.innerWidth-k.right-Q,te=window.innerWidth-_.right-L,ae=_.width+te,ne=Math.max(ae,C.width),se=window.innerWidth-Tl,ue=Xb(L,[Tl,Math.max(Tl,se-ne)]);l.style.minWidth=ae+"px",l.style.right=ue+"px"}const R=f(),T=window.innerHeight-Tl*2,D=g.scrollHeight,A=window.getComputedStyle(d),V=parseInt(A.borderTopWidth,10),U=parseInt(A.paddingTop,10),O=parseInt(A.borderBottomWidth,10),M=parseInt(A.paddingBottom,10),$=V+U+D+M+O,I=Math.min(v.offsetHeight*5,$),B=window.getComputedStyle(g),K=parseInt(B.paddingTop,10),Z=parseInt(B.paddingBottom,10),q=_.top+_.height/2-Tl,H=T-q,X=v.offsetHeight/2,G=v.offsetTop+X,ee=V+U+G,re=$-ee;if(ee<=q){const Q=R.length>0&&v===R[R.length-1].ref.current;l.style.bottom="0px";const L=d.clientHeight-g.offsetTop-g.offsetHeight,te=Math.max(H,X+(Q?Z:0)+L+O),ae=ee+te;l.style.height=ae+"px"}else{const Q=R.length>0&&v===R[0].ref.current;l.style.top="0px";const te=Math.max(q,V+g.offsetTop+(Q?K:0)+X)+re;l.style.height=te+"px",g.scrollTop=ee-q+g.offsetTop}l.style.margin=`${Tl}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=T+"px",s==null||s(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,l,d,g,v,y,i.dir,s]);js(()=>w(),[w]);const[S,j]=h.useState();js(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const N=h.useCallback(_=>{_&&x.current===!0&&(w(),b==null||b(),x.current=!1)},[w,b]);return r.jsx(cwe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:r.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:r.jsx(ut.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});VG.displayName=owe;var lwe="SelectPopperPosition",tR=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:s="start",collisionPadding:a=Tl,...i}=e,o=Y_(n);return r.jsx(fw,{...o,...i,ref:t,align:s,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});tR.displayName=lwe;var[cwe,E5]=Nv(Mf,{}),rR="SelectViewport",UG=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:s,...a}=e,i=nh(rR,n),o=E5(rR,n),l=Ht(t,i.onViewportChange),c=h.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),r.jsx(H_.Slot,{scope:n,children:r.jsx(ut.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:We(a.onScroll,d=>{const u=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&m){const p=Math.abs(c.current-u.scrollTop);if(p>0){const x=window.innerHeight-Tl*2,g=parseFloat(m.style.minHeight),v=parseFloat(m.style.height),y=Math.max(g,v);if(y<x){const b=y+p,w=Math.min(x,b),S=b-w;m.style.height=w+"px",m.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,m.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});UG.displayName=rR;var FG="SelectGroup",[dwe,uwe]=Nv(FG),mwe=h.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=ji();return r.jsx(dwe,{scope:n,id:a,children:r.jsx(ut.div,{role:"group","aria-labelledby":a,...s,ref:t})})});mwe.displayName=FG;var BG="SelectLabel",zG=h.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=uwe(BG,n);return r.jsx(ut.div,{id:a.id,...s,ref:t})});zG.displayName=BG;var CN="SelectItem",[hwe,qG]=Nv(CN),HG=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:s,disabled:a=!1,textValue:i,...o}=e,l=rh(CN,n),c=nh(CN,n),d=l.value===s,[u,m]=h.useState(i??""),[f,p]=h.useState(!1),x=Ht(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,s,a)}),g=ji(),v=h.useRef("touch"),y=()=>{a||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(hwe,{scope:n,value:s,disabled:a,textId:g,isSelected:d,onItemTextChange:h.useCallback(b=>{m(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:r.jsx(H_.ItemSlot,{scope:n,value:s,disabled:a,textValue:u,children:r.jsx(ut.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:x,onFocus:We(o.onFocus,()=>p(!0)),onBlur:We(o.onBlur,()=>p(!1)),onClick:We(o.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:We(o.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:We(o.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:We(o.onPointerMove,b=>{var w;v.current=b.pointerType,a?(w=c.onItemLeave)==null||w.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:We(o.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:We(o.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(Q0e.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});HG.displayName=CN;var Oy="SelectItemText",WG=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:a,...i}=e,o=rh(Oy,n),l=nh(Oy,n),c=qG(Oy,n),d=rwe(Oy,n),[u,m]=h.useState(null),f=Ht(t,y=>m(y),c.onItemTextChange,y=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,y,c.value,c.disabled)}),p=u==null?void 0:u.textContent,x=h.useMemo(()=>r.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=d;return js(()=>(g(x),()=>v(x)),[g,v,x]),r.jsxs(r.Fragment,{children:[r.jsx(ut.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$d.createPortal(i.children,o.valueNode):null]})});WG.displayName=Oy;var YG="SelectItemIndicator",GG=h.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return qG(YG,n).isSelected?r.jsx(ut.span,{"aria-hidden":!0,...s,ref:t}):null});GG.displayName=YG;var nR="SelectScrollUpButton",KG=h.forwardRef((e,t)=>{const n=nh(nR,e.__scopeSelect),s=E5(nR,e.__scopeSelect),[a,i]=h.useState(!1),o=Ht(t,s.onScrollButtonChange);return js(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?r.jsx(ZG,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});KG.displayName=nR;var sR="SelectScrollDownButton",XG=h.forwardRef((e,t)=>{const n=nh(sR,e.__scopeSelect),s=E5(sR,e.__scopeSelect),[a,i]=h.useState(!1),o=Ht(t,s.onScrollButtonChange);return js(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?r.jsx(ZG,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});XG.displayName=sR;var ZG=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:s,...a}=e,i=nh("SelectScrollButton",n),o=h.useRef(null),l=W_(n),c=h.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),js(()=>{var u;const d=l().find(m=>m.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),r.jsx(ut.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:We(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:We(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:We(a.onPointerLeave,()=>{c()})})}),fwe="SelectSeparator",QG=h.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return r.jsx(ut.div,{"aria-hidden":!0,...s,ref:t})});QG.displayName=fwe;var aR="SelectArrow",pwe=h.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,a=Y_(n),i=rh(aR,n),o=nh(aR,n);return i.open&&o.position==="popper"?r.jsx(pw,{...a,...s,ref:t}):null});pwe.displayName=aR;var xwe="SelectBubbleInput",JG=h.forwardRef(({__scopeSelect:e,value:t,...n},s)=>{const a=h.useRef(null),i=Ht(s,a),o=jv(t);return h.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const m=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(m)}},[o,t]),r.jsx(ut.select,{...n,style:{...yH,...n.style},ref:i,defaultValue:t})});JG.displayName=xwe;function eK(e){return e===""||e===void 0}function tK(e){const t=Dn(e),n=h.useRef(""),s=h.useRef(0),a=h.useCallback(o=>{const l=n.current+o;t(l),function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,a,i]}function rK(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=gwe(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function gwe(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var vwe=AG,nK=RG,ywe=PG,bwe=DG,wwe=MG,sK=IG,jwe=UG,aK=zG,iK=HG,Nwe=WG,Swe=GG,oK=KG,lK=XG,cK=QG;const kn=vwe,En=ywe,wn=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(nK,{ref:s,className:ge("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
1082ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,r.jsx(bwe,{asChild:!0,children:r.jsx(Qs,{className:"h-4 w-4 opacity-50"})})]}));wn.displayName=nK.displayName;const dK=h.forwardRef(({className:e,...t},n)=>r.jsx(oK,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Mm,{className:"h-4 w-4"})}));dK.displayName=oK.displayName;const uK=h.forwardRef(({className:e,...t},n)=>r.jsx(lK,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Qs,{className:"h-4 w-4"})}));uK.displayName=lK.displayName;const jn=h.forwardRef(({className:e,children:t,position:n="popper",...s},a)=>r.jsx(wwe,{children:r.jsxs(sK,{ref:a,className:ge("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx(dK,{}),r.jsx(jwe,{className:ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(uK,{})]})}));jn.displayName=sK.displayName;const _we=h.forwardRef(({className:e,...t},n)=>r.jsx(aK,{ref:n,className:ge("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));_we.displayName=aK.displayName;const _t=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(iK,{ref:s,className:ge("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Swe,{children:r.jsx(nt,{className:"h-4 w-4"})})}),r.jsx(Nwe,{children:t})]}));_t.displayName=iK.displayName;const Cwe=h.forwardRef(({className:e,...t},n)=>r.jsx(cK,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));Cwe.displayName=cK.displayName;var G_="Switch",[kwe,sit]=Ss(G_),[Ewe,Awe]=kwe(G_),mK=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:s,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...m}=e,[f,p]=h.useState(null),x=Ht(t,w=>p(w)),g=h.useRef(!1),v=f?u||!!f.closest("form"):!0,[y,b]=Zs({prop:a,defaultProp:i??!1,onChange:d,caller:G_});return r.jsxs(Ewe,{scope:n,checked:y,disabled:l,children:[r.jsx(ut.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":xK(y),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:x,onClick:We(e.onClick,w=>{b(S=>!S),v&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),v&&r.jsx(pK,{control:f,bubbles:!g.current,name:s,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});mK.displayName=G_;var hK="SwitchThumb",fK=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...s}=e,a=Awe(hK,n);return r.jsx(ut.span,{"data-state":xK(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})});fK.displayName=hK;var Twe="SwitchBubbleInput",pK=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:s=!0,...a},i)=>{const o=h.useRef(null),l=Ht(o,i),c=jv(n),d=mw(t);return h.useEffect(()=>{const u=o.current;if(!u)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:s});p.call(u,n),u.dispatchEvent(x)}},[c,n,s]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});pK.displayName=Twe;function xK(e){return e?"checked":"unchecked"}var gK=mK,Rwe=fK;const rr=h.forwardRef(({className:e,...t},n)=>r.jsx(gK,{className:ge("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:r.jsx(Rwe,{className:ge("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")})}
vendor: 3,448 bytes, line 1082
1082));rr.displayName=gK.displayName;var Yk="rovingFocusGroup.onEntryFocus",Owe={bubbles:!1,cancelable:!0},ww="RovingFocusGroup",[iR,vK,Pwe]=Qm(ww),[Dwe,sh]=Ss(ww,[Pwe]),[Mwe,Iwe]=Dwe(ww),yK=h.forwardRef((e,t)=>r.jsx(iR.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(iR.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Lwe,{...e,ref:t})})}));yK.displayName=ww;var Lwe=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...m}=e,f=h.useRef(null),p=Ht(t,f),x=Yc(i),[g,v]=Zs({prop:o,defaultProp:l??null,onChange:c,caller:ww}),[y,b]=h.useState(!1),w=Dn(d),S=vK(n),j=h.useRef(!1),[N,_]=h.useState(0);return h.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Yk,w),()=>C.removeEventListener(Yk,w)},[w]),r.jsx(Mwe,{scope:n,orientation:s,dir:x,loop:a,currentTabStopId:g,onItemFocus:h.useCallback(C=>v(C),[v]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>_(C=>C+1),[]),onFocusableItemRemove:h.useCallback(()=>_(C=>C-1),[]),children:r.jsx(ut.div,{tabIndex:y||N===0?-1:0,"data-orientation":s,...m,ref:p,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{j.current=!0}),onFocus:We(e.onFocus,C=>{const k=!j.current;if(C.target===C.currentTarget&&k&&!y){const E=new CustomEvent(Yk,Owe);if(C.currentTarget.dispatchEvent(E),!E.defaultPrevented){const R=S().filter(U=>U.focusable),T=R.find(U=>U.active),D=R.find(U=>U.id===g),V=[T,D,...R].filter(Boolean).map(U=>U.ref.current);jK(V,u)}}j.current=!1}),onBlur:We(e.onBlur,()=>b(!1))})})}),bK="RovingFocusGroupItem",wK=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=ji(),d=i||c,u=Iwe(bK,n),m=u.currentTabStopId===d,f=vK(n),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:g}=u;return h.useEffect(()=>{if(s)return p(),()=>x()},[s,p,x]),r.jsx(iR.ItemSlot,{scope:n,id:d,focusable:s,active:a,children:r.jsx(ut.span,{tabIndex:m?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,v=>{s?u.onItemFocus(d):v.preventDefault()}),onFocus:We(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:We(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Uwe(v,u.orientation,u.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=u.loop?Fwe(w,S+1):w.slice(S+1)}setTimeout(()=>jK(w))}}),children:typeof o=="function"?o({isCurrentTabStop:m,hasTabStop:g!=null}):o})})});wK.displayName=bK;var $we={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vwe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uwe(e,t,n){const s=Vwe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return $we[s]}function jK(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function Fwe(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var K_=yK,X_=wK,NK="Toggle",A5=h.forwardRef((e,t)=>
1082{const{pressed:n,defaultPressed:s,onPressedChange:a,...i}=e,[o,l]=Zs({prop:n,onChange:a,defaultProp:s??!1,caller:NK});return r.jsx(ut.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:We(e.onClick,()=>{e.disabled||l(!o)})})});A5.displayName=NK;var SK=A5,ah="ToggleGroup",[_K,ait]=Ss(ah,[sh]),CK=sh(),T5=Y.forwardRef((e,t)=>{const{type:n,...s}=e;if(n==="single"){const a=s;return r.jsx(Bwe,{...a,ref:t})}if(n==="multiple"){const a=s;return r.jsx(zwe,{...a,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${ah}\``)});T5.displayName=ah;var[kK,EK]=_K(ah),Bwe=Y.forwardRef((e,t)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...i}=e,[o,l]=Zs({prop:n,defaultProp:s??"",onChange:a,caller:ah});return r.jsx(kK,{scope:e.__scopeToggleGroup,type:"single",value:Y.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:Y.useCallback(()=>l(""),[l]),children:r.jsx(AK,{...i,ref:t})})}),zwe=Y.forwardRef((e,t)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...i}=e,[o,l]=Zs({prop:n,defaultProp:s??[],onChange:a,caller:ah}),c=Y.useCallback(u=>l((m=[])=>[...m,u]),[l]),d=Y.useCallback(u=>l((m=[])=>m.filter(f=>f!==u)),[l]);return r.jsx(kK,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:d,children:r.jsx(AK,{...i,ref:t})})});T5.displayName=ah;var[qwe,Hwe]=_K(ah),AK=Y.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:s=!1,rovingFocus:a=!0,orientation:i,dir:o,loop:l=!0,...c}=e,d=CK(n),u=Yc(o),m={role:"group",dir:u,...c};return r.jsx(qwe,{scope:n,rovingFocus:a,disabled:s,children:a?r.jsx(K_,{asChild:!0,...d,orientation:i,dir:u,loop:l,children:r.jsx(ut.div,{...m,ref:t})}):r.jsx(ut.div,{...m,ref:t})})}),kN="ToggleGroupItem",TK=Y.forwardRef((e,t)=>{const n=EK(kN,e.__scopeToggleGroup),s=Hwe(kN,e.__scopeToggleGroup),a=CK(e.__scopeToggleGroup),i=n.value.includes(e.value),o=s.disabled||e.disabled,l={...e,pressed:i,disabled:o},c=Y.useRef(null);return s.rovingFocus?r.jsx(X_,{asChild:!0,...a,focusable:!o,active:i,ref:c,children:r.jsx(t6,{...l,ref:t})}):r.jsx(t6,{...l,ref:t})});TK.displayName=kN;var t6=Y.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:s,...a}=e,i=EK(kN,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=i.type==="single"?o:void 0;return r.jsx(A5,{...l,...a,ref:t,onPressedChange:c=>{c?i.onItemActivate(s):i.onItemDeactivate(s)}})}),RK=T5,OK=TK;const PK=Jm("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Wwe=h.forwardRef(({className:e,variant:t,size:n,...s},a)=>r.jsx(SK,{ref:a,className:ge(PK({variant:t,size:n,className:e})),...s}));Wwe.displayName=SK.displayName;const DK=h.createContext({size:"default",variant:"default"}),Z_=h.forwardRef(({className:e,variant:t,size:n,children:s,...a},i)=>r.jsx(RK,{ref:i,className:ge("flex items-center justify-center gap-1",e),...a,children:r.jsx(DK.Provider,{value:{variant:t,size:n},children:s})}));Z_.displayName=RK.displayName;const If=h.forwardRef(({className:e,children:t,variant:n,size:s,...a},i)=>{const o=h.useContext(DK);return r.jsx(OK,{ref:i,className:ge(PK({variant:o.variant||n,size:o.size||s}),e),...a,children:t})});If.displayName=OK.displayName;const EN=640,r6=1024,Ywe=768,Gwe=1024,Kwe=()=>{if(typeof navigator>"u")return!1;if(Ic.isNativePlatform())return!0;const e=navigator.userAgent,t=/iPhone|iPod|Android.*Mobile|Mobile/i.test(e),n=/iPad/i.test(e)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t&&!n};function MK(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${EN-1}px)`),s=()=>{t(Kwe()||window.innerWidth<EN)};return n.addEventListener("change",s),s(),()=>n.removeEventListener("change",s)},[]),!!e}function Q_(){const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=()=>{const a=window.innerWidth;t(a>=EN&&a<r6)},s=window.matchMedia(`(min-width: ${EN}px) and (max-width: ${r6-1}px)`);return s.addEventListener("change",n),n(),()=>s.removeEventListener("change",n)},[]),e}function R5(){const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=()=>{const s=window.innerWidth,a=navigator.userAgent,i=/iPad/i.test(a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,o=s>=Ywe&&s<=Gwe;t(i||o&&navigator.maxTouchPoints>0)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e}function ih(){const[e]=h.useState(()=>{if(Ic.isNativePlatform())return!0;const t=navigator.userAgent,n=/iPhone|iPod|Android.*Mobile|Mobile/i.test(t),s=/iPad/i.test(t)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return n&&!s});return e}function O5(){const[e,t]=h.useState(!1);return h.useEffect(()=>{var s;const n=()=>{var a;(a=window.screen)!=null&&a.orientation?t(window.screen.orientation.type.includes("landscape")):t(window.innerWidth>window.innerHeight)};return(s=window.screen)!=null&&s.orientation&&window.screen.orientation.addEventListener("change",n),window.addEventListener("resize",n),window.addEventListener("orientationchange",n),n(),()=>{var a;(a=window.screen)!=null&&a.orientation&&window.screen.orientation.removeEventListener("change",n),window.removeEventListener("resize",n),window.removeEventListener("orientationchange",n)}},[]),e}function IK(){const e=Q_(),t=O5();return e&&t}function Xwe(){const e=R5(),t=O5();return e&&!t}function Zwe(){const e=R5(),t=O5();return e&&t}const is={MAX_FILE_SIZE_MB:1024,MAX_FILE_SIZE_BYTES:1024*1024*1024,PRO_MAX_DURATION_SECONDS:600,PRO_MAX_DURATION_MINUTES:10,EXTENDED_30_MAX_DURATION_SECONDS:1800,EXTENDED_30_MAX_DURATION_MINUTES:30,EXTENDED_60_MAX_DURATION_SECONDS:3600,EXTENDED_60_MAX_DURATION_MINUTES:60,FREE_MAX_DURATION_SECONDS:120,FREE_MAX_DURATION_MINUTES:2,FREE_MAX_RECORDINGS_PER_MONTH:5,FREE_MAX_SENDS_PER_MONTH:5,MAX_RESOLUTION_WIDTH:1920,MAX_RESOLUTION_HEIGHT:1080,VIDEO_CALL_MAX_DURATION_SECONDS:7200,VIDEO_CALL_MAX_DURATION_MINUTES:120,VIDEO_CALL_WARNING_5_MIN:6900,VIDEO_CALL_WARNING_1_MIN:7140,BROWSER_CALL_RECORDING_MAX_SECONDS:1200,BROWSER_CALL_RECORDING_MAX_MINUTES:20,BROWSER_CALL_RECORDING_WARN_5_MIN:900,BROWSER_CALL_RECORDING_WARN_1_MIN:1140,SUPPORTED_FORMATS:["video/webm","video/mp4","video/quicktime"]},mm={extended_video_30:{name:"Extended Video Length (30 min)",duration_minutes:30,duration_seconds:1800,price:20},extended_video_60:{name:"Extended Video Length (60 min)",duration_minutes:60,duration_seconds:3600,price:30}},nb=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,Qwe=e=>{const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`},oR=e=>e<=is.MAX_FILE_SIZE_BYTES,Jwe=e=>e<=is.PRO_MAX_DURATION_SECONDS,wj={starter:is.FREE_MAX_RECORDINGS_PER_MONTH,professional:1/0,team:1/0,admin:1/0},jw=e=>{const[t,n]=h.useState(0),[s,a]=h.useState("starter"),[i,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=
1082h.useState(null),f=wj[l?"admin":s]??wj.starter,p=d!==null?d:f,x=d!==null,g=Math.max(0,p-t),v=p!==1/0&&t>=p,y=h.useCallback(async()=>{if(!e){o(!1);return}try{const{data:S}=await F.from("user_roles").select("role").eq("user_id",e).eq("role","admin").maybeSingle();if(c(!!S),S){o(!1);return}const{data:j}=await F.from("profiles").select("subscription_tier").eq("user_id",e).single();j!=null&&j.subscription_tier&&a(j.subscription_tier);const{data:N}=await F.from("user_custom_limits").select("max_recordings").eq("user_id",e).maybeSingle();(N==null?void 0:N.max_recordings)!==null&&(N==null?void 0:N.max_recordings)!==void 0?u(N.max_recordings):u(null);const{data:_,error:C}=await F.rpc("get_video_recording_usage",{p_user_id:e});!C&&_!==null&&n(_)}catch(S){console.error("Error fetching video recording usage:",S)}finally{o(!1)}},[e]);h.useEffect(()=>{y()},[y]),h.useEffect(()=>{if(!e)return;const S=()=>{y()},j=()=>{document.visibilityState==="visible"&&y()};return window.addEventListener("vidareo:usage-updated",S),document.addEventListener("visibilitychange",j),()=>{window.removeEventListener("vidareo:usage-updated",S),document.removeEventListener("visibilitychange",j)}},[e,y]);const b=h.useCallback(async()=>{if(!e)return!1;if(l)return!0;const S=d!==null?d:wj[s]??wj.starter;if(S!==1/0&&t>=S)return!1;try{const{data:j,error:N}=await F.rpc("increment_video_recording_count",{p_user_id:e});if(N)return console.error("Error incrementing recording usage:",N),!1;j!==null&&n(j);try{window.dispatchEvent(new CustomEvent("vidareo:usage-updated"))}catch{}return!0}catch(j){return console.error("Error incrementing video recording usage:",j),!1}},[e,s,t,d,l]),w=h.useCallback(async()=>{await y()},[y]);return{currentUsage:t,limit:p,remaining:g,isAtLimit:v,isLoading:i,subscriptionTier:s,hasCustomLimit:x,incrementUsage:b,refreshUsage:w}};function np(){const{user:e}=nr(),[t,n]=h.useState({addons:[],isLoading:!0,hasExtendedVideo:!1,hasExtendedVideo30:!1,hasExtendedVideo60:!1,maxVideoDurationMinutes:10}),s=h.useCallback(async()=>{if(!(e!=null&&e.id)){n({addons:[],isLoading:!1,hasExtendedVideo:!1,hasExtendedVideo30:!1,hasExtendedVideo60:!1,maxVideoDurationMinutes:10});return}try{const{data:a,error:i}=await F.from("user_addons").select("*").eq("user_id",e.id);if(i)throw i;const o=a||[],l=o.some(f=>f.addon_type==="extended_video_60"&&f.is_active),c=o.some(f=>f.addon_type==="extended_video_30"&&f.is_active),d=o.some(f=>f.addon_type==="extended_video"&&f.is_active),u=l||c||d;let m=10;l?m=60:(c||d)&&(m=30),n({addons:o,isLoading:!1,hasExtendedVideo:u,hasExtendedVideo30:c||d,hasExtendedVideo60:l,maxVideoDurationMinutes:m})}catch(a){console.error("Error fetching user addons:",a),n(i=>({...i,isLoading:!1}))}},[e==null?void 0:e.id]);return h.useEffect(()=>{s()},[s]),h.useEffect(()=>{if(!e)return;const a=setInterval(()=>{s()},3e4);return()=>clearInterval(a)},[e,s]),{...t,refetchAddons:s}}const sp=()=>{const{user:e}=nr(),[t,n]=h.useState(!1),[s,a]=h.useState(!0);return h.useEffect(()=>{(async()=>{if(!e){n(!1),a(!1);return}try{const{data:o,error:l}=await F.from("user_roles").select("role").eq("user_id",e.id).eq("role","admin").maybeSingle();l?(console.error("Error checking admin status:",l),n(!1)):n(!!o)}catch(o){console.error("Error checking admin status:",o),n(!1)}finally{a(!1)}})()},[e]),{isAdmin:t,loading:s}},xi={starter:{name:"Free",priceMonthly:0,priceAnnual:0,features:["5 video recordings per month","5 video sends per month","720p video quality"]},professional:{name:"Professional",priceMonthly:29.95,priceAnnual:239.4,features:["Unlimited video recordings","10 minute max per video","Unlimited video sends","Custom branding","1080p video quality","Priority support"]},team:{name:"Team",priceMonthly:19,priceAnnual:180,perUser:!0,minUsers:2,features:["Everything in Professional","Team workspace","Admin controls","Team analytics","Priority support"]}};function Jl(){const{user:e,session:t,loading:n}=nr(),{isAdmin:s}=sp(),{toast:a}=Gr(),[i,o]=h.useState({subscribed:!1,subscriptionTier:"starter",subscriptionEnd:null,maxVideoMinutes:5,isLoading:!0,isGiftedAccount:!1,isTrial:!1,trialEnd:null}),l=h.useCallback(async()=>{var u;if(!n){if(!e||!(t!=null&&t.access_token)){o(m=>({...m,isLoading:!1}));return}try{const[m,f]=await Promise.all([F.functions.invoke("check-subscription",{headers:{Authorization:`Bearer ${t.access_token}`}}),F.from("profiles").select("is_admin_assigned_tier").eq("user_id",e.id).single()]);if(m.error)throw m.error;const p=m.data,x=((u=f.data)==null?void 0:u.is_admin_assigned_tier)===!0;o({subscribed:p.subscribed||!1,subscriptionTier:p.subscription_tier||"starter",subscriptionEnd:p.subscription_end||null,maxVideoMinutes:p.max_video_minutes||5,isLoading:!1,isGiftedAccount:x,isTrial:p.is_trial||!1,trialEnd:p.trial_end||null})}catch(m){console.warn("check-subscription unavailable, using profile fallback:",m);try{const{data:f}=await F.from("profiles").select("subscription_tier, is_admin_assigned_tier").eq("user_id",e.id).maybeSingle(),p=(f==null?void 0:f.subscription_tier)||"starter";o({subscribed:p!=="starter",subscriptionTier:p,subscriptionEnd:null,maxVideoMinutes:p==="starter"?5:60,isLoading:!1,isGiftedAccount:(f==null?void 0:f.is_admin_assigned_tier)===!0,isTrial:!1,trialEnd:null})}catch(f){console.warn("Profile fallback also failed, defaulting to starter:",f),o({subscribed:!1,subscriptionTier:"starter",subscriptionEnd:null,maxVideoMinutes:5,isLoading:!1,isGiftedAccount:!1,isTrial:!1,trialEnd:null})}}}},[e,t,n]);return h.useEffect(()=>{n||l()},[l,n]),h.useEffect(()=>{if(!e)return;const u=setInterval(()=>{l()},6e4);return()=>clearInterval(u)},[e,l]),{...i,checkSubscription:l,createCheckout:async(u,m="monthly",f,p)=>
1082{if(!(t!=null&&t.access_token)){a({title:"Please log in",description:"You need to be logged in to upgrade your subscription.",variant:"destructive"});return}let x=f??1;if(u==="team"&&f===void 0){const y=localStorage.getItem("signup_team_member_count");y&&(x=parseInt(y,10),localStorage.removeItem("signup_team_member_count"))}u==="team"&&x<2&&(x=2);let g=p??[];if(g.length===0&&localStorage.getItem("signup_addon_extended_video")==="true"){const b=localStorage.getItem("signup_addon_type");b==="extended_video_30"||b==="extended_video_60"?g=[b]:g=["extended_video_30"],localStorage.removeItem("signup_addon_extended_video"),localStorage.removeItem("signup_addon_type")}const v=localStorage.getItem("signup_promo_code");v&&localStorage.removeItem("signup_promo_code");try{const{data:y,error:b}=await F.functions.invoke("create-checkout",{body:{tier:u,billingPeriod:m,quantity:x,addons:g,promoCode:v||void 0},headers:{Authorization:`Bearer ${t.access_token}`}});if(b)throw b;y!=null&&y.url&&window.open(y.url,"_blank")}catch(y){console.error("Error creating checkout:",y),a({title:"Error",description:"Failed to start checkout process. Please try again.",variant:"destructive"})}},openCustomerPortal:async()=>{if(!(t!=null&&t.access_token)){a({title:"Please log in",description:"You need to be logged in to manage your subscription.",variant:"destructive"});return}try{const{data:u,error:m}=await F.functions.invoke("customer-portal",{headers:{Authorization:`Bearer ${t.access_token}`}});if(m)throw m;u!=null&&u.url&&window.open(u.url,"_blank")}catch(u){console.error("Error opening customer portal:",u),a({title:"Error",description:"Failed to open billing portal. Please try again.",variant:"destructive"})}},isPremium:s||i.subscriptionTier!=="starter",isAdmin:s,tierInfo:xi[i.subscriptionTier]||xi.starter}}const eje="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",tje="abcdefghjkmnpqrstuvwxyz23456789";function LK(e,t){const n=Math.floor(256/t.length)*t.length;let s="";for(;s.length<e;){const a=new Uint8Array(e-s.length);crypto.getRandomValues(a);for(const i of a)i<n&&(s+=t.charAt(i%t.length))}return s}function J_(e=22){return LK(e,eje)}function P5(e=10){return LK(e,tje)}var D5={};(function e(t,n,s,a){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;try{var I=new OffscreenCanvas(1,1),B=I.getContext("2d");B.fillRect(0,0,1,1);var K=I.transferToImageBitmap();B.createPattern(K,"no-repeat")}catch{return!1}return!0}();function c(){}function d(I){var B=n.exports.Promise,K=B!==void 0?B:t.Promise;return typeof K=="function"?new K(I):(I(c,c),null)}var u=function(I,B){return{transform:function(K){if(I)return K;if(B.has(K))return B.get(K);var Z=new OffscreenCanvas(K.width,K.height),q=Z.getContext("2d");return q.drawImage(K,0,0),B.set(K,Z),Z},clear:function(){B.clear()}}}(l,new Map),m=function(){var I=Math.floor(16.666666666666668),B,K,Z={},q=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(B=function(H){var X=Math.random();return Z[X]=requestAnimationFrame(function G(ee){q===ee||q+I-1<ee?(q=ee,delete Z[X],H()):Z[X]=requestAnimationFrame(G)}),X},K=function(H){Z[H]&&cancelAnimationFrame(Z[H])}):(B=function(H){return setTimeout(H,I)},K=function(H){return clearTimeout(H)}),{frame:B,cancel:K}}(),f=function(){var I,B,K={};function Z(q){function H(X,G){q.postMessage({options:X||{},callback:G})}q.init=function(G){var ee=G.transferControlToOffscreen();q.postMessage({canvas:ee},[ee])},q.fire=function(G,ee,re){if(B)return H(G,null),B;var W=Math.random().toString(36).slice(2);return B=d(function(Q){function L(te){te.data.callback===W&&(delete K[W],q.removeEventListener("message",L),B=null,u.clear(),re(),Q())}q.addEventListener("message",L),H(G,W),K[W]=L.bind(null,{data:{callback:W}})}),B},q.reset=function(){q.postMessage({reset:!0});for(var G in K)K[G](),delete K[G]}}return function(){if(I)return I;if(!s&&i){var q=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join(`
1083`);try{I=new Worker(URL.createObjectURL(new Blob([q])))}catch(H){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",H),null}Z(I)}return I}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function x(I,B){return B?B(I):I}function g(I){return I!=null}function v(I,B,K){return x(I&&g(I[B])?I[B]:p[B],K)}function y(I){return I<0?0:Math.floor(I)}function b(I,B){return Math.floor(Math.random()*(B-I))+I}function w(I){return parseInt(I,16)}function S(I){return I.map(j)}function j(I){var B=String(I).replace(/[^0-9a-f]/gi,"");return B.length<6&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),{r:w(B.substring(0,2)),g:w(B.substring(2,4)),b:w(B.substring(4,6))}}function N(I){var B=v(I,"origin",Object);return B.x=v(B,"x",Number),B.y=v(B,"y",Number),B}function _(I){I.width=document.documentElement.clientWidth,I.height=document.documentElement.clientHeight}function C(I){var B=I.getBoundingClientRect();I.width=B.width,I.height=B.height}function k(I){var B=document.createElement("canvas");return B.style.position="fixed",B.style.top="0px",B.style.left="0px",B.style.pointerEvents="none",B.style.zIndex=I,B}
vendor: 4,218 bytes, line 1083
1083function E(I,B,K,Z,q,H,X,G,ee){I.save(),I.translate(B,K),I.rotate(H),I.scale(Z,q),I.arc(0,0,1,X,G,ee),I.restore()}function R(I){var B=I.angle*(Math.PI/180),K=I.spread*(Math.PI/180);return{x:I.x,y:I.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:I.startVelocity*.5+Math.random()*I.startVelocity,angle2D:-B+(.5*K-Math.random()*K),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:I.color,shape:I.shape,tick:0,totalTicks:I.ticks,decay:I.decay,drift:I.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:I.gravity*3,ovalScalar:.6,scalar:I.scalar,flat:I.flat}}function T(I,B){B.x+=Math.cos(B.angle2D)*B.velocity+B.drift,B.y+=Math.sin(B.angle2D)*B.velocity+B.gravity,B.velocity*=B.decay,B.flat?(B.wobble=0,B.wobbleX=B.x+10*B.scalar,B.wobbleY=B.y+10*B.scalar,B.tiltSin=0,B.tiltCos=0,B.random=1):(B.wobble+=B.wobbleSpeed,B.wobbleX=B.x+10*B.scalar*Math.cos(B.wobble),B.wobbleY=B.y+10*B.scalar*Math.sin(B.wobble),B.tiltAngle+=.1,B.tiltSin=Math.sin(B.tiltAngle),B.tiltCos=Math.cos(B.tiltAngle),B.random=Math.random()+2);var K=B.tick++/B.totalTicks,Z=B.x+B.random*B.tiltCos,q=B.y+B.random*B.tiltSin,H=B.wobbleX+B.random*B.tiltCos,X=B.wobbleY+B.random*B.tiltSin;if(I.fillStyle="rgba("+B.color.r+", "+B.color.g+", "+B.color.b+", "+(1-K)+")",I.beginPath(),o&&B.shape.type==="path"&&typeof B.shape.path=="string"&&Array.isArray(B.shape.matrix))I.fill(O(B.shape.path,B.shape.matrix,B.x,B.y,Math.abs(H-Z)*.1,Math.abs(X-q)*.1,Math.PI/10*B.wobble));else if(B.shape.type==="bitmap"){var G=Math.PI/10*B.wobble,ee=Math.abs(H-Z)*.1,re=Math.abs(X-q)*.1,W=B.shape.bitmap.width*B.scalar,Q=B.shape.bitmap.height*B.scalar,L=new DOMMatrix([Math.cos(G)*ee,Math.sin(G)*ee,-Math.sin(G)*re,Math.cos(G)*re,B.x,B.y]);L.multiplySelf(new DOMMatrix(B.shape.matrix));var te=I.createPattern(u.transform(B.shape.bitmap),"no-repeat");te.setTransform(L),I.globalAlpha=1-K,I.fillStyle=te,I.fillRect(B.x-W/2,B.y-Q/2,W,Q),I.globalAlpha=1}else if(B.shape==="circle")I.ellipse?I.ellipse(B.x,B.y,Math.abs(H-Z)*B.ovalScalar,Math.abs(X-q)*B.ovalScalar,Math.PI/10*B.wobble,0,2*Math.PI):E(I,B.x,B.y,Math.abs(H-Z)*B.ovalScalar,Math.abs(X-q)*B.ovalScalar,Math.PI/10*B.wobble,0,2*Math.PI);else if(B.shape==="star")for(var ae=Math.PI/2*3,ne=4*B.scalar,se=8*B.scalar,ue=B.x,Ne=B.y,Qe=5,J=Math.PI/Qe;Qe--;)ue=B.x+Math.cos(ae)*se,Ne=B.y+Math.sin(ae)*se,I.lineTo(ue,Ne),ae+=J,ue=B.x+Math.cos(ae)*ne,Ne=B.y+Math.sin(ae)*ne,I.lineTo(ue,Ne),ae+=J;else I.moveTo(Math.floor(B.x),Math.floor(B.y)),I.lineTo(Math.floor(B.wobbleX),Math.floor(q)),I.lineTo(Math.floor(H),Math.floor(X)),I.lineTo(Math.floor(Z),Math.floor(B.wobbleY));return I.closePath(),I.fill(),B.tick<B.totalTicks}function D(I,B,K,Z,q){var H=B.slice(),X=I.getContext("2d"),G,ee,re=d(function(W){function Q(){G=ee=null,X.clearRect(0,0,Z.width,Z.height),u.clear(),q(),W()}function L(){s&&!(Z.width===a.width&&Z.height===a.height)&&(Z.width=I.width=a.width,Z.height=I.height=a.height),!Z.width&&!Z.height&&(K(I),Z.width=I.width,Z.height=I.height),X.clearRect(0,0,Z.width,Z.height),H=H.filter(function(te){return T(X,te)}),H.length?G=m.frame(L):Q()}G=m.frame(L),ee=Q});return{addFettis:function(W){return H=H.concat(W),re},canvas:I,promise:re,reset:function(){G&&m.cancel(G),ee&&ee()}}}function A(I,B){var K=!I,Z=!!v(B||{},"resize"),q=!1,H=v(B,"disableForReducedMotion",Boolean),X=i&&!!v(B||{},"useWorker"),G=X?f():null,ee=K?_:C,re=I&&G?!!I.__confetti_initialized:!1,W=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Q;function L(ae,ne,se){for(var ue=v(ae,"particleCount",y),Ne=v(ae,"angle",Number),Qe=v(ae,"spread",Number),J=v(ae,"startVelocity",Number),de=v(ae,"decay",Number),ve=v(ae,"gravity",Number),Le=v(ae,"drift",Number),$e=v(ae,"colors",S),De=v(ae,"ticks",Number),oe=v(ae,"shapes"),xe=v(ae,"scalar"),Ze=!!v(ae,"flat"),it=N(ae),ct=ue,Oe=[],pe=I.width*it.x,le=I.height*it.y;ct--;)Oe.push(R({x:pe,y:le,angle:Ne,spread:Qe,startVelocity:J,color:$e[ct%$e.length],shape:oe[b(0,oe.length)],ticks:De,decay:de,gravity:ve,drift:Le,scalar:xe,flat:Ze}));return Q?Q.addFettis(Oe):(Q=D(I,Oe,ee,ne,se),Q.promise)}function te(ae){var ne=H||v(ae,"disableForReducedMotion",Boolean),se=v(ae,"zIndex",Number);if(ne&&W)return d(function(J){J()});
1083K&&Q?I=Q.canvas:K&&!I&&(I=k(se),document.body.appendChild(I)),Z&&!re&&ee(I);var ue={width:I.width,height:I.height};G&&!re&&G.init(I),re=!0,G&&(I.__confetti_initialized=!0);function Ne(){if(G){var J={getBoundingClientRect:function(){if(!K)return I.getBoundingClientRect()}};ee(J),G.postMessage({resize:{width:J.width,height:J.height}});return}ue.width=ue.height=null}function Qe(){Q=null,Z&&(q=!1,t.removeEventListener("resize",Ne)),K&&I&&(document.body.contains(I)&&document.body.removeChild(I),I=null,re=!1)}return Z&&!q&&(q=!0,t.addEventListener("resize",Ne,!1)),G?G.fire(ae,ue,Qe):L(ae,ue,Qe)}return te.reset=function(){G&&G.reset(),Q&&Q.reset()},te}var V;function U(){return V||(V=A(null,{useWorker:!0,resize:!0})),V}function O(I,B,K,Z,q,H,X){var G=new Path2D(I),ee=new Path2D;ee.addPath(G,new DOMMatrix(B));var re=new Path2D;return re.addPath(ee,new DOMMatrix([Math.cos(X)*q,Math.sin(X)*q,-Math.sin(X)*H,Math.cos(X)*H,K,Z])),re}function M(I){if(!o)throw new Error("path confetti are not supported in this browser");var B,K;typeof I=="string"?B=I:(B=I.path,K=I.matrix);var Z=new Path2D(B),q=document.createElement("canvas"),H=q.getContext("2d");if(!K){for(var X=1e3,G=X,ee=X,re=0,W=0,Q,L,te=0;te<X;te+=2)for(var ae=0;ae<X;ae+=2)H.isPointInPath(Z,te,ae,"nonzero")&&(G=Math.min(G,te),ee=Math.min(ee,ae),re=Math.max(re,te),W=Math.max(W,ae));Q=re-G,L=W-ee;var ne=10,se=Math.min(ne/Q,ne/L);K=[se,0,0,se,-Math.round(Q/2+G)*se,-Math.round(L/2+ee)*se]}return{type:"path",path:B,matrix:K}}function $(I){var B,K=1,Z="#000000",q='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof I=="string"?B=I:(B=I.text,K="scalar"in I?I.scalar:K,q="fontFamily"in I?I.fontFamily:q,Z="color"in I?I.color:Z);var H=10*K,X=""+H+"px "+q,G=new OffscreenCanvas(H,H),ee=G.getContext("2d");ee.font=X;var re=ee.measureText(B),W=Math.ceil(re.actualBoundingBoxRight+re.actualBoundingBoxLeft),Q=Math.ceil(re.actualBoundingBoxAscent+re.actualBoundingBoxDescent),L=2,te=re.actualBoundingBoxLeft+L,ae=re.actualBoundingBoxAscent+L;W+=L+L,Q+=L+L,G=new OffscreenCanvas(W,Q),ee=G.getContext("2d"),ee.font=X,ee.fillStyle=Z,ee.fillText(B,te,ae);var ne=1/K;return{type:"bitmap",bitmap:G.transferToImageBitmap(),matrix:[ne,0,0,ne,-W*ne/2,-Q*ne/2]}}n.exports=function(){return U().apply(this,arguments)},n.exports.reset=function(){U().reset()},n.exports.create=A,n.exports.shapeFromPath=M,n.exports.shapeFromText=$})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),D5,!1);const $K=D5.exports;D5.exports.create;const Gk=["#0ea5e9","#3b82f6","#ec4899","#ef4444","#f97316","#eab308","#22c55e","#06b6d4"],rje=({userId:e,selectedFolderId:t,onFolderSelect:n})=>{const{toast:s}=Gr(),[a,i]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(!1),[u,m]=h.useState(""),[f,p]=h.useState(Gk[0]),[x,g]=h.useState(!1);h.useEffect(()=>{v()},[e]);const v=async()=>{try{const{data:w,error:S}=await F.from("video_folders").select("id, name, color").eq("user_id",e).order("name");if(S)throw S;i(w||[])}catch(w){console.error("Failed to fetch folders:",w)}finally{l(!1)}},y=async()=>{if(u.trim()){g(!0);try{const{data:w,error:S}=await F.from("video_folders").insert({user_id:e,name:u.trim(),color:f}).select("id, name, color").single();if(S)throw S;i([...a,w]),n(w.id),s({title:"Folder created"}),d(!1),m("")}catch(w){s({title:"Error",description:w.message,variant:"destructive"})}finally{g(!1)}}},b=a.find(w=>w.id===t);return r.jsxs("div",{children:[r.jsx(ye,{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Save to folder (optional)"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(kn,{value:t||"none",onValueChange:w=>n(w==="none"?null:w),disabled:o,children:[r.jsx(wn,{className:"flex-1",children:r.jsx(En,{children:o?r.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):b?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:b.color}}),r.jsx("span",{children:b.name})]}):r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx(cN,{className:"w-4 h-4"}),r.jsx("span",{children:"No folder (main library)"})]})})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(cN,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{children:"No folder (main library)"})]})}),a.map(w=>r.jsx(_t,{value:w.id,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:w.color}}),r.jsx("span",{children:w.name})]})},w.id))]})]}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>{m(""),p(Gk[0]),d(!0)},title:"Create new folder",children:r.jsx(Ns,{className:"w-4 h-4"})})]}),r.jsx(It,{open:c,onOpenChange:d,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Create Folder"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Folder Name"}),r.jsx(He,{value:u,onChange:w=>m(w.target.value),placeholder:"My Folder",onKeyDown:w=>{w.key==="Enter"&&u.trim()&&y()}})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex gap-2 mt-2",children:Gk.map(w=>r.jsx("button",{type:"button",onClick:()=>p(w),className:`w-8 h-8 rounded-full transition-transform ${f===w?"scale-110 ring-2 ring-offset-2 ring-primary":""}`,style:{backgroundColor:w}},w))})]}),r.jsx(P,{onClick:y,disabled:x||!u.trim(),className:"w-full",children:x?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Create Folder"})]})]})})]})};var e2="Tabs",[nje,iit]=Ss(e2,[sh]),VK=sh(),[sje,M5]=nje(e2),UK=h.forwardRef((e,t)=>
1083{const{__scopeTabs:n,value:s,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Yc(l),[m,f]=Zs({prop:s,onChange:a,defaultProp:i??"",caller:e2});return r.jsx(sje,{scope:n,baseId:ji(),value:m,onValueChange:f,orientation:o,dir:u,activationMode:c,children:r.jsx(ut.div,{dir:u,"data-orientation":o,...d,ref:t})})});UK.displayName=e2;var FK="TabsList",BK=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...a}=e,i=M5(FK,n),o=VK(n);return r.jsx(K_,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:s,children:r.jsx(ut.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});BK.displayName=FK;var zK="TabsTrigger",qK=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:a=!1,...i}=e,o=M5(zK,n),l=VK(n),c=YK(o.baseId,s),d=GK(o.baseId,s),u=s===o.value;return r.jsx(X_,{asChild:!0,...l,focusable:!a,active:u,children:r.jsx(ut.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,m=>{!a&&m.button===0&&m.ctrlKey===!1?o.onValueChange(s):m.preventDefault()}),onKeyDown:We(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&o.onValueChange(s)}),onFocus:We(e.onFocus,()=>{const m=o.activationMode!=="manual";!u&&!a&&m&&o.onValueChange(s)})})})});qK.displayName=zK;var HK="TabsContent",WK=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:a,children:i,...o}=e,l=M5(HK,n),c=YK(l.baseId,s),d=GK(l.baseId,s),u=s===l.value,m=h.useRef(u);return h.useEffect(()=>{const f=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(f)},[]),r.jsx(_s,{present:a||u,children:({present:f})=>r.jsx(ut.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:f&&i})})});WK.displayName=HK;function YK(e,t){return`${e}-trigger-${t}`}function GK(e,t){return`${e}-content-${t}`}var aje=UK,KK=BK,XK=qK,ZK=WK;const ec=aje,pl=h.forwardRef(({className:e,...t},n)=>r.jsx(KK,{ref:n,className:ge("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));pl.displayName=KK.displayName;const tn=h.forwardRef(({className:e,...t},n)=>r.jsx(XK,{ref:n,className:ge("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));tn.displayName=XK.displayName;const Fn=h.forwardRef(({className:e,...t},n)=>r.jsx(ZK,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fn.displayName=ZK.displayName;var QK=["PageUp","PageDown"],JK=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],eX={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Sv="Slider",[lR,ije,oje]=Qm(Sv),[tX,oit]=Ss(Sv,[oje]),[lje,t2]=tX(Sv),rX=h.forwardRef((e,t)=>{const{name:n,min:s=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[s],value:u,onValueChange:m=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:x,...g}=e,v=h.useRef(new Set),y=h.useRef(0),w=o==="horizontal"?cje:dje,[S=[],j]=Zs({prop:u,defaultProp:d,onChange:R=>{var D;(D=[...v.current][y.current])==null||D.focus(),m(R)}}),N=h.useRef(S);function _(R){const T=pje(S,R);E(R,T)}function C(R){E(R,y.current)}function k(){const R=N.current[y.current];S[y.current]!==R&&f(S)}function E(R,T,{commit:D}={commit:!1}){const A=yje(i),V=bje(Math.round((R-s)/i)*i+s,A),U=Xb(V,[s,a]);j((O=[])=>{const M=hje(O,U,T);if(vje(M,c*i)){y.current=M.indexOf(U);const $=String(M)!==String(O);return $&&D&&f(M),$?M:O}else return O})}return r.jsx(lje,{scope:e.__scopeSlider,name:n,disabled:l,min:s,max:a,valueIndexToChangeRef:y,thumbs:v.current,values:S,orientation:o,form:x,children:r.jsx(lR.Provider,{scope:e.__scopeSlider,children:r.jsx(lR.Slot,{scope:e.__scopeSlider,children:r.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:We(g.onPointerDown,()=>{l||(N.current=S)}),min:s,max:a,inverted:p,onSlideStart:l?void 0:_,onSlideMove:l?void 0:C,onSlideEnd:l?void 0:k,onHomeKeyDown:()=>!l&&E(s,0,{commit:!0}),onEndKeyDown:()=>!l&&E(a,S.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:T})=>
1083{if(!l){const V=QK.includes(R.key)||R.shiftKey&&JK.includes(R.key)?10:1,U=y.current,O=S[U],M=i*V*T;E(O+M,U,{commit:!0})}}})})})})});rX.displayName=Sv;var[nX,sX]=tX(Sv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),cje=h.forwardRef((e,t)=>{const{min:n,max:s,dir:a,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=e,[m,f]=h.useState(null),p=Ht(t,w=>f(w)),x=h.useRef(void 0),g=Yc(a),v=g==="ltr",y=v&&!i||!v&&i;function b(w){const S=x.current||m.getBoundingClientRect(),j=[0,S.width],_=I5(j,y?[n,s]:[s,n]);return x.current=S,_(w-S.left)}return r.jsx(nX,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:r.jsx(aX,{dir:g,"data-orientation":"horizontal",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=b(w.clientX);o==null||o(S)},onSlideMove:w=>{const S=b(w.clientX);l==null||l(S)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:w=>{const j=eX[y?"from-left":"from-right"].includes(w.key);d==null||d({event:w,direction:j?-1:1})}})})}),dje=h.forwardRef((e,t)=>{const{min:n,max:s,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...d}=e,u=h.useRef(null),m=Ht(t,u),f=h.useRef(void 0),p=!a;function x(g){const v=f.current||u.current.getBoundingClientRect(),y=[0,v.height],w=I5(y,p?[s,n]:[n,s]);return f.current=v,w(g-v.top)}return r.jsx(nX,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:r.jsx(aX,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const v=x(g.clientY);i==null||i(v)},onSlideMove:g=>{const v=x(g.clientY);o==null||o(v)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:g=>{const y=eX[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:y?-1:1})}})})}),aX=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...d}=e,u=t2(Sv,n);return r.jsx(ut.span,{...d,ref:t,onKeyDown:We(e.onKeyDown,m=>{m.key==="Home"?(o(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):QK.concat(JK).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:We(e.onPointerDown,m=>{const f=m.target;f.setPointerCapture(m.pointerId),m.preventDefault(),u.thumbs.has(f)?f.focus():s(m)}),onPointerMove:We(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&a(m)}),onPointerUp:We(e.onPointerUp,m=>{const f=m.target;f.hasPointerCapture(m.pointerId)&&(f.releasePointerCapture(m.pointerId),i(m))})})}),iX="SliderTrack",oX=h.forwardRef((e,t)=>{const{__scopeSlider:n,...s}=e,a=t2(iX,n);return r.jsx(ut.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:t})});oX.displayName=iX;var cR="SliderRange",lX=h.forwardRef((e,t)=>{const{__scopeSlider:n,...s}=e,a=t2(cR,n),i=sX(cR,n),o=h.useRef(null),l=Ht(t,o),c=a.values.length,d=a.values.map(f=>uX(f,a.min,a.max)),u=c>1?Math.min(...d):0,m=100-Math.max(...d);return r.jsx(ut.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...s,ref:l,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:m+"%"}})});lX.displayName=cR;var dR="SliderThumb",cX=h.forwardRef((e,t)=>{const n=ije(e.__scopeSlider),[s,a]=h.useState(null),i=Ht(t,l=>a(l)),o=h.useMemo(()=>s?n().findIndex(l=>l.ref.current===s):-1,[n,s]);return r.jsx(uje,{...e,ref:i,index:o})}),uje=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:s,name:a,...i}=e,o=t2(dR,n),l=sX(dR,n),[c,d]=h.useState(null),u=Ht(t,b=>d(b)),m=c?o.form||!!c.closest("form"):!0,f=mw(c),p=o.values[s],x=p===void 0?0:uX(p,o.min,o.max),g=fje(s,o.values.length),v=f==null?void 0:f[l.size],y=v?xje(v,x,l.direction):0;return h.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),r.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${y}px)`},children:[r.jsx(lR.ItemSlot,{scope:e.__scopeSlider,children:r.jsx(ut.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:u,style:p===void 0?{display:"none"}:e.style,onFocus:We(e.onFocus,()=>{o.valueIndexToChangeRef.current=s})})}),m&&r.jsx(dX,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},s)]})});cX.displayName=dR;var mje="RadioBubbleInput",dX=h.forwardRef(({__scopeSlider:e,value:t,...n},s)=>{const a=h.useRef(null),i=Ht(a,s),o=jv(t);return h.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const m=new Event("input",{bubbles:!0});u.call(l,t),l.dispatchEvent(m)}},[o,t]),r.jsx(ut.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});dX.displayName=mje;function hje(e=[],t,n){const s=[...e];return s[n]=t,s.sort((a,i)=>a-i)}function uX(e,t,n){const i=100/(n-t)*(e-t);return Xb(i,[0,100])}function fje(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function pje(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),s=Math.min(...n);return n.indexOf(s)}function xje(e,t,n){const s=e/2,i=I5([0,50],[0,s]);return(s-i(t)*n)*n}function gje(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function vje(e,t){if(t>0){const n=gje(e);return Math.min(...n)>=t}return!0}function I5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(n-e[0])}}function yje(e){return(String(e).split(".")[1]||"").length}function bje(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var mX=rX,wje=oX,jje=lX,Nje=cX;const zm=h.forwardRef(({className:e,...t},n)=>r.jsxs(mX,{ref:n,className:ge("relative flex w-full touch-none select-none items-center",e),...t,children:[r.jsx(wje,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:r.jsx(jje,{className:"absolute h-full bg-primary"})}),r.jsx(Nje,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));zm.displayName=mX.displayName;var Sje=Object.defineProperty,_je=(e,t,n)=>t in e?Sje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ks=(e,t,n)=>_je(e,typeof t!="symbol"?t+"":t,n);const AN={x:0,y:0,width:0,height:0,unit:"px"},Ep=(e,t,n)=>Math.min(Math.max(e,t),n),Cje=(...e)=>e.filter(t=>t&&typeof t=="string").join(" "),n6=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function r2(e,t,n,s){const a=oc(e,n,s);return e.width&&(a.height=a.width/t),e.height&&(a.width=a.height*t),a.y+a.height>s&&(a.height=s-a.y,a.width=a.height*t),a.x+a.width>n&&(a.width=n-a.x,a.height=a.width/t),e.unit==="%"?Uu(a,n,s):a}function n2(e,t,n){const s=oc(e,t,n);return s.x=(t-s.width)/2,s.y=(n-s.height)/2,e.unit==="%"?Uu(s,t,n):s}function Uu(e,t,n){return e.unit==="%"?{...AN,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function oc(e,t,n){return e.unit?e.unit==="px"?{...AN,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...AN,...e,unit:"px"}}function s6(e,t,n,s,a,i=0,o=0,l=s,c=a){const d={...e};let u=Math.min(i,s),m=Math.min(o,a),f=Math.min(l,s),p=Math.min(c,a);t&&(t>1?(u=o?o*t:u,m=u/t,f=l*t):(m=i?i/t:m,u=m*t,p=c/t)),d.y<0&&(d.height=Math.max(d.height+d.y,m),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,u),d.x=0);const x=s-(d.x+d.width);x<0&&(d.x=Math.min(d.x,s-u),d.width+=x);const g=a-(d.y+d.height);if(g<0&&(d.y=Math.min(d.y,a-m),d.height+=g),d.width<u&&((n==="sw"||n=="nw")&&(d.x-=u-d.width),d.width=u),d.height<m&&((n==="nw"||n=="ne")&&(d.y-=m-d.height),d.height=m),d.width>f&&((n==="sw"||n=="nw")&&(d.x-=f-d.width),d.width=f),d.height>p&&((n==="nw"||n=="ne")&&(d.y-=p-d.height),d.height=p),t){const v=d.width/d.height;if(v<t){const y=Math.max(d.width/t,m);(n==="nw"||n=="ne")&&(d.y-=y-d.height),d.height=y}else if(v>t){const y=Math.max(d.height*t,u);(n==="sw"||n=="nw")&&(d.x-=y-d.width),d.width=y}}return d}function kje(e,t,n,s){const a={...e};return t==="ArrowLeft"?s==="nw"?(a.x-=n,a.y-=n,a.width+=n,a.height+=n):s==="w"?(a.x-=n,a.width+=n):s==="sw"?(a.x-=n,a.width+=n,a.height+=n):s==="ne"?(a.y+=n,a.width-=n,a.height-=n):s==="e"?a.width-=n:s==="se"&&(a.width-=n,a.height-=n):t==="ArrowRight"&&(s==="nw"?(a.x+=n,a.y+=n,a.width-=n,a.height-=n):s==="w"?(a.x+=n,a.width-=n):s==="sw"?(a.x+=n,a.width-=n,a.height-=n):s==="ne"?(a.y-=n,a.width+=n,a.height+=n):s==="e"?a.width+=n:s==="se"&&(a.width+=n,a.height+=n)),t==="ArrowUp"?s==="nw"?(a.x-=n,a.y-=n,a.width+=n,a.height+=n):s==="n"?(a.y-=n,a.height+=n):s==="ne"?(a.y-=n,a.width+=n,a.height+=n):s==="sw"?(a.x+=n,a.width-=n,a.height-=n):s==="s"?a.height-=n:s==="se"&&(a.width-=n,a.height-=n):t==="ArrowDown"&&(s==="nw"?(a.x+=n,a.y+=n,a.width-=n,a.height-=n):s==="n"?(a.y+=n,a.height-=n):s==="ne"?(a.y+=n,a.width-=n,a.height-=n):s==="sw"?(a.x-=n,a.width+=n,a.height+=n):s==="s"?a.height+=n:s==="se"&&(a.width+=n,a.height+=n)),a}const Ap={capture:!0,passive:!1};let Eje=0;const Du=class Al extends h.PureComponent{constructor(){super(...arguments),ks(this,"docMoveBound",!1),ks(this,"mouseDownOnCrop",!1),ks(this,"dragStarted",!1),ks(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),ks(this,"componentRef",h.createRef()),ks(this,"mediaRef",h.createRef()),ks(this,"resizeObserver"),ks(this,"initChangeCalled",!1),ks(this,"instanceId",`rc-${Eje++}`),ks(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),ks(this,"onCropPointerDown",t=>{const{crop:n,disabled:s}=this.props,a=this.getBox();if(!n)return;const i=oc(n,a.width,a.height);if(s)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const o=t.target.dataset.ord,l=!!o;let c=t.clientX,d=t.clientY,u=i.x,m=i.y;if(o){const f=t.clientX-a.x,p=t.clientY-a.y;let x=0,g=0;o==="ne"||o=="e"?(x=f-(i.x+i.width),g=p-i.y,u=i.x,m=i.y+i.height):o==="se"||o==="s"?(x=f-(i.x+i.width),g=p-(i.y+i.height),u=i.x,m=i.y):o==="sw"||o=="w"?(x=f-i.x,g=p-(i.y+i.height),u=i.x+i.width,m=i.y):(o==="nw"||o=="n")&&(x=f-i.x,g=p-i.y,u=i.x+i.width,m=i.y+i.height),c=u+a.x+x,d=m+a.y+g}this.evData={startClientX:c,startClientY:d,startCropX:u,startCropY:m,clientX:t.clientX,clientY:t.clientY,isResize:l,ord:o},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),ks(this,"onComponentPointerDown",t=>{const{crop:n,disabled:s,locked:a,keepSelection:i,onChange:o}=this.props,l=this.getBox();if(s||a||i&&n)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const c=t.clientX-l.x,d=t.clientY-l.y,u={unit:"px",x:c,y:d,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:c,startCropY:d,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(oc(u,l.width,l.height),Uu(u,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),ks(this,"onDocPointerMove",t=>{const{crop:n,disabled:s,onChange:a,onDragStart:i}=this.props,o=this.getBox();if(s||!n||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(t));const{evData:l}=this;l.clientX=t.clientX,l.clientY=t.clientY;let c;l.isResize?c=this.resizeCrop():c=this.dragCrop(),n6(n,c)||a(oc(c,o.width,o.height),Uu(c,o.width,o.height))}),ks(this,"onComponentKeyDown",t=>{const{crop:n,disabled:s,onChange:a,onComplete:i}=this.props;if(s)return;const o=t.key;let l=!1;if(!n)return;const c=this.getBox(),d=this.makePixelCrop(c),u=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Al.nudgeStepLarge:t.shiftKey?Al.nudgeStepMedium:Al.nudgeStep;if(o==="ArrowLeft"?(d.x-=u,l=!0):o==="ArrowRight"?(d.x+=u,l=!0):o==="ArrowUp"?(d.y-=u,l=!0):o==="ArrowDown"&&(d.y+=u,l=!0),l){t.cancelable&&t.preventDefault(),d.x=Ep(d.x,
10830,c.width-d.width),d.y=Ep(d.y,0,c.height-d.height);const m=oc(d,c.width,c.height),f=Uu(d,c.width,c.height);a(m,f),i&&i(m,f)}}),ks(this,"onHandlerKeyDown",(t,n)=>{const{aspect:s=0,crop:a,disabled:i,minWidth:o=0,minHeight:l=0,maxWidth:c,maxHeight:d,onChange:u,onComplete:m}=this.props,f=this.getBox();if(i||!a)return;if(t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="ArrowLeft"||t.key==="ArrowRight")t.stopPropagation(),t.preventDefault();else return;const p=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Al.nudgeStepLarge:t.shiftKey?Al.nudgeStepMedium:Al.nudgeStep,x=oc(a,f.width,f.height),g=kje(x,t.key,p,n),v=s6(g,s,n,f.width,f.height,o,l,c,d);if(!n6(a,v)){const y=Uu(v,f.width,f.height);u(v,y),m&&m(v,y)}}),ks(this,"onDocPointerDone",t=>{const{crop:n,disabled:s,onComplete:a,onDragEnd:i}=this.props,o=this.getBox();this.unbindDocMove(),!(s||!n)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(t),a&&a(oc(n,o.width,o.height),Uu(n,o.width,o.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),ks(this,"onDragFocus",()=>{var t;(t=this.componentRef.current)==null||t.scrollTo(0,0)})}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:n,y:s,width:a,height:i}=t.getBoundingClientRect();return{x:n,y:s,width:a,height:i}}componentDidUpdate(t){const{crop:n,onComplete:s}=this.props;if(s&&!t.crop&&n){const{width:a,height:i}=this.getBox();a&&i&&s(oc(n,a,i),Uu(n,a,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Ap),this.document.addEventListener("pointerup",this.onDocPointerDone,Ap),this.document.addEventListener("pointercancel",this.onDocPointerDone,Ap),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Ap),this.document.removeEventListener("pointerup",this.onDocPointerDone,Ap),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Ap),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,n=this.getBox(),s=this.makePixelCrop(n),a=t.clientX-t.startClientX,i=t.clientY-t.startClientY;return s.x=Ep(t.startCropX+a,0,n.width-s.width),s.y=Ep(t.startCropY+i,0,n.height-s.height),s}getPointRegion(t,n,s,a){const{evData:i}=this,o=i.clientX-t.x,l=i.clientY-t.y;let c;a&&n?c=n==="nw"||n==="n"||n==="ne":c=l<i.startCropY;let d;return s&&n?d=n==="nw"||n==="w"||n==="sw":d=o<i.startCropX,d?c?"nw":"sw":c?"ne":"se"}resolveMinDimensions(t,n,s=0,a=0){const i=Math.min(s,t.width),o=Math.min(a,t.height);return!n||!i&&!o?[i,o]:n>1?i?[i,i/n]:[o*n,o]:o?[o*n,o]:[i,i/n]}resizeCrop(){const{evData:t}=this,{aspect:n=0,maxWidth:s,maxHeight:a}=this.props,i=this.getBox(),[o,l]=this.resolveMinDimensions(i,n,this.props.minWidth,this.props.minHeight);let c=this.makePixelCrop(i);const d=this.getPointRegion(i,t.ord,o,l),u=t.ord||d;let m=t.clientX-t.startClientX,f=t.clientY-t.startClientY;(o&&u==="nw"||u==="w"||u==="sw")&&(m=Math.min(m,-o)),(l&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-l));const p={unit:"px",x:0,y:0,width:0,height:0};d==="ne"?(p.x=t.startCropX,p.width=m,n?(p.height=p.width/n,p.y=t.startCropY-p.height):(p.height=Math.abs(f),p.y=t.startCropY-p.height)):d==="se"?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,n?p.height=p.width/n:p.height=f):d==="sw"?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),n?p.height=p.width/n:p.height=f):d==="nw"&&(p.x=t.startCropX+m,p.width=Math.abs(m),n?(p.height=p.width/n,p.y=t.startCropY-p.height):(p.height=Math.abs(f),p.y=t.startCropY+f));const x=s6(p,n,d,i.width,i.height,o,l,s,a);return n||Al.xyOrds.indexOf(u)>-1?c=x:Al.xOrds.indexOf(u)>-1?(c.x=x.x,c.width=x.width):Al.yOrds.indexOf(u)>-1&&(c.y=x.y,c.height=x.height),c.x=Ep(c.x,0,i.width-c.width),c.y=Ep(c.y,0,i.height-c.height),c}renderCropSelection(){const{ariaLabels:t=Al.defaultProps.ariaLabels,disabled:n,locked:s,renderSelectionAddon:a,ruleOfThirds:i,crop:o}=this.props,l=this.getCropStyle();if(o)return Y.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!s&&Y.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Y.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Y.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Y.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Y.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"nw"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"n"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"ne"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"e"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"se"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"s"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"sw"),role:"button"}),Y.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"w"),role:"button"})),a&&Y.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:c=>c.stopPropagation()},a(this.state)),i&&Y.createElement(Y.Fragment,null,Y.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Y.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(t){const n={...AN,...this.props.crop||{}};return oc(n,t.width,t.height)}render(){const{aspect:t,children:n,circularCrop:s,className:a,crop:i,disabled:o,locked:l,style:c,ruleOfThirds:d}=this.props,{cropIsActive:u,newCropIsBeingDrawn:m}=this.state,f=i?this.renderCropSelection():null,p=Cje("ReactCrop",a,u&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",m&&"ReactCrop--new-crop",i&&t&&"ReactCrop--fixed-aspect",i&&s&&"ReactCrop--circular-crop",i&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&i&&!i.width&&!i.height&&"ReactCrop--invisible-crop",s&&"ReactCrop--no-animate");return Y.createElement("div",{ref:this.componentRef,className:p,style:c},Y.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},n),i?Y.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},Y.createElement("defs",null,Y.createElement("mask",{id:`hole-${this.instanceId}`},Y.createElement("rect",{width:"100%",height:"100%",fill:"white"}),s?Y.createElement("ellipse",{cx:`${i.x+i.width/2}${i.unit}`,cy:`${i.y+i.height/2}${i.unit}`,rx:`${i.width/2}${i.unit}`,ry:`${i.height/2}${i.unit}`,fill:"black"}):Y.createElement("rect",{x:`${i.x}${i.unit}`,y:`${i.y}${i.unit}`,width:`${i.width}${i.unit}`,height:`${i.height}${i.unit}`,fill:"black"}))),Y.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,f)}};ks(Du,"xOrds",["e","w"]),ks(Du,"yOrds",["n","s"]),ks(Du,"xyOrds",["nw","ne","se","sw"]),ks(Du,"nudgeStep",1),ks(Du,"nudgeStepMedium",10),ks(Du,"nudgeStepLarge",100),ks(Du,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let s2=Du;const Aje=e=>{const t=e.duration;if(Number.isFinite(t)&&!Number.isNaN(t)&&t>0)return t;try{const n=e.seekable;if(n&&n.length>0){const s=n.end(n.length-1);if(Number.isFinite(s)&&s>0)return s}}catch{}return null},a6=(e,t={})=>{const n=t.width??t.height??640,s=t.width??640,a=t.height??360,i=t.quality??.85,o=t.timeoutMs??12e3;return new Promise((l,c)=>{const d=document.createElement("video");e.startsWith("blob:")||(d.crossOrigin="anonymous"),d.muted=!0,d.playsInl
1083ine=!0,d.preload="auto",d.setAttribute("webkit-playsinline","true"),d.style.position="fixed",d.style.left="-9999px",d.style.top="0",d.style.width="1px",d.style.height="1px",d.style.opacity="0",d.style.pointerEvents="none",document.body.appendChild(d);let u=!1;const m=()=>{try{d.pause(),d.removeAttribute("src"),d.load()}catch{}try{d.remove()}catch{}},f=y=>{u||(u=!0,m(),c(y instanceof Error?y:new Error("Failed to capture thumbnail")))},p=window.setTimeout(()=>{f(new Error("Thumbnail capture timed out"))},o),x=async()=>{let y=0;for(;(d.videoWidth===0||d.videoHeight===0)&&y<20;){try{await d.play(),d.pause()}catch{}await new Promise(k=>setTimeout(k,100)),y++}const b=d.videoWidth>0?d.videoWidth:s,w=d.videoHeight>0?d.videoHeight:a,S=d.videoWidth>0&&d.videoHeight>0;S||console.warn("Video dimensions not available for thumbnail, using fallback");let j,N;S?b>=w?(j=Math.min(n,b),N=Math.round(j*w/b)):(N=Math.min(n,w),j=Math.round(N*b/w)):(j=s,N=a);const _=document.createElement("canvas");_.width=j,_.height=N;const C=_.getContext("2d");if(!C){f(new Error("Canvas context unavailable"));return}try{C.drawImage(d,0,0,b,w,0,0,j,N)}catch(k){f(k);return}_.toBlob(k=>{if(!u){if(window.clearTimeout(p),!k||k.size<1e3){f(new Error("Failed to encode thumbnail"));return}u=!0,m(),l(k)}},"image/jpeg",i)};let g=!1;const v=()=>{g||(g=!0,x())};d.onloadeddata=async()=>{const y=Aje(d),b=y?Math.min(1,Math.max(.1,y*.1)):.1,w=t.time,S=typeof w=="number"&&Number.isFinite(w)?w:b,j=y?Math.max(0,Math.min(S,Math.max(0,y-.05))):Math.max(0,S);if(!y||!Number.isFinite(y)||e.startsWith("blob:")){try{d.muted=!0,await d.play();const N=j,_=setInterval(()=>{if(u){clearInterval(_);return}(d.currentTime>=N||d.ended)&&(clearInterval(_),d.pause(),v())},50);try{d.currentTime=N}catch{}setTimeout(()=>{clearInterval(_),g||(d.pause(),v())},3e3)}catch{setTimeout(()=>v(),200)}return}try{d.currentTime=j}catch{v()}},d.onseeked=()=>{v()},d.oncanplaythrough=()=>{setTimeout(()=>{g||v()},500)},d.onerror=()=>{f(new Error("Failed to load video for thumbnail capture"))},d.src=e;try{d.load()}catch{}e.startsWith("blob:")&&(setTimeout(async()=>{if(!g){try{await d.play(),d.pause()}catch{}!g&&d.readyState>=2&&v()}},500),setTimeout(()=>{!g&&d.readyState>=2&&v()},1500))})},i6=16/9,sy=e=>{const t=e.duration;if(Number.isFinite(t)&&!Number.isNaN(t)&&t>0)return t;try{const n=e.seekable;if(n&&n.length>0){const s=n.end(n.length-1);if(Number.isFinite(s)&&s>0)return s}}catch{}return null};function Tje(e,t,n){return n2(r2({unit:"%",width:90},n,e,t),e,t)}const Rje=({videoUrl:e,onThumbnailSelected:t,defaultThumbnail:n,knownDuration:s})=>{const a=h.useRef(null),i=h.useRef(null),o=h.useRef(null),l=h.useRef(null),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),m=h.useRef(!1),f=h.useRef(null),p=h.useRef(0),x=h.useRef(null),[g,v]=h.useState(.5),[y,b]=h.useState(s&&s>0?s:10),[w,S]=h.useState(!1),[j,N]=h.useState(null),[_,C]=h.useState(null),[k,E]=h.useState(!0),[R,T]=h.useState(!1),[D,A]=h.useState(!1),[V,U]=h.useState(null),[O,M]=h.useState(null),[$,I]=h.useState(null),[B,K]=h.useState(null),[Z,q]=h.useState(null),[H,X]=h.useState("auto"),[G,ee]=h.useState("auto"),[re,W]=h.useState(null),Q=h.useRef(null),[L,te]=h.useState(!1),[ae,ne]=h.useState(null),[se,ue]=h.useState(null),[Ne,Qe]=h.useState(!1),[J,de]=h.useState(),[ve,Le]=h.useState();h.useEffect(()=>{s&&Number.isFinite(s)&&s>0&&b(s)},[s]);const $e=h.useCallback(()=>new Promise((Re,Fe)=>{if(d.current&&m.current){Re(d.current);return}const Ae=d.current||document.createElement("video");Ae.muted=!0,Ae.playsInline=!0,Ae.preload="auto",Ae.setAttribute("webkit-playsinline","true"),e.startsWith("blob:")||(Ae.crossOrigin="anonymous"),Ae.style.position="fixed",Ae.style.left="-9999px",Ae.style.top="0",Ae.style.width="1px",Ae.style.height="1px",Ae.style.opacity="0",Ae.style.pointerEvents="none",Ae.parentElement||document.body.appendChild(Ae),d.current=Ae;const Ve=()=>{clearTimeout(St),Ae.removeEventListener("loadedmetadata",Ge),Ae.removeEventListener("loadeddata",Ge),Ae.removeEventListener("canplay",Ge),Ae.removeEventListener("error",et)},et=()=>{Ve(),Fe(new Error("Failed to load video"))},Ge=async()=>{Ve();try{await Ae.play(),Ae.pause()}catch{}let Tt=sy(Ae);if(!Tt||!Number.isFinite(Tt))try{await new Promise(Zt=>{const bt=()=>{Ae.removeEventListener("timeupdate",bt);try{Ae.currentTime=0}catch{}Zt()};Ae.addEventListener("timeupdate",bt,{once:!0});try{Ae.currentTime=Number.MAX_SAFE_INTEGER}catch{Ae.removeEventListener("timeupdate",bt),Zt()}setTimeout(()=>{Ae.removeEventListener("timeupdate",bt),Zt()},3e3)}),Tt=sy(Ae)}catch{}Tt&&Tt>0&&Number.isFinite(Tt)?b(Tt):s&&s>0&&b(s),m.current=!0,S(!0),Re(Ae)},St=setTimeout(()=>{Ve(),Fe(new Error("Video load timeout"))},12e3);Ae.addEventListener("loadedmetadata",Ge,{once:!0}),Ae.addEventListener("loadeddata",Ge,{once:!0}),Ae.addEventListener("canplay",Ge,{once:!0}),Ae.addEventListener("error",et,{once:!0}
1083),Ae.src!==e?(Ae.src=e,Ae.load()):Ae.readyState>=1&&Ge()}),[e,s]),De=h.useCallback(async(Re,Fe)=>{var Ue;u.current||(u.current=document.createElement("canvas"));const Ae=u.current,Ve=Ae.getContext("2d");if(!Ve)throw new Error("No canvas context");const et=++p.current,Ge=sy(Re)??(s&&Number.isFinite(s)&&s>0?s:null)??(y>0?y:null),St=Ge?Math.max(0,Math.min(Fe,Math.max(0,Ge-.05))):Math.max(0,Fe),Tt=(Ue=Re.src)==null?void 0:Ue.startsWith("blob:");if(!await new Promise(we=>{let pt=!1;const mt=at=>{pt||(pt=!0,clearTimeout(kt),Re.removeEventListener("seeked",er),we(at))},er=()=>mt(!0);Re.addEventListener("seeked",er,{once:!0});const kt=setTimeout(()=>mt(!1),Tt?600:1500);try{Re.currentTime=St}catch{mt(!1)}})&&et===p.current){const we=Re.playbackRate||1;try{Number.isFinite(Re.currentTime)&&Re.currentTime>St+.5&&(Re.currentTime=0,await new Promise(er=>setTimeout(er,50))),Re.playbackRate=16,await Re.play();const pt=Date.now(),mt=Math.min(8e3,Math.max(1500,St/16*1e3+1e3));await new Promise(er=>{const kt=setInterval(()=>{const at=Re.currentTime>=St-.15||Re.ended,Yt=Date.now()-pt>=mt,Ft=et!==p.current;(at||Yt||Ft)&&(clearInterval(kt),er())},40)})}catch{}finally{try{Re.pause()}catch{}Re.playbackRate=we}}if(await new Promise(we=>setTimeout(we,60)),et!==p.current)throw new Error("Frame capture superseded by a newer scrub request");const bt=Re.videoWidth||640,Wt=Re.videoHeight||360,{width:Xe,height:be}=rl(bt,Wt);return Ae.width=Xe,Ae.height=be,Ve.clearRect(0,0,Ae.width,Ae.height),Ve.drawImage(Re,0,0,bt,Wt,0,0,Xe,be),new Promise((we,pt)=>{Ae.toBlob(mt=>{if(et!==p.current){pt(new Error("Frame capture superseded by a newer scrub request"));return}mt&&mt.size>300?we(mt):pt(new Error("Frame capture produced empty image"))},"image/jpeg",.85)})},[s,y]),oe=h.useCallback(async()=>{if(e){E(!0),T(!1),S(!1);try{const Re=await $e(),Fe=await De(Re,.5),Ae=URL.createObjectURL(Fe);N(Ae),C(Fe),X("auto"),t(Fe),v(.5),console.log("Initial thumbnail captured, duration:",y)}catch(Re){console.error("Failed to capture initial thumbnail:",Re);try{const Fe=await a6(e,{time:.5,timeoutMs:1e4}),Ae=URL.createObjectURL(Fe);N(Ae),C(Fe),X("auto"),t(Fe),v(.5);const Ve=document.createElement("video");Ve.muted=!0,Ve.preload="metadata",e.startsWith("blob:")||(Ve.crossOrigin="anonymous"),Ve.src=e,await new Promise(et=>{const Ge=()=>{const St=sy(Ve);St&&St>0&&b(St),S(!0),Ve.src="",et()};Ve.addEventListener("loadedmetadata",Ge),setTimeout(()=>{S(!0),Ve.src="",et()},3e3),Ve.load()})}catch{T(!0),Pe.error("Could not load video. Try Upload or Webcam.")}}finally{E(!1)}}},[e,t,$e,De,y]);h.useCallback(()=>{const Re=d.current;if(!Re)return;const Fe=sy(Re);Fe&&Fe>0&&(b(Fe),S(!0),console.log("Scrubber video ready, duration:",Fe))},[]);const xe=h.useCallback(async Re=>{if(e){A(!0);try{const Fe=await $e(),Ae=await De(Fe,Re);N(Ve=>(Ve&&URL.revokeObjectURL(Ve),URL.createObjectURL(Ae))),C(Ae),X("auto"),t(Ae),console.log(`Frame captured at ${Re.toFixed(1)}s`)}catch(Fe){if(Fe instanceof Error&&Fe.message.includes("superseded"))return;try{const Ae=await a6(e,{time:Re,timeoutMs:1e4});N(Ve=>(Ve&&URL.revokeObjectURL(Ve),URL.createObjectURL(Ae))),C(Ae),X("auto"),t(Ae)}catch(Ae){console.error("Failed to capture frame:",Ae),Pe.error("Failed to capture frame. Try again.")}}finally{A(!1)}}},[e,t,$e,De]),Ze=h.useCallback(Re=>{const Fe=Re[0];v(Fe),w&&(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{xe(Fe)},250))},[xe,w]),it=h.useCallback(Re=>{const Fe=Re[0];f.current&&(clearTimeout(f.current),f.current=null),xe(Fe)},[xe]),ct=h.useCallback(()=>{if(d.current){try{d.current.pause(),d.current.removeAttribute("src"),d.current.load(),d.current.remove()}catch{}d.current=null,m.current=!1}},[]);h.useEffect(()=>{if(ct(),j&&URL.revokeObjectURL(j),N(null),C(null),S(!1),n){const Re=URL.createObjectURL(n);N(Re),C(n),X("auto"),E(!1),S(!0),e&&$e().catch(()=>{})}else oe()},[e]),h.useEffect(()=>()=>{f.current&&clearTimeout(f.current),ct(),j&&URL.revokeObjectURL(j),V&&URL.revokeObjectURL(V),O&&URL.revokeObjectURL(O),B&&URL.revokeObjectURL(B),se&&URL.revokeObjectURL(se.url),Q.current&&Q.current.getTracks().forEach(Re=>Re.stop()),x.current&&(x.current.close().catch(()=>{}),x.current=null)},[]),h.useEffect(()=>{G==="webcam"&&!re&&!L&&!se&&!B&&Oe(),G!=="webcam"&&re&&(re.getTracks().forEac
1083h(Re=>Re.stop()),W(null),Q.current=null,te(!1))},[G]);const Oe=async()=>{try{const Re=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:640,height:360}});W(Re),Q.current=Re,te(!0)}catch(Re){Pe.error("Could not access webcam"),console.error("Webcam error:",Re)}};h.useEffect(()=>{o.current&&re&&L&&(o.current.srcObject=re)},[re,L]);const pe=h.useCallback(async Re=>{try{const Fe=window.AudioContext||window.webkitAudioContext;if(!Fe)return;const Ae=x.current??new Fe;x.current=Ae,Ae.state==="suspended"&&await Ae.resume();const Ve=Ae.currentTime,et=Ae.createOscillator(),Ge=Ae.createGain();et.type="sine",et.frequency.setValueAtTime(Re===1?1046.5:783.99,Ve),Ge.gain.setValueAtTime(1e-4,Ve),Ge.gain.exponentialRampToValueAtTime(.16,Ve+.01),Ge.gain.exponentialRampToValueAtTime(1e-4,Ve+.22),et.connect(Ge),Ge.connect(Ae.destination),et.start(Ve),et.stop(Ve+.24)}catch{}},[]),le=h.useCallback(async()=>{try{const Re=window.AudioContext||window.webkitAudioContext;if(!Re)return;const Fe=x.current??new Re;x.current=Fe,Fe.state==="suspended"&&await Fe.resume();const Ae=Fe.currentTime,Ve=Fe.createBuffer(1,Fe.sampleRate*.14,Fe.sampleRate),et=Ve.getChannelData(0);for(let Zt=0;Zt<et.length;Zt+=1)et[Zt]=(Math.random()*2-1)*(1-Zt/et.length);const Ge=Fe.createBufferSource();Ge.buffer=Ve;const St=Fe.createBiquadFilter();St.type="bandpass",St.frequency.setValueAtTime(1800,Ae),St.Q.setValueAtTime(.8,Ae);const Tt=Fe.createGain();Tt.gain.setValueAtTime(1e-4,Ae),Tt.gain.exponentialRampToValueAtTime(.28,Ae+.005),Tt.gain.exponentialRampToValueAtTime(1e-4,Ae+.14),Ge.connect(St),St.connect(Tt),Tt.connect(Fe.destination),Ge.start(Ae),Ge.stop(Ae+.14)}catch{}},[]),ke=h.useCallback(async()=>{ae===null&&(await pe(3),ne(3))},[ae,pe]),Ee=h.useCallback(()=>{const Re=o.current;if(!Re||Re.readyState<2){console.warn("Video not ready for capture"),Pe.error("Camera not ready. Please try again.");return}le();const Fe=document.createElement("canvas"),Ae=Fe.getContext("2d");if(!Ae){Pe.error("Failed to capture photo");return}const Ve=Re.videoWidth||640,et=Re.videoHeight||360,{width:Ge,height:St}=rl(Ve,et);Fe.width=Ge,Fe.height=St,Ae.drawImage(Re,0,0,Ve,et,0,0,Ge,St),Fe.toBlob(Tt=>{if(Tt&&Tt.size>1e3){const Zt=URL.createObjectURL(Tt);ue({url:Zt,blob:Tt});const bt=Q.current;bt&&bt.getTracks().forEach(Wt=>Wt.stop()),W(null),Q.current=null,te(!1),Pe.success("Photo captured! Review and confirm below.")}else Pe.error("Failed to capture photo. Please try again.")},"image/jpeg",.9)},[le]);h.useEffect(()=>{if(ae===null)return;if(ae===0){Ee(),ne(null);return}const Re=setTimeout(()=>{const Fe=ae-1;Fe>0&&pe(Fe),ne(Fe)},1e3);return()=>clearTimeout(Re)},[ae,Ee,pe]);const ot=()=>{se&&(K(se.url),q(se.blob),X("webcam"),t(se.blob),ue(null))},gt=()=>{se&&(URL.revokeObjectURL(se.url),ue(null)),Oe()},Nt=Re=>{var Ve;const Fe=(Ve=Re.target.files)==null?void 0:Ve[0];if(!Fe)return;if(!Fe.type.startsWith("image/")){Pe.error("Please upload an image file");return}if(Fe.size>5*1024*1024){Pe.error("Image must be less than 5MB");return}const Ae=URL.createObjectURL(Fe);U(Ae),M(null),Qe(!0),c.current&&(c.current.value="")},Ct=h.useCallback(Re=>{const{width:Fe,height:Ae}=Re.currentTarget;de(Tje(Fe,Ae,i6))},[]),dt=h.useCallback(async()=>{if(!ve||!l.current){Pe.error("Please select a crop area");return}const Re=l.current,Fe=i.current||document.createElement("canvas"),Ae=Fe.getContext("2d");if(!Ae)return;const Ve=Re.naturalWidth/Re.width,et=Re.naturalHeight/Re.height,Ge=ve.x*Ve,St=ve.y*et,Tt=ve.width*Ve,Zt=ve.height*et,{width:bt,height:Wt}=rl(Tt,Zt);Fe.width=bt,Fe.height=Wt,Ae.imageSmoothingQuality="high",Ae.drawImage(Re,Ge,St,Tt,Zt,0,0,bt,Wt),Fe.toBlob(Xe=>{if(Xe){const be=URL.createObjectURL(Xe);M(be),I(Xe),X("upload"),t(Xe),Qe(!1),Pe.success("Image cropped successfully")}else Pe.error("Failed to crop image")},"image/jpeg",.9)},[ve,t]),tt=Re=>{const Fe=Math.floor(Re/60),Ae=Math.floor(Re%60);return`${Fe}:${Ae.toString().padStart(2,"0")}`};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("canvas",{ref:a,className:"hidden"}),r.jsx("canvas",{ref:i,className:"hidden"}),r.jsx("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:Nt}),r.jsx(It,{open:Ne,onOpenChange:Qe,children:r.jsxs(Dt,{className:"max-w-2xl",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx($m,{className:"w-5 h-5"}),"Crop Thumbnail"]}),r.jsx($r,{children:"Adjust the crop area for your thumbnail (16:9 aspect ratio)."})]}),r.jsx("div",{className:"relative max-h-[60vh] overflow-auto",children:V&&r.jsx(s2,{crop:J,onChange:Re=>de(Re),onComplete:Re=>Le(Re),aspect:i6,className:"max-w-full",children:r.jsx("img",{ref:l,src:V,alt:"Crop preview",onLoad:Ct,className:"max-w-full max-h-[55vh] object-contain"})})}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:()=>Qe(!1),children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Cancel"]}),r.jsxs(P,{onClick:dt,children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Apply Crop"]})]})]})}),r.jsxs(ec,{value:G,onValueChange:ee,className:"w-full",children:[r.jsxs(pl,{className:"grid w-full grid-cols-3 h-8",children:[r.jsxs(tn,{value:"auto",className:"text-xs",children:[r.jsx(cr,{className:"w-3 h-3 mr-1"}),"Scrub"]}),r.jsxs(tn,{value:"upload",className:"text-xs",children:[r.jsx(na,{className:"w-3 h-3 mr-1"}),"Upload"]}),r.jsxs(tn,{value:"webcam",className:"text-xs",children:[r.jsx(ga,{className:"w-3 h-3 mr-1"}),"Webcam"]})]}),r.jsx(Fn,{value:"auto",className:"space-y-3 mt-2",children:k?r.jsx("div",{className:"aspect-video bg-muted rounded-lg flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Me,{className:"w-6 h-6 animate-spin mx-auto mb-2 text-muted-foreground"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading video..."})]})}):R?r.jsx("div",{className:"aspect-video bg-muted rounded-lg flex items-center justify-center",children:r.jsxs("div",{className:"text-center p-4",children:[r.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Could not load video"}),r.jsxs(P,{variant:"outline",size:"sm",className:"text-xs",onClick:oe,children:[r.jsx(vs,{className:"w-3.5 h-3.5 mr-1.5"}),"Try Again"]})]})}):r.jsxs("div",{className:"space-y-3",children:[j&&r.jsxs("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:[r.jsx("img",{src:j,alt:"Scrubbed frame",className:"w-full h-full object-contain"}),D&&r.jsx("div",{className:"absolute inset-0 bg-background/40 flex items-center justify-center",children:r.jsx(Me,{className:"w-5 h-5 animate-spin text-primary"})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-muted-foreground w-8",children:tt(0)}),r.jsx(zm,{value:[g],min:.1,max:Math.max(.5,y-.1),step:.1,onValueChange:Ze,onValueCommit:it,className:"flex-1",disabled:!w||D}),r.jsx("span",{className:"text-[10px] text-muted-foreground w-8 text-right",children:tt(y)})]}),r.jsx("p",{className:"text-[10px] text-muted-foreground text-center",children:"Drag the slider to select a frame from any point in the video"})]})]})}),r.jsx(Fn,{value:"upload",className:"space-y-2 mt-2",children:O?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`relative aspect-video bg-muted rounded-lg overflow-hidden border-2 ${H==="upload"?"border-primary/50":"border-muted-foreground
1083/20"}`,children:[r.jsx("img",{src:O,alt:"Upload thumbnail",className:"w-full h-full object-cover"}),H==="upload"&&r.jsxs("div",{className:"absolute top-2 left-2 px-2 py-1 bg-primary text-primary-foreground rounded-md text-xs font-medium flex items-center gap-1",children:[r.jsx(nt,{className:"w-3 h-3"}),"Selected"]})]}),r.jsxs("div",{className:"flex gap-2",children:[H!=="upload"&&r.jsxs(P,{size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>{$&&(X("upload"),t($))},children:[r.jsx(nt,{className:"w-3.5 h-3.5 mr-1.5"}),"Use This"]}),r.jsxs(P,{variant:"outline",size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>{var Re;return(Re=c.current)==null?void 0:Re.click()},children:[r.jsx(na,{className:"w-3.5 h-3.5 mr-1.5"}),"Change Image"]}),r.jsxs(P,{variant:"outline",size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>Qe(!0),children:[r.jsx($m,{className:"w-3.5 h-3.5 mr-1.5"}),"Re-crop"]})]})]}):r.jsx("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden cursor-pointer border-2 border-dashed border-muted-foreground/25 hover:border-primary/50 transition-colors",onClick:()=>{var Re;return(Re=c.current)==null?void 0:Re.click()},children:r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(na,{className:"w-6 h-6 mx-auto mb-1 opacity-50"}),r.jsx("p",{className:"text-xs",children:"Click to upload an image"}),r.jsx("p",{className:"text-[10px] opacity-70",children:"Will be cropped to 16:9"})]})})})}),r.jsxs(Fn,{value:"webcam",className:"space-y-2 mt-2",children:[se&&!L&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden border-2 border-amber-500/50",children:[r.jsx("img",{src:se.url,alt:"Captured photo",className:"w-full h-full object-cover"}),r.jsx("div",{className:"absolute top-2 left-2 px-2 py-1 bg-amber-500 text-white rounded-md text-xs font-medium",children:"Review Photo"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",size:"sm",className:"flex-1 h-8 text-xs",onClick:gt,children:[r.jsx(vs,{className:"w-3.5 h-3.5 mr-1.5"}),"Retake"]}),r.jsxs(P,{size:"sm",className:"flex-1 h-8 text-xs",onClick:ot,children:[r.jsx(nt,{className:"w-3.5 h-3.5 mr-1.5"}),"Use as Thumbnail"]})]})]}),L&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:[r.jsx("video",{ref:o,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover scale-x-[-1]"}),ae!==null&&r.jsx("div",{className:"absolute inset-0 bg-background/60 backdrop-blur-sm flex items-center justify-center",children:r.jsx("div",{className:"text-6xl font-bold text-primary animate-pulse",children:ae})})]}),r.jsxs(P,{size:"sm",className:"w-full h-8 text-xs",onClick:ke,disabled:ae!==null,children:[r.jsx(ga,{className:"w-3.5 h-3.5 mr-1.5"}),ae!==null?`Capturing in ${ae}...`:"Take Photo (3s countdown)"]})]}),!L&&!se&&!B&&r.jsx("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(ga,{className:"w-6 h-6 mx-auto mb-1 opacity-50"}),r.jsx("p",{className:"text-xs",children:"Starting webcam..."})]})})}),B&&!L&&!se&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`relative aspect-video bg-muted rounded-lg overflow-hidden border-2 ${H==="webcam"?"border-primary/50":"border-muted-foreground/20"}`,children:[r.jsx("img",{src:B,alt:"Webcam thumbnail",className:"w-full h-full object-cover"}),H==="webcam"&&r.jsxs("div",{className:"absolute top-2 left-2 px-2 py-1 bg-primary text-primary-foreground rounded-md text-xs font-medium flex items-center gap-1",children:[r.jsx(nt,{className:"w-3 h-3"}),"Selected"]})]}),r.jsxs("div",{className:"flex gap-2",children:[H!=="webcam"&&r.jsxs(P,{size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>{Z&&(X("webcam"),t(Z))},children:[r.jsx(nt,{className:"w-3.5 h-3.5 mr-1.5"}),"Use This"]}),r.jsxs(P,{variant:"outline",size:"sm",className:"flex-1 h-8 text-xs",onClick:gt,children:[r.jsx(vs,{className:"w-3.5 h-3.5 mr-1.5"}),"Take New Photo"]})]})]})]})]})]})},L5=h.createContext({});function a2(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const $5=typeof window<"u",V5=$5?h.useLayoutEffect:h.useEffect,i2=h.createContext(null);function U5(e,t){e.indexOf(t)===-1&&e.push(t)}function F5(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Kd=(e,t,n)=>n>t?t:n<e?e:n;let TN=()=>{};const Xd={},hX=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function fX(e){return typeof e=="object"&&e!==null}const pX=e=>/^0[^.\s]+$/u.test(e);function B5(e){let t;return()=>(t===void 0&&(t=e()),t)}const dl=e=>e,Oje=(e,t)=>n=>t(e(n)),Nw=(...e)=>
vendor: 22,883 bytes, line 1083
1083e.reduce(Oje),Zb=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class z5{constructor(){this.subscriptions=[]}add(t){return U5(this.subscriptions,t),()=>F5(this.subscriptions,t)}notify(t,n,s){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,s);else for(let i=0;i<a;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ec=e=>e*1e3,nl=e=>e/1e3;function xX(e,t){return t?e*(1e3/t):0}const gX=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Pje=1e-7,Dje=12;function Mje(e,t,n,s,a){let i,o,l=0;do o=t+(n-t)/2,i=gX(o,s,a)-e,i>0?n=o:t=o;while(Math.abs(i)>Pje&&++l<Dje);return o}function Sw(e,t,n,s){if(e===t&&n===s)return dl;const a=i=>Mje(i,0,1,e,n);return i=>i===0||i===1?i:gX(a(i),t,s)}const vX=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yX=e=>t=>1-e(1-t),bX=Sw(.33,1.53,.69,.99),q5=yX(bX),wX=vX(q5),jX=e=>(e*=2)<1?.5*q5(e):.5*(2-Math.pow(2,-10*(e-1))),H5=e=>1-Math.sin(Math.acos(e)),NX=yX(H5),SX=vX(H5),Ije=Sw(.42,0,1,1),Lje=Sw(0,0,.58,1),_X=Sw(.42,0,.58,1),$je=e=>Array.isArray(e)&&typeof e[0]!="number",CX=e=>Array.isArray(e)&&typeof e[0]=="number",o6={linear:dl,easeIn:Ije,easeInOut:_X,easeOut:Lje,circIn:H5,circInOut:SX,circOut:NX,backIn:q5,backInOut:wX,backOut:bX,anticipate:jX},Vje=e=>typeof e=="string",l6=e=>{if(CX(e)){TN(e.length===4);const[t,n,s,a]=e;return Sw(t,n,s,a)}else if(Vje(e))return TN(o6[e]!==void 0),o6[e];return e},jj=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],c6={value:null,addProjectionMetrics:null};function Uje(e,t){let n=new Set,s=new Set,a=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function d(m){o.has(m)&&(u.schedule(m),e()),c++,m(l)}const u={schedule:(m,f=!1,p=!1)=>{const g=p&&a?n:s;return f&&o.add(m),g.has(m)||g.add(m),m},cancel:m=>{s.delete(m),o.delete(m)},process:m=>{if(l=m,a){i=!0;return}a=!0,[n,s]=[s,n],n.forEach(d),t&&c6.value&&c6.value.frameloop[t].push(c),c=0,n.clear(),a=!1,i&&(i=!1,u.process(m))}};return u}const Fje=40;function kX(e,t){let n=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=jj.reduce((w,S)=>(w[S]=Uje(i,t?S:void 0),w),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:u,update:m,preRender:f,render:p,postRender:x}=o,g=()=>{const w=Xd.useManualTiming?a.timestamp:performance.now();n=!1,Xd.useManualTiming||(a.delta=s?1e3/60:Math.max(Math.min(w-a.timestamp,Fje),1)),a.timestamp=w,a.isProcessing=!0,l.process(a),c.process(a),d.process(a),u.process(a),m.process(a),f.process(a),p.process(a),x.process(a),a.isProcessing=!1,n&&t&&(s=!1,e(g))},v=()=>{n=!0,s=!0,a.isProcessing||e(g)};return{schedule:jj.reduce((w,S)=>{const j=o[S];return w[S]=(N,_=!1,C=!1)=>(n||v(),j.schedule(N,_,C)),w},{}),cancel:w=>{for(let S=0;S<jj.length;S++)o[jj[S]].cancel(w)},state:a,steps:o}}const{schedule:As,cancel:qm,state:si,steps:Kk}=kX(typeof requestAnimationFrame<"u"?requestAnimationFrame:dl,!0);let w1;function Bje(){w1=void 0}const Qi={now:()=>(w1===void 0&&Qi.set(si.isProcessing||Xd.useManualTiming?si.timestamp:performance.now()),w1),set:e=>{w1=e,queueMicrotask(Bje)}},EX=e=>t=>typeof t=="string"&&t.startsWith(e),AX=EX("--"),zje=EX("var(--"),W5=e=>zje(e)?qje.test(e.split("/*")[0].trim()):!1,qje=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,_v={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qb={..._v,transform:e=>Kd(0,1,e)},Nj={..._v,default:1},sb=e=>Math.round(e*1e5)/1e5,Y5=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hje(e){return e==null}const Wje=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,G5=(e,t)=>n=>!!(typeof n=="string"&&Wje.test(n)&&n.startsWith(e)||t&&!Hje(n)&&Object.prototype.hasOwnProperty.call(n,t)),TX=(e,t,n)=>s=>{if(typeof s!="string")return s;const[a,i,o,l]=s.match(Y5);return{[e]:parseFloat(a),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Yje=e=>Kd(0,255,e),Xk={..._v,transform:e=>Math.round(Yje(e))},Hh={test:G5("rgb","red"),parse:TX("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Xk.transform(e)+", "+Xk.transform(t)+", "+Xk.transform(n)+", "+sb(Qb.transform(s))+")"};function Gje(e){let t="",n="",s="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,s+=s,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:a?parseInt(a,16)/255:1}}const uR={test:G5("#"),parse:Gje,transform:Hh.transform},_w=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mu=_w("deg"),Ac=_w("%"),vr=_w("px"),Kje=_w("vh"),Xje=_w("vw"),d6={...Ac,parse:e=>Ac.parse(e)/100,transform:e=>Ac.transform(e*100)},sx={test:G5("hsl","hue"),parse:TX("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Ac.transform(sb(t))+", "+Ac.transform(sb(n))+", "+sb(Qb.transform(s))+")"},ma={test:e=>Hh.test(e)||uR.test(e)||sx.test(e),parse:e=>Hh.test(e)?Hh.parse(e):sx.test(e)?sx.parse(e):uR.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hh.transform(e):sx.transform(e),getAnimatableNone:e=>{const t=ma.parse(e);return t.alpha=0,ma.transform(t)}},Zje=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Qje(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Y5))==null?void 0:t.length)||0)+(((n=e.match(Zje))==null?void 0:n.length)||0)>0}const RX="number",OX="color",Jje="var",e1e="var(",u6="${}",t1e=/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 Jb(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},a=[];let i=0;const l=t.replace(t1e,c=>(ma.test(c)?(s.color.push(i),a.push(OX),n.push(ma.parse(c))):c.startsWith(e1e)?(s.var.push(i),a.push(Jje),n.push(c)):(s.number.push(i),a.push(RX),n.push(parseFloat(c))),++i,u6)).split(u6);return{values:n,split:l,indexes:s,types:a}}function PX(e){return Jb(e).values}function DX(e){const{split:t,types:n}=Jb(e),s=t.length;return a=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],a[o]!==void 0){const l=n[o];l===RX?i+=sb(a[o]):l===OX?i+=ma.transform(a[o]):i+=a[o]}return i}}const r1e=e=>typeof e=="number"?0:ma.test(e)?ma.getAnimatableNone(e):e;function n1e(e){const t=PX(e);return DX(e)(t.map(r1e))}const Hm={test:Qje,parse:PX,createTransformer:DX,getAnimatableNone:n1e};function Zk(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 s1e({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let a=0,i=0,o=0;if(!t)a=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;a=Zk(c,l,e+1/3),i=Zk(c,l,e),o=Zk(c,l,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function RN(e,t){return n=>n>0?t:e}const Is=(e,t,n)=>e+(t-e)*n,Qk=(e,t,n)=>{const s=e*e,a=n*(t*t-s)+s;return a<0?0:Math.sqrt(a)},a1e=[uR,Hh,sx],i1e=e=>a1e.find(t=>t.test(e));function m6(e){const t=i1e(e);if(!t)return!1;let n=t.parse(e);return t===sx&&(n=s1e(n)),n}const h6=(e,t)=>{const n=m6(e),s=m6(t);if(!n||!s)return RN(e,t);const a={...n};return i=>(a.red=Qk(n.red,s.red,i),a.green=Qk(n.green,s.green,i),a.blue=Qk(n.blue,s.blue,i),a.alpha=Is(n.alpha,s.alpha,i),Hh.transform(a))},mR=new Set(["none","hidden"]);function o1e(e,t){return mR.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function l1e(e,t){return n=>Is(e,t,n)}function K5(e){return typeof e=="number"?l1e:typeof e=="string"?W5(e)?RN:ma.test(e)?h6:u1e:Array.isArray(e)?MX:typeof e=="object"?ma.test(e)?h6:c1e:RN}function MX(e,t){const n=[...e],s=n.length,a=e.map((i,o)=>K5(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=a[o](i);return n}}function c1e(e,t){const n={...e,...t},s={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(s[a]=K5(e[a])(e[a],t[a]));return a=>{for(const i in s)n[i]=s[i](a);return n}}function d1e(e,t){const n=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],o=e.indexes[i][s[i]],l=e.values[o]??0;n[a]=l,s[i]++}return n}const u1e=(e,t)=>{const n=Hm.createTransformer(t),s=Jb(e),a=Jb(t);return s.indexes.var.length===a.indexes.var.length&&s.indexes.color.length===a.indexes.color.length&&s.indexes.number.length>=a.indexes.number.length?mR.has(e)&&!a.values.length||mR.has(t)&&!s.values.length?o1e(e,t):Nw(MX(d1e(s,a),a.values),n):RN(e,t)};function IX(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Is(e,t,n):K5(e)(e,t)}const m1e=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>As.update(t,n),stop:()=>qm(t),now:()=>si.isProcessing?si.timestamp:Qi.now()}},LX=(e,t,n=10)=>{let s="";const a=Math.max(Math.round(t/n),2);for(let i=0;i<a;i++)s+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ON=2e4;function X5(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<ON;)t+=n,s=e.next(t);return t>=ON?1/0:t}function h1e(e,t=100,n){const s=n({...e,keyframes:[0,t]}),a=Math.min(X5(s),ON);return{type:"keyframes",ease:i=>s.next(a*i).value/t,duration:nl(a)}}const f1e=5;function $X(e,t,n){const s=Math.max(t-f1e,0);return xX(n-e(s),t-s)}const Ys={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},Jk=.001;function p1e({duration:e=Ys.duration,bounce:t=Ys.bounce,velocity:n=Ys.velocity,mass:s=Ys.mass}){let a,i,o=1-t;o=Kd(Ys.minDamping,Ys.maxDamping,o),e=Kd(Ys.minDuration,Ys.maxDuration,nl(e)),o<1?(a=d=>{const u=d*o,m=u*e,f=u-n,p=hR(d,o),x=Math.exp(-m);return Jk-f/p*x},i=d=>{const m=d*o*e,f=m*n+n,p=Math.pow(o,2)*Math.pow(d,2)*e,x=Math.exp(-m),g=hR(Math.pow(d,2),o);return(-a(d)+Jk>0?-1:1)*((f-p)*x)/g}):(a=d=>{const u=Math.exp(-d*e),m=(d-n)*e+1;return-Jk+u*m},i=d=>{const u=Math.exp(-d*e),m=(n-d)*(e*e);return u*m});const l=5/e,c=g1e(a,i,l);if(e=Ec(e),isNaN(c))return{stiffness:Ys.stiffness,damping:Ys.damping,duration:e};{const d=Math.pow(c,2)*s;return{stiffness:d,damping:o*2*Math.sqrt(s*d),duration:e}}}const x1e=12;function g1e(e,t,n){let s=n;for(let a=1;a<x1e;a++)s=s-e(s)/t(s);return s}function hR(e,t){return e*Math.sqrt(1-t*t)}const v1e=["duration","bounce"],y1e=["stiffness","damping","mass"];function f6(e,t){return t.some(n=>e[n]!==void 0)}function b1e(e){let t={velocity:Ys.velocity,stiffness:Ys.stiffness,damping:Ys.damping,mass:Ys.mass,isResolvedFromDuration:!1,...e};if(!f6(e,y1e)&&f6(e,v1e))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),a=s*s,i=2*Kd(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Ys.mass,stiffness:a,damping:i}}else{const n=p1e(e);t={...t,...n,mass:Ys.mass},t.isResolvedFromDuration=!0}return t}function PN(e=Ys.visualDuration,t=Ys.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:a}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:u,duration:m,velocity:f,isResolvedFromDuration:p}=b1e({...n,velocity:-nl(n.velocity||0)}),x=f||0,g=d/(2*Math.sqrt(c*u)),v=o-i,y=nl(Math.sqrt(c/u)),b=Math.abs(v)<5;s||(s=b?Ys.restSpeed.granular:Ys.restSpeed.default),a||(a=b?Ys.restDelta.granular:Ys.restDelta.default);let w;if(g<1){const j=hR(y,g);w=N=>{const _=Math.exp(-g*y*N);return o-_*((x+g*y*v)/j*Math.sin(j*N)+v*Math.cos(j*N))}}else if(g===1)w=j=>o-Math.exp(-y*j)*(v+(x+y*v)*j);else{const j=y*Math.sqrt(g*g-1);w=N=>{const _=Math.exp(-g*y*N),C=Math.min(j*N,300);return o-_*((x+g*y*v)*Math.sinh(C)+j*v*Math.cosh(C))/j}}const S={calculatedDuration:p&&m||null,next:j=>{const N=w(j);if(p)l.done=j>=m;else{let _=j===0?x:0;g<1&&(_=j===0?Ec(x):$X(w,j,N));const C=Math.abs(_)<=s,k=Math.abs(o-N)<=a;l.done=C&&k}return l.value=l.done?o:N,l},toString:()=>{const j=Math.min(X5(S),ON),N=LX(_=>S.next(j*_).value,j,30);return j+"ms "+N},toTransition:()=>{}};return S}PN.applyToOptions=e=>{const t=h1e(e,100,PN);return e.ease=t.ease,e.duration=Ec(t.duration),e.type="keyframes",e};function fR({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:u}){const m=e[0],f={done:!1,value:m},p=C=>l!==void 0&&C<l||c!==void 0&&C>c,x=C=>l===void 0?c:c===void 0||Math.abs(l-C)<Math.abs(c-C)?l:c;let g=n*t;const v=m+g,y=o===void 0?v:o(v);y!==v&&(g=y-m);const b=C=>-g*Math.exp(-C/s),w=C=>y+b(C),S=C=>{const k=b(C),E=w(C);f.done=Math.abs(k)<=d,f.value=f.done?y:E};let j,N;const _=C=>{p(f.value)&&(j=C,N=PN({keyframes:[f.value,x(f.value)],velocity:$X(w,C,f.value),damping:a,stiffness:i,restDelta:d,restSpeed:u}))};return _(0),{calculatedDuration:null,next:C=>{let k=!1;return!N&&j===void 0&&(k=!0,S(C),_(C)),j!==void 0&&C>=j?N.next(C-j):(!k&&S(C),f)}}}function w1e(e,t,n){const s=[],a=n||Xd.mix||IX,i=e.length-1;for(let o=0;o<i;o++){let l=a(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||dl:t;l=Nw(c,l)}s.push(l)}return s}function j1e(e,t,{clamp:n=!0,ease:s,mixer:a}={}){const i=e.length;if(TN(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=w1e(t,s,a),c=l.length,d=u=>{if(o&&u<e[0])return t[0];let m=0;if(c>1)for(;m<e.length-2&&!(u<e[m+1]);m++);const f=Zb(e[m],e[m+1],u);return l[m](f)};return n?u=>d(Kd(e[0],e[i-1],u)):d}function N1e(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const a=Zb(0,t,s);e.push(Is(n,1,a))}}function S1e(e){const t=[0];return N1e(t,e.length-1),t}function _1e(e,t){return e.map(n=>n*t)}function C1e(e,t){return e.map(()=>t||_X).splice(0,e.length-1)}function ab({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const a=$je(s)?s.map(l6):l6(s),i={done:!1,value:t[0]},o=_1e(n&&n.length===t.length?n:S1e(t),e),l=j1e(o,t,{ease:Array.isArray(a)?a:C1e(t,a)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const k1e=e=>e!==null;function Z5(e,{repeat:t,repeatType:n="loop"},s,a=1){const i=e.filter(k1e),l=a<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||s===void 0?i[l]:s}const E1e={decay:fR,inertia:fR,tween:ab,keyframes:ab,spring:PN};function VX(e){typeof e.type=="string"&&(e.type=E1e[e.type])}class Q5{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 A1e=e=>e/100;class J5 extends Q5{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,a;const{motionValue:n}=this.options;n&&n.updatedAt!==Qi.now()&&this.tick(Qi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(s=this.options).onStop)==null||a.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;VX(t);const{type:n=ab,repeat:s=0,repeatDelay:a=0,repeatType:i,velocity:o=0}=t;let{keyframes:l}=t;const c=n||ab;c!==ab&&typeof l[0]!="number"&&(this.mixKeyframes=Nw(A1e,IX(l[0],l[1])),l=[0,100]);const d=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=X5(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+a,this.totalDuration=this.resolvedDuration*(s+1)-a,this.generator=d}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:s,totalDuration:a,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:d=0,keyframes:u,repeat:m,repeatType:f,repeatDelay:p,type:x,onUpdate:g,finalKeyframe:v}=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 y=this.currentTime-d*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?y<0:y>a;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let w=this.currentTime,S=s;if(m){const C=Math.min(this.currentTime,a)/l;let k=Math.floor(C),E=C%1;!E&&C>=1&&(E=1),E===1&&k--,k=Math.min(k,m+1),!!(k%2)&&(f==="reverse"?(E=1-E,p&&(E-=p/l)):f==="mirror"&&(S=o)),w=Kd(0,1,E)*l}const j=b?{done:!1,value:u[0]}:S.next(w);i&&(j.value=i(j.value));let{done:N}=j;!b&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return _&&x!==fR&&(j.value=Z5(u,this.options,v,this.speed)),g&&g(j.value),_&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return nl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nl(t)}get time(){return nl(this.currentTime)}set time(t){var n;t=Ec(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Qi.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nl(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=m1e,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(a=this.options).onPlay)==null||i.call(a);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(Qi.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 T1e(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Wh=e=>e*180/Math.PI,pR=e=>{const t=Wh(Math.atan2(e[1],e[0]));return xR(t)},R1e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:pR,rotateZ:pR,skewX:e=>Wh(Math.atan(e[1])),skewY:e=>Wh(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},xR=e=>(e=e%360,e<0&&(e+=360),e),p6=pR,x6=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),g6=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),O1e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:x6,scaleY:g6,scale:e=>(x6(e)+g6(e))/2,rotateX:e=>xR(Wh(Math.atan2(e[6],e[5]))),rotateY:e=>xR(Wh(Math.atan2(-e[2],e[0]))),rotateZ:p6,rotate:p6,skewX:e=>Wh(Math.atan(e[4])),skewY:e=>Wh(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gR(e){return e.includes("scale")?1:0}function vR(e,t){if(!e||e==="none")return gR(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(n)s=O1e,a=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=R1e,a=l}if(!a)return gR(t);const i=s[t],o=a[1].split(",").map(D1e);return typeof i=="function"?i(o):o[i]}const P1e=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return vR(n,t)};function D1e(e){return parseFloat(e.trim())}const Cv=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],kv=new Set(Cv),v6=e=>e===_v||e===vr,M1e=new Set(["x","y","z"]),I1e=Cv.filter(e=>!M1e.has(e));function L1e(e){const t=[];return I1e.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const pf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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})=>vR(t,"x"),y:(e,{transform:t})=>vR(t,"y")};pf.translateX=pf.x;pf.translateY=pf.y;const xf=new Set;let yR=!1,bR=!1,wR=!1;function UX(){if(bR){const e=Array.from(xf).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const a=L1e(s);a.length&&(n.set(s,a),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const a=n.get(s);a&&a.forEach(([i,o])=>{var l;(l=s.getValue(i))==null||l.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}bR=!1,yR=!1,xf.forEach(e=>e.complete(wR)),xf.clear()}function FX(){xf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(bR=!0)})}function $1e(){wR=!0,FX(),UX(),wR=!1}class eD{constructor(t,n,s,a,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=a,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(xf.add(this),yR||(yR=!0,As.read(FX),As.resolveKeyframes(UX))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const l=s.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),a&&i===void 0&&a.set(t[0])}T1e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),xf.delete(this)}cancel(){this.state==="scheduled"&&(xf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const V1e=e=>e.startsWith("--");function U1e(e,t,n){V1e(t)?e.style.setProperty(t,n):e.style[t]=n}const F1e=B5(()=>window.ScrollTimeline!==void 0),B1e={};function z1e(e,t){const n=B5(e);return()=>B1e[t]??n()}const BX=z1e(()=>{try{document.createElement("div").animate({opacity:0}
1083,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Py=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,y6={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Py([0,.65,.55,1]),circOut:Py([.55,0,1,.45]),backIn:Py([.31,.01,.66,-.59]),backOut:Py([.33,1.53,.69,.99])};function zX(e,t){if(e)return typeof e=="function"?BX()?LX(e,t):"ease-out":CX(e)?Py(e):Array.isArray(e)?e.map(n=>zX(n,t)||y6.easeOut):y6[e]}function q1e(e,t,n,{delay:s=0,duration:a=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const u={[t]:n};c&&(u.offset=c);const m=zX(l,a);Array.isArray(m)&&(u.easing=m);const f={delay:s,duration:a,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(f.pseudoElement=d),e.animate(u,f)}function qX(e){return typeof e=="function"&&"applyToOptions"in e}function H1e({type:e,...t}){return qX(e)&&BX()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class W1e extends Q5{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:a,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,TN(typeof t.type!="string");const d=H1e(t);this.animation=q1e(n,s,a,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Z5(a,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(u):U1e(n,s,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(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 t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return nl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nl(t)}get time(){return nl(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ec(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&F1e()?(this.animation.timeline=t,dl):n(this)}}const HX={anticipate:jX,backInOut:wX,circInOut:SX};function Y1e(e){return e in HX}function G1e(e){typeof e.ease=="string"&&Y1e(e.ease)&&(e.ease=HX[e.ease])}const b6=10;class K1e extends W1e{constructor(t){G1e(t),VX(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:a,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new J5({...o,autoplay:!1}),c=Ec(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-b6).value,l.sample(c).value,b6),l.stop()}}const w6=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Hm.test(e)||e==="0")&&!e.startsWith("url("));function X1e(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 Z1e(e,t,n,s){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=w6(a,t),l=w6(i,t);return!o||!l?!1:X1e(e)||(n==="spring"||qX(n))&&s}function jR(e){e.duration=0,e.type="keyframes"}const Q1e=new Set(["opacity","clipPath","filter","transform"]),J1e=B5(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function eNe(e){var u;const{motionValue:t,name:n,repeatDelay:s,repeatType:a,damping:i,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return J1e()&&n&&Q1e.has(n)&&(n!=="transform"||!d)&&!c&&!s&&a!=="mirror"&&i!==0&&o!=="inertia"}const tNe=40;class rNe extends Q5{constructor({autoplay:t=!0,delay:n=0,type:s="
1083keyframes",repeat:a=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:u,...m}){var x;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Qi.now();const f={autoplay:t,delay:n,type:s,repeat:a,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:u,...m},p=(u==null?void 0:u.KeyframeResolver)||eD;this.keyframeResolver=new p(l,(g,v,y)=>this.onKeyframesResolved(g,v,f,!y),c,d,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,s,a){this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:u}=s;this.resolvedAt=Qi.now(),Z1e(t,i,o,l)||((Xd.instantAnimations||!c)&&(u==null||u(Z5(t,s,n))),t[0]=t[t.length-1],jR(s),s.repeat=0);const f={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>tNe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},p=!d&&eNe(f)?new K1e({...f,element:f.motionValue.owner.current}):new J5(f);p.finished.then(()=>this.notifyFinished()).catch(dl),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}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(),$1e()),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()}}const nNe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sNe(e){const t=nNe.exec(e);if(!t)return[,];const[,n,s,a]=t;return[`--${n??s}`,a]}function WX(e,t,n=1){const[s,a]=sNe(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return hX(o)?parseFloat(o):o}return W5(a)?WX(a,t,n+1):a}function tD(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const YX=new Set(["width","height","top","left","right","bottom",...Cv]),aNe={test:e=>e==="auto",parse:e=>e},GX=e=>t=>t.test(e),KX=[_v,vr,Ac,Mu,Xje,Kje,aNe],j6=e=>KX.find(GX(e));function iNe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||pX(e):!0}const oNe=new Set(["brightness","contrast","saturate","opacity"]);function lNe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Y5)||[];if(!s)return e;const a=n.replace(s,"");let i=oNe.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+a+")"}const cNe=/\b([a-z-]*)\(.*?\)/gu,NR={...Hm,getAnimatableNone:e=>{const t=e.match(cNe);return t?t.map(lNe).join(" "):e}},N6={..._v,transform:Math.round},dNe={rotate:Mu,rotateX:Mu,rotateY:Mu,rotateZ:Mu,scale:Nj,scaleX:Nj,scaleY:Nj,scaleZ:Nj,skew:Mu,skewX:Mu,skewY:Mu,distance:vr,translateX:vr,translateY:vr,translateZ:vr,x:vr,y:vr,z:vr,perspective:vr,transformPerspective:vr,opacity:Qb,originX:d6,originY:d6,originZ:vr},rD={borderWidth:vr,borderTopWidth:vr,borderRightWidth:vr,borderBottomWidth:vr,borderLeftWidth:vr,borderRadius:vr,radius:vr,borderTopLeftRadius:vr,borderTopRightRadius:vr,borderBottomRightRadius:vr,borderBottomLeftRadius:vr,width:vr,maxWidth:vr,height:vr,maxHeight:vr,top:vr,right:vr,bottom:vr,left:vr,padding:vr,paddingTop:vr,paddingRight:vr,paddingBottom:vr,paddingLeft:vr,margin:vr,marginTop:vr,marginRight:vr,marginBottom:vr,marginLeft:vr,backgroundPositionX:vr,backgroundPositionY:vr,...dNe,zIndex:N6,fillOpacity:Qb,strokeOpacity:Qb,numOctaves:N6},uNe={...rD,color:ma,backgroundColor:ma,outlineColor:ma,fill:ma,stroke:ma,borderColor:ma,borderTopColor:ma,borderRightColor:ma,borderBottomColor:ma,borderLeftColor:ma,filter:NR,WebkitFilter:NR},XX=e=>uNe[e];function ZX(e,t){let n=XX(e);return n!==NR&&(n=Hm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
vendor: 12,941 bytes, lines 1083-1091
1083const mNe=new Set(["auto","none","0"]);function hNe(e,t,n){let s=0,a;for(;s<e.length&&!a;){const i=e[s];typeof i=="string"&&!mNe.has(i)&&Jb(i).values.length&&(a=e[s]),s++}if(a&&n)for(const i of t)e[i]=ZX(n,a)}class fNe extends eD{constructor(t,n,s,a,i){super(t,n,s,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),W5(d))){const u=WX(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!YX.has(s)||t.length!==2)return;const[a,i]=t,o=j6(a),l=j6(i);if(o!==l)if(v6(o)&&v6(l))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else pf[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||iNe(t[a]))&&s.push(a);s.length&&hNe(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pf[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(s,a).jump(a,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=pf[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function pNe(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const a=document.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}const QX=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function JX(e){return fX(e)&&"offsetHeight"in e}const S6=30,xNe=e=>!isNaN(parseFloat(e));class gNe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var i;const a=Qi.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Qi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=xNe(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 z5);const s=this.events[t].add(n);return t==="change"?()=>{s(),As.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=Qi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>S6)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,S6);return xX(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 fg(e,t){return new gNe(e,t)}const{schedule:nD,cancel:lit}=kX(queueMicrotask,!1),Rl={x:!1,y:!1};function eZ(){return Rl.x||Rl.y}function vNe(e){return e==="x"||e==="y"?Rl[e]?null:(Rl[e]=!0,()=>{Rl[e]=!1}):Rl.x||Rl.y?null:(Rl.x=Rl.y=!0,()=>{Rl.x=Rl.y=!1})}function tZ(e,t){const n=pNe(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[n,a,()=>s.abort()]}function _6(e){return!(e.pointerType==="touch"||eZ())}function yNe(e,t,n={}){const[s,a,i]=tZ(e,n),o=l=>{if(!_6(l))return;const{target:c}=l,d=t(c,l);if(typeof d!="function"||!c)return;const u=m=>{_6(m)&&(d(m),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,a)};return s.forEach(l=>{l.addEventListener("pointerenter",o,a)}),i}const rZ=(e,t)=>t?e===t?!0:rZ(e,t.parentElement):!1,sD=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,bNe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wNe(e){return bNe.has(e.tagName)||e.tabIndex!==-1}const j1=new WeakSet;function C6(e){return t=>{t.key==="Enter"&&e(t)}}function eE(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const jNe=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=C6(()=>{if(j1.has(n))return;eE(n,"down");const a=C6(()=>{eE(n,"up")}),i=()=>eE(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function k6(e){return sD(e)&&!eZ()}function NNe(e,t,n={}){const[s,a,i]=tZ(e,n),o=l=>{const c=l.currentTarget;if(!k6(l))return;j1.add(c);const d=t(c,l),u=(p,x)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",f),j1.has(c)&&j1.delete(c),k6(p)&&typeof d=="function"&&d(p,{success:x})},m=p=>{u(p,c===window||c===document||n.useGlobalTarget||rZ(c,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",m,a),window.addEventListener("pointercancel",f,a)};return s.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,a),JX(l)&&(l.addEventListener("focus",d=>jNe(d,a)),!wNe(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function nZ(e){return fX(e)&&"ownerSVGElement"in e}function SNe(e){return nZ(e)&&e.tagName==="svg"}const yi=e=>!!(e&&e.getVelocity),_Ne=[...KX,ma,Hm],CNe=e=>_Ne.find(GX(e)),aD=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function E6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kNe(...e){return t=>{let n=!1;const s=e.map(a=>{const i=E6(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<s.length;a++){const i=s[a];typeof i=="function"?i():E6(e[a],null)}}}}function ENe(...e){return h.useCallback(kNe(...e),e)}class ANe extends h.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=n.offsetParent,a=JX(s)&&s.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=a-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function TNe({children:e,isPresent:t,anchorX:n,root:s}){const a=h.useId(),i=h.useRef(null),o=h.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=h.useContext(aD),c=ENe(i,e==null?void 0:e.ref);return h.useInsertionEffect(()=>{const{width:d,height:u,top:m,left:f,right:p}=o.current;if(t||!i.current||!d||!u)return;const x=n==="left"?`left: ${f}`:`right: ${p}`;i.current.dataset.motionPopId=a;const g=document.createElement("style");l&&(g.nonce=l);const v=s??document.head;return v.appendChild(g),g.sheet&&g.sheet.insertRule(`
1084          [data-motion-pop-id="${a}"] {
1085            position: absolute !important;
1086            width: ${d}px !important;
1087            height: ${u}px !important;
1088            ${x}px !important;
1089            top: ${m}px !important;
1090          }
1091        `),()=>{v.contains(g)&&v.removeChild(g)}},[t]),r.jsx(ANe,{isPresent:t,childRef:i,sizeRef:o,children:h.cloneElement(e,{ref:c})})}const RNe=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:a,presenceAffectsLayout:i,mode:o,anchorX:l,root:c})=>{const d=a2(ONe),u=h.useId();let m=!0,f=h.useMemo(()=>(m=!1,{id:u,initial:t,isPresent:n,custom:a,onExitComplete:p=>{d.set(p,!0);for(const x of d.values())if(!x)return;s&&s()},register:p=>(d.set(p,!1),()=>d.delete(p))}),[n,d,s]);return i&&m&&(f={...f}),h.useMemo(()=>{d.forEach((p,x)=>d.set(x,!1))},[n]),h.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(TNe,{isPresent:n,anchorX:l,root:c,children:e})),r.jsx(i2.Provider,{value:f,children:e})};function ONe(){return new Map}function sZ(e=!0){const t=h.useContext(i2);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:a}=t,i=h.useId();h.useEffect(()=>{if(e)return a(i)},[e]);const o=h.useCallback(()=>e&&s&&s(i),[i,s,e]);return!n&&s?[!1,o]:[!0]}const Sj=e=>e.key||"";function A6(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Ts=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:a=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",root:c})=>{const[d,u]=sZ(o),m=h.useMemo(()=>A6(e),[e]),f=o&&!d?[]:m.map(Sj),p=h.useRef(!0),x=h.useRef(m),g=a2(()=>new Map),[v,y]=h.useState(m),[b,w]=h.useState(m);V5(()=>{p.current=!1,x.current=m;for(let N=0;N<b.length;N++){const _=Sj(b[N]);f.includes(_)?g.delete(_):g.get(_)!==!0&&g.set(_,!1)}},[b,f.length,f.join("-")]);const S=[];if(m!==v){let N=[...m];for(let _=0;_<b.length;_++){const C=b[_],k=Sj(C);f.includes(k)||(N.splice(_,0,C),S.push(C))}return i==="wait"&&S.length&&(N=S),w(A6(N)),y(m),null}const{forceRender:j}=h.useContext(L5);return r.jsx(r.Fragment,{children:b.map(N=>{const _=Sj(N),C=o&&!d?!1:m===b||f.includes(_),k=()=>{if(g.has(_))g.set(_,!0);else return;let E=!0;g.forEach(R=>{R||(E=!1)}),E&&(j==null||j(),w(x.current),o&&(u==null||u()),s&&s())};return r.jsx(RNe,{isPresent:C,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:i,root:c,onExitComplete:C?void 0:k,anchorX:l,children:N},_)})})},aZ=h.createContext({strict:!1}),T6={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"]},pg={};for(const e in T6)pg[e]={isEnabled:t=>T6[e].some(n=>!!t[n])};function PNe(e){for(const t in e)pg[t]={...pg[t],...e[t]}}const DNe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function DN(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||DNe.has(e)}let iZ=e=>!DN(e);function MNe(e){typeof e=="function"&&(iZ=t=>t.startsWith("on")?!DN(t):e(t))}try{MNe(require("@emotion/is-prop-valid").default)}catch{}function INe(e,t,n){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||(iZ(a)||n===!0&&DN(a)||!t&&!DN(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const o2=h.createContext({});function l2(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function e0(e){return typeof e=="string"||Array.isArray(e)}const iD=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],oD=["initial",...iD];function c2(e){return l2(e.animate)||oD.some(t=>e0(e[t]))}function oZ(e){return!!(c2(e)||e.variants)}function LNe(e,t){if(c2(e)){const{initial:n,animate:s}=e;return{initial:n===!1||e0(n)?n:void 0,animate:e0(s)?s:void 0}}return e.inherit!==!1?t:{}}function $Ne(e){const{initial:t,animate:n}=LNe(e,h.useContext(o2));return h.useMemo(()=>({initial:t,animate:n}),[R6(t),R6(n)])}function R6(e){return Array.isArray(e)?e.join(" "):e}function O6(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ay={correct:(e,t)=>
vendor: 4,086 bytes, line 1091
1091{if(!t.target)return e;if(typeof e=="string")if(vr.test(e))e=parseFloat(e);else return e;const n=O6(e,t.target.x),s=O6(e,t.target.y);return`${n}% ${s}%`}},VNe={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,a=Hm.parse(e);if(a.length>5)return s;const i=Hm.createTransformer(e),o=typeof a[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;a[0+o]/=l,a[1+o]/=c;const d=Is(l,c,.5);return typeof a[2+o]=="number"&&(a[2+o]/=d),typeof a[3+o]=="number"&&(a[3+o]/=d),i(a)}},SR={borderRadius:{...ay,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ay,borderTopRightRadius:ay,borderBottomLeftRadius:ay,borderBottomRightRadius:ay,boxShadow:VNe};function lZ(e,{layout:t,layoutId:n}){return kv.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!SR[e]||e==="opacity")}const UNe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},FNe=Cv.length;function BNe(e,t,n){let s="",a=!0;for(let i=0;i<FNe;i++){const o=Cv[i],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const d=QX(l,rD[o]);if(!c){a=!1;const u=UNe[o]||o;s+=`${u}(${d}) `}n&&(t[o]=d)}}return s=s.trim(),n?s=n(t,a?"":s):a&&(s="none"),s}function lD(e,t,n){const{style:s,vars:a,transformOrigin:i}=e;let o=!1,l=!1;for(const c in t){const d=t[c];if(kv.has(c)){o=!0;continue}else if(AX(c)){a[c]=d;continue}else{const u=QX(d,rD[c]);c.startsWith("origin")?(l=!0,i[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=BNe(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:u=0}=i;s.transformOrigin=`${c} ${d} ${u}`}}const cD=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cZ(e,t,n){for(const s in t)!yi(t[s])&&!lZ(s,n)&&(e[s]=t[s])}function zNe({transformTemplate:e},t){return h.useMemo(()=>{const n=cD();return lD(n,t,e),Object.assign({},n.vars,n.style)},[t])}function qNe(e,t){const n=e.style||{},s={};return cZ(s,n,e),Object.assign(s,zNe(e,t)),s}function HNe(e,t){const n={},s=qNe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const WNe={offset:"stroke-dashoffset",array:"stroke-dasharray"},YNe={offset:"strokeDashoffset",array:"strokeDasharray"};function GNe(e,t,n=1,s=0,a=!0){e.pathLength=1;const i=a?WNe:YNe;e[i.offset]=vr.transform(-s);const o=vr.transform(t),l=vr.transform(n);e[i.array]=`${o} ${l}`}function dZ(e,{attrX:t,attrY:n,attrScale:s,pathLength:a,pathSpacing:i=1,pathOffset:o=0,...l},c,d,u){if(lD(e,l,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:f}=e;m.transform&&(f.transform=m.transform,delete m.transform),(f.transform||m.transformOrigin)&&(f.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),s!==void 0&&(m.scale=s),a!==void 0&&GNe(m,a,i,o,!1)}const uZ=()=>({...cD(),attrs:{}}),mZ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function KNe(e,t,n,s){const a=h.useMemo(()=>{const i=uZ();return dZ(i,t,mZ(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};cZ(i,e.style,e),a.style={...i,...a.style}}return a}const XNe=["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 dD(e){return typeof e!="string"||e.includes("-")?!1:!!(XNe.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZNe(e,t,n,{latestValues:s},a,i=!1){const l=(dD(e)?KNe:HNe)(t,s,a,e),c=INe(t,typeof e=="string",i),d=e!==h.Fragment?{...c,...l,ref:n}:{},{children:u}=t,m=h.useMemo(()=>yi(u)?u.get():u,[u]);return h.createElement(e,{...d,children:m})}function P6(e){const t=[{},{}];
vendor: 4,538 bytes, line 1091
1091return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function uD(e,t,n,s){if(typeof t=="function"){const[a,i]=P6(s);t=t(n!==void 0?n:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=P6(s);t=t(n!==void 0?n:e.custom,a,i)}return t}function N1(e){return yi(e)?e.get():e}function QNe({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,a){return{latestValues:JNe(n,s,a,e),renderState:t()}}function JNe(e,t,n,s){const a={},i=s(e,{});for(const f in i)a[f]=N1(i[f]);let{initial:o,animate:l}=e;const c=c2(e),d=oZ(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const m=u?l:o;if(m&&typeof m!="boolean"&&!l2(m)){const f=Array.isArray(m)?m:[m];for(let p=0;p<f.length;p++){const x=uD(e,f[p]);if(x){const{transitionEnd:g,transition:v,...y}=x;for(const b in y){let w=y[b];if(Array.isArray(w)){const S=u?w.length-1:0;w=w[S]}w!==null&&(a[b]=w)}for(const b in g)a[b]=g[b]}}}return a}const hZ=e=>(t,n)=>{const s=h.useContext(o2),a=h.useContext(i2),i=()=>QNe(e,t,s,a);return n?i():a2(i)};function mD(e,t,n){var i;const{style:s}=e,a={};for(const o in s)(yi(s[o])||t.style&&yi(t.style[o])||lZ(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(a[o]=s[o]);return a}const eSe=hZ({scrapeMotionValuesFromProps:mD,createRenderState:cD});function fZ(e,t,n){const s=mD(e,t,n);for(const a in e)if(yi(e[a])||yi(t[a])){const i=Cv.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[i]=e[a]}return s}const tSe=hZ({scrapeMotionValuesFromProps:fZ,createRenderState:uZ}),rSe=Symbol.for("motionComponentSymbol");function ax(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nSe(e,t,n){return h.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):ax(n)&&(n.current=s))},[t])}const hD=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),sSe="framerAppearId",pZ="data-"+hD(sSe),xZ=h.createContext({});function aSe(e,t,n,s,a){var g,v;const{visualElement:i}=h.useContext(o2),o=h.useContext(aZ),l=h.useContext(i2),c=h.useContext(aD).reducedMotion,d=h.useRef(null);s=s||o.renderer,!d.current&&s&&(d.current=s(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const u=d.current,m=h.useContext(xZ);u&&!u.projection&&a&&(u.type==="html"||u.type==="svg")&&iSe(d.current,n,a,m);const f=h.useRef(!1);h.useInsertionEffect(()=>{u&&f.current&&u.update(n,l)});const p=n[pZ],x=h.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return V5(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),x.current&&u.animationState&&u.animationState.animateChanges())}),h.useEffect(()=>{u&&(!x.current&&u.animationState&&u.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),x.current=!1),u.enteringChildren=void 0)}),u}function iSe(e,t,n,s){const{layoutId:a,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gZ(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!o||l&&ax(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:d})}function gZ(e){if(e)return e.options.allowProjection!==!1?e.projection:gZ(e.parent)}function tE(e,{forwardMotionProps:t=!1}={},n,s){n&&PNe(n);const a=dD(e)?tSe:eSe;function i(l,c){let d;const u={...h.useContext(aD),...l,layoutId:oSe(l)},{isStatic:m}=u,f=$Ne(l),p=a(l,m);if(!m&&$5){lSe();const x=cSe(u);d=x.MeasureLayout,f.visualElement=aSe(e,p,u,s,x.ProjectionNode)}return r.jsxs(o2.Provider,{value:f,children:[d&&f.visualElement?r.jsx(d,{visualElement:f.visualElement,...u}):null,ZNe(e,l,nSe(p,f.visualElement,c),p,m,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=h.forwardRef(i);return o[rSe]=e,o}function oSe({layoutId:e}){const t=h.useContext(L5).id;return t&&e!==void 0?t+"-"+e:e}function lSe(e,t){h.useContext(aZ).strict}function cSe(e){const{drag:t,layout:n}=pg;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}
vendor: 19,624 bytes, line 1091
1091function dSe(e,t){if(typeof Proxy>"u")return tE;const n=new Map,s=(i,o)=>tE(i,o,e,t),a=(i,o)=>s(i,o);return new Proxy(a,{get:(i,o)=>o==="create"?s:(n.has(o)||n.set(o,tE(o,void 0,e,t)),n.get(o))})}function vZ({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function uSe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mSe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function rE(e){return e===void 0||e===1}function _R({scale:e,scaleX:t,scaleY:n}){return!rE(e)||!rE(t)||!rE(n)}function Dh(e){return _R(e)||yZ(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yZ(e){return D6(e.x)||D6(e.y)}function D6(e){return e&&e!=="0%"}function MN(e,t,n){const s=e-n,a=t*s;return n+a}function M6(e,t,n,s,a){return a!==void 0&&(e=MN(e,a,s)),MN(e,n,s)+t}function CR(e,t=0,n=1,s,a){e.min=M6(e.min,t,n,s,a),e.max=M6(e.max,t,n,s,a)}function bZ(e,{x:t,y:n}){CR(e.x,t.translate,t.scale,t.originPoint),CR(e.y,n.translate,n.scale,n.originPoint)}const I6=.999999999999,L6=1.0000000000001;function hSe(e,t,n,s=!1){const a=n.length;if(!a)return;t.x=t.y=1;let i,o;for(let l=0;l<a;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ox(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,bZ(e,o)),s&&Dh(i.latestValues)&&ox(e,i.latestValues))}t.x<L6&&t.x>I6&&(t.x=1),t.y<L6&&t.y>I6&&(t.y=1)}function ix(e,t){e.min=e.min+t,e.max=e.max+t}function $6(e,t,n,s,a=.5){const i=Is(e.min,e.max,a);CR(e,t,n,i,s)}function ox(e,t){$6(e.x,t.x,t.scaleX,t.scale,t.originX),$6(e.y,t.y,t.scaleY,t.scale,t.originY)}function wZ(e,t){return vZ(mSe(e.getBoundingClientRect(),t))}function fSe(e,t,n){const s=wZ(e,n),{scroll:a}=t;return a&&(ix(s.x,a.offset.x),ix(s.y,a.offset.y)),s}const V6=()=>({translate:0,scale:1,origin:0,originPoint:0}),lx=()=>({x:V6(),y:V6()}),U6=()=>({min:0,max:0}),Ta=()=>({x:U6(),y:U6()}),IN={current:null},fD={current:!1};function jZ(){if(fD.current=!0,!!$5)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>IN.current=e.matches;e.addEventListener("change",t),t()}else IN.current=!1}const pSe=new WeakMap;function xSe(e,t,n){for(const s in t){const a=t[s],i=n[s];if(yi(a))e.addValue(s,a);else if(yi(i))e.addValue(s,fg(a,{owner:e}));else if(i!==a)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(a):o.hasAnimated||o.set(a)}else{const o=e.getStaticValue(s);e.addValue(s,fg(o!==void 0?o:a,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const F6=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class gSe{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:a,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=eD,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Qi.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,As.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=c2(n),this.isVariantNode=oZ(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in m){const p=m[f];c[f]!==void 0&&yi(p)&&p.set(c[f])}}mount(t){var n;this.current=t,pSe.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((s,a)=>this.bindToMotionValue(a,s)),fD.current||jZ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:IN.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),qm(this.notifyUpdate),qm(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 s=this.features[n];s&&(s.unmount(),s.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){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=kv.has(t);s&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&As.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),i&&i(),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 pg){const n=pg[t];if(!n)continue;const{isEnabled:s,Feature:a}=n;if(!this.features[t]&&a&&s(this.props)&&(this.features[t]=new a(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ta()}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 s=0;s<F6.length;s++){const a=F6[s];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,o=t[i];o&&(this.propEventSubscriptions[a]=this.on(a,o))}this.prevMotionValues=xSe(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 s=this.values.get(t);n!==s&&(s&&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 s=this.values.get(t);return s===void 0&&n!==void 0&&(s=fg(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(hX(s)||pX(s))?s=parseFloat(s):!CNe(s)&&Hm.test(n)&&(s=ZX(t,n)),this.setBaseTarget(t,yi(s)?s.get():s)),yi(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=uD(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!yi(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new z5),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){nD.render(this.render)}}class NZ extends gSe{constructor(){super(...arguments),this.KeyframeResolver=fNe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;yi(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function SZ(e,{style:t,vars:n},s,a){const i=e.style;let o;for(o in t)i[o]=t[o];a==null||a.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function vSe(e){return window.getComputedStyle(e)}class ySe extends NZ{constructor(){super(...arguments),this.type="html",this.renderInstance=SZ}readValueFromInstance(t,n){var s;if(kv.has(n))return(s=this.projection)!=null&&s.isProjecting?gR(n):P1e(t,n);{const a=vSe(t),i=(AX(n)?a.getPropertyValue(n):a[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return wZ(t,n)}build(t,n,s){lD(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return mD(t,n,s)}}const _Z=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bSe(e,t,n,s){SZ(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(_Z.has(a)?a:hD(a),t.attrs[a])}class wSe extends NZ{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ta}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(kv.has(n)){const s=XX(n);return s&&s.default||0}return n=_Z.has(n)?n:hD(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return fZ(t,n,s)}build(t,n,s){dZ(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,a){bSe(t,n,s,a)}mount(t){this.isSVGTag=mZ(t.tagName),super.mount(t)}}const jSe=(e,t)=>dD(e)?new wSe(t):new ySe(t,{allowProjection:e!==h.Fragment});function Ex(e,t,n){const s=e.getProps();return uD(s,t,n!==void 0?n:s.custom,e)}const kR=e=>Array.isArray(e);function NSe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,fg(n))}function SSe(e){return kR(e)?e[e.length-1]||0:e}function pD(e,t){const n=Ex(e,t);let{transitionEnd:s={},transition:a={},...i}=n||{};i={...i,...s};for(const o in i){const l=SSe(i[o]);NSe(e,o,l)}}function _Se(e){return!!(yi(e)&&e.add)}function ER(e,t){const n=e.getValue("willChange");if(_Se(n))return n.add(t);if(!n&&Xd.WillChange){const s=new Xd.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function CZ(e){return e.props[pZ]}const CSe=e=>e!==null;function kSe(e,{repeat:t,repeatType:n="loop"},s){const a=e.filter(CSe),i=t&&n!=="loop"&&t%2===1?0:a.length-1;return!i||s===void 0?a[i]:s}const ESe={type:"spring",stiffness:500,damping:25,restSpeed:10},ASe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),TSe={type:"keyframes",duration:.8},RSe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OSe=(e,{keyframes:t})=>t.length>2?TSe:kv.has(e)?e.startsWith("scale")?ASe(t[1]):ESe:RSe;function PSe({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:a,repeat:i,repeatType:o,repeatDelay:l,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const xD=(e,t,n,s={},a,i)=>o=>{const l=tD(s,e)||{},c=l.delay||s.delay||0;let{elapsed:d=0}=s;d=d-Ec(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:a};PSe(l)||Object.assign(u,OSe(e,u)),u.duration&&(u.duration=Ec(u.duration)),u.repeatDelay&&(u.repeatDelay=Ec(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let m=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(jR(u),u.delay===0&&(m=!0)),(Xd.instantAnimations||Xd.skipAnimations)&&(m=!0,jR(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,m&&!i&&t.get()!==void 0){const f=kSe(u.keyframes,l);if(f!==void 0){As.update(()=>{u.onUpdate(f),u.onComplete()});return}}return l.isSync?new J5(u):new rNe(u)};function DSe({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function kZ(e,t,{delay:n=0,transitionOverride:s,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...l}=t;s&&(i=s);const c=[],d=a&&e.animationState&&e.animationState.getState()[a];for(const u in l){const m=e.getValue(u,e.latestValues[u]??null),f=l[u];if(f===void 0||d&&DSe(d,u))continue;const p={delay:n,...tD(i||{},u)},x=m.get();if(x!==void 0&&!m.isAnimating&&!Array.isArray(f)&&f===x&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const y=CZ(e);if(y){const b=window.MotionHandoffAnimation(y,u,As);b!==null&&(p.startTime=b,g=!0)}}ER(e,u),m.start(xD(u,m,f,e.shouldReduceMotion&&YX.has(u)?{type:!1}:p,e,g));const v=m.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{As.update(()=>{o&&pD(e,o)})}),c}function EZ(e,t,n,s=0,a=1){const i=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),o=e.size,l=(o-1)*s;return typeof n=="function"?n(i,o):a===1?i*s:l-i*s}function AR(e,t,n={}){var c;const s=Ex(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(a=n.transitionOverride);const i=s?()=>Promise.all(kZ(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:m,staggerDirection:f}=a;return MSe(e,t,d,u,m,f,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[d,u]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function MSe(e,t,n=0,s=0,a=0,i=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(AR(c,t,{...o,delay:n+(typeof s=="function"?0:s)+EZ(e.variantChildren,c,s,a,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function AZ(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(i=>AR(e,i,n));s=Promise.all(a)}else if(typeof t=="string")s=AR(e,t,n);else{const a=typeof t=="function"?Ex(e,t,n.custom):t;s=Promise.all(kZ(e,a,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function TZ(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const ISe=oD.length;function RZ(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?RZ(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ISe;n++){const s=oD[n],a=e.props[s];(e0(a)||a===!1)&&(t[s]=a)}return t}const LSe=[...iD].reverse(),$Se=iD.length;function VSe(e){return t=>Promise.all(t.map(({animation:n,options:s})=>AZ(e,n,s)))}function USe(e){let t=VSe(e),n=B6(),s=!0;const a=c=>(d,u)=>{var f;const m=Ex(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(m){const{transition:p,transitionEnd:x,...g}=m;d={...d,...g,...x}}return d};function i(c){t=c(e)}function o(c){const{props:d}=e,u=RZ(e.parent)||{},m=[],f=new Set;let p={},x=1/0;for(let v=0;v<$Se;v++){const y=LSe[v],b=n[y],w=d[y]!==void 0?d[y]:u[y],S=e0(w),j=y===c?b.isActive:null;j===!1&&(x=v);let N=w===u[y]&&w!==d[y]&&S;if(N&&s&&e.manuallyAnimateOnMount&&(N=!1),b.protectedKeys={...p},!b.isActive&&j===null||!w&&!b.prevProp||l2(w)||typeof w=="boolean")continue;const _=FSe(b.prevProp,w);let C=_||y===c&&b.isActive&&!N&&S||v>x&&S,k=!1;const E=Array.isArray(w)?w:[w];let R=E.reduce(a(y),{});j===!1&&(R={});const{prevResolvedValues:T={}}=b,D={...T,...R},A=O=>{C=!0,f.has(O)&&(k=!0,f.delete(O)),b.needsAnimating[O]=!0;const M=e.getValue(O);M&&(M.liveStyle=!1)};for(const O in D){const M=R[O],$=T[O];if(p.hasOwnProperty(O))continue;let I=!1;kR(M)&&kR($)?I=!TZ(M,$):I=M!==$,I?M!=null?A(O):f.add(O):M!==void 0&&f.has(O)?A(O):b.protectedKeys[O]=!0}b.prevProp=w,b.prevResolvedValues=R,b.isActive&&(p={...p,...R}),s&&e.blockInitialAnimation&&(C=!1);const V=N&&_;C&&(!V||k)&&m.push(...E.map(O=>{const M={type:y};if(typeof O=="string"&&s&&!V&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,I=Ex($,O);if($.enteringChildren&&I){const{delayChildren:B}=I.transition||{};M.delay=EZ($.enteringChildren,e,B)}}return{animation:O,options:M}}))}if(f.size){const v={};if(typeof d.initial!="boolean"){const y=Ex(e,Array.isArray(d.initial)?d.initial[0]:d.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const b=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),v[y]=b??null}),m.push({animation:v})}let g=!!m.length;return s&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(g=!1),s=!1,g?t(m):Promise.resolve()}function l(c,d){var m;if(n[c].isActive===d)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(c,d)}),n[c].isActive=d;const u=o(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=B6()}}}function FSe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!TZ(t,e):!1}function jh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function B6(){return{animate:jh(!0),whileInView:jh(),whileHover:jh(),whileTap:jh(),whileDrag:jh(),whileFocus:jh(),exit:jh()}}class oh{constructor(t){this.isMounted=!1,this.node=t}update(){}}class BSe extends oh{constructor(t){super(t),t.animationState||(t.animationState=USe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();l2(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 zSe=0;class qSe extends oh{constructor(){super(...arguments),this.id=zSe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};
vendor: 11,589 bytes, line 1091
1091n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const HSe={animation:{Feature:BSe},exit:{Feature:qSe}};function t0(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Cw(e){return{point:{x:e.pageX,y:e.pageY}}}const WSe=e=>t=>sD(t)&&e(t,Cw(t));function ib(e,t,n,s){return t0(e,t,WSe(n),s)}const OZ=1e-4,YSe=1-OZ,GSe=1+OZ,PZ=.01,KSe=0-PZ,XSe=0+PZ;function Pi(e){return e.max-e.min}function ZSe(e,t,n){return Math.abs(e-t)<=n}function z6(e,t,n,s=.5){e.origin=s,e.originPoint=Is(t.min,t.max,e.origin),e.scale=Pi(n)/Pi(t),e.translate=Is(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YSe&&e.scale<=GSe||isNaN(e.scale))&&(e.scale=1),(e.translate>=KSe&&e.translate<=XSe||isNaN(e.translate))&&(e.translate=0)}function ob(e,t,n,s){z6(e.x,t.x,n.x,s?s.originX:void 0),z6(e.y,t.y,n.y,s?s.originY:void 0)}function q6(e,t,n){e.min=n.min+t.min,e.max=e.min+Pi(t)}function QSe(e,t,n){q6(e.x,t.x,n.x),q6(e.y,t.y,n.y)}function H6(e,t,n){e.min=t.min-n.min,e.max=e.min+Pi(t)}function LN(e,t,n){H6(e.x,t.x,n.x),H6(e.y,t.y,n.y)}function Bo(e){return[e("x"),e("y")]}const DZ=({current:e})=>e?e.ownerDocument.defaultView:null,W6=(e,t)=>Math.abs(e-t);function JSe(e,t){const n=W6(e.x,t.x),s=W6(e.y,t.y);return Math.sqrt(n**2+s**2)}class MZ{constructor(t,n,{transformPagePoint:s,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=sE(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,x=JSe(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!x)return;const{point:g}=f,{timestamp:v}=si;this.history.push({...g,timestamp:v});const{onStart:y,onMove:b}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=nE(p,this.transformPagePoint),As.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:x,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=sE(f.type==="pointercancel"?this.lastMoveEventInfo:nE(p,this.transformPagePoint),this.history);this.startEvent&&x&&x(f,y),g&&g(f,y)},!sD(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=a||window;const l=Cw(t),c=nE(l,this.transformPagePoint),{point:d}=c,{timestamp:u}=si;this.history=[{...d,timestamp:u}];const{onSessionStart:m}=n;m&&m(t,sE(c,this.history)),this.removeListeners=Nw(ib(this.contextWindow,"pointermove",this.handlePointerMove),ib(this.contextWindow,"pointerup",this.handlePointerUp),ib(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qm(this.updatePoint)}}function nE(e,t){return t?{point:t(e.point)}:e}function Y6(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sE({point:e},t){return{point:e,delta:Y6(e,IZ(t)),offset:Y6(e,e_e(t)),velocity:t_e(t,.1)}}function e_e(e){return e[0]}function IZ(e){return e[e.length-1]}function t_e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const a=IZ(e);for(;n>=0&&(s=e[n],!(a.timestamp-s.timestamp>Ec(t)));)n--;if(!s)return{x:0,y:0};const i=nl(a.timestamp-s.timestamp);if(i===0)return{x:0,y:0};const o={x:(a.x-s.x)/i,y:(a.y-s.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function r_e(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?Is(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?Is(n,e,s.max):Math.min(e,n)),e}function G6(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 n_e(e,{top:t,left:n,bottom:s,right:a}){return{x:G6(e.x,n,a),y:G6(e.y,t,s)}}function K6(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function s_e(e,t){return{x:K6(e.x,t.x),y:K6(e.y,t.y)}}function a_e(e,t){let n=.5;const s=Pi(e),a=Pi(t);return a>s?n=Zb(t.min,t.max-s,e.min):s>a&&(n=Zb(e.min,e.max-a,t.min)),Kd(0,1,n)}function i_e(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 TR=.35;function o_e(e=TR){return e===!1?e=0:e===!0&&(e=TR),{x:X6(e,"left","right"),y:X6(e,"top","bottom")}}function X6(e,t,n){return{min:Z6(e,t),max:Z6(e,n)}}function Z6(e,t){return typeof e=="number"?e:e[t]||0}const l_e=new WeakMap;class c_e{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=Ta(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=m=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Cw(m).point)},o=(m,f)=>{const{drag:p,dragPropagation:x,onDragStart:g}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vNe(p),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bo(y=>{let b=this.getAxisMotionValue(y).get()||0;if(Ac.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const S=w.layout.layoutBox[y];S&&(b=Pi(S)*(parseFloat(b)/100))}}this.originPoint[y]=b}),g&&As.postRender(()=>g(m,f)),ER(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},l=(m,f)=>{this.latestPointerEvent=m,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(x&&this.currentDirection===null){this.currentDirection=d_e(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(m,f)},c=(m,f)=>{this.latestPointerEvent=m,this.latestPanInfo=f,this.stop(m,f),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>Bo(m=>{var f;return this.getAnimationState(m)==="paused"&&((f=this.getAxisMotionValue(m).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new MZ(t,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:DZ(this.visualElement)})}stop(t,n){const s=t||this.latestPointerEvent,a=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!s)return;const{velocity:o}=a;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&As.postRender(()=>l(s,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:a}=this.getProps();if(!s||!_j(t,a,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=r_e(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,a=this.constraints;t&&ax(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=n_e(s.layoutBox,t):this.constraints=!1,this.elastic=o_e(n),a!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Bo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=i_e(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ax(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=fSe(s,a.root,this.visualElement.getTransformPagePoint());let o=s_e(a.layout.layoutBox,i);if(n){const l=n(uSe(o));this.hasMutatedConstraints=!!l,l&&(o=vZ(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:a,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Bo(u=>{if(!_j(u,n,this.currentDirection))return;let m=c&&c[u]||{};o&&(m={min:0,max:0});const f=a?200:1e6,p=a?40:1e7,x={type:"inertia",velocity:s?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...m};return this.startAxisValueAnimation(u,x)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return ER(this.visualElement,t),s.start(xD(t,s,0,n,this.visualElement,!1))}stopAnimation(){Bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bo(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),a=s[n];return a||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Bo(n=>{const{drag:s}=this.getProps();if(!_j(n,s,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(n);if(a&&a.layout){const{min:o,max:l}=a.layout.layoutBox[n];i.set(t[n]-Is(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ax(n)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Bo(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();a[o]=a_e({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Bo(o=>{if(!_j(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(Is(c,d,a[o]))})}addListeners(){if(!this.visualElement.current)return;l_e.set(this.visualElement,this);const t=this.visualElement.current,n=ib(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();ax(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),As.read(s);const o=t0(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Bo(u=>{const m=this.getAxisMotionValue(u);m&&(this.originPoint[u]+=c[u].translate,m.set(m.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:o=TR,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:a,dragConstraints:i,dragElastic:o,dragMomentum:l}}}
vendor: 22,915 bytes, line 1091
1091function _j(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function d_e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class u_e extends oh{constructor(t){super(t),this.removeGroupControls=dl,this.removeListeners=dl,this.controls=new c_e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dl}unmount(){this.removeGroupControls(),this.removeListeners()}}const Q6=e=>(t,n)=>{e&&As.postRender(()=>e(t,n))};class m_e extends oh{constructor(){super(...arguments),this.removePointerDownListener=dl}onPointerDown(t){this.session=new MZ(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:DZ(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:Q6(t),onStart:Q6(n),onMove:s,onEnd:(i,o)=>{delete this.session,a&&As.postRender(()=>a(i,o))}}}mount(){this.removePointerDownListener=ib(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const S1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let aE=!1;class h_e extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:a}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),s&&s.register&&a&&s.register(i),aE&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),S1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:a,isPresent:i}=this.props,{projection:o}=s;return o&&(o.isPresent=i,aE=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||As.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),nD.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:a}=t;aE=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),s&&s.deregister&&s.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function LZ(e){const[t,n]=sZ(),s=h.useContext(L5);return r.jsx(h_e,{...e,layoutGroup:s,switchLayoutGroup:h.useContext(xZ),isPresent:t,safeToRemove:n})}function f_e(e,t,n){const s=yi(e)?e:fg(e);return s.start(xD("",s,t,n)),s.animation}const p_e=(e,t)=>e.depth-t.depth;class x_e{constructor(){this.children=[],this.isDirty=!1}add(t){U5(this.children,t),this.isDirty=!0}remove(t){F5(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(p_e),this.isDirty=!1,this.children.forEach(t)}}function g_e(e,t){const n=Qi.now(),s=({timestamp:a})=>{const i=a-n;i>=t&&(qm(s),e(i-t))};return As.setup(s,!0),()=>qm(s)}const $Z=["TopLeft","TopRight","BottomLeft","BottomRight"],v_e=$Z.length,J6=e=>typeof e=="string"?parseFloat(e):e,eV=e=>typeof e=="number"||vr.test(e);function y_e(e,t,n,s,a,i){a?(e.opacity=Is(0,n.opacity??1,b_e(s)),e.opacityExit=Is(t.opacity??1,0,w_e(s))):i&&(e.opacity=Is(t.opacity??1,n.opacity??1,s));for(let o=0;o<v_e;o++){const l=`border${$Z[o]}Radius`;let c=tV(t,l),d=tV(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||eV(c)===eV(d)?(e[l]=Math.max(Is(J6(c),J6(d),s),0),(Ac.test(d)||Ac.test(c))&&(e[l]+="%")):e[l]=d}(t.rotate||n.rotate)&&(e.rotate=Is(t.rotate||0,n.rotate||0,s))}function tV(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const b_e=VZ(0,.5,NX),w_e=VZ(.5,.95,dl);function VZ(e,t,n){return s=>s<e?0:s>t?1:n(Zb(e,t,s))}function rV(e,t){e.min=t.min,e.max=t.max}function Cl(e,t){rV(e.x,t.x),rV(e.y,t.y)}function nV(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function sV(e,t,n,s,a){return e-=t,e=MN(e,1/n,s),a!==void 0&&(e=MN(e,1/a,s)),e}function j_e(e,t=0,n=1,s=.5,a,i=e,o=e){if(Ac.test(t)&&(t=parseFloat(t),t=Is(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Is(i.min,i.max,s);e===i&&(l-=t),e.min=sV(e.min,t,n,l,a),e.max=sV(e.max,t,n,l,a)}function aV(e,t,[n,s,a],i,o){j_e(e,t[n],t[s],t[a],t.scale,i,o)}const N_e=["x","scaleX","originX"],S_e=["y","scaleY","originY"];function iV(e,t,n,s){aV(e.x,t,N_e,n?n.x:void 0,s?s.x:void 0),aV(e.y,t,S_e,n?n.y:void 0,s?s.y:void 0)}function oV(e){return e.translate===0&&e.scale===1}function UZ(e){return oV(e.x)&&oV(e.y)}function lV(e,t){return e.min===t.min&&e.max===t.max}function __e(e,t){return lV(e.x,t.x)&&lV(e.y,t.y)}function cV(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function FZ(e,t){return cV(e.x,t.x)&&cV(e.y,t.y)}function dV(e){return Pi(e.x)/Pi(e.y)}function uV(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class C_e{constructor(){this.members=[]}add(t){U5(this.members,t),t.scheduleRender()}remove(t){if(F5(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){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let s;for(let a=n;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){s=i;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function k_e(e,t,n){let s="";const a=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((a||i||o)&&(s=`translate3d(${a}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:m,rotateY:f,skewX:p,skewY:x}=n;d&&(s=`perspective(${d}px) ${s}`),u&&(s+=`rotate(${u}deg) `),m&&(s+=`rotateX(${m}deg) `),f&&(s+=`rotateY(${f}deg) `),p&&(s+=`skewX(${p}deg) `),x&&(s+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const iE=["","X","Y","Z"],E_e=1e3;let A_e=0;function oE(e,t,n,s){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function BZ(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=CZ(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",As,!(a||i))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&BZ(s)}function zZ({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(o={},l=t==null?void 0:t()){this.id=A_e++,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(O_e),this.nodes.forEach(I_e),this.nodes.forEach(L_e),this.nodes.forEach(P_e)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new x_e)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new z5),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=nZ(o)&&!SNe(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let u,m=0;const f=()=>this.root.updateBlockedByResize=!1;As.read(()=>{m=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==m&&(m=p,this.root.updateBlockedByResize=!0,u&&u(),u=g_e(f,250),S1.hasAnimatedSinceResize&&(S1.hasAnimatedSinceResize=!1,this.nodes.forEach(fV)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:m,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||B_e,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=d.getProps(),y=!this.targetLayout||!FZ(this.targetLayout,p),b=!m&&f;if(this.options.layoutRoot||this.resumeFrom||b||m&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...tD(x,"layout"),onPlay:g,onComplete:v};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,b)}else m||fV(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qm(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($_e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&BZ(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const m=this.path[u];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(mV);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(hV);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(M_e),this.nodes.forEach(T_e),this.nodes.forEach(R_e)):this.nodes.forEach(hV),this.clearAllSnapshots();const l=Qi.now();si.delta=Kd(0,1e3/60,l-si.timestamp),si.timestamp=l,si.isProcessing=!0,Kk.update.process(si),Kk.preRender.process(si),Kk.render.process(si),si.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nD.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(D_e),this.sharedNodes.forEach(V_e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,As.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){As.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pi(this.snapshot.measuredBox.x)&&!Pi(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Ta(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!UZ(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Dh(this.latestValues)||u)&&(a(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),z_e(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Ta();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(q_e))){const{scroll:u}=this.root;u&&(ix(l.x,u.offset.x),ix(l.y,u.offset.y))}return l}removeElementScroll(o){var c;const l=Ta();if(Cl(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:m,options:f}=u;u!==this.root&&m&&f.layoutScroll&&(m.wasRoot&&Cl(l,o),ix(l.x,m.offset.x),ix(l.y,m.offset.y))}return l}applyTransform(o,l=!1){const c=Ta();Cl(c,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ox(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Dh(u.latestValues)&&ox(c,u.latestValues)}return Dh(this.latestValues)&&ox(c,this.latestValues),c}removeTransform(o){const l=Ta();Cl(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!Dh(d.latestValues))continue;_R(d.latestValues)&&d.updateSnapshot();const u=Ta(),m=d.measurePageBox();Cl(u,m),iV(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return Dh(this.latestValues)&&iV(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==si.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:m}=this.options;if(!this.layout||!(u||m))return;this.resolvedRelativeTargetAt=si.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ta(),this.targetWithTransforms=Ta()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QSe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Cl(this.target,this.layout.layoutBox),bZ(this.target,this.targetDelta)):Cl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_R(this.parent.latestValues)||yZ(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ta(),this.relativeTargetOrigin=Ta(),LN(this.relativeTargetOrigin,l,c),Cl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===si.timestamp&&(c=!1),c)return;const{layout:d,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||u))return;Cl(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,f=this.treeScale.y;hSe(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ta());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nV(this.prevProjectionDelta.x,this.projectionDelta.x),nV(this.prevProjectionDelta.y,this.projectionDelta.y)),ob(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==f||!uV(this.projectionDelta.x,this.prevProjectionDelta.x)||!uV(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=lx(),this.projectionDelta=lx(),this.projectionDeltaWithTransform=lx()}setAnimationOrigin(o,l=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},m=lx();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=Ta(),p=c?c.source:void 0,x=this.layout?this.layout.source:void 0,g=p!==x,v=this.getStack(),y=!v||v.members.length<=1,b=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(F_e));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const j=S/1e3;pV(m.x,o.x,j),pV(m.y,o.y,j),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(LN(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),U_e(this.relativeTarget,this.relativeTargetOrigin,f,j),w&&__e(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ta()),Cl(w,this.relativeTarget)),g&&(this.animationValues=u,y_e(u,d,this.latestValues,j,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(qm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=As.update(()=>{S1.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fg(0)),this.currentAnimation=f_e(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:u}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&qZ(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Ta();const m=Pi(this.layout.layoutBox.x);
vendor: 9,637 bytes, line 1091
1091c.x.min=o.target.x.min,c.x.max=c.x.min+m;const f=Pi(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}Cl(l,c),ox(l,u),ob(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new C_e),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&oE("z",o,d,this.animationValues);for(let u=0;u<iE.length;u++)oE(`rotate${iE[u]}`,o,d,this.animationValues),oE(`skew${iE[u]}`,o,d,this.animationValues);o.render();for(const u in d)o.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=N1(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=N1(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Dh(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=k_e(this.projectionDeltaWithTransform,this.treeScale,u);c&&(m=c(u,m)),o.transform=m;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,d.animationValues?o.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in SR){if(u[x]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=SR[x],b=m==="none"?u[x]:g(u[x],d);if(v){const w=v.length;for(let S=0;S<w;S++)o[v[S]]=b}else y?this.options.visualElement.renderState.vars[x]=b:o[x]=b}this.options.layoutId&&(o.pointerEvents=d===this?N1(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(mV),this.root.sharedNodes.clear()}}}function T_e(e){e.updateLayout()}function R_e(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:s,measuredBox:a}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;i==="size"?Bo(m=>{const f=o?t.measuredBox[m]:t.layoutBox[m],p=Pi(f);f.min=s[m].min,f.max=f.min+p}):qZ(i,t.layoutBox,s)&&Bo(m=>{const f=o?t.measuredBox[m]:t.layoutBox[m],p=Pi(s[m]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+p)});const l=lx();ob(l,s,t.layoutBox);const c=lx();o?ob(c,e.applyTransform(a,!0),t.measuredBox):ob(c,s,t.layoutBox);const d=!UZ(l);let u=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:f,layout:p}=m;if(f&&p){const x=Ta();LN(x,t.layoutBox,f.layoutBox);const g=Ta();LN(g,s,p.layoutBox),FZ(x,g)||(u=!0),m.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function O_e(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 P_e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function D_e(e){e.clearSnapshot()}function mV(e){e.clearMeasurements()}function hV(e){e.isLayoutDirty=!1}function M_e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function fV(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function I_e(e){e.resolveTargetDelta()}function L_e(e){e.calcProjection()}function $_e(e){e.resetSkewAndRotation()}function V_e(e){e.removeLeadSnapshot()}function pV(e,t,n){e.translate=Is(t.translate,0,n),e.scale=Is(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xV(e,t,n,s){e.min=Is(t.min,n.min,s),e.max=Is(t.max,n.max,s)}function U_e(e,t,n,s){xV(e.x,t.x,n.x,s),xV(e.y,t.y,n.y,s)}function F_e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const B_e={duration:.45,ease:[.4,0,.1,1]},gV=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vV=gV("applewebkit/")&&!gV("chrome/")?Math.round:dl;function yV(e){e.min=vV(e.min),e.max=vV(e.max)}function z_e(e){yV(e.x),yV(e.y)}function qZ(e,t,n){return e==="position"||e==="preserve-aspect"&&!ZSe(dV(t),dV(n),.2)}function q_e(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const H_e=zZ({attachResizeListener:(e,t)=>t0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lE={current:void 0},HZ=zZ({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lE.current){const e=new H_e({});e.mount(window),e.setOptions({layoutScroll:!0}),lE.current=e}return lE.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),W_e={pan:{Feature:m_e},drag:{Feature:u_e,ProjectionNode:HZ,MeasureLayout:LZ}};function bV(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,i=s[a];i&&As.postRender(()=>i(t,Cw(t)))}class Y_e extends oh{mount(){const{current:t}=this.node;t&&(this.unmount=yNe(t,(n,s)=>(bV(this.node,s,"Start"),a=>bV(this.node,a,"End"))))}unmount(){}}class G_e extends oh{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=Nw(t0(this.node.current,"focus",()=>this.onFocus()),t0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wV(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),i=s[a];i&&As.postRender(()=>i(t,Cw(t)))}class K_e extends oh{mount(){const{current:t}=this.node;t&&(this.unmount=NNe(t,(n,s)=>(wV(this.node,s,"Start"),(a,{success:i})=>wV(this.node,a,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const RR=new WeakMap,cE=new WeakMap,X_e=e=>{const t=RR.get(e.target);t&&t(e)},Z_e=e=>{e.forEach(X_e)};function Q_e({root:e,...t}){const n=e||document;cE.has(n)||cE.set(n,{});const s=cE.get(n),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver(Z_e,{root:e,...t})),s[a]}function J_e(e,t,n){const s=Q_e(t);return RR.set(e,n),s.observe(e),()=>{RR.delete(e),s.unobserve(e)}}const e2e={some:0,all:1};class t2e extends oh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:a="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof a=="number"?a:e2e[a]},l=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:m}=this.node.getProps(),f=d?u:m;f&&f(c)};return J_e(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(r2e(t,n))&&this.startObserver()}unmount(){}}function r2e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const n2e={inView:{Feature:t2e},tap:{Feature:K_e},focus:{Feature:G_e},hover:{Feature:Y_e}},s2e={layout:{ProjectionNode:HZ,MeasureLayout:LZ}},a2e={...HSe,...n2e,...W_e,...s2e},fe=dSe(a2e,jSe);
1091function i2e(){!fD.current&&jZ();const[e]=h.useState(IN.current);return e}function o2e(e){e.values.forEach(t=>t.stop())}function OR(e,t){[...t].reverse().forEach(s=>{const a=e.getVariant(s);a&&pD(e,a),e.variantChildren&&e.variantChildren.forEach(i=>{OR(i,t)})})}function l2e(e,t){if(Array.isArray(t))return OR(e,t);if(typeof t=="string")return OR(e,[t]);pD(e,t)}function c2e(){const e=new Set,t={subscribe(n){return e.add(n),()=>void e.delete(n)},start(n,s){const a=[];return e.forEach(i=>{a.push(AZ(i,n,{transitionOverride:s}))}),Promise.all(a)},set(n){return e.forEach(s=>{l2e(s,n)})},stop(){e.forEach(n=>{o2e(n)})},mount(){return()=>{t.stop()}}};return t}function d2e(){const e=a2(c2e);return V5(e.mount,[]),e}const WZ=d2e,PR=({isActive:e,onComplete:t,fullscreen:n=!1})=>{const[s,a]=h.useState(3);h.useEffect(()=>{if(!e){a(3);return}if(s===0){t();return}const u=setTimeout(()=>{a(s-1)},1e3);return()=>clearTimeout(u)},[e,s,t]);const i=180,o=4,l=(i-o)/2,c=2*Math.PI*l,d=e&&s>0?(3-s)/3:0;return r.jsx(Ts,{children:e&&s>0&&r.jsx(fe.div,{initial:{opacity:0}
1091,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:ge("bg-background/85 backdrop-blur-xl flex items-center justify-center",n?"fixed inset-0 z-[10000] rounded-none":"absolute inset-0 z-20 rounded-2xl"),children:r.jsxs("div",{className:"relative flex items-center justify-center",children:[r.jsxs(fe.svg,{width:i,height:i,className:"absolute transform -rotate-90",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},children:[r.jsx("circle",{cx:i/2,cy:i/2,r:l,fill:"none",stroke:"hsl(var(--primary) / 0.15)",strokeWidth:o}),r.jsx(fe.circle,{cx:i/2,cy:i/2,r:l,fill:"none",stroke:"hsl(var(--primary))",strokeWidth:o,strokeLinecap:"round",strokeDasharray:c,animate:{strokeDashoffset:[c,c*(1-d)]},transition:{duration:.8,ease:"easeOut"}})]}),r.jsx(fe.div,{initial:{scale:.5,opacity:.6},animate:{scale:2.5,opacity:0},transition:{duration:.8,ease:"easeOut"},className:"absolute w-24 h-24 rounded-full border-2 border-primary/40"},`pulse-${s}`),r.jsxs(fe.div,{initial:{scale:.3,opacity:0,rotateY:-90},animate:{scale:1,opacity:1,rotateY:0},exit:{scale:1.8,opacity:0}
1091,transition:{duration:.4,ease:[.34,1.56,.64,1]},className:"text-center z-10",children:[r.jsx("span",{className:"text-8xl font-black text-foreground tabular-nums",children:s}),r.jsx(fe.p,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15},className:"text-lg font-medium text-muted-foreground mt-2",children:s===1?"Go!":"Get ready..."})]},s)]})})})},jV=({isVisible:e,onToggle:t,isRecording:n,isPaused:s=!1,script:a,onScriptChange:i,autoScroll:o,onAutoScrollChange:l,scrollSpeed:c,onScrollSpeedChange:d,fillHeight:u=!1,maxDurationSeconds:m=120})=>{const[f,p]=h.useState(!1),[x,g]=h.useState(""),[v,y]=h.useState(""),[b,w]=h.useState("60"),[S,j]=h.useState(!1),[N,_]=h.useState(!1),C=h.useRef(null),k=h.useRef(null),E=h.useRef(null),[R,T]=h.useState(!1),[D,A]=h.useState(!1),[V,U]=h.useState(0),O=h.useCallback(Z=>Z===0?0:10+Z/100*140,[]),M=h.useCallback(()=>{E.current&&(clearInterval(E.current),E.current=null),T(!1)},[]);h.useEffect(()=>{if(!(n&&!s&&o&&a.trim()&&e&&!D&&c>0||N&&c>0)){M();return}if(!(N?k.current:C.current))return;const H=setTimeout(()=>{const X=N?k.current:C.current;if(!X||E.current)return;T(!0);const G=O(c),ee=50,re=G*ee/1e3;E.current=setInterval(()=>{if(X.scrollTop+X.clientHeight>=X.scrollHeight){M(),_(!1);return}X.scrollTop+=re},ee)},100);return()=>{clearTimeout(H),M()}},[n,s,o,a,e,N,D,c,V,O,M]);const $=h.useCallback(()=>{M(),C.current&&(C.current.scrollTop=0),k.current&&(k.current.scrollTop=0),A(!1),U(Z=>Z+1)},[M]),I=()=>{A(Z=>!Z)},B=()=>{N?(_(!1),M()):(k.current&&(k.current.scrollTop=0),_(!0))},K=async()=>{var Z,q;if(!x.trim()){Pe.error("Please enter a topic for your script");return}p(!0);try{const{data:H,error:X}=await F.functions.invoke("generate-script",{body:{topic:x.trim(),maxDurationSeconds:parseInt(b),websiteUrl:v.trim()||void 0}});if(X)throw X;H!=null&&H.script&&(i(H.script),j(!1),g(""),y(""),Pe.success("Script generated!"))}catch(H){console.error("Script generation error:",H),(Z=H.message)!=null&&Z.includes("429")||H.status===429?Pe.error("Too many requests. Please wait a moment and try again."):(q=H.message)!=null&&q.includes("402")||H.status===402?Pe.error("AI usage limit reached. Please try again later."):Pe.error("Failed to generate script. Please try again.")}finally{p(!1)}};return e?r.jsx(Ts,{children:r.jsxs(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:ge("w-full bg-card border border-border rounded-xl overflow-hidden shadow-lg",u&&"flex flex-col h-full !animate-none"),style:u?{height:"100%"}:void 0,children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/50 border-b border-border",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(el,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"font-medium text-sm",children:"Script / Teleprompter"}),R&&r.jsx(fe.span,{initial:{opacity:0}
1091,animate:{opacity:1},className:"text-xs text-primary bg-primary/10 px-2 py-0.5 rounded-full",children:"Scrolling"})]}),r.jsx(P,{variant:"ghost",size:"icon",onClick:t,className:"h-7 w-7",children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]}),!n&&r.jsx("div",{className:"px-4 py-3 bg-muted/30 border-b border-border",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(rr,{id:"auto-scroll",checked:o,onCheckedChange:l}),r.jsx(ye,{htmlFor:"auto-scroll",className:"text-sm cursor-pointer",children:"Auto-scroll when recording"})]}),o&&r.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[200px] max-w-[280px]",children:[r.jsxs("span",{className:"text-xs font-medium text-foreground whitespace-nowrap min-w-[52px]",children:["Speed: ",c,"%"]}),r.jsx(zm,{value:[c],onValueChange:([Z])=>d(Z),min:0,max:100,step:1,className:"flex-1"})]}),o&&a.trim()&&r.jsx(P,{variant:N?"default":"outline",size:"sm",onClick:B,className:"text-xs h-7 gap-1.5",children:N?r.jsxs(r.Fragment,{children:[r.jsx(ig,{className:"w-3 h-3"}),"Stop Preview"]}):r.jsxs(r.Fragment,{children:[r.jsx(wr,{className:"w-3 h-3"}),"Preview Speed"]})})]})}),!n&&r.jsx(Ts,{children:S?r.jsxs(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-3 bg-gradient-to-r from-primary/5 to-accent/5 border-b border-border",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(_n,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"text-sm font-medium",children:"AI Script Generator"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"flex gap-2",children:r.jsx("input",{type:"text",value:x,onChange:Z=>g(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&!Z.shiftKey&&K(),placeholder:"E.g., Product demo for new CRM feature",className:"flex-1 px-3 py-2 text-sm bg-background border border-input rounded-lg focus:outline-none focus:ring-2 focus:ring-primary",disabled:f})}),r.jsx("div",{className:"flex gap-2",children:r.jsxs("div",{className:"relative flex-1",children:[r.jsx(k_,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),r.jsx("input",{type:"url",value:v,onChange:Z=>y(Z.target.value),placeholder:"Website URL for context (optional)",className:"w-full pl-8 pr-3 py-2 text-sm bg-background border border-input rounded-lg focus:outline-none focus:ring-2 focus:ring-primary",disabled:f})]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fr,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Script length:"}),r.jsxs(kn,{value:b,onValueChange:w,disabled:f,children:[r.jsx(wn,{className:"h-8 text-sm w-[140px]",children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"30",children:"30 seconds"}),r.jsx(_t,{value:"60",children:"1 minute"}),r.jsx(_t,{value:"120",children:"2 minutes"}),r.jsx(_t,{value:"180",children:"3 minutes"}),r.jsx(_t,{value:"300",children:"5 minutes"}),r.jsx(_t,{value:"600",children:"10 minutes"}),m>600&&r.jsxs(_t,{value:String(m),children:["Max (",Math.round(m/60)," min)"]})]})]})]}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{j(!1),y("")},disabled:f,children:"Cancel"}),r.jsx(P,{size:"sm",onClick:K,disabled:f||!x.trim(),className:"bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90",children:f?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(_n,{className:"w-4 h-4 mr-1"}),"Generate"]})})]})]})]}):r.jsx(fe.div,{initial:{opacity:0}
1091,animate:{opacity:1},className:"px-4 py-2 border-b border-border bg-muted/30",children:r.jsxs(P,{variant:"ghost",size:"sm",onClick:()=>j(!0),className:"text-xs text-muted-foreground hover:text-foreground gap-1.5",children:[r.jsx(_n,{className:"w-3.5 h-3.5"}),"Generate script with AI"]})})}),r.jsxs("div",{className:ge("p-4",u&&"flex-1 flex flex-col min-h-0"),children:[n?r.jsxs("div",{className:ge("flex flex-col",u&&"flex-1 min-h-0"),children:[r.jsx("div",{ref:C,className:ge("overflow-y-auto rounded-lg bg-muted/30 p-4","scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent",u?"flex-1 min-h-0":"h-64"),children:r.jsx("p",{className:"text-lg leading-loose whitespace-pre-wrap",children:a||"No script added. Add your script before recording to use the teleprompter."})}),o&&a.trim()&&r.jsxs("div",{className:"flex items-center justify-center gap-1 mt-2 py-1",children:[r.jsx(P,{variant:"ghost",size:"icon",onClick:I,className:ge("h-7 w-7",D&&"text-primary"),title:D?"Resume scroll":"Pause scroll",children:D?r.jsx(Js,{className:"w-3.5 h-3.5"}):r.jsx(ig,{className:"w-3.5 h-3.5"})}),r.jsx(P,{variant:"ghost",size:"icon",onClick:$,className:"h-7 w-7",title:"Return to top",children:r.jsx(Wd,{className:"w-3.5 h-3.5"})}),r.jsx("div",{className:"w-px h-4 bg-border mx-1"}),r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>d(Math.max(0,c-10)),className:"h-7 w-7",title:"Slower",disabled:c<=0,children:r.jsx(ag,{className:"w-3.5 h-3.5"})}),r.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums min-w-[32px] text-center",children:[c,"%"]}),r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>d(Math.min(100,c+10)),className:"h-7 w-7",title:"Faster",disabled:c>=100,children:r.jsx(Ns,{className:"w-3.5 h-3.5"})})]})]}):N?r.jsx("div",{ref:k,className:ge("overflow-y-auto rounded-lg bg-primary/5 border-2 border-primary/20 p-4","scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent",u?"flex-1 min-h-0":"h-48"),children:r.jsx("p",{className:"text-lg leading-loose whitespace-pre-wrap",children:a})}):r.jsx($s,{value:a,onChange:Z=>i(Z.target.value),placeholder:"Type or paste your script here. It will auto-scroll during recording...",className:ge("resize-none text-base leading-loose",u?"flex-1 min-h-0":"min-h-[120px]"),rows:u?void 0:5}),!n&&r.jsxs("div",{className:"flex items-center justify-between mt-3 text-xs text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("span",{children:[a.split(/\s+/).filter(Boolean).length," words"]}),r.jsxs("span",{children:["~",Math.ceil(a.split(/\s+/).filter(Boolean).length/150)," min read"]}),r.jsxs("span",{className:"text-primary/70",children:["Max: ",m>=60?`${Math.round(m/60)} min`:`${m}s`]})]}),o&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Js,{className:"w-3 h-3"}),"Auto-scrolls during recording"]})]})]})]})}):r.jsxs(P,{variant:"outline",size:"sm",onClick:t,className:"flex items-center gap-2",children:[r.jsx(el,{className:"w-4 h-4"}),r.jsx("span",{children:"Script"})]})};var d2="Popover",[YZ,dit]=Ss(d2,[Wc]),kw=Wc(),[u2e,lh]=YZ(d2),GZ=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=kw(t),c=h.useRef(null),[d,u]=h.useState(!1),[m,f]=Zs({prop:s,defaultProp:a??!1,onChange:i,caller:d2});return r.jsx(hw,{...l,children:r.jsx(u2e,{scope:t,contentId:ji(),triggerRef:c,open:m,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:o,children:n})})};GZ.displayName=d2;var KZ="PopoverAnchor",m2e=h.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=lh(KZ,n),i=kw(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return h.useEffect(()=>(o(),()=>l()),[o,l]),r.jsx(fv,{...i,...s,ref:t})});m2e.displayName=KZ;var XZ="PopoverTrigger",ZZ=h.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=lh(XZ,n),i=kw(n),o=Ht(t,a.triggerRef),l=r.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":rQ(a.open),...s,ref:o,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:r.jsx(fv,{asChild:!0,...i,children:l})});ZZ.displayName=XZ;var gD="PopoverPortal",[h2e,f2e]=YZ(gD,{forceMount:void 0}),QZ=e=>{const{__scopePopover:t,forceMount:n,children:s,container:a}=e,i=lh(gD,t);return r.jsx(h2e,{scope:t,forceMount:n,children:r.jsx(_s,{present:n||i.open,children:r.jsx(ov,{asChild:!0,container:a,children:s})})})};QZ.displayName=gD;var xg="PopoverContent",JZ=h.forwardRef((e,t)=>
1091{const n=f2e(xg,e.__scopePopover),{forceMount:s=n.forceMount,...a}=e,i=lh(xg,e.__scopePopover);return r.jsx(_s,{present:s||i.open,children:i.modal?r.jsx(x2e,{...a,ref:t}):r.jsx(g2e,{...a,ref:t})})});JZ.displayName=xg;var p2e=Dm("PopoverContent.RemoveScroll"),x2e=h.forwardRef((e,t)=>{const n=lh(xg,e.__scopePopover),s=h.useRef(null),a=Ht(t,s),i=h.useRef(!1);return h.useEffect(()=>{const o=s.current;if(o)return z_(o)},[]),r.jsx(bw,{as:p2e,allowPinchZoom:!0,children:r.jsx(eQ,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),g2e=h.forwardRef((e,t)=>{const n=lh(xg,e.__scopePopover),s=h.useRef(!1),a=h.useRef(!1);return r.jsx(eQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),eQ=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...m}=e,f=lh(xg,n),p=kw(n);return F_(),r.jsx(yw,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:r.jsx(nu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:r.jsx(fw,{"data-state":rQ(f.open),role:"dialog",id:f.contentId,...p,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tQ="PopoverClose",v2e=h.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=lh(tQ,n);return r.jsx(ut.button,{type:"button",...s,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});v2e.displayName=tQ;var y2e="PopoverArrow",b2e=h.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,a=kw(n);return r.jsx(pw,{...a,...s,ref:t})});b2e.displayName=y2e;function rQ(e){return e?"open":"closed"}var w2e=GZ,j2e=ZZ,N2e=QZ,nQ=JZ;const Ad=w2e,Td=j2e,Tc=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},a)=>r.jsx(N2e,{children:r.jsx(nQ,{ref:a,align:t,sideOffset:n,className:ge("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Tc.displayName=nQ.displayName;const S2e=e=>{const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`},NV=200,SV=({progress:e,size:t=48,strokeWidth:n=3,className:s})=>{const a=(t-n)/2,i=2*Math.PI*a,o=i*(1-e);return r.jsxs("svg",{width:t,height:t,className:ge("transform -rotate-90",s),children:[r.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,className:"text-muted/30"}),r.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:o,className:ge("transition-all duration-300",e>.9?"text-destructive":e>.75?"text-amber-500":"text-primary")})]})};function _2e({isRecording:e,isPaused:t,duration:n,maxDuration:s,mode:a,onPause:i,onResume:o,onStop:l,onCancel:c,onStart:d,cameraPipStream:u,onPipPositionChange:m,isInDocPip:f=!1,watermarkEnabled:p=!0,onWatermarkToggle:x,canToggleWatermark:g=!1,useCustomWatermark:v=!1,onCustomWatermarkToggle:y,hasCustomLogo:b=!1,isMuted:w=!1,onToggleMute:S}){const j=s-n,N=j<=60,_=j<=20,C=s>0?n/s:0,k=h.useRef(null),[E,R]=h.useState(null),T=h.useRef(!1),D=h.useRef({x:0,y:0}),A=h.useCallback(re=>{if(!k.current||re.target.closest("button"))return;T.current=!0;const W=k.current.getBoundingClientRect();D.current={x:re.clientX-W.left,y:re.clientY-W.top},k.current.setPointerCapture(re.pointerId),re.preventDefault()},[]),V=h.useCallback(re=>{if(!T.current||!k.current)return;const W=k.current.getBoundingClientRect(),Q=window.innerWidth-W.width,L=window.innerHeight-W.height,te=Math.max(0,Math.min(re.clientX-D.current.x,Q)),ae=Math.max(0,Math.min(re.clientY-D.current.y,L));if(R({x:te,y:ae}),m&&a==="both"){const ne=te/window.innerWidth,se=ae/window.innerHeight;m(ne,se)}},[m,a]),U=h.useCallback(re=>{var W;T.current=!1,(W=k.current)==null||W.releasePointerCapture(re.pointerId)},[]),O=h.useRef(null),[M,$]=h.useState(!1),[I,B]=h.useState(!1);if(h.useEffect(()=>{!O.current||!u||(O.current.srcObject=u,O.current.play().catch(()=>{}))},[u]),h.useEffect(()=>{if(!u||!e||a!=="both")return;const re=O.current;if(!re)return;const W=async()=>
1091{if(document.hidden)try{document.pictureInPictureEnabled&&!document.pictureInPictureElement&&(await re.requestPictureInPicture(),B(!0))}catch{}else try{document.pictureInPictureElement&&(await document.exitPictureInPicture(),B(!1))}catch{}};return document.addEventListener("visibilitychange",W),()=>{document.removeEventListener("visibilitychange",W),document.pictureInPictureElement&&document.exitPictureInPicture().catch(()=>{})}},[u,e,a]),h.useEffect(()=>{if(m&&a==="both"&&!E){const re=24/window.innerWidth,W=(window.innerHeight-280)/window.innerHeight;m(re,W)}},[m,a]),!e&&!(!e&&d))return null;const Z=({compact:re=!1})=>{const W=re?"h-8 w-8":"h-9 w-9",Q=re?"w-3.5 h-3.5":"w-4 h-4";return r.jsxs("div",{className:"flex items-center gap-1",children:[S&&r.jsx(P,{variant:"ghost",size:"icon",className:ge(W,"rounded-full",w?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/10"),onClick:S,title:w?"Unmute":"Mute",children:w?r.jsx(cv,{className:Q}):r.jsx(Hd,{className:Q})}),r.jsx(P,{variant:"ghost",size:"icon",className:ge(W,"rounded-full hover:bg-foreground
1091/10"),onClick:t?o:i,children:t?r.jsx(Js,{className:Q}):r.jsx(ig,{className:Q})}),r.jsx(P,{variant:"destructive",size:"icon",className:ge(W,"rounded-full shadow-lg shadow-destructive/20"),onClick:l,children:r.jsx(Um,{className:ge(Q,"fill-current")})}),r.jsx(P,{variant:"ghost",size:"icon",className:ge(W,"rounded-full text-muted-foreground hover:text-destructive hover:bg-destructive/10"),onClick:c,children:r.jsx(zt,{className:Q})})]})},q=({size:re="h-8 w-8",iconSize:W="w-4 h-4"})=>r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:ge(re,"rounded-full",p?"text-primary":"text-muted-foreground"),children:p?r.jsx(oue,{className:W}):r.jsx(GH,{className:W})})}),r.jsx(Tc,{side:"top",className:"w-56 p-3",align:"center",children:r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Watermark"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"wm-toggle",className:"text-xs text-muted-foreground",children:"Show watermark"}),r.jsx(rr,{id:"wm-toggle",checked:p,onCheckedChange:Q=>x==null?void 0:x(Q),disabled:!g})]}),!g&&r.jsx("p",{className:"text-[10px] text-muted-foreground/70",children:lr()?"Watermark options not available on your plan":"Upgrade to toggle watermark"}),g&&b&&p&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"wm-custom",className:"text-xs text-muted-foreground",children:"Use custom logo"}),r.jsx(rr,{id:"wm-custom",checked:v,onCheckedChange:Q=>y==null?void 0:y(Q)})]})]})})]}),H=()=>r.jsxs(r.Fragment,{children:[r.jsx(fe.span,{initial:{opacity:0,x:-5},animate:{opacity:1,x:0},className:"text-sm font-medium text-muted-foreground px-1",children:"Ready to record"}),r.jsx("div",{className:"w-px h-6 bg-border/50"}),r.jsx(q,{}),r.jsx("div",{className:"w-px h-6 bg-border/50"}),r.jsx(fe.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.1},children:r.jsxs(P,{variant:"destructive",size:"sm",className:"h-8 rounded-full gap-1.5 px-4 shadow-lg shadow-destructive/25",onClick:d,children:[r.jsx(fe.div,{animate:{scale:[1,1.2,1]},transition:{duration:1.5,repeat:1/0},children:r.jsx(Ob,{className:"w-3.5 h-3.5 fill-current"})}),"Record"]})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:c,children:r.jsx(zt,{className:"w-4 h-4"})})]}),X=({compact:re=!1})=>r.jsxs("div",{className:"flex items-center gap-2 px-1",children:[r.jsx(fe.div,{animate:t?{opacity:1}:{opacity:[1,.3,1]},transition:t?{}:{duration:1.2,repeat:1/0,ease:"easeInOut"},className:ge("w-2.5 h-2.5 rounded-full shrink-0",t?"bg-amber-500":"bg-destructive")}
1091),r.jsx("span",{className:ge("font-mono font-bold tabular-nums",re?"text-sm":"text-base",_&&"text-destructive"),children:S2e(n)}),t&&r.jsx(fe.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"text-[10px] text-amber-500 font-semibold uppercase tracking-wider",children:"Paused"})]}),G=()=>N?r.jsxs(fe.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:ge("text-xs px-2 py-0.5 rounded-full font-medium",_?"bg-destructive/15 text-destructive animate-pulse":"bg-amber-500/15 text-amber-500"),children:[j,"s left"]}):null;if(a==="screen"){const re=f?{width:"100%"}:E?{left:E.x,top:E.y,transform:"none"}:{bottom:80,left:"50%",transform:"translateX(-50%)"};return r.jsx(fe.div,{ref:k,initial:{y:30,opacity:0,scale:.95},animate:{y:0,opacity:1,scale:1},exit:{y:30,opacity:0,scale:.95},transition:{type:"spring",damping:30,stiffness:400},className:ge("select-none z-[9999]",f?"flex items-center justify-center p-4":"fixed cursor-grab"),style:re,onPointerDown:f?void 0:A,onPointerMove:f?void 0:V,onPointerUp:f?void 0:U,children:r.jsxs("div",{className:ge("bg-background/90 backdrop-blur-xl border border-border/50 shadow-2xl rounded-full","flex items-center gap-2 px-4 py-2",e&&_&&"border-destructive/50 shadow-destructive/10"),children:[!f&&!e&&r.jsx(mue,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"}),e?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative flex items-center justify-center",children:[r.jsx(SV,{progress:C,size:32,strokeWidth:2.5}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(fe.div,{animate:t?{}:{opacity:[1,.3,1]},transition:{duration:1.2,repeat:1/0},className:ge("w-2 h-2 rounded-full",t?"bg-amber-500":"bg-destructive")}
1091)})]}),r.jsx(X,{}),r.jsx(G,{}),r.jsx("div",{className:"w-px h-6 bg-border/50"}),r.jsx(Z,{})]}):r.jsx(H,{})]})})}const ee=f?{}:E?{left:E.x,top:E.y,transform:"none"}:{bottom:80,left:"50%",transform:"translateX(-50%)"};return r.jsx(Ts,{children:r.jsxs(fe.div,{ref:k,initial:{scale:.8,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.8,opacity:0,y:20},transition:{type:"spring",damping:28,stiffness:350},className:ge("select-none z-[9999] flex flex-col items-center gap-2",f?"p-4 w-full":"fixed cursor-grab"),style:ee,onPointerDown:f?void 0:A,onPointerMove:f?void 0:V,onPointerUp:f?void 0:U,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:[u&&r.jsxs("div",{className:"relative",children:[e&&!t&&r.jsx(fe.div,{className:"absolute -inset-1.5 rounded-full",animate:{boxShadow:["0 0 12px 2px hsl(var(--primary) / 0.3)","0 0 20px 4px hsl(var(--primary) / 0.5)","0 0 12px 2px hsl(var(--primary) / 0.3)"]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}}),e&&r.jsx(fe.div,{className:ge("absolute -inset-0.5 rounded-full border-2",t?"border-amber-500/60":"border-primary/60"),animate:t?{}:{opacity:[.6,1,.6]},transition:{duration:1.5,repeat:1/0}}),r.jsxs("div",{className:ge("overflow-hidden shadow-2xl bg-black relative rounded-full",!e&&"border-2 border-white/40",e&&"border-2 border-primary/40"),style:{width:NV,height:NV},children:[r.jsx("video",{ref:O,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover scale-x-[-1]"}),r.jsx(Ts,{children:M&&!f&&r.jsx(fe.div,{initial:{opacity:0}
1091,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/30 backdrop-blur-[1px] flex items-center justify-center pointer-events-none",children:r.jsx(YH,{className:"w-5 h-5 text-white drop-shadow-lg"})})})]})]}),r.jsx(fe.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:.1},className:ge("bg-background/90 backdrop-blur-xl border border-border/50 shadow-2xl rounded-full","flex items-center gap-2 px-3 py-1.5",e&&_&&"border-destructive/50 shadow-destructive/10"),children:e?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative flex items-center justify-center",children:[r.jsx(SV,{progress:C,size:28,strokeWidth:2}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(fe.div,{animate:t?{}:{opacity:[1,.3,1]},transition:{duration:1.2,repeat:1/0},className:ge("w-1.5 h-1.5 rounded-full",t?"bg-amber-500":"bg-destructive")})})]}),r.jsx(X,{compact:!0}),r.jsx(G,{}),r.jsx("div",{className:"w-px h-5 bg-border/50"}),r.jsx(Z,{compact:!0})]}):r.jsxs(r.Fragment,{children:[r.jsx(fe.span,{initial:{opacity:0}
1091,animate:{opacity:1},className:"text-xs font-medium text-muted-foreground px-1",children:"Ready"}),r.jsx("div",{className:"w-px h-5 bg-border/50"}),r.jsx(q,{size:"h-7 w-7",iconSize:"w-3.5 h-3.5"}),r.jsx("div",{className:"w-px h-5 bg-border/50"}),r.jsxs(P,{variant:"destructive",size:"sm",className:"h-7 rounded-full gap-1 px-3 text-xs shadow-lg shadow-destructive/20",onClick:d,children:[r.jsx(fe.div,{animate:{scale:[1,1.3,1]},transition:{duration:1.5,repeat:1/0},children:r.jsx(Ob,{className:"w-3 h-3 fill-current"})}),"Record"]}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-full text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:c,children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]})})]})})}const Tu=1,Cj=3,dE=.1,_V=({zoomPanRef:e,surfaceRef:t,mirrored:n=!1,className:s})=>{const[a,i]=h.useState(e.current.zoom),[o,l]=h.useState(e.current.panX),[c,d]=h.useState(e.current.panY);h.useEffect(()=>{e.current={zoom:a,panX:o,panY:c}},[a,o,c,e]);const u=h.useCallback(x=>{const g=Math.max(Tu,Math.min(Cj,Number(x.toFixed(2))));i(g),g<=Tu&&(l(.5),d(.5))},[]),m=h.useCallback(()=>{i(1),l(.5),d(.5)},[]),f=h.useRef(!1),p=h.useRef(null);return h.useEffect(()=>{const x=t.current;if(!x)return;const g=S=>{S.preventDefault();const j=S.deltaY>0?-1:1;i(N=>Math.max(Tu,Math.min(Cj,Number((N+j*dE).toFixed(2)))))},v=S=>{var j,N;e.current.zoom<=Tu||(f.current=!0,p.current={x:S.clientX,y:S.clientY},(N=(j=S.target)==null?void 0:j.setPointerCapture)==null||N.call(j,S.pointerId),x.style.cursor="grabbing")},y=S=>{if(!f.current||!p.current)return;const j=x.getBoundingClientRect(),N=(S.clientX-p.current.x)/j.width,_=(S.clientY-p.current.y)/j.height;p.current={x:S.clientX,y:S.clientY};const C=e.current.zoom,k=n?1:-1;l(E=>Math.max(0,Math.min(1,E+k*N*C))),d(E=>Math.max(0,Math.min(1,E-_*C)))},b=()=>{f.current=!1,p.current=null,x.style.cursor=e.current.zoom>Tu?"grab":"default"},w=()=>m();return x.addEventListener("wheel",g,{passive:!1}),x.addEventListener("pointerdown",v),window.addEventListener("pointermove",y),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b),x.addEventListener("dblclick",w),()=>{x.removeEventListener("wheel",g),x.removeEventListener("pointerdown",v),window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),x.removeEventListener("dblclick",w)}},[t,e,n,m]),h.useEffect(()=>{const x=t.current;x&&(x.style.cursor=a>Tu?"grab":"default")},[a,t]),r.jsxs("div",{className:ge("flex items-center gap-2 rounded-lg border border-border bg-card/70 backdrop-blur-sm px-2 py-1.5 shadow-sm",s),children:[r.jsx(P,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>u(a-dE*2),disabled:a<=Tu,title:"Zoom out",children:r.jsx(rW,{className:"w-3.5 h-3.5"})}),r.jsx(zm,{value:[a],min:Tu,max:Cj,step:.05,onValueChange:x=>u(x[0]),className:"w-28","aria-label":"Camera zoom"}),r.jsx(P,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>u(a+dE*2),disabled:a>=Cj,title:"Zoom in",children:r.jsx(tW,{className:"w-3.5 h-3.5"})}),r.jsxs("span",{className:"text-[10px] font-mono tabular-nums text-muted-foreground w-9 text-center select-none",children:[a.toFixed(2),"x"]}),r.jsxs("div",{className:"hidden sm:flex items-center gap-1 text-[10px] text-muted-foreground pl-1 border-l border-border/60 ml-1 pr-1",children:[r.jsx(Aue,{className:"w-3 h-3"}),r.jsx("span",{children:"Drag preview to pan"})]}),r.jsxs(P,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:m,disabled:a===1&&o===.5&&c===.5,title:"Reset zoom & pan",children:[r.jsx(Sue,{className:"w-3 h-3"}),"Reset"]})]})},C2e=()=>{const[e,t]=h.useState(!1),n=h.useRef(null),s=typeof document<"u"&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled;h.useEffect(()=>{const l=()=>{t(!0)},c=()=>{t(!1),n.current=null};return document.addEventListener("enterpictureinpicture",l),document.addEventListener("leavepictureinpicture",c),()=>{document.removeEventListener("enterpictureinpicture",l),document.removeEventListener("leavepictureinpicture",c)}},[]);const a=h.useCallback(async l=>{if(!s||!l){console.warn("PiP is not supported or no video element provided");return}try{document.pictureInPictureElement&&await document.exitPictureInPicture();const c=await l.requestPictureInPicture();n.current=c,t(!0),c.addEventListener("resize",()=>{console.log("PiP window resized:",c.width,c.height)})}catch(c){console.error("Failed to enter PiP:",c)}},[s]),i=h.useCallback(async()=>{try{document.pictureInPictureElement&&(await document.exitPictureInPicture(),t(!1),n.current=null)}catch(l){console.error("Failed to exit PiP:",l)}},[]),o=h.useCallback(async l=>{e?await i():await a(l)},[e,a,i]);return{isPiPSupported:s,isPiPActive:e,enterPiP:a,exitPiP:i,togglePiP:o}};function k2e(e={}){const[t,n]=h.useState(null),[s]=h.useState(()=>!!window.documentPictureInPicture),a=h.useRef(e.onClose);a.current=e.onClose;const i=h.useCallback(async()=>
1091{if(!window.documentPictureInPicture)return console.warn("Document Picture-in-Picture API is not supported in this browser."),null;try{const l=await window.documentPictureInPicture.requestWindow({width:e.width??360,height:e.height??420,disallowReturnToOpener:!0});return document.querySelectorAll('style, link[rel="stylesheet"]').forEach(d=>{l.document.head.appendChild(d.cloneNode(!0))}),l.document.body.style.margin="0",l.document.body.style.background="transparent",l.document.body.style.overflow="hidden",l.addEventListener("pagehide",()=>{var d;n(null),(d=a.current)==null||d.call(a)}),n(l),l}catch(l){return console.error("Failed to open Document PiP window:",l),null}},[e.width,e.height]),o=h.useCallback(()=>{t&&(t.close(),n(null))},[t]);return h.useEffect(()=>()=>{t&&t.close()},[t]),{isSupported:s,pipWindow:t,isOpen:!!t,open:i,close:o,containerElement:(t==null?void 0:t.document.body)??null}}const ch="/assets/vidareo-icon-C4xdDL_l.png",E2e=async(e,t)=>{if(!e.type.includes("webm"))return e;const n=URL.createObjectURL(e);try{await new Promise(s=>{const a=document.createElement("video");a.muted=!0,a.preload="auto",a.style.position="fixed",a.style.left="-9999px",a.style.opacity="0",document.body.appendChild(a);let i=!1;const o=()=>{if(!i){i=!0;try{a.pause(),a.removeAttribute("src"),a.load(),a.remove()}catch{}s()}},l=setTimeout(o,5e3);a.addEventListener("loadeddata",()=>{const c=()=>{a.removeEventListener("timeupdate",c),clearTimeout(l),a.currentTime=0,setTimeout(o,100)};a.addEventListener("timeupdate",c,{once:!0}),a.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),a.onerror=()=>{clearTimeout(l),o()},a.src=n,a.load()})}catch{}return URL.revokeObjectURL(n),e};function A2e(e){const{maxDuration:t,watermarkEnabled:n,watermarkPosition:s,watermarkOpacity:a,watermarkSize:i,useCustomWatermark:o,companyLogoUrl:l,subscriptionTier:c,selectedAudioDevice:d,selectedVideoDevice:u,mirrorCamera:m,onDocPipOpen:f,onDocPipClose:p,docPipSupported:x}=e,[g,v]=h.useState("setup"),[y,b]=h.useState(!1),[w,S]=h.useState(!1),[j,N]=h.useState(!1),[_,C]=h.useState(!1),[k,E]=h.useState(!1),[R,T]=h.useState(0),[D,A]=h.useState(null),[V,U]=h.useState(null),O=h.useRef(null),M=h.useRef(null),$=h.useRef(null),I=h.useRef(null),B=h.useRef(null),K=h.useRef([]),Z=h.useRef(null),q=h.useRef(0),H=h.useRef(null),X=h.useRef(0),G=h.useRef(null),ee=h.useRef([]),re=h.useRef(null),W=h.useRef({normX:.05,normY:.75}),Q=h.useRef(null),L=h.useRef(null),te=h.useRef(null),ae=h.useRef(null),ne=h.useRef(m),se=h.useRef(()=>{}),ue=h.useRef(null),Ne=h.useRef(null),Qe=h.useRef({zoom:1,panX:.5,panY:.5});h.useEffect(()=>{ne.current=m},[m]);const[J,de]=h.useState(null),ve=h.useRef(n);h.useEffect(()=>{ve.current=n},[n]);const Le=h.useRef(c);h.useEffect(()=>{Le.current=c},[c]),h.useEffect(()=>{if(!(c==="starter"||n)){Q.current=null;return}let tt=!1;const Re=c!=="starter"&&o&&l?l:ch,Fe=new window.Image;return Fe.crossOrigin="anonymous",Fe.onload=()=>{tt||Le.current!=="starter"&&!ve.current||(Q.current=Fe)},Fe.onerror=()=>{tt||(Q.current=null)},Fe.src=Re,()=>{tt=!0,Q.current=null}},[n,o,l,c]);const $e=h.useCallback((dt,tt,Re)=>{if(Le.current!=="starter"&&!ve.current)return;const Fe=Q.current;if(!Fe)return;const Ae=Math.round(tt*.02),Ve=Math.max(i*2*(tt/1920),28),et=Fe.naturalWidth/(Fe.naturalHeight||1),Ge=Ve*et,St=Ve*8,Tt=Math.min(Ge,St);let Zt,bt;switch(s){case"top-left":Zt=Ae,bt=Ae;break;case"top-right":Zt=tt-Tt-Ae,bt=Ae;break;case"bottom-left":Zt=Ae,bt=Re-Ve-Ae;break;default:Zt=tt-Tt-Ae,bt=Re-Ve-Ae;break}dt.save(),dt.globalAlpha=a,dt.drawImage(Fe,Zt,bt,Tt,Ve),dt.restore()},[i,s,a]);h.useEffect(()=>{se.current=$e},[$e]);const De=h.useCallback(dt=>{if(dt.length<=1)return dt;try{const tt=new AudioContext;te.current=tt;const Re=tt.createMediaStreamDestination();return dt.forEach(Fe=>{tt.createMediaStreamSource(new MediaStream([Fe])).connect(Re)}),Re.stream.getAudioTracks()}catch(tt){return console.warn("AudioContext mixing failed, using first track only:",tt),[dt[0]]}},[]),oe=h.useCallback(()=>{Z.current&&(clearInterval(Z.current),Z.current=null)},[]),xe=h.useCallback(()=>{if(oe(),G.current&&(cancelAnimationFrame(G.current),G.current=null),B.current&&B.current.state!=="inactive")try{B.
1091current.stop()}catch{}if(B.current=null,ee.current.forEach(dt=>dt.getTracks().forEach(tt=>tt.stop())),ee.current=[],I.current&&(I.current.getTracks().forEach(dt=>dt.stop()),I.current=null),O.current&&(O.current.srcObject=null),re.current=null,de(null),$.current&&($.current.srcObject=null),Ne.current){try{Ne.current.pause(),Ne.current.srcObject=null,Ne.current.remove()}catch{}Ne.current=null}te.current&&(te.current.close().catch(()=>{}),te.current=null)},[oe]),Ze=h.useCallback(()=>{v("setup"),E(!1),b(!1),S(!1),N(!1),T(0),A(null),U(null),C(!1),K.current=[]},[]),it=h.useCallback(()=>{oe(),B.current&&B.current.state!=="inactive"&&B.current.stop(),b(!1),S(!1),C(!1)},[oe]),ct=h.useCallback(()=>{B.current&&(w?(H.current!==null&&(q.current+=Date.now()-H.current,H.current=null),B.current.resume(),S(!1)):(H.current=Date.now(),B.current.pause(),S(!0)))},[w]),Oe=h.useCallback(()=>{const dt=[I.current,...ee.current].filter(Boolean),tt=!j;dt.forEach(Re=>{Re.getAudioTracks().forEach(Fe=>{Fe.enabled=!tt})}),N(tt)},[j]),pe=h.useCallback(()=>{it(),xe(),p==null||p(),A(null),U(null),v("setup"),T(0),C(!1)},[it,xe,p]),le=h.useCallback(async dt=>{try{if(I.current&&I.current.getTracks().forEach(Ge=>Ge.stop()),ee.current.forEach(Ge=>Ge.getTracks().forEach(St=>St.stop())),ee.current=[],G.current&&(cancelAnimationFrame(G.current),G.current=null),Ne.current){try{Ne.current.pause(),Ne.current.srcObject=null,Ne.current.remove()}catch{}Ne.current=null}re.current=null,de(null);const tt=await navigator.mediaDevices.getUserMedia(dt?{video:{deviceId:u?{exact:u}:void 0,facingMode:u?void 0:{ideal:"user"},width:{ideal:1280},height:{ideal:720}},audio:d?{deviceId:{exact:d}}:!0}:{audio:d?{deviceId:{exact:d}}:!0});if(ee.current=[tt],dt&&tt.getVideoTracks().length>0){const Ge=document.createElement("video");Ge.srcObject=tt,Ge.muted=!0,Ge.playsInline=!0,Ge.setAttribute("webkit-playsinline","true"),Ge.style.position="fixed",Ge.style.left="-9999px",Ge.style.top="0",Ge.style.width="1px",Ge.style.height="1px",Ge.style.opacity="0",Ge.style.pointerEvents="none",document.body.appendChild(Ge),await Ge.play(),Ne.current=Ge,re.current=tt,de(tt)}const Re=document.createElement("canvas");Re.width=1920,Re.height=1080;const Fe=Re.getContext("2d"),Ae=()=>{const Ge=ue.current;Fe.clearRect(0,0,Re.width,Re.height),Ge?Ge(Fe,Re.width,Re.height):(Fe.fillStyle="#000000",Fe.fillRect(0,0,Re.width,Re.height)),se.current(Fe,Re.width,Re.height),G.current=requestAnimationFrame(Ae)};Ae();const Ve=Re.captureStream(30),et=new MediaStream([...Ve.getVideoTracks(),...tt.getAudioTracks()]);I.current=et,O.current&&(O.current.srcObject=et,await O.current.play().catch(Ge=>{console.warn("Preview video play was interrupted:",Ge)}))}catch(tt){throw console.error("Presentation preview error:",tt),tt}},[u,d]),ke=h.useCallback(async()=>{try{if(I.current&&I.current.getTracks().forEach(bt=>bt.stop()),ee.current.forEach(bt=>bt.getTracks().forEach(Wt=>Wt.stop())),ee.current=[],G.current&&(cancelAnimationFrame(G.current),G.current=null),Ne.current){try{Ne.current.pause(),Ne.current.srcObject=null,Ne.current.remove()}catch{}Ne.current=null}const dt=await navigator.mediaDevices.getUserMedia({video:{deviceId:u?{exact:u}:void 0,facingMode:u?void 0:{ideal:"user"},width:{ideal:1280},height:{ideal:720},aspectRatio:{ideal:16/9}},audio:d?{deviceId:{exact:d}}:!0});ee.current=[dt];const tt=document.createElement("video");tt.srcObject=dt,tt.muted=!0,tt.playsInline=!0,tt.setAttribute("webkit-playsinline","true"),tt.style.position="fixed",tt.style.left="-9999px",tt.style.top="0",tt.style.width="1px",tt.style.height="1px",tt.style.opacity="0",tt.style.pointerEvents="none",document.body.appendChild(tt),await tt.play(),Ne.current=tt;const Re=tt.videoWidth||1280,Fe=tt.videoHeight||720,Ae=1280,Ve=720,et=document.createElement("canvas");et.width=Ae,et.height=Ve;const Ge=et.getContext("2d"),St=()=>{const bt=ue.current;if(bt)(et.width!==1920||et.height!==1080)&&(et.width=1920,et.height=1080),bt(Ge,et.width,et.height);else{(et.width!==Ae||et.height!==Ve)&&(et.width=Ae,et.height=Ve);const Wt=tt.videoWidth||Re,Xe=tt.videoHeight||Fe,be=et.width/et.height,Ue=Wt/Xe;let we=0,pt=0,mt=Wt,er=Xe;Ue>be?(mt=Xe*be,we=(Wt-mt)/2):Ue<be&&(er=Wt/be,pt=(Xe-er)/2);const kt=Qe.current,at=Math.max(1,Math.min(3,kt.zoom||1)),Yt=Math.max(0,Math.min(1,kt.panX??.5)),Ft=Math.max(0,Math.min(1,kt.panY??.5)),or=mt/at,Ar=er/at;
1091we=we+(mt-or)*Yt,pt=pt+(er-Ar)*Ft,mt=or,er=Ar,Ge.fillStyle="#000",Ge.fillRect(0,0,et.width,et.height),ne.current?(Ge.save(),Ge.translate(et.width,0),Ge.scale(-1,1),Ge.drawImage(tt,we,pt,mt,er,0,0,et.width,et.height),Ge.restore()):Ge.drawImage(tt,we,pt,mt,er,0,0,et.width,et.height)}se.current(Ge,et.width,et.height),G.current=requestAnimationFrame(St)};St();const Tt=et.captureStream(30),Zt=new MediaStream([...Tt.getVideoTracks(),...dt.getAudioTracks()]);I.current=Zt,re.current=dt,de(dt),O.current&&(O.current.srcObject=Zt,await O.current.play().catch(bt=>{console.warn("Preview video play was interrupted:",bt)}))}catch(dt){throw console.error("Camera preview error:",dt),dt}},[u,d]),Ee=h.useCallback(async dt=>{try{ee.current.forEach(kt=>kt.getTracks().forEach(at=>at.stop())),ee.current=[],I.current&&(I.current.getTracks().forEach(kt=>kt.stop()),I.current=null),G.current&&(cancelAnimationFrame(G.current),G.current=null);const tt=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"monitor",width:{ideal:3840},height:{ideal:2160}},audio:!0,preferCurrentTab:!1,selfBrowserSurface:"exclude",monitorTypeSurfaces:"include",surfaceSwitching:"exclude",systemAudio:"include"}),Fe=tt.getVideoTracks()[0].getSettings();console.log("[Screen Capture] Surface type:",Fe.displaySurface),console.log("[Screen Capture] Dimensions:",Fe.width,"x",Fe.height);let Ae=null,Ve=null;if(dt==="screen")try{Ae=await navigator.mediaDevices.getUserMedia({audio:d?{deviceId:{exact:d},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.log("Microphone not available, continuing without")}else try{Ve=await navigator.mediaDevices.getUserMedia({video:{deviceId:u?{exact:u}:void 0,facingMode:u?void 0:{ideal:"user"},width:{ideal:320},height:{ideal:240}},audio:d?{deviceId:{exact:d}}:!0})}catch(kt){console.warn("Camera not available, falling back to screen-only:",kt)}ae.current=tt,ee.current=[tt],Ae&&ee.current.push(Ae),Ve&&ee.current.push(Ve),Ve&&(re.current=Ve,de(Ve));const et=tt.getVideoTracks()[0],Ge=et.getSettings(),St=Ge.width||1920,Tt=Ge.height||1080,Zt=document.createElement("canvas");Zt.width=St,Zt.height=Tt;const bt=Zt.getContext("2d"),Wt=document.createElement("video");Wt.srcObject=tt,Wt.muted=!0,Wt.playsInline=!0,await Wt.play();let Xe=null;const be=()=>{if(Xe){try{Xe.pause(),Xe.srcObject=null,Xe.remove()}catch{}Xe=null}};Ve&&(Xe=document.createElement("video"),Xe.srcObject=Ve,Xe.muted=!0,Xe.playsInline=!0,Xe.setAttribute("webkit-playsinline","true"),Xe.style.position="fixed",Xe.style.left="-9999px",Xe.style.top="0",Xe.style.width="1px",Xe.style.height="1px",Xe.style.opacity="0",Xe.style.pointerEvents="none",document.body.appendChild(Xe),await Xe.play().catch(()=>{}));const Ue=()=>{if(bt.clearRect(0,0,St,Tt),bt.drawImage(Wt,0,0,St,Tt),Xe&&Xe.videoWidth>0&&Xe.videoHeight>0){const kt=Math.max(180,Math.round(St*.16)),at=Math.max(24,Math.round(St*.02)),Yt=Math.max(St-kt-at,at),Ft=Math.max(Tt-kt-at,at),or=at+(Yt-at)*W.current.normX,Ar=at+(Ft-at)*W.current.normY,nn=kt/2;bt.save(),bt.beginPath(),bt.arc(or+nn,Ar+nn,nn,0,Math.PI*2),bt.closePath(),bt.clip(),bt.translate(or+kt,Ar),bt.scale(-1,1),bt.drawImage(Xe,0,0,Xe.videoWidth,Xe.videoHeight,0,0,kt,kt),bt.restore(),bt.save(),bt.strokeStyle="rgba(255,255,255,0.92)",bt.lineWidth=Math.max(4,Math.round(kt*.025)),bt.beginPath(),bt.arc(or+nn,Ar+nn,nn-bt.lineWidth/2,0,Math.PI*2),bt.stroke(),bt.restore()}se.current(bt,St,Tt),G.current=requestAnimationFrame(Ue)};Ue();const we=Zt.captureStream(30),pt=[...Ae?Ae.getAudioTracks():[],...Ve?Ve.getAudioTracks():[],...tt.getAudioTracks()],mt=De(pt),er=new MediaStream([...we.getVideoTracks(),...mt]);I.current=er,et.onended=()=>{if(oe(),G.current&&(cancelAnimationFrame(G.current),G.current=null),be(),Ve&&Ve.getTracks().forEach(kt=>kt.stop()),Ae&&Ae.getTracks().forEach(kt=>kt.stop()),te.current&&(te.current.close().catch(()=>{}),te.current=null),B.current&&B.current.state!=="inactive")try{B.current.stop()}catch{}b(!1),S(!1),C(!1)},v("recording"),C(!0)}catch(tt){throw console.error("Failed to acquire screen:",tt),tt}},[d,u,oe,De]),ot=h.useCallback(()=>{E(!0)},[]),gt=h.useCallback(async()=>{E(!1);try{let dt;if(!I.current)throw new Error("No stream available");if(dt=I.current,(g==="setup"||!dt.getAudioTracks().length)&&dt.getAudioTracks().length===0&&d)try{const Ae=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:d}}});dt=new MediaStream([...dt.getVideoTracks(),...Ae.getAudioTracks()]),I.current=dt}catch{}
1091const tt=MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?"video/webm;codecs=vp9":MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",Re=new MediaRecorder(dt,{mimeType:tt});K.current=[],Re.ondataavailable=Fe=>{Fe.data.size>0&&K.current.push(Fe.data)},Re.onstop=async()=>{const Fe=new Blob(K.current,{type:tt}),Ve=(Date.now()-X.current-q.current)/1e3,et=await E2e(Fe,Ve),Ge=URL.createObjectURL(et);A(et),U(Ge),v("review"),ee.current.forEach(St=>St.getTracks().forEach(Tt=>Tt.stop())),ee.current=[],I.current&&(I.current.getTracks().forEach(St=>St.stop()),I.current=null),G.current&&(cancelAnimationFrame(G.current),G.current=null),te.current&&(te.current.close().catch(()=>{}),te.current=null)},B.current=Re,Re.start(1e3),b(!0),T(0),X.current=Date.now(),q.current=0,H.current=null,Z.current=setInterval(()=>{if(H.current===null){const Fe=Date.now()-X.current-q.current;T(Math.floor(Fe/1e3))}},100)}catch(dt){throw console.error("Failed to start recording:",dt),dt}},[g,d]),Nt=h.useCallback(dt=>{const tt=URL.createObjectURL(dt);A(dt),U(tt);const Re=document.createElement("video");Re.src=tt,Re.onloadedmetadata=()=>{T(Math.floor(Re.duration)),v("review")}},[]);h.useEffect(()=>{y&&!w&&R>=t&&it()},[R,y,w,t,it]);const Ct=g==="recording";return h.useEffect(()=>{if(!Ct)return;const dt=tt=>{tt.preventDefault()};return window.addEventListener("beforeunload",dt),()=>window.removeEventListener("beforeunload",dt)},[Ct]),h.useEffect(()=>()=>{xe()},[xe]),h.useEffect(()=>{if(g!=="setup"&&g!=="recording"||!I.current)return;const dt=()=>{!O.current||!I.current||(O.current.srcObject!==I.current&&(O.current.srcObject=I.current),O.current.play().catch(()=>{}))};dt();const tt=requestAnimationFrame(()=>{dt()});return()=>cancelAnimationFrame(tt)},[g,y,k]),h.useEffect(()=>{if(g==="recording"&&!(!$.current||!re.current))try{$.current.srcObject=re.current,$.current.play()}catch{}},[g]),{isRecording:y,isPaused:w,isMuted:j,isStreamReady:_,isCountingDown:k,duration:R,recordedBlob:D,recordedUrl:V,modalState:g,videoRef:O,recordedVideoRef:M,cameraPipRef:$,cameraStreamForPip:J,pipCanvasPosRef:W,nativeCameraInputRef:L,screenStream:ae.current,presentationOverlayRef:ue,cameraVideoElRef:Ne,cameraZoomPanRef:Qe,startScreenCapture:Ee,startPresentationPreview:le,startCameraPreview:ke,startCountdown:ot,completeCountdown:gt,stopRecording:it,togglePause:ct,toggleMute:Oe,cancelRecording:pe,cleanup:xe,resetState:Ze,handleNativeCameraCapture:Nt,setModalState:v}}const T2e="https://chromewebstore.google.com/detail/lmaaoeofdlnjfenacdmdffepkniggkng";function R2e({onCheckAgain:e,isChecking:t}){return r.jsxs("div",{className:"flex flex-col items-center justify-center py-2 px-4 text-center space-y-2 max-h-full overflow-hidden",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(Vs,{className:"w-6 h-6 text-primary"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Enhanced Mode Available"}),r.jsx("p",{className:"text-xs text-muted-foreground max-w-xs leading-relaxed",children:"Browser recording works without the extension. Install the extension for stronger cross-window controls."})]}),r.jsx("div",{className:"w-full max-w-xs space-y-1 text-left",children:["Stronger cross-window recording controls","Camera bubble that can stay visible outside the app tab","Helpful fallback when browser capture is limited","Same screen, screen + camera, and share workflow"].map((n,s)=>r.jsxs("div",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground",children:[r.jsx("span",{className:"text-primary mt-0.5 leading-none",children:"✓"}),r.jsx("span",{children:n})]},s))}),r.jsx(P,{size:"sm",className:"w-full max-w-xs gap-1.5",asChild:!0,children:r.jsxs("a",{href:T2e,target:"_blank",rel:"noopener noreferrer",children:["Install E
1091xtension ",r.jsx(bn,{className:"w-3.5 h-3.5"})]})}),r.jsxs("button",{onClick:e,disabled:t,className:"text-[11px] text-muted-foreground hover:text-primary transition-colors disabled:opacity-50 inline-flex items-center gap-1",children:[r.jsx(vs,{className:`w-3 h-3 ${t?"animate-spin":""}`}),t?"Checking...":"Check extension status"]}),r.jsx("p",{className:"text-[11px] text-muted-foreground/60",children:"Screen and camera recording can start directly in the browser."})]})}const DR=h.memo(({slide:e,theme:t,slideIndex:n,totalSlides:s,className:a})=>{if(e.layout==="image"&&e.imageUrl)return r.jsxs("div",{className:ge("w-[1920px] h-[1080px] relative overflow-hidden select-none bg-black flex items-center justify-center",a),children:[r.jsx("img",{src:e.imageUrl,alt:e.title,className:"max-w-full max-h-full object-contain",draggable:!1}),r.jsxs("div",{className:"absolute bottom-[40px] right-[60px] font-medium",style:{fontSize:"24px",color:"rgba(255,255,255,0.3)"},children:[n+1," / ",s]})]});const i=e.layout==="title",o=e.layout==="closing",l=e.layout==="quote";return r.jsxs("div",{className:ge("w-[1920px] h-[1080px] relative overflow-hidden select-none",a),style:{backgroundColor:t.backgroundColor,fontFamily:"'Inter', system-ui, sans-serif"},children:[r.jsx("div",{className:"absolute top-0 right-0 w-[900px] h-[900px] rounded-full opacity-10 blur-[120px]",style:{backgroundColor:t.primaryColor}}),r.jsx("div",{className:"absolute bottom-0 left-0 w-[600px] h-[600px] rounded-full opacity-8 blur-[100px]",style:{backgroundColor:t.accentColor}}),r.jsx("div",{className:"absolute top-0 left-0 w-[8px] h-full",style:{background:`linear-gradient(180deg, ${t.primaryColor}, ${t.accentColor})`}}),r.jsx("div",{className:ge("relative z-10 h-full flex flex-col px-[120px]",i||o?"items-center justify-center text-center":"justify-center"),children:i||o?r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"font-bold leading-tight mb-[30px]",style:{fontSize:"96px",color:"#FFFFFF"},children:e.title}),e.subtitle&&r.jsx("p",{className:"font-light leading-relaxed max-w-[1200px]",style:{fontSize:"42px",color:t.secondaryColor}
1091,children:e.subtitle}),o&&e.bullets.length>0&&r.jsx("p",{className:"mt-[40px] font-medium",style:{fontSize:"36px",color:t.accentColor},children:e.bullets[0]})]}):l?r.jsxs("div",{className:"flex flex-col items-center text-center max-w-[1400px] mx-auto",children:[r.jsx("div",{className:"font-bold mb-[20px]",style:{fontSize:"120px",color:t.primaryColor,lineHeight:.8},children:'"'}),r.jsx("p",{className:"font-light italic leading-relaxed mb-[40px]",style:{fontSize:"52px",color:"#FFFFFF"},children:e.title}),e.subtitle&&r.jsxs("p",{style:{fontSize:"30px",color:t.secondaryColor},children:["- ",e.subtitle]})]}):r.jsxs(r.Fragment,{children:[r.jsx("h2",{className:"font-bold leading-tight mb-[16px]",style:{fontSize:"72px",color:"#FFFFFF"},children:e.title}),e.subtitle&&r.jsx("p",{className:"mb-[48px] font-light",style:{fontSize:"34px",color:t.secondaryColor},children:e.subtitle}),r.jsx("ul",{className:"space-y-[28px]",children:e.bullets.map((c,d)=>r.jsxs("li",{className:"flex items-start gap-[24px]",children:[r.jsx("span",{className:"mt-[12px] w-[16px] h-[16px] rounded-full shrink-0",style:{backgroundColor:t.accentColor}}),r.jsx("span",{className:"font-normal leading-relaxed",style:{fontSize:"38px",color:"#E0E0E0"},children:c})]},d))})]})}),r.jsxs("div",{className:"absolute bottom-[40px] right-[60px] font-medium",style:{fontSize:"24px",color:"rgba(255,255,255,0.3)"},children:[n+1," / ",s]})]})});DR.displayName="SlideCanvas";const O2e=({slides:e,theme:t,onSlidesChange:n,activeSlideIndex:s,onActiveSlideChange:a})=>{const[i,o]=h.useState(null),[l,c]=h.useState(""),[d,u]=h.useState(""),[m,f]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState(null),y=h.useRef(null),b=e[s];h.useEffect(()=>{if(y.current){const T=y.current.children[s];T&&T.scrollIntoView({behavior:"smooth",block:"nearest"})}},[s]);const w=h.useCallback(T=>{o(T.id),c(T.title),u(T.subtitle||""),f(T.bullets.join(`
1092`)),x(T.speakerNotes||"")},[]),S=h.useCallback(()=>{if(!i)return;const T=e.map(D=>D.id===i?{...D,title:l.trim()||D.title,subtitle:d.trim()||void 0,bullets:m.split(`
1093`).filter(A=>A.trim()),speakerNotes:p.trim()||void 0}:D);n(T),o(null)},[i,l,d,m,p,e,n]),j=()=>o(null),N=T=>{if(e.length<=1)return;const D=e.filter((A,V)=>V!==T);n(D),s>=D.length&&a(D.length-1)},_=()=>{const T={id:crypto.randomUUID(),title:"New Slide",bullets:["Add your content here"],layout:"content",speakerNotes:""},D=[...e.slice(0,s+1),T,...e.slice(s+1)];n(D),a(s+1)},C=T=>v(T),k=(T,D)=>{if(T.preventDefault(),g===null||g===D)return;const A=[...e],[V]=A.splice(g,1);A.splice(D,0,V),n(A),s===g&&a(D),v(D)},E=()=>v(null),R=i===(b==null?void 0:b.id);return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsxs("div",{className:"relative bg-muted rounded-lg overflow-hidden",style:{aspectRatio:"16/9"},children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:b&&(b.layout==="image"&&b.imageUrl?r.jsx("img",{src:b.imageUrl,alt:b.title,className:"max-w-full max-h-full object-contain",draggable:!1}):r.jsx("div",{className:"origin-center",style:{transform:`scale(${Math.min(1,.35)})`},children:r.jsx(DR,{slide:b,theme:t,slideIndex:s,totalSlides:e.length})}))}),r.jsx("button",{onClick:()=>a(Math.max(0,s-1)),disabled:s===0,className:"absolute left-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center disabled:opacity-30 hover:bg-background transition-colors",children:r.jsx(L4,{className:"w-4 h-4"})}),r.jsx("button",{onClick:()=>a(Math.min(e.length-1,s+1)),disabled:s===e.length-1,className:"absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center disabled:opacity-30 hover:bg-background transition-colors",children:r.jsx(Hl,{className:"w-4 h-4"})}),r.jsxs("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 bg-background/80 backdrop-blur-sm rounded-full px-3 py-1 text-xs font-medium text-foreground",children:[s+1," / ",e.length]})]}),r.jsxs("div",{ref:y,className:"flex gap-2 overflow-x-auto pb-1 scrollbar-thin",children:[e.map((T,D)=>r.jsxs("button",{draggable:!0,onDragStart:()=>C(D),onDragOver:A=>k(A,D),onDragEnd:E,onClick:()=>a(D),className:ge("relative shrink-0 w-[120px] rounded border-2 overflow-hidden transition-all group",D===s?"border-primary ring-1 ring-primary/30":"border-border/50 hover:border-border"),style:{aspectRatio:"16/9"},children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center overflow-hidden",children:T.layout==="image"&&T.imageUrl?r.jsx("img",{src:T.imageUrl,alt:T.title,className:"w-full h-full object-contain",draggable:!1}):r.jsx("div",{style:{transform:"scale(0.0625)",transformOrigin:"center center"},children:r.jsx(DR,{slide:T,theme:t,slideIndex:D,totalSlides:e.length})})}),r.jsx("div",{className:"absolute top-0.5 left-0.5 bg-background/70 rounded px-1 text-[9px] font-medium",children:D+1}),r.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 bg-black/30 flex items-center justify-center gap-1 transition-opacity",children:r.jsx(YH,{className:"w-3 h-3 text-white"})})]},T.id)),r.jsx("button",{onClick:_,className:"shrink-0 w-[120px] rounded border-2 border-dashed border-border/50 hover:border-primary/50 flex items-center justify-center transition-colors",style:{aspectRatio:"16/9"},children:r.jsx(Ns,{className:"w-4 h-4 text-muted-foreground"})})]}),b&&r.jsxs("div",{className:"border border-border rounded-lg p-3 bg-card space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Slide ",s+1]}),r.jsxs("div",{className:"flex items-center gap-1",children:[R?r.jsxs(r.Fragment,{children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:S,children:r.jsx(nt,{className:"w-3.5 h-3.5 text-primary"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]}):r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>w(b),children:r.jsx(Oue,{className:"w-3.5 h-3.5"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6 text-destructive/60 hover:text-destructive",onClick:()=>N(s),disabled:e.length<=1,children:r.jsx(Xr,{className:"w-3.5 h-3.5"})})]})]}),R?r.jsxs("div",{className:"space-y-2",children:[r.jsx(He,{value:l,onCh
1093ange:T=>c(T.target.value),placeholder:"Slide title",className:"h-8 text-sm"}),r.jsx(He,{value:d,onChange:T=>u(T.target.value),placeholder:"Subtitle (optional)",className:"h-8 text-sm"}),r.jsx($s,{value:m,onChange:T=>f(T.target.value),placeholder:"Bullets (one per line)",rows:3,className:"text-sm"}),r.jsx($s,{value:p,onChange:T=>x(T.target.value),placeholder:"Speaker notes",rows:2,className:"text-sm"})]}):r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:b.title}),b.subtitle&&r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.subtitle}),b.speakerNotes&&r.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1 line-clamp-2 italic",children:["📝 ",b.speakerNotes]})]})]})]})},P2e=({onLoadDeck:e})=>{const{user:t}=nr(),[n,s]=h.useState([]),[a,i]=h.useState(!0),[o,l]=h.useState(null);h.useEffect(()=>{t&&c()},[t]);const c=async()=>{i(!0);const{data:m,error:f}=await F.from("saved_slide_decks").select("*").eq("user_id",t.id).order("created_at",{ascending:!1});f?console.error("Failed to fetch decks:",f):s(m||[]),i(!1)},d=async(m,f)=>{if(f.stopPropagation(),l(m),n.find(g=>g.id===m)){const g=`${t.id}/${m}`,{data:v}=await F.storage.from("slide-decks").list(g);v!=null&&v.length&&await F.storage.from("slide-decks").remove(v.map(y=>`${g}/${y.name}`))}const{error:x}=await F.from("saved_slide_decks").delete().eq("id",m);x?Pe.error("Failed to delete deck"):(s(g=>g.filter(v=>v.id!==m)),Pe.success("Deck deleted")),l(null)},u=m=>{const f=m.slides.map(p=>({id:crypto.randomUUID(),title:p.title||"",subtitle:p.subtitle||"",bullets:p.bullets||[],speakerNotes:p.speakerNotes||"",layout:p.layout||"image",imageUrl:p.imageUrl||""}));e(f,m.name,m.id)};return a?r.jsxs("div",{className:"flex items-center justify-center py-6 text-muted-foreground",children:[r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}),r.jsx("span",{className:"text-sm",children:"Loading saved decks..."})]}):n.length===0?r.jsxs("div",{className:"text-center py-6 text-muted-foreground",children:[r.jsx(uT,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No saved decks yet"}),r.jsx("p",{className:"text-xs mt-1",children:"Upload a deck and save it for reuse"})]}):r.jsx("div",{className:"space-y-2 max-h-[240px] overflow-y-auto",children:n.map(m=>{var f;return r.jsxs("button",{onClick:()=>u(m),className:ge("w-full flex items-center gap-3 p-3 rounded-lg border border-border bg-card","hover:border-primary/50 hover:bg-muted/50 transition-colors text-left group"),children:[r.jsx("div",{className:"w-16 h-10 rounded bg-muted overflow-hidden shrink-0",children:(f=m.slides[0])!=null&&f.imageUrl?r.jsx("img",{src:m.slides[0].imageUrl,className:"w-full h-full object-cover",alt:""}):r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsx(uT,{className:"w-4 h-4 text-muted-foreground/50"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:m.name}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-0.5",children:[r.jsxs("span",{children:[m.slide_count," slides"]}),r.jsx("span",{children:"·"}),r.jsx(fr,{className:"w-3 h-3"}),r.jsx("span",{children:new Date(m.created_at).toLocaleDateString()})]})]}),r.jsx(P,{variant:"ghost",size:"icon",className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity h-8 w-8 text-destructive hover:text-destructive",onClick:p=>d(m.id,p),disabled:o===m.id,children:o===m.id?r.jsx(Me,{className:"w-3.5 h-3.5 animate-spin"}):r.jsx(Xr,{className:"w-3.5 h-3.5"})})]},m.id)})})},sQ=.28,D2e=`${sQ*100}%`,M2e=({layout:e,cameraPanel:t,slidesPanel:n,className:s,cameraClassName:a,cameraFrameClassName:i,slidesClassName:o})=>e==="slides-only"?r.jsx("div",{className:ge("absolute inset-0 overflow-hidden bg-background",s),children:r.jsx("div",{className:ge("h-full w-full",o),children:n})}):r.jsx("div",{className:ge("absolute inset-0 overflow-hidden bg-background",s),children:r.jsxs("div",{className:"flex h-full w-full",children:[r.jsx("div",{className:ge("relative h-full shrink-0 border-r border-border bg-muted/30",a),style:{width:D2e},children:r.jsx("div",{className:ge("absolute left-1/2 top-1/2 aspect-square w-[82%] max-h-[50%] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl border border-border bg-background shadow-sm",i),children:t})}),r.jsx("div",{className:ge("h-full min-w-0 flex-1 overflow-hidden bg-background",o),children:n})]})}),I2e={primaryColor:"#00C2FF",secondaryColor:"#94A3B8",accentColor:"#22D3EE",backgroundColor:"#0F172A"},L2e=".pdf,.pptx,.ppt";async function $2e(e){const t=await Si(()=>import("./pdf-BBO_BrAh.js"),[]);t.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${t.version}/pdf.worker.min.mjs`;const n=await e.arrayBuffer(),s=await t.getDocument({data:n}).promise,a=[],i=Math.min(s.numPages,50);for(let o=1;o<=i;o++){const l=await s.getPage(o),c=l.getViewport({scale:2}),d=document.createElement("canvas");d.width=c.width,d.height=c.height;const u=d.getContext("2d");await l.render({canvas:d,canvasContext:u,viewport:c}).promise;const m=await new Promise((g,v)=>{d.toBlob(y=>{y?g(y):v(new Error("Failed to render PDF page"))},"image/jpeg",.9)}),f=URL.createObjectURL(m),x=(await l.getTextContent()).items.map(g=>typeof(g==null?void 0:g.str)=="string"?g.str:"").join(" ").replace(/\s+/g," ").trim();a.push({id:crypto.randomUUID(),title:`Slide ${o}`,bullets:[],speakerNotes:x||"",layout:"image",imageUrl:f})}return a}
1093async function V2e(e){const[{init:t},n]=await Promise.all([Si(()=>import("./pptx-preview.es-CcylmOQn.js"),[]),Si(()=>import("./html2canvas.esm-CBrSDip1.js"),[])]),s=n.default||n,a=await e.arrayBuffer(),i=document.createElement("div");i.style.cssText="position:fixed;left:-99999px;top:0;width:1280px;height:720px;pointer-events:none;opacity:0;",document.body.appendChild(i);const o=[];try{const l=t(i,{width:1280,height:720,mode:"list"});await l.preview(a),await new Promise(f=>setTimeout(f,600));const c=Array.from(i.querySelectorAll(".pptx-preview-wrapper > div, .slide, [data-slide-index]")),d=i.firstElementChild,u=c.length>0?c:d?Array.from(d.children):[],m=Math.min(u.length,50);if(m===0)throw new Error("No slides found in PowerPoint file");for(let f=0;f<m;f++){const p=u[f],x=await s(p,{backgroundColor:"#ffffff",scale:2,useCORS:!0,logging:!1}),g=await new Promise((b,w)=>{x.toBlob(S=>S?b(S):w(new Error("Failed to render slide")),"image/jpeg",.9)}),v=URL.createObjectURL(g),y=(p.innerText||"").replace(/\s+/g," ").trim();o.push({id:crypto.randomUUID(),title:`Slide ${f+1}`,bullets:[],speakerNotes:y||"",layout:"image",imageUrl:v})}try{l.destroy()}catch{}}finally{i.remove()}return o}function uE(e){e.forEach(t=>{var n;(n=t.imageUrl)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(t.imageUrl)})}function mE(e,t,n){return JSON.stringify({name:t.trim()||n||"Untitled Deck",fileName:n,slides:e})}async function U2e(e){if(e)try{const n=await(await fetch(e)).blob();return await new Promise((s,a)=>{const i=new FileReader;i.onloadend=()=>{if(typeof i.result=="string"){s(i.result);return}a(new Error("Failed to read slide image"))},i.onerror=()=>a(new Error("Failed to read slide image")),i.readAsDataURL(n)})}catch{return}}async function CV(e){var a;const t=await Promise.all(e.map(async(i,o)=>({index:o,text:i.speakerNotes||"",currentTitle:i.title,imageDataUrl:await U2e(i.imageUrl)}))),n=new Map,s=4;for(let i=0;i<t.length;i+=s){const o=t.slice(i,i+s),{data:l,error:c}=await F.functions.invoke("generate-slide-titles",{body:{slides:o}});if(c){const u=(a=c==null?void 0:c.context)==null?void 0:a.status,m=typeof c.message=="string"?c.message:"Failed to generate slide titles",f=new Error(m);throw f.status=u,f}(Array.isArray(l==null?void 0:l.titles)?l.titles:[]).forEach(u=>{typeof u.index=="number"&&typeof u.title=="string"&&u.title.trim()&&n.set(u.index,u.title.trim())})}return n.size?e.map((i,o)=>{const l=n.get(o);return l?{...i,title:l}:i}):e}const F2e=({onStartRecording:e,onBack:t})=>{const{user:n}=nr(),[s,a]=h.useState("upload"),[i,o]=h.useState([]),[l]=h.useState(I2e),[c,d]=h.useState(0),[u,m]=h.useState("side-by-side"),[f,p]=h.useState(null),[x,g]=h.useState(!1),[v,y]=h.useState(!1),[b,w]=h.useState(""),[S,j]=h.useState(null),[N,_]=h.useState(!1),[C,k]=h.useState(!1),[E,R]=h.useState(!1),[T,D]=h.useState(null),A=h.useRef(null),V=h.useRef(!1),U=h.useMemo(()=>mE(i,b,f),[i,b,f]),O=i.length>0&&U!==T;h.useEffect(()=>()=>{V.current||uE(i)},[i]);const M=h.useCallback(()=>{V.current=!1,uE(i),a("upload"),o([]),p(null),j(null),w(""),D(null),R(!1)},[i]),$=h.useCallback(async W=>{const Q=W.type==="application/pdf"||W.name.toLowerCase().endsWith(".pdf"),L=W.type==="application/vnd.openxmlformats-officedocument.presentationml.presentation"||W.name.toLowerCase().endsWith(".pptx"),te=W.type==="application/vnd.ms-powerpoint"||W.name.toLowerCase().endsWith(".ppt");if(!Q&&!L&&!te){Pe.error("Please upload a PDF or PowerPoint file");return}if(te&&!L){Pe.error("Legacy .ppt format is not supported. Please save as .pptx or export to PDF.");return}if(W.size>50*1024*1024){Pe.error("File too large. Maximum size is 50MB.");return}V.current=!1,uE(i),p(W.name),j(null),w(""),D(null),a("processing");try{if(Q){const ae=await $2e(W);if(ae.length===0)throw new Error("No pages found in PDF");let ne=ae;try{ne=await CV(ae)}catch(se){console.error("Slide title generation error:",se),(se==null?void 0:se.status)===429?Pe.error("AI title generation is busy. Using default slide titles."):(se==null?void 0:se.status)===402?Pe.error("AI credits unavailable. Using default slide titles."):Pe.error("Could not generate slide titles. Using default titles.")}o(ne),d(0),a("editing"),Pe.success(`Loaded ${ne.length} slides from PDF`)}else if(L){const ae=await V2e(W);if(ae.length===0)throw new Error("No slides found in PowerPoint");let ne=ae;try{ne=await CV(ae)}catch(se){console.error("Slide title generation error:",se),(se==null?void 0:se.status)===429?Pe.error("AI title generation is busy. Using default slide titles."):(se==null?void 0:se.status)===402?Pe.error("AI credits unavailable. Using default slide titles."):Pe.error("Could not generate slide titles. Using default titles.")}o(ne),d(0),a("editing"),Pe.success(`Loaded ${ne.length} slides from PowerPoint`)}}catch(ae){console.error("Slide processing error:",ae),Pe.error(ae.message||"Failed to process file"),a("upload"),p(null)}},[i]),I=h.useCallback(W=>{var L;const Q=(L=W.target.files)==null?void 0:L[0];Q&&$(Q),W.target.value=""},[$]),B=h.useCallback(W=>{var L;W.preventDefault(),g(!1);const Q=(L=W.dataTransfer.files)==null?void 0:L[0];Q&&$(Q)},[$]),K=W=>{W.preventDefault(),g(!0)},Z=()=>g(!1),q=h.useCallback(async W=>n?Promise.all(i.map(async(Q,L)=>{var ae,ne;let te=Q.imageUrl||"";if((ae=Q.imageUrl)!=null&&ae.startsWith("data:")||(ne=Q.imageUrl)!=null&&ne.startsWith("blob:")){const ue=await(await fetch(Q.imageUrl)).blob(),Ne=`${n.id}/${W}/slide-${L}.jpg`,{error:Qe}=await F.storage.from("slide-decks").upload(Ne,ue,{contentType:"image/jpeg",upsert:!0});if(Qe)throw Qe;const{data:J}=F.storage.from("slide-decks").getPublicUrl(Ne);te=J.publicUrl}return{title:Q.title,subtitle:Q.subtitle||"",speakerNotes:Q.speakerNotes||"",bullets:Q.bullets||[],layout:Q.layout||"image",imageUrl:te}})):[],[n,i]),H=h.useCallback(async()=>
1093{if(!n||i.length===0)return!1;const W=b.trim()||f||"Untitled Deck";y(!0);try{if(S){const Q=await q(S),{error:L}=await F.from("saved_slide_decks").update({name:W,file_name:f,slide_count:i.length,slides:Q}).eq("id",S);if(L)throw L;Pe.success("Deck updated!")}else{const Q=crypto.randomUUID(),L=await q(Q),{error:te}=await F.from("saved_slide_decks").insert({id:Q,user_id:n.id,name:W,file_name:f,slide_count:i.length,slides:L});if(te)throw te;j(Q),Pe.success("Deck saved!")}return D(mE(i,b,f)),!0}catch(Q){return console.error("Save deck error:",Q),Pe.error("Failed to save deck"),!1}finally{y(!1)}},[n,i,b,f,S,q]),X=h.useCallback((W,Q,L)=>{V.current=!1,o(W),p(Q),w(Q),j(L),D(mE(W,Q,Q)),d(0),a("editing"),_(!1),Pe.success(`Loaded "${Q}"`)},[]),G=h.useCallback(()=>{V.current=!0,R(!1),e(i,l,u)},[i,l,u,e]),ee=()=>{if(O){R(!0);return}G()},re=h.useCallback(async()=>{await H()&&G()},[H,G]);return r.jsxs("div",{className:"space-y-3",children:[r.jsx("input",{ref:A,type:"file",accept:L2e,onChange:I,className:"hidden"}),r.jsx(It,{open:C,onOpenChange:k,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(_n,{className:"w-4 h-4 text-primary"}),"Presentation upload tips"]}),r.jsx($r,{children:"Here’s what happens after you upload your presentation."})]}),r.jsxs("div",{className:"space-y-3 text-sm text-foreground",children:[r.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[r.jsx("p",{className:"font-medium",children:"1. AI suggests slide titles"}),r.jsx("p",{className:"text-muted-foreground",children:"We’ll generate a title for each slide automatically to speed up setup."})]}),r.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[r.jsx("p",{className:"font-medium",children:"2. You can edit every slide"}),r.jsx("p",{className:"text-muted-foreground",children:"Review and update any title, notes, or slide content before recording."})]}),r.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[r.jsx("p",{className:"font-medium",children:"3. Save your deck before recording"}),r.jsx("p",{className:"text-muted-foreground",children:"Give the deck a name and save it so you can reuse or update it later."})]})]}),r.jsx(Fr,{children:r.jsx(P,{onClick:()=>k(!1),className:"w-full sm:w-auto",children:"Got it"})})]})}),r.jsx(It,{open:E,onOpenChange:R,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Save your deck before recording?"}),r.jsx($r,{children:"You have unsaved slide edits. Save the presentation deck first so you don’t lose titles, notes, or other slide changes."})]}),r.jsxs(Fr,{className:"flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[r.jsx(P,{variant:"ghost",onClick:()=>R(!1),children:"Cancel"}),r.jsx(P,{variant:"outline",onClick:G,children:"Continue Without Saving"}),r.jsxs(P,{onClick:re,disabled:v,children:[v?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(Db,{className:"w-4 h-4"}),"Save Deck & Record"]})]})]})}),s==="upload"&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border bg-muted/40 px-3 py-2.5",children:[r.jsx("div",{className:"mt-0.5 rounded-full bg-primary/10 p-1.5",children:r.jsx(ql,{className:"w-3.5 h-3.5 text-primary"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"AI will title your slides for you"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"After upload, you can edit each slide, save the deck, and then start recording."})]}),r.jsx(P,{type:"button",variant:"ghost",size:"sm",className:"h-8 shrink-0 px-2 text-xs",onClick:()=>k(!0),children:"Learn how to upload slides"})]}),r.jsxs("div",{onDrop:B,onDragOver:K,onDragLeave:Z,onClick:()=>{var W;return(W=A.current)==null?void 0:W.click()},className:ge("flex flex-col items-center text-center py-6 px-4 rounded-lg border-2 border-dashed cursor-pointer transition-colors",x?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/50"),children:[r.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/15 flex items-center justify-center mb-2",children:r.jsx(na,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-base font-semibold text-foreground mb-1",children:"Upload Slide Deck"}),r.jsx("p",{className:"text-xs text-muted-foreground max-w-xs mb-2",children:"Drag & drop or click to upload your PDF or PowerPoint"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsxs(Se,{variant:"secondary",className:"text-xs",children:[r.jsx(el,{className:"w-3 h-3 mr-1"}),"PDF"]}),r.jsxs(Se,{variant:"secondary",className:"text-xs",children:[r.jsx(el,{className:"w-3 h-3 mr-1"}),"PPTX"]}
1093)]})]}),r.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:()=>_(!N),className:"w-full flex items-center gap-2 px-3 py-2.5 text-sm font-medium text-foreground hover:bg-muted/50 transition-colors",children:[r.jsx(uT,{className:"w-4 h-4 text-primary"}),"Saved Decks",r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:N?"Hide":"Show"})]}),N&&r.jsx("div",{className:"border-t border-border px-3 py-2",children:r.jsx(P2e,{onLoadDeck:X})})]}),r.jsxs(P,{variant:"ghost",size:"sm",className:"w-full text-muted-foreground",onClick:t,children:[r.jsx(aa,{className:"w-4 h-4 mr-1"}),"Back to mode selection"]})]}),s==="processing"&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[r.jsx(Me,{className:"w-10 h-10 text-primary animate-spin"}),r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Processing slides..."}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f&&r.jsx("span",{className:"truncate max-w-[200px] inline-block align-bottom",children:f})})]})]}),s==="editing"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5",children:[r.jsx(el,{className:"w-3.5 h-3.5 shrink-0"}),r.jsx("span",{className:"truncate",children:f}),r.jsx("button",{onClick:M,className:"ml-auto shrink-0 hover:text-foreground transition-colors",children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]}),r.jsx(O2e,{slides:i,theme:l,onSlidesChange:o,activeSlideIndex:c,onActiveSlideChange:d}),r.jsxs("div",{className:"border border-border rounded-lg p-3 bg-card space-y-3",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recording Layout"}),r.jsx("div",{className:"relative bg-muted rounded-md overflow-hidden",style:{aspectRatio:"16/9"},children:r.jsx(M2e,{layout:u,cameraPanel:r.jsx("div",{className:"flex h-full w-full items-center justify-center bg-primary/10",children:r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(cr,{className:"w-5 h-5 text-primary/60"}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Camera"})]})}),slidesPanel:r.jsx("div",{className:"flex h-full w-full items-center justify-center bg-accent/10",children:r.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:u==="slides-only"?"Slides Only":"Slides"})})})}),r.jsxs(Z_,{type:"single",value:u,onValueChange:W=>{W&&m(W)},className:"w-full",children:[r.jsxs(If,{value:"side-by-side",className:"flex-1 gap-1.5 text-xs data-[state=on]:bg-primary/10 data-[state=on]:text-primary",children:[r.jsx(vue,{className:"w-3.5 h-3.5"}),"Side by Side"]}),r.jsxs(If,{value:"slides-only",className:"flex-1 gap-1.5 text-xs data-[state=on]:bg-primary/10 data-[state=on]:text-primary",children:[r.jsx(_ue,{className:"w-3.5 h-3.5"}),"Slides Only"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{placeholder:"Deck name",value:b,onChange:W=>w(W.target.value),className:"flex-1 h-9 text-sm"}),r.jsxs(P,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:H,disabled:v,children:[v?r.jsx(Me,{className:"w-3.5 h-3.5 animate-spin"}):r.jsx(Db,{className:"w-3.5 h-3.5"}),S?"Update Deck":"Save Deck"]})]}),r.jsxs(P,{className:"w-full gap-2",onClick:ee,children:[r.jsx(Js,{className:"w-4 h-4"}),"Start Presentation Recording"]}),r.jsxs(P,{variant:"ghost",size:"sm",className:"w-full text-muted-foreground",onClick:M,children:[r.jsx(aa,{className:"w-4 h-4 mr-1"}),"Upload different file"]})]})]})},B2e=5,z2e=.8,q2e=3e4,H2e=e=>new Promise((t,n)=>{requestAnimationFrame(()=>{const s=document.createElement("canvas");s.width=e.videoWidth||640,s.height=e.videoHeight||360;const a=s.getContext("2d");if(!a){n(new Error("Failed to get canvas context"));return}a.drawImage(e,0,0,s.width,s.height),s.toBlob(i=>{i?t(i):n(new Error("Failed to capture frame"))},"image/jpeg",z2e)})}),W2e=(e,t)=>new Promise((n,s)=>{const a=setTimeout(()=>{s(new Error("Seek timeout"))},5e3),i=()=>{clearTimeout(a),e.removeEventListener("seeked",i),setTimeout(n,50)};e.addEventListener("seeked",i),e.currentTime=t}),Y2e=async(e,t=B2e)=>new Promise((n,s)=>{const a=document.createElement("video");e.startsWith("blob:")||(a.crossOrigin="anonymous"),a.muted=!0,a.playsInl
1093ine=!0,a.preload="auto";const i=[];let o=!1;const l=setTimeout(()=>{o||(o=!0,a.src="",s(new Error("Key frame extraction timed out")))},q2e),c=()=>{clearTimeout(l),a.src=""};a.onloadedmetadata=async()=>{if(!o)try{const d=a.duration;if(!d||!isFinite(d))throw new Error("Invalid video duration");const u=[],m=Math.min(.5,d*.05),f=d-Math.min(.5,d*.05);if(t===1)u.push(d*.5);else{const p=(f-m)/(t-1);for(let x=0;x<t;x++)u.push(m+p*x)}await a.play(),a.pause();for(const p of u){if(o)break;try{await W2e(a,p);const x=await H2e(a);i.push(x)}catch(x){console.warn(`Failed to capture frame at ${p}s:`,x)}}o||(o=!0,c(),n(i))}catch(d){o||(o=!0,c(),s(d))}},a.onerror=()=>{o||(o=!0,c(),s(new Error("Failed to load video for frame extraction")))},a.src=e,a.load()}),G2e=async(e,t,n,s)=>{const a=[],i=Date.now();for(let o=0;o<s.length;o++){const l=`${t}/${n}-frame-${o}-${i}.jpg`;try{const{error:c}=await e.storage.from("thumbnails").upload(l,s[o],{contentType:"image/jpeg",upsert:!1});if(!c){const{data:d}=e.storage.from("thumbnails").getPublicUrl(l);d!=null&&d.publicUrl&&a.push(d.publicUrl)}}catch(c){console.warn(`Failed to upload frame ${o}:`,c)}}return a},K2e="https://share.vidareo.com",r0=e=>e?`${K2e}/${e}`:"",$N=e=>e?`/watch/${e}`:"/",X2e=Object.freeze(Object.defineProperty({__proto__:null,getShareUrl:r0,getShareViewPath:$N},Symbol.toStringTag,{value:"Module"})),Z2e=["Sales","Demo","Follow-up","Introduction","Proposal","Support"],Q2e=e=>{const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`},J2e=e=>new Promise((t,n)=>{const s=document.createElement("video");e.startsWith("blob:")||(s.crossOrigin="anonymous"),s.muted=!0,s.playsInline=!0,s.preload="auto",s.setAttribute("webkit-playsinline","true"),s.style.position="fixed",s.style.left="-9999px",s.style.top="0",s.style.width="1px",s.style.height="1px",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s);let a=!1;const i=setTimeout(()=>
1093{a||(a=!0,o(),n(new Error("Thumbnail generation timed out")))},15e3),o=()=>{try{s.pause(),s.removeAttribute("src"),s.load()}catch{}try{s.remove()}catch{}},l=async()=>{if(a)return;let c=0;for(;(s.videoWidth===0||s.videoHeight===0)&&c<20;){try{await s.play(),s.pause()}catch{}await new Promise(g=>setTimeout(g,100)),c++}const d=s.videoWidth>0?s.videoWidth:640,u=s.videoHeight>0?s.videoHeight:360;(s.videoWidth===0||s.videoHeight===0)&&console.warn("Video dimensions not available, using fallback 640x360");const{width:m,height:f}=rl(d,u),p=document.createElement("canvas");p.width=m,p.height=f;const x=p.getContext("2d");if(!x){clearTimeout(i),a=!0,o(),n(new Error("Failed to get canvas context"));return}x.drawImage(s,0,0,d,u,0,0,m,f),p.toBlob(g=>{clearTimeout(i),o(),!a&&(a=!0,g&&g.size>1e3?t(g):n(new Error("Failed to generate thumbnail - invalid blob")))},"image/jpeg",.85)};s.onseeked=()=>l(),s.onloadeddata=()=>{if(a)return;const c=Math.min(1,(s.duration||2)*.1);try{s.currentTime=c}catch{l()}},s.oncanplaythrough=()=>{setTimeout(()=>{!a&&s.readyState>=2&&l()},500)},s.onerror=()=>{clearTimeout(i),o(),a||(a=!0,n(new Error("Failed to load video")))},s.src=e,s.load(),e.startsWith("blob:")&&setTimeout(async()=>{if(!a&&s.readyState<2)try{await s.play(),s.pause()}catch{}},200)}),eCe=({open:e,onOpenChange:t,onClose:n,onSaveComplete:s,initialMode:a})=>{var Ui,Nu;const i=Sr(),o=lr(),{user:l}=nr(),c=ih(),d=Q_(),{setScreenRecording:u}=bv(),{subscriptionTier:m="starter",incrementUsage:f,isAtLimit:p,remaining:x,limit:g,currentUsage:v,isLoading:y,refreshUsage:b}=jw(l==null?void 0:l.id),{maxVideoDurationMinutes:w,hasExtendedVideo:S,hasExtendedVideo30:j,hasExtendedVideo60:N}=np(),{createCheckout:_,isPremium:C,isGiftedAccount:k}=Jl(),{isExtensionAvailable:E,isChecking:R,recheckExtension:T,startExtensionRecording:D}=yv();h.useEffect(()=>{e&&(l!=null&&l.id)&&b()},[e,l==null?void 0:l.id,b]);const[A,V]=h.useState(a||"camera"),[U,O]=h.useState(!0),M=typeof((Ui=navigator.mediaDevices)==null?void 0:Ui.getDisplayMedia)=="function";h.useEffect(()=>{e&&a&&Be.modalState==="setup"&&V(a==="screen"&&!M?"camera":a)},[e,a]);const[$,I]=h.useState(!1),[B,K]=h.useState(null),[Z,q]=h.useState([]),[H,X]=h.useState([]),[G,ee]=h.useState(""),[re,W]=h.useState(""),[Q,L]=h.useState(`Recording ${new Date().toLocaleDateString()}`),[te,ae]=h.useState(""),[ne,se]=h.useState([]),[ue,Ne]=h.useState(""),[Qe,J]=h.useState(null),[de,ve]=h.useState(!1),[Le,$e]=h.useState(null),[De,oe]=h.useState(null),[xe,Ze]=h.useState(null),it=h.useRef(null),[ct,Oe]=h.useState(!0),[pe,le]=h.useState(null),[ke,Ee]=h.useState(null),[ot,gt]=h.useState(!1),[Nt,Ct]=h.useState(!0),[dt,tt]=h.useState(!1),[Re,Fe]=h.useState("bottom-right"),[Ae,Ve]=h.useState(.7),[et,Ge]=h.useState(20),[St,Tt]=h.useState(null),[Zt,bt]=h.useState(!1),[Wt,Xe]=h.useState(""),[be,Ue]=h.useState(""),[we,pt]=h.useState(!0),[mt,er]=h.useState(3),kt=A==="presentation"?be:Wt,at=A==="presentation"?Ue:Xe,[Yt,Ft]=h.useState([]),[or,Ar]=h.useState(null),[nn,es]=h.useState("side-by-side"),[An,ie]=h.useState(0),[_e,ht]=h.useState(!1);h.useRef(null);const Dr=h.useRef(null),Mr=h.useRef(null),Ln=h.useRef(null),[Zr,zn]=h.useState("bottom-left"),[Tn,Za]=h.useState(0),[Na,la]=h.useState(0);C2e();const[qn,Hn]=h.useState(null);h.useEffect(()=>{l!=null&&l.id&&F.from("user_custom_limits").select("max_duration_seconds").eq("user_id",l.id).maybeSingle().then(({data:rt})=>{rt!=null&&rt.max_duration_seconds&&Hn(rt.max_duration_seconds)})},[l==null?void 0:l.id]);const dn=qn||(m==="starter"?120:w*60),Os=Math.floor(dn/60),Qa=k2e({width:340,height:340,onClose:()=>{(Be.isRecording||Be.isStreamReady)&&(Be.cleanup(),oo())}}),Be=A2e({maxDuration:dn,watermarkEnabled:Nt,watermarkPosition:Re,watermarkOpacity:Ae,watermarkSize:et,useCustomWatermark:dt,companyLogoUrl:St,subscriptionTier:m,selectedAudioDevice:G,selectedVideoDevice:re,mirrorCamera:U,onDocPipOpen:Qa.isSupported?()=>Qa.open().then(()=>{}):void 0,onDocPipClose:()=>Qa.close(),docPipSupported:Qa.isSupported}),La=Be.pipCanvasPosRef,oo=h.useCallback(()=>{Be.resetState(),K(null),L(`Recording ${new Date().toLocaleDateString()}`),ae(""),se([]),Ne(""),J(null),zn("bottom-right"),Za(0),la(0),La.current={normX:.74,normY:.68},it.current&&(URL.revokeObjectURL(it.current),it.current=null),$e(null),oe(null),Ze(null),le(null),Ee(null),gt(!1),bt(!1),Oe(!0),Ft([]),Ar(null),ie(0),ht(!1)},[Be,La]),gu=h.useCallback((rt,jt=0,Qt=0,ts,hn)=>{if(rt==="custom"&&ts&&hn){La.current={normX:Math.max(0,Math.min(jt/Math.max(ts-192,1),1)),normY:Math.max(0,Math.min(Qt/Math.max(hn-192,1),1))};return}
1093const $n={"top-left":{normX:.04,normY:.06},"top-right":{normX:.74,normY:.06},"bottom-left":{normX:.04,normY:.68},"bottom-right":{normX:.74,normY:.68}};La.current=$n[rt]??$n["bottom-right"]},[La]);h.useCallback((rt,jt,Qt,ts,hn)=>{zn(rt),typeof jt=="number"&&Za(jt),typeof Qt=="number"&&la(Qt),gu(rt,jt??0,Qt??0,ts,hn)},[gu]);const Vi=h.useRef(new Map);h.useEffect(()=>{if(!_e||Yt.length===0)return;const rt=new Map;Yt.forEach(jt=>{if(jt.imageUrl){const Qt=new window.Image;jt.imageUrl.startsWith("blob:")||(Qt.crossOrigin="anonymous"),Qt.src=jt.imageUrl,rt.set(jt.id,Qt)}}),Vi.current=rt},[_e,Yt]);const Xc=h.useRef(An);h.useEffect(()=>{Xc.current=An},[An]);const vu=h.useRef(nn);h.useEffect(()=>{vu.current=nn},[nn]),h.useEffect(()=>{if(!_e||Yt.length===0){Be.presentationOverlayRef.current=null;return}return Be.presentationOverlayRef.current=(rt,jt,Qt)=>{const ts=Yt[Xc.current],hn=ts?Vi.current.get(ts.id):null,$n=Be.cameraVideoElRef.current,Us=vu.current;if(rt.fillStyle="#000000",rt.fillRect(0,0,jt,Qt),Us==="slides-only"){if(hn&&hn.complete&&hn.naturalWidth>0){const sn=hn.naturalWidth/hn.naturalHeight,hi=jt/Qt;let Ja=0,ei=0,$a=jt,Vr=Qt;sn>hi?(Vr=jt/sn,ei=(Qt-Vr)/2):($a=Qt*sn,Ja=(jt-$a)/2),rt.drawImage(hn,Ja,ei,$a,Vr)}}else if(Us==="side-by-side"){const sn=Math.round(jt*sQ),hi=jt-sn,Ja=Math.round(Qt*.05),ei=Math.max(1,Math.min(sn-Ja*2,Math.round(Qt*.5))),$a=Math.round((sn-ei)/2),Vr=Math.round((Qt-ei)/2);if($n&&$n.videoWidth>0){const Sa=Math.min($n.videoWidth,$n.videoHeight),Fi=Math.max(0,($n.videoWidth-Sa)/2),_a=Math.max(0,($n.videoHeight-Sa)/2);rt.drawImage($n,Fi,_a,Sa,Sa,$a,Vr,ei,ei)}if(hn&&hn.complete&&hn.naturalWidth>0){const Sa=hn.naturalWidth/hn.naturalHeight,Fi=hi/Qt;let _a=sn,_i=0,rd=hi,Su=Qt;Sa>Fi?(Su=hi/Sa,_i=(Qt-Su)/2):(rd=Qt*Sa,_a=sn+(hi-rd)/2),rt.drawImage(hn,_a,_i,rd,Su)}}},()=>{Be.presentationOverlayRef.current=null}},[_e,Yt,Be]),h.useEffect(()=>{if(!_e||!Be.isRecording)return;const rt=jt=>{jt.key==="ArrowRight"||jt.key===" "?(jt.preventDefault(),ie(Qt=>Math.min(Yt.length-1,Qt+1))):jt.key==="ArrowLeft"&&(jt.preventDefault(),ie(Qt=>Math.max(0,Qt-1)))};return window.addEventListener("keydown",rt),()=>window.removeEventListener("keydown",rt)},[_e,Be.isRecording,Yt.length]),h.useEffect(()=>{e||(Be.cleanup(),oo(),Be.recordedUrl&&URL.revokeObjectURL(Be.recordedUrl))},[e]),h.useEffect(()=>{Be.isRecording&&!Be.isPaused&&Be.duration>=dn&&Pe.info(`Recording stopped - ${Os} minute limit reached`)},[Be.duration,Be.isRecording,Be.isPaused,dn,Os]),h.useEffect(()=>{if(!e)return;(async()=>{try{const jt=await navigator.mediaDevices.getUserMedia({audio:!0,video:{facingMode:{ideal:"user"}}}),Qt=jt.getVideoTracks()[0],ts=(Qt==null?void 0:Qt.getSettings().deviceId)||"";jt.getTracks().forEach(sn=>sn.stop());const hn=await navigator.mediaDevices.enumerateDevices(),$n=hn.filter(sn=>sn.kind==="audioinput").map(sn=>({deviceId:sn.deviceId,label:sn.label||`Microphone ${sn.deviceId.slice(0,8)}`})),Us=hn.filter(sn=>sn.kind==="videoinput").map(sn=>({deviceId:sn.deviceId,label:sn.label||`Camera ${sn.deviceId.slice(0,8)}`}));if(q($n),X(Us),$n.length>0&&!G&&ee($n[0].deviceId),Us.length>0&&!re){const sn=ts?Us.find(Vr=>Vr.deviceId===ts):void 0,hi=/front|user|selfie|face/i,Ja=Us.find(Vr=>hi.test(Vr.label)),ei=/back|rear|environment/i,$a=Us.find(Vr=>!ei.test(Vr.label));W((sn??Ja??$a??Us[0]).deviceId)}}catch(jt){console.error("Failed to enumerate devices:",jt)}})()},[e]),h.useEffect(()=>{if(!(e&&!_e&&(A==="camera"||A==="both")&&!!re&&Be.modalState==="setup")){(!e||Be.modalState==="setup"&&!_e)&&Be.cleanup();return}let Qt=!1;return(async()=>{var hn,$n;I(!0),K(null);try{if(await Be.startCameraPreview(),Qt)return;A==="both"&&gu(Zr,Tn,Na,(hn=Dr.current)==null?void 0:hn.clientWidth,($n=Dr.current)==null?void 0:$n.clientHeight)}catch(Us){if(Qt)return;K(Us.name==="NotAllowedError"?"Camera access denied. Please allow camera access in your browser settings.":"Failed to access camera. Please check your device and try again.")}finally{Qt||I(!1)}})(),()=>{Qt=!0}},[e,A,re,G,Be.modalState,_e]),h.useEffect(()=>{if(!e||!l)return;(async()=>{try{const{data:jt}=await F.from("profiles").select("watermark_enabled, use_custom_watermark, watermark_position, watermark_opacity, watermark_size, company_logo_url, subscription_tier").eq("user_id",l.id).single();jt&&(Ct(!0),tt(jt.use_custom_watermark??!1),Fe(jt.watermark_position||"bottom-right"),Ve(jt.watermark_opacity??.7),Ge(jt.watermark_size??32),Tt(jt.company_logo_url||null))}catch(jt){console.error("Failed to fetch watermark settings:",jt),Ct(!0)}})()},[e,l]),h.useEffect(()=>{Be.modalState==="review"&&Be.recordedUrl&&!xe&&(async()=>{try{const jt=await J2e(Be.recordedUrl);Ze(jt),$e(jt)}catch(jt){console.warn("Default thumbnail generation failed:",jt)}})()},[Be.modalState,Be.recordedUrl,xe]);const yu=h.useCallback(async()=>{var Qt;if(!y&&m==="starter"&&p){Pe.error(o?"You've reached your monthly recording limit. Your limit resets on the 1st.":"You've reached your monthly recording limit. Upgrade to continue recording.");return}if(c){(Qt=Be.nativeCameraInputRef.current)==null||Qt.click();return}if(A==="camera"){Be.setModalState("recording");return}if(!E){Pe.error("The VIDAREO Chrome extension is required for screen recording. Please install it first.");return}const rt=(await(await Si(async()=>{const{supabase:ts}=await Promise.resolve().then(()=>Cye);return{supabase:ts}},void 0)).supabase.auth.getSession()).data.session;if(!rt){Pe.error("Please sign in to record");return}await D({mode:A==="both"?"both":"screen",accessToken:rt.access_token,refreshToken:rt.refresh_token,micDeviceId:G||void 0,videoDeviceId:re||void 0,watermark:{enabled:Nt,position:Re,opacity:Ae,size:et}})?(Pe.success("Recording started via extension",{duration:3e3}),t(!1)):Pe.error("Failed to start recording. Please check the extension.")},[A,c,m,p,y,Be,E,D,G,re,Nt,Re,Ae,et,t]),Zc=h.useCallback(async()=>{try{await Be.completeCountdown()}catch{Pe.error("Failed to start recording"),Be.setModalState("setup")}},[Be]),gh=h.useCallback(()=>{Be.startCountdown()},[Be]),vh=h.useCallback(()=>{Be.cleanup(),oo()},[Be,oo]),Qc=async rt=>{var Qt;const jt=(Qt=rt.target.files)==null?void 0:Qt[0];jt&&Be.handleNativeCameraCapture(jt),rt.target.value=""},lo=rt=>{const jt=rt.trim().toLowerCase();jt&&!ne.includes(jt)&&ne.length<10&&(se([...ne,jt]),Ne(""))},bu=rt=>se(ne.filter(jt=>jt!==rt)),nc=rt=>{(rt.key==="Enter"||rt.key===",")&&(rt.preventDefault(),lo(ue))},jl=h.useCallback(rt=>{it.current&&URL.revokeObjectURL(it.current);const jt=URL.createObjectURL(rt);it.current=jt,$e(rt),oe(jt)},[]),Jc=async()=>
1093{if(!l||!Be.recordedBlob){Pe.error("Please sign in to save videos");return}ve(!0);try{const{data:rt,error:jt}=await F.rpc("check_rate_limit",{p_identifier:l.id,p_endpoint:"video-recording",p_max_requests:10,p_window_minutes:15});if(jt)console.error("Rate limit check failed:",jt);else if(rt===!1){Pe.error("You're recording too quickly. Please wait a few minutes before recording again."),ve(!1);return}const Qt=Date.now(),ts=`${l.id}/${Qt}.webm`,hn=`${l.id}/${Qt}-thumb.jpg`,$n=Q.trim()||`Recording ${new Date().toLocaleDateString()}`;let Us=null;if(Le){const{error:_a}=await F.storage.from("videos").upload(hn,Le,{contentType:"image/jpeg",upsert:!1});if(!_a){const{data:_i}=F.storage.from("videos").getPublicUrl(hn);Us=_i.publicUrl}}const sn=Be.recordedBlob,hi=Be.duration,{error:Ja}=await F.storage.from("videos").upload(ts,sn,{contentType:"video/webm",upsert:!1});if(Ja)throw Ja;const{data:ei}=F.storage.from("videos").getPublicUrl(ts),$a=ei.publicUrl,{data:Vr,error:Sa}=await F.from("videos").insert({user_id:l.id,title:$n,description:te.trim()||null,video_url:$a,thumbnail_url:Us,duration:hi,file_size:sn.size,tags:ne.length>0?ne:null,folder_id:Qe,moderation_status:"pending",notify_on_reply:!0}).select("id").single();if(Sa)throw Sa;Vr!=null&&Vr.id&&Be.recordedUrl&&Y2e(Be.recordedUrl,5).then(async _a=>{if(_a.length>0){const _i=await G2e(F,l.id,Vr.id,_a);_i.length>0&&await F.from("videos").update({key_frames:_i}).eq("id",Vr.id)}}).catch(_a=>console.warn("Key frame extraction failed:",_a));let Fi=null;if(Vr!=null&&Vr.id){const _a=J_();Fi=_a;const{error:_i}=await F.functions.invoke("create-share-link",{body:{videoId:Vr.id,shareToken:_a,expiresAt:null,maxViews:null,password:null,recipientEmail:null,recipientName:null,recipientPhone:null,title:$n}});_i&&(console.warn("Share link creation failed:",_i),Fi=null),F.functions.invoke("moderate-video",{body:{videoId:Vr.id,videoTitle:$n,videoDescription:te.trim(),userId:l.id}}).catch(rd=>console.warn("Moderation request failed:",rd))}m==="starter"&&await f(),$K({particleCount:100,spread:70,origin:{y:.6},colors:["#00C2FF","#0EA5E9","#22D3EE","#67E8F9","#A5F3FC"]}),s&&(Vr!=null&&Vr.id)?(s({videoId:Vr.id,title:$n,thumbnailUrl:Us,videoUrl:$a,duration:hi,shareToken:Fi}),oo(),t(!1)):(le(Fi),Ee((Vr==null?void 0:Vr.id)||null),Be.setModalState("saved"))}catch(rt){console.error("Save error:",rt),Pe.error(rt.message||"Failed to save video")}finally{ve(!1)}},Nl=typeof window.Capacitor<"u"&&typeof window.Capacitor.isNativePlatform=="function"&&window.Capacitor.isNativePlatform(),wu=typeof((Nu=navigator.mediaDevices)==null?void 0:Nu.getDisplayMedia)=="function",ed=[{id:"screen",label:"Screen",icon:Vs,desktopOnly:!0,premiumOnly:!1},{id:"both",label:"Screen + Camera",icon:Tue,desktopOnly:!0,premiumOnly:!1},{id:"camera",label:"Camera",icon:cr,desktopOnly:!1,premiumOnly:!1},{id:"presentation",label:"Presentation",icon:na,desktopOnly:!1,premiumOnly:!0}],Lo=c||d||Nl||!wu?ed.filter(rt=>!rt.desktopOnly):ed,Uw=h.useCallback(()=>{Be.isRecording&&Be.stopRecording(),n==null||n(),t(!1),i("/videos")},[Be,n,t,i]);h.useEffect(()=>{Be.modalState!=="recording"&&Qa.isOpen&&Qa.close()},[Be.modalState,Qa.isOpen,Qa.close]);const $o=(Be.isStreamReady||Be.isRecording)&&!Be.isCountingDown&&(A==="screen"||A==="both")&&Be.modalState==="recording",td=document.body;return h.useEffect(()=>{u($o)},[$o,u]),e?r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:Be.nativeCameraInputRef,type:"file",accept:"video/*",capture:"user",onChange:Qc,className:"hidden"}),$o&&Be.isCountingDown&&$d.createPortal(r.jsx(PR,{isActive:Be.isCountingDown,onComplete:Zc,fullscreen:!0}),document.body),$o&&$d.createPortal(r.jsx("div",{children:r.jsx(_2e,{isRecording:Be.isRecording,isPaused:Be.isPaused,duration:Be.duration,maxDuration:dn,mode:A,onPause:Be.togglePause,onResume:Be.togglePause,onStop:Be.stopRecording,onStart:Be.isRecording?void 0:gh,onCancel:()=>{Be.cleanup(),oo()},cameraPipStream:A==="both"?Be.cameraStreamForPip:void 0,onPipPositionChange:A==="both"?(rt,jt)=>{Be.pipCanvasPosRef.current={normX:rt,normY:jt}}:void 0,isInDocPip:!1,watermarkEnabled:Nt,onWatermarkToggle:Ct,canToggleWatermark:m!=="starter",useCustomWatermark:dt,onCustomWatermarkToggle:tt,hasCustomLogo:!!St,isMuted:Be.isMuted,onToggleMute:Be.toggleMute})}),td),r.jsxs("div",{className:ge("fixed left-0 right-0 bottom-0 z-40 bg-background flex flex-col","to
1093p-14 sm:top-16 lg:top-20",$o&&"hidden"),children:[r.jsx("div",{className:"shrink-0 flex items-center justify-between px-4 py-3 border-b border-border/50",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Uw,children:r.jsx(aa,{className:"w-4 h-4"})}),r.jsxs("h1",{className:"text-base font-semibold text-foreground",children:[Be.modalState==="setup"&&"Create New Video",Be.modalState==="recording"&&(Be.isCountingDown?"Get Ready...":"Recording"),Be.modalState==="review"&&"Save Your Video",Be.modalState==="saved"&&"Video Saved!"]})]})}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:ge("w-full px-4 py-4 mx-auto space-y-3",_e&&Be.modalState==="recording"?"max-w-5xl":Be.modalState==="review"?"max-w-xl":A==="camera"&&(Be.modalState==="setup"||Be.modalState==="recording")?"max-w-3xl":"max-w-lg"),children:[Be.modalState==="setup"&&r.jsxs(r.Fragment,{children:[m==="starter"&&p&&!y&&r.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-4 text-center",children:[r.jsx(Im,{className:"w-8 h-8 text-destructive mx-auto mb-2"}),r.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Recording Limit Reached"}),r.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["You've used all ",g," recordings this month on the free plan."]}),o?r.jsx("p",{className:"text-xs text-muted-foreground",children:"This feature is not available on your current plan."}):r.jsxs(P,{onClick:()=>{t(!1),i("/pricing")},className:"bg-gradient-to-r from-primary to-cyan-400",children:[r.jsx(Ms,{className:"w-4 h-4 mr-2"}),"Upgrade for Unlimited Recordings"]})]}),m==="starter"&&!p&&!y&&r.jsxs("div",{className:"flex items-center justify-between px-2 py-1 bg-muted/50 rounded text-xs",children:[r.jsxs("span",{className:"text-muted-foreground",children:[x," of ",g," recordings remaining this month"]}),x<=2&&!o&&r.jsx("button",{onClick:()=>{t(!1),i("/pricing")},className:"text-primary hover:underline font-medium",children:"Upgrade"})]}),A==="camera"&&r.jsx(jV,{isVisible:Zt,onToggle:()=>bt(!Zt),isRecording:!1,script:kt,onScriptChange:at,autoScroll:we,onAutoScrollChange:pt,scrollSpeed:mt,onScrollSpeedChange:er,maxDurationSeconds:dn}),A==="presentation"?r.jsx(F2e,{onStartRecording:async(rt,jt,Qt)=>{Ft(rt),Ar(jt),es(Qt),ie(0),ht(!0);try{await new Promise(ts=>requestAnimationFrame(()=>ts())),await Be.startPresentationPreview(Qt==="side-by-side"),Be.setModalState("recording")}catch(ts){console.error("Failed to start presentation recording:",ts),ht(!1),Pe.error(Qt==="side-by-side"?"Camera access is required for side-by-side presentation mode.":"Failed to prepare presentation recording.")}},onBack:()=>{Be.cleanup(),t(!1)}}):r.jsx("div",{className:ge("relative bg-muted rounded-lg overflow-hidden aspect-[16/10]"),children:A==="camera"?r.jsxs(r.Fragment,{children:[$&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted",children:r.jsx(Me,{className:"w-8 h-8 text-muted-foreground animate-spin"})}),B?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-muted p-4 text-center",children:[r.jsx(Im,{className:"w-10 h-10 text-destructive mb-2"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:B})]}):r.jsx("div",{ref:Mr,className:"absolute inset-0 overflow-hidden touch-none select-none",children:r.jsx("video",{ref:Be.videoRef,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover pointer-events-none"})})]}):r.jsx("div",{className:"relative w-full h-full",ref:Dr,children:E?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center p-4",children:[r.jsxs(Se,{variant:"secondary",className:"mb-3 text-[10px]",children:[r.jsx(ya,{className:"w-3 h-3 mr-1"}),"Extension Connected"]}),r.jsx("h4",{className:"font-semibold text-foreground text-lg mb-1",children:A==="both"?"Screen + Camera":"Screen Recording"}),r.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mb-4",children:"Click the VIDAREO extension icon in your browser toolbar to start recording."}),r.jsxs("div",{className:"space-y-3 w-full max-w-xs",children:[r.jsxs("div",{className:"flex items-start gap-3 text-left bg-muted/50 rounded-lg px-3 py-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-background border border-border flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(TL,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium text-foreground",children:"Don't see it?"}),r.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Click the ",r.jsx("span",{className:"inline-flex items-center",children:r.jsx(TL,{className:"w-3 h-3 mx-0.5 inline"})})," puzzle icon in your toolbar to find your extensions."]})]})]}),r.jsxs("div",{className:"flex items-start gap-3 text-left bg-muted/50 rounded-lg px-3 py-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-background border border-border flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(EL,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium text-foreground",children:"Pin for easy access"}),r.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Click the ",r.jsx("span",{className:"inline-flex items-center",children:r.jsx(EL,{className:"w-3 h-3 mx-0.5 inline"})})," pin icon next to VIDAREO to keep it visible in your toolbar."]})]})]})]})]}):r.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-4",children:r.jsx(R2e,{onCheckAgain:T,isChecking:R})})})}),A==="camera"&&!B&&!_e&&r.jsx("div",{className:"flex justify-center",children:r.jsx(_V,{zoomPanRef:Be.cameraZoomPanRef,surfaceRef:Mr,mirrored:U})}),r.jsx("div",{className:"flex gap-1.5",children:Lo.map(rt=>{const jt=rt.premiumOnly&&!C;return r.jsxs("button",{onClick:()=>
1093{if(jt){Pe.error("Presentation mode is available on Professional and Team plans.",o?void 0:{action:{label:"Upgrade",onClick:()=>i("/pricing")}});return}V(rt.id)},className:ge("flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-md border transition-all relative",jt?"border-border bg-muted/50 opacity-70 cursor-not-allowed":A===rt.id?"border-primary bg-primary/5":"border-border hover:border-primary/50 bg-card"),children:[r.jsx(rt.icon,{className:ge("w-4 h-4",jt?"text-muted-foreground":A===rt.id?"text-primary":"text-muted-foreground")}),r.jsx("span",{className:ge("text-xs font-medium",jt?"text-muted-foreground":A===rt.id?"text-primary":"text-muted-foreground"),children:rt.label}),jt&&r.jsx(Ms,{className:"w-3 h-3 text-amber-500 absolute -top-1 -right-1"})]},rt.id)})}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("label",{className:"text-[10px] font-medium text-muted-foreground flex items-center gap-1",children:[r.jsx(Hd,{className:"w-3 h-3"}),"Microphone"]}),r.jsxs(kn,{value:G,onValueChange:ee,children:[r.jsx(wn,{className:"h-8 text-xs",children:r.jsx(En,{placeholder:"Select microphone"})}),r.jsx(jn,{children:Z.map(rt=>r.jsx(_t,{value:rt.deviceId,className:"text-xs",children:rt.label},rt.deviceId))})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("label",{className:"text-[10px] font-medium text-muted-foreground flex items-center gap-1",children:[r.jsx(ga,{className:"w-3 h-3"}),"Camera"]}),r.jsxs(kn,{value:re,onValueChange:W,disabled:A==="screen",children:[r.jsx(wn,{className:"h-8 text-xs",children:r.jsx(En,{placeholder:"Select camera"})}),r.jsx(jn,{children:H.map(rt=>r.jsx(_t,{value:rt.deviceId,className:"text-xs",children:rt.label},rt.deviceId))})]})]})]}),r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[A==="camera"&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(rr,{id:"mirror-camera",checked:U,onCheckedChange:O,className:"scale-75"}),r.jsx(ye,{htmlFor:"mirror-camera",className:"text-xs cursor-pointer",children:"Mirror"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:ge("flex items-center gap-1.5",m==="starter"&&"opacity-60"),children:[r.jsx(rr,{id:"watermark-toggle",checked:m==="starter"?!0:Nt,onCheckedChange:rt=>{m!=="starter"&&Ct(rt)},disabled:m==="starter",className:"scale-75"}),r.jsxs(ye,{htmlFor:"watermark-toggle",className:ge("text-xs flex items-center gap-1 cursor-pointer",m==="starter"&&"cursor-not-allowed"),children:[m==="starter"||Nt?r.jsx(wi,{className:"w-3 h-3"}):r.jsx(GH,{className:"w-3 h-3"}),"Watermark"]})]})}),m==="starter"&&r.jsx(yt,{children:r.jsx("p",{children:o?"Not available on your current plan":"Upgrade to Pro to customize"})})]})}
1093),m!=="starter"&&Nt&&r.jsxs(Z_,{type:"single",value:dt?"custom":"vidareo",onValueChange:rt=>{rt&&tt(rt==="custom")},className:"h-5",children:[r.jsx(If,{value:"vidareo",className:"h-5 px-1.5 text-[10px] data-[state=on]:bg-primary/10 data-[state=on]:text-primary",children:"VIDAREO"}),r.jsx(If,{value:"custom",className:"h-5 px-1.5 text-[10px] data-[state=on]:bg-primary/10 data-[state=on]:text-primary",children:"Custom"})]}),m!=="starter"&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-primary",onClick:()=>{t(!1),i("/profile")},children:r.jsx(_n,{className:"w-3 h-3"})})}),r.jsx(yt,{side:"bottom",children:r.jsx("p",{className:"text-xs",children:"Edit logo & signature in Profile Settings"})})]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(fr,{className:"w-3 h-3"}),r.jsxs("span",{children:["Max: ",Os," min"]}),S&&r.jsx(_n,{className:"w-3 h-3 text-primary"})]})]}),!o&&(m==="starter"||C&&!S&&!k)&&r.jsxs("div",{className:"flex items-center justify-between text-xs bg-muted/30 rounded-md px-2 py-1.5",children:[r.jsx("span",{className:"text-muted-foreground",children:m==="starter"?"Need longer videos?":"Need more time?"}),m==="starter"?r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"link",size:"sm",className:"h-auto p-0 text-xs text-primary",onClick:()=>{t(!1),i("/pricing")},children:[r.jsx(ya,{className:"w-3 h-3 mr-1"}),"Upgrade to Pro"]})}),r.jsx(yt,{side:"bottom",align:"end",children:r.jsx("p",{children:"Get 10+ minute recordings with Pro"})})]}):r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"link",size:"sm",className:"h-auto p-0 text-xs text-primary",onClick:()=>{t(!1),i("/settings?tab=add-ons")},children:[r.jsx(_n,{className:"w-3 h-3 mr-1"}),"Add Extended Video"]})}),r.jsx(yt,{side:"bottom",align:"end",children:r.jsx("p",{children:o?"Extended recordings not available on your plan":"Upgrade to 30 or 60 min recordings"})})]})]}),(A==="camera"||A==="presentation")&&r.jsxs(P,{className:"w-full gap-2",onClick:yu,disabled:$||m==="starter"&&p,children:[r.jsx("div",{className:"w-3 h-3 rounded-full bg-primary-foreground"}),m==="starter"&&p?"Limit Reached":A==="camera"?"Open Camera":"Start Recording"]})]}),Be.modalState==="recording"&&r.jsxs(r.Fragment,{children:[Zt&&A==="camera"&&r.jsx(jV,{isVisible:Zt,onToggle:()=>bt(!Zt),isRecording:Be.isRecording,isPaused:Be.isPaused,script:kt,onScriptChange:at,autoScroll:we,onAutoScrollChange:pt,scrollSpeed:mt,onScrollSpeedChange:er,maxDurationSeconds:dn}),r.jsxs("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:[r.jsx(PR,{isActive:Be.isCountingDown,onComplete:Zc}),(A==="screen"||A==="both")&&Be.isRecording&&!Be.isCountingDown?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-gradient-to-br from-primary/5 to-primary/10 p-6 text-center",ref:Dr,children:[r.jsx(Vs,{className:"w-12 h-12 text-primary/40 mb-3"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Screen recording in progress"}),r.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Use the floating controls to pause or stop"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:Ln,className:"absolute inset-0 overflow-hidden touch-none select-none",children:r.jsx("video",{ref:Be.videoRef,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-contain pointer-events-none"})}),Be.isRecording&&r.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-background/80 backdrop-blur-md border border-border/50 rounded-full px-3 py-1.5 shadow-lg",children:[r.jsx("div",{className:ge("w-2.5 h-2.5 rounded-full",Be.isPaused?"bg-amber-500":"bg-destructive animate-pulse")}),r.jsx("span",{className:"text-foreground text-sm font-mono font-bold tabular-nums",children:Q2e(Be.duration)}),Be.isPaused&&r.jsx("span",{className:"text-amber-500 text-[10px] font-semibold uppercase tracking-wider",children:"Paused"})]}),Be.isRecording&&Be.duration>=dn-20&&r.jsxs("div",{className:ge("absolute top-4 right-4 text-xs px-2.5 py-1 rounded-full font-medium border backdrop-blur-md shadow-lg",dn-Be.duration<=10?"bg-destructive/15 text-destructive border-destructive/30 animate-pulse":"bg-amber-500/15 text-amber-600 border-amber-500/30"),children:[dn-Be.duration,"s remaining"]})]})]}),A==="camera"&&!_e&&!Be.isCountingDown&&r.jsx("div",{className:"flex justify-center",children:r.jsx(_V,{zoomPanRef:Be.cameraZoomPanRef,surfaceRef:Ln,mirrored:U})}),!Be.isRecording&&!Be.isCountingDown&&(A==="camera"||_e)&&r.jsxs("div",{className:"flex items-center justify-center gap-4",children:[r.jsxs(P,{variant:"outline",size:"lg",onClick:()=>{ht(!1),Be.setModalState("setup")},className:"gap-2",children:[r.jsx(aa,{className:"w-5 h-5"}),"Back"]}),r.jsxs(P,{size:"lg",onClick:()=>Be.startCountdown(),className:"gap-2 shadow-lg shadow-primary/25",children:[r.jsx("div",{className:"w-3 h-3 rounded-full bg-destructive animate-pulse"}),"Start Recording"]})]}),Be.isRecording&&r.jsxs("div",{className:"flex items-center justify-center gap-3",children:[_e&&Yt.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs(P,{variant:"outline",size:"lg",onClick:()=>ie(Math.max(0,An-1)),disabled:An===0,className:"gap-1",children:[r.jsx(aa,{className:"w-4 h-4"}),"Prev"]}),r.jsxs("span",{className:"text-xs font-mono text-muted-foreground tabular-nums",children:[An+1,"/",Yt.length]}),r.jsxs(P,{variant:"outline",size:"lg",onClick:()=>ie(Math.min(Yt.length-1,An+1)),disabled:An===Yt.length-1,className:"gap-1",children:["Next",r.jsx(Hl,{className:"w-4 h-4"})]})]}),r.jsx(P,{variant:"outline",size:"lg",onClick:Be.toggleMute,className:ge("gap-2 backdrop-blur-sm",Be.isMuted&&"border-destructive/50 text-destructive"),children:Be.isMuted?r.jsxs(r.Fragment,{children:[r.jsx(cv,{className:"w-5 h-5"}),"Unmute"]}):r.jsxs(r.Fragment,{children:[r.jsx(Hd,{className:"w-5 h-5"}),"Mute"]})}),r.jsx(P,{variant:"outline",size:"lg",onClick:Be.togglePause,className:"gap-2 backdrop-blur-sm",children:Be.isPaused?r.jsxs(r.Fragment,{children:[r.jsx(Js,{className:"w-5 h-5"}),"Resume"]}):r.jsxs(r.Fragment,{children:[r.jsx(ig,{className:"w-5 h-5"}),"Pause"]})}),r.jsxs(P,{variant:"destructive",size:"lg",onClick:()=>{Be.stopRecording()},className:"gap-2 shadow-lg shadow-destructive/25",children:[r.jsx(Um,{className:"w-5 h-5 fill-current"}),"Stop"]})]}),(A==="screen"||A==="both")&&Be.isRecording&&!Be.isCountingDown&&r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"💡 The camera overlay in the final recording follows its position in this preview. It cannot be moved across monitors due to browser limitations."})]}),Be.modalState==="review"&&Be.recordedUrl&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden border-2 border-primary/30",children:r.jsx("video",{ref:rt=>{Be.recordedVideoRef.current=rt,rt&&CG(rt)}
1093,src:Be.recordedUrl,controls:!0,playsInline:!0,className:"w-full h-full object-contain bg-black"})}),ct?r.jsxs("div",{className:"border border-border rounded-lg p-3 bg-card",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wi,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Thumbnail"})]}),r.jsx("p",{className:"text-xs text-muted-foreground ml-6",children:"Auto-generated from video"})]}),r.jsxs("button",{onClick:()=>Oe(!1),className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[r.jsx(zt,{className:"w-4 h-4"}),"Close"]})]}),r.jsx(Rje,{videoUrl:Be.recordedUrl,onThumbnailSelected:jl,defaultThumbnail:xe,knownDuration:Be.duration})]}):r.jsxs("button",{onClick:()=>Oe(!0),className:"w-full flex items-center gap-3 border border-border rounded-lg p-3 bg-card hover:bg-accent/50 transition-colors text-left",children:[De?r.jsx("img",{src:De,alt:"Thumbnail",className:"w-16 h-9 object-cover rounded border border-border/50"}):r.jsx("div",{className:"w-16 h-9 bg-muted rounded flex items-center justify-center",children:r.jsx(wi,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Thumbnail"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Tap to change"})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ye,{className:"text-sm font-medium mb-1.5 block",children:"Title"}),r.jsx(He,{value:Q,onChange:rt=>L(rt.target.value),placeholder:"Enter video title",maxLength:100})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Description (optional)"}),r.jsxs("span",{className:ge("text-xs",te.length>450?"text-amber-500":"text-muted-foreground"),children:[te.length,"/500"]})]}),r.jsx($s,{value:te,onChange:rt=>ae(rt.target.value),placeholder:"Add a description...",rows:2,maxLength:500})]}),r.jsxs("div",{children:[r.jsx(ye,{className:"text-sm font-medium mb-1.5 block",children:"Tags (optional)"}),r.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:ne.map(rt=>r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[rt,r.jsx("button",{onClick:()=>bu(rt),className:"ml-1 hover:text-destructive",children:r.jsx(zt,{className:"w-3 h-3"})})]},rt))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{value:ue,onChange:rt=>Ne(rt.target.value),onKeyDown:nc,placeholder:"Add a tag and press Enter",className:"flex-1"}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>lo(ue),disabled:!ue.trim(),children:r.jsx(Ns,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:Z2e.filter(rt=>!ne.includes(rt.toLowerCase())).slice(0,4).map(rt=>r.jsxs("button",{onClick:()=>lo(rt),className:"text-xs px-2 py-1 rounded-full bg-muted hover:bg-muted/80 text-muted-foreground transition-colors",children:["+ ",rt]},rt))})]}),l&&r.jsx(rje,{userId:l.id,selectedFolderId:Qe,onFolderSelect:J})]}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs(P,{variant:"outline",className:"flex-1 gap-2",onClick:vh,disabled:de,children:[r.jsx(Wd,{className:"w-4 h-4"}),"Retake"]}),r.jsx(P,{className:"flex-1 gap-2",onClick:Jc,disabled:de,children:de?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Db,{className:"w-4 h-4"}),"Save to Library"]})})]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"A share link will be automatically created for your video"})]}),Be.modalState==="saved"&&r.jsxs("div",{className:"py-6 space-y-6",children:[r.jsxs("div",{className:"flex flex-col items-center text-center",children:[r.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-4",children:r.jsx(nt,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"Your video is ready to share!"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy the link below or view it in your library"})]}),pe&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 relative",children:r.jsx(He,{readOnly:!0,value:`https://lmytxuxvkybtzkbdljha.supabase.co/functions/v1/og-video-meta?token=${pe}&format=html`,className:"pr-10 text-sm bg-muted/50",onClick:rt=>rt.target.select()})}),r.jsx(P,{variant:ot?"default":"outline",size:"icon",onClick:()=>{const rt=`https://lmytxuxvkybtzkbdljha.supabase.co/functions/v1/og-video-meta?token=${pe}&format=html`;navigator.clipboard.writeText(rt),gt(!0),Pe.success("Link copied to clipboard!"),setTimeout(()=>gt(!1),2e3)},className:"shrink-0",children:ot?r.jsx(nt,{className:"w-4 h-4"}):r.jsx(ui,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"default",className:"flex-1 gap-2",onClick:()=>{const jt=`Check out my video: ${`https://lmytxuxvkybtzkbdljha.supabase.co/functions/v1/og-video-meta?token=${pe}&format=html`}`;window.open(`sms:?&body=${encodeURIComponent(jt)}`,"_self")},children:[r.jsx(Wa,{className:"w-4 h-4"}),"Text"]}),r.jsxs(P,{variant:"default",className:"flex-1 gap-2",onClick:()=>{const rt=r0(pe||""),jt=encodeURIComponent(Q||"Check out my video!"),Qt=encodeURIComponent(`I just recorded a video for you on VIDAREO:
1094
1095${rt}`);window.location.href=`mailto:?subject=${jt}&body=${Qt}`},children:[r.jsx(zr,{className:"w-4 h-4"}),"Email"]})]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Anyone with this link can view your video"})]}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs(P,{variant:"outline",className:"flex-1 gap-2",onClick:()=>{t(!1),i("/videos",{state:{highlightVideoId:ke}})},children:[r.jsx(bn,{className:"w-4 h-4"}),"View in Library"]}),r.jsxs(P,{className:"flex-1 gap-2",onClick:oo,children:[r.jsx(cr,{className:"w-4 h-4"}),"Record Another"]})]})]})]})})]})]}):null};function tCe(){const{isOpen:e,initialMode:t,closeRecording:n,onSaveComplete:s,isScreenRecording:a}=bv(),i=Sr(),o=ja(),l=h.useRef(o.pathname);h.useEffect(()=>{l.current!==o.pathname&&e&&!a&&n(),l.current=o.pathname},[o.pathname,e,a,n]);const c=h.useCallback(d=>{s(d),_r()?i("/videos",{state:{highlightVideoId:d.videoId}}):i("/videos",{state:{savedVideo:d,showShareDialog:!0,highlightVideoId:d.videoId}})},[s,i]);return r.jsx(eCe,{open:e,onOpenChange:d=>{d||n()},onSaveComplete:c,initialMode:t})}let MR={},aQ;function hE(e={}){MR={animate:!0,allowClose:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function Ut(e){return e?MR[e]:MR}function rCe(e){aQ=e}function go(){return aQ}let VN={};function kj(e,t){VN[e]=t}function gf(e){var t;(t=VN[e])==null||t.call(VN)}function nCe(){VN={}}function Ej(e,t,n,s){return(e/=s/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function iQ(e){const t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(n=>{const s=n.matches(t),a=Array.from(n.querySelectorAll(t));
1095return[...s?[n]:[],...a]}).filter(n=>getComputedStyle(n).pointerEvents!=="none"&&iCe(n))}function oQ(e){if(!e||aCe(e))return;const t=Ut("smoothScroll"),n=e.offsetHeight>window.innerHeight;e.scrollIntoView({behavior:!t||sCe(e)?"auto":"smooth",inline:"center",block:n?"start":"center"})}function sCe(e){if(!e||!e.parentElement)return;const t=e.parentElement;return t.scrollHeight>t.clientHeight}function aCe(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function iCe(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let UN={};function Ua(e,t){UN[e]=t}function Gt(e){return e?UN[e]:UN}function kV(){UN={}}function oCe(e,t,n,s){let a=Gt("__activeStagePosition");const i=a||n.getBoundingClientRect(),o=s.getBoundingClientRect(),l=Ej(e,i.x,o.x-i.x,t),c=Ej(e,i.y,o.y-i.y,t),d=Ej(e,i.width,o.width-i.width,t),u=Ej(e,i.height,o.height-i.height,t);a={x:l,y:c,width:d,height:u},cQ(a),Ua("__activeStagePosition",a)}function lQ(e){if(!e)return;const t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};Ua("__activeStagePosition",n),cQ(n)}function lCe(){const e=Gt("__activeStagePosition"),t=Gt("__overlaySvg");if(!e)return;if(!t){console.warn("No stage svg found.");return}const n=window.innerWidth,s=window.innerHeight;t.setAttribute("viewBox",`0 0 ${n} ${s}`)}function cCe(e){const t=dCe(e);document.body.appendChild(t),mQ(t,n=>{n.target.tagName==="path"&&gf("overlayClick")}),Ua("__overlaySvg",t)}function cQ(e){const t=Gt("__overlaySvg");if(!t){cCe(e);return}const n=t.firstElementChild;if((n==null?void 0:n.tagName)!=="path")throw new Error("no path element found in stage svg");n.setAttribute("d",dQ(e))}function dCe(e){const t=window.innerWidth,n=window.innerHeight,s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.classList.add("driver-overlay","driver-overlay-animated"),s.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("xmlSpace","preserve"),s.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),s.setAttribute("version","1.1"),s.setAttribute("preserveAspectRatio","xMinYMin slice"),s.style.fillRule="evenodd",s.style.clipRule="evenodd",s.style.strokeLinejoin="round",s.style.strokeMiterlimit="2",s.style.zIndex="10000",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%";const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d",dQ(e)),a.style.fill=Ut("overlayColor")||"rgb(0,0,0)",a.style.opacity=`${Ut("overlayOpacity")}`,a.style.pointerEvents="auto",a.style.cursor="auto",s.appendChild(a),s}function dQ(e){const t=window.innerWidth,n=window.innerHeight,s=Ut("stagePadding")||0,a=Ut("stageRadius")||0,i=e.width+s*2,o=e.height+s*2,l=Math.min(a,i/2,o/2),c=Math.floor(Math.max(l,0)),d=e.x-s+c,u=e.y-s,m=i-c*2,f=o-c*2;return`M${t},0L0,0L0,${n}L${t},${n}L${t},0Z
1096    M${d},${u} h${m} a${c},${c} 0 0 1 ${c},${c} v${f} a${c},${c} 0 0 1 -${c},${c} h-${m} a${c},${c} 0 0 1 -${c},-${c} v-${f} a${c},${c} 0 0 1 ${c},-${c} z`}function uCe(){const e=Gt("__overlaySvg");e&&e.remove()}function mCe(){const e=document.getElementById("driver-dummy-element");if(e)return e;let t=document.createElement("div");return t.id="driver-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}function EV(e){const{element:t}=e;let n=typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t;n||(n=mCe()),fCe(n,e)}function hCe(){const e=Gt("__activeElement"),t=Gt("__activeStep");e&&(lQ(e),lCe(),fQ(e,t))}function fCe(e,t){var n;const s=Date.now(),a=Gt("__activeStep"),i=Gt("__activeElement")||e,o=!i||i===e,l=e.id==="driver-dummy-element",c=i.id==="driver-dummy-element",d=Ut("animate"),u=t.onHighlightStarted||Ut("onHighlightStarted"),m=(t==null?void 0:t.onHighlighted)||Ut("onHighlighted"),f=(a==null?void 0:a.onDeselected)||Ut("onDeselected"),p=Ut(),x=Gt();!o&&f&&f(c?void 0:i,a,{config:p,state:x,driver:go()}),u&&u(l?void 0:e,t,{config:p,state:x,driver:go()});const g=!o&&d;let v=!1;yCe(),Ua("previousStep",a),Ua("previousElement",i),Ua("activeStep",t),Ua("activeElement",e);const y=()=>
1096{if(Gt("__transitionCallback")!==y)return;const b=Date.now()-s,w=400-b<=400/2;t.popover&&w&&!v&&g&&(AV(e,t),v=!0),Ut("animate")&&b<400?oCe(b,400,i,e):(lQ(e),m&&m(l?void 0:e,t,{config:Ut(),state:Gt(),driver:go()}),Ua("__transitionCallback",void 0),Ua("__previousStep",a),Ua("__previousElement",i),Ua("__activeStep",t),Ua("__activeElement",e)),window.requestAnimationFrame(y)};Ua("__transitionCallback",y),window.requestAnimationFrame(y),oQ(e),!g&&t.popover&&AV(e,t),i.classList.remove("driver-active-element","driver-no-interaction"),i.removeAttribute("aria-haspopup"),i.removeAttribute("aria-expanded"),i.removeAttribute("aria-controls"),((n=t.disableActiveInteraction)!=null?n:Ut("disableActiveInteraction"))&&e.classList.add("driver-no-interaction"),e.classList.add("driver-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","driver-popover-content")}function pCe(){var e;(e=document.getElementById("driver-dummy-element"))==null||e.remove(),document.querySelectorAll(".driver-active-element").forEach(t=>{t.classList.remove("driver-active-element","driver-no-interaction"),t.removeAttribute("aria-haspopup"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-controls")})}function n0(){const e=Gt("__resizeTimeout");e&&window.cancelAnimationFrame(e),Ua("__resizeTimeout",window.requestAnimationFrame(hCe))}function xCe(e){var t;if(!Gt("isInitialized")||!(e.key==="Tab"||e.keyCode===9))return;const n=Gt("__activeElement"),s=(t=Gt("popover"))==null?void 0:t.wrapper,a=iQ([...s?[s]:[],...n?[n]:[]]),i=a[0],o=a[a.length-1];if(e.preventDefault(),e.shiftKey){const l=a[a.indexOf(document.activeElement)-1]||o;l==null||l.focus()}else{const l=a[a.indexOf(document.activeElement)+1]||i;l==null||l.focus()}}function uQ(e){var t;((t=Ut("allowKeyboardControl"))==null||t)&&(e.key==="Escape"?gf("escapePress"):e.key==="ArrowRight"?gf("arrowRightPress"):e.key==="ArrowLeft"&&gf("arrowLeftPress"))}function mQ(e,t,n){const s=(a,i)=>{const o=a.target;e.contains(o)&&((!n||n(o))&&(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()),i==null||i(a))};document.addEventListener("pointerdown",s,!0),document.addEventListener("mousedown",s,!0),document.addEventListener("pointerup",s,!0),document.addEventListener("mouseup",s,!0),document.addEventListener("click",a=>{s(a,t)},!0)}function gCe(){window.addEventListener("keyup",uQ,!1),window.addEventListener("keydown",xCe,!1),window.addEventListener("resize",n0),window.addEventListener("scroll",n0)}function vCe(){window.removeEventListener("keyup",uQ),window.removeEventListener("resize",n0),window.removeEventListener("scroll",n0)}function yCe(){const e=Gt("popover");e&&(e.wrapper.style.display="none")}function AV(e,t){var n,s;let a=Gt("popover");a&&document.body.removeChild(a.wrapper),a=wCe(),document.body.appendChild(a.wrapper);const{title:i,description:o,showButtons:l,disableButtons:c,showProgress:d,nextBtnText:u=Ut("nextBtnText")||"Next &rarr;",prevBtnText:m=Ut("prevBtnText")||"&larr; Previous",progressText:f=Ut("progressText")||"{current} of {total}"}=t.popover||{};a.nextButton.innerHTML=u,a.previousButton.innerHTML=m,a.progress.innerHTML=f,i?(a.title.innerHTML=i,a.title.style.display="block"):a.title.style.display="none",o?(a.description.innerHTML=o,a.description.style.display="block"):a.description.style.display="none";const p=l||Ut("showButtons"),x=d||Ut("showProgress")||!1,g=(p==null?void 0:p.includes("next"))||(p==null?void 0:p.includes("previous"))||x;a.closeButton.style.display=p.includes("close")?"block":"none",g?(a.footer.style.display="flex",a.progress.style.display=x?"block":"none",a.nextButton.style.display=p.includes("next")?"block":"none",a.previousButton.style.display=p.includes("previous")?"block":"none"):a.footer.style.display="none";const v=c||Ut("disableButtons")||[];v!=null&&v.includes("next")&&(a.nextButton.disabled=!0,a.nextButton.classList.add("driver-popover-btn-disabled")),v!=null&&v.includes("previous")&&(a.previousButton.disabled=!0,a.previousButton.classList.add("driver-popover-btn-disabled")),v!=null&&v.includes("close")&&(a.closeButton.disabled=!0,a.closeButton.classList.add("driver-popover-btn-disabled"));const y=a.wrapper;y.style.display="block",y.style.left="",y.style.top="",y.style.bottom="",y.style.right="",y.id="driver-popover-content",y.setAttribute("role","dialog"),y.setAttribute("aria-labelledby","driver-popover-title"),y.setAttribute("aria-describedby","driver-popover-description");const b=a.arrow;b.className="driver-popover-arrow";const w=((n=t.popover)==null?void 0:n.popoverClass)||Ut("popoverClass")||"";y.className=`driver-popover ${w}`.trim(),mQ(a.wrapper,_=>{var C,k,E;const R=_.target,T=((C=t.popover)==null?void 0:C.onNextClick)||Ut
1096("onNextClick"),D=((k=t.popover)==null?void 0:k.onPrevClick)||Ut("onPrevClick"),A=((E=t.popover)==null?void 0:E.onCloseClick)||Ut("onCloseClick");if(R.closest(".driver-popover-next-btn"))return T?T(e,t,{config:Ut(),state:Gt(),driver:go()}):gf("nextClick");if(R.closest(".driver-popover-prev-btn"))return D?D(e,t,{config:Ut(),state:Gt(),driver:go()}):gf("prevClick");if(R.closest(".driver-popover-close-btn"))return A?A(e,t,{config:Ut(),state:Gt(),driver:go()}):gf("closeClick")},_=>!(a!=null&&a.description.contains(_))&&!(a!=null&&a.title.contains(_))&&typeof _.className=="string"&&_.className.includes("driver-popover")),Ua("popover",a);const S=((s=t.popover)==null?void 0:s.onPopoverRender)||Ut("onPopoverRender");S&&S(a,{config:Ut(),state:Gt(),driver:go()}),fQ(e,t),oQ(y);const j=e.classList.contains("driver-dummy-element"),N=iQ([y,...j?[]:[e]]);N.length>0&&N[0].focus()}function hQ(){const e=Gt("popover");if(!(e!=null&&e.wrapper))return;const t=e.wrapper.getBoundingClientRect(),n=Ut("stagePadding")||0,s=Ut("popoverOffset")||0;return{width:t.width+n+s,height:t.height+n+s,realWidth:t.width,realHeight:t.height}}function TV(e,t){const{elementDimensions:n,popoverDimensions:s,popoverPadding:a,popoverArrowDimensions:i}=t;return e==="start"?Math.max(Math.min(n.top-a,window.innerHeight-s.realHeight-i.width),i.width):e==="end"?Math.max(Math.min(n.top-(s==null?void 0:s.realHeight)+n.height+a,window.innerHeight-(s==null?void 0:s.realHeight)-i.width),i.width):e==="center"?Math.max(Math.min(n.top+n.height/2-(s==null?void 0:s.realHeight)/2,window.innerHeight-(s==null?void 0:s.realHeight)-i.width),i.width):0}function RV(e,t){const{elementDimensions:n,popoverDimensions:s,popoverPadding:a,popoverArrowDimensions:i}=t;return e==="start"?Math.max(Math.min(n.left-a,window.innerWidth-s.realWidth-i.width),i.width):e==="end"?Math.max(Math.min(n.left-(s==null?void 0:s.realWidth)+n.width+a,window.innerWidth-(s==null?void 0:s.realWidth)-i.width),i.width):e==="center"?Math.max(Math.min(n.left+n.width/2-(s==null?void 0:s.realWidth)/2,window.innerWidth-(s==null?void 0:s.realWidth)-i.width),i.width):0}function fQ(e,t){const n=Gt("popover");if(!n)return;const{align:s="start",side:a="left"}=(t==null?void 0:t.popover)||{},i=s,o=e.id==="driver-dummy-element"?"over":a,l=Ut("stagePadding")||0,c=hQ(),d=n.arrow.getBoundingClientRect(),u=e.getBoundingClientRect(),m=u.top-c.height;let f=m>=0;const p=window.innerHeight-(u.bottom+c.height);let x=p>=0;const g=u.left-c.width;let v=g>=0;const y=window.innerWidth-(u.right+c.width);let b=y>=0;const w=!f&&!x&&!v&&!b;let S=o;if(o==="top"&&f?b=v=x=!1:o==="bottom"&&x?b=v=f=!1:o==="left"&&v?b=f=x=!1:o==="right"&&b&&(v=f=x=!1),o==="over"){const j=window.innerWidth/2-c.realWidth/2,N=window.innerHeight/2-c.realHeight/2;n.wrapper.style.left=`${j}px`,n.wrapper.style.right="auto",n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto"}else if(w){const j=window.innerWidth/2-(c==null?void 0:c.realWidth)/2,N=10;n.wrapper.style.left=`${j}px`,n.wrapper.style.right="auto",n.wrapper.style.bottom=`${N}px`,n.wrapper.style.top="auto"}else if(v){const j=Math.min(g,window.innerWidth-(c==null?void 0:c.realWidth)-d.width),N=TV(i,{elementDimensions:u,popoverDimensions:c,popoverPadding:l,popoverArrowDimensions:d});n.wrapper.style.left=`${j}px`,n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.right="auto",S="left"}else if(b){const j=Math.min(y,window.innerWidth-(c==null?void 0:c.realWidth)-d.width),N=TV(i,{elementDimensions:u,popoverDimensions:c,popoverPadding:l,popoverArrowDimensions:d});n.wrapper.style.right=`${j}px`,n.wrapper.style.top=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.left="auto",S="right"}else if(f){const j=Math.min(m,window.innerHeight-c.realHeight-d.width);let N=RV(i,{elementDimensions:u,popoverDimensions:c,popoverPadding:l,popoverArrowDimensions:d});n.wrapper.style.top=`${j}px`,n.wrapper.style.left=`${N}px`,n.wrapper.style.bottom="auto",n.wrapper.style.right="auto",S="top"}else if(x){const j=Math.min(p,window.innerHeight-(c==null?void 0:c.realHeight)-d.width);let N=RV(i,{elementDimensions:u,popoverDimensions:c,popoverPadding:l,popoverArrowDimensions:d});n.wrapper.style.left=`${N}px`,n.wrapper.style.bottom=`${j}px`,n.wrapper.style.top="auto",n.wrapper.style.right="auto",S="bottom"}w?n.arrow.classList.add("driver-popover-arrow-none"):bCe(i,S,e)}function bCe(e,t,n){const s=Gt("popover");if(!s)return;const a=n.getBoundingClientRect(),i=hQ(),o=s.arrow,l=i.width,c=window.innerWidth,d=a.width,u=a.left,m=i.height,f=window.innerHeight,p=a.top,x=a.height;o.className="driver-popover-arrow";let g=t,v=e;if(t==="top"?(u+d<=0?(g="right",v="end"):u+d-l<=0&&(g="top",v="start"),u>=c?(g="left",v="end"):u+l>=c&&(g="top",v="end")):t==="bottom"?(u+d<=0?(g="right",v="start"):u+d-l<=0&&(g="bottom",v="start"),u>=c?(g="left",v="start"):u+l>
1096=c&&(g="bottom",v="end")):t==="left"?(p+x<=0?(g="bottom",v="end"):p+x-m<=0&&(g="left",v="start"),p>=f?(g="top",v="end"):p+m>=f&&(g="left",v="end")):t==="right"&&(p+x<=0?(g="bottom",v="start"):p+x-m<=0&&(g="right",v="start"),p>=f?(g="top",v="start"):p+m>=f&&(g="right",v="end")),!g)o.classList.add("driver-popover-arrow-none");else{o.classList.add(`driver-popover-arrow-side-${g}`),o.classList.add(`driver-popover-arrow-align-${v}`);const y=n.getBoundingClientRect(),b=o.getBoundingClientRect(),w=Ut("stagePadding")||0,S=y.left-w<window.innerWidth&&y.right+w>0&&y.top-w<window.innerHeight&&y.bottom+w>0;t==="bottom"&&S&&(b.x>y.x&&b.x+b.width<y.x+y.width?s.wrapper.style.transform="translateY(0)":(o.classList.remove(`driver-popover-arrow-align-${v}`),o.classList.add("driver-popover-arrow-none"),s.wrapper.style.transform=`translateY(-${w/2}px)`))}}function wCe(){const e=document.createElement("div");e.classList.add("driver-popover");const t=document.createElement("div");t.classList.add("driver-popover-arrow");const n=document.createElement("header");n.id="driver-popover-title",n.classList.add("driver-popover-title"),n.style.display="none",n.innerText="Popover Title";const s=document.createElement("div");s.id="driver-popover-description",s.classList.add("driver-popover-description"),s.style.display="none",s.innerText="Popover description is here";const a=document.createElement("button");a.type="button",a.classList.add("driver-popover-close-btn"),a.setAttribute("aria-label","Close"),a.innerHTML="&times;";const i=document.createElement("footer");i.classList.add("driver-popover-footer");const o=document.createElement("span");o.classList.add("driver-popover-progress-text"),o.innerText="";const l=document.createElement("span");l.classList.add("driver-popover-navigation-btns");const c=document.createElement("button");c.type="button",c.classList.add("driver-popover-prev-btn"),c.innerHTML="&larr; Previous";const d=document.createElement("button");return d.type="button",d.classList.add("driver-popover-next-btn"),d.innerHTML="Next &rarr;",l.appendChild(c),l.appendChild(d),i.appendChild(o),i.appendChild(l),e.appendChild(a),e.appendChild(t),e.appendChild(n),e.appendChild(s),e.appendChild(i),{wrapper:e,arrow:t,title:n,description:s,footer:i,previousButton:c,nextButton:d,closeButton:a,footerButtons:l,progress:o}}function jCe(){var e;const t=Gt("popover");t&&((e=t.wrapper.parentElement)==null||e.removeChild(t.wrapper))}function NCe(e={}){hE(e);function t(){Ut("allowClose")&&u()}function n(){const f=Ut("overlayClickBehavior");if(Ut("allowClose")&&f==="close"){u();return}if(typeof f=="function"){const p=Gt("__activeStep"),x=Gt("__activeElement");f(x,p,{config:Ut(),state:Gt(),driver:go()});return}f==="nextStep"&&s()}function s(){const f=Gt("activeIndex"),p=Ut("steps")||[];if(typeof f>"u")return;const x=f+1;p[x]?d(x):u()}function a(){const f=Gt("activeIndex"),p=Ut("steps")||[];if(typeof f>"u")return;const x=f-1;p[x]?d(x):u()}function i(f){(Ut("steps")||[])[f]?d(f):u()}function o(){var f;if(Gt("__transitionCallback"))return;const p=Gt("activeIndex"),x=Gt("__activeStep"),g=Gt("__activeElement");if(typeof p>"u"||typeof x>"u"||typeof Gt("activeIndex")>"u")return;const v=((f=x.popover)==null?void 0:f.onPrevClick)||Ut("onPrevClick");if(v)return v(g,x,{config:Ut(),state:Gt(),driver:go()});a()}function l(){var f;if(Gt("__transitionCallback"))return;const p=Gt("activeIndex"),x=Gt("__activeStep"),g=Gt("__activeElement");if(typeof p>"u"||typeof x>"u")return;const v=((f=x.popover)==null?void 0:f.onNextClick)||Ut("onNextClick");if(v)return v(g,x,{config:Ut(),state:Gt(),driver:go()});s()}function c(){Gt("isInitialized")||(Ua("isInitialized",!0),document.body.classList.add("driver-active",Ut("animate")?"driver-fade":"driver-simple"),gCe(),kj("overlayClick",n),kj("escapePress",t),kj("arrowLeftPress",o),kj("arrowRightPress",l))}function d(f=0){var p,x,g,v,y,b,w,S;const j=Ut("steps");if(!j){console.error("No steps to drive through"),u();return}if(!j[f]){u();return}Ua("__activeOnDestroyed",document.activeElement),Ua("activeIndex",f);const N=j[f],_=j[f+1],C=j[f-1],k=((p=N.popover)==null?void 0:p.doneBtnText)||Ut("doneBtnText")||"Done",E=Ut("allowClose"),R=typeof((x=N.popover)==null?void 0:x.showProgress)<"u"?(g=N.popover)==null?void 0:g.showProgress:Ut("showProgress"),T=(((v=N.popover)==null?void 0:v.progressText)||Ut("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${f+1}`).replace("{{total}}",`${j.length}`),D=((y=N.popover)==null?void 0:y.showButtons)||Ut("showButtons"),A=["next","previous",...E?["close"]:[]].filter(M=>!(D!=null&&D.length)||D.includes(M)),V=((b=N.popover)==null?void 0:b.onNextClick)||Ut
1096("onNextClick"),U=((w=N.popover)==null?void 0:w.onPrevClick)||Ut("onPrevClick"),O=((S=N.popover)==null?void 0:S.onCloseClick)||Ut("onCloseClick");EV({...N,popover:{showButtons:A,nextBtnText:_?void 0:k,disableButtons:[...C?[]:["previous"]],showProgress:R,progressText:T,onNextClick:V||(()=>{_?d(f+1):u()}),onPrevClick:U||(()=>{d(f-1)}),onCloseClick:O||(()=>{u()}),...(N==null?void 0:N.popover)||{}}})}function u(f=!0){const p=Gt("__activeElement"),x=Gt("__activeStep"),g=Gt("__activeOnDestroyed"),v=Ut("onDestroyStarted");if(f&&v){const w=!p||(p==null?void 0:p.id)==="driver-dummy-element";v(w?void 0:p,x,{config:Ut(),state:Gt(),driver:go()});return}const y=(x==null?void 0:x.onDeselected)||Ut("onDeselected"),b=Ut("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),vCe(),jCe(),pCe(),uCe(),nCe(),kV(),p&&x){const w=p.id==="driver-dummy-element";y&&y(w?void 0:p,x,{config:Ut(),state:Gt(),driver:go()}),b&&b(w?void 0:p,x,{config:Ut(),state:Gt(),driver:go()})}g&&g.focus()}const m={isActive:()=>Gt("isInitialized")||!1,refresh:n0,drive:(f=0)=>{c(),d(f)},setConfig:hE,setSteps:f=>{kV(),hE({...Ut(),steps:f})},getConfig:Ut,getState:Gt,getActiveIndex:()=>Gt("activeIndex"),isFirstStep:()=>Gt("activeIndex")===0,isLastStep:()=>{const f=Ut("steps")||[],p=Gt("activeIndex");return p!==void 0&&p===f.length-1},getActiveStep:()=>Gt("activeStep"),getActiveElement:()=>Gt("activeElement"),getPreviousElement:()=>Gt("previousElement"),getPreviousStep:()=>Gt("previousStep"),moveNext:s,movePrevious:a,moveTo:i,hasNextStep:()=>{const f=Ut("steps")||[],p=Gt("activeIndex");return p!==void 0&&!!f[p+1]},hasPreviousStep:()=>{const f=Ut("steps")||[],p=Gt("activeIndex");return p!==void 0&&!!f[p-1]},highlight:f=>{c(),EV({...f,popover:f.popover?{showButtons:[],showProgress:!1,progressText:"",...f.popover}:void 0})},destroy:()=>{u(!1)}};return rCe(m),m}const OV={dashboard:[{element:'[data-tour="greeting"]',popover:{title:"Welcome! 👋",description:"This is your dashboard - your home base for everything VIDAREO.",side:"bottom"}},{element:'[data-tour="usage-stats"]',popover:{title:"Usage Stats",description:"Track your recordings, shares, and viewing activity at a glance.",side:"bottom"}},{element:'[data-tour="quick-actions"]',popover:{title:"Quick Actions",description:"Start recording, schedule a call, or jump to your videos - all one click away.",side:"left"}},{element:'[data-tour="recent-videos"]',popover:{title:"Recent Videos",description:"Your latest recordings show up here for quick access.",side:"top"}},{element:'[data-tour="activity-feed"]',popover:{title:"Activity Feed",description:"See who viewed your videos and any recent engagement.",side:"top"}},{element:'[data-tour="plan-card"]',popover:{title:"Your Plan",description:"View your current plan details and upgrade options.",side:"left"}}],videos:[{element:'[data-tour="video-search"]',popover:{title:"Search & Filter",description:"Find any video by title, tags, or date. Use filters to narrow results.",side:"bottom"}},{element:'[data-tour="folder-manager"]',popover:{title:"Folders",description:"Organize your videos into folders for easy management.",side:"right"}},{element:'[data-tour="video-grid"]',popover:{title:"Video Library",description:"All your recordings live here. Click any video to play, edit, share, or view analytics.",side:"top"}}],analytics:[{element:'[data-tour="analytics-overview"]',popover:{title:"Overview Stats",description:"See your total views, watch time, and completion rates across all videos.",side:"bottom"}},{element:'[data-tour="analytics-time-range"]',popover:{title:"Date Range",description:"Filter analytics by time period to spot trends.",side:"bottom"}},{element:'[data-tour="analytics-video-list"]',popover:{title:"Video Engagement",description:"Videos sorted by engagement score. Click any video for detailed analytics.",side:"top"}}],meet:[{element:'[data-tour="meet-hero"]',popover:{title:"Video Calls",description:"Start or join peer-to-peer video calls directly from your browser.",side:"bottom"}},{element:'[data-tour="meet-actions"]',popover:{title:"Start or Join",description:"Create a new room or enter a code to join an existing call.",side:"bottom"}},{element:'[data-tour="meet-personal-link"]',popover:{title:"Personal Meeting Link",description:"Your permanent, reusable meeting URL. Share it once and anyone can join your room anytime.",side:"left"}},{element:'[data-tour="meet-schedule"]',popover:{title:"Schedule a Call",description:"Pick a date, time, and duration to schedule a future call. Email invites with calendar attachments are sent automatically.",side:"left"}},{element:'[data-tour="meet-upcoming"]',popover:{title:"Upcoming Calls",description:"View and manage your scheduled meetings. Join when it's time or cancel if plans change.",side:"left"}}],contacts:[{element:'[data-tour="contacts-area"]',popover:{title:"Your Contacts",description:"Manage your contact list - add, import, organize into lists, and send videos directly.",side:"bottom"}}],settings:[{element:'[data-tour="settings-notifications"]',popover:{title:"Email Notifications",description:"Control which email notifications you receive - views, completions, milestones, and more.",side:"bottom"}},{element:'[data-tour="settings-inapp"]',popover:{title:"In-App Notifications",description:"Toggle in-app alerts for video views, replies, comments, and moderation updates.",side:"bottom"}},{element:'[data-tour="settings-push"]',popover:{title:"Browser Push Notifications",description:"Enable push notifications to get real-time alerts even when the tab is closed.",side:"bottom"}},{element:'[data-tour="settings-theme"]',popover:{title:"Security & Session",description:"View your active session details and security settings.",side:"bottom"}},{element:'[data-tour="settings-privacy"]',popover:{title:"Privacy",description:"Manage cookie consent, analytics tracking, and delete your account.",side:"bottom"}}],profile:[{element:'[data-tour="profile-avatar"]',popover:{title:"Your Avatar",description:"Upload a profile photo that appears on your shared videos and emails.",side:"right"}},{element:'[data-tour="profile-info"]',popover:{title:"Personal Info",description:"Set your name, job title, and business details for your video page.",side:"top"}},{element:'[data-tour="profile-meeting-link"]',popover:{title:"Personal Meeting Link",description:"Set a custom, reusable meeting link so anyone can join your video calls easily.",side:"top"}},{element:'[data-tour="profile-branding"]',popover:{title:"Company Branding",description:"Upload your company logo and customize the tagline in your email headers.",side:"top"}},{element:'[data-tour="profile-signature"]',popover:{title:"Email & Text Signature",description:"Add your job title, company, and phone to a professional signature included in shared videos.",side:"top"}},{element:'[data-tour="profile-contact-info"]',popover:{title:"Shared Video Contact Info",description:"Control which personal details (email, phone, 
1096company) viewers see on your shared video pages.",side:"top"}},{element:'[data-tour="profile-watermark"]',popover:{title:"Watermark Settings",description:"Customize the watermark that appears on your shared videos.",side:"top"}}],mail:[{element:'[data-tour="mail-sidebar"]',popover:{title:"Email Sections",description:"Navigate between Compose, Templates, Branding, and Sent History tabs.",side:"right"}},{element:'[data-tour="mail-compose"]',popover:{title:"Compose",description:"Select a video, pick a recipient or contact list, customize your message, and send.",side:"bottom"}},{element:'[data-tour="mail-video-select"]',popover:{title:"Select Video",description:"Choose which video to share. Search by title to find it quickly.",side:"bottom"}},{element:'[data-tour="mail-email-composer"]',popover:{title:"Email Composer",description:"Customize the subject, message, and template. Preview the email before sending.",side:"top"}},{element:'[data-tour="mail-templates"]',popover:{title:"Templates",description:"Create and manage reusable email templates for faster outreach.",side:"bottom"}},{element:'[data-tour="mail-branding"]',popover:{title:"Branding",description:"Add your logo, signature, and custom styling to emails you send.",side:"bottom"}},{element:'[data-tour="mail-sent"]',popover:{title:"Sent History",description:"Track email opens, video views, watch time, and engagement for every email you've sent.",side:"bottom"}}]},SCe=({tourId:e,autoStart:t=!1})=>{const n=h.useRef(null),s=h.useCallback(()=>{if(!e||!OV[e])return;const a=OV[e].filter(o=>o.element?document.querySelector(o.element):!0);if(a.length===0)return;const i=NCe({showProgress:!0,animate:!0,smoothScroll:!0,allowClose:!0,stagePadding:6,stageRadius:8,popoverClass:"vidareo-tour-popover",nextBtnText:"Next →",prevBtnText:"← Back",doneBtnText:"Done ✓",progressText:"{{current}} of {{total}}",steps:a,onDestroyed:()=>{localStorage.setItem(`vidareo_tour_${e}_completed`,"true")}});n.current=i,i.drive()},[e]);return h.useEffect(()=>{if(!e||!t)return;const a=`vidareo_tour_${e}_completed`;if(localStorage.getItem(a))return;const i=setTimeout(()=>{s()},800);return()=>clearTimeout(i)},[e,t,s]),h.useEffect(()=>(window.__vidareoStartTour=s,()=>{delete window.__vidareoStartTour}),[s]),null},IR=h.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:s,...a},i)=>r.jsx(Uxe,{ref:i,to:s,className:({isActive:o,isPending:l})=>ge(e,o&&t,l&&n),...a}));IR.displayName="NavLink";function pQ(){var c,d;const e=new Date,t=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",year:"numeric",month:"numeric"}).formatToParts(e),n=Number((c=t.find(u=>u.type==="year"))==null?void 0:c.value),a=Number((d=t.find(u=>u.type==="month"))==null?void 0:d.value),i=a>11?n+1:n,o=a>11?0:a,l=new Date(Date.UTC(i,o,1));return new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",month:"long",day:"numeric"}).format(l)}function u2(e){const{isAtLimit:t,isLoading:n,limit:s,currentUsage:a}=jw(e),i=Aye(),o=h.useMemo(()=>pQ(),[]),l=h.useMemo(()=>t?i?`Monthly limit reached. Resets ${o}.`:"Monthly limit reached. Upgrade to record more.":"",[t,i,o]);return{disabled:t,isLoading:n,isIOS:i,reasonText:l,resetsOn:o,limit:s,currentUsage:a}}const _Ce=()=>{const{user:e,loading:t}=nr(),n=ih(),s=Sr(),a=ja(),i=h.useRef(null),{disabled:o,reasonText:l}=u2(e==null?void 0:e.id),c=a.pathname.startsWith("/meet/"),d=n&&!t&&!!e&&!c&&_r();if(h.useEffect(()=>(d?document.body.classList.add("has-bottom-nav"):document.body.classList.remove("has-bottom-nav"),()=>document.body.classList.remove("has-bottom-nav")),[d]),!d)return null;const u=()=>{if(o){Pe(l);return}if(!_r()){s("/record?mode=camera");return}},m=async f=>{var v;const p=(v=f.target.files)==null?void 0:v[0];if(f.target.value="",!p)return;if(!p.type.startsWith("video/")){Pe.error("Please record a video, not a photo.");return}const x=p.name.split(".").pop()||(p.type.includes("quicktime")?"mov":"mp4"),g=new File([p],`Recording ${new Date().toLocaleDateString()}.${x}`,{type:p.type||"video/mp4"});s("/videos?upload=true",{state:{nativeCapturedFile:g}})};return r.jsx("nav",{className:"fixed left-0 right-0 z-[100] bg-background border-t border-border/50 shadow-[0_-4px_20px_rgba(0,0,0,0.1)]",style:{bottom:0,paddingBottom:"env(safe-area-inset-bottom, 0px)",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",position:"fixed"},children:r.jsxs("div",{className:"flex items-center justify-around h-16 px-2",children:[r.jsxs(IR,{to:"/videos",className:"flex flex-col items-center justify-center gap-1 px-3 py-2 rounded-xl transition-all duration-200 text-muted-foreground hover:text-primary touch-target active-scale touch-manipulation",activeClassName:"text-primary bg-primary/10",children:[r.jsx(bi,{className:"h-5 w-5"}),r.jsx("span",{className:"text-[10px] font-medium",children:"Videos"})]}),r.jsxs("button",{onClick:u,"aria-label":o?l:"Record video",title:o?l:void 0,className:"relative flex flex-col items-center justify-center -mt-6 touch-manipulation active-scale",children:[r.jsxs("div",{className:"relative",children:[!
1096o&&r.jsx("div",{className:"absolute inset-0 bg-primary rounded-full blur-md opacity-50 animate-pulse"}),r.jsx("div",{className:`relative w-14 h-14 rounded-full flex items-center justify-center shadow-lg border-4 border-background ${o?"bg-muted":"bg-primary"}`,children:o?r.jsx(Ni,{className:"h-5 w-5 text-muted-foreground"}):r.jsx(cr,{className:"h-6 w-6 text-primary-foreground"})})]}),r.jsx("span",{className:`text-[10px] font-medium mt-1 ${o?"text-muted-foreground":"text-primary"}`,children:o?"Limit reached":"Record"}),_r()&&!o&&r.jsx("input",{ref:i,type:"file",accept:"video/*",capture:"user",onChange:m,"aria-label":"Record video",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",style:{fontSize:0}})]}),r.jsxs(IR,{to:"/settings",className:"flex flex-col items-center justify-center gap-1 px-2 py-2 rounded-xl transition-all duration-200 text-muted-foreground hover:text-primary touch-target active-scale touch-manipulation",activeClassName:"text-primary bg-primary/10",children:[r.jsx(Vm,{className:"h-5 w-5"}),r.jsx("span",{className:"text-[10px] font-medium",children:"Settings"})]})]})})};function CCe({children:e}){return r.jsx(r.Fragment,{children:e})}const kCe="https://chromewebstore.google.com/detail/vidareo-screen-recorder-v/lmaaoeofdlnjfenacdmdffepkniggkng",ECe="https://vidareo.com/dashboard",ACe={"mobile-record-yourself":{icon:qc,title:"Record yourself on the go",description:"Get the VIDAREO mobile app to record yourself with your phone's camera - anywhere, anytime.",benefits:["Record using your phone's front or rear camera","Upload and share instantly from your library","Push notifications when viewers watch your videos"]},"mobile-screen":{icon:xue,title:"Screen recording is desktop only",description:"Screen recording is only available on desktop. Open VIDAREO on your computer to record your screen.",benefits:[]},"mobile-presentation":{icon:kf,title:"Presentations are desktop-only",description:"Upload your slide deck and record over it from a desktop browser - open VIDAREO on your computer to get started.",benefits:["Upload PDF or PowerPoint decks","Record yourself over your slides","Auto-titled with AI when you're done"]},extension:{icon:Vs,title:"Install the Chrome Extension",description:"Screen recording uses our free Chrome extension for the best quality and reliability.",benefits:["Record any tab - even outside VIDAREO","Longer sessions, up to 60 minutes","Floating camera bubble across tabs","Capture screen + tab audio with one click"]}},xQ=({open:e,onOpenChange:t,variant:n})=>{const{icon:s,title:a,description:i,benefits:o}=ACe[n];return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-2",children:r.jsx(s,{className:"w-6 h-6 text-primary"})}),r.jsx(Mt,{children:a}),r.jsx($r,{children:i})]}),r.jsx("ul",{className:"space-y-2 py-2",children:o.map(l=>r.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[r.jsx(nt,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),r.jsx("span",{children:l})]},l))}),n==="mobile-record-yourself"&&r.jsxs(Fr,{className:"flex-col gap-2 sm:flex-col sm:space-x-0",children:[r.jsx(P,{asChild:!0,className:"w-full gap-1.5",children:r.jsxs("a",{href:g5,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),children:[r.jsx(eue,{className:"w-4 h-4"}),"Download iOS app"]})}),r.jsx(P,{asChild:!0,variant:"outline",className:"w-full gap-1.5",children:r.jsxs("a",{href:Tye,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),children:[r.jsx(qc,{className:"w-4 h-4"}),"Download Android app"]})}),r.jsx(P,{variant:"ghost",onClick:()=>t(!1),className:"w-full",children:"Maybe later"})]}),n==="mobile-screen"&&r.jsx(Fr,{className:"flex-col gap-2 sm:flex-col sm:space-x-0",children:r.jsx(P,{onClick:()=>t(!1),className:"w-full",children:"Got it"})}),n==="mobile-presentation"&&r.jsxs(Fr,{className:"flex-col gap-2 sm:flex-col sm:space-x-0",children:[r.jsx(P,{onClick:()=>t(!1),className:"w-full",children:"Got it"}),r.jsxs("p",{className:"text-[11px] text-muted-foreground text-center",children:["Visit ",ECe.replace("https://","")," from your computer."]})]}),n==="extension"&&r.jsxs(Fr,{className:"gap-2 sm:gap-2",children:[r.jsx(P,{variant:"ghost",onClick:()=>t(!1),children:"Maybe later"}),r.jsx(P,{asChild:!0,className:"gap-1.5",children:r.jsxs("a",{href:kCe,target:"_blank",rel:"noopener noreferrer",onClick:()=>
vendor: 14,205 bytes, line 1096
1096t(!1),children:["Install Extension ",r.jsx(bn,{className:"w-4 h-4"})]})})]})]})})};var LR=["Enter"," "],TCe=["ArrowDown","PageUp","Home"],gQ=["ArrowUp","PageDown","End"],RCe=[...TCe,...gQ],OCe={ltr:[...LR,"ArrowRight"],rtl:[...LR,"ArrowLeft"]},PCe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ew="Menu",[s0,DCe,MCe]=Qm(Ew),[ap,vQ]=Ss(Ew,[MCe,Wc,sh]),m2=Wc(),yQ=sh(),[ICe,ip]=ap(Ew),[LCe,Aw]=ap(Ew),bQ=e=>{const{__scopeMenu:t,open:n=!1,children:s,dir:a,onOpenChange:i,modal:o=!0}=e,l=m2(t),[c,d]=h.useState(null),u=h.useRef(!1),m=Dn(i),f=Yc(a);return h.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),r.jsx(hw,{...l,children:r.jsx(ICe,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:d,children:r.jsx(LCe,{scope:t,onClose:h.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:u,dir:f,modal:o,children:s})})})};bQ.displayName=Ew;var $Ce="MenuAnchor",vD=h.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,a=m2(n);return r.jsx(fv,{...a,...s,ref:t})});vD.displayName=$Ce;var yD="MenuPortal",[VCe,wQ]=ap(yD,{forceMount:void 0}),jQ=e=>{const{__scopeMenu:t,forceMount:n,children:s,container:a}=e,i=ip(yD,t);return r.jsx(VCe,{scope:t,forceMount:n,children:r.jsx(_s,{present:n||i.open,children:r.jsx(ov,{asChild:!0,container:a,children:s})})})};jQ.displayName=yD;var ul="MenuContent",[UCe,bD]=ap(ul),NQ=h.forwardRef((e,t)=>{const n=wQ(ul,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,i=ip(ul,e.__scopeMenu),o=Aw(ul,e.__scopeMenu);return r.jsx(s0.Provider,{scope:e.__scopeMenu,children:r.jsx(_s,{present:s||i.open,children:r.jsx(s0.Slot,{scope:e.__scopeMenu,children:o.modal?r.jsx(FCe,{...a,ref:t}):r.jsx(BCe,{...a,ref:t})})})})}),FCe=h.forwardRef((e,t)=>{const n=ip(ul,e.__scopeMenu),s=h.useRef(null),a=Ht(t,s);return h.useEffect(()=>{const i=s.current;if(i)return z_(i)},[]),r.jsx(wD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),BCe=h.forwardRef((e,t)=>{const n=ip(ul,e.__scopeMenu);return r.jsx(wD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zCe=Dm("MenuContent.ScrollLock"),wD=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:m,onInteractOutside:f,onDismiss:p,disableOutsideScroll:x,...g}=e,v=ip(ul,n),y=Aw(ul,n),b=m2(n),w=yQ(n),S=DCe(n),[j,N]=h.useState(null),_=h.useRef(null),C=Ht(t,_,v.onContentChange),k=h.useRef(0),E=h.useRef(""),R=h.useRef(0),T=h.useRef(null),D=h.useRef("right"),A=h.useRef(0),V=x?bw:h.Fragment,U=x?{as:zCe,allowPinchZoom:!0}:void 0,O=$=>{var G,ee;const I=E.current+$,B=S().filter(re=>!re.disabled),K=document.activeElement,Z=(G=B.find(re=>re.ref.current===K))==null?void 0:G.textValue,q=B.map(re=>re.textValue),H=tke(q,I,Z),X=(ee=B.find(re=>re.textValue===H))==null?void 0:ee.ref.current;(function re(W){E.current=W,window.clearTimeout(k.current),W!==""&&(k.current=window.setTimeout(()=>re(""),1e3))})(I),X&&setTimeout(()=>X.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),F_();const M=h.useCallback($=>{var B,K;return D.current===((B=T.current)==null?void 0:B.side)&&nke($,(K=T.current)==null?void 0:K.area)},[]);return r.jsx(UCe,{scope:n,searchRef:E,onItemEnter:h.useCallback($=>{M($)&&$.preventDefault()},[M]),onItemLeave:h.useCallback($=>{var I;M($)||((I=_.current)==null||I.focus(),N(null))},[M]),onTriggerLeave:h.useCallback($=>{M($)&&$.preventDefault()},[M]),pointerGraceTimerRef:R,onPointerGraceIntentChange:h.useCallback($=>{T.current=$},[]),children:r.jsx(V,{...U,children:r.jsx(yw,{asChild:!0,trapped:a,onMountAutoFocus:We(i,$=>{var I;$.preventDefault(),(I=_.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:r.jsx(nu,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:m,onInteractOutside:f,onDismiss:p,children:r.jsx(K_,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:s,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:We(c,$=>{y.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(fw,{role:"menu","aria-orientation":"vertical","data-state":VQ(v.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:C,style:{outline:"none",...g.style},onKeyDown:We(g.onKeyDown,$=>{const B=$.target.closest("[data-radix-menu-content]")===$.currentTarget,K=$.ctrlKey||$.altKey||$.metaKey,Z=$.key.length===1;B&&($.key==="Tab"&&$.preventDefault(),!K&&Z&&O($.key));const q=_.current;if($.target!==q||!RCe.includes($.key))return;$.preventDefault();const X=S().filter(G=>!G.disabled).map(G=>G.ref.current);gQ.includes($.key)&&X.reverse(),JCe(X)}),onBlur:We(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(k.current),E.current="")}),onPointerMove:We(e.onPointerMove,a0($=>{const I=$.target,B=A.current!==$.clientX;if($.currentTarget.contains(I)&&B){const K=$.clientX>A.current?"right":"left";D.current=K,A.current=$.clientX}}))})})})})})})});NQ.displayName=ul;var qCe="MenuGroup",jD=h.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(ut.div,{role:"group",...s,ref:t})});jD.displayName=qCe;var HCe="MenuLabel",SQ=h.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(ut.div,{...s,ref:t})});SQ.displayName=HCe;var FN="MenuItem",PV="menu.itemSelect",h2=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:s,...a}=e,i=h.useRef(null),o=Aw(FN,e.__scopeMenu),l=bD(FN,e.__scopeMenu),c=Ht(t,i),d=h.useRef(!1),u=()=>{const m=i.current;if(!n&&m){const f=new CustomEvent(PV,{bubbles:!0,cancelable:!0});m.addEventListener(PV,p=>s==null?void 0:s(p),{once:!0}),Rb(m,f),f.defaultPrevented?d.current=!1:o.onClose()}};return r.jsx(_Q,{...a,ref:c,disabled:n,onClick:We(e.onClick,u),onPointerDown:m=>{var f;(f=e.onPointerDown)==null||f.call(e,m),d.current=!0},onPointerUp:We(e.onPointerUp,m=>{var f;d.current||(f=m.currentTarget)==null||f.click()}),onKeyDown:We(e.onKeyDown,m=>{const f=l.searchRef.current!=="";n||f&&m.key===" "||LR.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});h2.displayName=FN;var _Q=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:s=!1,textValue:a,...i}=e,o=bD(FN,n),l=yQ(n),c=h.useRef(null),d=Ht(t,c),[u,m]=h.useState(!1),[f,p]=h.useState("");return h.useEffect(()=>{const x=c.current;x&&p((x.textContent??"").trim())},[i.children]),r.jsx(s0.ItemSlot,{scope:n,disabled:s,textValue:a??f,children:r.jsx(X_,{asChild:!0,...l,focusable:!s,children:r.jsx(ut.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...i,ref:d,onPointerMove:We(e.onPointerMove,a0(x=>{s?o.onItemLeave(x):(o.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:We(e.onPointerLeave,a0(x=>o.onItemLeave(x))),onFocus:We(e.onFocus,()=>m(!0)),onBlur:We(e.onBlur,()=>m(!1))})})})}),WCe="MenuCheckboxItem",CQ=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:s,...a}=e;return r.jsx(RQ,{scope:e.__scopeMenu,checked:n,children:r.jsx(h2,{role:"menuitemcheckbox","aria-checked":BN(n)?"mixed":n,...a,ref:t,"data-state":SD(n),onSelect:We(a.onSelect,()=>s==null?void 0:s(BN(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CQ.displayName=WCe;var kQ="MenuRadioGroup",[YCe,GCe]=ap(kQ,{value:void 0,onValueChange:()=>{}}),EQ=h.forwardRef((e,t)=>{const{value:n,onValueChange:s,...a}=e,i=Dn(s);return r.jsx(YCe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:r.jsx(jD,{...a,ref:t})})});EQ.displayName=kQ;var AQ="MenuRadioItem",TQ=h.forwardRef((e,t)=>{const{value:n,...s}=e,a=GCe(AQ,e.__scopeMenu),i=n===a.value;return r.jsx(RQ,{scope:e.__scopeMenu,checked:i,children:r.jsx(h2,{role:"menuitemradio","aria-checked":i,...s,ref:t,"data-state":SD(i),onSelect:We(s.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,n)},{checkForDefaultPrevented:!1})})})});TQ.displayName=AQ;var ND="MenuItemIndicator",[RQ,KCe]=ap(ND,{checked:!1}),OQ=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:s,...a}=e,i=KCe(ND,n);return r.jsx(_s,{present:s||BN(i.checked)||i.checked===!0,children:r.jsx(ut.span,{...a,ref:t,"data-state":SD(i.checked)})})});OQ.displayName=ND;var XCe="MenuSeparator",PQ=h.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(ut.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});PQ.displayName=XCe;var ZCe="MenuArrow",DQ=h.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,a=m2(n);return r.jsx(pw,{...a,...s,ref:t})});DQ.displayName=ZCe;var QCe="MenuSub",[uit,MQ]=ap(QCe),Dy="MenuSubTrigger",IQ=h.forwardRef((e,t)=>{const n=ip(Dy,e.__scopeMenu),s=Aw(Dy,e.__scopeMenu),a=MQ(Dy,e.__scopeMenu),i=bD(Dy,e.__scopeMenu),o=h.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},u=h.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),r.jsx(vD,{asChild:!0,...d,children:r.jsx(_Q,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":VQ(n.open),...e,ref:lw(t,a.onTriggerChange),onClick:m=>{var f;(f=e.onClick)==null||f.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:We(e.onPointerMove,a0(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:We(e.onPointerLeave,a0(m=>{var p,x;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(x=n.content)==null?void 0:x.dataset.side,v=g==="right",y=v?-5:5,b=f[v?"left":"right"],w=f[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+y,y:m.clientY},{x:b,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:b,y:f.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:We(e.onKeyDown,m=>{var p;const f=i.searchRef.current!=="";e.disabled||f&&m.key===" "||OCe[s.dir].includes(m.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),m.preventDefault())})})})});IQ.displayName=Dy;var LQ="MenuSubContent",$Q=h.forwardRef((e,t)=>{const n=wQ(ul,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,i=ip(ul,e.__scopeMenu),o=Aw(ul,e.__scopeMenu),l=MQ(LQ,e.__scopeMenu),c=h.useRef(null),d=Ht(t,c);return r.jsx(s0.Provider,{scope:e.__scopeMenu,children:r.jsx(_s,{present:s||i.open,children:r.jsx(s0.Slot,{scope:e.__scopeMenu,children:r.jsx(wD,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var m;o.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:We(e.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:We(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:We(e.onKeyDown,u=>{var p;const m=u.currentTarget.contains(u.target),f=PCe[o.dir].includes(u.key);m&&f&&(i.onOpenChange(!1),(p=l.trigger)==null||p.focus(),u.preventDefault())})})})})})});$Q.displayName=LQ;function VQ(e){return e?"open":"closed"}function BN(e){return e==="indeterminate"}function SD(e){return BN(e)?"indeterminate":e?"checked":"unchecked"}function JCe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eke(e,t){return e.map((n,s)=>e[(t+s)%e.length])}function tke(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=eke(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function rke(e,t){const{x:n,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,m=c.x,f=c.y;u>s!=f>s&&n<(m-d)*(s-u)/(f-u)+d&&(a=!a)}return a}function nke(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rke(n,t)}function a0(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ske=bQ,ake=vD,ike=jQ,oke=NQ,lke=jD,cke=SQ,dke=h2,uke=CQ,mke=EQ,hke=TQ,fke=OQ,pke=PQ,xke=DQ,gke=IQ,vke=$Q,f2="DropdownMenu",[yke,mit]=Ss(f2,[vQ]),$i=vQ(),[bke,UQ]=yke(f2),FQ=e=>{const{__scopeDropdownMenu:t,children:n,dir:s,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=$i(t),d=h.useRef(null),[u,m]=Zs({prop:a,defaultProp:i??!1,onChange:o,caller:f2});return r.jsx(bke,{scope:t,triggerId:ji(),triggerRef:d,contentId:ji(),open:u,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(f=>!f),[m]),modal:l,children:r.jsx(ske,{...c,open:u,onOpenChange:m,dir:s,modal:l,children:n})})};FQ.displayName=f2;var BQ="DropdownMenuTrigger",zQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...a}=e,i=UQ(BQ,n),o=$i(n);return r.jsx(ake,{asChild:!0,...o,children:r.jsx(ut.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:lw(t,i.triggerRef),onPointerDown:We(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:We(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});zQ.displayName=BQ;var wke="DropdownMenuPortal",qQ=e=>{const{__scopeDropdownMenu:t,...n}=e,s=$i(t);return r.jsx(ike,{...s,...n})};qQ.displayName=wke;var HQ="DropdownMenuContent",WQ=h.forwardRef((e,t)=>
1096{const{__scopeDropdownMenu:n,...s}=e,a=UQ(HQ,n),i=$i(n),o=h.useRef(!1);return r.jsx(oke,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...s,ref:t,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:We(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;(!a.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});WQ.displayName=HQ;var jke="DropdownMenuGroup",Nke=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(lke,{...a,...s,ref:t})});Nke.displayName=jke;var Ske="DropdownMenuLabel",YQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(cke,{...a,...s,ref:t})});YQ.displayName=Ske;var _ke="DropdownMenuItem",GQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(dke,{...a,...s,ref:t})});GQ.displayName=_ke;var Cke="DropdownMenuCheckboxItem",KQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(uke,{...a,...s,ref:t})});KQ.displayName=Cke;var kke="DropdownMenuRadioGroup",Eke=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(mke,{...a,...s,ref:t})});Eke.displayName=kke;var Ake="DropdownMenuRadioItem",XQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(hke,{...a,...s,ref:t})});XQ.displayName=Ake;var Tke="DropdownMenuItemIndicator",ZQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(fke,{...a,...s,ref:t})});ZQ.displayName=Tke;var Rke="DropdownMenuSeparator",QQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(pke,{...a,...s,ref:t})});QQ.displayName=Rke;var Oke="DropdownMenuArrow",Pke=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(xke,{...a,...s,ref:t})});Pke.displayName=Oke;var Dke="DropdownMenuSubTrigger",JQ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(gke,{...a,...s,ref:t})});JQ.displayName=Dke;var Mke="DropdownMenuSubContent",eJ=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,a=$i(n);return r.jsx(vke,{...a,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eJ.displayName=Mke;var Ike=FQ,Lke=zQ,$ke=qQ,tJ=WQ,rJ=YQ,nJ=GQ,sJ=KQ,aJ=XQ,iJ=ZQ,oJ=QQ,lJ=JQ,cJ=eJ;const sl=Ike,al=Lke,Vke=h.forwardRef(({className:e,inset:t,children:n,...s},a)=>r.jsxs(lJ,{ref:a,className:ge("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...s,children:[n,r.jsx(Hl,{className:"ml-auto h-4 w-4"})]}));Vke.displayName=lJ.displayName;const Uke=h.forwardRef(({className:e,...t},n)=>r.jsx(cJ,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Uke.displayName=cJ.displayName;const So=h.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx($ke,{children:r.jsx(tJ,{ref:s,sideOffset:t,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1096de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));So.displayName=tJ.displayName;const tr=h.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(nJ,{ref:s,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));tr.displayName=nJ.displayName;const Fke=h.forwardRef(({className:e,children:t,checked:n,...s},a)=>r.jsxs(sJ,{ref:a,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...s,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(iJ,{children:r.jsx(nt,{className:"h-4 w-4"})})}),t]}));Fke.displayName=sJ.displayName;const Bke=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(aJ,{ref:s,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(iJ,{children:r.jsx(Ob,{className:"h-2 w-2 fill-current"})})}),t]}));Bke.displayName=aJ.displayName;const zke=h.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(rJ,{ref:s,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));zke.displayName=rJ.displayName;const bc=h.forwardRef(({className:e,...t},n)=>r.jsx(oJ,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));bc.displayName=oJ.displayName;var op="NavigationMenu",[_D,dJ,qke]=Qm(op),[$R,Hke,Wke]=Qm(op),[CD,hit]=Ss(op,[qke,Wke]),[Yke,xl]=CD(op),[Gke,Kke]=CD(op),uJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:s,onValueChange:a,defaultValue:i,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:d,...u}=e,[m,f]=h.useState(null),p=Ht(t,k=>f(k)),x=Yc(d),g=h.useRef(0),v=h.useRef(0),y=h.useRef(0),[b,w]=h.useState(!0),[S,j]=Zs({prop:s,onChange:k=>{const E=k!=="",R=l>0;E?(window.clearTimeout(y.current),R&&w(!1)):(window.clearTimeout(y.current),y.current=window.setTimeout(()=>w(!0),l)),a==null||a(k)},defaultProp:i??"",caller:op}),N=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>j(""),150)},[j]),_=h.useCallback(k=>{window.clearTimeout(v.current),j(k)},[j]),C=h.useCallback(k=>{S===k?window.clearTimeout(v.current):g.current=window.setTimeout(()=>{window.clearTimeout(v.current),j(k)},o)},[S,j,o]);return h.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(v.current),window.clearTimeout(y.current)},[]),r.jsx(mJ,{scope:n,isRootMenu:!0,value:S,dir:x,orientation:c,rootNavigationMenu:m,onTriggerEnter:k=>{window.clearTimeout(g.current),b?C(k):_(k)},onTriggerLeave:()=>{window.clearTimeout(g.current),N()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:N,onItemSelect:k=>{j(E=>E===k?"":k)},onItemDismiss:()=>j(""),children:r.jsx(ut.nav,{"aria-label":"Main","data-orientation":c,dir:x,...u,ref:p})})});uJ.displayName=op;var VR="NavigationMenuSub",Xke=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:s,onValueChange:a,defaultValue:i,orientation:o="horizontal",...l}=e,c=xl(VR,n),[d,u]=Zs({prop:s,onChange:a,defaultProp:i??"",caller:VR});return r.jsx(mJ,{scope:n,isRootMenu:!1,value:d,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:m=>u(m),onItemSelect:m=>u(m),onItemDismiss:()=>u(""),children:r.jsx(ut.div,{"data-orientation":o,...l,ref:t})})});Xke.displayName=VR;var mJ=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:s,dir:a,orientation:i,children:o,value:l,onItemSelect:c,onItemDismiss:d,onTriggerEnter:u,onTriggerLeave:m,onContentEnter:f,onContentLeave:p}=e,[x,g]=h.useState(null),[v,y]=h.useState(new Map),[b,w]=h.useState(null);return r.jsx(Yke,{scope:t,isRootMenu:n,rootNavigationMenu:s,value:l,previousValue:jv(l),baseId:ji(),dir:a,orientation:i,viewport:x,onViewportChange:g,indicatorTrack:b,onIndicatorTrackChange:w,onTriggerEnter:Dn(u),onTriggerLeave:Dn(m),onContentEnter:Dn(f),onContentLeave:Dn(p),onItemSelect:Dn(c),onItemDismiss:Dn(d),onViewportContentChange:h.useCallback((S,j)=>{y(N=>(N.set(S,j),new Map(N)))},[]),onViewportContentRemove:h.useCallback(S=>{y(j=>j.has(S)?(j.delete(S),new Map(j)):j)},[]),children:r.jsx(_D.Provider,{scope:t,children:r.jsx(Gke,{scope:t,items:v,children:o})})})},hJ="NavigationMenuList",fJ=h.forwardRef((e,t)=>
vendor: 4,200 bytes, line 1096
1096{const{__scopeNavigationMenu:n,...s}=e,a=xl(hJ,n),i=r.jsx(ut.ul,{"data-orientation":a.orientation,...s,ref:t});return r.jsx(ut.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:r.jsx(_D.Slot,{scope:n,children:a.isRootMenu?r.jsx(SJ,{asChild:!0,children:i}):i})})});fJ.displayName=hJ;var pJ="NavigationMenuItem",[Zke,xJ]=CD(pJ),gJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:s,...a}=e,i=ji(),o=s||i||"LEGACY_REACT_AUTO_VALUE",l=h.useRef(null),c=h.useRef(null),d=h.useRef(null),u=h.useRef(()=>{}),m=h.useRef(!1),f=h.useCallback((x="start")=>{if(l.current){u.current();const g=FR(l.current);g.length&&AD(x==="start"?g:g.reverse())}},[]),p=h.useCallback(()=>{if(l.current){const x=FR(l.current);x.length&&(u.current=sEe(x))}},[]);return r.jsx(Zke,{scope:n,value:o,triggerRef:c,contentRef:l,focusProxyRef:d,wasEscapeCloseRef:m,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:p,onContentFocusOutside:p,children:r.jsx(ut.li,{...a,ref:t})})});gJ.displayName=pJ;var UR="NavigationMenuTrigger",vJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:s,...a}=e,i=xl(UR,e.__scopeNavigationMenu),o=xJ(UR,e.__scopeNavigationMenu),l=h.useRef(null),c=Ht(l,o.triggerRef,t),d=CJ(i.baseId,o.value),u=kJ(i.baseId,o.value),m=h.useRef(!1),f=h.useRef(!1),p=o.value===i.value;return r.jsxs(r.Fragment,{children:[r.jsx(_D.ItemSlot,{scope:n,value:o.value,children:r.jsx(_J,{asChild:!0,children:r.jsx(ut.button,{id:d,disabled:s,"data-disabled":s?"":void 0,"data-state":TD(p),"aria-expanded":p,"aria-controls":u,...a,ref:c,onPointerEnter:We(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:We(e.onPointerMove,zN(()=>{s||f.current||o.wasEscapeCloseRef.current||m.current||(i.onTriggerEnter(o.value),m.current=!0)})),onPointerLeave:We(e.onPointerLeave,zN(()=>{s||(i.onTriggerLeave(),m.current=!1)})),onClick:We(e.onClick,()=>{i.onItemSelect(o.value),f.current=p}),onKeyDown:We(e.onKeyDown,x=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];p&&x.key===v&&(o.onEntryKeyDown(),x.preventDefault())})})})}),p&&r.jsxs(r.Fragment,{children:[r.jsx(bH,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:x=>{const g=o.contentRef.current,v=x.relatedTarget,y=v===l.current,b=g==null?void 0:g.contains(v);(y||!b)&&o.onFocusProxyEnter(y?"start":"end")}}),i.viewport&&r.jsx("span",{"aria-owns":u})]})]})});vJ.displayName=UR;var Qke="NavigationMenuLink",DV="navigationMenu.linkSelect",yJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:s,onSelect:a,...i}=e;return r.jsx(_J,{asChild:!0,children:r.jsx(ut.a,{"data-active":s?"":void 0,"aria-current":s?"page":void 0,...i,ref:t,onClick:We(e.onClick,o=>{const l=o.target,c=new CustomEvent(DV,{bubbles:!0,cancelable:!0});if(l.addEventListener(DV,d=>a==null?void 0:a(d),{once:!0}),Rb(l,c),!c.defaultPrevented&&!o.metaKey){const d=new CustomEvent(_1,{bubbles:!0,cancelable:!0});Rb(l,d)}},{checkForDefaultPrevented:!1})})})});yJ.displayName=Qke;var kD="NavigationMenuIndicator",bJ=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=xl(kD,e.__scopeNavigationMenu),i=!!a.value;return a.indicatorTrack?IP.createPortal(r.jsx(_s,{present:n||i,children:r.jsx(Jke,{...s,ref:t})}),a.indicatorTrack):null});bJ.displayName=kD;var Jke=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...s}=e,a=xl(kD,n),i=dJ(n),[o,l]=h.useState(null),[c,d]=h.useState(null),u=a.orientation==="horizontal",m=!!a.value;h.useEffect(()=>{var g;const x=(g=i().find(v=>v.value===a.value))==null?void 0:g.ref.current;x&&l(x)},[i,a.value]);const f=()=>{o&&d({size:u?o.offsetWidth:o.offsetHeight,offset:u?o.offsetLeft:o.offsetTop})};return BR(o,f),BR(a.indicatorTrack,f),c?r.jsx(ut.div,{"aria-hidden":!0,"data-state":m?"visible":"hidden","data-orientation":a.orientation,...s,ref:t,style:{position:"absolute",...u?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...s.style}}):null}),gg="NavigationMenuContent",wJ=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=xl(gg,e.__scopeNavigationMenu),i=xJ(gg,e.__scopeNavigationMenu),o=Ht(i.contentRef,t),l=i.value===a.value,c={value:i.value,triggerRef:i.triggerRef,focu
1096sProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...s};return a.viewport?r.jsx(eEe,{forceMount:n,...c,ref:o}):r.jsx(_s,{present:n||l,children:r.jsx(jJ,{"data-state":TD(l),...c,ref:o,onPointerEnter:We(e.onPointerEnter,a.onContentEnter),onPointerLeave:We(e.onPointerLeave,zN(a.onContentLeave)),style:{pointerEvents:!l&&a.isRootMenu?"none":void 0,...c.style}})})});wJ.displayName=gg;var eEe=h.forwardRef((e,t)=>{const n=xl(gg,e.__scopeNavigationMenu),{onViewportContentChange:s,onViewportContentRemove:a}=n;return js(()=>{s(e.value,{ref:t,...e})},[e,t,s]),js(()=>()=>a(e.value),[e.value,a]),null}),_1="navigationMenu.rootContentDismiss",jJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:s,triggerRef:a,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...d}=e,u=xl(gg,n),m=h.useRef(null),f=Ht(m,t),p=CJ(u.baseId,s),x=kJ(u.baseId,s),g=dJ(n),v=h.useRef(null),{onItemDismiss:y}=u;h.useEffect(()=>{const w=m.current;if(u.isRootMenu&&w){const S=()=>{var j;y(),l(),w.contains(document.activeElement)&&((j=a.current)==null||j.focus())};return w.addEventListener(_1,S),()=>w.removeEventListener(_1,S)}},[u.isRootMenu,e.value,a,y,l]);const b=h.useMemo(()=>{const S=g().map(E=>E.value);u.dir==="rtl"&&S.reverse();const j=S.indexOf(u.value),N=S.indexOf(u.previousValue),_=s===u.value,C=N===S.indexOf(s);if(!_&&!C)return v.current;const k=(()=>{if(j!==N){if(_&&N!==-1)return j>N?"from-end":"from-start";if(C&&j!==-1)return j>N?"to-start":"to-end"}return null})();return v.current=k,k},[u.previousValue,u.value,u.dir,g,s]);return r.jsx(SJ,{asChild:!0,children:r.jsx(nu,{id:x,"aria-labelledby":p,"data-motion":b,"data-orientation":u.orientation,...d,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const w=new Event(_1,{bubbles:!0,cancelable:!0});(S=m.current)==null||S.dispatchEvent(w)},onFocusOutside:We(e.onFocusOutside,w=>{var j;c();const S=w.target;(j=u.rootNavigationMenu)!=null&&j.contains(S)&&w.preventDefault()}),onPointerDownOutside:We(e.onPointerDownOutside,w=>{var _;const S=w.target,j=g().some(C=>{var k;return(k=C.ref.current)==null?void 0:k.contains(S)}),N=u.isRootMenu&&((_=u.viewport)==null?void 0:_.contains(S));(j||N||!u.isRootMenu)&&w.preventDefault()}),onKeyDown:We(e.onKeyDown,w=>{var N;const S=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!S){const _=FR(w.currentTarget),C=document.activeElement,k=_.findIndex(T=>T===C),R=w.shiftKey?_.slice(0,k).reverse():_.slice(k+1,_.length);AD(R)?w.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:We(e.onEscapeKeyDown,w=>{o.current=!0})})})}),ED="NavigationMenuViewport",NJ=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=!!xl(ED,e.__scopeNavigationMenu).value;return r.jsx(_s,{present:n||i,children:r.jsx(tEe,{...s,ref:t})})});NJ.displayName=ED;var tEe=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:s,...a}=e,i=xl(ED,n),o=Ht(t,i.onViewportChange),l=Kke(gg,e.__scopeNavigationMenu),[c,d]=h.useState(null),[u,m]=h.useState(null),f=c?(c==null?void 0:c.width)+"px":void 0,p=c?(c==null?void 0:c.height)+"px":void 0,x=!!i.value,g=x?i.value:i.previousValue;return BR(u,()=>{u&&d({width:u.offsetWidth,height:u.offsetHeight})}),r.jsx(ut.div,{"data-state":TD(x),"data-orientation":i.orientation,...a,ref:o,style:{pointerEvents:!x&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":p,...a.style},onPointerEnter:We(e.onPointerEnter,i.onContentEnter),onPointerLeave:We(e.onPointerLeave,zN(i.onContentLeave)),children:Array.from(l.items).map(([y,{ref:b,forceMount:w,...S}])=>{const j=g===y;return r.jsx(_s,{present:w||j,children:r.jsx(jJ,{...S,ref:lw(b,N=>{j&&N&&m(N)})})},y)})})}),rEe="FocusGroup",SJ=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...s}=e,a=xl(rEe,n);return r.jsx($R.Provider,{scope:n,children:r.jsx($R.Slot,{scope:n,children:r.jsx(ut.div,{dir:a.dir,...s,ref:t})})})}),MV=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],nEe="FocusGroupItem",_J=h.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...s}=e,a=Hke(n),i=xl(nEe,n);return r.jsx($R.ItemSlot,{scope:n,children:r.jsx(ut.button,{...s,ref:t,onKeyDown:We(e.onKeyDown,o=>{if(["Home","End",...MV].includes(o.key)){let c=a().map(m=>m.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),MV.includes(o.key)){const m=c.indexOf(o.currentTarget);c=c.slice(m+1)}setTimeout(()=>AD(c)),o.preventDefault()}})})})});function FR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function AD(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function sEe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function BR(e,t){const n=Dn(t);js(()=>{let s=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(s),a.unobserve(e)}}},[e,n])}function TD(e){return e?"open":"closed"}function CJ(e,t){return`${e}-trigger-${t}`}function kJ(e,t){return`${e}-content-${t}`}function zN(e){return t=>t.pointerType==="mouse"?e(t):void 0}var EJ=uJ,AJ=fJ,aEe=gJ,TJ=vJ,iEe=yJ,RJ=bJ,OJ=wJ,PJ=NJ;const DJ=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(EJ,{ref:s,className:ge("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,r.jsx(IJ,{})]}));DJ.displayName=EJ.displayName;const MJ=h.forwardRef(({className:e,...t},n)=>r.jsx(AJ,{ref:n,className:ge("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));MJ.displayName=AJ.displayName;const fE=aEe,oEe=Jm("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),C1=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(TJ,{ref:s,className:ge(oEe(),"group",e),...n,children:[t," ",r.jsx(Qs,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));C1.displayName=TJ.displayName;
1096const k1=h.forwardRef(({className:e,...t},n)=>r.jsx(OJ,{ref:n,className:ge("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));k1.displayName=OJ.displayName;const pE=iEe,IJ=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:ge("absolute left-0 top-full flex justify-center"),children:r.jsx(PJ,{className:ge("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));IJ.displayName=PJ.displayName;const lEe=h.forwardRef(({className:e,...t},n)=>r.jsx(RJ,{ref:n,className:ge("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:r.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));lEe.displayName=RJ.displayName;var RD="Progress",OD=100,[cEe,fit]=Ss(RD),[dEe,uEe]=cEe(RD),LJ=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:s=null,max:a,getValueLabel:i=mEe,...o}=e;(a||a===0)&&!IV(a)&&console.error(hEe(`${a}`,"Progress"));const l=IV(a)?a:OD;s!==null&&!LV(s,l)&&console.error(fEe(`${s}`,"Progress"));const c=LV(s,l)?s:null,d=qN(c)?i(c,l):void 0;return r.jsx(dEe,{scope:n,value:c,max:l,children:r.jsx(ut.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":qN(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":UJ(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});LJ.displayName=RD;var $J="ProgressIndicator",VJ=h.forwardRef((e,t)=>{const{__scopeProgress:n,...s}=e,a=uEe($J,n);return r.jsx(ut.div,{"data-state":UJ(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...s,ref:t})});VJ.displayName=$J;function mEe(e,t){return`${Math.round(e/t*100)}%`}function UJ(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function qN(e){return typeof e=="number"}function IV(e){return qN(e)&&!isNaN(e)&&e>0}function LV(e,t){return qN(e)&&!isNaN(e)&&e<=t&&e>=0}function hEe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${OD}\`.`}function fEe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1097  - a positive number
1098  - less than the value passed to \`max\` (or ${OD} if no \`max\` prop is set)
1099  - \`null\` or \`undefined\` if the progress is indeterminate.
1100
1101Defaulting to \`null\`.`}var FJ=LJ,pEe=VJ;const Lc=h.forwardRef(({className:e,value:t,...n},s)=>r.jsx(FJ,{ref:s,className:ge("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:r.jsx(pEe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Lc.displayName=FJ.displayName;function xEe(e,t){return h.useReducer((n,s)=>t[n][s]??n,e)}var PD="ScrollArea",[BJ,pit]=Ss(PD),[gEe,gl]=BJ(PD),zJ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:s="hover",dir:a,scrollHideDelay:i=600,...o}=e,[l,c]=h.useState(null),[d,u]=h.useState(null),[m,f]=h.useState(null),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,b]=h.useState(0),[w,S]=h.useState(0),[j,N]=h.useState(!1),[_,C]=h.useState(!1),k=Ht(t,R=>c(R)),E=Yc(a);return r.jsx(gEe,{scope:n,type:s,dir:E,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:m,onContentChange:f,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:j,onScrollbarXEnabledChange:N,scrollbarY:g,onScrollbarYChange:v,scrollbarYEnabled:_,onScrollbarYEnabledChange:C,onCornerWidthChange:b,onCornerHeightChange:S,children:r.jsx(ut.div,{dir:E,...o,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});zJ.displayName=PD;var qJ="ScrollAreaViewport",HJ=h.forwardRef((e,t)=>
vendor: 8,597 bytes, line 1101
1101{const{__scopeScrollArea:n,children:s,nonce:a,...i}=e,o=gl(qJ,n),l=h.useRef(null),c=Ht(t,l,o.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),r.jsx(ut.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:r.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});HJ.displayName=qJ;var Gc="ScrollAreaScrollbar",DD=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=gl(Gc,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=e.orientation==="horizontal";return h.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?r.jsx(vEe,{...s,ref:t,forceMount:n}):a.type==="scroll"?r.jsx(yEe,{...s,ref:t,forceMount:n}):a.type==="auto"?r.jsx(WJ,{...s,ref:t,forceMount:n}):a.type==="always"?r.jsx(MD,{...s,ref:t}):null});DD.displayName=Gc;var vEe=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=gl(Gc,e.__scopeScrollArea),[i,o]=h.useState(!1);return h.useEffect(()=>{const l=a.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),o(!0)},u=()=>{c=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[a.scrollArea,a.scrollHideDelay]),r.jsx(_s,{present:n||i,children:r.jsx(WJ,{"data-state":i?"visible":"hidden",...s,ref:t})})}),yEe=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=gl(Gc,e.__scopeScrollArea),i=e.orientation==="horizontal",o=x2(()=>c("SCROLL_END"),100),[l,c]=xEe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,c]),h.useEffect(()=>{const d=a.viewport,u=i?"scrollLeft":"scrollTop";if(d){let m=d[u];const f=()=>{const p=d[u];m!==p&&(c("SCROLL"),o()),m=p};return d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[a.viewport,i,c,o]),r.jsx(_s,{present:n||l!=="hidden",children:r.jsx(MD,{"data-state":l==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:We(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:We(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),WJ=h.forwardRef((e,t)=>{const n=gl(Gc,e.__scopeScrollArea),{forceMount:s,...a}=e,[i,o]=h.useState(!1),l=e.orientation==="horizontal",c=x2(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?d:u)}},10);return vg(n.viewport,c),vg(n.content,c),r.jsx(_s,{present:s||i,children:r.jsx(MD,{"data-state":i?"visible":"hidden",...a,ref:t})})}),MD=h.forwardRef((e,t)=>{const{orientation:n="vertical",...s}=e,a=gl(Gc,e.__scopeScrollArea),i=h.useRef(null),o=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ZJ(l.viewport,l.content),u={...s,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function m(f,p){return _Ee(f,o.current,l,p)}return n==="horizontal"?r.jsx(bEe,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollLeft,p=$V(f,l,a.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{a.viewport&&(a.viewport.scrollLeft=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollLeft=m(f,a.dir))}}):n==="vertical"?r.jsx(wEe,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollTop,p=$V(f,l);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{a.viewport&&(a.viewport.scrollTop=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollTop=m(f))}}):null}),bEe=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:s,...a}=e,i=gl(Gc,e.__scopeScrollArea),[o,l]=h.useState(),c=h.useRef(null),d=Ht(t,c,i.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),r.jsx(GJ,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":p2(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,m)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),JJ(f,m)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&s({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:WN(o.paddingLeft),paddingEnd:WN(o.paddingRight)}})}})}),wEe=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:s,...a}=e,i=gl(Gc,e.__scopeScrollArea),[o,l]=h.useState(),c=h.useRef(null),d=Ht(t,c,i.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),r.jsx(GJ,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":p2(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,m)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),JJ(f,m)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&s({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:WN(o.paddingTop),paddingEnd:WN(o.paddingBottom)}})}})}),[jEe,YJ]=BJ(Gc),GJ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:m,...f}=e,p=gl(Gc,n),[x,g]=h.useState(null),v=Ht(t,k=>g(k)),y=h.useRef(null),b=h.useRef(""),w=p.viewport,S=s.content-s.viewport,j=Dn(u),N=Dn(c),_=x2(m,10);function C(k){if(y.current){const E=k.clientX-y.current.left,R=k.clientY-y.current.top;d({x:E,y:R})}}return h.useEffect(()=>{const k=E=>{const R=E.target;(x==null?void 0:x.contains(R))&&j(E,S)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,x,S,j]),h.useEffect(N,[s,N]),vg(x,_),vg(p.content,_),r.jsx(jEe,{scope:n,scrollbar:x,hasThumb:a,onThumbChange:Dn(i),onThumbPointerUp:Dn(o),onThumbPositionChange:N,onThumbPointerDown:Dn(l),children:r.jsx(ut.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:We(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=x.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(k))}),onPointerMove:We(e.onPointerMove,C),onPointerUp:We(e.onPointerUp,k=>{const E=k.target;E.hasPointerCapture(k.pointerId)&&E.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=b.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),HN="ScrollAreaThumb",KJ=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=YJ(HN,e.__scopeScrollArea);return r.jsx(_s,{present:n||a.hasThumb,children:r.jsx(NEe,{ref:t,...s})})}),NEe=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:s,...a}=e,i=gl(HN,n),o=YJ(HN,n),{onThumbPositionChange:l}=o,c=Ht(t,m=>o.onThumbChange(m)),d=h.useRef(void 0),u=x2(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const m=i.viewport;if(m){const f=()=>{if(u(),!d.current){const p=CEe(m,l);d.current=p,l()}};return l(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[i.viewport,u,l]),r.jsx(ut.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:We(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),x=m.clientX-p.left,g=m.clientY-p.top;o.onThumbPointerDown({x,y:g})}),onPointerUp:We(e.onPointerUp,o.onThumbPointerUp)})});KJ.displayName=HN;var ID="ScrollAreaCorner",XJ=h.forwardRef((e,t)=>
1101{const n=gl(ID,e.__scopeScrollArea),s=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&s?r.jsx(SEe,{...e,ref:t}):null});XJ.displayName=ID;var SEe=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...s}=e,a=gl(ID,n),[i,o]=h.useState(0),[l,c]=h.useState(0),d=!!(i&&l);return vg(a.scrollbarX,()=>{var m;const u=((m=a.scrollbarX)==null?void 0:m.offsetHeight)||0;a.onCornerHeightChange(u),c(u)}),vg(a.scrollbarY,()=>{var m;const u=((m=a.scrollbarY)==null?void 0:m.offsetWidth)||0;a.onCornerWidthChange(u),o(u)}),d?r.jsx(ut.div,{...s,ref:t,style:{width:i,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function WN(e){return e?parseInt(e,10):0}function ZJ(e,t){const n=e/t;return isNaN(n)?0:n}function p2(e){const t=ZJ(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-n)*t;return Math.max(s,18)}function _Ee(e,t,n,s="ltr"){const a=p2(n),i=a/2,o=t||i,l=a-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,u=n.content-n.viewport,m=s==="ltr"?[0,u]:[u*-1,0];return QJ([c,d],m)(e)}function $V(e,t,n="ltr"){const s=p2(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,l=i-s,c=n==="ltr"?[0,o]:[o*-1,0],d=Xb(e,c);return QJ([0,o],[0,l])(d)}function QJ(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(n-e[0])}}function JJ(e,t){return e>0&&e<t}var CEe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},s=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,l=n.top!==i.top;(o||l)&&t(),n=i,s=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(s)};function x2(e,t){const n=Dn(e),s=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(s.current),[]),h.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(n,t)},[n,t])}function vg(e,t){const n=Dn(t);js(()=>{let s=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(s),a.unobserve(e)}}},[e,n])}var eee=zJ,kEe=HJ,EEe=XJ;const Io=h.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(eee,{ref:s,className:ge("relative overflow-hidden",e),...n,children:[r.jsx(kEe,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(tee,{}),r.jsx(EEe,{})]}));Io.displayName=eee.displayName;const tee=h.forwardRef(({className:e,orientation:t="vertical",...n},s)=>r.jsx(DD,{ref:s,orientation:t,className:ge("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:r.jsx(KJ,{className:"relative flex-1 rounded-full bg-border"})}));tee.displayName=DD.displayName;const xE=()=>{const{user:e}=nr(),{toast:t}=Gr(),n=Sr(),[s,a]=h.useState([]),[i,o]=h.useState(0),[l,c]=h.useState(!1),[d,u]=h.useState(!1),m=S=>{var _,C;const j=(_=S.data)==null?void 0:_.share_token,N=(C=S.data)==null?void 0:C.room_code;j?(S.is_read||p(S.id),c(!1),window.open(`/share/${j}`,"_blank","noopener,noreferrer")):N&&(S.is_read||p(S.id),c(!1),n(`/meet/${N}`))};h.useEffect(()=>{if(e){f();const S=F.channel(`notifications-${e.id}-${Math.random().toString(36).slice(2)}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"notifications",filter:`user_id=eq.${e.id}`},j=>{const N=j.new;a(_=>[N,..._]),o(_=>_+1),t({title:N.title,description:N.message})}).subscribe();return()=>{F.removeChannel(S)}}},[e,t]),h.useEffect(()=>{l&&u(!1)},[l]);const f=async()=>{if(!e)return;const{data:S}=await F.from("notifications").select("*").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(20);if(S){const j=S.map(N=>({...N,data:N.data||{},is_read:N.is_read??!1}));a(j),o(j.filter(N=>!N.is_read).length)}},p=async S=>{await F.from("notifications").update({is_read:!0}).eq("id",S),a(j=>j.map(N=>N.id===S?{...N,is_read:!0}:N)),o(j=>Math.max(0,j-1))},x=async()=>{e&&(await F.from("notifications").update({is_read:!0}).eq("user_id",e.id).eq("is_read",!1),a(S=>S.map(j=>({...j,is_read:!0}))),o(0))},g=async S=>{const j=s.find(N=>N.id===S);await F.from("notifications").delete().eq("id",S),a(N=>N.filter(_=>_.id!==S)),j&&!j.is_read&&o(N=>Math.max(0,N-1))},v=async()=>{e&&(await F.from("notifications").delete().eq("user_id",e.id),a([]),o(0))},y=S=>{const j=new Date(S),_=new Date().getTime()-j.getTime(),C=Math.floor(_/6e4),k=Math.floor(C/60),E=Math.floor(k/24);return C<1?"Just now":C<60?`${C}m ago`:k<24?`${k}h ago`:E<7?`${E}d ago`:j.toLocaleDateString()},b=(S,j)=>{switch(S){case"video_view":return r.jsx(Js,{className:"w-4 h-4 text-blue-500"});case"meeting_reminder":return r.jsx(Ga,{className:"w-4 h-4 text-primary"});case"personal_room_visit":return r.jsx(HH,{className:"w-4 h-4 text-emerald-500"});case"video_milestone":return((j==null?void 0:j.milestone)||0)===100?r.jsx(Rue,{className:"w-4 h-4 text-green-500"}):r.jsx(Po,{className:"w-4 h-4 text-amber-500"});default:return r.jsx(zl,{className:"w-4 h-4 text-muted-foreground"})}},w=S=>S!=null&&S.milestone?S.milestone:null;return e?r.jsxs(Ad,{open:l,onOpenChange:c,children:[r.jsxs(wt,{open:d,onOpenChange:u,children:[r.jsx(vt,{asChild:!0,children:r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"ghost",size:"icon",className:"relative",children:[r.jsx(zl,{className:"w-5 h-5"}),i>0&&r.jsx("span",{className:"absolute -top-1 -right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center",children:i>9?"9+":i})]})})}),r.jsx(yt,{children:r.jsx("p",{children:"View notifications when viewers watch your videos"})})]}),r.jsxs(Tc,{align:"end",className:"w-80 p-0",children:[r.jsxs("div",{className:"p-3 border-b border-border flex items-center justify-between",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Notifications"}),r.jsxs("div",{className:"flex items-center gap-1",children:[i>0&&r.jsxs(P,{variant:"ghost",size:"sm",onClick:x,children:[r.jsx(nt,{className:"w-4 h-4 mr-1"}),"Mark all read"]}),s.length>0&&r.jsx(P,{variant:"ghost",size:"sm",onClick:v,className:"text-muted-foreground hover:text-destructive",children:r.jsx(Xr,{className:"w-4 h-4"})})]})]}),r.jsx(Io,{className:"h-80",children:s.length===0?r.jsxs("div",{className:"p-8 text-center text-muted-foreground",children:[r.jsx(zl,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No notifications yet"})]}):r.jsx(Ts,{children:s.map(S=>{var j,N,_,C;return r.jsx(fe.div,{initial:{opacity:0,x:-10}
1101,animate:{opacity:1,x:0},exit:{opacity:0,x:10},className:`p-3 border-b border-border last:border-0 hover:bg-muted/50 transition-colors ${S.is_read?"":"bg-primary/5"} ${(j=S.data)!=null&&j.share_token||(N=S.data)!=null&&N.room_code?"cursor-pointer":""}`,onClick:()=>m(S),children:r.jsxs("div",{className:"flex gap-3",children:[r.jsx("div",{className:"flex-shrink-0 mt-0.5",children:b(S.type,S.data)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:S.title}),r.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:S.message}),S.type==="video_milestone"&&w(S.data)&&r.jsxs("div",{className:"mt-2",children:[r.jsx(Lc,{value:w(S.data),className:"h-1.5"}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[w(S.data),"% watched"]})]}),S.type==="video_view"&&((_=S.data)==null?void 0:_.device)&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["📱 ",S.data.device," • 🌐 ",S.data.browser]}),r.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:y(S.created_at)}),((C=S.data)==null?void 0:C.share_token)&&r.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-primary",children:[r.jsx(bn,{className:"w-3 h-3"}),r.jsx("span",{className:"hidden sm:inline",children:"View"})]})]})]}),r.jsxs("div",{className:"flex flex-col gap-1",children:[!S.is_read&&r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:k=>{k.stopPropagation(),p(S.id)},children:r.jsx(nt,{className:"w-3 h-3"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:k=>{k.stopPropagation(),g(S.id)},children:r.jsx(zt,{className:"w-3 h-3"})})]})]})},S.id)})})})]})]}):null},ree=()=>{const{user:e}=nr(),[t,n]=h.useState(null),[s,a]=h.useState(!0);return h.useEffect(()=>{if(!e){n(null),a(!1);return}(async()=>{const{data:c}=await F.from("profiles").select("avatar_url").eq("user_id",e.id).maybeSingle();n((c==null?void 0:c.avatar_url)??null),a(!1)})();const l=F.channel(`avatar-${e.id}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"profiles",filter:`user_id=eq.${e.id}`},c=>{const d=c.new.avatar_url;n(d)}).subscribe();return()=>{F.removeChannel(l)}},[e]),{avatarUrl:t,loading:s,getInitials:o=>o?o.charAt(0).toUpperCase():"U",userId:e==null?void 0:e.id,userEmail:e==null?void 0:e.email}},AEe="/assets/legal-usecase-DxO4xBUX.png",TEe="/assets/realestate-usecase-5KXgslWC.png",REe="/assets/healthcare-usecase-CvryK2tK.png",OEe="/assets/teams-usecase-CBwX3R_R.png",PEe="/assets/sales-usecase-DmJBV1f7.png",DEe="/assets/training-usecase-CMtjNH85.png",MEe="/assets/marketing-usecase-tUqzLQ_p.png",IEe="/assets/videocalls-usecase-DOtoEeB2.png",LEe="/assets/education-usecase-BRLp0nFX.png",$Ee="/assets/customersuccess-usecase-BgKa2N4f.png",VEe="/assets/founders-usecase-C8VsFQoR.png",yg=[{slug:"sales-teams",icon:I4,title:"Sales Teams",subtitle:"Connect and close more deals",description:"Stand out in crowded inboxes with personalized video messages that build trust and genuine connections with prospects.",heroDescription:"Transform your sales outreach with personalized video messages that cut through inbox noise and build genuine connections with prospects.",benefits:["3x higher response rates than text emails","Personalized prospecting at scale","Real-time connection notifications","Know when prospects are ready to connect"],color:"from-blue-500/20 to-cyan-500/20",stats:{metric:"3x",label:"Higher response rates"},detailedBenefits:[{title:"Stand Out in Crowded Inboxes",description:"Video thumbnails catch attention and humanize your outreach, making prospects more likely to connect."},{title:"Build Trust Before the Call",description:"Let prospects see your face and hear your voice, creating connection before you even meet."},{title:"Know When to Connect",description:"Get notified the moment a prospect watches your video so you can reach out at the perfect time."},{title:"Scale Personal Connections",description:"Record once and personalize at scale with custom thumbnails and viewer insights."}],testimonial:{quote:"VIDAREO completely changed my connection game. I went from 5% response rates to over 25% 
1101in the first month.",author:"Sarah Chen",role:"Senior Account Executive"},heroImage:PEe},{slug:"async-teams",icon:Vs,title:"Teams & Async Communication",subtitle:"Stay connected without meetings",description:"Record screen walkthroughs, project updates, and team announcements that keep everyone connected on their own time.",heroDescription:"Eliminate unnecessary meetings and stay connected across time zones with async video updates that your team can watch when it works for them.",benefits:["Eliminate unnecessary status meetings","Stay connected across time zones","Screen recordings for walkthroughs","Searchable video library for your team"],color:"from-sky-500/20 to-blue-500/20",stats:{metric:"40%",label:"Less meetings"},detailedBenefits:[{title:"Eliminate Status Meetings",description:"Replace daily standups and status updates with quick video recordings everyone can watch async."},{title:"Connect Across Time Zones",description:"Stay connected with global teams without requiring everyone to be online at the same time."},{title:"Show, Don't Tell",description:"Screen recordings make complex topics easy to understand for your team."},{title:"Build a Knowledge Base",description:"Create a searchable library of video updates and walkthroughs your team can reference anytime."}],testimonial:{quote:"We cut our meeting time by 40% and our remote team feels more connected than ever.",author:"Marcus Johnson",role:"Engineering Manager"},heroImage:OEe},{slug:"live-video-calls",icon:cr,title:"Live Video Calls",subtitle:"Meet face-to-face, instantly",description:"Jump on a live video call with up to 4 attendees-no downloads, no friction. Perfect for quick syncs, client check-ins, and remote collaboration.",heroDescription:"Connect in real time with live video calls for up to 4 participants. No apps to install, no links to fumble-just instant face-to-face conversations right from your browser.",benefits:["Up to 4 participants per call","No downloads or installs required","Personal meeting links for easy scheduling","In-call chat and screen sharing"],color:"from-violet-500/20 to-purple-500/20",stats:{metric:"4",label:"Live participants"},detailedBenefits:[{title:"Instant Face-to-Face",description:"Launch a video call in seconds-share your personal link and meet without any setup or downloads."},{title:"Small Group Collaboration",description:"Designed for focused conversations with up to 4 attendees, ideal for quick syncs, 1-on-1s, and client calls."},{title:"Screen Sharing",description:"Share your screen during calls to walk through presentations, demos, or documents in real time."},{title:"Seamless Scheduling",description:"Share your personal meeting link or schedule calls in advance with calendar invites and reminders."}],testimonial:{quote:"VIDAREO Meet replaced our need for a separate video conferencing tool. Quick calls with clients have never been easier.",author:"Priya Kapoor",role:"Client Success Lead"},heroImage:IEe},{slug:"real-estate",icon:fue,title:"Real Estate",subtitle:"Create genuine connections with buyers",description:"Send virtual property tours, neighborhood walkthroughs, and personal follow-ups that make clients feel connected.",heroDescription:"Connect with buyers and sellers on a personal level with virtual tours, neighborhood insights, and personalized follow-ups that set you apart.",benefits:["Virtual property tour walkthroughs","Personalized buyer/seller updates","Stand out from competing agents","Build connections before showings"],color:"from-emerald-500/20 to-teal-500/20",stats:{metric:"47%",label:"Faster closings"},detailedBenefits:[{title:"Virtual Property Tours",description:"Walk buyers through properties remotely with personalized video tours that highlight key features."},{title:"Stand Out From Competition",description:"Video messages show your personality and dedication, helping you win listings over other agents."},{title:"Build Pre-Showing Connection",description:"Connect with clients before meetups so they already feel comfortable with you."},{title:"Personalized Market Updates",description:"Keep clients connected with video market updates and new listing alerts."}
1101],testimonial:{quote:"My listing presentations with video win 80% of the time. Clients love connecting with my personality before we meet.",author:"Jennifer Martinez",role:"Real Estate Agent"},heroImage:TEe},{slug:"training-onboarding",icon:zH,title:"Training & Onboarding",subtitle:"Connect new hires faster",description:"Create step-by-step tutorials, process documentation, and training libraries that help your team connect with knowledge anytime.",heroDescription:"Build a video training library that gets new hires connected faster and gives your team an always-available resource for processes and procedures.",benefits:["Reusable training video library","Screen-recorded SOPs and guides","New hire onboarding sequences","Knowledge base that scales with you"],color:"from-rose-500/20 to-red-500/20",stats:{metric:"60%",label:"Faster onboarding"},detailedBenefits:[{title:"Reusable Training Content",description:"Record once, train forever. Build a library of training videos that scales with your team."},{title:"Visual Process Documentation",description:"Screen recordings make SOPs and procedures crystal clear with step-by-step walkthroughs."},{title:"Consistent Onboarding",description:"Every new hire gets the same high-quality training experience, helping them connect with your culture."},{title:"Self-Service Learning",description:"Team members can find answers themselves without waiting for someone to explain."}],testimonial:{quote:"Onboarding used to take 3 weeks. With our video library, new hires connect with our culture in just one week.",author:"David Park",role:"Head of Operations"},heroImage:DEe},{slug:"customer-success",icon:hue,title:"Customer Success",subtitle:"Keep customers connected",description:"Improve retention with video check-ins, onboarding walkthroughs, and milestone celebrations that keep customers connected.",heroDescription:"Build stronger customer connections with personalized video touchpoints that increase retention and turn customers into advocates.",benefits:["Personalized onboarding experiences","Proactive connection messages","Feature adoption tutorials","Renewal and upsell conversations"],color:"from-cyan-500/20 to-sky-500/20",stats:{metric:"25%",label:"Reduced churn"},detailedBenefits:[{title:"Personalized Onboarding",description:"Welcome new customers with personal video walkthroughs that help them connect from day one."},{title:"Proactive Check-ins",description:"Send regular video touchpoints that show customers you care about their success."},{title:"Feature Adoption",description:"Create quick tutorial videos that help customers discover and adopt new features."},{title:"Renewal Conversations",description:"Make renewal discussions personal and build the case for continued partnership."}],testimonial:{quote:"Our NPS score increased 20 points after we started sending personalized video check-ins. Customers feel truly connected.",author:"Amanda Foster",role:"VP of Customer Success"},heroImage:$Ee},{slug:"founders-executives",icon:_n,title:"Founders & Executives",subtitle:"Lead with authentic connection",description:"Connect with investors, partners, team members, and key stakeholders through personal video messages that demonstrate leadership.",heroDescription:"Lead with authenticity by connecting personally with investors, partners, and your team through video messages that build trust and demonstrate vision.",benefits:["Investor updates and pitch follow-ups","All-hands announcements and culture","Partner connection building","Board and stakeholder communication"],color:"from-amber-500/20 to-orange-500/20",stats:{metric:"5x",label:"More memorable"},detailedBenefits:[{title:"Investor Connections",description:"Send personal updates to investors that keep them connected and excited about your progress."},{title:"Culture Building",description:"All-hands announcements and company updates that feel personal, connecting everyone at scale."},{title:"Partner Connections",description:"Build and maintain key partnerships with personal video touchpoints."},{title:"Board Communication",description:"Keep your board connected with video updates that convey context and enthusiasm."}],testimonial:{quote:"Video updates to my investors have completely changed our 
1101connection. They feel like true partners now.",author:"Michael Rivera",role:"CEO & Founder"},heroImage:VEe},{slug:"education-coaching",icon:uue,title:"Education & Coaching",subtitle:"Connect with learners through video",description:"Create personalized feedback, course introductions, and student support messages that enhance the learning connection.",heroDescription:"Transform the learning experience with personalized video feedback, course content, and student support that drives connection and outcomes.",benefits:["Personalized student feedback","Course welcome messages","Assignment walkthroughs","Office hours and Q&A"],color:"from-blue-500/20 to-cyan-500/20",stats:{metric:"40%",label:"Better engagement"},detailedBenefits:[{title:"Personalized Feedback",description:"Give students detailed video feedback that's more nuanced than written comments."},{title:"Course Introductions",description:"Welcome students with personal video messages that build excitement and connection."},{title:"Visual Explanations",description:"Walk through complex concepts with screen recordings that make learning easier."},{title:"Async Office Hours",description:"Answer student questions with video responses they can watch on their own time."}],testimonial:{quote:"Student connection doubled when I started using video feedback instead of written comments.",author:"Dr. Lisa Thompson",role:"Online Course Creator"},heroImage:LEe},{slug:"healthcare",icon:Vue,title:"Healthcare",subtitle:"Build patient trust and connection",description:"Send appointment reminders, follow-up care instructions, and wellness check-ins that help patients feel connected.",heroDescription:"Improve patient outcomes and satisfaction with video communications that build trust, improve compliance, and make healthcare more personal.",benefits:["Post-visit care instructions","Appointment preparation guides","Wellness program connection","Provider introduction videos"],color:"from-teal-500/20 to-cyan-500/20",stats:{metric:"60%",label:"Better compliance"},detailedBenefits:[{title:"Clear Care Instructions",description:"Post-visit video instructions that patients can review as many times as needed."},{title:"Appointment Preparation",description:"Help patients prepare for procedures with video guides that reduce anxiety."},{title:"Provider Introductions",description:"Let patients connect with their providers before appointments to build comfort and trust."},{title:"Wellness Connection",description:"Keep patients connected to wellness programs with personalized video check-ins."}],testimonial:{quote:"Patient compliance with post-visit instructions improved dramatically. Patients feel more connected to their care.",author:"Dr. Robert Kim",role:"Family Medicine Physician"},heroImage:REe},{slug:"legal-professional-services",icon:Mue,title:"Legal & Professional Services",subtitle:"Connect through clarity",description:"Walk clients through documents, explain legal processes, and provide updates in a format that builds understanding and connection.",heroDescription:"Build client trust and connection with video explanations that make complex legal and professional matters accessible and clear.",benefits:["Document review walkthroughs","Case status updates","Process explanations","Client onboarding"],color:"from-slate-500/20 to-gray-500/20",stats:{metric:"35%",label:"Fewer follow-up calls"},detailedBenefits:[{title:"Document Walkthroughs",description:"Walk clients through complex documents with screen recordings that explain key points."},{title:"Case Status Updates",description:"Keep clients connected with personal video updates that build confidence and trust."},{title:"Process Explanations",description:"Help clients understand complex processes with step-by-step video guides."},{title:"Client Onboarding",description:"Welcome new clients with personal video introductions that set expectations clearly."}],testimonial:{quote:"Clients feel more connected and understand their matters so much better with video explanations.",author:"Katherine Wells",role:"Managing Partner"},heroImage:AEe},{slug:"marketing-agencies",icon:Jy,title:"Marketing & Agencies",subtitle:"Win and connect with clients",description:"Deliver creative presentations, campaign reports, and client updates that showcase your work and strengthen connections.",heroDescription:"Win more pitches and keep clients connected with video presentations, campaign reports, and creative walkthroughs that showcase your agency's value.",benefits:["Proposal and pitch presentations","Campaign performance reviews","Creative concept explanations","Client connection nurturing"],color:"from-fuchsia-500/20 to-pink-500/20",stats:{metric:"2x",label:"Proposal win rate"},detailedBenefits:[{title:"Winning Proposals",description:"Video proposals let you present your ideas with the energy and context that text can't capture."},{title:"Campaign Reports",description:"Walk clients through performance data with video reports that tell the full story."},{title:"Creative Presentations",description:"Present concepts and designs with video walkthroughs that explain your creative thinking."},{title:"Client Connections",description:"Regular video touchpoints keep clients connected and strengthen partnerships."}],testimonial:{quote:"Our pitch win rate doubled after we started using video proposals. Clients love c
1101onnecting with our energy and approach.",author:"Chris Anderson",role:"Agency Owner"},heroImage:MEe}],UEe=e=>yg.find(t=>t.slug===e),pn=()=>{const[e,t]=h.useState(!1),n=Sr(),{openRecording:s}=bv(),a=ja(),{user:i,signOut:o,loading:l}=nr(),{isAdmin:c}=sp(),{subscriptionTier:d,isPremium:u,subscribed:m}=Jl(),{disabled:f,reasonText:p}=u2(i==null?void 0:i.id),x=v5(),{isExtensionAvailable:g}=yv(),[v,y]=h.useState(!1),[b,w]=h.useState("mobile-screen"),S=T=>{if(!f){if(x&&!lr()){if(T==="camera"){w("mobile-record-yourself"),y(!0);return}if(T==="screen"){w("mobile-screen"),y(!0);return}if(T==="presentation"){w("mobile-presentation"),y(!0);return}}if(T==="screen"&&!lr()&&!g){w("extension"),y(!0);return}s(T)}},{avatarUrl:j}=ree(),N=()=>d==="professional"?r.jsxs(Se,{variant:"default",className:"gap-1 bg-primary/90 hover:bg-primary text-xs",children:[r.jsx(ya,{className:"h-3 w-3"}),"Pro"]}):d==="team"?r.jsxs(Se,{variant:"default",className:"gap-1 bg-amber-500/90 hover:bg-amber-500 text-xs text-white",children:[r.jsx(Ms,{className:"h-3 w-3"}),"Team"]}):r.jsxs(Se,{variant:"secondary",className:"gap-1 text-xs",children:[r.jsx(_n,{className:"h-3 w-3"}),"Free"]}),_=[{name:"Features",href:"/features",icon:_n,description:"Explore all features"},{name:"Products",href:"/products",icon:kf,description:"Presentations, extension, calls, email"},{name:"How it Works",href:"/how-it-works",icon:zH,description:"See how it works"},...lr()?[]:[{name:"Pricing",href:"/pricing",icon:ya,description:"Plans for every need"}]],C=[{name:"About",href:"/about",icon:ql,description:"Learn about us"},{name:"FAQ",href:"/faq",icon:ff,description:"Common questions"},{name:"Contact",href:"/contact",icon:zr,description:"Get in touch"}],k=async()=>{await o(),t(!1)},E=T=>T[0].toUpperCase(),R=_r();return r.jsxs(r.Fragment,{children:[r.jsx("nav",{className:"fixed top-0 left-0 right-0 z-50 bg-background/80 ios-blur border-b-[3px] border-primary safe-area-top",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs("div",{className:"flex items-center justify-between h-14 sm:h-16 lg:h-20",children:[r.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[r.jsxs(Cr,{to:_r()?"/videos":i?"/dashboard":"/",className:"flex items-center gap-2 touch-manipulation",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:[r.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 rounded-xl overflow-hidden flex items-center justify-center",children:r.jsx("img",{src:ch,alt:"VIDAREO",className:"w-full h-full object-contain"})}),!i&&r.jsx("span",{className:"text-lg sm:text-xl font-bold text-foreground",children:"VIDAREO"})]}),i&&!R&&r.jsx("nav",{className:"hidden sm:flex items-center gap-0.5 ml-1 lg:ml-2",children:[{to:"/dashboard",label:"Dashboard",icon:XH},{to:"/videos",label:"Videos",icon:bi},{to:"/contacts",label:"Contacts",icon:jr},{to:"/mail",label:"Email",icon:zr},{to:"/analytics",label:"Analytics",icon:qd}].map(T=>{const D=a.pathname===T.to;return r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Cr,{to:T.to,className:`flex items-center gap-1.5 px-2 lg:px-3 py-1.5 rounded-lg text-xs lg:text-sm font-medium transition-colors ${D?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,"aria-label":T.label,children:[r.jsx(T.icon,{className:"w-4 h-4 lg:w-3.5 lg:h-3.5"}),r.jsx("span",{className:"hidden lg:inline",children:T.label})]})}),r.jsx(yt,{className:"lg:hidden",children:r.jsx("p",{children:T.label})})]},T.to)})})]}),!i&&!R&&r.jsx(DJ,{className:"hidden sm:flex",children:r.jsxs(MJ,{className:"gap-0.5 lg:gap-1",children:[r.jsxs(fE,{children:[r.jsx(C1,{className:"text-xs lg:text-sm text-muted-foreground hover:text-foreground transition-colors font-medium bg-transparent hover:bg-transparent data-[state=open]:bg-transparent px-2 lg:px-3",children:"Product"}),r.jsx(k1,{children:r.jsx("div",{className:"w-[280px] lg:w-[320px] p-2 lg:p-3 bg-popover",children:_.map(T=>{const D=T.icon;return r.jsx(pE,{asChild:!0,children:r.jsxs(Cr,{to:T.href,className:"flex items-center gap-3 p-2 lg:p-3 rounded-lg hover:bg-muted transition-colors group",children:[r.jsx("div",{className:"w-8 h-8 lg:w-9 lg:h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(D,{className:"w-4 h-4 lg:w-5 lg:h-5 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"font-medium text-foreground group-hover:text-primary transition-colors text-sm",children:T.name}),r.jsx("div",{className:"text-xs text-muted-foreground",children:T.description})]})]})},T.href)})})})]}),r.jsxs(fE,{children:[r.jsx(C1,{className:"text-xs lg:text-sm text-muted-foreground hover:text-foreground transition-colors font-medium bg-transparent hover:bg-transparent data-[state=open]:bg-transparent px-2 lg:px-3",children:"Use Cases"}),r.jsx(k1,{children:r.jsxs("div",{className:"w-[400px] lg:w-[500px] p-3 lg:p-4 bg-popover",children:[r.jsx("div",{className:"grid grid-cols-2 gap-1.5 lg:gap-2",children:yg.map(T=>{const D=T.icon;return r.jsx(pE,{asChild:!0,children:r.jsxs(Cr,{to:`/use-cases/${T.slug}`,className:"flex items-start gap-2 lg:gap-3 p-2 lg:p-3 rounded-lg hover:bg-muted transition-colors group",children:[r.jsx("div",{className:`w-8 h-8 lg:w-10 lg:h-10 rounded-lg bg-gradient-to-br ${T.color} flex items-center justify-center shrink-0`,children:r.jsx(D,{className:"w-4 h-4 lg:w-5 lg:h-5 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"font-medium text-foreground group-hover:text-primary transition-colors text-xs lg:text-sm",children:T.title}),r.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1 hidden lg:block",children:T.subtitle})]})]})},T.slug)})}),r.jsx("div",{className:"border-t border-border mt-2 lg:mt-3 pt-2 lg:pt-3",children:r.jsxs(Cr,{to:"/use-cases",className:"flex items-center justify-center gap-2 text-xs lg:text-sm font-medium text-primary hover:underline py-2",children:["View All Use Cases",r.jsx(Qs,{className:"w-4 h-4 rotate-[-90deg]"})]})})]})})]}),r.jsxs(fE,{children:[r.jsx(C1,{className:"text-xs lg:text-sm text-muted-foreground hover:text-foreground transition-colors font-medium bg-transparent hover:bg-transparent data-[state=open]:bg-transparent px-2 lg:px-3",children:"Company"}),r.jsx(k1,{children:r.jsx("div",{className:"w-[280px] lg:w-[320px] p-2 lg:p-3 bg-popover",children:C.map(T=>{const D=T.icon;return r.jsx(pE,{asChild:!0,children:r.jsxs(Cr,{to:T.href,className:"flex items-center gap-3 p-2 lg:p-3 rounded-lg hover:bg-muted transition-colors group",children:[r.jsx("div",{className:"w-8 h-8 lg:w-9 lg:h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(D,{className:"w-4 h-4 lg:w-5 lg:h-5 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"font-medium text-foreground group-hover:text-primary transition-colors text-sm",children:T.name}),r.jsx("div",{className:"text-xs text-muted-foreground",children:T.description})]})]})},T.href)})})})]})]})}),r.jsx("div",{className:`${R?"hidden":"hidden sm:flex"} items-center gap-2 lg:gap-4`,children:!l&&r.jsx(r.Fragment,{children:i?r.jsxs("div",{className:"flex items-center gap-2 lg:gap-3",children:[r.jsx(Se,{variant:"outline",className:`hidden lg:flex text-xs font-medium px-3 py-1 ${d==="professional"?"border-primary text-primary":d==="team"?"border-amber-500 text-amber-600":"border-border"}`,children:d==="professional"?"Pro Plan":d==="team"?"Team Plan":"Free Plan"}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsxs(P,{size:"sm",className:"text-xs font-semibold gap-1",children:[r.jsx(Ns,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"hidden lg:inline",children:"New Video"}),r.jsx("span",{className:"lg:hidden",children:"New"}),r.jsx(Qs,{className:"h-3 w-3 ml-0.5"})]})}),r.jsxs(So,{align:"end",className:"w-56",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(tr,{onClick:()=>S("camera"),disabled:f,children:[r.jsx(Cc,{className:"mr-2 h-4 w-4 text-primary"}),"Record Yourself"]})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:f?p:"Record using your camera and microphone"})})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(tr,{onClick:()=>S("screen"),disabled:f,children:[r.jsx(Vs,{className:"mr-2 h-4 w-4 text-primary"}),"Record Screen"]})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:f?p:x?"Open VIDAREO on desktop to record your screen":g?"Capture your screen for demos and walkthroughs":"Install the Chrome extension to record your screen"})})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(tr,{onClick:()=>S("presentation"),disabled:f,children:[r.jsx(kf,{className:"mr-2 h-4 w-4 text-primary"}),"Presentation"]})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:f?p:"Record over your slide deck"})})]}),r.jsx(bc,{}),u?r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(tr,{onClick:()=>n("/videos?upload=true"),children:[r.jsx(na,{className:"mr-2 h-4 w-4"}),"Upload Video"]})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:"Upload an existing video file"})})]}):r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("span",{children:r.jsxs(tr,{disabled:!0,className:"opacity-50 cursor-not-allowed",children:[r.jsx(na,{className:"mr-2 h-4 w-4"}),"Upload Video",r.jsx(Se,{className:"ml-auto text-[10px] px-1.5 py-0 bg-primary/90 text-primary-foreground",children:"Pro+"})]})})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:lr()?"Not available on your current plan":"Upgrade to Pro to upload existing videos"})})]}
1101),!R&&(u?r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(tr,{onClick:()=>n("/meet"),children:[r.jsx(og,{className:"mr-2 h-4 w-4"}),"Video Call"]})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:"Start or join a video call (up to 4 people)"})})]}):r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("span",{children:r.jsxs(tr,{disabled:!0,className:"opacity-50 cursor-not-allowed",children:[r.jsx(og,{className:"mr-2 h-4 w-4"}),"Video Call",r.jsx(Se,{className:"ml-auto text-[10px] px-1.5 py-0 bg-primary/90 text-primary-foreground",children:"Pro+"})]})})}),r.jsx(yt,{side:"left",children:r.jsx("p",{children:"Upgrade to Pro for video calls"})})]}))]})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"hidden lg:inline-flex h-9 w-9 lg:h-10 lg:w-10",onClick:()=>{var T;return(T=window.__vidareoStartTour)==null?void 0:T.call(window)},children:r.jsx(ff,{className:"h-4 w-4 lg:h-5 lg:w-5 text-muted-foreground"})})}),r.jsx(yt,{children:r.jsx("p",{children:"Take a guided tour of this page"})})]}),r.jsx(xE,{}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",className:"relative h-9 w-9 lg:h-10 lg:w-10 rounded-full",children:r.jsxs(an,{className:"h-8 w-8 lg:h-9 lg:w-9",children:[r.jsx(gn,{src:j||void 0,alt:"Profile avatar",className:"object-cover"}),r.jsx(on,{className:"bg-primary text-primary-foreground text-sm",children:E(i.email||"U")})]})})}),r.jsxs(So,{align:"end",className:"w-56",children:[r.jsxs("div",{className:"px-2 py-1.5 space-y-1.5",children:[r.jsx("p",{className:"text-sm font-medium",children:i.email}),N()]}),r.jsxs(tr,{onClick:()=>n("/profile"),children:[r.jsx(Cc,{className:"mr-2 h-4 w-4"}),"Profile"]}),r.jsxs(tr,{onClick:()=>n("/analytics"),children:[r.jsx(qd,{className:"mr-2 h-4 w-4"}),"Analytics"]}),r.jsxs(tr,{onClick:()=>n("/settings"),children:[r.jsx(Vm,{className:"mr-2 h-4 w-4"}),"Settings"]}),d==="team"&&r.jsxs(tr,{onClick:()=>n("/team"),children:[r.jsx(jr,{className:"mr-2 h-4 w-4"}),"Team"]}),r.jsxs(tr,{onClick:()=>n("/billing"),children:[r.jsx(vi,{className:"mr-2 h-4 w-4"}),"Billing"]}),!m&&!lr()&&r.jsxs(tr,{onClick:()=>n("/pricing"),children:[r.jsx(Po,{className:"mr-2 h-4 w-4"}),"Upgrade"]}),c&&r.jsxs(tr,{onClick:()=>n("/admin"),children:[r.jsx(mi,{className:"mr-2 h-4 w-4"}),"Admin Dashboard"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:k,children:[r.jsx(dN,{className:"mr-2 h-4 w-4"}),"Sign Out"]})]})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs(P,{variant:"outline",className:"border-2 font-semibold text-xs lg:text-sm px-3 lg:px-4",onClick:()=>n("/auth"),children:[r.jsx(_L,{className:"w-4 h-4 mr-1.5 lg:mr-2"}),"Sign In"]}),r.jsxs(P,{variant:"default",className:"font-semibold text-xs lg:text-sm px-3 lg:px-4",onClick:()=>n("/auth?mode=signup"),children:[r.jsx(lg,{className:"w-4 h-4 mr-1.5 lg:mr-2"}),r.jsx("span",{className:"hidden md:inline",children:"Get Started Free"}),r.jsx("span",{className:"md:hidden",children:"Start Free"})]})]})})}),r.jsxs("div",{className:`${R?"flex":"sm:hidden flex"} items-center gap-2`,children:[i&&(R?r.jsx(xE,{}):r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("div",{children:r.jsx(xE,{})})}),r.jsx(yt,{children:r.jsx("p",{children:"View notifications when viewers watch your videos"})})]})),r.jsx("button",{onClick:()=>t(!e),className:"p-3 -mr-2 text-foreground touch-manipulation active:bg-muted/50 rounded-lg transition-colors","aria-label":e?"Close menu":"Open menu",children:e?r.jsx(zt,{className:"w-6 h-6"}):r.jsx(Cue,{className:"w-6 h-6"})})]})]}),r.jsx(Ts,{children:e&&r.jsx(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:`${R?"":"sm:hidden"} border-t border-border`,children:r.jsx("div",{className:"py-4 space-y-1",children:i?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2 py-3 border-b border-border mb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:j||void 0,alt:"Profile avatar",className:"object-cover"}),r.jsx(on,{className:"bg-primary text-primary-foreground",children:E(i.email||"U")})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:i.email}),N()]})]})}),r.jsxs("button",{onClick:()=>{n("/profile"),t(!1)},className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(Cc,{className:"h-5 w-5"}),"Profile"]}),r.jsxs("button",{onClick:()=>{n("/settings"),t(!1)},className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(Vm,{className:"h-5 w-5"}),"Settings"]}),r.jsxs("button",{onClick:()=>{n("/billing"),t(!1)},className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(vi,{className:"h-5 w-5"}),"Billing"]}),!m&&!lr()&&r.jsxs("button",{onClick:()=>{n("/pricing"),t(!1)},className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(Po,{className:"h-5 w-5"}),"Upgrade"]}),c&&r.jsxs("button",{onClick:()=>{n("/admin"),t(!1)},className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(mi,{className:"h-5 w-5"}),"Admin Dashboard"]}),r.jsx("div",{className:"pt-2 border-t border-border mt-2",children:r.jsxs("button",{onClick:k,className:"flex items-center gap-3 w-full text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-3 px-2 rounded-lg touch-manipulation",children:[r.jsx(dN,{className:"h-5 w-5"}),"Sign Out"]})})]}):r.jsxs(r.Fragment,{children:[!lr()&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider px-2 py-1",children:"Product"}),_.map(T=>{const D=T.icon;return r.jsxs(Cr,{to:T.href,className:"flex items-center gap-3 text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-2.5 px-2 rounded-lg touch-manipulation",onClick:()=>t(!1),children:[r.jsx(D,{className:"h-4 w-4"}),T.name]},T.name)}),r.jsxs("div",{className:"border-t border-border my-2 pt-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider px-2 py-1",children:"Use Cases"}),yg.slice(0,5).map(T=>{const D=T.icon;return r.jsxs(Cr,{to:`/use-cases/${T.slug}`,className:"flex items-center gap-3 text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-2.5 px-2 rounded-lg touch-manipulation",onClick:()=>t(!1),children:[r.jsx(D,{className:"h-4 w-4"}),T.title]},T.slug)}),r.jsx(Cr,{to:"/use-cases",className:"block text-primary hover:underline font-medium py-2.5 px-2 touch-manipulation",onClick:()=>t(!1),children:"View All Use Cases →"})]}),r.jsxs("div",{className:"border-t border-border my-2 pt-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider px-2 py-1",children:"Company"}),C.map(T=>{const D=T.icon;return r.jsxs(Cr,{to:T.href,className:"flex items-center gap-3 text-muted-foreground hover:text-foreground active:bg-muted/50 transition-colors font-medium py-2.5 px-2 rounded-lg touch-manipulation",onClick:()=>t(!1),children:[r.jsx(D,{className:"h-4 w-4"}),T.name]},T.name)})]})]}),r.jsx("div",{className:"flex flex-col gap-3 pt-4",children:!l&&r.jsxs(r.Fragment,{children:[r.jsxs(P,{variant:"outline",className:"w-full min-h-[48px] touch-manipulation border-2 font-semibold",onClick:()=>{n("/auth"),t(!1)},children:[r.jsx(_L,{className:"w-4 h-4 mr-2"}),"Sign In"]}),r.jsxs(P,{variant:"default",className:"w-full min-h-[48px] touch-manipulation font-semibold",onClick:()=>{n("/auth"),t(!1)},children:[r.jsx(lg,{className:"w-4 h-4 mr-2"}),"Get Started Free"]})]})})]})})})})]})}),r.jsx(xQ,{open:v,onOpenChange:y,variant:b})]})},FEe="/assets/hero-midnight-studio-DqHcOcVU.jpg",nee="/assets/app-store-badge-CVyK0T4N.svg",see="/demo/vidareo-demo.mp4",aee="/demo/vidareo-demo-poster.jpg",BEe=({label:e="Watch Demo",className:t,variant:n="outline"})=>{const[s,a]=h.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsxs(P,{size:"lg",variant:n,onClick:()=>a(!0),className:t??"w-full sm:w-auto h-14 px-8 sm:px-10 rounded-2xl border-2 border-border text-foreground font-semibold hover:bg-muted transition-all",children:[r.jsx(Js,{className:"w-4 h-4"}),e]}),r.jsx(It,{open:s,onOpenChange:a,children:r.jsxs(Dt,{className:"max-w-4xl p-0 overflow-hidden bg-background border-border",children:[r.jsx(Mt,{className:"sr-only",children:"VIDAREO product demo"}),r.jsx($r,{className:"sr-only",children:"A short demo showing screen recording, the teleprompter, and live meetings in VIDAREO."}),s&&r.jsx("video",{src:see,poster:aee,controls:!0,autoPlay:!0,playsInl
1101ine:!0,className:"w-full h-auto bg-black"})]})})]})},zEe=[{value:"10+",label:"tools in one platform"},{value:"Free",label:"plan included"},{value:"14-day",label:"paid plan trial"},{value:"2 min",label:"to get started"}],qEe=[{icon:Vs,label:"Screen + camera"},{icon:ga,label:"Teleprompter"},{icon:og,label:"Live meetings"},{icon:kf,label:"Presentations"},{icon:$4,label:"Chrome extension"},{icon:qc,label:"iOS & Android"},{icon:qd,label:"Analytics"},{icon:dv,label:"Instant sharing"},{icon:A_,label:"Video editor"},{icon:zr,label:"Email built in"}],HEe=()=>{const e=Oye();return r.jsxs("section",{className:"relative min-h-[760px] overflow-hidden bg-secondary pt-14 sm:pt-16 lg:pt-20",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("img",{src:FEe,alt:"A sales professional recording a personalized video in a modern studio",width:1920,height:1080,fetchPriority:"high",className:"h-full w-full object-cover object-[72%_center] sm:object-[68%_center] lg:object-center"}),r.jsx("div",{className:"absolute inset-0 bg-[image:var(--hero-overlay)]"}),r.jsx("div",{className:"absolute inset-0 bg-[image:var(--hero-vignette)]"})]}),r.jsx("div",{className:"pointer-events-none absolute left-5 top-20 h-14 w-14 border-l border-t border-primary-foreground/20 sm:left-8 sm:top-24 lg:left-10 lg:top-28 lg:h-20 lg:w-20"}),r.jsx("div",{className:"pointer-events-none absolute right-5 top-20 h-14 w-14 border-r border-t border-primary-foreground/20 sm:right-8 sm:top-24 lg:right-10 lg:top-28 lg:h-20 lg:w-20"}),r.jsxs("div",{className:"relative flex min-h-[700px] w-full flex-col justify-between pt-12 sm:pt-16 lg:pt-20",children:[r.jsx("div",{className:"relative mx-auto flex w-full max-w-7xl flex-1 items-center px-5 py-10 sm:px-6 lg:px-8 lg:py-14",children:r.jsxs(fe.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},className:"max-w-3xl space-y-4 sm:space-y-5",children:[r.jsxs("div",{className:"inline-flex items-center gap-3 text-xs font-bold uppercase tracking-[0.18em] text-accent",children:[r.jsx("span",{className:"h-px w-9 bg-accent"}),"Humanizing Sales Outreach"]}),r.jsxs("h1",{className:"max-w-3xl font-display text-4xl font-bold leading-[1.02] text-primary-foreground sm:text-5xl md:text-6xl lg:text-[4.25rem]",children:["Personalized video messaging"," ",r.jsx("span",{className:"text-primary",children:"for sales teams."})]}),r.jsx("p",{className:"max-w-2xl text-base leading-relaxed text-[hsl(var(--hero-muted))] sm:text-lg lg:text-xl",children:"Move beyond the inbox. VIDAREO combines screen recording, async video messages, live meetings, and a built-in teleprompter so your team builds real human connections and closes deals faster. Start with a free account, or try every paid feature free for 14 days."}),r.jsxs(Cr,{to:"/pricing",className:"inline-flex items-center gap-2 border-b border-accent/70 pb-1 text-sm font-semibold text-accent transition-colors hover:text-primary-foreground",children:[r.jsx(_n,{className:"w-4 h-4"}),"14-day free trial on paid plans"]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4",children:[r.jsx(Cr,{to:"/auth?mode=signup",className:"w-full sm:w-auto",children:r.jsxs(P,{size:"lg",className:"w-full rounded-sm px-8 font-bold sm:w-auto sm:px-10",children:[r.jsx(lg,{className:"w-5 h-5 transition-transform group-hover:-rotate-12"}),"Start Free Plan",r.jsx(Ya,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),r.jsx(BEe,{label:"Watch Demo",className:"h-14 w-full rounded-sm border border-primary-foreground/35 bg-primary-foreground/10 px-8 font-bold text-primary-foreground backdrop-blur-md hover:bg-primary-foreground/20 sm:w-auto sm:px-10"}),r.jsx(Cr,{to:"/auth",className:"w-full sm:w-auto",children:r.jsx(P,{size:"lg",variant:"ghost",className:"h-14 w-full rounded-sm px-6 font-bold text-primary-foreground hover:bg-primary-foreground/10 hover:text-primary-foreground sm:w-auto",children:"Sign In"})})]}),r.jsx("p",{className:"-mt-2 text-sm text-[hsl(var(--hero-muted))]",children:"Free account included · 14-d
1101ay free trial on paid plans"}),e&&r.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-3",children:[r.jsx("a",{href:g5,target:"_blank",rel:"noopener noreferrer","aria-label":"Download VIDAREO on the App Store",children:r.jsx("img",{src:nee,alt:"Download on the App Store",className:"h-10 sm:h-11 w-auto"})}),r.jsx("p",{className:"max-w-[12rem] text-xs leading-snug text-[hsl(var(--hero-muted))]",children:"Available for iPhone and iPad"})]})]})}),r.jsxs(fe.button,{type:"button","aria-label":"Scroll to learn more",initial:{opacity:0},animate:{opacity:1},transition:{delay:.8,duration:.6},onClick:()=>window.scrollTo({top:window.innerHeight,behavior:"smooth"}),className:"mx-auto mb-1 flex flex-col items-center gap-0.5 text-[hsl(var(--hero-muted))] transition-colors hover:text-primary-foreground",children:[r.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.2em]",children:"Scroll to learn more"}),r.jsx(Qs,{className:"h-4 w-4 animate-bounce"})]}),r.jsx(fe.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.35,duration:.6},className:"w-full border-t border-primary-foreground/20 bg-[hsl(var(--hero-surface)/0.82)] py-6 backdrop-blur-md sm:py-8",children:r.jsxs("div",{className:"mx-auto w-full max-w-7xl px-5 sm:px-6 lg:px-8",children:[r.jsx("div",{className:"mb-6 grid grid-cols-2 gap-5 sm:grid-cols-4 sm:gap-8",children:zEe.map(t=>r.jsxs("div",{children:[r.jsx("p",{className:"font-display text-2xl font-semibold text-primary-foreground sm:text-3xl",children:t.value}),r.jsx("p",{className:"mt-1 text-xs text-[hsl(var(--hero-muted))] sm:text-sm",children:t.label})]},t.label))}),r.jsx("p",{className:"mb-4 text-[11px] font-bold uppercase tracking-[0.2em] text-accent",children:"Everything you need, built in"}),r.jsx("ul",{className:"flex flex-wrap gap-x-5 gap-y-3",children:qEe.map(t=>r.jsxs("li",{className:"inline-flex items-center gap-1.5 text-[11px] font-medium text-[hsl(var(--hero-muted))] sm:text-[13px]",children:[r.jsx(t.icon,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),t.label]},t.label))})]})})]})]})},WEe="/assets/lifestyle-inbox-Bno2anAt.jpg",iee="/assets/lifestyle-team-BSWylGrw.jpg",YEe=[{icon:KH,title:"Direct Inbox Delivery",description:"Your video lands directly in their inbox - no algorithms, no feed competition. Just a face, a message, and a reason to reply.",image:WEe,alt:"A man watching a personalized video message on his phone in a cafe"},{icon:jr,title:"Build Real Relationships",description:"Put your face to the message. Turn prospects into clients and clients into advocates with conversations that feel human.",image:iee,alt:"Two colleagues laughing during a video call in a bright workspace"}],GEe=()=>r.jsx("section",{className:"bg-background",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 py-16 sm:py-20 md:py-28",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"grid md:grid-cols-12 gap-6 md:gap-12 items-end mb-10 sm:mb-14 md:mb-16",children:[r.jsxs("div",{className:"md:col-span-7",children:[r.jsx("span",{className:"text-xs font-semibold tracking-wide text-primary uppercase",children:"The Inbox Advantage"}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 tracking-tight leading-[1.1] text-balance",children:["Your message, their inbox,"," ",r.jsx("span",{className:"text-muted-foreground",children:"real results."})]})]}),r.jsx("p",{className:"md:col-span-5 text-[0.95rem] sm:text-base text-muted-foreground leading-relaxed",children:"Stop competing with endless feeds. VIDAREO delivers personalized video directly to inboxes, cutting through the noise to build relationships that drive results."})]}),r.jsx("div",{className:"grid md:grid-cols-2 gap-6 md:gap-8",children:YEe.map((e,t)=>r.jsxs(fe.article,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.55,delay:t*.1},className:"group rounded-[1.75rem] overflow-hidden bg-card shadow-lg shadow-foreground/5 hover:shadow-xl hover:shadow-foreground
1101/10 transition-shadow",children:[r.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:r.jsx("img",{src:e.image,alt:e.alt,loading:"lazy",width:1200,height:1200,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-[1.04]"})}),r.jsxs("div",{className:"p-6 sm:p-8 md:p-9",children:[r.jsx("div",{className:"w-11 h-11 rounded-2xl bg-primary/10 flex items-center justify-center mb-4 sm:mb-5",children:r.jsx(e.icon,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-display text-lg sm:text-xl md:text-2xl font-bold text-foreground mb-2 sm:mb-3",children:e.title}),r.jsx("p",{className:"text-sm sm:text-base text-muted-foreground leading-relaxed",children:e.description})]})]},e.title))})]})}),KEe=[{letter:"V",title:"Video",description:"Personalized video messages that stand out in crowded inboxes.",color:"bg-red-50 text-red-600"},{letter:"I",title:"Inbox",description:"Direct delivery straight to your recipient's email or text.",color:"bg-orange-50 text-orange-600"},{letter:"D",title:"Delivery",description:"Seamless sharing across any platform or device.",color:"bg-amber-50 text-amber-600"},{letter:"A",title:"And",description:"Connecting all the pieces for maximum impact.",color:"bg-green-50 text-green-600"},{letter:"R",title:"Relationship",description:"Building genuine human connections that convert.",color:"bg-blue-50 text-blue-600"},{letter:"E",title:"Engagement",description:"Driving meaningful interactions and responses.",color:"bg-cyan-50 text-cyan-600"},{letter:"O",title:"Optimization",description:"Analytics and insights to improve every message.",color:"bg-sky-50 text-sky-600"}],XEe=()=>r.jsx("section",{className:"bg-background",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 py-16 sm:py-20 md:py-28",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-100px"},transition:{duration:.6},className:"text-center max-w-3xl mx-auto mb-12 sm:mb-16",children:[r.jsx("span",{className:"text-xs font-bold tracking-widest text-primary uppercase",children:"What VIDAREO Means"}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 tracking-tight leading-[1.1]",children:["More than a name."," ",r.jsx("span",{className:"text-muted-foreground",children:"A method."})]}),r.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mt-4 sm:mt-6",children:"VIDAREO is built from the seven pillars of modern video communication. Every feature is designed to help you connect, engage, and convert."})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6",children:KEe.map((e,t)=>r.jsx(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:t*.05},className:"group p-6 sm:p-7 rounded-[1.5rem] bg-card shadow-sm hover:shadow-md transition-all border border-border/60",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:`w-12 h-12 sm:w-14 sm:h-14 rounded-2xl ${e.color} flex items-center justify-center shrink-0 font-display text-2xl sm:text-3xl font-bold`,children:e.letter}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-display text-lg sm:text-xl font-bold text-foreground mb-1",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.description})]})]})},e.letter))}),r.jsxs(fe.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.35},className:"mt-12 sm:mt-16 text-center",children:[r.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:r.jsx("span",{className:"font-semibold text-foreground",children:"Video · Inbox · Delivery · And · Relationship · Engagement · Optimization"})}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2 uppercase tracking-widest",children:"Real People · Real Connections · Real Results"})]})]})}),ZEe="/assets/promo-easy-recording-DSlYbsby.png",oee="/assets/promo-recording-progress-BE7LMI7Q.png",QEe="/assets/promo-presentation-mode-D_ilPXWZ.png",lee="/assets/promo-teleprompter-Bl1wVp6A.png",JEe="/assets/promo-save-share-CC5v96zw.png",eAe="/assets/Group_video_call_with_friends-a--yNQr0.png",tAe="/assets/promo-smart-analytics-BRtFMY-o.png",rAe="/assets/promo-mobile-app-Z-LHIqm0.png",nAe="/assets/promo-video-library-HmbbbE_V.png",iy={icon:Vs,title:"Screen + Camera Recording",description:"Record your screen with a camera bubble overlay for demos, presentations, or tutorials - all from your browser, with crystal clear resolution and zero lag.",image:oee},Tp=[{icon:ga,title:"Camera Mode + Teleprompter",description:"Record yourself talking to camera with our built-in teleprompter. Write your own script or let AI draft one.",image:lee},{icon:og,title:"Live Meetings + Recording",description:"Start instant calls with up to 4 people, share your screen, and record the whole session to your library.",image:eAe}],VV=[{icon:kf,title:"Presentation Mode",description:"Upload your slide deck (PDF or PowerPoint), record over it with your camera, and deliver polished video presentations that feel personal and prepared.",image:QEe},{icon:$4,title:"Chrome Extension",description:"Record from any tab with our Chrome extension. Floating controls, picture-in-picture camera, and one-click sharing - right inside your browser.",image:ZEe},{icon:qc,title:"iOS and Android Apps",description:"Record, review, and share videos on the go with 
1101native iOS and Android apps. Full camera and teleprompter support in your pocket.",image:rAe},{icon:qd,title:"Smart Analytics",description:"Know exactly who watched, for how long, and when they engaged most. Real-time insights to perfect your follow-up timing.",image:tAe},{icon:dv,title:"Instant Sharing",description:"Share videos via email, LinkedIn, or custom landing pages in seconds. Every link is trackable so you know who watched.",image:JEe},{icon:sue,title:"Upload Videos to Share",description:"Already have a video? Drag and drop any MP4, MOV, or WebM into your library to share it with a branded link, analytics, comments, and reactions.",image:nAe},{icon:A_,title:"Built-In Video Editor",description:"Trim, split, and delete sections from any recording right in your browser. Preview the cut, then save a copy or overwrite the original.",image:oee}],sAe=[{icon:ya,title:"Lightning Fast",description:"Videos process in seconds, not minutes. Your prospects won't wait."},{icon:zr,title:"Email Integration",description:"Send videos directly via email or embed in your outreach workflows."},{icon:jr,title:"Team Management",description:"Invite team members, manage roles, and view unified team analytics."},{icon:mi,title:"Enterprise Security",description:"Encrypted storage, access controls, and secure video hosting."},{icon:fr,title:"Video Library",description:"Organize, search, and reuse your videos with smart tagging and folders."},{icon:aue,title:"Contact Management",description:"Import, organize, and segment your contacts for targeted video outreach."},{icon:xT,title:"Share YouTube Videos",description:"Paste any YouTube URL into your library and share it through your branded link."},{icon:cr,title:"AI Titles & Summaries",description:"Auto-generated titles, summaries, and transcripts on every recording."}],cee=({hideHeader:e=!1,minimal:t=!1})=>r.jsx("section",{id:"features",className:"bg-background",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 py-16 sm:py-20 md:py-28",children:[!e&&r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-100px"},transition:{duration:.6},className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6 mb-10 sm:mb-14 md:mb-16 md:pb-8",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold tracking-widest text-primary uppercase",children:"Capabilities"}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 tracking-tight leading-[1.1]",children:["Built for the",r.jsx("br",{}),r.jsx("span",{className:"text-muted-foreground",children:"modern workforce."})]})]}),r.jsx("p",{className:"md:max-w-xs text-sm text-muted-foreground leading-relaxed",children:"Every tool you need to communicate clearly - without the calendar fatigue."})]}),!t&&r.jsxs("div",{className:"grid md:grid-cols-3 gap-6 md:gap-8 mb-20 md:mb-28",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"md:col-span-2 group cursor-default",children:[r.jsxs("div",{className:"aspect-[16/9] bg-muted rounded-[1.75rem] overflow-hidden mb-6 relative shadow-lg shadow-foreground/5",children:[r.jsx("img",{src:iy.image,alt:iy.title,className:"w-full h-full object-cover",loading:"lazy"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-foreground
1101/30 via-transparent to-transparent"})]}),r.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs font-bold tracking-widest text-primary uppercase",children:[r.jsx(iy.icon,{className:"w-4 h-4"})," Featured"]}),r.jsx("h3",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-2",children:iy.title}),r.jsx("p",{className:"text-muted-foreground leading-relaxed max-w-2xl",children:iy.description})]}),r.jsx("div",{className:"flex flex-col gap-6 md:gap-8",children:(()=>{const n=Tp[0].icon,s=Tp[1].icon;return r.jsxs(r.Fragment,{children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.1},className:"p-8 bg-card rounded-[1.75rem] shadow-lg shadow-foreground/5 hover:shadow-xl hover:shadow-foreground/10 hover:-translate-y-1 transition-all",children:[r.jsx("div",{className:"w-11 h-11 bg-primary/10 rounded-lg flex items-center justify-center mb-6",children:r.jsx(n,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-display text-xl font-bold text-foreground mb-3",children:Tp[0].title}),r.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:Tp[0].description})]}),r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"p-8 bg-primary rounded-[1.75rem] text-primary-foreground hover:-translate-y-1 transition-all shadow-xl shadow-primary/20",children:[r.jsx("div",{className:"w-11 h-11 bg-primary-foreground/15 rounded-lg flex items-center justify-center mb-6",children:r.jsx(s,{className:"w-5 h-5 text-primary-foreground"})}),r.jsx("h3",{className:"font-display text-xl font-bold mb-3",children:Tp[1].title}),r.jsx("p",{className:"text-sm text-primary-foreground/80 leading-relaxed mb-6",children:Tp[1].description}),r.jsxs("div",{className:"flex -space-x-2",children:[r.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-primary bg-primary-foreground/30"}),r.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-primary bg-primary-foreground/50"}),r.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-primary bg-primary-foreground/70"})]})]})]})})()})]}),t?r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 mb-10 sm:mb-12",children:VV.map((n,s)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:s*.05},className:"bg-card rounded-[1.5rem] p-6 shadow-md shadow-foreground/5 hover:shadow-lg hover:-translate-y-1 transition-all",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:r.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),r.jsx("h4",{className:"font-display text-base font-bold text-foreground mb-2",children:n.title}),r.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description})]},n.title))}):r.jsx("div",{className:"space-y-20 md:space-y-28 mb-20 md:mb-28",children:VV.map((n,s)=>r.jsxs(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.6},className:`grid md:grid-cols-12 gap-8 md:gap-12 items-center ${s%2===1?"md:[direction:rtl]":""}`,children:[r.jsx("div",{className:"md:col-span-7 [direction:ltr]",children:r.jsx("div",{className:"rounded-[1.75rem] overflow-hidden bg-muted shadow-lg shadow-foreground/5",children:r.jsx("img",{src:n.image,alt:n.title,className:"w-full h-auto object-cover",loading:"lazy"})})}),r.jsxs("div",{className:"md:col-span-5 [direction:ltr] space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold tracking-widest text-primary uppercase",children:[r.jsxs("span",{children:["0",s+1]}),r.jsx("span",{className:"w-8 h-px bg-primary/40"}),r.jsx(n.icon,{className:"w-4 h-4"})]}),r.jsx("h3",{className:"font-display text-3xl md:text-4xl font-bold text-foreground tracking-tight leading-tight",children:n.title}),r.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed",children:n.description})]})]},n.title))}),r.jsxs("div",{className:"pt-10 sm:pt-14 md:pt-16",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"flex flex-col md:flex-row md:items-end justify-between gap-2 md:gap-4 mb-6 sm:mb-10",children:[r.jsx("h3",{className:"font-display text-xl sm:text-2xl md:text-3xl font-bold text-foreground tracking-tight",children:"And so much more."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"A complete toolkit for async-first teams."})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:sAe.map((n,s)=>r.jsxs(fe.div,{initial:{opacity:0}
1101,whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.4,delay:s*.04},className:"p-5 sm:p-6 rounded-[1.25rem] bg-card shadow-sm hover:shadow-md transition-shadow group",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/5 flex items-center justify-center mb-4 group-hover:bg-primary/10 transition-colors",children:r.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),r.jsx("h4",{className:"font-display text-base font-bold text-foreground mb-2",children:n.title}),r.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description})]},n.title))})]})]})}),aAe="/assets/lifestyle-analytics-C846coNO.jpg",iAe=[{icon:wr,label:"View notifications",value:"Instant alerts when someone connects"},{icon:fr,label:"Engagement insights",value:"See how long viewers stay connected"},{icon:cr,label:"Video replies",value:"Recipients can reply with their own video"},{icon:zl,label:"Perfect timing",value:"Know the right moment to connect"}],oAe=()=>r.jsx("section",{className:"py-16 sm:py-20 md:py-28 bg-background overflow-hidden",children:r.jsx("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8",children:r.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 sm:gap-12 lg:gap-16 items-center",children:[r.jsxs(fe.div,{initial:{opacity:0,x:-30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6},children:[r.jsx("span",{className:"text-primary font-semibold text-xs uppercase tracking-wide",children:"Meaningful Connections"}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 mb-4 sm:mb-6 tracking-tight leading-[1.1] text-balance",children:["Know Who Connected."," ",r.jsx("span",{className:"text-muted-foreground",children:"Know What Resonated."})]}),r.jsx("p",{className:"text-base sm:text-lg text-muted-foreground mb-7 sm:mb-10",children:"VIDAREO shows you when someone watches, how they engage, and when it's time to connect. No guessing. No noise."}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-1 gap-3 sm:gap-4",children:iAe.map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.4,delay:t*.1},className:"flex items-center gap-3 sm:gap-4 p-3.5 sm:p-4 rounded-xl bg-muted/40 hover:bg-muted/60 transition-colors",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg gradient-primary flex items-center justify-center shrink-0 shadow-md shadow-primary/20",children:r.jsx(e.icon,{className:"w-5 h-5 text-primary-foreground"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("h4",{className:"font-semibold text-foreground text-sm sm:text-base",children:e.label}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:e.value})]})]},e.label))})]}),r.jsxs(fe.div,{initial:{opacity:0,x:30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"relative",children:[r.jsx("div",{className:"rounded-[1.5rem] sm:rounded-[1.75rem] overflow-hidden mb-5 sm:mb-6 shadow-lg shadow-foreground/5",children:r.jsx("img",{src:aAe,alt:"A woman reviewing video engagement insights on a tablet",loading:"lazy",width:1200,height:1200,className:"w-full h-48 sm:h-64 lg:h-56 xl:h-64 object-cover"})}),r.jsx("div",{className:"relative bg-card rounded-[1.5rem] sm:rounded-[1.75rem] p-5 sm:p-6 shadow-lg shadow-foreground/5",children:r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h3",{className:"font-bold text-foreground",children:"Recent Activity"}),r.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),"Live"]})]}),r.jsx("div",{className:"space-y-3",children:[{name:"Sarah M.",action:"watched 95%",time:"2 min ago",avatar:"S"},{name:"James K.",action:"opened video",time:"5 min ago",avatar:"J"},{name:"Emily R.",action:"watched 100%",time:"12 min ago",avatar:"E"},{name:"Michael T.",action:"replied",time:"18 min ago",avatar:"M"}].map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.3,delay:.4+t*.1},className:"flex items-center gap-3 p-3.5 rounded-xl bg-muted/40",children:[r.jsx("div",{className:"w-9 h-9 rounded-full gradient-primary flex items-center justify-center text-xs font-bold text-primary-foreground shadow-sm",children:e.avatar}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("p",{className:"text-sm font-medium text-foreground truncate",children:[e.name," ",r.jsx("span",{className:"text-muted-foreground",children:e.action})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:e.time})]}),r.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"})]},t))})]})})]})]})})}),lAe=[{icon:_n,title:"AI-powered scripts",description:"Write your own script or let AI draft one for any length - from a 30-second intro to a 10-minute deep dive. Scripts are double-spaced for effortless reading."},{icon:due,title:"Auto-scroll at your pace",description:"Built-in auto-scroll and speed controls keep your delivery natural on camera, in screen recordings, and over presentations."},{icon:Ni,title:"Encrypted secure hosting",description:"Every recording is stored with encryption in transit and at rest. Access controls and password-protected links keep sensitive content private."},{icon:rp,title:"Reliable delivery",description:"Branded share links, instant notifications, and 99.9% uptime mean your video lands where it should - every time, without surprises."}],cAe=()=>r.jsx("section",{className:"py-16 sm:py-20 md:py-28 bg-background overflow-hidden",children:r.jsx("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8",children:r.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 sm:gap-12 lg:gap-16 items-center",children:[r.jsxs(fe.div,{initial:{opacity:0,scale:.97},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.6},className:"relative order-2 lg:order-1",children:[r.jsx("div",{className:"rounded-[1.5rem] sm:rounded-[1.75rem] overflow-hidden shadow-xl shadow-foreground
1101/10 bg-card",children:r.jsx("img",{src:lee,alt:"VIDAREO teleprompter with auto-scroll script displayed during a camera recording",loading:"lazy",width:1200,height:1200,className:"w-full h-auto object-cover"})}),r.jsxs("div",{className:"absolute -bottom-4 -right-3 sm:-bottom-5 sm:-right-5 bg-card rounded-2xl shadow-lg shadow-foreground/10 px-4 py-3 flex items-center gap-2.5",children:[r.jsx("div",{className:"w-9 h-9 rounded-lg gradient-primary flex items-center justify-center shrink-0",children:r.jsx(rp,{className:"w-5 h-5 text-primary-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-semibold text-foreground leading-tight",children:"Secure by default"}),r.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:"Encrypted end-to-end"})]})]})]}),r.jsxs(fe.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.1},className:"order-1 lg:order-2",children:[r.jsxs("span",{className:"inline-flex items-center gap-2 text-xs font-semibold tracking-wide text-primary uppercase",children:[r.jsx(ga,{className:"w-4 h-4"}),"Trusted Screen Recording"]}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 mb-4 sm:mb-6 tracking-tight leading-[1.1] text-balance",children:["A screen recorder with teleprompter"," ",r.jsx("span",{className:"text-muted-foreground",children:"you can trust."})]}),r.jsx("p",{className:"text-base sm:text-lg text-muted-foreground mb-7 sm:mb-9 leading-relaxed",children:"VIDAREO's built-in teleprompter keeps you on script while you record your screen or camera - no memorizing, no awkward pauses. Every video is backed by secure, encrypted hosting so your content stays private and reliable."}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-4 sm:gap-5",children:lAe.map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:t*.08},className:"p-4 sm:p-5 rounded-2xl bg-muted/40 hover:bg-muted/60 transition-colors",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-3",children:r.jsx(e.icon,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-display text-sm sm:text-base font-bold text-foreground mb-1.5",children:e.title}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground leading-relaxed",children:e.description})]},e.title))})]})]})})}),dAe=["sales-teams","async-teams","real-estate","training-onboarding","customer-success","founders-executives"],uAe=dAe.map(e=>yg.find(t=>t.slug===e)).filter(Boolean),mAe=()=>r.jsx("section",{className:"py-16 sm:py-20 md:py-28 bg-muted/40",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-10 sm:mb-14 md:mb-20",children:[r.jsx("span",{className:"text-primary font-semibold text-xs uppercase tracking-wide",children:"Use Cases"}),r.jsxs("h2",{className:"font-display text-[1.75rem] sm:text-4xl md:text-5xl font-extrabold text-foreground mt-3 sm:mt-4 mb-4 sm:mb-6 tracking-tight leading-[1.1] text-balance",children:["Connect Exter
1101nally"," ",r.jsx("span",{className:"text-muted-foreground",children:"& Internally"})]}),r.jsx("p",{className:"text-base sm:text-lg text-muted-foreground max-w-3xl mx-auto",children:"Whether you're closing deals, training your team, or sharing knowledge-VIDAREO helps you connect with clarity and authenticity."})]}),r.jsx("div",{className:"grid sm:grid-cols-2 xl:grid-cols-3 gap-5 sm:gap-6 lg:gap-8",children:uAe.map((e,t)=>{const n=e.icon;return r.jsx(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:t*.1},className:"relative group",children:r.jsx(Cr,{to:`/use-cases/${e.slug}`,children:r.jsxs("div",{className:"relative bg-card rounded-[1.75rem] shadow-lg shadow-foreground/5 hover:shadow-xl hover:shadow-foreground/10 transition-shadow duration-300 h-full overflow-hidden",children:[e.heroImage&&r.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden bg-muted/30 flex items-center justify-center",children:[r.jsx("img",{src:e.heroImage,alt:e.title,className:"w-full h-full object-contain transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-card via-card/30 to-transparent"}),r.jsxs("div",{className:"absolute top-3 right-3 bg-card/80 backdrop-blur-sm rounded-lg px-3 py-1.5 text-sm font-semibold",children:[r.jsx("span",{className:"text-primary",children:e.stats.metric}),r.jsx("span",{className:"text-muted-foreground ml-1.5",children:e.stats.label})]})]}),r.jsxs("div",{className:"p-5 sm:p-6 md:p-7",children:[r.jsxs("div",{className:"flex items-start gap-3 sm:gap-4 mb-4",children:[r.jsx("div",{className:"w-11 h-11 sm:w-12 sm:h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(n,{className:"w-5 h-5 sm:w-6 sm:h-6 text-primary"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground",children:e.title}),r.jsx("p",{className:"text-sm text-primary font-medium",children:e.subt
vendor: 5,283 bytes, line 1101
1101itle})]})]}),r.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-4",children:e.description}),r.jsx("ul",{className:"space-y-2",children:e.benefits.map(s=>r.jsxs("li",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0"}),s]},s))}),r.jsxs("div",{className:"mt-4 text-primary font-medium text-sm group-hover:underline flex items-center gap-1",children:["Learn more about VIDAREO for ",e.title,r.jsx("span",{className:"transition-transform group-hover:translate-x-1 inline-block",children:"→"})]})]})]})})},e.slug)})}),r.jsx(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.4},className:"text-center mt-12",children:r.jsx(Cr,{to:"/use-cases",children:r.jsxs(P,{variant:"outline",size:"lg",className:"group",children:["View All Use Cases",r.jsx(Ya,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]})})})]})}),lu=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:ge("w-full caption-bottom text-sm",e),...t})}));lu.displayName="Table";const cu=h.forwardRef(({className:e,...t},n)=>r.jsx("thead",{ref:n,className:ge("[&_tr]:border-b",e),...t}));cu.displayName="TableHeader";const du=h.forwardRef(({className:e,...t},n)=>r.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0",e),...t}));du.displayName="TableBody";const hAe=h.forwardRef(({className:e,...t},n)=>r.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));hAe.displayName="TableFooter";const pr=h.forwardRef(({className:e,...t},n)=>r.jsx("tr",{ref:n,className:ge("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));pr.displayName="TableRow";const ar=h.forwardRef(({className:e,...t},n)=>r.jsx("th",{ref:n,className:ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ar.displayName="TableHead";const Te=h.forwardRef(({className:e,...t},n)=>r.jsx("td",{ref:n,className:ge("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Te.displayName="TableCell";const fAe=h.forwardRef(({className:e,...t},n)=>r.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground",e),...t}));fAe.displayName="TableCaption";var LD="Radio",[pAe,dee]=Ss(LD),[xAe,gAe]=pAe(LD),uee=h.forwardRef((e,t)=>{const{__scopeRadio:n,name:s,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:d,...u}=e,[m,f]=h.useState(null),p=Ht(t,v=>f(v)),x=h.useRef(!1),g=m?d||!!m.closest("form"):!0;return r.jsxs(xAe,{scope:n,checked:a,disabled:o,children:[r.jsx(ut.button,{type:"button",role:"radio","aria-checked":a,"data-state":pee(a),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:p,onClick:We(e.onClick,v=>{a||c==null||c(),g&&(x.current=v.isPropagationStopped(),x.current||v.stopPropagation())})}),g&&r.jsx(fee,{control:m,bubbles:!x.current,name:s,value:l,checked:a,required:i,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});uee.displayName=LD;var mee="RadioIndicator",hee=h.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:s,...a}=e,i=gAe(mee,n);return r.jsx(_s,{present:s||i.checked,children:r.jsx(ut.span,{"data-state":pee(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});hee.displayName=mee;var vAe="RadioBubbleInput",fee=h.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:s=!0,...a},i)=>{const o=h.useRef(null),l=Ht(o,i),c=jv(n),d=mw(t);return h.useEffect(()=>{const u=o.current;if(!u)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:s});p.call(u,n),u.dispatchEvent(x)}},[c,n,s]),r.jsx(ut.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fee.displayName=vAe;function pee(e){return e?"checked":"unchecked"}var yAe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],g2="RadioGroup",[bAe,xit]=Ss(g2,[sh,dee]),xee=sh(),gee=dee(),[wAe,jAe]=bAe(g2),vee=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:s,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:m,...f}=e,p=xee(n),x=Yc(d),[g,v]=Zs({prop:i,defaultProp:a??null,onChange:m,caller:g2});return r.jsx(wAe,{scope:n,name:s,required:o,disabled:l,value:g,onValueChange:v,children:r.jsx(K_,{asChild:!0,...p,orientation:c,dir:x,loop:u,children:r.jsx(ut.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...f,ref:t})})})});vee.displayName=g2;var yee="RadioGroupItem",bee=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:s,...a}=e,i=jAe(yee,n),o=i.disabled||s,l=xee(n),c=gee(n),d=h.useRef(null),u=Ht(t,d),m=i.value===a.value,f=h.useRef(!1);return h.useEffect(()=>{const p=g=>{yAe.includes(g.key)&&(f.current=!0)},x=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",x)}},[]),r.jsx(X_,{asChild:!0,...l,focusable:!o,active:m,children:r.jsx(uee,{disabled:o,required:i.required,
1101checked:m,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:We(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:We(a.onFocus,()=>{var p;f.current&&((p=d.current)==null||p.click())})})})});bee.displayName=yee;var NAe="RadioGroupIndicator",wee=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...s}=e,a=gee(n);return r.jsx(hee,{...a,...s,ref:t})});wee.displayName=NAe;var jee=vee,Nee=bee,SAe=wee;const Lf=h.forwardRef(({className:e,...t},n)=>r.jsx(jee,{className:ge("grid gap-2",e),...t,ref:n}));Lf.displayName=jee.displayName;const wo=h.forwardRef(({className:e,...t},n)=>r.jsx(Nee,{ref:n,className:ge("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus: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:r.jsx(SAe,{className:"flex items-center justify-center",children:r.jsx(Ob,{className:"h-2.5 w-2.5 fill-current text-current"})})}));wo.displayName=Nee.displayName;function zR({tier:e,billingPeriod:t,onPromoApplied:n,appliedPromo:s,onGiftRedeemed:a,allowGiftWhenSignedOut:i,onGiftPending:o,placeholder:l}){if(lr())return null;const[c,d]=h.useState(""),[u,m]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState(null),v=async()=>{if(c.trim()){m(!0),p(null),g(null);try{const{data:b,error:w}=await F.functions.invoke("validate-promo-code",{body:{code:c.trim(),tier:e,billingPeriod:t}});if(w)throw w;if(b.valid&&b.isGift){const{data:S}=await F.auth.getSession();if(!S.session){if(i){const _=c.trim().toUpperCase();o==null||o(_),d(""),g("Gift code applied - your Pro account activates as soon as you verify your email.");return}p("Please sign in or create an account first, then redeem your gift code.");return}const{data:j,error:N}=await F.functions.invoke("redeem-gift-code",{body:{code:c.trim()}});if(N||!(j!=null&&j.success)){p((j==null?void 0:j.error)||"Failed to redeem gift code");return}d(""),g("Gift code redeemed - your Pro account is active!"),a==null||a();return}b.valid?(n({code:b.code,discountPercentage:b.discountPercentage}),d("")):p(b.error||"Invalid promo code")}catch(b){console.error("Error validating promo code:",b),p("Failed to validate promo code")}finally{m(!1)}}},y=()=>{n(null),p(null)};return s?r.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-accent/10 border border-accent/30",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(nt,{className:"w-4 h-4 text-accent"}),r.jsx("span",{className:"text-sm font-medium text-foreground",children:s.code}),r.jsxs(Se,{variant:"secondary",className:"bg-accent/20 text-accent border-0",children:[s.discountPercentage,"% off"]})]}),r.jsx(P,{variant:"ghost",size:"sm",onClick:y,className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",children:r.jsx(zt,{className:"w-4 h-4"})})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Ef,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(He,{placeholder:l??"Enter promo code",value:c,onChange:b=>{d(b.target.value.toUpperCase()),p(null)},onKeyDown:b=>b.key==="Enter"&&v(),className:"pl-9 uppercase",disabled:u})]}),r.jsx(P,{variant:"outline",onClick:v,disabled:!c.trim()||u,children:u?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Apply"})]}),f&&r.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1",children:[r.jsx(zt,{className:"w-3 h-3"}),f]}),x&&r.jsxs("p",{className:"text-xs text-accent flex items-center gap-1",children:[r.jsx(nt,{className:"w-3 h-3"}),x]})]})}const UV=[{id:"none",name:"No Add-on",description:"10 minute max per video",price:0,highlight:!1},{id:"extended_video_30",name:"Extended Video (30 min)",description:"Record videos up to 30 minutes",price:20,highlight:!1},{id:"extended_video_60",name:"Extended Video (60 min)",description:"Record videos up to 60 minutes",price:30,highlight:!0,badge:"Best Value"}];function _Ae({open:e,onOpenChange:t,planName:n,planTier:s,monthlyPrice:a,annualPrice:i,billingPeriod:o,isPerUser:l=!1,minUsers:c=2,onConfirm:d,isLoading:u=!1}){const[m,f]=h.useState("none"),[p,x]=h.useState(o),[g,v]=h.useState(c),[y,b]=h.useState(null);h.useEffect(()=>{e&&(x(o),f("none"),v(c),b(null))},[e,o,c]);const w=UV.find(V=>V.id===m),S=(w==null?void 0:w.price)||0,j=p==="annual"?i:a,N=j+S,_=l?N*g:N,C=l?j*g:j,k=y?Math.round(C*(y.discountPercentage/100)):0,E=_-k,R=p==="annual"?Math.round((a-i)/a*100):0,T=()=>{d(m==="none"?null:m,p,l?g:void 0,y==null?void 0:y.code)},D=()=>v(V=>Math.min(V+1,100)),A=()=>v(V=>Math.max(V-1,c));return lr()?r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Manage subscription on the web"}),r.jsx($r,{children:"Your plan is managed outside the app."})]}),r.jsx(Fr,{children:r.jsx(P,{onClick:()=>t(!1),className:"w-full",children:"Close"})})]})}):r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:["Customize Your ",n," Plan"]}),r.jsx($r,{children:"Choose your billing cycle and optional add-ons before checkout."})]}),r.jsxs("div",{className:"py-4 space-y-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Billing Cycle"}),r.jsx(ec,{value:p,onValueChange:V=>x(V),className:"w-full",children:r.jsxs(pl,{className:"grid w-full grid-cols-2 p-1 h-auto",children:[r.jsx(tn,{value:"monthly",className:"text-sm py-2.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",children:"Monthly"}),r.jsxs(tn,{value:"annual",className:"text-sm py-2.5 relative data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",children:["Annual",R>0&&r.jsxs(Se,{variant:"secondary",className:"ml-1.5 text-[10px] px-1.5 py-0 bg-green-500 text-white dark:bg-green-600",children:["Save ",R,"%"]})]})]})})]}),l&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs(ye,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4"}),"Team Size"]}),r.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border border-border bg-muted/30",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"Team Members"}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5 cursor-help",children:[r.jsx(Ms,{className:"w-3 h-3"}),"You'll be the team admin",r.jsx(ql,{className:"w-3 h-3"})]})}),r.jsx(yt,{side:"top",className:"max-w-[220px]",children:r.jsx("p",{className:"text-xs",children:"As team admin, you can invite members, manage add-ons for your team, and view team analytics."})})]})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-8 w-8",onClick:A,disabled:g<=c,children:r.jsx(ag,{className:"w-4 h-4"})}),r.jsx("div",{className:"w-12 text-center",children:r.jsx("span",{className:"text-lg font-bold",children:g})}),r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-8 w-8",onClick:D,children:r.jsx(Ns,{className:"w-4 h-4"})})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Minimum ",c," users required. Add more team members anytime."]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Video Duration Add-on"}),r.jsx(Lf,{value:m,onValueChange:f,className:"space-y-3",children:UV.map(V=>r.jsxs("div",{className:`relative flex items-start gap-3 rounded-lg border p-4 cursor-pointer transition-all ${m===V.id?"border-primary bg-primary/5 ring-1 ring-primary":"border-border hover:border-muted-foreground
1101/30"} ${V.highlight?"ring-1 ring-accent/50":""}`,onClick:()=>f(V.id),children:[r.jsx(wo,{value:V.id,id:V.id,className:"mt-1"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(ye,{htmlFor:V.id,className:"font-medium cursor-pointer",children:V.name}),V.badge&&r.jsx(Se,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:V.badge})]}),r.jsxs("p",{className:"text-sm text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[r.jsx(fr,{className:"w-3.5 h-3.5"}),V.description]})]}),r.jsx("div",{className:"text-right shrink-0",children:V.price===0?r.jsx("span",{className:"text-sm text-muted-foreground",children:"Included"}):r.jsxs("span",{className:"text-sm font-semibold",children:["+$",V.price,l?"/user":"","/mo"]})})]},V.id))})]}),p==="annual"&&r.jsx("div",{className:"p-3 rounded-lg bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-800",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center",children:r.jsx("span",{className:"text-green-600 dark:text-green-400 text-sm font-bold",children:"🎉"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("p",{className:"text-sm font-semibold text-green-700 dark:text-green-400",children:["You're saving $",Math.round((a+S)*(l?g:1)*12*.2),"/year!"]}),r.jsxs("p",{className:"text-xs text-green-600 dark:text-green-500",children:["That's ",R,"% off compared to monthly billing"]})]})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Promo Code"}),r.jsx(zR,{tier:s,billingPeriod:p,onPromoApplied:b,appliedPromo:y})]}),r.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[l?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex justify-between items-center text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:[n," Plan ",p==="annual"?"(Annual)":"(Monthly)"]}),r.jsxs("div",{className:"text-right",children:[r.jsxs("span",{children:["$",j,"/user/mo"]}),p==="annual"&&r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground line-through",children:["$",a]})]})]}),r.jsxs("div",{className:"flex justify-between items-center text-sm mt-1 text-muted-foreground",children:[r.jsxs("span",{children:["× ",g," users"]}),r.jsxs("span",{children:["$",j*g,"/mo"]})]})]}):r.jsxs("div",{className:"flex justify-between items-center text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:[n," Plan ",p==="annual"?"(Annual)":"(Monthly)"]}),r.jsxs("div",{className:"text-right",children:[r.jsxs("span",{children:["$",j,"/mo"]}),p==="annual"&&r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground line-through",children:["$",a]})]})]}),S>0&&r.jsxs("div",{className:"flex justify-between items-center text-sm mt-1",children:[r.jsxs("span",{className:"text-muted-foreground",children:["Extended Video Add-on",l&&` × ${g} users`]}),r.jsxs("span",{children:["+$",S*(l?g:1),"/mo"]})]}),y&&r.jsxs("div",{className:"flex justify-between items-center text-sm mt-1 text-accent",children:[r.jsxs("span",{children:["Promo: ",y.code," (",y.discountPercentage,"% off)"]}),r.jsxs("span",{children:["-$",k,"/mo"]})]}),r.jsxs("div",{className:"border-t border-border mt-3 pt-3 flex justify-between items-center",children:[r.jsx("span",{className:"font-medium",children:"Total"}),r.jsxs("div",{className:"text-right",children:[y?r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"text-lg font-bold text-accent",children:["$",E,"/mo"]}),r.jsxs("span",{className:"ml-2 text-sm text-muted-foreground line-through",children:["$",_]})]}):r.jsxs("span",{className:"text-lg font-bold",children:["$",E,"/mo"]}),p==="annual"&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["$",(E*12).toFixed(2)," billed annually"]})]})]})]})]}),r.jsxs(Fr,{className:"flex-col sm:flex-row gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>t(!1),disabled:u,className:"w-full sm:w-auto",children:"Cancel"}),r.jsx(P,{onClick:T,disabled:u,className:"w-full sm:w-auto",children:u?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"animate-spin mr-2",children:"⏳"}),"Processing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Continue to Payment"]})})]})]})})}const CAe=[{tier:"starter",name:"Free",description:"For getting started",monthlyPrice:0,features:["5 video recordings per month","2 minute max per video","5 video link shares & emails per month","Screen + camera recording with overlay","AI script generation & teleprompter","Folders & organization","Password-protected links","Basic analytics","720p video quality","VIDAREO watermark"],cta:"Get Started Free",ctaActive:"Current Plan",popular:!1},{tier:"professional",name:"Professional",description:"For power users who need more",monthlyPrice:29.95,annualMonthlyPrice:19.95,features:["Unlimited video recordings","10 minute max per video","Unlimited video link shares & emails","Upload & share existing videos","Presentation mode (PDF & PowerPoint)","Video calls with screen share & recording (up to 4 people)","Advanced analytics & insights","AI transcription","Custom branding (no watermark)","Email & text signature","1080p video quality","Contact management & bulk email","Priority support"],cta:"Upgrade to Pro",ctaActive:"Your Plan",popular:!0,addons:[{name:"Extended Video (30 min)",price:20,description:"Upgrade to 30 min videos"},{name:"Extended Video (60 min)",price:30,description:"Upgrade to 60 min videos"}]}
1101,{tier:"team",name:"Team",description:"For sales teams & organizations",monthlyPrice:19,perUser:!0,minUsers:2,features:["Everything in Professional","Minimum 2 users","Team workspace & management","Admin controls & permissions","Team analytics dashboard","Priority support"],cta:"Upgrade to Team",ctaActive:"Your Plan",popular:!1,addons:[{name:"Extended Video (30 min)",price:20,description:"Per user add-on for 30 min videos",perUser:!0},{name:"Extended Video (60 min)",price:30,description:"Per user add-on for 60 min videos",perUser:!0}]}],See=({hideHeader:e=!1})=>{if(lr())return null;const[t,n]=h.useState(!0),[s,a]=h.useState(!0),[i,o]=h.useState(!1),[l,c]=h.useState(!1),[d,u]=h.useState(null),{subscriptionTier:m,subscribed:f,createCheckout:p,openCustomerPortal:x}=Jl(),{user:g}=nr(),v=Sr(),y=(N,_)=>_&&N.annualMonthlyPrice?N.annualMonthlyPrice:_?Math.round(N.monthlyPrice*.8):N.monthlyPrice,b=N=>N.annualMonthlyPrice?Number((N.annualMonthlyPrice*12).toFixed(2)):Math.round(N.monthlyPrice*.8)*12,w=N=>N.annualMonthlyPrice?Math.round((1-N.annualMonthlyPrice/N.monthlyPrice)*100):20,S=N=>N==="Professional"?t:N==="Team"?s:!0,j=(N,_)=>{N==="Professional"&&n(_),N==="Team"&&a(_)};return r.jsx("section",{id:"pricing",className:"py-16 sm:py-20 md:py-28 bg-background mesh-gradient",children:r.jsxs("div",{className:"container mx-auto px-5 sm:px-6 lg:px-8",children:[r.jsx(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-10 sm:mb-14 md:mb-16",children:!e&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-primary font-semibold text-sm uppercase tracking-wider",children:"Pricing"}),r.jsxs("h2",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-extrabold text-foreground mt-4 mb-4 sm:mb-6",children:["Simple, ",r.jsx("span",{className:"text-gradient",children:"Affordable"})," Pricing"]}),r.jsx("p",{className:"text-sm sm:text-base md:text-lg text-muted-foreground max-w-4xl mx-auto",children:"No hidden fees, no surprises. Start free and scale as you grow."})]})}),r.jsx("div",{className:"grid sm:grid-cols-2 md:grid-cols-3 gap-4 sm:gap-6 md:gap-6 lg:gap-8 max-w-5xl mx-auto [&>*:last-child]:max-sm:col-span-1 [&>*:last-child]:sm:col-span-2 [&>*:last-child]:md:col-span-1",children:CAe.map((N,_)=>{const C=S(N.name),k=N.monthlyPrice>0,E=g&&m===N.tier;g&&f&&N.tier;const R=g&&(m==="starter"&&N.tier!=="starter"||m==="professional"&&N.tier==="team"),T=()=>{N.tier==="starter"?f?x():v("/settings"):(u({tier:N.tier,billingPeriod:C?"annual":"monthly",quantity:N.tier==="team"?2:void 0,monthlyPrice:y(N,C),isPerUser:N.perUser}),c(!0))},D=async(A,V,U,O)=>{if(d){o(!0);try{const M=A?[A]:[];O?localStorage.setItem("signup_promo_code",O):localStorage.removeItem("signup_promo_code"),await p(d.tier,V,U||d.quantity,M)}finally{o(!1),c(!1),u(null)}}};return r.jsxs(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:_*.1},className:`relative rounded-2xl p-8 ${E?"ring-2 ring-accent ring-offset-2 ring-offset-background":""} ${N.popular?"bg-secondary text-secondary-foreground border-2 border-primary shadow-xl shadow-primary/10":"bg-card border border-border/50"}`,children:[E&&r.jsxs("div",{className:"absolute -top-4 right-4 inline-flex items-center gap-1 bg-accent text-accent-foreground px-3 py-1 rounded-full text-xs font-semibold shadow-sm",children:[r.jsx(cl,{className:"w-3.5 h-3.5"}),"Your Plan"]}),N.popular&&!E&&r.jsxs("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 inline-flex items-center gap-1 bg-primary text-primary-foreground px-4 py-1 rounded-full text-sm font-semibold",children:[r.jsx(Ib,{className:"w-4 h-4 fill-current"}),"Most Popular"]}),N.popular&&E&&r.jsxs("div",{className:"absolute -top-4 left-4 inline-flex items-center gap-1 bg-primary text-primary-foreground px-3 py-1 rounded-full text-xs font-semibold",children:[r.jsx(Ib,{className:"w-3.5 h-3.5 fill-current"}),"Popular"]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:`text-xl font-bold mb-2 ${N.popular?"text-secondary-foreground":"text-foreground"}`,children:N.name}),r.jsx("p",{className:`text-sm ${N.popular?"text-secondary-foreground
1101/80":"text-muted-foreground"}`,children:N.description}),N.monthlyPrice>0&&!f&&r.jsx("p",{className:`text-xs font-semibold mt-2 ${N.popular?"text-accent":"text-primary"}`,children:"14-day free trial · No charge today"})]}),k&&r.jsx("div",{className:"mb-4",children:r.jsxs("div",{className:`inline-flex items-center gap-1 p-1 rounded-lg ${N.popular?"bg-secondary-foreground/10":"bg-muted/50"} border ${N.popular?"border-secondary-foreground/20":"border-border"}`,children:[r.jsx("button",{onClick:()=>j(N.name,!1),className:`px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${C?N.popular?"text-secondary-foreground/60 hover:text-secondary-foreground/80":"text-muted-foreground hover:text-foreground":N.popular?"bg-secondary-foreground/20 text-secondary-foreground":"bg-card text-foreground shadow-sm"}`,children:"Monthly"}),r.jsxs("button",{onClick:()=>j(N.name,!0),className:`px-3 py-1.5 rounded-md text-xs font-semibold transition-all flex items-center gap-1.5 ${C?N.popular?"bg-secondary-foreground/20 text-secondary-foreground":"bg-card text-foreground shadow-sm":N.popular?"text-secondary-foreground/60 hover:text-secondary-foreground/80":"text-muted-foreground hover:text-foreground"}`,children:["Annual",r.jsxs("span",{className:`px-1.5 py-0.5 rounded-full text-[10px] font-bold ${C?N.popular?"bg-accent text-accent-foreground":"bg-primary text-primary-foreground":N.popular?"bg-accent/30 text-accent":"bg-primary/20 text-primary"}`,children:["-",w(N),"%"]})]})]})}),r.jsx("div",{className:"mb-2",children:N.monthlyPrice===0?r.jsx("span",{className:`text-5xl font-extrabold ${N.popular?"text-secondary-foreground":"text-foreground"}`,children:"Free"}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:`text-5xl font-extrabold ${N.popular?"text-secondary-foreground":"text-foreground"}`,children:["$",y(N,C)]}),r.jsxs("span",{className:`text-sm ${N.popular?"text-secondary-foreground/80":"text-muted-foreground"}`,children:["/",N.perUser?"user/":"","mo"]})]})}),N.minUsers&&N.minUsers>=2&&r.jsxs("p",{className:`text-sm font-medium mb-2 ${N.popular?"text-secondary-foreground/80":"text-muted-foreground"}`,children:["Minimum ",N.minUsers," users"]}),C&&N.monthlyPrice>0&&r.jsxs(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-6",children:[r.jsxs("p",{className:`text-sm ${N.popular?"text-secondary-foreground/70":"text-muted-foreground"}`,children:["$",b(N),N.perUser?"/user":""," billed annually"]}),r.jsxs("p",{className:`text-xs ${N.popular?"text-accent":"text-primary"} font-medium`,children:["You save $",Math.round((N.monthlyPrice-y(N,!0))*12),N.perUser?"/user":"","/year"]})]}),(!C||N.monthlyPrice===0)&&r.jsx("div",{className:"mb-6"}),r.jsx("ul",{className:"space-y-3 mb-8",children:N.features.map(A=>r.jsxs("li",{className:"flex items-start gap-3",children:[r.jsx(nt,{className:`w-5 h-5 flex-shrink-0 ${N.popular?"text-accent":"text-primary"}`}),r.jsx("span",{className:`text-sm ${N.popular?"text-secondary-foreground/90":"text-muted-foreground"}`,children:A})]},A))}),N.addons&&N.addons.length>0&&r.jsxs("div",{className:`mb-6 p-3 rounded-lg border ${N.popular?"bg-secondary-foreground/5 border-secondary-foreground/20":"bg-muted/30 border-border"}`,children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(cr,{className:`w-4 h-4 ${N.popular?"text-accent":"text-primary"}`}),r.jsx("span",{className:`text-xs font-semibold ${N.popular?"text-secondary-foreground":"text-foreground"}`,children:"Optional Add-ons"})]}),r.jsx("div",{className:"space-y-2",children:N.addons.map((A,V)=>r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:`text-sm ${N.popular?"text-secondary-foreground/80":"text-muted-foreground"}`,children:A.description}),r.jsxs("span",{className:`text-sm font-bold ${N.popular?"text-secondary-foreground":"text-foreground"}`,children:["+$",A.price,A.perUser?"/user":"","/mo"]})]},V))})]}),E?r.jsxs("div",{className:"space-y-2",children:[r.jsxs(P,{variant:"outline",size:"lg",className:"w-full",disabled:!0,children:[r.jsx(cl,{className:"w-4 h-4"}),N.ctaActive]}),f&&r.jsx(P,{variant:"ghost",size:"sm",className:"w-full text-muted-foreground",onClick:()=>x(),children:"Manage Subscription"})]}):g?r.jsxs(r.Fragment,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:N.popular?"hero":"outline",size:"lg",className:"w-full group",disabled:i,onClick:T,children:i&&(d==null?void 0:d.tier)===N.tier?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"animate-spin mr-2",children:"⏳"}),"Processing..."]}):r.jsxs(r.Fragment,{children:[N.name==="Free"&&r.jsx(lg,{className:"w-4 h-4 transition-transform group-hover:-rotate-12"}),N.name==="Professional"&&r.jsx(ya,{className:"w-4 h-4"}),N.name==="Team"&&r.jsx(Ms,{className:"w-4 h-4"}),R?N.cta:N.tier==="starter"?"Manage Plan":N.cta]})})}),r.jsx(yt,{side:"bottom",className:"max-w-[200px]",children:N.tier==="starter"?"Manage your current subscription":N.tier==="professional"?"Unlock unlimited recordings, 10 min videos, HD quality & custom branding":"Get team workspace, admin controls & collaboration features"})]}),(d==null?void 0:d.tier)===N.tier&&r.jsx(_Ae,{open:l,onOpenChange:A=>{c(A),A||u(null)},planName:N.name,planTier:N.tier,monthlyPrice:N.monthlyPrice,annualPrice:y(N,!0),billingPeriod:d.billingPeriod,isPerUser:d.isPerUser,minUsers:N.minUsers||2,onConfirm:D,isLoading:i})]}):r.jsx(Cr,{to:"/auth",className:"w-full",children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:N.popular?"hero":"outline",size:"lg",className:"w-full group",children:[N.name==="Free"&&r.jsx(lg,{className:"w-4 h-4 transition-transform group-hover:-rotate-12"}),N.name==="Professional"&&r.jsx(ya,{className:"w-4 h-4"}),N.name==="Team"&&r.jsx(Ms,{className:"w-4 h-4"}),N.cta]})}),r.jsx(yt,{side:"bottom",className:"max-w-[200px]",children:N.tier==="starter"?"Create your free account to get started":N.tier==="professional"?"Unlock unlimited recordings, 10 min videos, HD quality & custom branding":"Get team workspace, admin controls & collaboration features"})]})})]},N.name)})}),r.jsx(fe.p,{initial:{opacity:0}
1101,whileInView:{opacity:1},viewport:{once:!0},transition:{delay:.5},className:"text-center text-sm text-muted-foreground mt-8",children:"Start free and upgrade anytime. No credit card required."}),r.jsxs(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"mt-20",children:[r.jsx("h3",{className:"text-2xl md:text-3xl font-bold text-foreground text-center mb-8",children:"Compare All Features"}),r.jsx("div",{className:"max-w-4xl mx-auto rounded-xl border border-border overflow-hidden bg-card",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{className:"bg-muted/50 hover:bg-muted/50",children:[r.jsx(ar,{className:"w-[40%] font-semibold text-foreground",children:"Feature"}),r.jsx(ar,{className:"text-center font-semibold text-foreground",children:"Free"}),r.jsx(ar,{className:"text-center font-semibold text-foreground bg-primary/10",children:"Professional"}),r.jsx(ar,{className:"text-center font-semibold text-foreground",children:"Team"})]})}),r.jsxs(du,{children:[r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Recording & Video"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Video recordings per month"}),r.jsx(Te,{className:"text-center",children:"5"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"Unlimited"}),r.jsx(Te,{className:"text-center",children:"Unlimited"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Max video duration"}),r.jsx(Te,{className:"text-center",children:"2 min"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"10 min"}),r.jsx(Te,{className:"text-center",children:"10 min"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Extended duration (add-ons)"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsxs("div",{className:"text-xs space-y-0.5",children:[r.jsx("div",{children:"30 min (+$20/mo)"}),r.jsx("div",{children:"60 min (+$30/mo)"})]})}),r.jsx(Te,{className:"text-center",children:r.jsxs("div",{className:"text-xs space-y-0.5",children:[r.jsx("div",{children:"30 min (+$20/user/mo)"}),r.jsx("div",{children:"60 min (+$30/user/mo)"})]})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Video quality"}),r.jsx(Te,{className:"text-center",children:"720p"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"1080p HD"}),r.jsx(Te,{className:"text-center",children:"1080p HD"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Screen + camera with overlay"}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Upload & share existing videos"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Presentation mode (PDF & PowerPoint)"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Tools & Productivity"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"AI script generation & teleprompter"}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"AI transcription"}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Folders & organization"}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Sharing & Distribution"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Video shares per month"}),r.jsx(Te,{className:"text-center",children:"5"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"Unlimited"}),r.jsx(Te,{className:"text-center",children:"Unlimited"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Password-protected links"}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Contact management & bulk email"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground
1101/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Analytics & Insights"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"View tracking"}),r.jsx(Te,{className:"text-center",children:"Basic"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"Advanced"}),r.jsx(Te,{className:"text-center",children:"Advanced"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Watch time analytics"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Branding & Customization"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Watermark"}),r.jsx(Te,{className:"text-center",children:"Vidareo"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"Custom logo"}),r.jsx(Te,{className:"text-center",children:"Custom logo"})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Email & text signature"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Communication"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Video calls with screen share & recording (up to 4)"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Team & Enterprise"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Team workspace"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Team analytics"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Admin controls"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground/50 mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Priority support"}),r.jsx(Te,{className:"text-center",children:r.jsx(zt,{className:"w-4 h-4 text-muted-foreground
1101/50 mx-auto"})}),r.jsx(Te,{className:"text-center bg-primary/5",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})}),r.jsx(Te,{className:"text-center",children:r.jsx(nt,{className:"w-4 h-4 text-primary mx-auto"})})]}),r.jsx(pr,{className:"bg-muted/30 hover:bg-muted/30",children:r.jsx(Te,{colSpan:4,className:"font-semibold text-foreground text-sm uppercase tracking-wide py-3",children:"Support"})}),r.jsxs(pr,{children:[r.jsx(Te,{className:"text-muted-foreground",children:"Support level"}),r.jsx(Te,{className:"text-center",children:"Email"}),r.jsx(Te,{className:"text-center bg-primary/5",children:"Priority"}),r.jsx(Te,{className:"text-center",children:"Dedicated manager"})]})]})]})})]})]})})},uu=()=>lr()?null:r.jsx("section",{className:"bg-background",children:r.jsx("div",{className:"max-w-7xl mx-auto px-5 sm:px-6 lg:px-8 pb-16 sm:pb-24 md:pb-32",children:r.jsxs(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.7},className:"rounded-[1.75rem] sm:rounded-[2.5rem] px-6 py-12 sm:p-14 md:p-20 text-center relative overflow-hidden shadow-xl shadow-foreground/10",children:[r.jsx("img",{src:iee,alt:"",className:"absolute inset-0 w-full h-full object-cover",loading:"lazy"}),r.jsx("div",{className:"absolute inset-0 bg-[hsl(222_47%_11%/0.82)]"}),r.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,hsl(217_91%_60%/0.22)_0%,transparent_65%)] pointer-events-none"}),r.jsxs("div",{className:"relative z-10",children:[r.jsx("span",{className:"inline-block px-3 py-1 mb-4 sm:mb-6 text-[11px] sm:text-xs font-bold tracking-widest text-primary-foreground uppercase bg-primary/40 backdrop-blur-sm rounded-full",children:"Start in 2 minutes"}),r.jsxs("h2",{className:"font-display text-[1.875rem] sm:text-4xl md:text-5xl lg:text-6xl font-extrabold text-primary-foreground mb-4 sm:mb-6 tracking-tight leading-[1.08] text-balance",children:["Ready to transform",r.jsx("br",{}),"your workflow?"]}),r.jsx("p",{className:"text-sm sm:text-base md:text-lg text-primary-foreground/70 max-w-2xl mx-auto mb-7 sm:mb-10 leading-relaxed",children:"Start using VIDAREO to skip the meetings and get more done - through video that actually gets watched."}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[r.jsx(Cr,{to:"/auth?mode=signup",className:"w-full sm:w-auto",children:r.jsxs(P,{size:"lg",className:"w-full sm:w-auto group h-12 sm:h-14 px-8 sm:px-10 rounded-full bg-primary text-primary-foreground font-bold hover:scale-[1.02] hover:shadow-2xl hover:shadow-primary/40 transition-all",children:[r.jsx(lg,{className:"w-5 h-5 transition-transform group-hover:-rotate-12"}),"Start Free Trial",r.jsx(Ya,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),r.jsx("p",{className:"text-xs text-primary-foreground/60 font-medium uppercase tracking-widest",children:"14-day trial · Credit card required"})]})]})]})})}),Ka=()=>{const e=lr();if(e)return null;const t={Product:[{name:"Features",href:"/features"},{name:"How it Works",href:"/how-it-works"},{name:"All Products",href:"/products"},...e?[]:[{name:"Pricing",href:"/pricing"}]],Products:[{name:"Presentations",href:"/products/presentations"},{name:"Chrome Extension",href:"/products/chrome-extension"},{name:"Video Calls",href:"/products/video-calls"},{name:"Contacts & Emailing",href:"/products/contacts-and-emailing"}],"Use Cases":[{name:"Sales Teams",href:"/use-cases/sales-teams"},{name:"Async Teams",href:"/use-cases/async-teams"},{name:"Real Estate",href:"/use-cases/real-estate"},{name:"Customer Success",href:"/use-cases/customer-success"},{name:"All Use Cases",href:"/use-cases"}],Compare:[{name:"Loom Alternative",href:"/loom-alternative"},{name:"VIDAREO vs BombBomb",href:"/vidareo-vs-bombbomb"},{name:"VIDAREO vs Vidyard",href:"/vidareo-vs-vidyard"},{name:"VIDAREO vs Sendspark",href:"/vidareo-vs-sendspark"},{name:"Async Video Messaging",href:"/async-video-messaging"},{name:"Screen Recorder + Teleprompter",href:"/screen-recorder-with-teleprompter"},{name:"Personalized Video Messaging",href:"/personalized-video-messaging"}],Company:[{name:"About",href:"/about"},{name:"Contact",href:"/contact"},{name:"FAQ",href:"/faq"}],Legal:[{name:"Privacy",href:"/privacy"},{name:"Terms",href:"/terms"}
1101,{name:"Accessibility",href:"/accessibility"}]};return r.jsx("footer",{className:"bg-secondary text-secondary-foreground py-20",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-7 gap-10 mb-14",children:[r.jsxs("div",{className:"lg:col-span-2",children:[r.jsxs("a",{href:"#",className:"flex items-center gap-2.5 mb-5",children:[r.jsx("div",{className:"w-11 h-11 rounded-xl overflow-hidden flex items-center justify-center",children:r.jsx("img",{src:ch,alt:"VIDAREO",className:"w-full h-full object-contain"})}),r.jsx("span",{className:"text-xl font-bold",children:"VIDAREO"})]}),r.jsxs("p",{className:"text-sm font-semibold text-secondary-foreground/90 mb-3",children:[r.jsx("span",{className:"text-red-400",children:"Record"}),r.jsx("span",{className:"mx-1.5 text-secondary-foreground/40",children:"•"}),r.jsx("span",{className:"text-primary",children:"Share"}),r.jsx("span",{className:"mx-1.5 text-secondary-foreground/40",children:"•"}),r.jsx("span",{className:"text-green-400",children:"Connect"})]}),r.jsx("p",{className:"text-secondary-foreground/70 mb-5 max-w-xs text-sm leading-relaxed",children:"Video messaging that builds lasting connections with your prospects, clients, and team."}),r.jsxs("div",{className:"flex gap-4",children:[r.jsx("a",{href:"https://www.instagram.com/vidareo.app/",target:"_blank",rel:"noopener noreferrer",className:"text-secondary-foreground/50 hover:text-primary transition-colors","aria-label":"Instagram",children:r.jsx(pue,{className:"w-5 h-5"})}),r.jsx("a",{href:"https://www.linkedin.com/company/vidareo",target:"_blank",rel:"noopener noreferrer",className:"text-secondary-foreground/50 hover:text-primary transition-colors","aria-label":"LinkedIn",children:r.jsx(bue,{className:"w-5 h-5"})})]})]}),Object.entries(t).map(([n,s])=>r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold mb-4",children:n}),r.jsx("ul",{className:"space-y-2.5",children:s.map(a=>r.jsx("li",{children:a.href.startsWith("/")?r.jsx(Cr,{to:a.href,className:"text-secondary-foreground/70 hover:text-primary transition-colors text-sm",children:a.name}):r.jsx("a",{href:a.href,className:"text-secondary-foreground/70 hover:text-primary transition-colors text-sm",children:a.name})},a.name))})]},n))]}),r.jsxs("div",{className:"border-t border-secondary-foreground/10 pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[r.jsxs("p",{className:"text-sm text-secondary-foreground/50",children:["© ",new Date().getFullYear()," Summit 23 LLC dba VIDAREO. All rights reserved."]}),r.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-6",children:[r.jsxs("p",{className:"text-xs text-secondary-foreground/40",children:["We use cookies for authentication and analytics."," ",r.jsx(Cr,{to:"/privacy",className:"hover:text-primary transition-colors underline",children:"Read our Privacy Policy"})]}),r.jsxs("div",{className:"flex gap-6",children:[r.jsx(Cr,{to:"/privacy",className:"text-sm text-secondary-foreground/50 hover:text-primary transition-colors",children:"Privacy Policy"}),r.jsx(Cr,{to:"/terms",className:"text-sm text-secondary-foreground/50 hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})]})})},Bh="/assets/vidareo-logo-full-BoyZxyfu.png",kAe="/assets/onboarding-record-D6RpUgNm.png",EAe="/assets/onboarding-share-Bk0cbURA.png",AAe="/assets/onboarding-connect-B6HoowYH.png",Nh=[{id:1,image:kAe,iconBg:"bg-gradient-to-br from-rose-500 to-orange-500"},{id:2,image:EAe,iconBg:"bg-gradient-to-br from-blue-500 to-cyan-500"},{id:3,image:AAe,iconBg:"bg-gradient-to-br from-emerald-500 to-green-500"}],TAe=[{id:"free",name:"Starter",monthlyPrice:0,annualPrice:0,period:"Forever free",icon:_n,gradient:"from-slate-500 to-slate-600",features:["5 videos/month","2 min max","720p quality"],description:"Perfect to try it out"},{id:"professional",name:"Pro",monthlyPrice:29.95,annualPrice:19.95,period:"/month",icon:Ms,gradient:"from-primary to-blue-600",popular:!0,features:["Unlimited videos","10 min max","1080p HD"],description:"For power users"}
1101,{id:"team",name:"Team",monthlyPrice:19,annualPrice:15,period:"/user/month",icon:Nx,gradient:"from-emerald-500 to-green-600",features:["Everything in Pro","Team workspace","Analytics"],description:"Scale with your team"}],_ee=h.memo(({index:e,isActive:t,iconBg:n,onClick:s})=>r.jsx("button",{onClick:s,className:"relative p-2 transition-all duration-300 ease-out touch-manipulation","aria-label":`Go to slide ${e+1}`,children:r.jsx(fe.div,{animate:{scale:t?1:.85,opacity:t?1:.5},className:`rounded-full transition-all duration-300 ${t?`w-3.5 h-3.5 ${n} shadow-lg ring-2 ring-white/20`:"w-2.5 h-2.5 bg-muted-foreground/40"}`})}));_ee.displayName="SlideIndicator";const Cee=h.memo(({plan:e,isSelected:t,isAnnual:n,onSelect:s})=>{const a=e.icon;return r.jsx(fe.button,{onClick:s,layout:!0,className:`w-full p-4 rounded-2xl border-2 text-left transition-all active:scale-[0.98] ${t?"border-primary bg-primary/5 shadow-lg shadow-primary/10":"border-border bg-card hover:border-primary/30"}`,whileTap:{scale:.98},children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`w-11 h-11 rounded-xl bg-gradient-to-br ${e.gradient} flex items-center justify-center shrink-0 shadow-md`,children:r.jsx(a,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-bold text-foreground",children:e.name}),e.popular&&r.jsx("span",{className:"text-[10px] font-semibold bg-gradient-to-r from-primary to-blue-600 text-white px-2 py-0.5 rounded-full shadow-sm",children:"Most Popular"})]}),r.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:e.description}),r.jsx("div",{className:"flex items-baseline gap-1 mt-1.5",children:e.monthlyPrice===0?r.jsx("span",{className:"text-xl font-bold text-foreground",children:"Free"}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"text-xl font-bold text-foreground",children:["$",n?e.annualPrice:e.monthlyPrice]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e.period})]})}),r.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2",children:e.features.map((i,o)=>r.jsxs("span",{className:"text-[11px] text-muted-foreground flex items-center gap-1",children:[r.jsx(nt,{className:"w-3 h-3 text-emerald-500"}),i]},o))})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 transition-all ${t?"border-primary bg-primary scale-110":"border-muted-foreground/30"}`,children:t&&r.jsx(nt,{className:"w-3 h-3 text-primary-foreground"})})]})})});Cee.displayName="PlanCard";const RAe=()=>{const e=lr(),[t,n]=h.useState("onboarding"),[s,a]=h.useState(0),[i,o]=h.useState(!1),[l,c]=h.useState("professional"),[d,u]=h.useState(2),[m,f]=h.useState(null),[p,x]=h.useState(!0),g=Sr(),[v,y]=h.useState(0);Gr();const b=i2e(),w=h.useRef(null);h.useEffect(()=>{if(t==="onboarding")return w.current=setInterval(()=>{y(1),a(A=>(A+1)%Nh.length)},4e3),()=>{w.current&&clearInterval(w.current)}},[t]);const S=h.useCallback(()=>{w.current&&clearInterval(w.current),w.current=setInterval(()=>{y(1),a(A=>(A+1)%Nh.length)},4e3)},[]),j=h.useCallback(()=>{y(1),a(A=>(A+1)%Nh.length),S()},[S]),N=h.useCallback(()=>{y(-1),a(A=>(A-1+Nh.length)%Nh.length),S()},[S]),_=h.useCallback(A=>{y(A>s?1:-1),a(A),S()},[s,S]),C=h.useCallback(()=>{n("plans")},[]),k=h.useCallback(()=>{localStorage.setItem("signup_selected_plan",l),localStorage.setItem("signup_billing_period",p?"annual":"monthly"),l==="team"&&localStorage.setItem("signup_team_member_count",d.toString()),localStorage.removeItem("signup_addon_extended_video"),localStorage.removeItem("signup_addon_type"),(l==="professional"||l==="team")&&m&&(localStorage.setItem("signup_addon_extended_video","true"),localStorage.setItem("signup_addon_type",m)),g("/auth?mode=signup")},[l,p,d,m,g]),E=h.useCallback(()=>{g("/auth?mode=login")},[g]),R=h.useCallback(A=>{c(A),A!=="team"&&u(2),A==="free"&&f(null)},[]),T={enter:A=>({x:b?0:A>0?150:-150,opacity:0,scale:b?1:.92}),center:{x:0,opacity:1,scale:1},exit:A=>({x:b?0:A<0?150:-150,opacity:0,scale:b?1:.92})},D=Nh[s];return t==="plans"?r.jsxs("main",{className:"h-[100dvh] bg-background flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"pt-[max(1rem,calc(env(safe-area-inset-top)+0.5rem))] pb-2 px-4 flex items-center justify-between shrink-0",children:[r.jsx(fe.button,{onClick:()=>n("onboarding"),className:"text-sm text-muted-foreground active:opacity-70 flex items-center gap-1",whileTap:{scale:.95},children:"← Back"}),r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-8 w-auto"}),r.jsx("div",{className:"w-12"})]}),r.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:r.jsxs(fe.div,{initial:{opacity:0,y:20}
1101,animate:{opacity:1,y:0},transition:{duration:.4},className:"space-y-4",children:[r.jsxs("div",{className:"text-center pt-2",children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Choose Your Plan"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Start free, upgrade anytime"})]}),r.jsxs(fe.div,{className:"flex items-center justify-center gap-3 py-3 bg-muted/30 rounded-2xl mx-auto max-w-xs",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.1},children:[r.jsx("span",{className:`text-sm font-medium transition-colors ${p?"text-muted-foreground":"text-foreground"}`,children:"Monthly"}),r.jsx(rr,{checked:p,onCheckedChange:x,className:"data-[state=checked]:bg-primary"}),r.jsx("span",{className:`text-sm font-medium transition-colors ${p?"text-foreground":"text-muted-foreground"}`,children:"Annual"}),r.jsx(Ts,{children:p&&r.jsx(fe.span,{initial:{opacity:0,scale:.8,x:-10},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.8,x:-10},className:"text-[10px] font-bold bg-gradient-to-r from-emerald-500 to-green-600 text-white px-2 py-0.5 rounded-full shadow-sm",children:"Save 33%"})})]}),r.jsx("div",{className:"space-y-3",children:TAe.filter(A=>!e||A.id!=="team").map((A,V)=>r.jsx(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15+V*.08},children:r.jsx(Cee,{plan:A,isSelected:l===A.id,isAnnual:p,onSelect:()=>R(A.id)})},A.id))}),r.jsx(Ts,{children:l==="team"&&r.jsx(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:r.jsxs("div",{className:"bg-muted/50 rounded-xl p-4 border border-border",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium",children:"Team members"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(fe.button,{onClick:()=>u(Math.max(2,d-1)),disabled:d<=2,className:"w-8 h-8 rounded-full bg-background border border-border flex items-center justify-center disabled:opacity-40",whileTap:{scale:.9},children:r.jsx(ag,{className:"w-4 h-4"})}),r.jsx("span",{className:"w-8 text-center font-bold text-lg",children:d}),r.jsx(fe.button,{onClick:()=>u(d+1),className:"w-8 h-8 rounded-full bg-background border border-border flex items-center justify-center",whileTap:{scale:.9},children:r.jsx(Ns,{className:"w-4 h-4"})})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["$",(p?15:19)*d,"/",p?"month (billed annually)":"month"," total"]})]})})}),r.jsx(Ts,{children:(l==="professional"||l==="team")&&r.jsx(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2 px-1",children:[r.jsx(fr,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"text-sm font-medium",children:"Extended Video Length (Optional)"})]}),r.jsx(fe.button,{onClick:()=>f(m==="extended_video_30"?null:"extended_video_30"),className:`w-full p-3 rounded-xl border-2 text-left transition-all ${m==="extended_video_30"?"border-primary bg-primary/5":"border-border bg-card"}`,whileTap:{scale:.98},children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium",children:mm.extended_video_30.name}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["+$",mm.extended_video_30.price,"/month"]})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${m==="extended_video_30"?"border-primary bg-primary":"border-muted-foreground/30"}`,children:m==="extended_video_30"&&r.jsx(nt,{className:"w-3 h-3 text-primary-foreground"})})]})}),r.jsx(fe.button,{onClick:()=>f(m==="extended_video_60"?null:"extended_video_60"),className:`w-full p-3 rounded-xl border-2 text-left transition-all ${m==="extended_video_60"?"border-primary bg-primary/5":"border-border bg-card"}`,whileTap:{scale:.98},children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium",children:mm.extended_video_60.name}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["+$",mm.extended_video_60.price,"/month"]})]}),r.jsx("span",{className:"text-[10px] font-semibold bg-gradient-to-r from-emerald-500 to-green-600 text-white px-2 py-0.5 rounded-full",children:"Best Value"})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${m==="extended_video_60"?"border-primary bg-primary":"border-muted-foreground
1101/30"}`,children:m==="extended_video_60"&&r.jsx(nt,{className:"w-3 h-3 text-primary-foreground"})})]})})]})})})]})}),r.jsxs("div",{className:"px-5 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3 bg-background/95 backdrop-blur-lg border-t border-border shrink-0 space-y-2",children:[r.jsxs(P,{onClick:k,disabled:i,className:"w-full h-12 text-sm font-semibold rounded-xl shadow-lg shadow-primary/25 active:scale-[0.98] transition-all flex items-center justify-center gap-2",size:"lg",children:["Continue with Email",r.jsx(Hl,{className:"w-4 h-4"})]}),r.jsxs("p",{className:"text-center text-xs text-muted-foreground pt-1",children:["Already have an account?"," ",r.jsx("button",{onClick:E,disabled:i,className:"text-primary font-semibold hover:underline active:opacity-70",children:"Sign In"})]})]})]}):r.jsxs("main",{className:"h-[100dvh] bg-gradient-to-b from-background via-background to-muted/30 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex-1 flex flex-col items-center px-2 min-h-0 overflow-hidden pt-[max(0.5rem,env(safe-area-inset-top))]",children:r.jsxs("div",{className:"relative w-full flex flex-col items-center min-h-0 flex-1",onTouchStart:A=>{const V=A.touches[0].clientX,U=O=>{const M=O.changedTouches[0].clientX,$=V-M;Math.abs($)>40&&($>0?j():N()),document.removeEventListener("touchend",U)};document.addEventListener("touchend",U)},children:[r.jsx("div",{className:"relative w-full flex-1 min-h-0 mt-1",children:r.jsx(Ts,{mode:"wait",custom:v,children:r.jsx(fe.div,{custom:v,variants:T,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.25},scale:{duration:.25}},className:"absolute inset-0 flex items-center justify-center",children:r.jsx("img",{src:D.image,alt:`Onboarding slide ${s+1}`,className:"w-full h-full object-contain",loading:"eager"})},s)})}),r.jsx("div",{className:"flex items-center justify-center gap-2 shrink-0 pb-2",children:Nh.map((A,V)=>r.jsx(_ee,{index:V,isActive:V===s,iconBg:A.iconBg,onClick:()=>_(V)},V))})]})}),r.jsxs("div",{className:"px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-2 bg-background/95 backdrop-blur-lg shrink-0 space-y-2",children:[r.jsxs(P,{onClick:C,disabled:i,className:"w-full h-12 sm:h-14 text-base sm:text-lg font-bold rounded-xl shadow-lg shadow-primary/30 active:scale-[0.98] transition-all touch-manipulation flex items-center justify-center gap-2",size:"lg",children:["Get Started Free",r.jsx(Hl,{className:"w-5 h-5"})]}),r.jsxs("p",{className:"text-center text-sm text-muted-foreground py-1",children:["Already have an account?"," ",r.jsx("button",{onClick:E,disabled:i,className:"text-primary font-bold hover:underline active:opacity-70 touch-manipulation",children:"Sign In"})]})]})]})},OAe={"@context":"https://schema.org","@type":"Organization",name:"VIDAREO",url:"https://vidareo.com",logo:"https://vidareo.com/vidareo-logo-large.png",description:"Send personalized video messages that build real relationships. Perfect for sales outreach, customer success, and team collaboration.",sameAs:["https://www.instagram.com/vidareo.app/","https://www.linkedin.com/company/vidareo"],contactPoint:{"@type":"ContactPoint",contactType:"customer support",email:"[email protected]"}},PAe={"@context":"https://schema.org","@type":"WebSite",name:"VIDAREO",url:"https://vidareo.com",description:"Video messaging platform for sales, customer success, and team collaboration"},DAe=()=>{const{user:e,loading:t}=nr(),n=ih(),s=Sr(),i=ja().hash==="#pricing";return h.useEffect(()=>{const o="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",l="Screen recording with a built-in AI teleprompter, secure encrypted hosting, and live meetings. Trusted by sales teams to create polished videos. Start free.";document.title=o;const c=(d,u)=>{var m;return(m=document.querySelector(d))==null?void 0:m.setAttribute("content",u)};c('meta[name="description"]',l),c('meta[property="og:title"]',o),c('meta[property="og:description"]',l),c('meta[property="og:url"]',"https://vidareo.com/"),c('meta[name="twitter:title"]',o),c('meta[name="twitter:description"]',l)},[]),h.useEffect(()=>{const o=(l,c)=>{if(!document.querySelector(`script[data-${l}]`)){const u=document.createElement("script");u.type="application/ld+json",u.setAttribute(`data-${l}`,"true"),u.textContent=JSON.stringify(c),document.head.appendChild(u)}};return o("organization-jsonld",OAe),o("website-jsonld",PAe),()=>{const l=document.querySelector("script[data-organization-jsonld]"),c=document.querySelector("script[data-website-jsonld]");l&&l.remove(),c&&c.remove()}},[]),h.useEffect(()=>{e&&!t&&!i&&s("/videos",{replace:!0})},[e,t,s,i]),h.useEffect(()=>{i&&setTimeout(()=>{const o=document.getElementById("pricing");o&&o.scrollIntoView({behavior:"smooth"})},100)},[i]),t?r.jsx("main",{className:"min-h-screen flex items-center justify-center",children:r.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent roun
1101ded-full animate-spin"})}):_r()&&n&&!e?r.jsx(RAe,{}):r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{children:[r.jsx(HEe,{}),r.jsx(GEe,{}),r.jsx(XEe,{}),r.jsx(cee,{minimal:!0}),r.jsx(cAe,{}),r.jsx(oAe,{}),r.jsx(mAe,{}),r.jsx(See,{}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})},MAe=Jm("rounded-xl border bg-card text-card-foreground transition-all duration-300",{variants:{variant:{default:"shadow-sm hover:shadow-md",interactive:"shadow-sm hover:shadow-lg hover:border-primary/30 hover:-translate-y-1 cursor-pointer",elevated:"shadow-lg hover:shadow-xl",ghost:"border-transparent shadow-none hover:bg-muted/50",glass:"bg-card/80 backdrop-blur-md border-border/50 shadow-lg",gradient:"bg-gradient-to-br from-card to-muted/50 border-border/50 shadow-md hover:shadow-lg"}},defaultVariants:{variant:"default"}}),Ie=h.forwardRef(({className:e,variant:t,...n},s)=>r.jsx("div",{ref:s,className:ge(MAe({variant:t,className:e})),...n}));Ie.displayName="Card";const Ot=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:ge("flex flex-col space-y-1.5 p-6",e),...t}));Ot.displayName="CardHeader";const $t=h.forwardRef(({className:e,...t},n)=>r.jsx("h3",{ref:n,className:ge("text-2xl font-semibold leading-none tracking-tight",e),...t}));$t.displayName="CardTitle";const xr=h.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));xr.displayName="CardDescription";const lt=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:ge("p-6 pt-0",e),...t}));lt.displayName="CardContent";const IAe=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:ge("flex items-center p-6 pt-0",e),...t}));IAe.displayName="CardFooter";const LAe=()=>{const e=navigator.userAgent;return e.includes("Chrome")&&!e.includes("Edg")?"chrome":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Firefox")?"firefox":e.includes("Edg")?"edge":"other"},$Ae={chrome:{name:"Chrome",steps:["Click the lock/camera icon in the address bar","Select 'Site settings' or 'Permissions'","Set Camera and Microphone to 'Allow'","Reload the page"],settingsUrl:"chrome://settings/content/camera"},safari:{name:"Safari",steps:["Go to Safari → Settings → Websites","Click Camera and Microphone in the sidebar","Find this website and set to 'Allow'","Reload the page"]},firefox:{name:"Firefox",steps:["Click the lock icon in the address bar","Click 'Connection secure' → 'More Information'","Go to 'Permissions' tab","Uncheck 'Use Default' for Camera & Microphone, then select 'Allow'"]},edge:{name:"Edge",steps:["Click the lock icon in the address bar","Click 'Permissions for this site'","Set Camera and Microphone to 'Allow'","Reload the page"]},other:{name:"your browser",steps:["Open your browser's settings","Find Privacy or Permissions settings","Allow camera and microphone access for this website","Reload the page"]}},VAe=({error:e,onRetry:t,isRetrying:n})=>{const s=LAe(),a=$Ae[s],i=e.toLowerCase().includes("permission")||e.toLowerCase().includes("denied")||e.toLowerCase().includes("blocked"),o=e.toLowerCase().includes("not found")||e.toLowerCase().includes("no camera"),l=e.toLowerCase().includes("already in use")||e.toLowerCase().includes("in use");return r.jsxs(fe.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.3,ease:"easeOut"},className:"bg-destructive/5 border border-destructive/20 rounded-2xl p-6 space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-full bg-destructive/10 flex items-center justify-center flex-shrink-0",children:i?r.jsx(Mb,{className:"w-6 h-6 text-destructive"}):o?r.jsx(ga,{className:"w-6 h-6 text-destructive"}):r.jsx(Hd,{className:"w-6 h-6 text-destructive"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-destructive text-lg",children:i?"Camera Access Blocked":o?"No Camera Found":l?"Camera In Use":"Recording Error"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e})]})]}),i&&r.jsxs("div",{className:"bg-card/50 rounded-xl p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[r.jsx(Vm,{className:"w-4 h-4"}),r.jsxs("span",{children:["How to enable permissions in ",a.name,":"]})]}),r.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground pl-1",children:a.steps.map((c,d)=>r.jsxs("li",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-primary/10 text-primary text-xs font-medium flex items-center justify-center",children:d+1}),r.jsx("span",{children:c})]},d))})]}),o&&r.jsxs("div",{className:"bg-card/50 rounded-xl p-4 space-y-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:r.jsx("strong",{children:"Troubleshooting:"})}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"Make sure your camera is connected and turned on"}),r.jsx("li",{children:"Try unplugging and reconnecting your camera"}),r.jsx("li",{children:"Check if another app is using your camera"})]})]}),l&&r.jsxs("div",{className:"bg-card/50 rounded-xl p-4 space-y-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:r.jsx("strong",{children:"Troubleshooting:"})}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"Close other apps that might be using your camera (Zoom, Teams, etc.)"}),r.jsx("li",{children:"Close other browser tabs with camera access"}),r.jsx("li",{children:"Restart your browser if the problem persists"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[t&&r.jsxs(P,{onClick:t,disabled:n,className:"gap-2",children:[r.jsx(vs,{className:`w-4 h-4 ${n?"animate-spin":""}`}),n?"Retrying...":"Try Again"]}),i&&r.jsxs(P,{variant:"outline",onClick:()=>window.location.reload(),className:"gap-2",children:[r.jsx(bn,{className:"w-4 h-4"}),"Reload Page"]})]})]})},UAe=()=>{const e=Sr(),t=h.useRef(null),n=h.useRef(null),s=h.useRef(null),a=h.useRef(null),[i,o]=h.useState(null),[l,c]=h.useState("idle"),[d,u]=h.useState("idle"),[m,f]=h.useState(null),[p,x]=h.useState(0),[g,v]=h.useState([]),[y,b]=h.useState([]),[w,S]=h.useState(""),[j,N]=h.useState(""),[_,C]=h.useState(!0),[k,E]=h.useState(!1),R=h.useCallback(async()=>{try{const M=await navigator.mediaDevices.enumerateDevices(),$=M.filter(
1101B=>B.kind==="videoinput").map(B=>({deviceId:B.deviceId,label:B.label||`Camera ${B.deviceId.slice(0,8)}`})),I=M.filter(B=>B.kind==="audioinput").map(B=>({deviceId:B.deviceId,label:B.label||`Microphone ${B.deviceId.slice(0,8)}`}));v($),b(I),$.length>0&&!w&&S($[0].deviceId),I.length>0&&!j&&N(I[0].deviceId)}catch(M){console.error("Failed to enumerate devices:",M)}},[w,j]),T=h.useCallback(M=>{try{const $=new AudioContext,I=$.createAnalyser();I.fftSize=256,$.createMediaStreamSource(M).connect(I),n.current=$,s.current=I;const K=new Uint8Array(I.frequencyBinCount),Z=()=>{if(!s.current)return;s.current.getByteFrequencyData(K);const q=K.reduce((X,G)=>X+G)/K.length,H=Math.min(100,q/128*100);x(H),a.current=requestAnimationFrame(Z)};Z(),u("success")}catch($){console.error("Failed to start audio monitoring:",$),u("error")}},[]),D=h.useCallback(()=>{a.current&&(cancelAnimationFrame(a.current),a.current=null),n.current&&(n.current.close(),n.current=null),s.current=null,x(0)},[]),A=h.useCallback(async()=>{f(null),c("testing"),u("testing"),E(!1),i&&i.getTracks().forEach(M=>M.stop()),D();try{const M={video:w?{deviceId:{exact:w}}:!0,audio:j?{deviceId:{exact:j}}:!0},$=await navigator.mediaDevices.getUserMedia(M);o($),t.current&&(t.current.srcObject=$,await t.current.play()),c("success"),T($),await R()}catch(M){console.error("Camera test failed:",M),c("error"),u("error");let $="Failed to access camera and microphone";M.name==="NotAllowedError"?$="Camera/microphone permission was denied. Please allow access in your browser settings and try again.":M.name==="NotFoundError"?$="No camera or microphone was found on this device.":M.name==="NotReadableError"&&($="Your camera or microphone is already in use by another app."),f($)}},[w,j,i,D,T,R]),V=h.useCallback(()=>{i&&(i.getTracks().forEach(M=>M.stop()),o(null)),D(),t.current&&(t.current.srcObject=null),c("idle"),u("idle")},[i,D]),U=h.useCallback(()=>{E(!0),A()},[A]);h.useEffect(()=>{R()},[R]),h.useEffect(()=>()=>{i&&i.getTracks().forEach(M=>M.stop()),D()},[i,D]),h.useEffect(()=>{(l==="success"||l==="error")&&A()},[w,j]);const O=M=>{switch(M){case"success":return r.jsx(Se,{variant:"default",className:"bg-green-500/10 text-green-600 border-green-500/20",children:"Working"});case"error":return r.jsx(Se,{variant:"destructive",children:"Failed"});case"testing":return r.jsx(Se,{variant:"secondary",children:"Testing..."});default:return r.jsx(Se,{variant:"outline",children:"Not tested"})}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"container mx-auto px-4 pt-24 md:pt-28 pb-8 max-w-4xl",children:[r.jsxs(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"flex items-center gap-4 mb-6",children:[r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>e(-1),children:r.jsx(aa,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold",children:"Camera & Microphone Test"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Verify your devices work before recording"})]})]}),r.jsx(Ts,{children:m&&r.jsx(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"mb-6",children:r.jsx(VAe,{error:m,onRetry:U,isRetrying:k})})}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsx(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs($t,{className:"flex items-center gap-2 text-lg",children:[r.jsx(ga,{className:"w-5 h-5"}),"Camera Preview"]}),O(l)]})}),r.jsxs(lt,{className:"space-y-4",children:[r.jsxs("div",{className:"relative aspect-video bg-muted rounded-xl overflow-hidden",children:[l==="idle"?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[r.jsx(q4,{className:"w-12 h-12 mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"Camera not started"})]}):l==="testing"?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[r.jsx(vs,{className:"w-12 h-12 mb-2 animate-spin"}),r.jsx("p",{className:"text-sm",children:"Starting camera..."})]}
1101):null,r.jsx("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`w-full h-full object-cover ${_?"scale-x-[-1]":""} ${l!=="success"?"opacity-0":""}`})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(Vm,{className:"w-4 h-4"}),"Select Camera"]}),r.jsxs(kn,{value:w,onValueChange:S,children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"Choose camera..."})}),r.jsx(jn,{children:g.map(M=>r.jsx(_t,{value:M.deviceId,children:M.label},M.deviceId))})]})]}),r.jsx(P,{variant:"outline",size:"sm",onClick:()=>C(!_),className:"w-full",children:_?"Mirrored (Front Camera)":"Normal (Back Camera)"})]})]})}),r.jsx(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:r.jsxs(Ie,{children:[r.jsxs(Ot,{className:"pb-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs($t,{className:"flex items-center gap-2 text-lg",children:[r.jsx(Hd,{className:"w-5 h-5"}),"Microphone Test"]}),O(d)]}),r.jsx(xr,{children:"Speak to see your audio levels"})]}),r.jsxs(lt,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(eW,{className:`w-5 h-5 ${p>10?"text-primary":"text-muted-foreground"}`}),r.jsx("div",{className:"flex-1",children:r.jsx(Lc,{value:p,className:"h-4"})}),r.jsxs("span",{className:"text-sm font-mono w-12 text-right",children:[Math.round(p),"%"]})]}),d==="success"&&r.jsx(fe.div,{initial:{opacity:0}
1101,animate:{opacity:1},className:`text-sm text-center py-2 rounded-lg ${p>30?"bg-green-500/10 text-green-600":p>10?"bg-yellow-500/10 text-yellow-600":"bg-muted text-muted-foreground"}`,children:p>30?"✓ Audio is being detected clearly!":p>10?"Audio detected - speak louder for best results":"Speak into your microphone..."}),d==="idle"&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[r.jsx(cv,{className:"w-12 h-12 mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"Microphone not started"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(Vm,{className:"w-4 h-4"}),"Select Microphone"]}),r.jsxs(kn,{value:j,onValueChange:N,children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"Choose microphone..."})}),r.jsx(jn,{children:y.map(M=>r.jsx(_t,{value:M.deviceId,children:M.label},M.deviceId))})]})]})]})]})})]}),r.jsx(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"flex flex-col sm:flex-row items-center justify-center gap-4 mt-8",children:l==="idle"?r.jsxs(P,{size:"lg",onClick:A,className:"gap-2 w-full sm:w-auto",children:[r.jsx(cr,{className:"w-5 h-5"}),"Start Test"]}):r.jsxs(r.Fragment,{children:[r.jsx(P,{variant:"outline",size:"lg",onClick:V,className:"gap-2 w-full sm:w-auto",children:"Stop Test"}),l==="success"&&d==="success"&&r.jsxs(P,{size:"lg",onClick:()=>e("/videos",{state:{openRecordingModal:!0}}),className:"gap-2 w-full sm:w-auto",children:[r.jsx(cl,{className:"w-5 h-5"}),"Start Recording"]})]})}),r.jsx(Ts,{children:l==="success"&&d==="success"&&r.jsx(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"mt-6",children:r.jsx(Ie,{className:"border-green-500/20 bg-green-500/5",children:r.jsx(lt,{className:"pt-6",children:r.jsxs("div",{className:"flex items-center gap-3 text-green-600",children:[r.jsx(cl,{className:"w-6 h-6"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold",children:"All systems go!"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Your camera and microphone are working correctly."})]})]})})})})})]})]})},kee="/ffmpeg",FV=`${kee}/worker.js`,FAe=["https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm","https://unpkg.com/@ffmpeg/[email protected]/dist/esm","https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm","https://unpkg.com/@ffmpeg/[email protected]/dist/esm"],BAe=10*60*1e3,zAe=60*1e3,Eee=e=>(e||"video").replace(/[\\/:*?"<>|]+/g,"_").trim()||"video",qAe=(e,t)=>
1101{const n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(n),1e3)},HAe=e=>(e instanceof DOMException||typeof e=="object"&&e!==null&&"name"in e)&&e.name==="AbortError",WAe=async(e,t,n)=>{const s=window;return typeof s.showSaveFilePicker!="function"?null:await s.showSaveFilePicker({suggestedName:e,types:[{description:n.toUpperCase()+" video",accept:{[t]:[`.${n}`]}}]})},Aee=async(e,t,n)=>{if(n)try{const s=await n.createWritable();await s.write(e),await s.close();return}catch(s){if(HAe(s))throw s;console.warn("[downloadAsMp4] write to handle failed, falling back",s)}qAe(e,t)},Tee=e=>{const t=e.split("?")[0].toLowerCase();return t.endsWith(".mp4")?"mp4":t.endsWith(".mov")||t.endsWith(".qt")?"mov":"webm"},YAe=e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"unknown error"}},GAe=async()=>{const[{FFmpeg:e},t]=await Promise.all([Si(()=>import("./index-BWXEABTF.js"),[]),Si(()=>import("./index-2s2JVvo1.js"),[])]),{toBlobURL:n,fetchFile:s}=t,a=new e;a.on("log",({message:o})=>{console.log("[downloadAsMp4:ffmpeg]",o)});let i=null;try{const[o,l]=await Promise.all([n(`${kee}/ffmpeg-core.js`,"text/javascript"),n(IY,"application/wasm")]);return await a.load({coreURL:o,wasmURL:l,classWorkerURL:FV}),{ffmpeg:a,fetchFile:s}}catch(o){console.warn("[downloadAsMp4] Local FFmpeg load failed, trying CDN fallback",o),i=o}for(const o of FAe)try{const[l,c]=await Promise.all([n(`${o}/ffmpeg-core.js`,"text/javascript"),n(`${o}/ffmpeg-core.wasm`,"application/wasm")]);return await a.load({coreURL:l,wasmURL:c,classWorkerURL:FV}),{ffmpeg:a,fetchFile:s}}catch(l){console.warn("[downloadAsMp4] FFmpeg load failed from",o,l),i=l}throw new Error(`Could not load MP4 converter: ${YAe(i)}`)},Ree=async(e,t)=>{const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch video (${n.status})`);const s=Number(n.headers.get("content-length")||0);if(!n.body){const u=new Uint8Array(await n.arrayBuffer());return t(100),u}const a=n.body.getReader(),i=[];let o=0,l=0;for(;;){const{done:u,value:m}=await a.read();if(u)break;if(m){i.push(m),o+=m.byteLength;const f=Date.now();f-l>150&&(l=f,s>0?t(Math.min(99,Math.round(o/s*100))):t(Math.min(95,Math.round(o/(1024*1024)*5))))}}const c=new Uint8Array(o);let d=0;for(const u of i)c.set(u,d),d+=u.byteLength;return t(100),c},KAe=async e=>{await QAe(e)},XAe=e=>new Promise(t=>{try{const n=document.createElement("video");n.preload="metadata",n.muted=!0,n.crossOrigin="anonymous";const s=()=>{n.src="",n.remove()},a=setTimeout(()=>{s(),t(null)},8e3);n.onloadedmetadata=()=>{clearTimeout(a);const i=Number.isFinite(n.duration)&&n.duration>0?n.duration:null;s(),t(i)},n.onerror=()=>{clearTimeout(a),s(),t(null)},n.src=e}catch{t(null)}}),ZAe=e=>{const t=/time=(\d+):(\d+):(\d+(?:\.\d+)?)/.exec(e);return t?Number(t[1])*3600+Number(t[2])*60+Number(t[3]):null},QAe=async({url:e,title:t,onProgress:n,saveHandle:s})=>{var b,w,S,j,N;const a=Tee(e);if(a==="mp4"){await tTe(e,t,n,s);return}n==null||n({stage:"downloading",percent:0});const[i,o]=await Promise.all([Ree(e,_=>{n==null||n({stage:"downloading",percent:_})}),XAe(e)]);n==null||n({stage:"loading",percent:null});const{ffmpeg:l}=await GAe(),c=`download-input.${a}`,d="download-output.mp4";let u=Date.now(),m=0,f=null,p=null,x=0;const g=_=>{_!=null?(m=Math.max(m,Math.min(99,_)),n==null||n({stage:"converting",percent:m})):n==null||n({stage:"converting",percent:m}),u=Date.now()},v=({progress:_})=>{Number.isFinite(_)&&g(Math.max(0,Math.min(99,Math.round(_*100))))},y=({message:_})=>{const C=ZAe(_);C!=null&&(o&&o>0?g(Math.min(99,Math.round(C/o*100))):u=Date.now())};try{n==null||n({stage:"converting",percent:0}),await l.writeFile(c,i),(b=l.on)==null||b.call(l,"progress",v),(w=l.on)==null||w.call(l,"log",y);const _=new Promise((T,D)=>{p=D,f=setInterval(()=>{const A=Date.now()-u;o||(x=(x+5)%95,n==null||n({stage:"converting",percent:Math.max(5,x)})),A>zAe&&D(new Error("MP4 conversion stalled - please retry"))},1e3)}),C=eTe(l,c,d),k=await Promise.race([C,_]);if(k.length===0)throw new Error("MP4 conversion produced an empty file");const E=new ArrayBuffer(k.byteLength);new Uint8Array(E).set(k);const R=new Blob([E],{type:"video/mp4"});n==null||n({stage:"saving",percent:100}),await Aee(R,`${Eee(t)}.mp4`,s??null)}finally{f&&clearInterval(f),p=null,(S=l.off)==null||S.call(l,"progress",v),(j=l.off)==null||j.call(l,"log",y);try{await l.deleteFile(c)}catch{}try{await l.deleteFile(d)}catch{}try{(N=l.terminate)==null||N.call(l)}catch{}}},JAe=async(e,t)=>{const n=await e.readFile(t);return n instanceof Uint8Array?n:new TextEncoder().encode(n)},eTe=async(e,t,n)=>{const s=await e.exec(["-fflags","+genpts","-i",t,"-map","0:v:0","-map","0:a:0?","-c:v","libx264","-preset","ultrafast","-crf","26","-vf","fps=30,scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=1","-pix_fmt","yuv420p","-profile:v","main","-level:v","4.0","-tag:v","avc1","-vsync","vfr","-c:a","aac","-b:a","128k","-ar","48000","-ac","2","-avoid_negative_ts","make_zero","-movflags","+faststart","-y",
1101n],BAe);if(typeof s=="number"&&s!==0)throw new Error("MP4 conversion failed");return JAe(e,n)},tTe=async(e,t,n,s)=>{const a=Tee(e),i=a==="mp4"?"video/mp4":a==="mov"?"video/quicktime":"video/webm";n==null||n({stage:"downloading",percent:0});const o=await Ree(e,c=>{n==null||n({stage:"downloading",percent:c})}),l=new Blob([o],{type:i});n==null||n({stage:"saving",percent:100}),await Aee(l,`${Eee(t)}.${a}`,s??null)};function gr(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 so(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ta(e,t){const n=gr(e);return isNaN(t)?so(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Do(e,t){const n=gr(e);if(isNaN(t))return so(e,NaN);if(!t)return n;const s=n.getDate(),a=so(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const i=a.getDate();return s>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),s),n)}const $D=6048e5,rTe=864e5,nTe=6e4,Aj=43200,BV=1440;let sTe={};function Ev(){return sTe}function $c(e,t){var l,c,d,u;const n=Ev(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=gr(e),i=a.getDay(),o=(i<s?7:0)+i-s;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function $f(e){return $c(e,{weekStartsOn:1})}function Oee(e){const t=gr(e),n=t.getFullYear(),s=so(e,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const a=$f(s),i=so(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=$f(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Zd(e){const t=gr(e);return t.setHours(0,0,0,0),t}function bg(e){const t=gr(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 wc(e,t){const n=Zd(e),s=Zd(t),a=+n-bg(n),i=+s-bg(s);return Math.round((a-i)/rTe)}function aTe(e){const t=Oee(e),n=so(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),$f(n)}function Vf(e,t){const n=t*7;return ta(e,n)}function iTe(e,t){return Do(e,t*12)}function oTe(e){let t;return e.forEach(function(n){const s=gr(n);(t===void 0||t<s||isNaN(Number(s)))&&(t=s)}),t||new Date(NaN)}function lTe(e){let t;return e.forEach(n=>{const s=gr(n);(!t||t>s||isNaN(+s))&&(t=s)}),t||new Date(NaN)}function E1(e,t){const n=gr(e),s=gr(t),a=n.getTime()-s.getTime();return a<0?-1:a>0?1:a}function cTe(e){return so(e,Date.now())}function Ji(e,t){const n=Zd(e),s=Zd(t);return+n==+s}function VD(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dTe(e){if(!VD(e)&&typeof e!="number")return!1;const t=gr(e);return!isNaN(Number(t))}function wg(e,t){const n=gr(e),s=gr(t),a=n.getFullYear()-s.getFullYear(),i=n.getMonth()-s.getMonth();return a*12+i}function uTe(e,t,n){const s=$c(e,n),a=$c(t,n),i=+s-bg(s),o=+a-bg(a);return Math.round((i-o)/$D)}function Pee(e){return t=>{const n=Math.trunc,s=n(t);return s===0?0:s}}function Dee(e,t){return+gr(e)-+gr(t)}function mTe(e,t,n){const s=Dee(e,t)/nTe;return Pee()(s)}function hTe(e){const t=gr(e);return t.setHours(23,59,59,999),t}function v2(e){const t=gr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fTe(e){const t=gr(e);return+hTe(t)==+v2(t)}function pTe(e,t){const n=gr(e),s=gr(t),a=E1(n,s),i=Math.abs(wg(n,s));let o;if(i<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*i);let l=E1(n,s)===-a;fTe(gr(e))&&i===1&&E1(e,s)===1&&(l=!1),o=a*(i-Number(l))}return o===0?0:o}function xTe(e,t,n){const s=Dee(e,t)/1e3;return Pee()(s)}function gTe(e,t){const n=gr(e.start),s=gr(e.end);let a=+n>+s;const i=a?+n:+s,o=a?s:n;o.setHours(0,0,0,0);let l=1;const c=[];for(;+o<=i;)c.push(gr(o)),o.setDate(o.getDate()+l),o.setHours(0,0,0,0);return a?c.reverse():c}function ro(e){const t=gr(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Mee(e){const t=gr(e),n=so(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function UD(e,t){var l,c,d,u;const n=Ev(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=gr(e),i=a.getDay(),o=(i<s?-7:0)+6-(i-s);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function Iee(e){return UD(e,{weekStartsOn:1}
vendor: 7,122 bytes, line 1101
1101)}const vTe={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"}},yTe=(e,t,n)=>{let s;const a=vTe[e];return typeof a=="string"?s=a:t===1?s=a.one:s=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function gE(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const bTe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wTe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jTe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NTe={date:gE({formats:bTe,defaultWidth:"full"}),time:gE({formats:wTe,defaultWidth:"full"}),dateTime:gE({formats:jTe,defaultWidth:"full"})},STe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_Te=(e,t,n,s)=>STe[e];function oy(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let a;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const CTe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kTe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ETe={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"]},ATe={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"]},TTe={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"}},RTe={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"}},OTe=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},PTe={ordinalNumber:OTe,era:oy({values:CTe,defaultWidth:"wide"}),quarter:oy({values:kTe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oy({values:ETe,defaultWidth:"wide"}),day:oy({values:ATe,defaultWidth:"wide"}),dayPeriod:oy({values:TTe,defaultWidth:"wide",formattingValues:RTe,defaultFormattingWidth:"wide"})};function ly(e){return(t,n={})=>{const s=n.width,a=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?MTe(l,m=>m.test(o)):DTe(l,m=>m.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function DTe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function MTe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ITe(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const a=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const LTe=/^(\d+)(th|st|nd|rd)?/i,$Te=/\d+/i,VTe={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},UTe={any:[/^b/i,/^(a|c)/i]},FTe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BTe={any:[/1/i,/2/i,/3/i,/4/i]},zTe={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},qTe={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]},HTe={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},WTe={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]},YTe={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},GTe={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}},KTe={ordinalNumber:ITe({matchPattern:LTe,parsePattern:$Te,valueCallback:e=>parseInt(e,10)}),era:ly({matchPatterns:VTe,defaultMatchWidth:"wide",parsePatterns:UTe,defaultParseWidth:"any"}),quarter:ly({matchPatterns:FTe,defaultMatchWidth:"wide",parsePatterns:BTe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ly({matchPatterns:zTe,defaultMatchWidth:"wide",parsePatterns:qTe,defaultParseWidth:"any"}),day:ly({matchPatterns:HTe,defaultMatchWidth:"wide",parsePatterns:WTe,defaultParseWidth:"any"}),dayPeriod:ly({matchPatterns:YTe,defaultMatchWidth:"any",parsePatterns:GTe,defaultParseWidth:"any"})},FD={code:"en-US",formatDistance:yTe,formatLong:NTe,formatRelative:_Te,localize:PTe,match:KTe,o
vendor: 6,678 bytes, line 1101
1101ptions:{weekStartsOn:0,firstWeekContainsDate:1}};function XTe(e){const t=gr(e);return wc(t,Mee(t))+1}function Lee(e){const t=gr(e),n=+$f(t)-+aTe(t);return Math.round(n/$D)+1}function $ee(e,t){var u,m,f,p;const n=gr(e),s=n.getFullYear(),a=Ev(),i=(t==null?void 0:t.firstWeekContainsDate)??((m=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:m.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=so(e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=$c(o,t),c=so(e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const d=$c(c,t);return n.getTime()>=l.getTime()?s+1:n.getTime()>=d.getTime()?s:s-1}function ZTe(e,t){var l,c,d,u;const n=Ev(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=$ee(e,t),i=so(e,0);return i.setFullYear(a,0,s),i.setHours(0,0,0,0),$c(i,t)}function Vee(e,t){const n=gr(e),s=+$c(n,t)-+ZTe(n,t);return Math.round(s/$D)+1}function Rn(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Ru={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return Rn(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Rn(n+1,2)},d(e,t){return Rn(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 Rn(e.getHours()%12||12,t.length)},H(e,t){return Rn(e.getHours(),t.length)},m(e,t){return Rn(e.getMinutes(),t.length)},s(e,t){return Rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),a=Math.trunc(s*Math.pow(10,n-3));return Rn(a,t.length)}},Rp={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},zV={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),a=s>0?s:1-s;return n.ordinalNumber(a,{unit:"year"})}return Ru.y(e,t)},Y:function(e,t,n,s){const a=$ee(e,s),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Rn(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Rn(i,t.length)},R:function(e,t){const n=Oee(e);return Rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Rn(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return Rn(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return Rn(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Ru.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return Rn(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const a=Vee(e,s);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Rn(a,t.length)},I:function(e,t,n){const s=Lee(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):Rn(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ru.d(e,t)},D:function(e,t,n){const s=XTe(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):Rn(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Rn(i,2);case"eo":return n.ordinalNumber(i,{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,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Rn(i,t.length);case"co":return n.ordinalNumber(i,{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 s=e.getDay(),a=s===0?7:s;switch(t){case"i":return String(a);case"ii":return Rn(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{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 s=e.getHours();let a;switch(s===12?a=Rp.noon:s===0?a=Rp.midnight:a=s/12>
vendor: 4,720 bytes, line 1101
1101=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 s=e.getHours();let a;switch(s>=17?a=Rp.evening:s>=12?a=Rp.afternoon:s>=4?a=Rp.morning:a=Rp.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 s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ru.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ru.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):Rn(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):Rn(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ru.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ru.s(e,t)},S:function(e,t){return Ru.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return HV(s);case"XXXX":case"XX":return Mh(s);case"XXXXX":case"XXX":default:return Mh(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return HV(s);case"xxxx":case"xx":return Mh(s);case"xxxxx":case"xxx":default:return Mh(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qV(s,":");case"OOOO":default:return"GMT"+Mh(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qV(s,":");case"zzzz":default:return"GMT"+Mh(s,":")}},t:function(e,t,n){const s=Math.trunc(e.getTime()/1e3);return Rn(s,t.length)},T:function(e,t,n){const s=e.getTime();return Rn(s,t.length)}};function qV(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=Math.trunc(s/60),i=s%60;return i===0?n+String(a):n+String(a)+t+Rn(i,2)}function HV(e,t){return e%60===0?(e>0?"-":"+")+Rn(Math.abs(e)/60,2):Mh(e,t)}function Mh(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),a=Rn(Math.trunc(s/60),2),i=Rn(s%60,2);return n+a+t+i}const WV=(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"})}},Uee=(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"})}},QTe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],a=n[2];if(!a)return WV(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",WV(s,t)).replace("{{time}}",Uee(a,t))},JTe={p:Uee,P:QTe},eRe=/^D+$/,tRe=/^Y+$/,rRe=["D","DD","YY","YYYY"];function nRe(e){return eRe.test(e)}function sRe(e){return tRe.test(e)}function aRe(e,t,n){const s=iRe(e,t,n);if(console.warn(s),rRe.includes(e))throw new RangeError(s)}function iRe(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const oRe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lRe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cRe=/^'([^]*?)'?$/,dRe=/''/g,uRe=/[a-zA-Z]/;function cn(e,t,n){var u,m,f,p,x,g,v,y;const s=Ev(),a=(n==null?void 0:n.locale)??s.locale??FD,i=(n==null?void 0:n.firstWeekContainsDate)??((m=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((g=(x=n==null?void 0:n.locale)==null?void 0:x.options)==null?void 0:g.weekStartsOn)??s.weekStartsOn??((y=(v=s.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=gr(e);if(!dTe(l))throw new RangeError("Invalid time value");let c=t.match(lRe).map(b=>{const w=b[0];if(w==="p"||w==="P"){const S=JTe[w];return S(b,a.formatLong)}return b}).join("").match(oRe).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:mRe(b)};if(zV[w])return{isToken:!0,value:b};
1101if(w.match(uRe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&sRe(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&nRe(w))&&aRe(w,t,String(e));const S=zV[w[0]];return S(l,w,a.localize,d)}).join("")}function mRe(e){const t=e.match(cRe);return t?t[1].replace(dRe,"'"):e}function hRe(e,t,n){const s=Ev(),a=(n==null?void 0:n.locale)??s.locale??FD,i=2520,o=E1(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,d;o>0?(c=gr(t),d=gr(e)):(c=gr(e),d=gr(t));const u=xTe(d,c),m=(bg(d)-bg(c))/1e3,f=Math.round((u-m)/60);let p;if(f<2)return n!=null&&n.includeSeconds?u<5?a.formatDistance("lessThanXSeconds",5,l):u<10?a.formatDistance("lessThanXSeconds",10,l):u<20?a.formatDistance("lessThanXSeconds",20,l):u<40?a.formatDistance("halfAMinute",0,l):u<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):f===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",f,l);if(f<45)return a.formatDistance("xMinutes",f,l);if(f<90)return a.formatDistance("aboutXHours",1,l);if(f<BV){const x=Math.round(f/60);return a.formatDistance("aboutXHours",x,l)}else{if(f<i)return a.formatDistance("xDays",1,l);if(f<Aj){const x=Math.round(f/BV);return a.formatDistance("xDays",x,l)}else if(f<Aj*2)return p=Math.round(f/Aj),a.formatDistance("aboutXMonths",p,l)}if(p=pTe(d,c),p<12){const x=Math.round(f/Aj);return a.formatDistance("xMonths",x,l)}else{const x=p%12,g=Math.trunc(p/12);return x<3?a.formatDistance("aboutXYears",g,l):x<9?a.formatDistance("overXYears",g,l):a.formatDistance("almostXYears",g+1,l)}}function dh(e,t){return hRe(e,cTe(e),t)}function fRe(e){const t=gr(e),n=t.getFullYear(),s=t.getMonth(),a=so(e,0);return a.setFullYear(n,s+1,0),a.setHours(0,0,0,0),a.getDate()}function pRe(e){return Math.trunc(+gr(e)/1e3)}function xRe(e){const t=gr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function gRe(e,t){return uTe(xRe(e),ro(e),t)+1}function qR(e,t){const n=gr(e),s=gr(t);return n.getTime()>s.getTime()}function Fee(e,t){const n=gr(e),s=gr(t);return+n<+s}function BD(e,t){const n=gr(e),s=gr(t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function vRe(e,t){const n=gr(e),s=gr(t);return n.getFullYear()===s.getFullYear()}function vf(e,t){return ta(e,-t)}function vE(e,t){const n=gr(e),s=n.getFullYear(),a=n.getDate(),i=so(e,0);i.setFullYear(s,t,15),i.setHours(0,0,0,0);const o=fRe(i);return n.setMonth(t,Math.min(a,o)),n}function YV(e,t){const n=gr(e);return isNaN(+n)?so(e,NaN):(n.setFullYear(t),n)}var y2="Checkbox",[yRe,git]=Ss(y2),[bRe,zD]=yRe(y2);function wRe(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:m}=e,[f,p]=Zs({prop:n,defaultProp:a??!1,onChange:c,caller:y2}),[x,g]=h.useState(null),[v,y]=h.useState(null),b=h.useRef(!1),w=x?!!o||!!x.closest("form"):!0,S={checked:f,disabled:i,setChecked:p,control:x,setControl:g,name:l,form:o,value:u,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:km(a)?!1:a,isFormControl:w,bubbleInput:v,setBubbleInput:y};return r.jsx(bRe,{scope:t,...S,children:jRe(m)?m(S):s})}var Bee="CheckboxTrigger",zee=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...s},a)=>{const{control:i,value:o,disabled:l,checked:c,required:d,setControl:u,setChecked:m,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:x}=zD(Bee,e),g=Ht(a,u),v=h.useRef(c);return h.useEffect(()=>{const y=i==null?void 0:i.form;if(y){const b=()=>m(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[i,m]),r.jsx(ut.button,{type:"button",role:"checkbox","aria-checked":km(c)?"mixed":c,"aria-required":d,"data-state":Gee(c),"data-disabled":l?"":void 0,disabled:l,value:o,...s,ref:g,onKeyDown:We(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:We(n,y=>{m(b=>km(b)?!0:!b),x&&p&&(f.current=y.isPropagationStopped(),f.current||y.stopPropagation())})})});zee.displayName=Bee;var qD=h.forwardRef((e,t)=>
1101{const{__scopeCheckbox:n,name:s,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:d,form:u,...m}=e;return r.jsx(wRe,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:d,name:s,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>r.jsxs(r.Fragment,{children:[r.jsx(zee,{...m,ref:t,__scopeCheckbox:n}),f&&r.jsx(Yee,{__scopeCheckbox:n})]})})});qD.displayName=y2;var qee="CheckboxIndicator",Hee=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:s,...a}=e,i=zD(qee,n);return r.jsx(_s,{present:s||km(i.checked)||i.checked===!0,children:r.jsx(ut.span,{"data-state":Gee(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Hee.displayName=qee;var Wee="CheckboxBubbleInput",Yee=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:s,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:d,value:u,form:m,bubbleInput:f,setBubbleInput:p}=zD(Wee,e),x=Ht(n,p),g=jv(i),v=mw(s);h.useEffect(()=>{const b=f;if(!b)return;const w=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(w,"checked").set,N=!a.current;if(g!==i&&j){const _=new Event("click",{bubbles:N});b.indeterminate=km(i),j.call(b,km(i)?!1:i),b.dispatchEvent(_)}},[f,g,i,a]);const y=h.useRef(km(i)?!1:i);return r.jsx(ut.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:l,disabled:c,name:d,value:u,form:m,...t,tabIndex:-1,ref:x,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Yee.displayName=Wee;function jRe(e){return typeof e=="function"}function km(e){return e==="indeterminate"}function Gee(e){return km(e)?"indeterminate":e?"checked":"unchecked"}const ci=h.forwardRef(({className:e,...t},n)=>r.jsx(qD,{ref:n,className:ge("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:r.jsx(Hee,{className:ge("flex items-center justify-center text-current"),children:r.jsx(nt,{className:"h-4 w-4"})})}));ci.displayName=qD.displayName;var Kee="AlertDialog",[NRe,vit]=Ss(Kee,[iG]),mu=iG(),Xee=e=>{const{__scopeAlertDialog:t,...n}=e,s=mu(t);return r.jsx(jG,{...s,...n,modal:!0})};Xee.displayName=Kee;var SRe="AlertDialogTrigger",Zee=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=mu(n);return r.jsx(NG,{...a,...s,ref:t})});Zee.displayName=SRe;var _Re="AlertDialogPortal",Qee=e=>{const{__scopeAlertDialog:t,...n}=e,s=mu(t);return r.jsx(SG,{...s,...n})};Qee.displayName=_Re;var CRe="AlertDialogOverlay",Jee=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=mu(n);return r.jsx(N5,{...a,...s,ref:t})});Jee.displayName=CRe;var Ax="AlertDialogContent",[kRe,ERe]=NRe(Ax),ARe=pH("AlertDialogContent"),ete=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...a}=e,i=mu(n),o=h.useRef(null),l=Ht(t,o),c=h.useRef(null);return r.jsx(A0e,{contentName:Ax,titleName:tte,docsSlug:"alert-dialog",children:r.jsx(kRe,{scope:n,cancelRef:c,children:r.jsxs(S5,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:We(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[r.jsx(ARe,{children:s}),r.jsx(RRe,{contentRef:o})]})})})});ete.displayName=Ax;var tte="AlertDialogTitle",rte=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=mu(n);return r.jsx(_5,{...a,...s,ref:t})});rte.displayName=tte;var nte="AlertDialogDescription",ste=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=mu(n);return r.jsx(C5,{...a,...s,ref:t})});ste.displayName=nte;var TRe="AlertDialogAction",ate=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,a=mu(n);return r.jsx(k5,{...a,...s,ref:t})});ate.displayName=TRe;var ite="AlertDialogCancel",ote=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=ERe(ite,n),i=mu(n),o=Ht(t,a);return r.jsx(k5,{...i,...s,ref:o})});ote.displayName=ite;var RRe=({contentRef:e})=>{const t=`\`${Ax}\` requires a description for the component to be accessible for screen reader users.
1102
1103You can add a description to the \`${Ax}\` by passing a \`${nte}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
1104
1105Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ax}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
1106
1107For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},ORe=Xee,PRe=Zee,DRe=Qee,lte=Jee,cte=ete,dte=ate,ute=ote,mte=rte,hte=ste;const cs=ORe,Uf=PRe,MRe=DRe,fte=h.forwardRef(({className:e,...t},n)=>r.jsx(lte,{className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));fte.displayName=lte.displayName;const Kn=h.forwardRef(({className:e,...t},n)=>r.jsxs(MRe,{children:[r.jsx(fte,{}),r.jsx(cte,{ref:n,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Kn.displayName=cte.displayName;const Xn=({className:e,...t})=>r.jsx("div",{className:ge("flex flex-col space-y-2 text-center sm:text-left",e),...t});Xn.displayName="AlertDialogHeader";const Zn=({className:e,...t})=>r.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zn.displayName="AlertDialogFooter";const Qn=h.forwardRef(({className:e,...t},n)=>r.jsx(mte,{ref:n,className:ge("text-lg font-semibold",e),...t}));Qn.displayName=mte.displayName;const Jn=h.forwardRef(({className:e,...t},n)=>r.jsx(hte,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));Jn.displayName=hte.displayName;const bs=h.forwardRef(({className:e,...t},n)=>r.jsx(dte,{ref:n,className:ge(Kb(),e),...t}));bs.displayName=dte.displayName;const ds=h.forwardRef(({className:e,...t},n)=>r.jsx(ute,{ref:n,className:ge(Kb({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ds.displayName=ute.displayName;const cy=80,IRe=2.5,LRe=({onRefresh:e,children:t,disabled:n=!1})=>{const[s,a]=h.useState(0),[i,o]=h.useState(!1),[l,c]=h.useState(!1),d=h.useRef(0),u=h.useRef(0);WZ();const m=h.useCallback(v=>{n||i||window.scrollY<=0&&(d.current=v.touches[0].clientY,c(!0))},[n,i]),f=h.useCallback(v=>{if(!l||n||i)return;u.current=v.touches[0].clientY;const y=u.current-d.current;if(y>0&&window.scrollY<=0){const b=Math.min(y/IRe,cy*1.5);a(b)}},[l,n,i]),p=h.useCallback(async()=>{if(!(!l||n))if(c(!1),s>=cy&&!i){o(!0),a(cy/2);try{await e()}finally{o(!1),a(0)}}else a(0)},[l,s,i,e,n]),x=Math.min(s/cy,1),g=s>=cy;return r.jsxs("div",{onTouchStart:m,onTouchMove:f,onTouchEnd:p,className:"relative",children:[r.jsx(fe.div,{className:"absolute left-0 right-0 flex items-center justify-center overflow-hidden z-30 pointer-events-none",style:{top:-60,height:s+60},animate:{opacity:s>10?1:0},transition:{duration:.1},children:r.jsx(fe.div,{className:`flex items-center justify-center w-10 h-10 rounded-full transition-colors duration-200 ${g||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{transform:`translateY(${Math.max(0,s-20)}px)`},animate:{scale:g?1.1:1,rotate:i?360:x*180},transition:{rotate:i?{duration:1,repeat:1/0,ease:"linear"}:{duration:.1},scale:{duration:.2}},children:r.jsx(Me,{className:"w-5 h-5"})})}),r.jsx(fe.div,{style:{transform:`translateY(${s}px)`},transition:{type:"spring",stiffness:400,damping:30},children:t})]})};function ia({className:e,...t}){return r.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",e),...t})}var b2="Collapsible",[$Re,pte]=Ss(b2),[VRe,HD]=$Re(b2),xte=h.forwardRef((e,t)=>
1107{const{__scopeCollapsible:n,open:s,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,d]=Zs({prop:s,defaultProp:a??!1,onChange:o,caller:b2});return r.jsx(VRe,{scope:n,disabled:i,contentId:ji(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:r.jsx(ut.div,{"data-state":KD(c),"data-disabled":i?"":void 0,...l,ref:t})})});xte.displayName=b2;var gte="CollapsibleTrigger",WD=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...s}=e,a=HD(gte,n);return r.jsx(ut.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":KD(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...s,ref:t,onClick:We(e.onClick,a.onOpenToggle)})});WD.displayName=gte;var YD="CollapsibleContent",GD=h.forwardRef((e,t)=>{const{forceMount:n,...s}=e,a=HD(YD,e.__scopeCollapsible);return r.jsx(_s,{present:n||a.open,children:({present:i})=>r.jsx(URe,{...s,ref:t,present:i})})});GD.displayName=YD;var URe=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:s,children:a,...i}=e,o=HD(YD,n),[l,c]=h.useState(s),d=h.useRef(null),u=Ht(t,d),m=h.useRef(0),f=m.current,p=h.useRef(0),x=p.current,g=o.open||l,v=h.useRef(g),y=h.useRef(void 0);return h.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),js(()=>{const b=d.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();m.current=w.height,p.current=w.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(s)}},[o.open,s]),r.jsx(ut.div,{"data-state":KD(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:g&&a})});function KD(e){return e?"open":"closed"}var vte=xte,FRe=WD,BRe=GD;const Wm=vte,Ff=WD,Ym=GD;var yE,w2="HoverCard",[yte,yit]=Ss(w2,[Wc]),j2=Wc(),[zRe,XD]=yte(w2),bte=e=>{const{__scopeHoverCard:t,children:n,open:s,defaultOpen:a,onOpenChange:i,openDelay:o=700,closeDelay:l=300}=e,c=j2(t),d=h.useRef(0),u=h.useRef(0),m=h.useRef(!1),f=h.useRef(!1),[p,x]=Zs({prop:s,defaultProp:a??!1,onChange:i,caller:w2}),g=h.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>x(!0),o)},[o,x]),v=h.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>x(!1),l))},[l,x]),y=h.useCallback(()=>x(!1),[x]);return h.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),r.jsx(zRe,{scope:t,open:p,onOpenChange:x,onOpen:g,onClose:v,onDismiss:y,hasSelectionRef:m,isPointerDownOnContentRef:f,children:r.jsx(hw,{...c,children:n})})};bte.displayName=w2;var wte="HoverCardTrigger",jte=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...s}=e,a=XD(wte,n),i=j2(n);return r.jsx(fv,{asChild:!0,...i,children:r.jsx(ut.a,{"data-state":a.open?"open":"closed",...s,ref:t,onPointerEnter:We(e.onPointerEnter,GN(a.onOpen)),onPointerLeave:We(e.onPointerLeave,GN(a.onClose)),onFocus:We(e.onFocus,a.onOpen),onBlur:We(e.onBlur,a.onClose),onTouchStart:We(e.onTouchStart,o=>o.preventDefault())})})});jte.displayName=wte;var qRe="HoverCardPortal",[bit,HRe]=yte(qRe,{forceMount:void 0}),YN="HoverCardContent",Nte=h.forwardRef((e,t)=>{const n=HRe(YN,e.__scopeHoverCard),{forceMount:s=n.forceMount,...a}=e,i=XD(YN,e.__scopeHoverCard);return r.jsx(_s,{present:s||i.open,children:r.jsx(WRe,{"data-state":i.open?"open":"closed",...a,onPointerEnter:We(e.onPointerEnter,GN(i.onOpen)),onPointerLeave:We(e.onPointerLeave,GN(i.onClose)),ref:t})})});Nte.displayName=YN;var WRe=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,...l}=e,c=XD(YN,n),d=j2(n),u=h.useRef(null),m=Ht(t,u),[f,p]=h.useState(!1);return h.useEffect(()=>{if(f){const x=document.body;return yE=x.style.userSelect||x.style.webkitUserSelect,x.style.userSelect="none",x.style.webkitUserSelect="none",()=>{x.style.userSelect=yE,x.style.webkitUserSelect=yE}}},[f]),h.useEffect(()=>{if(u.current){const x=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",x),()=>{document.removeEventListener("pointerup",x),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),h.useEffect(()=>{u.current&&KRe(u.current).forEach(g=>g.setAttribute("tabindex","-1"))}),r.jsx(nu,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:We(i,x=>{x.preventDefault()}),onDismiss:c.onDismiss,children:r.jsx(fw,{...d,...l,onPointerDown:We(l.onPointerDown,x=>{x.currentTarget.contains(x.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...l.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),YRe="HoverCardArrow",GRe=h.forwardRef((e,t)=>
1107{const{__scopeHoverCard:n,...s}=e,a=j2(n);return r.jsx(pw,{...a,...s,ref:t})});GRe.displayName=YRe;function GN(e){return t=>t.pointerType==="touch"?void 0:e()}function KRe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var XRe=bte,ZRe=jte,Ste=Nte;const A1=XRe,T1=ZRe,lb=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},a)=>r.jsx(Ste,{ref:a,align:t,sideOffset:n,className:ge("z-50 w-64 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),...s}));lb.displayName=Ste.displayName;const Tj={starter:5,professional:1/0,team:1/0,admin:1/0},Tw=e=>{const[t,n]=h.useState(0),[s,a]=h.useState("starter"),[i,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState(null),f=Tj[l?"admin":s]??Tj.starter,p=d!==null?d:f,x=d!==null,g=Math.max(0,p-t),v=p!==1/0&&t>=p,y=h.useCallback(async()=>{if(!e){o(!1);return}try{const{data:S}=await F.from("user_roles").select("role").eq("user_id",e).eq("role","admin").maybeSingle();if(c(!!S),S){o(!1);return}const{data:j}=await F.from("profiles").select("subscription_tier").eq("user_id",e).single();j!=null&&j.subscription_tier&&a(j.subscription_tier);const{data:N}=await F.from("user_custom_limits").select("max_shares").eq("user_id",e).maybeSingle();(N==null?void 0:N.max_shares)!==null&&(N==null?void 0:N.max_shares)!==void 0?u(N.max_shares):u(null);const{data:_,error:C}=await F.rpc("get_video_send_usage",{p_user_id:e});!C&&_!==null&&n(_)}catch(S){console.error("Error fetching video send usage:",S)}finally{o(!1)}},[e]);h.useEffect(()=>{y()},[y]),h.useEffect(()=>{if(!e)return;const S=()=>{y()},j=()=>{document.visibilityState==="visible"&&y()};return window.addEventListener("vidareo:usage-updated",S),document.addEventListener("visibilitychange",j),()=>{window.removeEventListener("vidareo:usage-updated",S),document.removeEventListener("visibilitychange",j)}},[e,y]);const b=h.useCallback(async()=>{if(!e)return!1;if(l)return!0;const S=d!==null?d:Tj[s]??Tj.starter;if(S!==1/0&&t>=S)return!1;try{n(j=>j+1);try{window.dispatchEvent(new CustomEvent("vidareo:usage-updated"))}catch{}return setTimeout(()=>{y()},1500),!0}catch(j){return console.error("Error in optimistic increment:",j),!1}},[e,l,d,s,t,y]),w=h.useCallback(async()=>{await y()},[y]);return{currentUsage:t,limit:p,remaining:g,isAtLimit:v,isLoading:i,subscriptionTier:s,hasCustomLimit:x,incrementUsage:b,refreshUsage:w}};function N2(){const e=lr(),[t,n]=h.useState(!1),s=h.useCallback(async o=>{if(!e)return{success:!1,reason:"not-ios"};const l=TY[o];n(!0);try{return await Vye(l),Pe.success("Purchase complete! Your plan will update shortly."),{success:!0}}catch(c){const d=(c==null?void 0:c.code)==="1"||/cancel/i.test((c==null?void 0:c.message)??"");return d||(console.error("[IAP] purchase failed",c),c instanceof OY?Pe.error("This subscription isn't available yet. Please try again in a moment or tap Restore Purchases."):Pe.error((c==null?void 0:c.message)||"Purchase failed. Please try again.")),{success:!1,reason:d?"cancelled":"error"}}finally{n(!1)}},[e]),a=h.useCallback(async()=>{if(e){n(!0);try{await Uye(),Pe.success("Purchases restored.")}catch(o){console.error("[IAP] restore failed",o),Pe.error((o==null?void 0:o.message)||"Restore failed.")}finally{n(!1)}}},[e]),i=h.useCallback(()=>{window.open(Fye,"_blank")},[]);return{available:e,loading:t,purchase:s,restore:a,manageSubscription:i}}function _te(){const[e,t]=h.useState({}),[n,s]=h.useState(!1);return h.useEffect(()=>{let a=!1;if(!lr()){s(!0);return}return $ye().then(i=>{a||(t(i),s(!0))}).catch(()=>{a||s(!0)}),()=>{a=!0}},[]),{prices:e,loaded:n}}const GV=({currentUsage:e,limit:t,variant:n="inline"})=>{const s=Sr(),a=lr(),i=N2(),o=()=>
1107{if(a){i.purchase("pro_monthly");return}s("/pricing")};if(a){if(n==="modal")return r.jsxs("div",{className:"text-center p-6",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3",children:r.jsx(Ms,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-xl font-bold text-foreground",children:"Share Limit Reached"}),r.jsxs("p",{className:"text-sm text-muted-foreground mt-2 mb-4",children:["You've used all ",t," video sends this month. Upgrade to Pro for unlimited sends."]}),r.jsxs(P,{onClick:o,disabled:i.loading,className:"w-full",size:"lg",children:[r.jsx(Ms,{className:"w-4 h-4 mr-2"}),i.loading?"Opening App Store…":"Upgrade to Pro"]}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>i.restore(),className:"mt-2 w-full",children:"Restore Purchases"}),r.jsx("p",{className:"text-[11px] text-muted-foreground mt-3",children:"Subscriptions auto-renew. Manage in your Apple ID settings."})]});const d=e>=t;return!(e>=t-2&&e<t)&&!d?null:r.jsxs("div",{className:"rounded-xl p-4 border bg-primary/5 border-primary/30 flex items-center justify-between gap-3",children:[r.jsx("p",{className:"text-sm text-foreground",children:d?"Monthly share limit reached.":`Only ${t-e} share${t-e!==1?"s":""} left this month.`}),r.jsxs(P,{size:"sm",onClick:o,disabled:i.loading,className:"shrink-0",children:[r.jsx(Ms,{className:"w-3.5 h-3.5 mr-1.5"}),"Upgrade"]})]})}if(n==="modal")return r.jsxs(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center",children:[r.jsxs("div",{className:"bg-gradient-to-r from-primary to-primary/80 rounded-xl p-6 mb-4",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-white/20 flex items-center justify-center mx-auto mb-3",children:r.jsx(Ni,{className:"w-8 h-8 text-primary-foreground"})}),r.jsx("h3",{className:"text-xl font-bold text-primary-foreground",children:"Share Limit Reached"}),r.jsxs("p",{className:"text-primary-foreground/80 text-sm mt-1",children:["You've used all ",t," video sends this month"]})]}),r.jsxs("div",{className:"bg-muted/50 rounded-xl p-4 mb-4 text-left",children:[r.jsx("p",{className:"text-sm font-medium text-foreground mb-3 text-center",children:"Upgrade to Pro for:"}),r.jsxs("ul",{className:"space-y-2.5",children:[r.jsxs("li",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(_n,{className:"w-4 h-4 text-primary"})}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-foreground",children:"Unlimited"})," video sends every month"]})]}),r.jsxs("li",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(cr,{className:"w-4 h-4 text-primary"})}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-foreground",children:"10-minute"})," recordings (5x longer)"]})]}),r.jsxs("li",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(Po,{className:"w-4 h-4 text-primary"})}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-foreground",children:"1080p HD"})," video quality"]})]})]})]}),r.jsxs(P,{onClick:o,className:"w-full",size:"lg",children:[r.jsx(Ms,{className:"w-4 h-4 mr-2"}),"Upgrade to Pro - $29.95/mo"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Cancel anytime • Save 33% with annual billing"})]});const l=e>=t-2&&e<t,c=e>=t;return!l&&!c?null:r.jsx(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`rounded-xl p-4 border ${c?"bg-gradient-to-r from-destructive/10 to-destructive/5 border-destructive/30":"bg-gradient-to-r from-primary/10 to-primary/5 border-primary/30"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center shrink-0 ${c?"bg-destructive/20":"bg-primary/20"}`,children:c?r.jsx(Ni,{className:"w-5 h-5 text-destructive"}):r.jsx(_n,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:`text-sm font-semibold ${c?"text-destructive":"text-foreground"}`,children:c?"Monthly share limit reached":`Only ${t-e} share${t-e!==1?"s":""} left!`}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c?"Upgrade to Pro for unlimited video sends.":"Upgrade now for unlimited sends every month."})]}),r.jsxs(P,{variant:c?"default":"outline",size:"sm",onClick:o,className:"shrink-0",children:[r.jsx(Ms,{className:"w-3.5 h-3.5 mr-1.5"}),"Upgrade"]})]})})},QRe={"bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4","top-left":"top-4 left-4","top-right":"top-4 right-4"},ZD=({show:e,customLogoUrl:t,useCustom:n,position:s="bottom-right",opacity:a=.7,size:i=20})=>{if(!e)return null;const o=n&&t?t:ch,l=n&&t?"Company logo":"VIDAREO";return r.jsx("div",{className:ge("absolute pointer-events-none z-20",QRe[s]),children:r.jsx("img",{src:o,alt:l,style:{height:`${Math.max(i,28)}px`,opacity:a,maxWidth:`${Math.max(i*8,200)}px`},className:"w-auto object-contain drop-shadow-md"})})},KV=16/9;function JRe(e,t,n){return n2(r2({unit:"%",width:90},n,e,t),e,t)}const eOe=({open:e,onOpenChange:t,videoId:n,videoTitle:s,videoDescription:a,userId:i,thumbnailUrl:o,videoUrl:l,videoDurationSeconds:c,sourceType:d,onThumbnailChange:u})=>{const m=d==="youtube",{toast:f}=Gr(),[p,x]=h.useState(!1),[g,v]=h.useState(null),[y,b]=h.useState(!1),[w,S]=h.useState(7),[j,N]=h.useState(!1),[_,C]=h.useState(100),[k,E]=h.useState(!1),[R,T]=
1107h.useState(""),[D,A]=h.useState(!1),[V,U]=h.useState(!1),[O,M]=h.useState(""),[$,I]=h.useState(null),[B,K]=h.useState(""),[Z,q]=h.useState(""),[H,X]=h.useState(""),G=ih(),ee=ce=>ce.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(ce.trim()):!0,re=ce=>{M(ce),ce.trim()&&!ee(ce)?I("Please enter a valid email address"):I(null)},[W,Q]=h.useState(null),[L,te]=h.useState(null);h.useState(!1),h.useState(!1),h.useState("default"),h.useState("");const[ae,ne]=h.useState(""),[se,ue]=h.useState(null),[Ne,Qe]=h.useState(null),[J,de]=h.useState(!1),ve=h.useRef(null),[Le,$e]=h.useState(!1),[De,oe]=h.useState(0),[xe,Ze]=h.useState(0),[it,ct]=h.useState(null),[Oe,pe]=h.useState(!1),le=h.useRef(null),ke=h.useRef(null),Ee=h.useRef(null),[ot,gt]=h.useState(!1),[Nt,Ct]=h.useState(null),dt=h.useRef(null),[tt,Re]=h.useState(!1),[Fe,Ae]=h.useState(!1),Ve=h.useRef(null),et=h.useRef(null),[Ge,St]=h.useState(null),[Tt,Zt]=h.useState(!1),[bt,Wt]=h.useState(null),[Xe,be]=h.useState(),[Ue,we]=h.useState(),[pt,mt]=h.useState(!1),[er,kt]=h.useState(!1),at=h.useRef(null),Yt=h.useRef(null),Ft=Ne||o;h.useState(!1),h.useState(!1);const[or,Ar]=h.useState(!1),[nn,es]=h.useState(!1),[An,ie]=h.useState(!1),[_e,ht]=h.useState(""),[Dr,Mr]=h.useState(!1),[Ln,Zr]=h.useState(!1),[zn,Tn]=h.useState(null),[Za,Na]=h.useState(!1),[la,qn]=h.useState(!1),[Hn,Qr]=h.useState(!1),[dn,Os]=h.useState(!1),[Qa,Be]=h.useState(!1),[La,oo]=h.useState(!0),[gu,Vi]=h.useState(!1),[Xc,vu]=h.useState(null),[yu,Zc]=h.useState(!0),[gh,vh]=h.useState(!0),[Qc,lo]=h.useState(!1),[bu,nc]=h.useState(!1),[jl,Jc]=h.useState(""),[Nl,wu]=h.useState(""),[ed,ju]=h.useState(null),[Lo,Uw]=h.useState(null),{currentUsage:$o,limit:td,remaining:Ui,isAtLimit:Nu,isLoading:rt,subscriptionTier:jt,incrementUsage:Qt,refreshUsage:ts}=Tw(i);h.useEffect(()=>{e&&i&&ts()},[e,i,ts]),h.useEffect(()=>{!e&&Nt&&(Nt.getTracks().forEach(ce=>ce.stop()),Ct(null),dt.current=null,Re(!1),gt(!1))},[e,Nt]),h.useEffect(()=>()=>{Nt&&Nt.getTracks().forEach(ce=>ce.stop()),Ge&&URL.revokeObjectURL(Ge.url)},[Nt,Ge]),h.useEffect(()=>()=>{Ge&&URL.revokeObjectURL(Ge.url)},[Ge]),h.useEffect(()=>{e&&(async()=>{if(!i||!n)return;const{data:ze,error:Pt}=await F.from("profiles").select("full_name, job_title, business_name, phone, email, signature_enabled, subscription_tier, watermark_enabled, use_custom_watermark, company_logo_url, email_header_subtitle, signature_custom_text, notify_inapp_video_view, notify_email_view_start").eq("user_id",i).single();if(!Pt&&ze){const Br=ze.subscription_tier!=="starter";ue({enabled:Br&&(ze.signature_enabled??!1),fullName:ze.full_name,jobTitle:ze.job_title,businessName:ze.business_name,phone:ze.phone,email:ze.email,logoUrl:ze.company_logo_url,headerSubtitle:ze.email_header_subtitle,customText:ze.signature_custom_text});const Nn=ze.watermark_enabled??!0;oo(Br?Nn:!0),Vi(Br&&(ze.use_custom_watermark??!1)),vu(ze.company_logo_url);const Fs=ze.notify_inapp_video_view??!1,Bs=ze.notify_email_view_start??!1;Uw({inApp:Fs,email:Bs});const{data:Ca}=await F.from("video_share_links").select("id, share_token, title, recipient_email, recipient_name, allow_comments, allow_replies, notify_inapp, notify_email, expires_at, max_views, show_watermark, cta_url, cta_label").eq("video_id",n).eq("user_id",i).order("created_at",{ascending:!0}).limit(1),Jr=(Ca==null?void 0:Ca[0])||null;if(Jr){Q(Jr.share_token),te(Jr.id),v(r0(Jr.share_token)),Jr.title&&X(Jr.title),Jr.recipient_email&&M(Jr.recipient_email),Jr.recipient_name&&K(Jr.recipient_name);const{data:Ps}=await F.from("video_share_links_safe").select("is_password_protected").eq("id",Jr.id).maybeSingle();if(E(!!(Ps!=null&&Ps.is_password_protected)),Zc(Jr.allow_comments??!0),vh(Jr.allow_replies??!0),Jr.cta_url&&Jc(Jr.cta_url),Jr.cta_label&&wu(Jr.cta_label),Jr.expires_at){b(!0);const rs=Math.max(1,Math.ceil((new Date(Jr.expires_at).getTime()-Date.now())/(24*60*60*1e3)));S(rs)}else b(!1);Jr.max_views?(N(!0),C(Jr.max_views)):N(!1),lo(Jr.notify_inapp??!1),nc(Jr.notify_email??!1)}else lo(!1),nc(!1)}})()},[i,n,e]);const hn=td===1/0;h.useEffect(()=>()=>{Ne&&URL.revokeObjectURL(Ne)},[Ne]);const $n=async()=>
1107{if(!(!l||Oe)){pe(!0),$e(!0),ct(null);try{if(le.current){try{le.current.pause(),le.current.removeAttribute("src"),le.current.load(),le.current.remove()}catch{}le.current=null}const ce=document.createElement("video");l.startsWith("blob:")||(ce.crossOrigin="anonymous"),ce.muted=!0,ce.playsInline=!0,ce.preload="auto",ce.setAttribute("webkit-playsinline","true"),ce.style.position="fixed",ce.style.left="-9999px",ce.style.top="0",ce.style.width="1px",ce.style.height="1px",ce.style.opacity="0",document.body.appendChild(ce);const ze=typeof c=="number"&&Number.isFinite(c)&&c>0?c:null,Pt=()=>{const Fs=ce.duration;if(Number.isFinite(Fs)&&!Number.isNaN(Fs)&&Fs>0)return Fs;try{const Bs=ce.seekable;if(Bs&&Bs.length>0){const Ca=Bs.end(Bs.length-1);if(Number.isFinite(Ca)&&Ca>0)return Ca}}catch{}return null},Br=await new Promise((Fs,Bs)=>{let Ca=!1,Jr=null,Ps=0;function rs(){const ac=Pt();if(ac)return ea(ac);if(ze&&ce.readyState>=1)return ea(ze)}function fi(){ea(void 0,new Error("Failed to load video"))}const sc=()=>{Jr&&window.clearInterval(Jr),window.clearTimeout(Ps),ce.removeEventListener("loadedmetadata",rs),ce.removeEventListener("loadeddata",rs),ce.removeEventListener("durationchange",rs),ce.removeEventListener("canplay",rs),ce.removeEventListener("canplaythrough",rs),ce.removeEventListener("progress",rs),ce.removeEventListener("error",fi)},ea=(ac,nd)=>{Ca||(Ca=!0,sc(),nd?Bs(nd):Fs(ac))};Ps=window.setTimeout(()=>{if(ze&&ce.readyState>=1)return ea(ze);ea(void 0,new Error("Video load timeout"))},3e4),ce.addEventListener("loadedmetadata",rs),ce.addEventListener("loadeddata",rs),ce.addEventListener("durationchange",rs),ce.addEventListener("canplay",rs),ce.addEventListener("canplaythrough",rs),ce.addEventListener("progress",rs),ce.addEventListener("error",fi),ce.src=l;try{ce.load()}catch{}Promise.resolve().then(()=>ce.play()).then(()=>ce.pause()).catch(()=>{}),Jr=window.setInterval(rs,250)});Ze(Br),le.current=ce;const Nn=Math.min(.1,Math.max(0,Br-.1));oe(Nn),await Us(Nn)}catch(ce){console.error("Error initializing video scrubber:",ce),f({title:"Could not load video",description:(ce==null?void 0:ce.message)||"Please try again or use Upload Image.",variant:"destructive"}),$e(!1)}finally{pe(!1)}}},Us=async ce=>{const ze=le.current;if(!ze)return;ke.current||(ke.current=document.createElement("canvas"));const Pt=ke.current,Br=Pt.getContext("2d");if(!Br)return;const{width:Nn,height:Fs}=rl(ze.videoWidth,ze.videoHeight);Pt.width=Nn,Pt.height=Fs;const Bs=Number.isFinite(ze.duration)?ze.duration:xe,Ca=Number.isFinite(Bs)&&Bs>0?Math.max(0,Math.min(ce,Math.max(0,Bs-.05))):Math.max(0,ce),Jr=async()=>{if(await new Promise(sc=>requestAnimationFrame(()=>requestAnimationFrame(sc))),ze.videoWidth===0||ze.videoHeight===0)return console.warn("Video dimensions not ready:",ze.videoWidth,ze.videoHeight),!1;const{width:Ps,height:rs}=rl(ze.videoWidth,ze.videoHeight);Pt.width=Ps,Pt.height=rs,Br.drawImage(ze,0,0,ze.videoWidth,ze.videoHeight,0,0,Ps,rs);const fi=Pt.toDataURL("image/jpeg",.85);return ct(fi),!0};if(ze.readyState>=2&&Math.abs(ze.currentTime-Ca)<.05){try{await Jr()||console.warn("Frame draw returned false - video may not be ready")}catch(Ps){console.error("Failed to capture frame:",Ps),f({title:"Could not capture frame",description:"Try another time, or use Upload Image instead.",variant:"destructive"})}return}await new Promise(Ps=>{const rs=setTimeout(()=>{sc(),f({title:"Frame capture timed out",description:"Please try again or use Upload Image.",variant:"destructive"}),Ps()},1e4),fi=async()=>{try{await Jr()}catch(ea){console.error("Failed to capture frame:",ea),f({title:"Could not capture frame",description:"Try another time, or use Upload Image instead.",variant:"destructive"})}finally{sc(),Ps()}},sc=()=>{clearTimeout(rs),ze.removeEventListener("seeked",fi)};ze.addEventListener("seeked",fi),ze.currentTime=Ca})},sn=ce=>{const ze=ce[0];oe(ze),Ee.current&&clearTimeout(Ee.current),Ee.current=setTimeout(()=>{Us(ze)},150)},hi=async()=>{if(it){de(!0);try{const ze=await(await fetch(it)).blob(),Pt=new File([ze],`frame-${Date.now()}.jpg`,{type:"image/jpeg"}),Br=await Vr(Pt);if(Br){const{error:Nn}=await F.from("videos").update({thumbnail_url:Br}).eq("id",n);if(Nn)throw Nn;
1107Qe(Br),$e(!1),u==null||u(Br),f({title:"Thumbnail saved",description:"This frame will be used for all future shares."})}}catch(ce){console.error("Error saving thumbnail:",ce),f({title:"Error saving thumbnail",description:ce.message||"Could not save the custom frame.",variant:"destructive"})}finally{de(!1)}}},Ja=ce=>{const ze=Math.floor(ce/60),Pt=Math.floor(ce%60);return`${ze}:${Pt.toString().padStart(2,"0")}`},ei=()=>{Qe(null),$e(!1),ct(null),oe(0)},$a=h.useRef(null),Vr=async ce=>{try{const ze=ce.name.split(".").pop()||"jpg",Pt=`${i}/${n}-${Date.now()}.${ze}`,{data:Br,error:Nn}=await F.storage.from("thumbnails").upload(Pt,ce,{cacheControl:"3600",upsert:!0});if(Nn)throw Nn;const{data:Fs}=F.storage.from("thumbnails").getPublicUrl(Br.path);return Fs.publicUrl}catch(ze){return console.error("Error uploading thumbnail:",ze),f({title:"Upload failed",description:ze.message||"Could not upload thumbnail.",variant:"destructive"}),null}},Sa=10,Fi=Sa*1024*1024,_a=async ce=>{var Br;const ze=(Br=ce.target.files)==null?void 0:Br[0];if(!ze)return;if(!ze.type.startsWith("image/")){f({title:"Invalid file",description:"Please select an image file.",variant:"destructive"});return}if(ze.size>Fi){const Nn=(ze.size/1048576).toFixed(1);f({title:"File too large",description:`Your image is ${Nn}MB. Please choose an image under ${Sa}MB.`,variant:"destructive"});return}mt(!1);const Pt=URL.createObjectURL(ze);Wt(Pt),we(void 0),Zt(!0),$a.current&&($a.current.value="")},_i=h.useCallback(ce=>{const{width:ze,height:Pt}=ce.currentTarget;be(JRe(ze,Pt,KV))},[]),rd=h.useCallback(async()=>{if(!Ue||!at.current||!Yt.current){f({title:"Crop area required",description:"Please select a crop area.",variant:"destructive"});return}const ce=at.current,ze=Yt.current,Pt=ze.getContext("2d");if(!Pt)return;const Br=ce.naturalWidth/ce.width,Nn=ce.naturalHeight/ce.height,Fs=Ue.x*Br,Bs=Ue.y*Nn,Ca=Ue.width*Br,Jr=Ue.height*Nn,{width:Ps,height:rs}=rl(Ca,Jr);ze.width=Ps,ze.height=rs,Pt.imageSmoothingQuality="high",Pt.drawImage(ce,Fs,Bs,Ca,Jr,0,0,Ps,rs),ze.toBlob(async fi=>{if(!fi){f({title:"Crop failed",description:"Could not crop image.",variant:"destructive"});return}Zt(!1),bt&&(URL.revokeObjectURL(bt),Wt(null)),de(!0);try{const sc=new File([fi],`cropped-${Date.now()}.jpg`,{type:"image/jpeg"}),ea=await Vr(sc);if(ea){Ne!=null&&Ne.startsWith("blob:")&&URL.revokeObjectURL(Ne);const{error:ac}=await F.from("videos").update({thumbnail_url:ea}).eq("id",n);ac?console.error("Error saving thumbnail to video:",ac):u==null||u(ea),Qe(ea),f({title:"Thumbnail saved",description:"Your cropped photo will be used for all future shares."})}}finally{de(!1)}},"image/jpeg",.9)},[Ue,bt,Ne,n,u,f]),Su=()=>{Zt(!1),bt&&(URL.revokeObjectURL(bt),Wt(null))},jC=h.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation()},[]),NC=h.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation(),Be(!0)},[]),SC=h.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation(),ce.currentTarget.contains(ce.relatedTarget)||Be(!1)},[]),mp=h.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation(),Be(!1);const ze=ce.dataTransfer.files;if(ze.length===0)return;const Pt=ze[0];if(!Pt.type.startsWith("image/")){f({title:"Invalid file",description:"Please drop an image file.",variant:"destructive"});return}if(Pt.size>Fi){const Nn=(Pt.size/1048576).toFixed(1);f({title:"File too large",description:`Your image is ${Nn}MB. Please choose an image under ${Sa}MB.`,variant:"destructive"});return}const Br=URL.createObjectURL(Pt);Wt(Br),we(void 0),Zt(!0)},[f]),Bv=()=>{const ce=dt.current||Nt;ce&&ce.getTracks().forEach(ze=>ze.stop()),dt.current=null,Ct(null),Re(!1)},zv=()=>{Bv(),Ae(!1),gt(!1),St(ce=>(ce&&URL.revokeObjectURL(ce.url),null))},hp=async()=>{try{const ce=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720},facingMode:"user"}});Ct(ce),dt.current=ce,gt(!0),St(null),Re(!1),setTimeout(()=>{if(Ve.current){const ze=Ve.current;ze.srcObject=ce;const Pt=()=>{ze.videoWidth>0&&ze.videoHeight>0&&Re(!0)};ze.addEventListener("loadeddata",Pt,{once:!0}),ze.addEventListener("canplay",Pt,{once:!0}),ze.play().catch(()=>{}),setTimeout(Pt,250)}},100)}catch(ce){console.error("Webcam error:",ce),f({title:"Camera access denied",description:"Please allow camera access to take a photo.",variant:"destructive"})}},_C=async()=>{const ce=Ve.current,ze=et.current;if(!ce||!ze)return;if(ce.videoWidth===0||ce.videoHeight===0||ce.readyState<2){try{await ce.play()}catch{}await new Promise(Fs=>setTimeout(Fs,150))}if(ce.videoWidth===0||ce.videoHeight===0){f({title:"Camera not ready",description:"Please wait a moment and try again.",variant:"destructive"});return}const Pt=ze.getContext("2d");if(!Pt)return;const{width:Br,height:Nn}=rl(ce.videoWidth,ce.videoHeight);ze.width=Br,ze.height=Nn,Pt.translate(ze.width,0),Pt.scale(-1,1),Pt.drawImage(ce,0,0,ce.videoWidth,ce.videoHeight,0,0,ze.width,ze.height),Pt.setTransform(1,0,0,1,0,0),ze.toBlob(Fs=>{if(!Fs){f({title:"Capture failed",description:"Could not capture photo.",variant:"destructive"});return}const Bs=URL.createObjectURL(Fs);St({url:Bs,blob:Fs}),Bv()},"image/jpeg",.9)},N3=async()=>{St(ce=>(ce&&URL.revokeObjectURL(ce.url),null)),await hp()},S3=async()=>
1107{if(Ge){de(!0);try{const ce=new File([Ge.blob],`webcam-${Date.now()}.jpg`,{type:"image/jpeg"}),ze=await Vr(ce);if(ze){Ne!=null&&Ne.startsWith("blob:")&&URL.revokeObjectURL(Ne);const{error:Pt}=await F.from("videos").update({thumbnail_url:ze}).eq("id",n);Pt?console.error("Error saving thumbnail to video:",Pt):u==null||u(ze),Qe(ze),f({title:"Thumbnail saved",description:"Your photo will be used for all future shares."})}gt(!1),St(Pt=>(Pt&&URL.revokeObjectURL(Pt.url),null))}finally{de(!1)}}},_3=()=>{const ce=new Uint8Array(32);return crypto.getRandomValues(ce),btoa(String.fromCharCode(...ce)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"").slice(0,32)},C3=async()=>{var ce;if(O.trim()&&!ee(O)){I("Please enter a valid email address"),f({title:"Invalid email",description:"Please enter a valid email address for the recipient.",variant:"destructive"});return}if(k&&R.length<8){f({title:"Password too short",description:"Password must be at least 8 characters for security.",variant:"destructive"});return}x(!0);try{if(L){const{error:ze}=await F.from("video_share_links").update({recipient_email:O.trim()||null,recipient_name:B.trim()||null,recipient_phone:Z.trim()||null,title:H.trim()||null,expires_at:y?new Date(Date.now()+w*24*60*60*1e3).toISOString():null,max_views:j?_:null,allow_comments:yu,allow_replies:gh,notify_inapp:Qc,notify_email:bu,cta_url:jl.trim()||null,cta_label:Nl.trim()||null}).eq("id",L);if(ze)throw ze;k&&R&&(await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:W,updateOnly:!0,password:R}}),Tn(R)),f({title:"Link updated",description:"Your share link has been updated."})}else{const ze=_3(),Pt=y?new Date(Date.now()+w*24*60*60*1e3).toISOString():null,{data:Br,error:Nn}=await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:ze,expiresAt:Pt,maxViews:j?_:null,password:k?R:null,recipientEmail:O.trim()||null,recipientName:B.trim()||null,recipientPhone:Z.trim()||null,title:H.trim()||null,ctaUrl:jl.trim()||null,ctaLabel:Nl.trim()||null}});if(Nn)throw Nn;if(Br.error)throw new Error(Br.error);Q(ze),te(((ce=Br.shareLink)==null?void 0:ce.id)||null),await Qt(),v(r0(ze)),Ar(!1),k&&R&&Tn(R),f({title:or?"Link regenerated":"Share link created",description:k?"Your password-protected share link is ready.":"Your video share link is ready to use."})}}catch(ze){f({title:"Error",description:ze.message||"Failed to update share link",variant:"destructive"})}finally{x(!1)}},k3=async ce=>{if(!(!W||!L)){if(ce){es(!0),ht("");return}ie(!0);try{await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:W,updateOnly:!0,password:null}}),E(!1),T(""),ht(""),Tn(null),es(!1),f({title:"Password removed",description:"This link is now public."})}catch(ze){f({title:"Error",description:ze.message||"Failed to update password protection",variant:"destructive"})}finally{ie(!1)}}},E3=async()=>{if(_e.length<8){f({title:"Password too short",description:"Password must be at least 8 characters for security.",variant:"destructive"});return}ie(!0);try{await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:W,updateOnly:!0,password:_e}}),E(!0),Tn(_e),T(_e),ht(""),es(!1),Zr(!1),f({title:"Password set",description:"This link is now password protected."})}catch(ce){f({title:"Error",description:ce.message||"Failed to set password",variant:"destructive"})}finally{ie(!1)}},_u=async ce=>{if(!(!W||!L)){Qr(!0);try{const ze=ce?ta(new Date,w).toISOString():null;await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:W,updateOnly:!0,expiresAt:ze}}),b(ce),Na(!1),f({title:ce?"Expiration set":"Expiration removed",description:ce?`Link expires ${cn(ta(new Date,w),"MMM d, yyyy")}`:"Link no longer expires"})}catch(ze){f({title:"Error",description:ze.message||"Failed to update expiration",variant:"destructive"})}finally{Qr(!1)}}},fp=async ce=>{if(!(!W||!L)){Qr(!0);try{await F.functions.invoke("create-share-link",{body:{videoId:n,shareToken:W,updateOnly:!0,maxViews:ce?_:null}}),N(ce),qn(!1),f({title:ce?"View limit set":"View limit removed",description:ce?`Link limited to ${_} views`:"Link has no view limit"})}catch(ze){f({title:"Error",description:ze.message||"Failed to update view limit",variant:"destructive"})}finally{Qr(!1)}}},qv=async(ce,ze)=>{const Pt=ce==="notify_inapp"?Qc:bu;if(ce==="notify_inapp"?lo(ze):nc(ze),!L)return;const{error:Br}=await F.from("video_share_links").update({[ce]:ze}).eq("id",L);Br&&(ce==="notify_inapp"?lo(Pt):nc(Pt),f({title:"Error",description:"Failed to update notification setting",variant:"destructive"}))},CC=async()=>{g&&(await navigator.clipboard.writeText(g),A(!0),setTimeout(()=>A(!1),2e3),f({title:"Copied",description:"Link copied to clipboard"}))},pp=()=>{v(null),A(!1),U(!1),T(""),E(!1),M(""),I(null),K(""),q(""),X(""),Q(null),ne(""),ei(),t(!1)};return r.jsx(It,{open:e,onOpenChange:ce=>{ce||pp()},children:r.jsxs(Dt,{className:"max-w-md [&>button.absolute]:hidden",children:[r.jsxs(Lt,{children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(Wl,{className:"w-5 h-5"}),"Share Video"]}),r.jsx(P,{variant:"ghost",size:"sm",onClick:pp,children:"Close"})]}),r.jsx($r,{className:"sr-only",children:"Create and share a link to your video"})]}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsx("canvas",{ref:ve,className:"hidden"}),r.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-black aspect-video",children:[Ft?r.jsx("img",{src:Ft,alt:s,className:"w-full h-full object-contain"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground bg-muted",children:r.jsxs("div",{className:"text-center",children:[r.jsx(wi,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No thumbnail"})]})}),r.jsx(ZD,{show:La,customLogoUrl:Xc,useCustom:jt!=="starter"&&gu}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent pointer-events-none"}),r.jsxs("div",{className:"absolute bottom-2 left-2 right-2 pointer-events-none",children:[r.jsx("p",{className:"text-white text-sm font-medium truncate",children:s}),r.jsx("p",{className:"text-white/70 text-xs",children:Ne?"Custom frame selected":"This preview will be included in your share"})]})]}),!g&&r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:$a,type:"file",accept:"image/*",capture:"environment",onChange:_a,className:"hidden",id:"camera-in
1107put"}),r.jsx("input",{type:"file",accept:"image/*",onChange:_a,className:"hidden",id:"upload-input"}),Le?r.jsxs("div",{className:"space-y-2 p-2 bg-muted/30 rounded-lg",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs font-medium",children:"Scrub to select frame"}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{$e(!1),ct(null)},className:"h-5 w-5 p-0",children:r.jsx(zt,{className:"w-3 h-3"})})]}),Oe?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"aspect-video bg-muted rounded animate-pulse flex items-center justify-center",children:r.jsx(Me,{className:"w-6 h-6 animate-spin text-muted-foreground"})}),r.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Loading video..."})]}):r.jsxs(r.Fragment,{children:[it&&r.jsxs("div",{className:"relative aspect-video rounded overflow-hidden bg-muted",children:[r.jsx("img",{src:it,alt:"Frame preview",className:"w-full h-full object-contain"}),r.jsx("div",{className:"absolute bottom-1 right-1 text-[10px] bg-black/50 text-white px-1 rounded",children:Ja(De)})]}),r.jsxs("div",{className:"px-1",children:[r.jsx(zm,{value:[De],min:0,max:xe,step:.1,onValueChange:sn,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1",children:[r.jsx("span",{children:"0:00"}),r.jsx("span",{children:Ja(xe)})]})]}),r.jsx(P,{size:"sm",onClick:hi,disabled:!it||J,className:"w-full h-8",children:J?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-3 h-3 mr-1 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-3 h-3 mr-1"}),"Use This Frame"]})})]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:m?"Upload a custom thumbnail image":"Choose a thumbnail"}),r.jsxs("div",{className:"flex gap-2",children:[l&&!m&&r.jsx(P,{variant:"outline",size:"sm",onClick:$n,disabled:Oe,className:"flex-1",children:Oe?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Loading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(cr,{className:"w-4 h-4 mr-2"}),"Scrub"]})}),r.jsx(P,{variant:"outline",size:"sm",onClick:()=>{var ce;return(ce=$a.current)==null?void 0:ce.click()},disabled:J,className:"flex-1 md:hidden",children:J?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ga,{className:"w-4 h-4 mr-2"}),"Take Photo"]})}),!m&&r.jsx(P,{variant:"outline",size:"sm",onClick:hp,disabled:J,className:"flex-1 hidden md:flex",children:J?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ga,{className:"w-4 h-4 mr-2"}),"Webcam"]})}),r.jsx(P,{variant:"outline",size:"sm",onClick:()=>{var ce;return(ce=document.getElementById("upload-input"))==null?void 0:ce.click()},disabled:J,className:"flex-1",children:J?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(na,{className:"w-4 h-4 mr-2"}),"Upload"]})})]})]}),Ne&&!l&&r.jsx(P,{variant:"ghost",size:"sm",onClick:ei,className:"w-full",children:"Reset to Original Thumbnail"})]}),r.jsx(It,{open:ot,onOpenChange:ce=>{ce||zv()},children:r.jsxs(Dt,{className:"max-w-lg",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(ga,{className:"w-5 h-5"}),"Take Photo for Thumbnail"]}),r.jsx($r,{children:"Position yourself and click capture to take a photo for your video thumbnail."})]}),r.jsx("canvas",{ref:et,className:"hidden"}),Ge?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative bg-muted rounded-lg overflow-hidden",children:[r.jsx("img",{src:Ge.url,alt:"Captured photo preview",className:"max-h-[52vh] w-full object-contain"}),r.jsx("div",{className:"absolute top-2 left-2 px-2 py-1 bg-background/80 backdrop-blur-sm rounded text-xs font-medium",children:"Review Photo"})]}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:zv,disabled:J,children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Cancel"]}),r.jsxs("div",{className:"flex flex-1 gap-2 sm:justify-end",children:[r.jsxs(P,{variant:"outline",onClick:N3,disabled:J,className:"flex-1 sm:flex-none",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Retake"]}),r.jsx(P,{onClick:S3,disabled:J,className:"flex-1 sm:flex-none",children:J?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Use as Thumbnail"]})})]})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative bg-muted rounded-lg overflow-hidden",children:[r.jsx("video",{ref:Ve,autoPlay:!0,playsInl
1107ine:!0,muted:!0,className:"max-h-[52vh] w-full object-contain scale-x-[-1]"}),!tt&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-muted-foreground"})}),r.jsx(PR,{isActive:Fe,onComplete:()=>{Ae(!1),_C()}})]}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:zv,disabled:Fe,children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Cancel"]}),r.jsxs(P,{onClick:()=>Ae(!0),disabled:!tt||Fe,children:[r.jsx(ga,{className:"w-4 h-4 mr-2"}),Fe?"Get ready...":"Capture Photo"]})]})]})]})}),r.jsx(It,{open:pt,onOpenChange:mt,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(na,{className:"w-5 h-5"}),"Upload Thumbnail"]}),r.jsx($r,{children:"Upload an image to use as your video thumbnail."})]}),r.jsx("input",{type:"file",accept:"image/*",onChange:ce=>{var Br;const ze=(Br=ce.target.files)==null?void 0:Br[0];if(!ze)return;if(!ze.type.startsWith("image/")){f({title:"Invalid file",description:"Please select an image file.",variant:"destructive"});return}if(ze.size>Fi){const Nn=(ze.size/1048576).toFixed(1);f({title:"File too large",description:`Your image is ${Nn}MB. Please choose an image under ${Sa}MB.`,variant:"destructive"});return}mt(!1);const Pt=URL.createObjectURL(ze);Wt(Pt),we(void 0),Zt(!0),ce.target.value=""},className:"hidden",id:"upload-dialog-input"}),r.jsx("div",{className:`relative border-2 border-dashed rounded-lg p-8 transition-colors cursor-pointer ${er?"border-primary bg-primary/10":"border-muted-foreground/25 hover:border-primary/50 hover:bg-muted/50"}`,onDragOver:ce=>{ce.preventDefault(),ce.stopPropagation()},onDragEnter:ce=>{ce.preventDefault(),ce.stopPropagation(),kt(!0)},onDragLeave:ce=>{ce.preventDefault(),ce.stopPropagation(),ce.currentTarget.contains(ce.relatedTarget)||kt(!1)},onDrop:ce=>{ce.preventDefault(),ce.stopPropagation(),kt(!1);const ze=ce.dataTransfer.files;if(ze.length===0)return;const Pt=ze[0];if(!Pt.type.startsWith("image/")){f({title:"Invalid file",description:"Please drop an image file.",variant:"destructive"});return}if(Pt.size>Fi){const Nn=(Pt.size/1048576).toFixed(1);f({title:"File too large",description:`Your image is ${Nn}MB. Please choose an image under ${Sa}MB.`,variant:"destructive"});return}mt(!1);const Br=URL.createObjectURL(Pt);Wt(Br),we(void 0),Zt(!0)},onClick:()=>{var ce;return(ce=document.getElementById("upload-dialog-input"))==null?void 0:ce.click()},children:r.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[r.jsx("div",{className:`p-4 rounded-full ${er?"bg-primary/20":"bg-muted"}`,children:r.jsx(na,{className:`w-8 h-8 ${er?"text-primary":"text-muted-foreground"}`})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:er?"Drop image here":"Drag & drop an image"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"or click to browse"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG, WEBP up to 10MB"})]})}),r.jsx(Fr,{children:r.jsx(P,{variant:"outline",onClick:()=>mt(!1),children:"Cancel"})})]})}),r.jsx(It,{open:Tt,onOpenChange:ce=>!ce&&Su(),children:r.jsxs(Dt,{className:"max-w-lg",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx($m,{className:"w-5 h-5"}),"Crop Thumbnail"]}),r.jsx($r,{children:"Adjust the crop area to select the portion of the image you want to use as your thumbnail."})]}),r.jsx("div",{className:"relative bg-muted rounded-lg overflow-hidden",children:bt&&r.jsx(s2,{crop:Xe,onChange:(ce,ze)=>be(ze),onComplete:ce=>we(ce),aspect:KV,className:"max-h-[400px]",children:r.jsx("img",{ref:at,src:bt,alt:"Crop preview",onLoad:_i,className:"max-h-[400px] w-auto mx-auto"})})}),r.jsx("canvas",{ref:Yt,className:"hidden"}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:Su,children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Cancel"]}),r.jsxs(P,{onClick:rd,disabled:!Ue,children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Apply Crop"]})]})]})}),!hn&&!g&&r.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[r.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r.jsx("span",{className:"text-muted-foreground",children:"Monthly sends"}),r.jsxs("span",{className:"font-medium text-foreground",children:[$o," / ",td]})]}),r.jsx(Lc,{value:$o/td*100,className:"h-2"}),Ui<=3&&Ui>0&&r.jsxs("p",{className:"text-xs text-primary mt-2 font-medium",children:["⚡ Only ",Ui," send",Ui!==1?"s":""," remaining - upgrade for unlimited!"]})]}),!hn&&!g&&!Nu&&Ui<=2&&Ui>0&&r.jsx(GV,{currentUsage:$o,limit:td,variant:"inline"}),Nu&&!g?r.jsx(GV,{currentUsage:$o,limit:td,variant:"modal"}):g?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3 flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-green-100 dark:bg-green-800/50 flex items-center justify-center flex-shrink-0",children:r.jsx(nt,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-green-800 dark:text-green-200",children:"Link Created!"}),r.jsx("p",{className:"text-xs text-green-600 dark:text-green-300",children:"Now choose how you'd like to share it below."})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[r.jsx("div",{className:"w-5 h-5 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(ui,{className:"w-3 h-3"})}),"Copy Link"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{value:g||"",readOnly:!0,className:"flex-1 text-xs"}),r.jsxs(A1,{openDelay:200,closeDelay:100,children:[r.jsx(T1,{asChild:!0,children:r.jsx(P,{variant:D?"default":"outline",size:"icon",onClick:CC,
1107children:D?r.jsx(nt,{className:"w-4 h-4"}):r.jsx(ui,{className:"w-4 h-4"})})}),r.jsx(lb,{side:"left",align:"center",className:"w-56 p-2 text-xs text-center",children:"Copy clean link for emails and chat"})]}),r.jsxs(A1,{openDelay:200,closeDelay:100,children:[r.jsx(T1,{asChild:!0,children:r.jsx(P,{variant:"outline",size:"icon",onClick:()=>window.open(g||"","_blank"),children:r.jsx(bn,{className:"w-4 h-4"})})}),r.jsx(lb,{side:"left",align:"center",className:"w-48 p-2 text-xs text-center",children:"Open link in new tab"})]})]})]}),r.jsxs("div",{className:"bg-muted/50 border border-border rounded-lg p-3 space-y-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-foreground",children:"Link Settings"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:k||y||j?"Link access is restricted by the settings below":"Anyone with this link can view the video"}),r.jsxs("div",{className:"flex flex-wrap gap-2 mt-1.5",children:[y&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300",children:[r.jsx(Ga,{className:"w-2.5 h-2.5"}),"Expires ",cn(ta(new Date,w),"MMM d, yyyy")]}),j&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",children:[r.jsx(wr,{className:"w-2.5 h-2.5"}),_," view limit"]})]})]}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ni,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Password Protection"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:k?"Viewers must enter password":"Anyone with link can view"})]})]}),r.jsx(rr,{checked:k,onCheckedChange:k3,disabled:An})]}),k&&!nn&&zn&&r.jsxs("div",{className:"mt-2 flex items-center gap-2 bg-muted/50 rounded px-2 py-1.5",children:[r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Password:"}),r.jsx("code",{className:"text-xs font-mono flex-1",children:zn}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>{navigator.clipboard.writeText(zn),f({title:"Password copied"})},children:r.jsx(ui,{className:"w-3 h-3"})})]}),nn&&r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(He,{type:Ln?"text":"password",value:_e,onChange:ce=>ht(ce.target.value),placeholder:"Enter password (min 8 characters)",className:"text-xs h-8 pr-8",disabled:An}),r.jsx("button",{type:"button",onClick:()=>Zr(!Ln),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Ln?r.jsx(Pb,{className:"w-3.5 h-3.5"}):r.jsx(wr,{className:"w-3.5 h-3.5"})})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs flex-1",onClick:()=>{es(!1),ht("")},disabled:An,children:"Cancel"}),r.jsx(P,{size:"sm",className:"h-7 px-3 text-xs flex-1",onClick:E3,disabled:An||_e.length<8,children:An?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):"Set Password"})]})]}),k&&!nn&&r.jsx(P,{variant:"ghost",size:"sm",className:"mt-2 h-6 px-2 text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>{es(!0),ht("")},disabled:An,children:"Change password"})]}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ga,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Expiration Date"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:y?`Expires ${cn(ta(new Date,w),"MMM d, yyyy")}`:"Link never expires"})]})]}),r.jsx(rr,{checked:y,onCheckedChange:_u,disabled:Hn})]}),y&&r.jsx("div",{className:"mt-3 space-y-2",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Expires in"}),r.jsxs("select",{value:w,onChange:ce=>{S(Number(ce.target.value))},className:"h-7 px-2 text-xs rounded-md border border-input bg-background",disabled:Hn,children:[r.jsx("option",{value:1,children:"1 day"}),r.jsx("option",{value:3,children:"3 days"}),r.jsx("option",{value:7,children:"7 days"}),r.jsx("option",{value:14,children:"14 days"}),r.jsx("option",{value:30,children:"30 days"}),r.jsx("option",{value:90,children:"90 days"})]}),r.jsx(P,{size:"sm",variant:"outline",className:"h-7 px-2 text-xs",onClick:()=>_u(!0),disabled:Hn,children:Hn?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):"Update"})]})})]}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wr,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"View Limit"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:j?`Limited to ${_} views`:"Unlimited views"})]})]}),r.jsx(rr,{checked:j,onCheckedChange:fp,disabled:Hn})]}),j&&r.jsx("div",{className:"mt-3 space-y-2",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Max views"}
1107),r.jsx(He,{type:"number",value:_,onChange:ce=>C(Number(ce.target.value)||1),min:1,max:1e3,className:"h-7 w-20 text-xs",disabled:Hn}),r.jsx(P,{size:"sm",variant:"outline",className:"h-7 px-2 text-xs",onClick:()=>fp(!0),disabled:Hn,children:Hn?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):"Update"})]})})]}),r.jsx("div",{className:"border-t border-border pt-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Wa,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Allow Comments"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Let viewers leave comments on this video"})]})]}),r.jsx(rr,{checked:yu,onCheckedChange:async ce=>{const ze=yu;if(Zc(ce),!L)return;const{error:Pt}=await F.from("video_share_links").update({allow_comments:ce}).eq("id",L);Pt&&(Zc(ze),f({title:"Error",description:"Failed to update comments setting",variant:"destructive"}))}})]})}),r.jsx("div",{className:"border-t border-border pt-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(cr,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Allow Video Replies"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Let viewers send video replies to this video"})]})]}),r.jsx(rr,{checked:gh,onCheckedChange:async ce=>{const ze=gh;if(vh(ce),!L)return;const{error:Pt}=await F.from("video_share_links").update({allow_replies:ce}).eq("id",L);Pt&&(vh(ze),f({title:"Error",description:"Failed to update replies setting",variant:"destructive"}))}})]})}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(bn,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Call to Action"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Show a button in the watch page header"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(He,{value:jl,onChange:ce=>{Jc(ce.target.value),ce.target.value.trim()&&!/^https?:\/\//i.test(ce.target.value.trim())?ju("URL must start with http:// or https://"):ju(null)},placeholder:"https://example.com",className:"text-sm"}),ed&&r.jsx("p",{className:"text-[10px] text-destructive",children:ed}),r.jsx(He,{value:Nl,onChange:ce=>wu(ce.target.value.slice(0,30)),placeholder:"Button text (e.g. Learn More)",className:"text-sm",maxLength:30}),jl.trim()&&!ed&&r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{size:"sm",className:"flex-1 text-xs",onClick:async()=>{if(!L)return;const{error:ce}=await F.from("video_share_links").update({cta_url:jl.trim()||null,cta_label:Nl.trim()||null}).eq("id",L);f(ce?{title:"Error",description:"Failed to save CTA",variant:"destructive"}:{title:"CTA saved",description:"Call-to-action button updated."})},children:"Save CTA"}),r.jsx(P,{size:"sm",variant:"outline",className:"text-xs text-destructive hover:text-destructive",onClick:async()=>{if(!L)return;const{error:ce}=await F.from("video_share_links").update({cta_url:null,cta_label:null}).eq("id",L);ce||(Jc(""),wu(""),f({title:"CTA removed"}))},children:"Remove"})]})]})]}),r.jsx("div",{className:"border-t border-border pt-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zl,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"In-App View Alerts"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Get a notification in the app when someone views this video"})]})]}),r.jsx(rr,{checked:Qc,onCheckedChange:ce=>qv("notify_inapp",ce)})]})}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zr,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Email View Alerts"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Receive an email notification when someone views this video"})]})]}),r.jsx(rr,{checked:bu,onCheckedChange:ce=>qv("notify_email",ce)})]}),r.jsxs("div",{className:"border-t border-border pt-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wi,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium",children:"Thumbnail"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:Ne?"Custom frame selected":"Auto-generated from video"})]})]}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>Os(!dn),children:dn?r.jsxs(r.Fragment,{children:[r.jsx(zt,{className:"w-3 h-3 mr-1"}),"Close"]}):r.jsxs(r.Fragment,{children:[r.jsx(wi,{className:"w-3 h-3 mr-1"}),"Edit"]})})]}),dn&&l&&r.jsxs("div",{className:`mt-3 space-y-3 relative transition-colors ${Qa?"ring-2 ring-primary ring-dashed rounded-lg bg-primary/5":""}`,onDragOver:jC,onDragEnter:NC,onDragLeave:SC,onDrop:mp,children:[Qa&&r.jsx("div",{className:"absolute inset-0 bg-primary/10 rounded-lg flex items-center justify-center z-10 pointer-events-none",children:r.jsxs("div",{className:"text-center",children:[r.jsx(na,{className:"w-6 h-6 text-primary mx-auto mb-1"}),r.jsx("p",{className:"text-xs font-medium text-primary",children:"Drop image here"})]})}),!Le&&r.jsx("div",{className:"space-y-2",children:r.jsxs("div",{className:`grid gap-1.5 ${m?"grid-cols-1":"grid-cols-3"}`,children:[!m&&r.jsx(P,{variant:"outline",size:"sm",onClick:$n,disabled:Oe,className:"h-8 text-[10px] px-1",children:Oe?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(cr,{className:"w-3 h-3 mr-0.5"}),"Scrub"]})}),r.jsx(P,{variant:"outline",size:"sm",onClick:()=>mt(!0),disabled:J,className:"h-8 text-[10px] px-1",children:J?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(na,{className:"w-3 h-3 mr-0.5"}),"Upload"]})}),!m&&r.jsx(P,{variant:"outline",size:"sm",onClick:hp,disabled:J,className:"h-8 text-[10px] px-1",children:J?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(ga,{className:"w-3 h-3 mr-0.5"}),"Webcam"]})})]})}),Le&&r.jsxs("div",{className:"space-y-2 p-2 bg-muted/30 rounded-lg",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs font-medium",children:"Scrub to select frame"}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{$e(!1),ct(null)},className:"h-5 w-5 p-0",children:r.jsx(zt,{className:"w-3 h-3"})})]}),Oe?r.jsxs("div",{className:"space-y-2",children:[r.jsx(ia,{className:"aspect-video rounded"}),r.jsx(ia,{className:"h-4 w-full"})]}):r.jsxs(r.Fragment,{children:[it&&r.jsx("div",{className:"relative aspect-video rounded overflow-hidden bg-muted",children:r.jsx("img",{src:it,alt:"Scrubber preview",className:"w-full h-full object-cover"})}),r.jsxs("div",{className:"space-y-1",children:[r.jsx(zm,{value:[De],onValueChange:ce=>sn(ce),max:xe,step:.1,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[r.jsx("span",{children:Ja(De)}),r.jsx("span",{children:Ja(xe)})]})]}),r.jsx(P,{size:"sm",className:"w-full h-7 text-xs",onClick:hi,disabled:J||!it,children:J?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-3 h-3 mr-1"}),"Use This Frame"]})})]})]})]})]})]})]})]}
1107):r.jsxs(r.Fragment,{children:[!or&&r.jsxs("div",{className:"bg-primary/5 border border-primary/10 rounded-lg p-3 flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx("span",{className:"text-lg",children:"💡"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Quick Start"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Create Share Link" to get started. You can add recipient details now or send the email after.'})]})]}),r.jsxs("div",{className:"space-y-4",children:[!or&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[r.jsx("div",{className:"w-5 h-5 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx("span",{className:"text-xs",children:"1"})}),"Recipient Details",r.jsxs(A1,{openDelay:200,children:[r.jsx(T1,{asChild:!0,children:r.jsx("button",{className:"text-muted-foreground hover:text-foreground",children:r.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"1.5"}),r.jsx("path",{d:"M12 16v-4M12 8h.01",strokeWidth:"2",strokeLinecap:"round"})]})})}),r.jsxs(lb,{side:"top",className:"w-64 text-xs",children:[r.jsx("p",{className:"font-medium mb-1",children:"Why add recipient info?"}),r.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[r.jsx("li",{children:"• Track who views your video"}),r.jsx("li",{children:"• Personalize email messages"}),r.jsx("li",{children:"• See engagement analytics"})]})]})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs",children:"Link Title (optional)"}),r.jsx(He,{type:"text",value:H,onChange:ce=>X(ce.target.value.slice(0,40)),placeholder:"e.g., Sales Demo for Acme Corp",maxLength:40}),r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["A name to help you identify this link (",H.length,"/40)"]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs",children:"Email (optional)"}),r.jsx(He,{type:"email",value:O,onChange:ce=>re(ce.target.value),placeholder:"[email protected]",className:`text-sm ${$?"border-destructive focus-visible:ring-destructive":""}`}),$&&r.jsx("p",{className:"text-[10px] text-destructive",children:$})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs",children:"Name (optional)"}),r.jsx(He,{type:"text",value:B,onChange:ce=>K(ce.target.value),placeholder:"John Doe",className:"text-sm"})]})]}),G&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(U4,{className:"w-3 h-3"}),"Phone (optional)"]}),r.jsx(He,{type:"tel",value:Z,onChange:ce=>q(ce.target.value),placeholder:"+1 555 123 4567",className:"text-sm"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"For text message sharing"})]})]}),r.jsxs(Wm,{children:[r.jsx(Ff,{asChild:!0,children:r.jsxs("button",{className:"flex items-center gap-2 text-sm font-medium text-foreground w-full group",children:[r.jsx("div",{className:"w-5 h-5 rounded-full bg-muted flex items-center justify-center",children:r.jsx("span",{className:"text-xs",children:"2"})}),r.jsx("span",{children:"Advanced Options"}),r.jsx("span",{className:"text-[10px] text-muted-foreground ml-1",children:"(optional)"}),r.jsx(Qs,{className:"w-4 h-4 ml-auto text-muted-foreground group-hover:text-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),r.jsx(Ym,{className:"space-y-3 pt-3",children:r.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{className:"text-xs",children:"Expiration"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Link expires after set days"})]}),r.jsx(rr,{checked:y,onCheckedChange:b})]}),y&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{type:"number",value:w,onChange:ce=>S(Number(ce.target.value)),min:1,max:365,className:"w-20 text-sm"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"days"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{className:"text-xs",children:"View Limit"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Limit number of views"})]}),r.jsx(rr,{checked:j,onCheckedChange:N})]}),j&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{type:"number",value:_,onCh
1107ange:ce=>C(Number(ce.target.value)),min:1,className:"w-24 text-sm"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"views"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(Ni,{className:"w-3 h-3"}),"Password Protection"]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Require password to view"})]}),r.jsx(rr,{checked:k,onCheckedChange:E})]}),k&&r.jsxs("div",{className:"relative",children:[r.jsx(He,{type:Dr?"text":"password",value:R,onChange:ce=>T(ce.target.value),placeholder:"Enter password (min 8 characters)",className:"w-full text-sm pr-10"}),r.jsx("button",{type:"button",onClick:()=>Mr(!Dr),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Dr?r.jsx(Pb,{className:"w-4 h-4"}):r.jsx(wr,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(Wa,{className:"w-3 h-3"}),"Allow Comments"]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Let viewers leave comments"})]}),r.jsx(rr,{checked:yu,onCheckedChange:Zc})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(bn,{className:"w-3 h-3"}),"Call to Action"]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Add a button to the watch page header"}),r.jsx(He,{value:jl,onChange:ce=>{Jc(ce.target.value),ce.target.value.trim()&&!/^https?:\/\//i.test(ce.target.value.trim())?ju("URL must start with http:// or https://"):ju(null)},placeholder:"https://example.com",className:"text-sm"}),ed&&r.jsx("p",{className:"text-[10px] text-destructive",children:ed}),r.jsx(He,{value:Nl,onChange:ce=>wu(ce.target.value.slice(0,30)),placeholder:"Button text (e.g. Learn More)",className:"text-sm",maxLength:30})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(wr,{className:"w-3 h-3"}),"In-App View Alerts"]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Get notified when someone watches"})]}),r.jsx(rr,{checked:Qc,onCheckedChange:lo})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-xs flex items-center gap-1",children:[r.jsx(zr,{className:"w-3 h-3"}),"Email View Alerts"]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Receive email when video is viewed"})]}),r.jsx(rr,{checked:bu,onCheckedChange:nc})]})]})})]})]}),r.jsx(P,{onClick:C3,disabled:p,className:"w-full",children:p?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),or?"Regenerating...":"Creating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(vs,{className:`w-4 h-4 mr-2 ${or?"":"hidden"}`}),r.jsx(Wl,{className:`w-4 h-4 mr-2 ${or?"hidden":""}`}),or?"Regenerate Link":"Create Share Link"]})})]})]}),r.jsx(Fr,{className:"pt-4 mt-2 border-t",children:r.jsx(P,{variant:"outline",className:"w-full sm:w-auto",onClick:pp,children:"Close"})})]})})},tOe=({open:e,onOpenChange:t,shareLinkId:n,shareToken:s,linkTitle:a})=>{const[i,o]=h.useState(!0),[l,c]=h.useState(null),[d,u]=h.useState([]);h.useEffect(()=>{e&&n&&m()},[e,n]);const m=async()=>{o(!0);try{const{data:b,error:w}=await F.from("video_share_links_safe").select("*").eq("id",n).single();if(w)throw w;c(b);const{data:S,error:j}=await F.from("share_link_views").select("*").eq("share_link_id",n).order("viewed_at",{ascending:!1});if(j)throw j;u(S||[])}catch(b){console.error("Error fetching share link analytics:",b)}finally{o(!1)}},f=b=>{if(!b)return"0s";if(b<60)return`${b}s`;const w=Math.floor(b/60),S=b%60;return`${w}m ${S}s`},p=b=>{if(!b)return r.jsx(Vs,{className:"w-3.5 h-3.5"});const w=b.toLowerCase();return w.includes("mobile")||w.includes("phone")?r.jsx(qc,{className:"w-3.5 h-3.5"}):r.jsx(Vs,{className:"w-3.5 h-3.5"})},x=d.reduce((b,w)=>b+(w.watch_duration||0),0),g=d.length>0?Math.round(d.reduce((b,w)=>b+(w.watch_percentage||0),0)/d.length):0,v=d.filter(b=>b.completed).length,y=d.length>0?Math.round(v/d.length*100):0;return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-lg max-h-[85vh] overflow-hidden flex flex-col",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(Po,{className:"w-5 h-5 text-primary"}),"Link Analytics"]}),r.jsx("p",{className:"text-sm text-muted-foreground truncate",children:a})]}),i?r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsx("div",{className:"grid grid-cols-2 gap-3",children:[...Array(4)].map((b,w)=>r.jsx(ia,{className:"h-20 rounded-lg"},w))}),r.jsx(ia,{className:"h-32 rounded-lg"})]}):l?r.jsx(Io,{className:"flex-1 -mx-6 px-6",children:r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(fe.div,{initial:{opacity:0,y:10}
1107,animate:{opacity:1,y:0},transition:{delay:.05},children:r.jsxs(Ie,{className:"p-3 bg-primary/5 border-primary/20",children:[r.jsxs("div",{className:"flex items-center gap-2 text-primary mb-1",children:[r.jsx(wr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-xs font-medium",children:"Views"})]}),r.jsx("p",{className:"text-2xl font-bold",children:l.view_count}),l.max_views&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",l.max_views," max"]})]})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},children:r.jsxs(Ie,{className:"p-3 bg-accent/5 border-accent/20",children:[r.jsxs("div",{className:"flex items-center gap-2 text-accent-foreground mb-1",children:[r.jsx(fr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-xs font-medium",children:"Watch Time"})]}),r.jsx("p",{className:"text-2xl font-bold",children:f(x)}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[g,"% avg watched"]})]})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},children:r.jsxs(Ie,{className:"p-3 bg-green-500/5 border-green-500/20",children:[r.jsxs("div",{className:"flex items-center gap-2 text-green-600 dark:text-green-400 mb-1",children:[r.jsx(cl,{className:"w-4 h-4"}),r.jsx("span",{className:"text-xs font-medium",children:"Completions"})]}),r.jsx("p",{className:"text-2xl font-bold",children:v}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[y,"% rate"]})]})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2},children:r.jsxs(Ie,{className:"p-3 bg-blue-500/5 border-blue-500/20",children:[r.jsxs("div",{className:"flex items-center gap-2 text-blue-600 dark:text-blue-400 mb-1",children:[r.jsx(Vh,{className:"w-4 h-4"}),r.jsx("span",{className:"text-xs font-medium",children:"Email Opens"})]}),r.jsx("p",{className:"text-2xl font-bold",children:l.email_open_count||0}),l.email_sent_at&&r.jsx("p",{className:"text-xs text-muted-foreground",children:l.email_opened_at?"Opened":"Not opened"})]})})]}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.25},children:r.jsxs(Ie,{className:"p-4",children:[r.jsxs("h3",{className:"text-sm font-medium mb-3 flex items-center gap-2",children:[r.jsx(Wl,{className:"w-4 h-4"}),"Link Details"]}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Created"}),r.jsx("span",{children:cn(new Date(l.created_at),"MMM d, yyyy h:mm a")})]}),l.recipient_email&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Recipient"}),r.jsx("span",{className:"truncate ml-2",children:l.recipient_email})]}),l.expires_at&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Expires"}),r.jsx("span",{children:cn(new Date(l.expires_at),"MMM d, yyyy")})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Status"}),r.jsx(Se,{variant:l.is_active?"default":"secondary",children:l.is_active?"Active":"Inactive"})]}),l.email_sent_at&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[r.jsx(zr,{className:"w-3.5 h-3.5"}),"Email Sent"]}),r.jsx("span",{children:cn(new Date(l.email_sent_at),"MMM d, h:mm a")})]}),l.email_opened_at&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[r.jsx(Vh,{className:"w-3.5 h-3.5"}),"First Opened"]}),r.jsx("span",{children:cn(new Date(l.email_opened_at),"MMM d, h:mm a")})]})]})]})}),d.length>0&&r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:r.jsxs(Ie,{className:"p-4",children:[r.jsxs("h3",{className:"text-sm font-medium mb-3 flex items-center gap-2",children:[r.jsx(rue,{className:"w-4 h-4"}),"View History",r.jsx(Se,{variant:"secondary",className:"ml-auto",children:d.length})]}),r.jsxs("div",{className:"space-y-3",children:[d.slice(0,10).map(b=>r.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[r.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center",children:p(b.viewer_device)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"font-medium",children:dh(new Date(b.viewed_at),{addSuffix:!0})}),b.completed&&r.jsx(Se,{variant:"outline",className:"text-xs text-green-600 border-green-200",children:"Completed"})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground mt-1",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),f(b.watch_duration)]}),b.watch_percentage!==null&&r.jsxs("span",{children:[Math.round(b.watch_percentage),"% watched"]}),b.viewer_location&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Nue,{className:"w-3 h-3"}),b.viewer_location]}),b.viewer_browser&&r.jsx("span",{className:"truncate max-w-[120px]",children:b.viewer_browser})]})]})]},b.id)),d.length>10&&r.jsxs("p",{className:"text-xs text-muted-foreground text-center py-2",children:["+",d.length-10," more views"]})]})]})}),d.length===0&&r.jsxs(Ie,{className:"p-6 text-center",children:[r.jsx(wr,{className:"w-8 h-8 text-muted-foreground mx-auto mb-2"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"No views yet"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Views will appear here when someone watches your video"})]}),r.jsx("div",{className:"pt-2 pb-4",children:r.jsxs("button",{onClick:()=>window.open(`/share/${s}`,"_blank"),className:"w-full flex items-center justify-center gap-2 text-sm text-primary hover:underline",children:[r.jsx(bn,{className:"w-4 h-4"}),"Open share link"]})})]})}):r.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"Failed to load anal
1107ytics"})]})})},Rj=["#0ea5e9","#3b82f6","#ec4899","#ef4444","#f97316","#eab308","#22c55e","#06b6d4"],rOe=({userId:e,folders:t,selectedFolderId:n,onFolderSelect:s,onFoldersChange:a})=>{const{toast:i}=Gr(),[o,l]=h.useState(!1),[c,d]=h.useState(!1),[u,m]=h.useState(null),[f,p]=h.useState(""),[x,g]=h.useState(Rj[0]),[v,y]=h.useState(!1),b=async()=>{if(f.trim()){y(!0);try{const{error:N}=await F.from("video_folders").insert({user_id:e,name:f.trim(),color:x});if(N)throw N;i({title:"Folder created"}),l(!1),p(""),a()}catch(N){i({title:"Error",description:N.message,variant:"destructive"})}finally{y(!1)}}},w=async()=>{if(!(!u||!f.trim())){y(!0);try{const{error:N}=await F.from("video_folders").update({name:f.trim(),color:x}).eq("id",u.id);if(N)throw N;i({title:"Folder updated"}),d(!1),m(null),a()}catch(N){i({title:"Error",description:N.message,variant:"destructive"})}finally{y(!1)}}},S=async N=>{try{const{error:_}=await F.from("video_folders").delete().eq("id",N);if(_)throw _;n===N&&s(null),i({title:"Folder deleted"}),a()}catch(_){i({title:"Error",description:_.message,variant:"destructive"})}},j=N=>{m(N),p(N.name),g(N.color),d(!0)};return r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs(P,{variant:n===null?"default":"outline",size:"sm",onClick:()=>s(null),children:[r.jsx(cN,{className:"w-4 h-4 mr-1"}),"All Videos"]}),t.map(N=>r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs(P,{variant:n===N.id?"default":"outline",size:"sm",onClick:()=>s(N.id),className:"pr-1",children:[r.jsx("div",{className:"w-3 h-3 rounded-full mr-2",style:{backgroundColor:N.color}}),N.name]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",children:r.jsx(dm,{className:"w-3 h-3"})})}),r.jsxs(So,{align:"end",children:[r.jsxs(tr,{onClick:()=>j(N),children:[r.jsx(tl,{className:"w-4 h-4 mr-2"}),"Edit"]}),r.jsxs(tr,{onClick:()=>S(N.id),className:"text-destructive",children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]},N.id)),r.jsxs(P,{variant:"ghost",size:"sm",onClick:()=>{p(""),g(Rj[0]),l(!0)},children:[r.jsx(Ns,{className:"w-4 h-4 mr-1"}),"New Folder"]})]}),r.jsx(It,{open:o,onOpenChange:l,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Create Folder"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Folder Name"}),r.jsx(He,{value:f,onChange:N=>p(N.target.value),placeholder:"My Folder"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex gap-2 mt-2",children:Rj.map(N=>r.jsx("button",{onClick:()=>g(N),className:`w-8 h-8 rounded-full transition-transform ${x===N?"scale-110 ring-2 ring-offset-2 ring-primary":""}`,style:{backgroundColor:N}},N))})]}),r.jsx(P,{onClick:b,disabled:v||!f.trim(),className:"w-full",children:v?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Create Folder"})]})]})}),r.jsx(It,{open:c,onOpenChange:d,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Edit Folder"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Folder Name"}),r.jsx(He,{value:f,onChange:N=>p(N.target.value),placeholder:"My Folder"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex gap-2 mt-2",children:Rj.map(N=>r.jsx("button",{onClick:()=>g(N),className:`w-8 h-8 rounded-full transition-transform ${x===N?"scale-110 ring-2 ring-offset-2 ring-primary":""}`,style:{backgroundColor:N}},N))})]}),r.jsx(P,{onClick:w,disabled:v||!f.trim(),className:"w-full",children:v?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Save Changes"})]})]})})]})},Oj=["#6366f1","#8b5cf6","#ec4899","#ef4444","#f97316","#eab308","#22c55e","#06b6d4"],nOe=({userId:e,folders:t,selectedFolderId:n,onFolderSelect:s,onFoldersChange:a,totalVideoCount:i,folderVideoCounts:o,allTags:l,selectedTags:c,onToggleTag:d,onClearTags:u,archivedCount:m=0,viewMode:f="active",onViewModeChange:p})=>{const{toast:x}=Gr(),[g,v]=h.useState(!0),[y,b]=h.useState(!0),[w,S]=h.useState(!1),[j,N]=h.useState(!1),[_,C]=h.useState(null),[k,E]=h.useState(""),[R,T]=h.useState(Oj[0]),[D,A]=h.useState(!1),V=async()=>
1107{if(k.trim()){A(!0);try{const{error:$}=await F.from("video_folders").insert({user_id:e,name:k.trim(),color:R});if($)throw $;x({title:"Folder created"}),S(!1),E(""),a()}catch($){x({title:"Error",description:$.message,variant:"destructive"})}finally{A(!1)}}},U=async()=>{if(!(!_||!k.trim())){A(!0);try{const{error:$}=await F.from("video_folders").update({name:k.trim(),color:R}).eq("id",_.id);if($)throw $;x({title:"Folder updated"}),N(!1),C(null),a()}catch($){x({title:"Error",description:$.message,variant:"destructive"})}finally{A(!1)}}},O=async $=>{try{const{error:I}=await F.from("video_folders").delete().eq("id",$);if(I)throw I;n===$&&s(null),x({title:"Folder deleted"}),a()}catch(I){x({title:"Error",description:I.message,variant:"destructive"})}},M=$=>{C($),E($.name),T($.color),N(!0)};return r.jsxs("aside",{className:"w-60 flex-shrink-0 border-r border-border bg-background overflow-y-auto",children:[r.jsxs("nav",{className:"pt-10 pb-4 space-y-1",children:[r.jsx("div",{className:"px-4 pb-2",children:r.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Personal Workspace"})}),r.jsxs("button",{onClick:()=>{s(null),p==null||p("active")},className:`w-full flex items-center justify-between px-4 py-2 text-sm transition-colors ${n===null&&f==="active"?"bg-primary/10 text-primary font-medium border-r-2 border-primary":"text-foreground hover:bg-muted/50"}`,children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(cr,{className:"w-4 h-4"}),"All Videos"]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:i})]}),r.jsxs("button",{onClick:()=>p==null?void 0:p("archive"),className:`w-full flex items-center justify-between px-4 py-2 text-sm transition-colors ${f==="archive"?"bg-primary/10 text-primary font-medium border-r-2 border-primary":"text-foreground hover:bg-muted/50"}`,children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(BH,{className:"w-4 h-4"}),"Archive"]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:m})]}),r.jsxs(Wm,{open:g,onOpenChange:v,children:[r.jsx(Ff,{asChild:!0,children:r.jsxs("button",{className:"w-full flex items-center justify-between px-4 py-2 text-sm text-foreground hover:bg-muted/50 transition-colors",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(cN,{className:"w-4 h-4"}),"My Folders"]}),g?r.jsx(Qs,{className:"w-3.5 h-3.5 text-muted-foreground"}):r.jsx(Hl,{className:"w-3.5 h-3.5 text-muted-foreground"})]})}),r.jsx(Ym,{children:r.jsxs("div",{className:"space-y-0.5 pl-4",children:[t.map($=>r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{onClick:()=>s($.id),className:`flex-1 flex items-center justify-between px-4 py-1.5 text-sm transition-colors rounded-l ${n===$.id?"bg-primary/10 text-primary font-medium":"text-foreground hover:bg-muted/50"}`,children:[r.jsxs("span",{className:"flex items-center gap-2 truncate",children:[r.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:$.color}}),r.jsx("span",{className:"truncate",children:$.name})]}),r.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:o[$.id]||0})]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx("button",{className:"p-1 o
1107pacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:r.jsx(dm,{className:"w-3.5 h-3.5"})})}),r.jsxs(So,{align:"end",className:"w-32",children:[r.jsxs(tr,{onClick:()=>M($),children:[r.jsx(tl,{className:"w-3.5 h-3.5 mr-2"}),"Edit"]}),r.jsxs(tr,{onClick:()=>O($.id),className:"text-destructive",children:[r.jsx(Xr,{className:"w-3.5 h-3.5 mr-2"}),"Delete"]})]})]})]},$.id)),r.jsxs("button",{onClick:()=>{E(""),T(Oj[0]),S(!0)},className:"w-full flex items-center gap-2 px-4 py-1.5 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors rounded",children:[r.jsx(Ns,{className:"w-3.5 h-3.5"}),"New Folder"]})]})})]}),l.length>0&&r.jsxs(Wm,{open:y,onOpenChange:b,children:[r.jsx("div",{className:"pt-3 border-t border-border mx-4"}),r.jsx(Ff,{asChild:!0,children:r.jsxs("button",{className:"w-full flex items-center justify-between px-4 py-2 text-sm text-foreground hover:bg-muted/50 transition-colors",children:[r.jsx("span",{className:"flex items-center gap-2",children:r.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Tags"})}),y?r.jsx(Qs,{className:"w-3.5 h-3.5 text-muted-foreground"}):r.jsx(Hl,{className:"w-3.5 h-3.5 text-muted-foreground"})]})}),r.jsx(Ym,{children:r.jsxs("div",{className:"px-4 pb-2 space-y-1",children:[c.length>0&&r.jsx("button",{onClick:u,className:"text-xs text-primary hover:underline mb-1",children:"Clear all"}),r.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.map($=>r.jsx(Se,{variant:c.includes($)?"default":"outline",className:"cursor-pointer transition-colors text-xs",onClick:()=>d($),children:$},$))})]})})]})]}),r.jsx(It,{open:w,onOpenChange:S,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Create Folder"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Folder Name"}),r.jsx(He,{value:k,onChange:$=>E($.target.value),placeholder:"My Folder"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex gap-2 mt-2",children:Oj.map($=>r.jsx("button",{onClick:()=>T($),className:`w-8 h-8 rounded-full transition-transform ${R===$?"scale-110 ring-2 ring-offset-2 ring-primary":""}`,style:{backgroundColor:$}},$))})]}),r.jsx(P,{onClick:V,disabled:D||!k.trim(),className:"w-full",children:D?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Create Folder"})]})]})}),r.jsx(It,{open:j,onOpenChange:N,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Edit Folder"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Folder Name"}),r.jsx(He,{value:k,onChange:$=>E($.target.value),placeholder:"My Folder"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex gap-2 mt-2",children:Oj.map($=>r.jsx("button",{onClick:()=>T($),className:`w-8 h-8 rounded-full transition-transform ${R===$?"scale-110 ring-2 ring-offset-2 ring-primary":""}`,style:{backgroundColor:$}},$))})]}),r.jsx(P,{onClick:U,disabled:D||!k.trim(),className:"w-full",children:D?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Save Changes"})]})]})})]})},XV=80,ZV=40,QV="vidareo_swipe_hint_shown",sOe=({children:e,onSwipeLeft:t,onSwipeRight:n,leftAction:s="delete",rightAction:a="share",leftLabel:i="Delete",rightLabel:o="Share",disabled:l=!1,showHint:c=!1})=>{const[d,u]=h.useState(!1),[m,f]=h.useState(null),[p,x]=h.useState(!1),g=WZ(),v=h.useRef(null);h.useEffect(()=>{if(c&&!l&&!localStorage.getItem(QV)){x(!0);const _=setTimeout(async()=>{await g.start({x:-30,transition:{duration:.3}}),await g.start({x:30,transition:{duration:.4}}),await g.start({x:0,transition:{duration:.3}}),localStorage.setItem(QV,"true"),x(!1)},1500);return()=>clearTimeout(_)}},[c,l,g]);const y=N=>{switch(N){case"delete":return r.jsx(Xr,{className:"w-5 h-5"});case"share":return r.jsx(Wl,{className:"w-5 h-5"});case"download":return r.jsx(lv,{className:"w-5 h-5"});default:return r.jsx(dv,{className:"w-5 h-5"})}},b=N=>{switch(N){case"delete":return"bg-destructive";case"share":return"bg-primary";case"download":return"bg-accent";default:return"bg-primary"}},w=()=>{u(!0)},S=(N,_)=>{const{offset:C}=_;C.x>
1107ZV?f("right"):C.x<-ZV?f("left"):f(null)},j=async(N,_)=>{u(!1);const{offset:C,velocity:k}=_,E=C.x>XV||C.x>30&&k.x>200,R=C.x<-XV||C.x<-30&&k.x<-200;E&&n?(await g.start({x:150,transition:{type:"spring",stiffness:400,damping:30}}),n(),await g.start({x:0,transition:{type:"spring",stiffness:400,damping:30}})):R&&t?(await g.start({x:-150,transition:{type:"spring",stiffness:400,damping:30}}),t(),await g.start({x:0,transition:{type:"spring",stiffness:400,damping:30}})):await g.start({x:0,transition:{type:"spring",stiffness:400,damping:30}}),f(null)};return l?r.jsx("div",{ref:v,className:"relative overflow-hidden rounded-xl isolate",children:e}):r.jsxs("div",{ref:v,className:"relative overflow-hidden rounded-xl isolate",children:[r.jsx(fe.div,{className:`absolute inset-y-0 left-0 w-24 ${b(a)} flex items-center justify-center text-white rounded-l-lg`,initial:{opacity:0},animate:{opacity:m==="right"||p?1:0,scale:m==="right"||p?1:.8},transition:{duration:.15},children:r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[y(a),r.jsx("span",{className:"text-xs font-medium",children:o})]})}),r.jsx(fe.div,{className:`absolute inset-y-0 right-0 w-24 ${b(s)} flex items-center justify-center text-white rounded-r-lg`,initial:{opacity:0}
1107,animate:{opacity:m==="left"||p?1:0,scale:m==="left"||p?1:.8},transition:{duration:.15},children:r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[y(s),r.jsx("span",{className:"text-xs font-medium",children:i})]})}),p&&r.jsxs(r.Fragment,{children:[r.jsx(fe.div,{className:"absolute left-2 top-1/2 -translate-y-1/2 z-20 text-white/80",initial:{opacity:0,x:10},animate:{opacity:[0,1,0],x:[10,0,10]},transition:{duration:1,repeat:1/0},children:r.jsx(L4,{className:"w-6 h-6"})}),r.jsx(fe.div,{className:"absolute right-2 top-1/2 -translate-y-1/2 z-20 text-white/80",initial:{opacity:0,x:-10},animate:{opacity:[0,1,0],x:[-10,0,-10]},transition:{duration:1,repeat:1/0},children:r.jsx(Hl,{className:"w-6 h-6"})})]}),r.jsx(fe.div,{drag:"x",dragConstraints:{left:-150,right:150},dragElastic:.1,animate:g,onDragStart:w,onDrag:S,onDragEnd:j,className:`relative z-10 touch-pan-y ${d?"cursor-grabbing":""}`,style:{touchAction:"pan-y"},whileTap:{cursor:"grabbing"},children:e})]})};var aOe=Array.isArray,io=aOe,iOe=typeof zw=="object"&&zw&&zw.Object===Object&&zw,Cte=iOe,oOe=Cte,lOe=typeof self=="object"&&self&&self.Object===Object&&self,cOe=oOe||lOe||Function("return this")(),Kc=cOe,dOe=Kc,uOe=dOe.Symbol,Rw=uOe,JV=Rw,kte=Object.prototype,mOe=kte.hasOwnProperty,hOe=kte.toString,dy=JV?JV.toStringTag:void 0;function fOe(e){var t=mOe.call(e,dy),n=e[dy];try{e[dy]=void 0;var s=!0}catch{}var a=hOe.call(e);return s&&(t?e[dy]=n:delete e[dy]),a}var pOe=fOe,xOe=Object.prototype,gOe=xOe.toString;function vOe(e){return gOe.call(e)}var yOe=vOe,eU=Rw,bOe=pOe,wOe=yOe,jOe="[object Null]",NOe="[object Undefined]",tU=eU?eU.toStringTag:void 0;function SOe(e){return e==null?e===void 0?NOe:jOe:tU&&tU in Object(e)?bOe(e):wOe(e)}var hu=SOe;function _Oe(e){return e!=null&&typeof e=="object"}var fu=_Oe,COe=hu,kOe=fu,EOe="[object Symbol]";function AOe(e){return typeof e=="symbol"||kOe(e)&&COe(e)==EOe}var Av=AOe,TOe=io,ROe=Av,OOe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,POe=/^\w*$/;function DOe(e,t){if(TOe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ROe(e)?!0:POe.test(e)||!OOe.test(e)||t!=null&&e in Object(t)}var QD=DOe;function MOe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var uh=MOe;const Tv=Mn(uh);var IOe=hu,LOe=uh,$Oe="[object AsyncFunction]",VOe="[object Function]",UOe="[object GeneratorFunction]",FOe="[object Proxy]";function BOe(e){if(!LOe(e))return!1;var t=IOe(e);return t==VOe||t==UOe||t==$Oe||t==FOe}var JD=BOe;const Nr=Mn(JD);var zOe=Kc,qOe=zOe["__core-js_shared__"],HOe=qOe,bE=HOe,rU=function(){var e=/[^.]+$/.exec(bE&&bE.keys&&bE.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function WOe(e){return!!rU&&rU in e}var YOe=WOe,GOe=Function.prototype,KOe=GOe.toString;function XOe(e){if(e!=null){try{return KOe.call(e)}catch{}try{return e+""}catch{}}return""}var Ete=XOe,ZOe=JD,QOe=YOe,JOe=uh,ePe=Ete,tPe=/[\\^$.*+?()[\]{}|]/g,rPe=/^\[object .+?Constructor\]$/,nPe=Function.prototype,sPe=Object.prototype,aPe=nPe.toString,iPe=sPe.hasOwnProperty,oPe=RegExp("^"+aPe.call(iPe).replace(tPe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lPe(e){if(!JOe(e)||QOe(e))return!1;var t=ZOe(e)?oPe:rPe;return t.test(ePe(e))}var cPe=lPe;function dPe(e,t){return e==null?void 0:e[t]}var uPe=dPe,mPe=cPe,hPe=uPe;function fPe(e,t){var n=hPe(e,t);return mPe(n)?n:void 0}var lp=fPe,pPe=lp,xPe=pPe(Object,"create"),S2=xPe,nU=S2;function gPe(){this.__data__=nU?nU(null):{},this.size=0}var vPe=gPe;function yPe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var bPe=yPe,wPe=S2,jPe="__lodash_hash_undefined__",NPe=Object.prototype,SPe=NPe.hasOwnProperty;function _Pe(e){var t=this.__data__;if(wPe){var n=t[e];return n===jPe?void 0:n}return SPe.call(t,e)?t[e]:void 0}var CPe=_Pe,kPe=S2,EPe=Object.prototype,APe=EPe.hasOwnProperty;function TPe(e){var t=this.__data__;return kPe?t[e]!==void 0:APe.call(t,e)}var RPe=TPe,OPe=S2,PPe="__lodash_hash_undefined__";function DPe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=OPe&&t===void 0?PPe:t,this}var MPe=DPe,IPe=vPe,LPe=bPe,$Pe=CPe,VPe=RPe,UPe=MPe;function Rv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Rv.prototype.clear=IPe;Rv.prototype.delete=LPe;Rv.prototype.get=$Pe;Rv.prototype.has=VPe;Rv.prototype.set=UPe;var FPe=Rv;function BPe(){this.__data__=[],this.size=0}var zPe=BPe;function qPe(e,t){return e===t||e!==e&&t!==t}var eM=qPe,HPe=eM;function WPe(e,t){for(var n=e.length;n--;)if(HPe(e[n][0],t))return n;return-1}var _2=WPe,YPe=_2,GPe=Array.prototype,KPe=GPe.splice;function XPe(e){var t=this.__data__,n=YPe(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():KPe.call(t,n,1),--this.size,!0}var ZPe=XPe,QPe=_2;function JPe(e){var t=this.__data__,n=QPe(t,e);return n<0?void 0:t[n][1]}var e4e=JPe,t4e=_2;function r4e(e){return t4e(this.__data__,e)>-1}var n4e=r4e,s4e=_2;function a4e(e,t){var n=this.__data__,s=s4e(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}var i4e=a4e,o4e=zPe,l4e=ZPe,c4e=e4e,d4e=n4e,u4e=i4e;function Ov(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ov.prototype.clear=o4e;Ov.prototype.delete=l4e;Ov.prototype.get=c4e;Ov.prototype.has=d4e;Ov.prototype.set=u4e;var C2=Ov,m4e=lp,h4e=Kc,f4e=m4e(h4e,"Map"),tM=f4e,sU=FPe,p4e=C2,x4e=tM;function g4e(){this.size=0,this.__data__={hash:new sU,map:new(x4e||p4e),string:new sU}}var v4e=g4e;function y4e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var b4e=y4e,w4e=b4e;function j4e(e,t){var n=e.__data__;return w4e(t)?n[typeof t=="string"?"string":"hash"]:n.map}var k2=j4e,N4e=k2;function S4e(e){var t=N4e(this,e).delete(e);return this.size-=t?1:0,t}var _4e=S4e,C4e=k2;function k4e(e){return C4e(this,e).get(e)}var E4e=k4e,A4e=k2;function T4e(e){return A4e(this,e).has(e)}var R4e=T4e,O4e=k2;
vendor: 1,039 bytes, line 1107
1107function P4e(e,t){var n=O4e(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}var D4e=P4e,M4e=v4e,I4e=_4e,L4e=E4e,$4e=R4e,V4e=D4e;function Pv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Pv.prototype.clear=M4e;Pv.prototype.delete=I4e;Pv.prototype.get=L4e;Pv.prototype.has=$4e;Pv.prototype.set=V4e;var rM=Pv,Ate=rM,U4e="Expected a function";function nM(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(U4e);var n=function(){var s=arguments,a=t?t.apply(this,s):s[0],i=n.cache;if(i.has(a))return i.get(a);var o=e.apply(this,s);return n.cache=i.set(a,o)||i,o};return n.cache=new(nM.Cache||Ate),n}nM.Cache=Ate;var Tte=nM;const F4e=Mn(Tte);var B4e=Tte,z4e=500;function q4e(e){var t=B4e(e,function(s){return n.size===z4e&&n.clear(),s}),n=t.cache;return t}var H4e=q4e,W4e=H4e,Y4e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G4e=/\\(\\)?/g,K4e=W4e(function(e){var t=[];return e.charCodeAt(0)===46&&t.pu
1107sh(""),e.replace(Y4e,function(n,s,a,i){t.push(a?i.replace(G4e,"$1"):s||n)}),t}),X4e=K4e;function Z4e(e,t){for(var n=-1,s=e==null?0:e.length,a=Array(s);++n<s;)a[n]=t(e[n],n,e);return a}var sM=Z4e,aU=Rw,Q4e=sM,J4e=io,e5e=Av,t5e=1/0,iU=aU?aU.prototype:void 0,oU=iU?iU.toString:void 0;function Rte(e){if(typeof e=="string")return e;if(J4e(e))return Q4e(e,Rte)+"";if(e5e(e))return oU?oU.call(e):"";var t=e+"";return t=="0"&&1/e==-t5e?"-0":t}var r5e=Rte,n5e=r5e;function s5e(e){return e==null?"":n5e(e)}var Ote=s5e,a5e=io,i5e=QD,o5e=X4e,l5e=Ote;function c5e(e,t){return a5e(e)?e:i5e(e,t)?[e]:o5e(l5e(e))}var Pte=c5e,d5e=Av,u5e=1/0;function m5e(e){if(typeof e=="string"||d5e(e))return e;var t=e+"";return t=="0"&&1/e==-u5e?"-0":t}var E2=m5e,h5e=Pte,f5e=E2;function p5e(e,t){t=h5e(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[f5e(t[n++])];return n&&n==s?e:void 0}var aM=p5e,x5e=aM;function g5e(e,t,n){var s=e==null?void 0:x5e(e,t);return s===void 0?n:s}var Dte=g5e;const To=Mn(Dte);function v5e(e){return e==null}var y5e=v5e;const Rr=Mn(y5e);var b5e=hu,w5e=io,j5e=fu,N5e="[object String]";function S5e(e){return typeof e=="string"||!w5e(e)&&j5e(e)&&b5e(e)==N5e}var _5e=S5e;const Bf=Mn(_5e);var Mte={exports:{}},In={};/**
1108 * @license React
1109 * react-is.production.min.js
1110 *
1111 * Copyright (c) Facebook, Inc. and its affiliates.
1112 *
1113 * This source code is licensed under the MIT license found in the
1114 * LICENSE file in the root directory of this source tree.
1115 */var iM=Symbol.for("react.element"),oM=Symbol.for("react.portal"),A2=Symbol.for("react.fragment"),T2=Symbol.for("react.strict_mode"),R2=Symbol.for("react.profiler"),O2=Symbol.for("react.provider"),P2=Symbol.for("react.context"),C5e=Symbol.for("react.server_context"),D2=Symbol.for("react.forward_ref"),M2=Symbol.for("react.suspense"),I2=Symbol.for("react.suspense_list"),L2=Symbol.for("react.memo"),$2=Symbol.for("react.lazy"),k5e=Symbol.for("react.offscreen"),Ite;Ite=Symbol.for("react.module.reference");function vl(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iM:switch(e=e.type,e){case A2:case R2:case T2:case M2:case I2:return e;default:switch(e=e&&e.$$typeof,e){case C5e:case P2:case D2:case $2:case L2:case O2:return e;default:return t}}case oM:return t}}}In.ContextConsumer=P2;In.ContextProvider=O2;In.Element=iM;In.ForwardRef=D2;In.Fragment=A2;In.Lazy=$2;In.Memo=L2;In.Portal=oM;In.Profiler=R2;In.StrictMode=T2;In.Suspense=M2;In.SuspenseList=I2;In.isAsyncMode=function(){return!1};In.isConcurrentMode=function(){return!1};In.isContextConsumer=function(e){return vl(e)===P2};In.isContextProvider=function(e){return vl(e)===O2};In.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iM};In.isForwardRef=function(e){return vl(e)===D2};In.isFragment=function(e){return vl(e)===A2};In.isLazy=function(e){return vl(e)===$2};In.isMemo=function(e){return vl(e)===L2};In.isPortal=function(e){return vl(e)===oM};In.isProfiler=function(e){return vl(e)===R2};In.isStrictMode=function(e){return vl(e)===T2};In.isSuspense=function(e){return vl(e)===M2};In.isSuspenseList=function(e){return vl(e)===I2};In.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===A2||e===R2||e===T2||e===M2||e===I2||e===k5e||typeof e=="object"&&e!==null&&(e.$$typeof===$2||e.$$typeof===L2||e.$$typeof===O2||e.$$typeof===P2||e.$$typeof===D2||e.$$typeof===Ite||e.getModuleId!==void 0)};In.typeOf=vl;Mte.exports=In;var E5e=Mte.exports,A5e=hu,T5e=fu,R5e="[object Number]";function O5e(e){return typeof e=="number"||T5e(e)&&A5e(e)==R5e}var Lte=O5e;const P5e=Mn(Lte);var D5e=Lte;function M5e(e){return D5e(e)&&e!=+e}var I5e=M5e;const Dv=Mn(I5e);var Di=function(t){return t===0?0:t>0?1:-1},Yh=function(t){return Bf(t)&&t.indexOf("%")===t.length-1},xt=function(t){return P5e(t)&&!Dv(t)},L5e=function(t){return Rr(t)},Da=function(t){return xt(t)||Bf(t)},$5e=0,Mv=function(t){var n=++$5e;return"".concat(t||"").concat(n)},Mi=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xt(t)&&!Bf(t))return s;var i;if(Yh(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Dv(i)&&(i=s),a&&i>n&&(i=n),i},Bp=function(t){if(!t)return null;var n=Object.keys(t);
vendor: 5,203 bytes, line 1115
1115return n&&n.length?t[n[0]]:null},V5e=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,s={},a=0;a<n;a++)if(!s[t[a]])s[t[a]]=!0;else return!0;return!1},Zi=function(t,n){return xt(t)&&xt(n)?function(s){return t+s*(n-t)}:function(){return n}};function KN(e,t,n){return!e||!e.length?null:e.find(function(s){return s&&(typeof t=="function"?t(s):To(s,t))===n})}var U5e=function(t,n){return xt(t)&&xt(n)?t-n:Bf(t)&&Bf(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Tx(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var s in t)if({}.hasOwnProperty.call(t,s)&&!{}.hasOwnProperty.call(e,s))return!1;return!0}function HR(e){"@babel/helpers - typeof";return HR=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HR(e)}var F5e=["viewBox","children"],B5e=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],lU=["points","pathLength"],wE={svg:F5e,polygon:lU,polyline:lU},lM=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
1115ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],XN=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(h.isValidElement(t)&&(s=t.props),!Tv(s))return null;var a={};return Object.keys(s).forEach(function(i){lM.includes(i)&&(a[i]=n||function(o){return s[i](s,o)})}),a},z5e=function(t,n,s){return function(a){return t(n,s,a),null}},zf=function(t,n,s){if(!Tv(t)||HR(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];lM.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=z5e(o,n,s))}),a},q5e=["children"],H5e=["children"];function cU(e,t){if(e==null)return{};var n=W5e(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function W5e(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function WR(e){"@babel/helpers - typeof";return WR=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WR(e)}var dU={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"}
1115,Rd=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},uU=null,jE=null,cM=function e(t){if(t===uU&&Array.isArray(jE))return jE;var n=[];return h.Children.forEach(t,function(s){Rr(s)||(E5e.isFragment(s)?n=n.concat(e(s.props.children)):n.push(s))}),jE=n,uU=t,n};function ml(e,t){var n=[],s=[];return Array.isArray(t)?s=t.map(function(a){return Rd(a)}):s=[Rd(t)],cM(e).forEach(function(a){var i=To(a,"type.displayName")||To(a,"type.name");s.indexOf(i)!==-1&&n.push(a)}),n}function fo(e,t){var n=ml(e,t);return n&&n[0]}var mU=function(t){if(!t||!t.props)return!1;var n=t.props,s=n.width,a=n.height;return!(!xt(s)||s<=0||!xt(a)||a<=0)},Y5e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G5e=function(t){return t&&t.type&&Bf(t.type)&&Y5e.indexOf(t.type)>=0},K5e=function(t){return t&&WR(t)==="object"&&"clipDot"in t},X5e=function(t,n,s,a){var i,o=(i=wE==null?void 0:wE[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Nr(t)&&(a&&o.includes(n)||B5e.includes(n))||s&&lM.includes(n)},ir=function(t,n,s){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(h.isValidElement(t)&&(a=t.props),!Tv(a))return null;var i={};return Object.keys(a).forEach(function(o){var l;X5e((l=a)===null||l===void 0?void 0:l[o],o,n,s)&&(i[o]=a[o])}),i},YR=function e(t,n){if(t===n)return!0;var s=h.Children.count(t);if(s!==h.Children.count(n))return!1;if(s===0)return!0;if(s===1)return hU(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<s;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!hU(i,o))return!1}return!0},hU=function(t,n){if(Rr(t)&&Rr(n))return!0;if(!Rr(t)&&!Rr(n)){var s=t.props||{},a=s.children,i=cU(s,q5e),o=n.props||{},l=o.children,c=cU(o,H5e);return a&&l?Tx(i,c)&&YR(a,l):!a&&!l?Tx(i,c):!1}return!1},fU=function(t,n){var s=[],a={};return cM(t).forEach(function(i,o){if(G5e(i))s.push(i);else if(i){var l=Rd(i.type),c=n[l]||{},d=c.handler,u=c.once;if(d&&(!u||!a[l])){var m=d(i,l,o);s.push(m),a[l]=!0}}}),s},Z5e=function(t){var n=t&&t.type;return n&&dU[n]?dU[n]:null},Q5e=function(t,n){return cM(n).indexOf(t)},J5e=["children","width","height","viewBox","className","style","title","desc"];function GR(){return GR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},GR.apply(this,arguments)}function eDe(e,t){if(e==null)return{};var n=tDe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function tDe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function KR(e){var t=e.children,n=e.width,s=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,d=eDe(e,J5e),u=a||{width:n,height:s,x:0,y:0},m=Tr("recharts-surface",i);return Y.createElement("svg",GR({},ir(d,!0,"svg"),{className:m,width:n,height:s,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Y.createElement("title",null,l),Y.createElement("desc",null,c),t)}var rDe=["children","className"];function XR(){return XR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},XR.apply(this,arguments)}function nDe(e,t){if(e==null)return{};var n=sDe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function sDe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}var ln=Y.forwardRef(function(e,t){var n=e.children,s=e.className,a=nDe(e,rDe),i=Tr("recharts-layer",s);return Y.createElement("g",XR({className:i},ir(a,!0),{ref:t}),n)}),Od=function(t,n){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i]};function aDe(e,t,n){var s=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(a);++s<a;)i[s]=e[s+t];return i}var iDe=aDe,oDe=iDe;function lDe(e,t,n){var s=e.length;return n=n===void 0?s:n,!t&&n>=s?e:oDe(e,t,n)}var cDe=lDe,dDe="\\ud800-\\udfff",uDe="\\u0300-\\u036f",mDe="\\ufe20-\\ufe2f",hDe="\\u20d0-\\u20ff",fDe=uDe+mDe+hDe,pDe="\\ufe0e\\ufe0f",xDe="\\u200d",gDe=RegExp("["+xDe+dDe+fDe+pDe+"]");function vDe(e){return gDe.test(e)}var $te=vDe;function yDe(e){return e.split("")}var bDe=yDe,Vte="\\ud800-\\udfff",wDe="\\u0300-\\u036f",jDe="\\ufe20-\\ufe2f",NDe="\\u20d0-\\u20ff",SDe=wDe+jDe+NDe,_De="\\ufe0e\\ufe0f",CDe="["+Vte+"]",ZR="["+SDe+"]",QR="\\ud83c[\\udffb-\\udfff]",kDe="(?:"+ZR+"|"+QR+")",Ute="[^"+Vte+"]",Fte="(?:\\ud83c[\\udde6-\\uddff]){2}",Bte="[\\ud800-\\udbff][\\udc00-\\udfff]",EDe="\\u200d",zte=kDe+"?",qte="["+_De+"]?",ADe="(?:"+EDe+"(?:"+[Ute,Fte,Bte].join("|")+")"+qte+zte+")*",TDe=qte+zte+ADe,RDe="(?:"+[Ute+ZR+"?",ZR,Fte,Bte,CDe].join("|")+")",ODe=RegExp(QR+"(?="+QR+")|"+RDe+TDe,"g");function PDe(e){return e.match(ODe)||[]}var DDe=PDe,MDe=bDe,IDe=$te,LDe=DDe;function $De(e){return IDe(e)?LDe(e):MDe(e)}var VDe=$De,UDe=cDe,FDe=$te,BDe=VDe,zDe=Ote;function qDe(e){return function(t){t=zDe(t);var n=FDe(t)?BDe(t):void 0,s=n?n[0]:t.charAt(0),a=n?UDe(n,1).join(""):t.slice(1);return s[e]()+a}}var HDe=qDe,WDe=HDe,YDe=WDe("toUpperCase"),GDe=YDe;const V2=Mn(GDe);function as(e){return function(){return e}}const Hte=Math.cos,ZN=Math.sin,tc=Math.sqrt,QN=Math.PI,U2=2*QN,JR=Math.PI,eO=2*JR,Ih=1e-6,KDe=eO-Ih;function Wte(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function XDe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wte;const n=10**t;return function(s){this._+=s[0];for(let a=1,i=s.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+s[a]}}class ZDe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wte:XDe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,s,a){this._append`Q${+t},${+n},${this._x1=+s},${this._y1=+a}`}bezierCurveTo(t,n,s,a,i,o){this._append`C${+t},${+n},${+s},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,s,a,i){if(t=+t,n=+n,s=+s,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=s-t,d=a-n,u=o-t,m=l-n,f=u*u+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Ih)if(!(Math.abs(m*c-d*u)>Ih)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let p=s-o,x=a-l,g=c*c+d*d,v=p*p+x*x,y=Math.sqrt(g),b=Math.sqrt(f),w=i*Math.tan((JR-Math.acos((g+f-v)/(2*y*b)))/2),S=w/b,j=w/y;Math.abs(S-1)>Ih&&this._append`L${t+S*u},${n+S*m}`,this._append`A${i},${i},0,0,${+(m*p>u*x)},${this._x1=t+j*c},${this._y1=n+j*d}`}}arc(t,n,s,a,i,o){if(t=+t,n=+n,s=+s,o=!!o,s<0)throw new Error(`negative radius: ${s}`);let l=s*Math.cos(a),c=s*Math.sin(a),d=t+l,u=n+c,m=1^o,f=o?a-i:i-a;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Ih||Math.abs(this._y1-u)>Ih)&&this._append`L${d},${u}`,s&&(f<0&&(f=f%eO+eO),f>KDe?this._append`A${s},${s},0,1,${m},${t-l},${n-c}A${s},${s},0,1,${m},${this._x1=d},${this._y1=u}`:f>Ih&&this._append`A${s},${s},0,${+(f>=JR)},${m},${this._x1=t+s*Math.cos(i)},${this._y1=n+s*Math.sin(i)}`)}rect(t,n,s,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${s=+s}v${+a}h${-s}Z`}toString(){return this._}}function dM(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const s=Math.floor(n);if(!(s>=0))throw new RangeError(`invalid digits: ${n}`);t=s}return e},()=>new ZDe(t)}function uM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yte(e){this._context=e}Yte.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function F2(e){return new Yte(e)}function Gte(e){return e[0]}function Kte(e){return e[1]}function Xte(e,t){var n=as(!0),s=null,a=F2,i=null,o=dM(l);e=typeof e=="function"?e:e===void 0?Gte:as(e),t=typeof t=="function"?t:t===void 0?Kte:as(t);function l(c){var d,u=(c=uM(c)).length,m,f=!1,p;for(s==null&&(i=a(p=o())),d=0;d<=u;++d)!(d<u&&n(m=c[d],d,c))===f&&((f=!f)?i.lineStart():i.lineEnd()),f&&i.point(+e(m,d,c),+t(m,d,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:as(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:as(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:as(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,s!=null&&(i=a(s)),l):a},l.context=function(c){return arguments.length?(c==null?s=i=null:i=a(s=c),l):s},l}function Pj(e,t,n){var s=null,a=as(!0),i=null,o=F2,l=null,c=dM(d);e=typeof e=="function"?e:e===void 0?Gte:as(+e),t=typeof t=="function"?t:as(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Kte:as(+n);function d(m){var f,p,x,g=(m=uM(m)).length,v,y=!1,b,w=new Array(g),S=new Array(g);for(i==null&&(l=o(b=c())),f=0;f<=g;++f){if(!(f<g&&a(v=m[f],f,m))===y)if(y=!y)p=f,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=f-1;x>=p;--x)l.point(w[x],S[x]);l.lineEnd(),l.areaEnd()}y&&(w[f]=+e(v,f,m),S[f]=+t(v,f,m),l.point(s?+s(v,f,m):w[f],n?+n(v,f,m):S[f]))}if(b)return l=null,b+""||null}function u(){return Xte().defined(a).curve(o).context(i)}return d.x=function(m){return arguments.length?(e=typeof m=="function"?m:as(+m),s=null,d):e},d.x0=function(m){return arguments.length?(e=typeof m=="function"?m:as(+m),d):e},d.x1=function(m){return arguments.length?(s=m==null?null:typeof m=="function"?m:as(+m),d):s},d.y=function(m){return arguments.length?(t=typeof m=="function"?m:as(+m),n=null,d):t},d.y0=function(m){return arguments.length?(t=typeof m=="function"?m:as(+m),d):t},d.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:as(+m),d):n},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(n)},d.lineX1=function(){return u().x(s).y(t)},d.defined=function(m){return arguments.length?(a=typeof m=="function"?m:as(!!m),d):a},d.curve=function(m){return arguments.length?(o=m,i!=null&&(l=o(i)),d):o},d.context=function(m){return arguments.length?(m==null?i=l=null:l=o(i=m),d):i},d}class Zte{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}
vendor: 8,474 bytes, line 1115
1115point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function QDe(e){return new Zte(e,!0)}function JDe(e){return new Zte(e,!1)}const mM={draw(e,t){const n=tc(t/QN);e.moveTo(n,0),e.arc(0,0,n,0,U2)}},eMe={draw(e,t){const n=tc(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Qte=tc(1/3),tMe=Qte*2,rMe={draw(e,t){const n=tc(t/tMe),s=n*Qte;e.moveTo(0,-n),e.lineTo(s,0),e.lineTo(0,n),e.lineTo(-s,0),e.closePath()}},nMe={draw(e,t){const n=tc(t),s=-n/2;e.rect(s,s,n,n)}},sMe=.8908130915292852,Jte=ZN(QN/10)/ZN(7*QN/10),aMe=ZN(U2/10)*Jte,iMe=-Hte(U2/10)*Jte,oMe={draw(e,t){const n=tc(t*sMe),s=aMe*n,a=iMe*n;e.moveTo(0,-n),e.lineTo(s,a);for(let i=1;i<5;++i){const o=U2*i/5,l=Hte(o),c=ZN(o);e.lineTo(c*n,-l*n),e.lineTo(l*s-c*a,c*s+l*a)}e.closePath()}},NE=tc(3),lMe={draw(e,t){const n=-tc(t/(NE*3));e.moveTo(0,n*2),e.lineTo(-NE*n,-n),e.lineTo(NE*n,-n),e.closePath()}},Vo=-.5,Uo=tc(3)/2,tO=1/tc(12),cMe=(tO/2+1)*3,dMe={draw(e,t){const n=tc(t/cMe),s=n/2,a=n*tO,i=s,o=n*tO+n,l=-i,c=o;e.moveTo(s,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(Vo*s-Uo*a,Uo*s+Vo*a),e.lineTo(Vo*i-Uo*o,Uo*i+Vo*o),e.lineTo(Vo*l-Uo*c,Uo*l+Vo*c),e.lineTo(Vo*s+Uo*a,Vo*a-Uo*s),e.lineTo(Vo*i+Uo*o,Vo*o-Uo*i),e.lineTo(Vo*l+Uo*c,Vo*c-Uo*l),e.closePath()}};function uMe(e,t){let n=null,s=dM(a);e=typeof e=="function"?e:as(e||mM),t=typeof t=="function"?t:as(t===void 0?64:+t);function a(){let i;if(n||(n=i=s()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:as(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:as(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function JN(){}function eS(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ere(e){this._context=e}ere.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:eS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:eS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mMe(e){return new ere(e)}function tre(e){this._context=e}tre.prototype={areaStart:JN,areaEnd:JN,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:eS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hMe(e){return new tre(e)}function rre(e){this._context=e}rre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,s=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,s):this._context.moveTo(n,s);break;case 3:this._point=4;default:eS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fMe(e){return new rre(e)}function nre(e){this._context=e}nre.prototype={areaStart:JN,areaEnd:JN,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pMe(e){return new nre(e)}function pU(e){return e<0?-1:1}function xU(e,t,n){var s=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(s||a<0&&-0),o=(n-e._y1)/(a||s<0&&-0),l=(i*a+o*s)/(s+a);return(pU(i)+pU(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function gU(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function SE(e,t,n){var s=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-s)/3;e._context.bezierCurveTo(s+l,a+l*t,i-l,o-l*n,i,o)}function tS(e){this._context=e}tS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:SE(this,this._t0,gU(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,SE(this,gU(this,n=xU(this,e,t)),n);break;default:SE(this,this._t0,n=xU(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function sre(e){this._context=new are(e)}(sre.prototype=Object.create(tS.prototype)).point=function(e,t){tS.prototype.point.call(this,t,e)};function are(e){this._context=e}are.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,s,a,i){this._context.bezierCurveTo(t,e,s,n,i,a)}};function xMe(e){return new tS(e)}function gMe(e){return new sre(e)}function ire(e){this._context=e}ire.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var s=vU(e),a=vU(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(s[0][i],a[0][i],s[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function vU(e){var t,n=e.length-1,s,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)s=a[t]/i[t-1],i[t]-=s,o[t]-=s*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function vMe(e){return new ire(e)}function B2(e,t){this._context=e,this._t=t}B2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,196 bytes, lines 1115-1118
1115default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function yMe(e){return new B2(e,.5)}function bMe(e){return new B2(e,0)}function wMe(e){return new B2(e,1)}function jg(e,t){if((o=e.length)>1)for(var n=1,s,a,i=e[t[0]],o,l=i.length;n<o;++n)for(a=i,i=e[t[n]],s=0;s<l;++s)i[s][1]+=i[s][0]=isNaN(a[s][1])?a[s][0]:a[s][1]}function rO(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function jMe(e,t){return e[t]}function NMe(e){const t=[];return t.key=e,t}function SMe(){var e=as([]),t=rO,n=jg,s=jMe;function a(i){var o=Array.from(e.apply(this,arguments),NMe),l,c=o.length,d=-1,u;for(const m of i)for(l=0,++d;l<c;++l)(o[l][d]=[0,+s(m,o[l].key,d,i)]).data=m;for(l=0,u=uM(t(o));l<c;++l)o[u[l]].index=l;return n(o,u),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:as(Array.from(i)),a):e},a.value=function(i){return arguments.length?(s=typeof i=="function"?i:as(+i),a):s},a.order=function(i){return arguments.length?(t=i==null?rO:typeof i=="function"?i:as(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??jg,a):n},a}function _Me(e,t){if((s=e.length)>0){for(var n,s,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<s;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<s;++n)e[n][a][1]/=o}jg(e,t)}}function CMe(e,t){if((a=e.length)>0){for(var n=0,s=e[t[0]],a,i=s.length;n<i;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;s[n][1]+=s[n][0]=-l/2}jg(e,t)}}function kMe(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,s=1,a,i,o;s<i;++s){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],m=u[s][1]||0,f=u[s-1][1]||0,p=(m-f)/2,x=0;x<l;++x){var g=e[t[x]],v=g[s][1]||0,y=g[s-1][1]||0;p+=v-y}c+=m,d+=p*m}a[s-1][1]+=a[s-1][0]=n,c&&(n-=d/c)}a[s-1][1]+=a[s-1][0]=n,jg(e,t)}}function i0(e){"@babel/helpers - typeof";return i0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i0(e)}var EMe=["type","size","sizeType"];function nO(){return nO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},nO.apply(this,arguments)}function yU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function bU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yU(Object(n),!0).forEach(function(s){AMe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yU(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function AMe(e,t,n){return t=TMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TMe(e){var t=RMe(e,"string");return i0(t)=="symbol"?t:t+""}function RMe(e,t){if(i0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(i0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OMe(e,t){if(e==null)return{};var n=PMe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function PMe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}var ore={symbolCircle:mM,symbolCross:eMe,symbolDiamond:rMe,symbolSquare:nMe,symbolStar:oMe,symbolTriangle:lMe,symbolWye:dMe},DMe=Math.PI/180,MMe=function(t){var n="symbol".concat(V2(t));return ore[n]||mM},IMe=function(t,n,s){if(n==="area")return t;switch(s){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*DMe;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},LMe=function(t,n){ore["symbol".concat(V2(t))]=n},hM=function(t){var n=t.type,s=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=OMe(t,EMe),d=bU(bU({},c),{},{type:s,size:i,sizeType:l}),u=function(){var v=MMe(s),y=uMe().type(v).size(IMe(i,l,s));return y()},m=d.className,f=d.cx,p=d.cy,x=ir(d,!0);return f===+f&&p===+p&&i===+i?Y.createElement("path",nO({},x,{className:Tr("recharts-symbols",m),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};hM.registerSymbol=LMe;function Ng(e){"@babel/helpers - typeof";return Ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ng(e)}function sO(){return sO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},sO.apply(this,arguments)}function wU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function $Me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wU(Object(n),!0).forEach(function(s){o0(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wU(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function VMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UMe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,cre(s.key),s)}}function FMe(e,t,n){return t&&UMe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BMe(e,t,n){return t=rS(t),zMe(e,lre()?Reflect.construct(t,n||[],rS(e).constructor):t.apply(e,n))}function zMe(e,t){if(t&&(Ng(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qMe(e)}function qMe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lre(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lre=function(){return!!e})()}function rS(e){return rS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rS(e)}function HMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aO(e,t)}function aO(e,t){return aO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},aO(e,t)}function o0(e,t,n){return t=cre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cre(e){var t=WMe(e,"string");return Ng(t)=="symbol"?t:t+""}function WMe(e,t){if(Ng(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Ng(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fo=32,fM=function(e){function t(){return VMe(this,t),BMe(this,t,arguments)}return HMe(t,e),FMe(t,[{key:"renderIcon",value:function(s){var a=this.props.inactiveColor,i=Fo/2,o=Fo/6,l=Fo/3,c=s.inactive?a:s.color;if(s.type==="plainline")return Y.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:s.payload.strokeDasharray,x1:0,y1:i,x2:Fo,y2:i,className:"recharts-legend-icon"});if(s.type==="line")return Y.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
1116            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
1117            H`).concat(Fo,"M").concat(2*l,",").concat(i,`
1118            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(s.type==="rect")return Y.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Fo/8,"h").concat(Fo,"v").concat(Fo*3/4,"h").concat(-Fo,"z"),className:"recharts-legend-icon"});if(Y.isValidElement(s.legendIcon)){var d=$Me({},s);return delete d.legendIcon,Y.cloneElement(s.legendIcon,d)}return Y.createElement(hM,{fill:c,cx:i,cy:i,size:Fo,sizeType:"diameter",type:s.type})}},{key:"renderItems",value:function(){var s=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,d=a.inactiveColor,u={x:0,y:0,width:Fo,height:Fo}
1118,m={display:l==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,x){var g=p.formatter||c,v=Tr(o0(o0({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=Nr(p.value)?null:p.value;Od(!Nr(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=p.inactive?d:p.color;return Y.createElement("li",sO({className:v,style:m,key:"legend-item-".concat(x)},zf(s.props,p,x)),Y.createElement(KR,{width:o,height:o,viewBox:u,style:f},s.renderIcon(p)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},g?g(y,p,x):y))})}},{key:"render",value:function(){var s=this.props,a=s.payload,i=s.layout,o=s.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(h.PureComponent);o0(fM,"displayName","Legend");o0(fM,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var YMe=C2;function GMe(){this.__data__=new YMe,this.size=0}var KMe=GMe;function XMe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var ZMe=XMe;function QMe(e){return this.__data__.get(e)}var JMe=QMe;function e3e(e){return this.__data__.has(e)}var t3e=e3e,r3e=C2,n3e=tM,s3e=rM,a3e=200;function i3e(e,t){var n=this.__data__;if(n instanceof r3e){var s=n.__data__;if(!n3e||s.length<a3e-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new s3e(s)}return n.set(e,t),this.size=n.size,this}var o3e=i3e,l3e=C2,c3e=KMe,d3e=ZMe,u3e=JMe,m3e=t3e,h3e=o3e;function Iv(e){var t=this.__data__=new l3e(e);this.size=t.size}Iv.prototype.clear=c3e;Iv.prototype.delete=d3e;Iv.prototype.get=u3e;Iv.prototype.has=m3e;Iv.prototype.set=h3e;var dre=Iv,f3e="__lodash_hash_undefined__";function p3e(e){return this.__data__.set(e,f3e),this}var x3e=p3e;function g3e(e){return this.__data__.has(e)}var v3e=g3e,y3e=rM,b3e=x3e,w3e=v3e;function nS(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new y3e;++t<n;)this.add(e[t])}nS.prototype.add=nS.prototype.push=b3e;nS.prototype.has=w3e;var ure=nS;function j3e(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}var mre=j3e;function N3e(e,t){return e.has(t)}var hre=N3e,S3e=ure,_3e=mre,C3e=hre,k3e=1,E3e=2;function A3e(e,t,n,s,a,i){var o=n&k3e,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var m=-1,f=!0,p=n&E3e?new S3e:void 0;for(i.set(e,t),i.set(t,e);++m<l;){var x=e[m],g=t[m];if(s)var v=o?s(g,x,m,t,e,i):s(x,g,m,e,t,i);if(v!==void 0){if(v)continue;f=!1;break}if(p){if(!_3e(t,function(y,b){if(!C3e(p,b)&&(x===y||a(x,y,n,s,i)))return p.push(b)})){f=!1;break}}else if(!(x===g||a(x,g,n,s,i))){f=!1;break}}return i.delete(e),i.delete(t),f}var fre=A3e,T3e=Kc,R3e=T3e.Uint8Array,O3e=R3e;function P3e(e){var t=-1,n=Array(e.size);return e.forEach(function(s,a){n[++t]=[a,s]}),n}var D3e=P3e;function M3e(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var pM=M3e,jU=Rw,NU=O3e,I3e=eM,L3e=fre,$3e=D3e,V3e=pM,U3e=1,F3e=2,B3e="[object Boolean]",z3e="[object Date]",q3e="[object Error]",H3e="[object Map]",W3e="[object Number]",Y3e="[object RegExp]",G3e="[object Set]",K3e="[object String]",X3e="[object Symbol]",Z3e="[object ArrayBuffer]",Q3e="[object DataView]",SU=jU?jU.prototype:void 0,_E=SU?SU.valueOf:void 0;function J3e(e,t,n,s,a,i,o){switch(n){case Q3e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Z3e:return!(e.byteLength!=t.byteLength||!i(new NU(e),new NU(t)));case B3e:case z3e:case W3e:return I3e(+e,+t);case q3e:return e.name==t.name&&e.message==t.message;case Y3e:case K3e:return e==t+"";case H3e:var l=$3e;case G3e:var c=s&U3e;if(l||(l=V3e),e.size!=t.size&&!c)return!1;var d=o.get(e);if(d)return d==t;s|=F3e,o.set(e,t);var u=L3e(l(e),l(t),s,a,i,o);return o.delete(e),u;case X3e:if(_E)return _E.call(e)==_E.call(t)}return!1}var eIe=J3e;function tIe(e,t){for(var n=-1,s=t.length,a=e.length;++n<s;)e[a+n]=t[n];return e}var pre=tIe,rIe=pre,nIe=io;function sIe(e,t,n){var s=t(e);return nIe(e)?s:rIe(s,n(e))}var aIe=sIe;function iIe(e,t){for(var n=-1,s=e==null?0:e.length,a=0,i=[];++n<s;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}var oIe=iIe;function lIe(){return[]}var cIe=lIe,dIe=oIe,uIe=cIe,mIe=Object.prototype,hIe=mIe.propertyIsEnumerable,_U=Object.getOwnPropertySymbols,fIe=_U?function(e){return e==null?[]:(e=Object(e),dIe(_U(e),function(t){return hIe.call(e,t)}))}:uIe,pIe=fIe;function xIe(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var gIe=xIe,vIe=hu,yIe=fu,bIe="[object Arguments]";function wIe(e){return yIe(e)&&vIe(e)==bIe}var jIe=wIe,CU=jIe,NIe=fu,xre=Object.prototype,SIe=xre.hasOwnProperty,_Ie=xre.propertyIsEnumerable,CIe=CU(function(){return arguments}())?CU:function(e){return NIe(e)&&SIe.call(e,"callee")&&!_Ie.call(e,"callee")},xM=CIe,sS={exports:{}};function kIe(){return!1}var EIe=kIe;sS.exports;(function(e,t){var n=Kc,s=EIe,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||s;e.exports=d}
vendor: 4,275 bytes, line 1118
1118)(sS,sS.exports);var gre=sS.exports,AIe=9007199254740991,TIe=/^(?:0|[1-9]\d*)$/;function RIe(e,t){var n=typeof e;return t=t??AIe,!!t&&(n=="number"||n!="symbol"&&TIe.test(e))&&e>-1&&e%1==0&&e<t}var gM=RIe,OIe=9007199254740991;function PIe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=OIe}var vM=PIe,DIe=hu,MIe=vM,IIe=fu,LIe="[object Arguments]",$Ie="[object Array]",VIe="[object Boolean]",UIe="[object Date]",FIe="[object Error]",BIe="[object Function]",zIe="[object Map]",qIe="[object Number]",HIe="[object Object]",WIe="[object RegExp]",YIe="[object Set]",GIe="[object String]",KIe="[object WeakMap]",XIe="[object ArrayBuffer]",ZIe="[object DataView]",QIe="[object Float32Array]",JIe="[object Float64Array]",eLe="[object Int8Array]",tLe="[object Int16Array]",rLe="[object Int32Array]",nLe="[object Uint8Array]",sLe="[object Uint8ClampedArray]",aLe="[object Uint16Array]",iLe="[object Uint32Array]",fs={};fs[QIe]=fs[JIe]=fs[eLe]=fs[tLe]=fs[rLe]=fs[nLe]=fs[sLe]=fs[aLe]=fs[iLe]=!0;fs[LIe]=fs[$Ie]=fs[XIe]=fs[VIe]=fs[ZIe]=fs[UIe]=fs[FIe]=fs[BIe]=fs[zIe]=fs[qIe]=fs[HIe]=fs[WIe]=fs[YIe]=fs[GIe]=fs[KIe]=!1;function oLe(e){return IIe(e)&&MIe(e.length)&&!!fs[DIe(e)]}var lLe=oLe;function cLe(e){return function(t){return e(t)}}var vre=cLe,aS={exports:{}};aS.exports;(function(e,t){var n=Cte,s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===s,o=i&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(aS,aS.exports);var dLe=aS.exports,uLe=lLe,mLe=vre,kU=dLe,EU=kU&&kU.isTypedArray,hLe=EU?mLe(EU):uLe,yre=hLe,fLe=gIe,pLe=xM,xLe=io,gLe=gre,vLe=gM,yLe=yre,bLe=Object.prototype,wLe=bLe.hasOwnProperty;function jLe(e,t){var n=xLe(e),s=!n&&pLe(e),a=!n&&!s&&gLe(e),i=!n&&!s&&!a&&yLe(e),o=n||s||a||i,l=o?fLe(e.length,String):[],c=l.length;for(var d in e)(t||wLe.call(e,d))&&!(o&&(d=="length"||a&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||vLe(d,c)))&&l.push(d);return l}var NLe=jLe,SLe=Object.prototype;function _Le(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||SLe;return e===n}var CLe=_Le;function kLe(e,t){return function(n){return e(t(n))}}var bre=kLe,ELe=bre,ALe=ELe(Object.keys,Object),TLe=ALe,RLe=CLe,OLe=TLe,PLe=Object.prototype,DLe=PLe.hasOwnProperty;function MLe(e){if(!RLe(e))return OLe(e);var t=[];for(var n in Object(e))DLe.call(e,n)&&n!="constructor"&&t.push(n);return t}var ILe=MLe,LLe=JD,$Le=vM;function VLe(e){return e!=null&&$Le(e.length)&&!LLe(e)}var z2=VLe,ULe=NLe,FLe=ILe,BLe=z2;function zLe(e){return BLe(e)?ULe(e):FLe(e)}var yM=zLe,qLe=aIe,HLe=pIe,WLe=yM;function YLe(e){return qLe(e,WLe,HLe)}var GLe=YLe,AU=GLe,KLe=1,XLe=Object.prototype,ZLe=XLe.hasOwnProperty;function QLe(e,t,n,s,a,i){var o=n&KLe,l=AU(e),c=l.length,d=AU(t),u=d.length;if(c!=u&&!o)return!1;for(var m=c;m--;){var f=l[m];if(!(o?f in t:ZLe.call(t,f)))return!1}var p=i.get(e),x=i.get(t);if(p&&x)return p==t&&x==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=o;++m<c;){f=l[m];var y=e[f],b=t[f];if(s)var w=o?s(b,y,f,t,e,i):s(y,b,f,e,t,i);if(!(w===void 0?y===b||a(y,b,n,s,i):w)){g=!1;break}v||(v=f=="constructor")}if(g&&!v){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(g=!1)}return i.delete(e),i.delete(t),g}var JLe=QLe,e$e=lp,t$e=Kc,r$e=e$e(t$e,"DataView"),n$e=r$e,s$e=lp,a$e=Kc,i$e=s$e(a$e,"Promise"),o$e=i$e,l$e=lp,c$e=Kc,d$e=l$e(c$e,"Set"),wre=d$e,u$e=lp,m$e=Kc,h$e=u$e(m$e,"WeakMap"),f$e=h$e,iO=n$e,oO=tM,lO=o$e,cO=wre,dO=f$e,jre=hu,Lv=Ete,TU="[object Map]",p$e="[object Object]",RU="[object Promise]",OU="[object Set]",PU="[object WeakMap]",DU="[object DataView]",x$e=Lv(iO),g$e=Lv(oO),v$e=Lv(lO),y$e=Lv(cO),b$e=Lv(dO),Lh=jre;(iO&&Lh(new iO(new ArrayBuffer(1)))!=DU||oO&&Lh(new oO)!=TU||lO&&Lh(lO.resolve())!=RU||cO&&Lh(new cO)!=OU||dO&&Lh(new dO)!=PU)&&(Lh=function(e){var t=jre(e),n=t==p$e?e.constructor:void 0,s=n?Lv(n):"";if(s)switch(s){case x$e:return DU;case g$e:return TU;case v$e:return RU;case y$e:return OU;case b$e:return PU}return t});var w$e=Lh,CE=dre,j$e=fre,N$e=eIe,S$e=JLe,MU=w$e,IU=io,LU=gre,_$e=yre,C$e=1,$U="[object Arguments]",VU="[object Array]",Dj="[object Object]",k$e=Object.prototype,UU=k$e.hasOwnProperty;
vendor: 4,278 bytes, line 1118
1118function E$e(e,t,n,s,a,i){var o=IU(e),l=IU(t),c=o?VU:MU(e),d=l?VU:MU(t);c=c==$U?Dj:c,d=d==$U?Dj:d;var u=c==Dj,m=d==Dj,f=c==d;if(f&&LU(e)){if(!LU(t))return!1;o=!0,u=!1}if(f&&!u)return i||(i=new CE),o||_$e(e)?j$e(e,t,n,s,a,i):N$e(e,t,c,n,s,a,i);if(!(n&C$e)){var p=u&&UU.call(e,"__wrapped__"),x=m&&UU.call(t,"__wrapped__");if(p||x){var g=p?e.value():e,v=x?t.value():t;return i||(i=new CE),a(g,v,n,s,i)}}return f?(i||(i=new CE),S$e(e,t,n,s,a,i)):!1}var A$e=E$e,T$e=A$e,FU=fu;function Nre(e,t,n,s,a){return e===t?!0:e==null||t==null||!FU(e)&&!FU(t)?e!==e&&t!==t:T$e(e,t,n,s,Nre,a)}var bM=Nre,R$e=dre,O$e=bM,P$e=1,D$e=2;function M$e(e,t,n,s){var a=n.length,i=a,o=!s;if(e==null)return!i;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=n[a];var c=l[0],d=e[c],u=l[1];if(o&&l[2]){if(d===void 0&&!(c in e))return!1}else{var m=new R$e;if(s)var f=s(d,u,c,e,t,m);if(!(f===void 0?O$e(u,d,P$e|D$e,s,m):f))return!1}}return!0}var I$e=M$e,L$e=uh;function $$e(e){return e===e&&!L$e(e)}var Sre=$$e,V$e=Sre,U$e=yM;function F$e(e){for(var t=U$e(e),n=t.length;n--;){var s=t[n],a=e[s];t[n]=[s,a,V$e(a)]}return t}var B$e=F$e;function z$e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var _re=z$e,q$e=I$e,H$e=B$e,W$e=_re;function Y$e(e){var t=H$e(e);return t.length==1&&t[0][2]?W$e(t[0][0],t[0][1]):function(n){return n===e||q$e(n,e,t)}}var G$e=Y$e;function K$e(e,t){return e!=null&&t in Object(e)}var X$e=K$e,Z$e=Pte,Q$e=xM,J$e=io,e6e=gM,t6e=vM,r6e=E2;function n6e(e,t,n){t=Z$e(t,e);for(var s=-1,a=t.length,i=!1;++s<a;){var o=r6e(t[s]);if(!(i=e!=null&&n(e,o)))break;e=e[o]}return i||++s!=a?i:(a=e==null?0:e.length,!!a&&t6e(a)&&e6e(o,a)&&(J$e(e)||Q$e(e)))}var s6e=n6e,a6e=X$e,i6e=s6e;function o6e(e,t){return e!=null&&i6e(e,t,a6e)}var l6e=o6e,c6e=bM,d6e=Dte,u6e=l6e,m6e=QD,h6e=Sre,f6e=_re,p6e=E2,x6e=1,g6e=2;function v6e(e,t){return m6e(e)&&h6e(t)?f6e(p6e(e),t):function(n){var s=d6e(n,e);return s===void 0&&s===t?u6e(n,e):c6e(t,s,x6e|g6e)}}var y6e=v6e;function b6e(e){return e}var $v=b6e;function w6e(e){return function(t){return t==null?void 0:t[e]}}var j6e=w6e,N6e=aM;function S6e(e){return function(t){return N6e(t,e)}}var _6e=S6e,C6e=j6e,k6e=_6e,E6e=QD,A6e=E2;function T6e(e){return E6e(e)?C6e(A6e(e)):k6e(e)}var R6e=T6e,O6e=G$e,P6e=y6e,D6e=$v,M6e=io,I6e=R6e;function L6e(e){return typeof e=="function"?e:e==null?D6e:typeof e=="object"?M6e(e)?P6e(e[0],e[1]):O6e(e):I6e(e)}var mh=L6e;function $6e(e,t,n,s){for(var a=e.length,i=n+(s?1:-1);s?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var V6e=$6e;function U6e(e){return e!==e}var F6e=U6e;function B6e(e,t,n){for(var s=n-1,a=e.length;++s<a;)if(e[s]===t)return s;return-1}var z6e=B6e,q6e=V6e,H6e=F6e,W6e=z6e;function Y6e(e,t,n){return t===t?W6e(e,t,n):q6e(e,H6e,n)}var G6e=Y6e,K6e=G6e;function X6e(e,t){var n=e==null?0:e.length;return!!n&&K6e(e,t,0)>-1}var Z6e=X6e;function Q6e(e,t,n){for(var s=-1,a=e==null?0:e.length;++s<a;)if(n(t,e[s]))return!0;return!1}var J6e=Q6e;function eVe(){}var tVe=eVe,kE=wre,rVe=tVe,nVe=pM,sVe=1/0,aVe=kE&&1/nVe(new kE([,-0]))[1]==sVe?function(e){return new kE(e)}:rVe,iVe=aVe,oVe=ure,lVe=Z6e,cVe=J6e,dVe=hre,uVe=iVe,mVe=pM,hVe=200;function fVe(e,t,n){var s=-1,a=lVe,i=e.length,o=!0,l=[],c=l;if(n)o=!1,a=cVe;else if(i>=hVe){var d=t?null:uVe(e);if(d)return mVe(d);o=!1,a=dVe,c=new oVe}else c=t?[]:l;e:for(;++s<i;){var u=e[s],m=t?t(u):u;if(u=n||u!==0?u:0,o&&m===m){for(var f=c.length;f--;)if(c[f]===m)continue e;t&&c.push(m),l.push(u)}else a(c,m,n)||(c!==l&&c.push(m),l.push(u))}return l}var pVe=fVe,xVe=mh,gVe=pVe;function vVe(e,t){return e&&e.length?gVe(e,xVe(t)):[]}var yVe=vVe;const BU=Mn(yVe);function Cre(e,t,n){return t===!0?BU(e,n):Nr(t)?BU(e,t):e}function Sg(e){"@babel/helpers - typeof";return Sg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sg(e)}var bVe=["ref"];function zU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function cd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 4,107 bytes, line 1118
1118t%2?zU(Object(n),!0).forEach(function(s){q2(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zU(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function wVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qU(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Ere(s.key),s)}}function jVe(e,t,n){return t&&qU(e.prototype,t),n&&qU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function NVe(e,t,n){return t=iS(t),SVe(e,kre()?Reflect.construct(t,n||[],iS(e).constructor):t.apply(e,n))}function SVe(e,t){if(t&&(Sg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _Ve(e)}function _Ve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kre(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kre=function(){return!!e})()}function iS(e){return iS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},iS(e)}function CVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uO(e,t)}function uO(e,t){return uO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},uO(e,t)}function q2(e,t,n){return t=Ere(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ere(e){var t=kVe(e,"string");return Sg(t)=="symbol"?t:t+""}function kVe(e,t){if(Sg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Sg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EVe(e,t){if(e==null)return{};var n=AVe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function AVe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function TVe(e){return e.value}function RVe(e,t){if(Y.isValidElement(e))return Y.cloneElement(e,t);if(typeof e=="function")return Y.createElement(e,t);t.ref;var n=EVe(t,bVe);return Y.createElement(fM,n)}var HU=1,Rx=function(e){function t(){var n;wVe(this,t);for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=NVe(this,t,[].concat(a)),q2(n,"lastBoundingBox",{width:-1,height:-1}),n}return CVe(t,e),jVe(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var s=this.wrapperNode.getBoundingClientRect();return s.height=this.wrapperNode.offsetHeight,s.width=this.wrapperNode.offsetWidth,s}return null}},{key:"updateBBox",value:function(){var s=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>HU||Math.abs(a.height-this.lastBoundingBox.height)>HU)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,s&&s(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,s&&s(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?cd({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(s){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,d=a.chartWidth,u=a.chartHe
1118ight,m,f;if(!s||(s.left===void 0||s.left===null)&&(s.right===void 0||s.right===null))if(o==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();m={left:((d||0)-p.width)/2}}else m=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!s||(s.top===void 0||s.top===null)&&(s.bottom===void 0||s.bottom===null))if(l==="middle"){var x=this.getBBoxSnapshot();f={top:((u||0)-x.height)/2}}else f=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return cd(cd({},m),f)}},{key:"render",value:function(){var s=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,d=a.payloadUniqBy,u=a.payload,m=cd(cd({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Y.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(p){s.wrapperNode=p}},RVe(i,cd(cd({},this.props),{},{payload:Cre(u,d,TVe)})))}}],[{key:"getWithHeight",value:function(s,a){var i=cd(cd({},this.defaultProps),s.props),o=i.layout;return o==="vertical"&&xt(s.props.height)?{height:s.props.height}:o==="horizontal"?{width:s.props.width||a}:null}}])}(h.PureComponent);q2(Rx,"displayName","Legend");q2(Rx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var WU=Rw,OVe=xM,PVe=io,YU=WU?WU.isConcatSpreadable:void 0;function DVe(e){return PVe(e)||OVe(e)||!!(YU&&e&&e[YU])}var MVe=DVe,IVe=pre,LVe=MVe;function Are(e,t,n,s,a){var i=-1,o=e.length;for(n||(n=LVe),a||(a=[]);++i<o;){var l=e[i];t>0&&n(l)?t>1?Are(l,t-1,n,s,a):IVe(a,l):s||(a[a.length]=l)}return a}var Tre=Are;function $Ve(e){return function(t,n,s){for(var a=-1,i=Object(t),o=s(t),l=o.length;l--;){var c=o[e?l:++a];if(n(i[c],c,i)===!1)break}return t}}var VVe=$Ve,UVe=VVe,FVe=UVe(),BVe=FVe,zVe=BVe,qVe=yM;function HVe(e,t){return e&&zVe(e,t,qVe)}var Rre=HVe,WVe=z2;function YVe(e,t){return function(n,s){if(n==null)return n;if(!WVe(n))return e(n,s);for(var a=n.length,i=t?a:-1,o=Object(n);(t?i--:++i<a)&&s(o[i],i,o)!==!1;);return n}}var GVe=YVe,KVe=Rre,XVe=GVe,ZVe=XVe(KVe),wM=ZVe,QVe=wM,JVe=z2;function eUe(e,t){var n=-1,s=JVe(e)?Array(e.length):[];return QVe(e,function(a,i,o){s[++n]=t(a,i,o)}),s}var Ore=eUe;function tUe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var rUe=tUe,GU=Av;function nUe(e,t){if(e!==t){var n=e!==void 0,s=e===null,a=e===e,i=GU(e),o=t!==void 0,l=t===null,c=t===t,d=GU(t);if(!l&&!d&&!i&&e>t||i&&o&&c&&!l&&!d||s&&o&&c||!n&&c||!a)return 1;if(!s&&!i&&!d&&e<t||d&&n&&a&&!s&&!i||l&&n&&a||!o&&a||!c)return-1}return 0}var sUe=nUe,aUe=sUe;function iUe(e,t,n){for(var s=-1,a=e.criteria,i=t.criteria,o=a.length,l=n.length;++s<o;){var c=aUe(a[s],i[s]);if(c){if(s>=l)return c;var d=n[s];return c*(d=="desc"?-1:1)}}return e.index-t.index}var oUe=iUe,EE=sM,lUe=aM,cUe=mh,dUe=Ore,uUe=rUe,mUe=vre,hUe=oUe,fUe=$v,pUe=io;function xUe(e,t,n){t.length?t=EE(t,function(i){return pUe(i)?function(o){return lUe(o,i.length===1?i[0]:i)}:i}):t=[fUe];var s=-1;t=EE(t,mUe(cUe));var a=dUe(e,function(i,o,l){var c=EE(t,function(d){return d(i)});return{criteria:c,index:++s,value:i}});return uUe(a,function(i,o){return hUe(i,o,n)})}var gUe=xUe;function vUe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var yUe=vUe,bUe=yUe,KU=Math.max;function wUe(e,t,n){return t=KU(t===void 0?e.length-1:t,0),function(){for(var s=arguments,a=-1,i=KU(s.length-t,0),o=Array(i);++a<i;)o[a]=s[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=s[a];return l[t]=n(o),bUe(e,this,l)}}var jUe=wUe;function NUe(e){return function(){return e}}var SUe=NUe,_Ue=lp,CUe=function(){try{var e=_Ue(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Pre=CUe,kUe=SUe,XU=Pre,EUe=$v,AUe=XU?function(e,t){return XU(e,"toString",{configurable:!0,enumerable:!1,value:kUe(t),writable:!0})}:EUe,TUe=AUe,RUe=800,OUe=16,PUe=Date.now;function DUe(e){var t=0,n=0;return function(){var s=PUe(),a=OUe-(s-n);if(n=s,a>0){if(++t>=RUe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var MUe=DUe,IUe=TUe,LUe=MUe,$Ue=LUe(IUe),VUe=$Ue,UUe=$v,FUe=jUe,BUe=VUe;function zUe(e,t){return BUe(FUe(e,t,UUe),e+"")}var qUe=zUe,HUe=eM,WUe=z2,YUe=gM,GUe=uh;function KUe(e,t,n){if(!GUe(n))return!1;var s=typeof t;return(s=="number"?WUe(n)&&YUe(t,n.length):s=="string"&&t in n)?HUe(n[t],e):!1}var H2=KUe,XUe=Tre,ZUe=gUe,QUe=qUe,ZU=H2,JUe=QUe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ZU(e,t[0],t[1])?t=[]:n>2&&ZU(t[0],t[1],t[2])&&(t=[t[0]]),ZUe(e,XUe(t,1),[])}),e8e=JUe;const jM=Mn(e8e);function l0(e){"@babel/helpers - typeof";return l0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l0(e)}function mO(){return mO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mO.apply(this,arguments)}function t8e(e,t){return a8e(e)||s8e(e,t)||n8e(e,t)||r8e()}
vendor: 31,967 bytes, lines 1118-1126
1118function r8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1119In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n8e(e,t){if(e){if(typeof e=="string")return QU(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QU(e,t)}}function QU(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function s8e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function a8e(e){if(Array.isArray(e))return e}function JU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function AE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JU(Object(n),!0).forEach(function(s){i8e(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JU(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function i8e(e,t,n){return t=o8e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o8e(e){var t=l8e(e,"string");return l0(t)=="symbol"?t:t+""}function l8e(e,t){if(l0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(l0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c8e(e){return Array.isArray(e)&&Da(e[0])&&Da(e[1])?e.join(" ~ "):e}var d8e=function(t){var n=t.separator,s=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,d=c===void 0?{}:c,u=t.payload,m=t.formatter,f=t.itemSorter,p=t.wrapperClassName,x=t.labelClassName,g=t.label,v=t.labelFormatter,y=t.accessibilityLayer,b=y===void 0?!1:y,w=function(){if(u&&u.length){var T={padding:0,margin:0},D=(f?jM(u,f):u).map(function(A,V){if(A.type==="none")return null;var U=AE({display:"block",paddingTop:4,paddingBottom:4,color:A.color||"#000"},l),O=A.formatter||m||c8e,M=A.value,$=A.name,I=M,B=$;if(O&&I!=null&&B!=null){var K=O(M,$,A,V,u);if(Array.isArray(K)){var Z=t8e(K,2);I=Z[0],B=Z[1]}else I=K}return Y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(V),style:U},Da(B)?Y.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Da(B)?Y.createElement("span",{className:"recharts-tooltip-item-separator"},s):null,Y.createElement("span",{className:"recharts-tooltip-item-value"},I),Y.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return Y.createElement("ul",{className:"recharts-tooltip-item-list",style:T},D)}return null},S=AE({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=AE({margin:0},d),N=!Rr(g),_=N?g:"",C=Tr("recharts-default-tooltip",p),k=Tr("recharts-tooltip-label",x);N&&v&&u!==void 0&&u!==null&&(_=v(g,u));var E=b?{role:"status","aria-live":"assertive"}:{};return Y.createElement("div",mO({className:C,style:S},E),Y.createElement("p",{className:k,style:j},Y.isValidElement(_)?_:"".concat(_)),w())};function c0(e){"@babel/helpers - typeof";return c0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c0(e)}function Mj(e,t,n){return t=u8e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u8e(e){var t=m8e(e,"string");return c0(t)=="symbol"?t:t+""}function m8e(e,t){if(c0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(c0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uy="recharts-tooltip-wrapper",h8e={visibility:"hidden"};function f8e(e){var t=e.coordinate,n=e.translateX,s=e.translateY;return Tr(uy,Mj(Mj(Mj(Mj({},"".concat(uy,"-right"),xt(n)&&t&&xt(t.x)&&n>=t.x),"".concat(uy,"-left"),xt(n)&&t&&xt(t.x)&&n<t.x),"".concat(uy,"-bottom"),xt(s)&&t&&xt(t.y)&&s>=t.y),"".concat(uy,"-top"),xt(s)&&t&&xt(t.y)&&s<t.y))}function e8(e){var t=e.allowEscapeViewBox,n=e.coordinate,s=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,d=e.viewBoxDimension;if(i&&xt(i[s]))return i[s];var u=n[s]-l-a,m=n[s]+a;if(t[s])return o[s]?u:m;if(o[s]){var f=u,p=c[s];return f<p?Math.max(m,c[s]):Math.max(u,c[s])}var x=m+l,g=c[s]+d;return x>g?Math.max(u,c[s]):Math.max(m,c[s])}function p8e(e){var t=e.translateX,n=e.translateY,s=e.useTranslate3d;return{transform:s?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function x8e(e){var t=e.allowEscapeViewBox,n=e.coordinate,s=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,d,u,m;return o.height>0&&o.width>0&&n?(u=e8({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:s,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),m=e8({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:s,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=p8e({translateX:u,translateY:m,useTranslate3d:l})):d=h8e,{cssProperties:d,cssClasses:f8e({translateX:u,translateY:m,coordinate:n})}}function _g(e){"@babel/helpers - typeof";return _g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_g(e)}function t8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function r8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t8(Object(n),!0).forEach(function(s){fO(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t8(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function g8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v8e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Mre(s.key),s)}}function y8e(e,t,n){return t&&v8e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function b8e(e,t,n){return t=oS(t),w8e(e,Dre()?Reflect.construct(t,n||[],oS(e).constructor):t.apply(e,n))}function w8e(e,t){if(t&&(_g(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j8e(e)}function j8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dre(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dre=function(){return!!e})()}function oS(e){return oS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oS(e)}function N8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hO(e,t)}function hO(e,t){return hO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},hO(e,t)}function fO(e,t,n){return t=Mre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mre(e){var t=S8e(e,"string");return _g(t)=="symbol"?t:t+""}function S8e(e,t){if(_g(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(_g(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n8=1,_8e=function(e){function t(){var n;g8e(this,t);for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=b8e(this,t,[].concat(a)),fO(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),fO(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,d,u;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(d=(u=n.props.coordinate)===null||u===void 0?void 0:u.y)!==null&&d!==void 0?d:0}})}}),n}return N8e(t,e),y8e(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var s=this.wrapperNode.getBoundingClientRect();(Math.abs(s.width-this.state.lastBoundingBox.width)>n8||Math.abs(s.height-this.state.lastBoundingBox.height)>n8)&&this.setState({lastBoundingBox:{width:s.width,height:s.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var s,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((s=this.props.coordinate)===null||s===void 0?void 0:s.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var s=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,d=a.children,u=a.coordinate,m=a.hasPayload,f=a.isAnimationActive,p=a.offset,x=a.position,g=a.reverseDirection,v=a.useTranslate3d,y=a.viewBox,b=a.wrapperStyle,w=x8e({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:p,position:x,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),S=w.cssClasses,j=w.cssProperties,N=r8(r8({transition:f&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&m?"visible":"hidden",position:"absolute",top:0,left:0},b);return Y.createElement("div",{tabIndex:-1,className:S,style:N,ref:function(C){s.wrapperNode=C}},d)}}])}(h.PureComponent),C8e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Rc={isSsr:C8e(),get:function(t){return Rc[t]},set:function(t,n){if(typeof t=="string")Rc[t]=n;else{var s=Object.keys(t);s&&s.length&&s.forEach(function(a){Rc[a]=t[a]})}}};function Cg(e){"@babel/helpers - typeof";return Cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cg(e)}function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function a8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(s){NM(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function k8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E8e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Lre(s.key),s)}}function A8e(e,t,n){return t&&E8e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function T8e(e,t,n){return t=lS(t),R8e(e,Ire()?Reflect.construct(t,n||[],lS(e).constructor):t.apply(e,n))}function R8e(e,t){if(t&&(Cg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O8e(e)}function O8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ire(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ire=function(){return!!e})()}function lS(e){return lS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lS(e)}function P8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pO(e,t)}function pO(e,t){return pO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},pO(e,t)}function NM(e,t,n){return t=Lre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lre(e){var t=D8e(e,"string");return Cg(t)=="symbol"?t:t+""}function D8e(e,t){if(Cg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Cg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M8e(e){return e.dataKey}function I8e(e,t){return Y.isValidElement(e)?Y.cloneElement(e,t):typeof e=="function"?Y.createElement(e,t):Y.createElement(d8e,t)}var Wo=function(e){function t(){return k8e(this,t),T8e(this,t,arguments)}return P8e(t,e),A8e(t,[{key:"render",value:function(){var s=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,d=a.content,u=a.coordinate,m=a.filterNull,f=a.isAnimationActive,p=a.offset,x=a.payload,g=a.payloadUniqBy,v=a.position,y=a.reverseDirection,b=a.useTranslate3d,w=a.viewBox,S=a.wrapperStyle,j=x??[];m&&j.length&&(j=Cre(x.filter(function(_){return _.value!=null&&(_.hide!==!0||s.props.includeHidden)}),g,M8e));var N=j.length>0;return Y.createElement(_8e,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:f,active:i,coordinate:u,hasPayload:N,offset:p,position:v,reverseDirection:y,useTranslate3d:b,viewBox:w,wrapperStyle:S},I8e(d,a8(a8({},this.props),{},{payload:j})))}}])}(h.PureComponent);NM(Wo,"displayName","Tooltip");NM(Wo,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Rc.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var L8e=Kc,$8e=function(){return L8e.Date.now()},V8e=$8e,U8e=/\s/;function F8e(e){for(var t=e.length;t--&&U8e.test(e.charAt(t)););return t}var B8e=F8e,z8e=B8e,q8e=/^\s+/;function H8e(e){return e&&e.slice(0,z8e(e)+1).replace(q8e,"")}var W8e=H8e,Y8e=W8e,i8=uh,G8e=Av,o8=NaN,K8e=/^[-+]0x[0-9a-f]+$/i,X8e=/^0b[01]+$/i,Z8e=/^0o[0-7]+$/i,Q8e=parseInt;function J8e(e){if(typeof e=="number")return e;if(G8e(e))return o8;if(i8(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=i8(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Y8e(e);var n=X8e.test(e);return n||Z8e.test(e)?Q8e(e.slice(2),n?2:8):K8e.test(e)?o8:+e}var $re=J8e,eFe=uh,TE=V8e,l8=$re,tFe="Expected a function",rFe=Math.max,nFe=Math.min;function sFe(e,t,n){var s,a,i,o,l,c,d=0,u=!1,m=!1,f=!0;if(typeof e!="function")throw new TypeError(tFe);t=l8(t)||0,eFe(n)&&(u=!!n.leading,m="maxWait"in n,i=m?rFe(l8(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function p(N){var _=s,C=a;return s=a=void 0,d=N,o=e.apply(C,_),o}function x(N){return d=N,l=setTimeout(y,t),u?p(N):o}function g(N){var _=N-c,C=N-d,k=t-_;return m?nFe(k,i-C):k}function v(N){var _=N-c,C=N-d;return c===void 0||_>=t||_<0||m&&C>=i}function y(){var N=TE();if(v(N))return b(N);l=setTimeout(y,g(N))}function b(N){return l=void 0,f&&s?p(N):(s=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),d=0,s=c=a=l=void 0}function S(){return l===void 0?o:b(TE())}function j(){var N=TE(),_=v(N);if(s=arguments,a=this,c=N,_){if(l===void 0)return x(c);if(m)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return j.cancel=w,j.flush=S,j}var aFe=sFe,iFe=aFe,oFe=uh,lFe="Expected a function";function cFe(e,t,n){var s=!0,a=!0;if(typeof e!="function")throw new TypeError(lFe);return oFe(n)&&(s="leading"in n?!!n.leading:s,a="trailing"in n?!!n.trailing:a),iFe(e,t,{leading:s,maxWait:t,trailing:a})}var dFe=cFe;const Vre=Mn(dFe);function d0(e){"@babel/helpers - typeof";return d0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d0(e)}function c8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ij(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c8(Object(n),!0).forEach(function(s){uFe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c8(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function uFe(e,t,n){return t=mFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mFe(e){var t=hFe(e,"string");return d0(t)=="symbol"?t:t+""}function hFe(e,t){if(d0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(d0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fFe(e,t){return vFe(e)||gFe(e,t)||xFe(e,t)||pFe()}function pFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1120In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xFe(e,t){if(e){if(typeof e=="string")return d8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d8(e,t)}}function d8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function gFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function vFe(e){if(Array.isArray(e))return e}var u0=h.forwardRef(function(e,t){var n=e.aspect,s=e.initialDimension,a=s===void 0?{width:-1,height:-1}:s,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,d=e.minWidth,u=d===void 0?0:d,m=e.minHeight,f=e.maxHeight,p=e.children,x=e.debounce,g=x===void 0?0:x,v=e.id,y=e.className,b=e.onResize,w=e.style,S=w===void 0?{}:w,j=h.useRef(null),N=h.useRef();N.current=b,h.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var _=h.useState({containerWidth:a.width,containerHeight:a.height}),C=fFe(_,2),k=C[0],E=C[1],R=h.useCallback(function(D,A){E(function(V){var U=Math.round(D),O=Math.round(A);return V.containerWidth===U&&V.containerHeight===O?V:{containerWidth:U,containerHeight:O}})},[]);h.useEffect(function(){var D=function($){var I,B=$[0].contentRect,K=B.width,Z=B.height;R(K,Z),(I=N.current)===null||I===void 0||I.call(N,K,Z)};g>0&&(D=Vre(D,g,{trailing:!0,leading:!1}));var A=new ResizeObserver(D),V=j.current.getBoundingClientRect(),U=V.width,O=V.height;return R(U,O),A.observe(j.current),function(){A.disconnect()}},[R,g]);var T=h.useMemo(function(){var D=k.containerWidth,A=k.containerHeight;if(D<0||A<0)return null;Od(Yh(o)||Yh(c),`The width(%s) and height(%s) are both fixed numbers,
1121       maybe you don't need to use a ResponsiveContainer.`,o,c),Od(!n||n>0,"The aspect(%s) must be greater than zero.",n);var V=Yh(o)?D:o,U=Yh(c)?A:c;n&&n>0&&(V?U=V/n:U&&(V=U*n),f&&U>f&&(U=f)),Od(V>0||U>0,`The width(%s) and height(%s) of chart should be greater than 0,
1122       please check the style of container, or the props width(%s) and height(%s),
1123       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
1124       height and width.`,V,U,o,c,u,m,n);var O=!Array.isArray(p)&&Rd(p.type).endsWith("Chart");return Y.Children.map(p,function(M){return Y.isValidElement(M)?h.cloneElement(M,Ij({width:V,height:U},O?{style:Ij({height:"100%",width:"100%",maxHeight:U,maxWidth:V},M.props.style)}:{})):M})},[n,p,c,f,m,u,k,o]);return Y.createElement("div",{id:v?"".concat(v):void 0,className:Tr("recharts-responsive-container",y),style:Ij(Ij({},S),{},{width:o,height:c,minWidth:u,minHeight:m,maxHeight:f}),ref:j},T)}),W2=function(t){return null};W2.displayName="Cell";function m0(e){"@babel/helpers - typeof";return m0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m0(e)}function u8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function xO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u8(Object(n),!0).forEach(function(s){yFe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u8(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function yFe(e,t,n){return t=bFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bFe(e){var t=wFe(e,"string");return m0(t)=="symbol"?t:t+""}function wFe(e,t){if(m0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(m0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Op={widthCache:{},cacheCount:0},jFe=2e3,NFe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},m8="recharts_measurement_span";function SFe(e){var t=xO({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var cb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Rc.isSsr)return{width:0,height:0};var s=SFe(n),a=JSON.stringify({text:t,copyStyle:s});if(Op.widthCache[a])return Op.widthCache[a];try{var i=document.getElementById(m8);i||(i=document.createElement("span"),i.setAttribute("id",m8),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=xO(xO({},NFe),s);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Op.widthCache[a]=c,++Op.cacheCount>jFe&&(Op.cacheCount=0,Op.widthCache={}),c}catch{return{width:0,height:0}}},_Fe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function h0(e){"@babel/helpers - typeof";return h0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h0(e)}function cS(e,t){return AFe(e)||EFe(e,t)||kFe(e,t)||CFe()}function CFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1125In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kFe(e,t){if(e){if(typeof e=="string")return h8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h8(e,t)}}function h8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function EFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function AFe(e){if(Array.isArray(e))return e}function TFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f8(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,OFe(s.key),s)}}function RFe(e,t,n){return t&&f8(e.prototype,t),n&&f8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OFe(e){var t=PFe(e,"string");return h0(t)=="symbol"?t:t+""}function PFe(e,t){if(h0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(h0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var p8=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,x8=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DFe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,MFe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Ure={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},IFe=Object.keys(Ure),cx="NaN";function LFe(e,t){return e*Ure[t]}var Lj=function(){function e(t,n){TFe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!DFe.test(n)&&(this.num=NaN,this.unit=""),IFe.includes(n)&&(this.num=LFe(t,n),this.unit="px")}return RFe(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var s,a=(s=MFe.exec(n))!==null&&s!==void 0?s:[],i=cS(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function Fre(e){if(e.includes(cx))return cx;for(var t=e;t.includes("*")||t.includes("/");){var n,s=(n=p8.exec(t))!==null&&n!==void 0?n:[],a=cS(s,4),i=a[1],o=a[2],l=a[3],c=Lj.parse(i??""),d=Lj.parse(l??""),u=o==="*"?c.multiply(d):c.divide(d);if(u.isNaN())return cx;t=t.replace(p8,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var m,f=(m=x8.exec(t))!==null&&m!==void 0?m:[],p=cS(f,4),x=p[1],g=p[2],v=p[3],y=Lj.parse(x??""),b=Lj.parse(v??""),w=g==="+"?y.add(b):y.subtract(b);if(w.isNaN())return cx;t=t.replace(x8,w.toString())}return t}var g8=/\(([^()]*)\)/;function $Fe(e){for(var t=e;t.includes("(");){var n=g8.exec(t),s=cS(n,2),a=s[1];t=t.replace(g8,Fre(a))}return t}function VFe(e){var t=e.replace(/\s+/g,"");return t=$Fe(t),t=Fre(t),t}function UFe(e){try{return VFe(e)}catch{return cx}}function RE(e){var t=UFe(e.slice(5,-1));return t===cx?"":t}var FFe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],BFe=["dx","dy","angle","className","breakAll"];function gO(){return gO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},gO.apply(this,arguments)}function v8(e,t){if(e==null)return{};var n=zFe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function zFe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function y8(e,t){return YFe(e)||WFe(e,t)||HFe(e,t)||qFe()}function qFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1126In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HFe(e,t){if(e){if(typeof e=="string")return b8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b8(e,t)}}function b8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function WFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function YFe(e){if(Array.isArray(e))return e}var Bre=/[ \f\n\r\t\v\u2028\u2029]+/,zre=function(t){var n=t.children,s=t.breakAll,a=t.style;try{var i=[];Rr(n)||(s?i=n.toString().split(""):i=n.toString().split(Bre));var o=i.map(function(c){return{word:c,width:cb(c,a).width}}),l=s?0:cb(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},GFe=function(t,n,s,a,i){var o=t.maxLines,l=t.children,c=t.style,d=t.breakAll,u=xt(o),m=l,f=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(U,O){var M=O.word,$=O.width,I=U[U.length-1];if(I&&(a==null||i||I.width+$+s<Number(a)))I.words.push(M),I.width+=$+s;else{var B={words:[M],width:$};U.push(B)}return U},[])},p=f(n),x=function(V){return V.reduce(function(U,O){return U.width>O.width?U:O})};if(!u)return p;for(var g="…",v=function(V){var U=m.slice(0,V),O=zre({breakAll:d,style:c,children:U+g}).wordsWithComputedWidth,M=f(O),$=M.length>o||x(M).width>Number(a);return[$,M]},y=0,b=m.length-1,w=0,S;y<=b&&w<=m.length-1;){var j=Math.floor((y+b)/2),N=j-1,_=v(N),C=y8(_,2),k=C[0],E=C[1],R=v(j),T=y8(R,1),D=T[0];if(!k&&!D&&(y=j+1),k&&D&&(b=j-1),!k&&D){S=E;break}w++}return S||p},w8=function(t){var n=Rr(t)?[]:t.toString().split(Bre);return[{words:n}]},KFe=function(t){var n=t.width,s=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((n||s)&&!Rc.isSsr){var c,d,u=zre({breakAll:o,children:a,style:i});
1126if(u){var m=u.wordsWithComputedWidth,f=u.spaceWidth;c=m,d=f}else return w8(a);return GFe({breakAll:o,children:a,maxLines:l,style:i},c,d,n,s)}return w8(a)},j8="#808080",qf=function(t){var n=t.x,s=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,d=c===void 0?"0.71em":c,u=t.scaleToFit,m=u===void 0?!1:u,f=t.textAnchor,p=f===void 0?"start":f,x=t.verticalAnchor,g=x===void 0?"end":x,v=t.fill,y=v===void 0?j8:v,b=v8(t,FFe),w=h.useMemo(function(){return KFe({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:m,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,m,b.style,b.width]),S=b.dx,j=b.dy,N=b.angle,_=b.className,C=b.breakAll,k=v8(b,BFe);if(!Da(s)||!Da(i))return null;var E=s+(xt(S)?S:0),R=i+(xt(j)?j:0),T;switch(g){case"start":T=RE("calc(".concat(d,")"));break;case"middle":T=RE("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(d," / 2))"));break;default:T=RE("calc(".concat(w.length-1," * -").concat(l,")"));break}var D=[];if(m){var A=w[0].width,V=b.width;D.push("scale(".concat((xt(V)?V/A:1)/A,")"))}return N&&D.push("rotate(".concat(N,", ").concat(E,", ").concat(R,")")),D.length&&(k.transform=D.join(" ")),Y.createElement("text",gO({},ir(k,!0),{x:E,y:R,className:Tr("recharts-text",_),textAnchor:p,fill:y.includes("url")?j8:y}),w.map(function(U,O){var M=U.words.join(C?"":" ");return Y.createElement("tspan",{x:E,dy:O===0?T:l,key:"".concat(M,"-").concat(O)},M)}))};function Em(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function XFe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function SM(e){let t,n,s;e.length!==2?(t=Em,n=(l,c)=>Em(e(l),c),s=(l,c)=>e(l)-c):(t=e===Em||e===XFe?e:ZFe,n=e,s=e);function a(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const m=d+u>>>1;n(l[m],c)<0?d=m+1:u=m}while(d<u)}return d}function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const m=d+u>>>1;n(l[m],c)<=0?d=m+1:u=m}while(d<u)}return d}function o(l,c,d=0,u=l.length){const m=a(l,c,d,u-1);return m>d&&s(l[m-1],c)>-s(l[m],c)?m-1:m}return{left:a,center:o,right:i}}function ZFe(){return 0}function qre(e){return e===null?NaN:+e}function*QFe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const JFe=SM(Em),Ow=JFe.right;SM(qre).center;class N8 extends Map{constructor(t,n=rBe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[s,a]of t)this.set(s,a)}get(t){return super.get(S8(this,t))}has(t){return super.has(S8(this,t))}set(t,n){return super.set(eBe(this,t),n)}delete(t){return super.delete(tBe(this,t))}}function S8({_intern:e,_key:t},n){const s=t(n);return e.has(s)?e.get(s):n}function eBe({_intern:e,_key:t},n){const s=t(n);return e.has(s)?e.get(s):(e.set(s,n),n)}function tBe({_intern:e,_key:t},n){const s=t(n);return e.has(s)&&(n=e.get(s),e.delete(s)),n}function rBe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nBe(e=Em){if(e===Em)return Hre;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const s=e(t,n);return s||s===0?s:(e(n,n)===0)-(e(t,t)===0)}}function Hre(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const sBe=Math.sqrt(50),aBe=Math.sqrt(10),iBe=Math.sqrt(2);function dS(e,t,n){const s=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(s)),i=s/Math.pow(10,a),o=i>=sBe?10:i>=aBe?5:i>=iBe?2:1;let l,c,d;return a<0?(d=Math.pow(10,-a)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,a)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=n&&n<2?dS(e,t,n*2):[l,c,d]}function vO(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const s=t<e,[a,i,o]=s?dS(t,e,n):dS(e,t,n);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(s)if(o<0)for(let d=0;d<l;++d)c[d]=(i-d)/-o;else for(let d=0;d<l;++d)c[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(a+d)/-o;else for(let d=0;d<l;++d)c[d]=(a+d)*o;return c}function yO(e,t,n){return t=+t,e=+e,n=+n,dS(e,t,n)[2]}function bO(e,t,n){t=+t,e=+e,n=+n;const s=t<e,a=s?yO(t,e,n):yO(e,t,n);return(s?-1:1)*(a<0?1/-a:a)}function _8(e,t){let n;for(const s of e)s!=null&&(n<s||n===void 0&&s>=s)&&(n=s);return n}function C8(e,t){let n;for(const s of e)s!=null&&(n>s||n===void 0&&s>=s)&&(n=s);return n}function Wre(e,t,n=0,s=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),s=Math.floor(Math.min(e.length-1,s)),!(n<=t&&t<=s))return e;for(a=a===void 0?Hre:nBe(a);s>n;){if(s-n>600){const c=s-n+1,d=t-n+1,u=Math.log(c),m=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*m*(c-m)/c)*(d-c/2<0?-1:1),p=Math.max(n,Math.floor(t-d*m/c+f)),x=Math.min(s,Math.floor(t+(c-d)*m/c+f));Wre(e,t,p,x,a)}const i=e[t];let o=n,l=s;for(my(e,n,t),a(e[s],i)>0&&my(e,n,s);o<l;){for(my(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[n],i)===0?my(e,n,l):(++l,my(e,l,s)),l<=t&&(n=l+1),t<=l&&(s=l-1)}return e}
vendor: 11,039 bytes, line 1126
1126function my(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function oBe(e,t,n){if(e=Float64Array.from(QFe(e)),!(!(s=e.length)||isNaN(t=+t))){if(t<=0||s<2)return C8(e);if(t>=1)return _8(e);var s,a=(s-1)*t,i=Math.floor(a),o=_8(Wre(e,i).subarray(0,i+1)),l=C8(e.subarray(i+1));return o+(l-o)*(a-i)}}function lBe(e,t,n=qre){if(!(!(s=e.length)||isNaN(t=+t))){if(t<=0||s<2)return+n(e[0],0,e);if(t>=1)return+n(e[s-1],s-1,e);var s,a=(s-1)*t,i=Math.floor(a),o=+n(e[i],i,e),l=+n(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function cBe(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++s<a;)i[s]=e+s*n;return i}function yl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function pu(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const wO=Symbol("implicit");function _M(){var e=new N8,t=[],n=[],s=wO;function a(i){let o=e.get(i);if(o===void 0){if(s!==wO)return s;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new N8;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(s=i,a):s},a.copy=function(){return _M(t,n).unknown(s)},yl.apply(a,arguments),a}function f0(){var e=_M().unknown(void 0),t=e.domain,n=e.range,s=0,a=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function m(){var f=t().length,p=a<s,x=p?a:s,g=p?s:a;i=(g-x)/Math.max(1,f-c+d*2),l&&(i=Math.floor(i)),x+=(g-x-i*(f-c))*u,o=i*(1-c),l&&(x=Math.round(x),o=Math.round(o));var v=cBe(f).map(function(y){return x+i*y});return n(p?v.reverse():v)}return e.domain=function(f){return arguments.length?(t(f),m()):t()},e.range=function(f){return arguments.length?([s,a]=f,s=+s,a=+a,m()):[s,a]},e.rangeRound=function(f){return[s,a]=f,s=+s,a=+a,l=!0,m()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(l=!!f,m()):l},e.padding=function(f){return arguments.length?(c=Math.min(1,d=+f),m()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),m()):c},e.paddingOuter=function(f){return arguments.length?(d=+f,m()):d},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),m()):u},e.copy=function(){return f0(t(),[s,a]).round(l).paddingInner(c).paddingOuter(d).align(u)},yl.apply(m(),arguments)}function Yre(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Yre(t())},e}function db(){return Yre(f0.apply(null,arguments).paddingInner(1))}function CM(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Gre(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Pw(){}var p0=.7,uS=1/p0,Ox="\\s*([+-]?\\d+)\\s*",x0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dBe=/^#([0-9a-f]{3,8})$/,uBe=new RegExp(`^rgb\\(${Ox},${Ox},${Ox}\\)$`),mBe=new RegExp(`^rgb\\(${Oc},${Oc},${Oc}\\)$`),hBe=new RegExp(`^rgba\\(${Ox},${Ox},${Ox},${x0}\\)$`),fBe=new RegExp(`^rgba\\(${Oc},${Oc},${Oc},${x0}\\)$`),pBe=new RegExp(`^hsl\\(${x0},${Oc},${Oc}\\)$`),xBe=new RegExp(`^hsla\\(${x0},${Oc},${Oc},${x0}\\)$`),k8={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};CM(Pw,g0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:E8,formatHex:E8,formatHex8:gBe,formatHsl:vBe,formatRgb:A8,toString:A8});function E8(){return this.rgb().formatHex()}function gBe(){return this.rgb().formatHex8()}function vBe(){return Kre(this).formatHsl()}function A8(){return this.rgb().formatRgb()}function g0(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dBe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?T8(t):n===3?new eo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$j(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$j(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=uBe.exec(e))?new eo(t[1],t[2],t[3],1):(t=mBe.exec(e))?new eo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hBe.exec(e))?$j(t[1],t[2],t[3],t[4]):(t=fBe.exec(e))?$j(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pBe.exec(e))?P8(t[1],t[2]/100,t[3]/100,1):(t=xBe.exec(e))?P8(t[1],t[2]/100,t[3]/100,t[4]):k8.hasOwnProperty(e)?T8(k8[e]):e==="transparent"?new eo(NaN,NaN,NaN,0):null}function T8(e){return new eo(e>>16&255,e>>8&255,e&255,1)}function $j(e,t,n,s){return s<=0&&(e=t=n=NaN),new eo(e,t,n,s)}function yBe(e){return e instanceof Pw||(e=g0(e)),e?(e=e.rgb(),new eo(e.r,e.g,e.b,e.opacity)):new eo}function jO(e,t,n,s){return arguments.length===1?yBe(e):new eo(e,t,n,s??1)}function eo(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}CM(eo,jO,Gre(Pw,{brighter(e){return e=e==null?uS:Math.pow(uS,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?p0:Math.pow(p0,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new eo(yf(this.r),yf(this.g),yf(this.b),mS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:R8,formatHex:R8,formatHex8:bBe,formatRgb:O8,toString:O8}));function R8(){return`#${Gh(this.r)}${Gh(this.g)}${Gh(this.b)}`}function bBe(){return`#${Gh(this.r)}${Gh(this.g)}${Gh(this.b)}${Gh((isNaN(this.opacity)?1:this.opacity)*255)}`}function O8(){const e=mS(this.opacity);return`${e===1?"rgb(":"rgba("}${yf(this.r)}, ${yf(this.g)}, ${yf(this.b)}${e===1?")":`, ${e})`}`}function mS(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gh(e){return e=yf(e),(e<16?"0":"")+e.toString(16)}function P8(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $l(e,t,n,s)}function Kre(e){if(e instanceof $l)return new $l(e.h,e.s,e.l,e.opacity);if(e instanceof Pw||(e=g0(e)),!e)return new $l;if(e instanceof $l)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,a=Math.min(t,n,s),i=Math.max(t,n,s),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(n-s)/l+(n<s)*6:n===i?o=(s-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new $l(o,l,c,e.opacity)}function wBe(e,t,n,s){return arguments.length===1?Kre(e):new $l(e,t,n,s??1)}function $l(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}CM($l,wBe,Gre(Pw,{brighter(e){return e=e==null?uS:Math.pow(uS,e),new $l(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?p0:Math.pow(p0,e),new $l(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,a=2*n-s;return new eo(OE(e>=240?e-240:e+120,a,s),OE(e,a,s),OE(e<120?e+240:e-120,a,s),this.opacity)},clamp(){return new $l(D8(this.h),Vj(this.s),Vj(this.l),mS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=mS(this.opacity);return`${e===1?"hsl(":"hsla("}${D8(this.h)}, ${Vj(this.s)*100}%, ${Vj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D8(e){return e=(e||0)%360,e<0?e+360:e}function Vj(e){return Math.max(0,Math.min(1,e||0))}function OE(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const kM=e=>()=>e;function jBe(e,t){return function(n){return e+n*t}}function NBe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function SBe(e){return(e=+e)==1?Xre:function(t,n){return n-t?NBe(t,n,e):kM(isNaN(t)?n:t)}}function Xre(e,t){var n=t-e;return n?jBe(e,n):kM(isNaN(e)?t:e)}const M8=function e(t){var n=SBe(t);function s(a,i){var o=n((a=jO(a)).r,(i=jO(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),d=Xre(a.opacity,i.opacity);return function(u){return a.r=o(u),a.g=l(u),a.b=c(u),a.opacity=d(u),a+""}}return s.gamma=e,s}(1);function _Be(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),a;return function(i){for(a=0;a<n;++a)s[a]=e[a]*(1-i)+t[a]*i;return s}}function CBe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kBe(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,a=new Array(s),i=new Array(n),o;for(o=0;o<s;++o)a[o]=Vv(e[o],t[o]);for(;o<n;
vendor: 9,983 bytes, line 1126
1126++o)i[o]=t[o];return function(l){for(o=0;o<s;++o)i[o]=a[o](l);return i}}function EBe(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function hS(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ABe(e,t){var n={},s={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Vv(e[a],t[a]):s[a]=t[a];return function(i){for(a in n)s[a]=n[a](i);return s}}var NO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,PE=new RegExp(NO.source,"g");function TBe(e){return function(){return e}}function RBe(e){return function(t){return e(t)+""}}function OBe(e,t){var n=NO.lastIndex=PE.lastIndex=0,s,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(s=NO.exec(e))&&(a=PE.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(s=s[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:hS(s,a)})),n=PE.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?RBe(c[0].x):TBe(t):(t=c.length,function(d){for(var u=0,m;u<t;++u)l[(m=c[u]).i]=m.x(d);return l.join("")})}function Vv(e,t){var n=typeof t,s;return t==null||n==="boolean"?kM(t):(n==="number"?hS:n==="string"?(s=g0(t))?(t=s,M8):OBe:t instanceof g0?M8:t instanceof Date?EBe:CBe(t)?_Be:Array.isArray(t)?kBe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ABe:hS)(e,t)}function EM(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function PBe(e,t){t===void 0&&(t=e,e=Vv);for(var n=0,s=t.length-1,a=t[0],i=new Array(s<0?0:s);n<s;)i[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(s-1,Math.floor(o*=s)));return i[l](o-l)}}function DBe(e){return function(){return e}}function fS(e){return+e}var I8=[0,1];function Ii(e){return e}function SO(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:DBe(isNaN(t)?NaN:.5)}function MBe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(s){return Math.max(e,Math.min(t,s))}}function IBe(e,t,n){var s=e[0],a=e[1],i=t[0],o=t[1];return a<s?(s=SO(a,s),i=n(o,i)):(s=SO(s,a),i=n(i,o)),function(l){return i(s(l))}}function LBe(e,t,n){var s=Math.min(e.length,t.length)-1,a=new Array(s),i=new Array(s),o=-1;for(e[s]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<s;)a[o]=SO(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(l){var c=Ow(e,l,1,s)-1;return i[c](a[c](l))}}function Dw(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Y2(){var e=I8,t=I8,n=Vv,s,a,i,o=Ii,l,c,d;function u(){var f=Math.min(e.length,t.length);return o!==Ii&&(o=MBe(e[0],e[f-1])),l=f>2?LBe:IBe,c=d=null,m}function m(f){return f==null||isNaN(f=+f)?i:(c||(c=l(e.map(s),t,n)))(s(o(f)))}return m.invert=function(f){return o(a((d||(d=l(t,e.map(s),hS)))(f)))},m.domain=function(f){return arguments.length?(e=Array.from(f,fS),u()):e.slice()},m.range=function(f){return arguments.length?(t=Array.from(f),u()):t.slice()},m.rangeRound=function(f){return t=Array.from(f),n=EM,u()},m.clamp=function(f){return arguments.length?(o=f?!0:Ii,u()):o!==Ii},m.interpolate=function(f){return arguments.length?(n=f,u()):n},m.unknown=function(f){return arguments.length?(i=f,m):i},function(f,p){return s=f,a=p,u()}}function AM(){return Y2()(Ii,Ii)}function $Be(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pS(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}function kg(e){return e=pS(Math.abs(e)),e?e[1]:NaN}function VBe(e,t){return function(n,s){for(var a=n.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>s&&(l=Math.max(1,s-c)),i.push(n.substring(a-=l,a+l)),!((c+=l+1)>s));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function UBe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var FBe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function v0(e){if(!(t=FBe.exec(e)))throw new Error("invalid format: "+e);var t;return new TM({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}v0.prototype=TM.prototype;function TM(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}TM.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function BBe(e){e:for(var t=e.length,n=1,s=-1,a;n<t;++n)switch(e[n]){case".":s=a=n;break;case"0":s===0&&(s=n),a=n;break;default:if(!+e[n])break e;s>0&&(s=0);break}return s>0?e.slice(0,s)+e.slice(a+1):e}var Zre;function zBe(e,t){var n=pS(e,t);if(!n)return e+"";var s=n[0],a=n[1],i=a-(Zre=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+pS(e,Math.max(0,t+i-1))[0]}function L8(e,t){var n=pS(e,t);if(!n)return e+"";var s=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+s:s.length>a+1?s.slice(0,a+1)+"."+s.slice(a+1):s+new Array(a-s.length+2).join("0")}const $8={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$Be,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>L8(e*100,t),r:L8,s:zBe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function V8(e){return e}var U8=Array.prototype.map,F8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qBe(e){var t=e.grouping===void 0||e.thousands===void 0?V8:VBe(U8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",s=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?V8:UBe(U8.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(m){m=v0(m);var f=m.fill,p=m.align,x=m.sign,g=m.symbol,v=m.zero,y=m.width,b=m.comma,w=m.precision,S=m.trim,j=m.type;j==="n"?(b=!0,j="g"):$8[j]||(w===void 0&&(w=12),S=!0,j="g"),(v||f==="0"&&p==="=")&&(v=!0,f="0",p="=");var N=g==="$"?n:g==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",_=g==="$"?s:/[%p]/.test(j)?o:"",C=$8[j],k=/[defgprs%]/.test(j);w=w===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function E(R){var T=N,D=_,A,V,U;if(j==="c")D=C(R)+D,R="";else{R=+R;var O=R<0||1/R<0;if(R=isNaN(R)?c:C(Math.abs(R),w),S&&(R=BBe(R)),O&&+R==0&&x!=="+"&&(O=!1),T=(O?x==="("?x:l:x==="-"||x==="("?"":x)+T,D=(j==="s"?F8[8+Zre/3]:"")+D+(O&&x==="("?")":""),k){for(A=-1,V=R.length;++A<V;)if(U=R.charCodeAt(A),48>U||U>57){D=(U===46?a+R.slice(A+1):R.slice(A))+D,R=R.slice(0,A);break}}}b&&!v&&(R=t(R,1/0));var M=T.length+R.length+D.length,$=M<y?new Array(y-M+1).join(f):"";switch(b&&v&&(R=t($+R,$.length?y-D.length:1/0),$=""),p){case"<":R=T+R+D+$;break;case"=":R=T+$+R+D;break;case"^":R=$.slice(0,M=$.length>>1)+T+R+D+$.slice(M);break;default:R=$+T+R+D;break}return i(R)}return E.toString=function(){return m+""},E}function u(m,f){var p=d((m=v0(m),m.type="f",m)),x=Math.max(-8,Math.min(8,Math.floor(kg(f)/3)))*3,g=Math.pow(10,-x),v=F8[8+x/3];return function(y){return p(g*y)+v}}return{format:d,formatPrefix:u}}var Uj,RM,Qre;HBe({thousands:",",grouping:[3],currency:["$",""]});function HBe(e){return Uj=qBe(e),RM=Uj.format,Qre=Uj.formatPrefix,Uj}function WBe(e){return Math.max(0,-kg(Math.abs(e)))}function YBe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(kg(t)/3)))*3-kg(Math.abs(e)))}function GBe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,kg(t)-kg(e))+1}function Jre(e,t,n,s){var a=bO(e,t,n),i;switch(s=v0(s??",f"),s.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return s.precision==null&&!isNaN(i=YBe(a,o))&&(s.precision=i),Qre(s,o)}case"":case"e":case"g":case"p":case"r":{s.precision==null&&!isNaN(i=GBe(a,Math.max(Math.abs(e),Math.abs(t))))&&(s.precision=i-(s.type==="e"));break}case"f":case"%":{s.precision==null&&!isNaN(i=WBe(a))&&(s.precision=i-(s.type==="%")*2);break}}return RM(s)}function hh(e){var t=e.domain;return e.ticks=function(n){var s=t();return vO(s[0],s[s.length-1],n??10)},e.tickFormat=function(n,s){var a=t();return Jre(a[0],a[a.length-1],n??10,s)},e.nice=function(n){n==null&&(n=10);var s=t(),a=0,i=s.length-1,o=s[a],l=s[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=a,a=i,i=d);u-- >0;){if(d=yO(o,l,n),d===c)return s[a]=o,s[i]=l,t(s);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function xS(){var e=AM();return e.copy=function(){return Dw(e,xS())},yl.apply(e,arguments),hh(e)}function ene(e){var t;function n(s){return s==null||isNaN(s=+s)?t:s}return n.invert=n,n.domain=n.range=function(s){return arguments.length?(e=Array.from(s,fS),n):e.slice()},n.unknown=function(s){return arguments.length?(t=s,n):t},n.copy=function(){return ene(e).unknown(t)},e=arguments.length?Array.from(e,fS):[0,1],hh(n)}function tne(e,t){e=e.slice();var n=0,s=e.length-1,a=e[n],i=e[s],o;return i<a&&(o=n,n=s,s=o,o=a,a=i,i=o),e[n]=t.floor(a),e[s]=t.ceil(i),e}function B8(e){return Math.log(e)}function z8(e){return Math.exp(e)}function KBe(e){return-Math.log(-e)}function XBe(e){return-Math.exp(-e)}function ZBe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function QBe(e){return e===10?ZBe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function JBe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function q8(e){return(t,n)=>-e(-t,n)}function OM(e){const t=e(B8,z8),n=t.domain;let s=10,a,i;
1126function o(){return a=JBe(s),i=QBe(s),n()[0]<0?(a=q8(a),i=q8(i),e(KBe,XBe)):e(B8,z8),t}return t.base=function(l){return arguments.length?(s=+l,o()):s},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let d=c[0],u=c[c.length-1];const m=u<d;m&&([d,u]=[u,d]);let f=a(d),p=a(u),x,g;const v=l==null?10:+l;let y=[];if(!(s%1)&&p-f<v){if(f=Math.floor(f),p=Math.ceil(p),d>0){for(;f<=p;++f)for(x=1;x<s;++x)if(g=f<0?x/i(-f):x*i(f),!(g<d)){if(g>u)break;y.push(g)}}else for(;f<=p;++f)for(x=s-1;x>=1;--x)if(g=f>0?x/i(-f):x*i(f),!(g<d)){if(g>u)break;y.push(g)}y.length*2<v&&(y=vO(d,u,v))}else y=vO(f,p,Math.min(p-f,v)).map(i);return m?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=s===10?"s":","),typeof c!="function"&&(!(s%1)&&(c=v0(c)).precision==null&&(c.trim=!0),c=RM(c)),l===1/0)return c;const d=Math.max(1,s*l/t.ticks().length);return u=>{let m=u/i(Math.round(a(u)));return m*s<s-.5&&(m*=s),m<=d?c(u):""}},t.nice=()=>n(tne(n(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function rne(){const e=OM(Y2()).domain([1,10]);return e.copy=()=>Dw(e,rne()).base(e.base()),yl.apply(e,arguments),e}function H8(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function W8(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PM(e){var t=1,n=e(H8(t),W8(t));return n.constant=function(s){return arguments.length?e(H8(t=+s),W8(t)):t},hh(n)}function nne(){var e=PM(Y2());return e.copy=function(){return Dw(e,nne()).constant(e.constant())},yl.apply(e,arguments)}function Y8(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eze(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function tze(e){return e<0?-e*e:e*e}function DM(e){var t=e(Ii,Ii),n=1;function s(){return n===1?e(Ii,Ii):n===.5?e(eze,tze):e(Y8(n),Y8(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,s()):n},hh(t)}function MM(){var e=DM(Y2());return e.copy=function(){return Dw(e,MM()).exponent(e.exponent())},yl.apply(e,arguments),e}function rze(){return MM.apply(null,arguments).exponent(.5)}function G8(e){return Math.sign(e)*e*e}function nze(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function sne(){var e=AM(),t=[0,1],n=!1,s;function a(i){var o=nze(e(i));return isNaN(o)?s:n?Math.round(o):o}return a.invert=function(i){return e.invert(G8(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,fS)).map(G8)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(s=i,a):s},a.copy=function(){return sne(e.domain(),t).round(n).clamp(e.clamp()).unknown(s)},yl.apply(a,arguments),hh(a)}function ane(){var e=[],t=[],n=[],s;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=lBe(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?s:t[Ow(n,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Em),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(s=o,i):s},i.quantiles=function(){return n.slice()},i.copy=function(){return ane().domain(e).range(t).unknown(s)},yl.apply(i,arguments)}function ine(){var e=0,t=1,n=1,s=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[Ow(s,c,0,n)]:i}function l(){var c=-1;for(s=new Array(n);++c<n;)s[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var d=a.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,s[0]]:d>=n?[s[n-1],t]:[s[d-1],s[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return s.slice()},o.copy=function(){return ine().domain([e,t]).range(a).unknown(i)},yl.apply(hh(o),arguments)}function one(){var e=[.5],t=[0,1],n,s=1;function a(i){return i!=null&&i<=i?t[Ow(e,i,0,s)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),s=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),s=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return one().domain(e).range(t).unknown(n)},yl.apply(a,arguments)}const DE=new Date,ME=new Date;function Ia(e,t,n,s){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d<i&&i<o);return c},a.filter=i=>Ia(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(DE.setTime(+i),ME.setTime(+o),e(DE),e(ME),Math.floor(n(DE,ME))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(s?o=>s(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const gS=Ia(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gS.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ia(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):gS);gS.range;const Sd=1e3,il=Sd*60,_d=il*60,Qd=_d*24,IM=Qd*7,K8=Qd*30,IE=Qd*365,Kh=Ia(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Sd)},(e,t)=>(t-e)/Sd,e=>e.getUTCSeconds());Kh.range;const LM=Ia(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sd)},(e,t)=>{e.setTime(+e+t*il)},(e,t)=>(t-e)/il,e=>e.getMinutes());LM.range;const $M=Ia(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*il)},(e,t)=>(t-e)/il,e=>e.getUTCMinutes());$M.range;const VM=Ia(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sd-e.getMinutes()*il)},(e,t)=>{e.setTime(+e+t*_d)},(e,t)=>(t-e)/_d,e=>e.getHours());VM.range;const UM=Ia(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_d)},(e,t)=>(t-e)/_d,e=>e.getUTCHours());UM.range;const Mw=Ia(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*il)/Qd,e=>e.getDate()-1);Mw.range;
vendor: 4,426 bytes, line 1126
1126const G2=Ia(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qd,e=>e.getUTCDate()-1);G2.range;const lne=Ia(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qd,e=>Math.floor(e/Qd));lne.range;function cp(e){return Ia(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*il)/IM)}const K2=cp(0),vS=cp(1),sze=cp(2),aze=cp(3),Eg=cp(4),ize=cp(5),oze=cp(6);K2.range;vS.range;sze.range;aze.range;Eg.range;ize.range;oze.range;function dp(e){return Ia(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/IM)}const X2=dp(0),yS=dp(1),lze=dp(2),cze=dp(3),Ag=dp(4),dze=dp(5),uze=dp(6);X2.range;yS.range;lze.range;cze.range;Ag.range;dze.range;uze.range;const FM=Ia(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());FM.range;const BM=Ia(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());BM.range;const Jd=Ia(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Jd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ia(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Jd.range;const eu=Ia(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());eu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ia(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});eu.range;function cne(e,t,n,s,a,i){const o=[[Kh,1,Sd],[Kh,5,5*Sd],[Kh,15,15*Sd],[Kh,30,30*Sd],[i,1,il],[i,5,5*il],[i,15,15*il],[i,30,30*il],[a,1,_d],[a,3,3*_d],[a,6,6*_d],[a,12,12*_d],[s,1,Qd],[s,2,2*Qd],[n,1,IM],[t,1,K8],[t,3,3*K8],[e,1,IE]];function l(d,u,m){const f=u<d;f&&([d,u]=[u,d]);const p=m&&typeof m.range=="function"?m:c(d,u,m),x=p?p.range(d,+u+1):[];return f?x.reverse():x}function c(d,u,m){const f=Math.abs(u-d)/m,p=SM(([,,v])=>v).right(o,f);if(p===o.length)return e.every(bO(d/IE,u/IE,m));if(p===0)return gS.every(Math.max(bO(d,u,m),1));const[x,g]=o[f/o[p-1][2]<o[p][2]/f?p-1:p];return x.every(g)}return[l,c]}const[mze,hze]=cne(eu,BM,X2,lne,UM,$M),[fze,pze]=cne(Jd,FM,K2,Mw,VM,LM);function LE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $E(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function hy(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function xze(e){var t=e.dateTime,n=e.date,s=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=fy(a),u=py(a),m=fy(i),f=py(i),p=fy(o),x=py(o),g=fy(l),v=py(l),y=fy(c),b=py(c),w={a:O,A:M,b:$,B:I,c:null,d:tF,e:tF,f:Vze,g:Kze,G:Zze,H:Ize,I:Lze,j:$ze,L:dne,m:Uze,M:Fze,p:B,q:K,Q:sF,s:aF,S:Bze,u:zze,U:qze,V:Hze,w:Wze,W:Yze,x:null,X:null,y:Gze,Y:Xze,Z:Qze,"%":nF},S={a:Z,A:q,b:H,B:X,c:null,d:rF,e:rF,f:r9e,g:m9e,G:f9e,H:Jze,I:e9e,j:t9e,L:mne,m:n9e,M:s9e,p:G,q:ee,Q:sF,s:aF,S:a9e,u:i9e,U:o9e,V:l9e,w:c9e,W:d9e,x:null,X:null,y:u9e,Y:h9e,Z:p9e,"%":nF},j={a:E,A:R,b:T,B:D,c:A,d:J8,e:J8,f:Oze,g:Q8,G:Z8,H:eF,I:eF,j:Eze,L:Rze,m:kze,M:Aze,p:k,q:Cze,Q:Dze,s:Mze,S:Tze,u:wze,U:jze,V:Nze,w:bze,W:Sze,x:V,X:U,y:Q8,Y:Z8,Z:_ze,"%":Pze};w.x=N(n,w),w.X=N(s,w),w.c=N(t,w),S.x=N(n,S),S.X=N(s,S),S.c=N(t,S);function N(re,W){return function(Q){var L=[],te=-1,ae=0,ne=re.length,se,ue,Ne;for(Q instanceof Date||(Q=new Date(+Q));++te<ne;)re.charCodeAt(te)===37&&(L.push(re.slice(ae,te)),(ue=X8[se=re.charAt(++te)])!=null?se=re.charAt(++te):ue=se==="e"?" ":"0",(Ne=W[se])&&(se=Ne(Q,ue)),L.push(se),ae=te+1);return L.push(re.slice(ae,te)),L.join("")}}function _(re,W){return function(Q){var L=hy(1900,void 0,1),te=C(L,re,Q+="",0),ae,ne;if(te!=Q.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));
vendor: 7,174 bytes, line 1126
1126if(W&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(ae=$E(hy(L.y,0,1)),ne=ae.getUTCDay(),ae=ne>4||ne===0?yS.ceil(ae):yS(ae),ae=G2.offset(ae,(L.V-1)*7),L.y=ae.getUTCFullYear(),L.m=ae.getUTCMonth(),L.d=ae.getUTCDate()+(L.w+6)%7):(ae=LE(hy(L.y,0,1)),ne=ae.getDay(),ae=ne>4||ne===0?vS.ceil(ae):vS(ae),ae=Mw.offset(ae,(L.V-1)*7),L.y=ae.getFullYear(),L.m=ae.getMonth(),L.d=ae.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),ne="Z"in L?$E(hy(L.y,0,1)).getUTCDay():LE(hy(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(ne+5)%7:L.w+L.U*7-(ne+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,$E(L)):LE(L)}}function C(re,W,Q,L){for(var te=0,ae=W.length,ne=Q.length,se,ue;te<ae;){if(L>=ne)return-1;if(se=W.charCodeAt(te++),se===37){if(se=W.charAt(te++),ue=j[se in X8?W.charAt(te++):se],!ue||(L=ue(re,Q,L))<0)return-1}else if(se!=Q.charCodeAt(L++))return-1}return L}function k(re,W,Q){var L=d.exec(W.slice(Q));return L?(re.p=u.get(L[0].toLowerCase()),Q+L[0].length):-1}function E(re,W,Q){var L=p.exec(W.slice(Q));return L?(re.w=x.get(L[0].toLowerCase()),Q+L[0].length):-1}function R(re,W,Q){var L=m.exec(W.slice(Q));return L?(re.w=f.get(L[0].toLowerCase()),Q+L[0].length):-1}function T(re,W,Q){var L=y.exec(W.slice(Q));return L?(re.m=b.get(L[0].toLowerCase()),Q+L[0].length):-1}function D(re,W,Q){var L=g.exec(W.slice(Q));return L?(re.m=v.get(L[0].toLowerCase()),Q+L[0].length):-1}function A(re,W,Q){return C(re,t,W,Q)}function V(re,W,Q){return C(re,n,W,Q)}function U(re,W,Q){return C(re,s,W,Q)}function O(re){return o[re.getDay()]}function M(re){return i[re.getDay()]}function $(re){return c[re.getMonth()]}function I(re){return l[re.getMonth()]}function B(re){return a[+(re.getHours()>=12)]}function K(re){return 1+~~(re.getMonth()/3)}function Z(re){return o[re.getUTCDay()]}function q(re){return i[re.getUTCDay()]}function H(re){return c[re.getUTCMonth()]}function X(re){return l[re.getUTCMonth()]}function G(re){return a[+(re.getUTCHours()>=12)]}function ee(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var W=N(re+="",w);return W.toString=function(){return re},W},parse:function(re){var W=_(re+="",!1);return W.toString=function(){return re},W},utcFormat:function(re){var W=N(re+="",S);return W.toString=function(){return re},W},utcParse:function(re){var W=_(re+="",!0);return W.toString=function(){return re},W}}}var X8={"-":"",_:" ",0:"0"},Xa=/^\s*\d+/,gze=/^%/,vze=/[\\^$*+?|[\]().{}]/g;function xn(e,t,n){var s=e<0?"-":"",a=(s?-e:e)+"",i=a.length;return s+(i<n?new Array(n-i+1).join(t)+a:a)}function yze(e){return e.replace(vze,"\\$&")}function fy(e){return new RegExp("^(?:"+e.map(yze).join("|")+")","i")}function py(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bze(e,t,n){var s=Xa.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function wze(e,t,n){var s=Xa.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function jze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function Nze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function Sze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function Z8(e,t,n){var s=Xa.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function Q8(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function _ze(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function Cze(e,t,n){var s=Xa.exec(t.slice(n,n+1));return s?(e.q=s[0]*3-3,n+s[0].length):-1}function kze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function J8(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function Eze(e,t,n){var s=Xa.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function eF(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function Aze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function Tze(e,t,n){var s=Xa.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function Rze(e,t,n){var s=Xa.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function Oze(e,t,n){var s=Xa.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function Pze(e,t,n){var s=gze.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function Dze(e,t,n){var s=Xa.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function Mze(e,t,n){var s=Xa.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function tF(e,t){return xn(e.getDate(),t,2)}function Ize(e,t){return xn(e.getHours(),t,2)}function Lze(e,t){return xn(e.getHours()%12||12,t,2)}function $ze(e,t){return xn(1+Mw.count(Jd(e),e),t,3)}function dne(e,t){return xn(e.getMilliseconds(),t,3)}function Vze(e,t){return dne(e,t)+"000"}function Uze(e,t){return xn(e.getMonth()+1,t,2)}function Fze(e,t){return xn(e.getMinutes(),t,2)}function Bze(e,t){return xn(e.getSeconds(),t,2)}function zze(e){var t=e.getDay();return t===0?7:t}function qze(e,t){return xn(K2.count(Jd(e)-1,e),t,2)}function une(e){var t=e.getDay();return t>=4||t===0?Eg(e):Eg.ceil(e)}function Hze(e,t){return e=une(e),xn(Eg.count(Jd(e),e)+(Jd(e).getDay()===4),t,2)}function Wze(e){return e.getDay()}function Yze(e,t){return xn(vS.count(Jd(e)-1,e),t,2)}function Gze(e,t){return xn(e.getFullYear()%100,t,2)}function Kze(e,t){return e=une(e),xn(e.getFullYear()%100,t,2)}function Xze(e,t){return xn(e.getFullYear()%1e4,t,4)}function Zze(e,t){var n=e.getDay();return e=n>=4||n===0?Eg(e):Eg.ceil(e),xn(e.getFullYear()%1e4,t,4)}function Qze(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xn(t/60|0,"0",2)+xn(t%60,"0",2)}function rF(e,t){return xn(e.getUTCDate(),t,2)}function Jze(e,t){return xn(e.getUTCHours(),t,2)}function e9e(e,t){return xn(e.getUTCHours()%12||12,t,2)}function t9e(e,t){return xn(1+G2.count(eu(e),e),t,3)}function mne(e,t){return xn(e.getUTCMilliseconds(),t,3)}function r9e(e,t){return mne(e,t)+"000"}function n9e(e,t){return xn(e.getUTCMonth()+1,t,2)}function s9e(e,t){return xn(e.getUTCMinutes(),t,2)}function a9e(e,t){return xn(e.getUTCSeconds(),t,2)}function i9e(e){var t=e.getUTCDay();return t===0?7:t}function o9e(e,t){return xn(X2.count(eu(e)-1,e),t,2)}function hne(e){var t=e.getUTCDay();return t>=4||t===0?Ag(e):Ag.ceil(e)}function l9e(e,t){return e=hne(e),xn(Ag.count(eu(e),e)+(eu(e).getUTCDay()===4),t,2)}function c9e(e){return e.getUTCDay()}function d9e(e,t){return xn(yS.count(eu(e)-1,e),t,2)}function u9e(e,t){return xn(e.getUTCFullYear()%100,t,2)}function m9e(e,t){return e=hne(e),xn(e.getUTCFullYear()%100,t,2)}function h9e(e,t){return xn(e.getUTCFullYear()%1e4,t,4)}function f9e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ag(e):Ag.ceil(e),xn(e.getUTCFullYear()%1e4,t,4)}function p9e(){return"+0000"}function nF(){return"%"}function sF(e){return+e}function aF(e){return Math.floor(+e/1e3)}var Pp,fne,pne;x9e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
1126ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function x9e(e){return Pp=xze(e),fne=Pp.format,Pp.parse,pne=Pp.utcFormat,Pp.utcParse,Pp}function g9e(e){return new Date(e)}function v9e(e){return e instanceof Date?+e:+new Date(+e)}function zM(e,t,n,s,a,i,o,l,c,d){var u=AM(),m=u.invert,f=u.domain,p=d(".%L"),x=d(":%S"),g=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),b=d("%b %d"),w=d("%B"),S=d("%Y");function j(N){return(c(N)<N?p:l(N)<N?x:o(N)<N?g:i(N)<N?v:s(N)<N?a(N)<N?y:b:n(N)<N?w:S)(N)}return u.invert=function(N){return new Date(m(N))},u.domain=function(N){return arguments.length?f(Array.from(N,v9e)):f().map(g9e)},u.ticks=function(N){var _=f();return e(_[0],_[_.length-1],N??10)},u.tickFormat=function(N,_){return _==null?j:d(_)},u.nice=function(N){var _=f();return(!N||typeof N.range!="function")&&(N=t(_[0],_[_.length-1],N??10)),N?f(tne(_,N)):u},u.copy=function(){return Dw(u,zM(e,t,n,s,a,i,o,l,c,d))},u}function y9e(){return yl.apply(zM(fze,pze,Jd,FM,K2,Mw,VM,LM,Kh,fne).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function b9e(){return yl.apply(zM(mze,hze,eu,BM,X2,G2,UM,$M,Kh,pne).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Z2(){var e=0,t=1,n,s,a,i,o=Ii,l=!1,c;function d(m){return m==null||isNaN(m=+m)?c:o(a===0?.5:(m=(i(m)-n)*a,l?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t]=m,n=i(e=+e),s=i(t=+t),a=n===s?0:1/(s-n),d):[e,t]},d.clamp=function(m){return arguments.length?(l=!!m,d):l},d.interpolator=function(m){return arguments.length?(o=m,d):o};function u(m){return function(f){var p,x;return arguments.length?([p,x]=f,o=m(p,x),d):[o(0),o(1)]}}return d.range=u(Vv),d.rangeRound=u(EM),d.unknown=function(m){return arguments.length?(c=m,d):c},function(m){return i=m,n=m(e),s=m(t),a=n===s?0:1/(s-n),d}}function fh(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function xne(){var e=hh(Z2()(Ii));return e.copy=function(){return fh(e,xne())},pu.apply(e,arguments)}function gne(){var e=OM(Z2()).domain([1,10]);return e.copy=function(){return fh(e,gne()).base(e.base())},pu.apply(e,arguments)}function vne(){var e=PM(Z2());return e.copy=function(){return fh(e,vne()).constant(e.constant())},pu.apply(e,arguments)}function qM(){var e=DM(Z2());return e.copy=function(){return fh(e,qM()).exponent(e.exponent())},pu.apply(e,arguments)}function w9e(){return qM.apply(null,arguments).exponent(.5)}function yne(){var e=[],t=Ii;function n(s){if(s!=null&&!isNaN(s=+s))return t((Ow(e,s,1)-1)/(e.length-1))}return n.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Em),n},n.interpolator=function(s){return arguments.length?(t=s,n):t},n.range=function(){return e.map((s,a)=>t(a/(e.length-1)))},n.quantiles=function(s){return Array.from({length:s+1},(a,i)=>oBe(e,i/s))},n.copy=function(){return yne(t).domain(e)},pu.apply(n,arguments)}function Q2(){var e=0,t=.5,n=1,s=1,a,i,o,l,c,d=Ii,u,m=!1,f;function p(g){return isNaN(g=+g)?f:(g=.5+((g=+u(g))-i)*(s*g<s*i?l:c),d(m?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,n]=g,a=u(e=+e),i=u(t=+t),o=u(n=+n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),s=i<a?-1:1,p):[e,t,n]},p.clamp=function(g){return arguments.length?(m=!!g,p):m},p.interpolator=function(g){return arguments.length?(d=g,p):d};function x(g){return function(v){var y,b,w;return arguments.length?([y,b,w]=v,d=PBe(g,[y,b,w]),p):[d(0),d(.5),d(1)]}}return p.range=x(Vv),p.rangeRound=x(EM),p.unknown=function(g){return arguments.length?(f=g,p):f},function(g){return u=g,a=g(e),i=g(t),o=g(n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),s=i<a?-1:1,p}}function bne(){var e=hh(Q2()(Ii));return e.copy=function(){return fh(e,bne())},pu.apply(e,arguments)}function wne(){var e=OM(Q2()).domain([.1,1,10]);return e.copy=function(){return fh(e,wne()).base(e.base())},pu.apply(e,arguments)}function jne(){var e=PM(Q2());return e.copy=function(){return fh(e,jne()).constant(e.constant())},pu.apply(e,arguments)}function HM(){var e=DM(Q2());return e.copy=function(){return fh(e,HM()).exponent(e.exponent())},pu.apply(e,arguments)}function j9e(){return HM.apply(null,arguments).exponent(.5)}const iF=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:f0,scaleDiverging:bne,scaleDivergingLog:wne,scaleDivergingPow:HM,scaleDivergingSqrt:j9e,scaleDivergingSymlog:jne,scaleIdentity:ene,scaleImplicit:wO,scaleLinear:xS,scaleLog:rne,scaleOrdinal:_M,scalePoint:db,scalePow:MM,scaleQuantile:ane,scaleQuantize:ine,scaleRadial:sne,scaleSequential:xne,scaleSequentialLog:gne,scaleSequentialPow:qM,scaleSequentialQuantile:yne,scaleSequentialSqrt:w9e,scaleSequentialSymlog:vne,scaleSqrt:rze,scaleSymlog:nne,scaleThreshold:one,scaleTime:y9e,scaleUtc:b9e,tickFormat:Jre},Symbol.toStringTag,{value:"Module"}));var N9e=Av;function S9e(e,t,n){for(var s=-1,a=e.length;++s<a;){var i=e[s],o=t(i);if(o!=null&&(l===void 0?o===o&&!N9e(o):n(o,l)))var l=o,c=i}return c}var J2=S9e;function _9e(e,t){return e>t}var Nne=_9e,C9e=J2,k9e=Nne,E9e=$v;function A9e(e){return e&&e.length?C9e(e,E9e,k9e):void 0}var T9e=A9e;const hm=Mn(T9e);function R9e(e,t){return e<t}var Sne=R9e,O9e=J2,P9e=Sne,D9e=$v;function M9e(e){return e&&e.length?O9e(e,D9e,P9e):void 0}var I9e=M9e;const eC=Mn(I9e);var L9e=sM,$9e=mh,V9e=Ore,U9e=io;function F9e(e,t){var n=U9e(e)?L9e:V9e;return n(e,$9e(t))}var B9e=F9e,z9e=Tre,q9e=B9e;function H9e(e,t){return z9e(q9e(e,t),1)}var W9e=H9e;const Y9e=Mn(W9e);var G9e=bM;function K9e(e,t){return G9e(e,t)}var X9e=K9e;const Tg=Mn(X9e);
vendor: 59,918 bytes, lines 1126-1145
1126var Uv=1e9,Z9e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},YM,Rs=!0,fl="[DecimalError] ",bf=fl+"Invalid argument: ",WM=fl+"Exponent out of range: ",Fv=Math.floor,$h=Math.pow,Q9e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jo,Fa=1e7,ps=7,_ne=9007199254740991,bS=Fv(_ne/ps),Vt={};Vt.absoluteValue=Vt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Vt.comparedTo=Vt.cmp=function(e){var t,n,s,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(s=i.d.length,a=e.d.length,t=0,n=s<a?s:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return s===a?0:s>a^i.s<0?1:-1};Vt.decimalPlaces=Vt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ps;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Vt.dividedBy=Vt.div=function(e){return Pd(this,new this.constructor(e))};Vt.dividedToIntegerBy=Vt.idiv=function(e){var t=this,n=t.constructor;return Yn(Pd(t,new n(e),0,1),n.precision)};Vt.equals=Vt.eq=function(e){return!this.cmp(e)};Vt.exponent=function(){return ba(this)};Vt.greaterThan=Vt.gt=function(e){return this.cmp(e)>0};Vt.greaterThanOrEqualTo=Vt.gte=function(e){return this.cmp(e)>=0};Vt.isInteger=Vt.isint=function(){return this.e>this.d.length-2};Vt.isNegative=Vt.isneg=function(){return this.s<0};Vt.isPositive=Vt.ispos=function(){return this.s>0};Vt.isZero=function(){return this.s===0};Vt.lessThan=Vt.lt=function(e){return this.cmp(e)<0};Vt.lessThanOrEqualTo=Vt.lte=function(e){return this.cmp(e)<1};Vt.logarithm=Vt.log=function(e){var t,n=this,s=n.constructor,a=s.precision,i=a+5;if(e===void 0)e=new s(10);else if(e=new s(e),e.s<1||e.eq(jo))throw Error(fl+"NaN");if(n.s<1)throw Error(fl+(n.s?"NaN":"-Infinity"));return n.eq(jo)?new s(0):(Rs=!1,t=Pd(y0(n,i),y0(e,i),i),Rs=!0,Yn(t,a))};Vt.minus=Vt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ene(t,e):Cne(t,(e.s=-e.s,e))};Vt.modulo=Vt.mod=function(e){var t,n=this,s=n.constructor,a=s.precision;if(e=new s(e),!e.s)throw Error(fl+"NaN");return n.s?(Rs=!1,t=Pd(n,e,0,1).times(e),Rs=!0,n.minus(t)):Yn(new s(n),a)};Vt.naturalExponential=Vt.exp=function(){return kne(this)};Vt.naturalLogarithm=Vt.ln=function(){return y0(this)};Vt.negated=Vt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Vt.plus=Vt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Cne(t,e):Ene(t,(e.s=-e.s,e))};Vt.precision=Vt.sd=function(e){var t,n,s,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bf+e);if(t=ba(a)+1,s=a.d.length-1,n=s*ps+1,s=a.d[s],s){for(;s%10==0;s/=10)n--;for(s=a.d[0];s>=10;s/=10)n++}return e&&t>n?t:n};Vt.squareRoot=Vt.sqrt=function(){var e,t,n,s,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(fl+"NaN")}for(e=ba(l),Rs=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=jc(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Fv((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),s=new c(t)):s=new c(a.toString()),n=c.precision,a=o=n+3;;)if(i=s,s=i.plus(Pd(l,i,o+2)).times(.5),jc(i.d).slice(0,o)===(t=jc(s.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Yn(i,n+1,0),i.times(i).eq(l)){s=i;break}}else if(t!="9999")break;o+=4}return Rs=!0,Yn(s,n)};Vt.times=Vt.mul=function(e){var t,n,s,a,i,o,l,c,d,u=this,m=u.constructor,f=u.d,p=(e=new m(e)).d;if(!u.s||!e.s)return new m(0);for(e.s*=u.s,n=u.e+e.e,c=f.length,d=p.length,c<d&&(i=f,f=p,p=i,o=c,c=d,d=o),i=[],o=c+d,s=o;s--;)i.push(0);for(s=d;--s>=0;){for(t=0,a=c+s;a>s;)l=i[a]+p[s]*f[a-s-1]+t,i[a--]=l%Fa|0,t=l/Fa|0;i[a]=(i[a]+t)%Fa|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Rs?Yn(e,m.precision):e};Vt.toDecimalPlaces=Vt.todp=function(e,t){var n=this,s=n.constructor;return n=new s(n),e===void 0?n:(Vc(e,0,Uv),t===void 0?t=s.rounding:Vc(t,0,8),Yn(n,e+ba(n)+1,t))};Vt.toExponential=function(e,t){var n,s=this,a=s.constructor;return e===void 0?n=Hf(s,!0):(Vc(e,0,Uv),t===void 0?t=a.rounding:Vc(t,0,8),s=Yn(new a(s),e+1,t),n=Hf(s,!0,e+1)),n};Vt.toFixed=function(e,t){var n,s,a=this,i=a.constructor;return e===void 0?Hf(a):(Vc(e,0,Uv),t===void 0?t=i.rounding:Vc(t,0,8),s=Yn(new i(a),e+ba(a)+1,t),n=Hf(s.abs(),!1,e+ba(s)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Vt.toInteger=Vt.toint=function(){var e=this,t=e.constructor;return Yn(new t(e),ba(e)+1,t.rounding)};Vt.toNumber=function(){return+this};Vt.toPower=Vt.pow=function(e){var t,n,s,a,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(jo);if(l=new c(l),!l.s){if(e.s<1)throw Error(fl+"Infinity");return l}if(l.eq(jo))return l;if(s=c.precision,e.eq(jo))return Yn(l,s);if(t=e.e,n=e.d.length-1,o=t>=n,i=l.s,o){if((n=u<0?-u:u)<=_ne){for(a=new c(jo),t=Math.ceil(s/ps+4),Rs=!1;n%2&&(a=a.times(l),lF(a.d,t)),n=Fv(n/2),n!==0;)l=l.times(l),lF(l.d,t);return Rs=!0,e.s<0?new c(jo).div(a):Yn(a,s)}}else if(i<0)throw Error(fl+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Rs=!1,a=e.times(y0(l,s+d)),Rs=!0,a=kne(a),a.s=i,a};Vt.toPrecision=function(e,t){var n,s,a=this,i=a.constructor;return e===void 0?(n=ba(a),s=Hf(a,n<=i.toExpNeg||n>=i.toExpPos)):(Vc(e,1,Uv),t===void 0?t=i.rounding:Vc(t,0,8),a=Yn(new i(a),e,t),n=ba(a),s=Hf(a,e<=n||n<=i.toExpNeg,e)),s};Vt.toSignificantDigits=Vt.tosd=function(e,t){var n=this,s=n.constructor;return e===void 0?(e=s.precision,t=s.rounding):(Vc(e,1,Uv),t===void 0?t=s.rounding:Vc(t,0,8)),Yn(new s(n),e,t)};Vt.toString=Vt.valueOf=Vt.val=Vt.toJSON=Vt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ba(e),n=e.constructor;return Hf(e,t<=n.toExpNeg||t>=n.toExpPos)};function Cne(e,t){var n,s,a,i,o,l,c,d,u=e.constructor,m=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Rs?Yn(t,m):t;if(c=e.d,d=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(s=c,i=-i,l=d.length):(s=d,a=o,l=c.length),o=Math.ceil(m/ps),l=o>l?o+1:l+1,i>l&&(i=l,s.length=1),s.reverse();i--;)s.push(0);s.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,s=d,d=c,c=s),n=0;i;)n=(c[--i]=c[i]+d[i]+n)/Fa|0,c[i]%=Fa;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Rs?Yn(t,m):t}function Vc(e,t,n){if(e!==~~e||e<t||e>n)throw Error(bf+e)}function jc(e){var t,n,s,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)s=e[t]+"",n=ps-s.length,n&&(i+=Fu(n)),i+=s;o=e[t],s=o+"",n=ps-s.length,n&&(i+=Fu(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Pd=function(){function e(s,a){var i,o=0,l=s.length;for(s=s.slice();l--;)i=s[l]*a+o,s[l]=i%Fa|0,o=i/Fa|0;return o&&s.unshift(o),s}function t(s,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(s[l]!=a[l]){c=s[l]>a[l]?1:-1;break}return c}function n(s,a,i){for(var o=0;i--;)s[i]-=o,o=s[i]<a[i]?1:0,s[i]=o*Fa+s[i]-a[i];for(;!s[0]&&s.length>1;)s.shift()}return function(s,a,i,o){var l,c,d,u,m,f,p,x,g,v,y,b,w,S,j,N,_,C,k=s.constructor,E=s.s==a.s?1:-1,R=s.d,T=a.d;if(!s.s)return new k(s);if(!a.s)throw Error(fl+"Division by zero");for(c=s.e-a.e,_=T.length,j=R.length,p=new k(E),x=p.d=[],d=0;T[d]==(R[d]||0);)++d;if(T[d]>(R[d]||0)&&--c,i==null?b=i=k.precision:o?b=i+(ba(s)-ba(a))+1:b=i,b<0)return new k(0);if(b=b/ps+2|0,d=0,_==1)for(u=0,T=T[0],b++;(d<j||u)&&b--;d++)w=u*Fa+(R[d]||0),x[d]=w/T|0,u=w%T|0;else{for(u=Fa/(T[0]+1)|0,u>1&&(T=e(T,u),R=e(R,u),_=T.length,j=R.length),S=_,g=R.slice(0,_),v=g.length;v<_;)g[v++]=0;C=T.slice(),C.unshift(0),N=T[0],T[1]>=Fa/2&&++N;do u=0,l=t(T,g,_,v),l<0?(y=g[0],_!=v&&(y=y*Fa+(g[1]||0)),u=y/N|0,u>1?(u>=Fa&&(u=Fa-1),m=e(T,u),f=m.length,v=g.length,l=t(m,g,f,v),l==1&&(u--,n(m,_<f?C:T,f))):(u==0&&(l=u=1),m=T.slice()),f=m.length,f<v&&m.unshift(0),n(g,m,v),l==-1&&(v=g.length,l=t(T,g,_,v),l<1&&(u++,n(g,_<v?C:T,v))),v=g.length):l===0&&(u++,g=[0]),x[d++]=u,l&&g[0]?g[v++]=R[S]||0:(g=[R[S]],v=1);while((S++<j||g[0]!==void 0)&&b--)}return x[0]||x.shift(),p.e=c,Yn(p,o?i+ba(p)+1:i)}}();function kne(e,t){var n,s,a,i,o,l,c=0,d=0,u=e.constructor,m=u.precision;if(ba(e)>16)throw Error(WM+ba(e));if(!e.s)return new u(jo);for(t==null?(Rs=!1,l=m):l=t,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(s=Math.log($h(2,d))/Math.LN10*2+5|0,l+=s,n=a=i=new u(jo),u.precision=l;;){if(a=Yn(a.times(e),l),n=n.times(++c),o=i.plus(Pd(a,n,l)),jc(o.d).slice(0,l)===jc(i.d).slice(0,l)){for(;d--;)i=Yn(i.times(i),l);return u.precision=m,t==null?(Rs=!0,Yn(i,m)):i}i=o}}function ba(e){for(var t=e.e*ps,n=e.d[0];n>=10;n/=10)t++;return t}function VE(e,t,n){if(t>e.LN10.sd())throw Rs=!0,n&&(e.precision=n),Error(fl+"LN10 precision limit exceeded");return Yn(new e(e.LN10),t)}function Fu(e){for(var t="";e--;)t+="0";return t}function y0(e,t){var n,s,a,i,o,l,c,d,u,m=1,f=10,p=e,x=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(fl+(p.s?"NaN":"-Infinity"));if(p.eq(jo))return new g(0);if(t==null?(Rs=!1,d=v):d=t,p.eq(10))return t==null&&(Rs=!0),VE(g,d);if(d+=f,g.precision=d,n=jc(x),s=n.charAt(0),i=ba(p),Math.abs(i)<15e14){for(;s<7&&s!=1||s==1&&n.charAt(1)>3;)p=p.times(e),n=jc(p.d),s=n.charAt(0),m++;i=ba(p),s>1?(p=new g("0."+n),i++):p=new g(s+"."+n.slice(1))}else return c=VE(g,d+2,v).times(i+""),p=y0(new g(s+"."+n.slice(1)),d-f).plus(c),g.precision=v,t==null?(Rs=!0,Yn(p,v)):p;for(l=o=p=Pd(p.minus(jo),p.plus(jo),d),u=Yn(p.times(p),d),a=3;;){if(o=Yn(o.times(u),d),c=l.plus(Pd(o,new g(a),d)),jc(c.d).slice(0,d)===jc(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(VE(g,d+2,v).times(i+""))),l=Pd(l,new g(m),d),g.precision=v,t==null?(Rs=!0,Yn(l,v)):l;l=c,a+=2}}function oF(e,t){var n,s,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(n<0&&(n=s),n+=+t.slice(s+1),t=t.substring(0,s)):n<0&&(n=t.length),s=0;t.charCodeAt(s)===48;)++s;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(s,a),t){if(a-=s,n=n-s-1,e.e=Fv(n/ps),e.d=[],s=(n+1)%ps,n<0&&(s+=ps),s<a){for(s&&e.d.push(+t.slice(0,s)),a-=ps;s<a;)e.d.push(+t.slice(s,s+=ps));t=t.slice(s),s=ps-t.length}else s-=a;for(;s--;)t+="0";if(e.d.push(+t),Rs&&(e.e>bS||e.e<-bS))throw Error(WM+n)}else e.s=0,e.e=0,e.d=[0];return e}function Yn(e,t,n){var s,a,i,o,l,c,d,u,m=e.d;for(o=1,i=m[0];i>=10;i/=10)o++;if(s=t-o,s<0)s+=ps,a=t,d=m[u=0];else{if(u=Math.ceil((s+1)/ps),i=m.length,u>=i)return e;for(d=i=m[u],o=1;i>=10;i/=10)o++;s%=ps,a=s-ps+o}if(n!==void 0&&(i=$h(10,o-a-1),l=d/i%10|0,c=t<0||m[u+1]!==void 0||d%i,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(s>0?a>0?d/$h(10,o-a):0:m[u-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return c?(i=ba(e),m.length=1,t=t-i-1,m[0]=$h(10,(ps-t%ps)%ps),e.e=Fv(-t/ps)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(s==0?(m.length=u,i=1,u--):(m.length=u+1,i=$h(10,ps-s),m[u]=a>0?(d/$h(10,o-a)%$h(10,a)|0)*i:0),c)for(;;)if(u==0){(m[0]+=i)==Fa&&(m[0]=1,++e.e);break}else{if(m[u]+=i,m[u]!=Fa)break;m[u--]=0,i=1}for(s=m.length;m[--s]===0;)m.pop();if(Rs&&(e.e>bS||e.e<-bS))throw Error(WM+ba(e));return e}function Ene(e,t){var n,s,a,i,o,l,c,d,u,m,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Rs?Yn(t,p):t;if(c=e.d,m=t.d,s=t.e,d=e.e,c=c.slice(),o=d-s,o){for(u=o<0,u?(n=c,o=-o,l=m.length):(n=m,s=d,l=c.length),a=Math.max(Math.ceil(p/ps),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=m.length,u=a<l,u&&(l=a),a=0;a<l;a++)if(c[a]!=m[a]){u=c[a]<m[a];break}o=0}for(u&&(n=c,c=m,m=n,t.s=-t.s),l=c.length,a=m.length-l;a>0;--a)c[l++]=0;for(a=m.length;a>o;){if(c[--a]<m[a]){for(i=a;i&&c[--i]===0;)c[i]=Fa-1;--c[i],c[a]+=Fa}c[a]-=m[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--s;return c[0]?(t.d=c,t.e=s,Rs?Yn(t,p):t):new f(0)}function Hf(e,t,n){var s,a=ba(e),i=jc(e.d),o=i.length;return t?(n&&(s=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Fu(s):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Fu(-a-1)+i,n&&(s=n-o)>0&&(i+=Fu(s))):a>=o?(i+=Fu(a+1-o),n&&(s=n-a-1)>0&&(i=i+"."+Fu(s))):((s=a+1)<o&&(i=i.slice(0,s)+"."+i.slice(s)),n&&(s=n-o)>0&&(a+1===o&&(i+="."),i+=Fu(s))),e.s<0?"-"+i:i}function lF(e,t){if(e.length>t)return e.length=t,!0}function Ane(e){var t,n,s;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(bf+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return oF(o,i.toString())}else if(typeof i!="string")throw Error(bf+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Q9e.test(i))oF(o,i);else throw Error(bf+i)}if(a.prototype=Vt,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=Ane,a.config=a.set=J9e,e===void 0&&(e={}),e)for(s=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<s.length;)e.hasOwnProperty(n=s[t++])||(e[n]=this[n]);return a.config(e),a}function J9e(e){if(!e||typeof e!="object")throw Error(fl+"Object expected");var t,n,s,a=["precision",1,Uv,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((s=e[n=a[t]])!==void 0)if(Fv(s)===s&&s>=a[t+1]&&s<=a[t+2])this[n]=s;else throw Error(bf+n+": "+s);if((s=e[n="LN10"])!==void 0)if(s==Math.LN10)this[n]=new this(s);else throw Error(bf+n+": "+s);return this}var YM=Ane(Z9e);jo=new YM(1);const Un=YM;function e7e(e){return s7e(e)||n7e(e)||r7e(e)||t7e()}function t7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1127In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r7e(e,t){if(e){if(typeof e=="string")return _O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _O(e,t)}}function n7e(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function s7e(e){if(Array.isArray(e))return _O(e)}function _O(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}var a7e=function(t){return t},Tne={"@@functional/placeholder":!0},Rne=function(t){return t===Tne},cF=function(t){return function n(){return arguments.length===0||arguments.length===1&&Rne(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},i7e=function e(t,n){return t===1?n:cF(function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==Tne}).length;return o>=t?n.apply(void 0,a):e(t-o,cF(function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];var u=a.map(function(m){return Rne(m)?c.shift():m});return n.apply(void 0,e7e(u).concat(c))}))})},tC=function(t){return i7e(t.length,t)},CO=function(t,n){for(var s=[],a=t;a<n;++a)s[a-t]=a;return s},o7e=tC(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),l7e=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];if(!n.length)return a7e;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},kO=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},One=function(t){var n=null,s=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(l,c){return l===n[c]})||(n=i,s=t.apply(void 0,i)),s}};function c7e(e){var t;return e===0?t=1:t=Math.floor(new Un(e).abs().log(10).toNumber())+1,t}function d7e(e,t,n){for(var s=new Un(e),a=0,i=[];s.lt(t)&&a<1e5;)i.push(s.toNumber()),s=s.add(n),a++;return i}var u7e=tC(function(e,t,n){var s=+e,a=+t;return s+n*(a-s)}),m7e=tC(function(e,t,n){var s=t-+e;return s=s||1/0,(n-e)/s}),h7e=tC(function(e,t,n){var s=t-+e;return s=s||1/0,Math.max(0,Math.min(1,(n-e)/s))});const rC={rangeStep:d7e,getDigitCount:c7e,interpolateNumber:u7e,uninterpolateNumber:m7e,uninterpolateTruncation:h7e};function EO(e){return x7e(e)||p7e(e)||Pne(e)||f7e()}function f7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1128In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p7e(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function x7e(e){if(Array.isArray(e))return AO(e)}function b0(e,t){return y7e(e)||v7e(e,t)||Pne(e,t)||g7e()}function g7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1129In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pne(e,t){if(e){if(typeof e=="string")return AO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AO(e,t)}}function AO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function v7e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],s=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(s=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));s=!0);}catch(c){a=!0,i=c}finally{try{!s&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function y7e(e){if(Array.isArray(e))return e}function Dne(e){var t=b0(e,2),n=t[0],s=t[1],a=n,i=s;return n>s&&(a=s,i=n),[a,i]}function Mne(e,t,n){if(e.lte(0))return new Un(0);var s=rC.getDigitCount(e.toNumber()),a=new Un(10).pow(s),i=e.div(a),o=s!==1?.05:.1,l=new Un(Math.ceil(i.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new Un(Math.ceil(c))}function b7e(e,t,n){var s=1,a=new Un(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(s=new Un(10).pow(rC.getDigitCount(e)-1),a=new Un(Math.floor(a.div(s).toNumber())).mul(s)):i>1&&(a=new Un(Math.floor(e)))}else e===0?a=new Un(Math.floor((t-1)/2)):n||(a=new Un(Math.floor(e)));var o=Math.floor((t-1)/2),l=l7e(o7e(function(c){return a.add(new Un(c-o).mul(s)).toNumber()}),CO);return l(0,t)}function Ine(e,t,n,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Un(0),tickMin:new Un(0),tickMax:new Un(0)};var i=Mne(new Un(t).sub(e).div(n-1),s,a),o;e<=0&&t>=0?o=new Un(0):(o=new Un(e).add(t).div(2),o=o.sub(new Un(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Un(t).sub(o).div(i).toNumber()),d=l+c+1;return d>n?Ine(e,t,n,s,a+1):(d<n&&(c=t>0?c+(n-d):c,l=t>0?l:l+(n-d)),{step:i,tickMin:o.sub(new Un(l).mul(i)),tickMax:o.add(new Un(c).mul(i))})}function w7e(e){var t=b0(e,2),n=t[0],s=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=Dne([n,s]),c=b0(l,2),d=c[0],u=c[1];if(d===-1/0||u===1/0){var m=u===1/0?[d].concat(EO(CO(0,a-1).map(function(){return 1/0}))):[].concat(EO(CO(0,a-1).map(function(){return-1/0})),[u]);return n>s?kO(m):m}if(d===u)return b7e(d,a,i);var f=Ine(d,u,o,i),p=f.step,x=f.tickMin,g=f.tickMax,v=rC.rangeStep(x,g.add(new Un(.1).mul(p)),p);return n>s?kO(v):v}function j7e(e,t){var n=b0(e,2),s=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Dne([s,a]),l=b0(o,2),c=l[0],d=l[1];if(c===-1/0||d===1/0)return[s,a];if(c===d)return[c];var u=Math.max(t,2),m=Mne(new Un(d).sub(c).div(u-1),i,0),f=[].concat(EO(rC.rangeStep(new Un(c),new Un(d).sub(new Un(.99).mul(m)),m)),[d]);return s>a?kO(f):f}var N7e=One(w7e),S7e=One(j7e),_7e="Invariant failed";function Wf(e,t){throw new Error(_7e)}var C7e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Rg(e){"@babel/helpers - typeof";return Rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rg(e)}function wS(){return wS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},wS.apply(this,arguments)}function k7e(e,t){return R7e(e)||T7e(e,t)||A7e(e,t)||E7e()}function E7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1130In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A7e(e,t){if(e){if(typeof e=="string")return dF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dF(e,t)}}function dF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function T7e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function R7e(e){if(Array.isArray(e))return e}function O7e(e,t){if(e==null)return{};var n=P7e(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function P7e(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function D7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M7e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Vne(s.key),s)}}function I7e(e,t,n){return t&&M7e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function L7e(e,t,n){return t=jS(t),$7e(e,Lne()?Reflect.construct(t,n||[],jS(e).constructor):t.apply(e,n))}function $7e(e,t){if(t&&(Rg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V7e(e)}function V7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lne=function(){return!!e})()}function jS(e){return jS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jS(e)}function U7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TO(e,t)}function TO(e,t){return TO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},TO(e,t)}function $ne(e,t,n){return t=Vne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vne(e){var t=F7e(e,"string");return Rg(t)=="symbol"?t:t+""}function F7e(e,t){if(Rg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Rg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nC=function(e){function t(){return D7e(this,t),L7e(this,t,arguments)}return U7e(t,e),I7e(t,[{key:"render",value:function(){var s=this.props,a=s.offset,i=s.layout,o=s.width,l=s.dataKey,c=s.data,d=s.dataPointFormatter,u=s.xAxis,m=s.yAxis,f=O7e(s,C7e),p=ir(f,!1);this.props.direction==="x"&&u.type!=="number"&&Wf();var x=c.map(function(g){var v=d(g,l),y=v.x,b=v.y,w=v.value,S=v.errorVal;if(!S)return null;var j=[],N,_;if(Array.isArray(S)){var C=k7e(S,2);N=C[0],_=C[1]}else N=_=S;if(i==="vertical"){var k=u.scale,E=b+a,R=E+o,T=E-o,D=k(w-N),A=k(w+_);j.push({x1:A,y1:R,x2:A,y2:T}),j.push({x1:D,y1:E,x2:A,y2:E}),j.push({x1:D,y1:R,x2:D,y2:T})}else if(i==="horizontal"){var V=m.scale,U=y+a,O=U-o,M=U+o,$=V(w-N),I=V(w+_);j.push({x1:O,y1:I,x2:M,y2:I}),j.push({x1:U,y1:$,x2:U,y2:I}),j.push({x1:O,y1:$,x2:M,y2:$})}return Y.createElement(ln,wS({className:"recharts-errorBar",key:"bar-".concat(j.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},p),j.map(function(B){return Y.createElement("line",wS({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return Y.createElement(ln,{className:"recharts-errorBars"},x)}}])}(Y.Component);$ne(nC,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});$ne(nC,"displayName","ErrorBar");function w0(e){"@babel/helpers - typeof";return w0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w0(e)}function uF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Sh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uF(Object(n),!0).forEach(function(s){B7e(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function B7e(e,t,n){return t=z7e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z7e(e){var t=q7e(e,"string");return w0(t)=="symbol"?t:t+""}function q7e(e,t){if(w0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(w0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Une=function(t){var n=t.children,s=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=fo(n,Rx);if(!o)return null;var l=Rx.defaultProps,c=l!==void 0?Sh(Sh({},l),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:i==="children"?d=(s||[]).reduce(function(u,m){var f=m.item,p=m.props,x=p.sectors||p.data||[];return u.concat(x.map(function(g){return{type:o.props.iconType||f.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):d=(s||[]).map(function(u){var m=u.item,f=m.type.defaultProps,p=f!==void 0?Sh(Sh({},f),m.props):{},x=p.dataKey,g=p.name,v=p.legendType,y=p.hide;return{inactive:y,dataKey:x,type:c.iconType||v||"square",color:GM(m),value:g||x,payload:p}}),Sh(Sh(Sh({},c),Rx.getWithHeight(o,a)),{},{payload:d,item:o})};function j0(e){"@babel/helpers - typeof";return j0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j0(e)}function mF(e){return G7e(e)||Y7e(e)||W7e(e)||H7e()}function H7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1131In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W7e(e,t){if(e){if(typeof e=="string")return RO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RO(e,t)}}function Y7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function G7e(e){if(Array.isArray(e))return RO(e)}function RO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function hF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hF(Object(n),!0).forEach(function(s){Px(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Px(e,t,n){return t=K7e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K7e(e){var t=X7e(e,"string");return j0(t)=="symbol"?t:t+""}function X7e(e,t){if(j0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(j0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pa(e,t,n){return Rr(e)||Rr(t)?n:Da(t)?To(e,t,n):Nr(t)?t(e):n}function ub(e,t,n,s){var a=Y9e(e,function(l){return Pa(l,t)});if(n==="number"){var i=a.filter(function(l){return xt(l)||parseFloat(l)});return i.length?[eC(i),hm(i)]:[1/0,-1/0]}var o=s?a.filter(function(l){return!Rr(l)}):a;return o.map(function(l){return Da(l)||l instanceof Date?l:""})}var Z7e=function(t){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,d=0;d<l;d++){var u=d>0?a[d-1].coordinate:a[l-1].coordinate,m=a[d].coordinate,f=d>=l-1?a[0].coordinate:a[d+1].coordinate,p=void 0;if(Di(m-u)!==Di(f-m)){var x=[];if(Di(f-m)===Di(c[1]-c[0])){p=f;var g=m+c[1]-c[0];x[0]=Math.min(g,(g+u)/2),x[1]=Math.max(g,(g+u)/2)}else{p=u;var v=f+c[1]-c[0];x[0]=Math.min(m,(v+m)/2),x[1]=Math.max(m,(v+m)/2)}var y=[Math.min(m,(p+m)/2),Math.max(m,(p+m)/2)];if(t>y[0]&&t<=y[1]||t>=x[0]&&t<=x[1]){o=a[d].index;break}}else{var b=Math.min(u,f),w=Math.max(u,f);if(t>(b+m)/2&&t<=(w+m)/2){o=a[d].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(s[S].coordinate+s[S+1].coordinate)/2||S>0&&S<l-1&&t>(s[S].coordinate+s[S-1].coordinate)/2&&t<=(s[S].coordinate+s[S+1].coordinate)/2||S===l-1&&t>(s[S].coordinate+s[S-1].coordinate)/2){o=s[S].index;break}return o},GM=function(t){var n,s=t,a=s.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ks(Ks({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Q7e=function(t){var n=t.barSize,s=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,d=l.length;c<d;c++)for(var u=i[l[c]].stackGroups,m=Object.keys(u),f=0,p=m.length;f<p;f++){var x=u[m[f]],g=x.items,v=x.cateAxisId,y=g.filter(function(_){return Rd(_.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,w=b!==void 0?Ks(Ks({},b),y[0].props):y[0].props,S=w.barSize,j=w[v];o[j]||(o[j]=[]);var N=Rr(S)?n:S;o[j].push({item:y[0],stackList:y.slice(1),barSize:Rr(N)?void 0:Mi(N,s,0)})}}return o},J7e=function(t){var n=t.barGap,s=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var d=Mi(n,a,0,!0),u,m=[];if(o[0].barSize===+o[0].barSize){var f=!1,p=a/c,x=o.reduce(function(S,j){return S+j.barSize||0},0);x+=(c-1)*d,x>=a&&(x-=(c-1)*d,d=0),x>=a&&p>0&&(f=!0,p*=.9,x=c*p);var g=(a-x)/2>>0,v={offset:g-d,size:0};u=o.reduce(function(S,j){var N={item:j.item,position:{offset:v.offset+v.size+d,size:f?p:j.barSize}},_=[].concat(mF(S),[N]);return v=_[_.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(C){_.push({item:C,position:v})}),_},m)}else{var y=Mi(s,a,0,!0);a-2*y-(c-1)*d<=0&&(d=0);var b=(a-2*y-(c-1)*d)/c;b>1&&(b>>=0);var w=l===+l?Math.min(b,l):b;u=o.reduce(function(S,j,N){var _=[].concat(mF(S),[{item:j.item,position:{offset:y+(b+d)*N+(b-w)/2,size:w}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(C){_.push({item:C,position:_[_.length-1].position})}),_},m)}return u},eqe=function(t,n,s,a){var i=s.children,o=s.width,l=s.margin,c=o-(l.left||0)-(l.right||0),d=Une({children:i,legendWidth:c});if(d){var u=a||{},m=u.width,f=u.height,p=d.align,x=d.verticalAlign,g=d.layout;if((g==="vertical"||g==="horizontal"&&x==="middle")&&p!=="center"&&xt(t[p]))return Ks(Ks({},t),{},Px({},p,t[p]+(m||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&x!=="middle"&&xt(t[x]))return Ks(Ks({},t),{},Px({},x,t[x]+(f||0)))}return t},tqe=function(t,n,s){return Rr(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||s==="x"?n==="xAxis":s==="y"?n==="yAxis":!0},Fne=function(t,n,s,a,i){var o=n.props.children,l=ml(o,nC).filter(function(d){return tqe(a,i,d.props.direction)});if(l&&l.length){var c=l.map(function(d){return d.props.dataKey});return t.reduce(function(d,u){var m=Pa(u,s);if(Rr(m))return d;var f=Array.isArray(m)?[eC(m),hm(m)]:[m,m],p=c.reduce(function(x,g){var v=Pa(u,g,0),y=f[0]-Math.abs(Array.isArray(v)?v[0]:v),b=f[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(y,x[0]),Math.max(b,x[1])]},[1/0,-1/0]);return[Math.min(p[0],d[0]),Math.max(p[1],d[1])]},[1/0,-1/0])}return null},rqe=function(t,n,s,a,i){var o=n.map(function(l){return Fne(t,l,s,i,a)}).filter(function(l){return!Rr(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},Bne=function(t,n,s,a,i){var o=n.map(function(c){var d=c.props.dataKey;return s==="number"&&d&&Fne(t,c,d,a)||ub(t,d,s,i)});if(s==="number")return o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,d){for(var u=0,m=d.length;u<m;u++)l[d[u]]||(l[d[u]]=!0,c.push(d[u]));return c},[])},zne=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Xh=function(t,n,s){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,d=(n||s)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(d=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Di(l[0]-l[1])*2*d:d,n&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(m){var f=i?i.indexOf(m):m;return{coordinate:a(f)+d,value:m,offset:d}});return u.filter(function(m){return!Dv(m.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(m,f){return{coordinate:a(m)+d,value:m,index:f,offset:d}}):a.ticks&&!s?a.ticks(t.tickCount).map(function(m){return{coordinate:a(m)+d,value:m,offset:d}}):a.domain().map(function(m,f){return{coordinate:a(m)+d,value:i?i[m]:m,index:f,offset:d}})},UE=new WeakMap,Fj=function(t,n){if(typeof n!="function")return t;UE.has(t)||UE.set(t,new WeakMap);var s=UE.get(t);if(s.has(n))return s.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return s.set(n,a),a},qne=function(t,n,s){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:f0(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:xS(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!s)?{scale:db(),realScaleType:"point"}:i==="category"?{scale:f0(),realScaleType:"band"}:{scale:xS(),realScaleType:"linear"};if(Bf(a)){var c="scale".concat(V2(a));return{scale:(iF[c]||db)(),realScaleType:iF[c]?c:"point"}}return Nr(a)?{scale:a}:{scale:db(),realScaleType:"point"}},fF=1e-4,Hne=function(t){var n=t.domain();if(!(!n||n.length<=2)){var s=n.length,a=t.range(),i=Math.min(a[0],a[1])-fF,o=Math.max(a[0],a[1])+fF,l=t(n[0]),c=t(n[s-1]);(l<i||l>o||c<i||c>o)&&t.domain([n[0],n[s-1]])}},nqe=function(t,n){if(!t)return null;for(var s=0,a=t.length;s<a;s++)if(t[s].item===n)return t[s].position;return null},sqe=function(t,n){if(!n||n.length!==2||!xt(n[0])||!xt(n[1]))return t;var s=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!xt(t[0])||t[0]<s)&&(i[0]=s),(!xt(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<s&&(i[1]=s),i},aqe=function(t){var n=t.length;if(!(n<=0))for(var s=0,a=t[0].length;s<a;++s)for(var i=0,o=0,l=0;l<n;++l){var c=Dv(t[l][s][1])?t[l][s][0]:t[l][s][1];c>=0?(t[l][s][0]=i,t[l][s][1]=i+c,i=t[l][s][1]):(t[l][s][0]=o,t[l][s][1]=o+c,o=t[l][s][1])}},iqe=function(t){var n=t.length;if(!(n<=0))for(var s=0,a=t[0].length;s<a;++s)for(var i=0,o=0;o<n;++o){var l=Dv(t[o][s][1])?t[o][s][0]:t[o][s][1];l>=0?(t[o][s][0]=i,t[o][s][1]=i+l,i=t[o][s][1]):(t[o][s][0]=0,t[o][s][1]=0)}},oqe={sign:aqe,expand:_Me,none:jg,silhouette:CMe,wiggle:kMe,positive:iqe},lqe=function(t,n,s){var a=n.map(function(l){return l.props.dataKey}),i=oqe[s],o=SMe().keys(a).value(function(l,c){return+Pa(l,c,0)}).order(rO).offset(i);return o(t)},cqe=function(t,n,s,a,i,o){if(!t)return null;var l=o?n.reverse():n,c={},d=l.reduce(function(m,f){var p,x=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Ks(Ks({},f.type.defaultProps),f.props):f.props,g=x.stackId,v=x.hide;if(v)return m;var y=x[s],b=m[y]||{hasStack:!1,stackGroups:{}};if(Da(g)){var w=b.stackGroups[g]||{numericAxisId:s,cateAxisId:a,items:[]};w.items.push(f),b.hasStack=!0,b.stackGroups[g]=w}else b.stackGroups[Mv("_stackId_")]={numericAxisId:s,cateAxisId:a,items:[f]};return Ks(Ks({},m),{},Px({},y,b))},c),u={};return Object.keys(d).reduce(function(m,f){var p=d[f];if(p.hasStack){var x={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,v){var y=p.stackGroups[v];return Ks(Ks({},g),{},Px({},v,{numericAxisId:s,cateAxisId:a,items:y.items,stackedData:lqe(t,y.items,i)}))},x)}return Ks(Ks({},m),{},Px({},f,p))},u)},Wne=function(t,n){var s=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=s||n.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=t.domain();if(!d.length)return null;var u=N7e(d,i,l);return t.domain([eC(u),hm(u)]),{niceTicks:u}}if(i&&a==="number"){var m=t.domain(),f=S7e(m,i,l);return{niceTicks:f}}return null};function pF(e){var t=e.axis,n=e.ticks,s=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Rr(a[t.dataKey])){var l=KN(n,"value",a[t.dataKey]);if(l)return l.coordinate+s/2}return n[i]?n[i].coordinate+s/2:null}var c=Pa(a,Rr(o)?t.dataKey:o);return Rr(c)?null:t.scale(c)}var xF=function(t){var n=t.axis,s=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return s[l]?s[l].coordinate+a:null;var c=Pa(o,n.dataKey,n.domain[l]);return Rr(c)?null:n.scale(c)-i/2+a},dqe=function(t){var n=t.numericAxis,s=n.scale.domain();if(n.type==="number"){var a=Math.min(s[0],s[1]),i=Math.max(s[0],s[1]);return a<=0&&i>=0?0:i<0?i:a}return s[0]},uqe=function(t,n){var s,a=(s=t.type)!==null&&s!==void 0&&s.defaultProps?Ks(Ks({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Da(i)){var o=n[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},mqe=function(t){return t.reduce(function(n,s){return[eC(s.concat([n[0]]).filter(xt)),hm(s.concat([n[1]]).filter(xt))]},[1/0,-1/0])},Yne=function(t,n,s){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(d,u){var m=mqe(u.slice(n,s+1));return[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},gF=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vF=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OO=function(t,n,s){if(Nr(t))return t(n,s);if(!Array.isArray(t))return n;var a=[];if(xt(t[0]))a[0]=s?t[0]:Math.min(t[0],n[0]);else if(gF.test(t[0])){var i=+gF.exec(t[0])[1];a[0]=n[0]-i}else Nr(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(xt(t[1]))a[1]=s?t[1]:Math.max(t[1],n[1]);else if(vF.test(t[1])){var o=+vF.exec(t[1])[1];a[1]=n[1]+o}else Nr(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},NS=function(t,n,s){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!s||a>0)return a}if(t&&n&&n.length>=2){for(var i=jM(n,function(m){return m.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var d=i[l],u=i[l-1];o=Math.min((d.coordinate||0)-(u.coordinate||0),o)}return o===1/0?0:o}return s?void 0:0},yF=function(t,n,s){return!t||!t.length||Tg(t,To(s,"type.defaultProps.domain"))?n:t},Gne=function(t,n){var s=t.type.defaultProps?Ks(Ks({},t.type.defaultProps),t.props):t.props,a=s.dataKey,i=s.name,o=s.unit,l=s.formatter,c=s.tooltipType,d=s.chartType,u=s.hide;return Ks(Ks({},ir(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:GM(t),value:Pa(n,a),type:c,payload:n,chartType:d,hide:u})};function N0(e){"@babel/helpers - typeof";return N0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N0(e)}function bF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function xd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bF(Object(n),!0).forEach(function(s){Kne(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Kne(e,t,n){return t=hqe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hqe(e){var t=fqe(e,"string");return N0(t)=="symbol"?t:t+""}function fqe(e,t){if(N0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(N0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pqe(e,t){return yqe(e)||vqe(e,t)||gqe(e,t)||xqe()}function xqe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1132In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gqe(e,t){if(e){if(typeof e=="string")return wF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wF(e,t)}}function wF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function vqe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function yqe(e){if(Array.isArray(e))return e}var SS=Math.PI/180,bqe=function(t){return t*180/Math.PI},ls=function(t,n,s,a){return{x:t+Math.cos(-SS*a)*s,y:n+Math.sin(-SS*a)*s}},Xne=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(s.left||0)-(s.right||0)),Math.abs(n-(s.top||0)-(s.bottom||0)))/2},wqe=function(t,n,s,a,i){var o=t.width,l=t.height,c=t.startAngle,d=t.endAngle,u=Mi(t.cx,o,o/2),m=Mi(t.cy,l,l/2),f=Xne(o,l,s),p=Mi(t.innerRadius,f,0),x=Mi(t.outerRadius,f,f*.8),g=Object.keys(n);return g.reduce(function(v,y){var b=n[y],w=b.domain,S=b.reversed,j;if(Rr(b.range))a==="angleAxis"?j=[c,d]:a==="radiusAxis"&&(j=[p,x]),S&&(j=[j[1],j[0]]);else{j=b.range;var N=j,_=pqe(N,2);c=_[0],d=_[1]}var C=qne(b,i),k=C.realScaleType,E=C.scale;E.domain(w).range(j),Hne(E);var R=Wne(E,xd(xd({},b),{},{realScaleType:k})),T=xd(xd(xd({},b),R),{},{range:j,radius:x,realScaleType:k,scale:E,cx:u,cy:m,innerRadius:p,outerRadius:x,startAngle:c,endAngle:d});return xd(xd({},v),{},Kne({},y,T))},{})},jqe=function(t,n){var s=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(s-i,2)+Math.pow(a-o,2))},Nqe=function(t,n){var s=t.x,a=t.y,i=n.cx,o=n.cy,l=jqe({x:s,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(s-i)/l,d=Math.acos(c);return a>o&&(d=2*Math.PI-d),{radius:l,angle:bqe(d),angleInRadian:d}},Sqe=function(t){var n=t.startAngle,s=t.endAngle,a=Math.floor(n/360),i=Math.floor(s/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:s-o*360}},_qe=function(t,n){var s=n.startAngle,a=n.endAngle,i=Math.floor(s/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},jF=function(t,n){var s=t.x,a=t.y,i=Nqe({x:s,y:a},n),o=i.radius,l=i.angle,c=n.innerRadius,d=n.outerRadius;if(o<c||o>d)return!1;if(o===0)return!0;var u=Sqe(n),m=u.startAngle,f=u.endAngle,p=l,x;if(m<=f){for(;p>f;)p-=360;for(;p<m;)p+=360;x=p>=m&&p<=f}else{for(;p>m;)p-=360;for(;p<f;)p+=360;x=p>=f&&p<=m}return x?xd(xd({},n),{},{radius:o,angle:_qe(p,n)}):null},Zne=function(t){return!h.isValidElement(t)&&!Nr(t)&&typeof t!="boolean"?t.className:""};function S0(e){"@babel/helpers - typeof";return S0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S0(e)}var Cqe=["offset"];function kqe(e){return Rqe(e)||Tqe(e)||Aqe(e)||Eqe()}function Eqe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1133In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aqe(e,t){if(e){if(typeof e=="string")return PO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PO(e,t)}}function Tqe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rqe(e){if(Array.isArray(e))return PO(e)}function PO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function Oqe(e,t){if(e==null)return{};var n=Pqe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function Pqe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function NF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ea(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NF(Object(n),!0).forEach(function(s){Dqe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Dqe(e,t,n){return t=Mqe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mqe(e){var t=Iqe(e,"string");return S0(t)=="symbol"?t:t+""}function Iqe(e,t){if(S0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(S0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_0.apply(this,arguments)}var Lqe=function(t){var n=t.value,s=t.formatter,a=Rr(t.children)?n:t.children;return Nr(s)?s(a):a},$qe=function(t,n){var s=Di(n-t),a=Math.min(Math.abs(n-t),360);return s*a},Vqe=function(t,n,s){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,d=c.cx,u=c.cy,m=c.innerRadius,f=c.outerRadius,p=c.startAngle,x=c.endAngle,g=c.clockWise,v=(m+f)/2,y=$qe(p,x),b=y>=0?1:-1,w,S;a==="insideStart"?(w=p+b*o,S=g):a==="insideEnd"?(w=x-b*o,S=!g):a==="end"&&(w=x+b*o,S=g),S=y<=0?S:!S;var j=ls(d,u,v,w),N=ls(d,u,v,w+(S?1:-1)*359),_="M".concat(j.x,",").concat(j.y,`
1134    A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`,
1135    `).concat(N.x,",").concat(N.y),C=Rr(t.id)?Mv("recharts-radial-line-"):t.id;return Y.createElement("text",_0({},s,{dominantBaseline:"central",className:Tr("recharts-radial-bar-label",l)}),Y.createElement("defs",null,Y.createElement("path",{id:C,d:_})),Y.createElement("textPath",{xlinkHref:"#".concat(C)},n))},Uqe=function(t){var n=t.viewBox,s=t.offset,a=t.position,i=n,o=i.cx,l=i.cy,c=i.innerRadius,d=i.outerRadius,u=i.startAngle,m=i.endAngle,f=(u+m)/2;if(a==="outside"){var p=ls(o,l,d+s,f),x=p.x,g=p.y;return{x,y:g,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+d)/2,y=ls(o,l,v,f),b=y.x,w=y.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Fqe=function(t){var n=t.viewBox,s=t.parentViewBox,a=t.offset,i=t.position,o=n,l=o.x,c=o.y,d=o.width,u=o.height,m=u>=0?1:-1,f=m*a,p=m>0?"end":"start",x=m>0?"start":"end",g=d>=0?1:-1,v=g*a,y=g>0?"end":"start",b=g>0?"start":"end";if(i==="top"){var w={x:l+d/2,y:c-m*a,textAnchor:"middle",verticalAnchor:p};return Ea(Ea({},w),s?{height:Math.max(c-s.y,0),width:d}:{})}if(i==="bottom"){var S={x:l+d/2,y:c+u+f,textAnchor:"middle",verticalAnchor:x};return Ea(Ea({},S),s?{height:Math.max(s.y+s.height-(c+u),0),width:d}:{})}if(i==="left"){var j={x:l-v,y:c+u/2,textAnchor:y,verticalAnchor:"middle"};return Ea(Ea({},j),s?{width:Math.max(j.x-s.x,0),height:u}:{})}if(i==="right"){var N={x:l+d+v,y:c+u/2,textAnchor:b,verticalAnchor:"middle"};return Ea(Ea({},N),s?{width:Math.max(s.x+s.width-N.x,0),height:u}:{})}var _=s?{width:d,height:u}:{};return i==="insideLeft"?Ea({x:l+v,y:c+u/2,textAnchor:b,verticalAnchor:"middle"},_):i==="insideRight"?Ea({x:l+d-v,y:c+u/2,textAnchor:y,verticalAnchor:"middle"},_):i==="insideTop"?Ea({x:l+d/2,y:c+f,textAnchor:"middle",verticalAnchor:x},_):i==="insideBottom"?Ea({x:l+d/2,y:c+u-f,textAnchor:"middle",verticalAnchor:p},_):i==="insideTopLeft"?Ea({x:l+v,y:c+f,textAnchor:b,verticalAnchor:x},_):i==="insideTopRight"?Ea({x:l+d-v,y:c+f,textAnchor:y,verticalAnchor:x},_):i==="insideBottomLeft"?Ea({x:l+v,y:c+u-f,textAnchor:b,verticalAnchor:p},_):i==="insideBottomRight"?Ea({x:l+d-v,y:c+u-f,textAnchor:y,verticalAnchor:p},_):Tv(i)&&(xt(i.x)||Yh(i.x))&&(xt(i.y)||Yh(i.y))?Ea({x:l+Mi(i.x,d),y:c+Mi(i.y,u),textAnchor:"end",verticalAnchor:"end"},_):Ea({x:l+d/2,y:c+u/2,textAnchor:"middle",verticalAnchor:"middle"},_)},Bqe=function(t){return"cx"in t&&xt(t.cx)};function qa(e){var t=e.offset,n=t===void 0?5:t,s=Oqe(e,Cqe),a=Ea({offset:n},s),i=a.viewBox,o=a.position,l=a.value,c=a.children,d=a.content,u=a.className,m=u===void 0?"":u,f=a.textBreakAll;if(!i||Rr(l)&&Rr(c)&&!h.isValidElement(d)&&!Nr(d))return null;if(h.isValidElement(d))return h.cloneElement(d,a);var p;if(Nr(d)){if(p=h.createElement(d,a),h.isValidElement(p))return p}else p=Lqe(a);var x=Bqe(i),g=ir(a,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Vqe(a,p,g);var v=x?Uqe(a):Fqe(a);return Y.createElement(qf,_0({className:Tr("recharts-label",m)},g,v,{breakAll:f}),p)}qa.displayName="Label";var Qne=function(t){var n=t.cx,s=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,d=t.innerRadius,u=t.outerRadius,m=t.x,f=t.y,p=t.top,x=t.left,g=t.width,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(xt(g)&&xt(v)){if(xt(m)&&xt(f))return{x:m,y:f,width:g,height:v};if(xt(p)&&xt(x))return{x:p,y:x,width:g,height:v}}return xt(m)&&xt(f)?{x:m,y:f,width:0,height:0}:xt(n)&&xt(s)?{cx:n,cy:s,startAngle:i||a||0,endAngle:o||a||0,innerRadius:d||0,outerRadius:u||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},zqe=function(t,n){return t?t===!0?Y.createElement(qa,{key:"label-implicit",viewBox:n}):Da(t)?Y.createElement(qa,{key:"label-implicit",viewBox:n,value:t}):h.isValidElement(t)?t.type===qa?h.cloneElement(t,{key:"label-implicit",viewBox:n}):Y.createElement(qa,{key:"label-implicit",content:t,viewBox:n}):Nr(t)?Y.createElement(qa,{key:"label-implicit",content:t,viewBox:n}):Tv(t)?Y.createElement(qa,_0({viewBox:n},t,{key:"label-implicit"})):null:null},qqe=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&s&&!t.label)return null;var a=t.children,i=Qne(t),o=ml(a,qa).map(function(c,d){return h.cloneElement(c,{viewBox:n||i,key:"label-".concat(d)})});if(!s)return o;var l=zqe(t.label,n||i);return[l].concat(kqe(o))};qa.parseViewBox=Qne;qa.renderCallByParent=qqe;function Hqe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Wqe=Hqe;const Yqe=Mn(Wqe);function C0(e){"@babel/helpers - typeof";return C0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C0(e)}var Gqe=["valueAccessor"],Kqe=["data","dataKey","clockWise","id","textBreakAll"];function Xqe(e){return eHe(e)||Jqe(e)||Qqe(e)||Zqe()}function Zqe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1136In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qqe(e,t){if(e){if(typeof e=="string")return DO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DO(e,t)}}function Jqe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eHe(e){if(Array.isArray(e))return DO(e)}function DO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function _S(){return _S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_S.apply(this,arguments)}function SF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SF(Object(n),!0).forEach(function(s){tHe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function tHe(e,t,n){return t=rHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rHe(e){var t=nHe(e,"string");return C0(t)=="symbol"?t:t+""}function nHe(e,t){if(C0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(C0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CF(e,t){if(e==null)return{};var n=sHe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function sHe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}var aHe=function(t){return Array.isArray(t.value)?Yqe(t.value):t.value};function Dd(e){var t=e.valueAccessor,n=t===void 0?aHe:t,s=CF(e,Gqe),a=s.data,i=s.dataKey,o=s.clockWise,l=s.id,c=s.textBreakAll,d=CF(s,Kqe);return!a||!a.length?null:Y.createElement(ln,{className:"recharts-label-list"},a.map(function(u,m){var f=Rr(i)?n(u,m):Pa(u&&u.payload,i),p=Rr(l)?{}:{id:"".concat(l,"-").concat(m)};return Y.createElement(qa,_S({},ir(u,!0),d,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:c,viewBox:qa.parseViewBox(Rr(o)?u:_F(_F({},u),{},{clockWise:o})),key:"label-".concat(m),index:m}))}))}Dd.displayName="LabelList";function iHe(e,t){return e?e===!0?Y.createElement(Dd,{key:"labelList-implicit",data:t}):Y.isValidElement(e)||Nr(e)?Y.createElement(Dd,{key:"labelList-implicit",data:t,content:e}):Tv(e)?Y.createElement(Dd,_S({data:t},e,{key:"labelList-implicit"})):null:null}function oHe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var s=e.children,a=ml(s,Dd).map(function(o,l){return h.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var i=iHe(e.label,t);return[i].concat(Xqe(a))}Dd.renderCallByParent=oHe;function k0(e){"@babel/helpers - typeof";return k0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k0(e)}function MO(){return MO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},MO.apply(this,arguments)}function kF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function EF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kF(Object(n),!0).forEach(function(s){lHe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function lHe(e,t,n){return t=cHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cHe(e){var t=dHe(e,"string");return k0(t)=="symbol"?t:t+""}function dHe(e,t){if(k0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(k0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uHe=function(t,n){var s=Di(n-t),a=Math.min(Math.abs(n-t),359.999);return s*a},Bj=function(t){var n=t.cx,s=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,d=t.cornerIsExternal,u=c*(l?1:-1)+a,m=Math.asin(c/u)/SS,f=d?i:i+o*m,p=ls(n,s,u,f),x=ls(n,s,a,f),g=d?i-o*m:i,v=ls(n,s,u*Math.cos(m*SS),g);return{center:p,circleTangency:x,lineTangency:v,theta:m}},Jne=function(t){var n=t.cx,s=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=uHe(o,l),d=o+c,u=ls(n,s,i,o),m=ls(n,s,i,d),f="M ".concat(u.x,",").concat(u.y,`
1137    A `).concat(i,",").concat(i,`,0,
1138    `).concat(+(Math.abs(c)>180),",").concat(+(o>d),`,
1139    `).concat(m.x,",").concat(m.y,`
1140  `);if(a>0){var p=ls(n,s,a,o),x=ls(n,s,a,d);f+="L ".concat(x.x,",").concat(x.y,`
1141            A `).concat(a,",").concat(a,`,0,
1142            `).concat(+(Math.abs(c)>180),",").concat(+(o<=d),`,
1143            `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(s," Z");return f},mHe=function(t){var n=t.cx,s=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,d=t.startAngle,u=t.endAngle,m=Di(u-d),f=Bj({cx:n,cy:s,radius:i,angle:d,sign:m,cornerRadius:o,cornerIsExternal:c}),p=f.circleTangency,x=f.lineTangency,g=f.theta,v=Bj({cx:n,cy:s,radius:i,angle:u,sign:-m,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,w=v.theta,S=c?Math.abs(d-u):Math.abs(d-u)-g-w;if(S<0)return l?"M ".concat(x.x,",").concat(x.y,`
1144        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
1145        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
1146      `):Jne({cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:d,endAngle:u});var j="M ".concat(x.x,",").concat(x.y,`
1147    A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(p.x,",").concat(p.y,`
1148    A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(m<0),",").concat(y.x,",").concat(y.y,`
1149    A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(b.x,",").concat(b.y,`
1150  `);if(a>0){var N=Bj({cx:n,cy:s,radius:a,angle:d,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=N.circleTangency,C=N.lineTangency,k=N.theta,E=Bj({cx:n,cy:s,radius:a,angle:u,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),R=E.circleTangency,T=E.lineTangency,D=E.theta,A=c?Math.abs(d-u):Math.abs(d-u)-k-D;if(A<0&&o===0)return"".concat(j,"L").concat(n,",").concat(s,"Z");j+="L".concat(T.x,",").concat(T.y,`
1151      A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(R.x,",").concat(R.y,`
1152      A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(m>0),",").concat(_.x,",").concat(_.y,`
1153      A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(C.x,",").concat(C.y,"Z")}else j+="L".concat(n,",").concat(s,"Z");return j},hHe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ese=function(t){var n=EF(EF({},hHe),t),s=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,d=n.cornerIsExternal,u=n.startAngle,m=n.endAngle,f=n.className;if(o<i||u===m)return null;var p=Tr("recharts-sector",f),x=o-i,g=Mi(l,x,0,!0),v;return g>0&&Math.abs(u-m)<360?v=mHe({cx:s,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(g,x/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:u,endAngle:m}):v=Jne({cx:s,cy:a,innerRadius:i,outerRadius:o,startAngle:u,endAngle:m}),Y.createElement("path",MO({},ir(n,!0),{className:p,d:v,role:"img"}))};function E0(e){"@babel/helpers - typeof";return E0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E0(e)}function IO(){return IO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},IO.apply(this,arguments)}function AF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function TF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AF(Object(n),!0).forEach(function(s){fHe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function fHe(e,t,n){return t=pHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pHe(e){var t=xHe(e,"string");return E0(t)=="symbol"?t:t+""}function xHe(e,t){if(E0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(E0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var RF={curveBasisClosed:hMe,curveBasisOpen:fMe,curveBasis:mMe,curveBumpX:QDe,curveBumpY:JDe,curveLinearClosed:pMe,curveLinear:F2,curveMonotoneX:xMe,curveMonotoneY:gMe,curveNatural:vMe,curveStep:yMe,curveStepAfter:wMe,curveStepBefore:bMe},zj=function(t){return t.x===+t.x&&t.y===+t.y},xy=function(t){return t.x},gy=function(t){return t.y},gHe=function(t,n){if(Nr(t))return t;var s="curve".concat(V2(t));return(s==="curveMonotone"||s==="curveBump")&&n?RF["".concat(s).concat(n==="vertical"?"Y":"X")]:RF[s]||F2},vHe=function(t){var n=t.type,s=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,d=c===void 0?!1:c,u=gHe(s,l),m=d?i.filter(function(g){return zj(g)}):i,f;if(Array.isArray(o)){var p=d?o.filter(function(g){return zj(g)}):o,x=m.map(function(g,v){return TF(TF({},g),{},{base:p[v]})});return l==="vertical"?f=Pj().y(gy).x1(xy).x0(function(g){return g.base.x}):f=Pj().x(xy).y1(gy).y0(function(g){return g.base.y}),f.defined(zj).curve(u),f(x)}return l==="vertical"&&xt(o)?f=Pj().y(gy).x1(xy).x0(o):xt(o)?f=Pj().x(xy).y1(gy).y0(o):f=Xte().x(xy).y(gy),f.defined(zj).curve(u),f(m)},Dx=function(t){var n=t.className,s=t.points,a=t.path,i=t.pathRef;if((!s||!s.length)&&!a)return null;var o=s&&s.length?vHe(t):a;return h.createElement("path",IO({},ir(t,!1),XN(t),{className:Tr("recharts-curve",n),d:o,ref:i}))},tse={exports:{}},yHe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",bHe=yHe,wHe=bHe;function rse(){}function nse(){}nse.resetWarningCache=rse;var jHe=function(){function e(s,a,i,o,l,c){if(c!==wHe){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
1153:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:nse,resetWarningCache:rse};return n.PropTypes=n,n};tse.exports=jHe();var NHe=tse.exports;const Sn=Mn(NHe);var SHe=Object.getOwnPropertyNames,_He=Object.getOwnPropertySymbols,CHe=Object.prototype.hasOwnProperty;function OF(e,t){return function(s,a,i){return e(s,a,i)&&t(s,a,i)}}function qj(e){return function(n,s,a){if(!n||!s||typeof n!="object"||typeof s!="object")return e(n,s,a);var i=a.cache,o=i.get(n),l=i.get(s);if(o&&l)return o===s&&l===n;i.set(n,s),i.set(s,n);var c=e(n,s,a);return i.delete(n),i.delete(s),c}}function PF(e){return SHe(e).concat(_He(e))}var kHe=Object.hasOwn||function(e,t){return CHe.call(e,t)};function up(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var EHe="__v",AHe="__o",THe="_owner",DF=Object.getOwnPropertyDescriptor,MF=Object.keys;function RHe(e,t,n){var s=e.length;if(t.length!==s)return!1;for(;s-- >0;)if(!n.equals(e[s],t[s],s,s,e,t,n))return!1;return!0}function OHe(e,t){return up(e.getTime(),t.getTime())}function PHe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function DHe(e,t){return e===t}function IF(e,t,n){var s=e.size;if(s!==t.size)return!1;if(!s)return!0;for(var a=new Array(s),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var d=t.entries(),u=!1,m=0;(l=d.next())&&!l.done;){if(a[m]){m++;continue}var f=o.value,p=l.value;if(n.equals(f[0],p[0],c,m,e,t,n)&&n.equals(f[1],p[1],f[0],p[0],e,t,n)){u=a[m]=!0;break}m++}if(!u)return!1;c++}return!0}var MHe=up;function IHe(e,t,n){var s=MF(e),a=s.length;if(MF(t).length!==a)return!1;for(;a-- >0;)if(!sse(e,t,n,s[a]))return!1;return!0}function vy(e,t,n){var s=PF(e),a=s.length;if(PF(t).length!==a)return!1;for(var i,o,l;a-- >0;)if(i=s[a],!sse(e,t,n,i)||(o=DF(e,i),l=DF(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function LHe(e,t){return up(e.valueOf(),t.valueOf())}function $He(e,t){return e.source===t.source&&e.flags===t.flags}function LF(e,t,n){var s=e.size;if(s!==t.size)return!1;if(!s)return!0;for(var a=new Array(s),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),d=!1,u=0;(l=c.next())&&!l.done;){if(!a[u]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){d=a[u]=!0;break}u++}if(!d)return!1}return!0}function VHe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function UHe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function sse(e,t,n,s){return(s===THe||s===AHe||s===EHe)&&(e.$$typeof||t.$$typeof)?!0:kHe(t,s)&&n.equals(e[s],t[s],s,s,e,t,n)}var FHe="[object Arguments]",BHe="[object Boolean]",zHe="[object Date]",qHe="[object Error]",HHe="[object Map]",WHe="[object Number]",YHe="[object Object]",GHe="[object RegExp]",KHe="[object Set]",XHe="[object String]",ZHe="[object URL]",QHe=Array.isArray,$F=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,VF=Object.assign,JHe=Object.prototype.toString.call.bind(Object.prototype.toString);function eWe(e){var t=e.areArraysEqual,n=e.areDatesEqual,s=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,d=e.areRegExpsEqual,u=e.areSetsEqual,m=e.areTypedArraysEqual,f=e.areUrlsEqual;return function(x,g,v){if(x===g)return!0;if(x==null||g==null)return!1;var y=typeof x;if(y!==typeof g)return!1;if(y!=="object")return y==="number"?o(x,g,v):y==="function"?a(x,g,v):!1;var b=x.constructor;if(b!==g.constructor)return!1;if(b===Object)return l(x,g,v);if(QHe(x))return t(x,g,v);if($F!=null&&$F(x))return m(x,g,v);if(b===Date)return n(x,g,v);if(b===RegExp)return d(x,g,v);if(b===Map)return i(x,g,v);if(b===Set)return u(x,g,v);var w=JHe(x);return w===zHe?n(x,g,v):w===GHe?d(x,g,v):w===HHe?i(x,g,v):w===KHe?u(x,g,v):w===YHe?typeof x.then!="function"&&typeof g.then!="function"&&l(x,g,v):w===ZHe?f(x,g,v):w===qHe?s(x,g,v):w===FHe?l(x,g,v):w===BHe||w===WHe||w===XHe?c(x,g,v):!1}}
vendor: 29,706 bytes, lines 1153-1171
1153function tWe(e){var t=e.circular,n=e.createCustomConfig,s=e.strict,a={areArraysEqual:s?vy:RHe,areDatesEqual:OHe,areErrorsEqual:PHe,areFunctionsEqual:DHe,areMapsEqual:s?OF(IF,vy):IF,areNumbersEqual:MHe,areObjectsEqual:s?vy:IHe,arePrimitiveWrappersEqual:LHe,areRegExpsEqual:$He,areSetsEqual:s?OF(LF,vy):LF,areTypedArraysEqual:s?vy:VHe,areUrlsEqual:UHe};if(n&&(a=VF({},a,n(a))),t){var i=qj(a.areArraysEqual),o=qj(a.areMapsEqual),l=qj(a.areObjectsEqual),c=qj(a.areSetsEqual);a=VF({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return a}function rWe(e){return function(t,n,s,a,i,o,l){return e(t,n,l)}}function nWe(e){var t=e.circular,n=e.comparator,s=e.createState,a=e.equals,i=e.strict;if(s)return function(c,d){var u=s(),m=u.cache,f=m===void 0?t?new WeakMap:void 0:m,p=u.meta;return n(c,d,{cache:f,equals:a,meta:p,strict:i})};if(t)return function(c,d){return n(c,d,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,d){return n(c,d,o)}}var sWe=ph();ph({strict:!0});ph({circular:!0});ph({circular:!0,strict:!0});ph({createInternalComparator:function(){return up}});ph({strict:!0,createInternalComparator:function(){return up}});ph({circular:!0,createInternalComparator:function(){return up}});ph({circular:!0,createInternalComparator:function(){return up},strict:!0});function ph(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,s=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,l=tWe(e),c=eWe(l),d=s?s(c):rWe(c);return nWe({circular:n,comparator:c,createState:a,equals:d,strict:o})}function aWe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function UF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,s=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):aWe(a)};requestAnimationFrame(s)}function LO(e){"@babel/helpers - typeof";return LO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LO(e)}function iWe(e){return dWe(e)||cWe(e)||lWe(e)||oWe()}function oWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1154In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lWe(e,t){if(e){if(typeof e=="string")return FF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FF(e,t)}}function FF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function cWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dWe(e){if(Array.isArray(e))return e}function uWe(){var e={},t=function(){return null},n=!1,s=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,l=iWe(o),c=l[0],d=l.slice(1);if(typeof c=="number"){UF(a.bind(null,d),c);return}a(c),UF(a.bind(null,d));return}LO(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,s(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function A0(e){"@babel/helpers - typeof";return A0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A0(e)}function BF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function zF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BF(Object(n),!0).forEach(function(s){ase(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ase(e,t,n){return t=mWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mWe(e){var t=hWe(e,"string");return A0(t)==="symbol"?t:String(t)}function hWe(e,t){if(A0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(A0(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fWe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(s,a){return s.filter(function(i){return a.includes(i)})})},pWe=function(t){return t},xWe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},mb=function(t,n){return Object.keys(n).reduce(function(s,a){return zF(zF({},s),{},ase({},a,t(a,n[a])))},{})},qF=function(t,n,s){return t.map(function(a){return"".concat(xWe(a)," ").concat(n,"ms ").concat(s)}).join(",")};function gWe(e,t){return bWe(e)||yWe(e,t)||ise(e,t)||vWe()}function vWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1155In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yWe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function bWe(e){if(Array.isArray(e))return e}function wWe(e){return SWe(e)||NWe(e)||ise(e)||jWe()}function jWe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1156In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ise(e,t){if(e){if(typeof e=="string")return $O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $O(e,t)}}function NWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SWe(e){if(Array.isArray(e))return $O(e)}function $O(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}var CS=1e-4,ose=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},lse=function(t,n){return t.map(function(s,a){return s*Math.pow(n,a)}).reduce(function(s,a){return s+a})},HF=function(t,n){return function(s){var a=ose(t,n);return lse(a,s)}},_We=function(t,n){return function(s){var a=ose(t,n),i=[].concat(wWe(a.map(function(o,l){return o*l}).slice(1)),[0]);return lse(i,s)}},WF=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];var a=n[0],i=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var d=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),u=gWe(d,4);a=u[0],i=u[1],o=u[2],l=u[3]}}}var m=HF(a,o),f=HF(i,l),p=_We(a,o),x=function(y){return y>1?1:y<0?0:y},g=function(y){for(var b=y>1?1:y,w=b,S=0;S<8;++S){var j=m(w)-b,N=p(w);if(Math.abs(j-b)<CS||N<CS)return f(w);w=x(w-j/N)}return f(w)};return g.isStepper=!1,g},CWe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,s=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(u,m,f){var p=-(u-m)*s,x=f*i,g=f+(p-x)*l/1e3,v=f*l/1e3+u;return Math.abs(v-m)<CS&&Math.abs(g)<CS?[m,0]:[v,g]};return c.isStepper=!0,c.dt=l,c},kWe=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return WF(a);case"spring":return CWe();default:if(a.split("(")[0]==="cubic-bezier")return WF(a)}return typeof a=="function"?a:null};function T0(e){"@babel/helpers - typeof";return T0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T0(e)}function YF(e){return TWe(e)||AWe(e)||cse(e)||EWe()}function EWe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1157In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TWe(e){if(Array.isArray(e))return UO(e)}function GF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GF(Object(n),!0).forEach(function(s){VO(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function VO(e,t,n){return t=RWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RWe(e){var t=OWe(e,"string");return T0(t)==="symbol"?t:String(t)}function OWe(e,t){if(T0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(T0(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PWe(e,t){return IWe(e)||MWe(e,t)||cse(e,t)||DWe()}function DWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1158In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cse(e,t){if(e){if(typeof e=="string")return UO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UO(e,t)}}function UO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function MWe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function IWe(e){if(Array.isArray(e))return e}var kS=function(t,n,s){return t+(n-t)*s},FO=function(t){var n=t.from,s=t.to;return n!==s},LWe=function e(t,n,s){var a=mb(function(i,o){if(FO(o)){var l=t(o.from,o.to,o.velocity),c=PWe(l,2),d=c[0],u=c[1];return ni(ni({},o),{},{from:d,velocity:u})}return o},n);return s<1?mb(function(i,o){return FO(o)?ni(ni({},o),{},{velocity:kS(o.velocity,a[i].velocity,s),from:kS(o.from,a[i].from,s)}):o},n):e(t,a,s-1)};const $We=function(e,t,n,s,a){var i=fWe(e,t),o=i.reduce(function(v,y){return ni(ni({},v),{},VO({},y,[e[y],t[y]]))},{}),l=i.reduce(function(v,y){return ni(ni({},v),{},VO({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,d,u,m=function(){return null},f=function(){return mb(function(y,b){return b.from},l)},p=function(){return!Object.values(l).filter(FO).length},x=function(y){d||(d=y);var b=y-d,w=b/n.dt;l=LWe(n,l,w),a(ni(ni(ni({},e),t),f())),d=y,p()||(c=requestAnimationFrame(m))},g=function(y){u||(u=y);var b=(y-u)/s,w=mb(function(j,N){return kS.apply(void 0,YF(N).concat([n(b)]))},o);if(a(ni(ni(ni({},e),t),w)),b<1)c=requestAnimationFrame(m);else{var S=mb(function(j,N){return kS.apply(void 0,YF(N).concat([n(1)]))},o);a(ni(ni(ni({},e),t),S))}};return m=n.isStepper?x:g,function(){return requestAnimationFrame(m),function(){cancelAnimationFrame(c)}}};function Og(e){"@babel/helpers - typeof";return Og=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Og(e)}var VWe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function UWe(e,t){if(e==null)return{};var n=FWe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function FWe(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,i;for(i=0;i<s.length;i++)a=s[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function FE(e){return HWe(e)||qWe(e)||zWe(e)||BWe()}function BWe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1159In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zWe(e,t){if(e){if(typeof e=="string")return BO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BO(e,t)}}function qWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HWe(e){if(Array.isArray(e))return BO(e)}function BO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function KF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function kl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KF(Object(n),!0).forEach(function(s){My(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function My(e,t,n){return t=dse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YWe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,dse(s.key),s)}}function GWe(e,t,n){return t&&YWe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dse(e){var t=KWe(e,"string");return Og(t)==="symbol"?t:String(t)}function KWe(e,t){if(Og(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Og(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XWe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zO(e,t)}function zO(e,t){return zO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},zO(e,t)}function ZWe(e){var t=QWe();return function(){var s=ES(e),a;if(t){var i=ES(this).constructor;a=Reflect.construct(s,arguments,i)}else a=s.apply(this,arguments);return qO(this,a)}}function qO(e,t){if(t&&(Og(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HO(e)}function HO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ES(e){return ES=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ES(e)}var Uc=function(e){XWe(n,e);var t=ZWe(n);function n(s,a){var i;WWe(this,n),i=t.call(this,s,a);var o=i.props,l=o.isActive,c=o.attributeName,d=o.from,u=o.to,m=o.steps,f=o.children,p=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(HO(i)),i.changeStyle=i.changeStyle.bind(HO(i)),!l||p<=0)return i.state={style:{}},typeof f=="function"&&(i.state={style:u}),qO(i);if(m&&m.length)i.state={style:m[0].style};else if(d){if(typeof f=="function")return i.state={style:d},qO(i);i.state={style:c?My({},c,d):d}}else i.state={style:{}};return i}return GWe(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,d=i.shouldReAnimate,u=i.to,m=i.from,f=this.state.style;if(l){if(!o){var p={style:c?My({},c,u):u};this.state&&f&&(c&&f[c]!==u||!c&&f!==u)&&this.setState(p);return}if(!(sWe(a.to,u)&&a.canBegin&&a.isActive)){var x=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=x||d?m:a.to;if(this.state&&f){var v={style:c?My({},c,g):g};(c&&f[c]!==g||!c&&f!==g)&&this.setState(v)}this.runAnimation(kl(kl({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,c=a.duration,d=a.easing,u=a.begin,m=a.onAnimationEnd,f=a.onAnimationStart,p=$We(o,l,kWe(d),c,this.changeStyle),x=function(){i.stopJSAnimation=p()};this.manager.start([f,u,x,c,m])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,d=o[0],u=d.style,m=d.duration,f=m===void 0?0:m,p=function(g,v,y){if(y===0)return g;var b=v.duration,w=v.easing,S=w===void 0?"ease":w,j=v.style,N=v.properties,_=v.onAnimationEnd,C=y>0?o[y-1]:v,k=N||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(FE(g),[i.runJSAnimation.bind(i,{from:C.style,to:j,duration:b,easing:S}),b]);var E=qF(k,b,S),R=kl(kl(kl({},C.style),j),{},{transition:E});return[].concat(FE(g),[R,b,_]).filter(pWe)};return this.manager.start([c].concat(FE(o.reduce(p,[u,Math.max(f,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=uWe());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,d=a.easing,u=a.onAnimationStart,m=a.onAnimationEnd,f=a.steps,p=a.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof d=="function"||typeof p=="function"||d==="spring"){this.runJSAnimation(a);return}if(f.length>1){this.runStepAnimation(a);return}var g=l?My({},l,c):c,v=qF(Object.keys(g),o,d);x.start([u,i,kl(kl({},g),{},{transition:v}),o,m])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=UWe(a,VWe),d=h.Children.count(i),u=this.state.style;if(typeof i=="function")return i(u);if(!l||d===0||o<=0)return i;var m=function(p){var x=p.props,g=x.style,v=g===void 0?{}:g,y=x.className,b=h.cloneElement(p,kl(kl({},c),{},{style:kl(kl({},v),u),className:y}));return b};return d===1?m(h.Children.only(i)):Y.createElement("div",null,h.Children.map(i,function(f){return m(f)}))}}]),n}(h.PureComponent);Uc.displayName="Animate";Uc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Uc.propTypes={from:Sn.oneOfType([Sn.object,Sn.string]),to:Sn.oneOfType([Sn.object,Sn.string]),attributeName:Sn.string,duration:Sn.number,begin:Sn.number,easing:Sn.oneOfType([Sn.string,Sn.func]),steps:Sn.arrayOf(Sn.shape({duration:Sn.number.isRequired,style:Sn.object.isRequired,easing:Sn.oneOfType([Sn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Sn.func]),properties:Sn.arrayOf("string"),onAnimationEnd:Sn.func})),children:Sn.oneOfType([Sn.node,Sn.func]),isActive:Sn.bool,canBegin:Sn.bool,onAnimationEnd:Sn.func,shouldReAnimate:Sn.bool,onAnimationStart:Sn.func,onAnimationReStart:Sn.func};function R0(e){"@babel/helpers - typeof";return R0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R0(e)}function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},AS.apply(this,arguments)}function JWe(e,t){return nYe(e)||rYe(e,t)||tYe(e,t)||eYe()}function eYe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1160In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tYe(e,t){if(e){if(typeof e=="string")return XF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XF(e,t)}}function XF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function rYe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function nYe(e){if(Array.isArray(e))return e}function ZF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function QF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZF(Object(n),!0).forEach(function(s){sYe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZF(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function sYe(e,t,n){return t=aYe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aYe(e){var t=iYe(e,"string");return R0(t)=="symbol"?t:t+""}function iYe(e,t){if(R0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(R0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JF=function(t,n,s,a,i){var o=Math.min(Math.abs(s)/2,Math.abs(a)/2),l=a>=0?1:-1,c=s>=0?1:-1,d=a>=0&&s>=0||a<0&&s<0?1:0,u;if(o>0&&i instanceof Array){for(var m=[0,0,0,0],f=0,p=4;f<p;f++)m[f]=i[f]>o?o:i[f];u="M".concat(t,",").concat(n+l*m[0]),m[0]>0&&(u+="A ".concat(m[0],",").concat(m[0],",0,0,").concat(d,",").concat(t+c*m[0],",").concat(n)),u+="L ".concat(t+s-c*m[1],",").concat(n),m[1]>0&&(u+="A ".concat(m[1],",").concat(m[1],",0,0,").concat(d,`,
1161        `).concat(t+s,",").concat(n+l*m[1])),u+="L ".concat(t+s,",").concat(n+a-l*m[2]),m[2]>0&&(u+="A ".concat(m[2],",").concat(m[2],",0,0,").concat(d,`,
1162        `).concat(t+s-c*m[2],",").concat(n+a)),u+="L ".concat(t+c*m[3],",").concat(n+a),m[3]>0&&(u+="A ".concat(m[3],",").concat(m[3],",0,0,").concat(d,`,
1163        `).concat(t,",").concat(n+a-l*m[3])),u+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);u="M ".concat(t,",").concat(n+l*x,`
1164            A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(t+c*x,",").concat(n,`
1165            L `).concat(t+s-c*x,",").concat(n,`
1166            A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(t+s,",").concat(n+l*x,`
1167            L `).concat(t+s,",").concat(n+a-l*x,`
1168            A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(t+s-c*x,",").concat(n+a,`
1169            L `).concat(t+c*x,",").concat(n+a,`
1170            A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(t,",").concat(n+a-l*x," Z")}else u="M ".concat(t,",").concat(n," h ").concat(s," v ").concat(a," h ").concat(-s," Z");return u},oYe=function(t,n){if(!t||!n)return!1;var s=t.x,a=t.y,i=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var d=Math.min(i,i+l),u=Math.max(i,i+l),m=Math.min(o,o+c),f=Math.max(o,o+c);return s>=d&&s<=u&&a>=m&&a<=f}return!1},lYe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KM=function(t){var n=QF(QF({},lYe),t),s=h.useRef(),a=h.useState(-1),i=JWe(a,2),o=i[0],l=i[1];h.useEffect(function(){if(s.current&&s.current.getTotalLength)try{var S=s.current.getTotalLength();S&&l(S)}catch{}},[]);var c=n.x,d=n.y,u=n.width,m=n.height,f=n.radius,p=n.className,x=n.animationEasing,g=n.animationDuration,v=n.animationBegin,y=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||d!==+d||u!==+u||m!==+m||u===0||m===0)return null;var w=Tr("recharts-rectangle",p);return b?Y.createElement(Uc,{canBegin:o>0,from:{width:u,height:m,x:c,y:d},to:{width:u,height:m,x:c,y:d},duration:g,animationEasing:x,isActive:b},function(S){var j=S.width,N=S.height,_=S.x,C=S.y;return Y.createElement(Uc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,isActive:y,easing:x},Y.createElement("path",AS({},ir(n,!0),{className:w,d:JF(_,C,j,N,f),ref:s})))}):Y.createElement("path",AS({},ir(n,!0),{className:w,d:JF(c,d,u,m,f)}))},cYe=["points","className","baseLinePoints","connectNulls"];function dx(){return dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},dx.apply(this,arguments)}function dYe(e,t){if(e==null)return{};var n=uYe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function uYe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function eB(e){return pYe(e)||fYe(e)||hYe(e)||mYe()}function mYe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1171In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hYe(e,t){if(e){if(typeof e=="string")return WO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WO(e,t)}}function fYe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pYe(e){if(Array.isArray(e))return WO(e)}function WO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}var tB=function(t){return t&&t.x===+t.x&&t.y===+t.y},xYe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(s){tB(s)?n[n.length-1].push(s):n[n.length-1].length>0&&n.push([])}),tB(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},hb=function(t,n){var s=xYe(t);n&&(s=[s.reduce(function(i,o){return[].concat(eB(i),eB(o))},[])]);var a=s.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return s.length===1?"".concat(a,"Z"):a},gYe=function(t,n,s){var a=hb(t,s);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(hb(n.reverse(),s).slice(1))},vYe=function(t){var n=t.points,s=t.className,a=t.baseLinePoints,i=t.connectNulls,o=dYe(t,cYe);if(!n||!n.length)return null;var l=Tr("recharts-polygon",s);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",d=gYe(n,a,i);return Y.createElement("g",{className:l},Y.createElement("path",dx({},ir(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?Y.createElement("path",dx({},ir(o,!0),{fill:"none",d:hb(n,i)})):null,c?Y.createElement("path",dx({},ir(o,!0),{fill:"none",d:hb(a,i)})):null)}var u=hb(n,i);return Y.createElement("path",dx({},ir(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:l,d:u}))};function YO(){return YO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},YO.apply(this,arguments)}var sC=function(t){var n=t.cx,s=t.cy,a=t.r,i=t.className,o=Tr("recharts-dot",i);return n===+n&&s===+s&&a===+a?h.createElement("circle",YO({},ir(t,!1),XN(t),{className:o,cx:n,cy:s,r:a}
1171)):null};function O0(e){"@babel/helpers - typeof";return O0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O0(e)}var yYe=["x","y","top","left","width","height","className"];function GO(){return GO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},GO.apply(this,arguments)}function rB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function bYe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rB(Object(n),!0).forEach(function(s){wYe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function wYe(e,t,n){return t=jYe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jYe(e){var t=NYe(e,"string");return O0(t)=="symbol"?t:t+""}function NYe(e,t){if(O0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(O0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SYe(e,t){if(e==null)return{};var n=_Ye(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function _Ye(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}var CYe=function(t,n,s,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(s)},kYe=function(t){var n=t.x,s=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,d=c===void 0?0:c,u=t.width,m=u===void 0?0:u,f=t.height,p=f===void 0?0:f,x=t.className,g=SYe(t,yYe),v=bYe({x:s,y:i,top:l,left:d,width:m,height:p},g);return!xt(s)||!xt(i)||!xt(m)||!xt(p)||!xt(l)||!xt(d)?null:Y.createElement("path",GO({},ir(v,!0),{className:Tr("recharts-cross",x),d:CYe(s,i,m,p,l,d)}))},EYe=J2,AYe=Nne,TYe=mh;function RYe(e,t){return e&&e.length?EYe(e,TYe(t),AYe):void 0}var OYe=RYe;const PYe=Mn(OYe);var DYe=J2,MYe=mh,IYe=Sne;function LYe(e,t){return e&&e.length?DYe(e,MYe(t),IYe):void 0}var $Ye=LYe;const VYe=Mn($Ye);var UYe=["cx","cy","angle","ticks","axisLine"],FYe=["ticks","tick","angle","tickFormatter","stroke"];function Pg(e){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pg(e)}function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fb.apply(this,arguments)}function nB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function _h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nB(Object(n),!0).forEach(function(s){aC(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function sB(e,t){if(e==null)return{};var n=BYe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function BYe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function zYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,mse(s.key),s)}}
vendor: 28,346 bytes, lines 1171-1172
1171function qYe(e,t,n){return t&&aB(e.prototype,t),n&&aB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HYe(e,t,n){return t=TS(t),WYe(e,use()?Reflect.construct(t,n||[],TS(e).constructor):t.apply(e,n))}function WYe(e,t){if(t&&(Pg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YYe(e)}function YYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function use(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(use=function(){return!!e})()}function TS(e){return TS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TS(e)}function GYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&KO(e,t)}function KO(e,t){return KO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},KO(e,t)}function aC(e,t,n){return t=mse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mse(e){var t=KYe(e,"string");return Pg(t)=="symbol"?t:t+""}function KYe(e,t){if(Pg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Pg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iC=function(e){function t(){return zYe(this,t),HYe(this,t,arguments)}return GYe(t,e),qYe(t,[{key:"getTickValueCoord",value:function(s){var a=s.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return ls(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var s=this.props.orientation,a;switch(s){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var s=this.props,a=s.cx,i=s.cy,o=s.angle,l=s.ticks,c=PYe(l,function(u){return u.coordinate||0}),d=VYe(l,function(u){return u.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:d.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var s=this.props,a=s.cx,i=s.cy,o=s.angle,l=s.ticks,c=s.axisLine,d=sB(s,UYe),u=l.reduce(function(x,g){return[Math.min(x[0],g.coordinate),Math.max(x[1],g.coordinate)]},[1/0,-1/0]),m=ls(a,i,u[0],o),f=ls(a,i,u[1],o),p=_h(_h(_h({},ir(d,!1)),{},{fill:"none"},ir(c,!1)),{},{x1:m.x,y1:m.y,x2:f.x,y2:f.y});return Y.createElement("line",fb({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var s=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,d=a.stroke,u=sB(a,FYe),m=this.getTickTextAnchor(),f=ir(u,!1),p=ir(o,!1),x=i.map(function(g,v){var y=s.getTickValueCoord(g),b=_h(_h(_h(_h({textAnchor:m,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},f),{},{stroke:"none",fill:d},p),{},{index:v},y),{},{payload:g});return Y.createElement(ln,fb({className:Tr("recharts-polar-radius-axis-tick",Zne(o)),key:"tick-".concat(g.coordinate)},zf(s.props,g,v)),t.renderTickItem(o,b,c?c(g.value,v):g.value))});return Y.createElement(ln,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var s=this.props,a=s.ticks,i=s.axisLine,o=s.tick;return!a||!a.length?null:Y.createElement(ln,{className:Tr("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),qa.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(s,a,i){var o;return Y.isValidElement(s)?o=Y.cloneElement(s,a):Nr(s)?o=s(a):o=Y.createElement(qf,fb({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(h.PureComponent);aC(iC,"displayName","PolarRadiusAxis");aC(iC,"axisType","radiusAxis");aC(iC,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Dg(e){"@babel/helpers - typeof";return Dg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dg(e)}function zh(){return zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},zh.apply(this,arguments)}function iB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ch(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iB(Object(n),!0).forEach(function(s){oC(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function XYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,fse(s.key),s)}}function ZYe(e,t,n){return t&&oB(e.prototype,t),n&&oB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QYe(e,t,n){return t=RS(t),JYe(e,hse()?Reflect.construct(t,n||[],RS(e).constructor):t.apply(e,n))}function JYe(e,t){if(t&&(Dg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eGe(e)}function eGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hse=function(){return!!e})()}function RS(e){return RS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},RS(e)}function tGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XO(e,t)}function XO(e,t){return XO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},XO(e,t)}function oC(e,t,n){return t=fse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fse(e){var t=rGe(e,"string");return Dg(t)=="symbol"?t:t+""}function rGe(e,t){if(Dg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Dg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nGe=Math.PI/180,lB=1e-5,lC=function(e){function t(){return XYe(this,t),QYe(this,t,arguments)}return tGe(t,e),ZYe(t,[{key:"getTickLineCoord",value:function(s){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,d=a.tickSize,u=d||8,m=ls(i,o,l,s.coordinate),f=ls(i,o,l+(c==="inner"?-1:1)*u,s.coordinate);return{x1:m.x,y1:m.y,x2:f.x,y2:f.y}}},{key:"getTickTextAnchor",value:function(s){var a=this.props.orientation,i=Math.cos(-s.coordinate*nGe),o;return i>lB?o=a==="outer"?"start":"end":i<-lB?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var s=this.props,a=s.cx,i=s.cy,o=s.radius,l=s.axisLine,c=s.axisLineType,d=Ch(Ch({},ir(this.props,!1)),{},{fill:"none"},ir(l,!1));if(c==="circle")return Y.createElement(sC,zh({className:"recharts-polar-angle-axis-line"},d,{cx:a,cy:i,r:o}));var u=this.props.ticks,m=u.map(function(f){return ls(a,i,o,f.coordinate)});return Y.createElement(vYe,zh({className:"recharts-polar-angle-axis-line"},d,{points:m}))}},{key:"renderTicks",value:function(){var s=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,d=a.stroke,u=ir(this.props,!1),m=ir(o,!1),f=Ch(Ch({},u),{},{fill:"none"},ir(l,!1)),p=i.map(function(x,g){var v=s.getTickLineCoord(x),y=s.getTickTextAnchor(x),b=Ch(Ch(Ch({textAnchor:y},u),{},{stroke:"none",fill:d},m),{},{index:g,payload:x,x:v.x2,y:v.y2});return Y.createElement(ln,zh({className:Tr("recharts-polar-angle-axis-tick",Zne(o)),key:"tick-".concat(x.coordinate)},zf(s.props,x,g)),l&&Y.createElement("line",zh({className:"recharts-polar-angle-axis-tick-line"},f,v)),o&&t.renderTickItem(o,b,c?c(x.value,g):x.value))});return Y.createElement(ln,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var s=this.props,a=s.ticks,i=s.radius,o=s.axisLine;return i<=0||!a||!a.length?null:Y.createElement(ln,{className:Tr("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(s,a,i){var o;return Y.isValidElement(s)?o=Y.cloneElement(s,a):Nr(s)?o=s(a):o=Y.createElement(qf,zh({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(h.PureComponent);oC(lC,"displayName","PolarAngleAxis");oC(lC,"axisType","angleAxis");oC(lC,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var sGe=bre,aGe=sGe(Object.getPrototypeOf,Object),iGe=aGe,oGe=hu,lGe=iGe,cGe=fu,dGe="[object Object]",uGe=Function.prototype,mGe=Object.prototype,pse=uGe.toString,hGe=mGe.hasOwnProperty,fGe=pse.call(Object);function pGe(e){if(!cGe(e)||oGe(e)!=dGe)return!1;var t=lGe(e);if(t===null)return!0;var n=hGe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&pse.call(n)==fGe}var xGe=pGe;const gGe=Mn(xGe);var vGe=hu,yGe=fu,bGe="[object Boolean]";function wGe(e){return e===!0||e===!1||yGe(e)&&vGe(e)==bGe}var jGe=wGe;const NGe=Mn(jGe);function P0(e){"@babel/helpers - typeof";return P0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P0(e)}function OS(){return OS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},OS.apply(this,arguments)}function SGe(e,t){return EGe(e)||kGe(e,t)||CGe(e,t)||_Ge()}function _Ge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1172In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CGe(e,t){if(e){if(typeof e=="string")return cB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cB(e,t)}}function cB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function kGe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function EGe(e){if(Array.isArray(e))return e}function dB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function uB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dB(Object(n),!0).forEach(function(s){AGe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function AGe(e,t,n){return t=TGe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TGe(e){var t=RGe(e,"string");return P0(t)=="symbol"?t:t+""}function RGe(e,t){if(P0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(P0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mB=function(t,n,s,a,i){var o=s-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+s,",").concat(n),l+="L ".concat(t+s-o/2,",").concat(n+i),l+="L ".concat(t+s-o/2-a,",").concat(n+i),l+="L ".concat(t,",").concat(n," Z"),l},OGe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PGe=function(t){var n=uB(uB({},OGe),t),s=h.useRef(),a=h.useState(-1),i=SGe(a,2),o=i[0],l=i[1];h.useEffect(function(){if(s.current&&s.current.getTotalLength)try{var w=s.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,d=n.y,u=n.upperWidth,m=n.lowerWidth,f=n.height,p=n.className,x=n.animationEasing,g=n.animationDuration,v=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||d!==+d||u!==+u||m!==+m||f!==+f||u===0&&m===0||f===0)return null;var b=Tr("recharts-trapezoid",p);return y?Y.createElement(Uc,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:f,x:c,y:d},to:{upperWidth:u,lowerWidth:m,height:f,x:c,y:d},duration:g,animationEasing:x,isActive:y},function(w){var S=w.upperWidth,j=w.lowerWidth,N=w.height,_=w.x,C=w.y;return Y.createElement(Uc,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,easing:x},Y.createElement("path",OS({},ir(n,!0),{className:b,d:mB(_,C,S,j,N),ref:s})))}):Y.createElement("g",null,Y.createElement("path",OS({},ir(n,!0),{className:b,d:mB(c,d,u,m,f)})))},DGe=["option","shapeType","propTransformer","activeClassName","isActive"];function D0(e){"@babel/helpers - typeof";return D0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D0(e)}function MGe(e,t){if(e==null)return{};var n=IGe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function IGe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function hB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function PS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hB(Object(n),!0).forEach(function(s){LGe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function LGe(e,t,n){return t=$Ge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ge(e){var t=VGe(e,"string");return D0(t)=="symbol"?t:t+""}function VGe(e,t){if(D0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(D0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UGe(e,t){return PS(PS({},t),e)}function FGe(e,t){return e==="symbols"}function fB(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Y.createElement(KM,n);case"trapezoid":return Y.createElement(PGe,n);case"sector":return Y.createElement(ese,n);case"symbols":if(FGe(t))return Y.createElement(hM,n);break;default:return null}}function BGe(e){return h.isValidElement(e)?e.props:e}function xse(e){var t=e.option,n=e.shapeType,s=e.propTransformer,a=s===void 0?UGe:s,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=MGe(e,DGe),d;if(h.isValidElement(t))d=h.cloneElement(t,PS(PS({},c),BGe(t)));else if(Nr(t))d=t(c);else if(gGe(t)&&!NGe(t)){var u=a(t,c);d=Y.createElement(fB,{shapeType:n,elementProps:u})}else{var m=c;d=Y.createElement(fB,{shapeType:n,elementProps:m})}return l?Y.createElement(ln,{className:o},d):d}function cC(e,t){return t!=null&&"trapezoids"in e.props}function dC(e,t){return t!=null&&"sectors"in e.props}function M0(e,t){return t!=null&&"points"in e.props}function zGe(e,t){var n,s,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(s=t.labelViewBox)===null||s===void 0?void 0:s.y)||e.y===t.y;return a&&i}function qGe(e,t){var n=e.endAngle===t.endAngle,s=e.startAngle===t.startAngle;return n&&s}function HGe(e,t){var n=e.x===t.x,s=e.y===t.y,a=e.z===t.z;return n&&s&&a}function WGe(e,t){var n;return cC(e,t)?n=zGe:dC(e,t)?n=qGe:M0(e,t)&&(n=HGe),n}function YGe(e,t){var n;return cC(e,t)?n="trapezoids":dC(e,t)?n="sectors":M0(e,t)&&(n="points"),n}function GGe(e,t){if(cC(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(dC(e,t)){var s;return(s=t.tooltipPayload)===null||s===void 0||(s=s[0])===null||s===void 0||(s=s.payload)===null||s===void 0?void 0:s.payload}return M0(e,t)?t.payload:{}}function KGe(e){var t=e.activeTooltipItem,n=e.graphicalItem,s=e.itemData,a=YGe(n,t),i=GGe(n,t),o=s.filter(function(c,d){var u=Tg(i,c),m=n.props[a].filter(function(x){var g=WGe(n,t);return g(x,t)}),f=n.props[a].indexOf(m[m.length-1]),p=d===f;return u&&p}),l=s.indexOf(o[o.length-1]);return l}var R1;function Mg(e){"@babel/helpers - typeof";return Mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mg(e)}function ux(){return ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ux.apply(this,arguments)}function pB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(n),!0).forEach(function(s){Jo(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function XGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,vse(s.key),s)}}function ZGe(e,t,n){return t&&xB(e.prototype,t),n&&xB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QGe(e,t,n){return t=DS(t),JGe(e,gse()?Reflect.construct(t,n||[],DS(e).constructor):t.apply(e,n))}function JGe(e,t){if(t&&(Mg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eKe(e)}function eKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gse=function(){return!!e})()}function DS(e){return DS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},DS(e)}function tKe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZO(e,t)}function ZO(e,t){return ZO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},ZO(e,t)}function Jo(e,t,n){return t=vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vse(e){var t=rKe(e,"string");return Mg(t)=="symbol"?t:t+""}function rKe(e,t){if(Mg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Mg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xu=function(e){function t(n){var s;return XGe(this,t),s=QGe(this,t,[n]),Jo(s,"pieRef",null),Jo(s,"sectorRefs",[]),Jo(s,"id",Mv("recharts-pie-")),Jo(s,"handleAnimationEnd",function(){var a=s.props.onAnimationEnd;s.setState({isAnimationFinished:!0}),Nr(a)&&a()}),Jo(s,"handleAnimationStart",function(){var a=s.props.onAnimationStart;s.setState({isAnimationFinished:!1}),Nr(a)&&a()}),s.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},s}return tKe(t,e),ZGe(t,[{key:"isActiveIndex",value:function(s){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(s)!==-1:s===a}},{key:"hasActiveIndex",value:function(){var s=this.props.activeIndex;return Array.isArray(s)?s.length!==0:s||s===0}},{key:"renderLabels",value:function(s){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,d=i.valueKey,u=ir(this.props,!1),m=ir(o,!1),f=ir(l,!1),p=o&&o.offsetRadius||20,x=s.map(function(g,v){var y=(g.startAngle+g.endAngle)/2,b=ls(g.cx,g.cy,g.outerRadius+p,y),w=ss(ss(ss(ss({},u),g),{},{stroke:"none"},m),{},{index:v,textAnchor:t.getTextAnchor(b.x,g.cx)},b),S=ss(ss(ss(ss({},u),g),{},{fill:"none",stroke:g.fill},f),{},{index:v,points:[ls(g.cx,g.cy,g.outerRadius,y),b]}),j=c;return Rr(c)&&Rr(d)?j="value":Rr(c)&&(j=d),Y.createElement(ln,{key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(o,w,Pa(g,j)))});return Y.createElement(ln,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(s){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return s.map(function(d,u){if((d==null?void 0:d.startAngle)===0&&(d==null?void 0:d.endAngle)===0&&s.length!==1)return null;var m=a.isActiveIndex(u),f=c&&a.hasActiveIndex()?c:null,p=m?o:f,x=ss(ss({},d),{},{stroke:l?d.fill:d.stroke,tabIndex:-1});return Y.createElement(ln,ux({ref:function(v){v&&!a.sectorRefs.includes(v)&&a.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},zf(a.props,d,u),{key:"sector-".concat(d==null?void 0:d.startAngle,"-").concat(d==null?void 0:d.endAngle,"-").concat(d.midAngle,"-").concat(u)}),Y.createElement(xse,ux({option:p,isActive:m,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var s=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,d=a.animationEasing,u=a.animationId,m=this.state,f=m.prevSectors,p=m.prevIsAnimationActive;return Y.createElement(Uc,{begin:l,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var g=x.t,v=[],y=i&&i[0],b=y.startAngle;return i.forEach(function(w,S){var j=f&&f[S],N=S>0?To(w,"paddingAngle",0):0;if(j){var _=Zi(j.endAngle-j.startAngle,w.endAngle-w.startAngle),C=ss(ss({},w),{},{startAngle:b+N,endAngle:b+_(g)+N});v.push(C),b=C.endAngle}else{var k=w.endAngle,E=w.startAngle,R=Zi(0,k-E),T=R(g),D=ss(ss({},w),{},{startAngle:b+N,endAngle:b+T+N});v.push(D),b=D.endAngle}}),Y.createElement(ln,null,s.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(s){var a=this;s.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var s=this.props,a=s.sectors,i=s.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Tg(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var s=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,d=a.cx,u=a.cy,m=a.innerRadius,f=a.outerRadius,p=a.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!xt(d)||!xt(u)||!xt(m)||!xt(f))return null;var g=Tr("recharts-pie",l);return Y.createElement(ln,{tabIndex:this.props.rootTabIndex,className:g,ref:function(y){s.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),qa.renderCallByParent(this.props,null,!1),(!p||x)&&Dd.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(s,a){return a.prevIsAnimationActive!==s.isAnimationActive?{prevIsAnimationActive:s.isAnimationActive,prevAnimationId:s.animationId,curSectors:s.sectors,prevSectors:[],isAnimationFinished:!0}:s.isAnimationActive&&s.animationId!==a.prevAnimationId?{prevAnimationId:s.animationId,curSectors:s.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:s.sectors!==a.curSectors?{curSectors:s.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(s,a){return s>a?"start":s<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(s,a,i){if(Y.isValidElement(s))return Y.cloneElement(s,a);if(Nr(s))return s(a);var o=Tr("recharts-pie-label-line",typeof s!="boolean"?s.className:"");return Y.createElement(Dx,ux({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(s,a,i){if(Y.isValidElement(s))return Y.cloneElement(s,a);var o=i;if(Nr(s)&&(o=s(a),Y.isValidElement(o)))return o;var l=Tr("recharts-pie-label-text",typeof s!="boolean"&&!Nr(s)?s.className:"");return Y.createElement(qf,ux({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(h.PureComponent);R1=xu;Jo(xu,"displayName","Pie");Jo(xu,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Rc.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Jo(xu,"parseDeltaAngle",function(e,t){var n=Di(t-e),s=Math.min(Math.abs(t-e),360);return n*s});Jo(xu,"getRealPieData",function(e){var t=e.data,n=e.children,s=ir(e,!1),a=ml(n,W2);return t&&t.length?t.map(function(i,o){return ss(ss(ss({payload:i},s),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return ss(ss({},s),i.props)}):[]});Jo(xu,"parseCoordinateOfPie",function(e,t){var n=t.top,s=t.left,a=t.width,i=t.height,o=Xne(a,i),l=s+Mi(e.cx,a,a/2),c=n+Mi(e.cy,i,i/2),d=Mi(e.innerRadius,o,0),u=Mi(e.outerRadius,o,o*.8),m=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:d,outerRadius:u,maxRadius:m}});Jo(xu,"getComposedData",function(e){var t=e.item,n=e.offset,s=t.type.defaultProps!==void 0?ss(ss({},t.type.defaultProps),t.props):t.props,a=R1.getRealPieData(s);if(!a||!a.length)return null;var i=s.cornerRadius,o=s.startAngle,l=s.endAngle,c=s.paddingAngle,d=s.dataKey,u=s.nameKey,m=s.valueKey,f=s.tooltipType,p=Math.abs(s.minAngle),x=R1.parseCoordinateOfPie(s,n),g=R1.parseDeltaAngle(o,l),v=Math.abs(g),y=d;Rr(d)&&Rr(m)?(Od(!1,`Use "dataKey" to specify the value of pie,
1173      the props "valueKey" will be deprecated in 1.1.0`),y="value"):Rr(d)&&(Od(!1,`Use "dataKey" to specify the value of pie,
1174      the props "valueKey" will be deprecated in 1.1.0`),y=m);var b=a.filter(function(C){return Pa(C,y,0)!==0}).length,w=(v>=360?b:b-1)*c,S=v-b*p-w,j=a.reduce(function(C,k){var E=Pa(k,y,0);return C+(xt(E)?E:0)},0),N;if(j>0){var _;N=a.map(function(C,k){var E=Pa(C,y,0),R=Pa(C,u,k),T=(xt(E)?E:0)/j,D;k?D=_.endAngle+Di(g)*c*(E!==0?1:0):D=o;var A=D+Di(g)*((E!==0?p:0)+T*S),V=(D+A)/2,U=(x.innerRadius+x.outerRadius)/2,O=[{name:R,value:E,payload:C,dataKey:y,type:f}],M=ls(x.cx,x.cy,U,V);return _=ss(ss(ss({percent:T,cornerRadius:i,name:R,tooltipPayload:O,midAngle:V,middleRadius:U,tooltipPosition:M},C),x),{},{value:Pa(C,y),startAngle:D,endAngle:A,payload:C,paddingAngle:Di(g)*c}),_})}return ss(ss({},x),{},{sectors:N,data:a})});var nKe=Math.ceil,sKe=Math.max;function aKe(e,t,n,s){for(var a=-1,i=sKe(nKe((t-e)/(n||1)),0),o=Array(i);i--;)o[s?i:++a]=e,e+=n;return o}var iKe=aKe,oKe=$re,gB=1/0,lKe=17976931348623157e292;function cKe(e){if(!e)return e===0?e:0;if(e=oKe(e),e===gB||e===-gB){var t=e<0?-1:1;return t*lKe}return e===e?e:0}var dKe=cKe,uKe=iKe,mKe=H2,BE=dKe;function hKe(e){return function(t,n,s){return s&&typeof s!="number"&&mKe(t,n,s)&&(n=s=void 0),t=BE(t),n===void 0?(n=t,t=0):n=BE(n),s=s===void 0?t<n?1:-1:BE(s),uKe(t,n,s,e)}}var fKe=hKe,pKe=fKe,xKe=pKe(),gKe=xKe;const MS=Mn(gKe);function I0(e){"@babel/helpers - typeof";return I0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I0(e)}function vB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function yB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vB(Object(n),!0).forEach(function(s){yse(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function yse(e,t,n){return t=vKe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vKe(e){var t=yKe(e,"string");return I0(t)=="symbol"?t:t+""}function yKe(e,t){if(I0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(I0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bKe=["Webkit","Moz","O","ms"],wKe=function(t,n){var s=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=bKe.reduce(function(i,o){return yB(yB({},i),{},yse({},o+s,n))},{});return a[t]=n,a};function Ig(e){"@babel/helpers - typeof";return Ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ig(e)}function IS(){return IS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},IS.apply(this,arguments)}function bB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function zE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bB(Object(n),!0).forEach(function(s){mo(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function jKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,wse(s.key),s)}}function NKe(e,t,n){return t&&wB(e.prototype,t),n&&wB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SKe(e,t,n){return t=LS(t),_Ke(e,bse()?Reflect.construct(t,n||[],LS(e).constructor):t.apply(e,n))}function _Ke(e,t){if(t&&(Ig(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CKe(e)}function CKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bse=function(){return!!e})()}
vendor: 116,388 bytes, lines 1174-1178
1174function LS(e){return LS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LS(e)}function kKe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QO(e,t)}function QO(e,t){return QO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},QO(e,t)}function mo(e,t,n){return t=wse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wse(e){var t=EKe(e,"string");return Ig(t)=="symbol"?t:t+""}function EKe(e,t){if(Ig(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Ig(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AKe=function(t){var n=t.data,s=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,d=db().domain(MS(0,c)).range([i,i+o-l]),u=d.domain().map(function(m){return d(m)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(s),endX:d(a),scale:d,scaleValues:u}},jB=function(t){return t.changedTouches&&!!t.changedTouches.length},Lg=function(e){function t(n){var s;return jKe(this,t),s=SKe(this,t,[n]),mo(s,"handleDrag",function(a){s.leaveTimer&&(clearTimeout(s.leaveTimer),s.leaveTimer=null),s.state.isTravellerMoving?s.handleTravellerMove(a):s.state.isSlideMoving&&s.handleSlideDrag(a)}),mo(s,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&s.handleDrag(a.changedTouches[0])}),mo(s,"handleDragEnd",function(){s.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=s.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),s.detachDragEndListener()}),mo(s,"handleLeaveWrapper",function(){(s.state.isTravellerMoving||s.state.isSlideMoving)&&(s.leaveTimer=window.setTimeout(s.handleDragEnd,s.props.leaveTimeOut))}),mo(s,"handleEnterSlideOrTraveller",function(){s.setState({isTextActive:!0})}),mo(s,"handleLeaveSlideOrTraveller",function(){s.setState({isTextActive:!1})}),mo(s,"handleSlideDragStart",function(a){var i=jB(a)?a.changedTouches[0]:a;s.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),s.attachDragEndListener()}),s.travellerDragStartHandlers={startX:s.handleTravellerDragStart.bind(s,"startX"),endX:s.handleTravellerDragStart.bind(s,"endX")},s.state={},s}return kKe(t,e),NKe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(s){var a=s.startX,i=s.endX,o=this.state.scaleValues,l=this.props,c=l.gap,d=l.data,u=d.length-1,m=Math.min(a,i),f=Math.max(a,i),p=t.getIndexInRange(o,m),x=t.getIndexInRange(o,f);return{startIndex:p-p%c,endIndex:x===u?u:x-x%c}}},{key:"getTextOfTick",value:function(s){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=Pa(i[s],l,s);return Nr(o)?o(c,s):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(s){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,d=c.x,u=c.width,m=c.travellerWidth,f=c.startIndex,p=c.endIndex,x=c.onChange,g=s.pageX-i;g>0?g=Math.min(g,d+u-m-l,d+u-m-o):g<0&&(g=Math.max(g,d-o,d-l));var v=this.getIndex({startX:o+g,endX:l+g});(v.startIndex!==f||v.endIndex!==p)&&x&&x(v),this.setState({startX:o+g,endX:l+g,slideMoveStartX:s.pageX})}},{key:"handleTravellerDragStart",value:function(s,a){var i=jB(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:s,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(s){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,d=this.state[o],u=this.props,m=u.x,f=u.width,p=u.travellerWidth,x=u.onChange,g=u.gap,v=u.data,y={startX:this.state.startX,endX:this.state.endX},b=s.pageX-i;b>0?b=Math.min(b,m+f-p-d):b<0&&(b=Math.max(b,m-d)),y[o]=d+b;var w=this.getIndex(y),S=w.startIndex,j=w.endIndex,N=function(){var C=v.length-1;return o==="startX"&&(l>c?S%g===0:j%g===0)||l<c&&j===C||o==="endX"&&(l>c?j%g===0:S%g===0)||l>c&&j===C};this.setState(mo(mo({},o,d+b),"brushMoveStartX",s.pageX),function(){x&&N()&&x(w)})}},{key:"handleTravellerMoveKeyboard",value:function(s,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,d=o.endX,u=this.state[a],m=l.indexOf(u);if(m!==-1){var f=m+s;if(!(f===-1||f>=l.length)){var p=l[f];a==="startX"&&p>=d||a==="endX"&&p<=c||this.setState(mo({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var s=this.props,a=s.x,i=s.y,o=s.width,l=s.height,c=s.fill,d=s.stroke;return Y.createElement("rect",{stroke:d,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var s=this.props,a=s.x,i=s.y,o=s.width,l=s.height,c=s.data,d=s.children,u=s.padding,m=h.Children.only(d);return m?Y.cloneElement(m,{x:a,y:i,width:o,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(s,a){var i,o,l=this,c=this.props,d=c.y,u=c.travellerWidth,m=c.height,f=c.traveller,p=c.ariaLabel,x=c.data,g=c.startIndex,v=c.endIndex,y=Math.max(s,this.props.x),b=zE(zE({},ir(this.props,!1)),{},{x:y,y:d,width:u,height:m}),w=p||"Min value: ".concat((i=x[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=x[v])===null||o===void 0?void 0:o.name);return Y.createElement(ln,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":s,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,b))}},{key:"renderSlide",value:function(s,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,d=i.travellerWidth,u=Math.min(s,a)+d,m=Math.max(Math.abs(a-s)-d,0);return Y.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:o,width:m,height:l})}},{key:"renderText",value:function(){var s=this.props,a=s.startIndex,i=s.endIndex,o=s.y,l=s.height,c=s.travellerWidth,d=s.stroke,u=this.state,m=u.startX,f=u.endX,p=5,x={pointerEvents:"none",fill:d};return Y.createElement(ln,{className:"recharts-brush-texts"},Y.createElement(qf,IS({textAnchor:"end",verticalAnchor:"middle",x:Math.min(m,f)-p,y:o+l/2},x),this.getTextOfTick(a)),Y.createElement(qf,IS({textAnchor:"start",verticalAnchor:"middle",x:Math.max(m,f)+c+p,y:o+l/2},x),this.getTextOfTick(i)))}},{key:"render",value:function(){var s=this.props,a=s.data,i=s.className,o=s.children,l=s.x,c=s.y,d=s.width,u=s.height,m=s.alwaysShowText,f=this.state,p=f.startX,x=f.endX,g=f.isTextActive,v=f.isSlideMoving,y=f.isTravellerMoving,b=f.isTravellerFocused;if(!a||!a.length||!xt(l)||!xt(c)||!xt(d)||!xt(u)||d<=0||u<=0)return null;var w=Tr("recharts-brush",i),S=Y.Children.count(o)===1,j=wKe("userSelect","none");return Y.createElement(ln,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,x),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(x,"endX"),(g||v||y||b||m)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(s){var a=s.x,i=s.y,o=s.width,l=s.height,c=s.stroke,d=Math.floor(i+l/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),Y.createElement("line",{x1:a+1,y1:d,x2:a+o-1,y2:d,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:a+1,y1:d+2,x2:a+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(s,a){var i;return Y.isValidElement(s)?i=Y.cloneElement(s,a):Nr(s)?i=s(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(s,a){var i=s.data,o=s.width,l=s.x,c=s.travellerWidth,d=s.updateId,u=s.startIndex,m=s.endIndex;if(i!==a.prevData||d!==a.prevUpdateId)return zE({prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o},i&&i.length?AKe({data:i,width:o,x:l,travellerWidth:c,startIndex:u,endIndex:m}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var f=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o,startX:a.scale(s.startIndex),endX:a.scale(s.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(s,a){for(var i=s.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);s[c]>a?l=c:o=c}return a>=s[l]?l:o}}])}(h.PureComponent);mo(Lg,"displayName","Brush");mo(Lg,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var TKe=wM;function RKe(e,t){var n;return TKe(e,function(s,a,i){return n=t(s,a,i),!n}),!!n}var OKe=RKe,PKe=mre,DKe=mh,MKe=OKe,IKe=io,LKe=H2;function $Ke(e,t,n){var s=IKe(e)?PKe:MKe;return n&&LKe(e,t,n)&&(t=void 0),s(e,DKe(t))}var VKe=$Ke;const UKe=Mn(VKe);var Pc=function(t,n){var s=t.alwaysShow,a=t.ifOverflow;return s&&(a="extendDomain"),a===n},NB=Pre;function FKe(e,t,n){t=="__proto__"&&NB?NB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var BKe=FKe,zKe=BKe,qKe=Rre,HKe=mh;function WKe(e,t){var n={};return t=HKe(t),qKe(e,function(s,a,i){zKe(n,a,t(s,a,i))}),n}var YKe=WKe;const GKe=Mn(YKe);function KKe(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(!t(e[n],n,e))return!1;return!0}var XKe=KKe,ZKe=wM;function QKe(e,t){var n=!0;return ZKe(e,function(s,a,i){return n=!!t(s,a,i),n}),n}var JKe=QKe,eXe=XKe,tXe=JKe,rXe=mh,nXe=io,sXe=H2;function aXe(e,t,n){var s=nXe(e)?eXe:tXe;return n&&sXe(e,t,n)&&(t=void 0),s(e,rXe(t))}var iXe=aXe;const oXe=Mn(iXe);var lXe=["x","y"];function L0(e){"@babel/helpers - typeof";return L0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L0(e)}function JO(){return JO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},JO.apply(this,arguments)}function SB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SB(Object(n),!0).forEach(function(s){cXe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function cXe(e,t,n){return t=dXe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dXe(e){var t=uXe(e,"string");return L0(t)=="symbol"?t:t+""}function uXe(e,t){if(L0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(L0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mXe(e,t){if(e==null)return{};var n=hXe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function hXe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function fXe(e,t){var n=e.x,s=e.y,a=mXe(e,lXe),i="".concat(n),o=parseInt(i,10),l="".concat(s),c=parseInt(l,10),d="".concat(t.height||a.height),u=parseInt(d,10),m="".concat(t.width||a.width),f=parseInt(m,10);return yy(yy(yy(yy(yy({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function _B(e){return Y.createElement(xse,JO({shapeType:"rectangle",propTransformer:fXe,activeClassName:"recharts-active-bar"},e))}var pXe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(s,a){if(typeof t=="number")return t;var i=xt(s)||L5e(s);return i?t(s,a):(i||Wf(),n)}},xXe=["value","background"],jse;function $g(e){"@babel/helpers - typeof";return $g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$g(e)}function gXe(e,t){if(e==null)return{};var n=vXe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function vXe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function $S(){return $S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},$S.apply(this,arguments)}function CB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function da(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CB(Object(n),!0).forEach(function(s){fm(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function yXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Sse(s.key),s)}}function bXe(e,t,n){return t&&kB(e.prototype,t),n&&kB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wXe(e,t,n){return t=VS(t),jXe(e,Nse()?Reflect.construct(t,n||[],VS(e).constructor):t.apply(e,n))}function jXe(e,t){if(t&&($g(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NXe(e)}function NXe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nse=function(){return!!e})()}function VS(e){return VS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},VS(e)}function SXe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eP(e,t)}function eP(e,t){return eP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},eP(e,t)}function fm(e,t,n){return t=Sse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sse(e){var t=_Xe(e,"string");return $g(t)=="symbol"?t:t+""}function _Xe(e,t){if($g(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if($g(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tu=function(e){function t(){var n;yXe(this,t);for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=wXe(this,t,[].concat(a)),fm(n,"state",{isAnimationFinished:!1}),fm(n,"id",Mv("recharts-bar-")),fm(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),fm(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return SXe(t,e),bXe(t,[{key:"renderRectanglesStatically",value:function(s){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,d=i.activeBar,u=ir(this.props,!1);return s&&s.map(function(m,f){var p=f===c,x=p?d:o,g=da(da(da({},u),m),{},{isActive:p,option:x,index:f,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return Y.createElement(ln,$S({className:"recharts-bar-rectangle"},zf(a.props,m,f),{key:"rectangle-".concat(m==null?void 0:m.x,"-").concat(m==null?void 0:m.y,"-").concat(m==null?void 0:m.value,"-").concat(f)}),Y.createElement(_B,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var s=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,u=a.animationEasing,m=a.animationId,f=this.state.prevData;return Y.createElement(Uc,{begin:c,duration:d,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var x=p.t,g=i.map(function(v,y){var b=f&&f[y];if(b){var w=Zi(b.x,v.x),S=Zi(b.y,v.y),j=Zi(b.width,v.width),N=Zi(b.height,v.height);return da(da({},v),{},{x:w(x),y:S(x),width:j(x),height:N(x)})}if(o==="horizontal"){var _=Zi(0,v.height),C=_(x);return da(da({},v),{},{y:v.y+v.height-C,height:C})}var k=Zi(0,v.width),E=k(x);return da(da({},v),{},{width:E})});return Y.createElement(ln,null,s.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var s=this.props,a=s.data,i=s.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Tg(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var s=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=ir(this.props.background,!1);return i.map(function(d,u){d.value;var m=d.background,f=gXe(d,xXe);if(!m)return null;var p=da(da(da(da(da({},f),{},{fill:"#eee"},m),c),zf(s.props,d,u)),{},{onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd,dataKey:o,index:u,className:"recharts-bar-background-rectangle"});return Y.createElement(_B,$S({key:"background-bar-".concat(u),option:s.props.background,isActive:u===l},p))})}},{key:"renderErrorBar",value:function(s,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,d=i.layout,u=i.children,m=ml(u,nC);if(!m)return null;var f=d==="vertical"?o[0].height/2:o[0].width/2,p=function(v,y){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Pa(v,y)}},x={clipPath:s?"url(#clipPath-".concat(a,")"):null};return Y.createElement(ln,x,m.map(function(g){return Y.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:d,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var s=this.props,a=s.hide,i=s.data,o=s.className,l=s.xAxis,c=s.yAxis,d=s.left,u=s.top,m=s.width,f=s.height,p=s.isAnimationActive,x=s.background,g=s.id;if(a||!i||!i.length)return null;var v=this.state.isAnimationFinished,y=Tr("recharts-bar",o),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,S=b||w,j=Rr(g)?this.id:g;return Y.createElement(ln,{className:y},b||w?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(j)},Y.createElement("rect",{x:b?d:d-m/2,y:w?u:u-f/2,width:b?m:m*2,height:w?f:f*2}))):null,Y.createElement(ln,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||v)&&Dd.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(s,a){return s.animationId!==a.prevAnimationId?{prevAnimationId:s.animationId,curData:s.data,prevData:a.curData}:s.data!==a.curData?{curData:s.data}:null}}])}(h.PureComponent);jse=tu;fm(tu,"displayName","Bar");fm(tu,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Rc.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});fm(tu,"getComposedData",function(e){var t=e.props,n=e.item,s=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,d=e.stackedData,u=e.dataStartIndex,m=e.displayedData,f=e.offset,p=nqe(s,n);if(!p)return null;var x=t.layout,g=n.type.defaultProps,v=g!==void 0?da(da({},g),n.props):n.props,y=v.dataKey,b=v.children,w=v.minPointSize,S=x==="horizontal"?o:i,j=d?S.scale.domain():null,N=dqe({numericAxis:S}),_=ml(b,W2),C=m.map(function(k,E){var R,T,D,A,V,U;d?R=sqe(d[u+E],j):(R=Pa(k,y),Array.isArray(R)||(R=[N,R]));var O=pXe(w,jse.defaultProps.minPointSize)(R[1],E);if(x==="horizontal"){var M,$=[o.scale(R[0]),o.scale(R[1])],I=$[0],B=$[1];T=xF({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:k,index:E}),D=(M=B??I)!==null&&M!==void 0?M:void 0,A=p.size;var K=I-B;if(V=Number.isNaN(K)?0:K,U={x:T,y:o.y,width:A,height:o.height},Math.abs(O)>0&&Math.abs(V)<Math.abs(O)){var Z=Di(V||O)*(Math.abs(O)-Math.abs(V));D-=Z,V+=Z}}else{var q=[i.scale(R[0]),i.scale(R[1])],H=q[0],X=q[1];if(T=H,D=xF({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:k,index:E}),A=X-H,V=p.size,U={x:i.x,y:D,width:i.width,height:V},Math.abs(O)>0&&Math.abs(A)<Math.abs(O)){var G=Di(A||O)*(Math.abs(O)-Math.abs(A));A+=G}}return da(da(da({},k),{},{x:T,y:D,width:A,height:V,value:d?R:R[1],payload:k,background:U},_&&_[E]&&_[E].props),{},{tooltipPayload:[Gne(n,k)],tooltipPosition:{x:T+A/2,y:D+V/2}})});return da({data:C,layout:x},f)});function $0(e){"@babel/helpers - typeof";return $0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$0(e)}function CXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,_se(s.key),s)}}function kXe(e,t,n){return t&&EB(e.prototype,t),n&&EB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function AB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AB(Object(n),!0).forEach(function(s){uC(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function uC(e,t,n){return t=_se(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _se(e){var t=EXe(e,"string");return $0(t)=="symbol"?t:t+""}function EXe(e,t){if($0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if($0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cse=function(t,n,s,a,i){var o=t.width,l=t.height,c=t.layout,d=t.children,u=Object.keys(n),m={left:s.left,leftMirror:s.left,right:o-s.right,rightMirror:o-s.right,top:s.top,topMirror:s.top,bottom:l-s.bottom,bottomMirror:l-s.bottom},f=!!fo(d,tu);return u.reduce(function(p,x){var g=n[x],v=g.orientation,y=g.domain,b=g.padding,w=b===void 0?{}:b,S=g.mirror,j=g.reversed,N="".concat(v).concat(S?"Mirror":""),_,C,k,E,R;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var T=y[1]-y[0],D=1/0,A=g.categoricalDomain.sort(U5e);if(A.forEach(function(q,H){H>0&&(D=Math.min((q||0)-(A[H-1]||0),D))}),Number.isFinite(D)){var V=D/T,U=g.layout==="vertical"?s.height:s.width;if(g.padding==="gap"&&(_=V*U/2),g.padding==="no-gap"){var O=Mi(t.barCategoryGap,V*U),M=V*U/2;_=M-O-(M-O)/U*O}}}a==="xAxis"?C=[s.left+(w.left||0)+(_||0),s.left+s.width-(w.right||0)-(_||0)]:a==="yAxis"?C=c==="horizontal"?[s.top+s.height-(w.bottom||0),s.top+(w.top||0)]:[s.top+(w.top||0)+(_||0),s.top+s.height-(w.bottom||0)-(_||0)]:C=g.range,j&&(C=[C[1],C[0]]);var $=qne(g,i,f),I=$.scale,B=$.realScaleType;I.domain(y).range(C),Hne(I);var K=Wne(I,Ll(Ll({},g),{},{realScaleType:B}));a==="xAxis"?(R=v==="top"&&!S||v==="bottom"&&S,k=s.left,E=m[N]-R*g.height):a==="yAxis"&&(R=v==="left"&&!S||v==="right"&&S,k=m[N]-R*g.width,E=s.top);var Z=Ll(Ll(Ll({},g),K),{},{realScaleType:B,x:k,y:E,scale:I,width:a==="xAxis"?s.width:g.width,height:a==="yAxis"?s.height:g.height});return Z.bandSize=NS(Z,K),!g.hide&&a==="xAxis"?m[N]+=(R?-1:1)*Z.height:g.hide||(m[N]+=(R?-1:1)*Z.width),Ll(Ll({},p),{},uC({},x,Z))},{})},kse=function(t,n){var s=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(s,i),y:Math.min(a,o),width:Math.abs(i-s),height:Math.abs(o-a)}},AXe=function(t){var n=t.x1,s=t.y1,a=t.x2,i=t.y2;return kse({x:n,y:s},{x:a,y:i})},Ese=function(){function e(t){CXe(this,e),this.scale=t}return kXe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,i=s.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var s=this.range(),a=s[0],i=s[s.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();uC(Ese,"EPS",1e-4);var XM=function(t){var n=Object.keys(t).reduce(function(s,a){return Ll(Ll({},s),{},uC({},a,Ese.create(t[a])))},{});return Ll(Ll({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return GKe(a,function(c,d){return n[d].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return oXe(a,function(i,o){return n[o].isInRange(i)})}})};function TXe(e){return(e%180+180)%180}var RXe=function(t){var n=t.width,s=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=TXe(a),o=i*Math.PI/180,l=Math.atan(s/n),c=o>l&&o<Math.PI-l?s/Math.sin(o):n/Math.cos(o);return Math.abs(c)},OXe=F4e(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Ase=h.createContext(void 0),Tse=h.createContext(void 0),Rse=h.createContext(void 0),PXe=h.createContext({}),Ose=h.createContext(void 0),Pse=h.createContext(0),Dse=h.createContext(0),TB=function(t){var n=t.state,s=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,l=t.children,c=t.width,d=t.height,u=OXe(i);return Y.createElement(Ase.Provider,{value:s},Y.createElement(Tse.Provider,{value:a},Y.createElement(PXe.Provider,{value:i},Y.createElement(Rse.Provider,{value:u},Y.createElement(Ose.Provider,{value:o},Y.createElement(Pse.Provider,{value:d},Y.createElement(Dse.Provider,{value:c},l)))))))},DXe=function(){return h.useContext(Ose)},Mse=function(t){var n=h.useContext(Ase);n==null&&Wf();var s=n[t];return s==null&&Wf(),s},Ise=function(t){var n=h.useContext(Tse);n==null&&Wf();var s=n[t];return s==null&&Wf(),s},MXe=function(){var t=h.useContext(Rse);return t},Lse=function(){return h.useContext(Dse)},$se=function(){return h.useContext(Pse)};function Vg(e){"@babel/helpers - typeof";return Vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vg(e)}function IXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LXe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Use(s.key),s)}}function $Xe(e,t,n){return t&&LXe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function VXe(e,t,n){return t=US(t),UXe(e,Vse()?Reflect.construct(t,n||[],US(e).constructor):t.apply(e,n))}function UXe(e,t){if(t&&(Vg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FXe(e)}function FXe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vse=function(){return!!e})()}function US(e){return US=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},US(e)}function BXe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tP(e,t)}function tP(e,t){return tP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},tP(e,t)}function RB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function OB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RB(Object(n),!0).forEach(function(s){ZM(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ZM(e,t,n){return t=Use(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=zXe(e,"string");return Vg(t)=="symbol"?t:t+""}function zXe(e,t){if(Vg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Vg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qXe(e,t){return GXe(e)||YXe(e,t)||WXe(e,t)||HXe()}function HXe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1175In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WXe(e,t){if(e){if(typeof e=="string")return PB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PB(e,t)}}function PB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function YXe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function GXe(e){if(Array.isArray(e))return e}function rP(){return rP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},rP.apply(this,arguments)}var KXe=function(t,n){var s;return Y.isValidElement(t)?s=Y.cloneElement(t,n):Nr(t)?s=t(n):s=Y.createElement("line",rP({},n,{className:"recharts-reference-line-line"})),s},XXe=function(t,n,s,a,i,o,l,c,d){var u=i.x,m=i.y,f=i.width,p=i.height;if(s){var x=d.y,g=t.y.apply(x,{position:o});if(Pc(d,"discard")&&!t.y.isInRange(g))return null;var v=[{x:u+f,y:g},{x:u,y:g}];return c==="left"?v.reverse():v}if(n){var y=d.x,b=t.x.apply(y,{position:o});if(Pc(d,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:m+p},{x:b,y:m}];return l==="top"?w.reverse():w}if(a){var S=d.segment,j=S.map(function(N){return t.apply(N,{position:o})});return Pc(d,"discard")&&UKe(j,function(N){return!t.isInRange(N)})?null:j}return null};function ZXe(e){var t=e.x,n=e.y,s=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,d=DXe(),u=Mse(a),m=Ise(i),f=MXe();if(!d||!f)return null;Od(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=XM({x:u.scale,y:m.scale}),x=Da(t),g=Da(n),v=s&&s.length===2,y=XXe(p,x,g,v,f,e.position,u.orientation,m.orientation,e);if(!y)return null;var b=qXe(y,2),w=b[0],S=w.x,j=w.y,N=b[1],_=N.x,C=N.y,k=Pc(e,"hidden")?"url(#".concat(d,")"):void 0,E=OB(OB({clipPath:k},ir(e,!0)),{},{x1:S,y1:j,x2:_,y2:C});return Y.createElement(ln,{className:Tr("recharts-reference-line",l)},KXe(o,E),qa.renderCallByParent(e,AXe({x1:S,y1:j,x2:_,y2:C})))}var QM=function(e){function t(){return IXe(this,t),VXe(this,t,arguments)}return BXe(t,e),$Xe(t,[{key:"render",value:function(){return Y.createElement(ZXe,this.props)}}])}(Y.Component);ZM(QM,"displayName","ReferenceLine");ZM(QM,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function nP(){return nP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},nP.apply(this,arguments)}function Ug(e){"@babel/helpers - typeof";return Ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ug(e)}function DB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function MB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DB(Object(n),!0).forEach(function(s){mC(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function QXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JXe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Bse(s.key),s)}}function eZe(e,t,n){return t&&JXe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tZe(e,t,n){return t=FS(t),rZe(e,Fse()?Reflect.construct(t,n||[],FS(e).constructor):t.apply(e,n))}function rZe(e,t){if(t&&(Ug(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nZe(e)}function nZe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fse=function(){return!!e})()}function FS(e){return FS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},FS(e)}function sZe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sP(e,t)}function sP(e,t){return sP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},sP(e,t)}function mC(e,t,n){return t=Bse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bse(e){var t=aZe(e,"string");return Ug(t)=="symbol"?t:t+""}function aZe(e,t){if(Ug(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Ug(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iZe=function(t){var n=t.x,s=t.y,a=t.xAxis,i=t.yAxis,o=XM({x:a.scale,y:i.scale}),l=o.apply({x:n,y:s},{bandAware:!0});return Pc(t,"discard")&&!o.isInRange(l)?null:l},hC=function(e){function t(){return QXe(this,t),tZe(this,t,arguments)}return sZe(t,e),eZe(t,[{key:"render",value:function(){var s=this.props,a=s.x,i=s.y,o=s.r,l=s.alwaysShow,c=s.clipPathId,d=Da(a),u=Da(i);if(Od(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!u)return null;var m=iZe(this.props);if(!m)return null;var f=m.x,p=m.y,x=this.props,g=x.shape,v=x.className,y=Pc(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=MB(MB({clipPath:y},ir(this.props,!0)),{},{cx:f,cy:p});return Y.createElement(ln,{className:Tr("recharts-reference-dot",v)},t.renderDot(g,b),qa.renderCallByParent(this.props,{x:f-o,y:p-o,width:2*o,height:2*o}))}}])}(Y.Component);mC(hC,"displayName","ReferenceDot");mC(hC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});mC(hC,"renderDot",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Nr(e)?n=e(t):n=Y.createElement(sC,nP({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function aP(){return aP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},aP.apply(this,arguments)}function Fg(e){"@babel/helpers - typeof";return Fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fg(e)}function IB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function LB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IB(Object(n),!0).forEach(function(s){fC(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function oZe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lZe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,qse(s.key),s)}}function cZe(e,t,n){return t&&lZe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dZe(e,t,n){return t=BS(t),uZe(e,zse()?Reflect.construct(t,n||[],BS(e).constructor):t.apply(e,n))}function uZe(e,t){if(t&&(Fg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mZe(e)}function mZe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zse=function(){return!!e})()}function BS(e){return BS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BS(e)}function hZe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iP(e,t)}function iP(e,t){return iP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},iP(e,t)}function fC(e,t,n){return t=qse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qse(e){var t=fZe(e,"string");return Fg(t)=="symbol"?t:t+""}function fZe(e,t){if(Fg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Fg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pZe=function(t,n,s,a,i){var o=i.x1,l=i.x2,c=i.y1,d=i.y2,u=i.xAxis,m=i.yAxis;if(!u||!m)return null;var f=XM({x:u.scale,y:m.scale}),p={x:t?f.x.apply(o,{position:"start"}):f.x.rangeMin,y:s?f.y.apply(c,{position:"start"}):f.y.rangeMin},x={x:n?f.x.apply(l,{position:"end"}):f.x.rangeMax,y:a?f.y.apply(d,{position:"end"}):f.y.rangeMax};return Pc(i,"discard")&&(!f.isInRange(p)||!f.isInRange(x))?null:kse(p,x)},pC=function(e){function t(){return oZe(this,t),dZe(this,t,arguments)}return hZe(t,e),cZe(t,[{key:"render",value:function(){var s=this.props,a=s.x1,i=s.x2,o=s.y1,l=s.y2,c=s.className,d=s.alwaysShow,u=s.clipPathId;Od(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=Da(a),f=Da(i),p=Da(o),x=Da(l),g=this.props.shape;if(!m&&!f&&!p&&!x&&!g)return null;var v=pZe(m,f,p,x,this.props);if(!v&&!g)return null;var y=Pc(this.props,"hidden")?"url(#".concat(u,")"):void 0;return Y.createElement(ln,{className:Tr("recharts-reference-area",c)},t.renderRect(g,LB(LB({clipPath:y},ir(this.props,!0)),v)),qa.renderCallByParent(this.props,v))}}])}(Y.Component);fC(pC,"displayName","ReferenceArea");fC(pC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});fC(pC,"renderRect",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Nr(e)?n=e(t):n=Y.createElement(KM,aP({},t,{className:"recharts-reference-area-rect"})),n});function Hse(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var s=[],a=0;a<e.length;a+=t)s.push(e[a]);return s}function xZe(e,t,n){var s={width:e.width+t.width,height:e.height+t.height};return RXe(s,n)}function gZe(e,t,n){var s=n==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:s?a:i,end:s?a+o:i+l}:{start:s?a+o:i+l,end:s?a:i}}function zS(e,t,n,s,a){if(e*t<e*s||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-s)>=0&&e*(t+e*i/2-a)<=0}function vZe(e,t){return Hse(e,t+1)}function yZe(e,t,n,s,a){for(var i=(s||[]).slice(),o=t.start,l=t.end,c=0,d=1,u=o,m=function(){var x=s==null?void 0:s[c];if(x===void 0)return{v:Hse(s,d)};var g=c,v,y=function(){return v===void 0&&(v=n(x,g)),v},b=x.coordinate,w=c===0||zS(e,b,y,u,l);w||(c=0,u=o,d+=1),w&&(u=b+e*(y()/2+a),c+=d)},f;d<=i.length;)if(f=m(),f)return f.v;return[]}function V0(e){"@babel/helpers - typeof";return V0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V0(e)}function $B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$B(Object(n),!0).forEach(function(s){bZe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$B(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function bZe(e,t,n){return t=wZe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wZe(e){var t=jZe(e,"string");return V0(t)=="symbol"?t:t+""}function jZe(e,t){if(V0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(V0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NZe(e,t,n,s,a){for(var i=(s||[]).slice(),o=i.length,l=t.start,c=t.end,d=function(f){var p=i[f],x,g=function(){return x===void 0&&(x=n(p,f)),x};if(f===o-1){var v=e*(p.coordinate+e*g()/2-c);i[f]=p=gi(gi({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else i[f]=p=gi(gi({},p),{},{tickCoord:p.coordinate});var y=zS(e,p.tickCoord,g,l,c);y&&(c=p.tickCoord-e*(g()/2+a),i[f]=gi(gi({},p),{},{isShow:!0}))},u=o-1;u>=0;u--)d(u);return i}function SZe(e,t,n,s,a,i){var o=(s||[]).slice(),l=o.length,c=t.start,d=t.end;if(i){var u=s[l-1],m=n(u,l-1),f=e*(u.coordinate+e*m/2-d);o[l-1]=u=gi(gi({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate});var p=zS(e,u.tickCoord,function(){return m},c,d);p&&(d=u.tickCoord-e*(m/2+a),o[l-1]=gi(gi({},u),{},{isShow:!0}))}for(var x=i?l-1:l,g=function(b){var w=o[b],S,j=function(){return S===void 0&&(S=n(w,b)),S};if(b===0){var N=e*(w.coordinate-e*j()/2-c);o[b]=w=gi(gi({},w),{},{tickCoord:N<0?w.coordinate-N*e:w.coordinate})}else o[b]=w=gi(gi({},w),{},{tickCoord:w.coordinate});var _=zS(e,w.tickCoord,j,c,d);_&&(c=w.tickCoord+e*(j()/2+a),o[b]=gi(gi({},w),{},{isShow:!0}))},v=0;v<x;v++)g(v);return o}function _Ze(e,t,n){var s=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,d=e.tickFormatter,u=e.unit,m=e.angle;if(!a||!a.length||!s)return[];if(xt(c)||Rc.isSsr)return vZe(a,typeof c=="number"&&xt(c)?c:0);var f=[],p=l==="top"||l==="bottom"?"width":"height",x=u&&p==="width"?cb(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(w,S){var j=Nr(d)?d(w.value,S):w.value;return p==="width"?xZe(cb(j,{fontSize:t,letterSpacing:n}),x,m):cb(j,{fontSize:t,letterSpacing:n})[p]},v=a.length>=2?Di(a[1].coordinate-a[0].coordinate):1,y=gZe(i,v,p);return c==="equidistantPreserveStart"?yZe(v,y,g,a,o):(c==="preserveStart"||c==="preserveStartEnd"?f=SZe(v,y,g,a,o,c==="preserveStartEnd"):f=NZe(v,y,g,a,o),f.filter(function(b){return b.isShow}))}var CZe=["viewBox"],kZe=["viewBox"],EZe=["ticks"];function Bg(e){"@babel/helpers - typeof";return Bg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bg(e)}function mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mx.apply(this,arguments)}function VB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function ka(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VB(Object(n),!0).forEach(function(s){JM(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function qE(e,t){if(e==null)return{};var n=AZe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function AZe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function TZe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Yse(s.key),s)}}function RZe(e,t,n){return t&&UB(e.prototype,t),n&&UB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OZe(e,t,n){return t=qS(t),PZe(e,Wse()?Reflect.construct(t,n||[],qS(e).constructor):t.apply(e,n))}function PZe(e,t){if(t&&(Bg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DZe(e)}function DZe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wse=function(){return!!e})()}function qS(e){return qS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qS(e)}function MZe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oP(e,t)}function oP(e,t){return oP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},oP(e,t)}function JM(e,t,n){return t=Yse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yse(e){var t=IZe(e,"string");return Bg(t)=="symbol"?t:t+""}function IZe(e,t){if(Bg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Bg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xC=function(e){function t(n){var s;return TZe(this,t),s=OZe(this,t,[n]),s.state={fontSize:"",letterSpacing:""},s}return MZe(t,e),RZe(t,[{key:"shouldComponentUpdate",value:function(s,a){var i=s.viewBox,o=qE(s,CZe),l=this.props,c=l.viewBox,d=qE(l,kZe);return!Tx(i,c)||!Tx(o,d)||!Tx(a,this.state)}},{key:"componentDidMount",value:function(){var s=this.layerReference;if(s){var a=s.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(s){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,d=a.orientation,u=a.tickSize,m=a.mirror,f=a.tickMargin,p,x,g,v,y,b,w=m?-1:1,S=s.tickSize||u,j=xt(s.tickCoord)?s.tickCoord:s.coordinate;switch(d){case"top":p=x=s.coordinate,v=o+ +!m*c,g=v-w*S,b=g-w*f,y=j;break;case"left":g=v=s.coordinate,x=i+ +!m*l,p=x-w*S,y=p-w*f,b=j;break;case"right":g=v=s.coordinate,x=i+ +m*l,p=x+w*S,y=p+w*f,b=j;break;default:p=x=s.coordinate,v=o+ +m*c,g=v+w*S,b=g+w*f,y=j;break}return{line:{x1:p,y1:g,x2:x,y2:v},tick:{x:y,y:b}}}},{key:"getTickTextAnchor",value:function(){var s=this.props,a=s.orientation,i=s.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var s=this.props,a=s.orientation,i=s.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var s=this.props,a=s.x,i=s.y,o=s.width,l=s.height,c=s.orientation,d=s.mirror,u=s.axisLine,m=ka(ka(ka({},ir(this.props,!1)),ir(u,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var f=+(c==="top"&&!d||c==="bottom"&&d);m=ka(ka({},m),{},{x1:a,y1:i+f*l,x2:a+o,y2:i+f*l})}else{var p=+(c==="left"&&!d||c==="right"&&d);m=ka(ka({},m),{},{x1:a+p*o,y1:i,x2:a+p*o,y2:i+l})}return Y.createElement("line",mx({},m,{className:Tr("recharts-cartesian-axis-line",To(u,"className"))}))}},{key:"renderTicks",value:function(s,a,i){var o=this,l=this.props,c=l.tickLine,d=l.stroke,u=l.tick,m=l.tickFormatter,f=l.unit,p=_Ze(ka(ka({},this.props),{},{ticks:s}),a,i),x=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),v=ir(this.props,!1),y=ir(u,!1),b=ka(ka({},v),{},{fill:"none"},ir(c,!1)),w=p.map(function(S,j){var N=o.getTickLineCoord(S),_=N.line,C=N.tick,k=ka(ka(ka(ka({textAnchor:x,verticalAnchor:g},v),{},{stroke:"none",fill:d},y),C),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:m});return Y.createElement(ln,mx({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},zf(o.props,S,j)),c&&Y.createElement("line",mx({},b,_,{className:Tr("recharts-cartesian-axis-tick-line",To(c,"className"))})),u&&t.renderTickItem(u,k,"".concat(Nr(m)?m(S.value,j):S.value).concat(f||"")))});return Y.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var s=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,d=a.className,u=a.hide;if(u)return null;var m=this.props,f=m.ticks,p=qE(m,EZe),x=f;return Nr(c)&&(x=f&&f.length>0?c(this.props):c(p)),o<=0||l<=0||!x||!x.length?null:Y.createElement(ln,{className:Tr("recharts-cartesian-axis",d),ref:function(v){s.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),qa.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(s,a,i){var o,l=Tr(a.className,"recharts-cartesian-axis-tick-value");return Y.isValidElement(s)?o=Y.cloneElement(s,ka(ka({},a),{},{className:l})):Nr(s)?o=s(ka(ka({},a),{},{className:l})):o=Y.createElement(qf,mx({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(h.Component);JM(xC,"displayName","CartesianAxis");JM(xC,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var LZe=["layout","type","stroke","connectNulls","isRange","ref"],$Ze=["key"],Gse;function zg(e){"@babel/helpers - typeof";return zg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zg(e)}function Kse(e,t){if(e==null)return{};var n=VZe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function VZe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Zh.apply(this,arguments)}function FB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Iu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FB(Object(n),!0).forEach(function(s){Nc(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function UZe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BB(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Zse(s.key),s)}}function FZe(e,t,n){return t&&BB(e.prototype,t),n&&BB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function BZe(e,t,n){return t=HS(t),zZe(e,Xse()?Reflect.construct(t,n||[],HS(e).constructor):t.apply(e,n))}function zZe(e,t){if(t&&(zg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qZe(e)}function qZe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xse=function(){return!!e})()}function HS(e){return HS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},HS(e)}function HZe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lP(e,t)}function lP(e,t){return lP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},lP(e,t)}function Nc(e,t,n){return t=Zse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zse(e){var t=WZe(e,"string");return zg(t)=="symbol"?t:t+""}function WZe(e,t){if(zg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(zg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xh=function(e){function t(){var n;UZe(this,t);for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=BZe(this,t,[].concat(a)),Nc(n,"state",{isAnimationFinished:!0}),Nc(n,"id",Mv("recharts-area-")),Nc(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Nr(o)&&o()}),Nc(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Nr(o)&&o()}),n}return HZe(t,e),FZe(t,[{key:"renderDots",value:function(s,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,d=c.dot,u=c.points,m=c.dataKey,f=ir(this.props,!1),p=ir(d,!0),x=u.map(function(v,y){var b=Iu(Iu(Iu({key:"dot-".concat(y),r:3},f),p),{},{index:y,cx:v.x,cy:v.y,dataKey:m,value:v.value,payload:v.payload,points:u});return t.renderDotItem(d,b)}),g={clipPath:s?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return Y.createElement(ln,Zh({className:"recharts-area-dots"},g),x)}},{key:"renderHorizontalRect",value:function(s){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].x,d=o[o.length-1].x,u=s*Math.abs(c-d),m=hm(o.map(function(f){return f.y||0}));return xt(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(hm(i.map(function(f){return f.y||0})),m)),xt(m)?Y.createElement("rect",{x:c<d?c:c-u,y:0,width:u,height:Math.floor(m+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(s){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].y,d=o[o.length-1].y,u=s*Math.abs(c-d),m=hm(o.map(function(f){return f.x||0}));return xt(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(hm(i.map(function(f){return f.x||0})),m)),xt(m)?Y.createElement("rect",{x:0,y:c<d?c:c-u,width:m+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(s){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(s):this.renderHorizontalRect(s)}},{key:"renderAreaStatically",value:function(s,a,i,o){var l=this.props,c=l.layout,d=l.type,u=l.stroke,m=l.connectNulls,f=l.isRange;l.ref;var p=Kse(l,LZe);return Y.createElement(ln,{clipPath:i?"url(#clipPath-".concat(o,")"):null},Y.createElement(Dx,Zh({},ir(p,!0),{points:s,connectNulls:m,type:d,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),u!=="none"&&Y.createElement(Dx,Zh({},ir(this.props,!1),{className:"recharts-area-curve",layout:c,type:d,connectNulls:m,fill:"none",points:s})),u!=="none"&&f&&Y.createElement(Dx,Zh({},ir(this.props,!1),{className:"recharts-area-curve",layout:c,type:d,connectNulls:m,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(s,a){var i=this,o=this.props,l=o.points,c=o.baseLine,d=o.isAnimationActive,u=o.animationBegin,m=o.animationDuration,f=o.animationEasing,p=o.animationId,x=this.state,g=x.prevPoints,v=x.prevBaseLine;return Y.createElement(Uc,{begin:u,duration:m,isActive:d,easing:f,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var b=y.t;if(g){var w=g.length/l.length,S=l.map(function(C,k){var E=Math.floor(k*w);if(g[E]){var R=g[E],T=Zi(R.x,C.x),D=Zi(R.y,C.y);return Iu(Iu({},C),{},{x:T(b),y:D(b)})}return C}),j;if(xt(c)&&typeof c=="number"){var N=Zi(v,c);j=N(b)}else if(Rr(c)||Dv(c)){var _=Zi(v,0);j=_(b)}else j=c.map(function(C,k){var E=Math.floor(k*w);if(v[E]){var R=v[E],T=Zi(R.x,C.x),D=Zi(R.y,C.y);return Iu(Iu({},C),{},{x:T(b),y:D(b)})}return C});return i.renderAreaStatically(S,j,s,a)}return Y.createElement(ln,null,Y.createElement("defs",null,Y.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(b))),Y.createElement(ln,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,s,a)))})}},{key:"renderArea",value:function(s,a){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,d=this.state,u=d.prevPoints,m=d.prevBaseLine,f=d.totalLength;return c&&o&&o.length&&(!u&&f>0||!Tg(u,o)||!Tg(m,l))?this.renderAreaWithAnimation(s,a):this.renderAreaStatically(o,l,s,a)}},{key:"render",value:function(){var s,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,d=a.top,u=a.left,m=a.xAxis,f=a.yAxis,p=a.width,x=a.height,g=a.isAnimationActive,v=a.id;if(i||!l||!l.length)return null;var y=this.state.isAnimationFinished,b=l.length===1,w=Tr("recharts-area",c),S=m&&m.allowDataOverflow,j=f&&f.allowDataOverflow,N=S||j,_=Rr(v)?this.id:v,C=(s=ir(o,!1))!==null&&s!==void 0?s:{r:3,strokeWidth:2},k=C.r,E=k===void 0?3:k,R=C.strokeWidth,T=R===void 0?2:R,D=K5e(o)?o:{},A=D.clipDot,V=A===void 0?!0:A,U=E*2+T;return Y.createElement(ln,{className:w},S||j?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(_)},Y.createElement("rect",{x:S?u:u-p/2,y:j?d:d-x/2,width:S?p:p*2,height:j?x:x*2})),!V&&Y.createElement("clipPath",{id:"clipPath-dots-".concat(_)},Y.createElement("rect",{x:u-U/2,y:d-U/2,width:p+U,height:x+U}))):null,b?null:this.renderArea(N,_),(o||b)&&this.renderDots(N,V,_),(!g||y)&&Dd.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(s,a){return s.animationId!==a.prevAnimationId?{prevAnimationId:s.animationId,curPoints:s.points,curBaseLine:s.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:s.points!==a.curPoints||s.baseLine!==a.curBaseLine?{curPoints:s.points,curBaseLine:s.baseLine}:null}}])}(h.PureComponent);Gse=xh;Nc(xh,"displayName","Area");Nc(xh,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Rc.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Nc(xh,"getBaseValue",function(e,t,n,s){var a=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(xt(l)&&typeof l=="number")return l;var c=a==="horizontal"?s:n,d=c.scale.domain();if(c.type==="number"){var u=Math.max(d[0],d[1]),m=Math.min(d[0],d[1]);return l==="dataMin"?m:l==="dataMax"||u<0?u:Math.max(Math.min(d[0],d[1]),0)}return l==="dataMin"?d[0]:l==="dataMax"?d[1]:d[0]});Nc(xh,"getComposedData",function(e){var t=e.props,n=e.item,s=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,d=e.stackedData,u=e.dataStartIndex,m=e.displayedData,f=e.offset,p=t.layout,x=d&&d.length,g=Gse.getBaseValue(t,n,s,a),v=p==="horizontal",y=!1,b=m.map(function(S,j){var N;x?N=d[u+j]:(N=Pa(S,c),Array.isArray(N)?y=!0:N=[g,N]);var _=N[1]==null||x&&Pa(S,c)==null;return v?{x:pF({axis:s,ticks:i,bandSize:l,entry:S,index:j}),y:_?null:a.scale(N[1]),value:N,payload:S}:{x:_?null:s.scale(N[1]),y:pF({axis:a,ticks:o,bandSize:l,entry:S,index:j}),value:N,payload:S}}),w;return x||y?w=b.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:j!=null&&S.y!=null?a.scale(j):null}:{x:j!=null?s.scale(j):null,y:S.y}}):w=v?a.scale(g):s.scale(g),Iu({points:b,baseLine:w,layout:p,isRange:y},f)});Nc(xh,"renderDotItem",function(e,t){var n;if(Y.isValidElement(e))n=Y.cloneElement(e,t);else if(Nr(e))n=e(t);else{var s=Tr("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=Kse(t,$Ze);n=Y.createElement(sC,Zh({},i,{key:a,className:s}))}return n});function qg(e){"@babel/helpers - typeof";return qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qg(e)}function YZe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GZe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,eae(s.key),s)}}function KZe(e,t,n){return t&&GZe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XZe(e,t,n){return t=WS(t),ZZe(e,Qse()?Reflect.construct(t,n||[],WS(e).constructor):t.apply(e,n))}function ZZe(e,t){if(t&&(qg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QZe(e)}function QZe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qse(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qse=function(){return!!e})()}function WS(e){return WS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},WS(e)}function JZe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cP(e,t)}function cP(e,t){return cP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},cP(e,t)}function Jse(e,t,n){return t=eae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eae(e){var t=eQe(e,"string");return qg(t)=="symbol"?t:t+""}function eQe(e,t){if(qg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(qg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dP(){return dP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},dP.apply(this,arguments)}function tQe(e){var t=e.xAxisId,n=Lse(),s=$se(),a=Mse(t);return a==null?null:h.createElement(xC,dP({},a,{className:Tr("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:s},ticksGenerator:function(o){return Xh(o,!0)}}))}var Yf=function(e){function t(){return YZe(this,t),XZe(this,t,arguments)}return JZe(t,e),KZe(t,[{key:"render",value:function(){return h.createElement(tQe,this.props)}}])}(h.Component);Jse(Yf,"displayName","XAxis");Jse(Yf,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function rQe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nQe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,nae(s.key),s)}}function sQe(e,t,n){return t&&nQe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aQe(e,t,n){return t=YS(t),iQe(e,tae()?Reflect.construct(t,n||[],YS(e).constructor):t.apply(e,n))}function iQe(e,t){if(t&&(Hg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oQe(e)}function oQe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tae=function(){return!!e})()}function YS(e){return YS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},YS(e)}function lQe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uP(e,t)}function uP(e,t){return uP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},uP(e,t)}function rae(e,t,n){return t=nae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=cQe(e,"string");return Hg(t)=="symbol"?t:t+""}function cQe(e,t){if(Hg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Hg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mP(){return mP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mP.apply(this,arguments)}var dQe=function(t){var n=t.yAxisId,s=Lse(),a=$se(),i=Ise(n);return i==null?null:h.createElement(xC,mP({},i,{className:Tr("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:s,height:a},ticksGenerator:function(l){return Xh(l,!0)}}))},Gf=function(e){function t(){return rQe(this,t),aQe(this,t,arguments)}return lQe(t,e),sQe(t,[{key:"render",value:function(){return h.createElement(dQe,this.props)}}])}(h.Component);rae(Gf,"displayName","YAxis");rae(Gf,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function zB(e){return fQe(e)||hQe(e)||mQe(e)||uQe()}function uQe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1176In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mQe(e,t){if(e){if(typeof e=="string")return hP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hP(e,t)}}function hQe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fQe(e){if(Array.isArray(e))return hP(e)}function hP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}var fP=function(t,n,s,a,i){var o=ml(t,QM),l=ml(t,hC),c=[].concat(zB(o),zB(l)),d=ml(t,pC),u="".concat(a,"Id"),m=a[0],f=n;if(c.length&&(f=c.reduce(function(g,v){if(v.props[u]===s&&Pc(v.props,"extendDomain")&&xt(v.props[m])){var y=v.props[m];return[Math.min(g[0],y),Math.max(g[1],y)]}return g},f)),d.length){var p="".concat(m,"1"),x="".concat(m,"2");f=d.reduce(function(g,v){if(v.props[u]===s&&Pc(v.props,"extendDomain")&&xt(v.props[p])&&xt(v.props[x])){var y=v.props[p],b=v.props[x];return[Math.min(g[0],y,b),Math.max(g[1],y,b)]}return g},f)}return i&&i.length&&(f=i.reduce(function(g,v){return xt(v)?[Math.min(g[0],v),Math.max(g[1],v)]:g},f)),f},sae={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function a(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,m,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new a(u,m||c,f),x=n?n+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new s:delete c._events[d]}function l(){this._events=new s,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,m;if(this._eventsCount===0)return d;for(m in u=this._events)t.call(u,m)&&d.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=n?n+d:d,m=this._events[u];if(!m)return[];if(m.fn)return[m.fn];for(var f=0,p=m.length,x=new Array(p);f<p;f++)x[f]=m[f].fn;return x},l.prototype.listenerCount=function(d){var u=n?n+d:d,m=this._events[u];return m?m.fn?1:m.length:0},l.prototype.emit=function(d,u,m,f,p,x){var g=n?n+d:d;if(!this._events[g])return!1;var v=this._events[g],y=arguments.length,b,w;if(v.fn){switch(v.once&&this.removeListener(d,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,m),!0;case 4:return v.fn.call(v.context,u,m,f),!0;case 5:return v.fn.call(v.context,u,m,f,p),!0;case 6:return v.fn.call(v.context,u,m,f,p,x),!0}for(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];v.fn.apply(v.context,b)}else{var S=v.length,j;for(w=0;w<S;w++)switch(v[w].once&&this.removeListener(d,v[w].fn,void 0,!0),y){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,u);break;case 3:v[w].fn.call(v[w].context,u,m);break;case 4:v[w].fn.call(v[w].context,u,m,f);break;default:if(!b)for(j=1,b=new Array(y-1);j<y;j++)b[j-1]=arguments[j];v[w].fn.apply(v[w].context,b)}}return!0},l.prototype.on=function(d,u,m){return i(this,d,u,m,!1)},l.prototype.once=function(d,u,m){return i(this,d,u,m,!0)},l.prototype.removeListener=function(d,u,m,f){var p=n?n+d:d;if(!this._events[p])return this;if(!u)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===u&&(!f||x.once)&&(!m||x.context===m)&&o(this,p);else{for(var g=0,v=[],y=x.length;g<y;g++)(x[g].fn!==u||f&&!x[g].once||m&&x[g].context!==m)&&v.push(x[g]);v.length?this._events[p]=v.length===1?v[0]:v:o(this,p)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=n?n+d:d,this._events[u]&&o(this,u)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(sae);var pQe=sae.exports;const xQe=Mn(pQe);var HE=new xQe,WE="recharts.syncMouseEvents";function U0(e){"@babel/helpers - typeof";return U0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U0(e)}function gQe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vQe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,aae(s.key),s)}}function yQe(e,t,n){return t&&vQe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YE(e,t,n){return t=aae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aae(e){var t=bQe(e,"string");return U0(t)=="symbol"?t:t+""}function bQe(e,t){if(U0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(U0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wQe=function(){function e(){gQe(this,e),YE(this,"activeIndex",0),YE(this,"coordinateList",[]),YE(this,"layout","horizontal")}return yQe(e,[{key:"setDetails",value:function(n){var s,a=n.coordinateList,i=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,d=c===void 0?null:c,u=n.offset,m=u===void 0?null:u,f=n.mouseHandlerCallback,p=f===void 0?null:f;this.coordinateList=(s=i??this.coordinateList)!==null&&s!==void 0?s:[],this.container=l??this.container,this.layout=d??this.layout,this.offset=m??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,s;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,d=((n=window)===null||n===void 0?void 0:n.scrollX)||0,u=((s=window)===null||s===void 0?void 0:s.scrollY)||0,m=i+c+d,f=o+this.offset.top+l/2+u;this.mouseHandlerCallback({pageX:m,pageY:f})}}}])}();function jQe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var s=e==null?void 0:e[0],a=e==null?void 0:e[1];if(s&&a&&xt(s)&&xt(a))return!0}return!1}function NQe(e,t,n,s){var a=s/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?s:n.width-1,height:e==="horizontal"?n.height-1:s}}function iae(e){var t=e.cx,n=e.cy,s=e.radius,a=e.startAngle,i=e.endAngle,o=ls(t,n,s,a),l=ls(t,n,s,i);return{points:[o,l],cx:t,cy:n,radius:s,startAngle:a,endAngle:i}}function SQe(e,t,n){var s,a,i,o;if(e==="horizontal")s=t.x,i=s,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,s=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,d=t.innerRadius,u=t.outerRadius,m=t.angle,f=ls(l,c,d,m),p=ls(l,c,u,m);s=f.x,a=f.y,i=p.x,o=p.y}else return iae(t);return[{x:s,y:a},{x:i,y:o}]}function F0(e){"@babel/helpers - typeof";return F0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F0(e)}function qB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Hj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qB(Object(n),!0).forEach(function(s){_Qe(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function _Qe(e,t,n){return t=CQe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CQe(e){var t=kQe(e,"string");return F0(t)=="symbol"?t:t+""}function kQe(e,t){if(F0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(F0(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EQe(e){var t,n,s=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,d=e.activeTooltipIndex,u=e.tooltipAxisBandSize,m=e.layout,f=e.chartName,p=(t=s.props.cursor)!==null&&t!==void 0?t:(n=s.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!s||!p||!i||!o||f!=="ScatterChart"&&a!=="axis")return null;var x,g=Dx;if(f==="ScatterChart")x=o,g=kYe;else if(f==="BarChart")x=NQe(m,o,c,u),g=KM;else if(m==="radial"){var v=iae(o),y=v.cx,b=v.cy,w=v.radius,S=v.startAngle,j=v.endAngle;x={cx:y,cy:b,startAngle:S,endAngle:j,innerRadius:w,outerRadius:w},g=ese}else x={points:SQe(m,o,c)},g=Dx;var N=Hj(Hj(Hj(Hj({stroke:"#ccc",pointerEvents:"none"},c),x),ir(p,!1)),{},{payload:l,payloadIndex:d,className:Tr("recharts-tooltip-cursor",p.className)});return h.isValidElement(p)?h.cloneElement(p,N):h.createElement(g,N)}var AQe=["item"],TQe=["children","className","width","height","style","compact","title","desc"];function Wg(e){"@babel/helpers - typeof";return Wg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wg(e)}function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},hx.apply(this,arguments)}function HB(e,t){return PQe(e)||OQe(e,t)||lae(e,t)||RQe()}function RQe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1177In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OQe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,i,o,l=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(s=i.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(u){d=!0,a=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function PQe(e){if(Array.isArray(e))return e}function WB(e,t){if(e==null)return{};var n=DQe(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)s=i[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function DQe(e,t){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function MQe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IQe(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,cae(s.key),s)}}function LQe(e,t,n){return t&&IQe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $Qe(e,t,n){return t=GS(t),VQe(e,oae()?Reflect.construct(t,n||[],GS(e).constructor):t.apply(e,n))}function VQe(e,t){if(t&&(Wg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UQe(e)}function UQe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oae=function(){return!!e})()}function GS(e){return GS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},GS(e)}function FQe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pP(e,t)}function pP(e,t){return pP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},pP(e,t)}function Yg(e){return qQe(e)||zQe(e)||lae(e)||BQe()}function BQe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1178In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lae(e,t){if(e){if(typeof e=="string")return xP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xP(e,t)}}function zQe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qQe(e){if(Array.isArray(e))return xP(e)}function xP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function YB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YB(Object(n),!0).forEach(function(s){ur(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YB(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ur(e,t,n){return t=cae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cae(e){var t=HQe(e,"string");return Wg(t)=="symbol"?t:t+""}function HQe(e,t){if(Wg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(Wg(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WQe={xAxis:["bottom","top"],yAxis:["left","right"]},YQe={width:"100%",height:"100%"},dae={x:0,y:0};function Wj(e){return e}var GQe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},KQe=function(t,n,s,a){var i=n.find(function(u){return u&&u.index===s});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return Ye(Ye(Ye({},a),ls(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,d=a.angle;return Ye(Ye(Ye({},a),ls(a.cx,a.cy,c,d)),{},{angle:d,radius:c})}return dae},gC=function(t,n){var s=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(s??[]).reduce(function(l,c){var d=c.props.data;return d&&d.length?[].concat(Yg(l),Yg(d)):l},[]);return o.length>0?o:t&&t.length&&xt(a)&&xt(i)?t.slice(a,i+1):[]};function uae(e){return e==="number"?[0,"auto"]:void 0}var gP=function(t,n,s,a){var i=t.graphicalItems,o=t.tooltipAxis,l=gC(n,t);return s<0||!i||!i.length||s>=l.length?null:i.reduce(function(c,d){var u,m=(u=d.props.data)!==null&&u!==void 0?u:n;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=s&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var f;if(o.dataKey&&!o.allowDuplicatedCategory){var p=m===void 0?l:m;f=KN(p,o.dataKey,a)}else f=m&&m[s]||l[s];return f?[].concat(Yg(c),[Gne(d,f)]):c},[])},GB=function(t,n,s,a){var i=a||{x:t.chartX,y:t.chartY},o=GQe(i,s),l=t.orderedTooltipTicks,c=t.tooltipAxis,d=t.tooltipTicks,u=Z7e(o,l,d,c);if(u>=0&&d){var m=d[u]&&d[u].value,f=gP(t,n,u,m),p=KQe(s,l,u,i);return{activeTooltipIndex:u,activeLabel:m,activePayload:f,activeCoordinate:p}}return null},XQe=function(t,n){var s=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,u=t.layout,m=t.children,f=t.stackOffset,p=zne(u,i);return s.reduce(function(x,g){var v,y=g.type.defaultProps!==void 0?Ye(Ye({},g.type.defaultProps),g.props):g.props,b=y.type,w=y.dataKey,S=y.allowDataOverflow,j=y.allowDuplicatedCategory,N=y.scale,_=y.ticks,C=y.includeHidden,k=y[o];if(x[k])return x;var E=gC(t.data,{graphicalItems:a.filter(function(K){var Z,q=o in K.props?K.props[o]:(Z=K.type.defaultProps)===null||Z===void 0?void 0:Z[o];return q===k}),dataStartIndex:c,dataEndIndex:d}),R=E.length,T,D,A;jQe(y.domain,S,b)&&(T=OO(y.domain,null,S),p&&(b==="number"||N!=="auto")&&(A=ub(E,w,"category")));var V=uae(b);if(!T||T.length===0){var U,O=(U=y.domain)!==null&&U!==void 0?U:V;if(w){if(T=ub(E,w,b),b==="category"&&p){var M=V5e(T);j&&M?(D=T,T=MS(0,R)):j||(T=yF(O,T,g).reduce(function(K,Z){return K.indexOf(Z)>=0?K:[].concat(Yg(K),[Z])},[]))}else if(b==="category")j?T=T.filter(function(K){return K!==""&&!Rr(K)}):T=yF(O,T,g).reduce(function(K,Z){return K.indexOf(Z)>=0||Z===""||Rr(Z)?K:[].concat(Yg(K),[Z])},[]);else if(b==="number"){var $=rqe(E,a.filter(function(K){var Z,q,H=o in K.props?K.props[o]:(Z=K.type.defaultProps)===null||Z===void 0?void 0:Z[o],X="hide"in K.props?K.props.hide:(q=K.type.defaultProps)===null||q===void 0?void 0:q.hide;return H===k&&(C||!X)}),w,i,u);$&&(T=$)}p&&(b==="number"||N!=="auto")&&(A=ub(E,w,"category"))}else p?T=MS(0,R):l&&l[k]&&l[k].hasStack&&b==="number"?T=f==="expand"?[0,1]:Yne(l[k].stackGroups,c,d):T=Bne(E,a.filter(function(K){var Z=o in K.props?K.props[o]:K.type.defaultProps[o],q="hide"in K.props?K.props.hide:K.type.defaultProps.hide;return Z===k&&(C||!q)}),b,u,!0);if(b==="number")T=fP(m,T,k,i,_),O&&(T=OO(O,T,S));else if(b==="category"&&O){var I=O,B=T.every(function(K){return I.indexOf(K)>=0});B&&(T=I)}}return Ye(Ye({},x),{},ur({},k,Ye(Ye({},y),{},{axisType:i,domain:T,categoricalDomain:A,duplicateDomain:D,originalDomain:(v=y.domain)!==null&&v!==void 0?v:V,isCategorical:p,layout:u})))},{})},ZQe=function(t,n){var s=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,u=t.layout,m=t.children,f=gC(t.data,{graphicalItems:s,dataStartIndex:c,dataEndIndex:d}),p=f.length,x=zne(u,i),g=-1;return s.reduce(function(v,y){var b=y.type.defaultProps!==void 0?Ye(Ye({},y.type.defaultProps),y.props):y.props,w=b[o],S=uae("number");if(!v[w]){g++;var j;return x?j=MS(0,p):l&&l[w]&&l[w].hasStack?(j=Yne(l[w].stackGroups,c,d),j=fP(m,j,w,i)):(j=OO(S,Bne(f,s.filter(function(N){var _,C,k=o in N.props?N.props[o]:(_=N.type.defaultProps)===null||_===void 0?void 0:_[o],E="hide"in N.props?N.props.hide:(C=N.type.defaultProps)===null||C===void 0?void 0:C.hide;return k===w&&!E}),"number",u),a.defaultProps.allowDataOverflow),j=fP(m,j,w,i)),Ye(Ye({},v),{},ur({},w,Ye(Ye({axisType:i},a.defaultProps),{},{hide:!0,orientation:To(WQe,"".concat(i,".").concat(g%2),null),domain:j,originalDomain:S,isCategorical:x,layout:u})))}return v},{})},QQe=function(t,n){var s=n.axisType,a=s===void 0?"xAxis":s,i=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,u=t.children,m="".concat(a,"Id"),f=ml(u,i),p={};return f&&f.length?p=XQe(t,{axes:f,graphicalItems:o,axisType:a,axisIdKey:m,stackGroups:l,dataStartIndex:c,dataEndIndex:d}):o&&o.length&&(p=ZQe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:m,stackGroups:l,dataStartIndex:c,dataEndIndex:d})),p},JQe=function(t){var n=Bp(t),s=Xh(n,!1,!0);return{tooltipTicks:s,orderedTooltipTicks:jM(s,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:NS(n,s)}},KB=function(t){var n=t.children,s=t.defaultShowTooltip,a=fo(n,Lg),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!s}},eJe=function(t){return!t||!t.length?!1:t.some(function(n){var s=Rd(n&&n.type);return s&&s.indexOf("Bar")>=0})},XB=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tJe=function(t,n){var s=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,d=s.width,u=s.height,m=s.children,f=s.margin||{},p=fo(m,Lg),x=fo(m,Rx),g=Object.keys(c).reduce(function(j,N){var _=c[N],C=_.orientation;return!_.mirror&&!_.hide?Ye(Ye({},j),{},ur({},C,j[C]+_.width)):j},{left:f.left||0,right:f.right||0}),v=Object.keys(o).reduce(function(j,N){var _=o[N],C=_.orientation;return!_.mirror&&!_.hide?Ye(Ye({},j),{},ur({},C,To(j,"".concat(C))+_.height)):j},{top:f.top||0,bottom:f.bottom||0}),y=Ye(Ye({},v),g),b=y.bottom;p&&(y.bottom+=p.props.height||Lg.defaultProps.height),x&&n&&(y=eqe(y,a,s,n));var w=d-y.left-y.right,S=u-y.top-y.bottom;return Ye(Ye({brushBottom:b},y),{},{width:Math.max(w,0),height:Math.max(S,0)})},rJe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},e3=function(t){var n=t.chartName,s=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,d=t.legendContent,u=t.formatAxisMap,m=t.defaultProps,f=function(y,b){var w=b.graphicalItems,S=b.stackGroups,j=b.offset,N=b.updateId,_=b.dataStartIndex,C=b.dataEndIndex,k=y.barSize,E=y.layout,R=y.barGap,T=y.barCategoryGap,D=y.maxBarSize,A=XB(E),V=A.numericAxisName,U=A.cateAxisName,O=eJe(w),M=[];return w.forEach(function($,I){var B=gC(y.data,{graphicalItems:[$],dataStartIndex:_,dataEndIndex:C}),K=$.type.defaultProps!==void 0?Ye(Ye({},$.type.defaultProps),$.props):$.props,Z=K.dataKey,q=K.maxBarSize,H=K["".concat(V,"Id")],X=K["".concat(U,"Id")],G={},ee=c.reduce(function(de,ve){var Le=b["".concat(ve.axisType,"Map")],$e=K["".concat(ve.axisType,"Id")];Le&&Le[$e]||ve.axisType==="zAxis"||Wf();var De=Le[$e];return Ye(Ye({},de),{},ur(ur({},ve.axisType,De),"".concat(ve.axisType,"Ticks"),Xh(De)))},G),re=ee[U],W=ee["".concat(U,"Ticks")],Q=S&&S[H]&&S[H].hasStack&&uqe($,S[H].stackGroups),L=Rd($.type).indexOf("Bar")>=0,te=NS(re,W),ae=[],ne=O&&Q7e({barSize:k,stackGroups:S,totalSize:rJe(ee,U)});if(L){var se,ue,Ne=Rr(q)?D:q,Qe=(se=(ue=NS(re,W,!0))!==null&&ue!==void 0?ue:Ne)!==null&&se!==void 0?se:0;ae=J7e({barGap:R,barCategoryGap:T,bandSize:Qe!==te?Qe:te,sizeList:ne[X],maxBarSize:Ne}),Qe!==te&&(ae=ae.map(function(de){return Ye(Ye({},de),{},{position:Ye(Ye({},de.position),{},{offset:de.position.offset-Qe/2})})}))}var J=$&&$.type&&$.type.getComposedData;J&&M.push({props:Ye(Ye({},J(Ye(Ye({},ee),{},{displayedData:B,props:y,dataKey:Z,item:$,bandSize:te,barPosition:ae,offset:j,stackedData:Q,layout:E,dataStartIndex:_,dataEndIndex:C}))),{},ur(ur(ur({key:$.key||"item-".concat(I)},V,ee[V]),U,ee[U]),"animationId",N)),childIndex:Q5e($,y.children),item:$})}),M},p=function(y,b){var w=y.props,S=y.dataStartIndex,j=y.dataEndIndex,N=y.updateId;if(!mU({props:w}))return null;var _=w.children,C=w.layout,k=w.stackOffset,E=w.data,R=w.reverseStackOrder,T=XB(C),D=T.numericAxisName,A=T.cateAxisName,V=ml(_,s),U=cqe(E,V,"".concat(D,"Id"),"".concat(A,"Id"),k,R),O=c.reduce(function(K,Z){var q="".concat(Z.axisType,"Map");return Ye(Ye({},K),{},ur({},q,QQe(w,Ye(Ye({},Z),{},{graphicalItems:V,stackGroups:Z.axisType===D&&U,dataStartIndex:S,dataEndIndex:j}))))},{}),M=tJe(Ye(Ye({},O),{},{props:w,graphicalItems:V}),b==null?void 0:b.legendBBox);Object.keys(O).forEach(function(K){O[K]=u(w,O[K],M,K.replace("Map",""),n)});var $=O["".concat(A,"Map")],I=JQe($),B=f(w,Ye(Ye({},O),{},{dataStartIndex:S,dataEndIndex:j,updateId:N,graphicalItems:V,stackGroups:U,offset:M}));return Ye(Ye({formattedGraphicalItems:B,graphicalItems:V,offset:M,stackGroups:U},I),O)},x=function(v){function y(b){var w,S,j;return MQe(this,y),j=$Qe(this,y,[b]),ur(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ur(j,"accessibilityManager",new wQe),ur(j,"handleLegendBBoxUpdate",function(N){if(N){var _=j.state,C=_.dataStartIndex,k=_.dataEndIndex,E=_.updateId;j.setState(Ye({legendBBox:N},p({props:j.props,dataStartIndex:C,dataEndIndex:k,updateId:E},Ye(Ye({},j.state),{},{legendBBox:N}))))}}),ur(j,"handleReceiveSyncEvent",function(N,_,C){if(j.props.syncId===N){if(C===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(_)}}),ur(j,"handleBrushChange",function(N){var _=N.startIndex,C=N.endIndex;if(_!==j.state.dataStartIndex||C!==j.state.dataEndIndex){var k=j.state.updateId;j.setState(function(){return Ye({dataStartIndex:_,dataEndIndex:C},p({props:j.props,dataStartIndex:_,dataEndIndex:C,updateId:k},j.state))}),j.triggerSyncEvent({dataStartIndex:_,dataEndIndex:C})}}),ur(j,"handleMouseEnter",function(N){var _=j.getMouseInfo(N);if(_){var C=Ye(Ye({},_),{},{isTooltipActive:!0});j.setState(C),j.triggerSyncEvent(C);var k=j.props.onMouseEnter;Nr(k)&&k(C,N)}}),ur(j,"triggeredAfterMouseMove",function(N){var _=j.getMouseInfo(N),C=_?Ye(Ye({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(C),j.triggerSyncEvent(C);var k=j.props.onMouseMove;Nr(k)&&k(C,N)}),ur(j,"handleItemMouseEnter",function(N){j.setState(function(){return{isTooltipActive:!0,activeItem:N,activePayload:N.tooltipPayload,activeCoordinate:N.tooltipPosition||{x:N.cx,y:N.cy}}})}),ur(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),ur(j,"handleMouseMove",function(N){N.persist(),j.throttleTriggeredAfterMouseMove(N)}),ur(j,"handleMouseLeave",function(N){j.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var C=j.props.onMouseLeave;Nr(C)&&C(_,N)}),ur(j,"handleOuterEvent",function(N){var _=Z5e(N),C=To(j.props,"".concat(_));if(_&&Nr(C)){var k,E;/.*touch.*/i.test(_)?E=j.getMouseInfo(N.changedTouches[0]):E=j.getMouseInfo(N),C((k=E)!==null&&k!==void 0?k:{},N)}}),ur(j,"handleClick",function(N){var _=j.getMouseInfo(N);if(_){var C=Ye(Ye({},_),{},{isTooltipActive:!0});j.setState(C),j.triggerSyncEvent(C);var k=j.props.onClick;Nr(k)&&k(C,N)}}),ur(j,"handleMouseDown",function(N){var _=j.props.onMouseDown;if(Nr(_)){var C=j.getMouseInfo(N);_(C,N)}}),ur(j,"handleMouseUp",function(N){var _=j.props.onMouseUp;if(Nr(_)){var C=j.getMouseInfo(N);_(C,N)}}),ur(j,"handleTouchMove",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(N.changedTouches[0])}),ur(j,"handleTouchStart",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseDown(N.changedTouches[0])}),ur(j,"handleTouchEnd",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&j.handleMouseUp(N.changedTouches[0])}),ur(j,"handleDoubleClick",function(N){var _=j.props.onDoubleClick;if(Nr(_)){var C=j.getMouseInfo(N);_(C,N)}}),ur(j,"handleContextMenu",function(N){var _=j.props.onContextMenu;if(Nr(_)){var C=j.getMouseInfo(N);_(C,N)}}),ur(j,"triggerSyncEvent",function(N){j.props.syncId!==void 0&&HE.emit(WE,j.props.syncId,N,j.eventEmitterSymbol)}),ur(j,"applySyncEvent",function(N){var _=j.props,C=_.layout,k=_.syncMethod,E=j.state.updateId,R=N.dataStartIndex,T=N.dataEndIndex;if(N.dataStartIndex!==void 0||N.dataEndIndex!==void 0)j.setState(Ye({dataStartIndex:R,dataEndIndex:T},p({props:j.props,dataStartIndex:R,dataEndIndex:T,updateId:E},j.state)));else if(N.activeTooltipIndex!==void 0){var D=N.chartX,A=N.chartY,V=N.activeTooltipIndex,U=j.state,O=U.offset,M=U.tooltipTicks;if(!O)return;if(typeof k=="function")V=k(M,N);else if(k==="value"){V=-1;for(var $=0;$<M.length;$++)if(M[$].value===N.activeLabel){V=$;break}}var I=Ye(Ye({},O),{},{x:O.left,y:O.top}),B=Math.min(D,I.x+I.width),K=Math.min(A,I.y+I.height),Z=M[V]&&M[V].value,q=gP(j.state,j.props.data,V),H=M[V]?{x:C==="horizontal"?M[V].coordinate:B,y:C==="horizontal"?K:M[V].coordinate}:dae;j.setState(Ye(Ye({},N),{},{activeLabel:Z,activeCoordinate:H,activePayload:q,activeTooltipIndex:V}))}else j.setState(N)}),ur(j,"renderCursor",function(N){var _,C=j.state,k=C.isTooltipActive,E=C.activeCoordinate,R=C.activePayload,T=C.offset,D=C.activeTooltipIndex,A=C.tooltipAxisBandSize,V=j.getTooltipEventType(),U=(_=N.props.active)!==null&&_!==void 0?_:k,O=j.props.layout,M=N.key||"_recharts-cursor";return Y.createElement(EQe,{key:M,activeCoordinate:E,activePayload:R,activeTooltipIndex:D,chartName:n,element:N,isActive:U,layout:O,offset:T,tooltipAxisBandSize:A,tooltipEventType:V})}),ur(j,"renderPolarAxis",function(N,_,C){var k=To(N,"type.axisType"),E=To(j.state,"".concat(k,"Map")),R=N.type.defaultProps,T=R!==void 0?Ye(Ye({},R),N.props):N.props,D=E&&E[T["".concat(k,"Id")]];return h.cloneElement(N,Ye(Ye({},D),{},{className:Tr(k,D.className),key:N.key||"".concat(_,"-").concat(C),ticks:Xh(D,!0)}))}),ur(j,"renderPolarGrid",function(N){var _=N.props,C=_.radialLines,k=_.polarAngles,E=_.polarRadius,R=j.state,T=R.radiusAxisMap,D=R.angleAxisMap,A=Bp(T),V=Bp(D),U=V.cx,O=V.cy,M=V.innerRadius,$=V.outerRadius;return h.cloneElement(N,{polarAngles:Array.isArray(k)?k:Xh(V,!0).map(function(I){return I.coordinate}),polarRadius:Array.isArray(E)?E:Xh(A,!0).map(function(I){return I.coordinate}),cx:U,cy:O,innerRadius:M,outerRadius:$,key:N.key||"polar-grid",radialLines:C})}),ur(j,"renderLegend",function(){var N=j.state.formattedGraphicalItems,_=j.props,C=_.children,k=_.width,E=_.height,R=j.props.margin||{},T=k-(R.left||0)-(R.right||0),D=Une({children:C,formattedGraphicalItems:N,legendWidth:T,legendContent:d});if(!D)return null;var A=D.item,V=WB(D,AQe);return h.cloneElement(A,Ye(Ye({},V),{},{chartWidth:k,chartHeight:E,margin:R,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),ur(j,"renderTooltip",function(){var N,_=j.props,C=_.children,k=_.accessibilityLayer,E=fo(C,Wo);if(!E)return null;var R=j.state,T=R.isTooltipActive,D=R.activeCoordinate,A=R.activePayload,V=R.activeLabel,U=R.offset,O=(N=E.props.active)!==null&&N!==void 0?N:T;return h.cloneElement(E,{viewBox:Ye(Ye({},U),{},{x:U.left,y:U.top}),active:O,label:V,payload:O?A:[],coordinate:D,accessibilityLayer:k})}),ur(j,"renderBrush",function(N){var _=j.props,C=_.margin,k=_.data,E=j.state,R=E.offset,T=E.dataStartIndex,D=E.dataEndIndex,A=E.updateId;return h.cloneElement(N,{key:N.key||"_recharts-brush",onChange:Fj(j.handleBrushChange,N.props.onChange),data:k,x:xt(N.props.x)?N.props.x:R.left,y:xt(N.props.y)?N.props.y:R.top+R.height+R.brushBottom-(C.bottom||0),width:xt(N.props.width)?N.props.width:R.width,startIndex:T,endIndex:D,updateId:"brush-".concat(A)})}),ur(j,"renderReferenceElement",function(N,_,C){if(!N)return null;var k=j,E=k.clipPathId,R=j.state,T=R.xAxisMap,D=R.yAxisMap,A=R.offset,V=N.type.defaultProps||{},U=N.props,O=U.xAxisId,M=O===void 0?V.xAxisId:O,$=U.yAxisId,I=$===void 0?V.yAxisId:$;return h.cloneElement(N,{key:N.key||"".concat(_,"-").concat(C),xAxis:T[M],yAxis:D[I],viewBox:{x:A.left,y:A.top,width:A.width,height:A.height},clipPathId:E})}),ur(j,"renderActivePoints",function(N){var _=N.item,C=N.activePoint,k=N.basePoint,E=N.childIndex,R=N.isRange,T=[],D=_.props.key,A=_.item.type.defaultProps!==void 0?Ye(Ye({},_.item.type.defaultProps),_.item.props):_.item.props,V=A.activeDot,U=A.dataKey,O=Ye(Ye({index:E,dataKey:U,cx:C.x,cy:C.y,r:4,fill:GM(_.item),strokeWidth:2,stroke:"#fff",payload:C.payload,value:C.value},ir(V,!1)),XN(V));return T.push(y.renderActiveDot(V,O,"".concat(D,"-activePoint-").concat(E))),k?T.push(y.renderActiveDot(V,Ye(Ye({},O),{},{cx:k.x,cy:k.y}),"".concat(D,"-basePoint-").concat(E))):R&&T.push(null),T}),ur(j,"renderGraphicChild",function(N,_,C){var k=j.filterFormatItem(N,_,C);if(!k)return null;var E=j.getTooltipEventType(),R=j.state,T=R.isTooltipActive,D=R.tooltipAxis,A=R.activeTooltipIndex,V=R.activeLabel,U=j.props.children,O=fo(U,Wo),M=k.props,$=M.points,I=M.isRange,B=M.baseLine,K=k.item.type.defaultProps!==void 0?Ye(Ye({},k.item.type.defaultProps),k.item.props):k.item.props,Z=K.activeDot,q=K.hide,H=K.activeBar,X=K.activeShape,G=!!(!q&&T&&O&&(Z||H||X)),ee={};E!=="axis"&&O&&O.props.trigger==="click"?ee={onClick:Fj(j.handleItemMouseEnter,N.props.onClick)}:E!=="axis"&&(ee={onMouseLeave:Fj(j.handleItemMouseLeave,N.props.onMouseLeave),onMouseEnter:Fj(j.handleItemMouseEnter,N.props.onMouseEnter)});var re=h.cloneElement(N,Ye(Ye({},k.props),ee));function W(ve){return typeof D.dataKey=="function"?D.dataKey(ve.payload):null}if(G)if(A>=0){var Q,L;if(D.dataKey&&!D.allowDuplicatedCategory){var te=typeof D.dataKey=="function"?W:"payload.".concat(D.dataKey.toString());Q=KN($,te,V),L=I&&B&&KN(B,te,V)}else Q=$==null?void 0:$[A],L=I&&B&&B[A];if(X||H){var ae=N.props.activeIndex!==void 0?N.props.activeIndex:A;return[h.cloneElement(N,Ye(Ye(Ye({},k.props),ee),{},{activeIndex:ae})),null,null]}if(!Rr(Q))return[re].concat(Yg(j.renderActivePoints({item:k,activePoint:Q,basePoint:L,childIndex:A,isRange:I})))}else{var ne,se=(ne=j.getItemByXY(j.state.activeCoordinate))!==null&&ne!==void 0?ne:{graphicalItem:re},ue=se.graphicalItem,Ne=ue.item,Qe=Ne===void 0?N:Ne,J=ue.childIndex,de=Ye(Ye(Ye({},k.props),ee),{},{activeIndex:J});return[h.cloneElement(Qe,de),null,null]}return I?[re,null,null]:[re,null]}),ur(j,"renderCustomized",function(N,_,C){return h.cloneElement(N,Ye(Ye({key:"recharts-customized-".concat(C)},j.props),j.state))}),ur(j,"renderMap",{CartesianGrid:{handler:Wj,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Wj},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Wj},YAxis:{handler:Wj},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:Mv("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=Vre(j.triggeredAfterMouseMove,(S=b.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return FQe(y,v),LQe(y,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,j=w.data,N=w.height,_=w.layout,C=fo(S,Wo);if(C){var k=C.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,R=gP(this.state,j,k,E),T=this.state.tooltipTicks[k].coordinate,D=(this.state.offset.top+N)/2,A=_==="horizontal",V=A?{x:T,y:D}:{y:T,x:D},U=this.state.formattedGraphicalItems.find(function(M){var $=M.item;return $.type.name==="Scatter"});U&&(V=Ye(Ye({},V),U.props.points[k].tooltipPosition),R=U.props.points[k].tooltipPayload);var O={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:E,activePayload:R,activeCoordinate:V};this.setState(O),this.renderCursor(C),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var j,N;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0}})}return null}},{key:"componentDidUpdate",value:function(w){YR([fo(w.children,Wo)],[fo(this.props.children,Wo)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=fo(this.props.children,Wo);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),N=_Fe(j),_={chartX:Math.round(w.pageX-N.left),chartY:Math.round(w.pageY-N.top)},C=j.width/S.offsetWidth||1,k=this.inRange(_.chartX,_.chartY,C);if(!k)return null;var E=this.state,R=E.xAxisMap,T=E.yAxisMap,D=this.getTooltipEventType(),A=GB(this.state,this.props.data,this.props.layout,k);if(D!=="axis"&&R&&T){var V=Bp(R).scale,U=Bp(T).scale,O=V&&V.invert?V.invert(_.chartX):null,M=U&&U.invert?U.invert(_.chartY):null;return Ye(Ye({},_),{},{xValue:O,yValue:M},A)}return A?Ye(Ye({},_),A):null}},{key:"inRange",value:function(w,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=this.props.layout,_=w/j,C=S/j;if(N==="horizontal"||N==="vertical"){var k=this.state.offset,E=_>=k.left&&_<=k.left+k.width&&C>=k.top&&C<=k.top+k.height;return E?{x:_,y:C}:null}var R=this.state,T=R.angleAxisMap,D=R.radiusAxisMap;if(T&&D){var A=Bp(T);return jF({x:_,y:C},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),j=fo(w,Wo),N={};j&&S==="axis"&&(j.props.trigger==="click"?N={onClick:this.handleClick}:N={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=XN(this.props,this.handleOuterEvent);return Ye(Ye({},_),N)}},{key:"addListener",value:function(){HE.on(WE,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){HE.removeListener(WE,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,j){for(var N=this.state.formattedGraphicalItems,_=0,C=N.length;_<C;_++){var k=N[_];if(k.item===w||k.props.key===w.key||S===Rd(k.item.type)&&j===k.childIndex)return k}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,S=this.state.offset,j=S.left,N=S.top,_=S.height,C=S.width;return Y.createElement("defs",null,Y.createElement("clipPath",{id:w},Y.createElement("rect",{x:j,y:N,height:_,width:C})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(S,j){var N=HB(j,2),_=N[0],C=N[1];return Ye(Ye({},S),{},ur({},_,C.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(S,j){var N=HB(j,2),_=N[0],C=N[1];return Ye(Ye({},S),{},ur({},_,C.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(w){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(w){var S=this.state,j=S.formattedGraphicalItems,N=S.activeItem;if(j&&j.length)for(var _=0,C=j.length;_<C;_++){var k=j[_],E=k.props,R=k.item,T=R.type.defaultProps!==void 0?Ye(Ye({},R.type.defaultProps),R.props):R.props,D=Rd(R.type);if(D==="Bar"){var A=(E.data||[]).find(function(M){return oYe(w,M)});if(A)return{graphicalItem:k,payload:A}}else if(D==="RadialBar"){var V=(E.data||[]).find(function(M){return jF(w,M)});if(V)return{graphicalItem:k,payload:V}}else if(cC(k,N)||dC(k,N)||M0(k,N)){var U=KGe({graphicalItem:k,activeTooltipItem:N,itemData:T.data}),O=T.activeIndex===void 0?U:T.activeIndex;return{graphicalItem:Ye(Ye({},k),{},{childIndex:O}),payload:M0(k,N)?T.data[U]:k.props.data[U]}}}return null}},{key:"render",value:function(){var w=this;if(!mU(this))return null;var S=this.props,j=S.children,N=S.className,_=S.width,C=S.height,k=S.style,E=S.compact,R=S.title,T=S.desc,D=WB(S,TQe),A=ir(D,!1);if(E)return Y.createElement(TB,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement(KR,hx({},A,{width:_,height:C,title:R,desc:T}),this.renderClipPath(),fU(j,this.renderMap)));if(this.props.accessibilityLayer){var V,U;A.tabIndex=(V=this.props.tabIndex)!==null&&V!==void 0?V:0,A.role=(U=this.props.role)!==null&&U!==void 0?U:"application",A.onKeyDown=function(M){w.accessibilityManager.keyboardEvent(M)},A.onFocus=function(){w.accessibilityManager.focus()}}var O=this.parseEventsOfWrapper();return Y.createElement(TB,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement("div",hx({className:Tr("recharts-wrapper",N),style:Ye({position:"relative",cursor:"default",width:_,height:C},k)},O,{ref:function($){w.container=$}}),Y.createElement(KR,hx({},A,{width:_,height:C,title:R,desc:T,style:YQe}),this.renderClipPath(),fU(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(h.Component);ur(x,"displayName",n),ur(x,"defaultProps",Ye({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),ur(x,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,w=v.data,S=v.children,j=v.width,N=v.height,_=v.layout,C=v.stackOffset,k=v.margin,E=y.dataStartIndex,R=y.dataEndIndex;if(y.updateId===void 0){var T=KB(v);return Ye(Ye(Ye({},T),{},{updateId:0},p(Ye(Ye({props:v},T),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:w,prevWidth:j,prevHeight:N,prevLayout:_,prevStackOffset:C,prevMargin:k,prevChildren:S})}if(b!==y.prevDataKey||w!==y.prevData||j!==y.prevWidth||N!==y.prevHeight||_!==y.prevLayout||C!==y.prevStackOffset||!Tx(k,y.prevMargin)){var D=KB(v),A={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},V=Ye(Ye({},GB(y,w,_)),{},{updateId:y.updateId+1}),U=Ye(Ye(Ye({},D),A),V);return Ye(Ye(Ye({},U),p(Ye({props:v},U),y)),{},{prevDataKey:b,prevData:w,prevWidth:j,prevHeight:N,prevLayout:_,prevStackOffset:C,prevMargin:k,prevChildren:S})}if(!YR(S,y.prevChildren)){var O,M,$,I,B=fo(S,Lg),K=B&&(O=(M=B.props)===null||M===void 0?void 0:M.startIndex)!==null&&O!==void 0?O:E,Z=B&&($=(I=B.props)===null||I===void 0?void 0:I.endIndex)!==null&&$!==void 0?$:R,q=K!==E||Z!==R,H=!Rr(w),X=H&&!q?y.updateId:y.updateId+1;return Ye(Ye({updateId:X},p(Ye(Ye({props:v},y),{},{updateId:X,dataStartIndex:K,dataEndIndex:Z}),y)),{},{prevChildren:S,dataStartIndex:K,dataEndIndex:Z})}return null}),ur(x,"renderActiveDot",function(v,y,b){var w;return h.isValidElement(v)?w=h.cloneElement(v,y):Nr(v)?w=v(y):w=Y.createElement(sC,y),Y.createElement(ln,{className:"recharts-active-dot",key:b},w)});var g=h.forwardRef(function(y,b){return Y.createElement(x,hx({},y,{ref:b}))});return g.displayName=x.displayName,g},mae=e3({chartName:"BarChart",GraphicalChild:tu,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Yf},{axisType:"yAxis",AxisComp:Gf}],formatAxisMap:Cse}),nJe=e3({chartName:"PieChart",GraphicalChild:xu,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:lC},{axisType:"radiusAxis",AxisComp:iC}],formatAxisMap:wqe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),sJe=e3({chartName:"AreaChart",GraphicalChild:xh,axisComponents:[{axisType:"xAxis",AxisComp:Yf},{axisType:"yAxis",AxisComp:Gf}],formatAxisMap:Cse});const hae=({videoId:e,videoTitle:t,videoDuration:n})=>{const[s,a]=h.useState(null),[i,o]=h.useState([]),[l,c]=h.useState(!0),[d,u]=
1178h.useState("7d");h.useEffect(()=>{f(),m()},[e,d]);const m=async()=>{try{const{data:v,error:y}=await F.from("share_link_views").select("*").eq("video_id",e).order("viewed_at",{ascending:!1}).limit(20);if(y){console.error("Error fetching viewer progress:",y);return}const b=(v||[]).map(w=>({id:w.id,recipientEmail:w.recipient_email,recipientName:null,watchPercentage:Number(w.watch_percentage)||0,watchDuration:w.watch_duration||0,completed:w.completed||!1,device:w.viewer_device,browser:w.viewer_browser,viewedAt:w.viewed_at}));o(b)}catch(v){console.error("Error fetching viewer progress:",v)}},f=async()=>{c(!0);try{const v=new Date;let y=null;d==="7d"?y=vf(v,7):d==="30d"&&(y=vf(v,30));let b=F.from("share_link_views").select("*").eq("video_id",e);y&&(b=b.gte("viewed_at",y.toISOString()));const[{data:w,error:S},{data:j,error:N},{data:_,error:C}]=await Promise.all([b,F.from("video_share_links_safe").select("id, view_count").eq("video_id",e),F.from("videos").select("view_count").eq("id",e).maybeSingle()]);S&&console.error("Error fetching views:",S),N&&console.error("Error fetching share links:",N),C&&console.error("Error fetching video summary:",C);const k=w||[],E=k.length,R=(j||[]).reduce((q,H)=>q+(H.view_count||0),0),T=(_==null?void 0:_.view_count)||0,D=Math.max(E,R,T),A=new Set(k.map(q=>q.viewer_ip).filter(Boolean)).size,V=k.reduce((q,H)=>q+(H.watch_duration||0),0),U=E>0?V/E:0,O=k.filter(q=>q.completed).length,M=E>0?O/E*100:0,B=gTe({start:vf(v,(d==="7d"?7:30)-1),end:v}).map(q=>{const H=Zd(q),X=k.filter(G=>Zd(new Date(G.viewed_at)).getTime()===H.getTime()).length;return{date:cn(q,"MMM d"),views:X}}),Z=[{range:"0-25%",min:0,max:.25},{range:"25-50%",min:.25,max:.5},{range:"50-75%",min:.5,max:.75},{range:"75-100%",min:.75,max:1}].map(({range:q,min:H,max:X})=>{const G=k.filter(ee=>{if(!n||!ee.watch_duration)return!1;const re=ee.watch_duration/n;return re>=H&&re<X}).length;return{range:q,count:G}});a({totalViews:D,uniqueViewers:A,avgWatchTime:U,completionRate:M,totalWatchTime:V,shareLinks:(j==null?void 0:j.length)||0,viewsOverTime:B,watchTimeDistribution:Z})}catch(v){console.error("Error fetching analytics:",v)}finally{c(!1)}},p=v=>{if(v<60)return`${Math.round(v)}s`;const y=Math.floor(v/60),b=Math.round(v%60);return`${y}m ${b}s`},x=v=>{switch(v==null?void 0:v.toLowerCase()){case"mobile":return r.jsx(qc,{className:"w-3.5 h-3.5"});case"tablet":return r.jsx(z4,{className:"w-3.5 h-3.5"});default:return r.jsx(Vs,{className:"w-3.5 h-3.5"})}},g=v=>v>=75?"bg-green-500":v>=50?"bg-yellow-500":v>=25?"bg-orange-500":"bg-red-500";return l?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[r.jsx(qd,{className:"w-5 h-5 text-primary"}),"Video Analytics"]}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),r.jsx(ec,{value:d,onValueChange:v=>u(v),children:r.jsxs(pl,{className:"grid grid-cols-3 w-[200px]",children:[r.jsx(tn,{value:"7d",children:"7 days"}),r.jsx(tn,{value:"30d",children:"30 days"}),r.jsx(tn,{value:"all",children:"All time"})]})})]}),r.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},children:r.jsx(Ie,{className:"bg-gradient-to-br from-primary/10 to-primary/5",children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/20",children:r.jsx(wr,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.totalViews}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Views"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.15},children:r.jsx(Ie,{className:"bg-gradient-to-br from-blue-500/10 to-blue-500/5",children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-blue-500/20",children:r.jsx(jr,{className:"w-5 h-5 text-blue-500"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.uniqueViewers}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Unique Viewers"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10}
1178,animate:{opacity:1,y:0},transition:{delay:.2},children:r.jsx(Ie,{className:"bg-gradient-to-br from-green-500/10 to-green-500/5",children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-green-500/20",children:r.jsx(fr,{className:"w-5 h-5 text-green-500"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:p(s.avgWatchTime)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Watch Time"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.25},children:r.jsx(Ie,{className:"bg-gradient-to-br from-orange-500/10 to-orange-500/5",children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-orange-500/20",children:r.jsx(Lm,{className:"w-5 h-5 text-orange-500"})}),r.jsxs("div",{children:[r.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[s.completionRate.toFixed(0),"%"]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Completion Rate"})]})]})})})})]}),i.length>0&&r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.28},children:r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-3",children:r.jsxs($t,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4 text-primary"}),"Recent Viewers",r.jsxs(Se,{variant:"secondary",className:"ml-auto",children:[i.length," views"]})]})}),r.jsx(lt,{className:"p-0",children:r.jsx(Io,{className:"h-[280px]",children:r.jsx("div",{className:"divide-y divide-border",children:i.map((v,y)=>r.jsx(fe.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.05*y},className:"p-4 hover:bg-muted/50 transition-colors",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"p-2 rounded-full bg-muted shrink-0",children:r.jsx(Cc,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:v.recipientEmail||"Anonymous Viewer"}),r.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:dh(new Date(v.viewedAt),{addSuffix:!0})})]}),r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:r.jsx("div",{className:`h-full transition-all duration-500 ${g(v.watchPercentage)}`,style:{width:`${Math.min(100,v.watchPercentage)}%`}})}),r.jsxs("span",{className:"text-xs font-medium text-foreground min-w-[40px] text-right",children:[Math.round(v.watchPercentage),"%"]})]}),r.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[x(v.device),v.device||"Desktop"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(k_,{className:"w-3.5 h-3.5"}),v.browser||"Unknown"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(fr,{className:"w-3.5 h-3.5"}),p(v.watchDuration)]}),v.completed&&r.jsx(Se,{variant:"default",className:"text-[10px] px-1.5 py-0 h-4 bg-green-500/20 text-green-600 border-0",children:"Completed"})]})]})]})},v.id))})})})]})}),r.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs($t,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(Po,{className:"w-4 h-4 text-primary"}),"Views Over Time"]})}),r.jsx(lt,{children:r.jsx("div",{className:"h-[200px]",children:r.jsx(u0,{width:"100%",height:"100%",children:r.jsxs(sJe,{data:s.viewsOverTime,children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"viewsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"5%",stopColor:"hsl(var(--primary))",stopOpacity:.3}),r.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}
1178),r.jsx(Yf,{dataKey:"date",fontSize:11,tickLine:!1,axisLine:!1,tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gf,{fontSize:11,tickLine:!1,axisLine:!1,tick:{fill:"hsl(var(--muted-foreground))"},allowDecimals:!1}),r.jsx(Wo,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:"12px"},labelStyle:{color:"hsl(var(--foreground))"}}),r.jsx(xh,{type:"monotone",dataKey:"views",stroke:"hsl(var(--primary))",strokeWidth:2,fill:"url(#viewsGradient)"})]})})})})]})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.35},children:r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs($t,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(Js,{className:"w-4 h-4 text-green-500"}),"Watch Time Distribution"]})}),r.jsx(lt,{children:r.jsx("div",{className:"h-[200px]",children:r.jsx(u0,{width:"100%",height:"100%",children:r.jsxs(mae,{data:s.watchTimeDistribution,children:[r.jsx(Yf,{dataKey:"range",fontSize:11,tickLine:!1,axisLine:!1,tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Gf,{fontSize:11,tickLine:!1,axisLine:!1,tick:{fill:"hsl(var(--muted-foreground))"},allowDecimals:!1}),r.jsx(Wo,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:"12px"},labelStyle:{color:"hsl(var(--foreground))"}}),r.jsx(tu,{dataKey:"count",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})})})})]})})]}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4},children:r.jsx(Ie,{children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-muted",children:r.jsx(fr,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:p(s.totalWatchTime)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Watch Time"})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-muted",children:r.jsx(Po,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:s.shareLinks}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Share Links"})]})]}),n&&r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-muted",children:r.jsx(Ga,{className:"w-4 h-4 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:p(n)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Video Length"})]})]})]})})})}),s.totalViews===0&&i.length===0&&r.jsx(Ie,{className:"border-dashed",children:r.jsxs(lt,{className:"py-8 text-center",children:[r.jsx(wr,{className:"w-12 h-12 text-muted-foreground/50 mx-auto mb-3"}),r.jsx("p",{className:"text-muted-foreground",children:"No views yet"}),r.jsx("p",{className:"text-sm text-muted-foreground/70 mt-1",children:"Share your video to start tracking analytics"})]})})]}):r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Unable to load analytics"})},ZB=16/9;function aJe(e,t,n){return n2(r2({unit:"%",width:90},n,e,t),e,t)}const iJe=({videoUrl:e,currentThumbnail:t,onThumbnailGenerated:n,isGenerating:s=!1})=>{const a=h.useRef(null),i=h.useRef(null),o=h.useRef(null),l=h.useRef(null),c=h.useRef(null),[d,u]=h.useState(0),[m,f]=h.useState(0),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,b]=h.useState(null),[w,S]=h.useState(null),[j,N]=h.useState(null),[_,C]=h.useState(!1),[k,E]=h.useState("scrub"),R=h.useRef(null),[T,D]=h.useState(null),[A,V]=h.useState(!1),[U,O]=h.useState(!1),[M,$]=h.useState(),[I,B]=h.useState();h.useEffect(()=>()=>{p&&URL.revokeObjectURL(p),g&&URL.revokeObjectURL(g),y&&URL.revokeObjectURL(y),w&&URL.revokeObjectURL(w),T&&T.getTracks().forEach(se=>se.stop())},[p,g,y,w,T]),h.useEffect(()=>
1178{k!=="webcam"&&T&&(T.getTracks().forEach(se=>se.stop()),D(null),V(!1))},[k,T]);const K=async()=>{try{const se=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:640,height:360}});D(se),V(!0),c.current&&(c.current.srcObject=se)}catch(se){Pe.error("Could not access webcam"),console.error("Webcam error:",se)}},Z=()=>{if(!c.current||!i.current)return;const se=c.current,ue=i.current,Ne=ue.getContext("2d");if(!Ne)return;const{width:Qe,height:J}=rl(se.videoWidth,se.videoHeight);ue.width=Qe,ue.height=J,Ne.drawImage(se,0,0,se.videoWidth,se.videoHeight,0,0,Qe,J),ue.toBlob(de=>{if(de){const ve=URL.createObjectURL(de);S(ve),T==null||T.getTracks().forEach(Le=>Le.stop()),D(null),V(!1),Pe.success("Photo captured!")}},"image/jpeg",.9)},q=()=>{if(!i.current){Pe.error("Canvas not ready");return}i.current.toBlob(se=>{se?n(se):Pe.error("Failed to use webcam photo")},"image/jpeg",.9)},H=se=>{var Qe;const ue=(Qe=se.target.files)==null?void 0:Qe[0];if(!ue)return;if(!ue.type.startsWith("image/")){Pe.error("Please upload an image file");return}if(ue.size>5*1024*1024){Pe.error("Image must be less than 5MB");return}const Ne=URL.createObjectURL(ue);v(Ne),b(null),N(null),O(!0),R.current&&(R.current.value="")},X=h.useCallback(se=>{const{width:ue,height:Ne}=se.currentTarget;$(aJe(ue,Ne,ZB))},[]),G=h.useCallback(async()=>{if(!I||!l.current||!o.current){Pe.error("Please select a crop area");return}const se=l.current,ue=o.current,Ne=ue.getContext("2d");if(!Ne)return;const Qe=se.naturalWidth/se.width,J=se.naturalHeight/se.height,de=I.x*Qe,ve=I.y*J,Le=I.width*Qe,$e=I.height*J,{width:De,height:oe}=rl(Le,$e);ue.width=De,ue.height=oe,Ne.imageSmoothingQuality="high",Ne.drawImage(se,de,ve,Le,$e,0,0,De,oe),ue.toBlob(xe=>{if(xe){const Ze=URL.createObjectURL(xe);b(Ze),N(xe),O(!1),Pe.success("Image cropped successfully")}else Pe.error("Failed to crop image")},"image/jpeg",.9)},[I]),ee=()=>{var se;(se=R.current)==null||se.click()},re=()=>{if(!j){Pe.error("No image uploaded");return}n(j)},W=()=>{if(a.current){u(a.current.duration);const se=a.current.duration*.25;f(se),a.current.currentTime=se,C(!0)}},Q=se=>{const ue=se[0];f(ue),a.current&&(a.current.currentTime=ue)},L=()=>{te()},te=()=>{if(!a.current||!i.current)return;const se=a.current,ue=i.current,Ne=ue.getContext("2d");if(!Ne)return;const{width:Qe,height:J}=rl(se.videoWidth,se.videoHeight);ue.width=Qe,ue.height=J,Ne.drawImage(se,0,0,se.videoWidth,se.videoHeight,0,0,Qe,J);const de=ue.toDataURL("image/jpeg",.85);x(de)},ae=()=>{if(!i.current){Pe.error("Canvas not ready");return}i.current.toBlob(se=>{se?n(se):Pe.error("Failed to generate thumbnail")},"image/jpeg",.85)},ne=se=>{const ue=Math.floor(se/60),Ne=Math.floor(se%60);return`${ue}:${Ne.toString().padStart(2,"0")}`};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[r.jsx(wi,{className:"w-4 h-4"}),"Update Thumbnail"]}),r.jsx("video",{ref:a,src:e,className:"hidden",crossOrigin:"anonymous",preload:"auto",muted:!0,onLoadedMetadata:W,onSeeked:L}),r.jsx("canvas",{ref:i,className:"hidden"}),r.jsx("canvas",{ref:o,className:"hidden"}),r.jsx("input",{ref:R,type:"file",accept:"image/*",className:"hidden",onChange:H}),r.jsx(It,{open:U,onOpenChange:O,children:r.jsxs(Dt,{className:"max-w-2xl",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx($m,{className:"w-5 h-5"}),"Crop Thumbnail"]}),r.jsx($r,{children:"Adjust the crop area to select the best portion of your image. The thumbnail will be saved at 16:9 aspect ratio."})]}),r.jsx("div",{className:"relative max-h-[60vh] overflow-auto",children:g&&r.jsx(s2,{crop:M,onChange:se=>$(se),onComplete:se=>B(se),aspect:ZB,className:"max-w-full",children:r.jsx("img",{ref:l,src:g,alt:"Crop preview",onLoad:X,className:"max-w-full max-h-[55vh] object-contain"})})}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsxs(P,{variant:"outline",onClick:()=>O(!1),children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Cancel"]}),r.jsxs(P,{onClick:G,children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Apply Crop"]})]})]})}),r.jsxs(ec,{value:k,onValueChange:E,className:"w-full",children:[r.jsxs(pl,{className:"grid w-full grid-cols-3",children:[r.jsxs(tn,{value:"scrub",className:"text-xs sm:text-sm",children:[r.jsx(cr,{className:"w-3 h-3 mr-1 sm:w-4 sm:h-4 sm:mr-2"}),"Frame"]}),r.jsxs(tn,{value:"upload",className:"text-xs sm:text-sm",children:[r.jsx(na,{className:"w-3 h-3 mr-1 sm:w-4 sm:h-4 sm:mr-2"}),"Upload"]}),r.jsxs(tn,{value:"webcam",className:"text-xs sm:text-sm",children:[r.jsx(ga,{className:"w-3 h-3 mr-1 sm:w-4 sm:h-4 sm:mr-2"}),"Webcam"]})]}
1178),r.jsxs(Fn,{value:"scrub",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:[p?r.jsx("img",{src:p,alt:"Thumbnail preview",className:"w-full h-full object-cover"}):t?r.jsx("img",{src:t,alt:"Current thumbnail",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(wi,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"Loading video..."})]})}),_&&r.jsx("div",{className:"absolute bottom-2 left-2 px-2 py-1 bg-background/80 backdrop-blur-sm rounded text-xs font-medium",children:ne(m)})]}),_&&d>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0:00"}),r.jsx("span",{children:"Drag to select frame"}),r.jsx("span",{children:ne(d)})]}),r.jsx(zm,{value:[m],onValueChange:Q,max:d,step:.1,className:"w-full"})]}),r.jsx(P,{onClick:ae,disabled:!_||s,className:"w-full",size:"sm",children:s?r.jsxs(r.Fragment,{children:[r.jsx(vs,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Use This Frame"]})}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Scrub through the video timeline to find the perfect thumbnail frame"})]}),r.jsxs(Fn,{value:"upload",className:"space-y-4 mt-4",children:[r.jsx("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden cursor-pointer border-2 border-dashed border-muted-foreground/25 hover:border-primary/50 transition-colors",onClick:ee,children:y?r.jsx("img",{src:y,alt:"Cropped thumbnail",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(na,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"Click to upload image"}),r.jsx("p",{className:"text-xs opacity-75 mt-1",children:"JPG, PNG, GIF (max 5MB)"})]})})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",onClick:ee,className:"flex-1",size:"sm",children:[r.jsx(na,{className:"w-4 h-4 mr-2"}),y?"Change Image":"Choose File"]}),y&&r.jsxs(P,{variant:"outline",onClick:()=>O(!0),size:"sm",children:[r.jsx($m,{className:"w-4 h-4 mr-2"}),"Re-crop"]}),r.jsx(P,{onClick:re,disabled:!j||s,className:"flex-1",size:"sm",children:s?r.jsxs(r.Fragment,{children:[r.jsx(vs,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Use This Image"]})})]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Upload and crop a custom image for your thumbnail (16:9 aspect ratio)"})]}),r.jsxs(Fn,{value:"webcam",className:"space-y-4 mt-4",children:[r.jsx("div",{className:"relative aspect-video bg-muted rounded-lg overflow-hidden",children:A?r.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover transform scale-x-[-1]"}):w?r.jsx("img",{src:w,alt:"Captured photo",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(ga,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"Take a photo with your webcam"}),r.jsx("p",{className:"text-xs opacity-75 mt-1",children:"Click Start Camera to begin"})]})})}),r.jsxs("div",{className:"flex gap-2",children:[!A&&!w&&r.jsxs(P,{onClick:K,className:"flex-1",size:"sm",children:[r.jsx(ga,{className:"w-4 h-4 mr-2"}),"Start Camera"]}),A&&r.jsxs(P,{onClick:Z,className:"flex-1",size:"sm",children:[r.jsx(ga,{className:"w-4 h-4 mr-2"}),"Take Photo"]}),w&&!A&&r.jsxs(r.Fragment,{children:[r.jsxs(P,{variant:"outline",onClick:K,className:"flex-1",size:"sm",children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Retake"]}),r.jsx(P,{onClick:q,disabled:s,className:"flex-1",size:"sm",children:s?r.jsxs(r.Fragment,{children:[r.jsx(vs,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Use This Photo"]})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Capture a photo with your webcam to use as your thumbnail"})]})]})]})},oJe=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}),lJe=({open:e,onOpenChange:t,videoId:n,videoTitle:s,onCommentCountChange:a})=>{const{toast:i}=Gr(),[o,l]=h.useState([]),[c,d]=h.useState(!1),[u,m]=h.useState(null),[f,p]=h.useState(!1);h.useEffect(()=>{e&&n&&x()},[e,n]);const x=async()=>{d(!0);try{const{data:v,error:y}=await F.from("video_comments").select("id, commenter_name, commenter_email, comment, created_at, share_link_id").eq("video_id",n).order("created_at",{ascending:!1});if(y)throw y;l(v||[]),a==null||a(n,(v==null?void 0:v.length)||0)}catch(v){console.error("Error fetching comments:",v)}finally{d(!1)}},g=async()=>
1178{if(u){p(!0);try{const{error:v}=await F.from("video_comments").delete().eq("id",u);if(v)throw v;l(y=>y.filter(b=>b.id!==u)),a==null||a(n,o.length-1),i({title:"Comment deleted"})}catch(v){console.error("Error deleting comment:",v),i({title:"Failed to delete comment",variant:"destructive"})}finally{p(!1),m(null)}}};return r.jsxs(r.Fragment,{children:[r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"sm:max-w-lg max-h-[80vh] flex flex-col",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(Wa,{className:"w-5 h-5 text-primary"}),"Comments",o.length>0&&r.jsx(Se,{variant:"secondary",children:o.length})]}),r.jsxs($r,{className:"truncate",children:['Comments on "',s,'"']})]}),r.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:c?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):o.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Wa,{className:"w-10 h-10 text-muted-foreground/30 mx-auto mb-3"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"No comments yet"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Comments will appear here when viewers leave them on your shared video"})]}):r.jsx("div",{className:"space-y-3",children:o.map(v=>r.jsxs("div",{className:"flex gap-3 p-3 rounded-lg border bg-card group",children:[r.jsx(an,{className:"h-8 w-8 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:v.commenter_name.charAt(0).toUpperCase()})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"font-medium text-foreground text-sm truncate",children:v.commenter_name}),v.commenter_email&&r.jsxs("a",{href:`mailto:${encodeURIComponent(v.commenter_email)}`,className:"text-xs text-muted-foreground truncate hidden sm:inline-flex items-center gap-1 hover:text-foreground hover:underline",children:[r.jsx(zr,{className:"w-3 h-3"}),v.commenter_email]})]}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0 text-destructive hover:text-destructive",onClick:()=>m(v.id),children:r.jsx(Xr,{className:"w-3.5 h-3.5"})})]}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-wrap break-words",children:v.comment}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1 block",children:oJe(v.created_at)})]})]},v.id))})})]})}),r.jsx(cs,{open:!!u,onOpenChange:v=>!v&&m(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete Comment"}),r.jsx(Jn,{children:"Are you sure you want to delete this comment? This action cannot be undone."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:g,disabled:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:f?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"})," Deleting..."]}):"Delete"})]})]})})]})},cJe=({userId:e})=>{const t=Sr(),{isAdmin:n}=sp(),s=jw(e),a=Tw(e),{subscriptionTier:i,isGiftedAccount:o}=Jl(),{maxVideoDurationMinutes:l}=np();if(h.useEffect(()=>{if(!_r())return;const u=localStorage.getItem("signup_iap_pending");(u==="pro_monthly"||u==="pro_annual")&&t("/billing")},[t]),!_r()||n||o||s.isLoading||a.isLoading)return null;if(i==="team")return r.jsx(Ie,{className:"mb-4 border border-border/60",children:r.jsx(lt,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(Ms,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Team Plan"}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Active"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Your team subscription is managed by your team admin."})]})]})})});if(i!=="starter")return r.jsx(Ie,{className:"mb-4 border border-border/60",children:r.jsxs(lt,{className:"p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(Ms,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Pro Plan"}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Active"})]}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),l," min recordings"]})]})]}),r.jsxs(P,{type:"button",variant:"outline",className:"w-full justify-between",onClick:()=>t("/billing"),title:"Buy 30 or 60 min recording add-ons in Billing",children:[r.jsx("span",{children:"Manage Plan & Add-ons"}),r.jsx(Ya,{className:"w-4 h-4"})]}),r.jsx("p",{className:"text-[11px] text-muted-foreground text-center",children:"Extended 30 / 60 min recording add-ons available in Billing."})]})});const c=pQ(),d=[{label:"Recordings",icon:bi,used:s.currentUsage,limit:s.limit,iconColor:"text-primary",iconBg:"bg-primary/10"},{label:"Shares",icon:dv,used:a.currentUsage,limit:a.limit,iconColor:"text-emerald-500",iconBg:"bg-emerald-500/10"}];return r.jsx(Ie,{className:"mb-4 border border-border/60",children:r.jsxs(lt,{className:"p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(_n,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Free Starter Plan"}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Free"})]}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Resets ",c]})]})]}),r.jsx("div",{className:"space-y-3",children:d.map(u=>{const m=u.limit===1/0?"∞":u.limit,f=u.limit===1/0?0:Math.min(100,Math.round(u.used/Math.max(1,u.limit)*100));return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5",children:[r.jsx("div",{className:`p-1.5 rounded-md ${u.iconBg}`,children:r.jsx(u.icon,{className:`w-3.5 h-3.5 ${u.iconColor}`})}),r.jsx("p",{className:"text-sm text-foreground flex-1",children:u.label}),r.jsxs("p",{className:"text-sm font-semibold text-foreground tabular-nums",children:[u.used," / ",m]})]}),u.limit!==1/0&&r.jsx(Lc,{value:f,className:"h-1.5"})]},u.label)})}),r.jsxs(P,{type:"button",className:"w-full justify-between",onClick:()=>t("/billing"),title:"Upgrade to Pro in Billing",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ms,{className:"w-4 h-4"}),"Upgrade to Pro"]}),r.jsx(Ya,{className:"w-4 h-4"})]})]})})};function dJe({onFileDrop:e,enabled:t=!0}){const[n,s]=h.useState(!1),a=h.useRef(0);return h.useEffect(()=>{if(!t){s(!1),a.current=0;return}const i=m=>{var p;const f=(p=m.dataTransfer)==null?void 0:p.types;if(!f)return!1;for(let x=0;x<f.length;x++)if(f[x]==="Files")return!0;return!1},o=m=>{i(m)&&(m.preventDefault(),a.current++,s(!0))},l=m=>{i(m)&&(m.preventDefault(),m.dataTransfer&&(m.dataTransfer.dropEffect="copy"))},c=m=>{i(m)&&(m.preventDefault(),a.current=Math.max(0,a.current-1),a.current===0&&s(!1))},d=m=>{var p,x;m.preventDefault(),a.current=0,s(!1);const f=(x=(p=m.dataTransfer)==null?void 0:p.files)==null?void 0:x[0];f&&e(f)},u=()=>{a.current=0,s(!1)};return window.addEventListener("dragenter",o),window.addEventListener("dragover",l),window.addEventListener("dragleave",c),window.addEventListener("drop",d),window.addEventListener("blur",u),()=>{window.removeEventListener("dragenter",o),window.removeEventListener("dragover",l),window.removeEventListener("dragleave",c),window.removeEventListener("drop",d),window.removeEventListener("blur",u)}},[t,e]),{isDragging:n,dragHandlers:{}}}const uJe=({isDragging:e})=>r.jsx(Ts,{children:e&&r.jsx(fe.div,{initial:{opacity:0}
1178,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm pointer-events-none",children:r.jsxs(fe.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},transition:{duration:.15},className:"flex flex-col items-center gap-4 p-10 rounded-2xl border-2 border-dashed border-primary bg-primary/5",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(na,{className:"w-8 h-8 text-primary"})}),r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-lg font-semibold text-foreground",children:"Drop video to upload"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"MP4, WebM, MOV (max 1GB)"})]})]})})}),QB={responsive:{label:"Responsive (100%)",width:"100%",height:"auto",icon:r.jsx(Vs,{className:"w-4 h-4"})},small:{label:"Small (480×270)",width:480,height:270,icon:r.jsx(qc,{className:"w-4 h-4"})},medium:{label:"Medium (640×360)",width:640,height:360,icon:r.jsx(z4,{className:"w-4 h-4"})},large:{label:"Large (854×480)",width:854,height:480,icon:r.jsx(Vs,{className:"w-4 h-4"})},custom:{label:"Custom",width:640,height:360,icon:r.jsx(Um,{className:"w-4 h-4"})}},mJe=({shareToken:e,videoTitle:t})=>{const{toast:n}=Gr(),[s,a]=h.useState(!1),[i,o]=h.useState("responsive"),[l,c]=h.useState(640),[d,u]=h.useState(360),[m,f]=h.useState(!1),[p,x]=h.useState(!1),[g,v]=h.useState(!1),[y,b]=h.useState(!1),w=h.useMemo(()=>{const N=`${window.location.origin}/embed/${e}`,_=new URLSearchParams;
1178m&&_.append("autoplay","1"),p&&_.append("loop","1"),g&&_.append("muted","1"),y&&_.append("controls","0");const C=_.toString();return C?`${N}?${C}`:N},[e,m,p,g,y]),S=h.useMemo(()=>{const N=QB[i],_=i==="custom"?l:N.width,C=i==="custom"?d:N.height,k=typeof _=="number"?`width="${_}"`:`style="width: ${_};"`,E=typeof C=="number"?`height="${C}"`:"";return i==="responsive"?`<div style="position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; border-radius: 8px;">
1179  <iframe 
1180    src="${w}" 
1181    title="${t.replace(/"/g,"&quot;")}"
1182    frameborder="0" 
1183    allow="autoplay; fullscreen; picture-in-picture" 
1184    allowfullscreen
1185    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
1186  ></iframe>
1187</div>`:`<iframe 
1188  src="${w}" 
1189  ${k} 
1190  ${E}
1191  title="${t.replace(/"/g,"&quot;")}"
1192  frameborder="0" 
1193  allow="autoplay; fullscreen; picture-in-picture" 
1194  allowfullscreen
1195  style="border-radius: 8px;"
1196></iframe>`},[w,t,i,l,d]),j=async()=>{try{await navigator.clipboard.writeText(S),a(!0),n({title:"Embed code copied!"}),setTimeout(()=>a(!1),2e3)}catch{n({title:"Failed to copy",variant:"destructive"})}};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[r.jsx(dT,{className:"w-4 h-4 text-primary"}),"Embed Video"]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Add this video to your website, blog, or landing page by copying the embed code below."})]}),r.jsxs(ec,{defaultValue:"settings",className:"w-full",children:[r.jsxs(pl,{className:"grid w-full grid-cols-2",children:[r.jsx(tn,{value:"settings",children:"Settings"}),r.jsx(tn,{value:"code",children:"Code"})]}),r.jsxs(Fn,{value:"settings",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-xs",children:"Size"}),r.jsxs(kn,{value:i,onValueChange:N=>o(N),children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"Select size"})}),r.jsx(jn,{children:Object.entries(QB).map(([N,_])=>r.jsx(_t,{value:N,children:r.jsxs("div",{className:"flex items-center gap-2",children:[_.icon,r.jsx("span",{children:_.label})]})},N))})]})]}),i==="custom"&&r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs",children:"Width (px)"}),r.jsx("input",{type:"number",value:l,onChange:N=>c(Math.max(100,parseInt(N.target.value)||100)),min:100,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1196ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs",children:"Height (px)"}),r.jsx("input",{type:"number",value:d,onChange:N=>u(Math.max(100,parseInt(N.target.value)||100)),min:100,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),r.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[r.jsx(ye,{className:"text-xs text-muted-foreground",children:"Player Controls"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"autoplay",className:"text-sm cursor-pointer",children:"Autoplay"}),r.jsx(rr,{id:"autoplay",checked:m,onCheckedChange:f})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"loop",className:"text-sm cursor-pointer",children:"Loop video"}),r.jsx(rr,{id:"loop",checked:p,onCheckedChange:x})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"muted",className:"text-sm cursor-pointer",children:"Start muted"}),r.jsx(rr,{id:"muted",checked:g,onCheckedChange:v})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"hideControls",className:"text-sm cursor-pointer",children:"Hide controls"}),r.jsx(rr,{id:"hideControls",checked:y,onCheckedChange:b})]}),m&&!g&&r.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 p-2 rounded",children:"⚠️ Most browsers block autoplay unless the video is muted."})]})]}),r.jsxs(Fn,{value:"code",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 border",children:[r.jsx(ye,{className:"text-xs text-muted-foreground mb-2 block",children:"Preview"}),r.jsx("div",{className:"bg-background rounded overflow-hidden border",style:{maxWidth:"100%"},children:r.jsx("div",{className:"relative w-full",style:{paddingTop:"56.25%"},children:r.jsx("iframe",{src:w,title:"Video preview",className:"absolute inset-0 w-full h-full rounded",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-xs",children:"Embed Code"}),r.jsxs("div",{className:"relative",children:[r.jsx("pre",{className:"bg-muted/50 border rounded-lg p-3 text-xs overflow-auto font-mono text-muted-foreground max-h-40 whitespace-pre-wrap break-all",children:S}),r.jsx(P,{size:"sm",variant:"secondary",onClick:j,className:"absolute top-2 right-2",children:s?r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-3.5 h-3.5 mr-1"}),"Copied"]}):r.jsxs(r.Fragment,{children:[r.jsx(ui,{className:"w-3.5 h-3.5 mr-1"}),"Copy"]})})]})]})]})]})]})};function JB(e){if(!e)return null;const t=e.trim();let n=t.match(/youtu\.be\/([a-zA-Z0-9_-]{11})/);return n?{id:n[1],isShort:!1}:(n=t.match(/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/),n?{id:n[1],isShort:!0}:(n=t.match(/youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/),n?{id:n[1],isShort:!1}:(n=t.match(/[?&]v=([a-zA-Z0-9_-]{11})/),n?{id:n[1],isShort:!1}:(n=t.match(/^([a-zA-Z0-9_-]{11})$/),n?{id:n[1],isShort:!1}:null))))}function hJe(e){return`https://www.youtube.com/embed/${e}`}function fJe(e){return`https://i.ytimg.com/vi/${e}/maxresdefault.jpg`}const pJe=({open:e,onOpenChange:t,userId:n,folderId:s=null,defaultNotifyOnReply:a=!0,onAdded:i})=>{const{toast:o}=Gr(),[l,c]=h.useState(""),[d,u]=h.useState(""),[m,f]=h.useState(!1),[p,x]=h.useState(!0),g=()=>{c(""),u(""),x(!0),f(!1)},v=async()=>{const b=JB(l);if(!(!b||!p))try{const w=await fetch(`https://www.youtube.com/oembed?url=${encodeURIComponent(`https://www.youtube.com/watch?v=${b.id}`)}&format=json`);if(w.ok){const S=await w.json();S.title&&u(S.title)}}catch{}},y=async()=>{const b=JB(l);if(!b){o({title:"Invalid YouTube URL",description:"Paste a link like https://youtube.com/watch?v=… or https://youtu.be/…",variant:"destructive"});return}f(!0);try{let w=d.trim();if(!w)try{const N=await fetch(`https://www.youtube.com/oembed?url=${encodeURIComponent(`https://www.youtube.com/watch?v=${b.id}`)}&format=json`);N.ok&&(w=(await N.json()).title||"YouTube video")}catch{w="YouTube video"}
1196const S={user_id:n,title:w||"YouTube video",description:null,video_url:hJe(b.id),thumbnail_url:fJe(b.id),duration:null,notify_on_reply:a,source_type:"youtube",external_video_id:b.id,external_url:l.trim()};s&&(S.folder_id=s);const{error:j}=await F.from("videos").insert(S);if(j)throw j;o({title:"YouTube video added",description:"It's now in your library and ready to share."}),g(),t(!1),i==null||i()}catch(w){console.error("Add YouTube video error:",w),o({title:"Couldn't add video",description:w instanceof Error?w.message:"Please try again.",variant:"destructive"})}finally{f(!1)}};return r.jsx(It,{open:e,onOpenChange:b=>{m||(b||g(),t(b))},children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(xT,{className:"w-5 h-5 text-red-600"}),"Add YouTube video"]}),r.jsx($r,{children:"Paste a YouTube link to add it to your library. Share, embed, and collect comments and reactions just like any other video."})]}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"yt-url",children:"YouTube URL"}),r.jsx(He,{id:"yt-url",placeholder:"https://www.youtube.com/watch?v=…",value:l,onChange:b=>c(b.target.value),onBlur:v,disabled:m,autoFocus:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"yt-title",children:"Title (optional)"}),r.jsx(He,{id:"yt-title",placeholder:"Auto-fetched from YouTube if left blank",value:d,onChange:b=>{u(b.target.value),x(!1)},disabled:m,maxLength:200})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>t(!1),disabled:m,children:"Cancel"}),r.jsx(P,{onClick:y,disabled:m||!l.trim(),children:m?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding…"]}):r.jsxs(r.Fragment,{children:[r.jsx(xT,{className:"w-4 h-4 mr-2"}),"Add to library"]})})]})]})})},xJe=()=>{var P3,D3,M3;const{user:e}=nr(),{isImpersonating:t,impersonatedUser:n,fetchImpersonatedData:s}=th(),{toast:a}=Gr(),i=Sr(),o=ja(),l=MK();Q_(),IK(),R5(),Xwe(),Zwe();const{openRecording:c,registerSaveHandler:d}=bv(),[u,m]=h.useState(()=>{const z=o.state;if(z!=null&&z.highlightVideoId)return localStorage.setItem("vidareo_newest_video",JSON.stringify({videoId:z.highlightVideoId,timestamp:Date.now()})),z.highlightVideoId;const me=localStorage.getItem("vidareo_newest_video");if(me)try{const{videoId:Ce,timestamp:qe}=JSON.parse(me);if((Date.now()-qe)/(1e3*60*60)<24)return Ce;localStorage.removeItem("vidareo_newest_video")}catch{localStorage.removeItem("vidareo_newest_video")}return null});h.useEffect(()=>{const z=o.state;if(z!=null&&z.highlightVideoId&&(m(z.highlightVideoId),e!=null&&e.id&&(ea(),nd())),z!=null&&z.openRecordingModal){const me={camera:"camera",screen:"screen"},Ce=z.recordMode&&me[z.recordMode]?me[z.recordMode]:void 0;c(Ce)}if(z!=null&&z.savedVideo&&(z!=null&&z.showShareDialog)){const me=z.savedVideo;Ve(me.videoId),Ge(me.title),Tt(null),bt(me.thumbnailUrl),Xe(me.videoUrl),Ue(me.duration),e!=null&&e.id&&(ea(),nd())}(z!=null&&z.highlightVideoId||z!=null&&z.openRecordingModal||z!=null&&z.savedVideo)&&window.history.replaceState({},document.title)},[o.state,e==null?void 0:e.id]);const[f,p]=h.useState([]),[x,g]=h.useState(!0),[v,y]=h.useState(null),[b,w]=h.useState(!1),[S,j]=h.useState(null),[N,_]=h.useState(null),[C,k]=h.useState(!1),[E,R]=h.useState([]),[T,D]=h.useState(null),[A,V]=h.useState(""),[U,O]=h.useState(""),[M,$]=h.useState([]),[I,B]=h.useState(""),[K,Z]=h.useState(!1),[q,H]=h.useState(!1),[X,G]=h.useState(!1),[ee,re]=h.useState(new Set),[W,Q]=h.useState(!1),[L,te]=h.useState(!1),[ae,ne]=h.useState(!1),[se,ue]=h.useState(null),[Ne,Qe]=h.useState(null),[J,de]=h.useState(null),[ve,Le]=h.useState(!1),[$e,De]=h.useState(""),[oe,xe]=h.useState([]),[Ze,it]=h.useState(!1),[ct,Oe]=h.useState(""),[pe,le]=h.useState("all"),[ke,Ee]=h.useState(""),[ot,gt]=h.useState(""),[Nt,Ct]=h.useState([]),[dt,tt]=h.useState(null),[Re,Fe]=h.useState("active"),[Ae,Ve]=h.useState(null),[et,Ge]=h.useState(""),[St,Tt]=h.useState(null),[Zt,bt]=h.useState(null),[Wt,Xe]=h.useState(null),[be,Ue]=h.useState(null),[we,pt]=h.useState(null),[mt,er]=h.useState("starter"),[kt,at]=h.useState(!1),[Yt,Ft]=h.useState(null),[or,Ar]=h.useState(!0),[nn,es]=h.useState(!1),[An,ie]=h.useState("bottom-right"),[_e,ht]=h.useState(.7),[Dr,Mr]=h.useState(20),[Ln,Zr]=h.useState(!0),[zn,Tn]=h.useState(null),[Za,Na]=h.useState(!1),[la,qn]=h.useState(!1),[Hn,Qr]=h.useState(null),[dn,Os]=h.useState(""),[Qa,Be]=h.useState(""),[La,oo]=h.useState(!1),[gu,Vi]=h.useState(0),Xc=mt!=="starter",{maxVideoDurationMinutes:vu}=np(),yu=h.useCallback(async()=>
1196{if(e!=null&&e.id){const{data:z}=await F.from("user_custom_limits").select("max_duration_seconds").eq("user_id",e.id).maybeSingle();if(z!=null&&z.max_duration_seconds)return z.max_duration_seconds}return mt==="starter"?is.FREE_MAX_DURATION_SECONDS:vu>0?vu*60:is.PRO_MAX_DURATION_SECONDS},[e==null?void 0:e.id,vu,mt]),Zc=h.useCallback(z=>{if(!Xc){a({title:lr()?"Not available on this plan":"Upgrade required",description:lr()?"Video uploads are not available on your current plan.":"Video uploads are available on Professional and Team plans.",variant:"destructive"});return}if(!z.type.startsWith("video/")){a({title:"Invalid file",description:"Please drop a video file (MP4, WebM, MOV).",variant:"destructive"});return}if(z.size>is.MAX_FILE_SIZE_BYTES){a({title:"File too large",description:`Maximum file size is ${is.MAX_FILE_SIZE_MB/1024+"GB"}.`,variant:"destructive"});return}ce.current=!1,Qr(z),dn||Os(z.name.replace(/\.[^/.]+$/,"")),Na(!0)},[Xc,a,dn]),{isDragging:gh,dragHandlers:vh}=dJe({onFileDrop:Zc,enabled:!!e&&!La}),[Qc,lo]=h.useState(null),[bu,nc]=h.useState([]),[jl,Jc]=h.useState({}),[Nl,wu]=h.useState({}),[ed,ju]=h.useState(!1),[Lo,Uw]=h.useState(null),[$o,td]=h.useState(!1),[Ui,Nu]=h.useState(null),[rt,jt]=h.useState(null),[Qt,ts]=h.useState(null),[hn,$n]=h.useState(!1),[Us,sn]=h.useState(null),[hi,Ja]=h.useState(""),[ei,$a]=h.useState({}),[Vr,Sa]=h.useState({}),[Fi,_a]=h.useState({});h.useState(null),h.useState(""),h.useState(!1),h.useState(null);const[_i,rd]=h.useState(null),[Su,jC]=h.useState(""),[NC,SC]=h.useState(""),[mp,Bv]=h.useState(null),[zv,hp]=h.useState(""),{isAtLimit:_C,incrementUsage:N3,remaining:S3,limit:_3,currentUsage:C3,subscriptionTier:k3}=Tw(e==null?void 0:e.id),{currentUsage:E3,limit:_u,subscriptionTier:fp,isAtLimit:qv,incrementUsage:CC,refreshUsage:pp}=jw(e==null?void 0:e.id),ce=h.useRef(!1);h.useEffect(()=>{const z=new URLSearchParams(o.search),me=z.get("record"),Ce=z.get("upload");let qe=!1;if(me!==null){const st=me?{screen:"screen",camera:"camera"}[me]:void 0;c(st),z.delete("record"),qe=!0}if(Ce!==null){if(!kt)return;const Ke=o.state;if(Ke!=null&&Ke.nativeCapturedFile)if(fp==="starter"&&qv)a({title:"Recording limit reached",description:lr()?`You've used all ${_u} recordings this month. Your limit resets on the 1st.`:`You've used all ${_u} recordings for this month. Upgrade to record more.`,variant:"destructive"});else{const st=Ke.nativeCapturedFile;Qr(st);const Xt=`Recording ${new Date().toLocaleDateString()}`;Os(Xt),ce.current=!0,Na(!0)}else(mt==="professional"||mt==="team")&&(ce.current=!1,Na(!0));z.delete("upload"),qe=!0}if(qe){const Ke=z.toString(),st=`${o.pathname}${Ke?`?${Ke}`:""}`;i(st,{replace:!0,state:null})}},[o.search,o.pathname,o.state,mt,kt,i,c,fp,qv,_u]);const ze=h.useMemo(()=>{const z={};return f.forEach(me=>{const Ce=(Vr[me.id]||[]).reduce((qe,Ke)=>qe+(Ke.view_count||0),0);z[me.id]=Math.max(Ce,me.view_count||0)}),z},[Vr,f]);h.useMemo(()=>{const z=Object.values(ze).reduce((Ke,st)=>Ke+st,0),me=f.length,Ce=f.reduce((Ke,st)=>Ke+(st.duration||0),0),qe=me>0?Math.round(z/me):0;return{totalViews:z,totalVideos:me,totalDuration:Ce,avgViews:qe}},[f,ze]);const Pt=h.useMemo(()=>{const z=new Set;return f.forEach(me=>{var Ce;(Ce=me.tags)==null||Ce.forEach(qe=>z.add(qe))}),Array.from(z).sort()},[f]),Br=h.useMemo(()=>{const z={};return f.forEach(me=>{me.archived_at||me.folder_id&&(z[me.folder_id]=(z[me.folder_id]||0)+1)}),z},[f]),Nn=h.useMemo(()=>f.filter(z=>!z.archived_at).length,[f]),Fs=h.useMemo(()=>f.filter(z=>!!z.archived_at).length,[f]),Bs=h.useMemo(()=>{let z=Re==="archive"?f.filter(me=>!!me.archived_at):f.filter(me=>!me.archived_at);if(Re==="active"&&dt&&(z=z.filter(me=>me.folder_id===dt)),E.length>0&&(z=z.filter(me=>E.some(Ce=>{var qe;return(qe=me.tags)==null?void 0:qe.includes(Ce)}))),ct.trim()){const me=ct.toLowerCase();z=z.filter(Ce=>{var un;const qe=Ce.title.toLowerCase().includes(me),Ke=(un=Ce.description)==null?void 0:un.toLowerCase().includes(me),Ir=new Date(Ce.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}).toLowerCase().includes(me);return qe||Ke||Ir})}return pe!=="all"&&(new Date().setHours(23,59,59,999),z=z.filter(Ce=>{const qe=new Date(Ce.created_at);if(pe==="today"){const Ke=new Date;return Ke.setHours(0,0,0,0),qe>=Ke}if(pe==="week"){const Ke=new Date;return Ke.setDate(Ke.getDate()-7),Ke.setHours(0,0,0,0),qe>=Ke}if(pe==="month"){const Ke=new Date;return Ke.setMonth(Ke.getMonth()-1),Ke.setHours(0,0,0,0),qe>=Ke}if(pe==="custom"){if(ke){const Ke=new Date(ke);if(Ke.setHours(0,0,0,0),qe<Ke)return!1}if(ot){const Ke=new Date(ot);if(Ke.setHours(23,59,59,999),qe>Ke)return!1}return!0}return!0})),z},[f,E,ct,dt,pe,ke,ot,Re]),Ca=z=>{R(me=>me.includes(z)?me.filter(Ce=>Ce!==z):[...me,z])};h.useEffect(()=>{if(e!=null&&e.id){ea(),Ps(),Jr(),ac(),nd(),Aie(),kC(),A3();const z=F.channel(`videos-${e.id}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"videos",filter:`user_id=eq.${e.id}`},Ce=>{const qe=Ce.new;p(Ke=>Ke.some(st=>st.id===qe.id)?Ke:[qe,...Ke]),m(qe.id),localStorage.setItem("vidareo_newest_video",JSON.stringify({videoId:qe.id,timestamp:Date.now()}))}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"videos",filter:`user_id=eq.${e.id}`},Ce=>{const qe=Ce.new;p(Ke=>Ke.map(st=>st.id===qe.id?qe:st))}).on("postgres_changes",{event:"DELETE",schema:"public",table:"videos",filter:`user_id=eq.${e.id}`},Ce=>{const qe=Ce.old.id;p(Ke=>Ke.filter(st=>st.id!==qe))}).subscribe(),me=F.channel("share-links-changes").on("postgres_changes",{event:"*",schema:"public",table:"video_share_links",filter:`user_id=eq.${e.id}`},()=>{kC()}).subscribe();return()=>{F.removeChannel(z),F.removeChannel(me)}
1196}},[e==null?void 0:e.id,t]);const Jr=async()=>{if(!(e!=null&&e.id))return;if(t){const me=await s("profile");me&&(me.subscription_tier&&er(me.subscription_tier),at(!0),me.company_logo_url&&Ft(me.company_logo_url),Ar(me.watermark_enabled??!0),es(me.use_custom_watermark||!1),ie(me.watermark_position||"bottom-right"),ht(me.watermark_opacity??.7),Mr(me.watermark_size??32));return}const{data:z}=await F.from("profiles").select("subscription_tier, company_logo_url, watermark_enabled, use_custom_watermark, watermark_position, watermark_opacity, watermark_size, default_notify_on_reply, full_name").eq("user_id",e.id).single();z&&(z.subscription_tier&&er(z.subscription_tier),at(!0),z.company_logo_url&&Ft(z.company_logo_url),Ar(z.watermark_enabled??!0),es(z.use_custom_watermark||!1),ie(z.watermark_position||"bottom-right"),ht(z.watermark_opacity??.7),Mr(z.watermark_size??32),Zr(z.default_notify_on_reply??!0),Tn(z.full_name||null))},Ps=async()=>{if(!(e!=null&&e.id))return;if(t){const me=await s("folders");me&&Ct(me);return}const{data:z}=await F.from("video_folders").select("*").eq("user_id",e.id).order("name");z&&Ct(z)},rs=async(z,me)=>{if(t){a({title:"View-only mode",description:"Cannot move videos while viewing as another user.",variant:"destructive"});return}const{error:Ce}=await F.from("videos").update({folder_id:me}).eq("id",z);Ce||(p(qe=>qe.map(Ke=>Ke.id===z?{...Ke,folder_id:me}:Ke)),a({title:"Video moved"}))},fi=z=>{Ve(z.id),Ge(z.title),Tt(z.description),bt(z.thumbnail_url),Xe(z.video_url),Ue(z.duration??null)},sc=async z=>{var me;if(e!=null&&e.id){if(_C){a({title:"Monthly share limit reached",description:_r()?"You've used all your shares for this month.":"Upgrade to share more videos this month.",variant:"destructive"});return}lo(z.id);try{const{data:Ce}=await F.from("video_share_links_safe").select("share_token").eq("video_id",z.id).eq("user_id",e.id).maybeSingle();let qe=Ce==null?void 0:Ce.share_token;if(!qe){fi(z),lo(null);return}const{getShareUrl:Ke}=await Si(async()=>{const{getShareUrl:Xt}=await Promise.resolve().then(()=>X2e);return{getShareUrl:Xt}},void 0),st=Ke(qe);if(_r()){const{Share:Xt}=await Si(async()=>{const{Share:Ir}=await import("./index-CVRrKOxj.js");return{Share:Ir}},[]);await Xt.share({title:z.title,text:`Check out this video: ${z.title}`,url:st,dialogTitle:"Share Video"})}else navigator.share?await navigator.share({title:z.title,text:`Check out this video: ${z.title}`,url:st}):await navigator.clipboard.writeText(st);try{await F.rpc("increment_video_send_count",{p_user_id:e.id}),window.dispatchEvent(new CustomEvent("vidareo:usage-updated"))}catch(Xt){console.error("Failed to increment share usage:",Xt)}a({title:"Shared",description:"Video link shared successfully."})}catch(Ce){if((Ce==null?void 0:Ce.name)==="AbortError"||(me=Ce==null?void 0:Ce.message)!=null&&me.includes("cancel"))return;console.error("Quick share error:",Ce),a({title:"Error",description:Ce.message||"Failed to share video",variant:"destructive"})}finally{lo(null)}}},ea=async()=>{if(!(e!=null&&e.id))return;if(g(!0),t){const st=await s("videos");p(st||[]),g(!1);return}const{data:z,error:me}=await F.from("videos").select("*").eq("user_id",e.id).order("created_at",{ascending:!1});if(me){a({title:"Error",description:"Failed to load videos",variant:"destructive"}),g(!1);return}const Ce=(z||[]).map(st=>st.id);let qe={};if(Ce.length>0){const{data:st}=await F.from("video_moderation").select("video_id, status, flagged_categories").in("video_id",Ce);st&&(qe=Object.fromEntries(st.map(Xt=>[Xt.video_id,{status:Xt.status,flagged_categories:Xt.flagged_categories||[]}])))}const Ke=(z||[]).map(st=>{var Xt,Ir;return{...st,moderation_status:((Xt=qe[st.id])==null?void 0:Xt.status)||st.moderation_status,flagged_categories:((Ir=qe[st.id])==null?void 0:Ir.flagged_categories)||null}});p(Ke),g(!1)},ac=async()=>{if(!(e!=null&&e.id))return;ju(!0);const{data:z,error:me}=await F.from("video_replies").select("*").eq("original_owner_id",e.id).order("created_at",{ascending:!1});if(me)console.error("Error fetching video replies:",me);else if(z){const Ce=[...new Set(z.map(Xt=>Xt.original_video_id))],{data:qe}=await F.from("videos").select("id, title").in("id",Ce),Ke=new Map((qe==null?void 0:qe.map(Xt=>[Xt.id,Xt.title]))||[]),st=z.map(Xt=>({...Xt,original_video_title:Ke.get(Xt.original_video_id)||"Deleted Video"}));nc(st)}ju(!1)},nd=async()=>
1196{if(!(e!=null&&e.id))return;const{data:z,error:me}=await F.from("video_replies").select("original_video_id, share_link_id").eq("original_owner_id",e.id);if(me)console.error("Error fetching reply counts:",me);else if(z){const Ce={},qe={};z.forEach(Ke=>{Ce[Ke.original_video_id]=(Ce[Ke.original_video_id]||0)+1,qe[Ke.share_link_id]=(qe[Ke.share_link_id]||0)+1}),Jc(Ce),wu(qe)}},Aie=async()=>{if(!(e!=null&&e.id))return;const{data:z}=await F.from("videos").select("id").eq("user_id",e.id);if(!z||z.length===0)return;const{data:me,error:Ce}=await F.from("video_comments").select("video_id").in("video_id",z.map(qe=>qe.id));if(!Ce&&me){const qe={};me.forEach(Ke=>{qe[Ke.video_id]=(qe[Ke.video_id]||0)+1}),$a(qe)}},kC=async()=>{if(!(e!=null&&e.id))return;const{data:z,error:me}=await F.from("video_share_links_safe").select("id, video_id, share_token, recipient_email, recipient_name, title, view_count, created_at").eq("user_id",e.id).eq("is_active",!0).order("created_at",{ascending:!1});if(me)console.error("Error fetching share links:",me);else if(z){const Ce={};z.forEach(qe=>{Ce[qe.video_id]||(Ce[qe.video_id]=[]),Ce[qe.video_id].push({id:qe.id,share_token:qe.share_token,recipient_email:qe.recipient_email,recipient_name:qe.recipient_name,title:qe.title,view_count:qe.view_count||0,created_at:qe.created_at})}),Sa(Ce)}};h.useEffect(()=>(d(z=>{Ve(z.videoId),Ge(z.title),Tt(null),bt(z.thumbnailUrl),Xe(z.videoUrl),Ue(z.duration),ea(),nd()}),()=>d(null)),[d]),h.useEffect(()=>{const z=()=>{ea()};return window.addEventListener("video-processing-complete",z),()=>window.removeEventListener("video-processing-complete",z)},[e==null?void 0:e.id]);const A3=async()=>{if(!(e!=null&&e.id))return;const{data:z,error:me}=await F.from("share_link_views").select("video_id, watch_percentage").eq("owner_id",e.id);if(me){console.error("Error fetching watch percentages:",me);return}if(z){const Ce={};z.forEach(Ke=>{Ce[Ke.video_id]||(Ce[Ke.video_id]={total:0,count:0}),Ce[Ke.video_id].total+=Ke.watch_percentage||0,Ce[Ke.video_id].count+=1});const qe={};Object.entries(Ce).forEach(([Ke,st])=>{qe[Ke]=Math.round(st.total/st.count)}),_a(qe)}},Tie=async(z,me)=>{const Ce=!me,{error:qe}=await F.from("videos").update({notify_on_reply:Ce}).eq("id",z);qe?a({title:"Error",description:"Failed to update notification settings",variant:"destructive"}):(p(Ke=>Ke.map(st=>st.id===z?{...st,notify_on_reply:Ce}:st)),a({title:Ce?"Notifications Enabled":"Notifications Disabled",description:Ce?"You will receive notifications when someone replies to this video":"You will not receive notifications for replies to this video"}))},Rie=async z=>{if(z.source_type!=="youtube"||!z.external_video_id)return;const me=z.external_video_id;a({title:"Refreshing metadata…",description:"Fetching the latest title and thumbnail from YouTube."});try{let Ce=null;try{const Xt=await fetch(`https://www.youtube.com/oembed?url=${encodeURIComponent(`https://www.youtube.com/watch?v=${me}`)}&format=json`);if(Xt.ok){const Ir=await Xt.json();Ir!=null&&Ir.title&&(Ce=Ir.title)}}catch{}const qe=`https://i.ytimg.com/vi/${me}/maxresdefault.jpg`,Ke={thumbnail_url:qe};Ce&&(Ke.title=Ce);const{error:st}=await F.from("videos").update(Ke).eq("id",z.id);if(st)throw st;p(Xt=>Xt.map(Ir=>Ir.id===z.id?{...Ir,thumbnail_url:qe,title:Ce??Ir.title}:Ir)),a({title:"Metadata refreshed",description:Ce?"Title and thumbnail updated from YouTube.":"Thumbnail refreshed (title unavailable)."})}catch(Ce){console.error("Refresh YouTube metadata error:",Ce),a({title:"Couldn't refresh metadata",description:Ce instanceof Error?Ce.message:"Please try again.",variant:"destructive"})}},Oie=async()=>{await Promise.all([ea(),Ps(),ac(),nd(),kC(),A3()]),a({title:"Refreshed",description:"Your videos are up to date"})},Pie=async(z,me)=>{const{error:Ce}=await F.from("videos").update({archived_at:me?new Date().toISOString():null}).eq("id",z);if(Ce){a({title:"Error",description:Ce.message||`Failed to ${me?"archive":"unarchive"} video`,variant:"destructive"});return}p(qe=>qe.map(Ke=>Ke.id===z?{...Ke,archived_at:me?new Date().toISOString():null}:Ke)),a({title:me?"Video archived":"Video restored",description:me?"Moved to Archive. You can restore it anytime.":"Video is back in your library."})},Die=async()=>
1196{if(!S||!e)return;k(!0);const z=f.find(me=>me.id===S);try{const me=[];if(z!=null&&z.video_url){const qe=z.video_url.split("/videos/");qe[1]&&me.push(decodeURIComponent(qe[1].split("?")[0]))}if(z!=null&&z.thumbnail_url){const qe=z.thumbnail_url.split("/videos/");qe[1]&&me.push(decodeURIComponent(qe[1].split("?")[0]))}me.length>0&&await F.storage.from("videos").remove(me);const{error:Ce}=await F.from("videos").delete().eq("id",S);if(Ce)throw Ce;await F.from("notifications").delete().eq("user_id",e.id).contains("data",{video_id:S}),p(f.filter(qe=>qe.id!==S)),a({title:"Video deleted",description:"Your video has been removed."})}catch(me){a({title:"Error",description:me.message||"Failed to delete video",variant:"destructive"})}finally{k(!1),j(null)}},Mie=async()=>{if(!Qt||!e)return;$n(!0);const z=bu.find(me=>me.id===Qt);try{if(z!=null&&z.reply_video_url){const Ce=z.reply_video_url.split("/video-replies/");if(Ce[1]){const qe=decodeURIComponent(Ce[1].split("?")[0]);await F.storage.from("video-replies").remove([qe])}}if(z!=null&&z.reply_thumbnail_url){const Ce=z.reply_thumbnail_url.split("/video-replies/");if(Ce[1]){const qe=decodeURIComponent(Ce[1].split("?")[0]);await F.storage.from("video-replies").remove([qe])}}const{error:me}=await F.from("video_replies").delete().eq("id",Qt);if(me)throw me;nc(Ce=>Ce.filter(qe=>qe.id!==Qt)),z&&Jc(Ce=>({...Ce,[z.original_video_id]:Math.max(0,(Ce[z.original_video_id]||1)-1)})),a({title:"Reply deleted",description:"The video reply has been removed."})}catch(me){a({title:"Error",description:me.message||"Failed to delete reply",variant:"destructive"})}finally{$n(!1),ts(null)}},Hv=h.useCallback(()=>{w(!1),Nu(null),y(null)},[]),Iie=async z=>{if(e!=null&&e.id)try{const{data:me}=await F.from("video_share_links_safe").select("share_token").eq("video_id",z.id).eq("user_id",e.id).maybeSingle();let Ce=me==null?void 0:me.share_token;if(!Ce){fi(z),a({title:"Create a share link",description:"Generate a share link to open the watch page."});return}const qe=$N(Ce);_r()?i(qe):window.open(qe,"_blank","noopener,noreferrer")}catch(me){console.error("Failed to open watch page:",me),a({title:"Error",description:"Could not open the watch page. Please try again.",variant:"destructive"})}},Lie=async z=>{var Xt,Ir;if(N){a({title:"Download in progress",description:"Please wait for the current download to finish before starting another."});return}if(mt==="starter"){a({title:lr()?"Not available on this plan":"Upgrade required",description:lr()?"Video downloads are not available on your current plan.":"Video downloads are available on Professional and Team plans.",variant:"destructive"});return}if(!z.video_url){a({title:"Download unavailable",description:"This video does not have a downloadable source file.",variant:"destructive"});return}const me=(z.title||"video").replace(/[\\/:*?"<>|]+/g,"_").trim()||"video";let Ce=null;try{Ce=await WAe(`${me}.mp4`,"video/mp4","mp4")}catch(un){if(un instanceof DOMException&&un.name==="AbortError")return;console.warn("Save picker unavailable, will fall back to browser download",un)}const qe=1e3*60*60,Ke=a({title:"Preparing MP4…",description:"Downloading source…",duration:qe}),st=un=>{switch(un){case"loading":return"Loading converter…";case"downloading":return"Downloading source…";case"converting":return"Creating MP4…";case"saving":return"Saving file…";default:return"Working…"}};_(z.id);
1196try{await KAe({videoId:z.id,url:z.video_url,title:z.title,saveHandle:Ce,onProgress:({stage:un,percent:Ci})=>{const Fw=st(un);Ke.update({id:Ke.id,title:"Preparing MP4…",description:Ci!=null?`${Fw} ${Ci}%`:Fw,duration:qe})}}),(Xt=Ke.dismiss)==null||Xt.call(Ke),a({title:"Downloaded",description:"Saved as MP4.",duration:4e3})}catch(un){if((Ir=Ke.dismiss)==null||Ir.call(Ke),un instanceof DOMException&&un.name==="AbortError")return;const Ci=un instanceof Error?un.message:"Could not create an MP4 download. Please try again.";console.error("Video download failed:",un),a({title:"MP4 download failed",description:Ci,variant:"destructive"})}finally{_(null)}},T3=z=>{D(z),V(z.title),O(z.description||""),$(z.tags||[]),B("")},EC=()=>{D(null),V(""),O(""),$([]),B("")},R3=z=>{const me=z.trim().toLowerCase();me&&!M.includes(me)&&M.length<10&&($([...M,me]),B(""))},$ie=z=>{$(M.filter(me=>me!==z))},Vie=z=>{(z.key==="Enter"||z.key===",")&&(z.preventDefault(),R3(I))},Uie=async()=>{if(!(!T||!e)){Z(!0);try{const{error:z}=await F.from("videos").update({title:A.trim()||T.title,description:U.trim()||null,tags:M.length>0?M:null}).eq("id",T.id);if(z)throw z;p(f.map(me=>me.id===T.id?{...me,title:A.trim()||me.title,description:U.trim()||null,tags:M.length>0?M:null}:me)),a({title:"Video updated",description:"Your changes have been saved."}),EC()}catch(z){a({title:"Error",description:z.message||"Failed to update video",variant:"destructive"})}finally{Z(!1)}}},Fie=async z=>{if(!(!T||!e)){H(!0);try{const me=`${Date.now()}-${crypto.randomUUID()}-thumb.jpg`,Ce=`${e.id}/${me}`,{error:qe}=await F.storage.from("videos").upload(Ce,z,{contentType:"image/jpeg"});if(qe)throw qe;const{data:Ke}=F.storage.from("videos").getPublicUrl(Ce),{error:st}=await F.from("videos").update({thumbnail_url:Ke.publicUrl}).eq("id",T.id);if(st)throw st;p(f.map(Xt=>Xt.id===T.id?{...Xt,thumbnail_url:Ke.publicUrl}:Xt)),D({...T,thumbnail_url:Ke.publicUrl}),a({title:"Thumbnail updated",description:"Your custom thumbnail has been saved."})}catch(me){a({title:"Error",description:me.message||"Failed to update thumbnail",variant:"destructive"})}finally{H(!1)}}},Bie=z=>{if(!z)return"0:00";const me=Math.floor(z/60),Ce=z%60;return`${me}:${Ce.toString().padStart(2,"0")}`},zie=z=>{const me="America/Los_Angeles",Ce=new Intl.DateTimeFormat("en-CA",{timeZone:me,year:"numeric",month:"2-digit",day:"2-digit"}),qe=Xt=>{const[Ir,un,Ci]=Ce.format(Xt).split("-").map(Number);return Date.UTC(Ir,un-1,Ci)},Ke=new Date(z),st=Math.round((qe(new Date)-qe(Ke))/864e5);return st===0?"Today":st===1?"Yesterday":st<7?`${st} days ago`:Ke.toLocaleDateString("en-US",{timeZone:me})},qie=()=>{G(!X),re(new Set)},O3=z=>{re(me=>{const Ce=new Set(me);return Ce.has(z)?Ce.delete(z):Ce.add(z),Ce})},Hie=()=>{re(new Set(Bs.map(z=>z.id)))},Wie=()=>{re(new Set)},Yie=async()=>{if(!(ee.size===0||!e)){it(!0);try{const z=f.filter(Ke=>ee.has(Ke.id)),me=[];z.forEach(Ke=>{if(Ke.video_url){const st=Ke.video_url.split("/videos/");st[1]&&me.push(decodeURIComponent(st[1].split("?")[0]))}if(Ke.thumbnail_url){const st=Ke.thumbnail_url.split("/videos/");st[1]&&me.push(decodeURIComponent(st[1].split("?")[0]))}}),me.length>0&&await F.storage.from("videos").remove(me);const{error:Ce}=await F.from("videos").delete().in("id",Array.from(ee));if(Ce)throw Ce;const qe=Array.from(ee);await Promise.all(qe.map(Ke=>F.from("notifications").delete().eq("user_id",e.id).contains("data",{video_id:Ke}))),p(f.filter(Ke=>!ee.has(Ke.id))),a({title:"Videos deleted",description:`${ee.size} video(s) have been removed.`}),re(new Set),G(!1)}catch(z){a({title:"Error",description:z.message||"Failed to delete videos",variant:"destructive"})}finally{it(!1),Q(!1)}}},AC=z=>{const me=z.trim().toLowerCase();me&&!oe.includes(me)&&oe.length<10&&(xe([...oe,me]),De(""))},Gie=z=>{xe(oe.filter(me=>me!==z))},Kie=z=>{(z.key==="Enter"||z.key===",")&&(z.preventDefault(),AC($e))},Xie=async()=>{if(!(ee.size===0||oe.length===0||!e)){it(!0);try{const z=Array.from(ee).map(async me=>{const Ce=f.find(st=>st.id===me),qe=(Ce==null?void 0:Ce.tags)||[],Ke=Array.from(new Set([...qe,...oe])).slice(0,10);return F.from("videos").update({tags:Ke}).eq("id",me)});await Promise.all(z),p(f.map(me=>{if(ee.has(me.id)){const Ce=me.tags||[],qe=Array.from(new Set([...Ce,...oe])).slice(0,10);return{...me,tags:qe}}return me})),a({title:"Tags added",description:`Added ${oe.length} tag(s) to ${ee.size} video(s).`}),re(new Set),G(!1),xe([]),De("")}catch(z){a({title:"Error",description:z.message||"Failed to add tags",variant:"destructive"})}finally{it(!1),te(!1)}}},Zie=async()=>{var z;if(!(ee.size===0||!e)){if(t){a({title:"View-only mode",description:"Cannot move videos while viewing as another user.",variant:"destructive"});return}it(!0);try{const{error:me}=await F.from("videos").update({folder_id:se}).in("id",Array.from(ee));if(me)throw me;p(f.map(qe=>ee.has(qe.id)?{...qe,folder_id:se}:qe));const Ce=se?((z=Nt.find(qe=>qe.id===se))==null?void 0:z.name)||"folder":"main library";a({title:"Videos moved",description:`Moved ${ee.size} video(s) to ${Ce}.`}),re(new Set),G(!1)}catch(me){a({title:"Error",description:me.message||"Failed to move videos",variant:"destructive"})}finally{it(!1),ne(!1),ue(null)}}},Qie=()=>{if(!Xc){a({title:lr()?"Not available on this plan":"Upgrade required",description:lr()?"Video uploads are not available on your current plan.":"Video uploads are available on Professional and Team plans.",variant:"destructive"});return}Na(!0)},Jie=z=>{var Ce;const me=(Ce=z.target.files)==null?void 0:Ce[0];if(me){if(!me.type.startsWith("video/")){a({title:"Invalid file",description:"Please select a video file.",variant:"destructive"});return}if(!oR(me.size)){a({title:"File too large",description:`Maximum file size is ${nb(is.MAX_FILE_SIZE_BYTES)}.`,variant:"destructive"});return}ce.current=!1,Qr(me),dn||Os(me.name.replace(/\.[^/.]+$/,""))}},eoe=z=>new Promise((me,Ce)=>
1196{const qe=document.createElement("canvas"),Ke=qe.getContext("2d");if(!Ke){Ce(new Error("Canvas context not available"));return}const st=z.videoWidth||640,Xt=z.videoHeight||360,{width:Ir,height:un}=rl(st,Xt);qe.width=Ir,qe.height=un,Ke.drawImage(z,0,0,st,Xt,0,0,Ir,un),qe.toBlob(Ci=>{Ci?me(Ci):Ce(new Error("Failed to generate thumbnail"))},"image/jpeg",.85)}),toe=async()=>{if(!(!Hn||!e)){oo(!0),Vi(0);try{const z=document.createElement("video");z.preload="auto",z.muted=!0,z.crossOrigin="anonymous";const me=URL.createObjectURL(Hn);z.src=me;const Ce=await new Promise((co,ic)=>{z.onloadedmetadata=()=>co(z.duration),z.onerror=()=>ic(new Error("Failed to load video"))}),qe=await yu();if(Ce>qe){const co=Math.floor(qe/60),ic=Math.floor(Ce/60),Wv=Math.round(Ce%60);a({title:"Video too long",description:`Your plan allows videos up to ${co} minute${co!==1?"s":""}. This video is ${ic}m ${Wv}s.`,variant:"destructive"}),oo(!1),URL.revokeObjectURL(me);return}Vi(10);const Ke=Math.min(Ce*.25,5);z.currentTime=Ke;const st=await new Promise((co,ic)=>{z.onseeked=async()=>{try{const Wv=await eoe(z);co(Wv)}catch(Wv){ic(Wv)}},z.onerror=()=>ic(new Error("Failed to seek video"))});Vi(25);const Xt=`${Date.now()}-${crypto.randomUUID()}-thumb.jpg`,Ir=`${e.id}/${Xt}`,{error:un}=await F.storage.from("videos").upload(Ir,st,{contentType:"image/jpeg"});un&&console.error("Thumbnail upload failed:",un),Vi(40);const Ci=Hn.name.split(".").pop()||"mp4",Fw=`${Date.now()}-${crypto.randomUUID()}.${Ci}`,I3=`${e.id}/${Fw}`,{error:L3}=await F.storage.from("videos").upload(I3,Hn,{contentType:Hn.type});if(L3)throw L3;Vi(80);const{data:$3}=F.storage.from("videos").getPublicUrl(I3),{data:V3}=F.storage.from("videos").getPublicUrl(Ir),{data:Cu,error:U3}=await F.from("videos").insert({user_id:e.id,title:dn.trim()||"Untitled Video",description:Qa.trim()||null,video_url:$3.publicUrl,thumbnail_url:un?null:V3.publicUrl,duration:Math.round(Ce),file_size:Hn.size,notify_on_reply:Ln}).select().single();if(U3)throw U3;if(ce.current&&fp==="starter")try{await CC(),await pp()}catch(co){String((co==null?void 0:co.message)||"").includes("Recording limit reached")?(a({title:"Recording limit reached",description:lr()?`You've used all ${_u} recordings this month. Your limit resets on the 1st.`:`You've used all ${_u} recordings for this month. Upgrade to record more.`,variant:"destructive"}),await pp()):console.warn("Failed to increment recording usage:",co)}if(ce.current=!1,Vi(90),Cu!=null&&Cu.id){const co=J_(),{error:ic}=await F.functions.invoke("create-share-link",{body:{videoId:Cu.id,shareToken:co,expiresAt:null,maxViews:null,password:null,recipientEmail:null,recipientName:null,recipientPhone:null,title:dn.trim()||"Untitled Video"}});ic&&console.warn("Share link creation failed:",ic)}URL.revokeObjectURL(me),Vi(100),a({title:"Video uploaded",description:"Your video has been uploaded successfully."});const roe=dn.trim()||"Untitled Video",noe=Qa.trim()||null,soe=un?null:V3.publicUrl,aoe=$3.publicUrl,ioe=Math.round(Ce);Na(!1),Qr(null),Os(""),Be(""),Vi(0),Cu!=null&&Cu.id&&(Ve(Cu.id),Ge(roe),Tt(noe),bt(soe),Xe(aoe),Ue(ioe)),ea(),nd()}catch(z){a({title:"Upload failed",description:z.message||"Failed to upload video",variant:"destructive"})}finally{oo(!1)}}};return r.jsxs("div",{className:`min-h-screen bg-background ${t?"pt-12":""}`,...vh,children:[r.jsx(uJe,{isDragging:gh}),r.jsx(pn,{}),r.jsx("div",{className:"container mx-auto px-4 sm:px-6 md:px-6 lg:px-8 pt-24 md:pt-24 lg:pt-20",children:r.jsxs("div",{className:"flex w-full",children:[e&&r.jsx("div",{"data-tour":"folder-manager",className:"hidden md:block sticky top-16 h-[calc(100vh-4rem)] overflow-y-auto flex-shrink-0",children:r.jsx(nOe,{userId:e.id,folders:Nt,selectedFolderId:dt,onFolderSelect:z=>{tt(z),Fe("active")},onFoldersChange:Ps,totalVideoCount:Nn,folderVideoCounts:Br,allTags:Pt,selectedTags:E,onToggleTag:Ca,onClearTags:()=>R([]),archivedCount:Fs,viewMode:Re,onViewModeChange:z=>{Fe(z),z==="archive"&&tt(null)}})}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(LRe,{onRefresh:Oie,disabled:x,children:r.jsxs("main",{className:"px-1 sm:px-6 lg:px-8 py-3 sm:py-8 md:py-10",children:[_r()&&e&&r.jsxs(fe.div,{initial:{opacity:0,y:10}
1196,animate:{opacity:1,y:0},transition:{duration:.4},className:"mb-4",children:[r.jsxs("h1",{className:"font-bold text-foreground text-xl",children:[r.jsx("span",{className:"inline-block animate-wave origin-[70%_70%]",children:"👋"})," ",(()=>{var qe,Ke;const z=new Date().getHours(),me=z<12?"Good morning":z<18?"Good afternoon":"Good evening",Ce=zn||((qe=e.user_metadata)==null?void 0:qe.full_name)||((Ke=e.email)==null?void 0:Ke.split("@")[0])||"there";return`${me}, ${Ce}!`})()]}),r.jsx("p",{className:"text-muted-foreground mt-0.5 text-sm",children:"Here's what's happening with your videos"})]}),_r()&&e&&r.jsx(cJe,{userId:e.id}),e&&r.jsxs("div",{className:"mb-4 flex flex-col sm:flex-row gap-2",children:[_r()&&Xc&&r.jsxs(P,{onClick:Qie,variant:"outline",className:"gap-2 flex-1 sm:flex-initial",children:[r.jsx(na,{className:"h-4 w-4"}),"Upload Video"]}),!_r()&&r.jsxs(P,{onClick:()=>qn(!0),variant:"outline",className:"gap-2 flex-1 sm:flex-initial",children:[r.jsx(bn,{className:"h-4 w-4"}),"Add YouTube video"]})]}),f.length>0&&!x&&r.jsxs("div",{"data-tour":"video-search",className:"mb-4 sm:mb-6 space-y-2 sm:space-y-3",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-md",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(He,{value:ct,onChange:z=>Oe(z.target.value),placeholder:"Search by title, description, or date...",className:"pl-10 pr-10"}),ct&&r.jsx("button",{onClick:()=>Oe(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]}),!_r()&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(kn,{value:pe,onValueChange:z=>le(z),children:[r.jsxs(wn,{className:"w-[140px]",children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),r.jsx(En,{placeholder:"Date"})]}),r.jsxs(jn,{children:[r.jsx(_t,{value:"all",children:"All Time"}),r.jsx(_t,{value:"today",children:"Today"}),r.jsx(_t,{value:"week",children:"Last 7 Days"}),r.jsx(_t,{value:"month",children:"Last 30 Days"}),r.jsx(_t,{value:"custom",children:"Custom Range"})]})]}),pe!=="all"&&r.jsx(P,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>{le("all"),Ee(""),gt("")},children:r.jsx(zt,{className:"w-4 h-4"})})]})]}),pe==="custom"&&r.jsxs("div",{className:"flex flex-wrap items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ye,{htmlFor:"dateFrom",className:"text-sm text-muted-foreground whitespace-nowrap",children:"From:"}),r.jsx(He,{id:"dateFrom",type:"date",value:ke,onChange:z=>Ee(z.target.value),className:"w-auto"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ye,{htmlFor:"dateTo",className:"text-sm text-muted-foreground whitespace-nowrap",children:"To:"}),r.jsx(He,{id:"dateTo",type:"date",value:ot,onChange:z=>gt(z.target.value),className:"w-auto"})]}),(ke||ot)&&r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{Ee(""),gt("")},children:"Clear dates"})]})]}),r.jsxs("div",{"data-tour":"video-grid",className:"w-full",children:[f.length>0&&!x&&e&&!_r()&&r.jsxs("div",{className:"flex flex-col gap-0.5 mb-3 sm:mb-6",children:[r.jsxs(P,{variant:X?"default":"outline",size:"sm",onClick:qie,className:"self-start h-7 sm:h-9 text-xs sm:text-sm",children:[X?r.jsx(fT,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2"}):r.jsx(Um,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2"}),X?"Cancel":"Select"]}),r.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("span",{children:[Bs.length," video",Bs.length!==1?"s":""]}),dt&&r.jsxs("span",{className:"sm:hidden",children:["in ",((P3=Nt.find(z=>z.id===dt))==null?void 0:P3.name)||"folder"]})]})]}),f.length>0&&!x&&e&&r.jsx("div",{className:"mb-4 md:hidden","data-tour":"folder-manager",children:r.jsx(rOe,{userId:e.id,folders:Nt,selectedFolderId:dt,onFolderSelect:tt,onFoldersChange:Ps})}),X&&ee.size>0&&r.jsxs(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-4 sm:mb-6 p-2.5 sm:p-4 bg-muted rounded-lg flex items-center justify-between gap-2 sm:gap-4 flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-2 sm:gap-4",children:[r.jsxs("span",{className:"text-xs sm:text-sm font-medium",children:[ee.size," selected"]}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs sm:text-sm h-7 sm:h-9",onClick:Hie,children:"Select all"}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs sm:text-sm h-7 sm:h-9",onClick:Wie,children:"Deselect all"})]}),r.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{ue(null),ne(!0)},children:[r.jsx(gk,{className:"w-4 h-4 mr-2"}),"Move to Folder"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>te(!0),children:[r.jsx(Uue,{className:"w-4 h-4 mr-2"}),"Add Tags"]}),r.jsxs(P,{variant:"destructive",size:"sm",onClick:()=>Q(!0),children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),Pt.length>0&&!x&&f.length>0&&!_r()&&r.jsxs("div",{className:"mb-3 sm:mb-6 lg:hidden",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2 sm:mb-3",children:[r.jsx(WH,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Filter by tags:"}),E.length>0&&r.jsx("button",{onClick:()=>R([]),className:"text-xs text-primary hover:underline",children:"Clear all"})]}),r.jsx("div",{className:"flex flex-wrap gap-2",children:Pt.map(z=>r.jsxs(Se,{variant:E.includes(z)?"default":"outline",className:"cursor-pointer transition-colors",onClick:()=>Ca(z),children:[z,E.includes(z)&&r.jsx(zt,{className:"w-3 h-3 ml-1"})]},z))})]}),x?r.jsx("div",{className:"flex items-center justify-center py-16",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):f.length===0?r.jsxs(fe.div,{initial:{opacity:0,y:20}
1196,animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-20 h-20 rounded-full bg-muted/50 flex items-center justify-center mb-6",children:r.jsx(bi,{className:"w-10 h-10 text-muted-foreground"})}),r.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"No videos yet"}),r.jsxs("p",{className:"text-muted-foreground max-w-sm",children:["Start recording personalized videos to engage your prospects and close more deals. Use the ",r.jsx("strong",{children:"New Video"})," button in the header to get started."]})]}):Bs.length===0?r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("p",{className:"text-muted-foreground",children:Re==="archive"?"No archived videos. Use Archive from any video’s menu to move it here.":ct?`No videos match "${ct}"`:"No videos match the selected tags."}),r.jsx(P,{variant:"link",onClick:()=>{R([]),Oe("")},children:"Clear filters"})]}):r.jsx("div",{className:"divide-y divide-border",children:r.jsx(Ts,{children:Bs.map((z,me)=>{var Ce,qe,Ke;return r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,x:-20},transition:{delay:me*.03},className:`group py-2.5 sm:py-4 ${u===z.id?"bg-primary/5":""}`,children:r.jsx(sOe,{disabled:!0,children:r.jsxs("div",{className:`flex items-center gap-2.5 sm:gap-4 ${X?"pl-1 sm:pl-2":""}`,children:[X&&r.jsx(ci,{checked:ee.has(z.id),onCheckedChange:()=>O3(z.id),className:"h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0"}),r.jsxs("div",{className:"relative w-24 h-[60px] sm:w-36 sm:h-[90px] md:w-44 md:h-[110px] rounded-lg overflow-hidden bg-black cursor-pointer flex-shrink-0",onClick:()=>X?O3(z.id):Iie(z),children:[z.thumbnail_url?r.jsx("img",{src:z.thumbnail_url,alt:z.title,className:"w-full h-full object-contain",onError:st=>{var Xt;st.currentTarget.style.display="none",(Xt=st.currentTarget.nextElementSibling)==null||Xt.classList.remove("hidden")}}):null,r.jsx("video",{src:z.video_url,className:`w-full h-full object-contain ${z.thumbnail_url?"hidden":""}`,muted:!0,preload:"metadata",onLoadedMetadata:st=>{st.target.currentTime=.5}}),!X&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx("div",{className:"w-10 h-10 rounded-full bg-background/90 backdrop-blur-sm flex items-center justify-center shadow-md",children:r.jsx(Js,{className:"w-4 h-4 text-primary ml-0.5"})})}),r.jsx("div",{className:"absolute bottom-1 right-1 px-1.5 py-0.5 rounded bg-black/70 text-[10px] font-medium text-white",children:Bie(z.duration)})]}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5 sm:space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[u===z.id&&me===0&&!((Ce=z.flagged_categories)!=null&&Ce.length)&&r.jsx(Se,{className:"text-[10px] px-1.5 py-0 bg-primary text-primary-foreground",children:"NEW"}),z.flagged_categories&&z.flagged_categories.length>0&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(Se,{variant:"destructive",className:"text-[10px] px-1.5 py-0 cursor-help",children:z.moderation_status==="rejected"?"⛔ Rejected":"⚠️ Review"})}),r.jsxs(yt,{side:"bottom",className:"max-w-[250px]",children:[r.jsx("p",{className:"font-medium text-xs mb-1",children:z.moderation_status==="rejected"?"Rejected for:":"Flagged for review:"}),r.jsx("ul",{className:"text-xs space-y-0.5",children:z.flagged_categories.map((st,Xt)=>r.jsxs("li",{className:"capitalize",children:["• ",st.replace(/_/g," ")]},Xt))}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sharing is blocked until approved."})]})]}),z.tags&&z.tags.length>0&&z.tags.slice(0,2).map(st=>r.jsx(Se,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-normal",children:st},st))]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:zie(z.created_at)}),r.jsx("h3",{className:"font-medium text-foreground text-xs sm:text-sm leading-snug line-clamp-1",children:z.title}),z.description&&r.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:z.description}),r.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(wr,{className:"w-3 h-3"}),ze[z.id]||0]}),jl[z.id]>0&&r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsxs("button",{className:"flex items-center gap-0.5 text-primary hover:underline",children:[r.jsx(Wa,{className:"w-3 h-3"}),jl[z.id]]})}),r.jsx(Tc,{align:"start",className:"w-72 p-2 bg-background border shadow-lg z-50",children:r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs font-medium text-muted-foreground px-2 py-1",children:"Conversations"}),(qe=Vr[z.id])==null?void 0:qe.filter(st=>Nl[st.id]>0).map(st=>{const Xt=st.title&&st.title!==z.title?st.title:null,Ir=st.recipient_name||st.recipient_email||Xt||`Link · ${st.share_token.slice(-6).toUpperCase()}`,un=`Sent ${dh(new Date(st.created_at),{addSuffix:!0})}`,Ci=st.recipient_name&&st.recipient_email?`${un} · ${st.recipient_email}`:un;return r.jsxs("button",{onClick:()=>window.open($N(st.share_token),"_blank"),className:"w-full flex items-center justify-between gap-2 px-2 py-1.5 text-sm rounded hover:bg-muted transition-colors text-left",children:[r.jsxs("span",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"block truncate font-medium",children:Ir}),r.jsx("span",{className:"block truncate text-[11px] text-muted-foreground",children:Ci})]}),r.jsxs(Se,{variant:"secondary",className:"text-xs shrink-0",children:[Nl[st.id]," ",Nl[st.id]===1?"reply":"replies"]})]},st.id)})]})})]})]})]}),r.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1 flex-shrink-0",children:[z.flagged_categories&&z.flagged_categories.length>0?r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"ghost",size:"sm",className:"h-7 sm:h-8 px-2 sm:px-3 gap-1 sm:gap-1.5 text-muted-foreground cursor-not-allowed",disabled:!0,children:[r.jsx(wa,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"}),r.jsx("span",{className:"text-xs hidden sm:inline",children:"Blocked"})]})}),r.jsx(yt,{children:r.jsx("p",{className:"text-xs",children:"Sharing blocked: Video flagged for review"})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(P,{size:"sm",className:"h-7 sm:h-8 px-2 sm:px-3 gap-1 sm:gap-1.5",onClick:()=>_r()?sc(z):fi(z),disabled:Qc===z.id,children:[Qc===z.id?r.jsx(Me,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5 animate-spin"}):r.jsx(dv,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"}),r.jsx("span",{className:"text-xs hidden sm:inline",children:"Share"})]}),_r()&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 sm:h-8 sm:w-8",onClick:()=>fi(z),children:r.jsx(Wl,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})})}),r.jsx(yt,{children:r.jsx("p",{className:"text-xs",children:"Share link settings"})})]})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 sm:h-8 sm:w-8 hidden xs:flex",onClick:()=>T3(z),children:r.jsx(tl,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})})}),r.jsx(yt,{children:r.jsx("p",{className:"text-xs",children:"Edit details"})})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 sm:h-8 sm:w-8 hidden sm:flex",onClick:()=>pt(z),children:r.jsx(qd,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})})}),r.jsx(yt,{children:r.jsx("p",{className:"text-xs",children:"View analytics"})})]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 sm:h-8 sm:w-8",children:r.jsx(dm,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})})}),r.jsxs(So,{align:"end",className:"w-48",children:[r.jsxs(tr,{onClick:()=>T3(z),children:[r.jsx(tl,{className:"w-4 h-4 mr-2"}),"Edit Details"]}
1196),!((Ke=z.flagged_categories)!=null&&Ke.length)&&r.jsxs(tr,{onClick:()=>fi(z),children:[r.jsx(Wl,{className:"w-4 h-4 mr-2"}),"Share Link Settings"]}),z.source_type!=="youtube"&&mt!=="starter"&&!_r()&&!l&&r.jsxs(tr,{onClick:()=>i(`/editor/${z.id}`),children:[r.jsx(A_,{className:"w-4 h-4 mr-2"}),"Edit Video"]}),r.jsxs(tr,{onClick:()=>pt(z),children:[r.jsx(qd,{className:"w-4 h-4 mr-2"}),"View Analytics"]}),z.source_type!=="youtube"&&(()=>{const st=N===z.id,Xt=!!N&&!st,Ir=mt==="starter"||st||Xt,un=mt==="starter"?"Upgrade to Professional to download videos":st?"This video is downloading…":Xt?"Only one download at a time - please wait for the current download to finish":"You can only download one video at a time";return r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(tr,{onClick:()=>Lie(z),disabled:Ir,onSelect:Ci=>{Ir&&Ci.preventDefault()},children:mt==="starter"?r.jsxs(r.Fragment,{children:[r.jsx(Ni,{className:"w-4 h-4 mr-2"}),"Download (Pro+)"]}):st?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Downloading…"]}):r.jsxs(r.Fragment,{children:[r.jsx(lv,{className:"w-4 h-4 mr-2"}),"Download"]})})}),r.jsx(yt,{side:"left",children:un})]})})(),z.source_type==="youtube"&&r.jsxs(tr,{onClick:()=>Rie(z),children:[r.jsx(vs,{className:"w-4 h-4 mr-2"}),"Refresh metadata"]}),r.jsx(tr,{onClick:()=>Tie(z.id,z.notify_on_reply),children:z.notify_on_reply?r.jsxs(r.Fragment,{children:[r.jsx(tue,{className:"w-4 h-4 mr-2"}),"Mute Notifications"]}):r.jsxs(r.Fragment,{children:[r.jsx(zl,{className:"w-4 h-4 mr-2"}),"Enable Notifications"]})}),!_r()&&r.jsxs(tr,{onClick:()=>i(`/mail?video=${z.id}`),children:[r.jsx(zr,{className:"w-4 h-4 mr-2"}),"Send via Email"]}),!_r()&&r.jsxs(tr,{onClick:()=>{const st=Vr[z.id];st&&st.length>0?(Bv(z.id),hp(z.title)):a({title:"No share link",description:"Share this video first to get an embed code.",variant:"destructive"})},children:[r.jsx(dT,{className:"w-4 h-4 mr-2"}),"Embed Video"]}),!_r()&&Nt.length>0&&z.folder_id&&r.jsxs(tr,{onClick:()=>rs(z.id,null),children:[r.jsx(gk,{className:"w-4 h-4 mr-2"}),"Remove from Folder"]}),!_r()&&r.jsxs(tr,{onClick:()=>{Qe(z.id),de(z.folder_id||null),Le(!0)},children:[r.jsx(gk,{className:"w-4 h-4 mr-2"}),"Move to Folder"]}),r.jsxs(tr,{onClick:()=>{sn(z.id),Ja(z.title)},children:[r.jsx(Wa,{className:"w-4 h-4 mr-2"}),"View Comments",ei[z.id]>0&&r.jsx(Se,{variant:"secondary",className:"ml-auto text-xs",children:ei[z.id]})]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>Pie(z.id,!z.archived_at),children:[r.jsx(BH,{className:"w-4 h-4 mr-2"}),z.archived_at?"Unarchive":"Archive"]}),r.jsxs(tr,{onClick:()=>j(z.id),className:"text-destructive focus:text-destructive",children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete Video"]})]})]})]})]})})},z.id)})})})]})]})})})]})}),r.jsx(It,{open:b,onOpenChange:z=>{z?w(!0):Hv()},children:r.jsxs(Dt,{className:"w-[calc(100vw-1rem)] max-w-[calc(100vw-1rem)] max-h-[calc(100dvh-2rem)] sm:max-w-[90vw] sm:w-auto sm:max-h-[90vh] p-0 overflow-hidden [&>button]:hidden transition-transform duration-150 will-change-transform",style:{paddingTop:"env(safe-area-inset-top)"},onPointerDownOutside:Hv,onEscapeKeyDown:Hv,ref:z=>{if(!z||z.__swipeBound)return;z.__swipeBound=!0;let me=0,Ce=0,qe=!1;const Ke=()=>{z.style.transform="",z.style.opacity=""};z.addEventListener("touchstart",st=>{const Xt=st.touches[0];st.target.closest("video, iframe")||(me=Xt.clientY,Ce=Xt.clientX,qe=!0)},{passive:!0}),z.addEventListener("touchmove",st=>{if(!qe)return;const Xt=st.touches[0],Ir=Xt.clientY-me,un=Math.abs(Xt.clientX-Ce);Ir>0&&Ir>un&&(z.style.transform=`translate(-50%, calc(-50% + ${Ir}px))`,z.style.opacity=`${Math.max(.4,1-Ir/400)}`)},{passive:!0}),z.addEventListener("touchend",st=>{var Ir;if(!qe)return;qe=!1,(((Ir=st.changedTouches[0])==null?void 0:Ir.clientY)??me)-me>100&&Hv(),Ke()}),z.addEventListener("touchcancel",()=>{qe=!1,Ke()})},children:[r.jsxs(Lt,{className:"p-4 pb-0 pr-28",children:[r.jsx(Mt,{className:"truncate",children:v==null?void 0:v.title}),r.jsx("p",{className:"sr-only",children:"Swipe down or tap outside to close"})]}),r.jsx("div",{className:"sm:hidden absolute top-1.5 left-1/2 -translate-x-1/2 h-1.5 w-10 rounded-full bg-muted-foreground
1196/40 z-40 pointer-events-none"}),r.jsxs(P,{type:"button",variant:"default",size:"sm",onClick:Hv,className:"absolute right-3 z-50 h-10 gap-1.5 rounded-full shadow-lg px-4",style:{top:"calc(env(safe-area-inset-top) + 0.75rem)"},"aria-label":"Close video player",children:[r.jsx(zt,{className:"h-4 w-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Close"})]}),r.jsx("div",{className:"bg-black relative mx-auto max-h-[calc(100dvh-8rem)] sm:max-h-[calc(85vh-4rem)] max-w-full",style:{aspectRatio:Ui??16/9,width:Ui&&Ui<1?`min(calc((100dvh - 8rem) * ${Ui}), 100%)`:"min(90vw, 768px)"},children:v&&r.jsxs(r.Fragment,{children:[v.source_type==="youtube"&&v.external_video_id?r.jsx("iframe",{src:`https://www.youtube.com/embed/${v.external_video_id}?autoplay=1`,title:v.title,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):r.jsx("video",{ref:z=>{if(_N(z),z){const me=()=>{for(let Ce=0;Ce<z.textTracks.length;Ce++)z.textTracks[Ce].mode="disabled"};me(),z.textTracks.onchange=me,z.textTracks.onaddtrack=me}},src:v.video_url,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",disableRemotePlayback:!0,onLoadedMetadata:z=>{const me=z.currentTarget;me.videoWidth&&me.videoHeight&&Nu(me.videoWidth/me.videoHeight)},className:"w-full h-full object-contain"}),v.source_type!=="youtube"&&r.jsx(ZD,{show:mt==="starter"||or,customLogoUrl:Yt,useCustom:mt!=="starter"&&nn})]})})]})}),r.jsx(It,{open:$o,onOpenChange:z=>{td(z),z||jt(null)},children:r.jsxs(Dt,{className:"max-w-fit w-auto p-0 overflow-hidden sm:max-w-[90vw]",children:[r.jsx(Lt,{className:"p-4 pb-0",children:r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(Wa,{className:"w-5 h-5 text-primary"}),"Reply from ",Lo==null?void 0:Lo.sender_name]})}),r.jsx("div",{className:"bg-black mx-auto max-h-[85vh]",style:{aspectRatio:rt??16/9,width:rt&&rt<1?`calc(85vh * ${rt})`:"min(90vw, 768px)"},children:Lo&&r.jsx("video",{ref:z=>{if(_N(z),z){const me=()=>{for(let Ce=0;Ce<z.textTracks.length;Ce++)z.textTracks[Ce].mode="disabled"};me(),z.textTracks.onchange=me,z.textTracks.onaddtrack=me}},src:Lo.reply_video_url,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",disableRemotePlayback:!0,onLoadedMetadata:z=>{const me=z.currentTarget;me.videoWidth&&me.videoHeight&&jt(me.videoWidth/me.videoHeight)},className:"w-full h-full object-contain"})}),(Lo==null?void 0:Lo.message)&&r.jsx("div",{className:"p-4 border-t",children:r.jsxs("p",{className:"text-sm text-muted-foreground italic",children:['"',Lo.message,'"']})})]})}),r.jsx(cs,{open:!!Qt,onOpenChange:z=>!z&&ts(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete Video Reply?"}),r.jsx(Jn,{children:"This action cannot be undone. The video reply will be permanently deleted."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsxs(bs,{onClick:Mie,disabled:hn,children:[hn?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Delete"]})]})]})}),Ae&&e&&r.jsx(eOe,{open:!!Ae,onOpenChange:z=>!z&&Ve(null),videoId:Ae,videoTitle:et,videoDescription:St,userId:e.id,thumbnailUrl:Zt,videoUrl:Wt,videoDurationSeconds:be,sourceType:(D3=f.find(z=>z.id===Ae))==null?void 0:D3.source_type,onThumbnailChange:z=>{p(me=>me.map(Ce=>Ce.id===Ae?{...Ce,thumbnail_url:z}:Ce)),bt(z)}}),r.jsx(It,{open:!!we,onOpenChange:z=>!z&&pt(null),children:r.jsxs(Dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsx(Lt,{children:r.jsx(Mt,{className:"sr-only",children:"Video Analytics"})}),we&&r.jsx(hae,{videoId:we.id,videoTitle:we.title,videoDuration:we.duration})]})}),r.jsx(cs,{open:!!S,onOpenChange:()=>j(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete video?"}),r.jsx(Jn,{children:"This action cannot be undone. The video will be permanently deleted from your library."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{disabled:C,children:"Cancel"}),r.jsx(bs,{onClick:Die,disabled:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C?"Deleting...":"Delete"})]})]})}),r.jsx(It,{open:!!T,onOpenChange:z=>!z&&EC(),children:r.jsxs(Dt,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Edit Video Details"})}),r.jsxs("div",{className:"space-y-4 py-4",children:[T&&r.jsx(iJe,{videoUrl:T.video_url,currentThumbn
1196ail:T.thumbnail_url,onThumbnailGenerated:Fie,isGenerating:q}),r.jsxs("div",{className:"border-t border-border pt-4",children:[r.jsx(ye,{htmlFor:"edit-title",children:"Title"}),r.jsx(He,{id:"edit-title",value:A,onChange:z=>V(z.target.value),placeholder:"Enter video title",maxLength:100,className:"mt-1.5"})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"edit-description",children:"Description"}),r.jsx("div",{className:"mt-1.5",children:r.jsx($s,{id:"edit-description",value:U,onChange:z=>O(z.target.value),placeholder:"Add a description...",rows:3,maxLength:500})})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Tags"}),r.jsx("div",{className:"flex flex-wrap gap-2 mt-1.5 mb-2",children:M.map(z=>r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[z,r.jsx("button",{onClick:()=>$ie(z),className:"ml-1 hover:text-destructive",children:r.jsx(zt,{className:"w-3 h-3"})})]},z))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{value:I,onChange:z=>B(z.target.value),onKeyDown:Vie,placeholder:"Add a tag and press Enter",className:"flex-1"}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>R3(I),disabled:!I.trim(),children:r.jsx(Ns,{className:"w-4 h-4"})})]})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:EC,disabled:K||q,children:"Cancel"}),r.jsx(P,{onClick:Uie,disabled:K||q,children:K?"Saving...":"Save Changes"})]})]})}),r.jsx(cs,{open:W,onOpenChange:Q,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsxs(Qn,{children:["Delete ",ee.size," video(s)?"]}),r.jsx(Jn,{children:"This action cannot be undone. These videos will be permanently deleted from your library."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{disabled:Ze,children:"Cancel"}),r.jsx(bs,{onClick:Yie,disabled:Ze,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ze?"Deleting...":"Delete All"})]})]})}),r.jsx(It,{open:L,onOpenChange:te,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsx(Lt,{children:r.jsxs(Mt,{children:["Add Tags to ",ee.size," Video(s)"]})}),r.jsx("div",{className:"space-y-4 py-4",children:r.jsxs("div",{children:[r.jsx(ye,{children:"Tags to add"}),r.jsx("div",{className:"flex flex-wrap gap-2 mt-1.5 mb-2 min-h-[32px]",children:oe.map(z=>r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[z,r.jsx("button",{onClick:()=>Gie(z),className:"ml-1 hover:text-destructive",children:r.jsx(zt,{className:"w-3 h-3"})})]},z))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{value:$e,onChange:z=>De(z.target.value),onKeyDown:Kie,placeholder:"Type a tag and press Enter",className:"flex-1"}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>AC($e),disabled:!$e.trim(),children:r.jsx(Ns,{className:"w-4 h-4"})})]}),Pt.length>0&&r.jsxs("div",{className:"mt-3",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Quick add:"}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Pt.filter(z=>!oe.includes(z)).slice(0,6).map(z=>r.jsx(Se,{variant:"outline",className:"cursor-pointer hover:bg-muted",onClick:()=>AC(z),children:z},z))})]})]})}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>{te(!1),xe([]),De("")},disabled:Ze,children:"Cancel"}),r.jsx(P,{onClick:Xie,disabled:Ze||oe.length===0,children:Ze?"Adding...":"Add Tags"})]})]})}),r.jsx(It,{open:ae,onOpenChange:ne,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsx(Lt,{children:r.jsxs(Mt,{children:["Move ",ee.size," Video(s) to Folder"]})}),r.jsx("div",{className:"space-y-4 py-4",children:r.jsxs("div",{children:[r.jsx(ye,{children:"Select destination folder"}),r.jsxs(kn,{value:se||"none",onValueChange:z=>ue(z==="none"?null:z),children:[r.jsx(wn,{className:"mt-1.5",children:r.jsx(En,{placeholder:"Choose a folder"})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bi,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{children:"Main Library (no folder)"})]})}),Nt.map(z=>r.jsx(_t,{value:z.id,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:z.color}}),r.jsx("span",{children:z.name})]})},z.id))]})]}),Nt.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"No folders yet. Create folders from the folder bar above."})]})}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>{ne(!1),ue(null)},disabled:Ze,children:"Cancel"}),r.jsx(P,{onClick:Zie,disabled:Ze,children:Ze?"Moving...":"Move Videos"})]})]})}),r.jsx(It,{open:ve,onOpenChange:Le,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Move Video to Folder"})}),r.jsx("div",{className:"space-y-4 py-4",children:r.jsxs("div",{children:[r.jsx(ye,{children:"Select destination folder"}),r.jsxs(kn,{value:J||"none",onValueChange:z=>de(z==="none"?null:z),children:[r.jsx(wn,{className:"mt-1.5",children:r.jsx(En,{placeholder:"Choose a folder"})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bi,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{children:"Main Library (no folder)"})]})}),Nt.map(z=>r.jsx(_t,{value:z.id,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:z.color}}),r.jsx("span",{children:z.name})]})},z.id))]})]}),Nt.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"No folders yet. Create folders from the sidebar."})]})}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>{Le(!1),Qe(null),de(null)},children:"Cancel"}),r.jsx(P,{onClick:async()=>{Ne&&await rs(Ne,J),Le(!1),Qe(null),de(null)},children:"Move Video"})]})]})}),e&&r.jsx(pJe,{open:la,onOpenChange:qn,userId:e.id,folderId:dt,defaultNotifyOnReply:Ln,onAdded:()=>ea()}),r.jsx(It,{open:Za,onOpenChange:z=>
1196{La||(Na(z),z||(Qr(null),Os(""),Be(""),Vi(0)))},children:r.jsxs(Dt,{className:"max-w-md sm:max-w-md max-h-[100dvh] sm:max-h-[85vh] overflow-y-auto p-4 sm:p-6 data-[state=open]:slide-in-from-bottom-full sm:data-[state=open]:slide-in-from-bottom-0",children:[r.jsx(Lt,{children:r.jsx(Mt,{className:"text-lg",children:"Save Video"})}),r.jsxs("div",{className:"space-y-4 py-2 sm:py-4",children:[r.jsxs("div",{children:[r.jsx(ye,{className:"text-sm",children:"Video File"}),r.jsx("div",{className:"mt-1.5",children:Hn?r.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted rounded-lg",children:[r.jsx(cr,{className:"w-8 h-8 text-primary shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:Hn.name}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[(Hn.size/(1024*1024)).toFixed(1)," MB"]})]}),!La&&r.jsx(P,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>Qr(null),children:r.jsx(zt,{className:"w-4 h-4"})})]}):r.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-28 sm:h-32 border-2 border-dashed border-border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",onDragOver:z=>{z.preventDefault(),z.stopPropagation()},onDragEnter:z=>{z.preventDefault(),z.stopPropagation()},onDrop:z=>{var Ce;z.preventDefault(),z.stopPropagation();const me=(Ce=z.dataTransfer.files)==null?void 0:Ce[0];if(me&&me.type.startsWith("video/")){if(!oR(me.size)){a({title:"File too large",description:`Maximum file size is ${nb(is.MAX_FILE_SIZE_BYTES)}`,variant:"destructive"});return}Qr(me),dn||Os(me.name.replace(/\.[^/.]+$/,""))}else a({title:"Invalid file",description:"Please upload a video file (MP4, WebM, MOV)",variant:"destructive"})},children:[r.jsx(na,{className:"w-8 h-8 text-muted-foreground mb-2"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Click or drag & drop a video"}),r.jsxs("span",{className:"text-xs text-muted-foreground mt-1",children:["MP4, WebM, MOV (max ",nb(is.MAX_FILE_SIZE_BYTES),")"]}),r.jsx("input",{type:"file",accept:"video/*",className:"hidden",onChange:Jie,disabled:La})]})})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"upload-title",className:"text-sm",children:"Title"}),r.jsx(He,{id:"upload-title",value:dn,onChange:z=>Os(z.target.value),placeholder:"Enter video title",disabled:La,className:"mt-1.5 h-11 text-base"})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"upload-description",className:"text-sm",children:"Description (optional)"}),r.jsx($s,{id:"upload-description",value:Qa,onChange:z=>Be(z.target.value),placeholder:"Add a description...",disabled:La,className:"mt-1.5 text-base",rows:3})]}),La&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:"Uploading..."}),r.jsxs("span",{className:"font-medium",children:[gu,"%"]})]}),r.jsx("div",{className:"w-full h-2 bg-muted rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${gu}%`}})})]})]}),r.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2 pt-2",children:[r.jsx(P,{variant:"outline",onClick:()=>Na(!1),disabled:La,className:"h-11 sm:h-9",children:"Cancel"}),r.jsx(P,{onClick:toe,disabled:!Hn||La,className:"h-11 sm:h-9",children:La?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(na,{className:"w-4 h-4 mr-2"}),"Save Video"]})})]})]})}),r.jsx(tOe,{open:!!_i,onOpenChange:z=>{z||(rd(null),jC(""),SC(""))},shareLinkId:_i||"",shareToken:Su,linkTitle:NC}),r.jsx(It,{open:!!mp,onOpenChange:z=>{z||(Bv(null),hp(""))},children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsx(Lt,{children:r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(dT,{className:"h-5 w-5"}),"Embed Video"]})}),mp&&((M3=Vr[mp])==null?void 0:M3[0])&&r.jsx(mJe,{shareToken:Vr[mp][0].share_token,videoTitle:zv})]})}),r.jsx(lJe,{open:!!Us,onOpenChange:z=>{z||(sn(null),Ja(""))},videoId:Us||"",videoTitle:hi,onCommentCountChange:(z,me)=>{$a(Ce=>({...Ce,[z]:me}))}})]})},gJe=()=>{const[e]=iu(),t=Sr(),{user:n,loading:s}=nr(),{openRecording:a}=bv(),{disabled:i,isLoading:o,reasonText:l}=u2(n==null?void 0:n.id),{isExtensionAvailable:c}=yv();return h.useEffect(()=>{if(s||o)return;if(!n){t("/auth",{replace:!0});return}const d=e.get("mode");if(d==="upload"){t("/videos?upload=true",{replace:!0});return}if(i){Pe(l),t("/videos",{replace:!0});return}const m=["camera","screen","presentation"].includes(d)?d:"screen";if(!lr()&&v5()){if(m==="camera"){Pe("Record yourself in the VIDAREO mobile app"),t("/dashboard",{replace:!0});return}if(m==="screen"){Pe("Open VIDAREO on desktop to record your screen"),t("/dashboard",{replace:!0});return}
1196if(m==="presentation"){Pe("Presentations are available on desktop"),t("/dashboard",{replace:!0});return}}if(m==="screen"&&!lr()&&!c){Pe("Install the Chrome extension to record your screen"),t("/dashboard",{replace:!0});return}a(m),t(-1)},[s,o,n,e,t,a,i,l,c]),s?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):null},vJe=()=>{const{user:e}=nr(),[t,n]=h.useState(!0),[s,a]=h.useState("30"),[i,o]=h.useState([]),[l,c]=h.useState({totalViews:0,totalVideos:0,totalWatchTime:0,avgCompletionRate:0}),[d,u]=h.useState(null);h.useEffect(()=>{e&&m()},[e,s]);const m=async()=>{if(e){n(!0);try{const v=parseInt(s),y=Zd(vf(new Date,v)),{data:b}=await F.from("videos").select("id, title, description, thumbnail_url, duration, created_at, view_count").eq("user_id",e.id).order("created_at",{ascending:!1}),{data:w}=await F.from("share_link_views").select("video_id, watch_percentage, watch_duration, completed, viewer_ip").eq("owner_id",e.id).gte("viewed_at",y.toISOString()),S=b||[],j=w||[],N=S.map(R=>{const T=j.filter(B=>B.video_id===R.id),D=T.length,A=R.view_count||0,V=Math.max(D,A),U=D>0?T.reduce((B,K)=>B+(K.watch_percentage||0),0)/D:0,O=T.filter(B=>B.completed).length,M=D>0?O/D*100:0,$=T.reduce((B,K)=>B+(K.watch_duration||0),0),I=new Set(T.map(B=>B.viewer_ip).filter(Boolean)).size;return{id:R.id,title:R.title,description:R.description,thumbnail_url:R.thumbnail_url,duration:R.duration,created_at:R.created_at,totalViews:V,avgWatchPercentage:U,completionRate:M,totalWatchTime:$,uniqueViewers:I}});N.sort((R,T)=>{const D=R.totalViews*(R.avgWatchPercentage/100+1);return T.totalViews*(T.avgWatchPercentage/100+1)-D});const _=S.reduce((R,T)=>R+(T.view_count||0),0),C=j.reduce((R,T)=>R+(T.watch_duration||0),0),k=j.filter(R=>R.completed).length,E=j.length>0?Math.round(k/j.length*100):0;c({totalViews:_,totalVideos:S.length,totalWatchTime:C,avgCompletionRate:E}),o(N)}catch(v){console.error("Error fetching analytics:",v)}finally{n(!1)}}},f=v=>v<60?`${Math.round(v)}s`:v<3600?`${Math.floor(v/60)}m ${Math.round(v%60)}s`:`${Math.floor(v/3600)}h ${Math.floor(v%3600/60)}m`,p=v=>v>=75?"text-green-500":v>=50?"text-yellow-500":v>=25?"text-orange-500":"text-red-500",x=v=>v>=75?"bg-green-500":v>=50?"bg-yellow-500":v>=25?"bg-orange-500":"bg-red-500",g=[{label:"Total Views",value:l.totalViews,icon:wr,color:"text-primary",tooltip:"Total times recipients opened and watched your shared videos"},{label:"Videos",value:l.totalVideos,icon:cr,color:"text-blue-500",tooltip:"Total number of videos in your library"},{label:"Watch Time",value:f(l.totalWatchTime),icon:fr,color:"text-amber-500",tooltip:"Combined time all recipients spent watching your videos"},{label:"Completion",value:`${l.avgCompletionRate}%`,icon:cl,color:"text-green-500",tooltip:"Percentage of viewers who watched your videos to the end"}];return r.jsxs("div",{className:"min-h-screen bg-background overflow-y-auto",children:[r.jsx(pn,{}),r.jsx("main",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-24 md:pt-28 pb-24",children:r.jsx(Ts,{mode:"wait",children:d?r.jsxs(fe.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:[r.jsxs(P,{variant:"ghost",className:"mb-4 gap-2",onClick:()=>u(null),children:[r.jsx(aa,{className:"w-4 h-4"}),"Back to All Videos"]}),r.jsx(hae,{videoId:d.id,videoTitle:d.title,videoDuration:d.duration})]},"detail"):r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-3 mb-4 sm:mb-6",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-foreground",children:"Analytics"}),r.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm mt-0.5 sm:mt-1",children:"Track your video performance and engagement"})]}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("div",{"data-tour":"analytics-time-range",children:r.jsxs(kn,{value:s,onValueChange:a,children:[r.jsxs(wn,{className:"w-[180px]",children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),r.jsx(En,{})]}),r.jsxs(jn,{children:[r.jsx(_t,{value:"7",children:"Last 7 days"}),r.jsx(_t,{value:"14",children:"Last 14 days"}),r.jsx(_t,{value:"30",children:"Last 30 days"}),r.jsx(_t,{value:"90",children:"Last 90 days"})]})]})})}),r.jsx(yt,{children:"Filter analytics by date range"})]})})]}),r.jsx(ys,{children:r.jsx("div",{"data-tour":"analytics-overview",className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 md:gap-4 mb-5 sm:mb-8",children:g.map((v,y)=>r.jsx(fe.div,{initial:{opacity:0,y:10}
1196,animate:{opacity:1,y:0},transition:{delay:y*.05},children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(Ie,{className:"cursor-default",children:r.jsx(lt,{className:"p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[r.jsx(v.icon,{className:`w-4 h-4 sm:w-5 sm:h-5 ${v.color} shrink-0`}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"text-lg sm:text-xl font-bold text-foreground",children:t?"...":v.value}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:v.label})]})]})})})}),r.jsx(yt,{side:"bottom",className:"max-w-[240px]",children:r.jsx("p",{children:v.tooltip})})]})},v.label))})}),r.jsxs("div",{"data-tour":"analytics-video-list",className:"space-y-2",children:[r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-3 cursor-default inline-block",children:"Videos by Engagement"})}),r.jsx(yt,{children:"Sorted by a combined score of views and average watch percentage"})]})}),t?r.jsx("div",{className:"flex items-center justify-center py-16",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:[r.jsx(cr,{className:"w-12 h-12 mb-3 opacity-50"}),r.jsx("p",{className:"font-medium",children:"No videos yet"}),r.jsx("p",{className:"text-sm",children:"Record your first video to see analytics"})]}):r.jsx(ys,{children:r.jsx("div",{className:"space-y-2",children:i.map((v,y)=>r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:y*.03},children:r.jsx(Ie,{className:"cursor-pointer hover:bg-muted/50 transition-colors group",onClick:()=>u(v),children:r.jsx(lt,{className:"p-2.5 sm:p-4",children:r.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-4",children:[r.jsxs("div",{className:"relative shrink-0 w-14 h-10 sm:w-24 sm:h-16 md:w-32 md:h-20 rounded-md sm:rounded-lg overflow-hidden bg-muted",children:[v.thumbnail_url?r.jsx("img",{src:v.thumbnail_url,alt:v.title,className:"w-full h-full object-cover"}):r.jsx("div",{className:"flex items-center justify-center w-full h-full",children:r.jsx(Js,{className:"w-5 h-5 text-muted-foreground"})}),v.duration&&r.jsx("span",{className:"absolute bottom-0.5 right-0.5 text-[10px] bg-black/70 text-white px-1 rounded",children:f(v.duration)})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-medium text-foreground text-xs sm:text-base truncate",children:v.title}),r.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-muted-foreground",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(wr,{className:"w-3 h-3"}),v.totalViews," ",v.totalViews===1?"view":"views"]})}),r.jsx(yt,{children:"Times this video was watched by recipients"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(jr,{className:"w-3 h-3"}),v.uniqueViewers]})}),r.jsx(yt,{children:"Unique viewers (by IP address)"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("span",{className:"hidden sm:flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),f(v.totalWatchTime)]})}),r.jsx(yt,{children:"Total time spent watching this video"})]})]}),v.totalViews>0&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[r.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden max-w-[200px]",children:r.jsx("div",{className:`h-full rounded-full transition-all ${x(v.avgWatchPercentage)}`,style:{width:`${Math.min(100,v.avgWatchPercentage)}%`}})}),r.jsxs("span",{className:`text-xs font-medium ${p(v.avgWatchPercentage)}`,children:[Math.round(v.avgWatchPercentage),"% avg"]})]})}),r.jsx(yt,{children:"Average percentage of the video watched by viewers. Green (75%+) = excellent engagement."})]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[v.totalViews===0&&r.jsx(Se,{variant:"outline",className:"text-xs hidden sm:inline-flex",children:"No views"}),r.jsx(Hl,{className:"w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors"})]})]})})})},v.id))})})]})]},"list")})})]})},fae=xw("App",{web:()=>Si(()=>import("./web-B7BUKU6a.js"),[]).then(e=>new e.AppWeb)}),yJe=Object.freeze(Object.defineProperty({__proto__:null,App:fae},Symbol.toStringTag,{value:"Module"})),GE="1.0.4";let by=null;function bJe(){const[e,t]=h.useState(by??{version:GE,build:""});return h.useEffect(()=>{if(!by){if(!_r()){by={version:GE,build:""};return}fae.getInfo().then(n=>{by={version:n.version,build:n.build},t(by)}).catch(()=>{t({version:GE,build:""})})}},[]),e}const pae=(e="/")=>{const t=Sr();return{goBack:h.useCallback(()=>{window.history.length>1?t(-1):t(e)},[t,e]),navigate:t}};var wJe="Separator",ez="horizontal",jJe=["horizontal","vertical"],xae=h.forwardRef((e,t)=>
1196{const{decorative:n,orientation:s=ez,...a}=e,i=NJe(s)?s:ez,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return r.jsx(ut.div,{"data-orientation":i,...l,...a,ref:t})});xae.displayName=wJe;function NJe(e){return jJe.includes(e)}var gae=xae;const Kl=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...s},a)=>r.jsx(gae,{ref:a,decorative:n,orientation:t,className:ge("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Kl.displayName=gae.displayName;var SJe=Object.defineProperty,KS=Object.getOwnPropertySymbols,vae=Object.prototype.hasOwnProperty,yae=Object.prototype.propertyIsEnumerable,tz=(e,t,n)=>t in e?SJe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vP=(e,t)=>{for(var n in t||(t={}))vae.call(t,n)&&tz(e,n,t[n]);if(KS)for(var n of KS(t))yae.call(t,n)&&tz(e,n,t[n]);return e},yP=(e,t)=>{var n={};for(var s in e)vae.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&KS)for(var s of KS(e))t.indexOf(s)<0&&yae.call(e,s)&&(n[s]=e[s]);return n};/**
1197 * @license QR Code generator library (TypeScript)
1198 * Copyright (c) Project Nayuki.
1199 * SPDX-License-Identifier: MIT
1200 */var Kf;(e=>{const t=class Hr{constructor(c,d,u,m){if(this.version=c,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],c<Hr.MIN_VERSION||c>Hr.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let f=[];for(let x=0;x<this.size;x++)f.push(!1);for(let x=0;x<this.size;x++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(u);if(this.drawCodewords(p),m==-1){let x=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const v=this.getPenaltyScore();v<x&&(m=g,x=v),this.applyMask(g)}}a(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),this.isFunction=[]}static encodeText(c,d){const u=e.QrSegment.makeSegments(c);return Hr.encodeSegments(u,d)}static encodeBinary(c,d){const u=e.QrSegment.makeBytes(c);return Hr.encodeSegments([u],d)}static encodeSegments(c,d,u=1,m=40,f=-1,p=!0){if(!(Hr.MIN_VERSION<=u&&u<=m&&m<=Hr.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let x,g;for(x=u;;x++){const w=Hr.getNumDataCodewords(x,d)*8,S=o.getTotalBits(c,x);if(S<=w){g=S;break}if(x>=m)throw new RangeError("Data too long")}for(const w of[Hr.Ecc.MEDIUM,Hr.Ecc.QUARTILE,Hr.Ecc.HIGH])p&&g<=Hr.getNumDataCodewords(x,w)*8&&(d=w);let v=[];for(const w of c){n(w.mode.modeBits,4,v),n(w.numChars,w.mode.numCharCountBits(x),v);for(const S of w.getData())v.push(S)}a(v.length==g);const y=Hr.getNumDataCodewords(x,d)*8;a(v.length<=y),n(0,Math.min(4,y-v.length),v),n(0,(8-v.length%8)%8,v),a(v.length%8==0);for(let w=236;v.length<y;w^=253)n(w,8,v);let b=[];for(;b.length*8<v.length;)b.push(0);return v.forEach((w,S)=>b[S>>>3]|=w<<7-(S&7)),new Hr(x,d,b,f)}getModule(c,d){return 0<=c&&c<this.size&&0<=d&&d<this.size&&this.modules[d][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const c=this.getAlignmentPatternPositions(),d=c.length;for(let u=0;u<d;u++)for(let m=0;m<d;m++)u==0&&m==0||u==0&&m==d-1||u==d-1&&m==0||this.drawAlignmentPattern(c[u],c[m]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(c){const d=this.errorCorrectionLevel.formatBits<<3|c;let u=d;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;const m=(d<<10|u)^21522;a(m>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,s(m,f));this.setFunctionModule(8,7,s(m,6)),this.setFunctionModule(8,8,s(m,7)),this.setFunctionModule(7,8,s(m,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,s(m,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,s(m,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,s(m,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const d=this.version<<12|c;a(d>>>18==0);for(let u=0;u<18;u++){const m=s(d,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,m),this.setFunctionModule(p,f,m)}}drawFinderPattern(c,d){for(let u=-4;u<=4;u++)for(let m=-4;m<=4;m++){const f=Math.max(Math.abs(m),Math.abs(u)),p=c+m,x=d+u;0<=p&&p<this.size&&0<=x&&x<this.size&&this.setFunctionModule(p,x,f!=2&&f!=4)}}drawAlignmentPattern(c,d){for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)this.setFunctionModule(c+m,d+u,Math.max(Math.abs(m),Math.abs(u))!=1)}setFunctionModule(c,d,u){this.modules[d][c]=u,this.isFunction[d][c]=!0}addEccAndInterleave(c){const d=this.version,u=this.errorCorrectionLevel;if(c.length!=Hr.getNumDataCodewords(d,u))throw new RangeError("Invalid argument");const m=Hr.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][d],f=Hr.ECC_CODEWORDS_PER_BLOCK[u.ordinal][d],p=Math.floor(Hr.getNumRawDataModules(d)/8),x=m-p%m,g=Math.floor(p/m);let v=[];const y=Hr.reedSolomonComputeDivisor(f);for(let w=0,S=0;w<m;w++){let j=c.slice(S,S+g-f+(w<x?0:1));S+=j.length;const N=Hr.reedSolomonComputeRemainder(j,y);w<x&&j.push(0),v.push(j.concat(N))}let b=[];for(let w=0;w<v[0].length;w++)v.forEach((S,j)=>{(w!=g-f||j>=x)&&b.push(S[w])});return a(b.length==p),b}drawCodewords(c){if(c.length!=Math.floor(Hr.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let m=0;m<this.size;m++)for(let f=0;f<2;f++){const p=u-f,g=(u+1&2)==0?this.size-1-m:m;!this.isFunction[g][p]&&d<c.length*8&&(this.modules[g][p]=s(c[d>>>3],7-(d&7)),d++)}}a(d==c.length*8)}
1200applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let u=0;u<this.size;u++){let m;switch(c){case 0:m=(u+d)%2==0;break;case 1:m=d%2==0;break;case 2:m=u%3==0;break;case 3:m=(u+d)%3==0;break;case 4:m=(Math.floor(u/3)+Math.floor(d/2))%2==0;break;case 5:m=u*d%2+u*d%3==0;break;case 6:m=(u*d%2+u*d%3)%2==0;break;case 7:m=((u+d)%2+u*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][u]&&m&&(this.modules[d][u]=!this.modules[d][u])}}getPenaltyScore(){let c=0;for(let f=0;f<this.size;f++){let p=!1,x=0,g=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[f][v]==p?(x++,x==5?c+=Hr.PENALTY_N1:x>5&&c++):(this.finderPenaltyAddHistory(x,g),p||(c+=this.finderPenaltyCountPatterns(g)*Hr.PENALTY_N3),p=this.modules[f][v],x=1);c+=this.finderPenaltyTerminateAndCount(p,x,g)*Hr.PENALTY_N3}for(let f=0;f<this.size;f++){let p=!1,x=0,g=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][f]==p?(x++,x==5?c+=Hr.PENALTY_N1:x>5&&c++):(this.finderPenaltyAddHistory(x,g),p||(c+=this.finderPenaltyCountPatterns(g)*Hr.PENALTY_N3),p=this.modules[v][f],x=1);c+=this.finderPenaltyTerminateAndCount(p,x,g)*Hr.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){const x=this.modules[f][p];x==this.modules[f][p+1]&&x==this.modules[f+1][p]&&x==this.modules[f+1][p+1]&&(c+=Hr.PENALTY_N2)}let d=0;for(const f of this.modules)d=f.reduce((p,x)=>p+(x?1:0),d);const u=this.size*this.size,m=Math.ceil(Math.abs(d*20-u*10)/u)-1;return a(0<=m&&m<=9),c+=m*Hr.PENALTY_N4,a(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let m=this.size-7;u.length<c;m-=d)u.splice(1,0,m);return u}}static getNumRawDataModules(c){if(c<Hr.MIN_VERSION||c>Hr.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;d-=(25*u-10)*u-55,c>=7&&(d-=36)}return a(208<=d&&d<=29648),d}static getNumDataCodewords(c,d){return Math.floor(Hr.getNumRawDataModules(c)/8)-Hr.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c]*Hr.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let d=[];for(let m=0;m<c-1;m++)d.push(0);d.push(1);let u=1;for(let m=0;m<c;m++){for(let f=0;f<d.length;f++)d[f]=Hr.reedSolomonMultiply(d[f],u),f+1<d.length&&(d[f]^=d[f+1]);u=Hr.reedSolomonMultiply(u,2)}return d}static reedSolomonComputeRemainder(c,d){let u=d.map(m=>0);for(const m of c){const f=m^u.shift();u.push(0),d.forEach((p,x)=>u[x]^=Hr.reedSolomonMultiply(p,f))}return u}static reedSolomonMultiply(c,d){if(c>>>8||d>>>8)throw new RangeError("Byte out of range");let u=0;for(let m=7;m>=0;m--)u=u<<1^(u>>>7)*285,u^=(d>>>m&1)*c;return a(u>>>8==0),u}finderPenaltyCountPatterns(c){const d=c[1];a(d<=this.size*3);const u=d>0&&c[2]==d&&c[3]==d*3&&c[4]==d&&c[5]==d;return(u&&c[0]>=d*4&&c[6]>=d?1:0)+(u&&c[6]>=d*4&&c[0]>=d?1:0)}finderPenaltyTerminateAndCount(c,d,u){return c&&(this.finderPenaltyAddHistory(d,u),d=0),d+=this.size,this.finderPenaltyAddHistory(d,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,d){d[0]==0&&(c+=this.size),d.pop(),d.unshift(c)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(l,c,d){if(c<0||c>31||l>>>c)throw new RangeError("Value out of range");for(let u=c-1;u>=0;u--)d.push(l>>>u&1)}function s(l,c){return(l>>>c&1)!=0}function a(l){if(!l)throw new Error("Assertion error")}const i=class qs{constructor(c,d,u){if(this.mode=c,this.numChars=d,this.bitData=u,d<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let d=[];for(const u of c)n(u,8,d);return new qs(qs.Mode.BYTE,c.length,d)}static makeNumeric(c){if(!qs.isNumeric(c))throw new RangeError("String contains 
1200non-numeric characters");let d=[];for(let u=0;u<c.length;){const m=Math.min(c.length-u,3);n(parseInt(c.substring(u,u+m),10),m*3+1,d),u+=m}return new qs(qs.Mode.NUMERIC,c.length,d)}static makeAlphanumeric(c){if(!qs.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],u;for(u=0;u+2<=c.length;u+=2){let m=qs.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u))*45;m+=qs.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u+1)),n(m,11,d)}return u<c.length&&n(qs.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u)),6,d),new qs(qs.Mode.ALPHANUMERIC,c.length,d)}static makeSegments(c){return c==""?[]:qs.isNumeric(c)?[qs.makeNumeric(c)]:qs.isAlphanumeric(c)?[qs.makeAlphanumeric(c)]:[qs.makeBytes(qs.toUtf8ByteArray(c))]}static makeEci(c){let d=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)n(c,8,d);else if(c<16384)n(2,2,d),n(c,14,d);else if(c<1e6)n(6,3,d),n(c,21,d);else throw new RangeError("ECI assignment value out of range");return new qs(qs.Mode.ECI,0,d)}static isNumeric(c){return qs.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return qs.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,d){let u=0;for(const m of c){const f=m.mode.numCharCountBits(d);if(m.numChars>=1<<f)return 1/0;u+=4+f+m.bitData.length}return u}static toUtf8ByteArray(c){c=encodeURI(c);let d=[];for(let u=0;u<c.length;u++)c.charAt(u)!="%"?d.push(c.charCodeAt(u)):(d.push(parseInt(c.substring(u+1,u+3),16)),u+=2);return d}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let o=i;e.QrSegment=i})(Kf||(Kf={}));(e=>{(t=>{const n=class{constructor(a,i){this.ordinal=a,this.formatBits=i}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Kf||(Kf={}));(e=>{(t=>{const n=class{constructor(a,i){this.modeBits=a,this.numBitsCharCount=i}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Kf||(Kf={}));var fx=Kf;/**
1201 * @license qrcode.react
1202 * Copyright (c) Paul O'Shannessy
1203 * SPDX-License-Identifier: ISC
1204 */var _Je={L:fx.QrCode.Ecc.LOW,M:fx.QrCode.Ecc.MEDIUM,Q:fx.QrCode.Ecc.QUARTILE,H:fx.QrCode.Ecc.HIGH},bae=128,wae="L",jae="#FFFFFF",Nae="#000000",Sae=!1,_ae=1,CJe=4,kJe=0,EJe=.1;function Cae(e,t=0){const n=[];return e.forEach(function(s,a){let i=null;
1204s.forEach(function(o,l){if(!o&&i!==null){n.push(`M${i+t} ${a+t}h${l-i}v1H${i+t}z`),i=null;return}if(l===s.length-1){if(!o)return;i===null?n.push(`M${l+t},${a+t} h1v1H${l+t}z`):n.push(`M${i+t},${a+t} h${l+1-i}v1H${i+t}z`);return}o&&i===null&&(i=l)})}),n.join("")}function kae(e,t){return e.slice().map((n,s)=>s<t.y||s>=t.y+t.h?n:n.map((a,i)=>i<t.x||i>=t.x+t.w?a:!1))}function AJe(e,t,n,s){if(s==null)return null;const a=e.length+n*2,i=Math.floor(t*EJe),o=a/t,l=(s.width||i)*o,c=(s.height||i)*o,d=s.x==null?e.length/2-l/2:s.x*o,u=s.y==null?e.length/2-c/2:s.y*o,m=s.opacity==null?1:s.opacity;let f=null;if(s.excavate){let x=Math.floor(d),g=Math.floor(u),v=Math.ceil(l+d-x),y=Math.ceil(c+u-g);f={x,y:g,w:v,h:y}}const p=s.crossOrigin;return{x:d,y:u,h:c,w:l,excavation:f,opacity:m,crossOrigin:p}}function TJe(e,t){return t!=null?Math.max(Math.floor(t),0):e?CJe:kJe}function Eae({value:e,level:t,minVersion:n,includeMargin:s,marginSize:a,imageSettings:i,size:o,boostLevel:l}){let c=Y.useMemo(()=>{const x=(Array.isArray(e)?e:[e]).reduce((g,v)=>(g.push(...fx.QrSegment.makeSegments(v)),g),[]);return fx.QrCode.encodeSegments(x,_Je[t],n,void 0,void 0,l)},[e,t,n,l]);const{cells:d,margin:u,numCells:m,calculatedImageSettings:f}=Y.useMemo(()=>{let p=c.getModules();const x=TJe(s,a),g=p.length+x*2,v=AJe(p,o,x,i);return{cells:p,margin:x,numCells:g,calculatedImageSettings:v}},[c,o,i,s,a]);return{qrcode:c,margin:u,cells:d,numCells:m,calculatedImageSettings:f}}var RJe=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),OJe=Y.forwardRef(function(t,n){const s=t,{value:a,size:i=bae,level:o=wae,bgColor:l=jae,fgColor:c=Nae,includeMargin:d=Sae,minVersion:u=_ae,boostLevel:m,marginSize:f,imageSettings:p}=s,g=yP(s,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=g,y=yP(g,["style"]),b=p==null?void 0:p.src,w=Y.useRef(null),S=Y.useRef(null),j=Y.useCallback(A=>{w.current=A,typeof n=="function"?n(A):n&&(n.current=A)},[n]),[N,_]=Y.useState(!1),{margin:C,cells:k,numCells:E,calculatedImageSettings:R}=Eae({value:a,level:o,minVersion:u,boostLevel:m,includeMargin:d,marginSize:f,imageSettings:p,size:i});Y.useEffect(()=>{if(w.current!=null){const A=w.current,V=A.getContext("2d");if(!V)return;let U=k;const O=S.current,M=R!=null&&O!==null&&O.complete&&O.naturalHeight!==0&&O.naturalWidth!==0;M&&R.excavation!=null&&(U=kae(k,R.excavation));const $=window.devicePixelRatio||1;A.height=A.width=i*$;const I=i/E*$;V.scale(I,I),V.fillStyle=l,V.fillRect(0,0,E,E),V.fillStyle=c,RJe?V.fill(new Path2D(Cae(U,C))):k.forEach(function(B,K){B.forEach(function(Z,q){Z&&V.fillRect(q+C,K+C,1,1)})}),R&&(V.globalAlpha=R.opacity),M&&V.drawImage(O,R.x+C,R.y+C,R.w,R.h)}}),Y.useEffect(()=>{_(!1)},[b]);const T=vP({height:i,width:i},v);let D=null;return b!=null&&(D=Y.createElement("img",{src:b,key:b,style:{display:"none"},onLoad:()=>{_(!0)},ref:S,crossOrigin:R==null?void 0:R.crossOrigin})),Y.createElement(Y.Fragment,null,Y.createElement("canvas",vP({style:T,height:i,width:i,ref:j,role:"img"},y)),D)});OJe.displayName="QRCodeCanvas";var Aae=Y.forwardRef(function(t,n){const s=t,{value:a,size:i=bae,level:o=wae,bgColor:l=jae,fgColor:c=Nae,includeMargin:d=Sae,minVersion:u=_ae,boostLevel:m,title:f,marginSize:p,imageSettings:x}=s,g=yP(s,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:y,numCells:b,calculatedImageSettings:w}=Eae({value:a,level:o,minVersion:u,boostLevel:m,includeMargin:d,marginSize:p,imageSettings:x,size:i});let S=y,j=null;x!=null&&w!=null&&(w.excavation!=null&&(S=kae(y,w.excavation)),j=Y.createElement("image",{href:x.src,height:w.h,width:w.w,x:w.x+v,y:w.y+v,preserveAspectRatio:"none",opacity:w.opacity,crossOrigin:w.crossOrigin}));const N=Cae(S,v);return Y.createElement("svg",vP({height:i,width:i,viewBox:`0 0 ${b} ${b}`,ref:n,role:"img"},g),!!f&&Y.createElement("title",null,f),Y.createElement("path",{fill:l,d:`M0,0 h${b}v${b}H0z`,shapeRendering:"crispEdges"}),Y.createElement("path",{fill:c,d:N,shapeRendering:"crispEdges"}),j)});Aae.displayName="QRCodeSVG";const PJe=()=>{const{toast:e}=Gr(),[t,n]=h.useState(!0),[s,a]=h.useState(null),[i,o]=h.useState("idle"),[l,c]=h.useState(null),[d,u]=h.useState(""),[m,f]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState(!1),[y,b]=h.useState(!1),[w,S]=h.useState(!1),[j,N]=h.useState(""),_=h.useCallback(async()=>{var A;n(!0);try{const{data:V,error:U}=await F.auth.mfa.listFactors();if(U)throw U;const O=(A=V==null?void 0:V.totp)==null?void 0:A.find(M=>M.status==="verified");a((O==null?void 0:O.id)??null)}catch(V){console.warn("Failed to load MFA factors:",V)}finally{n(!1)}},[]);h.useEffect(()=>{_()},[_]);const C=async()=>{var U;const{data:A}=await F.auth.mfa.listFactors(),V=((U=A==null?void 0:A.totp)==null?void 0:U.filter(O=>O.status!=="verified"))??[];for(const O of V)await F.auth.mfa.unenroll({factorId:O.id}).catch(()=>{})},k=async()=>{v(!0);try{await C();const{data:A,error:V}=await F.auth.mfa.enroll({factorType:"totp",friendlyName:"VIDAREO Authenticator"});if(V)throw V;c(A.id),u(A.totp.uri),f(A.totp.secret),x(""),o("verifying")}catch(A){e({title:"Setup failed",description:A.message||"Unable to start two-factor setup. Please try again.",variant:"destructive"})}finally{v(!1)}},E=async()=>
1204{if(!(!l||p.trim().length!==6)){v(!0);try{const{data:A,error:V}=await F.auth.mfa.challenge({factorId:l});if(V)throw V;const{error:U}=await F.auth.mfa.verify({factorId:l,challengeId:A.id,code:p.trim()});if(U){e({title:"Incorrect code",description:"Check the code in your authenticator app and try again.",variant:"destructive"}),x("");return}e({title:"Two-factor authentication enabled",description:"Your account now requires a code from your authenticator app at sign-in."}),o("idle"),c(null),u(""),f(""),await _()}catch(A){e({title:"Verification failed",description:A.message||"Unable to verify the code. Please try again.",variant:"destructive"})}finally{v(!1)}}},R=async()=>{l&&await F.auth.mfa.unenroll({factorId:l}).catch(()=>{}),o("idle"),c(null),u(""),f(""),x("")},T=async()=>{if(!(!s||j.trim().length!==6)){v(!0);try{const{data:A,error:V}=await F.auth.mfa.challenge({factorId:s});if(V)throw V;const{error:U}=await F.auth.mfa.verify({factorId:s,challengeId:A.id,code:j.trim()});if(U){e({title:"Incorrect code",description:"Enter the current code from your authenticator app to disable two-factor.",variant:"destructive"}),N("");return}const{error:O}=await F.auth.mfa.unenroll({factorId:s});if(O)throw O;e({title:"Two-factor authentication disabled",description:"Your account now only requires your password at sign-in."}),S(!1),N(""),await _()}catch(A){e({title:"Unable to disable",description:A.message||"Something went wrong. Please try again.",variant:"destructive"})}finally{v(!1)}}},D=async()=>{try{await navigator.clipboard.writeText(m),b(!0),setTimeout(()=>b(!1),2e3)}catch{}};return t?r.jsxs("div",{className:"flex items-center gap-2 py-2 text-sm text-muted-foreground",children:[r.jsx(Me,{className:"w-4 h-4 animate-spin"}),"Checking security settings..."]}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(rp,{className:"w-4 h-4 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Two-Factor Authentication"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Require a code from an authenticator app at sign-in"})]})]}),s?r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Enabled"}):r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4",children:"Off"})]}),s&&i==="idle"&&r.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:()=>S(!0),children:"Disable two-factor authentication"}),!s&&i==="idle"&&r.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:k,disabled:g,children:g?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Preparing..."]}):"Set up two-factor authentication"}),i==="verifying"&&r.jsxs("div",{className:"space-y-4 p-4 rounded-lg bg-muted/50 border border-border",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"1. Add VIDAREO to your authenticator app"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Open your authenticator app, tap ",r.jsx("strong",{children:"+"})," or ",r.jsx("strong",{children:"Add account"}),", then scan the QR code below."]})]}),r.jsx("div",{className:"flex justify-center p-3 bg-white rounded-lg w-fit mx-auto",children:d&&r.jsx(Aae,{value:d,size:180})}),r.jsxs("div",{className:"rounded-md bg-background border border-border p-3 space-y-2",children:[r.jsx("p",{className:"text-xs font-medium",children:"Don't have an authenticator app?"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Download one free from your phone's app store - Google Authenticator, Authy, or 1Password all work. If you already use a password manager, it may already have an authenticator option."})]}),r.jsx(Kl,{}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"Can't scan the QR code?"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["In your authenticator app, choose ",r.jsx("strong",{children:"Enter setup key"})," (or ",r.jsx("strong",{children:"Manual entry"}),") and paste this key:"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"flex-1 text-xs bg-background border border-border rounded px-2 py-1.5 break-all select-all",children:m}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:D,children:y?r.jsx(nt,{className:"w-3.5 h-3.5 text-green-600"}):r.jsx(ui,{className:"w-3.5 h-3.5"})})]})]}),r.jsx(Kl,{}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"2. Enter the 6-digit code from your app"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Your authenticator app will now show a rotating 6-digit code. Type it here to finish enabling two-factor authentication."}),r.jsx(He,{inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",value:p,onChange:A=>x(A.target.value.replace(/\D/g,"").slice(0,6)),className:"text-center text-lg tracking-[0.4em] font-mono"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{size:"sm",className:"flex-1",onClick:E,disabled:g||p.length!==6,children:g?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify & Enable"}),r.jsx(P,{size:"sm",variant:"ghost",onClick:R,disabled:g,children:"Cancel"})]})]})]}),r.jsx(cs,{open:w,onOpenChange:S,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Disable two-factor authentication?"}),r.jsx(Jn,{children:"Your account will only be protected by your password. Enter the current code from your authenticator app to confirm."})]}),r.jsx(He,{inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",value:j,onChange:A=>N(A.target.value.replace(/\D/g,"").slice(0,6)),className:"text-center text-lg tracking-[0.4em] font-mono"}),r.jsxs(Zn,{children:[r.jsx(ds,{onClick:()=>N(""),children:"Cancel"}),r.jsx(bs,{onClick:A=>{A.preventDefault(),T()},disabled:g||j.length!==6,children:g?"Disabling...":"Disable"})]})]})})]})},DJe=()=>{const{user:e}=nr(),{toast:t}=Gr(),[n,s]=h.useState(!0),[a,i]=h.useState(!1),[o,l]=h.useState("idle"),[c,d]=h.useState("enable"),[u,m]=h.useState(""),[f,p]=h.useState(!1),[x,g]=h.useState(!1),v=h.useCallback(async()=>
1204{if(!e)return;s(!0);const{data:w}=await F.from("email_mfa_settings").select("enabled").eq("user_id",e.id).maybeSingle();i(!!(w!=null&&w.enabled)),s(!1)},[e]);h.useEffect(()=>{v()},[v]);const y=async w=>{p(!0);try{const{data:S,error:j}=await F.functions.invoke("email-mfa-send",{body:{purpose:"enroll"}});if(j||S!=null&&S.error)throw new Error((S==null?void 0:S.error)||(j==null?void 0:j.message));d(w),m(""),l("code"),t({title:"Code sent",description:`We emailed a 6-digit code to ${e==null?void 0:e.email}.`})}catch(S){t({title:"Couldn't send the code",description:S.message||"Please try again in a moment.",variant:"destructive"})}finally{p(!1)}},b=async()=>{if(u.length===6){p(!0);try{const{data:w,error:S}=await F.functions.invoke("email-mfa-verify",{body:{code:u,action:c}});if(S||w!=null&&w.error){t({title:"Incorrect code",description:(w==null?void 0:w.error)||"Check your email and try again.",variant:"destructive"}),m("");return}t({title:c==="enable"?"Email verification turned on":"Email verification turned off",description:c==="enable"?"We'll email you a code each time you sign in with your password.":"Your account now only requires your password at sign-in."}),l("idle"),await v()}finally{p(!1)}}};return n?r.jsxs("div",{className:"flex items-center gap-2 py-2 text-sm text-muted-foreground",children:[r.jsx(Me,{className:"w-4 h-4 animate-spin"}),"Checking security settings..."]}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zr,{className:"w-4 h-4 text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Extra sign-in security"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"We email you a 6-digit code after your password. No app needed."})]})]}),r.jsx(Se,{variant:"outline",className:a?"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5":"text-[10px] px-1.5 py-0 h-4",children:a?"On":"Off"})]}),o==="idle"&&r.jsx(P,{variant:"outline",size:"sm",className:"w-full",disabled:f,onClick:()=>y(a?"disable":"enable"),children:f?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending code..."]}):a?"Turn off email verification":"Turn on email verification"}),o==="code"&&r.jsxs("div",{className:"space-y-3 p-4 rounded-lg bg-muted/50 border border-border",children:[r.jsx("p",{className:"text-sm font-medium",children:"Enter the code we emailed you"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent to ",e==null?void 0:e.email,". It expires in 10 minutes - check your spam folder if it hasn't arrived."]}),r.jsx(He,{inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",value:u,onChange:w=>m(w.target.value.replace(/\D/g,"").slice(0,6)),className:"text-center text-lg tracking-[0.4em] font-mono"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{size:"sm",className:"flex-1",disabled:f||u.length!==6,onClick:b,children:f?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):c==="enable"?"Confirm & turn on":"Confirm & turn off"}),r.jsx(P,{size:"sm",variant:"ghost",disabled:f,onClick:()=>l("idle"),children:"Cancel"})]})]}),r.jsxs(Wm,{open:x,onOpenChange:g,children:[r.jsx(Ff,{asChild:!0,children:r.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[r.jsx(rp,{className:"w-3.5 h-3.5"}),"Advanced: use an authenticator app instead",r.jsx(Qs,{className:`w-3.5 h-3.5 transition-transform ${x?"rotate-180":""}`})]})}),r.jsx(Ym,{className:"pt-3",children:r.jsx(PJe,{})})]})]})},MJe="BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U";function IJe(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),a=new Uint8Array(s.length);for(let i=0;i<s.length;++i)a[i]=s.charCodeAt(i);return a}function LJe(){const{user:e}=nr(),{toast:t}=Gr(),[n,s]=h.useState(!1),[a,i]=h.useState(!1),[o,l]=h.useState(!0),[c,d]=h.useState("default");h.useEffect(()=>
1204{const f="serviceWorker"in navigator&&"PushManager"in window;s(f),f&&d(Notification.permission)},[]),h.useEffect(()=>{(async()=>{if(!n||!e){l(!1);return}try{const x=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(x){const{data:g}=await F.from("push_subscriptions").select("id").eq("user_id",e.id).eq("endpoint",x.endpoint).single();i(!!g)}else i(!1)}catch(p){console.error("Error checking push subscription:",p),i(!1)}finally{l(!1)}})()},[n,e]);const u=h.useCallback(async()=>{var f,p;if(!n||!e)return t({title:"Not supported",description:"Push notifications are not supported in this browser.",variant:"destructive"}),!1;try{l(!0);const x=await Notification.requestPermission();if(d(x),x!=="granted")return t({title:"Permission denied",description:"Please enable notifications in your browser settings.",variant:"destructive"}),!1;const g=await navigator.serviceWorker.ready,v=IJe(MJe),y=await g.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:v.buffer}),b=y.toJSON();if(!((f=b.keys)!=null&&f.p256dh)||!((p=b.keys)!=null&&p.auth))throw new Error("Invalid subscription keys");const{error:w}=await F.from("push_subscriptions").upsert({user_id:e.id,endpoint:y.endpoint,p256dh:b.keys.p256dh,auth:b.keys.auth},{onConflict:"user_id,endpoint"});if(w)throw w;return i(!0),t({title:"Push notifications enabled",description:"You will receive browser notifications for video views."}),!0}catch(x){return console.error("Error subscribing to push notifications:",x),t({title:"Subscription failed",description:x.message||"Could not enable push notifications.",variant:"destructive"}),!1}finally{l(!1)}},[n,e,t]),m=h.useCallback(async()=>{if(!e)return!1;try{l(!0);const p=await(await navigator.serviceWorker.ready).pushManager.getSubscription();return p&&(await p.unsubscribe(),await F.from("push_subscriptions").delete().eq("user_id",e.id).eq("endpoint",p.endpoint)),i(!1),t({title:"Push notifications disabled",description:"You will no longer receive browser notifications."}),!0}catch(f){return console.error("Error unsubscribing from push notifications:",f),t({title:"Error",description:"Could not disable push notifications.",variant:"destructive"}),!1}finally{l(!1)}},[e,t]);return{isSupported:n,isSubscribed:a,isLoading:o,permission:c,subscribe:u,unsubscribe:m}}const $Je=()=>{const e=bJe(),{goBack:t,navigate:n}=pae("/videos");iu();const{user:s}=nr(),{isImpersonating:a,fetchImpersonatedData:i}=th(),{toast:o}=Gr(),{theme:l,setTheme:c}=Y4(),{isSupported:d,isSubscribed:u,isLoading:m,permission:f,subscribe:p,unsubscribe:x}=LJe(),{subscriptionTier:g,isPremium:v,subscriptionEnd:y,openCustomerPortal:b,createCheckout:w,isGiftedAccount:S}=Jl(),[j,N]=h.useState(!1),[_,C]=h.useState(!1),[k,E]=h.useState(""),[R,T]=h.useState(!1),[D,A]=h.useState(!1),[V,U]=h.useState("professional"),[O,M]=h.useState("annual"),[$,I]=h.useState(null),[B,K]=h.useState(2),[Z,q]=h.useState(!1),[H,X]=h.useState(()=>localStorage.getItem("analytics_enabled")!=="false"),G=h.useMemo(()=>_r(),[]),[ee,re]=h.useState(!0);h.useState(!1);const[W,Q]=h.useState({notify_email_view_start:!0,notify_push_enabled:!0,default_notify_on_reply:!0,notify_on_comment:!0,notify_personal_room_visit:!0,notify_inapp_video_view:!0,notify_inapp_video_reply:!0,notify_inapp_moderation:!0,notify_push_video_view:!0,notify_push_video_reply:!0,notify_push_moderation:!0}),[L,te]=h.useState(!1);h.useEffect(()=>{(async()=>
1204{if(s!=null&&s.id)try{if(a){const ue=await i("profile");ue&&Q({notify_email_view_start:ue.notify_email_view_start??!0,notify_push_enabled:ue.notify_push_enabled??!0,default_notify_on_reply:ue.default_notify_on_reply??!0,notify_on_comment:ue.notify_on_comment??!0,notify_personal_room_visit:ue.notify_personal_room_visit??!0,notify_inapp_video_view:ue.notify_inapp_video_view??!0,notify_inapp_video_reply:ue.notify_inapp_video_reply??!0,notify_inapp_moderation:ue.notify_inapp_moderation??!0,notify_push_video_view:ue.notify_push_video_view??!0,notify_push_video_reply:ue.notify_push_video_reply??!0,notify_push_moderation:ue.notify_push_moderation??!0}),re(!1);return}const{data:se}=await F.from("profiles").select("notify_email_view_start, notify_push_enabled, default_notify_on_reply, notify_on_comment, notify_personal_room_visit, notify_inapp_video_view, notify_inapp_video_reply, notify_inapp_moderation, notify_push_video_view, notify_push_video_reply, notify_push_moderation").eq("user_id",s.id).single();se&&Q({notify_email_view_start:se.notify_email_view_start??!0,notify_push_enabled:se.notify_push_enabled??!0,default_notify_on_reply:se.default_notify_on_reply??!0,notify_on_comment:se.notify_on_comment??!0,notify_personal_room_visit:se.notify_personal_room_visit??!0,notify_inapp_video_view:se.notify_inapp_video_view??!0,notify_inapp_video_reply:se.notify_inapp_video_reply??!0,notify_inapp_moderation:se.notify_inapp_moderation??!0,notify_push_video_view:se.notify_push_video_view??!0,notify_push_video_reply:se.notify_push_video_reply??!0,notify_push_moderation:se.notify_push_moderation??!0})}catch(se){console.error("Failed to fetch settings:",se)}finally{re(!1)}})()},[s==null?void 0:s.id,a]);const ae=async()=>{if(!s||a){a&&o({title:"View-only mode",description:"Cannot save changes while viewing as another user.",variant:"destructive"});return}te(!0);try{const{error:ne}=await F.from("profiles").update({notify_email_view_start:W.notify_email_view_start,notify_push_enabled:W.notify_push_enabled,default_notify_on_reply:W.default_notify_on_reply,notify_on_comment:W.notify_on_comment,notify_personal_room_visit:W.notify_personal_room_visit}).eq("user_id",s.id);if(ne)throw ne;o({title:"Settings saved",description:"Your notification preferences have been updated."})}catch(ne){o({title:"Error",description:ne.message||"Failed to save settings",variant:"destructive"})}finally{te(!1)}};return r.jsxs("div",{className:`min-h-screen bg-background ${a?"pt-12":""}`,children:[r.jsx(pn,{}),r.jsxs("div",{className:"px-4 sm:px-6 md:px-8 lg:px-8 pt-24 pb-24 space-y-4 sm:space-y-6 max-w-4xl mx-auto",children:[r.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground mb-2 sm:mb-4",children:"Settings"}),r.jsxs(Ie,{"data-tour":"settings-notifications",className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(zr,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Email Notifications"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-muted-foreground border-muted-foreground/30",children:"Manual save"})]}),r.jsx(xr,{className:"text-sm",children:"Get notified when viewers watch your shared videos"})]})]})}),r.jsx(lt,{className:"space-y-4",children:ee?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Me,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Wa,{className:"w-4 h-4 text-primary"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Reply notifications (default)"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable reply notifications on new videos by default"})]})]}),r.jsx(rr,{checked:W.default_notify_on_reply,onCheckedChange:ne=>Q(se=>({...se,default_notify_on_reply:ne}))})]}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Wa,{className:"w-4 h-4 text-amber-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Comment notifications"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"When someone comments on your shared video"})]})]}),r.jsx(rr,{checked:W.notify_on_comment,onCheckedChange:ne=>Q(se=>({...se,notify_on_comment:ne}))})]}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(HH,{className:"w-4 h-4 text-emerald-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Personal meeting room visits"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Notify me when someone enters my personal meeting room (emails you if you're offline)"})]})]}),r.jsx(rr,{checked:W.notify_personal_room_visit,onCheckedChange:ne=>Q(se=>({...se,notify_personal_room_visit:ne}))})]}),r.jsx(P,{onClick:ae,disabled:L,className:"w-full",children:L?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}),"Saving..."]}):"Save Notification Settings"})]})})]}),!G&&r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[r.jsxs(Ie,{"data-tour":"settings-inapp",className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(zl,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"In-App Notifications"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Auto-save"})]}),r.jsx(xr,{className:"text-sm",children:"Control which notifications appear in the bell"})]})]})}),r.jsxs(lt,{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-border",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"All notifications"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Master switch for all in-app alerts"})]}),r.jsx(rr,{checked:W.notify_push_enabled,onCheckedChange:ne=>{Q(se=>({...se,notify_push_enabled:ne})),s&&!a&&F.from("profiles").update({notify_push_enabled:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Notifications enabled":"All notifications disabled"})})}})]}),r.jsxs("div",{className:ge("space-y-2",!W.notify_push_enabled&&"opacity-50 pointer-events-none"),children:[r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(hT,{className:"w-4 h-4 text-green-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Video replies"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"When someone replies to your video"})]})]}),r.jsx(rr,{checked:W.notify_inapp_video_reply,onCheckedChange:ne=>{Q(se=>({...se,notify_inapp_video_reply:ne})),s&&!a&&F.from("profiles").update({notify_inapp_video_reply:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Reply notifications enabled":"Reply notifications disabled"})})}})]}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mb,{className:"w-4 h-4 text-amber-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Moderation alerts"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"When your video is flagged for review"})]})]}),r.jsx(rr,{checked:W.notify_inapp_moderation,onCheckedChange:ne=>{Q(se=>({...se,notify_inapp_moderation:ne})),s&&!a&&F.from("profiles").update({notify_inapp_moderation:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Moderation alerts enabled":"Moderation alerts disabled"})})}})]})]})]})]}),d&&r.jsxs(Ie,{"data-tour":"settings-push",className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(qc,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Browser Push Notifications"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Auto-save"})]}),r.jsx(xr,{className:"text-sm",children:"Get alerts even when the app isn't open"})]})]})}),r.jsxs(lt,{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-border",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Enable browser push"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:f==="denied"?"Blocked - enable in browser settings":"Master switch for browser notifications"}),f==="denied"&&r.jsxs("div",{className:"mt-2 space-y-2",children:[r.jsxs("details",{className:"group",children:[r.jsxs("summary",{className:"flex items-center gap-1 text-xs text-primary font-medium cursor-pointer list-none",children:[r.jsx(Qs,{className:"h-3 w-3 transition-transform group-open:rotate-180"}),"How to enable notifications"]}),r.jsxs("div",{className:"mt-2 ml-4 space-y-2",children:[r.jsx("p",{className:"text-xs text-foreground font-medium",children:(()=>{const ne=navigator.userAgent;return ne.includes("Chrome")&&!ne.includes("Edg")?"Chrome: Click the icon left of the URL → Site settings → Notifications → Allow":ne.includes("Firefox")?"Firefox: Click ☰ menu → Settings → Privacy & Security → Permissions → Notifications → Settings → Remove block":ne.includes("Safari")&&!ne.includes("Chrome")?"Safari: Safari menu → Settings → Websites → Notifications → Find this site → Allow":ne.includes("Edg")?"Edge: Click the icon left of the URL → Site permissions → Notifications → Allow":'Click the icon left of the URL in your address bar, find "Notifications", and change it to "Allow"'})()}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.jsx("strong",{children:"Alternative:"})," Go to your browser's Settings → Privacy/Site Settings → Notifications → find this site and allow it."]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.jsx("strong",{children:"On mobile:"})," Tap the ⋮ menu → Settings → Site settings → Notifications → find this site."]})]})]}),r.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>window.location.reload(),children:[r.jsx(vs,{className:"h-3 w-3 mr-1"}),"Refresh page"]})]})]}),r.jsx(rr,{checked:u,disabled:m||f==="denied",onCheckedChange:async ne=>{ne?await p():await x()}})]}),r.jsxs("div",{className:ge("space-y-2",(!u||f==="denied")&&"opacity-50 pointer-events-none"),children:[r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(wr,{className:"w-4 h-4 text-blue-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Video views"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Push when someone starts watching"})]})]}),r.jsx(rr,{checked:W.notify_push_video_view,onCheckedChange:ne=>{Q(se=>({...se,notify_push_video_view:ne})),s&&!a&&F.from("profiles").update({notify_push_video_view:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Video view push enabled":"Video view push disabled"})})}})]}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(hT,{className:"w-4 h-4 text-green-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Video replies"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Push when someone replies"})]})]}),r.jsx(rr,{checked:W.notify_push_video_reply,onCheckedChange:ne=>{Q(se=>({...se,notify_push_video_reply:ne})),s&&!a&&F.from("profiles").update({notify_push_video_reply:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Reply push enabled":"Reply push disabled"})})}})]}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Mb,{className:"w-4 h-4 text-amber-500"}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Moderation alerts"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Push when video is flagged"})]})]}),r.jsx(rr,{checked:W.notify_push_moderation,onCheckedChange:ne=>{Q(se=>({...se,notify_push_moderation:ne})),s&&!a&&F.from("profiles").update({notify_push_moderation:ne}).eq("user_id",s.id).then(({error:se})=>{se||o({title:ne?"Moderation push enabled":"Moderation push disabled"})})}})]})]})]})]})]}),G?r.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(kL,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Appearance"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Auto-save"})]}),r.jsx(xr,{className:"text-sm",children:"Customize the app look and feel"})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-sm text-foreground",children:"Light mode"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:l==="dark"?"Using dark theme":"Using light theme"})]}),r.jsx(rr,{checked:l!=="dark",onCheckedChange:ne=>{c(ne?"light":"dark"),o({title:ne?"Light mode enabled":"Dark mode enabled"})}})]})})]}),r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(mi,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Privacy"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Auto-save"})]}),r.jsx(xr,{className:"text-sm",children:"Control your privacy settings"})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-foreground",children:"Analytics"}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(ff,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),r.jsx(yt,{side:"top",className:"max-w-[250px]",children:r.jsx("p",{className:"text-xs",children:"When enabled, we collect anonymous usage data to help improve VIDAREO."})})]})})]}),r.jsx(rr,{checked:H,onCheckedChange:ne=>{X(ne),localStorage.setItem("analytics_enabled",String(ne)),o({title:ne?"Analytics enabled":"Analytics disabled"})}})]})})]})]}):r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[r.jsxs(Ie,{"data-tour":"settings-theme",className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(mi,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{classNa
1204me:"flex-1",children:[r.jsx($t,{className:"text-base",children:"Security & Session"}),r.jsx(xr,{className:"text-sm",children:"Session info and security settings"})]})]})}),r.jsxs(lt,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Current Session"}),r.jsxs("div",{className:"p-3 rounded-lg bg-muted/50 border border-border space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Browser"}),r.jsx("span",{className:"text-xs text-foreground",children:(()=>{const ne=navigator.userAgent;return ne.includes("Chrome")&&!ne.includes("Edg")?"Chrome":ne.includes("Firefox")?"Firefox":ne.includes("Safari")&&!ne.includes("Chrome")?"Safari":ne.includes("Edg")?"Edge":"Unknown"})()})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Device"}),r.jsx("span",{className:"text-xs text-foreground",children:/Mobi|Android/i.test(navigator.userAgent)?"Mobile":"Desktop"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Active"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Sessions automatically expire after 35 minutes of inactivity."})]}),r.jsx(Kl,{}),r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(kL,{className:"w-4 h-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-foreground",children:"Dark Mode"})]}),r.jsx(rr,{checked:l==="dark",onCheckedChange:ne=>{c(ne?"dark":"light"),o({title:ne?"Dark mode enabled":"Light mode enabled"})}})]}),r.jsx(Kl,{}),r.jsx(DJe,{})]})]}),r.jsxs(Ie,{"data-tour":"settings-privacy",className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(mi,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Privacy"}),r.jsx(Se,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 text-green-600 border-green-600/30 bg-green-500/5",children:"Auto-save"})]}),r.jsx(xr,{className:"text-sm",children:"Control your privacy settings"})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-foreground",children:"Analytics"}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(ff,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),r.jsx(yt,{side:"top",className:"max-w-[250px]",children:r.jsx("p",{className:"text-xs",children:"When enabled, we collect anonymous usage data (like which features you use) to help improve VIDAREO. No personal information or video content is ever collected."})})]})})]}),r.jsx(rr,{checked:H,onCheckedChange:ne=>{X(ne),localStorage.setItem("analytics_enabled",String(ne)),o({title:ne?"Analytics enabled":"Analytics disabled",description:ne?"We collect anonymous usage data to improve the app.":"No usage data will be collected."})}})]})})]})]}),r.jsxs("div",{className:"space-y-2 pt-4",children:[r.jsxs(P,{variant:"ghost",className:"w-full justify-start gap-3 h-12",onClick:()=>n("/contact"),children:[r.jsx(ff,{className:"h-5 w-5 text-muted-foreground"}),r.jsx("span",{children:"Help & Support"})]}),r.jsxs(P,{variant:"ghost",className:"w-full justify-start gap-3 h-12",onClick:()=>N(!0),children:[r.jsx(ql,{className:"h-5 w-5 text-muted-foreground"}),r.jsx("span",{children:"About VIDAREO"})]}),r.jsxs(cs,{open:_,onOpenChange:C,children:[r.jsx(Uf,{asChild:!0,children:r.jsxs(P,{variant:"ghost",className:"w-full justify-start gap-3 h-12 text-muted-foreground hover:text-destructive",disabled:a,children:[r.jsx(Xr,{className:"h-5 w-5"}),r.jsx("span",{children:"Delete Account"})]})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsxs(Qn,{className:"flex items-center gap-2",children:[r.jsx(wa,{className:"h-5 w-5 text-destructive"}),"Delete Your Account?"]}),r.jsxs(Jn,{className:"space-y-3",children:[r.jsxs("p",{children:["This action is ",r.jsx("strong",{children:"permanent and irreversible"}),". Deleting your account will:"]}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm",children:[r.jsx("li",{children:"Delete all your videos and recordings"}),r.jsx("li",{children:"Remove all your share links and analytics"}),r.jsx("li",{children:"Cancel any active subscriptions and add-ons"}),r.jsx("li",{children:"Remove you from any teams you belong to"})]}),v&&!S&&r.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 text-sm border border-border",children:[r.jsxs("p",{className:"font-medium text-foreground flex items-center gap-1.5 mb-1",children:[r.jsx(vi,{className:"w-3.5 h-3.5"})," Refund Information"]}),r.jsxs("p",{children:["Your active subscription will be cancelled and you'll receive a ",r.jsx("strong",{children:"pro-rated refund"})," for any unused time remaining in your billing period. Refunds are processed within 5–10 business days."]})]}),r.jsxs("p",{className:"pt-2",children:["Type ",r.jsx("strong",{children:"DELETE"})," to confirm:"]}),r.jsx(He,{type:"text",value:k,onChange:ne=>E(ne.target.value),placeholder:"Type DELETE"})]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{onClick:()=>E(""),children:"Cancel"}),r.jsx(P,{variant:"destructive",disabled:k!=="DELETE"||R,onClick:async()=>
1204{if(!(k!=="DELETE"||!s)){T(!0);try{const{data:ne,error:se}=await F.functions.invoke("delete-my-account");if(se||ne&&ne.error)throw new Error((se==null?void 0:se.message)||(ne==null?void 0:ne.error)||"Failed to delete account");try{localStorage.removeItem("vidareo_remember_email"),localStorage.removeItem("vidareo_remember_password"),localStorage.removeItem("vidareo_remember_me")}catch{}await F.auth.signOut(),o({title:"Account deleted",description:"Your account and all data have been permanently removed."}),C(!1),E(""),n("/")}catch(ne){o({title:"Error",description:ne.message||"Failed to delete account.",variant:"destructive"})}finally{T(!1)}}},children:R?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"h-4 w-4 animate-spin mr-2"}),"Deleting..."]}):"Delete Account"})]})]})]})]}),r.jsxs("p",{className:"text-center text-xs text-muted-foreground pt-4",children:["Version ",e.version]})]}),r.jsx(It,{open:D,onOpenChange:A,children:r.jsxs(Dt,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(cT,{className:"w-5 h-5 text-primary"}),"Upgrade Your Plan"]}),r.jsx($r,{children:"Choose your plan and optional add-ons"})]}),r.jsxs("div",{className:"space-y-6 py-4",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Select Plan"}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("button",{type:"button",onClick:()=>U("professional"),className:ge("p-4 rounded-lg border text-left transition-all",V==="professional"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),children:[r.jsx("div",{className:"font-medium text-foreground",children:"Professional"}),r.jsxs("div",{className:"text-sm text-muted-foreground",children:[O==="annual"?"$19.95":"$29.95","/mo"]})]}),r.jsxs("button",{type:"button",onClick:()=>U("team"),className:ge("p-4 rounded-lg border text-left transition-all",V==="team"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),children:[r.jsx("div",{className:"font-medium text-foreground",children:"Team"}),r.jsxs("div",{className:"text-sm text-muted-foreground",children:[O==="annual"?"$15":"$19","/user/mo"]})]})]})]}),V==="team"&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ye,{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4"}),"Team Members (min 2)"]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>K(Math.max(2,B-1)),disabled:B<=2,children:r.jsx(ag,{className:"w-4 h-4"})}),r.jsx("span",{className:"text-lg font-medium w-12 text-center",children:B}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>K(B+1),children:r.jsx(Ns,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Billing Period"}),r.jsxs(Z_,{type:"single",value:O,onValueChange:ne=>ne&&M(ne),className:"w-full",children:[r.jsx(If,{value:"monthly",className:"flex-1",children:"Monthly"}),r.jsxs(If,{value:"annual",className:"flex-1 gap-1.5",children:["Annual",r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Save more"})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Extended Video Length (Optional)"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Standard plans include 10-minute videos. Add extended length for longer recordings."}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("button",{type:"button",onClick:()=>I($==="extended_video_30"?null:"extended_video_30"),className:ge("w-full p-3 rounded-lg border text-left transition-all flex items-center justify-between",$==="extended_video_30"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(fr,{className:"w-4 h-4 text-primary"}),r.jsxs("div",{children:[r.jsx("div",{className:"font-medium text-sm text-foreground",children:"30-Minute Videos"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Extend from 10 to 30 minutes"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-medium text-foreground",children:"+$20/mo"}),$==="extended_video_30"&&r.jsx(nt,{className:"w-4 h-4 text-primary"})]})]}),r.jsxs("button",{type:"button",onClick:()=>I($==="extended_video_60"?null:"extended_video_60"),className:ge("w-full p-3 rounded-lg border text-left transition-all flex items-center justify-between",$==="extended_video_60"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(fr,{className:"w-4 h-4 text-primary"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"font-medium text-sm text-foreground",children:"60-Minute Videos"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Extend from 10 to 60 minutes"})]}),r.jsx(Se,{variant:"default",className:"text-xs bg-primary/20 text-primary border-0",children:"Best Value"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-medium text-foreground",children:"+$30/mo"}),$==="extended_video_60"&&r.jsx(nt,{className:"w-4 h-4 text-primary"})]})]})]})]}),r.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border space-y-2",children:[r.jsxs("div",{className:"flex justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:V==="professional"?"Professional":`Team (${B} users)`}),r.jsxs("span",{className:"text-foreground",children:["$",V==="professional"?O==="annual"?"19.95":"29.95":O==="annual"?15*B:19*B,"/mo"]})]}),$&&r.jsxs("div",{className:"flex justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:$==="extended_video_30"?"30-min videos":"60-min videos"}),r.jsxs("span",{className:"text-foreground",children:["+$",$==="extended_video_30"?"20":"30","/mo"]})]}),r.jsxs("div",{className:"border-t border-border pt-2 mt-2",children:[r.jsxs("div",{className:"flex justify-between font-medium",children:[r.jsx("span",{className:"text-foreground",children:"Total"}),r.jsxs("span",{className:"text-foreground",children:["$",(V==="professional"?O==="annual"?19.95:29.95:O==="annual"?15*B:19*B)+($==="extended_video_30"?20:$==="extended_video_60"?30:0),"/mo"]})]}),O==="annual"&&r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Billed annually"})]})]})]}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsx(P,{variant:"outline",onClick:()=>A(!1),children:"Cancel"}),r.jsx(P,{onClick:async()=>
1204{if(a){o({title:"View-only mode",description:"Cannot upgrade while viewing as another user.",variant:"destructive"});return}q(!0);try{await w(V,O,V==="team"?B:void 0,$?[$]:void 0),A(!1)}catch(ne){o({title:"Error",description:ne.message||"Failed to start checkout.",variant:"destructive"})}finally{q(!1)}},disabled:Z,className:"gap-2",children:Z?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 animate-spin"}),"Processing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(vi,{className:"w-4 h-4"}),"Continue to Checkout"]})})]})]})}),r.jsx(It,{open:j,onOpenChange:N,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-8 h-8 rounded border border-black/20 dark:border-white/20 overflow-hidden flex items-center justify-center bg-background",children:r.jsx("img",{src:ch,alt:"VIDAREO",className:"w-[130%] h-[130%] object-contain"})}),"About VIDAREO"]}),r.jsx($r,{children:"Video That Builds Lasting Connections"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"VIDAREO helps you build real relationships through personalized video messages. Connect with colleagues, clients, and prospects more authentically - record your screen or camera to create lasting connections."}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Version"}),r.jsx("span",{className:"text-foreground",children:e.version})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Build"}),r.jsx("span",{className:"text-foreground",children:new Date().getFullYear()})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[r.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>n("/terms"),children:[r.jsx(bn,{className:"w-4 h-4 mr-2"}),"Terms of Service"]}),r.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:()=>n("/privacy"),children:[r.jsx(bn,{className:"w-4 h-4 mr-2"}),"Privacy Policy"]})]})]})]})})]})};function VJe(e,t){return n2(r2({unit:"%",width:80},1,e,t),e,t)}const bP=({open:e,imageSrc:t,onClose:n,onCropComplete:s,isUploading:a,circularCrop:i=!0,freeform:o=!1,title:l="Crop Avatar"})=>{const[c,d]=h.useState(),u=h.useRef(null),m=h.useCallback(p=>{const{naturalWidth:x,naturalHeight:g}=p.currentTarget;d(o?{unit:"%",x:5,y:5,width:90,height:90}:VJe(x,g))},[o]),f=h.useCallback(async()=>{if(!u.current||!c)return;const p=u.current,x=document.createElement("canvas"),g=p.naturalWidth/p.width,v=p.naturalHeight/p.height;let y,b,w,S;c.unit==="%"?(y=c.x/100*p.naturalWidth,b=c.y/100*p.naturalHeight,w=c.width/100*p.naturalWidth,S=c.height/100*p.naturalHeight):(y=(c.x??0)*g,b=(c.y??0)*v,w=(c.width??0)*g,S=(c.height??0)*v);const j=512,N=Math.min(j/w,j/S,1);x.width=Math.round(w*N),x.height=Math.round(S*N);const _=x.getContext("2d");_&&(_.drawImage(p,y,b,w,S,0,0,x.width,x.height),x.toBlob(C=>{C&&s(C)},"image/png",1))},[c,s]);return r.jsx(It,{open:e,onOpenChange:p=>{!p&&!a&&n()},children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:l})}),r.jsx("div",{className:"flex items-center justify-center max-h-[60vh] overflow-auto",children:t&&r.jsx(s2,{crop:c,onChange:p=>d(p),aspect:o?void 0:1,circularCrop:i,children:r.jsx("img",{ref:u,src:t,alt:"Crop preview",crossOrigin:"anonymous",onLoad:m,className:"max-h-[55vh] w-auto"})})}),r.jsxs(Fr,{className:"gap-2 sm:gap-0",children:[r.jsx(P,{variant:"outline",onClick:n,disabled:a,children:"Cancel"}),r.jsx(P,{onClick:f,disabled:a||!c,children:a?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"h-4 w-4 mr-2 animate-spin"}),"Uploading..."]}):"Save"})]})]})})},UJe=()=>{const e=h.useMemo(()=>_r(),[]),t=Sr(),[n]=iu(),{toast:s}=Gr(),{user:a}=nr(),{isImpersonating:i,fetchImpersonatedData:o}=th(),{subscriptionTier:l,subscriptionEnd:c,subscribed:d,isLoading:u,createCheckout:m,openCustomerPortal:f,checkSubscription:p}
1204=Jl(),[x,g]=h.useState(null),[v,y]=h.useState(""),[b,w]=h.useState(!1),[S,j]=h.useState(!0),[N,_]=h.useState("bottom-right"),[C,k]=h.useState(.7),[E,R]=h.useState(20),[T,D]=h.useState(!0),[A,V]=h.useState(!1),[U,O]=h.useState(!1),[M,$]=h.useState(!1);h.useState("annual"),h.useState("annual"),h.useState(2);const I=h.useRef(null),B=h.useRef(null),[K,Z]=h.useState(""),[q,H]=h.useState(""),[X,G]=h.useState(""),[ee,re]=h.useState(!1),[W,Q]=h.useState(!1),[L,te]=h.useState(""),[ae,ne]=h.useState(""),[se,ue]=h.useState(null),[Ne,Qe]=h.useState(!1);h.useState("avatar");const[J,de]=h.useState(null),[ve,Le]=h.useState(!1),[$e,De]=h.useState(!0),[oe,xe]=h.useState(!0),[Ze,it]=h.useState(!0),[ct,Oe]=h.useState(!0),[pe,le]=h.useState(""),[ke,Ee]=h.useState(!1),[ot,gt]=h.useState(!1);h.useEffect(()=>{const be=n.get("subscription"),Ue=n.get("team_addon"),we=n.get("member"),pt=n.get("team");be==="success"?(s({title:"Subscription activated!",description:"Your subscription has been activated successfully."}),p(),window.history.replaceState({},"","/profile")):be==="cancelled"&&(s({title:"Subscription cancelled",description:"Your subscription checkout was cancelled.",variant:"destructive"}),window.history.replaceState({},"","/profile")),Ue==="success"&&we&&pt?(Nt(pt,we),window.history.replaceState({},"","/profile")):Ue==="cancelled"&&(s({title:"Add-on cancelled",description:"The extended video add-on checkout was cancelled.",variant:"destructive"}),window.history.replaceState({},"","/profile"))},[n,s,p]);const Nt=async(be,Ue)=>{try{const{data:{session:we}}=await F.auth.getSession();if(!(we!=null&&we.access_token))return;const{data:pt,error:mt}=await F.functions.invoke("activate-team-addon",{body:{teamId:be,memberUserId:Ue},headers:{Authorization:`Bearer ${we.access_token}`}});if(mt)throw mt;s({title:"Add-on activated!",description:"Extended video length has been enabled for the team member."})}catch(we){s({title:"Error",description:we.message||"Failed to activate add-on",variant:"destructive"})}};h.useEffect(()=>{a!=null&&a.id&&Ct()},[a==null?void 0:a.id,i]),h.useEffect(()=>{const be=()=>{document.visibilityState==="visible"&&(a!=null&&a.id)&&!i&&Ct()};return document.addEventListener("visibilitychange",be),()=>document.removeEventListener("visibilitychange",be)},[a==null?void 0:a.id,i]);const Ct=async()=>{if(!(a!=null&&a.id))return;if(i){const we=await o("profile");we&&(g(we),y(we.full_name||""),w(we.use_custom_watermark||!1),j(we.watermark_enabled??!0),_(we.watermark_position||"bottom-right"),k(we.watermark_opacity??.7),R(we.watermark_size??32),Z(we.job_title||""),H(we.business_name||""),G(we.phone||""),re(we.signature_enabled||!1),te(we.email_header_subtitle||""),ne(we.signature_custom_text||""),De(we.show_email_on_share??!0),xe(we.show_phone_on_share??!0),it(we.show_job_title_on_share??!0),Oe(we.show_business_name_on_share??!0)),D(!1);return}const{data:be,error:Ue}=await F.from("profiles").select("*").eq("user_id",a.id).maybeSingle();Ue?s({title:"Error",description:"Failed to load profile",variant:"destructive"}):be&&(g(be),y(be.full_name||""),w(be.use_custom_watermark||!1),j(be.watermark_enabled??!0),_(be.watermark_position||"bottom-right"),k(be.watermark_opacity??.7),R(be.watermark_size??32),Z(be.job_title||""),H(be.business_name||""),G(be.phone||""),re(be.signature_enabled||!1),te(be.email_header_subtitle||""),ne(be.signature_custom_text||""),De(be.show_email_on_share??!0),xe(be.show_phone_on_share??!0),it(be.show_job_title_on_share??!0),Oe(be.show_business_name_on_share??!0),le(be.personal_room_code||"")),D(!1)},dt=()=>{var be;if(i){s({title:"View-only mode",description:"Cannot change avatar while viewing as another user.",variant:"destructive"});return}(be=I.current)==null||be.click()},tt=async()=>{if(!a||!(x!=null&&x.avatar_url)||i){i&&s({title:"View-only mode",description:"Cannot flip avatar while viewing as another user.",variant:"destructive"});return}O(!0);try{const Ue=await(await fetch(x.avatar_url)).blob(),we=new Image;we.src=URL.createObjectURL(Ue),await new Promise(Ar=>{we.onload=Ar});const pt=document.createElement("canvas");
1204pt.width=we.width,pt.height=we.height;const mt=pt.getContext("2d");if(!mt)throw new Error("Could not get canvas context");mt.translate(pt.width,0),mt.scale(-1,1),mt.drawImage(we,0,0);const er=await new Promise((Ar,nn)=>{pt.toBlob(es=>{es?Ar(es):nn(new Error("Failed to create blob"))},"image/png")}),kt=`${a.id}/avatar.png`,{error:at}=await F.storage.from("avatars").upload(kt,er,{upsert:!0});if(at)throw at;const{data:Yt}=F.storage.from("avatars").getPublicUrl(kt),Ft=`${Yt.publicUrl}?t=${Date.now()}`,{error:or}=await F.from("profiles").update({avatar_url:Ft}).eq("user_id",a.id);if(or)throw or;g(Ar=>Ar?{...Ar,avatar_url:Ft}:null),s({title:"Avatar flipped",description:"Your profile picture has been flipped horizontally."}),URL.revokeObjectURL(we.src)}catch(be){s({title:"Flip failed",description:be.message||"Failed to flip avatar.",variant:"destructive"})}finally{O(!1)}},Re=async be=>{var pt;const Ue=(pt=be.target.files)==null?void 0:pt[0];if(!Ue||!a)return;if(!Ue.type.startsWith("image/")){s({title:"Invalid file type",description:"Please select an image file.",variant:"destructive"});return}if(Ue.size>5*1024*1024){s({title:"File too large",description:"Please select an image under 5MB.",variant:"destructive"});return}const we=new FileReader;we.onload=()=>{ue(we.result),Qe(!0)},we.readAsDataURL(Ue),I.current&&(I.current.value="")},Fe=async be=>{if(a){V(!0);try{const Ue=`${a.id}/avatar.png`,{error:we}=await F.storage.from("avatars").upload(Ue,be,{upsert:!0});if(we)throw we;const{data:pt}=F.storage.from("avatars").getPublicUrl(Ue),mt=`${pt.publicUrl}?t=${Date.now()}`,{error:er}=await F.from("profiles").update({avatar_url:mt}).eq("user_id",a.id);if(er)throw er;g(kt=>kt?{...kt,avatar_url:mt}:null),s({title:"Avatar updated",description:"Your profile picture has been updated."}),Qe(!1),ue(null)}catch(Ue){s({title:"Upload failed",description:Ue.message||"Failed to upload avatar.",variant:"destructive"})}finally{V(!1)}}},[Ae,Ve]=h.useState(!1),et=async()=>{if(!(!a||!(x!=null&&x.avatar_url))){if(i){s({title:"View-only mode",description:"Cannot delete avatar while viewing as another user.",variant:"destructive"});return}if(window.confirm("Remove your profile picture?")){Ve(!0);try{await F.storage.from("avatars").remove([`${a.id}/avatar.png`]);const{error:be}=await F.from("profiles").update({avatar_url:null}).eq("user_id",a.id);if(be)throw be;g(Ue=>Ue?{...Ue,avatar_url:null}:null),s({title:"Avatar removed",description:"Your profile picture has been deleted."})}catch(be){s({title:"Delete failed",description:be.message||"Failed to delete avatar.",variant:"destructive"})}finally{Ve(!1)}}}},Ge=()=>{!(x!=null&&x.avatar_url)||i||(ue(x.avatar_url),Qe(!0))},St=()=>{var be;(be=B.current)==null||be.click()},Tt=async be=>{var pt;const Ue=(pt=be.target.files)==null?void 0:pt[0];if(!Ue||!a)return;if(!Ue.type.startsWith("image/")){s({title:"Invalid file type",description:"Please select an image file.",variant:"destructive"});return}if(Ue.size>2*1024*1024){s({title:"File too large",description:"Please select an image under 2MB.",variant:"destructive"});return}const we=new FileReader;we.onload=()=>{de(we.result),Le(!0)},we.readAsDataURL(Ue),B.current&&(B.current.value="")},Zt=async be=>{if(a){$(!0);try{const Ue=`${a.id}/company-logo.png`,{error:we}=await F.storage.from("avatars").upload(Ue,be,{upsert:!0});if(we)throw we;const{data:pt}=F.storage.from("avatars").getPublicUrl(Ue),mt=`${pt.publicUrl}?t=${Date.now()}`,{error:er}=await F.from("profiles").update({company_logo_url:mt}).eq("user_id",a.id);if(er)throw er;g(kt=>kt?{...kt,company_logo_url:mt}:null),s({title:"Logo uploaded",description:"Your company logo has been updated."}),Le(!1),de(null)}catch(Ue){s({title:"Upload failed",description:Ue.message||"Failed to upload logo.",variant:"destructive"})}finally{$(!1)}}},bt=async()=>{if(!a||i){i&&s({title:"View-only mode",description:"Cannot delete logo while viewing as another user.",variant:"destructive"});return}try{const{error:be}=await F.from("profiles").update({company_logo_url:null,use_custom_watermark:!1}).eq("user_id",a.id);if(be)throw be;g(Ue=>Ue?{...Ue,company_logo_url:null}:null),w(!1),s({title:"Logo removed",description:"Your custom logo has been deleted."})}catch(be){s({title:"Delete failed",description:be.message||"Failed to delete logo.",variant:"destructive"})}},Wt=async(be,Ue)=>{if(!(!a||i))try{const{error:we}=await F.from("profiles").update(be).eq("user_id",a.id);if(we)throw we;s({title:"Changes saved",description:Ue?`${Ue} has been updated.`:"Your changes have been saved.",duration:2500})}catch{s({title:"Error saving changes",description:Ue?`Failed to save ${Ue.toLowerCase()}.`:"Failed to save changes. Please try again.",variant:"destructive"})}},Xe=(be,Ue)=>be?be.split(" ").map(we=>we[0]).join("").toUpperCase().slice(0,2):Ue?Ue[0].toUpperCase():"U";return T?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):r.jsxs("div",{className:`min-h-screen bg-background ${i?"pt-12":""}`,children:[r.jsx(pn,{}),r.jsxs("main",{className:"container mx-auto px-4 sm:px-6 lg:px-8 py-8 pt-24 pb-24 max-w-lg sm:max-w-2xl lg:max-w-3xl",children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground mb-6",children:"Profile"}),r.jsxs(fe.div,{initial:{opacity:0,y:20}
1204,animate:{opacity:1,y:0},transition:{duration:.3},className:"space-y-6",children:[r.jsxs("div",{"data-tour":"profile-avatar",className:"flex flex-col items-center",children:[r.jsxs("div",{className:"relative",children:[r.jsxs(an,{className:"h-24 w-24",children:[r.jsx(gn,{src:(x==null?void 0:x.avatar_url)||void 0,alt:"User avatar",className:"object-cover"}),r.jsx(on,{className:"text-2xl bg-primary text-primary-foreground",children:Xe((x==null?void 0:x.full_name)||null,(x==null?void 0:x.email)||null)})]}),r.jsx("button",{onClick:dt,disabled:A,className:"absolute bottom-0 right-0 p-2 bg-primary rounded-full text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50",children:A?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):r.jsx(ga,{className:"h-4 w-4"})}),(x==null?void 0:x.avatar_url)&&r.jsx("button",{onClick:tt,disabled:U,className:"absolute bottom-0 left-0 p-2 bg-secondary rounded-full text-secondary-foreground hover:bg-secondary/90 transition-colors disabled:opacity-50",title:"Flip horizontally",children:U?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):r.jsx(cue,{className:"h-4 w-4"})}),(x==null?void 0:x.avatar_url)&&r.jsx("button",{onClick:Ge,className:"absolute top-0 right-0 p-1.5 bg-muted rounded-full text-muted-foreground hover:bg-muted/90 transition-colors",title:"Crop avatar",children:r.jsx($m,{className:"h-3.5 w-3.5"})}),(x==null?void 0:x.avatar_url)&&r.jsx("button",{onClick:et,disabled:Ae,className:"absolute top-0 left-0 p-1.5 bg-destructive rounded-full text-destructive-foreground hover:bg-destructive/90 transition-colors disabled:opacity-50",title:"Remove avatar",children:Ae?r.jsx(Me,{className:"h-3.5 w-3.5 animate-spin"}):r.jsx(Xr,{className:"h-3.5 w-3.5"})}),r.jsx("input",{ref:I,type:"file",accept:"image/*",onChange:Re,className:"hidden"})]}),r.jsx("p",{className:"mt-3 text-muted-foreground text-sm",children:A?"Uploading...":U?"Flipping...":Ae?"Removing...":"Tap to change photo"})]}),r.jsx(bP,{open:Ne,imageSrc:se,onClose:()=>{Qe(!1),ue(null)},onCropComplete:Fe,isUploading:A}),r.jsx(bP,{open:ve,imageSrc:J,onClose:()=>{Le(!1),de(null)},onCropComplete:Zt,isUploading:M,circularCrop:!1,freeform:!0,title:"Crop Logo"}),r.jsxs(Ie,{"data-tour":"profile-info",children:[r.jsx(Ot,{children:r.jsx($t,{className:"text-lg",children:"Account Details"})}),r.jsx(lt,{className:"space-y-4",children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"fullName",children:"Full Name"}),r.jsxs("div",{className:"relative",children:[r.jsx(Cc,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{id:"fullName",type:"text",placeholder:"Enter your name",value:v,onChange:be=>y(be.target.value),onBlur:()=>Wt({full_name:v},"Full Name"),className:"pl-10"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Email"}),r.jsxs("div",{className:"relative",children:[r.jsx(zr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{id:"email",type:"email",value:(x==null?void 0:x.email)||(a==null?void 0:a.email)||"",disabled:!0,className:"pl-10 bg-muted"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Email cannot be changed"})]})]})})]}),!e&&r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{"data-tour":"profile-meeting-link",children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(Wl,{className:"h-5 w-5"}),"Personal Meeting Link"]}),r.jsx(xr,{children:"Set a custom, reusable meeting link like meet.vidareo.com/yourname"})]}),(x==null?void 0:x.subscription_tier)==="starter"&&r.jsxs(Se,{variant:"secondary",className:"flex items-center gap-1",children:[r.jsx(_n,{className:"h-3 w-3"}),"Pro"]})]})}),r.jsx(lt,{className:"space-y-3",children:(x==null?void 0:x.subscription_tier)==="starter"?r.jsxs("div",{className:"text-center py-4",children:[r.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3",children:r.jsx(_n,{className:"h-6 w-6 text-primary"})}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Upgrade to Professional or Team to get a personal meeting link"}),lr()?r.jsx("p",{className:"text-xs text-muted-foreground",children:"This feature is not available on your current plan."}):r.jsx(P,{variant:"outline",size:"sm",onClick:()=>t("/pricing"),children:"View Plans"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"personalRoomCode",children:"Custom code"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{id:"personalRoomCode",placeholder:"e.g. john or my-room",value:pe,onCh
1204ange:be=>le(be.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),className:"font-mono",maxLength:30}),r.jsx(P,{size:"sm",disabled:ke||pe.length<3,onClick:async()=>{if(!(!a||i)){Ee(!0);try{const be=pe.trim()||null;if(be&&(be.length<3||be.length>30)){s({title:"Invalid code",description:"Must be 3-30 characters.",variant:"destructive"});return}const{error:Ue}=await F.from("profiles").update({personal_room_code:be}).eq("user_id",a.id);if(Ue)if(Ue.message.includes("unique")||Ue.message.includes("duplicate"))s({title:"Code taken",description:"This code is already in use. Try another.",variant:"destructive"});else throw Ue;else s({title:"Saved!",description:"Your personal meeting link has been updated."})}catch(be){s({title:"Error",description:be.message,variant:"destructive"})}finally{Ee(!1)}}},children:ke?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):"Save"})]})]}),pe&&pe.length>=3&&r.jsxs("div",{className:"flex items-center gap-2 bg-muted/50 rounded-lg px-3 py-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Your link:"}),r.jsxs("span",{className:"text-sm font-mono text-foreground flex-1 truncate",children:["meet.vidareo.com/",pe]}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:async()=>{await navigator.clipboard.writeText(`https://meet.vidareo.com/${pe}`),gt(!0),s({title:"Link copied!"}),setTimeout(()=>gt(!1),2e3)},children:ot?r.jsx(nt,{className:"h-3.5 w-3.5"}):r.jsx(Wl,{className:"h-3.5 w-3.5"})})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Lowercase letters, numbers, and hyphens only. 3-30 characters."})]})})]}),r.jsxs(Ie,{"data-tour":"profile-branding",children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(Nx,{className:"h-5 w-5"}),"Company Branding"]}),r.jsx(xr,{children:"Upload your logo and customize email headers"})]}),(x==null?void 0:x.subscription_tier)==="starter"&&r.jsxs(Se,{variant:"secondary",className:"flex items-center gap-1",children:[r.jsx(_n,{className:"h-3 w-3"}),"Pro"]})]})}),r.jsx(lt,{className:"space-y-4",children:(x==null?void 0:x.subscription_tier)==="starter"?r.jsxs("div",{className:"text-center py-4",children:[r.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3",children:r.jsx(_n,{className:"h-6 w-6 text-primary"})}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Upgrade to Professional or Team to use custom branding"}),lr()?r.jsx("p",{className:"text-xs text-muted-foreground",children:"This feature is not available on your current plan."}):r.jsx(P,{variant:"outline",size:"sm",onClick:()=>t("/pricing"),children:"View Plans"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(ye,{children:"Company Logo"}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("div",{onClick:St,className:"w-16 h-16 sm:w-20 sm:h-20 rounded-lg border-2 border-dashed border-border hover:border-primary/50 transition-colors cursor-pointer flex items-center justify-center overflow-hidden bg-muted/50 flex-shrink-0",children:M?r.jsx(Me,{className:"h-5 w-5 sm:h-6 sm:w-6 animate-spin text-muted-foreground"}):x!=null&&x.company_logo_url?r.jsx("img",{src:x.company_logo_url,alt:"Company logo",className:"w-full h-full object-contain p-2"}):r.jsx(Nx,{className:"h-5 w-5 sm:h-6 sm:w-6 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(P,{variant:"outline",size:"sm",onClick:St,disabled:M,children:x!=null&&x.company_logo_url?"Change Logo":"Upload Logo"}),(x==null?void 0:x.company_logo_url)&&r.jsxs(r.Fragment,{children:[r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{!(x!=null&&x.company_logo_url)||i||(de(x.company_logo_url),Le(!0))},title:"Crop logo",children:r.jsx($m,{className:"h-4 w-4"})}),r.jsx(P,{variant:"ghost",size:"sm",onClick:bt,className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:r.jsx(Xr,{className:"h-4 w-4"})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG, JPG up to 2MB. Best at 200x50px"})]}),r.jsx("input",{ref:B,type:"file",accept:"image/*",onChange:Tt,className:"hidden"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(ye,{htmlFor:"emailHeaderSubtitle",children:["Email Header Tagline",r.jsx("span",{className:"text-muted-foreground ml-1 text-xs font-normal",children:"(optional)"})]}),r.jsxs("span",{className:`text-[10px] ${L.length>45?"text-amber-500":"text-muted-foreground"}`,children:[L.length,"/50"]})]}),r.jsx(He,{id:"emailHeaderSubtitle",type:"text",placeholder:"e.g. Your Trusted Partner in Sales",value:L,onChange:be=>te(be.target.value.slice(0,50)),onBlur:()=>Wt({email_header_subtitle:L||null}),maxLength:50}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:'Replaces "Record • Share • C
1204onnect" in email headers'})]})]})})]}),r.jsxs(Ie,{"data-tour":"profile-signature",children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(lue,{className:"h-5 w-5"}),"Email & Text Signature",l==="starter"&&r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Pro"})]}),r.jsx(xr,{children:"Include your signature when sharing videos"})]}),l!=="starter"&&(()=>{const be=K.trim()&&q.trim()&&X.trim(),Ue=!ee&&!be;return r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("span",{children:r.jsx(rr,{checked:ee,disabled:!ee&&!be,onCheckedChange:we=>{we&&!be||(re(we),Wt({signature_enabled:we}))}})})}),Ue&&r.jsx(yt,{side:"left",children:r.jsx("p",{children:"Complete all fields first"})})]})})})()]})}),r.jsx(lt,{className:"space-y-4",children:l==="starter"?r.jsxs("div",{className:"text-center py-4 space-y-3",children:[r.jsx("p",{className:"text-muted-foreground text-sm",children:"Add a professional signature to your video shares with a paid plan."}),lr()?r.jsx("p",{className:"text-xs text-muted-foreground",children:"This feature is not available on your current plan."}):r.jsx(P,{variant:"outline",size:"sm",onClick:()=>t("/pricing"),children:"Upgrade to Pro"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(ye,{htmlFor:"jobTitle",children:["Job Title",ee&&r.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r.jsxs("span",{className:`text-[10px] ${K.length>30?"text-amber-500":"text-muted-foreground"}`,children:[K.length,"/40"]})]}),r.jsxs("div",{className:"relative",children:[r.jsx(I4,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{id:"jobTitle",type:"text",placeholder:"e.g. Sales Manager",value:K,onChange:be=>Z(be.target.value.slice(0,40)),onBlur:()=>Wt({job_title:K||null}),className:`pl-10 ${ee&&!K.trim()?"border-destructive":""}`,maxLength:40,required:ee})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(ye,{htmlFor:"businessName",children:["Business/Company",ee&&r.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r.jsxs("span",{className:`text-[10px] ${q.length>40?"text-amber-500":"text-muted-foreground"}`,children:[q.length,"/50"]})]}),r.jsxs("div",{className:"relative",children:[r.jsx(Nx,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{id:"businessName",type:"text",placeholder:"e.g. Acme Inc.",value:q,onChange:be=>H(be.target.value.slice(0,50)),onBlur:()=>Wt({business_name:q||null}),className:`pl-10 ${ee&&!q.trim()?"border-destructive":""}`,maxLength:50,required:ee})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(ye,{htmlFor:"phone",children:["Phone Number",ee&&r.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),r.jsxs("span",{className:`text-[10px] ${X.length>12?"text-amber-500":"text-muted-foreground"}`,children:[X.length,"/14"]})]}),r.jsxs("div",{className:"relative",children:[r.jsx(U4,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{id:"phone",type:"tel",placeholder:"(555) 123-4567",value:X,onChange:be=>{const Ue=be.target.value.replace(/\D/g,"").slice(0,10);let we="";Ue.length>0&&(we="("+Ue.slice(0,3)),Ue.length>=3&&(we+=") "+Ue.slice(3,6)),Ue.length>=6&&(we+="-"+Ue.slice(6,10)),G(we)},onBlur:()=>Wt({phone:X||null}),className:`pl-10 ${ee&&!X.trim()?"border-destructive":""}`,maxLength:14,required:ee})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs(ye,{htmlFor:"signatureCustomText",children:["Custom Text ",r.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),r.jsxs("span",{className:`text-[10px] ${ae.length>50?"text-amber-500":"text-muted-foreground"}`,children:[ae.length,"/60"]}),r.jsx(He,{id:"signatureCustomText",type:"text",placeholder:"e.g. License #12345, DRE #01234567",value:ae,onChange:be=>ne(be.target.value.slice(0,60)),onBlur:()=>Wt({signature_custom_text:ae||null}),maxLength:60}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Add a license number, 
1204certification, or any custom info to your signature."})]})]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>Q(!W),className:"w-full sm:w-auto",children:[r.jsx(wr,{className:"h-4 w-4 mr-2"}),W?"Hide Previews":"Preview Signature"]}),W&&r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zr,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Email Preview"})]}),r.jsxs("div",{className:"rounded-xl overflow-hidden border border-border shadow-sm bg-[#f4f4f5]",children:[r.jsxs("div",{className:"px-4 py-3 text-center",style:{background:"linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%)"},children:[r.jsx("h3",{className:"text-white font-bold text-sm tracking-wide uppercase",children:q||"VIDAREO"}),r.jsx("p",{className:"text-white/90 text-[10px] mt-0.5",children:L||"Video That Builds Lasting Connections"})]}),r.jsxs("div",{className:"bg-white px-4 py-3",children:[r.jsx("p",{className:"text-[11px] text-zinc-700 mb-2",children:"Hi there,"}),r.jsx("p",{className:"text-[11px] text-zinc-600 mb-3",children:"I've recorded a personalized video for you. Click below to watch it!"}),(v||K||q||X)&&r.jsx("div",{className:"border-t border-border pt-2 mt-2 text-[10px]",children:r.jsxs("div",{className:"flex items-start gap-2",children:[(x==null?void 0:x.avatar_url)&&r.jsx("img",{src:x.avatar_url,alt:"Avatar",className:"w-8 h-8 rounded-full object-cover flex-shrink-0 mt-0.5"}),r.jsxs("div",{children:[v&&r.jsx("p",{className:"font-medium text-zinc-700",children:v}),K&&r.jsx("p",{className:"text-zinc-500",children:K}),q&&r.jsx("p",{className:"text-zinc-500 font-medium",children:q}),ae&&r.jsx("p",{className:"text-zinc-500 italic",children:ae}),(X||(x==null?void 0:x.email))&&r.jsx("p",{className:"text-zinc-500 mt-1",children:[X,x==null?void 0:x.email].filter(Boolean).join(" | ")})]})]})})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Wa,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Text Preview"})]}),r.jsxs("div",{className:"bg-zinc-100 rounded-2xl p-3 border border-border",children:[r.jsxs("div",{className:"bg-[#34C759] text-white rounded-2xl rounded-br-sm px-3 py-2 max-w-[90%] ml-auto",children:[r.jsx("p",{className:"text-xs",children:v?`Hi! ${v} from ${q||"VIDAREO"} sent you a video:`:"Check out this video I made for you:"}),r.jsx("p",{className:"text-white/80 text-xs break-all underline",children:"vidareo.app/v/abc123"}),(v||K||q||X)&&r.jsxs("div",{className:"border-t border-white/20 mt-2 pt-2 text-xs text-white/90",children:[v&&r.jsx("p",{className:"font-medium",children:v}),K&&q?r.jsxs("p",{children:[K,", ",q]}):r.jsxs(r.Fragment,{children:[K&&r.jsx("p",{children:K}),q&&r.jsx("p",{children:q})]}),ae&&r.jsx("p",{className:"italic",children:ae}),X&&r.jsx("p",{children:X}),(x==null?void 0:x.email)&&r.jsx("p",{children:x.email})]})]}),r.jsx("p",{className:"text-[10px] text-zinc-500 text-right mt-1 mr-1",children:"Delivered"})]})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Your signature replaces VIDAREO branding in emails and is appended to text messages when sharing videos."})]})})]}),r.jsxs(Ie,{"data-tour":"profile-contact-info",children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(k_,{className:"h-5 w-5"}),"Shared Video Contact Info"]}),r.jsx(xr,{children:"Choose which details viewers see on your shared video pages"})]}),r.jsxs(lt,{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Show email"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:(x==null?void 0:x.email)||"No email set"})]}),r.jsx(rr,{checked:$e,onCheckedChange:be=>{De(be),Wt({show_email_on_share:be})}})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Show phone"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:X||"No phone set"})]}),r.jsx(rr,{checked:oe,onCheckedChange:be=>{xe(be),Wt({show_phone_on_share:be})}})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Show job title"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:K||"No job title set"})]}),r.jsx(rr,{checked:Ze,onCheckedChange:be=>{it(be),Wt({show_job_title_on_share:be})}})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Show business name"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:q||"No business name set"})]}),r.jsx(rr,{checked:ct,onCheckedChange:be=>{Oe(be),Wt({show_business_name_on_share:be})}})]})]})]}),(x==null?void 0:x.subscription_tier)!=="starter"&&r.jsxs(Ie,{"data-tour":"profile-watermark",children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(cr,{className:"h-5 w-5"}),"Watermark Settings"]}),r.jsx(xr,{children:"Control watermark branding on your recorded videos"})]}),r.jsxs(lt,{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"watermarkEnabled",children:"Show VIDAREO watermark"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display VIDAREO branding on your videos"})]}),r.jsx(rr,{id:"watermarkEnabled",checked:S,onCheckedChange:be=>{j(be);const Ue={watermark_enabled:be};be&&b&&(w(!1),Ue.use_custom_watermark=!1),Wt(Ue)}})]}),(x==null?void 0:x.company_logo_url)&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"customWatermark",children:"Use custom watermark"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Show your logo instead of VIDAREO"})]}),r.jsx(rr,{id:"customWatermark",checked:b,onCheckedChange:be=>{w(be);const Ue={use_custom_watermark:be};be&&(j(!1),Ue.watermark_enabled=!1),Wt(Ue)}})]}),(S||b)&&r.jsxs("div",{className:"space-y-2 pt-2 border-t border-border",children:[r.jsxs(ye,{className:"flex items-center gap-2",children:[r.jsx(wr,{className:"h-4 w-4"}),"Preview"]}),r.jsxs("div",{className:"relative w-full aspect-video bg-muted rounded-lg overflow-hidden border border-border",children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(cr,{className:"h-12 w-12 text-muted-foreground
1204/30"})}),r.jsx("div",{className:`absolute pointer-events-none z-10 ${N==="top-left"?"top-3 left-3":N==="top-right"?"top-3 right-3":N==="bottom-left"?"bottom-3 left-3":"bottom-3 right-3"}`,children:r.jsx("img",{src:b&&(x!=null&&x.company_logo_url)?x.company_logo_url:ch,alt:b?"Company logo":"VIDAREO",style:{height:`${b?E:32}px`,opacity:b?C:.7,maxWidth:`${Math.max((b?E:32)*4,100)}px`},className:"w-auto object-contain"})})]}),r.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[b?"Your custom watermark":"VIDAREO watermark"," will appear on recorded videos"]})]})]})]})]}),l==="team"&&r.jsx(Ie,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>t("/team"),children:r.jsxs(Ot,{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(jr,{className:"h-5 w-5 text-amber-500"}),"Team Management"]}),r.jsx(aa,{className:"h-4 w-4 rotate-180 text-muted-foreground"})]}),r.jsx(xr,{children:"Manage team members, invitations, and analytics"})]})}),r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsx($t,{className:"text-lg",children:"Account Info"})}),r.jsx(lt,{children:r.jsxs("div",{className:"space-y-3 text-sm",children:[r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Member since"}),r.jsx("span",{className:"font-medium",children:x!=null&&x.created_at?new Date(x.created_at).toLocaleDateString():"N/A"})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-muted-foreground",children:"Account ID"}),r.jsxs("span",{className:"font-mono text-xs",children:[a==null?void 0:a.id.slice(0,8),"..."]})]})]})})]})]})]})]})},Gg=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/FxiOS|Firefox/.test(e)?!1:/Chrome|CriOS|Edg|OPR/.test(e)};var fn;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function s(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(fn||(fn={}));var rz;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rz||(rz={}));const qt=fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bu=e=>{switch(typeof e){case"undefined":return qt.undefined;case"string":return qt.string;case"number":return Number.isNaN(e)?qt.nan:qt.number;case"boolean":return qt.boolean;case"function":return qt.function;case"bigint":return qt.bigint;case"symbol":return qt.symbol;case"object":return Array.isArray(e)?qt.array:e===null?qt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?qt.promise:typeof Map<"u"&&e instanceof Map?qt.map:typeof Set<"u"&&e instanceof Set?qt.set:typeof Date<"u"&&e instanceof Date?qt.date:qt.object;default:return qt.unknown}}
vendor: 6,039 bytes, line 1204
1204,ft=fn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Fc extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},s={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)s._errors.push(n(o));else{let l=s,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return a(this),s}static assert(t){if(!(t instanceof Fc))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},s=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else s.push(t(a));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}Fc.create=e=>new Fc(e);const wP=(e,t)=>{let n;switch(e.code){case ft.invalid_type:e.received===qt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ft.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,fn.jsonStringifyReplacer)}`;break;case ft.unrecognized_keys:n=`Unrecognized key(s) in object: ${fn.joinValues(e.keys,", ")}`;break;case ft.invalid_union:n="Invalid input";break;case ft.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${fn.joinValues(e.options)}`;break;case ft.invalid_enum_value:n=`Invalid enum value. Expected ${fn.joinValues(e.options)}, received '${e.received}'`;break;case ft.invalid_arguments:n="Invalid function arguments";break;case ft.invalid_return_type:n="Invalid function return type";break;case ft.invalid_date:n="Invalid date";break;case ft.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:fn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ft.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ft.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ft.custom:n="Invalid input";break;case ft.invalid_intersection_types:n="Intersection results could not be merged";break;case ft.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ft.not_finite:n="Number must be finite";break;default:n=t.defaultError,fn.assertNever(e)}return{message:n}};let FJe=wP;function BJe(){return FJe}const zJe=e=>{const{data:t,path:n,errorMaps:s,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=s.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}};function At(e,t){const n=BJe(),s=zJe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===wP?void 0:wP].filter(a=>!!a)});e.common.issues.push(s)}class Mo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const s=[];for(const a of n){if(a.status==="aborted")return kr;a.status==="dirty"&&t.dirty(),s.push(a.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,n){const s=[];for(const a of n){const i=await a.key,o=await a.value;s.push({key:i,value:o})}return Mo.mergeObjectSync(t,s)}static mergeObjectSync(t,n){const s={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return kr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const kr=Object.freeze({status:"aborted"}),Iy=e=>({status:"dirty",value:e}),bl=e=>
vendor: 5,882 bytes, line 1204
1204({status:"valid",value:e}),nz=e=>e.status==="aborted",sz=e=>e.status==="dirty",Kg=e=>e.status==="valid",XS=e=>typeof Promise<"u"&&e instanceof Promise;var Kt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Kt||(Kt={}));class Gm{constructor(t,n,s,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const az=(e,t)=>{if(Kg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Fc(e.common.issues);return this._error=n,this._error}}};function qr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:s,description:a}=e;if(t&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??s??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:a}}class mn{get description(){return this._def.description}_getType(t){return Bu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Bu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mo,ctx:{common:t.parent.common,data:t.data,parsedType:Bu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(XS(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const s=this.safeParse(t,n);if(s.success)return s.data;throw s.error}safeParse(t,n){const s={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bu(t)},a=this._parseSync({data:t,path:s.path,parent:s});return az(s,a)}"~validate"(t){var s,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bu(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return Kg(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(s=i==null?void 0:i.message)==null?void 0:s.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>Kg(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const s=await this.safeParseAsync(t,n);if(s.success)return s.data;throw s.error}async safeParseAsync(t,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bu(t)},a=this._parse({data:t,path:s.path,parent:s}),i=await(XS(a)?a:Promise.resolve(a));return az(s,i)}refine(t,n){const s=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:ft.custom,...s(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((s,a)=>t(s)?!0:(a.addIssue(typeof n=="function"?n(s,a):n),!1))}_refinement(t){return new Zg({schema:this,typeName:Er.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Am.create(this,this._def)}nullable(){return Qg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dc.create(this)}promise(){return e_.create(this,this._def)}or(t){return QS.create([this,t],this._def)}and(t){return JS.create(this,t,this._def)}transform(t){return new Zg({...qr(this._def),schema:this,typeName:Er.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new SP({...qr(this._def),innerType:this,defaultValue:n,typeName:Er.ZodDefault})}brand(){return new het({typeName:Er.ZodBranded,type:this,...qr(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new _P({...qr(this._def),innerType:this,catchValue:n,typeName:Er.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return t3.create(this,t)}readonly(){return CP.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qJe=/^c[^\s-]{8,}
vendor: 4,296 bytes, line 1204
1204$/i,HJe=/^[0-9a-z]+$/,WJe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YJe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,GJe=/^[a-z0-9_-]{21}$/i,KJe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,XJe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ZJe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QJe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let KE;const JJe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eet=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tet=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ret=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,net=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,set=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Tae="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",aet=new RegExp(`^${Tae}$`);function Rae(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function iet(e){return new RegExp(`^${Rae(e)}$`)}function oet(e){let t=`${Tae}T${Rae(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function cet(e,t){return!!((t==="v4"||!t)&&JJe.test(e)||(t==="v6"||!t)&&tet.test(e))}function det(e,t){if(!KJe.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(s));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function uet(e,t){return!!((t==="v4"||!t)&&eet.test(e)||(t==="v6"||!t)&&ret.test(e))}class pm extends mn{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==qt.string){const i=this._getOrReturnCtx(t);return At(i,{code:ft.invalid_type,expected:qt.string,received:i.parsedType}),kr}const s=new Mo;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),At(a,{code:ft.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),At(a,{code:ft.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;
vendor: 6,397 bytes, line 1204
1204(o||l)&&(a=this._getOrReturnCtx(t,a),o?At(a,{code:ft.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&At(a,{code:ft.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")ZJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"email",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")KE||(KE=new RegExp(QJe,"u")),KE.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"emoji",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")YJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"uuid",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")GJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"nanoid",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")qJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"cuid",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")HJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"cuid2",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")WJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"ulid",code:ft.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),At(a,{validation:"url",code:ft.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"regex",code:ft.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?oet(i).test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?aet.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?iet(i).test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{code:ft.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?XJe.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"duration",code:ft.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?cet(t.data,i.version)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"ip",code:ft.invalid_string,message:i.message}),s.dirty()):i.kind==="jwt"?det(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"jwt",code:ft.invalid_string,message:i.message}),s.dirty()):i.kind==="cidr"?uet(t.data,i.version)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"cidr",code:ft.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?net.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"base64",code:ft.invalid_string,message:i.message}),s.dirty()):i.kind==="base64url"?set.test(t.data)||(a=this._getOrReturnCtx(t,a),At(a,{validation:"base64url",code:ft.invalid_string,message:i.message}),s.dirty()):fn.assertNever(i);return{status:s.value,value:t.data}}_regex(t,n,s){return this.refinement(a=>t.test(a),{validation:n,code:ft.invalid_string,...Kt.errToObj(s)})}_addCheck(t){return new pm({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Kt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Kt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Kt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Kt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Kt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Kt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Kt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Kt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Kt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Kt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Kt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Kt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Kt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Kt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Kt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Kt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Kt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Kt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Kt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Kt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Kt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Kt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Kt.errToObj(n)})}nonempty(t){return this.min(1,Kt.errToObj(t))}trim(){return new pm({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pm({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pm({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 4,672 bytes, line 1204
1204get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}pm.create=e=>new pm({checks:[],typeName:Er.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...qr(e)});function met(e,t){const n=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,a=n>s?n:s,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class B0 extends mn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==qt.number){const i=this._getOrReturnCtx(t);return At(i,{code:ft.invalid_type,expected:qt.number,received:i.parsedType}),kr}let s;const a=new Mo;for(const i of this._def.checks)i.kind==="int"?fn.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),At(s,{code:ft.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?met(t.data,i.value)!==0&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),At(s,{code:ft.not_finite,message:i.message}),a.dirty()):fn.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Kt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Kt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Kt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Kt.toString(n))}setLimit(t,n,s,a){return new B0({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:s,message:Kt.toString(a)}]})}_addCheck(t){return new B0({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Kt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Kt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Kt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&fn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(n)&&Number.isFinite(t)}
vendor: 8,035 bytes, line 1204
1204}B0.create=e=>new B0({checks:[],typeName:Er.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...qr(e)});class z0 extends mn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==qt.bigint)return this._getInvalidInput(t);let s;const a=new Mo;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),At(s,{code:ft.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):fn.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return At(n,{code:ft.invalid_type,expected:qt.bigint,received:n.parsedType}),kr}gte(t,n){return this.setLimit("min",t,!0,Kt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Kt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Kt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Kt.toString(n))}setLimit(t,n,s,a){return new z0({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:s,message:Kt.toString(a)}]})}_addCheck(t){return new z0({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Kt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}z0.create=e=>new z0({checks:[],typeName:Er.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...qr(e)});class iz extends mn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==qt.boolean){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.boolean,received:s.parsedType}),kr}return bl(t.data)}}iz.create=e=>new iz({typeName:Er.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...qr(e)});class ZS extends mn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==qt.date){const i=this._getOrReturnCtx(t);return At(i,{code:ft.invalid_type,expected:qt.date,received:i.parsedType}),kr}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return At(i,{code:ft.invalid_date}),kr}const s=new Mo;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),At(a,{code:ft.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),At(a,{code:ft.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):fn.assertNever(i);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZS({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Kt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Kt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ZS.create=e=>new ZS({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Er.ZodDate,...qr(e)});class oz extends mn{_parse(t){if(this._getType(t)!==qt.symbol){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.symbol,received:s.parsedType}),kr}return bl(t.data)}}oz.create=e=>new oz({typeName:Er.ZodSymbol,...qr(e)});class lz extends mn{_parse(t){if(this._getType(t)!==qt.undefined){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.undefined,received:s.parsedType}),kr}return bl(t.data)}}lz.create=e=>new lz({typeName:Er.ZodUndefined,...qr(e)});class cz extends mn{_parse(t){if(this._getType(t)!==qt.null){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.null,received:s.parsedType}),kr}return bl(t.data)}}cz.create=e=>new cz({typeName:Er.ZodNull,...qr(e)});class dz extends mn{constructor(){super(...arguments),this._any=!0}_parse(t){return bl(t.data)}}dz.create=e=>new dz({typeName:Er.ZodAny,...qr(e)});class uz extends mn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bl(t.data)}}uz.create=e=>new uz({typeName:Er.ZodUnknown,...qr(e)});class Km extends mn{_parse(t){const n=this._getOrReturnCtx(t);return At(n,{code:ft.invalid_type,expected:qt.never,received:n.parsedType}),kr}}Km.create=e=>new Km({typeName:Er.ZodNever,...qr(e)});class mz extends mn{_parse(t){if(this._getType(t)!==qt.undefined){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.void,received:s.parsedType}),kr}return bl(t.data)}}mz.create=e=>new mz({typeName:Er.ZodVoid,...qr(e)});class Dc extends mn{_parse(t){const{ctx:n,status:s}=this._processInputParams(t),a=this._def;if(n.parsedType!==qt.array)return At(n,{code:ft.invalid_type,expected:qt.array,received:n.parsedType}),kr;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,l=n.data.length<a.exactLength.value;(o||l)&&(At(n,{code:o?ft.too_big:ft.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(At(n,{code:ft.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(At(n,{code:ft.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>a.type._parseAsync(new Gm(n,o,n.path,l)))).then(o=>Mo.mergeArray(s,o));const i=[...n.data].map((o,l)=>a.type._parseSync(new Gm(n,o,n.path,l)));return Mo.mergeArray(s,i)}get element(){return this._def.type}min(t,n){return new Dc({...this._def,minLength:{value:t,message:Kt.toString(n)}})}max(t,n){return new Dc({...this._def,maxLength:{value:t,message:Kt.toString(n)}})}length(t,n){return new Dc({...this._def,exactLength:{value:t,message:Kt.toString(n)}})}nonempty(t){return this.min(1,t)}}Dc.create=(e,t)=>new Dc({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Er.ZodArray,...qr(t)});function zp(e){if(e instanceof Gs){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Am.create(zp(s))}return new Gs({...e._def,shape:()=>t})}else return e instanceof Dc?new Dc({...e._def,type:zp(e.element)}):e instanceof Am?Am.create(zp(e.unwrap())):e instanceof Qg?Qg.create(zp(e.unwrap())):e instanceof Xf?Xf.create(e.items.map(t=>zp(t))):e}class Gs extends mn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=fn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==qt.object){const d=this._getOrReturnCtx(t);return At(d,{code:ft.invalid_type,expected:qt.object,received:d.parsedType}),kr}const{status:s,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];
vendor: 4,643 bytes, line 1204
1204if(!(this._def.catchall instanceof Km&&this._def.unknownKeys==="strip"))for(const d in a.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const u=i[d],m=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Gm(a,m,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof Km){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of l)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(d==="strict")l.length>0&&(At(a,{code:ft.unrecognized_keys,keys:l}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of l){const m=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Gm(a,m,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const m=await u.key,f=await u.value;d.push({key:m,value:f,alwaysSet:u.alwaysSet})}return d}).then(d=>Mo.mergeObjectSync(s,d)):Mo.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(t){return Kt.errToObj,new Gs({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,s)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:Kt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Gs({...this._def,unknownKeys:"strip"})}passthrough(){return new Gs({...this._def,unknownKeys:"passthrough"})}extend(t){return new Gs({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Gs({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Er.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Gs({...this._def,catchall:t})}pick(t){const n={};for(const s of fn.objectKeys(t))t[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new Gs({...this._def,shape:()=>n})}omit(t){const n={};for(const s of fn.objectKeys(this.shape))t[s]||(n[s]=this.shape[s]);return new Gs({...this._def,shape:()=>n})}deepPartial(){return zp(this)}partial(t){const n={};for(const s of fn.objectKeys(this.shape)){const a=this.shape[s];t&&!t[s]?n[s]=a:n[s]=a.optional()}return new Gs({...this._def,shape:()=>n})}required(t){const n={};for(const s of fn.objectKeys(this.shape))if(t&&!t[s])n[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof Am;)i=i._def.innerType;n[s]=i}return new Gs({...this._def,shape:()=>n})}keyof(){return Oae(fn.objectKeys(this.shape))}}Gs.create=(e,t)=>new Gs({shape:()=>e,unknownKeys:"strip",catchall:Km.create(),typeName:Er.ZodObject,...qr(t)});Gs.strictCreate=(e,t)=>new Gs({shape:()=>e,unknownKeys:"strict",catchall:Km.create(),typeName:Er.ZodObject,...qr(t)});Gs.lazycreate=(e,t)=>new Gs({shape:e,unknownKeys:"strip",catchall:Km.create(),typeName:Er.ZodObject,...qr(t)});class QS extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),s=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Fc(l.ctx.common.issues));return At(n,{code:ft.invalid_union,unionErrors:o}),kr}if(n.common.async)return Promise.all(s.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of s){const d={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Fc(c));return At(n,{code:ft.invalid_union,unionErrors:l}),kr}}get options(){return this._def.options}}QS.create=(e,t)=>new QS({options:e,typeName:Er.ZodUnion,...qr(t)});function jP(e,t){const n=Bu(e),s=Bu(t);if(e===t)return{valid:!0,data:e};if(n===qt.object&&s===qt.object){const a=fn.objectKeys(t),i=fn.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=jP(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===qt.array&&s===qt.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=jP(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===qt.date&&s===qt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class JS extends mn{_parse(t){const{status:n,ctx:s}=this._processInputParams(t),a=(i,o)=>
vendor: 4,181 bytes, line 1204
1204{if(nz(i)||nz(o))return kr;const l=jP(i.value,o.value);return l.valid?((sz(i)||sz(o))&&n.dirty(),{status:n.value,value:l.data}):(At(s,{code:ft.invalid_intersection_types}),kr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}JS.create=(e,t,n)=>new JS({left:e,right:t,typeName:Er.ZodIntersection,...qr(n)});class Xf extends mn{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==qt.array)return At(s,{code:ft.invalid_type,expected:qt.array,received:s.parsedType}),kr;if(s.data.length<this._def.items.length)return At(s,{code:ft.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),kr;!this._def.rest&&s.data.length>this._def.items.length&&(At(s,{code:ft.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...s.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Gm(s,o,s.path,l)):null}).filter(o=>!!o);return s.common.async?Promise.all(i).then(o=>Mo.mergeArray(n,o)):Mo.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Xf({...this._def,rest:t})}}Xf.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xf({items:e,typeName:Er.ZodTuple,rest:null,...qr(t)})};class hz extends mn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==qt.map)return At(s,{code:ft.invalid_type,expected:qt.map,received:s.parsedType}),kr;const a=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([l,c],d)=>({key:a._parse(new Gm(s,l,s.path,[d,"key"])),value:i._parse(new Gm(s,c,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return kr;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return kr;(d.status==="dirty"||u.status==="dirty")&&n.dirty(),l.set(d.value,u.value)}return{status:n.value,value:l}}}}hz.create=(e,t,n)=>new hz({valueType:t,keyType:e,typeName:Er.ZodMap,...qr(n)});class q0 extends mn{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.parsedType!==qt.set)return At(s,{code:ft.invalid_type,expected:qt.set,received:s.parsedType}),kr;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(At(s,{code:ft.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(At(s,{code:ft.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const d=new Set;for(const u of c){if(u.status==="aborted")return kr;u.status==="dirty"&&n.dirty(),d.add(u.value)}return{status:n.value,value:d}}const l=[...s.data.values()].map((c,d)=>i._parse(new Gm(s,c,s.path,d)));return s.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new q0({...this._def,minSize:{value:t,message:Kt.toString(n)}})}max(t,n){return new q0({...this._def,maxSize:{value:t,message:Kt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}q0.create=(e,t)=>new q0({valueType:e,minSize:null,maxSize:null,typeName:Er.ZodSet,...qr(t)});class fz extends mn{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}fz.create=(e,t)=>new fz({getter:e,typeName:Er.ZodLazy,...qr(t)});class NP extends mn{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return At(n,{received:n.data,code:ft.invalid_literal,expected:this._def.value}),kr}
vendor: 4,162 bytes, line 1204
1204return{status:"valid",value:t.data}}get value(){return this._def.value}}NP.create=(e,t)=>new NP({value:e,typeName:Er.ZodLiteral,...qr(t)});function Oae(e,t){return new Xg({values:e,typeName:Er.ZodEnum,...qr(t)})}class Xg extends mn{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),s=this._def.values;return At(n,{expected:fn.joinValues(s),received:n.parsedType,code:ft.invalid_type}),kr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),s=this._def.values;return At(n,{received:n.data,code:ft.invalid_enum_value,options:s}),kr}return bl(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Xg.create(t,{...this._def,...n})}exclude(t,n=this._def){return Xg.create(this.options.filter(s=>!t.includes(s)),{...this._def,...n})}}Xg.create=Oae;class pz extends mn{_parse(t){const n=fn.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==qt.string&&s.parsedType!==qt.number){const a=fn.objectValues(n);return At(s,{expected:fn.joinValues(a),received:s.parsedType,code:ft.invalid_type}),kr}if(this._cache||(this._cache=new Set(fn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=fn.objectValues(n);return At(s,{received:s.data,code:ft.invalid_enum_value,options:a}),kr}return bl(t.data)}get enum(){return this._def.values}}pz.create=(e,t)=>new pz({values:e,typeName:Er.ZodNativeEnum,...qr(t)});class e_ extends mn{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==qt.promise&&n.common.async===!1)return At(n,{code:ft.invalid_type,expected:qt.promise,received:n.parsedType}),kr;const s=n.parsedType===qt.promise?n.data:Promise.resolve(n.data);return bl(s.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}e_.create=(e,t)=>new e_({type:e,typeName:Er.ZodPromise,...qr(t)});class Zg extends mn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Er.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:s}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{At(s,o),o.fatal?n.abort():n.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return kr;const c=await this._def.schema._parseAsync({data:l,path:s.path,parent:s});return c.status==="aborted"?kr:c.status==="dirty"||n.value==="dirty"?Iy(c.value):c});{if(n.value==="aborted")return kr;const l=this._def.schema._parseSync({data:o,path:s.path,parent:s});return l.status==="aborted"?kr:l.status==="dirty"||n.value==="dirty"?Iy(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?kr:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>l.status==="aborted"?kr:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Kg(o))return kr;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Kg(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:n.value,value:l})):kr);fn.assertNever(a)}}
1204Zg.create=(e,t,n)=>new Zg({schema:e,typeName:Er.ZodEffects,effect:t,...qr(n)});Zg.createWithPreprocess=(e,t,n)=>new Zg({schema:t,effect:{type:"preprocess",transform:e},typeName:Er.ZodEffects,...qr(n)});class Am extends mn{_parse(t){return this._getType(t)===qt.undefined?bl(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Am.create=(e,t)=>new Am({innerType:e,typeName:Er.ZodOptional,...qr(t)});class Qg extends mn{_parse(t){return this._getType(t)===qt.null?bl(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Qg.create=(e,t)=>new Qg({innerType:e,typeName:Er.ZodNullable,...qr(t)});class SP extends mn{_parse(t){const{ctx:n}=this._processInputParams(t);let s=n.data;return n.parsedType===qt.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}SP.create=(e,t)=>new SP({innerType:e,typeName:Er.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...qr(t)});class _P extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),s={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return XS(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fc(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Fc(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}_P.create=(e,t)=>new _P({innerType:e,typeName:Er.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...qr(t)});class xz extends mn{_parse(t){if(this._getType(t)!==qt.nan){const s=this._getOrReturnCtx(t);return At(s,{code:ft.invalid_type,expected:qt.nan,received:s.parsedType}),kr}return{status:"valid",value:t.data}}}xz.create=e=>new xz({typeName:Er.ZodNaN,...qr(e)});class het extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class t3 extends mn{_parse(t){const{status:n,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?kr:i.status==="dirty"?(n.dirty(),Iy(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?kr:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(t,n){return new t3({in:t,out:n,typeName:Er.ZodPipeline})}}class CP extends mn{_parse(t){const n=this._def.innerType._parse(t),s=a=>(Kg(a)&&(a.value=Object.freeze(a.value)),a);return XS(n)?n.then(a=>s(a)):s(n)}unwrap(){return this._def.innerType}}CP.create=(e,t)=>new CP({innerType:e,typeName:Er.ZodReadonly,...qr(t)});Gs.lazycreate;var Er;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Er||(Er={}));const Bl=pm.create;Km.create;Dc.create;const Pae=Gs.create;Gs.strictCreate;QS.create;JS.create;Xf.create;const fet=NP.create;Xg.create;e_.create;Am.create;Qg.create;const r3=e=>[{label:"8 characters",met:e.length>=8},{label:"1 upper case character",met:/[A-Z]/.test(e)},{label:"1 lower case character",met:/[a-z]/.test(e)},{label:"1 special character",met:/[!@#$%^&*(),.?":{}|<>_\-+=\[\]\\\/`~;']/.test(e)},{label:"1 number",met:/\d/.test(e)}],Dae=e=>r3(e).every(n=>n.met),Mae=({requirements:e})=>r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground text-sm mb-2",children:"Password requirements"}),e.map((t,n)=>r.jsxs("div",{className:"flex items-center gap-2",children:[t.met?r.jsx(nt,{className:"h-3.5 w-3.5 text-green-500"}):r.jsx(zt,{className:"h-3.5 w-3.5 text-destructive"}),r.jsx("span",{className:`text-sm ${t.met?"text-muted-foreground":"text-foreground"}`,children:t.label})]},n))]}),pet=({password:e,children:t})=>{const n=r3(e);return r.jsxs(A1,{openDelay:0,closeDelay:100,children:[r.jsx(T1,{asChild:!0,children:t}),r.jsx(lb,{side:"top",align:"start",className:"w-auto p-3 bg-popover border border-border shadow-lg",children:r.jsx(Mae,{requirements:n})})]})},Iae=({password:e})=>{const t=r3(e);return r.jsx("div",{className:"p-3 rounded-lg bg-muted/50 border border-border",children:r.jsx(Mae,{requirements:t})})},xet=({open:e,onOpenChange:t})=>r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-3xl max-h-[85vh] p-0",children:[r.jsxs(Lt,{className:"p-6 pb-0",children:[r.jsx(Mt,{className:"text-2xl font-bold",children:"Terms of Use"}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsx("span",{children:"Version 3.3"}),r.jsx("span",{className:"text-border",children:"•"}),r.jsx("span",{children:"Last updated: August 18, 2026"})]})]}),r.jsx(Io,{className:"h-[60vh] px-6 pb-6",children:r.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none space-y-6",children:[r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"1. Introduction"}),r.jsx("p",{className:"text-muted-foreground",children:"Welcome to VIDAREO - the personalized video messaging platform for direct inbox delivery and relationship building. By using our platform, you agree to these Terms of Use and our Content Policy. These terms govern your access to and use of VIDAREO's services, including our website, applications, screen recording, video replies, and any related features."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"2. Acceptance of Terms"}),r.jsx("p",{className:"text-muted-foreground",children:"By creating an account or using VIDAREO, you confirm that you are at least 18 years old (or the age of majority in your jurisdiction) and agree to be bound by these Terms. If you do not agree, you may 
1204not use our services."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"2a. Eligibility"}),r.jsx("p",{className:"text-muted-foreground",children:"You must be at least eighteen (18) years of age and have the legal capacity to enter into a binding agreement to create a VIDAREO account or use the Services. By creating an account or using VIDAREO, you represent and warrant that you are at least 18 years of age and legally authorized to enter into and comply with these Terms."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"3. Our Services"}),r.jsx("p",{className:"text-muted-foreground mb-3",children:"VIDAREO provides the following services for personalized video messaging and relationship building:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Screen + Camera Recording:"})," Record your screen with camera overlay for demos, tutorials, and presentations"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Chrome Extension:"})," Record from any tab with floating controls and picture-in-picture camera"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Presentation Mode:"})," Upload slide decks and record over them with your camera"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Direct Inbox Delivery:"})," Send videos directly to recipient inboxes via secure, shareable links"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Calls:"})," Peer-to-peer calls with up to 4 participants - no downloads required"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Replies & Reactions:"})," Two-way communication with video/text replies and emoji reactions"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"AI Script & Teleprompter:"})," Generate scripts with AI and use auto-scrolling teleprompter"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Real-Time Analytics:"})," Track views, watch duration, completion rates, and engagement"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Contact Management:"})," Import and organize contacts for targeted video outreach"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team Management:"})," Invite team members, manage roles, and access unified team analytics"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Custom Branding:"})," Add custom watermarks with your company logo and email signatures"]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"4. User Responsibilities"}),r.jsx("p",{className:"text-muted-foreground",children:"You are responsible for:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsx("li",{children:"Maintaining the confidentiality of your account credentials"}),r.jsx("li",{children:"Creating a strong password (8+ characters with uppercase, lowercase, numbers, and special characters)"}),r.jsx("li",{children:"All activities that occur under your account"}),r.jsx("li",{children:"Ensuring your content complies with our Content Policy"}),r.jsx("li",{children:"Using the platform only for lawful purposes"}),r.jsx("li",{children:"Obtaining necessary permissions before recording others"}),r.jsx("li",{children:"Respecting the privacy of individuals appearing in your videos"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"5. Recording Features & Permissions"}),r.jsx("p",{className:"text-muted-foreground mb-3",children:"When using our recording features, you grant VIDAREO access to:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Camera Access:"})," Required for camera recording, screen + camera overlay, presentation mode, and video calls"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Microphone Access:"})," Required for audio capture in all recording modes and video calls"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Screen Capture:"})," Required for screen recording and Chrome extension recording"]})]}),r.jsx("p",{className:"text-muted-foreground mt-3 text-sm",children:"You are responsible for ensuring you have the right to re
1204cord any content, including obtaining consent from individuals who appear in your videos and respecting copyright for any materials shown on screen."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"6. Account Security"}),r.jsx("p",{className:"text-muted-foreground",children:"Your account is protected by mandatory email verification, breached-password screening, rate limiting (5 failed login attempts triggers a 15-minute lockout and security alert email), and automatic session timeout after 35 minutes of inactivity with a 30-minute warning."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"7. Subscriptions & Billing"}),r.jsx("p",{className:"text-muted-foreground",children:"Some features require a paid subscription. Subscription terms include:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsx("li",{children:"Subscriptions renew automatically unless cancelled"}),r.jsx("li",{children:"Monthly usage limits (recordings and sends) reset each billing cycle"}),r.jsx("li",{children:"Annual billing is available with a 20% discount"}),r.jsx("li",{children:"Add-ons (extended video length) can be purchased 
1204separately"}),r.jsx("li",{children:"Promo codes may be applied at checkout for eligible discounts"}),r.jsx("li",{children:"Manage subscriptions via the Stripe Customer Portal in your Profile settings"}),r.jsx("li",{children:"Refunds are handled according to our refund policy"}),r.jsx("li",{children:"Downgrading may result in loss of premium features and enforce Free tier limits"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"8. Termination"}),r.jsx("p",{className:"text-muted-foreground",children:"We may terminate or suspend your account for violations of these Terms or our Content Policy. You may delete your account at any time. Upon termination, your videos and data will be removed according to our data retention policy."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"9. Limitation of Liability"}),r.jsx("p",{className:"text-muted-foreground",children:'VIDAREO is provided "as is" without warranties. We are not liable for any indirect, incidental, or consequential damages arising from your use of our services, including loss of data or business interruption.'})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"10. Changes to Terms"}),r.jsx("p",{className:"text-muted-foreground",children:"We may update these Terms from time to time. We will notify you of significant changes via email or platform notification. Your continued use of VIDAREO after changes constitutes acceptance of the updated Terms."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"11. Contact"}),r.jsx("p",{className:"text-muted-foreground",children:"For questions about these Terms, contact us at [email protected]."})]})]})})]})}),get=({open:e,onOpenChange:t})=>r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-3xl max-h-[85vh] p-0",children:[r.jsxs(Lt,{className:"p-6 pb-0",children:[r.jsx(Mt,{className:"text-2xl font-bold",children:"Content Policy"}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsx("span",{children:"Version 2.1"}),r.jsx("span",{className:"text-border",children:"•"}),r.jsx("span",{children:"Last updated: January 27, 2026"})]})]}),r.jsx(Io,{className:"h-[60vh] px-6 pb-6",children:r.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none space-y-6",children:[r.jsx("section",{children:r.jsx("p",{className:"text-muted-foreground",children:"VIDAREO uses automated AI moderation to review all uploaded content. The following types of content are strictly prohibited and will result in immediate removal and potential account termination:"})}),r.jsxs("section",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Hate Speech"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Content promoting hatred, discrimination, or violence against individuals or groups based on race, ethnicity, national origin, religion, gender, gender identity, sexual orientation, disability, or other protected characteristics."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Violence & Threats"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Graphic violence, threats of violence, incitement to violence, or content that glorifies violent acts. This includes depictions of serious physical harm, weapons used to harm, or content intended to intimidate."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Sexual Content"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Explicit sexual content, nudity, pornography, or content intended to be sexually gratifying. This includes sexually suggestive content involving minors."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Spam & Deceptive Practices"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Unsolicited commercial content, misleading information, fake engagement, phishing attempts, or content designed to deceive viewers for personal gain."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Dangerous Acts"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Content promoting dangerous activities, illegal drug use, self-harm, or challenges that could result in physical injury. This includes instructions for creating weapons or explosives."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Child Endangerment"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Any content that exploits, endangers, or sexualizes minors. This is a zero-tolerance policy and will be reported to appropriate authorities."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Harassment & Bullying"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Targeted harassment, cyberbullying, doxxing, or content intended to intimidate, shame, or degrade specific individuals. This includes persistent unwanted contact."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4 py-2",children:[r.jsx("h3",{className:"font-semibold text-foreground text-base",children:"Misinformation"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Deliberately false or misleading information that could cause real-world harm, including medical misinformation, election interference, or dangerous conspiracy theories."})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Moderation & Enforcement"}),r.jsx("p",{className:"text-muted-foreground",children:"All uploaded content is automatically reviewed by our AI moderation system. Content that violates our policies may be:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm mt-2",children:[r.jsx("li",{children:"Automatically removed from the platform"}),r.jsx("li",{children:"Flagged for human review"}),r.jsx("li",{children:"Result in account warnings or suspension"}),r.jsx("li",{children:"Lead to permanent account termination for severe or repeated violations"})]}),r.jsx("p",{className:"text-muted-foreground mt-3 text-sm",children:"Users may appeal content removal decisions by contacting our support team at [email protected]."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Video Quality & Limits"}),r.jsx("p",{className:"text-muted-foreground mb-3",children:"To ensure optimal platform performance and fair usage, the following limits apply:"}),r.jsx("h3",{className:"text-base font-medium text-foreground mt-3",children:"Technical Limits"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Maximum file size:"})," 1 GB per video"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Maximum resolution:"})," 1080p (1920x1080)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Supported formats:"})," MP4, WebM, MOV"]})]}),r.jsx("h3",{className:"text-base font-medium text-foreground mt-3",children:"Plan-Based Limits"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Free Starter:"}
1204)," 2 minutes per video, 5 recordings per month, 5 video sends per month, 720p quality"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Professional:"})," 10 minutes per video (extendable to 30 or 60 min with add-ons), unlimited recordings and sends, 1080p quality"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team:"})," Same as Professional with team collaboration features"]})]})]})]})})]})}),vet="/assets/auth-hero-DiSbgNvz.png",px=()=>r.jsxs("div",{className:"hidden lg:flex w-1/2 relative overflow-hidden",children:[r.jsx("img",{src:vet,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[hsl(215_50%_20%/0.85)] via-[hsl(200_90%_40%/0.7)] to-[hsl(195_95%_50%/0.6)]"}),r.jsx("div",{className:"relative z-10 flex flex-col justify-between p-10 w-full",children:r.jsxs("div",{className:"mt-auto",children:[r.jsx("blockquote",{className:"text-white/90 text-lg italic leading-relaxed",children:'"VIDAREO has completely transformed how our sales team connects with prospects. Response rates have doubled since we started using video messages."'}),r.jsxs("div",{className:"mt-4",children:[r.jsx("p",{className:"text-white font-semibold text-sm",children:"Sarah Mitchell"}),r.jsx("p",{className:"text-white/60 text-sm",children:"VP of Sales, TechCorp"})]})]})})]}),yet=({factorId:e,onSuccess:t,onCancel:n})=>{const[s,a]=h.useState(""),[i,o]=h.useState(!1),{toast:l}=Gr(),c=async d=>{if(d.preventDefault(),s.trim().length!==6){l({title:"Invalid code",description:"Enter the 6-digit code from your authenticator app.",variant:"destructive"});return}o(!0);try{const{data:u,error:m}=await F.auth.mfa.challenge({factorId:e});if(m)throw m;const{error:f}=await F.auth.mfa.verify({factorId:e,challengeId:u.id,code:s.trim()});if(f){l({title:"Verification failed",description:"That code is incorrect or expired. Try again with the current code in your app.",variant:"destructive"}),a("");return}t()}catch(u){l({title:"Verification failed",description:u.message||"Unable to verify your code. Please try again.",variant:"destructive"})}finally{o(!1)}};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(rp,{className:"w-6 h-6 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Two-factor authentication"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the 6-digit code from your authenticator app to finish signing in."})]}),r.jsxs("form",{onSubmit:c,className:"space-y-4",children:[r.jsx(He,{inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",value:s,onChange:d=>a(d.target.value.replace(/\D/g,"").slice(0,6)),className:"text-center text-2xl tracking-[0.5em] font-mono",autoFocus:!0}),r.jsx(P,{type:"submit",className:"w-full",disabled:i||s.length!==6,children:i?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify & Sign In"})]}),r.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto",children:[r.jsx(aa,{className:"w-4 h-4"}),"Back to sign in"]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Lost access to your authenticator app? Contact support to recover your account."})]})},bet=({email:e,onSuccess:t,onCancel:n})=>{const[s,a]=h.useState(""),[i,o]=h.useState(!1),[l,c]=h.useState(!0),[d,u]=h.useState(30),{toast:m}=Gr(),f=h.useRef(!1),p=async()=>{c(!0);try{const{data:g,error:v}=await F.functions.invoke("email-mfa-send",{body:{purpose:"login"}});if(v||g!=null&&g.error)throw new Error((g==null?void 0:g.error)||(v==null?void 0:v.message));u(30)}catch(g){m({title:"Couldn't send the code",description:g.message||"Please try again in a moment.",variant:"destructive"})}finally{c(!1)}};h.useEffect(()=>{f.current||(f.current=!0,p())},[]),h.useEffect(()=>{if(d<=0)return;const g=setTimeout(()=>u(v=>v-1),1e3);return()=>clearTimeout(g)},[d]);const x=async g=>{if(g.preventDefault(),s.length===6){o(!0);try{const{data:v,error:y}=await F.functions.invoke("email-mfa-verify",{body:{code:s,action:"login"}});if(y||v!=null&&v.error){m({title:"Verification failed",description:(v==null?void 0:v.error)||"That code is incorrect or expired.",variant:"destructive"}),a("");return}t()}catch(v){m({title:"Verification failed",description:v.message||"Please try again.",variant:"destructive"})}finally{o(!1)}}};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(zr,{className:"w-6 h-6 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Check your email"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a 6-digit code to ",e?r.jsx("strong",{children:e}):"your email address",". Enter it below to finish signing in."]})]}),r.jsxs("form",{onSubmit:x,className:"space-y-4",children:[r.jsx(He,{inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",value:s,onChange:g=>a(g.target.value.replace(/\D/g,"").slice(0,6)),className:"text-center text-2xl tracking-[0.5em] font-mono",autoF
1204ocus:!0}),r.jsx(P,{type:"submit",className:"w-full",disabled:i||s.length!==6,children:i?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify & Sign In"})]}),r.jsx("div",{className:"text-center",children:r.jsx(P,{type:"button",variant:"ghost",size:"sm",disabled:l||d>0,onClick:p,children:l?"Sending code...":d>0?`Resend code in ${d}s`:"Send a new code"})}),r.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto",children:[r.jsx(aa,{className:"w-4 h-4"}),"Back to sign in"]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"The code expires in 10 minutes. Can't find it? Check your spam folder."})]})},gz=Bl().email("Please enter a valid email address"),vz=new Set;Bl().min(8,"Password must be at least 8 characters").regex(/[A-Z]/,"Password must contain at least 1 uppercase letter").regex(/[a-z]/,"Password must contain at least 1 lowercase letter").regex(/\d/,"Password must contain at least 1 number").regex(/[!@#$%^&*(),.?":{}|<>_\-+=\[\]\\\/`~;']/,"Password must contain at least 1 special character");const dd=[{id:"free",name:"Free",description:"For getting started",monthlyPrice:0,icon:r.jsx(_n,{className:"h-6 w-6"}),features:["5 video recordings per month","2 minute max per video","5 video link shares & emails per month","Screen + camera recording with overlay","AI script generation & teleprompter","Folders & organization","Basic analytics","720p video quality","VIDAREO watermark"]},{id:"professional",name:"Professional",description:"For power users who need more",monthlyPrice:29.95,annualMonthlyPrice:19.95,icon:r.jsx(ya,{className:"h-6 w-6"}),features:["Unlimited video recordings","10 minute max per video","Unlimited video link shares & emails","Upload & share existing videos","Presentation mode (PDF & PowerPoint)","Video calls (up to 4 people)","Advanced analytics & insights","AI transcription","Custom branding (no watermark)","1080p video quality","Contact management & bulk email","Priority support"],recommended:!0},{id:"team",name:"Team",description:"For sales teams & organizations",monthlyPrice:19,annualMonthlyPrice:15,perUser:!0,minUsers:2,icon:r.jsx(Ms,{className:"h-6 w-6"}),features:["Everything in Professional","Minimum 2 users","Team workspace & management","Admin controls","Team analytics","Priority support"]}],wet=()=>{var Ze,it,ct,Oe;const[e]=iu(),t=e.get("mode")==="signup"?"signup":"login",n=e.get("redirect")||"",s=n.startsWith("/invite/"),[a,i]=h.useState(t),[o,l]=h.useState(()=>e.get("step")==="details"||n.startsWith("/invite/")?"details":"plan");h.useEffect(()=>{document.title=a==="signup"?"Sign Up Free | VIDAREO - Start Sending Video Messages":"Sign In | VIDAREO - Video Messaging Platform";const pe=document.querySelector('meta[name="description"]');return pe&&pe.setAttribute("content",a==="signup"?"Create your free VIDAREO account. Record personalized video messages, share instantly, and track views. No credit card required to get started.":"Sign in to your VIDAREO account to record, share, and track personalized video messages. Access your video library, analytics, and contacts."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams"}},[a]),h.useEffect(()=>{o==="details"&&window.scrollTo({top:0,behavior:"instant"})},[o]);const[c,d]=h.useState(()=>lr()?localStorage.getItem("signup_selected_plan")||"free":localStorage.getItem("signup_selected_plan")||"professional"),[u,m]=h.useState(()=>{const pe=localStorage.getItem("signup_team_member_count");return pe?parseInt(pe,10):2}),[f,p]=h.useState(()=>localStorage.getItem("signup_addon_type")||null),[x,g]=h.useState(()=>{const pe=localStorage.getItem("signup_billing_period");return pe?pe==="annual":!0}),[v,y]=h.useState(()=>!!localStorage.getItem("vidareo_remembered_email")),[b,w]=h.useState(()=>localStorage.getItem("vidareo_remembered_email")||""),[S,j]=h.useState(""),[N,_]=h.useState(""),[C,k]=h.useState(!1),[E,R]=h.useState(!1),[T,D]=h.useState(!1),[A,V]=h.useState(null),[U,O]=h.useState({}),[M,$]=h.useState(!1),[I,B]=h.useState(!1),[K,Z]=h.useState(!1),[q,H]=h.useState(null),[X,G]=h.useState(0),[ee,re]=h.useState(null),[W,Q]=h.useState(!1),L=async()=>{var pe;try{const{data:le,error:ke}=await F.auth.mfa.getAuthenticatorAssuranceLevel();if(ke||!le)return null;if(le.currentLevel==="aal1"&&le.nextLevel==="aal2"){const{data:Ee}=await F.auth.mfa.listFactors(),ot=(pe=Ee==null?void 0:Ee.totp)==null?void 0:pe.find(gt=>gt.status==="verified");return(ot==null?void 0:ot.id)??null}return null}catch{return null}},te=async pe=>
1204{try{if(sessionStorage.getItem(`vidareo_email_mfa_ok_${pe}`)==="true")return!1;const{data:le}=await F.from("email_mfa_settings").select("enabled").eq("user_id",pe).maybeSingle();return!!(le!=null&&le.enabled)}catch{return!1}},ae=pe=>pe.monthlyPrice===0?"Free":x&&pe.annualMonthlyPrice?`$${pe.annualMonthlyPrice}`:`$${pe.monthlyPrice}`,ne=pe=>pe.monthlyPrice===0?"":`/${pe.perUser?"user/":""}mo`,se=Sr(),{toast:ue}=Gr(),{user:Ne,signIn:Qe,signUp:J}=nr();h.useEffect(()=>{if(!q)return;const pe=setInterval(()=>{const le=Math.max(0,Math.ceil((q.getTime()-Date.now())/1e3));G(le),le<=0&&(H(null),clearInterval(pe))},1e3);return()=>clearInterval(pe)},[q]),h.useEffect(()=>{!Ne&&ee&&re(null),!Ne&&W&&Q(!1)},[Ne,ee,W]),h.useEffect(()=>{(async()=>{const le=new URLSearchParams(window.location.hash.substring(1)),ke=le.get("access_token"),Ee=le.get("refresh_token"),ot=le.get("type");if(ke&&Ee&&(ot==="signup"||ot==="magiclink")){const{error:Nt,data:Ct}=await F.auth.setSession({access_token:ke,refresh_token:Ee});ue(Nt?{title:"Verification failed",description:Nt.message,variant:"destructive"}:{title:"Email verified!",description:"Your account has been verified successfully. Welcome to VIDAREO!"}),window.history.replaceState(null,"",window.location.pathname)}e.get("verified")==="true"&&ue({title:"Email verified!",description:"Your account has been verified. Please sign in to continue."})})()},[se,ue,e]);const de=h.useRef(!1);h.useEffect(()=>{(async()=>{var le;if(Ne){if(ee)return;{const Ee=await L();if(Ee){re(Ee);return}}if(W)return;if(await te(Ne.id)){Q(!0);return}if(!vz.has(Ne.id)&&!de.current)try{de.current=!0,vz.add(Ne.id);const{data:Ee}=await F.from("profiles").select("welcome_email_sent, full_name, email").eq("user_id",Ne.id).maybeSingle();if(Ee&&!Ee.welcome_email_sent){const{data:ot}=await F.from("profiles").update({welcome_email_sent:!0}).eq("user_id",Ne.id).eq("welcome_email_sent",!1).select("user_id").maybeSingle();ot&&await F.functions.invoke("send-welcome-email",{body:{email:Ee.email||Ne.email,fullName:Ee.full_name||((le=Ne.user_metadata)==null?void 0:le.full_name)||""}})}}catch(Ee){console.warn("Failed to send welcome email:",Ee)}const{data:ke}=await F.from("user_roles").select("role").eq("user_id",Ne.id).eq("role","admin").maybeSingle();if(ke)se("/admin");else{const Ee=e.get("redirect");if(!Ee)try{const{data:Nt}=await F.from("team_invitations").select("id, team_id, email, status").eq("email",Ne.email||"").eq("status","pending");if(Nt&&Nt.length>0){for(const Ct of Nt){const{data:dt}=await F.from("team_members").select("id").eq("team_id",Ct.team_id).eq("user_id",Ne.id).maybeSingle();dt||await F.from("team_members").insert({team_id:Ct.team_id,user_id:Ne.id,role:"member"}),await F.from("team_invitations").update({status:"accepted"}).eq("id",Ct.id)}ue({title:"Welcome to the team!",description:"Your team invitation has been automatically accepted."})}}catch(Nt){console.warn("Failed to auto-accept team invitation:",Nt)}const{isNativeApp:ot}=await Si(async()=>{const{isNativeApp:Nt}=await Promise.resolve().then(()=>ope);return{isNativeApp:Nt}},void 0),gt=ot()?"/videos":"/dashboard";se(Ee||gt)}}})()},[Ne,se,ee,W]);const ve=()=>{const pe={},le=gz.safeParse(b);return le.success||(pe.email=le.error.errors[0].message),a!=="forgot"&&(a==="signup"?Dae(S)||(pe.password="Password does not meet all requirements"):S||(pe.password="Password is required")),a==="signup"&&!N.trim()&&(pe.fullName="Please enter your name"),a==="signup"&&!T&&(pe.terms="You must agree to the Terms of Use and Content Policy"),O(pe),Object.keys(pe).length===0},Le=async()=>{const pe=gz.safeParse(b);if(!pe.success){O({email:pe.error.errors[0].message});return}R(!0);try{await F.functions.invoke("send-password-reset",{body:{email:b}}),ue({title:"Check your email",description:"We sent you a password reset link."}),i("login")}catch{ue({title:"Error",description:"Unable to send reset email. Please try again.",variant:"destructive"})}R(!1)},$e=async()=>{R(!0);const{error:pe}=await F.auth.resend({type:"signup",email:b,options:{emailRedirectTo:`${window.location.origin}/`}});ue(pe?{title:"Error",description:pe.message,variant:"destructive"}:{title:"Email sent",description:"Verification email has been resent."}),R(!1)},De=async pe=>{var le,ke;if(pe.preventDefault(),a==="forgot"){await Le();return}if(ve()){R(!0);try{if(a==="login"){try{const{data:ot}=await F.functions.invoke("check-login-rate-limit",{body:{email:b}});if(ot&&!ot.allowed){const gt=new Date(ot.lockedUntil);H(gt);const Nt=Math.max(0,Math.ceil((gt.getTime()-Date.now())/1e3));G(Nt),ue({title:"Account temporarily locked",description:`Too many login attempts. Try again in ${Math.ceil(Nt/60)} minutes.`,variant:"destructive"}),R(!1);return}}catch(ot){console.warn("Rate limit check failed:",ot)}const{error:Ee}=await Qe(b,S);if(Ee)Ee.message.includes("Invalid login credentials")?ue({title:"Login failed",description:"Invalid email or password. Please try again.",variant:"destructive"}):Ee.message.includes("Email not confirmed")?(ue({title:"Email not verified",de
1204scription:"Please check your email and verify your account.",variant:"destructive"}),i("verify")):ue({title:"Login failed",description:Ee.message,variant:"destructive"});else{v?localStorage.setItem("vidareo_remembered_email",b):localStorage.removeItem("vidareo_remembered_email"),localStorage.removeItem("vidareo_remembered_password");const ot=await L(),{data:gt}=await F.auth.getSession(),Nt=(ke=(le=gt==null?void 0:gt.session)==null?void 0:le.user)==null?void 0:ke.id;ot?re(ot):Nt&&await te(Nt)?Q(!0):ue({title:"Welcome back!",description:"You have successfully logged in."})}}else{$(!1);const{error:Ee,user:ot}=await J(b,S,N);Ee?Ee.message.includes("User already registered")||Ee.message.includes("email_exists")||Ee.message.includes("already been registered")?$(!0):ue({title:"Sign up failed",description:Ee.message,variant:"destructive"}):(ot!=null&&ot.id&&(await F.from("content_policy_agreements").insert({user_id:ot.id,policy_version:"1.0"}).then(({error:gt})=>{gt&&console.warn("Failed to record policy agreement:",gt)}),f&&(c==="professional"||c==="team")?localStorage.setItem("signup_addon_type",f):localStorage.removeItem("signup_addon_type"),c==="team"?localStorage.setItem("signup_team_member_count",u.toString()):localStorage.removeItem("signup_team_member_count"),lr()&&c==="professional"?(localStorage.setItem("signup_iap_pending",x?"pro_annual":"pro_monthly"),f==="extended_video_30"?localStorage.setItem("signup_iap_addon","addon_extended_video_30"):f==="extended_video_60"?localStorage.setItem("signup_iap_addon","addon_extended_video_60"):localStorage.removeItem("signup_iap_addon")):(localStorage.removeItem("signup_iap_pending"),localStorage.removeItem("signup_iap_addon"))),i("verify"))}}catch{ue({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{R(!1)}}},oe=()=>{switch(a){case"login":return"Welcome Back";case"signup":return o==="plan"?"Choose Your Plan":"Create Account";case"forgot":return"Reset Password";case"verify":return"Confirm Your Account"}},xe=()=>{switch(a){case"login":return"Sign in to access your videos";case"signup":return s?"Create your account to join the team":o==="plan"?"Select the plan that works best for you":"Complete your account details";case"forgot":return"Enter your email to reset your password";case"verify":return`We sent a confirmation link to ${b}`}};return a==="verify"?r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col",children:[r.jsx("header",{className:"p-4",children:r.jsx("a",{href:"/",className:"inline-block",children:r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-10 w-auto"})})}),r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsxs(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.5},className:"w-full max-w-md text-center lg:text-left",children:[r.jsx("div",{className:"flex justify-center lg:justify-start mb-6",children:r.jsx("a",{href:"/",className:"inline-block",children:r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-10 w-auto"})})}),r.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:oe()}),r.jsx("p",{className:"text-muted-foreground mb-2",children:xe()}),r.jsxs("p",{className:"text-sm font-medium mb-4 lg:hidden",children:[r.jsx("span",{className:"text-destructive",children:"Record."}),r.jsx("span",{className:"text-muted-foreground/50 mx-1",children:"•"}),r.jsx("span",{className:"text-primary",children:"Share."}),r.jsx("span",{className:"text-muted-foreground/50 mx-1",children:"•"}),r.jsx("span",{className:"text-green-500",children:"Connect."})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Click the link in your email to confirm your account and start using VIDAREO."}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(P,{onClick:$e,variant:"outline",className:"w-full",disabled:E,children:E?"Sending...":"Resend verification email"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Already verified?",r.jsx("button",{type:"button",onClick:()=>i("login"),className:"ml-2 text-primary font-semibold hover:underline",children:"Sign In"})]}),Gg()&&r.jsx("div",{className:"mt-6 rounded-xl border border-primary/20 bg-primary/5 p-4 text-left",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(Vs,{className:"w-4 h-4 text-primary"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-sm text-foreground",children:"While you wait - install the Chrome Extension"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Record your screen + camera from any tab. Ready the moment you log in."}),r.jsxs("ul",{className:"mt-2 space-y-1 text-[11px] text-muted-foreground",children:[r.jsxs("li",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-primary"})," One-click screen capture"]}),r.jsxs("li",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-primary"})," Record up to 60 minutes"]}),r.jsxs("li",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-primary"})," Floating camera bubble"]})]}),r.jsx(P,{asChild:!0,size:"sm",className:"mt-3 gap-1.5",children:r.jsxs("a",{href:"https://chromewebstore.google.com/detail/vidareo-screen-recorder-v/lmaaoeofdlnjfenacdmdffepkniggkng",target:"_blank",rel:"noopener noreferrer",children:["Install E
1204xtension ",r.jsx(bn,{className:"w-3.5 h-3.5"})]})}),r.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"You can also install it later from your dashboard."})]})]})})]})]})})]})]}):ee?r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col",children:[r.jsx("header",{className:"p-4",children:r.jsx("a",{href:"/",className:"inline-block",children:r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-10 w-auto"})})}),r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsx(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.5},className:"w-full max-w-md",children:r.jsx(yet,{factorId:ee,onSuccess:()=>{re(null),ue({title:"Welcome back!",description:"You have successfully logged in."})},onCancel:async()=>{re(null),await F.auth.signOut()}})})})]})]}):W?r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col",children:[r.jsx("header",{className:"p-4",children:r.jsx("a",{href:"/",className:"inline-block",children:r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-10 w-auto"})})}),r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsx(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.5},className:"w-full max-w-md",children:r.jsx(bet,{email:Ne==null?void 0:Ne.email,onSuccess:()=>{if(Ne!=null&&Ne.id)try{sessionStorage.setItem(`vidareo_email_mfa_ok_${Ne.id}`,"true")}catch{}Q(!1),ue({title:"Welcome back!",description:"You have successfully logged in."})},onCancel:async()=>{Q(!1),await F.auth.signOut()}})})})]})]}):r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col pt-[max(1rem,env(safe-area-inset-top))] overflow-y-auto max-h-screen",children:[r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-md",children:[r.jsxs("div",{className:"text-center lg:text-left mb-8",children:[r.jsx("div",{className:"flex items-center justify-center lg:justify-start mb-4",children:r.jsx("a",{href:"/",className:"inline-block",children:r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-10 w-auto"})})}),r.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:oe()}),r.jsx("p",{className:"text-muted-foreground mb-3",children:xe()}),r.jsxs("p",{className:"text-sm font-medium lg:hidden",children:[r.jsx("span",{className:"text-destructive",children:"Record."}),r.jsx("span",{className:"text-muted-foreground/50 mx-1",children:"•"}),r.jsx("span",{className:"text-primary",children:"Share."}),r.jsx("span",{className:"text-muted-foreground/50 mx-1",children:"•"}),r.jsx("span",{className:"text-green-500",children:"Connect."})]})]}),a==="signup"&&o==="plan"&&r.jsxs("div",{className:"space-y-4",children:[!lr()&&r.jsx("div",{className:"flex justify-center mb-2",children:r.jsxs("div",{className:"inline-flex items-center gap-1 p-1 rounded-lg bg-muted/50 border border-border",children:[r.jsx("button",{type:"button",onClick:()=>g(!1),className:`px-4 py-2 rounded-md text-sm font-semibold transition-all ${x?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:"Monthly"}),r.jsxs("button",{type:"button",onClick:()=>g(!0),className:`px-4 py-2 rounded-md text-sm font-semibold transition-all flex items-center gap-2 ${x?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Annual",r.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-bold ${x?"bg-primary text-primary-foreground":"bg-primary/20 text-primary"}`,children:"-33%"})]})]})}),dd.filter(pe=>!lr()||pe.id!=="team").map(pe=>r.jsx(fe.button,{type:"button",onClick:()=>{d(pe.id),pe.id==="free"&&p(null)},className:`w-full p-4 rounded-xl border-2 text-left transition-all ${c===pe.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,whileHover:{scale:1.01},whileTap:{scale:.99},children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:`p-2 rounded-lg ${c===pe.id?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:pe.icon}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:pe.name}),pe.recommended&&r.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-primary text-primary-foreground rounded-full",children:"Recommended"})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("span",{className:"text-lg font-bold text-foreground",children:ae(pe)}),pe.monthlyPrice>0&&r.jsx("span",{className:"text-sm text-muted-foreground",children:ne(pe)}),pe.minUsers&&pe.minUsers>=2&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["min ",pe.minUsers," users"]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:pe.description}),r.jsx("ul",{className:"space-y-1",children:pe.features.map((le,ke)=>r.jsxs("li",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(nt,{className:"h-4 w-4 text-primary"}),le]},ke))})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${c===pe.id?"border-primary bg-primary":"border-muted-foreground"}`,children:c===pe.id&&r.jsx(nt,{className:"h-3 w-3 text-primary-foreground"})})]})},pe.id)),c==="team"&&r.jsxs(fe.div,{className:"p-4 rounded-xl border-2 border-primary bg-primary/5",initial:{opacity:0,y:10}
1204,animate:{opacity:1,y:0},children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary text-primary-foreground",children:r.jsx(jr,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Team Members"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Minimum 2 users required"})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:pe=>{pe.stopPropagation(),m(Math.max(2,u-1))},disabled:u<=2,children:r.jsx(ag,{className:"h-4 w-4"})}),r.jsx("span",{className:"w-8 text-center text-lg font-bold text-foreground",children:u}),r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:pe=>{pe.stopPropagation(),m(u+1)},children:r.jsx(Ns,{className:"h-4 w-4"})})]})]}),r.jsx("div",{className:"mt-3 pt-3 border-t border-border",children:r.jsxs("div",{className:"flex items-center justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:"Total per month:"}),r.jsxs("span",{className:"font-bold text-foreground",children:["$",x?Math.round(19*.8)*u:19*u,"/mo"]})]})})]}),(c==="professional"||c==="team")&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Optional Add-ons"}),r.jsx(fe.button,{type:"button",onClick:()=>p(f==="extended_video_30"?null:"extended_video_30"),className:`w-full p-4 rounded-xl border-2 text-left transition-all ${f==="extended_video_30"?"border-accent bg-accent/5":"border-border hover:border-accent/50"}`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},whileHover:{scale:1.01},whileTap:{scale:.99},children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:`p-2 rounded-lg ${f==="extended_video_30"?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground"}`,children:r.jsx(fr,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"30 Minute Videos"}),r.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-accent/20 text-accent rounded-full",children:"Add-on"})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("span",{className:"text-lg font-bold text-foreground",children:"+$20"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[c==="team"?"/user":"","/mo"]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Upgrade from 10 to 30 minute videos"})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${f==="extended_video_30"?"border-accent bg-accent":"border-muted-foreground"}`,children:f==="extended_video_30"&&r.jsx(nt,{className:"h-3 w-3 text-accent-foreground"})})]})}),r.jsx(fe.button,{type:"button",onClick:()=>p(f==="extended_video_60"?null:"extended_video_60"),className:`w-full p-4 rounded-xl border-2 text-left transition-all ${f==="extended_video_60"?"border-accent bg-accent/5":"border-border hover:border-accent/50"}`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.05},whileHover:{scale:1.01},whileTap:{scale:.99},children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:`p-2 rounded-lg ${f==="extended_video_60"?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground"}`,children:r.jsx(fr,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"60 Minute Videos"}),r.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-primary/20 text-primary rounded-full",children:"Best Value"})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("span",{className:"text-lg font-bold text-foreground",children:"+$30"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[c==="team"?"/user":"","/mo"]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Upgrade from 10 to 60 minute videos"})]}),r.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${f==="extended_video_60"?"border-accent bg-accent":"border-muted-foreground"}`,children:f==="extended_video_60"&&r.jsx(nt,{className:"h-3 w-3 text-accent-foreground"})})]})})]}),r.jsxs(P,{type:"button",className:"w-full",size:"lg",onClick:()=>
1204l("details"),children:["Continue with ",(Ze=dd.find(pe=>pe.id===c))==null?void 0:Ze.name,f&&(c==="professional"||c==="team")&&" + Add-on"]}),r.jsx("div",{className:"text-center",children:r.jsxs("p",{className:"text-muted-foreground",children:["Already have an account?",r.jsx("button",{type:"button",onClick:()=>{i("login"),O({})},className:"ml-2 text-primary font-semibold hover:underline",children:"Sign In"})]})})]}),(a!=="signup"||o==="details")&&r.jsxs("form",{onSubmit:De,className:"space-y-4",children:[a==="signup"&&o==="details"&&r.jsxs("div",{className:"mb-4 space-y-3",children:[!Gg()&&r.jsxs("div",{className:"p-3 rounded-lg bg-amber-500/10 border border-amber-500/30 flex items-start gap-2",children:[r.jsx(ql,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"}),r.jsxs("div",{className:"text-xs text-amber-800 dark:text-amber-300 leading-relaxed",children:[r.jsx("span",{className:"font-semibold",children:"Google Chrome is recommended"})," for the best experience. Screen recording, video calls, and the VIDAREO extension work best in Chrome, Edge, or Brave."]})]}),s?r.jsxs("div",{className:"p-3 rounded-lg bg-primary/10 border border-primary/20 flex items-center gap-3",children:[r.jsx("div",{className:"p-1.5 rounded-md bg-primary text-primary-foreground",children:r.jsx(jr,{className:"h-6 w-6"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Joining a Team"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"You'll inherit your team's plan after joining"})]})]}):r.jsxs("div",{className:"p-3 rounded-lg bg-muted/50 flex items-center gap-3",children:[r.jsx("div",{className:"p-1.5 rounded-md bg-primary text-primary-foreground",children:(it=dd.find(pe=>pe.id===c))==null?void 0:it.icon}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("p",{className:"text-sm font-medium text-foreground",children:[(ct=dd.find(pe=>pe.id===c))==null?void 0:ct.name," Plan"]}),!lr()&&r.jsx("button",{type:"button",onClick:()=>l("plan"),className:"text-xs text-primary hover:underline",children:"Change plan"})]})]}),(c==="professional"||c==="team")&&r.jsx("div",{className:"flex justify-center",children:r.jsxs("div",{className:"inline-flex items-center gap-1 p-1 rounded-lg bg-muted/50 border border-border",children:[r.jsx("button",{type:"button",onClick:()=>{g(!1),localStorage.setItem("signup_billing_period","monthly")},className:`px-4 py-2 rounded-md text-sm font-semibold transition-all ${x?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:"Monthly"}),r.jsxs("button",{type:"button",onClick:()=>{g(!0),localStorage.setItem("signup_billing_period","annual")},className:`px-4 py-2 rounded-md text-sm font-semibold transition-all flex items-center gap-2 ${x?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Annual",r.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-bold ${x?"bg-primary text-primary-foreground":"bg-primary/20 text-primary"}`,children:"-20%"})]})]})}),c==="team"&&r.jsxs("div",{className:"p-3 rounded-lg bg-primary/5 border border-primary/20 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-1.5 rounded-md bg-primary text-primary-foreground",children:r.jsx(jr,{className:"h-4 w-4"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Team Members"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Min. 2 users"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 rounded-full",onClick:()=>{const pe=Math.max(2,u-1);m(pe),localStorage.setItem("signup_team_member_count",pe.toString())},disabled:u<=2,children:r.jsx(ag,{className:"h-3 w-3"})}),r.jsx("span",{className:"w-6 text-center text-sm font-bold text-foreground",children:u}),r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 rounded-full",onClick:()=>{const pe=u+1;m(pe),localStorage.setItem("signup_team_member_count",pe.toString())},children:r.jsx(Ns,{className:"h-3 w-3"})})]})]}),(c==="professional"||c==="team")&&r.jsxs("div",{className:"p-3 rounded-lg bg-accent/5 border border-accent/20 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-1.5 rounded-md bg-accent text-accent-foreground",children:r.jsx(fr,{className:"h-4 w-4"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Extended Video Length"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Pro includes 10 min videos • Upgrade for longer recordings"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{type:"button",onClick:()=>{p(null),localStorage.removeItem("signup_addon")},className:`flex-1 px-3 py-2 rounded-md text-xs font-medium transition-all border ${f?"bg-muted/30 border-border text-muted-foreground hover:bg-muted/50":"bg-background border-primary text-foreground shadow-sm ring-1 ring-primary/20"}`,children:[r.jsx("span",{className:"block font-semibold",children:"10 min"}),r.jsx("span",{className:"text-muted-foreground",children:"Included"})]}),r.jsxs("button",{type:"button",onClick:()=>{p("extended_video_30"),localStorage.setItem("signup_addon","extended_video_30")},className:`flex-1 px-3 py-2 rounded-md text-xs font-medium transition-all border ${f==="extended_video_30"?"bg-background border-primary text-foreground shadow-sm ring-1 ring-primary/20":"bg-muted/30 border-border text-muted-foreground hover:bg-muted/50"}`,children:[r.jsx("span",{className:"block font-semibold",children:"30 min"}),r.jsx("span",{className:"text-muted-foreground",children:"+$20/mo"})]}),r.jsxs("button",{type:"button",onClick:()=>{p("extended_video_60"),localStorage.setItem("signup_addon","extended_video_60")},className:`flex-1 px-3 py-2 rounded-md text-xs font-medium transition-all border ${f==="extended_video_60"?"bg-background border-primary text-foreground shadow-sm ring-1 ring-primary/20":"bg-muted/30 border-border text-muted-foreground hover:bg-muted/50"}`,children:[r.jsx("span",{className:"block font-semibold",children:"60 min"}),r.jsx("span",{className:"text-muted-foreground",children:"+$30/mo"})]})]}),c==="team"&&f&&r.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Add-on priced per team member (",u," × $",f==="extended_video_60"?"30":"20"," = $",u*(f==="extended_video_60"?30:20),"/mo)"]})]}),c==="professional"||c==="team"?r.jsx(zR,{tier:c,billingPeriod:x?"annual"
1204:"monthly",appliedPromo:A,allowGiftWhenSignedOut:!0,onGiftPending:pe=>localStorage.setItem("signup_gift_code",pe),onPromoApplied:pe=>{V(pe),pe?localStorage.setItem("signup_promo_code",pe.code):localStorage.removeItem("signup_promo_code")}}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Have a gift code?"}),r.jsx(zR,{tier:"free",billingPeriod:"monthly",appliedPromo:null,allowGiftWhenSignedOut:!0,placeholder:"Enter gift code",onGiftPending:pe=>localStorage.setItem("signup_gift_code",pe),onPromoApplied:()=>{}})]}),(c==="professional"||c==="team")&&r.jsxs("div",{className:"p-4 rounded-xl bg-muted/30 border border-border space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:[(Oe=dd.find(pe=>pe.id===c))==null?void 0:Oe.name," Plan",c==="team"&&` (${u} users)`]}),r.jsxs("span",{className:"text-sm font-medium text-foreground",children:["$",(()=>{const pe=dd.find(ot=>ot.id===c),le=pe.monthlyPrice,ke=c==="team"?u:1;return(x?pe.annualMonthlyPrice||Math.round(le*.8):le)*ke})(),"/mo"]})]}),f&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:[f==="extended_video_60"?"60 Min":"30 Min"," Add-on",c==="team"&&` (${u} users)`]}),r.jsxs("span",{className:"text-sm font-medium text-foreground",children:["+$",(f==="extended_video_60"?30:20)*(c==="team"?u:1),"/mo"]})]}),A&&r.jsxs("div",{className:"flex items-center justify-between text-accent",children:[r.jsxs("span",{className:"text-sm",children:["Promo: ",A.code," (",A.discountPercentage,"% off)"]}),r.jsxs("span",{className:"text-sm font-medium",children:["-$",(()=>{const pe=dd.find(gt=>gt.id===c),le=pe.monthlyPrice,ke=c==="team"?u:1,ot=(x?pe.annualMonthlyPrice||Math.round(le*.8):le)*ke;return Math.round(ot*(A.discountPercentage/100))})(),"/mo"]})]}),r.jsx(Kl,{className:"my-2"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-sm font-semibold text-foreground",children:x?"Monthly (billed annually)":"Monthly Total"}),r.jsxs("div",{className:"text-right",children:[r.jsxs("span",{className:"text-lg font-bold text-foreground",children:["$",(()=>{const pe=dd.find(tt=>tt.id===c),le=pe.monthlyPrice,ke=c==="team"?u:1,ot=(x?pe.annualMonthlyPrice||Math.round(le*.8):le)*ke,Nt=(f?f==="extended_video_60"?30:20:0)*ke,Ct=ot+Nt,dt=A?Math.round(ot*(A.discountPercentage/100)):0;return Ct-dt})()]}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]})]}),x&&r.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Billed as $",(()=>{const pe=dd.find(tt=>tt.id===c),le=pe.monthlyPrice,ke=c==="team"?u:1,ot=(x?pe.annualMonthlyPrice||Math.round(le*.8):le)*ke,Nt=(f?f==="extended_video_60"?30:20:0)*ke,Ct=ot+Nt,dt=A?Math.round(ot*(A.discountPercentage/100)):0;return((Ct-dt)*12).toFixed(2)})()," annually"]})]})]}),a==="signup"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"fullName",children:"Full Name"}),r.jsxs("div",{className:"relative",children:[r.jsx(Cc,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),r.jsx(He,{id:"fullName",type:"text",placeholder:"Enter your name",value:N,onChange:pe=>_(pe.target.value),className:"pl-10"})]}),U.fullName&&r.jsx("p",{className:"text-sm text-destructive",children:U.fullName})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Email"}),r.jsxs("div",{className:"relative",children:[r.jsx(zr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),r.jsx(He,{id:"email",type:"email",placeholder:"Enter your email",value:b,onChange:pe=>{w(pe.target.value),$(!1)},className:"pl-10"})]}),U.email&&r.jsx("p",{className:"text-sm text-destructive",children:U.email}),a==="signup"&&M&&r.jsxs("div",{className:"p-4 rounded-lg bg-destructive/10 border border-destructive/20 space-y-3",children:[r.jsx("p",{className:"text-sm text-destructive font-medium",children:"This email is already registered with VIDAREO."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"You can sign in to your existing account, or reset your password if you've forgotten it."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsx(P,{type:"button",variant:"default",size:"sm",className:"flex-1",onClick:()=>{i("login"),$(!1),O({})},children:"Sign In Instead"}),r.jsx(P,{type:"button",variant:"outline",size:"sm",className:"flex-1",onClick:()=>{i("forgot"),$(!1),O({})},children:"Forgot Password?"})]})]})]}),a!=="forgot"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ye,{htmlFor:"password",children:"Password"}),a==="signup"&&r.jsx(pet,{password:S,children:r.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground",children:r.jsx(ql,{className:"h-4 w-4"})})})]}),r.jsxs("div",{className:"relative",children:[r.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),r.jsx(He,{id:"password",type:C?"text":"password",placeholder:"Enter your password",value:S,onChange:pe=>j(pe.target.value),className:"pl-10 pr-10"}),r.jsx("button",{type:"button",onClick:()=>k(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:C?r.jsx(Pb,{className:"h-5 w-5"}):r.jsx(wr,{className:"h-5 w-5"})})]}),a==="signup"&&S.length>0&&r.jsx(Iae,{password:S}),U.password&&r.jsx("p",{className:"text-sm text-destructive",children:U.password})]}),a==="login"&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("label",{htmlFor:"remember-me",className:"flex items-center gap-2 cursor-pointer select-none",children:[r.jsx("input",{id:"remember-me",type:"checkbox",checked:v,onChange:pe=>
1204y(pe.target.checked),className:"h-4 w-4 rounded border-2 border-muted-foreground accent-primary"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Remember me"})]}),r.jsx("button",{type:"button",onClick:()=>{i("forgot"),O({})},className:"text-sm text-primary hover:underline",children:"Forgot password?"})]}),a==="signup"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(ci,{id:"terms",checked:T,onCheckedChange:pe=>D(pe===!0),className:"mt-1"}),r.jsxs(ye,{htmlFor:"terms",className:"text-sm text-muted-foreground leading-relaxed cursor-pointer",children:["I agree to the"," ",r.jsx("button",{type:"button",onClick:pe=>{pe.preventDefault(),B(!0)},className:"text-primary hover:underline font-medium",children:"Terms of Use"})," ","and"," ",r.jsx("button",{type:"button",onClick:pe=>{pe.preventDefault(),Z(!0)},className:"text-primary hover:underline font-medium",children:"Content Policy"}),". I understand that uploading prohibited content (hate speech, violence, sexual content, harassment, etc.) will result in account termination."]})]}),U.terms&&r.jsx("p",{className:"text-sm text-destructive",children:U.terms})]}),q&&X>0&&a==="login"&&r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-destructive/10 border border-destructive/20",children:[r.jsx(Mb,{className:"h-5 w-5 text-destructive shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-destructive",children:"Account temporarily locked"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Too many failed attempts. Try again in ",Math.ceil(X/60)," minute",Math.ceil(X/60)!==1?"s":"","."]})]})]}),r.jsx(P,{type:"submit",className:"w-full",size:"lg",disabled:E||q!==null&&X>0&&a==="login",children:E?"Please wait...":a==="login"?"Sign In":a==="signup"?"Create Account":"Send Reset Link"})]}),a==="login"&&r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("p",{className:"text-muted-foreground",children:["Don't have an account?",r.jsx("button",{type:"button",onClick:()=>{i("signup"),l("details"),d("free"),O({})},className:"ml-2 text-primary font-semibold hover:underline",children:"Sign Up"})]})}),a==="signup"&&o==="details"&&r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("p",{className:"text-muted-foreground",children:["Already have an account?",r.jsx("button",{type:"button",onClick:()=>{i("login"),l("plan"),O({})},className:"ml-2 text-primary font-semibold hover:underline",children:"Sign In"})]})}),a==="forgot"&&r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("p",{className:"text-muted-foreground",children:["Remember your password?",r.jsx("button",{type:"button",onClick:()=>{i("login"),O({})},className:"ml-2 text-primary font-semibold hover:underline",children:"Sign In"})]})})]})}),r.jsx(xet,{open:I,onOpenChange:B}),r.jsx(get,{open:K,onOpenChange:Z})]})]})},jet=()=>{const[e,t]=h.useState(""),[n,s]=h.useState(""),[a,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),[u,m]=h.useState({}),f=Sr(),{toast:p}=Gr();h.useEffect(()=>{(async()=>{const{data:{session:y}}=await F.auth.getSession();y||(p({title:"Invalid or expired link",description:"Please request a new password reset link.",variant:"destructive"}),f("/auth"))})()},[f,p]);const x=()=>{const v={};return Dae(e)||(v.password="Password does not meet all requirements"),e!==n&&(v.confirmPassword="Passwords do not match"),m(v),Object.keys(v).length===0},g=async v=>{if(v.preventDefault(),!x())return;l(!0);const{error:y}=await F.auth.updateUser({password:e});y?p({title:"Error",description:y.message,variant:"destructive"}):(d(!0),p({title:"Password updated",description:"Your password has been successfully reset."})),l(!1)};return c?r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col",children:[r.jsx("header",{className:"p-4",children:r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>f("/"),className:"text-foreground",children:r.jsx(aa,{className:"h-6 w-6"})})}),r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsxs(fe.div,{initial:{opacity:0,scale:.95}
1204,animate:{opacity:1,scale:1},transition:{duration:.5},className:"w-full max-w-md text-center lg:text-left",children:[r.jsx("div",{className:"flex justify-center lg:justify-start mb-6",children:r.jsx("div",{className:"p-4 bg-primary/10 rounded-full",children:r.jsx(Lm,{className:"h-12 w-12 text-primary"})})}),r.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Password Reset Complete"}),r.jsx("p",{className:"text-muted-foreground mb-8",children:"Your password has been successfully updated. You can now sign in with your new password."}),r.jsx(P,{onClick:()=>f("/"),className:"w-full",size:"lg",children:"Continue to App"})]})})]})]}):r.jsxs("div",{className:"min-h-screen bg-background flex flex-row",children:[r.jsx(px,{}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-y-auto max-h-screen",children:[r.jsx("header",{className:"p-4 pt-[max(1rem,env(safe-area-inset-top))]",children:r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>f("/auth"),className:"text-foreground",children:r.jsx(aa,{className:"h-6 w-6"})})}),r.jsx("main",{className:"flex-1 flex items-center justify-center px-4 pb-8",children:r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-md",children:[r.jsxs("div",{className:"text-center lg:text-left mb-8",children:[r.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Set New Password"}),r.jsx("p",{className:"text-muted-foreground",children:"Enter your new password below"})]}),r.jsxs("form",{onSubmit:g,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"password",children:"New Password"}),r.jsxs("div",{className:"relative",children:[r.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),r.jsx(He,{id:"password",type:a?"text":"password",placeholder:"Enter new password",value:e,onChange:v=>t(v.target.value),className:"pl-10 pr-10"}),r.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?r.jsx(Pb,{className:"h-5 w-5"}):r.jsx(wr,{className:"h-5 w-5"})})]}),u.password&&r.jsx("p",{className:"text-sm text-destructive",children:u.password}),e&&r.jsx(Iae,{password:e})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"confirmPassword",children:"Confirm Password"}),r.jsxs("div",{className:"relative",children:[r.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),r.jsx(He,{id:"confirmPassword",type:a?"text":"password",placeholder:"Confirm new password",value:n,onChange:v=>s(v.target.value),className:"pl-10"})]}),u.confirmPassword&&r.jsx("p",{className:"text-sm text-destructive",children:u.confirmPassword})]}),r.jsx(P,{type:"submit",className:"w-full",size:"lg",disabled:o,children:o?"Updating...":"Update Password"})]})]})})]})]})},Lae=({shareToken:e,parentReplyId:t,replyingToName:n,onSuccess:s,onCancel:a})=>{const{toast:i}=Gr(),o=h.useRef(null),l=h.useRef(null),c=h.useRef(null),d=h.useRef(null),u=h.useRef([]),[m,f]=h.useState("idle"),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,b]=h.useState(0),[w,S]=h.useState(!1),[j,N]=h.useState(!0),[_,C]=h.useState(""),[k,E]=h.useState(""),[R,T]=h.useState(""),D=h.useRef(null),[A,V]=h.useState(()=>window.innerHeight>window.innerWidth);h.useEffect(()=>{const q=()=>V(window.innerHeight>window.innerWidth);return window.addEventListener("resize",q),window.addEventListener("orientationchange",q),()=>{window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q)}},[]);const U=h.useCallback(async q=>{const H=q!==void 0?q:j;try{const X=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:1280},height:{ideal:720}},audio:H});d.current=X,o.current&&(o.current.srcObject=X)}catch(X){console.error("Error accessing camera:",X),i({title:"Camera Access Required",description:"Please allow camera access to record your reply.",variant:"destructive"})}},[j,i]),O=h.useCallback(()=>
1204{d.current&&(d.current.getTracks().forEach(q=>q.stop()),d.current=null),o.current&&(o.current.srcObject=null)},[]);h.useEffect(()=>(U(),()=>{O(),g&&URL.revokeObjectURL(g)}),[]);const M=h.useCallback(()=>{if(!d.current)return;u.current=[];const q=new MediaRecorder(d.current,{mimeType:"video/webm;codecs=vp9,opus"});q.ondataavailable=H=>{H.data.size>0&&u.current.push(H.data)},q.onstop=()=>{const H=new Blob(u.current,{type:"video/webm"});x(H);const X=URL.createObjectURL(H);v(X),f("recorded"),O()},c.current=q,q.start(1e3),f("recording"),b(0),D.current=setInterval(()=>{b(H=>H+1)},1e3)},[O]),$=h.useCallback(()=>{c.current&&c.current.state==="recording"&&c.current.stop(),D.current&&clearInterval(D.current)},[]),I=h.useCallback(()=>{g&&URL.revokeObjectURL(g),x(null),v(null),f("idle"),b(0),U()},[g,U]),B=h.useCallback(()=>{l.current&&(w?l.current.pause():l.current.play(),S(!w))},[w]),K=q=>{const H=Math.floor(q/60),X=q%60;return`${H}:${X.toString().padStart(2,"0")}`},Z=async()=>{if(!p||!_.trim()){i({title:"Missing Information",description:"Please record a video and enter your name.",variant:"destructive"});return}f("uploading");try{const q=new FormData;q.append("file",p,"reply.webm"),q.append("shareToken",e),q.append("duration",y.toString());const{data:H,error:X}=await F.functions.invoke("upload-video-reply",{body:q});if(X)throw X;if(!(H!=null&&H.success)||!(H!=null&&H.url))throw new Error((H==null?void 0:H.error)||"Upload failed");const{data:G,error:ee}=await F.functions.invoke("submit-video-reply",{body:{shareToken:e,replyVideoUrl:H.url,replyDuration:y,senderName:_.trim(),senderEmail:k.trim()||null,message:R.trim()||null,parentReplyId:t||null}});if(ee)throw ee;f("sent"),i({title:"Reply Sent!",description:"Your video reply has been sent successfully."}),s==null||s()}catch(q){console.error("Error submitting reply:",q),f("recorded");const H=q instanceof Error?q.message:"There was an error sending your reply.";i({title:"Failed to Send",description:H.includes("Rate limit")?H:"There was an error sending your reply. Please try again.",variant:"destructive"})}};return m==="sent"?r.jsxs(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center py-8",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-green-500/20 flex items-center justify-center mx-auto mb-4",children:r.jsx(Es,{className:"w-8 h-8 text-green-500"})}),r.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Reply Sent!"}),r.jsx("p",{className:"text-muted-foreground",children:"Your video reply has been delivered."})]}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("h3",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[r.jsx(cr,{className:"w-5 h-5 text-primary"}),n?`Reply to ${n}`:"Record a Reply"]}),a&&r.jsx(P,{variant:"ghost",size:"sm",onClick:a,children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:`relative bg-black rounded-lg overflow-hidden ${A?"aspect-[3/4]":"aspect-video"}`,children:m==="idle"||m==="recording"?r.jsxs(r.Fragment,{children:[r.jsx("video",{ref:o,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover scale-x-[-1]"}),m==="recording"&&r.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2 bg-red-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:[r.jsx("span",{className:"w-2 h-2 bg-white rounded-full animate-pulse"}),K(y)]})]}):g?r.jsxs(r.Fragment,{children:[r.jsx("video",{ref:l,src:g,className:"w-full h-full object-cover",onEnded:()=>S(!1),playsInline:!0}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(P,{variant:"secondary",size:"icon",className:"w-12 h-12 rounded-full bg-background/80 backdrop-blur-sm",onClick:B,children:w?r.jsx(ig,{className:"w-5 h-5"}):r.jsx(Js,{className:"w-5 h-5 ml-0.5"})})}),r.jsx("div",{className:"absolute bottom-4 left-4 bg-background/80 backdrop-blur-sm px-3 py-1 rounded-lg text-sm",children:K(y)})]}):null}),(m==="idle"||m==="recording")&&r.jsxs("div",{className:"flex justify-center gap-4",children:[r.jsx(P,{variant:"outline",size:"icon",onClick:()=>{const q=!j;N(q),m==="idle"&&(O(),setTimeout(()=>U(q),100))},disabled:m==="recording",title:j?"Mute microphone":"Enable microphone",children:j?r.jsx(Hd,{className:"w-4 h-4"}):r.jsx(cv,{className:"w-4 h-4"})}),m==="idle"?r.jsxs(P,{size:"lg",className:"gap-2 gradient-primary text-white",onClick:M,children:[r.jsx(ga,{className:"w-5 h-5"}),"Start Recording"]}):r.jsxs(P,{size:"lg",variant:"destructive",className:"gap-2",onClick:$,children:[r.jsx(Um,{className:"w-5 h-5"}),"Stop Recording"]})]}),m==="recorded"&&r.jsxs(fe.div,{initial:{opacity:0,y:10}
1204,animate:{opacity:1,y:0},className:"space-y-4 pb-24",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"name",children:"Your Name *"}),r.jsx(He,{id:"name",value:_,onChange:q=>C(q.target.value),placeholder:"Enter your name",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"email",children:"Email (optional)"}),r.jsx(He,{id:"email",type:"email",value:k,onChange:q=>E(q.target.value),placeholder:"Your email for follow-up",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"message",children:"Message (optional)"}),r.jsx($s,{id:"message",value:R,onChange:q=>T(q.target.value),placeholder:"Add a message to your reply...",className:"mt-1 resize-none",rows:2})]})]}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs(P,{variant:"outline",className:"flex-1 gap-2",onClick:I,children:[r.jsx(Wd,{className:"w-4 h-4"}),"Retake"]}),r.jsxs(P,{className:"flex-1 gap-2 gradient-primary text-white",onClick:Z,disabled:!_.trim(),children:[r.jsx(Es,{className:"w-4 h-4"}),"Send Reply"]})]})]}),m==="uploading"&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Sending your reply..."})]})]})},Net=({replies:e,shareToken:t,onReplySubmitted:n})=>{const[s,a]=h.useState(new Set),[i,o]=h.useState(null),[l,c]=h.useState(null),[d,u]=h.useState(!1),m=w=>{if(!w)return"0:00";const S=Math.floor(w/60),j=w%60;return`${S}:${j.toString().padStart(2,"0")}`},f=w=>{const S=new Date(w),N=new Date().getTime()-S.getTime(),_=Math.floor(N/6e4),C=Math.floor(_/60),k=Math.floor(C/24);return _<1?"Just now":_<60?`${_}m ago`:C<24?`${C}h ago`:k<7?`${k}d ago`:S.toLocaleDateString("en-US",{month:"short",day:"numeric"})},p=w=>{a(S=>{const j=new Set(S);return j.has(w)?j.delete(w):j.add(w),j})},x=w=>{o(i===w?null:w)},g=e.filter(w=>!w.parent_reply_id),v=w=>e.filter(S=>S.parent_reply_id===w),y=d?g:g.slice(0,3);if(e.length===0)return null;const b=(w,S=0)=>{const j=v(w.id),N=s.has(w.id),_=i===w.id,C=l===w.id,k=!w.reply_video_url;return r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`${S>0?"ml-6 sm:ml-10 border-l-2 border-border pl-4":""}`,children:r.jsxs(Ie,{className:"p-3 sm:p-4 bg-muted/30",children:[r.jsxs("div",{className:"flex gap-3",children:[r.jsx(an,{className:"h-8 w-8 sm:h-10 sm:w-10 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs sm:text-sm",children:w.sender_name.charAt(0).toUpperCase()})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"font-medium text-foreground text-sm truncate",children:w.sender_name}),r.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:f(w.created_at)})]}),w.reply_duration&&!k&&r.jsxs(Se,{variant:"secondary",className:"text-xs flex-shrink-0",children:[r.jsx(fr,{className:"w-3 h-3 mr-1"}),m(w.reply_duration)]}),k&&r.jsxs(Se,{variant:"outline",className:"text-xs flex-shrink-0",children:[r.jsx(Bue,{className:"w-3 h-3 mr-1"}),"Text"]})]}),w.message&&r.jsx("p",{className:`text-sm text-muted-foreground ${k?"mb-2":"mb-3"}`,children:w.message}),!k&&w.reply_video_url&&r.jsx(_et,{videoUrl:w.reply_video_url,thumbnailUrl:w.reply_thumbnail_url,isPlaying:_,onPlay:()=>x(w.id),onEnded:()=>o(null)}),r.jsxs(P,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-primary mt-2",onClick:()=>{c(C?null:w.id)},children:[r.jsx(hT,{className:"w-3 h-3 mr-1"}),C?"Cancel":"Reply"]}),r.jsx(Ts,{children:C&&r.jsx(fe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-3",children:r.jsx(Lae,{shareToken:t,parentReplyId:w.id,replyingToName:w.sender_name,onSuccess:()=>{c(null),n==null||n()},onCancel:()=>c(null)})})})]})]}),j.length>0&&r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx("button",{onClick:()=>p(w.id),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:N?r.jsxs(r.Fragment,{children:[r.jsx(Mm,{className:"w-3 h-3"}),"Hide ",j.length," ",j.length===1?"reply":"replies"]}):r.jsxs(r.Fragment,{children:[r.jsx(Qs,{className:"w-3 h-3"}),"Show ",j.length," ",j.length===1?"reply":"replies"]})}),r.jsx(Ts,{children:N&&r.jsx(fe.div,{initial:{opacity:0,height:0}
1204,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:j.map(E=>b(E,S+1))})})]})]})},w.id)};return r.jsxs(Ie,{className:"p-4 sm:p-6",children:[r.jsx("div",{className:"flex items-center justify-between mb-4",children:r.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[r.jsx(Wa,{className:"w-5 h-5 text-primary"}),"Video Replies",r.jsx(Se,{variant:"secondary",children:e.length})]})}),r.jsx("div",{className:"space-y-4",children:r.jsx(Ts,{children:y.map(w=>b(w))})}),g.length>3&&r.jsx(P,{variant:"ghost",className:"w-full mt-4",onClick:()=>u(!d),children:d?r.jsxs(r.Fragment,{children:[r.jsx(Mm,{className:"w-4 h-4 mr-2"})," Show Less"]}):r.jsxs(r.Fragment,{children:[r.jsx(Qs,{className:"w-4 h-4 mr-2"})," Show All ",g.length," Replies"]})})]})},_et=({videoUrl:e,thumbnailUrl:t,isPlaying:n,onPlay:s,onEnded:a})=>{const[i,o]=h.useState(null),l=h.useRef(null),c=h.useCallback(m=>{if(l.current=m,!m)return;_N(m);const f=()=>{m.videoWidth&&m.videoHeight&&o(m.videoWidth/m.videoHeight)};m.readyState>=1&&f(),m.addEventListener("loadedmetadata",f)},[]);h.useCallback(m=>{if(!m)return;const f=()=>{m.naturalWidth&&m.naturalHeight&&o(m.naturalWidth/m.naturalHeight)};m.complete&&f(),m.addEventListener("load",f)},[]);const d=()=>{if(n)return;s();const m=l.current;if(m){try{m.muted=!1,m.currentTime=0}catch{}m.play().catch(()=>{})}},u=i?{aspectRatio:String(i),maxHeight:i<1?"70vh":void 0}:void 0;return r.jsxs("div",{className:`relative bg-black rounded-lg overflow-hidden mb-2 mx-auto ${i?"":"aspect-video"} ${i&&i<1?"max-w-xs":"w-full"}`,style:u,children:[r.jsx("video",{ref:c,src:e,poster:t||void 0,controls:n,playsInline:!0,preload:"metadata",className:"w-full h-full",onEnded:a,onPlay:()=>{n||s()}}),!n&&r.jsxs("button",{type:"button","aria-label":"Play reply",onClick:d,className:"absolute inset-0 flex items-center justify-center bg-black/30 hover:bg-black/40 transition-colors group",children:[!t&&r.jsx("span",{className:"sr-only",children:"Play video reply"}),r.jsx("span",{className:"w-12 h-12 rounded-full bg-background/90 backdrop-blur-sm flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform",children:r.jsx(Js,{className:"w-5 h-5 text-primary ml-0.5"})})]})]})},Cet=[{emoji:"👍",label:"Like"},{emoji:"❤️",label:"Love"},{emoji:"👏",label:"Clap"},{emoji:"😊",label:"Smile"},{emoji:"🎉",label:"Celebrate"}],yz=({shareLinkId:e,videoId:t,shareToken:n,currentTime:s,onTimedReactionsLoaded:a})=>{const{toast:i}=Gr(),[o,l]=h.useState({}),[c,d]=h.useState(new Set),[u,m]=h.useState(!0),[f,p]=h.useState(null),[x,g]=h.useState([]),[v,y]=h.useState(0);h.useEffect(()=>{const j=localStorage.getItem(`reactions_${e}`);j&&d(new Set(JSON.parse(j)))},[e]),h.useEffect(()=>{b()},[e]);const b=async()=>{try{const{data:j,error:N}=await F.functions.invoke("get-video-reactions",{body:{shareLinkId:e}});if(N){console.error("Error fetching reactions:",N);return}j!=null&&j.counts&&l(j.counts),j!=null&&j.timedReactions&&a&&a(j.timedReactions)}catch(j){console.error("Failed to fetch reactions:",j)}finally{m(!1)}},w=()=>{$K({particleCount:100,spread:70,origin:{y:.8},colors:["#ff6b6b","#feca57","#48dbfb","#ff9ff3","#54a0ff","#5f27cd"]})},S=async j=>{var k,E;if(f)return;p(j),j==="🎉"&&w();const N=Array.from({length:5},(R,T)=>({id:v+T+1,emoji:j,delay:T*.1,x:(Math.random()-.5)*100}));y(R=>R+5),g(R=>[...R,...N]),setTimeout(()=>{g(R=>R.filter(T=>!N.find(D=>D.id===T.id)))},2500);const _=new Set(c),C=c.has(j);C?(_.delete(j),l(R=>({...R,[j]:Math.max((R[j]||1)-1,0)}))):(_.add(j),l(R=>({...R,[j]:(R[j]||0)+1}))),d(_),localStorage.setItem(`reactions_${e}`,JSON.stringify([..._]));try{const R=`reaction_tokens_${e}`;let T={};try{T=JSON.parse(localStorage.getItem(R)||"{}")}catch{T={}}const{data:D,error:A}=await F.functions.invoke("submit-video-reaction",{body:{shareLinkId:e,videoId:t,emoji:j,action:C?"remove":"add",videoTimestamp:s??null,reactionId:C?(k=T[j])==null?void 0:k.id:void 0,removalToken:C?(E=T[j])==null?void 0:E.token:void 0}});A||(C?delete T[j]:D!=null&&D.reactionId&&(D!=null&&D.removalToken)&&(T[j]={id:D.reactionId,token:D.removalToken}),localStorage.setItem(R,JSON.stringify(T))),A&&(C?(_.add(j),l(V=>({...V,[j]:(V[j]||0)+1}))):(_.delete(j),l(V=>({...V,[j]:Math.max((V[j]||1)-1,0)}))),d(_),localStorage.setItem(`reactions_${e}`,JSON.stringify([..._])),i({title:"Failed to save reaction",variant:"destructive"}))}catch(R){console.error("Failed to submit reaction:",R)}finally{p(null)}};return u?r.jsx("div",{className:"flex items-center justify-center py-3",children:r.jsx(Me,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"relative",children:[r.jsx(Ts,{children:x.map(({id:j,emoji:N,delay:_=0,x:C=0})=>r.jsx(fe.div,{initial:{opacity:1,y:0,scale:1,x:0}
1204,animate:{opacity:[1,1,.8,0],y:-200,scale:[1,1.5,1.8,2],x:C,rotate:[0,-10,10,-5,5,0]},exit:{opacity:0},transition:{duration:2,ease:"easeOut",delay:_},className:"absolute left-1/2 -translate-x-1/2 bottom-full pointer-events-none text-3xl z-10",children:N},j))}),r.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:Cet.map(({emoji:j,label:N})=>{const _=o[j]||0,C=c.has(j),k=f===j;return r.jsxs(fe.button,{onClick:()=>S(j),disabled:k,whileHover:{scale:1.1},whileTap:{scale:.9},className:ge("relative flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all","border hover:border-primary/50",C?"bg-primary/10 border-primary/30 text-foreground":"bg-muted/50 border-border text-muted-foreground hover:text-foreground",k&&"opacity-70"),title:N,children:[r.jsx("span",{className:"text-base",children:j}),_>0&&r.jsx(fe.span,{initial:{scale:1.2},animate:{scale:1},className:"text-xs font-medium min-w-[1rem] text-center",children:_},_)]},j)})})]})},ket=({timedReactions:e,currentTime:t,isPlaying:n})=>{const[s,a]=h.useState([]),i=h.useRef(new Set),o=h.useRef(0);return h.useEffect(()=>{t<1&&i.current.clear()},[t]),h.useEffect(()=>{n&&e.forEach((l,c)=>{const d=`${c}-${l.timestamp}`;if(!i.current.has(d)&&Math.abs(t-l.timestamp)<.5){i.current.add(d);const u=o.current++,m={id:u,emoji:l.emoji,x:10+Math.random()*80,y:60+Math.random()*30};a(f=>[...f,m]),setTimeout(()=>{a(f=>f.filter(p=>p.id!==u))},2e3)}})},[t,n,e]),r.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden z-10",children:r.jsx(Ts,{children:s.map(({id:l,emoji:c,x:d,y:u})=>r.jsx(fe.div,{initial:{opacity:1,y:`${u}%`,x:`${d}%`,scale:.5},animate:{opacity:[1,1,0],y:`${u-40}%`,scale:[.5,1.5,1.8]},exit:{opacity:0},transition:{duration:1.8,ease:"easeOut"},className:"absolute text-2xl sm:text-3xl",style:{left:`${d}%`},children:c},l))})})},Eet=e=>{const t=new Date(e),s=new Date().getTime()-t.getTime(),a=Math.floor(s/6e4),i=Math.floor(a/60),o=Math.floor(i/24);return a<1?"Just now":a<60?`${a}m ago`:i<24?`${i}h ago`:o<7?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})},Aet=({shareToken:e,comments:t,onCommentAdded:n})=>{const{toast:s}=Gr(),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,m]=h.useState(""),[f,p]=h.useState(!1),x=f?t:t.slice(0,5),g=async()=>{if(!o.trim()||!u.trim()){s({title:"Missing Information",description:"Please enter your name and a comment.",variant:"destructive"});return}i(!0);try{const{data:v,error:y}=await F.functions.invoke("submit-video-comment",{body:{shareToken:e,commenterName:o.trim(),commenterEmail:c.trim()||null,comment:u.trim()}});if(y)throw y;if(v!=null&&v.error){const b=(v==null?void 0:v.moderated)===!0;s({title:b?"Comment Not Allowed":"Failed to Post",description:v.error,variant:"destructive"});return}m(""),s({title:"Comment posted!"}),v!=null&&v.comment&&(n==null||n(v.comment))}catch(v){const y=v instanceof Error?v.message:"Failed to post comment.";s({title:"Failed to Post",description:y||"Failed to post comment. Please try again.",variant:"destructive"})}finally{i(!1)}};return r.jsxs(Ie,{className:"p-4 sm:p-6",children:[r.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2 mb-4",children:[r.jsx(Wa,{className:"w-5 h-5 text-primary"}),"Comments",t.length>0&&r.jsx(Se,{variant:"secondary",children:t.length})]}),r.jsxs("div",{className:"space-y-3 mb-6",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"comment-name",className:"text-xs",children:"Your Name *"}),r.jsx(He,{id:"comment-name",value:o,onChange:v=>l(v.target.value),placeholder:"Enter your name",className:"mt-1 h-9",disabled:a,maxLength:100})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"comment-email",className:"text-xs",children:"Email (optional)"}),r.jsx(He,{id:"comment-email",type:"email",value:c,onChange:v=>d(v.target.value),placeholder:"Your email",className:"mt-1 h-9",disabled:a})]})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"comment-text",className:"text-xs",children:"Comment *"}),r.jsx($s,{id:"comment-text",value:u,onChange:v=>m(v.target.value),placeholder:"Write a comment...",className:"resize-none mt-1",rows:2,disabled:a,maxLength:2e3})]}),r.jsx(P,{onClick:g,disabled:!o.trim()||!u.trim()||a,size:"sm",className:"gap-2 gradient-primary text-white",children:a?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 animate-spin"})," Posting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"w-4 h-4"})," Post Comment"]})})]}),t.length>0&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ts,{children:x.map(v=>r.jsxs(fe.div,{initial:{opacity:0,y:10}
1204,animate:{opacity:1,y:0},className:"flex gap-3",children:[r.jsx(an,{className:"h-8 w-8 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:v.commenter_name.charAt(0).toUpperCase()})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[r.jsx("span",{className:"font-medium text-foreground text-sm truncate",children:v.commenter_name}),r.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:Eet(v.created_at)})]}),r.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap break-words",children:v.comment})]})]},v.id))}),t.length>5&&r.jsx(P,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>p(!f),children:f?r.jsxs(r.Fragment,{children:[r.jsx(Mm,{className:"w-4 h-4 mr-1"})," Show Less"]}):r.jsxs(r.Fragment,{children:[r.jsx(Qs,{className:"w-4 h-4 mr-1"})," Show All ",t.length," Comments"]})})]}),t.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"No comments yet. Be the first to comment!"})]})},bz=()=>{const{token:e}=eh(),t=Sr();Gr();const n=IK(),s=ih(),a=()=>{if(_r()){window.history.length>1?t(-1):t("/videos");return}if(s){const L=window.history.length>1?"?back=1":"";t(`/watch-ended${L}`);return}try{window.close()}catch{}setTimeout(()=>{window.closed||(window.history.length>1?t(-1):t("/"))},150)},i=()=>{_r()?t("/videos"):t(s?"/watch-ended":"/")},[o,l]=h.useState(null),[c,d]=h.useState(!0),[u,m]=h.useState(null),[f,p]=h.useState(!1),[x,g]=h.useState(!1),[v,y]=h.useState(""),[b,w]=h.useState(""),[S,j]=h.useState(!1),[N,_]=h.useState(null),[C,k]=h.useState(0),[E,R]=h.useState(!1),[T,D]=h.useState(!1),[A,V]=h.useState(0),[U,O]=h.useState(null),[M,$]=h.useState([]),I=h.useRef(null),B=L=>{l(te=>{if(!te)return te;const ae=te.comments||[];return ae.some(se=>se.id===L.id)?te:{...te,comments:[...ae,L]}})},K=(o==null?void 0:o.ownerSubscriptionTier)&&o.ownerSubscriptionTier!=="starter",Z=K&&(o==null?void 0:o.ownerCompanyLogoUrl);h.useEffect(()=>{e&&H()},[e]);const q=(o==null?void 0:o.video.processing)===!0;h.useEffect(()=>{if(!e||!q)return;const L=window.setInterval(()=>{H(void 0,{silent:!0})},3e3);return()=>window.clearInterval(L)},[e,q]),h.useEffect(()=>{if(!o)return;const L=(Qe,J,de)=>{const ve=document.querySelector(Qe);ve&&ve.setAttribute(J,de)},te=o.video.title||"Video Message",ae=o.video.description||"Watch this personal video message from VIDAREO and build an authentic relationship today.",ne=o.video.thumbnail_url||"https://vidareo.com/og-image.png";document.title=`${te} | VIDAREO`,L('meta[property="og:title"]',"content",te),L('meta[property="og:description"]',"content",ae),L('meta[property="og:image"]',"content",ne),L('meta[property="og:url"]',"content",window.location.href),L('meta[property="og:type"]',"content","video.other"),L('meta[name="twitter:title"]',"content",te),L('meta[name="twitter:description"]',"content",ae),L('meta[name="twitter:image"]',"content",ne),L('meta[name="description"]',"content",ae);const se=document.querySelector("script[data-video-jsonld]");se&&se.remove();const ue=document.createElement("script");ue.type="application/ld+json",ue.setAttribute("data-video-jsonld","true");const Ne={"@context":"https://schema.org","@type":"VideoObject",name:te,description:ae,thumbnailUrl:[ne],uploadDate:o.video.created_at,contentUrl:o.video.video_url};if(o.video.duration){const Qe=Math.max(0,Math.round(o.video.duration));Ne.duration=`PT${Math.floor(Qe/60)}M${Qe%60}S`}return ue.textContent=JSON.stringify(Ne),document.head.appendChild(ue),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",L('meta[property="og:title"]',"content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),L('meta[property="og:description"]',"content","Record, share, and connect with personalized video messages. Build authentic relationships through video."),L('meta[property="og:image"]',"content","https://vidareo.com/og-image.png"),L('meta[property="og:type"]',"content","website"),L('meta[name="twitter:title"]',"content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),L('meta[name="twitter:description"]',"content","Record, share, and connect with personalized video messages."),L('meta[name="twitter:image"]',"content","https://vidareo.com/og-image.png");
1204const Qe=document.querySelector("script[data-video-jsonld]");Qe&&Qe.remove()}},[o]);const H=async(L,te)=>{try{te!=null&&te.silent||d(!0);const{data:ae,error:ne}=await F.functions.invoke("get-shared-video",{body:{shareToken:e,passwordHash:L||null}});if(ne){console.error("Edge function error:",ne),te!=null&&te.silent||m("Failed to load video. Please try again.");return}if(ae.error){te!=null&&te.silent||m(ae.error);return}if(ae.requiresPassword&&!L){g(!0),te!=null&&te.silent||d(!1);return}l(ae),g(!1)}catch(ae){console.error("Error fetching shared video:",ae),te!=null&&te.silent||m("Failed to load video. Please try again.")}finally{te!=null&&te.silent||d(!1)}},X=async L=>{if(L.preventDefault(),!!v.trim()){j(!0),w("");try{const{data:te,error:ae}=await F.functions.invoke("get-shared-video",{body:{shareToken:e,password:v}});if(ae){w("Failed to verify password. Please try again.");return}if(te.error){w(te.error);return}l(te),g(!1)}catch{w("Failed to verify password. Please try again.")}finally{j(!1)}}},G=()=>{if(!(!o||f)){if(o.video.source_type==="youtube")p(!0);else{const L=I.current;if(!L)return;p(!0),L.play().catch(te=>{console.warn("Video playback did not start automatically:",te)})}F.functions.invoke("notify-video-view",{body:{shareToken:e,videoTitle:o.video.title,viewerInfo:{timestamp:new Date().toISOString()}}}).then(({data:L})=>{L!=null&&L.viewId&&_(L.viewId)}).catch(L=>{console.error("Failed to send view notification:",L)})}},ee=async L=>{if(!o||!N)return;const te=L.currentTarget,ae=te.currentTime,ne=te.duration||o.video.duration||0;if(V(ae),ne===0)return;const se=ae/ne*100;if(Math.floor(se/10)>Math.floor(C/10)||se>=95&&C<95)try{await F.functions.invoke("notify-video-view",{body:{shareToken:e,videoTitle:o.video.title,viewId:N,isProgressUpdate:!0,viewerInfo:{watchDuration:Math.round(ae),previousPercentage:C,completed:se>=95}}}),k(se)}catch(Ne){console.error("Failed to update watch progress:",Ne)}},re=async()=>{if(!(!o||!N))try{await F.functions.invoke("notify-video-view",{body:{shareToken:e,videoTitle:o.video.title,viewId:N,isProgressUpdate:!0,viewerInfo:{watchDuration:o.video.duration||0,previousPercentage:C,completed:!0}}}),k(100)}catch(L){console.error("Failed to send completion notification:",L)}},W=L=>{if(!L)return"0:00";const te=Math.floor(L/60),ae=L%60;return`${te}:${ae.toString().padStart(2,"0")}`},Q=L=>new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return c?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsxs("div",{className:"animate-pulse flex flex-col items-center gap-4",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/20 flex items-center justify-center",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}),r.jsx("p",{className:"text-muted-foreground",children:"Loading video..."})]})}):u?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:r.jsx(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"max-w-md w-full",children:r.jsxs(Ie,{className:"p-8 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto mb-4",children:r.jsx(Im,{className:"w-8 h-8 text-destructive"})}),r.jsx("h1",{className:"text-xl font-semibold text-foreground mb-2",children:"Video Unavailable"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:u}),r.jsxs(P,{onClick:i,variant:"outline",children:[r.jsx(aa,{className:"w-4 h-4 mr-2"}),"Go to Homepage"]})]})})}):x?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:r.jsx(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"max-w-md w-full",children:r.jsxs(Ie,{className:"p-6 sm:p-8",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:r.jsx(Ni,{className:"w-8 h-8 text-primary"})}),r.jsx("h1",{className:"text-xl font-semibold text-foreground mb-2",children:"Password Protected"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"This video requires a password to view."})]}),r.jsxs("form",{onSubmit:X,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"password",children:"Password"}
1204),r.jsx(He,{id:"password",type:"password",value:v,onChange:L=>y(L.target.value),placeholder:"Enter password",className:"mt-1"}),b&&r.jsx("p",{className:"text-sm text-destructive mt-1",children:b})]}),r.jsx(P,{type:"submit",className:"w-full",disabled:S||!v.trim(),children:S?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Ni,{className:"w-4 h-4 mr-2"}),"Unlock Video"]})})]}),r.jsx("div",{className:"mt-6 text-center",children:r.jsxs(P,{variant:"ghost",size:"sm",onClick:i,children:[r.jsx(aa,{className:"w-4 h-4 mr-2"}),"Go to Homepage"]})})]})})}):o?r.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[r.jsx("header",{className:"border-b border-border bg-background/95 backdrop-blur-lg sticky top-0 z-40 pt-[env(safe-area-inset-top)]",children:r.jsxs("div",{className:"container mx-auto px-4 h-14 sm:h-16 flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center gap-3",children:Z?r.jsxs(r.Fragment,{children:[r.jsx("img",{src:o.ownerCompanyLogoUrl,alt:"Company logo",className:"h-8 sm:h-10 w-auto object-contain"}),o.ownerFullName&&r.jsxs("span",{className:"text-sm text-muted-foreground hidden sm:block",children:["from ",o.ownerFullName]})]}):r.jsxs(r.Fragment,{children:[r.jsx("img",{src:ch,alt:"VIDAREO",className:"h-7 sm:h-8 w-auto"}),r.jsx("span",{className:"text-sm text-muted-foreground hidden sm:block",children:"Video Message"})]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[o.ctaUrl&&r.jsx(P,{size:"sm",asChild:!0,className:"hidden sm:inline-flex gradient-primary text-white",children:r.jsxs("a",{href:o.ctaUrl,target:"_blank",rel:"noopener noreferrer",children:[r.jsx(bn,{className:"w-3.5 h-3.5 mr-1.5"}),o.ctaLabel||"Learn More"]})}),r.jsxs(P,{variant:"outline",size:"sm",onClick:a,className:"gap-1.5","aria-label":"Close video",children:[r.jsx(aa,{className:"w-4 h-4"}),r.jsx("span",{children:"Close"})]})]})]})}),r.jsx("main",{className:"flex-1 container mx-auto px-4 py-4 sm:py-6 lg:py-8 max-w-6xl safe-area-bottom",children:r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[r.jsxs("div",{className:`${n?"grid grid-cols-5 gap-6":""}`,children:[r.jsxs("div",{className:n?"col-span-3":"",children:[r.jsx(Ie,{className:"overflow-hidden mb-4 sm:mb-6 shadow-lg bg-black",children:r.jsxs("div",{className:"bg-black relative w-full mx-auto max-h-[80vh]",style:{aspectRatio:U??16/9},children:[r.jsx(ket,{timedReactions:M,currentTime:A,isPlaying:f}),o.video.source_type==="youtube"&&o.video.external_video_id?f?r.jsx("iframe",{src:`https://www.youtube.com/embed/${o.video.external_video_id}?autoplay=1`,title:o.video.title,className:"w-full h-full block bg-black relative z-[1]",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):o.video.thumbnail_url?r.jsx("img",{src:o.video.thumbnail_url,alt:o.video.title,className:"w-full h-full object-contain"}):null:r.jsx("video",{ref:L=>{if(I.current=L,_N(L),L){const te=()=>{for(let ae=0;ae<L.textTracks.length;ae++)L.textTracks[ae].mode="disabled"};te(),L.textTracks.onchange=te,L.textTracks.onaddtrack=te}},src:o.video.video_url,poster:o.video.thumbnail_url||void 0,controls:f,preload:"auto",className:"w-full h-full object-contain block bg-black relative z-[1]",playsInline:!0,disableRemotePlayback:!0,onLoadedMetadata:L=>{const te=L.currentTarget;te.videoWidth&&te.videoHeight&&O(te.videoWidth/te.videoHeight)},onPlay:()=>p(!0),onTimeUpdate:ee,onEnded:re}),o.video.source_type!=="youtube"&&r.jsx(ZD,{show:o.showWatermark!==!1&&o.ownerWatermarkEnabled!==!1,customLogoUrl:o.ownerCompanyLogoUrl,useCustom:K&&o.ownerUseCustomWatermark,position:o.ownerWatermarkPosition||"bottom-right",opacity:o.ownerWatermarkOpacity??.7,size:o.ownerWatermarkSize??32}),!f&&!q&&r.jsxs("button",{type:"button",className:"absolute inset-0 z-[2] flex items-center justify-center bg-black/30 hover:bg-black/40 transition-colors group",onClick:G,"aria-label":"Play video",children:[r.jsx(fe.span,{whileHover:{scale:1.1},whileTap:{scale:.95},className:"w-14 h-14 sm:w-16 sm:h-16 lg:w-20 lg:h-20 rounded-full bg-background/90 backdrop-blur-sm flex items-center justify-center shadow-xl",children:r.jsx(Js,{className:"w-5 h-5 sm:w-6 sm:h-6 lg:w-8 lg:h-8 text-primary ml-1"})}),r.jsx("span",{className:"absolute bottom-2 right-2 sm:bottom-3 sm:right-3 lg:bottom-4 lg:right-4 px-2 py-1 sm:px-3 rounded-lg bg-background/80 backdrop-blur-sm text-xs sm:text-sm font-medium text-foreground",children:W(o.video.duration)})]}),q&&r.jsxs("div",{className:"absolute inset-0 z-[3] flex flex-col items-center justify-center gap-3 bg-black/70 backdrop-blur-sm text-center px-6",children:[r.jsx(Me,{className:"w-10 h-10 text-white animate-spin"}),r.jsx("div",{className:"text-white font-medium text-sm sm:text-base",children:"This video is being updated"}),r.jsxs("div",{className:"text-white/70 text-xs sm:text-sm max-w-sm",children:[o.video.processing_stage||"Applying edits…",typeof o.video.processing_progress=="number"&&o.video.processing_progress>0?` (${o.video.processing_progress}%)`:"",". The latest version will play here automatically."]})]})]})}),o.video.source_type==="youtube"&&r.jsxs("p",{className:"text-[11px] text-muted-foreground mb-3 px-1 leading-relaxed",children:["This video is embedded from YouTube. Playback is delivered by YouTube and may set cookies or collect data per the"," ",r.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"Google Privacy Policy"})," ","and"," ",r.jsx("a",{href:"https://www.youtube.com/t/terms",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"YouTube Terms"}),"."]}),!n&&r.jsx(Ie,{className:"p-3 sm:p-4 mb-4",children:r.jsx(yz,{shareLinkId:o.id,videoId:o.video_id,shareToken:e,currentTime:A,onTimedReactionsLoaded:$})})]}),r.jsxs("div",{className:n?"col-span-2 space-y-4":"",children:[n&&r.jsx(Ie,{className:"p-3",children:r.jsx(yz,{shareLinkId:o.id,videoId:o.video_id,shareToken:e,currentTime:A,onTimedReactionsLoaded:$})}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.ctaUrl&&r.jsx(P,{asChild:!0,size:"lg",className:"sm:hidden w-full rounded-full gradient-primary text-white",children:r.jsxs("a",{href:o.ctaUrl,target:"_blank",rel:"noopener noreferrer",children:[r.jsx(bn,{className:"w-4 h-4 mr-2"}),o.ctaLabel||"Learn More"]})}),r.jsx("h1",{className:`font-bold text-foreground leading-tight ${n?"text-lg":"text-xl sm:text-2xl"}`,children:o.video.title}),r.jsxs("div",{className:`flex flex-wrap items-center gap-2 sm:gap-3 lg:gap-4 text-muted-foreground ${n?"text-xs":"text-xs sm:text-sm"}`,children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(fr,{className:"w-3.5 h-3.5"}),Q(o.video.created_at)]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(wr,{className:"w-3.5 h-3.5"}),o.view_count+(f?1:0)," views"]}),o.ownerFullName&&!Z&&r.jsxs("span",{className:"text-muted-foreground",children:["from ",o.ownerFullName]})]}),o.video.description&&r.jsx(Ie,{className:"p-3 sm:p-4 bg-muted/30",children:r.jsx("p",{className:`text-muted-foreground whitespace-pre-wrap ${n?"text-xs":"text-sm"}`,children:o.video.description})}),(o.ownerEmail||o.ownerPhone||o.ownerJobTitle||o.ownerBusinessName)&&r.jsxs(Ie,{className:"p-3 sm:p-4 bg-muted/30",children:[r.jsx("h3",{className:`font-semibold text-foreground mb-2 ${n?"text-xs":"text-sm"}`,children:o.ownerFullName?`Contact ${o.ownerFullName}`:"Contact"}),r.jsxs("div",{className:`space-y-1.5 ${n?"text-xs":"text-sm"}`,children:[(o.ownerJobTitle||o.ownerBusinessName)&&r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.ownerJobTitle&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(I4,{className:"w-3.5 h-3.5 shrink-0"}),o.ownerJobTitle]}),o.ownerJobTitle&&o.ownerBusinessName&&r.jsx("span",{className:"text-muted-foreground
1204/50",children:"·"}),o.ownerBusinessName&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Nx,{className:"w-3.5 h-3.5 shrink-0"}),o.ownerBusinessName]})]}),o.ownerEmail&&r.jsxs("a",{href:`mailto:${o.ownerEmail}`,className:"flex items-center gap-1.5 text-primary hover:underline",children:[r.jsx(zr,{className:"w-3.5 h-3.5 shrink-0"}),o.ownerEmail]}),o.ownerPhone&&r.jsxs("a",{href:`tel:${o.ownerPhone}`,className:"flex items-center gap-1.5 text-primary hover:underline",children:[r.jsx(U4,{className:"w-3.5 h-3.5 shrink-0"}),o.ownerPhone]})]})]}),o.expires_at&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["This link expires on ",Q(o.expires_at)]})]})]})]}),o.allowReplies!==!1&&o.replies&&o.replies.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(Net,{replies:o.replies,shareToken:e,onReplySubmitted:()=>{H()}})}),o.allowComments!==!1&&r.jsx("div",{className:"mt-6",children:r.jsx(Aet,{shareToken:e,comments:o.comments||[],onCommentAdded:B})}),o.allowReplies!==!1&&r.jsx(Ie,{className:`p-4 sm:p-6 mt-6 ${n?"max-w-2xl":""}`,children:r.jsx(Ts,{mode:"wait",children:T?r.jsxs(fe.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center py-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500/20 flex items-center justify-center mx-auto mb-3",children:r.jsx(nt,{className:"w-6 h-6 text-green-500"})}),r.jsx("h3",{className:"font-semibold text-foreground",children:"Reply Sent!"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your video reply has been delivered."}),r.jsx(P,{variant:"outline",className:"mt-4",onClick:()=>D(!1),children:"Send Another Reply"})]},"sent"):E?r.jsx(fe.div,{initial:{opacity:0}
1204,animate:{opacity:1},exit:{opacity:0},children:r.jsx(Lae,{shareToken:e,onSuccess:()=>{R(!1),D(!0),H()},onCancel:()=>R(!1)})},"composer"):r.jsxs(fe.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center",children:[r.jsx(cr,{className:`text-primary mx-auto mb-3 ${n?"w-8 h-8":"w-10 h-10"}`}),r.jsx("h3",{className:"font-semibold text-foreground",children:o.replies&&o.replies.length>0?"Add to the conversation":"Want to reply?"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1 mb-4",children:"Record a video reply to continue the conversation."}),r.jsxs(P,{size:n?"sm":"default",onClick:()=>R(!0),className:"gradient-primary text-white",children:[r.jsx(cr,{className:"w-4 h-4 mr-2"}),"Record Video Reply"]})]},"prompt")})})]})}),r.jsx("footer",{className:"py-4 mt-auto",children:r.jsx("div",{className:"container mx-auto px-4 text-center",children:r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Powered by"," ",r.jsx("a",{href:"/",className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:"VIDAREO"})]})})})]}):null},Tet=()=>{const[e]=iu(),t=Sr(),n=e.get("back")==="1";return r.jsxs("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center px-6 text-center",children:[r.jsx("img",{src:Bh,alt:"VIDAREO",className:"h-8 mb-8"}),r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-foreground mb-3",children:"Thanks for watching!"}),r.jsx("p",{className:"text-muted-foreground mb-8 max-w-sm",children:"This video was shared with you via VIDAREO."}),r.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:[n&&r.jsxs(P,{variant:"outline",onClick:()=>t(-1),className:"w-full",children:[r.jsx(aa,{className:"w-4 h-4 mr-2"}),"Watch again"]}),r.jsxs("a",{href:"https://vidareo.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 h-11 rounded-lg bg-primary text-primary-foreground font-semibold transition-opacity hover:opacity-90",children:["Learn more about VIDAREO",r.jsx(bn,{className:"w-4 h-4"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-10",children:"Send personalized videos to anyone, from anywhere."})]})},Ret=()=>{const{token:e}=eh();return h.useEffect(()=>{const n=`https://lmytxuxvkybtzkbdljha.supabase.co/functions/v1/og-video-meta?token=${e}&format=html`,s=document.createElement("meta");return s.httpEquiv="refresh",s.content=`0;url=${n}`,/bot|crawler|spider|googlebot|facebookexternalhit|twitterbot|linkedinbot|slackbot|whatsapp|telegram/i.test(navigator.userAgent)&&document.head.appendChild(s),()=>{s.parentNode&&s.parentNode.removeChild(s)}},[e]),e?r.jsx(Of,{to:$N(e),replace:!0}):r.jsx(Of,{to:"/",replace:!0})},Oet=()=>{const{token:e}=eh(),t=Sr(),{user:n}=nr(),{toast:s}=Gr(),[a,i]=h.useState(null),[o,l]=h.useState(!0),[c,d]=h.useState(!1),[u,m]=h.useState(!1),[f,p]=h.useState(null);h.useEffect(()=>{e&&x()},[e]);const x=async()=>{l(!0);try{const{data:y,error:b}=await F.functions.invoke("get-invitation",{body:{token:e}});if(b||!y){p("Invitation not found or has expired");return}if(y.error){p(y.error);return}if(y.status!=="pending"){p(`This invitation has already been ${y.status}`);return}if(new Date(y.expires_at)<new Date){p("This invitation has expired");return}i({id:y.id,team_id:y.team_id,email:y.email,status:y.status,team_name:y.team_name})}catch{p("Failed to load invitation")}finally{l(!1)}},g=async()=>{if(!a||!n){t(`/auth?redirect=/invite/${e}`);return}d(!0);try{const{error:y}=await F.from("team_members").insert({team_id:a.team_id,user_id:n.id,role:"member"});if(y)throw y;const{error:b}=await F.from("team_invitations").update({status:"accepted"}).eq("id",a.id);if(b)throw b;s({title:"Welcome to the team!",description:`You've joined ${a.team_name||"the team"} successfully.`}),t("/profile")}catch(y){s({title:"Error",description:y.message||"Failed to accept invitation",variant:"destructive"})}finally{d(!1)}},v=async()=>{if(a){m(!0);try{const{error:y}=await F.from("team_invitations").update({status:"declined"}).eq("id",a.id);if(y)throw y;s({title:"Invitation declined",description:"You've declined the team invitation."}),t("/")}catch(y){s({title:"Error",description:y.message||"Failed to decline invitation",variant:"destructive"})}finally{m(!1)}}};return o?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):f?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:r.jsx(Ie,{className:"max-w-md w-full",children:r.jsxs(lt,{className:"pt-6 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto mb-4",children:r.jsx(zt,{className:"w-8 h-8 text-destructive"})}),r.jsx("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Invalid Invitation"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:f}),r.jsx(P,{onClick:()=>t("/"),children:"Go Home"})]})})}):r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:r.jsx(fe.div,{initial:{opacity:0,y:20}
1204,animate:{opacity:1,y:0},className:"w-full max-w-md",children:r.jsxs(Ie,{children:[r.jsxs(Ot,{className:"text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:r.jsx(jr,{className:"w-8 h-8 text-primary"})}),r.jsx($t,{className:"text-2xl",children:"Team Invitation"}),r.jsx(xr,{children:"You've been invited to join a team on VIDAREO"})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Team Name"}),r.jsx("p",{className:"text-xl font-bold text-foreground",children:(a==null?void 0:a.team_name)||"VIDAREO Team"})]}),!n&&r.jsx("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-lg p-4",children:r.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:"You need an account to join this team. Sign in if you already have one, or create a new account."})}),n?r.jsxs("div",{className:"flex gap-3",children:[r.jsx(P,{variant:"outline",className:"flex-1",onClick:v,disabled:u||c,children:u?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):"Decline"}),r.jsx(P,{className:"flex-1",onClick:g,disabled:u||c,children:c?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(nt,{className:"w-4 h-4 mr-2"}),"Accept"]})})]}):r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(P,{className:"w-full",onClick:()=>t(`/auth?mode=signup&redirect=/invite/${e}`),children:"Create Account & Accept"}),r.jsx(P,{variant:"outline",className:"w-full",onClick:()=>t(`/auth?redirect=/invite/${e}`),children:"I already have an account - Sign In"})]})]})]})})})},Pet={light:"",dark:".dark"},$ae=h.createContext(null);function Vae(){const e=h.useContext($ae);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const Uae=h.forwardRef(({id:e,className:t,children:n,config:s,...a},i)=>{const o=h.useId(),l=`chart-${e||o.replace(/:/g,"")}`;return r.jsx($ae.Provider,{value:{config:s},children:r.jsxs("div",{"data-chart":l,ref:i,className:ge("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[r.jsx(Met,{id:l,config:s}),r.jsx(u0,{children:n})]})})});Uae.displayName="Chart";const wz=e=>e.replace(/[^a-zA-Z0-9_-]/g,""),Det=e=>e&&/^(#[0-9a-fA-F]{3,8}|rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)|rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*[\d.]+\s*\)|hsl\(\s*[\d.]+\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*\)|hsla\(\s*[\d.]+\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*[\d.]+\s*\)|[a-zA-Z]+)$/.test(e.trim())?e.trim():null,Met=({id:e,config:t})=>{const n=Object.entries(t).filter(([a,i])=>i.theme||i.color);if(!n.length)return null;const s=wz(e);return r.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Pet).map(([a,i])=>`
1205${i} [data-chart=${s}] {
1206${n.map(([o,l])=>{var m;const c=((m=l.theme)==null?void 0:m[a])||l.color,d=Det(c||""),u=wz(o);return d?`  --color-${u}: ${d};`:null}).filter(Boolean).join(`
1207`)}
1208}
1209`).join(`
1210`)}})},jz=Wo,Fae=h.forwardRef(({active:e,payload:t,className:n,indicator:s="dot",hideLabel:a=!1,hideIndicator:i=!1,label:o,labelFormatter:l,labelClassName:c,formatter:d,color:u,nameKey:m,labelKey:f},p)=>{const{config:x}=Vae(),g=h.useMemo(()=>{var j;if(a||!(t!=null&&t.length))return null;const[y]=t,b=`${f||y.dataKey||y.name||"value"}`,w=kP(x,y,b),S=!f&&typeof o=="string"?((j=x[o])==null?void 0:j.label)||o:w==null?void 0:w.label;return l?r.jsx("div",{className:ge("font-medium",c),children:l(S,t)}):S?r.jsx("div",{className:ge("font-medium",c),children:S}):null},[o,l,t,a,c,x,f]);if(!e||!(t!=null&&t.length))return null;const v=t.length===1&&s!=="dot";return r.jsxs("div",{ref:p,className:ge("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[v?null:g,r.jsx("div",{className:"grid gap-1.5",children:t.map((y,b)=>{const w=`${m||y.name||y.dataKey||"value"}`,S=kP(x,y,w),j=u||y.payload.fill||y.color;return r.jsx("div",{className:ge("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",s==="dot"&&"items-center"),children:d&&(y==null?void 0:y.value)!==void 0&&y.name?d(y.value,y.name,y,b,y.payload):r.jsxs(r.Fragment,{children:[S!=null&&S.icon?r.jsx(S.icon,{}):!i&&r.jsx("div",{className:ge("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":s==="dot","w-1":s==="line","w-0 border-[1.5px] border-dashed bg-transparent":s==="dashed","my-0.5":v&&s==="dashed"}),style:{"--color-bg":j,"--color-border":j}}),r.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",v?"items-end":"items-center"),children:[r.jsxs("div",{className:"grid gap-1.5",children:[v?g:null,r.jsx("span",{className:"text-muted-foreground",children:(S==null?void 0:S.label)||y.name})]}),y.value&&r.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:y.value.toLocaleStr
1210ing()})]})]})},y.dataKey)})})]})});Fae.displayName="ChartTooltip";const Iet=h.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:s="bottom",nameKey:a},i)=>{const{config:o}=Vae();return n!=null&&n.length?r.jsx("div",{ref:i,className:ge("flex items-center justify-center gap-4",s==="top"?"pb-3":"pt-3",e),children:n.map(l=>{const c=`${a||l.dataKey||"value"}`,d=kP(o,l,c);return r.jsxs("div",{className:ge("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d!=null&&d.icon&&!t?r.jsx(d.icon,{}):r.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),d==null?void 0:d.label]},l.value)})}):null});Iet.displayName="ChartLegend";function kP(e,t,n){if(typeof t!="object"||t===null)return;const s="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:s&&n in s&&typeof s[n]=="string"&&(a=s[n]),a in e?e[a]:e[n]}const Nz=["hsl(var(--primary))","hsl(var(--secondary))","hsl(var(--accent))","hsl(var(--muted))"],Let=()=>{const[e,t]=h.useState({totalUsers:0,totalVideos:0,totalAdmins:0,suspendedUsers:0,newUsersLast7Days:0,newVideosLast7Days:0,totalViews:0,activeUsersToday:0}),[n,s]=h.useState([]),[a,i]=h.useState(!0);h.useEffect(()=>{o()},[]);const o=async()=>{try{i(!0);const[{count:d},{count:u},{count:m},{count:f},{data:p},{data:x},{data:g}]=await Promise.all([F.from("profiles").select("*",{count:"exact",head:!0}),F.from("videos").select("*",{count:"exact",head:!0}),F.from("user_roles").select("*",{count:"exact",head:!0}).eq("role","admin"),F.from("profiles").select("*",{count:"exact",head:!0}).eq("is_suspended",!0),F.from("profiles").select("created_at").gte("created_at",new Date(Date.now()-7*24*60*60*1e3).toISOString()),F.from("videos").select("created_at").gte("created_at",new Date(Date.now()-7*24*60*60*1e3).toISOString()),F.from("videos").select("view_count")]),v=(g==null?void 0:g.reduce((b,w)=>b+(w.view_count||0),0))||0;t({totalUsers:d||0,totalVideos:u||0,totalAdmins:m||0,suspendedUsers:f||0,newUsersLast7Days:(p==null?void 0:p.length)||0,newVideosLast7Days:(x==null?void 0:x.length)||0,totalViews:v,activeUsersToday:0});const y=[];for(let b=6;b>=0;b--){const w=new Date;w.setDate(w.getDate()-b);const S=w.toISOString().split("T")[0],j=(p==null?void 0:p.filter(_=>_.created_at.split("T")[0]===S).length)||0,N=(x==null?void 0:x.filter(_=>_.created_at.split("T")[0]===S).length)||0;y.push({date:w.toLocaleDateString("en-US",{weekday:"short"}),users:j,videos:N})}s(y)}catch(d){console.error("Error fetching admin stats:",d)}finally{i(!1)}},l=[{title:"Total Users",value:e.totalUsers,icon:jr,color:"text-blue-500",bg:"bg-blue-500/10"},{title:"Total Videos",value:e.totalVideos,icon:cr,color:"text-green-500",bg:"bg-green-500/10"},{title:"Total Views",value:e.totalViews,icon:wr,color:"text-sky-500",bg:"bg-sky-500/10"},{title:"Admins",value:e.totalAdmins,icon:mi,color:"text-amber-500",bg:"bg-amber-500/10"},{title:"New Users (7d)",value:e.newUsersLast7Days,icon:Po,color:"text-emerald-500",bg:"bg-emerald-500/10"},{title:"New Videos (7d)",value:e.newVideosLast7Days,icon:Ga,color:"text-cyan-500",bg:"bg-cyan-500/10"},{title:"Suspended",value:e.suspendedUsers,icon:Ay,color:"text-red-500",bg:"bg-red-500/10"}],c=[{name:"Active Users",value:e.totalUsers-e.suspendedUsers},{name:"Suspended",value:e.suspendedUsers},{name:"Admins",value:e.totalAdmins}];return a?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4",children:l.map(d=>r.jsx(Ie,{className:"relative overflow-hidden",children:r.jsxs(lt,{className:"p-4",children:[r.jsx("div",{className:`inline-flex p-2 rounded-lg ${d.bg} mb-2`,children:r.jsx(d.icon,{className:`h-4 w-4 ${d.color}`})}),r.jsx("p",{className:"text-2xl font-bold",children:d.value.toLocaleString()}),r.jsx("p",{className:"text-xs text-muted-foreground",children:d.title})]})},d.title))}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-lg",children:"Weekly Activity"}),r.jsx(xr,{children:"New users and videos over the last 7 days"})]}),r.jsx(lt,{children:r.jsx(Uae,{config:{users:{label:"Users",color:"hsl(var(--primary))"},videos:{label:"Videos",color:"hsl(var(--secondary))"}},className:"h-[250px]",children:r.jsx(u0,{width:"100%",height:"100%",children:r.jsxs(mae,{data:n,children:[r.jsx(Yf,{dataKey:"date",fontSize:12,tickLine:!1,axisLine
1210:!1}),r.jsx(Gf,{fontSize:12,tickLine:!1,axisLine:!1}),r.jsx(jz,{content:r.jsx(Fae,{})}),r.jsx(tu,{dataKey:"users",fill:"hsl(var(--primary))",radius:[4,4,0,0]}),r.jsx(tu,{dataKey:"videos",fill:"hsl(var(--secondary))",radius:[4,4,0,0]})]})})})})]}),r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-lg",children:"User Distribution"}),r.jsx(xr,{children:"Breakdown of user types"})]}),r.jsx(lt,{children:r.jsx("div",{className:"h-[250px] flex items-center justify-center",children:r.jsx(u0,{width:"100%",height:"100%",children:r.jsxs(nJe,{children:[r.jsx(xu,{data:c.filter(d=>d.value>0),cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",label:({name:d,value:u})=>`${d}: ${u}`,children:c.map((d,u)=>r.jsx(W2,{fill:Nz[u%Nz.length]},`cell-${u}`))}),r.jsx(jz,{})]})})})})]})]}),r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsx($t,{className:"text-lg",children:"System Health"})}),r.jsx(lt,{children:r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-green-500/10 border border-green-500/20",children:[r.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"Database"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Healthy"})]})]}),r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-green-500/10 border border-green-500/20",children:[r.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"Auth"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Operational"})]})]}),r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-green-500/10 border border-green-500/20",children:[r.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"Storage"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Online"})]})]}),r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-green-500/10 border border-green-500/20",children:[r.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"Edge Functions"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Running"})]})]})]})})]})]})},$et=({userEmail:e,userName:t})=>{const[n,s]=h.useState(!1),[a,i]=h.useState(!1),[o,l]=h.useState(null),[c,d]=h.useState(null),u=async()=>{if(!e){d("No email address available");return}try{i(!0),d(null);const{data:x,error:g}=await F.functions.invoke("admin-get-user-billing",{body:{userEmail:e}});if(g)throw g;if(x!=null&&x.error)throw new Error(x.error);l(x)}catch(x){console.error("Error fetching billing data:",x),d(x instanceof Error?x.message:"Failed to fetch billing data"),Pe.error("Failed to fetch billing data")}finally{i(!1)}},m=x=>{s(x),x&&!o&&u()},f=(x,g="usd")=>new Intl.NumberFormat("en-US",{style:"currency",currency:g.toUpperCase()}).format(x/100),p=x=>{switch(x){case"active":return r.jsx(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:"Active"});case"canceled":return r.jsx(Se,{variant:"destructive",children:"Canceled"});case"past_due":return r.jsx(Se,{className:"bg-orange-500/10 text-orange-600 border-orange-500/20",children:"Past Due"});case"paid":return r.jsx(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:"Paid"});case"open":return r.jsx(Se,{variant:"secondary",children:"Open"});case"draft":return r.jsx(Se,{variant:"outline",children:"Draft"});default:return r.jsx(Se,{variant:"secondary",children:x})}};return r.jsxs(It,{open:n,onOpenChange:m,children:[r.jsx(wv,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",title:"View billing",className:"text-green-600 hover:text-green-700 hover:bg-green-50",children:r.jsx(dw,{className:"h-4 w-4"})})}),r.jsxs(Dt,{className:"max-w-2xl max-h-[80vh]",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(vi,{className:"h-5 w-5"}),"Billing Details"]}
1210),r.jsxs($r,{children:["Stripe billing information for ",t||e||"user"]})]}),a?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):c?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[r.jsx(Im,{className:"h-8 w-8 mb-2 text-destructive"}),r.jsx("p",{className:"text-sm",children:c}),r.jsx(P,{variant:"outline",size:"sm",className:"mt-4",onClick:u,children:"Retry"})]}):o!=null&&o.hasStripeCustomer?r.jsx(Io,{className:"max-h-[60vh] pr-4",children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Spent"}),r.jsx("p",{className:"text-2xl font-bold text-green-600",children:f(o.totalSpent,o.currency)})]}),r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Customer Since"}),r.jsx("p",{className:"text-lg font-medium",children:o.customerCreated?new Date(o.customerCreated).toLocaleDateString():"N/A"})]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(Ga,{className:"h-4 w-4"}),"Subscriptions (",o.subscriptions.length,")"]}),o.subscriptions.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No subscriptions"}):r.jsx("div",{className:"space-y-3",children:o.subscriptions.map(x=>r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:x.productName}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[f(x.priceAmount,x.priceCurrency),"/",x.interval]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[x.cancelAtPeriodEnd&&r.jsx(Se,{variant:"outline",className:"text-orange-600",children:"Cancels at period end"}),p(x.status)]})]}),r.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:r.jsxs("p",{children:["Current period: ",new Date(x.currentPeriodStart).toLocaleDateString()," - ",new Date(x.currentPeriodEnd).toLocaleDateString()]})})]},x.id))})]}),r.jsx(Kl,{}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(vi,{className:"h-4 w-4"}),"Payment Methods (",o.paymentMethods.length,")"]}),o.paymentMethods.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No payment methods"}):r.jsx("div",{className:"flex flex-wrap gap-2",children:o.paymentMethods.map(x=>r.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border px-3 py-2",children:[r.jsx("span",{className:"capitalize font-medium",children:x.brand}),r.jsxs("span",{className:"text-muted-foreground",children:["•••• ",x.last4]}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[x.expMonth,"/",x.expYear]})]},x.id))})]}),r.jsx(Kl,{}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(E_,{className:"h-4 w-4"}),"Recent Invoices (",o.invoices.length,")"]}),o.invoices.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No invoices"}):r.jsx("div",{className:"space-y-2",children:o.invoices.map(x=>r.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[r.jsx("div",{className:"flex items-center gap-4",children:r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:x.number||x.id}),r.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(x.created).toLocaleDateString()})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"font-medium",children:f(x.amountPaid||x.amountDue,x.currency)}),x.status&&p(x.status),x.hostedInvoiceUrl&&r.jsx(P,{variant:"ghost",size:"icon",asChild:!0,children:r.jsx("a",{href:x.hostedInvoiceUrl,target:"_blank",rel:"noopener noreferrer",children:r.jsx(bn,{className:"h-4 w-4"})})})]})]},x.id))})]})]})}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[r.jsx(vi,{className:"h-8 w-8 mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No Stripe customer found"}),r.jsx("p",{className:"text-xs mt-1",children:"This user has never made a purchase"})]})]})]})},Vet=({userId:e,userName:t,userEmail:n,onSave:s})=>{const[a,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),[u,m]=h.useState(!1),[f,p]=h.useState(!1),[x,g]=h.useState(!1),[v,y]=h.useState(!1),[b,w]=h.useState(""),[S,j]=h.useState(""),[N,_]=h.useState(""),[C,k]=h.useState("");h.useEffect(()=>{a&&E()},[a,e]);const E=async()=>{var A,V;l(!0);try{const{data:U,error:O}=await F.from("user_custom_limits").select("*").eq("user_id",e).maybeSingle();if(O)throw O;U?(m(!0),p(U.max_recordings!==null),g(U.max_shares!==null),y(U.max_duration_seconds!==null),w(((A=U.max_recordings)==null?void 0:A.toString())||""),j(((V=U.max_shares)==null?void 0:V.toString())||""),_(U.max_duration_seconds?(U.max_duration_seconds/60).toString():""),k(U.notes||"")):(m(!1),R())}catch(U){console.error("Error fetching custom limits:",U),Pe.error("Failed to load custom limits")}finally{l(!1)}},R=()=>{p(!1),g(!1),y(!1),w(""),j(""),_(""),k("")},T=async()=>{d(!0);try{const A={max_recordings:f&&b?parseInt(b):null,max_shares:x&&S?parseInt(S):null,max_duration_seconds:v&&N?parseInt(N)*60:null,notes:C.trim()||null};if(A.max_recordings===null&&A.max_shares===null&&A.max_duration_seconds===null&&!A.notes)if(u){const{error:U}=await F.from("user_custom_limits").delete().eq("user_id",e);if(U)throw U;Pe.success("Custom limits removed")}else Pe.info("No custom limits to save");else{const{error:U}=await F.from("user_custom_limits").upsert({user_id:e,...A,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(U)throw U;Pe.success("Custom limits saved")}i(!1),s==null||s()}catch(A){console.error("Error saving custom limits:",A),Pe.error("Failed to save custom limits")}finally{d(!1)}},D=async()=>{d(!0);try{const{error:A}=await F.from("user_custom_limits").delete().eq("user_id",e);if(A)throw A;Pe.success("All custom limits removed"),R(),m(!1),i(!1),s==null||s()}catch(A){console.error("Error removing custom limits:",A),Pe.error("Failed to remove custom limits")}finally{d(!1)}};return r.jsxs(It,{open:a,onOpenChange:i,children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(wv,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:u?"text-sky-600 hover:text-sky-700 hover:bg-sky-50":"text-muted-foreground hover:text-foreground",children:r.jsx(QH,{className:"h-4 w-4"})})})}),r.jsx(yt,{children:"Custom Limits"})]}),r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Custom Usage Limits"}),r.jsxs($r,{children:["Set custom limits for ",t||n||"this user",". These override the default tier limits."]})]}),o?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Me,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"space-y-6 py-4",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"enable-recordings",className:"text-sm font-medium",children:"Custom Recording Limit"}),r.jsx(rr,{id:"enable-recordings",checked:f,onCheckedChange:p})]}),f&&r.jsxs("div",{className:"pl-0",children:[r.jsx(He,{type:"number",min:"0",placeholder:"Max recordings per month",value:b,onChange:A=>w(A.target.value)}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Default: 5 (free), unlimited (paid)"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"enable-shares",className:"text-sm font-medium",children:"Custom Share Limit"}),r.jsx(rr,{id:"enable-shares",checked:x,onCheckedChange:g})]}),x&&r.jsxs("div",{className:"pl-0",children:[r.jsx(He,{type:"number",min:"0",placeholder:"Max shares per month",value:S,onChange:A=>j(A.target.value)}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Default: 5 (free), unlimited (paid)"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(ye,{htmlFor:"enable-duration",className:"text-sm font-medium",children:"Custom Duration Limit"}),r.jsx(rr,{id:"enable-duration",checked:v,onCheckedChange:y})]}),v&&r.jsxs("div",{className:"pl-0",children:[r.jsx(He,{type:"number",min:"1",placeholder:"Max duration in minutes",value:N,onChange:A=>_(A.target.value)}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Default: 2 min (free), 10 min (paid)"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"notes",className:"text-sm font-medium",children:"Admin Notes"}),r.jsx($s,{id:"notes",placeholder:"Optional notes about why these limits were set...",value:C,onChange:A=>k(A.target.value),rows:2})]})]}),r.jsxs(Fr,{className:"flex-col sm:flex-row gap-2",children:[u&&r.jsx(P,{variant:"outline",onClick:D,disabled:c,
1210className:"text-destructive hover:text-destructive",children:"Remove All Limits"}),r.jsxs("div",{className:"flex gap-2 ml-auto",children:[r.jsx(P,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),r.jsxs(P,{onClick:T,disabled:c,children:[c&&r.jsx(Me,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Limits"]})]})]})]})]})},Uet=[{value:"starter",label:"Starter (Free)",description:"5 videos/month, 5 shares/month"},{value:"professional",label:"Professional",description:"Unlimited videos & shares"},{value:"team",label:"Team",description:"Team features + unlimited usage"}],Fet=({userId:e,userName:t,userEmail:n,currentTier:s,isGifted:a=!1,onSave:i})=>{const[o,l]=h.useState(!1),[c,d]=h.useState(s||"starter"),[u,m]=h.useState(a),[f,p]=h.useState(!1);h.useEffect(()=>{o&&(d(s||"starter"),m(a))},[o,s,a]);const x=async()=>{p(!0);try{const{error:v}=await F.from("profiles").update({subscription_tier:c,is_admin_assigned_tier:u,updated_at:new Date().toISOString()}).eq("user_id",e);if(v)throw v;const y=u?" (Gifted)":"";Pe.success(`Subscription updated to ${c}${y} for ${t||n}`),l(!1),i()}catch(v){console.error("Error updating subscription:",v),Pe.error("Failed to update subscription tier")}finally{p(!1)}},g=t||n||"this user";return r.jsxs(It,{open:o,onOpenChange:l,children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(wv,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"text-sky-600 hover:text-sky-700 hover:bg-sky-50",children:r.jsx(Ms,{className:"h-4 w-4"})})})}),r.jsx(yt,{children:"Assign subscription plan"})]}),r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Assign Subscription Plan"}),r.jsxs($r,{children:["Manually assign a subscription tier for ",g,". This bypasses billing."]})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"tier",children:"Subscription Tier"}),r.jsxs(kn,{value:c,onValueChange:d,children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"Select tier"})}),r.jsx(jn,{children:Uet.map(v=>r.jsx(_t,{value:v.value,children:r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{children:v.label}),r.jsx("span",{className:"text-xs text-muted-foreground",children:v.description})]})},v.value))})]})]}),r.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(ye,{htmlFor:"gifted-toggle",className:"text-sm font-medium",children:"Gifted Account"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Bypass billing - user gets full access without being charged"})]}),r.jsx(rr,{id:"gifted-toggle",checked:u,onCheckedChange:m})]}),u&&r.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-3",children:r.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-400",children:[r.jsx("strong",{children:"Note:"})," This is a manual override that bypasses Stripe billing. The user won't be charged but will have full access to the selected tier's features."]})})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>l(!1),disabled:f,children:"Cancel"}),r.jsx(P,{onClick:x,disabled:f,children:f?"Saving...":"Save Changes"})]})]})]})},Bet=()=>{const e=Sr(),{user:t}=nr(),{startImpersonation:n}=th(),[s,a]=h.useState([]),[i,o]=h.useState(!0),[l,c]=h.useState(""),[d,u]=h.useState(null),[m,f]=h.useState({full_name:"",email:""}),[p,x]=h.useState(""),[g,v]=h.useState(!1),[y,b]=h.useState(null),[w,S]=h.useState(!1),[j,N]=h.useState(null),[_,C]=h.useState(""),[k,E]=h.useState(""),[R,T]=h.useState(!1),[D,A]=h.useState(null),[V,U]=h.useState({}),[O,M]=h.useState(""),[$,I]=h.useState(""),[B,K]=h.useState([]),[Z,q]=h.useState(!1),[H,X]=h.useState(!1),[G,ee]=h.useState(null),[re,W]=h.useState({}),[Q,L]=h.useState("both");h.useEffect(()=>{te(),ne();const le=[],ke=new Date;for(let Ee=0;Ee<12;Ee++){const ot=new Date(ke.getUTCFullYear(),ke.getUTCMonth()-Ee,1),gt=`${ot.getFullYear()}-${String(ot.getMonth()+1).padStart(2,"0")}`;le.push(gt)}K(le),I(le[0])},[]),h.useEffect(()=>{$&&ae($)},[$]);const te=async()=>{try{o(!0);const{data:le,error:ke}=await F.from("profiles").select("*").order("created_at",{ascending:!1});if(ke)throw ke;const{data:Ee,error:ot}=await F.from("user_roles").select("user_id").eq("role","admin");if(ot)throw ot;const gt=new Set((Ee==null?void 0:Ee.map(Ct=>Ct.user_id))||[]),Nt=(le||[]).map(Ct=>({...Ct,isAdmin:gt.has(Ct.user_id)}));a(Nt)}catch(le){console.error("Error fetching users:",le),Pe.error("Failed to load users")}finally{o(!1)}},ae=async le=>{q(!0);try{const{data:ke,error:Ee}=await F.functions.invoke("admin-get-all-usage",{body:le?{monthYear:le}:void 0});if(Ee)throw Ee;if(ke!=null&&ke.error)throw new Error(ke.error);U(ke.usage||{}),M(ke.monthYear||"")}catch(ke){console.error("Error fetching usage stats:",ke)}finally{q(!1)}},ne=async()=>{try{const{data:le,error:ke}=await F.from("user_custom_limits").select("user_id, max_recordings, max_shares, max_duration_seconds");if(ke)throw ke;const Ee={};
1210(le||[]).forEach(ot=>{Ee[ot.user_id]={max_recordings:ot.max_recordings,max_shares:ot.max_shares,max_duration_seconds:ot.max_duration_seconds}}),W(Ee)}catch(le){console.error("Error fetching custom limits:",le)}},se=le=>{var Ee;const ke=(Ee=re[le])==null?void 0:Ee.max_recordings;return ke??5},ue=le=>{var Ee;const ke=(Ee=re[le])==null?void 0:Ee.max_shares;return ke??5},Ne=le=>{const ke=re[le];return ke?ke.max_recordings!==null||ke.max_shares!==null||ke.max_duration_seconds!==null:!1},Qe=le=>{const[ke,Ee]=le.split("-");return new Date(parseInt(ke),parseInt(Ee)-1,1).toLocaleDateString("en-US",{month:"long",year:"numeric"})},J=()=>!$||B.length===0?!0:$===B[0],de=le=>{u(le),f({full_name:le.full_name||"",email:le.email||""})},ve=async()=>{if(d)try{const{error:le}=await F.from("profiles").update({full_name:m.full_name,email:m.email,updated_at:new Date().toISOString()}).eq("id",d.id);if(le)throw le;Pe.success("User updated successfully"),u(null),te()}catch(le){console.error("Error updating user:",le),Pe.error("Failed to update user")}},Le=async le=>{if(le.user_id===(t==null?void 0:t.id)){Pe.error("You cannot delete your own account");return}try{const{data:ke,error:Ee}=await F.functions.invoke("delete-user-admin",{body:{userId:le.user_id}});if(Ee)throw Ee;if(ke!=null&&ke.error)throw new Error(ke.error);Pe.success("User deleted successfully"),te()}catch(ke){console.error("Error deleting user:",ke),Pe.error(ke instanceof Error?ke.message:"Failed to delete user")}},$e=async()=>{const le=k.trim().toLowerCase();if(!le){Pe.error("Email is required");return}if(le===((t==null?void 0:t.email)??"").toLowerCase()){Pe.error("You cannot delete your own account");return}try{const{data:ke,error:Ee}=await F.functions.invoke("delete-user-by-email-admin",{body:{email:le}});if(Ee)throw Ee;if(ke!=null&&ke.error)throw new Error(ke.error);Pe.success(`Deleted ${(ke==null?void 0:ke.deletedCount)??0} user(s)`),T(!1),E(""),te()}catch(ke){console.error("Error deleting user by email:",ke),Pe.error(ke instanceof Error?ke.message:"Failed to delete user")}},De=async le=>{try{if(le.isAdmin){const{error:ke}=await F.from("user_roles").delete().eq("user_id",le.user_id).eq("role","admin");if(ke)throw ke;Pe.success("Admin role removed")}else{const{error:ke}=await F.from("user_roles").insert({user_id:le.user_id,role:"admin"});if(ke)throw ke;Pe.success("Admin role granted")}te()}catch(ke){console.error("Error toggling admin:",ke),Pe.error("Failed to update admin status")}},oe=le=>{b(le),x(""),v(!0)},xe=async()=>{y&&(await n(y.user_id,p),v(!1),b(null),e("/videos"))},Ze=le=>{N(le),C(""),S(!0)},it=async()=>{if(!j)return;const le=j.is_suspended?"unsuspend":"suspend";try{const{data:ke,error:Ee}=await F.functions.invoke("suspend-user-admin",{body:{userId:j.user_id,action:le,reason:_}});if(Ee)throw Ee;if(ke!=null&&ke.error)throw new Error(ke.error);Pe.success(`User ${le}ed successfully`),S(!1),N(null),te()}catch(ke){console.error(`Error ${le}ing user:`,ke),Pe.error(ke instanceof Error?ke.message:`Failed to ${le} user`)}},ct=(le,ke)=>{ee(le),L(ke),X(!0)},Oe=async()=>{if(!G)return;const le=G,ke=Q;if(le.subscription_tier&&le.subscription_tier!=="starter"){Pe.error("Usage reset is only available for free (starter) tier users"),X(!1);return}A(le.user_id);try{const{data:Ee,error:ot}=await F.functions.invoke("reset-user-usage-admin",{body:{userId:le.user_id,resetType:ke}});if(ot)throw ot;if(Ee!=null&&Ee.error)throw new Error(Ee.error);const gt={recordings:"recordings",shares:"shares",both:"recordings and shares"};Pe.success(`Successfully reset ${gt[ke]} for ${le.full_name||le.email}`),await ae($)}catch(Ee){console.error("Error resetting usage:",Ee),Pe.error(Ee instanceof Error?Ee.message:"Failed to reset usage")}finally{A(null),X(!1),ee(null)}},pe=s.filter(le=>{var ke,Ee;return((ke=le.email)==null?void 0:ke.toLowerCase().includes(l.toLowerCase()))||((Ee=le.full_name)==null?void 0:Ee.toLowerCase().includes(l.toLowerCase()))});return r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"h-5 w-5"}),"User Management"]}),r.jsxs(xr,{children:["View and manage all user accounts (",s.length," total)"]})]}),r.jsxs("div",{className:"relative",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}
1210),r.jsx(He,{placeholder:"Search users...",value:l,onChange:le=>c(le.target.value),className:"pl-9 w-64"})]})]})}),r.jsxs(lt,{children:[r.jsx("div",{className:"mb-6 rounded-lg border border-border bg-muted/20 p-4",children:r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete user by email"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this if an account can still log in but no longer appears in the list."})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:items-center",children:[r.jsx(He,{placeholder:"[email protected]",value:k,onChange:le=>E(le.target.value),className:"sm:w-64"}),r.jsxs(cs,{open:R,onOpenChange:T,children:[r.jsx(Uf,{asChild:!0,children:r.jsx(P,{variant:"destructive",disabled:!k.trim(),children:"Delete"})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{className:"text-destructive",children:"⚠️ Permanently Delete User"}),r.jsx(Jn,{asChild:!0,children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("p",{children:["You are about to permanently delete ",r.jsx("strong",{children:k.trim()||"this user"}),"."]}),r.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-3 space-y-2",children:[r.jsx("p",{className:"font-medium text-destructive",children:"This action will permanently delete:"}),r.jsxs("ul",{className:"list-disc list-inside text-sm space-y-1 text-muted-foreground",children:[r.jsx("li",{children:"All videos, thumbnails, and transcriptions"}),r.jsx("li",{children:"All share links and view analytics"}),r.jsx("li",{children:"Billing information and subscription data"}),r.jsx("li",{children:"Team memberships and invitations"}),r.jsx("li",{children:"User preferences and custom settings"}),r.jsx("li",{children:"All notification and activity history"})]})]}),r.jsx("p",{className:"text-destructive font-medium",children:"This action cannot be undone. All data will be permanently deleted and unrecoverable."})]})})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:$e,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Yes, permanently delete user"})]})]})]})]})]})}),i?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"User"}),r.jsx(ar,{children:"Email"}),r.jsx(ar,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{children:"Usage"}),r.jsxs(kn,{value:$,onValueChange:I,children:[r.jsxs(wn,{className:"h-7 w-[140px] text-xs",children:[r.jsx(Ga,{className:"h-3 w-3 mr-1"}),r.jsx(En,{placeholder:"Select month"})]}),r.jsx(jn,{children:B.map(le=>r.jsx(_t,{value:le,className:"text-xs",children:Qe(le)},le))})]}),Z&&r.jsx("div",{className:"animate-spin h-3 w-3 border border-primary border-t-transparent rounded-full"})]})}),r.jsx(ar,{children:"Plan"}),r.jsx(ar,{children:"Role"}),r.jsx(ar,{children:"Joined"}),r.jsx(ar,{className:"text-right",children:"Actions"})]})}),r.jsx(du,{children:pe.length===0?r.jsx(pr,{children:r.jsx(Te,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"No users found"})}):pe.map(le=>{var ke,Ee,ot,gt;return r.jsxs(pr,{children:[r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:le.avatar_url||void 0,alt:le.full_name||"User",className:"object-cover"}),r.jsx(on,{className:"bg-primary/10 text-primary font-medium",children:(le.full_name||le.email||"U")[0].toUpperCase()})]}),r.jsx("span",{className:"font-medium",children:le.full_name||"No name"})]})}),r.jsx(Te,{className:"text-muted-foreground",children:le.email||"No email"}),r.jsx(Te,{children:!le.subscription_tier||le.subscription_tier==="starter"?r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[r.jsx(cr,{className:"h-3.5 w-3.5 text-muted-foreground"}),r.jsxs("span",{className:`font-medium ${(((ke=V[le.user_id])==null?void 0:ke.recordings)||0)>=se(le.user_id)?"text-destructive":""}`,children:[((Ee=V[le.user_id])==null?void 0:Ee.recordings)||0,"/",se(le.user_id)]})]})}),r.jsxs(yt,{children:["Recordings this month",Ne(le.user_id)&&" (custom limit)"]})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[r.jsx(Es,{className:"h-3.5 w-3.5 text-muted-foreground"}),r.jsxs("span",{className:`font-medium ${(((ot=V[le.user_id])==null?void 0:ot.shares)||0)>=ue(le.user_id)?"text-destructive":""}`,children:[((gt=V[le.user_id])==null?void 0:gt.shares)||0,"/",ue(le.user_id)]})]})}),r.jsxs(yt,{children:["Shares this month",Ne(le.user_id)&&" (custom limit)"]})]}),Ne(le.user_id)&&r.jsx(Se,{variant:"outline",className:"text-xs bg-amber-500/10 text-amber-600 border-amber-500/30",children:"Custom"})]}):r.jsx(Se,{variant:"outline",className:"text-xs",children:"Unlimited"})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex flex-wrap gap-1",children:[!le.subscription_tier||le.subscription_tier==="starter"?r.jsx(Se,{variant:"outline",className:"text-xs",children:"Free"}):r.jsx(Se,{className:"text-xs capitalize bg-primary/10 text-primary border-primary/30",children:le.
1210subscription_tier}),le.is_admin_assigned_tier&&r.jsx(Se,{variant:"outline",className:"text-xs bg-purple-500/10 text-purple-600 border-purple-500/30",children:"Gifted"})]})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex flex-wrap gap-1",children:[le.isAdmin?r.jsxs(Se,{className:"gap-1",children:[r.jsx(mi,{className:"h-3 w-3"}),"Admin"]}):r.jsx(Se,{variant:"secondary",children:"User"}),le.is_suspended&&r.jsxs(Se,{variant:"destructive",className:"gap-1",children:[r.jsx(Ay,{className:"h-3 w-3"}),"Suspended"]})]})}),r.jsx(Te,{className:"text-muted-foreground",children:new Date(le.created_at).toLocaleDateString()}),r.jsx(Te,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[(!le.subscription_tier||le.subscription_tier==="starter")&&J()&&r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",title:"Reset monthly usage (current month only)",disabled:D===le.user_id,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",children:r.jsx(Wd,{className:`h-4 w-4 ${D===le.user_id?"animate-spin":""}`})})}),r.jsxs(So,{align:"end",children:[r.jsx(tr,{onClick:()=>ct(le,"recordings"),children:"Reset Recordings"}),r.jsx(tr,{onClick:()=>ct(le,"shares"),children:"Reset Shares"}),r.jsx(tr,{onClick:()=>ct(le,"both"),children:"Reset Both"})]})]}),r.jsx(Vet,{userId:le.user_id,userName:le.full_name,userEmail:le.email,onSave:()=>{ae($),ne()}}),r.jsx(Fet,{userId:le.user_id,userName:le.full_name,userEmail:le.email,currentTier:le.subscription_tier||"starter",isGifted:le.is_admin_assigned_tier,onSave:te}),r.jsx($et,{userEmail:le.email,userName:le.full_name}),le.user_id!==(t==null?void 0:t.id)&&r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>oe(le),title:"View as this user",className:"text-amber-600 hover:text-amber-700 hover:bg-amber-50",children:r.jsx(wr,{className:"h-4 w-4"})}),r.jsxs(It,{children:[r.jsx(wv,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>de(le),children:r.jsx(B4,{className:"h-4 w-4"})})}),r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Edit User"}),r.jsx($r,{children:"Update user profile information"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"full_name",children:"Full Name"}),r.jsx(He,{id:"full_name",value:m.full_name,onChange:Nt=>f(Ct=>({...Ct,full_name:Nt.target.value}))})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Email"}),r.jsx(He,{id:"email",type:"email",value:m.email,onChange:Nt=>f(Ct=>({...Ct,email:Nt.target.value}))})]})]}),r.jsx(Fr,{children:r.jsx(P,{onClick:ve,children:"Save Changes"})})]})]}),le.user_id!==(t==null?void 0:t.id)&&r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>De(le),title:le.isAdmin?"Remove admin":"Make admin",children:le.isAdmin?r.jsx(Lue,{className:"h-4 w-4"}):r.jsx(mi,{className:"h-4 w-4"})}),le.user_id!==(t==null?void 0:t.id)&&r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>Ze(le),title:le.is_suspended?"Unsuspend user":"Suspend user",className:le.is_suspended?"text-green-600 hover:text-green-700 hover:bg-green-50":"text-orange-600 hover:text-orange-700 hover:bg-orange-50",children:le.is_suspended?r.jsx(vk,{className:"h-4 w-4"}):r.jsx(Ay,{className:"h-4 w-4"})}),le.user_id!==(t==null?void 0:t.id)&&r.jsxs(cs,{children:[r.jsx(Uf,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",children:r.jsx(Xr,{className:"h-4 w-4"})})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{className:"text-destructive",children:"⚠️ Permanently Delete User"}),r.jsx(Jn,{asChild:!0,children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("p",{children:["You are about to permanently delete ",r.jsx("strong",{children:le.full_name||le.email||"this user"}),"."]}),r.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-3 space-y-2",children:[r.jsx("p",{className:"font-medium text-destructive",children:"This action will permanently delete:"}),r.jsxs("ul",{className:"list-disc list-inside text-sm space-y-1 text-muted-foreground",children:[r.jsx("li",{children:"All videos, thumbnails, and transcriptions"}
1210),r.jsx("li",{children:"All share links and view analytics"}),r.jsx("li",{children:"Billing information and subscription data"}),r.jsx("li",{children:"Team memberships and invitations"}),r.jsx("li",{children:"User preferences and custom settings"}),r.jsx("li",{children:"All notification and activity history"})]})]}),r.jsx("p",{className:"text-destructive font-medium",children:"This action cannot be undone. All data will be permanently deleted and unrecoverable."})]})})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:()=>Le(le),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Yes, permanently delete user"})]})]})]})]})})]},le.id)})})]})]})]}),r.jsx(It,{open:g,onOpenChange:v,children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(wr,{className:"h-5 w-5 text-amber-600"}),"View as User"]}),r.jsxs($r,{children:["You will see the app exactly as ",(y==null?void 0:y.full_name)||(y==null?void 0:y.email)||"this user"," sees it. All actions will be disabled while viewing."]})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted rounded-lg",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:(y==null?void 0:y.avatar_url)||void 0}),r.jsx(on,{className:"bg-primary/10 text-primary",children:((y==null?void 0:y.full_name)||(y==null?void 0:y.email)||"U")[0].toUpperCase()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:(y==null?void 0:y.full_name)||"No name"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:y==null?void 0:y.email})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"reason",children:"Reason (optional)"}),r.jsx($s,{id:"reason",placeholder:"e.g., Customer support ticket #1234",value:p,onChange:le=>x(le.target.value),className:"resize-none",rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"This will be logged for audit purposes."})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),r.jsxs(P,{onClick:xe,className:"bg-amber-500 hover:bg-amber-600 text-amber-950",children:[r.jsx(wr,{className:"h-4 w-4 mr-2"}),"Start Viewing"]})]})]})}),r.jsx(It,{open:w,onOpenChange:S,children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{className:"flex items-center gap-2",children:j!=null&&j.is_suspended?r.jsxs(r.Fragment,{children:[r.jsx(vk,{className:"h-5 w-5 text-green-600"}),"Unsuspend User"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ay,{className:"h-5 w-5 text-orange-600"}),"Suspend User"]})}),r.jsx($r,{children:j!=null&&j.is_suspended?"This will restore the user's ability to log in.":"This will prevent the user from logging in. Their data will be preserved."})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted rounded-lg",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:(j==null?void 0:j.avatar_url)||void 0}),r.jsx(on,{className:"bg-primary/10 text-primary",children:((j==null?void 0:j.full_name)||(j==null?void 0:j.email)||"U")[0].toUpperCase()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:(j==null?void 0:j.full_name)||"No name"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:j==null?void 0:j.email})]})]}),!(j!=null&&j.is_suspended)&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"suspend_reason",children:"Reason (optional)"}),r.jsx($s,{id:"suspend_reason",placeholder:"e.g., Terms of service violation",value:_,onChange:le=>C(le.target.value),className:"resize-none",rows:2})]}),(j==null?void 0:j.is_suspended)&&(j==null?void 0:j.suspended_reason)&&r.jsxs("div",{className:"p-3 bg-muted rounded-lg",children:[r.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.jsx("strong",{children:"Suspension reason:"})," ",j.suspended_reason]}),(j==null?void 0:j.suspended_at)&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Suspended on: ",new Date(j.suspended_at).toLocaleDateString()]})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),r.jsx(P,{onClick:it,className:j!=null&&j.is_suspended?"bg-green-500 hover:bg-green-600 text-white":"bg-orange-500 hover:bg-orange-600 text-white",children:j!=null&&j.is_suspended?r.jsxs(r.Fragment,{children:[r.jsx(vk,{className:"h-4 w-4 mr-2"}),"Unsuspend"]}):r.jsxs(r.Fragment,{children:[r.jsx(Ay,{className:"h-4 w-4 mr-2"}),"Suspend"]})})]})]})}),r.jsx(cs,{open:H,onOpenChange:X,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Reset Usage"}),r.jsxs(Jn,{children:["Are you sure you want to reset"," ",r.jsx("span",{className:"font-medium",children:Q==="both"?"recordings and shares":Q})," ","for"," ",r.jsx("span",{className:"font-medium",children:(G==null?void 0:G.full_name)||(G==null?void 0:G.email)}
1210),"? This will reset their ",Q==="both"?"recording and share counts":`${Q} count`," for the current month to 0."]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsxs(bs,{onClick:Oe,className:"bg-blue-600 hover:bg-blue-700",children:[r.jsx(Wd,{className:"h-4 w-4 mr-2"}),"Reset Usage"]})]})]})})]})},zet=()=>{const[e,t]=h.useState([]),[n,s]=h.useState(!0),[a,i]=h.useState("all");h.useEffect(()=>{o()},[a]);const o=async()=>{try{s(!0);let u=F.from("video_moderation").select("video_id, confidence_score, flagged_categories, status").not("flagged_categories","eq","{}").order("created_at",{ascending:!1}).limit(50);a!=="all"&&(u=u.eq("status",a));const{data:m,error:f}=await u;if(f)throw f;if(!m||m.length===0){t([]),s(!1);return}const p=m.map(j=>j.video_id),x=new Map(m.map(j=>[j.video_id,j])),{data:g,error:v}=await F.from("videos").select("id, title, video_url, thumbnail_url, view_count, created_at, moderation_status, user_id").in("id",p).order("created_at",{ascending:!1});if(v)throw v;const y=[...new Set((g==null?void 0:g.map(j=>j.user_id))||[])],{data:b}=await F.from("profiles").select("user_id, full_name, email, avatar_url").in("user_id",y),w=new Map((b==null?void 0:b.map(j=>[j.user_id,j]))||[]),S=(g||[]).map(j=>({...j,profiles:w.get(j.user_id)||null,moderation:x.get(j.id)||null}));t(S)}catch(u){console.error("Error fetching videos:",u),Pe.error("Failed to load videos")}finally{s(!1)}},l=async(u,m)=>{var f;try{const{error:p}=await F.from("video_moderation").update({status:m,reviewed_at:new Date().toISOString(),reviewed_by:(f=(await F.auth.getUser()).data.user)==null?void 0:f.id,flagged_categories:m==="approved"?[]:void 0}).eq("video_id",u);if(p)throw p;const{error:x}=await F.from("videos").update({moderation_status:m}).eq("id",u);if(x)throw x;Pe.success(`Video ${m}`),o()}catch(p){console.error("Error moderating video:",p),Pe.error("Failed to moderate video")}},c=async u=>{try{const{error:m}=await F.from("videos").delete().eq("id",u);if(m)throw m;Pe.success("Video deleted"),o()}catch(m){console.error("Error deleting video:",m),Pe.error("Failed to delete video")}},d=u=>{switch(u){case"approved":return r.jsxs(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:[r.jsx(Lm,{className:"h-3 w-3 mr-1"}),"Approved"]});case"rejected":return r.jsxs(Se,{variant:"destructive",children:[r.jsx(sg,{className:"h-3 w-3 mr-1"}),"Rejected"]});case"review":return r.jsxs(Se,{className:"bg-orange-500/10 text-orange-600 border-orange-500/20",children:[r.jsx(wa,{className:"h-3 w-3 mr-1"}),"Needs Review"]});case"pending":return r.jsxs(Se,{variant:"secondary",children:[r.jsx(fr,{className:"h-3 w-3 mr-1"}),"Pending"]});default:return r.jsxs(Se,{variant:"outline",children:[r.jsx(wa,{className:"h-3 w-3 mr-1"}),"Not Reviewed"]})}};return r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(cr,{className:"h-5 w-5"}),"Video Moderation"]}),r.jsx(xr,{children:"Review flagged videos that require moderator attention"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{variant:a==="all"?"default":"outline",size:"sm",onClick:()=>i("all"),children:"All"}),r.jsx(P,{variant:a==="review"?"default":"outline",size:"sm",onClick:()=>i("review"),children:"Needs Review"}),r.jsx(P,{variant:a==="pending"?"default":"outline",size:"sm",onClick:()=>i("pending"),children:"Pending"}),r.jsx(P,{variant:a==="approved"?"default":"outline",size:"sm",onClick:()=>i("approved"),children:"Approved"}),r.jsx(P,{variant:a==="rejected"?"default":"outline",size:"sm",onClick:()=>i("rejected"),children:"Rejected"})]})]})}),r.jsx(lt,{children:n?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):e.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(cr,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No flagged videos requiring review"})]}):r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"Video"}),r.jsx(ar,{children:"Owner"}),r.jsx(ar,{children:"AI Analysis"}),r.jsx(ar,{children:"Views"}),r.jsx(ar,{children:"Status"}),r.jsx(ar,{children:"Created"}),r.jsx(ar,{className:"text-right",children:"Actions"})]})}),r.jsx(du,{children:e.map(u=>{var m,f,p,x,g,v,y,b;return r.jsxs(pr,{children:[r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-16 h-9 bg-muted rounded overflow-hidden flex-shrink-0",children:u.thumbnail_url?r.jsx("img",{src:u.thumbnail_url,alt:u.title||"Video",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsx(cr,{className:"h-4 w-4 text-muted-foreground"})})}),r.jsx("span",{className:"font-medium truncate max-w-[200px]",children:u.title||"Untitled"})]})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(an,{className:"h-6 w-6",children:[r.jsx(gn,{src:((m=u.profiles)==null?void 0:m.avatar_url)||void 0}),r.jsx(on,{className:"text-xs",children:(((f=u.profiles)==null?void 0:f.full_name)||((p=u.profiles)==null?void 0:p.email)||"U")[0].toUpperCase()})]}),r.jsx("span",{className:"text-sm text-muted-foreground truncate max-w-[150px]",children:((x=u.profiles)==null?void 0:x.full_name)||((g=u.profiles)==null?void 0:g.email)||"Unknown"})]})}),r.jsx(Te,{children:r.jsx(ys,{children:r.jsxs("div",{className:"flex flex-col gap-1",children:[((v
1210=u.moderation)==null?void 0:v.confidence_score)!==null&&((y=u.moderation)==null?void 0:y.confidence_score)!==void 0?r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-1.5 cursor-help",children:[r.jsx(qH,{className:"h-3 w-3 text-muted-foreground"}),r.jsxs("span",{className:`text-sm font-medium ${u.moderation.confidence_score>=.8?"text-green-600":u.moderation.confidence_score>=.5?"text-yellow-600":"text-red-600"}`,children:[Math.round(u.moderation.confidence_score*100),"%"]})]})}),r.jsx(yt,{children:r.jsx("p",{children:"AI Confidence Score"})})]}):r.jsx("span",{className:"text-xs text-muted-foreground",children:"No AI data"}),((b=u.moderation)==null?void 0:b.flagged_categories)&&u.moderation.flagged_categories.length>0&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-1 cursor-help",children:[r.jsx(Ef,{className:"h-3 w-3 text-orange-500"}),r.jsxs("span",{className:"text-xs text-orange-600 truncate max-w-[100px]",children:[u.moderation.flagged_categories.length," flagged"]})]})}),r.jsxs(yt,{children:[r.jsx("p",{className:"font-medium mb-1",children:"Flagged Categories:"}),r.jsx("ul",{className:"text-xs space-y-0.5",children:u.moderation.flagged_categories.map((w,S)=>r.jsxs("li",{className:"capitalize",children:["• ",w.replace(/_/g," ")]},S))})]})]})]})})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(wr,{className:"h-3 w-3"}),u.view_count||0]})}),r.jsx(Te,{children:d(u.moderation_status)}),r.jsx(Te,{className:"text-muted-foreground text-sm",children:new Date(u.created_at).toLocaleDateString()}),r.jsx(Te,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-1",children:[u.video_url&&r.jsx(P,{variant:"ghost",size:"icon",asChild:!0,children:r.jsx("a",{href:u.video_url,target:"_blank",rel:"noopener noreferrer",children:r.jsx(bn,{className:"h-4 w-4"})})}),u.moderation_status!=="approved"&&r.jsx(P,{variant:"ghost",size:"icon",className:"text-green-600 hover:text-green-700 hover:bg-green-50",onClick:()=>l(u.id,"approved"),title:"Approve",children:r.jsx(Lm,{className:"h-4 w-4"})}),u.moderation_status!=="rejected"&&r.jsx(P,{variant:"ghost",size:"icon",className:"text-orange-600 hover:text-orange-700 hover:bg-orange-50",onClick:()=>l(u.id,"rejected"),title:"Reject",children:r.jsx(sg,{className:"h-4 w-4"})}),r.jsxs(cs,{children:[r.jsx(Uf,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",children:r.jsx(Xr,{className:"h-4 w-4"})})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete Video"}),r.jsx(Jn,{children:"Are you sure you want to delete this video? This action cannot be undone."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:()=>c(u.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})})]},u.id)})})]})})]})},qet=()=>{const[e,t]=h.useState([]),[n,s]=h.useState(!0);h.useEffect(()=>{a()},[]);const a=async()=>{try{s(!0);const{data:o,error:l}=await F.from("admin_impersonation_logs").select("*").order("started_at",{ascending:!1}).limit(100);if(l)throw l;if(o&&o.length>0){const c=[...new Set(o.map(p=>p.admin_id))],d=[...new Set(o.map(p=>p.impersonated_user_id))],{data:u}=await F.from("profiles").select("user_id, full_name, email, avatar_url").in("user_id",[...c,...d]),m=new Map((u==null?void 0:u.map(p=>[p.user_id,p]))||[]),f=o.map(p=>({...p,admin_profile:m.get(p.admin_id),impersonated_profile:m.get(p.impersonated_user_id)}));t(f)}else t([])}catch(o){console.error("Error fetching activity logs:",o)}finally{s(!1)}},i=(o,l)=>{if(!l)return"Active";const c=new Date(l).getTime()-new Date(o).getTime(),d=Math.floor(c/6e4),u=Math.floor(c%6e4/1e3);return d>0?`${d}m ${u}s`:`${u}s`};return r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(Cf,{className:"h-5 w-5"}),"Activity Logs"]}),r.jsx(xr,{children:"Admin impersonation sessions and audit trail"})]}),r.jsx(lt,{children:n?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):e.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(Cf,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No activity logs yet"}),r.jsx("p",{className:"text-sm",children:"Impersonation sessions will appear here"})]}):r.jsx(Io,{className:"h-[500px]",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"Admin"}),r.jsx(ar,{children:"Viewed User"}),r.jsx(ar,{children:"Reason"}),r.jsx(ar,{children:"Started"}),r.jsx(ar,{children:"Duration"}),r.jsx(ar,{children:"Status"})]})}),r.jsx(du,{children:e.map(o=>{var l,c,d,u,m,f,p,x,g,v;return r.jsxs(pr,{children:[r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(an,{className:"h-7 w-7",children:[r.jsx(gn,{src:((l=o.admin_profile)==null?void 0:l.avatar_url)||void 0}),r.jsx(on,{className:"text-xs bg-primary/10 text-primary",children:(((c=o.admin_profile)==null?void 0:c.full_name)||((d=o.admin_profile)==null?void 0:d.email)||"A")[0].toUpperCase()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:((u=o.admin_profile)==null?void 0:u.full_name)||"Admin"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:(m=o.admin_profile)==null?void 0:m.email})]})]})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(an,{className:"h-7 w-7",children:[r.jsx(gn,{src:((f=o.impersonated_profile)==null?void 0:f.avatar_url)||void 0}),r.jsx(on,{className:"text-xs",children:(((p=o.impersonated_profile)==null?void 0:p.full_name)||((x=o.impersonated_profile)==null?void 0:x.email)||"U")[0].toUpperCase()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:((g=o.impersonated_profile)==null?void 0:g.full_name)||"User"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:(v=o.impersonated_profile)==null?void 0:v.email})]})]})}),r.jsx(Te,{children:r.jsx("span",{className:"text-sm text-muted-foreground",children:o.reason||"-"})}),r.jsx(Te,{children:r.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[r.jsx(fr,{className:"h-3 w-3"}
1210),new Date(o.started_at).toLocaleString()]})}),r.jsx(Te,{children:r.jsx("span",{className:"text-sm",children:i(o.started_at,o.ended_at)})}),r.jsx(Te,{children:o.ended_at?r.jsx(Se,{variant:"secondary",children:"Ended"}):r.jsxs(Se,{className:"bg-amber-500/10 text-amber-600 border-amber-500/20",children:[r.jsx(wr,{className:"h-3 w-3 mr-1"}),"Active"]})})]},o.id)})})]})})})]})},Sz={notify_new_users:!0,notify_new_videos:!0,notify_payment_failed:!0,notify_flagged_content:!0},Het=()=>{const{user:e}=nr(),[t,n]=h.useState(Sz),[s,a]=h.useState(!0),[i,o]=h.useState(!1),[l,c]=h.useState(!1),[d,u]=h.useState(!1);h.useEffect(()=>{e&&l&&m()},[e,l]);const m=async()=>{if(e)try{a(!0);const{data:g,error:v}=await F.from("admin_notification_preferences").select("*").eq("user_id",e.id).maybeSingle();if(v)throw v;g?(u(!0),n({notify_new_users:g.notify_new_users,notify_new_videos:g.notify_new_videos,notify_payment_failed:g.notify_payment_failed,notify_flagged_content:g.notify_flagged_content})):(u(!1),n(Sz))}catch(g){console.error("Error fetching preferences:",g)}finally{a(!1)}},f=async()=>{if(e)try{if(o(!0),d){const{error:g}=await F.from("admin_notification_preferences").update(t).eq("user_id",e.id);if(g)throw g}else{const{error:g}=await F.from("admin_notification_preferences").insert({user_id:e.id,...t});if(g)throw g;u(!0)}Pe.success("Notification preferences saved"),c(!1)}catch(g){console.error("Error saving preferences:",g),Pe.error("Failed to save preferences")}finally{o(!1)}},p=g=>{n(v=>({...v,[g]:!v[g]}))},x=[{key:"notify_new_users",label:"New User Signups",description:"Get notified when a new user signs up",icon:Cc,color:"text-blue-500"},{key:"notify_new_videos",label:"New Video Uploads",description:"Get notified when users upload new videos",icon:cr,color:"text-green-500"},{key:"notify_payment_failed",label:"Payment Failures",description:"Get notified when payments fail",icon:vi,color:"text-red-500"},{key:"notify_flagged_content",label:"Flagged Content",description:"Get notified when content is flagged for review",icon:wa,color:"text-orange-500"}];return r.jsxs(It,{open:l,onOpenChange:c,children:[r.jsx(wv,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",children:r.jsx(Vm,{className:"h-4 w-4"})})}),r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Notification Preferences"}),r.jsx($r,{children:"Choose which admin notifications you want to receive"})]}),s?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Me,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"space-y-4",children:[x.map(g=>{const v=g.icon;return r.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-card",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:`${g.color}`,children:r.jsx(v,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:g.key,className:"font-medium cursor-pointer",children:g.label}),r.jsx("p",{className:"text-sm text-muted-foreground",children:g.description})]})]}),r.jsx(rr,{id:g.key,checked:t[g.key],onCheckedChange:()=>p(g.key)})]},g.key)}),r.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[r.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),r.jsxs(P,{onClick:f,disabled:i,children:[i&&r.jsx(Me,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Preferences"]})]})]})]})]})},Wet=e=>{switch(e){case"new_user":return r.jsx(Cc,{className:"h-4 w-4 text-blue-500"});case"new_video":return r.jsx(cr,{className:"h-4 w-4 text-green-500"});case"payment_failed":return r.jsx(vi,{className:"h-4 w-4 text-red-500"});case"flagged_content":return r.jsx(wa,{className:"h-4 w-4 text-orange-500"});default:return r.jsx(zl,{className:"h-4 w-4 text-muted-foreground"})}},Yet=e=>{switch(e){case"new_user":return"bg-blue-500/10 border-blue-500/20";case"new_video":return"bg-green-500/10 border-green-500/20";case"payment_failed":return"bg-red-500/10 border-red-500/20";case"flagged_content":return"bg-orange-500/10 border-orange-500/20";default:return"bg-muted"}},Get=()=>{const e=Sr(),{user:t}=nr(),[n,s]=h.useState([]),[a,i]=h.useState(null),[o,l]=h.useState(!0),[c,d]=h.useState(!1);h.useState(!1);const u=(j,N)=>{if(!N)return!0;switch(j){case"new_user":return N.notify_new_users;case"new_video":return N.notify_new_videos;case"payment_failed":return N.notify_payment_failed;case"flagged_content":return N.notify_flagged_content;default:return!0}},m=n.filter(j=>u(j.type,a)),f=m.filter(j=>!j.is_read).length,p=async j=>{j.is_read||await v(j.id),d(!1);const N=j.metadata;switch(j.type){case"new_user":N!=null&&N.user_id?e(`/admin?tab=users&user=${N.user_id}`):e("/admin?tab=users");break;case"new_video":case"flagged_content":e("/admin?tab=videos");break;case"payment_failed":N!=null&&N.user_id?e(`/admin?tab=users&user=${N.user_id}`):e("/admin?tab=users");break;default:e("/admin")}};h.useEffect(()=>{t&&(g(),x())},[t==null?void 0:t.id]),h.useEffect(()=>{if(!t)return;const j=F.channel("admin-notifications-realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"admin_notifications"},N=>{const _=N.new;s(C=>C.some(k=>k.id===_.id)?C:[_,...C]),Pe.info(_.title,{id:`admin-notification-${_.id}`,description:_.message,duration:4e3})}).subscribe();return()=>{F.removeChannel(j)}},[t==null?void 0:t.id]);const x=async()=>
1210{if(t)try{const{data:j,error:N}=await F.from("admin_notification_preferences").select("*").eq("user_id",t.id).maybeSingle();if(N)throw N;j&&i({notify_new_users:j.notify_new_users,notify_new_videos:j.notify_new_videos,notify_payment_failed:j.notify_payment_failed,notify_flagged_content:j.notify_flagged_content})}catch(j){console.error("Error fetching notification preferences:",j)}},g=async()=>{try{l(!0);const{data:j,error:N}=await F.from("admin_notifications").select("*").order("created_at",{ascending:!1}).limit(50);if(N)throw N;s(j||[])}catch(j){console.error("Error fetching notifications:",j)}finally{l(!1)}},v=async j=>{try{const{error:N}=await F.from("admin_notifications").update({is_read:!0}).eq("id",j);if(N)throw N;s(_=>_.map(C=>C.id===j?{...C,is_read:!0}:C))}catch(N){console.error("Error marking notification as read:",N)}},y=async()=>{try{const j=n.filter(_=>!_.is_read).map(_=>_.id);if(j.length===0)return;const{error:N}=await F.from("admin_notifications").update({is_read:!0}).in("id",j);if(N)throw N;s(_=>_.map(C=>({...C,is_read:!0}))),Pe.success("All notifications marked as read")}catch(j){console.error("Error marking all as read:",j)}},b=async(j,N)=>{N.stopPropagation();try{const{error:_}=await F.from("admin_notifications").delete().eq("id",j);if(_)throw _;s(C=>C.filter(k=>k.id!==j)),Pe.success("Notification deleted")}catch(_){console.error("Error deleting notification:",_)}},w=async()=>{try{const j=m.map(_=>_.id);if(j.length===0)return;const{error:N}=await F.from("admin_notifications").delete().in("id",j);if(N)throw N;s(_=>_.filter(C=>!j.includes(C.id))),Pe.success("All notifications deleted")}catch(j){console.error("Error marking all as read:",j)}},S=j=>{const N=new Date(j),C=new Date().getTime()-N.getTime(),k=Math.floor(C/6e4),E=Math.floor(C/36e5),R=Math.floor(C/864e5);return k<1?"Just now":k<60?`${k}m ago`:E<24?`${E}h ago`:R<7?`${R}d ago`:N.toLocaleDateString()};return r.jsxs(Ad,{open:c,onOpenChange:d,children:[r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"outline",size:"icon",className:"relative",children:[r.jsx(zl,{className:"h-4 w-4"}),f>0&&r.jsx(Se,{className:"absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs",variant:"destructive",children:f>9?"9+":f})]})}),r.jsxs(Tc,{className:"w-96 p-0",align:"end",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zl,{className:"h-4 w-4"}),r.jsx("span",{className:"font-semibold",children:"Notifications"}),f>0&&r.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[10px] font-bold text-white bg-primary rounded-full",children:f})]}),r.jsxs("div",{className:"flex items-center gap-0.5",children:[f>0&&r.jsxs(P,{variant:"ghost",size:"sm",onClick:y,className:"text-xs h-8 px-2",children:[r.jsx(nt,{className:"h-3 w-3 mr-1"}),"Read all"]}),m.length>0&&r.jsx(P,{variant:"ghost",size:"sm",onClick:w,className:"text-xs h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",children:r.jsx(Xr,{className:"h-3 w-3"})}),r.jsx(Het,{})]})]}),r.jsx(Io,{className:"h-[400px]",children:o?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):m.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[r.jsx(zl,{className:"h-8 w-8 mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No notifications yet"})]}):r.jsx("div",{className:"divide-y",children:m.map(j=>r.jsx("div",{className:ge("p-4 hover:bg-muted/50 cursor-pointer transition-colors group",!j.is_read&&"bg-primary/5"),onClick:()=>p(j),children:r.jsxs("div",{className:"flex gap-3",children:[r.jsx("div",{className:ge("flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center border",Yet(j.type)),children:Wet(j.type)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsx("p",{className:ge("text-sm",!j.is_read&&"font-medium"),children:j.title}),r.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!j.is_read&&r.jsx("div",{className:"w-2 h-2 rounded-full bg-primary mt-1.5"}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:N=>b(j.id,N),children:r.jsx(zt,{className:"h-3 w-3"})})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground truncate",children:j.message}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S(j.created_at)})]})]})},j.id))})})]})]})},Ket=()=>{const[e,t]=h.useState([]),[n,s]=h.useState(!0),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,m]=h.useState({}),[f,p]=h.useState(!1),[x,g]=h.useState(null),[v,y]=h.useState(null),[b,w]=h.useState(!1),[S,j]=h.useState(null);h.useEffect(()=>{N(),_()},[]);const N=async()=>{try{const{data:A,error:V}=await F.from("profiles").select("user_id, email, full_name, subscription_tier, created_at").order("created_at",{ascending:!1});if(V)throw V;t(A||[])}catch(A){console.error("Error fetching profiles:",A),Pe.error("Failed to load users")}finally{s(!1)}},_=async()=>{try{p(!0);const{data:A}=await F.from("profiles").select("user_id, email").in("subscription_tier",["professional","team"]);if(!A||A.length===0){p(!1);return}const V={};await Promise.all(A.map(async U=>{if(U.email)try{const{data:O}=await F.functions.invoke("admin-get-user-billing",{body:{userEmail:U.email}});O!=null&&O.promoCode&&(V[U.user_id]={code:O.promoCode,discount:O.promoCodeDiscount})}catch(O){console.error(`Error fetching promo code for ${U.email}:`,O)}})),m(V)}catch(A){console.error("Error fetching promo codes:",A)}finally{p(!1)}},C=async A=>{try{w(!0),j(null);const{data:V,error:U}=await F.functions.invoke("admin-get-user-billing",{body:{userEmail:A}});if(U)throw U;if(V!=null&&V.error)throw new Error(V.error);y(V)}catch(V){console.error("Error fetching billing data:",V),j(V instanceof Error?V.message:"Failed to fetch billing data"),Pe.error("Failed to fetch billing data")}finally{w(!1)}},k=A=>{g(A),y(null),A.email&&C(A.email)},E=(A,V="usd")=>new Intl.NumberFormat("en-US",{style:"currency",currency:V.toUpperCase()}).format(A/100),R=A=>{switch(A){case"active":return r.jsx(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:"Active"});case"canceled":return r.jsx(Se,{variant:"destructive",children:"Canceled"});case"past_due":return r.jsx(Se,{className:"bg-orange-500/10 text-orange-600 border-orange-500/20",children:"Past Due"});case"paid":return r.jsx(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:"Paid"});case"open":return r.jsx(Se,{variant:"secondary",children:"Open"});case"draft":return r.jsx(Se,{variant:"outline",children:"Draft"});default:return r.jsx(Se,{variant:"secondary",children:A})}},T=A=>{switch(A){case"professional":return r.jsx(Se,{className:"bg-sky-500/10 text-sky-600 border-sky-500/20",children:"Professional"});case"team":return r.jsx(Se,{className:"bg-blue-500/10 text-blue-600 border-blue-500/20",children:"Team"});default:return r.jsx(Se,{variant:"secondary",children:"Starter"})}},D=e.filter(A=>{var I,B,K;const V=a.toLowerCase(),U=((I=A.email)==null?void 0:I.toLowerCase().includes(V))||((B=A.full_name)==null?void 0:B.toLowerCase().includes(V)),O=(K=u[A.user_id])==null?void 0:K.co
1210de,M=!o||O&&O.toLowerCase().includes(o.toLowerCase()),$=!c||O!=null;return U&&M&&$});return n?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(dw,{className:"h-5 w-5"}),"Billing Management"]}),r.jsx(xr,{children:"View and manage user billing information and subscriptions"})]}),r.jsxs(lt,{children:[r.jsxs("div",{className:"flex flex-col gap-4 mb-6",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{placeholder:"Search by name or email...",value:a,onChange:A=>i(A.target.value),className:"pl-10"})]}),r.jsxs(Se,{variant:"outline",className:"gap-1",children:[r.jsx(jr,{className:"h-3 w-3"}),D.length," users"]})]}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-xs",children:[r.jsx(Ef,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{placeholder:"Filter by promo code...",value:o,onChange:A=>l(A.target.value),className:"pl-10"})]}),r.jsxs(P,{variant:c?"default":"outline",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[r.jsx(WH,{className:"h-4 w-4"}),c?"Showing with promo":"Show with promo only"]}),f&&r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[r.jsx(Me,{className:"h-4 w-4 animate-spin"}),"Loading promo codes..."]})]})]}),r.jsx("div",{className:"rounded-md border",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"User"}),r.jsx(ar,{children:"Email"}),r.jsx(ar,{children:"Plan"}),r.jsx(ar,{children:"Promo Code"}),r.jsx(ar,{children:"Joined"}),r.jsx(ar,{className:"text-right",children:"Actions"})]})}),r.jsx(du,{children:D.length===0?r.jsx(pr,{children:r.jsx(Te,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"No users found"})}):D.map(A=>{const V=u[A.user_id];return r.jsxs(pr,{children:[r.jsx(Te,{className:"font-medium",children:A.full_name||"Unnamed User"}),r.jsx(Te,{className:"text-muted-foreground",children:A.email||"No email"}),r.jsx(Te,{children:T(A.subscription_tier)}),r.jsx(Te,{children:V!=null&&V.code?r.jsxs(Se,{className:"bg-amber-500/10 text-amber-600 border-amber-500/20 gap-1",children:[r.jsx(Ef,{className:"h-3 w-3"}),V.code,V.discount&&` (${V.discount}%)`]}):r.jsx("span",{className:"text-muted-foreground text-sm",children:"-"})}),r.jsx(Te,{className:"text-muted-foreground",children:new Date(A.created_at).toLocaleDateString()}),r.jsx(Te,{className:"text-right",children:r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>k(A),disabled:!A.email,className:"gap-2",children:[r.jsx(vi,{className:"h-4 w-4"}),"View Billing"]})})]},A.user_id)})})]})})]})]}),r.jsx(It,{open:!!x,onOpenChange:A=>!A&&g(null),children:r.jsxs(Dt,{className:"max-w-2xl max-h-[80vh]",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(vi,{className:"h-5 w-5"}),"Billing Details"]}),r.jsxs($r,{children:["Stripe billing information for ",(x==null?void 0:x.full_name)||(x==null?void 0:x.email)||"user"]})]}),b?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):S?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[r.jsx(Im,{className:"h-8 w-8 mb-2 text-destructive"}),r.jsx("p",{className:"text-sm",children:S}),r.jsx(P,{variant:"outline",size:"sm",className:"mt-4",onClick:()=>(x==null?void 0:x.email)&&C(x.email),children:"Retry"})]}):v!=null&&v.hasStripeCustomer?r.jsx(Io,{className:"max-h-[60vh] pr-4",children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Spent"}),r.jsx("p",{className:"text-2xl font-bold text-green-600",children:E(v.totalSpent,v.currency)})]}),r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Customer Since"}),r.jsx("p",{className:"text-lg font-medium",children:v.customerCreated?new Date(v.customerCreated).toLocaleDateString():"N/A"})]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(Ga,{className:"h-4 w-4"}),"Subscriptions (",v.subscriptions.length,")"]}),v.subscriptions.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No subscriptions"}):r.jsx("div",{className:"space-y-3",children:v.subscriptions.map(A=>r.jsxs("div",{className:"rounded-lg border p-4",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:A.productName}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[E(A.priceAmount,A.priceCurrency),"/",A.interval]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[A.cancelAtPeriodEnd&&r.jsx(Se,{variant:"outline",className:"text-orange-600",children:"Cancels at period end"}),R(A.status)]})]}),r.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:r.jsxs("p",{children:["Current period: ",new Date(A.currentPeriodStart).toLocaleDateString()," -"," ",new Date(A.currentPeriodEnd).toLocaleDateString()]})})]},A.id))})]}),r.jsx(Kl,{}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(vi,{className:"h-4 w-4"}),"Payment Methods (",v.paymentMethods.length,")"]}),v.paymentMethods.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No payment methods"}):r.jsx("div",{className:"flex flex-wrap gap-2",children:v.paymentMethods.map(A=>r.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border px-3 py-2",children:[r.jsx("span",{className:"capitalize font-medium",children:A.brand}),r.jsxs("span",{className:"text-muted-foreground",children:["•••• ",A.last4]}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[A.expMonth,"/",A.expYear]})]},A.id))})]}),r.jsx(Kl,{}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(E_,{className:"h-4 w-4"}),"Recent Invoices (",v.invoices.length,")"]}),v.invoices.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:"No invoices"}):r.jsx("div",{className:"space-y-2",children:v.invoices.map(A=>r.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[r.jsx("div",{className:"flex items-center gap-4",children:r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:A.number||A.id}),r.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(A.created).toLocaleDateString()})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"font-medium",children:E(A.amountPaid||A.amountDue,A.currency)}),A.status&&R(A.status),A.hostedInvoiceUrl&&r.jsx(P,{variant:"ghost",size:"icon",asChild:!0,children:r.jsx("a",{href:A.hostedInvoiceUrl,target:"_blank",rel:"noopener noreferrer",children:r.jsx(bn,{className:"h-4 w-4"})})})]})]},A.id))})]})]})}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[r.jsx(vi,{className:"h-8 w-8 mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No Stripe customer found"}),r.jsx("p",{className:"text-xs mt-1",children:"This user has never made a purchase"})]})]})})]})},Xet=Jm("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Md=h.forwardRef(({className:e,variant:t,...n},s)=>r.jsx("div",{ref:s,role:"alert",className:ge(Xet({variant:t}),e),...n}));Md.displayName="Alert";const Zet=h.forwardRef(({className:e,...t},n)=>r.jsx("h5",{ref:n,className:ge("mb-1 font-medium leading-none tracking-tight",e),...t}));Zet.displayName="AlertTitle";const Id=h.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:ge("text-sm [&_p]:leading-relaxed",e),...t}));Id.displayName="AlertDescription";const _z={blue:"linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%)"},Qet={desktop:600,tablet:480,mobile:340},Jet=({open:e,onOpenChange:t,subject:n,title:s,message:a,ctaText:i,ctaUrl:o,iconEmoji:l="📢"})=>{const[c,d]=h.useState("desktop"),u=Qet[c],m=c==="mobile"?"28px 16px":c==="tablet"?"36px 24px":"32px 24px",f=c==="mobile"?"24px 16px":c==="tablet"?"28px 24px":"32px 24px",p=c==="mobile"?"16px 16px":"20px 24px",x=c==="mobile"?"18px":c==="tablet"?"19px":"20px",g=c==="mobile"?48:c==="tablet"?56:64,v=c==="mobile"?24:c==="tablet"?28:32,y=c==="mobile"?"14px 20px":"12px 28px",b="14px",w=c==="mobile"?160:c==="tablet"?200:280,S=c==="mobile"?"12px":c==="tablet"?"14px":"16px";return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden p-0",children:[r.jsxs(Lt,{className:"px-6 py-4 border-b",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Mt,{className:"text-lg",children:"Email Preview"}),r.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-1",children:[{mode:"desktop",Icon:Vs,label:"Desktop"},{mode:"tablet",Icon:z4,label:"Tablet"},{mode:"mobile",Icon:qc,label:"Mobile"}].map(({mode:j,Icon:N,label:_})=>r.jsx("button",{onClick:()=>d(j),className:`p-1.5 rounded-md transition-colors ${c===j?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,title:_,children:r.jsx(N,{className:"h-4 w-4"})},j))})]}),r.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[r.jsx("strong",{children:"Subject:"})," ",n||"(No subject)"]})]}),r.jsx("div",{className:"overflow-y-auto max-h-[70vh] flex justify-center",children:r.jsx("div",{style:{backgroundColor:"#f4f4f5",padding:"24px 16px",
1210width:"100%"},children:r.jsxs("div",{style:{width:u,maxWidth:"100%",margin:"0 auto",backgroundColor:"#ffffff",borderRadius:c==="mobile"?"0":"12px",overflow:"hidden",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",transition:"width 0.3s ease"},children:[r.jsxs("div",{style:{background:"linear-gradient(135deg, #f4f4f5 0%, #e5e7eb 100%)",padding:m,textAlign:"center"},children:[r.jsx("img",{src:"/vidareo-email-logo.png",alt:"VIDAREO",style:{maxWidth:w,height:"auto",margin:"0 auto 16px",display:"block"}}),r.jsxs("p",{style:{margin:"12px 0 0 0",fontSize:S,letterSpacing:"1px"},children:[r.jsx("span",{style:{color:"#ef4444",fontWeight:600},children:"Record"})," • ",r.jsx("span",{style:{color:"#3b82f6",fontWeight:600},children:"Share"})," • ",r.jsx("span",{style:{color:"#22c55e",fontWeight:600},children:"Connect."})]})]}),r.jsxs("div",{style:{padding:f},children:[r.jsxs("div",{style:{textAlign:"center",marginBottom:"24px"},children:[r.jsx("div",{style:{width:g,height:g,background:_z.blue,borderRadius:"50%",margin:"0 auto 16px",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsx("span",{style:{fontSize:v},children:l})}),r.jsx("h2",{style:{margin:"0 0 8px 0",color:"#18181b",fontSize:x,fontWeight:600},children:s||"(No title)"})]}),r.jsx("div",{style:{color:"#3f3f46",fontSize:b,lineHeight:1.6,whiteSpace:"pre-wrap"},children:a?a.split(`
1211`).map((j,N)=>r.jsx("p",{style:{margin:"0 0 12px 0"},children:j||" "},N)):r.jsx("p",{style:{color:"#9ca3af",fontStyle:"italic"},children:"(No message)"})}),i&&r.jsxs("div",{style:{textAlign:"center",marginTop:"24px"},children:[r.jsx("span",{style:{display:"inline-block",background:_z.blue,color:"#ffffff",padding:y,borderRadius:"8px",fontWeight:600,fontSize:"14px",...c==="mobile"?{width:"100%",boxSizing:"border-box",textAlign:"center"}:{}},children:i}),o&&r.jsxs("p",{style:{margin:"8px 0 0 0",fontSize:"11px",color:"#9ca3af"},children:["Links to: ",o]})]})]}),r.jsxs("div",{style:{backgroundColor:"#f9fafb",padding:p,textAlign:"center",borderTop:"1px solid #e5e7eb"},children:[r.jsx("p",{style:{margin:"0 0 8px 0",color:"#6b7280",fontSize:c==="mobile"?"11px":"12px"},children:"You received this email because you have an account with VIDAREO."}),r.jsxs("p",{style:{margin:0,color:"#9ca3af",fontSize:c==="mobile"?"10px":"11px"},children:["© ",new Date().getFullYear()," VIDAREO. All rights reserved."]})]})]})})}),r.jsx("div",{className:"px-6 py-4 border-t bg-muted/30",children:r.jsx(P,{variant:"outline",onClick:()=>t(!1),className:"w-full",children:"Close Preview"})})]})})},ett=()=>{const[e,t]=h.useState([]),[n,s]=h.useState(!0),[a,i]=h.useState(null),[o,l]=h.useState({}),c=async()=>{s(!0);try{const{data:d,error:u}=await F.from("admin_email_log").select("*").order("created_at",{ascending:!1}).limit(200);if(u)throw u;const m=d||[];t(m);const f=Array.from(new Set(m.map(p=>p.sent_by).filter(Boolean)));if(f.length>0){const{data:p}=await F.from("profiles").select("user_id, full_name, email").in("user_id",f),x={};(p||[]).forEach(g=>{x[g.user_id]=g.full_name||g.email||"Admin"}),l(x)}}catch(d){console.error("Error fetching email log:",d),Pe.error("Failed to load email history")}finally{s(!1)}};return h.useEffect(()=>{c()},[]),r.jsxs(Ie,{children:[r.jsxs(Ot,{className:"flex flex-row items-start justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(Cf,{className:"h-5 w-5"}),"Email Send History"]}),r.jsx(xr,{children:"Log of announcements and policy update emails sent to users"})]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:c,disabled:n,children:[r.jsx(vs,{className:`h-4 w-4 mr-2 ${n?"animate-spin":""}`}),"Refresh"]})]}),r.jsxs(lt,{children:[n?r.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"Loading history..."}):e.length===0?r.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No emails have been sent yet."}):r.jsx("div",{className:"border rounded-lg overflow-hidden",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"Type"}),r.jsx(ar,{children:"Subject"}),r.jsx(ar,{children:"Sent By"}),r.jsx(ar,{children:"Audience"}),r.jsx(ar,{className:"text-right",children:"Sent / Total"}),r.jsx(ar,{children:"When"}),r.jsx(ar,{className:"w-12"})]})}),r.jsx(du,{children:e.map(d=>r.jsxs(pr,{children:[r.jsx(Te,{children:d.email_type==="announcement"?r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[r.jsx(Jy,{
1211className:"h-3 w-3"}),"Announcement"]}):r.jsxs(Se,{variant:"outline",className:"gap-1",children:[r.jsx(el,{className:"h-3 w-3"}),"Policy"]})}),r.jsx(Te,{className:"font-medium max-w-xs truncate",children:d.subject}),r.jsx(Te,{className:"text-sm text-muted-foreground",children:d.sent_by?o[d.sent_by]||"Admin":"System"}),r.jsx(Te,{className:"text-sm text-muted-foreground max-w-[200px] truncate",children:d.segment_description||(d.update_type?`Policy: ${d.update_type}`:"All users")}),r.jsxs(Te,{className:"text-right text-sm",children:[r.jsx("span",{className:d.failed_count>0?"text-amber-600":"text-green-600",children:d.sent_count}),r.jsxs("span",{className:"text-muted-foreground",children:[" / ",d.total_recipients]}),d.failed_count>0&&r.jsxs("div",{className:"text-xs text-destructive",children:[d.failed_count," failed"]})]}),r.jsx(Te,{className:"text-sm text-muted-foreground",title:cn(new Date(d.created_at),"PPpp"),children:dh(new Date(d.created_at),{addSuffix:!0})}),r.jsx(Te,{children:r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>i(d),children:r.jsx(wr,{className:"h-4 w-4"})})})]},d.id))})]})}),r.jsx(It,{open:!!a,onOpenChange:d=>!d&&i(null),children:r.jsxs(Dt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:a==null?void 0:a.subject}),r.jsxs($r,{children:["Sent ",a&&cn(new Date(a.created_at),"PPpp")]})]}),a&&r.jsxs("div",{className:"space-y-4 text-sm",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Type"}),r.jsx("div",{className:"font-medium capitalize",children:a.email_type.replace("_"," ")})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Sent By"}),r.jsx("div",{className:"font-medium",children:a.sent_by?o[a.sent_by]||"Admin":"System"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Recipients"}),r.jsx("div",{className:"font-medium",children:a.total_recipients})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Delivery"}),r.jsxs("div",{className:"font-medium",children:[a.sent_count," sent",a.failed_count>0&&`, ${a.failed_count} failed`]})]})]}),a.segment_description&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Audience"}),r.jsx("div",{children:a.segment_description})]}),a.update_type&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Policy Updated"}),r.jsx("div",{className:"capitalize",children:a.update_type})]}),a.title&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),r.jsx("div",{className:"font-medium",children:a.title})]}),a.message&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Message"}),r.jsx("div",{className:"p-3 bg-muted rounded-md whitespace-pre-wrap",children:a.message})]}),a.cta_text&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground",children:"Call to Action"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium",children:a.cta_text}),a.cta_url&&r.jsxs("span",{className:"text-muted-foreground",children:[" → ",a.cta_url]})]})]})]})]})})]})]})},Cz=[{value:"starter",label:"Free Starter"},{value:"professional",label:"Professional"},{value:"team",label:"Team"}],ttt=[{value:"all",label:"All users"},{value:"7",label:"Active in last 7 days"},{value:"30",label:"Active in last 30 days"},{value:"90",label:"Active in last 90 days"}],rtt=()=>{var U;const[e,t]=h.useState("both"),[n,s]=h.useState(""),[a,i]=h.useState(!1),[o,l]=h.useState(null),[c,d]=h.useState(""),[u,m]=h.useState(""),[f,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(""),[b,w]=h.useState(!1),[S,j]=h.useState(null),[N,_]=h.useState({subscriptionTiers:[],activeDays:null,includeAll:!0}),[C,k]=h.useState(!1),E=async()=>{i(!0),l(null);try{const{data:O,error:M}=await F.functions.invoke("send-policy-update-email",{body:{updateType:e,customMessage:n.trim()||void 0}});if(M)throw M;l(O);try{const{data:{user:$}}=await F.auth.getUser();await F.from("admin_email_log").insert({email_type:"policy_update",sent_by:$==null?void 0:$.id,subject:`Important: ${A()} Update`,title:"Policy Update Notice",message:n.trim()||null,update_type:e,segment_description:"All active users",total_recipients:(O==null?void 0:O.total)??0,sent_count:(O==null?void 0:O.sent)??0,failed_count:(O==null?void 0:O.failed)??0})}catch($){console.error("Failed to log email send:",$)}O.success&&Pe.success(`Policy update emails sent to ${O.sent} users`)}catch(O){console.error("Error sending policy emails:",O),Pe.error(O.message||"Failed to send policy update emails")}finally{i(!1)}},R=async()=>
1211{if(!c.trim()||!u.trim()||!f.trim()){Pe.error("Subject, title, and message are required");return}w(!0),j(null);const O=c.trim(),M=u.trim(),$=f.trim(),I=x.trim(),B=v.trim(),K=D();try{const{data:Z,error:q}=await F.functions.invoke("send-announcement-email",{body:{subject:O,title:M,message:$,ctaText:I||void 0,ctaUrl:B||void 0,segment:N.includeAll?{includeAll:!0}:{subscriptionTiers:N.subscriptionTiers.length>0?N.subscriptionTiers:void 0,activeDays:N.activeDays||void 0,includeAll:!1}}});if(q)throw q;j(Z);try{const{data:{user:H}}=await F.auth.getUser();await F.from("admin_email_log").insert({email_type:"announcement",sent_by:H==null?void 0:H.id,subject:O,title:M,message:$,cta_text:I||null,cta_url:B||null,segment_description:K,total_recipients:(Z==null?void 0:Z.total)??0,sent_count:(Z==null?void 0:Z.sent)??0,failed_count:(Z==null?void 0:Z.failed)??0})}catch(H){console.error("Failed to log email send:",H)}Z.success&&(Pe.success(`Announcement emails sent to ${Z.sent} users`),d(""),m(""),p(""),g(""),y(""))}catch(Z){console.error("Error sending announcement emails:",Z),Pe.error(Z.message||"Failed to send announcement emails")}finally{w(!1)}},T=O=>{_(M=>({...M,subscriptionTiers:M.subscriptionTiers.includes(O)?M.subscriptionTiers.filter($=>$!==O):[...M.subscriptionTiers,O]}))},D=()=>{if(N.includeAll)return"all active users";const O=[];if(N.subscriptionTiers.length>0){const M=N.subscriptionTiers.map($=>{var I;return((I=Cz.find(B=>B.value===$))==null?void 0:I.label)||$});O.push(M.join(", ")+" users")}return N.activeDays&&O.push(`active in last ${N.activeDays} days`),O.length>0?O.join(" • "):"users matching criteria"},A=()=>{switch(e){case"terms":return"Terms of Use";case"privacy":return"Privacy Policy";case"both":return"Terms of Use and Privacy Policy"}},V=({result:O})=>r.jsxs(Md,{variant:"default",className:O.failed>0?"border-amber-500/50":"border-green-500/50 bg-green-500/10",children:[r.jsx(Lm,{className:`h-4 w-4 ${O.failed>0?"text-amber-500":"text-green-500"}`}),r.jsxs(Id,{children:[r.jsxs("p",{className:"font-medium",children:[O.sent," of ",O.total," emails sent successfully",O.failed>0&&` (${O.failed} failed)`]}),O.errors&&O.errors.length>0&&r.jsxs("details",{className:"mt-2",children:[r.jsx("summary",{className:"text-sm cursor-pointer text-muted-foreground",children:"View errors"}),r.jsx("ul",{className:"mt-2 text-xs space-y-1",children:O.errors.map((M,$)=>r.jsx("li",{className:"text-destructive",children:M},$))})]})]})]});return r.jsx("div",{className:"space-y-6",children:r.jsxs(ec,{defaultValue:"announcements",className:"w-full",children:[r.jsxs(pl,{className:"grid w-full grid-cols-3",children:[r.jsxs(tn,{value:"announcements",className:"flex items-center gap-2",children:[r.jsx(Jy,{className:"h-4 w-4"}),"Announcements"]}),r.jsxs(tn,{value:"policy",className:"flex items-center gap-2",children:[r.jsx(el,{className:"h-4 w-4"}),"Policy Updates"]}),r.jsxs(tn,{value:"history",className:"flex items-center gap-2",children:[r.jsx(Cf,{className:"h-4 w-4"}),"History"]})]}),r.jsx(Fn,{value:"announcements",className:"mt-6",children:r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(Jy,{className:"h-5 w-5"}),"Send Announcement Email"]}),r.jsx(xr,{children:"Send custom announcements to all active users about new features, updates, or important news"})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"subject",children:"Email Subject *"}),r.jsx(He,{id:"subject",placeholder:"e.g., New Feature: Video Reactions Now Available!",value:c,onChange:O=>d(O.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"title",children:"Email Title *"}),r.jsx(He,{id:"title",placeholder:"e.g., Exciting New Feature",value:u,onChange:O=>m(O.target.value)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"This appears as the main heading in the email body."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"message",children:"Message *"}),r.jsx($s,{id:"message",placeholder:"Write your announcement message here. You can use multiple paragraphs...",value:f,onChange:O=>p(O.target.value),rows:6,className:"resize-none"})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"ctaText",children:"Button Text (Optional)"}),r.jsx(He,{id:"ctaText",placeholder:"e.g., Try It Now",value:x,onChange:O=>g(O.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"ctaUrl",children:"Button URL (Optional)"}),r.jsx(He,{id:"ctaUrl",type:"url",placeholder:"e.g., https://vidareo.com/features",value:v,onCh
1211ange:O=>y(O.target.value)})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-4",children:"Add a call-to-action button to direct users to a specific page."}),r.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"h-4 w-4 text-muted-foreground"}),r.jsx(ye,{className:"text-base font-medium",children:"Target Audience"})]}),r.jsxs(Lf,{value:N.includeAll?"all":"filtered",onValueChange:O=>_(M=>({...M,includeAll:O==="all"})),children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(wo,{value:"all",id:"audience-all"}),r.jsx(ye,{htmlFor:"audience-all",className:"cursor-pointer",children:"Send to all active users"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(wo,{value:"filtered",id:"audience-filtered"}),r.jsx(ye,{htmlFor:"audience-filtered",className:"cursor-pointer",children:"Filter by criteria"})]})]}),!N.includeAll&&r.jsxs("div",{className:"space-y-4 pl-6 border-l-2 border-muted ml-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm text-muted-foreground",children:"Filter by subscription tier"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:Cz.map(O=>r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ci,{id:`tier-${O.value}`,checked:N.subscriptionTiers.includes(O.value),onCheckedChange:()=>T(O.value)}),r.jsx(ye,{htmlFor:`tier-${O.value}`,className:"cursor-pointer text-sm",children:O.label})]},O.value))})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm text-muted-foreground",children:"Filter by activity"}),r.jsxs(kn,{value:((U=N.activeDays)==null?void 0:U.toString())||"all",onValueChange:O=>_(M=>({...M,activeDays:O==="all"?null:parseInt(O)})),children:[r.jsx(wn,{className:"w-full md:w-[250px]",children:r.jsx(En,{placeholder:"Select activity filter"})}),r.jsx(jn,{children:ttt.map(O=>r.jsx(_t,{value:O.value,children:O.label},O.value))})]})]})]})]}),r.jsxs(Md,{variant:"default",className:"border-amber-500/50 bg-amber-500/10",children:[r.jsx(wa,{className:"h-4 w-4 text-amber-500"}),r.jsxs(Id,{className:"text-amber-700 dark:text-amber-400",children:["This will send an email to ",r.jsx("strong",{children:D()}),". Please review your message carefully before sending."]})]}),S&&r.jsx(V,{result:S}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[r.jsxs(P,{variant:"outline",onClick:()=>k(!0),disabled:!c.trim()&&!u.trim()&&!f.trim(),className:"w-full sm:w-auto",children:[r.jsx(wr,{className:"mr-2 h-4 w-4"}),"Preview Email"]}),r.jsxs(cs,{children:[r.jsx(Uf,{asChild:!0,children:r.jsx(P,{disabled:b||!c.trim()||!u.trim()||!f.trim(),className:"w-full sm:w-auto",children:b?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending Emails..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Jy,{className:"mr-2 h-4 w-4"}),"Send Announcement"]})})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Confirm Bulk Email"}),r.jsxs(Jn,{children:["You are about to send an announcement email to ",r.jsx("strong",{children:D()}),".",r.jsx("br",{}),r.jsx("br",{}),r.jsx("strong",{children:"Subject:"})," ",c,r.jsx("br",{}),r.jsx("br",{}),"This action cannot be undone. Are you sure you want to proceed?"]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:R,children:"Yes, Send Emails"})]})]})]})]}),r.jsx(Jet,{open:C,onOpenChange:k,subject:c,title:u,message:f,ctaText:x,ctaUrl:v})]})]})}),r.jsxs(Fn,{value:"policy",className:"mt-6",children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(zr,{className:"h-5 w-5"}),"Send Policy Update Notification"]}),r.jsx(xr,{children:"Notify all active users when Terms of Use or Privacy Policy has been updated"})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(ye,{children:"Which policy was updated?"}),r.jsxs(Lf,{value:e,onValueChange:O=>t(O),className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2 p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:[r.jsx(wo,{value:"terms",id:"terms"}),r.jsxs(ye,{htmlFor:"terms",className:"flex items-center gap-2 cursor-pointer flex-1",children:[r.jsx(el,{className:"h-4 w-4 text-blue-500"}),"Terms of Use"]})]}),r.jsxs("div",{className:"flex items-center space-x-2 p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:[r.jsx(wo,{value:"privacy",id:"privacy"}),r.jsxs(ye,{htmlFor:"privacy",className:"flex items-center gap-2 cursor-pointer flex-1",children:[r.jsx(mi,{className:"h-4 w-4 text-green-500"}),"Privacy Policy"]})]}),r.jsxs("div",{className:"flex items-center space-x-2 p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:[r.jsx(wo,{value:"both",id:"both"}),r.jsxs(ye,{htmlFor:"both",className:"flex items-center gap-2 cursor-pointer flex-1",children:[r.jsx(el,{className:"h-4 w-4 text-sky-500"}),"Both Policies"]}
1211)]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"policyMessage",children:"Custom Message (Optional)"}),r.jsx($s,{id:"policyMessage",placeholder:"Add a brief summary of the key changes made to the policy...",value:n,onChange:O=>s(O.target.value),rows:4,className:"resize-none"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"This message will be highlighted in the email to explain the changes."})]}),r.jsxs(Md,{variant:"default",className:"border-amber-500/50 bg-amber-500/10",children:[r.jsx(wa,{className:"h-4 w-4 text-amber-500"}),r.jsxs(Id,{className:"text-amber-700 dark:text-amber-400",children:["This will send an email to ",r.jsx("strong",{children:"all active users"}),". Please ensure the ",A()," has been updated before sending."]})]}),o&&r.jsx(V,{result:o}),r.jsxs(cs,{children:[r.jsx(Uf,{asChild:!0,children:r.jsx(P,{disabled:a,className:"w-full md:w-auto",children:a?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending Emails..."]}):r.jsxs(r.Fragment,{children:[r.jsx(zr,{className:"mr-2 h-4 w-4"}),"Send Policy Update Email"]})})}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Confirm Bulk Email"}),r.jsxs(Jn,{children:["You are about to send a policy update notification email to ",r.jsx("strong",{children:"all active users"})," regarding the ",A(),".",r.jsx("br",{}),r.jsx("br",{}),"This action cannot be undone. Are you sure you want to proceed?"]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:E,children:"Yes, Send Emails"})]})]})]})]})]}),r.jsxs(Ie,{className:"mt-6",children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-lg",children:"Policy Pages"}),r.jsx(xr,{children:"Quick links to review current policies"})]}),r.jsx(lt,{children:r.jsxs("div",{className:"flex flex-wrap gap-3",children:[r.jsx(P,{variant:"outline",asChild:!0,children:r.jsxs("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",children:[r.jsx(el,{className:"mr-2 h-4 w-4"}),"View Terms of Use"]})}),r.jsx(P,{variant:"outline",asChild:!0,children:r.jsxs("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",children:[r.jsx(mi,{className:"mr-2 h-4 w-4"}),"View Privacy Policy"]})})]})})]})]}),r.jsx(Fn,{value:"history",className:"mt-6",children:r.jsx(ett,{})})]})})};async function ntt(e,t=5,n){return new Promise((s,a)=>{const i=document.createElement("video");i.crossOrigin="anonymous",i.preload="metadata";const o=setTimeout(()=>{i.src="",a(new Error("Video loading timed out after 30 seconds"))},3e4);i.onloadedmetadata=async()=>{clearTimeout(o);const l=i.duration;if(!l||l<=0){a(new Error("Invalid video duration"));return}const c=[];for(let f=0;f<t;f++){const p=(f+1)/(t+1);c.push(l*p)}const d=document.createElement("canvas"),u=d.getContext("2d");if(!u){a(new Error("Failed to get canvas context"));return}const m=[];for(let f=0;f<c.length;f++)try{const p=await stt(i,c[f],d,u);m.push(p),n==null||n((f+1)/c.length*100)}catch(p){console.warn(`Failed to capture frame at ${c[f]}s:`,p)}if(i.src="",m.length===0){a(new Error("Failed to extract any frames from video"));return}s(m)},i.onerror=()=>{clearTimeout(o),a(new Error("Failed to load video. Make sure the URL is accessible and CORS-enabled."))},i.src=e})}function stt(e,t,n,s){return new Promise((a,i)=>{const o=setTimeout(()=>{i(new Error("Seek timeout"))},1e4);e.onseeked=()=>{clearTimeout(o),n.width=e.videoWidth,n.height=e.videoHeight,s.drawImage(e,0,0,n.width,n.height);const l=n.toDataURL("image/jpeg",.8);a(l)},e.currentTime=t})}const att=[{title:"Product Demo Video",description:"Learn how to use our new software features in this tutorial.",imageUrls:[]},{title:"HATE ALL [group]!!!",description:"They are terrible and should be stopped!",imageUrls:[]},{title:"How to make explosives at home",description:"Step by step guide to dangerous materials",imageUrls:[]},{title:"FREE MONEY - Click now!!!",description:"Make $10000 per day with this simple trick! Limited time offer! Act now!",imageUrls:[]},{title:"Graphic violence compilation",description:"The most brutal fights caught on camera",imageUrls:[]},{title:"Team meeting recap",description:"Summary of our Q4 planning session and next steps",imageUrls:[]}],itt=[{title:"Nature Documentary",description:"Beautiful landscape and wildlife footage",videoUrl:"https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"}
1211,{title:"Tech Product Demo",description:"Software tutorial and feature walkthrough",videoUrl:"https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"},{title:"Corporate Presentation",description:"Business meeting recording with slides",videoUrl:"https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4"}],ott=()=>{const[e,t]=h.useState([]),[n,s]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,m]=h.useState(!1),[f,p]=h.useState("text"),x=async N=>{t(_=>_.map(C=>C.id===N.id?{...C,loading:!0,result:void 0,extractionProgress:0}:C));try{let _=[...N.imageUrls];if(N.videoUrl)try{const E=await ntt(N.videoUrl,5,R=>{t(T=>T.map(D=>D.id===N.id?{...D,extractionProgress:R}:D))});_=[..._,...E]}catch(E){console.error("Frame extraction error:",E),Pe.error(`Frame extraction failed: ${E instanceof Error?E.message:"Unknown error"}`)}const{data:C,error:k}=await F.functions.invoke("test-moderation",{body:{title:N.title,description:N.description,imageUrls:_}});if(k)throw k;if(!C.success)throw new Error(C.error);t(E=>E.map(R=>R.id===N.id?{...R,loading:!1,result:C.result,extractionProgress:void 0}:R))}catch(_){console.error("Moderation test error:",_),Pe.error("Failed to run moderation test"),t(C=>C.map(k=>k.id===N.id?{...k,loading:!1,extractionProgress:void 0}:k))}},g=()=>{if(f==="video"){if(!c.trim()){Pe.error("Please enter a video URL");return}const C={id:`video-${Date.now()}`,title:n.trim()||"Video Test",description:a.trim(),imageUrls:[],videoUrl:c.trim()};t(k=>[C,...k]),s(""),i(""),d(""),Pe.success("Video test case added");return}if(!n.trim()&&!a.trim()){Pe.error("Please enter a title or description");return}const N=o.split(/[,\n]/).map(C=>C.trim()).filter(C=>C.length>0),_={id:`custom-${Date.now()}`,title:n.trim(),description:a.trim(),imageUrls:N};t(C=>[_,...C]),s(""),i(""),l(""),Pe.success("Test case added")},v=()=>{const N=att.map((_,C)=>({id:`sample-${Date.now()}-${C}`,..._}));t(_=>[...N,..._]),Pe.success("Sample text test cases added")},y=()=>{const N=itt.map((_,C)=>({id:`video-sample-${Date.now()}-${C}`,title:_.title,description:_.description,imageUrls:[],videoUrl:_.videoUrl}));t(_=>[...N,..._]),Pe.success("Sample video test cases added")},b=async()=>{if(e.length===0){Pe.error("No test cases to run");return}m(!0);for(const N of e)await x(N),await new Promise(_=>setTimeout(_,500));m(!1),Pe.success("All tests completed")},w=N=>{t(_=>_.filter(C=>C.id!==N))},S=()=>{t([])},j=N=>{switch(N.wouldBeStatus){case"approved":return r.jsxs(Se,{className:"bg-green-500/10 text-green-600 border-green-500/20",children:[r.jsx(Lm,{className:"h-3 w-3 mr-1"}),"Would be Approved"]});case"rejected":return r.jsxs(Se,{variant:"destructive",children:[r.jsx(sg,{className:"h-3 w-3 mr-1"}),"Would be Rejected"]});case"review":return r.jsxs(Se,{variant:"secondary",className:"bg-orange-500/10 text-orange-600 border-orange-500/20",children:[r.jsx(wa,{className:"h-3 w-3 mr-1"}),"Would need Review"]})}};return r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(SL,{className:"h-5 w-5"}),"Moderation Test Panel"]}),r.jsx(xr,{children:"Test how the AI moderation system would classify sample content without creating actual videos"})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4 p-4 bg-muted/50 rounded-lg",children:[r.jsx("h3",{className:"font-medium",children:"Add Custom Test"}),r.jsxs(ec,{value:f,onValueChange:p,children:[r.jsxs(pl,{className:"grid w-full grid-cols-2",children:[r.jsxs(tn,{value:"text",className:"flex items-center gap-2",children:[r.jsx(wi,{className:"h-4 w-4"}),"Text & Images"]}),r.jsxs(tn,{value:"video",className:"flex items-center gap-2",children:[r.jsx(cr,{className:"h-4 w-4"}),"Video URL"]})]}),r.jsxs(Fn,{value:"text",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"test-title",children:"Video Title"}),r.jsx(He,{id:"test-title",placeholder:"Enter test video title...",value:n,onChange:N=>s(N.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"test-images",children:"Image URLs (one per line, optional)"}),r.jsx($s,{id:"test-images",placeholder:`https://example.com/frame1.jpg
1212https://example.com/frame2.jpg`,value:o,onChange:N=>l(N.target.value),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Add multiple image URLs to test multi-frame analysis"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"test-description",children:"Video Description"}),r.jsx($s,{id:"test-description",placeholder:"Enter test video description...",value:a,onChange:N=>i(N.target.value),rows:3})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{onClick:g,children:"Add Test Case"}),r.jsx(P,{variant:"outline",onClick:v,children:"Add Sample Tests"})]})]}
1212),r.jsxs(Fn,{value:"video",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"video-title",children:"Video Title (optional)"}),r.jsx(He,{id:"video-title",placeholder:"Enter test video title...",value:n,onChange:N=>s(N.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"video-url",children:"Video URL"}),r.jsx(He,{id:"video-url",placeholder:"https://example.com/video.mp4",value:c,onChange:N=>d(N.target.value)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Direct video URL (must be CORS-enabled). Frames will be extracted automatically."})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"video-description",children:"Video Description (optional)"}),r.jsx($s,{id:"video-description",placeholder:"Enter test video description...",value:a,onChange:N=>i(N.target.value),rows:2})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{onClick:g,children:[r.jsx(bi,{className:"h-4 w-4 mr-2"}),"Add Video Test"]}),r.jsx(P,{variant:"outline",onClick:y,children:"Add Sample Videos"})]})]})]})]}),r.jsx(Kl,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.length," test case",e.length!==1?"s":"",e.filter(N=>N.videoUrl).length>0&&r.jsxs("span",{className:"ml-2",children:["(",e.filter(N=>N.videoUrl).length," video",e.filter(N=>N.videoUrl).length!==1?"s":"",")"]})]}),r.jsx("div",{className:"flex gap-2",children:e.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(P,{variant:"outline",size:"sm",onClick:S,children:"Clear All"}),r.jsx(P,{size:"sm",onClick:b,disabled:u,children:u?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"h-4 w-4 mr-2 animate-spin"}),"Running..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Js,{className:"h-4 w-4 mr-2"}),"Run All Tests"]})})]})})]}),e.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(SL,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No test cases yet"}),r.jsx("p",{className:"text-sm",children:"Add a custom test or load sample tests to get started"})]}):r.jsx("div",{className:"space-y-4",children:e.map(N=>r.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[r.jsx("h4",{className:"font-medium truncate",children:N.title||"Untitled"}),N.videoUrl&&r.jsxs(Se,{variant:"outline",className:"text-xs flex-shrink-0 bg-primary/5",children:[r.jsx(cr,{className:"h-3 w-3 mr-1"}),"Video"]}),N.imageUrls.length>0&&r.jsxs(Se,{variant:"outline",className:"text-xs flex-shrink-0",children:[r.jsx(wi,{className:"h-3 w-3 mr-1"}),N.imageUrls.length," image",N.imageUrls.length!==1?"s":""]})]}),r.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:N.description||"No description"}),N.videoUrl&&r.jsx("p",{className:"text-xs text-muted-foreground truncate mt-1",children:N.videoUrl})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.jsx(P,{variant:"outline",size:"sm",onClick:()=>x(N),disabled:N.loading||u,children:N.loading?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):r.jsx(Js,{className:"h-4 w-4"})}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>w(N.id),className:"text-muted-foreground hover:text-destructive",children:r.jsx(Xr,{className:"h-4 w-4"})})]})]}),N.loading&&N.videoUrl&&N.extractionProgress!==void 0&&r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(bi,{className:"h-3 w-3"}),"Extracting frames..."]}),r.jsxs("span",{children:[Math.round(N.extractionProgress),"%"]})]}),r.jsx(Lc,{value:N.extractionProgress,className:"h-1"})]}),N.result&&r.jsxs("div",{className:"mt-3 pt-3 border-t space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[j(N.result),r.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[r.jsx(qH,{className:"h-3.5 w-3.5"}),r.jsxs("span",{className:`font-medium ${N.result.confidence>=.8?"text-green-600":N.result.confidence>=.5?"text-yellow-600":"text-red-600"}`,children:[Math.round(N.result.confidence*100),"% confidence"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[r.jsx(fr,{className:"h-3.5 w-3.5"}),N.result.processingTimeMs,"ms"]}),N.result.imagesAnalyzed>0&&r.jsxs(Se,{variant:"outline",className:"text-xs",children:[r.jsx(wi,{className:"h-3 w-3 mr-1"}),N.result.imagesAnalyzed," image",N.result.imagesAnalyzed!==1?"s":""," analyzed"]})]}),N.result.flagged_categories.length>0&&r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"Flagged:"}),N.result.flagged_categories.map(_=>r.jsx(Se,{variant:"destructive",className:"text-xs capitalize",children:_.replace(/_/g," ")},_))]}),r.jsxs("div",{className:"bg-muted/50 rounded-md p-3",children:[r.jsx("p",{className:"text-sm font-medium mb-1",children:"AI Reasoning:"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:N.result.reasoning})]})]})]},N.id))})]})]})},ltt=({open:e,onOpenChange:t,userId:n,userName:s,userEmail:a})=>{const[i,o]=h.useState([]),[l,c]=h.useState(!0);h.useEffect(()=>{e&&n&&d()},[e,n]);const d=async()=>{c(!0);try{const{data:m,error:f}=await F.from("video_moderation").select(`
1213          id,
1214          video_id,
1215          status,
1216          flagged_categories,
1217          rejection_reason,
1218          confidence_score,
1219          created_at,
1220          reviewed_at
1221        `).eq("user_id",n).in("status",["rejected","review"]).order("created_at",{ascending:!1});if(f)throw f;if(m&&m.length>0){const p=m.map(y=>y.video_id),{data:x}=await F.from("videos").select("id, title").in("id",p),g=new Map((x==null?void 0:x.map(y=>[y.id,y.title]))||[]),v=m.map(y=>({...y,video_title:g.get(y.video_id)||"Unknown Video"}));o(v)}else o([])}catch(m){console.error("Error fetching violations:",m)}finally{c(!1)}},u=m=>{switch(m){case"rejected":return{icon:sg,color:"text-red-500",bg:"bg-red-500/10",label:"Rejected"};case"review":return{icon:wr,color:"text-orange-500",bg:"bg-orange-500/10",label:"Under Review"};default:return{icon:wa,color:"text-yellow-500",bg:"bg-yellow-500/10",label:"Flagged"}}};return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-2xl max-h-[80vh]",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(fr,{className:"h-5 w-5"}),"Violation History"]}),r.jsxs($r,{children:["Chronological view of flagged content for ",s||a||"Unknown User"]}
1221)]}),r.jsx(Io,{className:"h-[60vh] pr-4",children:l?r.jsx("div",{className:"space-y-4",children:[1,2,3].map(m=>r.jsxs("div",{className:"flex gap-4",children:[r.jsx(ia,{className:"h-10 w-10 rounded-full"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx(ia,{className:"h-4 w-32"}),r.jsx(ia,{className:"h-3 w-48"})]})]},m))}):i.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(cr,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No violation history found"})]}):r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute left-5 top-0 bottom-0 w-0.5 bg-border"}),r.jsx("div",{className:"space-y-6",children:i.map((m,f)=>{const p=u(m.status),x=p.icon;return r.jsxs("div",{className:"relative flex gap-4",children:[r.jsx("div",{className:`relative z-10 flex-shrink-0 w-10 h-10 rounded-full ${p.bg} flex items-center justify-center`,children:r.jsx(x,{className:`h-5 w-5 ${p.color}`})}),r.jsx("div",{className:"flex-1 pb-6",children:r.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 border",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm line-clamp-1",children:m.video_title}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[r.jsx(Ga,{className:"h-3 w-3"}),r.jsx("span",{children:cn(new Date(m.created_at),"MMM d, yyyy h:mm a")}),r.jsx("span",{className:"text-muted-foreground/50",children:"•"}),r.jsx("span",{children:dh(new Date(m.created_at),{addSuffix:!0})})]})]}),r.jsx(Se,{className:`${p.bg} ${p.color} border-0 text-xs`,children:p.label})]}),m.flagged_categories&&m.flagged_categories.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:m.flagged_categories.map(g=>r.jsx(Se,{variant:"outline",className:"text-xs capitalize",children:g.replace(/_/g," ")},g))}),m.rejection_reason&&r.jsxs("div",{className:"mt-3 text-sm text-muted-foreground bg-background/50 rounded p-2",children:[r.jsx("span",{className:"font-medium text-foreground",children:"Reason: "}),m.rejection_reason]}),m.confidence_score!==null&&r.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["AI Confidence: ",(m.confidence_score*100).toFixed(0),"%"]}),m.reviewed_at&&r.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Reviewed: ",cn(new Date(m.reviewed_at),"MMM d, yyyy h:mm a")]})]})})]},m.id)})})]})})]})})},ctt=({onViewUser:e})=>{const[t,n]=h.useState([]),[s,a]=h.useState(!0),[i,o]=h.useState(null);h.useEffect(()=>{l()},[]);const l=async()=>{a(!0);try{const{data:u,error:m}=await F.from("video_moderation").select(`
1222          user_id,
1223          status,
1224          flagged_categories,
1225          created_at
1226        `).order("created_at",{ascending:!1});if(m)throw m;const f=new Map;u==null||u.forEach(y=>{var w;const b=f.get(y.user_id)||{total_videos:0,flagged_count:0,rejected_count:0,review_count:0,pending_count:0,latest_flag_date:null,all_categories:[]};b.total_videos++,y.status==="rejected"?(b.rejected_count++,b.flagged_count++):y.status==="review"?(b.review_count++,b.flagged_count++):y.status==="pending"&&b.pending_count++,(w=y.flagged_categories)!=null&&w.length&&b.all_categories.push(...y.flagged_categories),(y.status==="rejected"||y.status==="review")&&(!b.latest_flag_date||y.created_at>b.latest_flag_date)&&(b.latest_flag_date=y.created_at),f.set(y.user_id,b)});const p=Array.from(f.entries()).filter(([y,b])=>b.flagged_count>=5).map(([y])=>y);if(p.length===0){n([]),a(!1);return}const{data:x,error:g}=await F.from("profiles").select("user_id, email, full_name, avatar_url, is_suspended").in("user_id",p);if(g)throw g;const v=p.map(y=>{const b=f.get(y),w=x==null?void 0:x.find(j=>j.user_id===y),S=[...new Set(b.all_categories)];return{user_id:y,email:(w==null?void 0:w.email)||null,full_name:(w==null?void 0:w.full_name)||null,avatar_url:(w==null?void 0:w.avatar_url)||null,is_suspended:(w==null?void 0:w.is_suspended)||!1,total_videos:b.total_videos,flagged_count:b.flagged_count,rejected_count:b.rejected_count,review_count:b.review_count,pending_count:b.pending_count,latest_flag_date:b.latest_flag_date,flagged_categories:S}});v.sort((y,b)=>b.flagged_count-y.flagged_count),n(v)}catch(u){console.error("Error fetching repeat offenders:",u)}finally{a(!1)}},c=(u,m)=>m>=3?{level:"critical",color:"text-red-600",bg:"bg-red-500/10",icon:RL}:u>=5||m>=2?{level:"high",color:"text-orange-600",bg:"bg-orange-500/10",icon:Mb}:{level:"medium",color:"text-yellow-600",bg:"bg-yellow-500/10",icon:mi},d=(u,m)=>u?u.split(" ").map(f=>f[0]).join("").toUpperCase().slice(0,2):m?m[0].toUpperCase():"?";return s?r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(wa,{className:"h-5 w-5"}),"Repeat Offenders"]}),r.jsx(xr,{children:"Loading..."})]}),r.jsx(lt,{className:"space-y-4",children:[1,2,3].map(u=>r.jsxs("div",{className:"flex items-center gap-4 p-4 border rounded-lg",children:[r.jsx(ia,{className:"h-10 w-10 rounded-full"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx(ia,{className:"h-4 w-32"}),r.jsx(ia,{className:"h-3 w-48"})]})]},u))})]}):r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(wa,{className:"h-5 w-5 text-orange-500"}),"Repeat Offenders"]}),r.jsxs(xr,{children:["Users with multiple flagged or rejected videos (",t.length," identified)"]})]}),r.jsx(lt,{children:t.length===0?r.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[r.jsx(mi,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No repeat offenders detected"}),r.jsx("p",{className:"text-sm",children:"Users with 5+ flagged videos will appear here"})]}):r.jsx("div",{className:"space-y-3",children:t.map(u=>{const m=c(u.flagged_count,u.rejected_count),f=m.icon;return r.jsxs("div",{className:`border rounded-lg p-4 space-y-3 ${m.bg}`,children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:u.avatar_url||void 0}),r.jsx(on,{children:d(u.full_name,u.email)})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-medium",children:u.full_name||u.email||"Unknown User"}),u.is_suspended&&r.jsx(Se,{variant:"destructive",className:"text-xs",children:"Suspended"})]}),u.email&&u.full_name&&r.jsx("p",{className:"text-sm text-muted-foreground",children:u.email})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Se,{className:`${m.bg} ${m.color} border-0`,children:[r.jsx(f,{className:"h-3 w-3 mr-1"}),m.level.toUpperCase()," RISK"]}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>o({userId:u.user_id,userName:u.full_name,userEmail:u.email}),title:"View violation history",children:r.jsx(Cf,{className:"h-4 w-4"})}),e&&r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>e(u.user_id),children:"View User"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 text-sm",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r.jsx(cr,{className:"h-3.5 w-3.5"}),r.jsxs("span",{children:[u.total_videos," total videos"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Po,{className:"h-3.5 w-3.5 text-orange-500"}),r.jsxs("span",{className:"text-orange-600 font-medium",children:[u.flagged_count," flagged"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(RL,{className:"h-3.5 w-3.5 text-red-500"}),r.jsxs("span",{className:"text-red-600 font-medium",children:[u.rejected_count," rejected"]})]}),u.latest_flag_date&&r.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r.jsx(Ga,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:dh(new Date(u.latest_flag_date),{addSuffix:!0})})]})]}),u.flagged_categories.length>0&&r.jsxs("div",{className:"flex items-center gap-2 flex-wrap pt-1",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Categories:"}),u.flagged_categories.slice(0,5).map(p=>r.jsx(Se,{variant:"outline",className:"text-xs capitalize",children:p.replace(/_/g," ")},p)),u.flagged_categories.length>5&&r.jsxs(Se,{variant:"outline",className:"text-xs",children:["+",u.flagged_categories.length-5," more"]})]})]},u.user_id)})})}),r.jsx(ltt,{open:!!i,onOpenChange:u=>!u&&o(null),userId:(i==null?void 0:i.userId)||"",userName:(i==null?void 0:i.userName)||null,userEmail:(i==null?void 0:i.userEmail)||null})]})},dtt=()=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let t="VIDAREO";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t},utt=()=>{const{user:e}=nr(),t=c5(),[n,s]=h.useState(!1),[a,i]=h.useState(!1),[o,l]=h.useState(null),[c,d]=h.useState(""),[u,m]=h.useState(""),[f,p]=h.useState(10),[x,g]=h.useState(["professional","team"]),[v,y]=h.useState(["monthly","annual"]),[b,w]=h.useState(""),[S,j]=h.useState(""),[N,_]=h.useState(!0),[C,k]=h.useState("discount"),{data:E,isLoading:R}=Upe({queryKey:["promo-codes"],queryFn:async()=>{const{data:H,error:X}=await F.from("promo_codes").select("*").order("created_at",{ascending:!1});if(X)throw X;return H}}),T=Ck({mutationFn:async H=>{const{error:X}=await F.from("promo_codes").insert([H]);if(X)throw X},onSuccess:()=>{t.invalidateQueries({queryKey:["promo-codes"]}),Rt({title:"Promo code created",description:"The promo code has been created successfully."}),V(),s(!1)},onError:H=>{Rt({title:"Error",description:H.message,variant:"destructive"})}}),D=Ck({mutationFn:async({id:H,updates:X})=>{const{error:G}=await F.from("promo_codes").update(X).eq("id",H);if(G)throw G},onSuccess:()=>{t.invalidateQueries({queryKey:["promo-codes"]}),Rt({title:"Promo code updated",description:"The promo code has been updated successfully."}),i(!1),l(null)},onError:H=>{Rt({title:"Error",description:H.message,variant:"destructive"})}}),A=Ck({mutationFn:async H=>{const{error:X}=await F.from("promo_codes").delete().eq("id",H);if(X)throw X},onSuccess:()=>{t.invalidateQueries({queryKey:["promo-codes"]}),Rt({title:"Promo code deleted",description:"The promo code has been deleted."})},onError:H=>{Rt({title:"Error",description:H.message,variant:"destructive"})}}),V=()=>{d(""),m(""),p(10),g(["professional","team"]),y(["monthly","annual"]),w(""),j(""),_(!0),k("discount")},U=()=>
1226{if(!c.trim()){Rt({title:"Error",description:"Please enter a promo code",variant:"destructive"});return}T.mutate({code:c.toUpperCase().trim(),description:u.trim()||null,discount_percentage:f,applicable_tiers:x,applicable_billing_cycles:v,usage_limit:b?parseInt(b):null,expires_at:S||null,is_active:N,grant_type:C,created_by:(e==null?void 0:e.id)||"",current_usage:0})},O=H=>{var X;l(H),d(H.code),m(H.description||""),p(H.discount_percentage),g(H.applicable_tiers),y(H.applicable_billing_cycles),w(((X=H.usage_limit)==null?void 0:X.toString())||""),j(H.expires_at?H.expires_at.split("T")[0]:""),_(H.is_active),k(H.grant_type||"discount"),i(!0)},M=()=>{o&&D.mutate({id:o.id,updates:{code:c.toUpperCase().trim(),description:u.trim()||null,discount_percentage:f,applicable_tiers:x,applicable_billing_cycles:v,usage_limit:b?parseInt(b):null,expires_at:S||null,is_active:N,grant_type:C}})},$=H=>{navigator.clipboard.writeText(H),Rt({title:"Copied",description:"Promo code copied to clipboard"})},I=H=>{g(X=>X.includes(H)?X.filter(G=>G!==H):[...X,H])},B=H=>{y(X=>X.includes(H)?X.filter(G=>G!==H):[...X,H])},K=H=>H?new Date(H)<new Date:!1,Z=(H,X)=>H?X>=H:!1,q=()=>r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Code Type"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("button",{type:"button",onClick:()=>k("discount"),className:`rounded-lg border p-3 text-left text-sm transition-colors ${C==="discount"?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[r.jsx("span",{className:"font-medium block",children:"Discount"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"% off at Stripe checkout"})]}),r.jsxs("button",{type:"button",onClick:()=>k("gift_pro"),className:`rounded-lg border p-3 text-left text-sm transition-colors ${C==="gift_pro"?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[r.jsx("span",{className:"font-medium block",children:"Gift Pro account"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Free Pro forever, no card"})]})]}),C==="gift_pro"&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"Redeemable on the Billing page or at checkout. Instantly grants a free Professional plan - no Stripe subscription is created."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"code",children:"Promo Code"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{id:"code",value:c,onChange:H=>d(H.target.value.toUpperCase()),placeholder:"VIDAREO20",className:"font-mono uppercase"}),r.jsx(P,{type:"button",variant:"outline",size:"icon",onClick:()=>d(dtt()),title:"Generate random code",children:r.jsx(vs,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"description",children:"Description (optional)"}),r.jsx(He,{id:"description",value:u,onChange:H=>m(H.target.value),placeholder:"Summer promotion 2026"})]}),C==="discount"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"discount",children:"Discount Percentage"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{id:"discount",type:"number",min:1,max:100,value:f,onChange:H=>p(parseInt(H.target.value)||0),className:"w-24"}),r.jsx("span",{className:"text-muted-foreground",children:"%"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Applicable Plans"}),r.jsxs("div",{className:"flex gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"tier-professional",checked:x.includes("professional"),onCheckedChange:()=>I("professional")}),r.jsx("label",{htmlFor:"tier-professional",className:"text-sm",children:"Professional"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"tier-team",checked:x.includes("team"),onCheckedChange:()=>I("team")}),r.jsx("label",{htmlFor:"tier-team",className:"text-sm",children:"Team"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Billing Cycles"}),r.jsxs("div",{className:"flex gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"cycle-monthly",checked:v.includes("monthly"),onCheckedChange:()=>B("monthly")}),r.jsx("label",{htmlFor:"cycle-monthly",className:"text-sm",children:"Monthly"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"cycle-annual",checked:v.includes("annual"),onCheckedChange:()=>B("annual")}),r.jsx("label",{htmlFor:"cycle-annual",className:"text-sm",children:"Annual"})]})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"usageLimit",children:"Usage Limit (optional)"}),r.jsx(He,{id:"usageLimit",type:"number",min:1,value:b,onChange:H=>w(H.target.value),placeholder:"Unlimited"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"expiresAt",children:"Expires On (optional)"}),r.jsx(He,{id:"expiresAt",type:"date",value:S,onChange:H=>j(H.target.value)})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(rr,{id:"isActive",checked:N,onCheckedChange:_}),r.jsx(ye,{htmlFor:"isActive",children:"Active"})]})]});return r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(pT,{className:"h-5 w-5"}),"Promo Codes"]}),r.jsx(xr,{children:"Manage promotional codes for subscription discounts"})]}),r.jsxs(It,{open:n,onOpenChange:H=>{s(H),H||V()},children:[r.jsx(wv,{asChild:!0,children:r.jsxs(P,{className:"gap-2",children:[r.jsx(Ns,{className:"h-4 w-4"}),"Create Code"]}
1226)}),r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Create Promo Code"}),r.jsx($r,{children:"Create a new promotional code for subscription discounts"})]}),q(),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),r.jsx(P,{onClick:U,disabled:T.isPending,children:T.isPending?"Creating...":"Create"})]})]})]})]})}),r.jsxs(lt,{children:[R?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):(E==null?void 0:E.length)===0?r.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[r.jsx(pT,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"No promo codes yet"}),r.jsx("p",{className:"text-sm",children:"Create your first promotional code"})]}):r.jsx("div",{className:"overflow-x-auto",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"Code"}),r.jsx(ar,{children:"Discount"}),r.jsx(ar,{children:"Plans"}),r.jsx(ar,{children:"Billing"}),r.jsx(ar,{children:"Usage"}),r.jsx(ar,{children:"Expires"}),r.jsx(ar,{children:"Status"}),r.jsx(ar,{className:"text-right",children:"Actions"})]})}),r.jsx(du,{children:E==null?void 0:E.map(H=>{const X=K(H.expires_at),G=Z(H.usage_limit,H.current_usage),ee=!H.is_active||X||G;return r.jsxs(pr,{className:ee?"opacity-60":"",children:[r.jsxs(Te,{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"bg-muted px-2 py-1 rounded text-sm font-mono",children:H.code}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>$(H.code),children:r.jsx(ui,{className:"h-3 w-3"})})]}),H.description&&r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:H.description})]}),r.jsx(Te,{children:H.grant_type==="gift_pro"?r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[r.jsx(mT,{className:"h-3 w-3"}),"Gift Pro"]}):r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Pue,{className:"h-3 w-3 text-primary"}),r.jsxs("span",{className:"font-medium",children:[H.discount_percentage,"%"]})]})}),r.jsx(Te,{children:r.jsx("div",{className:"flex gap-1 flex-wrap",children:H.applicable_tiers.map(re=>r.jsx(Se,{variant:"outline",className:"text-xs capitalize",children:re},re))})}),r.jsx(Te,{children:r.jsx("div",{className:"flex gap-1 flex-wrap",children:H.applicable_billing_cycles.map(re=>r.jsx(Se,{variant:"secondary",className:"text-xs capitalize",children:re},re))})}),r.jsx(Te,{children:r.jsxs("span",{className:G?"text-destructive font-medium":"",children:[H.current_usage,H.usage_limit&&` / ${H.usage_limit}`]})}),r.jsx(Te,{children:H.expires_at?r.jsx("span",{className:X?"text-destructive":"",children:cn(new Date(H.expires_at),"MMM d, yyyy")}):r.jsx("span",{className:"text-muted-foreground",children:"Never"})}),r.jsx(Te,{children:X?r.jsx(Se,{variant:"destructive",children:"Expired"}):G?r.jsx(Se,{variant:"destructive",children:"Limit Reached"}):H.is_active?r.jsx(Se,{variant:"default",className:"bg-green-500",children:"Active"}):r.jsx(Se,{variant:"secondary",children:"Inactive"})}),r.jsx(Te,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-1",children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>O(H),children:r.jsx(ZH,{className:"h-4 w-4"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm("Delete this promo code?")&&A.mutate(H.id)},children:r.jsx(Xr,{className:"h-4 w-4"})})]})})]},H.id)})})]})}),r.jsx(It,{open:a,onOpenChange:H=>{i(H),H||(l(null),V())},children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Edit Promo Code"}),r.jsx($r,{children:"Update promotional code settings"})]}),q(),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),r.jsx(P,{onClick:M,disabled:D.isPending,children:D.isPending?"Saving...":"Save Changes"})]})]})})]})]})},mtt=()=>{const{toast:e}=Gr(),[t,n]=h.useState([]),[s,a]=h.useState(!0),[i,o]=h.useState(""),[l,c]=h.useState(null),[d,u]=h.useState(null),[m,f]=h.useState(""),[p,x]=h.useState(2),[g,v]=h.useState(null),[y,b]=h.useState(null);h.useEffect(()=>{w()},[]);const w=async()=>{try{a(!0);const{data:k,error:E}=await F.from("teams").select("*").order("created_at",{ascending:!1});if(E)throw E;if(!k){n([]);return}const R=[];for(const T of k){const[D,A,V]=await Promise.all([F.from("profiles").select("full_name, email, avatar_url").eq("user_id",T.owner_id).maybeSingle(),F.from("team_members").select("*").eq("team_id",T.id),F.from("team_invitations").select("*").eq("team_id",T.id)]),U=[];if(A.data)for(const O of A.data){const{data:M}=await F.from("profiles").select("full_name, email, avatar_url").eq("user_id",O.user_id).maybeSingle();
1226U.push({...O,profile:M||void 0})}R.push({...T,ownerProfile:D.data||void 0,members:U,invitations:V.data||[]})}n(R)}catch(k){console.error("Error fetching teams:",k),e({title:"Error",description:"Failed to load teams.",variant:"destructive"})}finally{a(!1)}},S=async()=>{if(d)try{const{error:k}=await F.from("teams").update({name:m,max_members:p}).eq("id",d.id);if(k)throw k;e({title:"Team updated"}),u(null),w()}catch(k){console.error(k),e({title:"Error",description:"Failed to update team.",variant:"destructive"})}},j=async()=>{if(g)try{await F.from("team_members").delete().eq("team_id",g),await F.from("team_invitations").delete().eq("team_id",g);const{error:k}=await F.from("teams").delete().eq("id",g);if(k)throw k;e({title:"Team deleted"}),v(null),w()}catch(k){console.error(k),e({title:"Error",description:"Failed to delete team.",variant:"destructive"})}},N=async()=>{if(y)try{const{error:k}=await F.from("team_members").delete().eq("id",y.memberId);if(k)throw k;e({title:"Member removed"}),b(null),w()}catch(k){console.error(k),e({title:"Error",description:"Failed to remove member.",variant:"destructive"})}},_=async k=>{try{const{error:E}=await F.from("team_invitations").delete().eq("id",k);if(E)throw E;e({title:"Invitation deleted"}),w()}catch(E){console.error(E),e({title:"Error",description:"Failed to delete invitation.",variant:"destructive"})}},C=t.filter(k=>{var R,T,D,A;const E=i.toLowerCase();return k.name.toLowerCase().includes(E)||((T=(R=k.ownerProfile)==null?void 0:R.email)==null?void 0:T.toLowerCase().includes(E))||((A=(D=k.ownerProfile)==null?void 0:D.full_name)==null?void 0:A.toLowerCase().includes(E))});return s?r.jsx("div",{className:"space-y-4",children:[1,2,3].map(k=>r.jsx(Ie,{children:r.jsx(lt,{className:"p-6",children:r.jsx(ia,{className:"h-16 w-full"})})},k))}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-xl font-bold",children:"Team Management"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," team",t.length!==1?"s":""," total"]})]}),r.jsxs("div",{className:"relative w-64",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{placeholder:"Search teams...",value:i,onChange:k=>o(k.target.value),className:"pl-9"})]})]}),C.length===0?r.jsx(Ie,{children:r.jsx(lt,{className:"p-8 text-center text-muted-foreground",children:"No teams found."})}):r.jsx("div",{className:"space-y-3",children:C.map(k=>{var R,T;const E=l===k.id;return r.jsx(Ie,{children:r.jsxs(lt,{className:"p-4",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:()=>c(E?null:k.id),children:[r.jsx("div",{className:"bg-amber-500/10 p-2 rounded-lg",children:r.jsx(jr,{className:"h-5 w-5 text-amber-500"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"font-semibold text-foreground truncate",children:k.name}),r.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Owner: ",((R=k.ownerProfile)==null?void 0:R.full_name)||((T=k.ownerProfile)==null?void 0:T.email)||"Unknown"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsxs(Se,{variant:"outline",className:"text-xs",children:[k.members.length,"/",k.max_members," members"]}),k.subscription_id&&r.jsx(Se,{className:"text-xs bg-green-500/20 text-green-700 border-green-500/30",children:"Active Sub"}),r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>{u(k),f(k.name),x(k.max_members)},children:r.jsx(QH,{className:"h-4 w-4"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive",onClick:()=>v(k.id),children:r.jsx(Xr,{className:"h-4 w-4"})}),r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>c(E?null:k.id),children:E?r.jsx(Mm,{className:"h-4 w-4"}):r.jsx(Qs,{className:"h-4 w-4"})})]})]}),E&&r.jsxs("div",{className:"mt-4 space-y-4 border-t border-border pt-4",children:[r.jsxs("div",{children:[r.jsxs("h4",{className:"text-sm font-medium mb-2",children:["Members (",k.members.length,")"]}),k.members.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:"No members yet."}):r.jsx("div",{className:"space-y-2",children:k.members.map(D=>{var A,V,U,O,M,$;return r.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-muted/30",children:[r.jsxs(an,{className:"h-8 w-8",children:[r.jsx(gn,{src:((A=D.profile)==null?void 0:A.avatar_url)||void 0}),r.jsx(on,{className:"text-xs",children:(((V=D.profile)==null?void 0:V.full_name)||((U=D.profile)==null?void 0:U.email)||"U").charAt(0).toUpperCase()})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("p",{className:"text-sm font-medium truncate",children:[((O=D.profile)==null?void 0:O.full_name)||((M=D.profile)==null?void 0:M.email)||"Unknown",D.user_id===k.owner_id&&r.jsx(Se,{variant:"secondary",className:"ml-2 text-[10px]",children:"Owner"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:($=D.profile)==null?void 0:$.email})]}),r.jsx(Se,{variant:"outline",className:"text-xs capitalize",children:D.role}),D.user_id!==k.owner_id&&r.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive h-7 w-7",onClick:()=>{var I,B;return b({teamId:k.id,memberId:D.id,name:((I=D.profile)==null?void 0:I.full_name)||((B=D.profile)==null?void 0:B.email)||"this member"})},children:r.jsx(eb,{className:"h-3.5 w-3.5"})})]},D.id)})})]}),k.invitations.length>0&&r.jsxs("div",{children:[r.jsxs("h4",{className:"text-sm font-medium mb-2",children:["Pending Invitations (",k.invitations.filter(D=>D.status==="pending").length,")"]}),r.jsx("div",{className:"space-y-2",children:k.invitations.filter(D=>D.status==="pending").map(D=>r.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-muted/30",children:[r.jsx(zr,{className:"h-4 w-4 text-muted-foreground"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm truncate",children:D.email}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Expires: ",new Date(D.expires_at).toLocaleDateString()]})]}),r.jsx(Se,{variant:"outline",className:"text-xs capitalize",children:D.status}),r.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive h-7 w-7",onClick:()=>_(D.id),children:r.jsx(Xr,{className:"h-3.5 w-3.5"})})]},D.id))})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created: ",new Date(k.created_at).toLocaleDateString(),k.subscription_id&&` • Stripe: ${k.subscription_id}`]})]})]})},k.id)})}),r.jsx(It,{open:!!d,onOpenChange:k=>!k&&u(null),children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Edit Team"}),r.jsx($r,{children:"Update team settings."})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Team Name"}),r.jsx(He,{value:m,onChange:k=>f(k.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Max Members"}),r.jsx(He,{type:"number",min:1,value:p,onChange:k=>x(parseInt(k.target.value)||2)})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>u(null),children:"Cancel"}),r.jsx(P,{onClick:S,children:"Save"})]})]})}),r.jsx(cs,{open:!!g,onOpenChange:k=>!k&&v(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete Team"}),r.jsx(Jn,{children:"This will permanently delete the team, remove all members, and cancel pending invitations. This action cannot be undone."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Team"})]})]})}),r.jsx(cs,{open:!!y,onOpenChange:k=>!k&&b(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Remove Member"}),r.jsxs(Jn,{children:["Are you sure you want to remove ",y==null?void 0:y.name," from this team?"]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})},XE=50,Yj=e=>`$${(e/100).toFixed(2)}`,htt=e=>{if(e==="all")return null;const t=e==="7d"?7:e==="30d"?30:90,n=new Date;return n.setDate(n.getDate()-t),n.toISOString()},ftt=()=>{const[e,t]=h.useState(!0),[n,s]=h.useState([]),[a,i]=h.useState("30d"),[o,l]=h.useState("all"),[c,d]=h.useState("all"),[u,m]=h.useState(0),f=async()=>{t(!0);try{let w=F.from("refund_events").select("*").order("refunded_at",{ascending:!1}).limit(1e3);const S=htt(a);S&&(w=w.gte("refunded_at",S)),o!=="all"&&(w=w.eq("provider",o));const{data:j,error:N}=await w;if(N)throw N;s(j??[]),m(0)}catch(w){console.error("[AdminRefunds] load failed",w),Pe.error((w==null?void 0:w.message)??"Failed to load refunds")}finally{t(!1)}};h.useEffect(()=>{f()},[a,o]);const p=h.useMemo(()=>{const w=new Set;
1226return n.forEach(S=>S.product_label&&w.add(S.product_label)),Array.from(w).sort()},[n]),x=h.useMemo(()=>n.filter(w=>c==="all"||w.product_label===c),[n,c]),g=h.useMemo(()=>{const w=x.length,S=x.reduce((_,C)=>_+(C.gross_amount_cents||0),0),j=x.reduce((_,C)=>_+(C.commission_lost_cents||0),0),N=new Set(x.map(_=>_.user_id).filter(Boolean)).size;return{count:w,gross:S,commission:j,uniqueUsers:N}},[x]),v=x.slice(u*XE,(u+1)*XE),y=Math.max(1,Math.ceil(x.length/XE)),b=()=>{if(!x.length){Pe.info("Nothing to export");return}const w=["Date","Provider","User","Product","Gross USD","Commission Lost USD","Reason","Refund ID"],S=x.map(E=>[new Date(E.refunded_at).toISOString(),E.provider,E.user_email??E.user_id??"",E.product_label??"",(E.gross_amount_cents/100).toFixed(2),(E.commission_lost_cents/100).toFixed(2),E.reason??"",E.provider_refund_id]),j=E=>{const R=String(E??"");return/^[=+\-@\t\r]/.test(R)?`'${R}`:R},N=[w,...S].map(E=>E.map(R=>`"${j(R).replace(/"/g,'""')}"`).join(",")).join(`
1227`),_=new Blob([N],{type:"text/csv"}),C=URL.createObjectURL(_),k=document.createElement("a");k.href=C,k.download=`refunds-${a}-${new Date().toISOString().slice(0,10)}.csv`,k.click(),URL.revokeObjectURL(C)};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Refunds"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:'Track refunds across Stripe and Apple. Apple keeps their commission on refunded transactions, shown as "Commission lost" below.'})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(P,{variant:"outline",size:"sm",onClick:f,disabled:e,children:[r.jsx(vs,{className:`h-4 w-4 mr-2 ${e?"animate-spin":""}`}),"Refresh"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:b,disabled:!x.length,children:[r.jsx(lv,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]})]}),r.jsxs("div",{className:"flex gap-3 flex-wrap",children:[r.jsxs(kn,{value:a,onValueChange:w=>i(w),children:[r.jsx(wn,{className:"w-[160px]",children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"7d",children:"Last 7 days"}),r.jsx(_t,{value:"30d",children:"Last 30 days"}),r.jsx(_t,{value:"90d",children:"Last 90 days"}),r.jsx(_t,{value:"all",children:"All time"})]})]}),r.jsxs(kn,{value:o,onValueChange:w=>l(w),children:[r.jsx(wn,{className:"w-[160px]",children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"all",children:"All providers"}),r.jsx(_t,{value:"stripe",children:"Stripe"}),r.jsx(_t,{value:"apple",children:"Apple"})]})]}),r.jsxs(kn,{value:c,onValueChange:d,children:[r.jsx(wn,{className:"w-[220px]",children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"all",children:"All products"}),p.map(w=>r.jsx(_t,{value:w,children:w},w))]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[r.jsx(Gj,{icon:r.jsx(E_,{className:"h-4 w-4"}),label:"Refunds",value:String(g.count)}),r.jsx(Gj,{icon:r.jsx(dw,{className:"h-4 w-4"}),label:"Gross refunded",value:Yj(g.gross)}),r.jsx(Gj,{icon:r.jsx(Fue,{className:"h-4 w-4"}),label:"Commission lost",value:Yj(g.commission),tone:"destructive"}),r.jsx(Gj,{icon:r.jsx(wa,{className:"h-4 w-4"}),label:"Affected users",value:String(g.uniqueUsers)})]}),r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-base",children:"Refund events"}),r.jsxs(xr,{children:["Showing ",v.length," of ",x.length," refunds."]})]}),r.jsx(lt,{children:e?r.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((w,S)=>r.jsx(ia,{className:"h-10 w-full"},S))}):v.length===0?r.jsx("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"No refunds in this range. That's a good thing."}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"overflow-x-auto",children:r.jsxs(lu,{children:[r.jsx(cu,{children:r.jsxs(pr,{children:[r.jsx(ar,{children:"Date"}),r.jsx(ar,{children:"Provider"}),r.jsx(ar,{children:"User"}),r.jsx(ar,{children:"Product"}),r.jsx(ar,{className:"text-right",children:"Gross"}),r.jsx(ar,{className:"text-right",children:"Commission lost"}),r.jsx(ar,{children:"Reason"})]})}),r.jsx(du,{children:v.map(w=>r.jsxs(pr,{children:[r.jsx(Te,{className:"text-xs text-muted-foreground",children:new Date(w.refunded_at).toLocaleStr
1227ing()}),r.jsx(Te,{children:r.jsx(Se,{variant:w.provider==="apple"?"destructive":"secondary",children:w.provider})}),r.jsx(Te,{className:"text-sm",children:w.user_email??"-"}),r.jsx(Te,{className:"text-sm",children:w.product_label??"-"}),r.jsx(Te,{className:"text-right font-mono text-sm",children:Yj(w.gross_amount_cents)}),r.jsx(Te,{className:"text-right font-mono text-sm text-destructive",children:w.commission_lost_cents>0?Yj(w.commission_lost_cents):"-"}),r.jsx(Te,{className:"text-xs text-muted-foreground capitalize",children:w.reason??"-"})]},w.id))})]})}),y>1&&r.jsxs("div",{className:"flex items-center justify-between pt-4",children:[r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Page ",u+1," of ",y]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{variant:"outline",size:"sm",disabled:u===0,onClick:()=>m(w=>w-1),children:"Previous"}),r.jsx(P,{variant:"outline",size:"sm",disabled:u>=y-1,onClick:()=>m(w=>w+1),children:"Next"})]})]})]})})]})]})},Gj=({icon:e,label:t,value:n,tone:s})=>r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs(xr,{className:"flex items-center gap-2",children:[e,t]})}),r.jsx(lt,{children:r.jsx("div",{className:`text-2xl font-bold ${s==="destructive"?"text-destructive":"text-foreground"}`,children:n})})]}),ptt=()=>{const e=Sr(),{user:t,loading:n,signOut:s}=nr(),{isAdmin:a,loading:i}=sp(),{avatarUrl:o,getInitials:l,userEmail:c}=ree(),d=async()=>{await s(),e("/")};return h.useEffect(()=>{!n&&!t&&e("/auth")},[t,n,e]),h.useEffect(()=>{!i&&!a&&t&&e("/")},[a,i,t,e]),n||i?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):a?r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("header",{className:"border-b border-border bg-background/80 backdrop-blur-md sticky top-0 z-50 pt-[env(safe-area-inset-top)]",children:r.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>e("/"),children:r.jsx(aa,{className:"h-5 w-5"})}),r.jsxs("a",{href:"/",className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-9 h-9 rounded-xl overflow-hidden flex items-center justify-center",children:r.jsx("img",{src:ch,alt:"VIDAREO",className:"w-full h-full object-contain"})}),r.jsx("span",{className:"text-xl font-bold text-foreground",children:"VIDAREO"})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Get,{}),r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[r.jsx(mi,{className:"h-3 w-3"}),"Admin Dashboard"]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsxs(an,{className:"h-9 w-9 border-2 border-border hover:border-primary transition-colors cursor-pointer",children:[r.jsx(gn,{src:o||void 0,alt:"User avatar"}),r.jsx(on,{className:"bg-primary/10 text-primary text-sm font-medium",children:l(c)})]})}),r.jsxs(So,{align:"end",className:"w-48 bg-popover border border-border shadow-lg z-50",children:[r.jsxs(tr,{onClick:()=>e("/profile"),className:"cursor-pointer gap-2",children:[r.jsx(Cc,{className:"h-4 w-4"}),"Profile"]}),r.jsxs(tr,{onClick:()=>e("/settings"),className:"cursor-pointer gap-2",children:[r.jsx(Vm,{className:"h-4 w-4"}),"Settings"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:d,className:"cursor-pointer gap-2 text-destructive focus:text-destructive",children:[r.jsx(dN,{className:"h-4 w-4"}),"Log Out"]})]})]})]})]})}),r.jsx("main",{className:"container mx-auto px-4 py-8",children:r.jsxs(ec,{defaultValue:"overview",className:"space-y-6",children:[r.jsxs(pl,{className:"grid w-full grid-cols-9 lg:w-auto lg:inline-grid",children:[r.jsxs(tn,{value:"overview",className:"gap-2",children:[r.jsx(XH,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Overview"})]}),r.jsxs(tn,{value:"users",className:"gap-2",children:[r.jsx(jr,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Users"})]}),r.jsxs(tn,{value:"teams",className:"gap-2",children:[r.jsx(Wue,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Teams"})]}),r.jsxs(tn,{value:"billing",className:"gap-2",children:[r.jsx(dw,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Billing"})]}),r.jsxs(tn,{value:"refunds",className:"gap-2",children:[r.jsx(E_,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Refunds"})]}),r.jsxs(tn,{value:"promos",className:"gap-2",children:[r.jsx(pT,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Promos"})]}),r.jsxs(tn,{value:"videos",className:"gap-2",children:[r.jsx(cr,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Videos"})]}),r.jsxs(tn,{value:"emails",className:"gap-2",children:[r.jsx(zr,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Emails"})]}),r.jsxs(tn,{value:"activity",className:"gap-2",children:[r.jsx(Cf,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Activity"})]})]}),r.jsx(Fn,{value:"overview",children:r.jsx(Let,{})}),r.jsx(Fn,{value:"users",children:r.jsx(Bet,{})}),r.jsx(Fn,{value:"teams",children:r.jsx(mtt,{})}),r.jsx(Fn,{value:"billing",children:r.jsx(Ket,{})}),r.jsx(Fn,{value:"refunds",children:r.jsx(ftt,{})}),r.jsx(Fn,{value:"promos",children:r.jsx(utt,{})}),r.jsx(Fn,{value:"videos",children:r.jsxs("div",{className:"space-y-6",children:[r.jsx(ctt,{}),r.jsx(zet,{}),r.jsx(ott,{})]})}),r.jsx(Fn,{value:"emails",children:r.jsx(rtt,{})}),r.jsx(Fn,{value:"activity",children:r.jsx(qet,{})})]})})]}):null}
1227,wl=({title:e,subtitle:t,imageSrc:n})=>r.jsxs("section",{className:"relative overflow-hidden",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("img",{src:n,alt:"",className:"w-full h-full object-cover",width:1920,height:600}),r.jsx("div",{className:"absolute inset-0 bg-primary/85"})]}),r.jsxs("div",{className:"container mx-auto px-4 relative py-16 sm:py-20 lg:py-24 text-center",children:[r.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-extrabold text-white mb-4",children:e}),t&&r.jsx("p",{className:"text-lg md:text-xl text-white/80 max-w-3xl mx-auto",children:t})]})]}),xtt=()=>{const e=Sr();return h.useEffect(()=>{window.scrollTo(0,0),document.title="Terms of Use | VIDAREO - Video Messaging Platform";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","VIDAREO Terms of Use: acceptable use, accounts, billing, intellectual property, and your rights on our video messaging platform.");const n=document.querySelector('meta[property="og:title"]');n&&n.setAttribute("content","Terms of Use | VIDAREO - Video Messaging Platform");const s=document.querySelector('meta[property="og:description"]');s&&s.setAttribute("content","VIDAREO Terms of Use: acceptable use, accounts, billing, intellectual property, and your rights on our video messaging platform.");const a=document.querySelector('meta[property="og:url"]');a&&a.setAttribute("content",window.location.href);const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Terms of Use | VIDAREO - Video Messaging Platform");const o=document.querySelector('meta[name="twitter:description"]');return o&&o.setAttribute("content","VIDAREO Terms of Use: acceptable use, accounts, billing, intellectual property, and your rights on our video messaging platform."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",n&&n.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),s&&s.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),a&&a.setAttribute("content","https://vidareo.com"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsx("div",{className:"pt-14 sm:pt-16 lg:pt-20",children:r.jsx(wl,{title:"Terms of Use",subtitle:"Version 3.3 · Last updated: August 18, 2026",imageSrc:"https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?w=1920&h=600&fit=crop"})}),r.jsxs("main",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[r.jsxs("div",{className:"prose prose-lg dark:prose-invert max-w-none space-y-8",children:[r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"1. Introduction"}),r.jsx("p",{className:"text-muted-foreground",children:`Welcome to VIDAREO, operated by Summit 23 LLC dba VIDAREO ("we," "us," or "our"). By using our platform, you agree to these Terms of Use and our Content Policy. These terms govern your access to and use of VIDAREO's services, including our website, native mobile applications (iOS and iPadOS), Chrome extension, screen + camera recording, presentation recording, video replies, video calls (up to 4 participants), contact management, AI script generation, teleprompter, and any related features.`})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"2. Acceptance of Terms"}),r.jsx("p",{className:"text-muted-foreground",children:"By creating an account or using VIDAREO, you confirm that you are at least 18 years old (or the age of majority in your jurisdiction) and agree to be bound by these Terms. If you do not agree, you may not use our services."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"2a. Eligibility"}),r.jsx("p",{className:"text-muted-foreground",children:"You must be at least eighteen (18) years of age and have the legal capacity to enter into a binding agreement to create a VIDAREO account or use the Services. By creating an account or using VIDAREO, you represent and warrant that you are at least 18 years of age and legally authorized to enter into and comply with these Terms."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"3. Our Services"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO provides the following services for personalized video messaging and relationship building:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Screen + Camera Recording:"})," Record your screen with a camera bubble overlay for demos, tutorials, and presentations with system audio support"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Chrome Extension:"})," Record from any browser tab with floating controls, picture-in-picture camera, and one-click sharing via the VIDAREO Chrome extension"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Presentation Recording:"})," Upload slide decks (PDF or PowerPoint) and record over them with your camera using side-by-side or slides-only layouts"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Browser Recording:"})," Record directly from your browser using native screen capture APIs"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Direct Inbox Delivery:"})," Send videos directly to recipient inboxes via secure, shareable links with email, SMS, and social sharing"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Replies & Reactions:"})," Enable recipients to respond with video/text replies and emoji reactions for two-way communication"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Threaded Conversations:"}
1227)," Continue discussions with nested reply threads on shared videos"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Transcription:"})," AI-powered transcription of your video content"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Real-Time Analytics:"})," Track views, watch duration, completion rates, reactions, and get instant view notifications via email and push"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Contact Management:"})," Import, organize, and segment contacts into lists for targeted, personalized video outreach with CSV and vCard support"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Bulk Video Email:"})," Send personalized video emails to entire contact lists with tracking and analytics"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"AI Script Generation:"})," Generate video scripts with AI to help you stay on message"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Teleprompter:"})," Auto-scrolling teleprompter to guide your recordings"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Calls:"})," Peer-to-peer video calls with up to 4 participants via WebRTC, with instant room creation, invite link sharing, and no downloads required (Professional and Team plans)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Host Call Recording:"})," Optional client-side recording of video calls by the host only, capturing the composited participant grid and mixed audio. Recordings are processed locally in the host's browser and saved to the host's video library (capped at 20 minutes per recording)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team Management:"})," Invite team members, manage roles, and access unified team analytics"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Custom Branding:"})," Add custom watermarks with your company logo, email signatures, and header subtitles"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Folder Organization:"})," Organize videos into folders for easy management"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Editor:"})," Trim, split, and delete sections of your videos in the browser. Final renders are processed server-side via secure edge functions and saved back to your library"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Meeting Scheduling & Recurring Meetings:"})," Schedule one-time or recurring video calls, generate calendar invites (.ics), and manage past events"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Pre-Join Lobby:"})," Microphone and camera preview with device selection before entering a video call room (no audio or video is recorded in the lobby)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Email Management Hub:"})," Compose, send, and track personalized bulk email with custom templates and per-recipient unique tracking links"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Native Mobile Apps (iOS/iPadOS):"})," Record, review, share, and reply to videos from your iPhone or iPad, with a mobile-optimized interface, orientation-aware recording, and push notifications. Some web-only features (including screen sharing) are not available on mobile or tablet browsers due to platform constraints."]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"4. User Responsibilities"}),r.jsx("p",{className:"text-muted-foreground",children:"You are responsible for:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Maintaining the confidentiality of your account credentials"}),r.jsx("li",{children:"Creating a strong password meeting our complexity requirements (minimum 8 characters including uppercase, lowercase, numbers, and special characters)"}),r.jsx("li",{children:"All activities that occur under your account"}),r.jsx("li",{children:"Ensuring your content complies with our Content Policy"}),r.jsx("li",{children:"Using the platform only for lawful purposes"}),r.jsx("li",{children:"Obtaining necessary permissions before recording others"}),r.jsx("li",{children:"Respecting the privacy of individuals appearing in y
1227our videos"}),r.jsx("li",{children:"Ensuring you have consent to store and email contacts you add to the platform"}),r.jsx("li",{children:"Complying with applicable anti-spam laws (e.g., CAN-SPAM, GDPR) when sending bulk video emails"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"5. Recording Features & Permissions"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"When using our recording features, you grant VIDAREO access to:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Camera Access:"})," Required for camera recording, screen + camera overlay, presentation mode, and video calls"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Microphone Access:"})," Required for audio capture in all recording modes and video calls"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Screen Capture:"})," Required for screen recording and Chrome extension recording features"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"The Chrome extension requests only the minimum browser permissions required to capture tab content, manage recording state, and upload completed recordings (activeTab, tabCapture, desktopCapture, storage, notifications, and offscreen). Note that certain browser pages (chrome://, extension pages, Chrome Web Store) are restricted by the browser and cannot be recorded. You are responsible for ensuring you have the right to record any content, including obtaining consent from individuals who appear in your videos and respecting copyright for any materials shown on screen. Video calls are peer-to-peer and are not recorded or stored by VIDAREO unless the host explicitly enables Host Call Recording, in which case the recording is composited locally in the host's browser and saved only to the host's video library - VIDAREO does not record participants server-side. When you use the Video Editor, your source videos are processed server-side via secure edge functions solely on your instruction to produce the trimmed or exported output you request."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"6. Account Security"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO implements the following security measures to protect your account:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Email Verification:"})," All accounts require email verification before access is granted"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Password Requirements:"})," Passwords must be at least 8 characters and include uppercase letters, lowercase letters, numbers, and special characters"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Leaked-Password Screening:"})," New and changed passwords are checked against the Have I Been Pwned (HIBP) breach database using k-anonymity (only a hashed prefix is sent) to block known-compromised credentials"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Rate Limiting:"})," After 5 failed login attempts, access is temporarily blocked for 15 minutes per email/IP address and a security alert email is sent to the account holder"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Session Timeout:"})," Sessions are monitored for inactivity; a warning is displayed after 30 minutes of inactivity and you are automatically logged out after 35 minutes"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Active Sessions:"})," You can view active session information in your account settings"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Remember Me:"})," Optional local-device storage of your email (and, if you enable it, credentials) on trusted devices for faster sign-in; you can clear this at any time by signing out or clearing browser storage"]})]})]}),r.jsxs("section",{className:"bg-destructive/5 border border-destructive/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"7. 
1227Content Policy"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO uses automated AI moderation to review all uploaded content. The following types of content are strictly prohibited and will result in immediate removal and potential account termination:"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Hate Speech"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Content promoting hatred, discrimination, or violence against individuals or groups based on race, ethnicity, national origin, religion, gender, gender identity, sexual orientation, disability, or other protected characteristics."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Violence & Threats"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Graphic violence, threats of violence, incitement to violence, or content that glorifies violent acts."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Sexual Content"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Explicit sexual content, nudity, pornography, or content intended to be sexually gratifying. This includes sexually suggestive content involving minors."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Spam & Deceptive Practices"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Unsolicited commercial content, misleading information, fake engagement, phishing attempts, or content designed to deceive viewers for personal gain."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Dangerous Acts"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Content promoting dangerous activities, illegal drug use, self-harm, or challenges that could result in physical injury."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Child Endangerment"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Any content that exploits, endangers, or sexualizes minors. This is a zero-tolerance policy and will be reported to appropriate authorities."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Harassment & Bullying"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Targeted harassment, cyberbullying, doxxing, or content intended to intimidate, shame, or degrade specific individuals."})]}),r.jsxs("div",{className:"border-l-4 border-destructive pl-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Misinformation"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Deliberately false or misleading information that could cause real-world harm."})]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"8. Video Quality & Limits"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"To ensure optimal platform performance and fair usage, the following limits apply:"}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4",children:"Technical Limits"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Maximum file size:"})," 1 GB per video"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Maximum resolution:"})," 1080p (1920x1080)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Supported formats:"})," MP4, WebM, MOV"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Host Call Recording:"})," Capped at 20 minutes per recording (composited client-side in the host's browser)"]})]}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4",children:"Plan-Based Limits"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Free Starter:"}
1227)," 2 minutes per video, 5 recordings per month, 5 video sends per month, 720p quality"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Professional ($29.95/month or $19.95/month billed annually at $239.40/year):"})," 10 minutes per video (extendable to 30 or 60 min with add-ons), unlimited recordings and sends, 1080p quality"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team ($19.00/user/month or $15.00/user/month billed annually):"})," Everything in Professional plus team workspace, admin controls, team analytics, and priority support. Minimum 2 users."]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Extended video length add-ons are available for Professional and Team plans: 30-minute (+$20/month) or 60-minute (+$30/month). On Team plans, add-ons are billed per user."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"9. Video Sharing"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"When sharing videos, you can configure the following options:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Password Protection:"})," Require a password to view shared videos"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Expiration Dates:"})," Set videos to expire after a specific date"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"View Limits:"})," Limit the number of times a video can be viewed"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Link Management:"})," Deactivate share links at any time"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Custom Thumbnails:"})," Select thumbnails from your video for email previews"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Multiple Channels:"})," Share via email (Gmail, Outlook, Yahoo, Apple Mail), SMS text message, or direct link"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Per-Recipient Tracking Links:"})," Bulk email sends generate a unique tracking link for each recipient so opens, clicks, and views can be attributed to individual contacts in your analytics"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You are responsible for managing access to your shared videos. We are not responsible for unauthorized sharing of video links by recipients."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"10. Moderation & Enforcement"}),r.jsx("p",{className:"text-muted-foreground",children:"All uploaded content is automatically reviewed by our AI moderation system. Content that violates our policies may be:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Automatically removed from the platform"}),r.jsx("li",{children:"Flagged for human review"}),r.jsx("li",{children:"Result in account warnings or suspension"}),r.jsx("li",{children:"Lead to permanent account termination for severe or repeated violations"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Users may appeal content removal decisions by contacting our support team."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"11. Team Features"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Team functionality allows collaboration with the following terms:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Team owners are responsible for team member conduct"}),r.jsx("li",{children:"Team invitations expire after 7 days if not accepted"}),r.jsx("li",{children:"Team members may have access to team analytics"}),r.jsx("li",{children:"Removing a team member revokes their access to team resources"}),r.jsx("li",{children:"Team plans require a minimum of 2 users"}),r.jsx("li",{children:"Extended video length add-ons on Team plans are charged per user"}),r.jsx("li",{children:"Team members may schedule one-time or recurring meetings, generate calendar invites, and view team-wide past events"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"12. Intellectual Property"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"You retain ownership of content you create. By uploading content to VIDAREO, you grant us a non-exclusive license to host, display, process, and distribute your content as necessary to provide our services, including transcription and moderation. You represent that you have all necessary rights to the content you upload."}),r.jsxs("p",{className:"text-muted-foreground",children:[r.jsx("strong",{children:"Feedback:"}),' If you provide us with any feedback, suggestions, ideas, or proposals ("Feedback"), you agree that we may use, disclose, reproduce, and otherwise exploit such Feedback without restriction or obligation to you. You hereby assign to us all rights, title, and interest in and to any such Feedback.']})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"12a. Third-Party Video Content (YouTube)"}),r.jsxs("p",{className:"text-muted-foreground mb-4",children:["VIDAREO allows you to add YouTube videos to your library by URL and share them through branded share links. VIDAREO does not download, re-host, or modify YouTube content; it is embedded directly from YouTube using YouTube's official player. Your use of embedded YouTube content is also governed by the",r.jsx("a",{href:"https://www.youtube.com/t/terms",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:" YouTube Terms of Service"})," ","and the"," ",r.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Google Privacy Policy"}),"."]}),r.jsx("p",{className:"text-muted-foreground",children:"You are responsible for ensuring that the YouTube videos you add and share do not infringe any third-party rights and comply with the YouTube Terms of Service. VIDAREO is not responsible for the availability, accuracy, or content of any YouTube video, and embedded videos may become unavailable if removed by their creator or by YouTube."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"12b. DMCA Notice & Copyright Infringement"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:'VIDAREO respects the intellectual property rights of others and complies with the Digital Millennium Copyright Act ("DMCA"). If you believe that content hosted on or shared through VIDAREO infringes your copyright, you may submit a written notice to our designated Copyright Agent that includes all of the following:'}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"A physical or electronic signature of the copyright owner or an authorized representative"}),r.jsx("li",{children:"Identification of the copyrighted work you claim has been infringed"}),r.jsx("li",{children:"The specific URL(s) or location of the allegedly infringing material on VIDAREO so we can locate it"}),r.jsx("li",{children:"Your contact information (name, address, telephone number, email)"}),r.jsx("li",{children:"A statement that you have a good-faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law"}),r.jsx("li",{children:"A statement, made under penalty of perjury, that the information in the notice is accurate and that you are the copyright owner or authorized to act on the owner's behalf"})]}),r.jsxs("p",{className:"text-muted-foreground mt-4",children:["Send DMCA notices to: ",r.jsx("strong",{children:"[email protected]"}),' (Subject: "DMCA Takedown Request") or to Summit 23 LLC dba VIDAREO, Attn: Copyright Agent.']}),r.jsxs("p",{className:"text-muted-foreground mt-4",children:[r.jsx("strong",{children:"Counter-Notice:"})," If you believe your content was removed in error, you may submit a counter-notice to the same address containing the information required under 17 U.S.C. § 512(g)."]}),r.jsxs("p",{className:"text-muted-foreground mt-4",children:[r.jsx("strong",{children:"Repeat Infringers:"})," We will terminate, in appropriate circumstances, the accounts of users who are determined to be repeat infringers."]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"13. Privacy"}),r.jsx("p",{className:"text-muted-foreground",children:"Your privacy is important to us. Please review our Privacy Policy to understand how we 
1227collect, use, and protect your information, including data from screen recordings, captures, and video analytics. By using VIDAREO, you consent to our data practices as described in our Privacy Policy."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"14. Subscriptions & Billing"}),r.jsx("p",{className:"text-muted-foreground",children:"Some features require a paid subscription. Subscription terms include:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Subscriptions renew automatically unless cancelled"}),r.jsx("li",{children:"Monthly usage limits (recordings and sends) reset each billing cycle"}),r.jsx("li",{children:"Annual billing is available at $19.95/month (billed at $239.40/year), saving ~33% compared to monthly billing at $29.95/month"}),r.jsx("li",{children:"Add-ons (extended video length) can be purchased separately"}),r.jsx("li",{children:"Promo codes may be applied at checkout for eligible discounts"}),r.jsx("li",{children:"Manage subscriptions via the Stripe Customer Portal from your Billing settings (/billing)"}),r.jsx("li",{children:"Downgrading may result in loss of premium features and enforce Free tier limits"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"14a. App Store & In-App Purchases"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:`Subscriptions and add-ons purchased through the Apple App Store or Google Play are billed, renewed, and managed by the applicable app store under its own terms. Cancellations, refunds, and billing disputes for those purchases must be handled through the app store (e.g., Apple's "Report a Problem" or Google Play refund process) and are governed by the app store's policies rather than VIDAREO's pro-rated refund policy. Web subscriptions purchased through vidareo.com continue to be managed via our Stripe-powered billing portal and remain subject to Section 15 below.`}),r.jsx("p",{className:"text-muted-foreground",children:"Prices, plans, and available features on mobile apps may differ from the web due to app store requirements. You are responsible for any charges incurred through your app store account."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"15. Refund Policy"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO offers pro-rated refunds for subscription cancellations. The following terms apply:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Pro-Rated Credit:"})," When you cancel your subscription, you will receive a pro-rated refund based on the unused time remaining in your current billing period"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Calculation:"})," Refund amounts are calculated from the date of cancellation to the end of the current billing cycle"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Processing Time:"})," Refunds are processed within 5–10 business days and returned to the original payment method"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Add-Ons:"})," Extended video length add-ons are also eligible for pro-rated refunds upon cancellation"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Annual Plans:"})," Annual subscriptions are refunded on a pro-rated basis for the remaining unused months"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Free Tier:"})," The Free Starter plan has no associated charges and is not eligible for refunds"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"To request a cancellation and refund, visit your billing settings or contact us at [email protected]."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"16. Termination"}),r.jsx("p",{className:"text-muted-foreground",children:"We reserve the right to suspend or terminate your account at any time for violations of these Terms or our Content Policy. You may also delete your account at any time. Upon termination, your right to use the service ceases immediately, and your videos and data will be deleted within 30 days."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"17. Indemnification"}),r.jsx("p",{className:"text-muted-foreground",children:"You agree to indemnify, defend, and hold harmless Summit 23 LLC dba VIDAREO, its officers, directors, employees, agents, and affiliates from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising out of or related to:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Your use of the service or any violation of these Terms"}),r.jsx("li",{children:"Any content you create, upload, share, or distribute through VIDAREO"}),r.jsx("li",{children:"Your violation of any third-party rights, including intellectual property, privacy, or publicity rights"}),r.jsx("li",{children:"Your violation of any applicable law, rule, or regulation, including anti-spam and data protection laws"}),r.jsx("li",{children:"Any claim that your content caused damage to a third party"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"18. Limitation of Liability"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:'VIDAREO IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.'}),r.jsx("li",{children:"IN NO EVENT SHALL SUMMIT 23 LLC DBA VIDAREO BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES."}),r.jsx("li",{children:"OUR TOTAL AGGREGATE LIABILITY FOR ALL CLAIMS ARISING OUT OF OR RELATING TO THESE TERMS OR THE SERVICE SHALL NOT EXCEED THE GREATER OF (A) THE AMOUNT YOU PAID TO US IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM, OR (B) ONE HUNDRED DOLLARS ($100)."}
1227),r.jsx("li",{children:"WE DO NOT GUARANTEE UNINTERRUPTED OR ERROR-FREE SERVICE. WE ARE NOT RESPONSIBLE FOR CONTENT CREATED BY USERS, TRANSCRIPTION ACCURACY, OR ANY DAMAGES RESULTING FROM YOUR USE OF THE PLATFORM."})]})]}),r.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"19. Dispute Resolution & Governing Law"}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-2 mb-2",children:"Governing Law"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"These Terms shall be governed by and construed in accordance with the laws of the State of Delaware, United States, without regard to its conflict of law provisions."}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Binding Arbitration"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Any dispute, controversy, or claim arising out of or relating to these Terms or the breach, termination, or val
1227idity thereof shall be finally settled by binding arbitration administered in accordance with the rules of the American Arbitration Association (AAA). The arbitration shall be conducted in the State of Delaware. The arbitrator's award shall be final and binding and may be entered as a judgment in any court of competent jurisdiction."}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Opt-Out"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"You may opt out of this arbitration agreement by sending written notice to [email protected] within 30 days of first accepting these Terms. Your notice must include your name, email address associated with your account, and a clear statement that you wish to opt out of this arbitration provision."}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Class Action Waiver"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"YOU AGREE THAT ANY DISPUTE RESOLUTION PROCEEDINGS WILL BE CONDUCTED ONLY ON AN INDIVIDUAL BASIS AND NOT IN A CLASS, CONSOLIDATED, OR REPRESENTATIVE ACTION. If for any reason a claim proceeds in court rather than in arbitration, both parties waive any right to a jury trial."}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Exceptions"}),r.jsx("p",{className:"text-muted-foreground",children:"Either party may seek injunctive or other equitable relief in any court of competent jurisdiction for claims involving intellectual property infringement or misappropriation."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"20. Force Majeure"}),r.jsx("p",{className:"text-muted-foreground",children:"Neither party shall be liable for any failure or delay in performing obligations under these Terms to the extent such failure or delay results from circumstances beyond the party's reasonable control, including but not limited to acts of God, natural disasters, war, terrorism, pandemics, government actions, power failures, internet or telecommunications failures, or cyberattacks."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"21. Beta Features"}),r.jsx("p",{className:"text-muted-foreground",children:'From time to time, we may offer beta or experimental features ("Beta Features"). Beta Features are provided "as is" without warranty of any kind. We may modify, suspend, or discontinue Beta Features at any time without notice or liability. Your use of Beta Features is at your own risk, and we make no guarantees regarding their availability, reliability, or performance.'})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"22. Export Controls & Sanctions"}),r.jsx("p",{className:"text-muted-foreground",children:"You agree to comply with all applicable export control laws and regulations, including those of the United States (including the Export Administration Regulations and OFAC sanctions programs). You represent and warrant that you are not located in, or a national or resident of, any country or region subject to comprehensive U.S. economic sanctions (currently including Cuba, Iran, North Korea, Syria, and the Crimea, Donetsk, and Luhansk regions of Ukraine), and that you are not listed on any U.S. government restricted-parties list (including OFAC's Specially Designated Nationals list, the Bureau of Industry and Security's Entity List, or the State Department's Debarred List). You may not use VIDAREO in violation of any applicable export or sanctions laws."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"23. Severability"}),r.jsx("p",{className:"text-muted-foreground",children:"If any provision of these Terms is held to be invalid, illegal, or unenforceable by a court of competent jurisdiction, such provision shall be modified to the minimum extent necessary to make it valid and enforceable, or if modification is not possible, severed from these Terms. The remaining provisions shall continue in full force and effect."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"24. Assignment"}),r.jsx("p",{className:"text-muted-foreground",children:"You may not assign or transfer these Terms, or any rights or obligations hereunder, without our prior written consent. We may assign these Terms without restriction. Any attempted assignment in violation of this section shall be null and void. These Terms shall be binding upon and inure to the benefit of the parties and their respective permitted successors and assigns."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"25. Automated Communications"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"By creating an account, you consent to receive the following automated communications:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Welcome Email:"})," Sent immediately upon account creation"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Email Verification:"})," For account security and confirmation"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Retention Milestone Emails:"})," Sent at key milestones (7 days, 30 days, 90 days, 120 days) celebrating your journey and informing you of available features and upgrade options"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Notifications:"})," Alerts when your videos are viewed, replied to, or receive reactions (configurable in settings)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Subscription Updates:"}
1227)," Payment confirmations, renewal notices, and billing changes"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Security Alerts:"})," Password changes, failed login attempt warnings, and account security notifications"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You may manage notification preferences in your account settings. Transactional and security emails cannot be opted out of while your account is active."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"26. Changes to Terms"}),r.jsx("p",{className:"text-muted-foreground",children:"We may update these Terms from time to time. Continued use of VIDAREO after changes constitutes acceptance of the new Terms. We will notify users of significant changes via email or platform notification. We encourage you to review these Terms periodically."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"27. Entire Agreement"}),r.jsx("p",{className:"text-muted-foreground",children:"These Terms, together with the Privacy Policy and Content Policy, constitute the entire agreement between you and Summit 23 LLC dba VIDAREO with respect to the use of the service. Any failure by us to exercise or enforce any right or provision of these Terms shall not constitute a waiver of such right or provision."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"28. Contact Us"}),r.jsx("p",{className:"text-muted-foreground",children:"If you have questions about these Terms or need to report a violation, please contact us:"}),r.jsxs("ul",{className:"list-none pl-0 text-muted-foreground space-y-1 mt-4",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Email:"})," [email protected]"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Entity:"})," Summit 23 LLC dba VIDAREO"]})]})]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx(P,{onClick:()=>e("/"),variant:"outline",children:"Return to Home"})})]}),r.jsx(Ka,{})]})},gtt=()=>{const e=Sr();return h.useEffect(()=>{window.scrollTo(0,0),document.title="Privacy Policy | VIDAREO - Your Data, Protected";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","VIDAREO Privacy Policy: Learn how we collect, use, and protect your personal data. We are committed to transparency and safeguarding your video messages and account information.");const n=document.querySelector('meta[property="og:title"]');n&&n.setAttribute("content","Privacy Policy | VIDAREO - Your Data, Protected");const s=document.querySelector('meta[property="og:description"]');s&&s.setAttribute("content","VIDAREO Privacy Policy: Learn how we collect, use, and protect your personal data. We are committed to transparency and safeguarding your video messages and account information.");const a=document.querySelector('meta[property="og:url"]');a&&a.setAttribute("content",window.location.href);const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Privacy Policy | VIDAREO - Your Data, Protected");const o=document.querySelector('meta[name="twitter:description"]');return o&&o.setAttribute("content","VIDAREO Privacy Policy: Learn how we collect, use, and protect your personal data. We are committed to transparency and safeguarding your video messages and account information."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",n&&n.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),s&&s.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),a&&a.setAttribute("content","https://vidareo.com"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsx("div",{className:"pt-14 sm:pt-16 lg:pt-20",children:r.jsx(wl,{title:"Privacy Policy",subtitle:"Version 3.3 · Last updated: August 18, 2026",imageSrc:"https://images.unsplash.com/photo-1555949963-ff9fe0c870eb?w=1920&h=600&fit=crop"})}),r.jsxs("main",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[r.jsxs("div",{className:"prose prose-lg dark:prose-invert max-w-none space-y-8",children:[r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"1. Introduction"}),r.jsx("p",{className:"text-muted-foreground",children:'At VIDAREO ("we," "us," or "our"), operated by Summit 23 LLC dba VIDAREO, we take your privacy seriously. This Privacy Policy explains how we 
1227collect, use, disclose, and safeguard your information when you use our personalized video messaging platform for direct inbox delivery, including screen + camera recording, Chrome extension recording, presentation recording, video reply capabilities, video calls (up to 4 participants), contact management, AI-powered script generation, teleprompter, and mobile apps.'})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"2. Scope of This Privacy Policy"}),r.jsx("p",{className:"text-muted-foreground",children:'This Privacy Policy applies to the VIDAREO website, mobile applications, desktop applications, browser extensions, browser-based services, and other products and services offered by Summit 23 LLC under the VIDAREO name (collectively, the "Services").'}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"When you use the Services, we may collect information necessary to provide the features you choose to use, including account information, video and audio recordings, uploaded media, screen recordings, communications, device information, usage information, and other content you voluntarily create, upload, transmit, or share through VIDAREO."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Certain features may require access to your device's camera, microphone, photo library, files, screen, notifications, or other device functionality. VIDAREO will request permission before accessing these features where required. You may manage or revoke these permissions through your device or operating system settings. Disabling certain permissions may prevent some VIDAREO features from functioning properly."}),r.jsxs("p",{className:"text-muted-foreground mt-4",children:["This Privacy Policy applies to personal data we collect as a ",r.jsx("strong",{children:"data controller"})," - meaning data we collect about you when you visit our website, create an account, or use our services. When you use VIDAREO to send video messages to your recipients, you act as the controller of the recipient data you provide (e.g., names and email addresses of your contacts), and we process that data on your behalf as a ",r.jsx("strong",{children:"data processor"}),". In such cases, our processing is governed by applicable data processing terms."]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"3. Information We Collect"}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.1 Account Information"}),r.jsx("p",{className:"text-muted-foreground",children:"When you create an account, we collect:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Email address"}),r.jsx("li",{children:"Full name"}),r.jsx("li",{children:"Profile picture (optional)"}),r.jsx("li",{children:"Company name and job title (optional)"}),r.jsx("li",{children:"Phone number (optional)"}),r.jsx("li",{children:"Company logo (optional, for custom watermarks and branding)"}),r.jsx("li",{children:"Email signature and header subtitle (Professional/Team plans)"})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.2 Contact Data"}),r.jsx("p",{className:"text-muted-foreground",children:"When you use our contact management features, we collect:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Contact names, email addresses, and company names"}),r.jsx("li",{children:"Contact notes and organization metadata"}),r.jsx("li",{children:"Contact list names, descriptions, and membership"}),r.jsx("li",{children:"Imported contact data from CSV and vCard (.vcf) files"})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.3 Video & Recording Data"}),r.jsx("p",{className:"text-muted-foreground",children:"When you use our recording and inbox delivery features, we collect:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Screen + camera recordings and captures (including Chrome extension recordings)"}),r.jsx("li",{children:"Presentation recordings with uploaded slide decks"}),r.jsx("li",{children:"System and tab audio (when enabled)"}),r.jsx("li",{children:"Video metadata (duration, file size, resolution, recording mode)"}),r.jsx("li",{children:"Custom thumbnails you create or select"}),r.jsx("li",{children:"Video transcriptions (when enabled)"}),r.jsx("li",{children:"AI-generated scripts and teleprompter content"}),r.jsx("li",{children:"Video titles, descriptions, tags, and folder organization"}),r.jsx("li",{children:"Video replies (video and text) from recipients"}),r.jsx("li",{children:"Emoji reactions from viewers"}),r.jsx("li",{children:"Recipient information for inbox delivery (email, name, phone when provided)"}),r.jsx("li",{children:"Video call metadata (room codes, call duration, participant count - video/audio streams are peer-to-peer and never stored on our servers)"}),r.jsx("li",{children:"Host-recorded video calls (when the host enables Host Call Recording, the composited grid and mixed audio are recorded locally in the host's browser and uploaded to the host's video library; capped at 20 minutes per recording)"}),r.jsx("li",{children:"Saved slide decks and presentation layouts"}),r.jsx("li",{children:"Edited and exported video artifacts produced by the Video Editor (server-side processing via secure edge functions on your instruction)"}),r.jsx("li",{children:"Calendar and meeting metadata for scheduled and recurring video calls (title, time, recurrence rule, invitee list, generated .ics files)"}),r.jsx("li",{children:"Pre-join lobby device-selection preferences (no audio or video is recorded in the lobby)"})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.4 Usage Data"}),r.jsx("p",{className:"text-muted-foreground",children:"We automatically collect:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Video view counts, reaction counts, and analytics"}),r.jsx("li",{children:"Watch duration, completion rates, and engagement metrics"}),r.jsx("li",{children:"Device information, browser type, and operating system"}),r.jsx("li",{children:"IP address and approximate location"}),r.jsx("li",{children:"Last active timestamps and session data"}),r.jsx("li",{children:"Recording and send usage counts (for plan limits)"}),r.jsx("li",{children:"Push notification subscription data"}),r.jsx("li",{children:"Per-recipient unique-link tracking for bulk email (open, click, and view attribution to individual contacts)"})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.5 Security & Authentication Data"}),r.jsx("p",{className:"text-muted-foreground",children:"To protect your account, we collect:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Failed login attempt counts per email and IP address (for rate limiting)"}),r.jsx("li",{children:"Session activity signals (mouse, keyboard, scroll events for inactivity timeout detection)"}),r.jsx("li",{children:"Email verification status and timestamps"}),r.jsx("li",{children:"Password reset request metadata"}),r.jsx("li",{children:"Have I Been Pwned (HIBP) leaked-password check 
1227signal (only a hashed prefix is transmitted; full passwords never leave our servers)"}),r.jsx("li",{children:'"Remember Me" preference flag stored in local device storage for faster sign-in on trusted devices'})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-4",children:"3.6 Recording Settings & Extension Data"}),r.jsx("p",{className:"text-muted-foreground",children:"We store your preferences including:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Watermark settings (position, opacity, size, custom vs. default)"}),r.jsx("li",{children:"Video quality preferences (720p/1080p)"}),r.jsx("li",{children:"Recording orientation preferences (landscape/portrait)"}),r.jsx("li",{children:"Audio capture preferences (microphone, system audio, tab audio)"}),r.jsx("li",{children:"Notification preferences (email alerts, push notifications, milestones)"}),r.jsx("li",{children:"Chrome extension settings (recording mode, camera position, quality preferences)"}),r.jsx("li",{children:"Presentation layout preferences (side-by-side, slides-only)"}),r.jsx("li",{children:"Mobile app preferences (3-tab navigation state, orientation-aware recording settings, push notification tokens). Screen sharing is not available on mobile or tablet browsers due to platform constraints."})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-8",children:"3.7 Data Collection Summary (App Store Data Safety Disclosure)"}),r.jsx("p",{className:"text-muted-foreground",children:"The following table summarizes the categories of data collected through VIDAREO, whether collection is required, and the purposes for which the data is used. This summary is aligned with mobile app-store data safety and privacy questionnaire requirements."}),r.jsxs("div",{className:"mt-6 space-y-6",children:[r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Email address"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Developer communications · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"User IDs"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Analytics · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Purchase history"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Emails (email content and related message data)"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Developer communications · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Photos and videos"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Analytics · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Audio files"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Account management · Analytics · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"Device or other IDs"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Analytics · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"App activity"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Analytics · Fraud prevention, security, and compliance"})]}),r.jsxs("div",{className:"border-l-2 border-primary/30 pl-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-1",children:[r.jsx("h4",{className:"text-base font-semibold text-foreground",children:"App info and performance (crash logs and diagnostics)"}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Required"})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"App functionality · Analytics · Fraud prevention, security, and compliance"})]})]}),r.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"Additional optional information (such as profile photo, company name, job title, phone number, and signature) may be provided by you to enhance your account, but is not required to use the core service."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"4. Camera, Microphone, and Screen Recording"}),r.jsx("p",{className:"text-muted-foreground",children:"VIDAREO provides features that allow users to create video recordings, audio recordings, screen recordings, and other audiovisual content. When you choose to use these features, VIDAREO may access your device's camera, microphone, screen, photo library, files, or other media with your permission."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO will provide a visual, audible, or other reasonably clear indication when recording functionality is active. VIDAREO is not intended to be used to secretly or unlawfully record another person."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You are responsible for obtaining any consent or authorization required by applicable law before recording, uploading, transmitting, or sharing another person's image, voice, communications, screen activity, personal information, or other content through VIDAREO."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Recordings and uploaded content may be transmitted to and stored on VIDAREO's systems or those of service providers acting on our behalf so that we can host, process, secure, deliver, display, and otherwise provide the Services."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"5. User-Generated Content"}),r.jsx("p",{className:"text-muted-foreground",children:'VIDAREO allows users to create, upload, store, transmit, and share videos, audio, images, text, screen recordings, and other content ("User Content").'}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You retain your ownership rights in User Content that you create or upload. VIDAREO may process User Content as reasonably necessary to operate and provide the Services, including storing, hosting, transmitting, displaying, converting, encoding, delivering, securing, backing up, and processing content at your direction."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You are responsible for ensuring that you have all rights, licenses, permissions, and consents necessary to create, upload, record, transmit, or share User Content through VIDAREO."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO does not sell your private video or audio content."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"6. Video Viewing and Engagement Information"}),r.jsx("p",{className:"text-muted-foreground",children:"When a person views or interacts with content shared through VIDAREO, we may collect information about that interaction. Depending on the features used and the viewer's device or browser, this information may include the date and time content was accessed, viewing activity, viewing duration, completion information, clicks or other interactions, device and browser information, IP address, approximate location derived from an IP address, and other technical or engagement information."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We may use this information to operate and improve the Services, provide video owners with engagement and performance information, maintain security, prevent fraud or misuse, troubleshoot technical issues, and understand how VIDAREO is used."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"A person may interact with VIDAREO content without having a registered VIDAREO account. Where applicable, this Privacy Policy also applies to information VIDAREO collects from those viewers."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"7. Legal Bases for Processing"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"We process your personal data under the following legal bases as applicable under GDPR and similar laws:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Contractual Necessity:"})," Processing necessary to perform our contract with you, including providing the VIDAREO platform, hosting your videos, processing payments, and managing your account."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Consent:"})," Where you have given explicit consent, such as subscribing to marketing communications or enabling optional features like push notifications."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Legitimate Interests:"})," Processing necessary for our legitimate interests, including platform security, fraud prevention, service improvement, analytics, and enforcing our Terms of Use - provided these interests are not overridden by your rights."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Legal Compliance:"})," Processing necessary to comply with legal obligations, such as tax and accounting requirements, responding to legal process, or mandatory record-keeping."]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"8. How We Use Your Information"}),r.jsx("p",{className:"text-muted-foreground",children:"We use collected information to:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Provide and maintain our video recording, sharing, and video calling services"}),r.jsx("li",{children:"Process and store your screen recordings"}),r.jsx("li",{children:"Enable video sharing via secure links with optional password protection"}),r.jsx("li",{children:"Generate video transcriptions using AI technology"}),r.jsx("li",{children:"Generate scripts and provide teleprompter functionality using AI"}),r.jsx("li",{children:"Moderate content using automated AI systems to ensure platform safety"}),r.jsx("li",{children:"Provide analytics on video performance, viewer engagement, and reactions"}),r.jsx("li",{children:"Send notifications about video views, replies, reactions, and account activity via email and push"}),r.jsx("li",{children:"Manage contact lists and facilitate bulk video email outreach"}),r.jsx("li",{children:"Manage team features, invitations, and member roles"}),r.jsx("li",{children:"Process subscription payments and manage billing"}),r.jsx("li",{children:"Enforce plan limits (recordings, sends, duration) and usage tracking"}),r.jsx("li",{children:"Apply custom branding, watermarks, and signatures to your content"}),r.jsx("li",{children:"Protect accounts with bot detection, rate limiting, and session management"}),r.jsx("li",{children:"Send security alerts for failed login attempts and account activity"}),r.jsx("li",{children:"Improve our services and develop new features"}),r.jsx("li",{children:"Communicate with you about updates, security, and support"}),r.jsx("li",{children:"Send automated retention emails at account milestones (e.g., 7 days, 30 days, 90 days, 120 days) to celebrate your journey and share upgrade options"}),r.jsx("li",{children:"Process video editing and export jobs server-side via secure edge functions on your instruction"}),r.jsx("li",{children:"Schedule one-time and recurring meetings, generate calendar invites (.ics), and manage past events"})]})]}),r.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"9. AI Content Moderation"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"All videos uploaded to VIDAREO are automatically processed by our AI moderation system to ensure compliance with our Content Policy. This processing includes:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Automated analysis of video content for prohibited material"}),r.jsx("li",{children:"Confidence scoring for moderation decisions"}),r.jsx("li",{children:"Flagging content for human review when necessary"}),r.jsx("li",{children:"Storing moderation status and any rejection reasons"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Videos that violate our policies may be removed, and repeated violations may result in account restrictions or termination."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"10. Artificial Intelligence Features"}),r.jsx("p",{className:"text-muted-foreground",children:"Certain VIDAREO features use artificial intelligence or machine-learning technologies to provide functionality such as video transcription, AI script generation for the teleprompter, title suggestions, and automated content moderation."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"When you choose to use an AI-enabled feature, information necessary to provide that feature may be processed by VIDAREO or by third-party technology providers acting on our behalf. Depending on the feature, this information may include User Content, recordings, transcripts, prompts, instructions, or related information."}),r.jsx("p",{className:"text-muted-foregroun
1227d mt-4",children:"Where required by applicable law or platform requirements, VIDAREO will provide appropriate notice and obtain required consent before personal information is provided to a third-party artificial intelligence service."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO does not authorize User Content submitted through the Services to be used to train third-party general-purpose artificial intelligence models unless that practice is clearly disclosed and any consent required by applicable law has been obtained."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"11. Data Sharing & Disclosure"}),r.jsx("p",{className:"text-muted-foreground",children:"We may share your information with:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Video Recipients:"})," When you share a video, recipients can view the video, leave reactions, and any information you include"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team Members:"})," If you're part of a team, team owners and admins may have access to shared workspaces and team analytics"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Service Providers:"})," We use third-party services for hosting, analytics, transcription, AI content moderation, AI transcription for editor features (audio is sent solely to produce timestamps and is not used for model training), email delivery (Resend), and payment processing (Stripe)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Push Notification Services:"})," Web push providers to deliver real-time notifications"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Legal Requirements:"})," We may disclose information when required by law or to protect our rights"]})]}),r.jsxs("p",{className:"text-muted-foreground mt-4",children:[r.jsx("strong",{children:"Bulk Email Tracking:"})," When you send bulk video email, each recipient receives a uniquely-tracked link. Open, click, and view activity tied to that link is reported back to you (the sender) as part of your analytics."]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We do not sell your personal information to third parties. We do not share your personal information for cross-context behavioral advertising purposes."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"12. Business Customers and Information Processed on Their Behalf"}),r.jsx("p",{className:"text-muted-foreground",children:"VIDAREO may process certain personal information and User Content on behalf of businesses, organizations, professionals, and other customers that use the Services to communicate with their clients, customers, prospects, employees, or other recipients."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"When VIDAREO processes information on behalf of a business customer, that customer may determine why and how certain information is collected and used. In those circumstances, VIDAREO processes the information to provide the Services requested by the customer and in accordance with our agreements with that customer."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"If you receive VIDAREO content from one of our business customers and have questions about information collected or used by that customer, you may need to contact the business customer directly regarding its privacy practices."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO may separately process certain information for its own legitimate business purposes, including operating and securing the Services, administering accounts, processing payments, preventing fraud and abuse, complying with legal obligations, and improving the Services, as permitted by applicable law."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"13. Administrative Access"}),r.jsx("p",{className:"text-muted-foreground",children:"VIDAREO administrators may access user accounts for support and moderation purposes. This includes:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"View-only access to user profiles, settings, and videos for troubleshooting"}),r.jsx("li",{children:"Content moderation review and enforcement"}),r.jsx("li",{children:"All administrative access is logged for security and accountability"}),r.jsx("li",{children:"Administrators cannot modify user data during support sessions"}),r.jsx("li",{children:"Outbound platform-wide communications (announcements and policy updates) sent by administrators are logged in an internal audit log capturing the sender, subject, message content, recipient counts, and delivery results for accountability and compliance purposes"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"14. Data Storage & Security"}),r.jsx("p",{className:"text-muted-foreground",children:"Your data is stored securely using industry-standard encryption and security practices:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Encryption in transit:"})," All data is transmitted over TLS 1.2+ (HTTPS) between your device, our servers, and recipients"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Encryption at rest:"})," Videos, database records, and backups are encrypted at rest using AES-256"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"SOC 2 Type II compliant infrastru
1227cture:"})," Our backend runs on cloud infrastructure (Lovable Cloud, powered by Supabase) hosted in SOC 2 Type II and ISO 27001 certified data centers"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Account password hashing:"})," Account passwords are salted and hashed; we never store them in plain text"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Password complexity enforced:"})," 8+ characters with uppercase, lowercase, numbers, and special characters"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Leaked-password screening:"})," New and changed passwords are checked against the Have I Been Pwned (HIBP) breach database to block known-compromised credentials"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Share-link password hashing:"})," Passwords on protected share links are hashed server-side using PBKDF2 with a per-link salt"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Share-link tokens:"})," Share links use unique, unguessable tokens with optional expiration, view limits, and password protection"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Brute-force protection:"})," Rate limiting blocks access for 15 minutes after 5 failed login attempts and triggers a security alert email"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Session security:"})," Automatic session timeout after 35 minutes of inactivity with a 30-minute warning prompt"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Email verification:"})," Mandatory email verification before account access"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Row-level security (RLS):"})," Database-enforced policies ensure users can only access their own data"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Admin access controls:"})," Admin operations are validated server-side with comprehensive audit logging"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Vulnerability scanning:"})," Automated dependency and code security scanning runs on every deployment"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Ongoing monitoring:"})," Regular security audits, monitoring, and incident response procedures"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Team plan admin controls:"})," Additional access management and audit tools are available for Team plans"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO uses reasonable administrative, technical, and organizational safeguards designed to protect personal information and User Content against unauthorized access, use, alteration, disclosure, destruction, or loss. These safeguards may include encryption in transit, access controls, authentication measures, monitoring, secure hosting practices, and other security measures appropriate to the nature and sensitivity of the information being processed."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"However, no method of electronic transmission, processing, or storage is completely secure, and we cannot guarantee the absolute security of personal information or User Content."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"15. Your Rights"}),r.jsx("p",{className:"text-muted-foreground",children:"You have the right to:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Access your personal data and download your videos"}),r.jsx("li",{children:"Update or correct your account information"}),r.jsx("li",{children:"Delete your videos, folders, and account"}),r.jsx("li",{children:"Opt out of marketing communications"}),r.jsx("li",{children:"Configure notification preferences (email, push, milestones)"}),r.jsx("li",{children:"Request a copy of your data"}),r.jsx("li",{children:"Object to certain data processing activities"}),r.jsx("li",{children:"Manage or revoke share links at any time"}),r.jsx("li",{children:"Delete your contacts and contact lists"})]}),r.jsx("h3",{className:"text-xl font-medium text-foreground mt-6",children:"Your Privacy Choices and Device Permissions"}),r.jsx("p",{className:"text-muted-foreground",children:"Depending on your device and the features you use, you may control VIDAREO's access to your camera, microphone, photos, files, screen, notifications, and other device features through your device or operating system settings."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"You may withdraw previously granted permissions through your device settings. Withdrawing permission will not affect processing that occurred before permission was withdrawn, but it may prevent certain VIDAREO features from functioning properly."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:'Where provided by applicable law, you may also have the right to request access to, correction of, or deleti
1227on of personal information associated with you. Requests may be submitted through available account and privacy controls or by contacting VIDAREO using the information provided in the "Contact Us" section below.'})]}),r.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"16. European Privacy Rights (GDPR)"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"If you are located in the European Economic Area (EEA), United Kingdom, or Switzerland, you have the following additional rights under the General Data Protection Regulation (GDPR):"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Right of Access:"})," You may request a copy of the personal data we hold about you."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Rectification:"})," You may request that we correct inaccurate or incomplete personal data."]}),r.jsxs("li",{children:[r.jsx("strong",{children:'Right to Erasure ("Right to be Forgotten"):'})," You may request deletion of your personal data, subject to legal retention obligations."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Restriction of Processing:"})," You may request that we limit how we use your data in certain circumstances."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Data Portability:"})," You may request your data in a structured, commonly used, machine-readable format and have it transferred to another controller."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Object:"})," You may object to processing based on legitimate interests, including profiling and direct marketing."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Withdraw Consent:"})," Where processing is based on consent, you may withdraw that consent at any time without affecting the lawfulness of prior processing."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Lodge a Complaint:"})," You have the right to lodge a complaint with your local data protection supervisory authority."]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"To exercise these rights, contact us at [email protected]. We will respond within 30 days (or as required by applicable law). We may ask for verification of your identity before processing your request."})]}),r.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"17. California Privacy Notice (CCPA/CPRA)"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"This section applies to California residents and supplements the rest of this Privacy Policy pursuant to the California Consumer Privacy Act (CCPA) as amended by the California Privacy Rights Act (CPRA)."}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Categories of Personal Information Collected"}),r.jsx("p",{className:"text-muted-foreground mb-2",children:"In the preceding 12 months, we have collected the following categories of personal information:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-1 text-sm",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Identifiers:"})," Name, email address, IP address, account ID"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Commercial Information:"})," Subscription plan, payment history, transaction records"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Internet/Network Activity:"})," Browsing history on our platform, video viewing data, interaction with features"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Professional Information:"})," Job title, company name"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Audio/Visual Data:"})," Video recordings, screen captures, profile photos"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Geolocation Data:"})," Approximate location derived from IP address"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Inferences:"})," Usage patterns and preferences derived from the above"]})]}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"Your California Privacy Rights"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Know:"})," You may request that we disclose the categories and specific pieces of personal information we have collected, the categories of sources, the business purpose for collecting it, and the categories of third parties with whom we share it."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Delete:"}
1227)," You may request deletion of your personal information, subject to certain exceptions."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Correct:"})," You may request correction of inaccurate personal information."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Opt Out of Sale/Sharing:"})," We do not sell your personal information. We do not share your personal information for cross-context behavioral advertising."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Limit Use of Sensitive Personal Information:"})," We only use sensitive personal information for purposes permitted under the CCPA."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Right to Non-Discrimination:"})," We will not discriminate against you for exercising any of your CCPA rights."]})]}),r.jsx("h3",{className:"text-lg font-medium text-foreground mt-4 mb-2",children:"How to Submit a Request"}),r.jsx("p",{className:"text-muted-foreground",children:'To exercise your rights, email us at [email protected] with the subject line "California Privacy Request." We will verify your identity using your account email. You may also designate an authorized agent to submit a request on your behalf; the agent must provide written proof of authorization and we may still verify your identity directly.'})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"18. Data Retention"}),r.jsx("p",{className:"text-muted-foreground",children:"We retain personal information for as long as reasonably necessary to provide the Services, maintain your account, comply with legal obligations, resolve disputes, enforce our agreements, protect the security and integrity of VIDAREO, and fulfill the purposes described in this Privacy Policy."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"User Content, including videos and recordings, may generally be retained while your account remains active or until you delete the content, subject to applicable account settings, backup procedures, legal requirements, and legitimate security or operational needs."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"When personal information or User Content is deleted, copies may remain temporarily in backups, logs, or disaster-recovery systems until those systems are overwritten or the applicable retention period expires."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We may retain certain information after account deletion when required or permitted by applicable law, including information reasonably necessary for fraud prevention, security, accounting, tax compliance, legal compliance, dispute resolution, or enforcement of our agreements."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Specific retention practices include:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Videos are retained until you delete them or your account"}),r.jsx("li",{children:"Video replies are retained until deleted by the video owner or cleaned up automatically"}),r.jsx("li",{children:"Account information is retained while your account is active"}),r.jsx("li",{children:"Usage data (recording/send counts) resets monthly per billing cycle"}),r.jsx("li",{children:"Rate limit records are automatically purged after the 15-minute window expires"}),r.jsx("li",{children:"Analytics data may be retained in anonymized form for service improvement"}),r.jsx("li",{children:"Moderation records are retained for compliance and safety purposes"}),r.jsx("li",{children:"Upon account deletion, your data is removed within 30 days"}),r.jsx("li",{children:"Expired share links and associated view data may be cleaned up periodically"}),r.jsx("li",{children:"Edited and exported video artifacts from the Video Editor follow the same retention as their source videos"}),r.jsx("li",{children:"Scheduled and recurring meetings are retained until deleted by the owner; past-event records are retained for the owner's reference"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"19. Account and Data Deletion"}),r.jsxs("p",{className:"text-muted-foreground",children:["You may request deleti
1227on of your VIDAREO account and personal information through the account settings available within the VIDAREO application, through our"," ",r.jsx("a",{href:"/delete-account",className:"text-primary hover:underline",children:"account deletion page"}),", or through another account-deletion method made available by VIDAREO."]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Deleting your account will initiate deletion of the account and personal information associated with it, including User Content associated with the account, except for information that we are required or permitted to retain for legitimate legal, security, fraud-prevention, accounting, dispute-resolution, regulatory, or other lawful purposes."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Before completing an account deletion request, we may take reasonable steps to verify your identity and confirm that the request is authorized."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"Deletion from active systems may not immediately remove information from encrypted backups or disaster-recovery systems. Information remaining in those systems will be deleted or overwritten in accordance with our normal backup-retention procedures and will not be restored for ordinary business purposes."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"If you have an active paid subscription, deleting your VIDAREO account may not automatically cancel a subscription managed by Apple, Google, or another third-party payment provider. You are responsible for separately canceling any applicable subscription through the provider through which you purchased it."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"20. Cookies & Tracking"}),r.jsx("p",{className:"text-muted-foreground",children:"We use cookies and similar technologies for:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Strictly Necessary Cookies:"})," Authentication, session management, and security features (cannot be disabled)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Functional Cookies:"})," Remembering your preferences and settings"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Analytics Cookies:"})," Performance monitoring and usage analytics"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Security Cookies:"})," Fraud prevention and session security"]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"21. Do Not Track Signals"}),r.jsx("p",{className:"text-muted-foreground",children:'Some browsers transmit "Do Not Track" (DNT) or Global Privacy Control (GPC) signals. At this time, VIDAREO does not respond to DNT signals because there is no industry-wide standard for compliance. However, we honor GPC signals as opt-out-of-sale/sharing requests where required by applicable law (e.g., California). Regardless of these signals, we do not sell your personal information or share it for cross-context behavioral advertising.'})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"22. Aggregate & De-Identified Data"}),r.jsx("p",{className:"text-muted-foreground",children:"We may create aggregate or de-identified data from your personal information by removing information that makes the data personally identifiable. We may use this aggregate or de-identified data for analytics, research, service improvement, and other lawful business purposes. We commit to maintaining and using such data in de-identified form and will not attempt to re-identify it."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"23. Age Requirement and Minors"}),r.jsx("p",{className:"text-muted-foreground",children:"VIDAREO is intended for use only by individuals who are 18 years of age or older. Individuals under the age of 18 are not permitted to create a VIDAREO account or independently use the Services."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"VIDAREO does not knowingly collect personal information directly from individuals under the age of 18 for purposes of establishing or maintaining a VIDAREO account. If we become aware that an individual under the age of 18 has created an account or provided personal information to VIDAREO in violation of this policy, we may suspend or terminate the account and take reasonable steps to delete the associated personal information."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:'If you believe that an individual under the age of 18 has created a VIDAREO account or provided personal information through the Services in violation of this policy, please contact us using the information provided in the "Contact Us" section.'}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"User Content may depict or include individuals under the age of 18 where lawful and appropriate. Users are responsible for ensuring that they have obtained any parental, guardian, or other consent or authorization required by applicable law before creating, uploading, recording, transmitting, or sharing content involving a minor."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"24. International Data Transfers"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO is operated from the United States. Your information may be transferred to and processed in the United States and other countries where our service providers operate, which may have different data protection laws than your country of residence."}),r.jsx("p",{className:"text-muted-foreground",children:"Where required by law (e.g., for transfers from the EEA/UK), we implement appropriate safeguards, including encryption in transit and at rest, access controls, and contractual protections with our service providers. By using VIDAREO, you acknowledge and consent to the transfer and processing of your data as described 
1227in this section."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"25. Sub-Processors"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"To provide our service we rely on a small number of trusted third-party sub-processors. Each is bound by a Data Processing Agreement (DPA) or equivalent contractual safeguards and processes your data only on our instructions and in accordance with this Privacy Policy."}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Lovable Cloud (powered by Supabase):"})," Database, authentication, file storage, and serverless functions. SOC 2 Type II and ISO 27001 certified. Hosted in secure US/EU data centers."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Stripe, Inc.:"})," Payment processing and subscription billing. PCI-DSS Level 1 certified. We do not store full payment card numbers."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Resend:"})," Transactional and marketing email delivery (account, notifications, milestones, bulk email)."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Cloudflare, Inc.:"})," CDN, DNS, DDoS protection, and the share-link metadata proxy used for branded link previews."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"OpenAI and Google (via Lovable AI Gateway):"})," AI features including teleprompter script generation, automated video moderation, and title suggestions. Inputs are processed transiently and are not used by the providers to train their models."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Have I Been Pwned (HIBP):"})," Breach-database password screening using k-anonymity (only a hashed password prefix is sent); full passwords never leave our servers."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Apple App Store and Google Play:"})," Distribution and in-app purchase processing for our native mobile applications. In-app purchases made through these stores are billed and managed by Apple or Google under their respective terms; refund and cancellation requests for those purchases are handled directly through the applicable app store."]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"More broadly, we may use third-party service providers to help us operate and provide VIDAREO, including providers of cloud hosting, data storage, content delivery, video processing, analytics, authentication, communications, payment processing, customer support, security, error monitoring, and other technology services. These service providers may process personal information and User Content as reasonably necessary to provide services to VIDAREO or as otherwise permitted by applicable law and their agreements with us."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We require service providers that process personal information on our behalf to maintain appropriate privacy and security protections and to process such information only for authorized purposes. We do not authorize service providers to use VIDAREO User Content or personal information for their own independent marketing purposes unless that use has been disclosed and any consent required by applicable law has been obtained."}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We review our sub-processors periodically and will update this section when material changes occur. To request our current Data Processing Agreement, contact [email protected]."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"26. Third-Party Links and Embedded Content"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Our platform may contain links to third-party websites or services that are not operated by us. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. We encourage you to review the privacy policy of every site you visit. This Privacy Policy applies only to VIDAREO."}),r.jsxs("p",{className:"text-muted-foreground",children:[r.jsx("strong",{children:"Embedded YouTube Videos:"})," When you or a recipient view a YouTube video embedded through VIDAREO, the YouTube player is loaded directly from YouTube and may set cookies or collect data (such as IP address, device information, and viewing activity) according to Google's policies. This data collection is governed by the"," ",r.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Google Privacy Policy"})," ","and the"," ",r.jsx("a",{href:"https://www.youtube.com/t/terms",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"YouTube Terms of Service"}),", not by this Privacy Policy. VIDAREO does not download or re-host YouTube video files."]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"27. Changes to This Policy"}),r.jsx("p",{className:"text-muted-foreground",children:"We may update this Privacy Policy from time to time. We will notify you of significant changes via email or platform notification. Your continued use of VIDAREO after changes constitutes acceptance of the updated policy. We encourage you to review this page periodically."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"28. Contact Us"}),r.jsxs("p",{className:"text-muted-foreground",children:["VIDAREO is operated by ",r.jsx("strong",{children:"Summit 23 LLC dba VIDAREO"}),"."]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"If you have questions about this Privacy Policy, VIDAREO's privacy practices, or would like to submit a privacy, access, correction, or deleti
1227on request, please contact us at:"}),r.jsxs("ul",{className:"list-none pl-0 text-muted-foreground space-y-1 mt-4",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Privacy Email:"})," [email protected]"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Website:"})," VIDAREO.com"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Entity:"})," Summit 23 LLC dba VIDAREO"]})]})]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx(P,{onClick:()=>e("/"),variant:"outline",children:"Return to Home"})})]}),r.jsx(Ka,{})]})};var Iw=e=>e.type==="checkbox",Qh=e=>e instanceof Date,Ri=e=>e==null;const Bae=e=>typeof e=="object";var oa=e=>!Ri(e)&&!Array.isArray(e)&&Bae(e)&&!Qh(e),vtt=e=>oa(e)&&e.target?Iw(e.target)?e.target.checked:e.target.value:e,ytt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,btt=(e,t)=>e.has(ytt(t)),wtt=e=>{const t=e.constructor&&e.constructor.prototype;return oa(t)&&t.hasOwnProperty("isPrototypeOf")},n3=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Va(e){let t;const n=Array.isArray(e),s=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(n3&&(e instanceof Blob||s))&&(n||oa(e)))if(t=n?[]:{},!n&&!wtt(e))t=e;else for(const a in e)e.hasOwnProperty(a)&&(t[a]=Va(e[a]));else return e;return t}var vC=e=>/^\w*$/.test(e),pa=e=>e===void 0,s3=e=>Array.isArray(e)?e.filter(Boolean):[],a3=e=>s3(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Bt=(e,t,n)=>{if(!t||!oa(e))return n;const s=(vC(t)?[t]:a3(t)).reduce((a,i)=>Ri(a)?a:a[i],e);return pa(s)||s===e?pa(e[t])?n:e[t]:s},lc=e=>typeof e=="boolean",Wn=(e,t,n)=>{let s=-1;const a=vC(t)?[t]:a3(t),i=a.length,o=i-1;for(;++s<i;){const l=a[s];let c=n;if(s!==o){const d=e[l];c=oa(d)||Array.isArray(d)?d:isNaN(+a[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const kz={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Vl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ud={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},jtt=Y.createContext(null);jtt.displayName="HookFormContext";var Ntt=(e,t,n,s=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==Vl.all&&(t._proxyFormState[o]=!s||Vl.all),e[o]}});return a};const Stt=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;var Sc=e=>typeof e=="string",_tt=(e,t,n,s,a)=>Sc(e)?(s&&t.watch.add(e),Bt(n,e,a)):Array.isArray(e)?e.map(i=>(s&&t.watch.add(i),Bt(n,i))):(s&&(t.watchAll=!0),n),EP=e=>Ri(e)||!Bae(e);function Gu(e,t,n=new WeakSet){if(EP(e)||EP(t))return e===t;if(Qh(e)&&Qh(t))return e.getTime()===t.getTime();const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of s){const o=e[i];if(!a.includes(i))return!1;if(i!=="ref"){const l=t[i];if(Qh(o)&&Qh(l)||oa(o)&&oa(l)||Array.isArray(o)&&Array.isArray(l)?!Gu(o,l,n):o!==l)return!1}}return!0}var zae=(e,t,n,s,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[s]:a||!0}}:{},pb=e=>Array.isArray(e)?e:[e],Ez=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}},Gi=e=>oa(e)&&!Object.keys(e).length,i3=e=>e.type==="file",Ul=e=>typeof e=="function",t_=e=>{if(!n3)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qae=e=>e.type==="select-multiple",o3=e=>e.type==="radio",Ctt=e=>o3(e)||Iw(e),ZE=e=>t_(e)&&e.isConnected;function ktt(e,t){const n=t.slice(0,-1).length;let s=0;for(;s<n;)e=pa(e)?s++:e[t[s++]];return e}function Ett(e){for(const t in e)if(e.hasOwnProperty(t)&&!pa(e[t]))return!1;return!0}function ca(e,t){const n=Array.isArray(t)?t:vC(t)?[t]:a3(t),s=n.length===1?e:ktt(e,n),a=n.length-1,i=n[a];return s&&delete s[i],a!==0&&(oa(s)&&Gi(s)||Array.isArray(s)&&Ett(s))&&ca(e,n.slice(0,-1)),e}var Hae=e=>{for(const t in e)if(Ul(e[t]))return!0;return!1};function r_(e,t={}){const n=Array.isArray(e);if(oa(e)||n)for(const s in e)Array.isArray(e[s])||oa(e[s])&&!Hae(e[s])?(t[s]=Array.isArray(e[s])?[]:{}
vendor: 6,053 bytes, line 1227
1227,r_(e[s],t[s])):Ri(e[s])||(t[s]=!0);return t}function Wae(e,t,n){const s=Array.isArray(e);if(oa(e)||s)for(const a in e)Array.isArray(e[a])||oa(e[a])&&!Hae(e[a])?pa(t)||EP(n[a])?n[a]=Array.isArray(e[a])?r_(e[a],[]):{...r_(e[a])}:Wae(e[a],Ri(t)?{}:t[a],n[a]):n[a]=!Gu(e[a],t[a]);return n}var wy=(e,t)=>Wae(e,t,r_(t));const Az={value:!1,isValid:!1},Tz={value:!0,isValid:!0};var Yae=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!pa(e[0].attributes.value)?pa(e[0].value)||e[0].value===""?Tz:{value:e[0].value,isValid:!0}:Tz:Az}return Az},Gae=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:s})=>pa(e)?e:t?e===""?NaN:e&&+e:n&&Sc(e)?new Date(e):s?s(e):e;const Rz={isValid:!1,value:null};var Kae=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Rz):Rz;function Oz(e){const t=e.ref;return i3(t)?t.files:o3(t)?Kae(e.refs).value:qae(t)?[...t.selectedOptions].map(({value:n})=>n):Iw(t)?Yae(e.refs).value:Gae(pa(t.value)?e.ref.value:t.value,e)}var Att=(e,t,n,s)=>{const a={};for(const i of e){const o=Bt(t,i);o&&Wn(a,i,o._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:s}},n_=e=>e instanceof RegExp,jy=e=>pa(e)?e:n_(e)?e.source:oa(e)?n_(e.value)?e.value.source:e.value:e,Pz=e=>({isOnSubmit:!e||e===Vl.onSubmit,isOnBlur:e===Vl.onBlur,isOnChange:e===Vl.onChange,isOnAll:e===Vl.all,isOnTouch:e===Vl.onTouched});const Dz="AsyncFunction";var Ttt=e=>!!e&&!!e.validate&&!!(Ul(e.validate)&&e.validate.constructor.name===Dz||oa(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Dz)),Rtt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Mz=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(s=>e.startsWith(s)&&/^\.\w+/.test(e.slice(s.length))));const xb=(e,t,n,s)=>{for(const a of n||Object.keys(e)){const i=Bt(e,a);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!s)return!0;if(o.ref&&t(o.ref,o.name)&&!s)return!0;if(xb(l,t))break}else if(oa(l)&&xb(l,t))break}}};function Iz(e,t,n){const s=Bt(e,n);if(s||vC(n))return{error:s,name:n};const a=n.split(".");for(;a.length;){const i=a.join("."),o=Bt(t,i),l=Bt(e,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};a.pop()}return{name:n}}var Ott=(e,t,n,s)=>{n(e);const{name:a,...i}=e;return Gi(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!s||Vl.all))},Ptt=(e,t,n)=>!e||!t||e===t||pb(e).some(s=>s&&(n?s===t:s.startsWith(t)||t.startsWith(s))),Dtt=(e,t,n,s,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||e):(n?s.isOnBlur:a.isOnBlur)?!e:(n?s.isOnChange:a.isOnChange)?e:!0,Mtt=(e,t)=>!s3(Bt(e,t)).length&&ca(e,t),Itt=(e,t,n)=>{const s=pb(Bt(e,n));return Wn(s,"root",t[n]),Wn(e,n,s),e},O1=e=>Sc(e);function Lz(e,t,n="validate"){if(O1(e)||Array.isArray(e)&&e.every(O1)||lc(e)&&!e)return{type:n,message:O1(e)?e:"",ref:t}}var Dp=e=>oa(e)&&!n_(e)?e:{value:e,message:""},$z=async(e,t,n,s,a,i)=>{const{ref:o,refs:l,required:c,maxLength:d,minLength:u,min:m,max:f,pattern:p,validate:x,name:g,valueAsNumber:v,mount:y}=e._f,b=Bt(n,g);if(!y||t.has(g))return{};const w=l?l[0]:o,S=T=>{a&&w.reportValidity&&(w.setCustomValidity(lc(T)?"":T||""),w.reportValidity())},j={},N=o3(o),_=Iw(o),C=N||_,k=(v||i3(o))&&pa(o.value)&&pa(b)||t_(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,E=zae.bind(null,g,s,j),R=(T,D,A,V=ud.maxLength,U=ud.minLength)=>{const O=T?D:A;j[g]={type:T?V:U,message:O,ref:o,...E(T?V:U,O)}};if(i?!Array.isArray(b)||!b.length:c&&(!C&&(k||Ri(b))||lc(b)&&!b||_&&!Yae(l).isValid||N&&!Kae(l).isValid)){const{value:T,message:D}=O1(c)?{value:!!c,message:c}:Dp(c);if(T&&(j[g]={type:ud.required,message:D,ref:w,...E(ud.required,D)},!s))return S(D),j}if(!k&&(!Ri(m)||!Ri(f))){let T,D;const A=Dp(f),V=Dp(m);if(!Ri(b)&&!isNaN(b)){const U=o.valueAsNumber||b&&+b;Ri(A.value)||(T=U>A.value),Ri(V.value)||(D=U<V.value)}else{const U=o.valueAsDate||new Date(b),O=I=>new Date(new Date().toDateString()+" "+I),M=o.type=="time",$=o.type=="week";Sc(A.value)&&b&&(T=M?O(b)>O(A.value):$?b>A.value:U>new Date(A.value)),Sc(V.value)&&b&&(D=M?O(b)<O(V.value):$?b<V.value:U<new Date(V.value))}if((T||D)&&(R(!!T,A.message,V.message,ud.max,ud.min),!s))return S(j[g].message),j}if((d||u)&&!k&&(Sc(b)||i&&Array.isArray(b))){const T=Dp(d),D=Dp(u),A=!Ri(T.value)&&b.length>+T.value,V=!Ri(D.value)&&b.length<+D.value;if((A||V)&&(R(A,T.message,D.message),!s))return S(j[g].message),j}if(p&&!k&&Sc(b)){const{value:T,message:D}=Dp(p);if(n_(T)&&!b.match(T)&&(j[g]={type:ud.pattern,message:D,ref:o,...E(ud.pattern,D)},!s))return S(D),j}if(x){if(Ul(x)){const T=await x(b,n),D=Lz(T,w);if(D&&(j[g]={...D,...E(ud.validate,D.message)},!s))return S(D.message),j}else if(oa(x)){let T={};for(const D in x){if(!Gi(T)&&!s)break;const A=Lz(await x[D](b,n),w,D);A&&(T={...A,...E(D,A.message)},S(A.message),s&&(j[g]=T))}if(!Gi(T)&&(j[g]={ref:w,...T},!s))return j}}return S(!0),j};const Ltt={mode:Vl.onSubmit,reValidateMode:Vl.onChange,shouldFocusError:!0};function $tt(e={}){let t={...Ltt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ul(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},s={},a=oa(t.defaultValues)||oa(t.values)?Va(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Va(a),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let m={...u};const f={array:Ez(),state:Ez()},p=t.criteriaMode===Vl.all,x=J=>de=>{clearTimeout(d),d=setTimeout(J,de)},g=async J=>{if(!t.disabled&&(u.isValid||m.isValid||J)){const de=t.resolver?Gi((await _()).errors):await k(s,!0);de!==n.isValid&&f.state.next({isValid:de})}},v=(J,de)=>
vendor: 5,086 bytes, line 1227
1227{!t.disabled&&(u.isValidating||u.validatingFields||m.isValidating||m.validatingFields)&&((J||Array.from(l.mount)).forEach(ve=>{ve&&(de?Wn(n.validatingFields,ve,de):ca(n.validatingFields,ve))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Gi(n.validatingFields)}))},y=(J,de=[],ve,Le,$e=!0,De=!0)=>{if(Le&&ve&&!t.disabled){if(o.action=!0,De&&Array.isArray(Bt(s,J))){const oe=ve(Bt(s,J),Le.argA,Le.argB);$e&&Wn(s,J,oe)}if(De&&Array.isArray(Bt(n.errors,J))){const oe=ve(Bt(n.errors,J),Le.argA,Le.argB);$e&&Wn(n.errors,J,oe),Mtt(n.errors,J)}if((u.touchedFields||m.touchedFields)&&De&&Array.isArray(Bt(n.touchedFields,J))){const oe=ve(Bt(n.touchedFields,J),Le.argA,Le.argB);$e&&Wn(n.touchedFields,J,oe)}(u.dirtyFields||m.dirtyFields)&&(n.dirtyFields=wy(a,i)),f.state.next({name:J,isDirty:R(J,de),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Wn(i,J,de)},b=(J,de)=>{Wn(n.errors,J,de),f.state.next({errors:n.errors})},w=J=>{n.errors=J,f.state.next({errors:n.errors,isValid:!1})},S=(J,de,ve,Le)=>{const $e=Bt(s,J);if($e){const De=Bt(i,J,pa(ve)?Bt(a,J):ve);pa(De)||Le&&Le.defaultChecked||de?Wn(i,J,de?De:Oz($e._f)):A(J,De),o.mount&&g()}},j=(J,de,ve,Le,$e)=>{let De=!1,oe=!1;const xe={name:J};if(!t.disabled){if(!ve||Le){(u.isDirty||m.isDirty)&&(oe=n.isDirty,n.isDirty=xe.isDirty=R(),De=oe!==xe.isDirty);const Ze=Gu(Bt(a,J),de);oe=!!Bt(n.dirtyFields,J),Ze?ca(n.dirtyFields,J):Wn(n.dirtyFields,J,!0),xe.dirtyFields=n.dirtyFields,De=De||(u.dirtyFields||m.dirtyFields)&&oe!==!Ze}if(ve){const Ze=Bt(n.touchedFields,J);Ze||(Wn(n.touchedFields,J,ve),xe.touchedFields=n.touchedFields,De=De||(u.touchedFields||m.touchedFields)&&Ze!==ve)}De&&$e&&f.state.next(xe)}return De?xe:{}},N=(J,de,ve,Le)=>{const $e=Bt(n.errors,J),De=(u.isValid||m.isValid)&&lc(de)&&n.isValid!==de;if(t.delayError&&ve?(c=x(()=>b(J,ve)),c(t.delayError)):(clearTimeout(d),c=null,ve?Wn(n.errors,J,ve):ca(n.errors,J)),(ve?!Gu($e,ve):$e)||!Gi(Le)||De){const oe={...Le,...De&&lc(de)?{isValid:de}:{},errors:n.errors,name:J};n={...n,...oe},f.state.next(oe)}},_=async J=>{v(J,!0);const de=await t.resolver(i,t.context,Att(J||l.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return v(J),de},C=async J=>{const{errors:de}=await _(J);if(J)for(const ve of J){const Le=Bt(de,ve);Le?Wn(n.errors,ve,Le):ca(n.errors,ve)}else n.errors=de;return de},k=async(J,de,ve={valid:!0})=>{for(const Le in J){const $e=J[Le];if($e){const{_f:De,...oe}=$e;if(De){const xe=l.array.has(De.name),Ze=$e._f&&Ttt($e._f);Ze&&u.validatingFields&&v([Le],!0);const it=await $z($e,l.disabled,i,p,t.shouldUseNativeValidation&&!de,xe);if(Ze&&u.validatingFields&&v([Le]),it[De.name]&&(ve.valid=!1,de))break;!de&&(Bt(it,De.name)?xe?Itt(n.errors,it,De.name):Wn(n.errors,De.name,it[De.name]):ca(n.errors,De.name))}!Gi(oe)&&await k(oe,de,ve)}}return ve.valid},E=()=>{for(const J of l.unMount){const de=Bt(s,J);de&&(de._f.refs?de._f.refs.every(ve=>!ZE(ve)):!ZE(de._f.ref))&&G(J)}l.unMount=new Set},R=(J,de)=>!t.disabled&&(J&&de&&Wn(i,J,de),!Gu(I(),a)),T=(J,de,ve)=>_tt(J,l,{...o.mount?i:pa(de)?a:Sc(J)?{[J]:de}:de},ve,de),D=J=>s3(Bt(o.mount?i:a,J,t.shouldUnregister?Bt(a,J,[]):[])),A=(J,de,ve={})=>{const Le=Bt(s,J);let $e=de;if(Le){const De=Le._f;De&&(!De.disabled&&Wn(i,J,Gae(de,De)),$e=t_(De.ref)&&Ri(de)?"":de,qae(De.ref)?[...De.ref.options].forEach(oe=>oe.selected=$e.includes(oe.value)):De.refs?Iw(De.ref)?De.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray($e)?oe.checked=!!$e.find(xe=>xe===oe.value):oe.checked=$e===oe.value||!!$e)}):De.refs.forEach(oe=>oe.checked=oe.value===$e):i3(De.ref)?De.ref.value="":(De.ref.value=$e,De.ref.type||f.state.next({name:J,values:Va(i)})))}(ve.shouldDirty||ve.shouldTouch)&&j(J,$e,ve.shouldTouch,ve.shouldDirty,!0),ve.shouldValidate&&$(J)},V=(J,de,ve)=>{for(const Le in de){if(!de.hasOwnProperty(Le))return;const $e=de[Le],De=J+"."+Le,oe=Bt(s,De);(l.array.has(J)||oa($e)||oe&&!oe._f)&&!Qh($e)?V(De,$e,ve):A(De,$e,ve)}},U=(J,de,ve={})=>{const Le=Bt(s,J),$e=l.array.has(J),De=Va(de);Wn(i,J,De),$e?(f.array.next({name:J,values:Va(i)}),(u.isDirty||u.dirtyFields||m.isDirty||m.dirtyFields)&&ve.shouldDirty&&f.state.next({name:J,dirtyFields:wy(a,i),isDirty:R(J,De)})):Le&&!Le._f&&!Ri(De)?V(J,De,ve):A(J,De,ve),Mz(J,l)&&f.state.next({...n,name:J}),f.state.next({name:o.mount?J:void 0,values:Va(i)})},O=async J=>{o.mount=!0;const de=J.target;let ve=de.name,Le=!0;const $e=Bt(s,ve),De=Ze=>{Le=Number.isNaN(Ze)||Qh(Ze)&&isNaN(Ze.getTime())||Gu(Ze,Bt(i,ve,Ze))},oe=Pz(t.mode),xe=Pz(t.reValidateMode);if($e){let Ze,it;const ct=de.type?Oz($e._f):vtt(J),Oe=J.type===kz.BLUR||J.type===kz.FOCUS_OUT,pe=!Rtt($e._f)&&!t.resolver&&!Bt(n.errors,ve)&&!$e._f.deps||Dtt(Oe,Bt(n.touchedFields,ve),n.isSubmitted,xe,oe),le=Mz(ve,l,Oe);Wn(i,ve,ct),Oe?($e._f.onBlur&&$e._f.onBlur(J),c&&c(0)):$e._f.onChange&&$e._f.onChange(J);const ke=j(ve,ct,Oe),Ee=!Gi(ke)||le;if(!Oe&&f.state.next({name:ve,type:J.type,values:Va(i)}),pe)return(u.isValid||m.isValid)&&(t.mode==="onBlur"?Oe&&g():Oe||g()),Ee&&f.state.next({name:ve,...le?{}:ke});if(!Oe&&le&&f.state.next({...n}),t.resolver){const{errors:ot}=await _([ve]);
vendor: 6,640 bytes, line 1227
1227if(De(ct),Le){const gt=Iz(n.errors,s,ve),Nt=Iz(ot,s,gt.name||ve);Ze=Nt.error,ve=Nt.name,it=Gi(ot)}}else v([ve],!0),Ze=(await $z($e,l.disabled,i,p,t.shouldUseNativeValidation))[ve],v([ve]),De(ct),Le&&(Ze?it=!1:(u.isValid||m.isValid)&&(it=await k(s,!0)));Le&&($e._f.deps&&$($e._f.deps),N(ve,it,Ze,ke))}},M=(J,de)=>{if(Bt(n.errors,de)&&J.focus)return J.focus(),1},$=async(J,de={})=>{let ve,Le;const $e=pb(J);if(t.resolver){const De=await C(pa(J)?J:$e);ve=Gi(De),Le=J?!$e.some(oe=>Bt(De,oe)):ve}else J?(Le=(await Promise.all($e.map(async De=>{const oe=Bt(s,De);return await k(oe&&oe._f?{[De]:oe}:oe)}))).every(Boolean),!(!Le&&!n.isValid)&&g()):Le=ve=await k(s);return f.state.next({...!Sc(J)||(u.isValid||m.isValid)&&ve!==n.isValid?{}:{name:J},...t.resolver||!J?{isValid:ve}:{},errors:n.errors}),de.shouldFocus&&!Le&&xb(s,M,J?$e:l.mount),Le},I=J=>{const de={...o.mount?i:a};return pa(J)?de:Sc(J)?Bt(de,J):J.map(ve=>Bt(de,ve))},B=(J,de)=>({invalid:!!Bt((de||n).errors,J),isDirty:!!Bt((de||n).dirtyFields,J),error:Bt((de||n).errors,J),isValidating:!!Bt(n.validatingFields,J),isTouched:!!Bt((de||n).touchedFields,J)}),K=J=>{J&&pb(J).forEach(de=>ca(n.errors,de)),f.state.next({errors:J?n.errors:{}})},Z=(J,de,ve)=>{const Le=(Bt(s,J,{_f:{}})._f||{}).ref,$e=Bt(n.errors,J)||{},{ref:De,message:oe,type:xe,...Ze}=$e;Wn(n.errors,J,{...Ze,...de,ref:Le}),f.state.next({name:J,errors:n.errors,isValid:!1}),ve&&ve.shouldFocus&&Le&&Le.focus&&Le.focus()},q=(J,de)=>Ul(J)?f.state.subscribe({next:ve=>"values"in ve&&J(T(void 0,de),ve)}):T(J,de,!0),H=J=>f.state.subscribe({next:de=>{Ptt(J.name,de.name,J.exact)&&Ott(de,J.formState||u,ue,J.reRenderRoot)&&J.callback({values:{...i},...n,...de,defaultValues:a})}}).unsubscribe,X=J=>(o.mount=!0,m={...m,...J.formState},H({...J,formState:m})),G=(J,de={})=>{for(const ve of J?pb(J):l.mount)l.mount.delete(ve),l.array.delete(ve),de.keepValue||(ca(s,ve),ca(i,ve)),!de.keepError&&ca(n.errors,ve),!de.keepDirty&&ca(n.dirtyFields,ve),!de.keepTouched&&ca(n.touchedFields,ve),!de.keepIsValidating&&ca(n.validatingFields,ve),!t.shouldUnregister&&!de.keepDefaultValue&&ca(a,ve);f.state.next({values:Va(i)}),f.state.next({...n,...de.keepDirty?{isDirty:R()}:{}}),!de.keepIsValid&&g()},ee=({disabled:J,name:de})=>{(lc(J)&&o.mount||J||l.disabled.has(de))&&(J?l.disabled.add(de):l.disabled.delete(de))},re=(J,de={})=>{let ve=Bt(s,J);const Le=lc(de.disabled)||lc(t.disabled);return Wn(s,J,{...ve||{},_f:{...ve&&ve._f?ve._f:{ref:{name:J}},name:J,mount:!0,...de}}),l.mount.add(J),ve?ee({disabled:lc(de.disabled)?de.disabled:t.disabled,name:J}):S(J,!0,de.value),{...Le?{disabled:de.disabled||t.disabled}:{},...t.progressive?{required:!!de.required,min:jy(de.min),max:jy(de.max),minLength:jy(de.minLength),maxLength:jy(de.maxLength),pattern:jy(de.pattern)}:{},name:J,onChange:O,onBlur:O,ref:$e=>{if($e){re(J,de),ve=Bt(s,J);const De=pa($e.value)&&$e.querySelectorAll&&$e.querySelectorAll("input,select,textarea")[0]||$e,oe=Ctt(De),xe=ve._f.refs||[];if(oe?xe.find(Ze=>Ze===De):De===ve._f.ref)return;Wn(s,J,{_f:{...ve._f,...oe?{refs:[...xe.filter(ZE),De,...Array.isArray(Bt(a,J))?[{}]:[]],ref:{type:De.type,name:J}}:{ref:De}}}),S(J,!1,void 0,De)}else ve=Bt(s,J,{}),ve._f&&(ve._f.mount=!1),(t.shouldUnregister||de.shouldUnregister)&&!(btt(l.array,J)&&o.action)&&l.unMount.add(J)}}},W=()=>t.shouldFocusError&&xb(s,M,l.mount),Q=J=>{lc(J)&&(f.state.next({disabled:J}),xb(s,(de,ve)=>{const Le=Bt(s,ve);Le&&(de.disabled=Le._f.disabled||J,Array.isArray(Le._f.refs)&&Le._f.refs.forEach($e=>{$e.disabled=Le._f.disabled||J}))},0,!1))},L=(J,de)=>async ve=>{let Le;ve&&(ve.preventDefault&&ve.preventDefault(),ve.persist&&ve.persist());let $e=Va(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:De,values:oe}=await _();n.errors=De,$e=Va(oe)}else await k(s);if(l.disabled.size)for(const De of l.disabled)ca($e,De);if(ca(n.errors,"root"),Gi(n.errors)){f.state.next({errors:{}});try{await J($e,ve)}catch(De){Le=De}}else de&&await de({...n.errors},ve),W(),setTimeout(W);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Gi(n.errors)&&!Le,submitCount:n.submitCount+1,errors:n.errors}),Le)throw Le},te=(J,de={})=>{Bt(s,J)&&(pa(de.defaultValue)?U(J,Va(Bt(a,J))):(U(J,de.defaultValue),Wn(a,J,Va(de.defaultValue))),de.keepTouched||ca(n.touchedFields,J),de.keepDirty||(ca(n.dirtyFields,J),n.isDirty=de.defaultValue?R(J,Va(Bt(a,J))):R()),de.keepError||(ca(n.errors,J),u.isValid&&g()),f.state.next({...n}))},ae=(J,de={})=>{const ve=J?Va(J):a,Le=Va(ve),$e=Gi(J),De=$e?a:Le;if(de.keepDefaultValues||(a=ve),!de.keepValues){if(de.keepDirtyValues){const oe=new Set([...l.mount,...Object.keys(wy(a,i))]);for(const xe of Array.from(oe))Bt(n.dirtyFields,xe)?Wn(De,xe,Bt(i,xe)):U(xe,Bt(De,xe))}else{if(n3&&pa(J))for(const oe of l.mount){const xe=Bt(s,oe);if(xe&&xe._f){const Ze=Array.isArray(xe._f.refs)?xe._f.refs[0]:xe._f.ref;if(t_(Ze)){const it=Ze.closest("form");if(it){it.reset();break}}}}if(de.keepFieldsRef)for(const oe of l.mount)U(oe,Bt(De,oe));else s={}}i=t.shouldUnregister?de.keepDefaultValues?Va(a):{}:Va(De),f.array.next({values:{...De}}),f.state.next({values:{...De}})}l={mount:de.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!de.keepIsValid||!!de.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:de.keepSubmitCount?n.submitCount:0,isDirty:$e?!1:de.keepDirty?n.isDirty:!!(de.keepDefaultValues&&!Gu(J,a)),isSubmitted:de.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$e?{}:de.keepDirtyValues?de.keepDefaultValues&&i?wy(a,i):n.dirtyFields:de.keepDefaultValues&&J?wy(a,J):de.keepDirty?n.dirtyFields:{},touchedFields:de.keepTouched?n.touchedFields:{},errors:de.keepErrors?n.errors:{},isSubmitSuccessful:de.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ne=(J,de)=>ae(Ul(J)?J(i):J,de),se=(J,de={})=>{const ve=Bt(s,J),Le=ve&&ve._f;if(Le){const $e=Le.refs?Le.refs[0]:Le.ref;$e.focus&&($e.focus(),de.shouldSelect&&Ul($e.select)&&$e.select())}},ue=J=>{n={...n,...J}},Qe={control:{register:re,unregister:G,getFieldState:B,handleSubmit:L,setError:Z,_subscribe:H,_runSchema:_,_focusError:W,_getWatch:T,_getDirty:R,_setValid:g,_setFieldArray:y,_setDisabledField:ee,_setErrors:w,_getFieldArray:D,_reset:ae,_resetDefaultValues:()=>Ul(t.defaultValues)&&t.defaultValues().then(J=>{ne(J,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:E,_disableForm:Q,_subjects:f,_proxyFormState:u,get _fields(){return s},get _formValues(){return i},get _state(){return o},set _state(J){o=J},get _defaultValues(){return a},get _names(){return l},set _names(J){l=J},get _formState(){return n},get _options(){return t}
vendor: 1,995 bytes, line 1227
1227,set _options(J){t={...t,...J}}},subscribe:X,trigger:$,register:re,handleSubmit:L,watch:q,setValue:U,getValues:I,reset:ne,resetField:te,clearErrors:K,unregister:G,setError:Z,setFocus:se,getFieldState:B};return{...Qe,formControl:Qe}}function Xae(e={}){const t=Y.useRef(void 0),n=Y.useRef(void 0),[s,a]=Y.useState({isDirty:!1,isValidating:!1,isLoading:Ul(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ul(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!Ul(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...l}=$tt(e);t.current={...l,formState:s}}const i=t.current.control;return i._options=e,Stt(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,o},[i]),Y.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Y.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Y.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Y.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Y.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==s.isDirty&&i._subjects.state.next({isDirty:o})}},[i,s.isDirty]),Y.useEffect(()=>{e.values&&!Gu(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,a(o=>({...o}))):i._resetDefaultValues()},[i,e.values]),Y.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Ntt(s,i),t.current}
1227const Vz=(e,t,n)=>{if(e&&"reportValidity"in e){const s=Bt(n,t);e.setCustomValidity(s&&s.message||""),e.reportValidity()}},Zae=(e,t)=>{for(const n in t.fields){const s=t.fields[n];s&&s.ref&&"reportValidity"in s.ref?Vz(s.ref,n,e):s.refs&&s.refs.forEach(a=>Vz(a,n,e))}},Vtt=(e,t)=>{t.shouldUseNativeValidation&&Zae(e,t);const n={};for(const s in e){const a=Bt(t.fields,s),i=Object.assign(e[s]||{},{ref:a&&a.ref});if(Utt(t.names||Object.keys(e),s)){const o=Object.assign({},Bt(n,s));Wn(o,"root",i),Wn(n,s,o)}else Wn(n,s,i)}return n},Utt=(e,t)=>e.some(n=>n.startsWith(t+"."));var Ftt=function(e,t){for(var n={};e.length;){var s=e[0],a=s.code,i=s.message,o=s.path.join(".");if(!n[o])if("unionErrors"in s){var l=s.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:i,type:a};if("unionErrors"in s&&s.unionErrors.forEach(function(u){return u.errors.forEach(function(m){return e.push(m)})}),t){var c=n[o].types,d=c&&c[s.code];n[o]=zae(o,t,n,a,d?[].concat(d,s.message):s.message)}e.shift()}return n},Qae=function(e,t,n){return n===void 0&&(n={}),function(s,a,i){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](s,t)).then(function(d){return i.shouldUseNativeValidation&&Zae({},i),{errors:{},values:n.raw?s:d}})}catch(d){return l(d)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:Vtt(Ftt(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}};const Btt=Pae({name:Bl().trim().min(1,"Name is required").max(100,"Name must be less than 100 characters"),email:Bl().trim().email("Invalid email address").max(255,"Email must be less than 255 characters"),subject:Bl().min(1,"Please select a subject"),message:Bl().trim().min(10,"Message must be at least 10 characters").max(2e3,"Message must be less than 2000 characters")}),ztt=[{value:"sales",label:"Sales Inquiry"},{value:"support",label:"Technical Support"},{value:"billing",label:"Billing Question"},{value:"partnership",label:"Partnership Opportunity"},{value:"feedback",label:"Product Feedback"},{value:"other",label:"Other"}],qtt=()=>{const[e,t]=h.useState(!1);h.useEffect(()=>{window.scrollTo(0,0),document.title="Contact VIDAREO: Sales, Support and Partnerships";const c=document.querySelector('meta[name="description"]');c&&c.setAttribute("content","Contact the VIDAREO team about video messaging plans, technical support, partnerships, or product feedback. We reply within one business day.");const d=document.querySelector('meta[property="og:title"]');d&&d.setAttribute("content","Contact VIDAREO: Sales, Support and Partnerships");const u=document.querySelector('meta[property="og:description"]');u&&u.setAttribute("content","Contact the VIDAREO team about video messaging plans, technical support, partnerships, or product feedback. We reply within one business day.");const m=document.querySelector('meta[property="og:url"]');m&&m.setAttribute("content",window.location.href);const f=document.querySelector('meta[property="og:image"]');f&&f.setAttribute("content","https://vidareo.com/og-contact.png");const p=document.querySelector('meta[name="twitter:title"]');p&&p.setAttribute("content","Contact VIDAREO: Sales, Support and Partnerships");const x=document.querySelector('meta[name="twitter:description"]');x&&x.setAttribute("content","Contact the VIDAREO team about video messaging plans, technical support, partnerships, or product feedback. We reply within one business day.");const g=document.querySelector('meta[name="twitter:image"]');return g&&g.setAttribute("content","https://vidareo.com/og-contact.png"),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",d&&d.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),u&&u.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),m&&m.setAttribute("content","https://vidareo.com"),f&&f.setAttribute("content","https://vidareo.com/og-image.png"),p&&p.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),x&&x.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),g&&g.setAttribute("content","https://vidareo.com/og-image.png")}},[]);const{register:n,handleSubmit:s,setValue:a,reset:i,formState:{errors:o}}=Xae({resolver:Qae(Btt)}),l=async c=>{t(!0);try{const{error:d}=await F.functions.invoke("send-contact-email",{body:c});if(d)throw d;Rt({title:"Message sent!",description:"We'll get back to you as soon as possible."}),i()}catch(d){console.error("Contact form error:",d),Rt({title:"Failed to send message",description:"Please try again or email us directly at [email protected]",variant:"destructive"})}finally{t(!1)}};return r.jsxs("div",{className:"min-h-screen",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Get in Touch",subtitle:"Have a question or need help? We're here for you. Fill out the form below and we'll respond within 24 hours.",imageSrc:"https://images.unsplash.com/photo-1553877522-43269d4ea984?w=1920&h=600&fit=crop"}),r.jsx("div",{className:"container mx-auto px-4 py-12 md:py-16",children:r.jsxs("div",{className:"grid lg:grid-cols-3 gap-12 max-w-6xl mx-auto",children:[r.jsxs(fe.div,{initial:{opacity:0,x:-20}
1227,animate:{opacity:1,x:0},transition:{duration:.6,delay:.2},className:"lg:col-span-1 space-y-8",children:[r.jsxs("div",{className:"bg-card rounded-2xl p-6 border border-border/50",children:[r.jsx("h3",{className:"text-lg font-bold text-foreground mb-6",children:"Contact Information"}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx(zr,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Email"}),r.jsx("a",{href:"mailto:[email protected]",className:"text-foreground font-medium hover:text-primary transition-colors",children:"[email protected]"})]})]}),r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx(Wa,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Social"}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("a",{href:"https://www.instagram.com/vidareo.app/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:text-primary transition-colors",children:"Instagram"}),r.jsx("a",{href:"https://www.linkedin.com/company/vidareo",target:"_blank",rel:"noopener noreferrer",className:"text-foreground font-medium hover:text-primary transition-colors",children:"LinkedIn"})]})]})]})]})]}),r.jsxs("div",{className:"bg-gradient-to-br from-primary/10 to-accent/10 rounded-2xl p-6 border border-primary/20",children:[r.jsx("h3",{className:"text-lg font-bold text-foreground mb-3",children:"Quick Response"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"For sales inquiries, we typically respond within 2 hours during business hours. Support requests are handled within 24 hours."})]})]}),r.jsx(fe.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.6,delay:.3},className:"lg:col-span-2",children:r.jsx("div",{className:"bg-card rounded-2xl p-6 md:p-8 border border-border/50",children:r.jsxs("form",{onSubmit:s(l),className:"space-y-6",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"name",children:"Name"}),r.jsx(He,{id:"name",placeholder:"Your name",...n("name"),className:o.name?"border-destructive":""}),o.name&&r.jsx("p",{className:"text-sm text-destructive",children:o.name.message})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Email"}),r.jsx(He,{id:"email",type:"email",placeholder:"[email protected]",...n("email"),className:o.email?"border-destructive":""}),o.email&&r.jsx("p",{className:"text-sm text-destructive",children:o.email.message})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"subject",children:"Subject"}),r.jsxs(kn,{onValueChange:c=>a("subject",c),children:[r.jsx(wn,{className:o.subject?"border-destructive":"",children:r.jsx(En,{placeholder:"What is this regarding?"})}),r.jsx(jn,{children:ztt.map(c=>r.jsx(_t,{value:c.value,children:c.label},c.value))})]}),o.subject&&r.jsx("p",{className:"text-sm text-destructive",children:o.subject.message})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"message",children:"Message"}),r.jsx($s,{id:"message",placeholder:"Tell us how we can help...",rows:6,...n("message"),className:o.message?"border-destructive":""}),o.message&&r.jsx("p",{className:"text-sm text-destructive",children:o.message.message})]}),r.jsx(P,{type:"submit",size:"lg",className:"w-full sm:w-auto",disabled:e,children:e?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"w-4 h-4 mr-2"}),"Send Message"]})})]})})})]})})]}),r.jsx(Ka,{})]})},Htt={"@context":"https://schema.org","@type":"SoftwareApplication",name:"VIDAREO",applicationCategory:"BusinessApplication",operatingSystem:"Web",description:"Record, personalize, and share video messages that get results. Perfect for sales outreach, customer success, and team collaboration.",offers:[{"@type":"Offer",name:"Free Starter Plan",price:"0",priceCurrency:"USD",description:"5 video recordings per month, 2 minute max, 720p quality",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Professional Plan",price:"29.95",priceCurrency:"USD",priceValidUntil:"2026-12-31",description:"Unlimited recordings, 10 minute max, 1080p HD, custom branding",availability:"https://schema.org/InStock",billingDuration:"P1M"},{"@type":"Offer",name:"Professional Plan (Annual)",price:"19.95",priceCurrency:"USD",priceValidUntil:"2026-12-31",description:"Unlimited recordings, 10 minute max, 1080p HD, custom branding - $19.95/mo billed annually",availability:"https://schema.org/InStock",billingDuration:"P1M"},{"@type":"Offer",name:"Team Plan",price:"19",priceCurrency:"USD",priceValidUntil:"2026-12-31",description:"Everything in Professional plus team workspace, admin controls, and team analytics",availability:"https://schema.org/InStock",billingDuration:"P1M",eligibleQuantity:{"@type":"QuantitativeValue",minValue:2}}]},Wtt=()=>(h.useEffect(()=>{window.scrollTo(0,0),document.title="Pricing: Free Plan and 14-Day Paid Trial | VIDAREO";const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content","Compare VIDAREO plans. Start free with no credit card, or try Professional and Team free for 14 days - unlimited sends, longer recordings, HD video.");const t=document.querySelector('meta[property="og:title"]');t&&t.setAttribute("content","Pricing: Free Plan and 14-Day Paid Trial | VIDAREO");const n=document.querySelector('meta[property="og:description"]');n&&n.setAttribute("content","Compare VIDAREO plans. Start free with no credit card, or try Professional and Team free for 14 days - unlimited sends, longer recordings, HD video.");const s=document.querySelector('meta[property="og:url"]');s&&s.setAttribute("content",window.location.href);const a=document.querySelector('meta[property="og:image"]');a&&a.setAttribute("content","https://vidareo.com/og-pricing.png");const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Pricing: Free Plan and 14-Day Paid Trial | VIDAREO");const o=document.querySelector('meta[name="twitter:description"]');o&&o.setAttribute("content","Compare VIDAREO plans. Start free with no credit card, or try Professional and Team free for 14 days - unlimited sends, longer recordings, HD video.");const l=document.querySelector('meta[name="twitter:image"]');if(l&&l.setAttribute("content","https://vidareo.com/og-pricing.png"),!document.querySelector("script[data-pricing-jsonld]")){const d=document.createElement("script");
1227d.type="application/ld+json",d.setAttribute("data-pricing-jsonld","true"),d.textContent=JSON.stringify(Htt),document.head.appendChild(d)}return()=>{const d=document.querySelector("script[data-pricing-jsonld]");d&&d.remove(),t&&t.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),n&&n.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),s&&s.setAttribute("content","https://vidareo.com"),a&&a.setAttribute("content","https://vidareo.com/og-image.png"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),l&&l.setAttribute("content","https://vidareo.com/og-image.png")}},[]),lr()?r.jsx(Of,{to:"/videos",replace:!0}):r.jsxs("div",{className:"min-h-screen",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Simple, Transparent Pricing",subtitle:"Choose the perfect plan for your needs. Start free, upgrade when you're ready.",imageSrc:"https://images.unsplash.com/photo-1552664730-d307ca884978?w=1920&h=600&fit=crop"}),r.jsx(See,{hideHeader:!0}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})),Ytt="/demo/vidareo-viewer-demo.mp4",Gtt="/demo/vidareo-viewer-demo-poster.jpg",Ktt=[{icon:Vs,title:"Screen recording",copy:"Capture your screen, camera or both and share a link instantly."},{icon:Iue,title:"Teleprompter",copy:"Auto-scrolling scripts keep you on message and on camera."},{icon:cr,title:"Live meetings",copy:"Start or schedule a room, present live, and record the call."}],Xtt=[{icon:jr,title:"Contacts",copy:"Organize everyone you send to, with tags and per-person tracking."},{icon:zr,title:"Video email",copy:"Send branded video emails with a unique tracked link per recipient."},{icon:kue,title:"Viewer experience",copy:"Watchers react with emoji, comment, and reply by video - no login needed."}],Ztt=()=>r.jsx("section",{className:"py-16 sm:py-24 bg-muted/40 border-y border-border",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-5 sm:px-6 lg:px-8",children:[r.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10 sm:mb-14",children:[r.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary mb-4",children:"Product demo"}),r.jsx("h2",{className:"font-display text-3xl sm:text-4xl lg:text-5xl text-foreground tracking-tight",children:"See VIDAREO in action"}),r.jsx("p",{className:"mt-4 text-base sm:text-lg text-muted-foreground",children:"A 20-second walkthrough of screen recording, the built-in teleprompter, and live meetings."})]}),r.jsx(fe.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.6},className:"rounded-3xl overflow-hidden border border-border shadow-2xl shadow-foreground/10 bg-card",children:r.jsx("video",{src:see,poster:aee,controls:!0,playsInline:!0,preload:"none",className:"w-full h-auto block bg-black"})}),r.jsx("div",{className:"grid sm:grid-cols-3 gap-6 mt-10",children:Ktt.map(e=>r.jsxs("div",{className:"rounded-2xl bg-card border border-border p-6",children:[r.jsx(e.icon,{className:"w-6 h-6 text-primary mb-3"}),r.jsx("p",{className:"font-semibold text-foreground",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 leading-relaxed",children:e.copy})]},e.title))}),r.jsxs("div",{className:"text-center max-w-2xl mx-auto mt-20 sm:mt-28 mb-10 sm:mb-14",children:[r.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary mb-4",children:"Contacts, mail & the watch page"}),r.jsx("h2",{className:"font-display text-3xl sm:text-4xl lg:text-5xl text-foreground tracking-tight",children:"From contact list to conversation"}),r.jsx("p",{className:"mt-4 text-base sm:text-lg text-muted-foreground",children:"Send a branded video email, then see exactly what your viewer can do - react, comment, and reply with a video of their own."})]}),r.jsx(fe.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.6},className:"rounded-3xl overflow-hidden border border-border shadow-2xl shadow-foreground
1227/10 bg-card",children:r.jsx("video",{src:Ytt,poster:Gtt,controls:!0,playsInline:!0,preload:"none",className:"w-full h-auto block bg-black"})}),r.jsx("div",{className:"grid sm:grid-cols-3 gap-6 mt-10",children:Xtt.map(e=>r.jsxs("div",{className:"rounded-2xl bg-card border border-border p-6",children:[r.jsx(e.icon,{className:"w-6 h-6 text-primary mb-3"}),r.jsx("p",{className:"font-semibold text-foreground",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 leading-relaxed",children:e.copy})]},e.title))})]})}),Qtt=()=>(h.useEffect(()=>{window.scrollTo(0,0),document.title="Screen Recording Features for Sales Teams | VIDAREO";const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content","Screen recording with an AI teleprompter, instant share links, real-time view analytics, custom branding, and team tools - see every VIDAREO feature.");const t=document.querySelector('meta[property="og:title"]');t&&t.setAttribute("content","Screen Recording Features for Sales Teams | VIDAREO");const n=document.querySelector('meta[property="og:description"]');n&&n.setAttribute("content","Screen recording with an AI teleprompter, instant share links, real-time view analytics, custom branding, and team tools - see every VIDAREO feature.");const s=document.querySelector('meta[property="og:url"]');s&&s.setAttribute("content",window.location.href);const a=document.querySelector('meta[property="og:image"]');a&&a.setAttribute("content","https://vidareo.com/og-features.png");const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Screen Recording Features for Sales Teams | VIDAREO");const o=document.querySelector('meta[name="twitter:description"]');o&&o.setAttribute("content","Screen recording with an AI teleprompter, instant share links, real-time view analytics, custom branding, and team tools - see every VIDAREO feature.");const l=document.querySelector('meta[name="twitter:image"]');return l&&l.setAttribute("content","https://vidareo.com/og-features.png"),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",t&&t.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),n&&n.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),s&&s.setAttribute("content","https://vidareo.com"),a&&a.setAttribute("content","https://vidareo.com/og-image.png"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),l&&l.setAttribute("content","https://vidareo.com/og-image.png")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Powerful Features",subtitle:"Discover VIDAREO's tools for easy screen recording, instant sharing, real-time analytics, team collaboration, and custom branding.",imageSrc:"https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=1920&h=600&fit=crop"}),r.jsx(Ztt,{}),r.jsx(cee,{hideHeader:!0}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})),Jtt="/assets/step-record-1EvtAXDV.jpg",ert="/assets/step-personalize-CDOoXz-m.jpg",trt="/assets/step-share-kNXciZLI.jpg",rrt="/assets/step-track-BrsH9co6.jpg",nrt=[{step:"01",image:Jtt,title:"Click to Record",description:"Open our web app or Chrome extension and hit record. Capture your screen with camera overlay, record a presentation, or go camera-only.",label:"Screen, camera, or presentation"},{step:"02",image:ert,title:"Personalize Your Message",description:"Add your prospect's name, company details, and a custom thumbnail to stand out.",label:"Add personal touches"},{step:"03",image:trt,title:"Share Instantly",description:"Send via email, LinkedIn, or grab a link. Videos are hosted and optimized automatically.",label:"Multiple sharing options"},{step:"04",image:rrt,title:"Connect & Engage",description:"Get notified when prospects watch. Build relationships with real-time engagement data.",label:"Real-time notifications"}],srt=({hideHeader:e=!1})=>r.jsx("section",{id:"how-it-works",className:"py-20 sm:py-24 md:py-32 lg:py-36 bg-muted/20",children:r.jsxs("div",{className:"container mx-auto px-4",children:[!e&&r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-12 sm:mb-14 md:mb-20",children:[r.jsx("span",{className:"text-primary font-semibold text-sm uppercase tracking-wider",children:"How It Works"}),r.jsxs("h2",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-extrabold text-foreground mt-4 mb-4 sm:mb-6",children:["From Recording to Connection in ",r.jsx("span",{className:"text-gradient",children:"4 Simple Steps"})]}),r.jsx("p",{className:"text-sm sm:text-base md:text-lg text-muted-foreground max-w-4xl mx-auto",children:"No complicated setup. No lengthy training. Start sending videos that build connections in minutes."})]}),r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"hidden lg:block absolute top-1/2 left-8 right-8 border-t-2 border-dashed border-primary/20 -translate-y-1/2"}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
12275 sm:gap-6 md:gap-8",children:nrt.map((t,n)=>r.jsx(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:n*.15},className:"relative text-center",children:r.jsxs("div",{className:"relative bg-card rounded-xl sm:rounded-2xl p-5 sm:p-6 border border-border/50 hover:border-primary/30 transition-all duration-300 hover:shadow-lg group overflow-hidden",children:[r.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full gradient-primary flex items-center justify-center text-sm sm:text-base font-bold text-primary-foreground mx-auto mb-4 shadow-lg shadow-primary/20 relative z-10",children:t.step}),r.jsxs(fe.div,{initial:{opacity:0,scale:.95},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{delay:.2+n*.1},className:"relative w-full aspect-square rounded-lg sm:rounded-xl overflow-hidden mb-4 shadow-md",children:[r.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/50 via-transparent to-transparent"})]}),r.jsx("h3",{className:"text-base sm:text-lg font-bold text-foreground mb-2",children:t.title}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground leading-relaxed",children:t.description}),r.jsx("div",{className:"mt-3 pt-3 border-t border-border/30",children:r.jsx("span",{className:"text-[10px] sm:text-xs text-primary/70 font-medium",children:t.label})})]})},t.title))})]})]})}),art=()=>(h.useEffect(()=>{window.scrollTo(0,0),document.title="How Video Messaging Works: Record, Send, Track | VIDAREO";const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content","Record a screen or webcam video, personalize it with your branding, share it by link or email, and see exactly who watched - in four simple steps.");const t=document.querySelector('meta[property="og:title"]');t&&t.setAttribute("content","How Video Messaging Works: Record, Send, Track | VIDAREO");const n=document.querySelector('meta[property="og:description"]');n&&n.setAttribute("content","Record a screen or webcam video, personalize it with your branding, share it by link or email, and see exactly who watched - in four simple steps.");const s=document.querySelector('meta[property="og:url"]');s&&s.setAttribute("content",window.location.href);const a=document.querySelector('meta[property="og:image"]');a&&a.setAttribute("content","https://vidareo.com/og-how-it-works.png");const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","How Video Messaging Works: Record, Send, Track | VIDAREO");const o=document.querySelector('meta[name="twitter:description"]');o&&o.setAttribute("content","Record a screen or webcam video, personalize it with your branding, share it by link or email, and see exactly who watched - in four simple steps.");const l=document.querySelector('meta[name="twitter:image"]');return l&&l.setAttribute("content","https://vidareo.com/og-how-it-works.png"),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",t&&t.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),n&&n.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),s&&s.setAttribute("content","https://vidareo.com"),a&&a.setAttribute("content","https://vidareo.com/og-image.png"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),l&&l.setAttribute("content","https://vidareo.com/og-image.png")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"How It Works",subtitle:"See how easy VIDAREO is: Record, personalize, share, and track - all in four simple steps.",imageSrc:"https://images.unsplash.com/photo-1600880292203-757bb62b4baf?w=1920&h=600&fit=crop"}),r.jsx(srt,{hideHeader:!0}),r.jsx(uu,{})]}),r.jsx(Ka,{})]}));var rc="Accordion",irt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[l3,ort,lrt]=Qm(rc),[yC,Nit]=Ss(rc,[lrt,pte]),c3=pte(),Jae=Y.forwardRef((e,t)=>
1227{const{type:n,...s}=e,a=s,i=s;return r.jsx(l3.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?r.jsx(mrt,{...i,ref:t}):r.jsx(urt,{...a,ref:t})})});Jae.displayName=rc;var[eie,crt]=yC(rc),[tie,drt]=yC(rc,{collapsible:!1}),urt=Y.forwardRef((e,t)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=Zs({prop:n,defaultProp:s??"",onChange:a,caller:rc});return r.jsx(eie,{scope:e.__scopeAccordion,value:Y.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:Y.useCallback(()=>i&&c(""),[i,c]),children:r.jsx(tie,{scope:e.__scopeAccordion,collapsible:i,children:r.jsx(rie,{...o,ref:t})})})}),mrt=Y.forwardRef((e,t)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...i}=e,[o,l]=Zs({prop:n,defaultProp:s??[],onChange:a,caller:rc}),c=Y.useCallback(u=>l((m=[])=>[...m,u]),[l]),d=Y.useCallback(u=>l((m=[])=>m.filter(f=>f!==u)),[l]);return r.jsx(eie,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:r.jsx(tie,{scope:e.__scopeAccordion,collapsible:!0,children:r.jsx(rie,{...i,ref:t})})})}),[hrt,bC]=yC(rc),rie=Y.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:s,dir:a,orientation:i="vertical",...o}=e,l=Y.useRef(null),c=Ht(l,t),d=ort(n),m=Yc(a)==="ltr",f=We(e.onKeyDown,p=>{var C;if(!irt.includes(p.key))return;const x=p.target,g=d().filter(k=>{var E;return!((E=k.ref.current)!=null&&E.disabled)}),v=g.findIndex(k=>k.ref.current===x),y=g.length;if(v===-1)return;p.preventDefault();let b=v;const w=0,S=y-1,j=()=>{b=v+1,b>S&&(b=w)},N=()=>{b=v-1,b<w&&(b=S)};switch(p.key){case"Home":b=w;break;case"End":b=S;break;case"ArrowRight":i==="horizontal"&&(m?j():N());break;case"ArrowDown":i==="vertical"&&j();break;case"ArrowLeft":i==="horizontal"&&(m?N():j());break;case"ArrowUp":i==="vertical"&&N();break}const _=b%y;(C=g[_].ref.current)==null||C.focus()});return r.jsx(hrt,{scope:n,disabled:s,direction:a,orientation:i,children:r.jsx(l3.Slot,{scope:n,children:r.jsx(ut.div,{...o,"data-orientation":i,ref:c,onKeyDown:s?void 0:f})})})}),s_="AccordionItem",[frt,d3]=yC(s_),nie=Y.forwardRef((e,t)=>{const{__scopeAccordion:n,value:s,...a}=e,i=bC(s_,n),o=crt(s_,n),l=c3(n),c=ji(),d=s&&o.value.includes(s)||!1,u=i.disabled||e.disabled;return r.jsx(frt,{scope:n,open:d,disabled:u,triggerId:c,children:r.jsx(vte,{"data-orientation":i.orientation,"data-state":cie(d),...l,...a,ref:t,disabled:u,open:d,onOpenChange:m=>{m?o.onItemOpen(s):o.onItemClose(s)}})})});nie.displayName=s_;var sie="AccordionHeader",aie=Y.forwardRef((e,t)=>{const{__scopeAccordion:n,...s}=e,a=bC(rc,n),i=d3(sie,n);return r.jsx(ut.h3,{"data-orientation":a.orientation,"data-state":cie(i.open),"data-disabled":i.disabled?"":void 0,...s,ref:t})});aie.displayName=sie;var AP="AccordionTrigger",iie=Y.forwardRef((e,t)=>{const{__scopeAccordion:n,...s}=e,a=bC(rc,n),i=d3(AP,n),o=drt(AP,n),l=c3(n);return r.jsx(l3.ItemSlot,{scope:n,children:r.jsx(FRe,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...s,ref:t})})});iie.displayName=AP;var oie="AccordionContent",lie=Y.forwardRef((e,t)=>{const{__scopeAccordion:n,...s}=e,a=bC(rc,n),i=d3(oie,n),o=c3(n);return r.jsx(BRe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...s,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});lie.displayName=oie;function cie(e){return e?"open":"closed"}var prt=Jae,xrt=nie,grt=aie,die=iie,uie=lie;const u3=prt,cc=h.forwardRef(({className:e,...t},n)=>r.jsx(xrt,{ref:n,className:ge("border-b",e),...t}));cc.displayName="AccordionItem";const dc=h.forwardRef(({className:e,children:t,...n},s)=>r.jsx(grt,{className:"flex",children:r.jsxs(die,{ref:s,className:ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,r.jsx(Qs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));dc.displayName=die.displayName;const uc=h.forwardRef(({className:e,children:t,...n},s)=>r.jsx(uie,{ref:s,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:r.jsx("div",{className:ge("pb-4 pt-0",e),children:t})}));
1227uc.displayName=uie.displayName;const m3=[{category:"Getting Started",questions:[{question:"How do I get started with VIDAREO?",answer:"Sign up for a free account-no credit card required. You can start recording personalized video messages immediately using our web app. Our guided onboarding helps you create your first video in under 2 minutes."},{question:"What makes VIDAREO different from other video tools?",answer:"VIDAREO combines screen recording, video calls with up to 4 participants, and async video messaging in one platform. With real-time view notifications, detailed analytics, and video replies, you'll build authentic connections that drive 3x higher response rates."},{question:"Do I need to install any software?",answer:"No installation required for web! VIDAREO works directly in your browser using native screen recording APIs. We also offer a native iOS and Android app for camera recording on the go."},{question:"Can I use VIDAREO on mobile devices?",answer:"Yes! Our native mobile app for iOS and Android supports camera recording, video sharing, and joining video calls. Screen recording and screen sharing during calls are available on desktop browsers."},{question:"Is VIDAREO available in other languages?",answer:"Currently VIDAREO is available in English. We're actively working on expanding language support. Contact us if you'd like to request a specific language."}]},{category:"Recording & Features",questions:[{question:"What recording modes are available?",answer:"On desktop, record your screen in landscape or portrait orientation and adjust video quality up to 1080p. On our native mobile app, record directly from your device camera."},{question:"How long can my videos be?",answer:"Free Starter users can record up to 2 minutes per video. Professional and Team plans include 10-minute videos by default, with optional add-ons for 30-minute ($20/month) or 60-minute ($30/month) recordings."},{question:"Can I use a teleprompter while recording?",answer:"Yes! Write your own script or let AI generate one for you, then use the auto-scrolling teleprompter to stay on message. Adjust scroll speed and pause anytime during recording."},{question:"Does VIDAREO support audio recording?",answer:"Absolutely! Record your microphone audio, system audio, or both. During screen recordings, you can capture tab audio to include sounds from the content you're sharing."}]},{category:"Video Calls",questions:[{question:"How do video calls work?",answer:"Create a private room with one click and share the invite link or room code. Up to 4 participants can join - calls are peer-to-peer with video and audio streaming directly between browsers. Guests can join without an account. Each call has a 2-hour maximum duration with on-screen warnings."},{question:"Can I share my screen during a call?",answer:"Yes! On desktop browsers, click the screen share button to share your entire screen, a window, or a browser tab. Your camera stays visible in a floating preview. Screen sharing is not available on mobile devices."},{question:"What is a personal meeting link?",answer:"Your personal meeting link is a permanent, custom URL (e.g. meet.vidareo.com/yourname) that you can share anytime. It's always ready - no need to create a new room each time."},{question:"Can I schedule calls for later?",answer:"Yes! Schedule a call with a specific date, time, and duration. An email invite with a calendar attachment (.ics) and Google Calendar link is sent to your guest automatically."},{question:"Is there a time limit on video calls?",answer:"Yes - each video call has a 2-hour maximum duration. An on-screen timer counts up during the call, and you'll receive warnings at 5 minutes and 1 minute remaining before the call ends automatically."},{question:"Can I record a video call (with screen sharing)?",answer:"Yes! The host can record any video call directly in the browser - no extension needed. The recorder composites the on-screen layout: when someone shares their screen, the screen fills the frame with a strip of camera tiles on top; otherwise it captures a grid of all participant cameras. Audio from your microphone, every remote participant, and screen-share audio is mixed into a single track. When you stop, the recording is saved straight to your VIDAREO video library where you can share, embed, or download it like any other video."},{question:"Why is in-browser call recording limited to 20 minutes?",answer:"In-browser call recordings are encoded entirely in your browser's memory until you press Stop, so a long session can consume several gigabytes of RAM and risk crashing the tab. To keep recordings reliable on every laptop, we cap browser-based call recording at 20 minutes, with on-screen warnings at 15 and 19 minutes and an automatic stop-and-save at the limit. For longer sessions (up to 60 minutes), install the VIDAREO Chrome extension, which streams the recording directly to storage and isn't memory-bound."},{question:"Who can record a call and do participants get notified?",answer:"Only the host (the person who created the room) can start a call recording. When recording is active, all participants see a clear 'Recording' indicator with a live timer in the call interface, so everyone knows the session is being captured."},{question:"Do guests need an account to join?",answer:"No - guests can join any video call by clicking the invite link or entering the room code. No sign-up or download required."}]},{category:"Sharing & Engagement",questions:[{question:"How does video sharing work?",answer:"Share videos via unique links sent directly to your recipient's email. Each link includes the recipient's name for personalization, view tracking, and the option for them to reply with their own video message-creating a genuine connection."},{question:"Can recipients reply with video?",answer:"Yes! Recipients can record and send a video or text reply directly from your shared video page-no account required. This two-way communication helps you connect faster and build deeper relationships."},{question:"How do I know when someone watches my video?",answer:"You'll receive real-time notifications via email and push notifications when someone views your video. Plus, detailed analytics show watch duration, completion rates, and connection metrics."},{question:"Can I password-protect my videos?",answer:"Yes! Add password protection to any shared video for sensitive content. You can also set expiration dates and view limits for additional control."},{question:"Can viewers react to my videos?",answer:"Yes! Viewers can leave emoji reactions on your videos, giving you instant feedback on how your message connected. Reactions appear in your analytics dashboard."}]},{category:"YouTube Videos",questions:[{question:"Can I share YouTube videos through VIDAREO?",answer:"Yes! Paste any YouTube URL (standard videos, Shorts, or youtu.be links) into your VIDAREO library and share it through a branded share link just like a recorded video. Recipients see the YouTube player embedded inside your share page - with your CTA, comments, reactions, and replies all working as usual."},{question:"How do I add a YouTube video to my library?",answer:"On the Videos page, click 'Add YouTube video', paste the URL, and submit. VIDAREO automatically pulls in the title and thumbnail. You can then share or embed it like any other video."},{question:"Do YouTube videos count against my recording or storage limits?",answer:"No. Because YouTube hosts the video file, embedded YouTube videos do not count against your monthly recording minutes or storage. They do count toward your monthly share-link quota when shared."},{question:"Can I edit, transcribe, or download a YouTube video in VIDAREO?",answer:"No. VIDAREO does not download or re-host YouTube content (which would violate YouTube's Terms of Service). Editing, transcription, captured-frame thumbnails, and watermarks are only available on videos you record or upload directly. You can still set a custom thumbnail image and refresh the YouTube title."}
1227,{question:"Do analytics, comments, and replies work for YouTube videos?",answer:"Yes. View tracking, viewer comments, emoji reactions, and video replies are all VIDAREO features that work the same way for shared YouTube videos as they do for self-hosted recordings."}]},{category:"Pricing & Plans",questions:[{question:"Is there a free plan?",answer:"Yes! The Free Starter Plan includes up to 5 recordings per month (2 minutes each), 5 video sends per month, basic analytics, 720p quality, and video replies. Videos include a VIDAREO watermark."},{question:"What's included in the Professional plan?",answer:"For $29.95/month (or $19.95/month annually), get 10-minute videos, unlimited sends, advanced analytics, custom branding with no watermark, 1080p quality, script & teleprompter, video calls with up to 4 participants, email signatures, and priority support."},{question:"What's included in the Team plan?",answer:"Starting at $19/user/month (or $15/user/month annually, minimum 2 users), teams get everything in Professional plus team workspaces, admin controls, team analytics dashboard, and priority support."},{question:"Do you offer annual billing discounts?",answer:"Yes! Save with annual billing. Professional is $239.40/year ($19.95/month) and Team is $180/user/year ($15/user/month). Extended video add-ons are also discounted with annual plans."},{question:"Can I upgrade or downgrade anytime?",answer:"Absolutely. Upgrade instantly to access premium features, or downgrade at the end of your billing period. Manage everything through your account settings or the Stripe Customer Portal."},{question:"What payment methods do you accept?",answer:"We accept all major credit cards (Visa, Mastercard, American Express) through our secure Stripe payment processing. Enterprise customers can arrange invoice billing."}]},{category:"Teams & Management",questions:[{question:"How do team workspaces work?",answer:"Team workspaces let you invite members via email, manage roles, and access unified team analytics. Team owners can view team-wide performance metrics from the dashboard."},{question:"Can I add or remove team members?",answer:"Yes! Team admins can invite new members and remove existing ones anytime. Your subscription adjusts automatically based on active team members."},{question:"What admin controls are available?",answer:"Admins can manage team members and roles, view team-wide analytics and usage reports, control branding settings, and monitor activity across the organization."}]},{category:"Security & Privacy",questions:[{question:"How is my data protected?",answer:"VIDAREO uses enterprise-grade encryption for all data in transit and at rest. Videos are stored securely in the cloud with access controls, and we never share your content with third parties. Video calls are peer-to-peer, meaning your audio and video never pass through our servers."},{question:"Can I delete my videos and data?",answer:"Yes! You have full control over your content. Delete individual videos anytime, or request complete account deletion from your settings. We respect your right to data privacy."},{question:"Is VIDAREO GDPR compliant?",answer:"Yes! We're committed to GDPR compliance and data protection best practices. You can access, export, or delete your personal data at any time. See our Privacy Policy for details."},{question:"Where are videos stored?",answer:"Videos are stored on secure, globally distributed cloud infrastructure with redundancy and high availability. Your content remains accessible from anywhere in the world."}]},{category:"Support & Resources",questions:[{question:"How do I get help?",answer:"Visit our Contact page to reach our support team. Professional and Team plan users receive priority support with faster response times. We're here to help you connect!"},{question:"Do you offer onboarding or training?",answer:"Yes! All users get access to our guided in-app onboarding. Team plan customers receive priority support with faster response times to help you get started quickly."},{question:"Can I request new features?",answer:"Absolutely! We love hearing from our users. Reach out through our Contact page with feature requests, and our product team reviews all suggestions for future updates."}]}],vrt=()=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:m3.flatMap(t=>t.questions).map(t=>
1227({"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:t.answer}}))}),yrt=({hideHeader:e=!1})=>(h.useEffect(()=>{if(!document.querySelector("script[data-faq-jsonld]")){const n=document.createElement("script");n.type="application/ld+json",n.setAttribute("data-faq-jsonld","true"),n.textContent=JSON.stringify(vrt()),document.head.appendChild(n)}return()=>{const n=document.querySelector("script[data-faq-jsonld]");n&&n.remove()}},[]),r.jsx("section",{id:"faq",className:"py-24 md:py-36 bg-background",children:r.jsxs("div",{className:"container mx-auto px-4",children:[!e&&r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-16 md:mb-20",children:[r.jsx("span",{className:"text-primary font-semibold text-sm uppercase tracking-wider",children:"FAQ"}),r.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-extrabold text-foreground mt-4 mb-6",children:["Frequently Asked ",r.jsx("span",{className:"text-gradient",children:"Questions"})]}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-4xl mx-auto",children:"Everything you need to know about VIDAREO. Can't find your answer? Contact our support team."})]}),r.jsx("div",{className:"max-w-4xl mx-auto",children:r.jsx("div",{className:"grid gap-10",children:m3.map((t,n)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:n*.08},children:[r.jsx("h3",{className:"text-lg font-bold text-foreground mb-4 flex items-center gap-3 pl-3 border-l-2 border-primary",children:t.category}),r.jsx(u3,{type:"single",collapsible:!0,className:"bg-card rounded-xl border border-border/50",children:t.questions.map((s,a)=>r.jsxs(cc,{value:`${t.category}-${a}`,className:"border-border/50",children:[r.jsx(dc,{className:"px-6 py-5 text-left hover:no-underline hover:bg-muted/50 transition-colors",children:r.jsx("span",{className:"font-medium text-foreground",children:s.question})}),r.jsx(uc,{className:"px-6 pb-5 text-muted-foreground leading-relaxed",children:s.answer})]},a))})]},t.category))})})]})})),brt=()=>{h.useEffect(()=>{window.scrollTo(0,0),document.title="Video Messaging FAQ: Recording, Sharing & Plans | VIDAREO";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","Answers about screen recording, share links, view analytics, security, plans, and the 14-day free trial on VIDAREO paid plans.");const n=document.querySelector('meta[property="og:title"]');n&&n.setAttribute("content","Video Messaging FAQ: Recording, Sharing & Plans | VIDAREO");const s=document.querySelector('meta[property="og:description"]');s&&s.setAttribute("content","Answers about screen recording, share links, view analytics, security, plans, and the 14-day free trial on VIDAREO paid plans.");const a=document.querySelector('meta[property="og:url"]');a&&a.setAttribute("content",window.location.href);const i=document.querySelector('meta[property="og:image"]');i&&i.setAttribute("content","https://vidareo.com/og-faq.png");const o=document.querySelector('meta[name="twitter:title"]');o&&o.setAttribute("content","Video Messaging FAQ: Recording, Sharing & Plans | VIDAREO");const l=document.querySelector('meta[name="twitter:description"]');l&&l.setAttribute("content","Answers about screen recording, share links, view analytics, security, plans, and the 14-day free trial on VIDAREO paid plans.");const c=document.querySelector('meta[name="twitter:image"]');return c&&c.setAttribute("content","https://vidareo.com/og-faq.png"),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",t&&t.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),n&&n.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),s&&s.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),a&&a.setAttribute("content","https://vidareo.com"),i&&i.setAttribute("content","https://vidareo.com/og-image.png"),o&&o.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),l&&l.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),c&&c.setAttribute("content","https://vidareo.com/og-image.png")}},[]);const e={"@context":"https://schema.org","@type":"FAQPage",mainEntity:m3.flatMap(t=>t.questions.map(n=>
1227({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer}})))};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}}),r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Frequently Asked Questions",subtitle:"Get answers to common questions about VIDAREO video messaging, recording, sharing, and pricing.",imageSrc:"https://images.unsplash.com/photo-1531482615713-2afd69097998?w=1920&h=600&fit=crop"}),r.jsx(yrt,{hideHeader:!0}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})},wrt=()=>(h.useEffect(()=>{window.scrollTo(0,0),document.title="Video Messaging Use Cases by Industry | VIDAREO";const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content","See how sales, real estate, customer success, recruiting, and education teams use VIDAREO video messaging to win replies and close deals faster.");const t=document.querySelector('meta[property="og:title"]');t&&t.setAttribute("content","Video Messaging Use Cases by Industry | VIDAREO");const n=document.querySelector('meta[property="og:description"]');n&&n.setAttribute("content","See how sales, real estate, customer success, recruiting, and education teams use VIDAREO video messaging to win replies and close deals faster.");const s=document.querySelector('meta[property="og:url"]');s&&s.setAttribute("content",window.location.href);const a=document.querySelector('meta[property="og:image"]');a&&a.setAttribute("content","https://vidareo.com/og-use-cases.png");const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Video Messaging Use Cases by Industry | VIDAREO");const o=document.querySelector('meta[name="twitter:description"]');o&&o.setAttribute("content","See how sales, real estate, customer success, recruiting, and education teams use VIDAREO video messaging to win replies and close deals faster.");const l=document.querySelector('meta[name="twitter:image"]');return l&&l.setAttribute("content","https://vidareo.com/og-use-cases.png"),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",t&&t.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),n&&n.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),s&&s.setAttribute("content","https://vidareo.com"),a&&a.setAttribute("content","https://vidareo.com/og-image.png"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),l&&l.setAttribute("content","https://vidareo.com/og-image.png")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Use Cases",subtitle:"From sales outreach to internal communication, training to customer success - see how teams use VIDAREO to communicate with clarity and build authentic relationships.",imageSrc:"https://images.unsplash.com/photo-1521737604893-d14cc237f11d?w=1920&h=600&fit=crop"}),r.jsx("section",{className:"py-16 md:py-24 bg-muted/30",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-16",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-foreground mb-4",children:"Built for Connection & Collaboration"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-4xl mx-auto",children:"Whether you are closing deals, training your team, or sharing knowledge, VIDAREO helps you communicate with clarity and authenticity."})]}),r.jsx("div",{className:"grid md:grid-cols-2 gap-8 max-w-6xl mx-auto",children:yg.map((e,t)=>{const n=e.icon;return r.jsx(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:t*.1},className:"relative group",children:r.jsxs(Cr,{to:`/use-cases/${e.slug}`,children:[r.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${e.color} rounded-2xl blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500`}),r.jsxs("div",{className:"relative bg-card rounded-2xl border border-border/50 hover:border-primary/30 transition-all duration-300 hover:shadow-lg h-full overflow-hidden",children:[e.heroImage&&r.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden bg-muted/30 flex items-center justify-center",children:[r.jsx("img",{src:e.heroImage,alt:e.title,className:"w-full h-full object-contain transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-card via-card/30 to-transparent"}),r.jsxs("div",{className:"absolute top-3 right-3 bg-card/80 backdrop-blur-sm rounded-lg px-3 py-1.5 text-sm font-semibold",children:[r.jsx("span",{className:"text-primary",children:e.stats.metric}),r.jsx("span",{className:"text-muted-foreground ml-1.5",children:e.stats.label})]})]}),r.jsxs("div",{className:"p-6 md:p-8",children:[r.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(n,{className:"w-6 h-6 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-xl font-bold text-foreground",children:e.title}),r.jsx("p",{className:"text-sm text-primary font-medium",children:e.subt
1227itle})]})]}),r.jsx("p",{className:"text-muted-foreground mb-4",children:e.description}),r.jsx("ul",{className:"space-y-2",children:e.benefits.map(s=>r.jsxs("li",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0"}),s]},s))}),r.jsxs("div",{className:"mt-4 text-primary font-medium text-sm group-hover:underline flex items-center gap-1",children:["Learn more about VIDAREO for ",e.title,r.jsx("span",{className:"transition-transform group-hover:translate-x-1 inline-block",children:"→"})]})]})]})]})},e.title)})})]})}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})),jrt=()=>{const{slug:e}=eh(),t=e?UEe(e):void 0;if(h.useEffect(()=>{if(window.scrollTo(0,0),t){document.title=`${t.title} | VIDAREO - Video Messaging`;const i=document.querySelector('meta[name="description"]');i&&i.setAttribute("content",t.heroDescription);const o=document.querySelector('meta[property="og:title"]');o&&o.setAttribute("content",`${t.title} | VIDAREO - Video Messaging`);const l=document.querySelector('meta[property="og:description"]');l&&l.setAttribute("content",t.heroDescription);const c=document.querySelector('meta[property="og:url"]');c&&c.setAttribute("content",window.location.href);const d=document.querySelector('meta[property="og:image"]');d&&d.setAttribute("content","https://vidareo.com/og-use-cases.png");const u=document.querySelector('meta[name="twitter:title"]');u&&u.setAttribute("content",`${t.title} | VIDAREO - Video Messaging`);const m=document.querySelector('meta[name="twitter:description"]');m&&m.setAttribute("content",t.heroDescription);const f=document.querySelector('meta[name="twitter:image"]');f&&f.setAttribute("content","https://vidareo.com/og-use-cases.png")}let a=null;return t&&(a=document.createElement("script"),a.type="application/ld+json",a.setAttribute("data-usecase-jsonld","true"),a.textContent=JSON.stringify({"@context":"https://schema.org","@type":"Article",headline:`VIDAREO for ${t.title}`,description:t.heroDescription,image:t.heroImage||"https://vidareo.com/og-use-cases.png",url:`https://vidareo.com/use-cases/${t.slug}`,author:{"@type":"Organization",name:"VIDAREO"},publisher:{"@type":"Organization",name:"VIDAREO",logo:{"@type":"ImageObject",url:"https://vidareo.com/vidareo-logo-large.png"}},mainEntityOfPage:{"@type":"WebPage","@id":`https://vidareo.com/use-cases/${t.slug}`}}),document.querySelectorAll("script[data-usecase-jsonld]").forEach(i=>i.remove()),document.head.appendChild(a)),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams";const i=document.querySelector('meta[property="og:title"]');i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams");const o=document.querySelector('meta[property="og:description"]');o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video");const l=document.querySelector('meta[property="og:url"]');l&&l.setAttribute("content","https://vidareo.com");const c=document.querySelector('meta[property="og:image"]');c&&c.setAttribute("content","https://vidareo.com/og-image.png");const d=document.querySelector('meta[name="twitter:title"]');d&&d.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams");const u=document.querySelector('meta[name="twitter:description"]');u&&u.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video");const m=document.querySelector('meta[name="twitter:image"]');m&&m.setAttribute("content","https://vidareo.com/og-image.png"),document.querySelectorAll("script[data-usecase-jsonld]").forEach(f=>f.remove())}},[t]),!t)return r.jsx(Of,{to:"/use-cases",replace:!0});const n=t.icon,s=yg.filter(a=>a.slug!==e).slice(0,3);return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-16 md:pt-24",children:[r.jsx("section",{className:"py-8 md:py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(Cr,{to:"/use-cases",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors mb-6",children:[r.jsx(aa,{className:"w-4 h-4"}),"All Use Cases"]}),r.jsxs(fe.div,{initial:{opacity:0,y:20}
1227,animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-4xl",children:[r.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[r.jsx("div",{className:`w-16 h-16 rounded-2xl bg-gradient-to-br ${t.color} flex items-center justify-center`,children:r.jsx(n,{className:"w-8 h-8 text-primary"})}),r.jsxs("div",{children:[r.jsx("span",{className:"inline-block text-primary font-semibold text-sm uppercase tracking-wider",children:t.subtitle}),r.jsxs("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-extrabold text-foreground",children:["VIDAREO for ",t.title]})]})]}),r.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-3xl mb-8",children:t.heroDescription}),r.jsxs("div",{className:"flex flex-wrap gap-4 mb-8",children:[r.jsx(P,{size:"lg",asChild:!0,children:r.jsxs(Cr,{to:"/auth",children:["Get Started Free",r.jsx(Ya,{className:"w-4 h-4 ml-2"})]})}),r.jsx(P,{size:"lg",variant:"outline",asChild:!0,children:r.jsx(Cr,{to:"/features",children:"See All Features"})})]}),r.jsxs("div",{className:"inline-flex items-center gap-3 bg-primary/10 rounded-xl px-6 py-4",children:[r.jsx("span",{className:"text-3xl md:text-4xl font-bold text-primary",children:t.stats.metric}),r.jsx("span",{className:"text-muted-foreground font-medium",children:t.stats.label})]})]}),t.heroImage&&r.jsx(fe.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.7,delay:.2},className:"mt-12 max-w-4xl",children:r.jsx("img",{src:t.heroImage,alt:`${t.title} - VIDAREO video messaging`,className:"w-full rounded-2xl shadow-xl border border-border/30"})})]})}),r.jsx("section",{className:"py-16 bg-muted/30",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center mb-12",children:[r.jsxs("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground mb-4",children:["How VIDAREO Helps ",t.title]}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:t.description})]}),r.jsx("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:t.detailedBenefits.map((a,i)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:i*.1},className:"bg-card rounded-xl p-6 border border-border/50",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:r.jsx(nt,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:a.title}),r.jsx("p",{className:"text-muted-foreground",children:a.description})]},a.title))})]})}),r.jsx("section",{className:"py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground mb-8 text-center",children:"Key Benefits"}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:t.benefits.map((a,i)=>r.jsxs(fe.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.4,delay:i*.1},className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(nt,{className:"w-4 h-4 text-primary"})}),r.jsx("span",{className:"text-foreground",children:a})]},a))})]})})}),t.testimonial&&r.jsx("section",{className:"py-16 bg-muted/30",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"max-w-3xl mx-auto text-center",children:[r.jsxs("blockquote",{className:"text-xl md:text-2xl text-foreground font-medium mb-6",children:['"',t.testimonial.quote,'"']}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-foreground",children:t.testimonial.author}),r.jsx("p",{className:"text-muted-foreground",children:t.testimonial.role})]})]})})}),r.jsx("section",{className:"py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground mb-8 text-center",children:"Explore Other Use Cases"}),r.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-5xl mx-auto",children:s.map((a,i)=>{const o=a.icon;return r.jsx(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:i*.1},children:r.jsxs(Cr,{to:`/use-cases/${a.slug}`,className:"block bg-card rounded-xl p-6 border border-border/50 hover:border-primary/30 transition-all duration-300 h-full",children:[r.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br ${a.color} flex items-center justify-center mb-4`,children:r.jsx(o,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:a.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a.subtitle})]})},a.slug)})})]})}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})},h3=[{slug:"presentations",icon:kf,name:"Presentations",tagline:"Record your slides with you on camera",summary:"Turn a PDF or PowerPoint into a 
1227narrated video presentation with your camera on screen - no meeting required.",heroDescription:"Upload a PDF or PowerPoint deck, pick a layout, and record yourself walking through it slide by slide. VIDAREO composites your camera and slides into a single polished video you can share with a link.",heroImage:"https://images.unsplash.com/photo-1591115765373-5207764f72e7?w=1600&h=900&fit=crop",color:"from-primary/20 to-primary/5",whatItDoes:["Imports PDF and PowerPoint files and renders each slide in the recorder","Composites your camera bubble alongside or over the slides in real time","Lets you advance slides while recording, with keyboard and on-screen controls","Saves the finished recording to your video library, ready to share or email"],features:[{title:"Multiple slide layouts",description:"Choose between slide-focused, side-by-side, or presenter-forward layouts, and switch mid-recording when you want the attention on you."},{title:"Built-in teleprompter",description:"Write or generate a script and read it while looking straight at the camera. Scroll speed and text size are adjustable while recording."},{title:"AI-assisted titling",description:"VIDAREO suggests a clear title based on your deck contents so recordings stay organized in your library."},{title:"Review before you send",description:"Watch the recording, retake it, trim it in the editor, or set a custom thumbnail before creating a share link."}],steps:[{title:"Open the recorder and choose Presentation",description:"From the dashboard or the Record page, start a new recording and select the presentation mode."},{title:"Upload your deck",description:"Drop in a PDF or PowerPoint file. Slides are converted and shown in the recorder so you can preview the order before you start."},{title:"Pick your layout and check your setup",description:"Select the camera and microphone, choose how your camera sits against the slides, and load a teleprompter script if you want one."},{title:"Record and advance slides",description:"Hit record and talk through your deck. Move forward and back through slides as you speak; pause and resume whenever you need to."},{title:"Review, then share",description:"Stop recording to review it, make any edits, then create a share link or send it straight to a contact by email."}],bestFor:["Sales decks and proposals sent async instead of booking another call","Onboarding and training walkthroughs your team can rewatch","Investor and board updates with a face and voice attached","Marketing explainers and product launch summaries"],faqs:[{question:"What file types can I upload?",answer:"PDF and PowerPoint decks are supported. If a font or animation does not survive the conversion, export your deck to PDF first for the most faithful result."},{question:"Can I re-record a single slide?",answer:"Recordings are captured in one pass, but you can trim in the video editor or simply record again - drafts are cheap and nothing is published until you create a share link."},{question:"Is presentation mode available on mobile?",answer:"Presentation recording is designed for desktop browsers, where slide controls and camera compositing work reliably."}],primaryCta:{label:"Start a presentation",href:"/record"}},{slug:"chrome-extension",icon:$4,name:"Chrome Extension",tagline:"Record your screen from anywhere in the browser",summary:"Capture any tab, window, or full screen - with camera and microphone - without leaving the page you are working in.",heroDescription:"The VIDAREO Chrome extension puts screen recording one click away. Record a tab, a window, or your whole screen with your camera and mic, then upload straight to your VIDAREO library and share the link.",heroImage:"https://images.unsplash.com/photo-1517430816045-df4b7de11d1d?w=1600&h=900&fit=crop",color:"from-primary/20 to-primary/5",whatItDoes:["Records the current tab, another window, or your entire screen","Adds a camera bubble and microphone audio, including tab audio when you allow it","Uploads recordings directly to your VIDAREO library when you finish","Gives you a review screen so you can keep, retake, or discard a take"],features:[{title:"One-click capture",description:"Pin the extension and start recording from any page. Chrome's native picker lets you choose the exact tab, window, or display."},{title:"Camera and mic controls",description:"Choose your devices before you start, and mute or unmute the microphone mid-recording without stopping the take."},{title:"Reliable uploads",description:"Recordings upload directly to secure storage, so long screen shares are not lost to browser memory limits."},{title:"Post-recording review",description:"Every take lands on a review screen with playback, so you can confirm the recording before it appears in your library."}],steps:[{title:"Install the extension",description:"Download the VIDAREO extension and add it to Chrome, then pin it to your toolbar so it is always one click away."},{title:"Sign in once",description:"Open the extension and sign in with your VIDAREO account. It stays connected so future recordings upload automatically."}
1227,{title:"Choose what to record",description:"Click the extension icon, pick screen, window, or tab, and select your camera and microphone. Chrome will ask which surface to share."},{title:"Record and narrate",description:"Walk through the workflow, page, or bug you are explaining. Mute the mic or stop the recording from the extension at any time."},{title:"Review and share",description:"Stop the recording to review it. Keep it and it uploads to your library, where you can create a share link, add a CTA, or email it."}],bestFor:["Product walkthroughs and demos recorded from a live app","Bug reports and support replies that are faster to show than to type","Quick answers to teammates without booking a meeting","Recording a workflow across multiple tabs in one take"],faqs:[{question:"Do I need the extension to record?",answer:"Camera recording works in the browser without it. Screen recording is handled through the extension, which gives Chrome the permissions it needs for reliable capture."},{question:"Can I capture audio playing in a tab?",answer:"Yes. When Chrome's picker asks which surface to share, tick the option to share tab audio and it will be mixed into the recording."},{question:"What happens if my browser closes mid-recording?",answer:"The extension recovers in-progress recordings where possible and surfaces them on the review screen the next time you open it."}],primaryCta:{label:"Get the extension",href:"/features"}},{slug:"video-calls",icon:cr,name:"Video Calls",tagline:"Live meetings with rooms, scheduling, and recording",summary:"Host live video meetings with a shareable room link, screen sharing, scheduling, and host-side recording saved to your library.",heroDescription:"When async is not enough, hop on a live call. Create a room, send the link, and meet in the browser with screen sharing, a pre-join lobby, and recordings that land in the same library as your video messages.",heroImage:"https://images.unsplash.com/photo-1600880292203-757bb62b4baf?w=1600&h=900&fit=crop",color:"from-primary/20 to-primary/5",whatItDoes:["Creates instant or scheduled meeting rooms with a shareable join link","Runs meetings in the browser with camera, microphone, and screen sharing","Gives guests a pre-join lobby to check their devices before entering","Lets the host record the call and save it to their VIDAREO library"],features:[{title:"Instant or scheduled rooms",description:"Start a room right now, or schedule a meeting - including recurring ones - and send calendar invites to attendees."},{title:"Presenter-focused screen sharing",description:"When someone shares their screen, the layout shifts to put the content front and center with participants alongside."},{title:"Pre-join lobby",description:"Guests confirm their camera and mic before joining, so meetings do not open with two minutes of troubleshooting."},{title:"Host recording",description:"The host can record the meeting and the finished file is saved to the video library, ready to share with anyone who missed it."}],steps:[{title:"Open Meet",description:"Go to the Meet page from your dashboard to see upcoming meetings and start a new room."},{title:"Create or schedule a room",description:"Start an instant room for a quick conversation, or schedule one with a date, time, and attendee list - including recurring meetings."},{title:"Send the join link",description:"Share the room link or invite attendees by email. Scheduled meetings include a calendar file so the time lands on their calendar."},{title:"Meet, share, and record",description:"Join through the lobby, share your screen when you need to walk through something, and start recording if you want a copy."},{title:"Follow up with the recording",description:"After the call, the recording appears in your library, so you can trim it, share a link, or email it to anyone who missed it."}],bestFor:["Discovery calls and live demos with prospects","Recurring team standups and client check-ins","Coaching and training sessions that benefit from a recording","Any conversation that is faster live than in a thread"],faqs:[{question:"Do guests need an account?",answer:"No. Anyone with the room link can join from a browser - they only pass through the lobby to confirm their camera and microphone."},{question:"Can I share my screen from a phone or tablet?",answer:"Screen sharing is a desktop browser feature. On mobile you can still join, talk, and see everyone's video and shared screens."},{question:"Where do recordings go?",answer:"Host recordings are saved to your VIDAREO video library alongside your other recordings, so sharing and analytics work the same way."}],primaryCta:{label:"Start a meeting",href:"/meet"}},{slug:"contacts-and-emailing",icon:jue,name:"Contacts & Emailing",tagline:"Send videos to the right people and see who watched",summary:"Keep your recipients in one place and send branded video emails - individually or in bulk - with per-recipient tracking.",heroDescription:"Store your contacts, compose branded emails around your videos, and send them to one person or a 
1227whole list. Every recipient gets their own tracked link, so you know exactly who opened and watched.",heroImage:"https://images.unsplash.com/photo-1526628953301-3e589a6a8b74?w=1600&h=900&fit=crop",color:"from-primary/20 to-primary/5",whatItDoes:["Stores and de-duplicates your contacts in one searchable list","Composes video emails with your branding, signature, and a thumbnail preview","Sends to a single contact or a selected group in one pass","Generates a unique tracked link per recipient so views are attributed correctly"],features:[{title:"Contact management",description:"Add contacts manually or as you send. Duplicates are merged automatically so your list stays clean."},{title:"Reusable templates",description:"Save email templates with personalization variables like first name, so repeat outreach takes seconds instead of minutes."},{title:"Your branding",description:"Emails carry your logo, colors, and signature pulled from your profile settings, so recipients recognize who is writing."},{title:"Per-recipient analytics",description:"See who opened, who watched, and how far they got - then follow up with the people actually paying attention."}],steps:[{title:"Build your contact list",description:"Open Contacts and add the people you send to. Contacts you email are saved automatically for next time."},{title:"Set your branding once",description:"In profile settings, add your logo, colors, and email signature so every message goes out looking like you."},{title:"Pick a video and compose",description:"From the Mail page or a video in your library, choose the recording, write your subject and message, or start from a saved template."},{title:"Choose recipients and send",description:"Select one contact or several. Each person gets their own tracked link, and the send history records what went out."},{title:"Watch the results and follow up",description:"Check analytics to see who opened and watched, then reply to the engaged contacts while your video is still fresh."}],bestFor:["Personalized prospecting at scale without a separate sales tool","Client updates and check-ins that need a human touch","Announcements and launches sent to a segmented list","Following up after a call with a recap the recipient can rewatch"],faqs:[{question:"How does per-recipient tracking work?",answer:"Each recipient receives a unique link to the same video. When they open it, the view is attributed to them so analytics show individual engagement rather than one anonymous total."},{question:"Can I import contacts?",answer:"You can add contacts directly in the Contacts page, and anyone you email is stored automatically with duplicates merged."},{question:"Are there sending limits?",answer:"Bulk sending volume depends on your plan. Your current limits and usage are always visible on the billing page."}],primaryCta:{label:"Open Contacts",href:"/contacts"}}],Nrt=e=>h3.find(t=>t.slug===e),Uz="VIDAREO Products | Record, Present, Meet & Send",Fz="Explore every VIDAREO product: narrated presentations, the Chrome screen recording extension, live video calls, and contacts with tracked video emailing.",Srt=()=>(h.useEffect(()=>{var e,t,n,s;window.scrollTo(0,0),document.title=Uz,(e=document.querySelector('meta[name="description"]'))==null||e.setAttribute("content",Fz),(t=document.querySelector('meta[property="og:title"]'))==null||t.setAttribute("content",Uz),(n=document.querySelector('meta[property="og:description"]'))==null||n.setAttribute("content",Fz),(s=document.querySelector('meta[property="og:url"]'))==null||s.setAttribute("content","https://vidareo.com/products")},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Products",subtitle:"Four ways to communicate with VIDAREO - record a 
1227narrated deck, capture your screen from any tab, meet live, or send tracked video email. Here is what each one does and how to use it.",imageSrc:"https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=1920&h=600&fit=crop"}),r.jsx("section",{className:"py-16 md:py-24",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsx("div",{className:"grid md:grid-cols-2 gap-8 max-w-6xl mx-auto",children:h3.map((e,t)=>{const n=e.icon;return r.jsx(fe.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:t*.08},children:r.jsxs(Cr,{to:`/products/${e.slug}`,className:"group flex h-full flex-col rounded-[1.75rem] bg-card p-8 shadow-[0_18px_50px_-30px_hsl(var(--foreground)/0.35)] transition-all duration-300 hover:-translate-y-1 hover:shadow-[0_28px_70px_-30px_hsl(var(--foreground)/0.4)]",children:[r.jsx("div",{className:"mb-6 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(n,{className:"h-7 w-7 text-primary"})}),r.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-primary",children:e.tagline}),r.jsx("h2",{className:"mt-2 text-2xl font-extrabold text-foreground",children:e.name}),r.jsx("p",{className:"mt-3 flex-1 text-muted-foreground",children:e.summary}),r.jsxs("span",{className:"mt-6 inline-flex items-center gap-2 font-semibold text-primary",children:["See how ",e.name," works",r.jsx(Ya,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})},e.slug)})})})}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})),_rt=()=>{const{slug:e}=eh(),t=e?Nrt(e):void 0;if(h.useEffect(()=>{var o,l,c,d;if(window.scrollTo(0,0),!t)return;const a=`${t.name} | VIDAREO`;document.title=a,(o=document.querySelector('meta[name="description"]'))==null||o.setAttribute("content",t.summary),(l=document.querySelector('meta[property="og:title"]'))==null||l.setAttribute("content",a),(c=document.querySelector('meta[property="og:description"]'))==null||c.setAttribute("content",t.summary),(d=document.querySelector('meta[property="og:url"]'))==null||d.setAttribute("content",`https://vidareo.com/products/${t.slug}`),document.querySelectorAll("script[data-product-jsonld]").forEach(u=>u.remove());const i=document.createElement("script");return i.type="application/ld+json",i.setAttribute("data-product-jsonld","true"),i.textContent=JSON.stringify([{"@context":"https://schema.org","@type":"HowTo",name:`How to use VIDAREO ${t.name}`,description:t.heroDescription,step:t.steps.map((u,m)=>({"@type":"HowToStep",position:m+1,name:u.title,text:u.description}))},{"@context":"https://schema.org","@type":"FAQPage",mainEntity:t.faqs.map(u=>({"@type":"Question",name:u.question,acceptedAnswer:{"@type":"Answer",text:u.answer}}))}]),document.head.appendChild(i),()=>{document.querySelectorAll("script[data-product-jsonld]").forEach(u=>u.remove())}},[t]),!t)return r.jsx(Of,{to:"/products",replace:!0});const n=t.icon,s=h3.filter(a=>a.slug!==t.slug);return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-16 md:pt-24",children:[r.jsx("section",{className:"py-8 md:py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(Cr,{to:"/products",className:"mb-6 inline-flex items-center gap-2 text-muted-foreground transition-colors hover:text-foreground",children:[r.jsx(aa,{className:"h-4 w-4"}),"All Products"]}),r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-4xl",children:[r.jsxs("div",{className:"mb-6 flex items-center gap-4",children:[r.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx(n,{className:"h-8 w-8 text-primary"})}),r.jsxs("div",{children:[r.jsx("span",{className:"inline-block text-sm font-semibold uppercase tracking-wider text-primary",children:t.tagline}),r.jsx("h1",{className:"text-3xl font-extrabold text-foreground md:text-4xl lg:text-5xl",children:t.name})]})]}),r.jsx("p",{className:"mb-8 max-w-3xl text-lg text-muted-foreground md:text-xl",children:t.heroDescription}),r.jsxs("div",{className:"flex flex-wrap gap-4",children:[r.jsx(P,{size:"lg",asChild:!0,children:r.jsxs(Cr,{to:t.primaryCta.href,children:[t.primaryCta.label,r.jsx(Ya,{className:"ml-2 h-4 w-4"})]})}),r.jsx(P,{size:"lg",variant:"outline",asChild:!0,children:r.jsx(Cr,{to:"/pricing",children:"See pricing"})})]})]}),r.jsx(fe.div,{initial:{opacity:0,y:30}
1227,animate:{opacity:1,y:0},transition:{duration:.7,delay:.15},className:"mt-12 max-w-5xl",children:r.jsx("img",{src:t.heroImage,alt:`${t.name} in VIDAREO`,className:"w-full rounded-[1.75rem] shadow-[0_30px_80px_-40px_hsl(var(--foreground)/0.5)]",loading:"lazy"})})]})}),r.jsx("section",{className:"bg-muted/30 py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"mx-auto max-w-4xl",children:[r.jsxs("h2",{className:"mb-8 text-2xl font-extrabold text-foreground md:text-3xl",children:["What ",t.name," does"]}),r.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:t.whatItDoes.map(a=>r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10",children:r.jsx(nt,{className:"h-4 w-4 text-primary"})}),r.jsx("span",{className:"text-foreground",children:a})]},a))})]})})}),r.jsx("section",{className:"py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"mx-auto max-w-3xl",children:[r.jsxs("h2",{className:"mb-3 text-2xl font-extrabold text-foreground md:text-3xl",children:["How to use ",t.name]}),r.jsx("p",{className:"mb-10 text-muted-foreground",children:"Five steps from opening VIDAREO to sharing the result."}),r.jsx("ol",{className:"space-y-6",children:t.steps.map((a,i)=>r.jsxs(fe.li,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:i*.06},className:"flex gap-5 rounded-[1.5rem] bg-card p-6 shadow-[0_18px_50px_-34px_hsl(var(--foreground)/0.4)]",children:[r.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary text-base font-bold text-primary-foreground",children:i+1}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-1 text-lg font-bold text-foreground",children:a.title}),r.jsx("p",{className:"text-muted-foreground",children:a.description})]})]},a.title))})]})})}),r.jsx("section",{className:"bg-muted/30 py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs("h2",{className:"mb-10 text-center text-2xl font-extrabold text-foreground md:text-3xl",children:["Inside ",t.name]}),r.jsx("div",{className:"mx-auto grid max-w-5xl gap-6 md:grid-cols-2",children:t.features.map((a,i)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.45,delay:i*.07},className:"rounded-[1.5rem] bg-card p-6 shadow-[0_18px_50px_-34px_hsl(var(--foreground)/0.4)]",children:[r.jsx("h3",{className:"mb-2 text-lg font-bold text-foreground",children:a.title}),r.jsx("p",{className:"text-muted-foreground",children:a.description})]},a.title))})]})}),r.jsx("section",{className:"py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"mx-auto max-w-3xl",children:[r.jsx("h2",{className:"mb-8 text-2xl font-extrabold text-foreground md:text-3xl",children:"When to reach for it"}),r.jsx("ul",{className:"space-y-4",children:t.bestFor.map(a=>r.jsxs("li",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10",children:r.jsx(nt,{className:"h-4 w-4 text-primary"})}),r.jsx("span",{className:"text-foreground",children:a})]},a))})]})})}),r.jsx("section",{className:"bg-muted/30 py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"mx-auto max-w-3xl",children:[r.jsxs("h2",{className:"mb-8 text-center text-2xl font-extrabold text-foreground md:text-3xl",children:[t.name," questions"]}),r.jsx(u3,{type:"single",collapsible:!0,className:"w-full",children:t.faqs.map((a,i)=>r.jsxs(cc,{value:`item-${i}`,children:[r.jsx(dc,{className:"text-left text-base font-semibold",children:a.question}),r.jsx(uc,{className:"text-muted-foreground",children:a.answer})]},a.question))})]})})}),r.jsx("section",{className:"py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsx("h2",{className:"mb-8 text-center text-2xl font-extrabold text-foreground md:text-3xl",children:"Explore other products"}),r.jsx("div",{className:"mx-auto grid max-w-5xl gap-6 md:grid-cols-3",children:s.map(a=>{const i=a.icon;return r.jsxs(Cr,{to:`/products/${a.slug}`,className:"block h-full rounded-[1.5rem] bg-card p-6 shadow-[0_18px_50px_-34px_hsl(var(--foreground)/0.4)] transition-all duration-300 hover:-translate-y-1",children:[r.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10",children:r.jsx(i,{className:"h-6 w-6 text-primary"})}),r.jsx("h3",{className:"mb-2 text-lg font-bold text-foreground",children:a.name}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a.tagline})]},a.slug)})})]})}),r.jsx(uu,{})]}),r.jsx(Ka,{})]})},Crt=()=>{const{token:e}=eh(),[t]=iu(),n=t.get("autoplay")==="1",s=t.get("loop")==="1",a=t.get("muted")==="1",i=t.get("controls")==="0",[o,l]=h.useState(null),[c,d]=h.useState(!0),[u,m]=h.useState(null),[f,p]=h.useState(!1),x=h.useRef(null);o!=null&&o.ownerSubscriptionTier&&o.ownerSubscriptionTier,h.useEffect(()=>{e&&g()},[e]),h.useEffect(()=>{o&&n&&x.current&&(a&&(x.current.muted=!0),x.current.play().then(()=>{p(!0)}).catch(()=>{p(!1)}))}
1227,[o,n,a]);const g=async()=>{try{d(!0);const{data:b,error:w}=await F.functions.invoke("get-shared-video",{body:{shareToken:e,embedMode:!0}});if(w){console.error("Edge function error:",w),m("Failed to load video");return}if(b.error){m(b.error);return}if(b.requiresPassword){m("This video is password protected and cannot be embedded");return}l(b)}catch(b){console.error("Error fetching video:",b),m("Failed to load video")}finally{d(!1)}},v=async()=>{if(x.current)try{if(await x.current.play(),p(!0),o)try{await F.functions.invoke("notify-video-view",{body:{shareToken:e,videoTitle:o.video.title,viewerInfo:{timestamp:new Date().toISOString(),isEmbed:!0}}})}catch{}}catch{}};if(c)return r.jsx("div",{className:"w-full h-full min-h-[200px] bg-black flex items-center justify-center",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-white/60"})});if(u)return r.jsx("div",{className:"w-full h-full min-h-[200px] bg-black flex items-center justify-center p-4",children:r.jsxs("div",{className:"text-center text-white/60",children:[r.jsx(Im,{className:"w-8 h-8 mx-auto mb-2 opacity-60"}),r.jsx("p",{className:"text-sm",children:u})]})});if(!o)return null;const y=o.video.source_type==="youtube"&&o.video.external_video_id;return r.jsx("div",{className:"w-full h-full relative bg-black",children:y?r.jsx("iframe",{src:`https://www.youtube.com/embed/${o.video.external_video_id}?${n?"autoplay=1&":""}${s?`loop=1&playlist=${o.video.external_video_id}&`:""}${a?"mute=1&":""}${i?"controls=0&":""}`,title:o.video.title,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):r.jsxs(r.Fragment,{children:[r.jsx("video",{ref:b=>{if(x.current=b,b){const w=()=>{for(let S=0;S<b.textTracks.length;S++)b.textTracks[S].mode="disabled"};w(),b.textTracks.onchange=w,b.textTracks.onaddtrack=w}},src:o.video.video_url,poster:o.video.thumbnail_url||void 0,className:"w-full h-full object-contain",controls:!i&&f,loop:s,muted:a,playsInline:!0,disableRemotePlayback:!0,onPlay:()=>p(!0),onPause:()=>p(!1),onEnded:()=>{s||p(!1)}}),!f&&r.jsx("button",{onClick:v,className:"absolute inset-0 flex items-center justify-center bg-black/40 hover:bg-black/30 transition-colors cursor-pointer group",children:r.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 rounded-full bg-white/90 group-hover:bg-white flex items-center justify-center transition-colors shadow-lg",children:r.jsx(Js,{className:"w-7 h-7 sm:w-9 sm:h-9 text-black fill-black ml-1"})})})]})})},krt=()=>{const e=ja();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname);const t=document.title;document.title="Page Not Found (404) | VIDAREO";const n=document.querySelector('meta[name="description"]'),s=(n==null?void 0:n.getAttribute("content"))??null;n==null||n.setAttribute("content","The page you're looking for doesn't exist or has been moved. Return to VIDAREO to record and share personalized video messages.");const a=document.querySelector('meta[property="og:title"]'),i=(a==null?void 0:a.getAttribute("content"))??null;a==null||a.setAttribute("content","Page Not Found (404) | VIDAREO");const o=document.querySelector('meta[property="og:description"]'),l=(o==null?void 0:o.getAttribute("content"))??null;o==null||o.setAttribute("content","The page you're looking for doesn't exist or has been moved.");const c=document.querySelector('meta[property="og:url"]'),d=(c==null?void 0:c.getAttribute("content"))??null;c==null||c.setAttribute("content",window.location.href);let u=document.querySelector('meta[name="robots"]');const m=!u;return u||(u=document.createElement("meta"),u.setAttribute("name","robots"),document.head.appendChild(u)),u.setAttribute("content","noindex, follow"),()=>{document.title=t,s!==null&&(n==null||n.setAttribute("content",s)),i!==null&&(a==null||a.setAttribute("content",i)),l!==null&&(o==null||o.setAttribute("content",l)),d!==null&&(c==null||c.setAttribute("content",d)),m?u==null||u.remove():u==null||u.setAttribute("content","index, follow")}},[e.pathname]),r.jsx("main",{className:"flex min-h-screen items-center justify-center bg-background",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h1",{className:"mb-4 text-4xl font-bold text-foreground",children:"404"}),r.jsx("p",{className:"mb-4 text-xl text-foreground",children:"Oops! Page not found"}),r.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Ert=[{key:"vidareo",name:"VIDAREO",highlight:!0}
1227,{key:"loom",name:"Loom"},{key:"bonjoro",name:"Bonjoro"},{key:"vidyard",name:"Vidyard"},{key:"bombbomb",name:"BombBomb"}],Art=[{name:"Free Plan Available",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!1},{name:"Paid Plans Under $25/mo",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!1,bombbomb:!1},{name:"Screen + Webcam Recording",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Built-in Teleprompter",vidareo:!0,loom:!1,bonjoro:!1,vidyard:!1,bombbomb:!1},{name:"HD 1080p Quality",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Real-time View Notifications",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Video Reactions & Replies",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!1},{name:"Custom Branding",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"No Watermark (Paid)",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Transcription & Captions",vidareo:!0,loom:!0,bonjoro:!1,vidyard:!0,bombbomb:!0},{name:"Built-in Video Meetings",vidareo:!0,loom:!1,bonjoro:!1,vidyard:!1,bombbomb:!1},{name:"Bulk Personalized Email Send",vidareo:!0,loom:!1,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Chrome Extension Recorder",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Team Plans & Seat Management",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0},{name:"Team Plans Under $20/seat",vidareo:!0,loom:!0,bonjoro:!1,vidyard:!1,bombbomb:!1},{name:"Mobile App",vidareo:!0,loom:!0,bonjoro:!0,vidyard:!0,bombbomb:!0}],Trt=[{icon:dw,title:"Most Affordable",description:"Premium plans from $19.95/mo and team seats under $20.00 - a fraction of Vidyard ($59.00+/seat) or BombBomb ($36.00/mo)."},{icon:gue,title:"All-in-One Platform",description:"Recording, video meetings, bulk personalized email, and analytics - no need to stitch together separate tools."},{icon:V4,title:"Built for Connection",description:"A built-in teleprompter, video reactions, and reply threads together in one workspace - no extra tools required."}],Ny=({available:e,isVidareo:t})=>e?r.jsx(fe.div,{initial:{scale:0,opacity:0},whileInView:{scale:1,opacity:1},viewport:{once:!0},transition:{type:"spring",stiffness:500,damping:25},className:`w-6 h-6 rounded-full flex items-center justify-center mx-auto ${t?"bg-gradient-to-br from-primary to-blue-600 shadow-md shadow-primary/30":"bg-emerald-500/20"}`,children:r.jsx(nt,{className:`w-3.5 h-3.5 ${t?"text-primary-foreground":"text-emerald-600"}`})}):r.jsx(fe.div,{initial:{scale:0,opacity:0},whileInView:{scale:1,opacity:1},viewport:{once:!0},transition:{type:"spring",stiffness:500,damping:25},className:"w-6 h-6 rounded-full bg-muted flex items-center justify-center mx-auto",children:r.jsx(zt,{className:"w-3.5 h-3.5 text-muted-foreground"})}),Rrt=()=>r.jsx("section",{className:"py-16 md:py-24 bg-gradient-to-b from-background to-muted/30 overflow-hidden",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"text-center mb-12",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-4",children:[r.jsx(_n,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"text-sm font-medium text-primary",children:"How We Compare"})]}),r.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4",children:["VIDAREO vs. ",r.jsx("span",{className:"text-gradient",children:"The Competition"})]}),r.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto",children:"See how VIDAREO stacks up against Loom, Bonjoro, Vidyard, and BombBomb."})]}),r.jsxs(fe.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.15},className:"max-w-6xl mx-auto",children:[r.jsx("div",{className:"bg-card rounded-2xl border border-border shadow-xl overflow-x-auto",children:r.jsxs("div",{className:"min-w-[720px]",children:[r.jsxs("div",{className:"grid grid-cols-6 gap-2 p-4 bg-muted/50 border-b border-border",children:[r.jsx("div",{className:"col-span-1 flex items-end",children:r.jsx("span",{className:"text-sm font-semibold text-muted-foreground",children:"Features"})}),Ert.map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,y:-10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.05*t},className:"flex flex-col items-center justify-end gap-1.5",children:[e.highlight?r.jsx(fe.span,{initial:{scale:0},whileInView:{scale:1},viewport:{once:!0},transition:{type:"spring",delay:.3},className:"text-[10px] font-bold bg-gradient-to-r from-primary to-blue-600 text-primary-foreground px-2 py-0.5 rounded-full whitespace-nowrap shadow-lg",children:"Best Value"}):null,r.jsx("span",{className:`text-sm font-bold ${e.highlight?"text-primary":"text-foreground"}`,children:e.name})]},e.key))]}),r.jsx("div",{className:"divide-y divide-border",children:Art.map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{delay:.02*t},className:`grid grid-cols-6 gap-2 p-4 items-center transition-colors hover:bg-muted/30 ${t%2===0?"bg-background":"bg-muted/10"}`,children:[r.jsx("div",{className:"col-span-1",children:r.jsx("span",{className:"text-sm text-foreground font-medium",children:e.name})}),r.jsx("div",{children:r.jsx(Ny,{available:e.vidareo,isVidareo:!0})}),r.jsx("div",{children:r.jsx(Ny,{available:e.loom,isVidareo:!1})}),r.jsx("div",{children:r.jsx(Ny,{available:e.bonjoro,isVidareo:!1})}),r.jsx("div",{children:r.jsx(Ny,{available:e.vidyard,isVidareo:!1})}),r.jsx("div",{children:r.jsx(Ny,{available:e.bombbomb,isVidareo:!1})})]},e.name))})]})}),r.jsx("p",{className:"text-center text-xs text-muted-foreground mt-3 md:hidden",children:"← Scroll horizontally to compare all platforms →"})]}),r.jsxs(fe.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"max-w-6xl mx-auto mt-12",children:[r.jsx("h3",{className:"text-2xl md:text-3xl font-bold text-foreground text-center mb-8",children:"Why VIDAREO Wins"}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:Trt.map((e,t)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.1*t},className:"bg-card border border-border rounded-2xl p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:r.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),r.jsx("h4",{className:"text-lg font-bold text-foreground mb-2",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]},e.title))})]})]})}),Ort={"@context":"https://schema.org","@type":"Organization",name:"VIDAREO",url:"https://vidareo.com",logo:"https://vidareo.com/vidareo-logo-large.png",description:"VIDAREO - Video Inbox Delivery and Relationship Engagement Optimization. A personalized video messaging platform that builds lasting connections.",sameAs:["https://www.instagram.com/vidareo.app/","https://www.linkedin.com/company/vidareo"],foundingDate:"2025",slogan:"Video That Builds Lasting Connections"},Prt=[{letter:"V",word:"Video",icon:cr,bgColor:"bg-red-500/10",borderColor:"border-red-500/20",color:"text-red-500",description:"Personalized video messages that stand out in crowded inboxes"},{letter:"I",word:"Inbox",icon:KH,bgColor:"bg-orange-500/10",borderColor:"border-orange-500/20",color:"text-orange-500",description:"Direct delivery straight to your recipient's email or text"}
1227,{letter:"D",word:"Delivery",icon:Es,bgColor:"bg-amber-500/10",borderColor:"border-amber-500/20",color:"text-amber-500",description:"Seamless sharing across any platform or device"},{letter:"A",word:"And",icon:_n,bgColor:"bg-emerald-500/10",borderColor:"border-emerald-500/20",color:"text-emerald-500",description:"Connecting all the pieces for maximum impact"},{letter:"R",word:"Relationship",icon:V4,bgColor:"bg-blue-500/10",borderColor:"border-blue-500/20",color:"text-blue-500",description:"Building genuine human connections that convert"},{letter:"E",word:"Engagement",icon:Po,bgColor:"bg-sky-500/10",borderColor:"border-sky-500/20",color:"text-sky-500",description:"Driving meaningful interactions and responses"},{letter:"O",word:"Optimization",icon:JH,bgColor:"bg-cyan-500/10",borderColor:"border-cyan-500/20",color:"text-cyan-500",description:"Analytics and insights to improve every message"}],Drt=[{icon:jr,title:"Human Connection",description:"We believe authentic video creates deeper relationships than text ever could."},{icon:ya,title:"Simplicity First",description:"Complex technology should feel effortless. Record, share, done."},{icon:wr,title:"Transparency",description:"Real-time analytics so you always know when and how your videos are watched."},{icon:mi,title:"Trust & Privacy",description:"Your videos and data are protected with enterprise-grade security."}],QE={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},Kj={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.5}}},Mrt={hidden:{opacity:0,scale:.5,rotateY:-90},visible:e=>({opacity:1,scale:1,rotateY:0,transition:{duration:.6,delay:e*.1}})},Irt=()=>(h.useEffect(()=>{window.scrollTo(0,0),document.title="About VIDAREO: The Team Behind Personal Video";const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content","Learn about VIDAREO - Video Inbox Delivery And Relationship Engagement Optimization - and our mission to power authentic video relationships.");const t=document.querySelector('meta[property="og:title"]');t&&t.setAttribute("content","About VIDAREO: The Team Behind Personal Video");const n=document.querySelector('meta[property="og:description"]');n&&n.setAttribute("content","Learn about VIDAREO - Video Inbox Delivery And Relationship Engagement Optimization - and our mission to power authentic video relationships.");const s=document.querySelector('meta[property="og:url"]');s&&s.setAttribute("content",window.location.href);const a=document.querySelector('meta[property="og:image"]');a&&a.setAttribute("content","https://vidareo.com/og-about.png");const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","About VIDAREO: The Team Behind Personal Video");const o=document.querySelector('meta[name="twitter:description"]');o&&o.setAttribute("content","Learn about VIDAREO - Video Inbox Delivery And Relationship Engagement Optimization - and our mission to power authentic video relationships.");const l=document.querySelector('meta[name="twitter:image"]');if(l&&l.setAttribute("content","https://vidareo.com/og-about.png"),!document.querySelector("script[data-about-jsonld]")){const d=document.createElement("script");d.type="application/ld+json",d.setAttribute("data-about-jsonld","true"),d.textContent=JSON.stringify(Ort),document.head.appendChild(d)}return()=>{const d=document.querySelector("script[data-about-jsonld]");d&&d.remove(),t&&t.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),n&&n.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),s&&s.setAttribute("content","https://vidareo.com"),a&&a.setAttribute("content","https://vidareo.com/og-image.png"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),l&&l.setAttribute("content","https://vidareo.com/og-image.png")}},[]),r.jsxs("div",{className:"min-h-screen",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"About VIDAREO",subtitle:"Video That Builds Lasting Connections",imageSrc:"https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=1920&h=600&fit=crop"}),r.jsx("section",{className:"py-12 md:py-16",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(fe.div,{className:"text-center mb-8",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},children:[r.jsxs("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold text-foreground mb-2",children:["What Does ",r.jsx("span",{className:"text-gradient",children:"VIDAREO"})," Stand For?"]}),r.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto",children:"Our name embodies our mission to transform how people communicate through video."})]}),r.jsxs("div",{className:"max-w-6xl mx-auto",children:[r.jsx(fe.div,{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 md:gap-4",variants:QE,initial:"hidden",
1227whileInView:"visible",viewport:{once:!0},children:Prt.map((e,t)=>r.jsx(fe.div,{variants:Kj,whileHover:{y:-4},transition:{type:"spring",stiffness:300},children:r.jsx(Ie,{className:`h-full border ${e.borderColor} ${e.bgColor} hover:shadow-lg transition-all duration-300`,children:r.jsxs(lt,{className:"p-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx(fe.div,{className:`w-10 h-10 rounded-lg ${e.bgColor} border ${e.borderColor} flex items-center justify-center flex-shrink-0 shadow-sm`,custom:t,variants:Mrt,children:r.jsx("span",{className:`text-lg font-black ${e.color}`,children:e.letter})}),r.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r.jsx(e.icon,{className:`w-4 h-4 ${e.color} flex-shrink-0`}),r.jsx("h3",{className:"text-sm md:text-base font-bold text-foreground truncate",children:e.word})]})]}),r.jsx("p",{className:"text-muted-foreground text-xs md:text-sm leading-snug",children:e.description})]})})},e.letter))}),r.jsx(fe.div,{className:"mt-8 text-center",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.3},children:r.jsx(Ie,{className:"bg-gradient-to-r from-primary/10 via-accent/10 to-primary/10 border-primary/20 shadow-md overflow-hidden relative",children:r.jsx(lt,{className:"p-4 md:p-6 relative",children:r.jsxs("p",{className:"text-sm md:text-lg lg:text-xl font-bold text-foreground",children:[r.jsx("span",{className:"text-red-500",children:"V"}),"ideo"," ",r.jsx("span",{className:"text-orange-500",children:"I"}),"nbox"," ",r.jsx("span",{className:"text-amber-500",children:"D"}),"elivery"," ",r.jsx("span",{className:"text-emerald-500",children:"A"}),"nd"," ",r.jsx("span",{className:"text-blue-500",children:"R"}),"elationship"," ",r.jsx("span",{className:"text-sky-500",children:"E"}),"ngagement"," ",r.jsx("span",{className:"text-cyan-500",children:"O"}),"ptimization"]})})})})]})]})}),r.jsxs("section",{className:"py-20 md:py-32 bg-muted/30 relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-primary/3 rounded-full blur-3xl"})}),r.jsx("div",{className:"container mx-auto px-4 relative z-10",children:r.jsx("div",{className:"max-w-5xl mx-auto",children:r.jsxs(fe.div,{className:"grid md:grid-cols-2 gap-8 md:gap-16",variants:QE,initial:"hidden",whileInView:"visible",viewport:{once:!0},children:[r.jsx(fe.div,{variants:Kj,children:r.jsx(Ie,{className:"h-full bg-background/80 backdrop-blur-sm border-2 hover:border-primary/30 transition-colors",children:r.jsxs(lt,{className:"p-8",children:[r.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mb-6",children:r.jsx(JH,{className:"w-7 h-7 text-primary"})}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-4",children:"Our Mission"}),r.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"We believe every message deserves to be personal. In a world of endless emails and texts, VIDAREO empowers you to stand out with authentic video communication that builds trust and drives results."})]})})}),r.jsx(fe.div,{variants:Kj,children:r.jsx(Ie,{className:"h-full bg-background/80 backdrop-blur-sm border-2 hover:border-accent/30 transition-colors",children:r.jsxs(lt,{className:"p-8",children:[r.jsx("div",{className:"w-14 h-14 rounded-2xl bg-accent/10 flex items-center justify-center mb-6",children:r.jsx(k_,{className:"w-7 h-7 text-accent"})}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-4",children:"Our Vision"}),r.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"We're creating a future where video messaging is as simple as sending a text, but infinitely more powerful. Whether you're closing deals, supporting customers, or connecting with your team-VIDAREO makes it personal."})]})})})]})})})]}),r.jsx("section",{className:"py-20 md:py-32",children:r.jsxs("div",{className:"container mx-auto px-4",children:[r.jsxs(fe.div,{className:"text-center mb-16",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:"What We Stand For"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Our core values guide everything we build"})]}),r.jsx(fe.div,{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",variants:QE,initial:"hidden",
1227whileInView:"visible",viewport:{once:!0},children:Drt.map((e,t)=>r.jsx(fe.div,{variants:Kj,children:r.jsx(Ie,{className:"h-full text-center hover:shadow-xl transition-all duration-300 group hover:-translate-y-1",children:r.jsxs(lt,{className:"p-6",children:[r.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4 group-hover:bg-primary/20 transition-colors",children:r.jsx(e.icon,{className:"w-7 h-7 text-primary"})}),r.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:e.title}),r.jsx("p",{className:"text-muted-foreground text-sm",children:e.description})]})})},e.title))})]})}),r.jsx(Rrt,{}),r.jsx("section",{className:"py-20 md:py-32 bg-gradient-to-b from-background to-primary/5",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs(fe.div,{className:"text-center max-w-3xl mx-auto",initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[r.jsx("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-6",children:"Ready to Build Lasting Connections?"}),r.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-10",children:"Join thousands of professionals who use VIDAREO to create meaningful video messages that get results."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsx(P,{asChild:!0,size:"lg",className:"gap-2 px-8 py-6 text-lg shadow-lg hover:shadow-xl transition-shadow",children:r.jsxs(Cr,{to:"/auth",children:["Get Started Free",r.jsx(Ya,{className:"w-5 h-5"})]})}),r.jsx(P,{asChild:!0,variant:"outline",size:"lg",className:"px-8 py-6 text-lg",children:r.jsx(Cr,{to:"/contact",children:"Contact Us"})})]})]})})})]}),r.jsx(Ka,{})]})),Lrt=()=>{const e=Sr();return h.useEffect(()=>{window.scrollTo(0,0),document.title="Accessibility | VIDAREO - Inclusive Video Messaging";const t=document.querySelector('meta[name="description"]');t&&t.setAttribute("content","VIDAREO is committed to digital accessibility. Learn about our WCAG 2.1 AA compliance goals, accessibility features, and how to report issues.");const n=document.querySelector('meta[property="og:title"]');n&&n.setAttribute("content","Accessibility | VIDAREO - Inclusive Video Messaging");const s=document.querySelector('meta[property="og:description"]');s&&s.setAttribute("content","VIDAREO is committed to digital accessibility. Learn about our WCAG 2.1 AA compliance goals, accessibility features, and how to report issues.");const a=document.querySelector('meta[property="og:url"]');a&&a.setAttribute("content",window.location.href);const i=document.querySelector('meta[name="twitter:title"]');i&&i.setAttribute("content","Accessibility | VIDAREO - Inclusive Video Messaging");const o=document.querySelector('meta[name="twitter:description"]');return o&&o.setAttribute("content","VIDAREO is committed to digital accessibility. Learn about our WCAG 2.1 AA compliance goals, accessibility features, and how to report issues."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams",n&&n.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),s&&s.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video"),a&&a.setAttribute("content","https://vidareo.com"),i&&i.setAttribute("content","VIDAREO | Screen Recorder with Teleprompter for Sales Teams"),o&&o.setAttribute("content","Record, share, and connect with personalized video messages. VIDAREO makes it easy to build authentic relationships through video")}},[]),r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsx("div",{className:"pt-14 sm:pt-16 lg:pt-20",children:r.jsx(wl,{title:"Accessibility Statement",subtitle:"Last updated: June 3, 2026",imageSrc:"https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1920&h=600&fit=crop"})}),r.jsxs("main",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[r.jsxs("div",{className:"prose prose-lg dark:prose-invert max-w-none space-y-8",children:[r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Our C
1227ommitment"}),r.jsx("p",{className:"text-muted-foreground",children:"Summit 23 LLC dba VIDAREO is committed to ensuring digital accessibility for people of all abilities. We are continually improving the user experience for everyone and applying the relevant accessibility standards to ensure we provide equal access to all users."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Conformance Goals"}),r.jsx("p",{className:"text-muted-foreground",children:"We aim to conform to the Web Content Accessibility Guidelines (WCAG) 2.1 at Level AA. These guidelines explain how to make web content more accessible to people with a wide range of disabilities, including visual, auditory, physical, speech, cognitive, language, learning, and neurological disabilities."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Accessibility Features"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"VIDAREO incorporates the following accessibility features:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Keyboard Navigation:"})," All interactive elements are accessible via keyboard, including recording controls, video players, and form fields"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Screen Reader Support:"})," We use semantic HTML, ARIA labels, and roles to support assistive technologies"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Color Contrast:"})," We maintain sufficient color contrast ratios between text and backgrounds to meet WCAG AA requirements"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Responsive Design:"})," Our platform is fully responsive and works across desktop, tablet, and mobile devices"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Focus Indicators:"})," Visible focus indicators help keyboard users navigate the interface"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Text Alternatives:"})," Images and non-text elements include descriptive alt text"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Transcription:"})," AI-powered video transcription provides text alternatives for video content"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Resizable Text:"})," Content is readable and functional when text is resized up to 200%"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Consistent Navigation:"})," Navigation patterns are consistent throughout the platform"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Error Identification:"})," Form errors are clearly identified and described to the user"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Reduced Motion Support:"})," Animations respect the ",r.jsx("code",{children:"prefers-reduced-motion"})," system setting for users sensitive to motion"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Light and Dark Themes:"})," A theme toggle is available to support users with light sensitivity, low vision, or specific contrast preferences"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Pre-Join Lobby:"})," Device selection and preview controls are fully keyboard and screen-reader accessible before entering a call"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Video Editor:"})," Timeline and editing controls support keyboard shortcuts and are labeled for assistive technology"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Meeting Scheduling:"})," Scheduling forms, recurring meeting controls, and calendar invite generation include proper labels and focus management"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Email Management:"})," Bulk composition and contact selection interfaces support keyboard navigation and screen-reader announcement of selection state"]})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Known Limitations"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"While we strive for comprehensive accessibility, some areas of our platform may have limitations:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Live video calls rely on browser-native WebRTC controls that may have varying levels of accessibility support across browsers"}),r.jsx("li",{children:"Some third-party integrations (e.g., payment processing) may have their own accessibility characteristics"}),r.jsx("li",{children:"Screen recording features require browser permissions that may interact differently with assistive technologies"}),r.jsx("li",{children:"AI-generated transcriptions may not be 100% accurate, particularly for specialized terminology"})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We are actively working to address these limitations and improve accessibility across all features."})]}),r.jsxs("section",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6",children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"Feedback & Contact"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"We welcome your feedback on the accessibility of VIDAREO. If you encounter accessibility barriers or have suggestions for improvement, please contact us:"}),r.jsxs("ul",{className:"list-none pl-0 text-muted-foreground space-y-2",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Email:"})," [email protected]"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"General Support:"})," [email protected]"]})]}),r.jsx("p",{className:"text-muted-foreground mt-4",children:"We aim to respond to accessibility feedback within 5 business days and to resolve accessibility issues within a reasonable timeframe."})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Ongoing Efforts"}),r.jsx("p",{className:"text-muted-foreground",children:"Our commitment to accessibility is ongoing. We regularly:"}),r.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[r.jsx("li",{children:"Conduct accessibility audits of new and existing features"}),r.jsx("li",{children:"Include accessibility considerations in our design and development process"}),r.jsx("li",{children:"Train our team on accessibility best practices"}),r.jsx("li",{children:"Monitor and respond to user accessibility feedback"}),r.jsx("li",{children:"Stay current with evolving accessibility standards and guidelines"})]})]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx(P,{onClick:()=>e("/"),variant:"outline",children:"Return to Home"})})]}),r.jsx(Ka,{})]})},$rt=Pae({name:Bl().trim().min(1,"Name is required").max(100,"Name must be less than 100 characters"),email:Bl().trim().email("Please enter the email address on your VIDAREO account").max(255,"Email must be less than 255 characters"),reason:Bl().trim().max(1e3,"Please keep this under 1000 characters").optional(),confirm:fet(!0,{errorMap:()=>({message:"You must confirm you understand this is permanent"})})}),Vrt=()=>{const[e,t]=h.useState(!1),[n,s]=h.useState(!1);h.useEffect(()=>{window.scrollTo(0,0),document.title="Delete Your Account | VIDAREO";const f=document.querySelector('meta[name="description"]');
1227return f&&f.setAttribute("content","Request permanent deletion of your VIDAREO account and associated data. Learn what gets deleted, what is retained, and how to submit a request."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams"}},[]);const{register:a,handleSubmit:i,reset:o,setValue:l,watch:c,formState:{errors:d}}=Xae({resolver:Qae($rt)}),u=c("confirm"),m=async f=>{t(!0);try{const{error:p}=await F.functions.invoke("send-contact-email",{body:{name:f.name,email:f.email,subject:"account_deletion_request",message:`ACCOUNT DELETION REQUEST
1228
1229Account email: ${f.email}
1230Name: ${f.name}
1231
1232Reason (optional):
1233${f.reason||"(not provided)"}
1234
1235Submitted from /delete-account`}});if(p)throw p;s(!0),o(),Rt({title:"Request received",description:"We'll email you within 72 hours to verify and process your deletion request."})}catch(p){console.error("Delete account request error:",p),Rt({title:"Couldn't submit your request",description:"Please try again, or email [email protected] directly with the subject line 'Account Deletion Request'.",variant:"destructive"})}finally{t(!1)}};return r.jsxs("div",{className:"min-h-screen",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-14 sm:pt-16 lg:pt-20",children:[r.jsx(wl,{title:"Delete Your Account",subtitle:"Request permanent deletion of your VIDAREO account and associated data.",imageSrc:"https://images.unsplash.com/photo-1521737604893-d14cc237f11d?w=1920&h=600&fit=crop"}),r.jsx("div",{className:"container mx-auto px-4 py-12 md:py-16",children:r.jsxs("div",{className:"max-w-4xl mx-auto space-y-10",children:[r.jsxs(fe.section,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.5},className:"bg-card rounded-2xl p-6 md:p-8 border border-border/50",children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"How to delete your account"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"You can delete your account in two ways. Both result in permanent deletion of your account and associated data."}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"rounded-xl border border-border/60 p-5",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:r.jsx(Hue,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Option 1: In-app (fastest)"}),r.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1 list-decimal list-inside",children:[r.jsx("li",{children:"Sign in to your VIDAREO account"}),r.jsxs("li",{children:["Go to"," ",r.jsx(Cr,{to:"/settings",className:"text-primary hover:underline",children:"Settings"})," ","→ Account"]}),r.jsx("li",{children:'Scroll to "Delete Account"'}),r.jsx("li",{children:"Confirm to permanently delete"})]}),r.jsx(P,{asChild:!0,variant:"outline",size:"sm",className:"mt-4",children:r.jsx(Cr,{to:"/settings",children:"Go to Settings"})})]}),r.jsxs("div",{className:"rounded-xl border border-border/60 p-5",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-destructive/10 flex items-center justify-center mb-4",children:r.jsx(Xr,{className:"w-5 h-5 text-destructive"})}),r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Option 2: Request deletion below"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"If you can't access your account, use the secure form below. We'll verify your identity by emailing the address on file before we process the deletion, usually within 72 hours."})]})]})]}),r.jsxs(fe.section,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.5,delay:.05},className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"bg-card rounded-2xl p-6 border border-border/50",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(iue,{className:"w-5 h-5 text-primary"}),r.jsx("h3",{className:"font-semibold text-foreground",children:"What gets deleted"})]}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 list-disc list-inside",children:[r.jsx("li",{children:"Your profile, name, avatar, and account email"}),r.jsx("li",{children:"All recorded and uploaded videos, audio, and thumbnails"}
1235),r.jsx("li",{children:"Share links, view analytics, and reactions tied to you"}),r.jsx("li",{children:"Contacts, teleprompter scripts, and email templates"}),r.jsx("li",{children:"Team memberships you own (team seats are released)"}),r.jsx("li",{children:"Authentication credentials and active sessions"})]})]}),r.jsxs("div",{className:"bg-card rounded-2xl p-6 border border-border/50",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(fr,{className:"w-5 h-5 text-primary"}),r.jsx("h3",{className:"font-semibold text-foreground",children:"What is retained (and why)"})]}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 list-disc list-inside",children:[r.jsx("li",{children:"Billing and tax records required by law - retained up to 7 years by our payment processor (Stripe)"}),r.jsx("li",{children:"Anonymized, aggregated usage metrics that cannot identify you"}),r.jsx("li",{children:"Abuse/security logs when required to protect the service - retained up to 90 days"})]})]})]}),r.jsxs(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"rounded-2xl border border-destructive/30 bg-destructive/5 p-5 flex gap-4",children:[r.jsx(wa,{className:"w-5 h-5 text-destructive flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-foreground",children:[r.jsx("strong",{className:"font-semibold",children:"Account deletion is permanent."})," ","Once processed, your videos, share links, and account data cannot be recovered. Active paid subscriptions are canceled and any unused time is refunded on a pro-rata basis per our"," ",r.jsx(Cr,{to:"/terms",className:"text-primary hover:underline",children:"Terms"}),"."]})]}),r.jsxs(fe.section,{id:"request-form",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.5,delay:.15},className:"bg-card rounded-2xl p-6 md:p-8 border border-border/50",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx(rp,{className:"w-5 h-5 text-primary"}),r.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Request account deletion"})]}),r.jsx("p",{className:"text-muted-foreground mb-6 text-sm",children:"Submitted requests are verified by email before deletion is processed. Requests are transmitted over HTTPS and stored securely."}),n?r.jsxs("div",{className:"rounded-xl border border-primary/30 bg-primary/5 p-6 text-center",children:[r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Request received"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Check your inbox - we'll email the address you provided within 72 hours to verify and complete your deletion request."}),r.jsx(P,{variant:"outline",onClick:()=>s(!1),children:"Submit another request"})]}):r.jsxs("form",{onSubmit:i(m),className:"space-y-6",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"name",children:"Full name"}),r.jsx(He,{id:"name",placeholder:"Your name",...a("name"),className:d.name?"border-destructive":""}),d.name&&r.jsx("p",{className:"text-sm text-destructive",children:d.name.message})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Account email"}),r.jsx(He,{id:"email",type:"email",placeholder:"[email protected]",...a("email"),className:d.email?"border-destructive":""}),d.email&&r.jsx("p",{className:"text-sm text-destructive",children:d.email.message})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"reason",children:"Reason (optional)"}),r.jsx($s,{id:"reason",placeholder:"Help us improve - why are you leaving?",rows:4,...a("reason"),className:d.reason?"border-destructive":""}),d.reason&&r.jsx("p",{className:"text-sm text-destructive",children:d.reason.message})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border/60 p-4",children:[r.jsx(ci,{id:"confirm",checked:!!u,onCheckedChange:f=>{f===!0?l("confirm",!0,{shouldValidate:!0}):l("confirm",void 0,{shouldValidate:!0})}}),r.jsx(ye,{htmlFor:"confirm",className:"text-sm text-foreground leading-relaxed cursor-pointer",children:"I understand this request will permanently delete my VIDAREO account and all associated data listed above, and that this action cannot be undone."})]}),d.confirm&&r.jsx("p",{className:"text-sm text-destructive -mt-4",children:d.confirm.message}),r.jsx(P,{type:"submit",size:"lg",variant:"destructive",className:"w-full sm:w-auto",disabled:e,children:e?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"w-4 h-4 mr-2"}
1235),"Submit deletion request"]})}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Prefer email? Write to"," ",r.jsx("a",{href:"mailto:[email protected]?subject=Account%20Deletion%20Request",className:"text-primary hover:underline",children:"[email protected]"})," ",'from the address on your account with the subject "Account Deletion Request".']})]})]}),r.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["See our"," ",r.jsx(Cr,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"})," ","for full details on how we handle your data."]})]})})]}),r.jsx(Ka,{})]})},Urt=["small-promo-tile-440x280.png","large-promo-tile-920x680.png","marquee-promo-tile-1400x560.png","screenshot-1-recording-controls.png","screenshot-2-recording-in-progress.png","screenshot-3-crop-to-region.png","screenshot-4-post-recording.png","screenshot-5-install-page.png"],JE=[{index:0,name:"Small Promo Tile",dimensions:"440×280",required:!0},{index:1,name:"Large Promo Tile",dimensions:"920×680",required:!1},{index:2,name:"Marquee Promo Tile",dimensions:"1400×560",required:!1},{index:3,name:"Screenshot: Recording Controls",dimensions:"1280×800",required:!0},{index:4,name:"Screenshot: Recording in Progress",dimensions:"1280×800",required:!0},{index:5,name:"Screenshot: Crop to Region",dimensions:"1280×800",required:!0},{index:6,name:"Screenshot: Post-Recording",dimensions:"1280×800",required:!1},{index:7,name:"Screenshot: Install Page",dimensions:"1280×800",required:!1}],Frt=()=>{const{user:e}=nr(),{isAdmin:t}=sp(),{toast:n}=Gr(),[s,a]=h.useState(null),[i,o]=h.useState([]),[l,c]=h.useState(null);if(h.useEffect(()=>{if(!e||!t)return;(async()=>{const{data:v}=await F.storage.from("store-assets").list();if(!v)return;const y=v.map(w=>w.name),b=[];Urt.forEach((w,S)=>{if(y.includes(w)){const{data:j}=F.storage.from("store-assets").getPublicUrl(w);b.push({name:JE[S].name,url:j.publicUrl+"?t="+Date.now(),dimensions:JE[S].dimensions})}}),b.length>0&&o(b)})()},[e,t]),!e||!t)return r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:r.jsx("p",{className:"text-muted-foreground",children:"Admin access required."})});const d=async g=>{a(g!==void 0?g:"all");try{const{data:v,error:y}=await F.functions.invoke("generate-store-assets",{body:{assetIndex:g}});if(y)throw y;if(v!=null&&v.results){o(S=>{const j=[...S];for(const N of v.results){const _=j.findIndex(C=>C.name===N.name);_>=0?j[_]=N:j.push(N)}return j});const b=v.results.filter(S=>S.url).length,w=v.results.filter(S=>S.error).length;n({title:"Generation complete",description:`${b} generated${w?`, ${w} failed`:""}`})}}catch(v){n({title:"Generation failed",description:v instanceof Error?v.message:"Unknown error",variant:"destructive"})}finally{a(null)}},u=g=>i.find(v=>v.name===g),m=async g=>{await navigator.clipboard.writeText(g),c(g),setTimeout(()=>c(null),2e3)},f=`VIDAREO - Screen Recorder & Video Messaging for Chrome
1236
1237Record your screen and share personalized video messages - all from your browser.
1238
1239KEY FEATURES
1240
1241⬥ Screen Recording
1242Capture any tab, window, or your entire screen for clean demos and walkthroughs.
1243
1244⬥ Crop to Region
1245Don't record your entire screen. Draw a rectangle over the exact area you want to capture - only that region is recorded. No editing needed.
1246
1247⬥ Persistent Controls
1248Recording controls follow you across every tab. Pause, resume, or stop from anywhere without losing your place.
1249
1250⬥ Tab Audio Capture
1251Record system audio from the tab you're sharing for complete product walkthroughs and tutorials.
1252
1253⬥ One-Click Save & Share
1254Finish recording and instantly get a shareable VIDAREO link. Your video is saved to your library automatically.
1255
1256⬥ Watermark Control
1257Add your branding with customizable watermark position and opacity.
1258
1259PERFECT FOR
1260• Sales teams sending personalized outreach
1261• Customer success teams creating walkthroughs
1262• Product managers recording bug reports
1263• Educators creating tutorials
1264• Anyone who wants to replace long emails with quick videos
1265
1266HOW IT WORKS
12671. Click the VIDAREO icon in your toolbar
12682. Choose Screen or Camera mode
12693. Select what to share and hit record
12704. Review, save, and share your video link
1271
1272Free to use with any VIDAREO account. Sign up at vidareo.com.`,p="Record your screen or camera, crop to region, and share video messages instantly. Free with VIDAREO.",x=[{permission:"offscreen",justification:"Required to capture screen, window, or tab media using the MediaRecorder API inside an offscreen document, since the MV3 service worker cannot directly access getDisplayMedia or getUserMedia."},{permission:"storage",justification:"Stores the user's authentication tokens, recording preferences (microphone, camera, watermark, quality), and selected input devices locally s
1272o settings persist and the user stays signed in between sessions."},{permission:"activeTab",justification:"Used to attach the floating Picture-in-Picture camera bubble to the user's current tab when they start a recording, so they can see and reposition their camera while presenting. Activated only by the user clicking the extension."},{permission:"system.display",justification:"Used to detect screen dimensions, scale factor, and DPI so the recording canvas is sized correctly for the user's monitor, ensuring crisp, undistorted output on multi-monitor and high-DPI setups."},{permission:"host_permissions (<all_urls>)",justification:"The floating Picture-in-Picture camera overlay must be displayable on top of any tab the user chooses to record, regardless of domain. The extension does not read, collect, or transmit page content or browsing data."}];return r.jsxs("main",{className:"min-h-screen pb-16 md:pb-0",children:[r.jsx(pn,{}),r.jsx("div",{className:"pt-16 md:pt-24",children:r.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-6xl",children:[r.jsxs("div",{className:"flex items-center justify-between mb-8",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Chrome Web Store Assets"}),r.jsx("p",{className:"text-muted-foreground mt-1",children:"Generate and download promotional images for the extension listing."})]}),r.jsxs(P,{onClick:()=>d(),disabled:s!==null,className:"gap-2",children:[s==="all"?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(vs,{className:"w-4 h-4"}),"Generate All"]})]}),r.jsx("div",{className:"grid md:grid-cols-2 gap-6 mb-12",children:JE.map(g=>{const v=u(g.name);return r.jsxs(Ie,{children:[r.jsx(Ot,{className:"pb-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx($t,{className:"text-base",children:g.name}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Se,{variant:g.required?"default":"secondary",children:g.required?"Required":"Optional"}),r.jsx(Se,{variant:"outline",children:g.dimensions})]})]})}),r.jsx(lt,{children:v!=null&&v.url?r.jsxs("div",{className:"space-y-3",children:[r.jsx("img",{src:v.url,alt:g.name,className:"w-full rounded-lg border"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{size:"sm",variant:"outline",className:"gap-1",asChild:!0,children:r.jsxs("a",{href:v.url,download:!0,target:"_blank",rel:"noopener noreferrer",children:[r.jsx(lv,{className:"w-3 h-3"})," Download"]})}),r.jsxs(P,{size:"sm",variant:"outline",className:"gap-1",onClick:()=>d(g.index),disabled:s!==null,children:[r.jsx(vs,{className:"w-3 h-3"})," Regenerate"]})]})]}):v!=null&&v.error?r.jsxs("div",{className:"text-sm text-destructive bg-destructive/10 p-3 rounded-lg",children:[v.error,r.jsxs(P,{size:"sm",variant:"outline",className:"mt-2 gap-1",onClick:()=>d(g.index),disabled:s!==null,children:[r.jsx(vs,{className:"w-3 h-3"})," Retry"]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[r.jsx(wi,{className:"w-8 h-8 mb-2"}),r.jsx("p",{className:"text-sm mb-3",children:"Not generated yet"}),r.jsxs(P,{size:"sm",onClick:()=>d(g.index),disabled:s!==null,className:"gap-1",children:[s===g.index?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsx(wi,{className:"w-3 h-3"}),"Generate"]})]})})]},g.index)})}),r.jsxs("div",{className:"space-y-8",children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Store Listing Copy"}),r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx($t,{className:"text-base",children:"Short Description (132 chars)"}),r.jsxs(P,{size:"sm",variant:"ghost",className:"gap-1",onClick:()=>m(p),children:[l===p?r.jsx(cl,{className:"w-3 h-3 text-green-500"}):r.jsx(ui,{className:"w-3 h-3"}),"Copy"]})]})}),r.jsxs(lt,{children:[r.jsx("p",{className:"text-sm bg-muted p-3 rounded-lg font-mono",children:p}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[p.length," / 132 characters"]})]})]}),r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx($t,{className:"text-base",children:"Detailed Description"}),r.jsxs(P,{size:"sm",variant:"ghost",className:"gap-1",onClick:()=>m(f),children:[l===f?r.jsx(cl,{className:"w-3 h-3 text-green-500"}):r.jsx(ui,{className:"w-3 h-3"}),"Copy"]})]})}),r.jsx(lt,{children:r.jsx("pre",{className:"text-sm bg-muted p-4 rounded-lg whitespace-pre-wrap font-mono max-h-96 overflow-y-auto",children:f})})]}),r.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Permission Justifications"}),r.jsx(Ie,{children:r.jsx(lt,{className:"pt-6",children:r.jsx("div",{className:"space-y-4",children:x.map(g=>r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(Se,{variant:"outline",className:"mt-0.5 shrink-0 font-mono text-xs",children:g.permission}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm text-foreground",children:g.justification}),r.jsxs(P,{size:"sm",variant:"ghost",className:"gap-1 h-6 px-2 mt-1",onClick:()=>m(g.justification),children:[l===g.justification?r.jsx(cl,{className:"w-3 h-3 text-green-500"}):r.jsx(ui,{className:"w-3 h-3"}),"Copy"]})]})]},g.permission))})})}),r.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Web Store Upload Steps"}),r.jsx(Ie,{children:r.jsx(lt,{className:"pt-6",children:r.jsxs("ol",{className:"space-y-6 list-decimal list-inside",children:[r.jsxs("li",{className:"text-foreground font-medium",children:["Register as a Developer",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:["Go to ",r.jsx("a",{href:"https://chrome.google.com/webstore/devconsole",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Chrome Developer Dashboard"}),", sign in, pay the $5 fee, and verify your identity."]})]}),r.jsxs("li",{className:"text-foreground font-medium",children:["Prepare the Extension ZIP",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:["ZIP all files inside the ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"extension/"})," folder. Ensure ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"manifest.json"})," is at the root of the ZIP (not inside a subfolder)."]})]}),r.jsxs("li",{className:"text-foreground font-medium",children:["Create a New Item",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:["Upload the ZIP, fill in descriptions (copy from above), set category to ",r.jsx("strong",{children:"Productivity"}),", upload screenshots and promo tiles."]})]}),r.jsxs("li",{className:"text-foreground font-medium",children:["Fill in Privacy Tab",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:["Privacy policy: ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"https://vidareo.com/privacy"}),'. Single purpose: "Record screen or camera, then save and share video messages via VIDAREO." Justify each permission using the justifications above.']})]}),r.jsxs("li",{className:"text-foreground font-medium",children:["Fill in Distribution Tab",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:["Set visibility to ",r.jsx("strong",{children:"Public"})," and distribution to ",r.jsx("strong",{children:"All regions"}),"."]})]}),r.jsxs("li",{className:"text-foreground font-medium",children:["Submit for Review",r.jsxs("p",{className:"text-sm text-muted-foreground ml-6 mt-1",children:['Click "Submit for review". Review typically takes 1–3 business days. Update the ',r.jsx("code",{className:"bg-muted px-1 rounded",children:"CHROME_WEB_STORE_URL"})," in Install.tsx after approval."]})]})]})})})]})]})}),r.jsx(Ka,{})]})},Brt=[{slug:"loom-alternative",keyword:"loom alternative",title:"The Best Loom Alternative for Video Messaging | VIDAREO",metaDescription:"Looking for a Loom alternative? VIDAREO offers screen + webcam recording, AI teleprompter, video meetings, and bulk personalized video - under $25/mo.",heroEyebrow:"Loom Alternative",heroSubheadline:"Record, share, and track personalized video - with built-in meetings, an AI teleprompter, and bulk email sending Loom doesn't offer.",intro:"VIDAREO is the most complete Loom alternative for sales, customer success, and async teams. Get every recording feature you love about Loom - plus live video meetings, an AI script teleprompter, bulk personalized video email, and a Chrome extension - at a fraction of the price.",features:[{title:"HD Screen + Webcam Recording",description:"Capture your screen, camera, or both in crisp 1080p - straight from your browser or our Chrome extension. No download required."},{title:"AI Script & Teleprompter",description:"Generate a script with AI, then read it back through a built-in teleprompter while you record. Sound polished on every take."},{title:"Built-in Video Meetings",description:"Host live video calls with up to 4 participants, screen sharing, and host-side recording - no separate Zoom or Meet account needed."},{title:"Bulk Personalized Email Send",description:"Send the same video to dozens of contacts with unique tracked links - perfect for sales outreach and customer follow-ups."},{title:"Custom Branded Share Links",description:"Add your logo, custom CTAs, and password protection to every share page. Track views, watch time, and reactions in real time."},{title:"Transcription & Captions",description:"Automatic transcripts and burned-in captions in every supported language - accessible by default, no add-on fees."}
1272,{title:"Built-In Video Editor",description:"Trim, split, and delete sections from any recording right in your browser. Save as a copy to keep the original or replace it in one click - no separate editor required."}],comparisonTitle:"VIDAREO vs. Loom",comparisonSubtitle:"Every feature Loom users care about - plus the ones they wish they had.",comparisonCompetitor:"Loom",comparison:[{feature:"Screen + webcam recording",vidareo:"✓",competitor:"✓"},{feature:"HD 1080p quality",vidareo:"✓",competitor:"✓"},{feature:"Real-time view notifications",vidareo:"✓",competitor:"✓"},{feature:"Custom branded share pages",vidareo:"✓",competitor:"✓"},{feature:"AI script & teleprompter",vidareo:"✓",competitor:"-"},{feature:"Built-in live video meetings",vidareo:"✓",competitor:"-"},{feature:"Bulk personalized video email",vidareo:"✓",competitor:"-"},{feature:"Built-in trim & split editor",vidareo:"✓",competitor:"-"},{feature:"Paid plans under $25/mo",vidareo:"✓",competitor:"-"},{feature:"Team plans under $20/seat",vidareo:"✓",competitor:"-"}],faqs:[{question:"Is VIDAREO really a free Loom alternative?",answer:"Yes. The VIDAREO Starter plan is free forever and includes screen + webcam recording, share links, and viewer analytics - no credit card required."},{question:"Can I import my existing Loom videos?",answer:"You can upload any MP4 or WebM file from your computer directly into VIDAREO and get a branded share link with full analytics."},{question:"How is VIDAREO different from Loom?",answer:"VIDAREO bundles recording, live video meetings, an AI teleprompter, and bulk personalized email into one workspace - features Loom either charges separately for or doesn't offer."},{question:"Is the Chrome extension required?",answer:"No. You can record entirely from the web app. The Chrome extension is a one-click option for people who want to start a recording from any tab."},{question:"Can I edit my videos in VIDAREO?",answer:"Yes. Every recording opens in a built-in editor where you can trim the ends, split the timeline, and delete sections - then save as a copy or replace the original."}],ctaTitle:"Make the switch from Loom in under 60 seconds",ctaSubtitle:"Free Starter plan. No credit card. Cancel anytime.",internalLinks:[{label:"See all features",href:"/features"},{label:"Compare pricing",href:"/pricing"},{label:"Use cases for sales teams",href:"/use-cases/sales-teams"}]},{slug:"async-video-messaging",keyword:"async video messaging",title:"Async Video Messaging for Distributed Teams | VIDAREO",metaDescription:"Async video messaging that replaces meetings. Record, share, and track video updates with your team - built for distributed and remote teams.",heroEyebrow:"Async Video Messaging",heroSubheadline:"Replace meetings that should have been emails with quick, personal video updates your team can watch anytime.",intro:"VIDAREO is built for async video messaging across distributed teams. Record updates, walkthroughs, and feedback in seconds - then share a branded link that your team can watch on their own time, react to, and reply to with their own video.",features:[{title:"Record in One Click",description:"Capture screen, camera, or both directly in your browser. No download, no setup - perfect for quick async updates."},{title:"Video Replies & Reactions",description:"Teammates can reply with their own video or drop timed emoji reactions - turning one-way messages into real async conversations."},{title:"Branded Share Links",description:"Every video gets a clean, branded share page with comments, transcript, and watch analytics built in."},{title:"Real-Time Watch Notifications",description:"Know the moment a teammate opens your video - including how much of it they watched and what they reacted to."},{title:"Tighten Updates in One Click",description:"Built-in editor lets you trim, split, and delete sections so async updates stay short."}],faqs:[{question:"What is async video messaging?",answer:"Async video messaging means recording a short video and sending it instead of holding a live meeting. Recipients watch on their own time, reducing meeting load and saving hours per week."},{question:"Is VIDAREO good for remote teams?",answer:"Yes - async video is the core use case. Distributed teams use VIDAREO to share updates across time zones without dragging anyone onto another call."},{question:"Do recipients need an account to watch?",answer:"No. Anyone with the share link can watch, react, and reply - no account required."}],ctaTitle:"Cut your meeting load this week",ctaSubtitle:"Start sending async video updates in under a minute. Free forever plan.",internalLinks:[{label:"Async team use cases",href:"/use-cases/async-teams"},{label:"All features",href:"/features"}
1272,{label:"How it works",href:"/how-it-works"}]},{slug:"screen-recorder-with-teleprompter",keyword:"screen recorder with teleprompter",title:"Screen Recorder with Teleprompter (AI Script) | VIDAREO",metaDescription:"VIDAREO is a screen recorder with a built-in teleprompter and AI script generator. Record polished screen + webcam videos in one take.",heroEyebrow:"Screen Recorder + AI Teleprompter",heroSubheadline:"Generate a script, scroll it on screen while you record, and sound polished on every take - no editing required.",intro:"VIDAREO is the only screen recorder with a built-in teleprompter and AI script generator. Outline what you want to say, let AI draft a script, then scroll it on-screen while recording your camera and screen in HD.",features:[{title:"AI-Generated Scripts",description:"Type a topic or paste your bullet points and let AI draft a clear, on-brand script you can edit before you hit record."},{title:"On-Screen Teleprompter",description:"Adjustable speed, font size, and double-spaced layout so your eyes stay close to the camera lens. Look natural every take."},{title:"Screen + Webcam in HD",description:"Record your full screen, a tab, or just the camera - with picture-in-picture overlay, custom backgrounds, and 1080p quality."},{title:"Branded Share Links",description:"Every recording lands at a clean share URL with your logo, custom CTA, and full viewer analytics."}],faqs:[{question:"Is the teleprompter included for free?",answer:"Yes - the teleprompter is available on every VIDAREO plan, including the free Starter tier."},{question:"Can I write my own script instead of using AI?",answer:"Absolutely. Paste in any text and the teleprompter will scroll it for you. AI generation is optional."},{question:"Does it work in the browser?",answer:"Yes. The screen recorder and teleprompter both run in the browser. A Chrome extension is also available for one-click recording from any tab."}],ctaTitle:"Record your first scripted video in 60 seconds",ctaSubtitle:"Free plan, no credit card. Includes AI teleprompter.",internalLinks:[{label:"All features",href:"/features"},{label:"How it works",href:"/how-it-works"},{label:"Use cases for sales teams",href:"/use-cases/sales-teams"}]},{slug:"personalized-video-messaging",keyword:"personalized video messaging",title:"Personalized Video Messaging for Sales & CS | VIDAREO",metaDescription:"Send personalized video messages that build real relationships. Record once, personalize at scale, and track every view with VIDAREO.",heroEyebrow:"Personalized Video Messaging",heroSubheadline:"Send a video that feels one-to-one - at scale. Trusted by sales reps, account managers, and founders to build real relationships.",intro:"VIDAREO is built for personalized video messaging that actually scales. Record one video, generate dozens of unique tracked links for your contacts, and know the moment each person watches - so you can follow up at exactly the right time.",features:[{title:"Bulk Personalized Send",description:"Upload a contact list, attach one video, and send dozens of unique tracked links in a single click."},{title:"Custom Thumbnails",description:"Hand-pick or upload a thumbnail per contact to boost open rates - including animated GIF previews."},{title:"Real-Time View Alerts",description:"Get an instant notification when a contact opens your video, including watch time and reactions."},{title:"Branded CTAs",description:"Add a custom call-to-action button to every share page - book a call, reply, or visit a link."},{title:"Polish Before You Send",description:"Built-in editor lets you trim the ends, split, and delete sections in one click so every personalized video sounds tight."}],faqs:[{question:"What is personalized video messaging?",answer:"Personalized video messaging means 
1272sending a short, recorded video addressed to a specific person - instead of a generic text email. It dramatically improves response rates in sales and customer success outreach."},{question:"Can I send the same video to many people?",answer:"Yes. VIDAREO's bulk-send feature generates a unique tracked link per recipient so you can measure who watched what."},{question:"Will recipients know it's me?",answer:"Yes - your share pages are fully branded with your logo, name, and a custom CTA, so every video feels personal."}],ctaTitle:"Send your first personalized video today",ctaSubtitle:"Free Starter plan. No credit card. Track every view.",internalLinks:[{label:"Sales team use cases",href:"/use-cases/sales-teams"},{label:"Customer success use cases",href:"/use-cases/customer-success"},{label:"See all features",href:"/features"}]},{slug:"vidareo-vs-bombbomb",keyword:"bombbomb alternative",title:"VIDAREO vs BombBomb: The Best BombBomb Alternative | VIDAREO",metaDescription:"Compare VIDAREO vs BombBomb. Get video email, AI teleprompter, live meetings, and a free plan - premium from $19.95/mo.",heroEyebrow:"VIDAREO vs BombBomb",heroSubheadline:"Everything you use BombBomb for - video email, tracking, branding - plus a free plan, live meetings, and a built-in editor.",intro:"BombBomb is popular with real estate and sales pros for video email. VIDAREO covers the same ground - personal video, tracked links, bulk sends - and adds live video meetings, an AI teleprompter, and a free forever plan, with premium plans from $19.95/mo.",features:[{title:"HD Screen + Webcam Recording",description:"Record your screen, camera, or both in 1080p from the browser or the Chrome extension."},{title:"AI Script & Teleprompter",description:"Generate a script with AI and read it from a built-in teleprompter while you record."},{title:"Built-in Video Meetings",description:"Host live calls with up to 4 people, screen sharing, and host recording - no separate meeting tool."},{title:"Bulk Personalized Email Send",description:"Send one video to many contacts, each with a unique tracked link."},{title:"Branded Share Pages",description:"Your logo, custom CTAs, password protection, reactions, and video replies on every share."},{title:"Built-In Video Editor",description:"Trim, split, and delete sections right in your browser before you send."}],comparisonTitle:"VIDAREO vs. BombBomb",comparisonSubtitle:"A side-by-side look at what you get.",comparisonCompetitor:"BombBomb",mobileApp:{label:"Mobile apps",vidareo:"iPhone & iPad",competitor:"iPhone & Android"},comparison:[{feature:"Screen + webcam recording",vidareo:"✓",competitor:"✓"},{feature:"Real-time view notifications",vidareo:"✓",competitor:"✓"},{feature:"Custom branded share pages",vidareo:"✓",competitor:"✓"},{feature:"Free plan available",vidareo:"✓",competitor:"-"},{feature:"AI script & teleprompter",vidareo:"✓",competitor:"-"},{feature:"Built-in live video meetings",vidareo:"✓",competitor:"-"},{feature:"Video reactions & replies",vidareo:"✓",competitor:"-"},{feature:"Built-in trim & split editor",vidareo:"✓",competitor:"-"},{feature:"Paid plans under $25/mo",vidareo:"✓",competitor:"-"}],faqs:[{question:"Is VIDAREO a good BombBomb alternative for real estate?",answer:"Yes. Agents use VIDAREO for listing walkthroughs, client updates, and follow-ups with tracked, branded links - plus live calls for virtual showings."},{question:"Does VIDAREO have a free plan?",answer:"Yes. The Starter plan is free forever, with recording, share links, and viewer analytics."},{question:"Can I send video by email like BombBomb?",answer:"Yes. Send to one contact or use bulk personalized send so each recipient gets a unique tracked link."}],ctaTitle:"Switch from BombBomb today",ctaSubtitle:"Free Starter plan. No credit card. Cancel anytime.",internalLinks:[{label:"Compare pricing",href:"/pricing"},{label:"VIDAREO vs Loom",href:"/loom-alternative"},{label:"Use cases for sales teams",href:"/use-cases/sales-teams"}]},{slug:"vidareo-vs-vidyard",keyword:"vidyard alternative",title:"VIDAREO vs Vidyard: The Best Vidyard Alternative | VIDAREO",metaDescription:"Compare VIDAREO vs Vidyard. Sales video recording, tracking, AI teleprompter, and live meetings - team seats under $20.",heroEyebrow:"VIDAREO vs Vidyard",heroSubheadline:"Sales video without enterprise pricing: record, send, and track - with team seats under $20.00.",intro:"Vidyard is built for sales video at scale, and its team plans are priced for it. VIDAREO gives sales teams recording, tracked share links, bulk personalized sends, and team analytics - plus live meetings and an AI teleprompter - with team seats from $15.00/mo billed annually.",features:[{title:"HD Screen + Webcam Recording",description:"Record your screen, camera, or both in 1080p from the browser or the Chrome extension."},{title:"AI Script & Teleprompter",description:"Generate a script with AI and read it from a built-in teleprompter while you record."},{title:"Built-in Video Meetings",description:"Host live calls with up to 4 people, screen sharing, and host recording - no separate meeting tool."},{title:"Bulk Personalized Email Send",description:"Send one video to many contacts, each with a unique tracked link."},{title:"Branded Share Pages",description:"Your logo, custom CTAs, password protection, reactions, and video replies on every share."}
1272,{title:"Built-In Video Editor",description:"Trim, split, and delete sections right in your browser before you send."}],comparisonTitle:"VIDAREO vs. Vidyard",comparisonSubtitle:"A side-by-side look at what you get.",comparisonCompetitor:"Vidyard",mobileApp:{label:"Mobile apps",vidareo:"iPhone & iPad",competitor:"iPhone & Android"},comparison:[{feature:"Screen + webcam recording",vidareo:"✓",competitor:"✓"},{feature:"Real-time view notifications",vidareo:"✓",competitor:"✓"},{feature:"Custom branded share pages",vidareo:"✓",competitor:"✓"},{feature:"Free plan available",vidareo:"✓",competitor:"✓"},{feature:"AI script & teleprompter",vidareo:"✓",competitor:"-"},{feature:"Built-in live video meetings",vidareo:"✓",competitor:"-"},{feature:"Built-in trim & split editor",vidareo:"✓",competitor:"✓"},{feature:"Paid plans under $25/mo",vidareo:"✓",competitor:"-"},{feature:"Team plans under $20/seat",vidareo:"✓",competitor:"-"}],faqs:[{question:"Is VIDAREO cheaper than Vidyard?",answer:"VIDAREO premium plans start at $19.95/mo and team seats are $19.00/mo, or $15.00/mo billed annually."},{question:"Does VIDAREO work for sales teams?",answer:"Yes. Teams get shared seats, team analytics, bulk personalized sends, and real-time view alerts."},{question:"Can I upload existing videos?",answer:"Yes. Upload any MP4 or WebM file and get a branded, tracked share link."}],ctaTitle:"Move your sales team off Vidyard",ctaSubtitle:"Free Starter plan. No credit card. Cancel anytime.",internalLinks:[{label:"Compare pricing",href:"/pricing"},{label:"VIDAREO vs Loom",href:"/loom-alternative"},{label:"Use cases for sales teams",href:"/use-cases/sales-teams"}]},{slug:"vidareo-vs-sendspark",keyword:"sendspark alternative",title:"VIDAREO vs Sendspark: The Best Sendspark Alternative | VIDAREO",metaDescription:"Compare VIDAREO vs Sendspark. Personalized video, tracked links, AI teleprompter, and built-in video meetings in one tool.",heroEyebrow:"VIDAREO vs Sendspark",heroSubheadline:"Personalized video for outreach - plus live meetings, a teleprompter, and an editor in the same workspace.",intro:"Sendspark focuses on personalized video for prospecting. VIDAREO covers personalized recording, tracked links, and bulk sends, and also brings live video meetings, an AI script teleprompter, and a browser video editor into one affordable plan.",features:[{title:"HD Screen + Webcam Recording",description:"Record your screen, camera, or both in 1080p from the browser or the Chrome extension."},{title:"AI Script & Teleprompter",description:"Generate a script with AI and read it from a built-in teleprompter while you record."},{title:"Built-in Video Meetings",description:"Host live calls with up to 4 people, screen sharing, and host recording - no separate meeting tool."},{title:"Bulk Personalized Email Send",description:"Send one video to many contacts, each with a unique tracked link."},{title:"Branded Share Pages",description:"Your logo, custom CTAs, password protection, reactions, and video replies on every share."},{title:"Built-In Video Editor",description:"Trim, split, and delete sections right in your browser before you send."}],comparisonTitle:"VIDAREO vs. Sendspark",mobileApp:{label:"Mobile apps",vidareo:"iPhone & iPad",competitor:"iPhone"},comparisonSubtitle:"A side-by-side look at what you get.",comparisonCompetitor:"Sendspark",comparison:[{feature:"Screen + webcam recording",vidareo:"✓",competitor:"✓"},{feature:"Real-time view notifications",vidareo:"✓",competitor:"✓"},{feature:"Custom branded share pages",vidareo:"✓",competitor:"✓"},{feature:"Free plan available",vidareo:"✓",competitor:"✓"},{feature:"Bulk personalized video email",vidareo:"✓",competitor:"✓"},{feature:"AI script & teleprompter",vidareo:"✓",competitor:"-"},{feature:"Built-in live video meetings",vidareo:"✓",competitor:"-"},{feature:"Video reactions & replies",vidareo:"✓",competitor:"-"}],faqs:[{question:"How is VIDAREO different from Sendspark?",answer:"VIDAREO combines personalized video with live meetings, an AI teleprompter, and a built-in editor, so you don't need separate tools."},{question:"Does VIDAREO have a free plan?",answer:"Yes. The Starter plan is free forever - no credit card required."},{question:"Do recipients need an account?",answer:"No. Anyone with the link can watch, react, and reply."}],ctaTitle:"Try the Sendspark alternative free",ctaSubtitle:"Free Starter plan. No credit card. Cancel anytime.",internalLinks:[{label:"Compare pricing",href:"/pricing"},{label:"VIDAREO vs Loom",href:"/loom-alternative"},{label:"Use cases for sales teams",href:"/use-cases/sales-teams"}]}],zrt=e=>Brt.find(t=>t.slug===e),kh=()=>{const{pathname:e}=ja(),t=e.replace(/^\/+|\/+$/g,""),n=zrt(t);return h.useEffect(()=>{if(!n)return;const s=`https://vidareo.com/${n.slug}`;document.title=n.title;const a=(l,c)=>{const d=document.querySelector(l);d&&d.setAttribute("content",c)};a('meta[name="description"]',n.metaDescription),a('meta[property="og:title"]',n.title),a('meta[property="og:description"]',n.metaDescription),a('meta[property="og:url"]',s),a('meta[name="twitter:title"]',n.title),a('meta[name="twitter:description"]',n.metaDescription);let i=document.querySelector('link[rel="canonical"]');i||(i=document.createElement("link"),i.rel="canonical",document.head.appendChild(i)),i.href=s;const o=document.createElement("script");return o.type="application/ld+json",o.setAttribute("data-seo-landing-jsonld","true"),o.textContent=JSON.stringify([{"@context":"https://schema.org","@type":"WebPage",name:n.title,de
1272scription:n.metaDescription,url:s},{"@context":"https://schema.org","@type":"FAQPage",mainEntity:n.faqs.map(l=>({"@type":"Question",name:l.question,acceptedAnswer:{"@type":"Answer",text:l.answer}}))}]),document.querySelectorAll("script[data-seo-landing-jsonld]").forEach(l=>l.remove()),document.head.appendChild(o),()=>{document.querySelectorAll("script[data-seo-landing-jsonld]").forEach(l=>l.remove())}},[n]),n?r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"pt-16 md:pt-24",children:[r.jsx("section",{className:"py-12 md:py-20",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-4xl mx-auto text-center",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-6",children:[r.jsx(_n,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"text-sm font-medium text-primary",children:n.heroEyebrow})]}),r.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-extrabold text-foreground mb-6 leading-tight",children:n.title.split("|")[0].trim()}),r.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-8 max-w-2xl mx-auto",children:n.heroSubheadline}),r.jsxs("div",{className:"flex flex-wrap gap-4 justify-center",children:[r.jsx(P,{size:"lg",asChild:!0,className:"rounded-full",children:r.jsxs(Cr,{to:"/auth",children:["Get Started Free",r.jsx(Ya,{className:"w-4 h-4 ml-2"})]})}),r.jsx(P,{size:"lg",variant:"outline",asChild:!0,className:"rounded-full",children:r.jsx(Cr,{to:"/features",children:"See All Features"})})]})]})})}),r.jsx("section",{className:"py-8",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsx("div",{className:"max-w-3xl mx-auto",children:r.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed text-center",children:n.intro})})})}),n.comparison&&r.jsx("section",{className:"border-y border-border bg-secondary py-8 text-secondary-foreground",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col items-center justify-between gap-6 sm:flex-row",children:[r.jsxs("div",{className:"flex items-center gap-4 text-center sm:text-left",children:[r.jsx("div",{className:"hidden h-12 w-12 shrink-0 items-center justify-center rounded-md bg-primary sm:flex",children:r.jsx(qc,{className:"h-6 w-6 text-primary-foreground"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-display text-xl font-bold sm:text-2xl",children:"VIDAREO for iPhone and iPad"}),r.jsx("p",{className:"mt-1 text-sm text-secondary-foreground/75",children:"Record, manage, and share videos wherever work takes you."})]})]}),r.jsx("a",{href:g5,target:"_blank",rel:"noopener noreferrer","aria-label":"Download VIDAREO on the App Store",className:"shrink-0 transition-opacity hover:opacity-85",children:r.jsx("img",{src:nee,alt:"Download on the App Store",className:"h-12 w-auto"})})]})})}),r.jsx("section",{className:"py-16 bg-muted/30",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground text-center mb-12",children:"Everything You Need in One Workspace"}),r.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:n.features.map((s,a)=>r.jsxs(fe.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:a*.05},className:"bg-card rounded-xl p-6 border border-border/50",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:r.jsx(nt,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:s.title}),r.jsx("p",{className:"text-muted-foreground",children:s.description})]},s.title))})]})})}),n.comparison&&n.comparisonCompetitor&&r.jsx("section",{className:"py-16",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground mb-3",children:n.comparisonTitle}),n.comparisonSubtitle&&r.jsx("p",{className:"text-muted-foreground",children:n.comparisonSubtitle})]}),r.jsxs("div",{className:"bg-card rounded-2xl border border-border overflow-hidden shadow-sm",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-2 p-4 bg-muted/50 border-b border-border font-semibold text-sm",children:[r.jsx("div",{children:"Feature"}),r.jsx("div",{className:"text-center text-primary",children:"VIDAREO"}),r.jsx("div",{className:"text-center text-muted-foreground",children:n.comparisonCompetitor})]}),r.jsxs("div",{className:"divide-y divide-border",children:[r.jsx("div",{className:"grid grid-cols-3 gap-2 p-4 items-center",children:n.mobileAp
1272p?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:n.mobileApp.label}),r.jsx("div",{className:"text-center text-sm font-semibold text-primary",children:n.mobileApp.vidareo}),r.jsx("div",{className:"text-center text-sm text-muted-foreground",children:n.mobileApp.competitor})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:"App for iPhone and iPad"}),r.jsx("div",{className:"text-center font-semibold text-primary",children:"✓"}),r.jsx("div",{className:"text-center text-xs text-muted-foreground",children:"Not compared"})]})}),n.comparison.map(s=>r.jsxs("div",{className:"grid grid-cols-3 gap-2 p-4 items-center",children:[r.jsx("div",{className:"text-sm text-foreground",children:s.feature}),r.jsx("div",{className:"text-center text-primary font-semibold",children:s.vidareo}),r.jsx("div",{className:"text-center text-muted-foreground",children:s.competitor})]},s.feature))]})]})]})})}),r.jsx("section",{className:"py-16 bg-muted/30",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-3xl mx-auto",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-foreground text-center mb-10",children:"Frequently Asked Questions"}),r.jsx("div",{className:"space-y-4",children:n.faqs.map(s=>r.jsxs("div",{className:"bg-card rounded-xl p-6 border border-border/50",children:[r.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:s.question}),r.jsx("p",{className:"text-muted-foreground",children:s.answer})]},s.question))})]})})}),r.jsx("section",{className:"py-12",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[r.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:"Keep Exploring"}),r.jsx("div",{className:"flex flex-wrap gap-3 justify-center",children:n.internalLinks.map(s=>r.jsx(Cr,{to:s.href,className:"px-5 py-2 rounded-full border border-border text-sm text-foreground hover:border-primary/40 hover:text-primary transition-colors",children:s.label},s.href))})]})})}),r.jsx("section",{className:"py-20",children:r.jsx("div",{className:"container mx-auto px-4",children:r.jsxs("div",{className:"max-w-3xl mx-auto text-center bg-gradient-to-br from-primary/10 to-blue-500/5 rounded-3xl p-10 md:p-16 border border-primary/20",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-foreground mb-4",children:n.ctaTitle}),r.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:n.ctaSubtitle}),r.jsx(P,{size:"lg",asChild:!0,className:"rounded-full",children:r.jsxs(Cr,{to:"/auth",children:["Get Started Free",r.jsx(Ya,{className:"w-4 h-4 ml-2"})]})})]})})})]}),r.jsx(Ka,{})]}):r.jsx(Of,{to:"/",replace:!0})};let qrt=0;const Mp=()=>`seg-${++qrt}`;function Hrt(e){const{user:t}=nr(),[n,s]=h.useState(null),[a,i]=h.useState(!0),[o,l]=h.useState(0),[c,d]=h.useState([]),[u,m]=h.useState(null),f=h.useRef(null),[p,x]=h.useState(0),[g,v]=h.useState(!1),[y,b]=h.useState(!1),[w,S]=h.useState([]),[j,N]=h.useState(1),[_,C]=h.useState(1),[k,E]=h.useState(!1),R=c.length>0?c[0].start:0,T=c.length>0?c[c.length-1].end:o;h.useEffect(()=>{!e||!(t!=null&&t.id)||(async()=>{i(!0);const{data:W,error:Q}=await F.from("videos").select("id, title, video_url, thumbnail_url, duration").eq("id",e).eq("user_id",t.id).maybeSingle();Q||!W?m("Video not found or access denied."):s(W),i(!1)})()},[e,t==null?void 0:t.id]);const D=h.useCallback(W=>{isFinite(W)&&W>0&&o===0&&(l(W),d([{id:Mp(),start:0,end:W,deleted:!1}]))},[o]),A=h.useCallback(()=>{S(W=>[...W,c.map(Q=>({...Q}))])},[c]),V=h.useCallback(()=>{S(W=>{if(W.length===0)return W;const Q=W[W.length-1];return d(Q),W.slice(0,-1)})},[]),U=h.useCallback(()=>{const W=p,Q=c.findIndex(ne=>W>ne.start+.05&&W<ne.end-.05);if(Q===-1)return;A();const L=c[Q],te={id:Mp(),start:L.start,end:W,deleted:L.deleted},ae={id:Mp(),start:W,end:L.end,deleted:L.deleted};d(ne=>[...ne.slice(0,Q),te,ae,...ne.slice(Q+1)])},[p,c,A]),O=h.useCallback(W=>{const Q=c.filter(te=>!te.deleted&&te.id!==W),L=c.find(te=>te.id===W);L&&(!L.deleted&&Q.length===0||(A(),d(te=>te.map(ae=>ae.id===W?{...ae,deleted:!ae.deleted}:ae))))},[c,A]),M=h.useCallback(W=>{if(!W.length||o<=0)return;const Q=W.map(te=>({start:Math.max(0,te.start),end:Math.min(o,te.end)})).filter(te=>te.end-te.start>.02).sort((te,ae)=>te.start-ae.start),L=[];for(const te of Q){const ae=L[L.length-1];ae&&te.start<=ae.end+.01?ae.end=Math.max(ae.end,te.end):L.push({...te})}L.length&&(A(),d(te=>{const ae=[];for(const ne of te){if(ne.deleted){ae.push(ne);continue}const se=L.filter(Ne=>Ne.end>ne.start&&Ne.start<ne.end);if(se.length===0){ae.push(ne);continue}let ue=ne.start;for(const Ne of se){const Qe=Math.max(ne.start,Ne.start),J=Math.min(ne.end,Ne.end);Qe>ue+.02&&ae.push({id:Mp(),start:ue,end:Qe,deleted:!1}),ae.push({id:Mp(),start:Qe,end:J,deleted:!0}
1272),ue=J}ue<ne.end-.02&&ae.push({id:Mp(),start:ue,end:ne.end,deleted:!1})}return!ae.some(ne=>!ne.deleted)&&ae.length>0&&(ae[0].deleted=!1),ae}))},[o,A]),$=h.useRef(null),I=h.useCallback(()=>{$.current&&(clearInterval($.current),$.current=null)},[]),B=h.useCallback(()=>{const W=f.current;if(!W)return;const Q=c.filter(te=>!te.deleted);if(Q.length===0)return;let L=0;b(!0),v(!0),W.currentTime=Q[0].start,W.play(),I(),$.current=window.setInterval(()=>{if(L>=Q.length){W.pause(),v(!1),b(!1),I();return}const te=Q[L];W.currentTime>=te.end-.05&&(L++,L<Q.length?W.currentTime=Q[L].start:(W.pause(),v(!1),b(!1),I()))},50)},[c,I]),K=h.useCallback(()=>{const W=f.current;W&&(W.pause(),W.currentTime=0,x(0)),v(!1),b(!1),I()},[I]);h.useEffect(()=>()=>I(),[I]);const Z=h.useCallback(()=>{const W=f.current;if(!W)return;const Q=c.filter(te=>!te.deleted);if(Q.length===0)return;let L=Q.findIndex(te=>W.currentTime<te.end-.05);L===-1&&(L=0),W.currentTime<Q[L].start&&(W.currentTime=Q[L].start),W.play(),v(!0),I(),$.current=window.setInterval(()=>{if(L>=Q.length){W.pause(),v(!1),I();return}const te=Q[L];W.currentTime>=te.end-.05&&(L++,L<Q.length?W.currentTime=Q[L].start:(W.pause(),v(!1),I()))},50)},[c,I]),q=h.useCallback(()=>{var W;(W=f.current)==null||W.pause(),v(!1),y&&(b(!1),I())},[y,I]),H=h.useCallback(W=>{if(f.current){const Q=Math.max(0,Math.min(o,W));f.current.currentTime=Q,x(Q)}},[o]),X=h.useCallback(W=>{N(W),f.current&&(f.current.playbackRate=W)},[]),G=h.useCallback(W=>{C(W),E(W===0),f.current&&(f.current.volume=W,f.current.muted=W===0)},[]),ee=h.useCallback(()=>{const W=!k;E(W),f.current&&(f.current.muted=W)},[k]),re=c.some(W=>W.deleted)||c.length>1||c.length===1&&(c[0].start>.05||o>0&&c[0].end<o-.05);return{video:n,isLoading:a,duration:o,trimStart:R,trimEnd:T,setTrimStart:W=>{c.length>0&&d(Q=>{const L=[...Q];return L[0]={...L[0],start:W},L})},setTrimEnd:W=>{c.length>0&&d(Q=>{const L=[...Q];return L[L.length-1]={...L[L.length-1],end:W},L})},pushHistory:A,segments:c,splitAtPlayhead:U,toggleSegmentDelete:O,applyDeletionRanges:M,error:u,setError:m,videoRef:f,applyDuration:D,currentTime:p,setCurrentTime:x,isPlaying:g,isPreviewing:y,play:Z,pause:q,seekTo:H,startPreviewPlayback:B,stopPreviewPlayback:K,undo:V,canUndo:w.length>0,hasEdits:re,playbackRate:j,setPlaybackRate:X,volume:_,setVolume:G,isMuted:k,toggleMute:ee}}const Xj=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};function Wrt(e,t,n=12){const[s,a]=h.useState([]);return h.useEffect(()=>{if(!e||t<=0)return;let i=!1;return(async()=>{const l=document.createElement("video");l.crossOrigin="anonymous",l.preload="metadata",l.muted=!0,await new Promise((x,g)=>{l.onloadedmetadata=()=>x(),l.onerror=()=>g(),l.src=e});const c=document.createElement("canvas"),d=48,u=l.videoWidth/(l.videoHeight||1),m=Math.round(d*u);c.width=m,c.height=d;const f=c.getContext("2d"),p=[];for(let x=0;x<n&&!i;x++){const g=x/n*t+t/(n*2);await new Promise(v=>{const y=()=>{l.removeEventListener("seeked",y),f.drawImage(l,0,0,m,d),p.push(c.toDataURL("image/jpeg",.5)),v()};l.addEventListener("seeked",y),l.currentTime=Math.min(g,t-.1)})}i||a(p),l.src=""})().catch(()=>{}),()=>{i=!0}},[e,t,n]),s}const eA=[1,2,4,8],Yrt=({duration:e,trimStart:t,trimEnd:n,currentTime:s,segments:a,selectedSegmentId:i,onTrimStartChange:o,onTrimEndChange:l,onSeek:c,onToggleSegmentDelete:d,onSelectSegment:u,onSingleSegmentClick:m,onDragStart:f,videoUrl:p})=>{const x=h.useRef(null),g=h.useRef(null),v=h.useRef(!1),y=Wrt(p,e),[b,w]=h.useState(0),S=eA[b],j=h.useCallback(D=>{if(!g.current)return 0;const A=g.current.getBoundingClientRect();return Math.max(0,Math.min(1,(D-A.left)/A.width))*e},[e]),N=D=>{if(v.current||D.target.closest("[data-handle]")||D.target.closest("[data-segment-action]"))return;const A=j(D.clientX);c(A)},_=(D,A,V)=>U=>{U.preventDefault(),U.stopPropagation(),v.current=!0,f==null||f();const O=I=>{var B;return"touches"in I?((B=I.touches[0])==null?void 0:B.clientX)??0:I.clientX},M=I=>{const B=j(O(I));D(Math.max(A(),Math.min(V(),B)))},$=()=>{requestAnimationFrame(()=>{v.current=!1}),window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",$),window.removeEventListener("touchmove",M),window.removeEventListener("touchend",$)};window.addEventListener("mousemove",M,{passive:!1}),window.addEventListener("mouseup",$),window.addEventListener("touchmove",M,{passive:!1}),window.addEventListener("touchend",$)};if(h.useEffect(()=>{if(S===1||!x.current||!g.current||e<=0)return;const D=x.current,A=s/e*g.current.offsetWidth,V=D.scrollLeft,U=V+D.clientWidth;(A<V+40||A>U-40)&&D.scrollTo({left:Math.max(0,A-D.clientWidth/2),behavior:"smooth"})},[s,S,e]),e<=0)return r.jsx("div",{className:"w-full h-14 bg-muted rounded-lg flex items-center justify-center",children:r.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading timeline… (waiting for video metadata)"})});const C=s/e*100,k=t/e*100,E=n/e*100,R=Math.min(10,Math.floor(e)),T=Array.from({length:R+1},(D,A)=>A/R*e);return r.jsxs("div",{className:"w-full space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-end gap-1 text-xs text-muted-foreground",children:[r.jsx("span",{className:"mr-1",children:"Zoom"}),r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7",disabled:b===0,onClick:()=>w(D=>Math.max(0,D-1)),title:"Zoom out",children:r.jsx(rW,{className:"w-3.5 h-3.5"})}),r.jsxs("span",{className:"w-8 text-center font-medium tabular-nums",children:[S,"x"]}),r.jsx(P,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7",disabled:b===eA.length-1,onClick:()=>w(D=>Math.min(eA.length-1,D+1)),title:"Zoom in",children:r.jsx(tW,{className:"w-3.5 h-3.5"})})]}),r.jsx("div",{ref:x,className:"w-full overflow-x-auto overflow-y-hidden",children:r.jsxs("div",{style:{width:`${S*100}%`,minWidth:"100%"},children:[r.jsx("div",{className:"relative h-4 select-none",children:T.map((D,A)=>r.jsx("span",{className:"absolute text-[10px] text-muted-foreground -translate-x-1/2",style:{left:`${D/e*100}%`},children:Xj(D)},A))}),r.jsxs("div",{ref:g,className:"relative h-16 select-none cursor-pointer rounded-lg bg-muted overflow-hidden",onClick:N,children:[y.length>0&&r.jsx("div",{className:"absolute inset-0 flex pointer-events-none",style:{zIndex:0},children:y.map((D,A)=>r.jsx("img",{src:D,alt:"",className:"h-full object-cover flex-1",draggable:!1},A))}),a.map(D=>{const A=D.start/e*100,V=(D.end-D.start)/e*100,U=D.id===i;return r.jsx("div",{className:`absolute top-0 bottom-0 border-r border-background/50 transition-colors pointer-events-none ${D.deleted?"bg-destructive/30":U?"bg-primary/25 ring-2 ring-primary ring-inset":"bg-primary/10"}`,style:{left:`${A}%`,width:`${V}%`,zIndex:5}},D.id)}),a.map(D=>{const A=D.start/e*100,V=(D.end-D.start)/e*100,U=D.id===i;return r.jsx("div",{"data-segment-action":!0,className:"absolute top-0 bottom-0 cursor-pointer hover:bg-foreground
1272/5",style:{left:`${A}%`,width:`${V}%`,minWidth:"14px",zIndex:6},title:U?"Selected":"Select section",onClick:O=>{O.stopPropagation(),a.length>1?u(U?null:D.id):m==null||m()}},`hit-${D.id}`)}),r.jsx("div",{className:"absolute top-0 bottom-0 left-0 bg-foreground/30 pointer-events-none rounded-l-lg",style:{width:`${k}%`,zIndex:10}}),r.jsx("div",{className:"absolute top-0 bottom-0 right-0 bg-foreground/30 pointer-events-none rounded-r-lg",style:{width:`${100-E}%`,zIndex:10}}),a.map((D,A)=>{if(A===0)return null;const V=D.start/e*100;return r.jsx("div",{className:"absolute -top-1 -bottom-1 w-1 bg-destructive pointer-events-none rounded-full shadow-[0_0_6px_hsl(var(--destructive)/0.8)]",style:{left:`${V}%`,transform:"translateX(-50%)",zIndex:20}},`split-${D.id}`)}),r.jsxs("div",{"data-handle":!0,className:"absolute top-0 bottom-0 cursor-ew-resize touch-none",style:{left:`${C}%`,transform:"translateX(-50%)",width:"16px",zIndex:30},onMouseDown:_(c,()=>0,()=>e),onTouchStart:_(c,()=>0,()=>e),children:[r.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 top-0 bottom-0 w-0.5 bg-[hsl(210_100%_55%)] shadow-[0_0_6px_hsl(210_100%_55%/0.9)] pointer-events-none"}),r.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-[hsl(210_100%_55%)] rounded-full shadow-md pointer-events-none"})]})]})]})}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Start: ",Xj(t)]}),r.jsxs("span",{children:["Current: ",Xj(s)]}),r.jsxs("span",{children:["End: ",Xj(n)]})]})]})},Grt=({isPlaying:e,onPlay:t,onPause:n,onUndo:s,canUndo:a,onPreview:i,onStopPreview:o,isPreviewing:l,onSave:c,onCancel:d,hasEdits:u,onSplit:m,canSplit:f,selectedSegmentId:p,selectedSegmentDeleted:x,onDeleteSelectedSegment:g,canDeleteSegment:v,playbackRate:y,onPlaybackRateChange:b,volume:w,onVolumeChange:S,isMuted:j,onToggleMute:N})=>r.jsx(ys,{children:r.jsx("div",{className:"space-y-3",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs(P,{size:"sm",variant:"outline",onClick:e?n:t,children:[e?r.jsx(ig,{className:"w-4 h-4 mr-1"}):r.jsx(Js,{className:"w-4 h-4 mr-1"}),e?"Pause":"Play"]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{size:"sm",variant:"outline",onClick:m,disabled:!f,children:[r.jsx(A_,{className:"w-4 h-4 mr-1"}),"Split"]})}),r.jsx(yt,{side:"top",children:r.jsx("p",{className:"max-w-[200px] text-xs",children:"Split the clip at the current playhead position. Then click a segment to select it and delete."})})]}),p&&r.jsx(P,{size:"sm",variant:x?"secondary":"destructive",onClick:g,disabled:!v&&!x,children:x?r.jsxs(r.Fragment,{children:[r.jsx(Wd,{className:"w-4 h-4 mr-1"})," Restore"]}):r.jsxs(r.Fragment,{children:[r.jsx(Xr,{className:"w-4 h-4 mr-1"})," Delete Section"]})}),r.jsxs(P,{size:"sm",variant:"ghost",onClick:s,disabled:!a,children:[r.jsx(zue,{className:"w-4 h-4 mr-1"}),"Undo"]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("span",{children:r.jsxs(P,{size:"sm",variant:l?"default":"secondary",onClick:l?o??i:i,disabled:!u,children:[r.jsx(wr,{className:"w-4 h-4 mr-1"}),l?"Stop Preview":"Preview"]})})}),r.jsx(yt,{side:"top",children:r.jsx("p",{className:"max-w-[200px] text-xs",children:l?"Stop preview and return to editing.":u?"Play only the kept segments so you see the final result.":"Make an edit (trim or split + delete) to preview the result."})})]}),r.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Speed:"}),r.jsxs(kn,{value:String(y),onValueChange:_=>b(Number(_)),children:[r.jsx(wn,{className:"h-8 w-[70px] text-xs",children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"0.25",children:"0.25x"}),r.jsx(_t,{value:"0.5",children:"0.5x"}),r.jsx(_t,{value:"1",children:"1x"}),r.jsx(_t,{value:"1.5",children:"1.5x"}),r.jsx(_t,{value:"2",children:"2x"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[r.jsx(P,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:N,children:j||w===0?r.jsx(Yue,{className:"w-4 h-4"}):r.jsx(eW,{className:"w-4 h-4"})}),r.jsx(zm,{value:[j?0:w*100],onValueChange:([_])=>S(_/100),max:100,step:1,className:"w-20"})]}),r.jsx("div",{className:"flex-1"}),u&&r.jsxs(r.Fragment,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{size:"sm",variant:"outline",onClick:()=>c(!0),children:[r.jsx(ui,{className:"w-4 h-4 mr-1"}),"Save as Copy"]})}),r.jsx(yt,{side:"top",children:r.jsx("p",{className:"max-w-[200px] text-xs",children:"Creates a new video with edits applied. Your original stays untouched."})})]}),r.jsxs(cs,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(Uf,{asChild:!0,children:r.jsxs(P,{size:"sm",variant:"default",children:[r.jsx(Db,{className:"w-4 h-4 mr-1"}),"Save & Replace"]})})}),r.jsx(yt,{side:"top",children:r.jsx("p",{className:"max-w-[200px] text-xs",children:"Overwrites your original video with the edited ver
1272sion. This can't be undone."})})]}),r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Replace original video?"}),r.jsxs(Jn,{children:["This will overwrite your original video with the edited version. This action can't be undone. If you want to keep the original, choose ",r.jsx("strong",{children:"Save as Copy"})," instead."]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:()=>c(!1),children:"Replace original"})]})]})]})]}),r.jsxs(P,{size:"sm",variant:"ghost",onClick:d,children:[r.jsx(zt,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})}),Bz=e=>{(!isFinite(e)||e<0)&&(e=0);const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`},Krt=({segments:e,selectedSegmentId:t,onSelectSegment:n,onToggleSegmentDelete:s,onSeek:a})=>{if(e.length<=1)return r.jsxs("div",{className:"rounded-lg border border-dashed border-border p-3 text-xs text-muted-foreground text-center",children:["Click ",r.jsx("strong",{children:"Split"})," on the timeline to create sections you can select and delete here."]});const i=e.filter(o=>!o.deleted).length;return r.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[r.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between",children:[r.jsxs("h3",{className:"text-sm font-semibold",children:["Sections (",e.length,")"]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Click a row to select, then delete it"})]}),r.jsx("ul",{className:"max-h-64 overflow-y-auto divide-y divide-border",children:e.map((o,l)=>{const c=o.id===t,d=Math.max(0,o.end-o.start),u=o.deleted||i>1;return r.jsxs("li",{className:`flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${c?"bg-primary/10":o.deleted?"bg-destructive/5 hover:bg-destructive/10":"hover:bg-muted/50"}`,onClick:()=>n(c?null:o.id),children:[r.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-medium shrink-0 ${o.deleted?"bg-destructive/20 text-destructive line-through":"bg-primary/15 text-primary"}`,children:l+1}),r.jsxs("div",{className:"flex-1 min-w-0 text-sm",children:[r.jsxs("div",{className:`font-medium ${o.deleted?"line-through text-muted-foreground":""}`,children:[Bz(o.start)," – ",Bz(o.end)]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:[d.toFixed(1),"s ",o.deleted&&"• will be removed"]})]}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",title:"Seek to start of section",onClick:m=>{m.stopPropagation(),a(o.start)},children:r.jsx(Js,{className:"w-3.5 h-3.5"})}),r.jsx(P,{variant:(o.deleted,"ghost"),size:"icon",className:`h-7 w-7 ${o.deleted?"text-primary":"text-destructive"}`,disabled:!u,title:o.deleted?"Restore section":"Delete section",onClick:m=>{m.stopPropagation(),s(o.id)},children:o.deleted?r.jsx(Wd,{className:"w-3.5 h-3.5"}):r.jsx(Xr,{className:"w-3.5 h-3.5"})})]},o.id)})})]})},Xrt=()=>{const{videoId:e}=eh(),t=Sr(),n=MK(),{user:s}=nr(),{job:a,startProcessing:i}=$Y(),o=Q_();h.useEffect(()=>{(n||o||_r())&&t("/videos",{replace:!0})},[n,o,t]);const{video:l,isLoading:c,duration:d,trimStart:u,setTrimStart:m,trimEnd:f,setTrimEnd:p,segments:x,splitAtPlayhead:g,toggleSegmentDelete:v,error:y,setError:b,videoRef:w,applyDuration:S,currentTime:j,setCurrentTime:N,isPlaying:_,isPreviewing:C,play:k,pause:E,seekTo:R,startPreviewPlayback:T,stopPreviewPlayback:D,undo:A,canUndo:V,hasEdits:U,pushHistory:O,playbackRate:M,setPlaybackRate:$,volume:I,setVolume:B,isMuted:K,toggleMute:Z}=Hrt(e),[q,H]=h.useState(null),X=x.find(W=>W.id===q)??null,G=h.useCallback(()=>{q&&v(q)},[q,v]),ee=h.useCallback(W=>{const Q=W.duration;if(isFinite(Q)&&Q>0){S(Q);return}const L=()=>{W.removeEventListener("seeked",L),isFinite(W.duration)&&W.duration>0?S(W.duration):l!=null&&l.duration&&l.duration>0&&S(l.duration),W.currentTime=0};W.addEventListener("seeked",L),W.currentTime=1e10},[S,l]);h.useEffect(()=>{const W=w.current;if(!W||!l)return;const Q=()=>ee(W),L=()=>N(W.currentTime);return W.readyState>=1?ee(W):W.addEventListener("loadedmetadata",Q),W.addEventListener("timeupdate",L),()=>{W.removeEventListener("loadedmetadata",Q),W.removeEventListener("timeupdate",L)}},[l,ee]);const re=W=>{if(!(!l||!(s!=null&&s.id))){if(a){Pe.error("Another video is already processing. Please wait.");return}i(l,x,W,s.id),Pe("Your video is processing in the background. You can keep working!",{duration:5e3}),t("/videos")}};return c?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):l?r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("div",{className:"max-w-5xl mx-auto px-4 pt-24 pb-12 space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(P,{variant:"ghost",size:"icon",onClick:()=>t("/videos"),children:r.jsx(aa,{className:"w-5 h-5"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h1",{className:"text-xl font-bold",children:"Trim Video"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:l.title})]})]}),y&&r.jsxs(Md,{variant:"destructive",children:[r.jsx(Id,{children:y}),r.jsx(P,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>b(null),children:"Dismiss"})]}),r.jsx("div",{className:"relative rounded-xl overflow-hidden bg-black aspect-video",children:r.jsx("video",{ref:w,src:l.video_url,crossOrigin:"anonymous",className:"w-full h-full object-contain",playsInl
1272ine:!0,preload:"metadata"})}),(()=>{const W=L=>{(!isFinite(L)||L<0)&&(L=0);const te=Math.floor(L/60),ae=Math.floor(L%60);return`${te}:${ae.toString().padStart(2,"0")}`},Q=x.filter(L=>!L.deleted).reduce((L,te)=>{const ae=Math.max(te.start,u),ne=Math.min(te.end,f);return L+Math.max(0,ne-ae)},0);return r.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-muted-foreground",children:"Original:"}),r.jsx("span",{className:"font-medium",children:W(d)})]}),r.jsx("div",{className:"h-4 w-px bg-border"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-muted-foreground",children:"Edited:"}),r.jsx("span",{className:"font-medium text-primary",children:W(Q)})]}),U&&d>0&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",W(d-Q)," removed)"]})]})})(),r.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3 text-xs text-muted-foreground space-y-1",children:[r.jsxs("p",{children:["• Move the playhead to where you want to cut, then click ",r.jsx("strong",{children:"Split"})," to divide the video into sections."]}),r.jsxs("p",{children:["• Click a section to select it, then press ",r.jsx("strong",{children:"Delete Section"})," to remove it from the final video."]}),r.jsxs("p",{children:["• Click ",r.jsx("strong",{children:"Preview"})," (enabled after any edit) to play only the kept parts."]}),r.jsx("p",{children:"• Zoom the timeline in for fine control, or pick sections from the list below."}),r.jsxs("p",{children:["• Use ",r.jsx("strong",{children:"Speed"})," and ",r.jsx("strong",{children:"Volume"})," to control playback while editing."]}),r.jsxs("p",{children:["• ",r.jsx("strong",{children:"Save as Copy"})," keeps your original; ",r.jsx("strong",{children:"Save & Replace"})," overwrites it."]})]}),r.jsx(Yrt,{duration:d,trimStart:u,trimEnd:f,currentTime:j,segments:x,selectedSegmentId:q,onTrimStartChange:m,onTrimEndChange:p,onSeek:R,onToggleSegmentDelete:v,onSelectSegment:H,onSingleSegmentClick:()=>Pe("Click Split first to create sections you can delete."),onDragStart:O,videoUrl:l.video_url}),r.jsx(Krt,{segments:x,selectedSegmentId:q,onSelectSegment:H,onToggleSegmentDelete:v,onSeek:R}),r.jsx(Grt,{isPlaying:_,onPlay:k,onPause:E,onUndo:A,canUndo:V,onPreview:T,onStopPreview:D,isPreviewing:C,onSave:re,onCancel:()=>t("/videos"),hasEdits:U,onSplit:g,canSplit:x.some(W=>j>W.start+.05&&j<W.end-.05),selectedSegmentId:q,selectedSegmentDeleted:(X==null?void 0:X.deleted)??!1,onDeleteSelectedSegment:G,canDeleteSegment:x.filter(W=>!W.deleted).length>1,playbackRate:M,onPlaybackRateChange:$,volume:I,onVolumeChange:B,isMuted:K,onToggleMute:Z})]})]}):r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("div",{className:"max-w-4xl mx-auto px-4 pt-24 text-center space-y-4",children:[r.jsx(wa,{className:"w-12 h-12 text-destructive mx-auto"}),r.jsx("h1",{className:"text-2xl font-bold",children:"Video Not Found"}),r.jsx("p",{className:"text-muted-foreground",children:"This video doesn't exist or you don't have access."}),r.jsx(P,{onClick:()=>t("/videos"),children:"Back to Videos"})]})]})},zz="signup_gift_code";function Zrt(e){const{user:t}=nr(),n=h.useRef(!1);h.useEffect(()=>{if(!t||n.current)return;const s=localStorage.getItem(zz);s&&(n.current=!0,(async()=>{try{const{data:a,error:i}=await F.functions.invoke("redeem-gift-code",{body:{code:s}});i||!(a!=null&&a.success)?Pe.error((a==null?void 0:a.error)||"We could not redeem your gift code."):(Pe.success("Pro plan unlocked - enjoy!"),e==null||e())}catch{Pe.error("We could not redeem your gift code.")}finally{localStorage.removeItem(zz)}})())},[t,e])}const Qrt=()=>{const e=Sr(),{user:t}=nr(),{isAdmin:n}=sp(),{isPremium:s}=Jl(),{currentUsage:a,limit:i}=jw(t==null?void 0:t.id),{currentUsage:o,limit:l}=Tw(t==null?void 0:t.id),[c,d]=h.useState("annual"),[u,m]=h.useState(!1);if(s||n||lr())return null;const f=i>0?a/i*100:0,p=l>0?o/l*100:0,x=(xi.professional.priceAnnual/12).toFixed(2),g=c==="monthly"?xi.professional.priceMonthly:Math.round(xi.professional.priceAnnual/12),v=c==="monthly"?xi.team.priceMonthly:Math.round(xi.team.priceAnnual/12),y=Math.round((xi.professional.priceMonthly*12-xi.professional.priceAnnual)/(xi.professional.priceMonthly*12)*100),b=["Unlimited recordings & shares","Upload & share existing videos","10-minute max per video","Presentation mode (PDF & PowerPoint)","AI transcription","Contact management & bulk email","Custom branding"],w=["Everything in Professional","Team workspace & analytics","Admin controls","Priority support"];return r.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 w-full",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("div",{className:"p-1.5 bg-primary/10 rounded-lg flex-shrink-0",children:r.jsx(_n,{className:"w-4 h-4 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:"Free Starter Plan Usage This Month"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Upgrade anytime for unlimited access"})]})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsxs(P,{size:"sm",onClick:()=>e("/pricing"),className:"gap-1.5 text-xs",children:[r.jsx(Ms,{className:"w-3.5 h-3.5"}),"Upgrade Plan",r.jsx(Ya,{className:"w-3.5 h-3.5"})]}),r.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Starting at $",x,"/mo"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r.jsx(cr,{className:"w-3 h-3"})," Recordings"]}),r.jsxs("span",{className:"font-medium text-foreground",children:[a,"/",i]})]}),r.jsx(Lc,{value:f,className:"h-1.5"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r.jsx(dv,{className:"w-3 h-3"})," Shares"]}),r.jsxs("span",{className:"font-medium text-foreground",children:[o,"/",l]})]}),r.jsx(Lc,{value:p,className:"h-1.5"})]})]}),r.jsxs("button",{onClick:()=>m(!u),className:"flex items-center gap-1 text-xs text-primary hover:text-primary/80 transition-colors mt-2",children:["Compare Plans",r.jsx(Qs,{className:`w-3 h-3 transition-transform ${u?"rotate-180":""}`})]}),r.jsx(Wm,{open:u,onOpenChange:m,children:r.jsx(Ym,{children:r.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[r.jsx("h4",{className:"font-semibold text-sm text-foreground",children:"Compare Plans"}),r.jsx(ec,{value:c,onValueChange:S=>d(S),children:r.jsxs(pl,{className:"grid w-full grid-cols-2 sm:w-auto",children:[r.jsx(tn,{value:"monthly",className:"text-xs",children:"Monthly"}),r.jsxs(tn,{value:"annual",className:"text-xs",children:["Annual",r.jsxs("span",{className:"ml-1 text-[10px] bg-green-500/20 text-green-600 dark:text-green-400 px-1.5 py-0.5 rounded-full",children:["Save ",y,"%"]})]})]})})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[r.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 hover:border-primary/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ms,{className:"w-4 h-4 text-primary"}),r.jsx("h5",{className:"font-semibold text-sm text-foreground",children:"Professional"})]}),r.jsxs("div",{className:"text-right",children:[r.jsxs("span",{className:"text-xl font-bold text-foreground",children:["$",g]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"/mo"}),c==="annual"&&r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["billed annually ($",xi.professional.priceAnnual,"/yr)"]})]})]}),r.jsx("ul",{className:"space-y-1.5 mb-3",children:b.map((S,j)=>r.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500 flex-shrink-0"}
1272)," ",S]},j))}),r.jsxs("div",{className:"pt-3 border-t border-border mb-3",children:[r.jsxs("p",{className:"flex items-center gap-1.5 text-xs font-medium text-foreground mb-2",children:[r.jsx(Ns,{className:"w-3 h-3 text-primary"})," Optional Add-ons"]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-md p-2 text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-foreground",children:[r.jsx(fr,{className:"w-3 h-3 text-primary"})," 30 min videos"]}),r.jsx("span",{className:"font-medium text-foreground",children:"+$20/mo"})]}),r.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-md p-2 text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-foreground",children:[r.jsx(fr,{className:"w-3 h-3 text-primary"})," 60 min videos"]}),r.jsx("span",{className:"font-medium text-foreground",children:"+$30/mo"})]})]})]}),r.jsx(P,{size:"sm",onClick:()=>e("/pricing"),className:"w-full",variant:"outline",children:"Get Professional"})]}),r.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 hover:border-primary/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4 text-accent"}),r.jsxs("div",{children:[r.jsx("h5",{className:"font-semibold text-sm text-foreground",children:"Team"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Minimum 2 users"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsxs("span",{className:"text-xl font-bold text-foreground",children:["$",v]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"/user/mo"}),c==="annual"&&r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["billed annually ($",xi.team.priceAnnual,"/user/yr)"]})]})]}),r.jsx("ul",{className:"space-y-1.5 mb-3",children:w.map((S,j)=>r.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500 flex-shrink-0"}
1272)," ",S]},j))}),r.jsxs("div",{className:"pt-3 border-t border-border mb-3",children:[r.jsxs("p",{className:"flex items-center gap-1.5 text-xs font-medium text-foreground mb-2",children:[r.jsx(Ns,{className:"w-3 h-3 text-primary"})," Optional Add-ons"]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-md p-2 text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-foreground",children:[r.jsx(fr,{className:"w-3 h-3 text-primary"})," 30 min videos"]}),r.jsx("span",{className:"font-medium text-foreground",children:"+$20/user/mo"})]}),r.jsxs("div",{className:"flex items-center justify-between bg-muted/50 rounded-md p-2 text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-foreground",children:[r.jsx(fr,{className:"w-3 h-3 text-primary"})," 60 min videos"]}),r.jsx("span",{className:"font-medium text-foreground",children:"+$30/user/mo"})]})]}),r.jsx("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:"Per-user add-on for extended recordings"})]}),r.jsx(P,{size:"sm",onClick:()=>e("/pricing"),className:"w-full",variant:"outline",children:"Get Team"})]})]})]})})})]})},Jrt=({userId:e,subscriptionTier:t,totalVideos:n,totalViews:s})=>{const a=Sr();nr();const{maxVideoDurationMinutes:i,hasExtendedVideo60:o}=np(),[l,c]=h.useState(!1),[d,u]=h.useState(null),m=t==="starter",f=t==="professional"||t==="team";h.useEffect(()=>{if(!e)return;(async()=>{const{data:b}=await F.from("user_custom_limits").select("max_duration_seconds").eq("user_id",e).maybeSingle();b!=null&&b.max_duration_seconds&&u(Math.round(b.max_duration_seconds/60))})()},[e]);const p=d||(m?is.FREE_MAX_DURATION_MINUTES:i),x=!lr()&&f&&!o,g=()=>{a("/billing")},v=[{label:"Total Videos",value:n,icon:bi,color:"text-primary",bgColor:"bg-primary/10",tooltip:"Total number of videos you've recorded or uploaded",clickable:!1},{label:"Total Views",value:s,icon:wr,color:"text-emerald-500",bgColor:"bg-emerald-500/10",tooltip:"Total times recipients have watched your shared videos",clickable:!1},{label:"Max Duration",value:`${p} min`,icon:fr,color:"text-amber-500",bgColor:"bg-amber-500/10",tooltip:m?"Maximum recording length per video on your free plan. Upgrade for longer recordings.":x?`Currently ${p} min per video. Click to extend up to 60 min.`:"Maximum recording length per video on your current plan",clickable:x||m,onClick:g}];return r.jsx(ys,{children:r.jsx("div",{className:"grid grid-cols-3 gap-3 md:gap-4",children:v.map(y=>r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(Ie,{variant:"ghost",className:`border border-border/50 ${y.clickable?"cursor-pointer hover:border-primary/30 hover:bg-primary/5 transition-all":"cursor-default"}`,onClick:y.clickable?y.onClick:void 0,children:r.jsxs(lt,{className:"p-3 flex items-center gap-2.5",children:[r.jsx("div",{className:`p-2 rounded-lg ${y.bgColor}`,children:r.jsx(y.icon,{className:`w-4 h-4 ${y.color}`})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:y.label}),r.jsx("p",{className:"text-lg font-bold text-foreground leading-tight",children:y.value})]}),y.clickable&&r.jsx("div",{className:"ml-auto",children:l?r.jsx(Me,{className:"w-3.5 h-3.5 animate-spin text-primary"}):r.jsx("span",{className:"text-[10px] text-primary font-medium",children:"Upgrade"})})]})})}),r.jsx(yt,{side:"bottom",className:"max-w-[220px]",children:r.jsx("p",{children:y.tooltip})})]},y.label))})})},ent=({isPremium:e,subscriptionTier:t})=>{const n=Sr(),{openRecording:s}=bv(),a=lr(),i=v5(),{user:o}=nr(),{disabled:l,reasonText:c}=u2(o==null?void 0:o.id),{isExtensionAvailable:d}=yv(),[u,m]=h.useState(!1),[f,p]=h.useState("mobile-screen"),x=v=>{if(!l){if(i&&!a){if(v==="camera"){p("mobile-record-yourself"),m(!0);return}if(v==="screen"){p("mobile-screen"),m(!0);return}if(v==="presentation"){p("mobile-presentation"),m(!0);return}}if(v==="screen"&&!a&&!d){p("extension"),m(!0);return}s(v)}},g=v=>{e?n(v):a||n("/pricing")};return r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsx(Ot,{className:"pb-2 pt-4 px-4",children:r.jsx($t,{className:"text-sm",children:"Qu
1272ick Actions"})}),r.jsx(lt,{className:"space-y-1.5 px-4 pb-4",children:r.jsxs(ys,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{className:"w-full justify-start gap-2 text-sm",onClick:()=>x("camera"),disabled:l,children:[r.jsx(cr,{className:"w-4 h-4"}),"Record Yourself"]})}),r.jsx(yt,{side:"left",children:l?c:i&&!a?"Available on the iOS and Android app":"Record a video using your camera"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2 text-sm border-primary/50 text-primary hover:bg-primary/10",onClick:()=>x("screen"),disabled:l,children:[r.jsx(Vs,{className:"w-4 h-4"}),"Record Screen"]})}),r.jsx(yt,{side:"left",children:l?c:i?"Open VIDAREO on desktop to record your screen":d?"Record your screen for demos and walkthroughs":"Install the Chrome extension to record your screen"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2 text-sm border-accent/50 text-accent hover:bg-accent/10",onClick:()=>x("presentation"),disabled:l,children:[r.jsx(kf,{className:"w-4 h-4"}),"Presentation"]})}),r.jsx(yt,{side:"left",children:l?c:i&&!a?"Open VIDAREO on desktop to record a presentation":"Record over your slide deck"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:`w-full justify-start gap-2 text-sm ${e?"":"opacity-70 cursor-not-allowed"}`,onClick:()=>g("/videos?upload=true"),children:[e?r.jsx(na,{className:"w-4 h-4"}):r.jsx(Ni,{className:"w-4 h-4"}),"Upload Video",!e&&r.jsx(Se,{variant:"secondary",className:"ml-auto text-[10px]",children:"Pro+"})]})}),r.jsx(yt,{side:"left",children:e?"Upload an existing video file (up to 1GB)":a?"Not available on your current plan":"Upgrade to Professional to upload videos"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:`w-full justify-start gap-2 text-sm ${e?"border-accent/50 text-accent hover:bg-accent/10":"opacity-70 cursor-not-allowed"}`,onClick:()=>g("/meet"),children:[e?r.jsx(og,{className:"w-4 h-4"}):r.jsx(Ni,{className:"w-4 h-4"}),"Video Call",!e&&r.jsx(Se,{variant:"secondary",className:"ml-auto text-[10px]",children:"Pro+"})]})}),r.jsx(yt,{side:"left",children:e?"Start or join a video call (up to 4 people)":a?"Not available on your current plan":"Upgrade to Professional for video calls"})]})]})}),r.jsx(xQ,{open:u,onOpenChange:m,variant:f})]})},tnt=({userId:e})=>{const t=Sr(),[n,s]=h.useState([]),[a,i]=h.useState(!0);h.useEffect(()=>{(async()=>{try{const{data:c,error:d}=await F.from("videos").select("id, title, thumbnail_url, duration, view_count, created_at").eq("user_id",e).is("archived_at",null).order("created_at",{ascending:!1}).limit(5);if(d)throw d;if(!(c!=null&&c.length)){s([]);return}const u=c.map(g=>g.id),[m,f]=await Promise.all([F.from("share_link_views").select("video_id").eq("owner_id",e).in("video_id",u),F.from("video_share_links").select("video_id, view_count").eq("user_id",e).in("video_id",u)]);if(m.error)throw m.error;if(f.error)throw f.error;const p=(m.data||[]).reduce((g,v)=>(g[v.video_id]=(g[v.video_id]||0)+1,g),{}),x=(f.data||[]).reduce((g,v)=>(g[v.video_id]=(g[v.video_id]||0)+(v.view_count||0),g),{});s(c.map(g=>({...g,total_views:Math.max(g.view_count||0,p[g.id]||0,x[g.id]||0)})))}catch(c){console.error("Error fetching recent dashboard videos:",c),s([])}finally{i(!1)}})()},[e]);const o=l=>{const c=Date.now()-new Date(l).getTime(),d=Math.floor(c/6e4);if(d<60)return`${d}m ago`;const u=Math.floor(d/60);if(u<24)return`${u}h ago`;const m=Math.floor(u/24);return m<7?`${m}d ago`:new Date(l).toLocaleDateString()};return r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsxs(Ot,{className:"pb-3 flex flex-row items-center justify-between",children:[r.jsx($t,{className:"text-base",children:"Recent Videos"}),r.jsxs(P,{variant:"ghost",size:"sm",onClick:()=>t("/videos"),className:"text-xs text-muted-foreground gap-1",children:["View All ",r.jsx(Ya,{className:"w-3 h-3"})]})]}),r.jsx(lt,{children:a?r.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ia,{className:"w-16 h-10 rounded"}),r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx(ia,{className:"h-4 w-3/4"}),r.jsx(ia,{className:"h-3 w-1/2"})]})]},l))}):n.length===0?r.jsxs("div",{className:"text-center py-8",children:[r.jsx(bi,{className:"w-10 h-10 text-muted-foreground
1272/40 mx-auto mb-2"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"No videos yet"})]}):r.jsx("div",{className:"space-y-2",children:n.map(l=>r.jsxs("button",{onClick:()=>t("/videos"),className:"w-full flex items-center gap-3 p-2 rounded-lg hover:bg-muted/50 transition-colors text-left",children:[r.jsx("div",{className:"relative w-16 h-10 rounded bg-muted overflow-hidden flex-shrink-0",children:l.thumbnail_url?r.jsx("img",{src:l.thumbnail_url,alt:"",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsx(Js,{className:"w-4 h-4 text-muted-foreground/50"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title}),r.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[l.duration&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),Qwe(l.duration)]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(wr,{className:"w-3 h-3"}),l.total_views]}),r.jsx("span",{children:o(l.created_at)})]})]})]},l.id))})})]})},rnt={view:{icon:wr,color:"text-blue-500",bg:"bg-blue-500/10"},reply:{icon:Wa,color:"text-emerald-500",bg:"bg-emerald-500/10"},reaction:{icon:V4,color:"text-pink-500",bg:"bg-pink-500/10"},email_opened:{icon:zr,color:"text-amber-500",bg:"bg-amber-500/10"}},nnt=({userId:e})=>{const[t,n]=h.useState([]),[s,a]=h.useState(!0);h.useEffect(()=>{(async()=>{try{const l=[],{data:c}=await F.from("share_link_views").select("id, viewed_at, recipient_email, video_id").eq("owner_id",e).order("viewed_at",{ascending:!1}).limit(5);c==null||c.forEach(u=>{l.push({id:`view-${u.id}`,type:"view",message:u.recipient_email?`${u.recipient_email} watched your video`:"Someone watched your video",timestamp:u.viewed_at})});const{data:d}=await F.from("video_replies").select("id, created_at, sender_name, sender_email").eq("original_owner_id",e).order("created_at",{ascending:!1}).limit(5);d==null||d.forEach(u=>{l.push({id:`reply-${u.id}`,type:"reply",message:`${u.sender_name||u.sender_email||"Someone"} replied to your video`,timestamp:u.created_at})}),l.sort((u,m)=>new Date(m.timestamp).getTime()-new Date(u.timestamp).getTime()),n(l.slice(0,8))}catch(l){console.error("Error fetching activity:",l)}finally{a(!1)}})()},[e]);const i=o=>{const l=Date.now()-new Date(o).getTime(),c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const u=Math.floor(d/24);return u<7?`${u}d ago`:new Date(o).toLocaleDateString()};return r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsx(Ot,{className:"pb-3",children:r.jsx($t,{className:"text-base",children:"Recent Activity"})}),r.jsx(lt,{children:s?r.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(o=>r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ia,{className:"w-8 h-8 rounded-full"}),r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx(ia,{className:"h-3.5 w-3/4"}),r.jsx(ia,{className:"h-3 w-1/3"})]})]},o))}):t.length===0?r.jsxs("div",{className:"text-center py-6",children:[r.jsx(fr,{className:"w-8 h-8 text-muted-foreground/40 mx-auto mb-2"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Share a video to start seeing activity"})]}):r.jsx("div",{className:"space-y-1",children:t.map(o=>{const{icon:l,color:c,bg:d}=rnt[o.type];return r.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-lg hover:bg-muted/30 transition-colors",children:[r.jsx("div",{className:`p-1.5 rounded-full ${d} mt-0.5`,children:r.jsx(l,{className:`w-3.5 h-3.5 ${c}`})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm text-foreground truncate",children:o.message}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i(o.timestamp)})]})]},o.id)})})})]})},snt=({subscriptionTier:e,subscriptionEnd:t,isGiftedAccount:n,isPremium:s,isTrial:a,trialEnd:i})=>{var A,V,U;const o=lr(),l=Sr(),{user:c}=nr(),{toast:d}=Gr(),{hasExtendedVideo:u,hasExtendedVideo30:m,hasExtendedVideo60:f,maxVideoDurationMinutes:p}=np(),[x,g]=h.useState("extended_video_30"),[v,y]=h.useState(null),[b,w]=h.useState(!1),[S,j]=h.useState(null);h.useEffect(()=>{if(!(c!=null&&c.id))return;(async()=>{const{data:M}=await F.from("user_custom_limits").select("max_duration_seconds").eq("user_id",c.id).maybeSingle();M!=null&&M.max_duration_seconds&&j(Math.round(M.max_duration_seconds/60))})()},[c==null?void 0:c.id]);const N=S||p;h.useEffect(()=>{(async()=>
1272{if(!c)return;const{data:M}=await F.from("team_members").select("team_id").eq("user_id",c.id).limit(1).maybeSingle();if(M){const{data:$}=await F.from("teams").select("owner_id").eq("id",M.team_id).single();if($){const{data:I}=await F.from("profiles").select("full_name").eq("user_id",$.owner_id).single();y({isOwner:$.owner_id===c.id,ownerId:$.owner_id,ownerName:(I==null?void 0:I.full_name)||null})}}})()},[c]);const _=v&&!v.isOwner,C=async()=>{if(!(!c||!v)){w(!0);try{const O=x==="extended_video_60"?"60-minute":"30-minute",{data:M}=await F.from("profiles").select("full_name, email").eq("user_id",c.id).single(),$=(M==null?void 0:M.full_name)||(M==null?void 0:M.email)||"A team member",{error:I}=await F.from("notifications").insert({user_id:v.ownerId,type:"addon_request",title:"Extended Video Request",message:`${$} is requesting the ${O} extended video add-on. You can enable it from Team Management.`,data:{requester_id:c.id,requester_name:$,addon_type:x}});if(I)throw I;d({title:"Request sent!",description:`Your request for ${O} video has been sent to your team admin.`})}catch(O){d({title:"Error",description:O.message||"Failed to send request.",variant:"destructive"})}finally{w(!1)}}},k={starter:{icon:_n,label:"Free Starter",color:"text-muted-foreground",bgColor:"bg-muted",badgeClass:""},professional:{icon:ya,label:"Professional",color:"text-primary",bgColor:"bg-primary/10",badgeClass:"bg-primary/90 text-primary-foreground"},team:{icon:Ms,label:"Team",color:"text-amber-500",bgColor:"bg-amber-500/10",badgeClass:"bg-amber-500/90 text-white"}},E=k[e]||k.starter,R=E.icon,T=()=>{l("/billing")},D=!o&&s&&!n&&!f;return r.jsx(ys,{children:r.jsx(Ie,{variant:"ghost",className:"border border-border/50",children:r.jsxs(lt,{className:"p-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:`p-2 rounded-lg ${E.bgColor}`,children:r.jsx(R,{className:`w-4 h-4 ${E.color}`})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:E.label}),n&&r.jsx(Se,{variant:"outline",className:"text-[10px] mt-0.5",children:"Gifted"})]})]}),s&&E.badgeClass&&r.jsx(Se,{className:E.badgeClass,children:"Active"})]}),s&&r.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:a&&i?`Trial ends ${new Date(i).toLocaleDateString()}`:t?`Renews ${new Date(t).toLocaleDateString()}`:null}),s?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," Unlimited recordings"]}),r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," Unlimited shares"]}),r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," ",N," min per video",u&&!S&&r.jsx(Se,{variant:"outline",className:"text-[9px] px-1 py-0 ml-1",children:"Add-on"})]}),e==="team"&&r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," Team workspace"]})]}),_&&r.jsxs("div",{className:"text-[11px] text-muted-foreground bg-muted/50 rounded-lg p-2 flex items-start gap-1.5 mt-2",children:[r.jsx(Wa,{className:"w-3 h-3 mt-0.5 shrink-0"}),r.jsxs("span",{children:["Managed by ",v.ownerName||"your team admin"]})]}),!o&&!n&&!_&&r.jsx(P,{size:"sm",variant:"outline",className:"w-full mt-2",onClick:()=>l("/billing"),children:"Manage Subscription"}),o&&!n&&!_&&r.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"Your subscription is managed outside the app."})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," 5 recordings/month"]}),r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," 5 shares/month"]}),r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," 2 min max per video"]}),r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500"})," Screen + camera with overlay"]})]}),o?r.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"This feature is not available on your current plan."}):r.jsxs(P,{size:"sm",className:"w-full mt-2 gap-1.5",onClick:()=>l("/pricing"),children:[r.jsx(Ms,{className:"w-3.5 h-3.5"}),"Upgrade Plan",r.jsx(Ya,{className:"w-3.5 h-3.5"})]})]}),D&&r.jsxs("div",{className:"mt-4 pt-3 border-t border-border/50",children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[r.jsx(fr,{className:"w-3.5 h-3.5 text-primary"}),r.jsx("p",{className:"text-xs font-medium text-foreground",children:"Extend Video Length"})]}),r.jsxs("div",{className:"space-y-1.5",children:[!m&&!f&&r.jsxs("button",{onClick:()=>g("extended_video_30"),className:`w-full flex items-center justify-between p-2.5 rounded-lg border transition-all text-left ${x==="extended_video_30"?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border/50 hover:border-primary/30 hover:bg-primary/5"}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:`w-3.5 h-3.5 rounded-full border-2 flex items-center justify-center ${x==="extended_video_30"?"border-primary":"border-muted-foreground
1272/40"}`,children:x==="extended_video_30"&&r.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs font-medium text-foreground",children:"30 min videos"}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"3× longer recordings"})]})]}),r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsxs("span",{className:"text-xs font-bold text-foreground",children:["+$",mm.extended_video_30.price]}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/mo"})]})]}),r.jsxs("button",{onClick:()=>g("extended_video_60"),className:`w-full flex items-center justify-between p-2.5 rounded-lg border transition-all text-left ${x==="extended_video_60"?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border/50 hover:border-primary/30 hover:bg-primary/5"}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:`w-3.5 h-3.5 rounded-full border-2 flex items-center justify-center ${x==="extended_video_60"?"border-primary":"border-muted-foreground/40"}`,children:x==="extended_video_60"&&r.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary"})}),r.jsxs("div",{children:[r.jsxs("p",{className:"text-xs font-medium text-foreground flex items-center gap-1",children:["60 min videos",r.jsx(Se,{variant:"secondary",className:"text-[9px] px-1 py-0",children:"Best Value"})]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"6× longer recordings"})]})]}),r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsxs("span",{className:"text-xs font-bold text-foreground",children:["+$",mm.extended_video_60.price]}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/mo"})]})]})]}),_?r.jsx("div",{className:"mt-3",children:r.jsxs(P,{size:"sm",variant:"secondary",className:"w-full gap-1.5",onClick:C,disabled:b,children:[b?r.jsx(Me,{className:"w-3.5 h-3.5 animate-spin"}):r.jsx(Es,{className:"w-3.5 h-3.5"}),"Request from Admin"]})}):r.jsxs("div",{className:"mt-3 p-2.5 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Monthly total"}),r.jsxs("span",{className:"text-sm font-bold text-foreground",children:["$",(((A=xi[e])==null?void 0:A.priceMonthly)||29)+mm[x].price,"/mo"]})]}),r.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground mb-2",children:[r.jsxs("span",{children:[((V=k[e])==null?void 0:V.label)||"Professional"," plan"]}),r.jsxs("span",{children:["$",((U=xi[e])==null?void 0:U.priceMonthly)||29,"/mo"]})]}),r.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground mb-3",children:[r.jsxs("span",{children:[x==="extended_video_30"?"30":"60"," min add-on"]}),r.jsxs("span",{children:["+$",mm[x].price,"/mo"]})]}),r.jsxs(P,{size:"sm",className:"w-full gap-1.5",onClick:T,children:[r.jsx(ya,{className:"w-3.5 h-3.5"}),"View Upgrade Options",r.jsx(Ya,{className:"w-3.5 h-3.5"})]})]})]})]})})})},ant=({userId:e})=>{const t=Sr(),[n,s]=h.useState([]),[a,i]=h.useState(""),[o,l]=h.useState(!1),[c,d]=h.useState(!0);return h.useEffect(()=>{(async()=>{try{let m=null;const{data:f}=await F.from("teams").select("id, name").eq("owner_id",e).maybeSingle();if(f)m=f.id,i(f.name),l(!0);else{const{data:w}=await F.from("team_members").select("team_id, teams(id, name)").eq("user_id",e).maybeSingle();if(w){m=w.team_id;const S=w.teams;i((S==null?void 0:S.name)||"")}}if(!m){d(!1);return}const{data:p}=await F.from("team_members").select("user_id").eq("team_id",m),x=(p==null?void 0:p.map(w=>w.user_id))||[];f&&!x.includes(e)&&x.push(e);const{data:g}=await F.from("profiles").select("full_name, avatar_url").eq("user_id",e).maybeSingle(),{data:v}=await F.rpc("get_teammate_profiles",{p_user_id:e}),y=[{user_id:e,full_name:(g==null?void 0:g.full_name)??null,avatar_url:(g==null?void 0:g.avatar_url)??null},...v||[]].slice(0,5),b=[];for(const w of y){const{count:S}=await F.from("videos").select("id",{count:"exact",head:!0}
1272).eq("user_id",w.user_id);b.push({userId:w.user_id,fullName:w.full_name,email:null,avatarUrl:w.avatar_url,videoCount:S||0})}s(b)}catch(m){console.error("Error fetching team:",m)}finally{d(!1)}})()},[e]),c?r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsx(Ot,{className:"pb-3",children:r.jsx(ia,{className:"h-5 w-32"})}),r.jsx(lt,{children:r.jsx("div",{className:"space-y-3",children:[1,2,3].map(u=>r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ia,{className:"w-8 h-8 rounded-full"}),r.jsx(ia,{className:"h-4 w-24"})]},u))})})]}):n.length===0?null:r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsxs(Ot,{className:"pb-3 flex flex-row items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4 text-amber-500"}),r.jsx($t,{className:"text-base",children:a||"Your Team"})]}),r.jsxs(P,{variant:"ghost",size:"sm",onClick:()=>t("/team"),className:"text-xs text-muted-foreground gap-1",children:[o?"Manage":"View"," ",r.jsx(Ya,{className:"w-3 h-3"})]})]}),r.jsx(lt,{children:r.jsx("div",{className:"space-y-2",children:n.map(u=>r.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-muted/30 transition-colors",children:[r.jsxs(an,{className:"w-8 h-8",children:[r.jsx(gn,{src:u.avatarUrl||void 0}),r.jsx(on,{className:"text-xs",children:(u.fullName||u.email||"U").charAt(0).toUpperCase()})]}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsxs("p",{className:"text-sm font-medium text-foreground truncate",children:[u.fullName||u.email||"Team Member",u.userId===e&&r.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"(you)"})]})}),r.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(bi,{className:"w-3 h-3"}),u.videoCount]})]},u.userId))})})]})},int=({className:e})=>{const[t,n]=h.useState(()=>{try{return localStorage.getItem("vidareo-ext-help-dismissed")==="true"}catch{return!1}}),[s,a]=h.useState(!1);if(t)return null;const i=()=>{n(!0);try{localStorage.setItem("vidareo-ext-help-dismissed","true")}catch{}};return r.jsxs(Md,{className:ge("relative border-primary/20 bg-primary/5",e),children:[r.jsx(ff,{className:"h-4 w-4 text-primary"}),r.jsxs(Id,{className:"pr-8",children:[r.jsx("div",{className:"flex items-start justify-between gap-2",children:r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"font-semibold text-sm text-foreground mb-1",children:"VIDAREO Extension Tips"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Get the most out of your screen recording extension."}),r.jsx(P,{variant:"ghost",size:"sm",className:"mt-1 h-6 px-2 text-xs text-primary hover:text-primary",onClick:()=>a(!s),children:s?r.jsxs(r.Fragment,{children:["Less ",r.jsx(Mm,{className:"w-3 h-3 ml-1"})]}):r.jsxs(r.Fragment,{children:["Learn more about the extension ",r.jsx(Qs,{className:"w-3 h-3 ml-1"})]})})]})}),s&&r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsxs("div",{className:"rounded-lg bg-amber-500/10 border border-amber-500/20 p-3",children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[r.jsx(wa,{className:"w-3.5 h-3.5 text-amber-600 dark:text-amber-400"}),r.jsx("span",{className:"font-semibold text-xs text-amber-700 dark:text-amber-300",children:"Restricted Pages"})]}),r.jsxs("p",{className:"text-xs text-amber-700/80 dark:text-amber-300/80 leading-relaxed",children:["The camera PiP overlay ",r.jsx("strong",{children:"cannot appear"})," on browser internal pages like"," ",r.jsx("code",{className:"bg-amber-500/10 px-1 py-0.5 rounded text-[10px]",children:"chrome://"}),","," ",r.jsx("code",{className:"bg-amber-500/10 px-1 py-0.5 rounded text-[10px]",children:"chrome-extension://"}),","," ","or the Chrome Web Store. Recording still works - your controls are always in the extension popup. The overlay will reappear on any normal webpage."]})]}),r.jsxs("div",{className:"rounded-lg bg-primary/5 border border-primary/10 p-3",children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[r.jsx(Vs,{className:"w-3.5 h-3.5 text-primary"}),r.jsx("span",{className:"font-semibold text-xs text-foreground",children:"Qu
1272ick Tips"})]}),r.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1.5",children:[r.jsxs("li",{className:"flex items-start gap-1.5",children:[r.jsx(cr,{className:"w-3 h-3 mt-0.5 shrink-0 text-primary/60"}),r.jsxs("span",{children:["In ",r.jsx("strong",{children:"Screen + Camera"})," mode, your camera pops out as a floating PiP overlay visible on any tab."]})]}),r.jsxs("li",{className:"flex items-start gap-1.5",children:[r.jsx(Hd,{className:"w-3 h-3 mt-0.5 shrink-0 text-primary/60"}),r.jsxs("span",{children:["When Chrome asks what to share, check ",r.jsx("strong",{children:'"Share tab sound"'})," to capture audio from the recorded tab."]})]}),r.jsxs("li",{className:"flex items-start gap-1.5",children:[r.jsx(Vs,{className:"w-3 h-3 mt-0.5 shrink-0 text-primary/60"}),r.jsxs("span",{children:["Record a ",r.jsx("strong",{children:"single tab"})," instead of full screen for the sharpest output."]})]})]})]}),r.jsxs("div",{className:"rounded-lg bg-destructive/5 border border-destructive/10 p-3",children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[r.jsx(wa,{className:"w-3.5 h-3.5 text-destructive"}),r.jsx("span",{className:"font-semibold text-xs text-foreground",children:"Troubleshooting"})]}),r.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"No audio?"})," - Check ",r.jsx("strong",{children:'"Share tab sound"'}),` in Chrome's share dialog. For screen/window sharing, check "Share system audio" instead.`]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Black screen?"})," - Some apps block capture. Try recording the tab directly."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Camera overlay missing?"})," - You're likely on a restricted page. Navigate to any normal website."]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Camera not showing?"})," - Ensure camera permissions are granted in the extension."]})]})]}),r.jsxs("a",{href:"https://chromewebstore.google.com/detail/lmaaoeofdlnjfenacdmdffepkniggkng",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline font-medium",children:["View extension on Chrome Web Store ",r.jsx(bn,{className:"w-3 h-3"})]})]})]}),r.jsx(P,{variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-6 w-6 text-muted-foreground hover:text-foreground",onClick:i,children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]})},f3="https://chromewebstore.google.com/detail/vidareo-screen-recorder-v/lmaaoeofdlnjfenacdmdffepkniggkng",ont=({onRecheck:e,isChecking:t})=>r.jsxs(Ie,{variant:"ghost",className:"border border-border/50",children:[r.jsx(Ot,{className:"pb-2 pt-4 px-4",children:r.jsxs($t,{className:"text-sm flex items-center gap-2",children:[r.jsx(Vs,{className:"w-4 h-4 text-primary"}),"Chrome Extension"]})}),r.jsxs(lt,{className:"space-y-2 px-4 pb-4",children:[r.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Record from any tab - even outside VIDAREO. Floating camera bubble and longer sessions."}),r.jsx(P,{asChild:!0,size:"sm",className:"w-full gap-1.5",children:r.jsxs("a",{href:f3,target:"_blank",rel:"noopener noreferrer",children:["Install E
1272xtension ",r.jsx(bn,{className:"w-3.5 h-3.5"})]})}),e&&r.jsxs("button",{type:"button",onClick:e,disabled:t,className:"w-full text-[11px] text-muted-foreground hover:text-primary transition-colors disabled:opacity-50 inline-flex items-center justify-center gap-1",children:[r.jsx(vs,{className:`w-3 h-3 ${t?"animate-spin":""}`}),t?"Checking...":"Already installed? Recheck"]})]})]}),lnt=["Same recording workflow as the web app","Record longer sessions - up to 60 minutes","Floating camera bubble survives tab switches","Capture screen + tab audio with one click"],cnt=({open:e,onOpenChange:t})=>{const n=()=>{window.open(f3,"_blank","noopener,noreferrer"),t(!1)};return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-2",children:r.jsx(Vs,{className:"w-6 h-6 text-primary"})}),r.jsx(Mt,{children:"Get the full VIDAREO experience"}),r.jsx($r,{children:"Install our free Chrome extension to record from any tab - no need to keep VIDAREO open."})]}),r.jsx("ul",{className:"space-y-2 py-2",children:lnt.map(s=>r.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[r.jsx(nt,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),r.jsx("span",{children:s})]},s))}),r.jsxs(Fr,{className:"gap-2",children:[r.jsx(P,{variant:"ghost",onClick:()=>t(!1),children:"Maybe later"}
1272),r.jsxs(P,{onClick:n,className:"gap-1.5",children:["Install Extension ",r.jsx(bn,{className:"w-4 h-4"})]})]}),r.jsx("p",{className:"text-[11px] text-muted-foreground text-center -mt-1",children:"You can install it any time from your dashboard."})]})})},dnt=()=>{const{isExtensionAvailable:e,isChecking:t,recheckExtension:n}=yv();return h.useEffect(()=>{if(e||!Gg())return;const s=setInterval(()=>{n()},1e4);return()=>clearInterval(s)},[e,n]),h.useEffect(()=>{if(e)return;const s=()=>n();return window.addEventListener("focus",s),()=>window.removeEventListener("focus",s)},[e,n]),Gg()?e?r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Se,{variant:"outline",className:"gap-1.5 border-green-500/40 bg-green-500/10 text-green-700 dark:text-green-400 hover:bg-green-500/15 cursor-default",children:[r.jsx(cl,{className:"w-3.5 h-3.5"}),"Extension: Installed"]})}),r.jsx(yt,{children:"VIDAREO Chrome Extension is active"})]})}):r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("a",{href:f3,target:"_blank",rel:"noopener noreferrer",className:"inline-flex",children:r.jsxs(Se,{variant:"outline",className:"gap-1.5 border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-400 hover:bg-amber-500/15 cursor-pointer",children:[r.jsx(Im,{className:"w-3.5 h-3.5"}),"Extension: Not installed",t?r.jsx(vs,{className:"w-3 h-3 animate-spin"}):r.jsx(bn,{className:"w-3 h-3"})]})})}),r.jsx(yt,{children:"Click to install the VIDAREO Chrome Extension"})]})}):null},qz="vidareo-mfa-prompt-dismissed",unt=()=>{const{user:e}=nr(),[t,n]=h.useState(!1);if(h.useEffect(()=>{var o;if(!e||!(((o=e.app_metadata)==null?void 0:o.providers)??[]).includes("email"))return;try{if(localStorage.getItem(qz)==="true")return}catch{}let i=!1;return(async()=>{var l;try{const[{data:c},{data:d}]=await Promise.all([F.auth.mfa.listFactors(),F.from("email_mfa_settings").select("enabled").eq("user_id",e.id).maybeSingle()]),u=(l=c==null?void 0:c.totp)==null?void 0:l.some(m=>m.status==="verified");!i&&!u&&!(d!=null&&d.enabled)&&n(!0)}catch{}})(),()=>{i=!0}},[e]),!t)return null;const s=()=>{n(!1);try{localStorage.setItem(qz,"true")}catch{}};return r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.05},className:"mb-4",children:r.jsxs("div",{className:"relative flex flex-col sm:flex-row sm:items-center gap-3 rounded-lg border border-border bg-muted/50 p-4 pr-10",children:[r.jsxs("div",{className:"flex items-start sm:items-center gap-3 flex-1 min-w-0",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:r.jsx(rp,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Add extra security to your sign-in"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"We'll email you a 6-digit code after your password. No app to install."})]})]}),r.jsx(P,{size:"sm",asChild:!0,className:"shrink-0",children:r.jsx(Cr,{to:"/settings",children:"Turn on email verification"})}),r.jsx("button",{type:"button",onClick:s,"aria-label":"Dismiss",className:"absolute top-2.5 right-2.5 text-muted-foreground hover:text-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]})})},mnt=()=>{var k,E;const{user:e}=nr(),{subscriptionTier:t,subscriptionEnd:n,isTrial:s,trialEnd:a,isGiftedAccount:i,isPremium:o,isLoading:l,checkSubscription:c}=Jl();Zrt(c);const{isAdmin:d}=sp(),[u,m]=h.useState(0),{isExtensionAvailable:f,isChecking:p,recheckExtension:x}=yv(),[g,v]=h.useState(0),[y,b]=h.useState(null),[w,S]=h.useState(!1);h.useEffect(()=>{if(l||f||!Gg())return;try{if(localStorage.getItem("vidareo-ext-onboarding-seen")==="true")return}catch{return}const R=setTimeout(()=>S(!0),800);return()=>clearTimeout(R)},[l,f]);const j=R=>{if(S(R),!R)try{localStorage.setItem("vidareo-ext-onboarding-seen","true")}catch{}};h.useEffect(()=>{if(!e)return;(async()=>{var V;const[T,D,A]=await Promise.all([F.from("videos").select("id",{count:"exact",head:!0}).eq("user_id",e.id),F.from("share_link_views").select("id",{count:"exact",head:!0}).eq("owner_id",e.id),F.from("profiles").select("full_name").eq("user_id",e.id).single()]);m(T.count||0),v(D.count||0),(V=A.data)!=null&&V.full_name&&b(A.data.full_name)})()},[e]);const N=()=>{const R=new Date().getHours();return R<12?"Good morning":R<18?"Good afternoon":"Good evening"},_=y||((k=e==null?void 0:e.user_metadata)==null?void 0:k.full_name)||((E=e==null?void 0:e.email)==null?void 0:E.split("@")[0])||"there",C=t==="team";return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("main",{className:"container mx-auto px-4 sm:px-6 md:px-8 lg:px-8 pt-24 pb-12",children:[r.jsxs(fe.div,{initial:{opacity:0,y:10}
1272,animate:{opacity:1,y:0},transition:{duration:.4},className:"mb-4","data-tour":"greeting",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsxs("h1",{className:"font-bold text-foreground text-2xl sm:text-3xl",children:[r.jsx("span",{className:"inline-block animate-wave origin-[70%_70%]",children:"👋"})," ",N(),", ",_,"!"]}),r.jsx(dnt,{})]}),r.jsx("p",{className:"text-muted-foreground mt-0.5 text-sm sm:text-base",children:"Here's what's happening with your videos"})]}),r.jsx(unt,{}),!o&&!d&&!l&&!lr()&&r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.05},className:"mb-4",children:r.jsx(Qrt,{})}),f&&r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.07},className:"mb-4",children:r.jsx(int,{})}),r.jsxs(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},children:[r.jsx("div",{"data-tour":"usage-stats",children:r.jsx(Jrt,{userId:e==null?void 0:e.id,subscriptionTier:t,totalVideos:u,totalViews:g})}),r.jsxs("div",{className:"grid mt-4 grid-cols-1 lg:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[r.jsx("div",{"data-tour":"recent-videos",children:e&&r.jsx(tnt,{userId:e.id})}),r.jsx("div",{"data-tour":"activity-feed",children:e&&r.jsx(nnt,{userId:e.id})}),C&&e&&r.jsx(ant,{userId:e.id})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 gap-4 lg:space-y-0 space-y-0",children:[r.jsx("div",{"data-tour":"quick-actions",children:r.jsx(ent,{isPremium:o,subscriptionTier:t})}),!f&&Gg()&&r.jsx(ont,{onRecheck:x,isChecking:p}),r.jsx("div",{"data-tour":"plan-card",children:r.jsx(snt,{subscriptionTier:t,subscriptionEnd:n,isGiftedAccount:i,isPremium:o,isTrial:s,trialEnd:a})})]})]})]})]}),r.jsx(cnt,{open:w,onOpenChange:j})]})},hnt=({open:e,onOpenChange:t,existingEmails:n,onConfirm:s})=>{const{user:a}=nr(),[i,o]=h.useState(!1),[l,c]=h.useState([]),[d,u]=h.useState([]),[m,f]=h.useState(""),[p,x]=h.useState("all"),[g,v]=h.useState(new Set),y=h.useMemo(()=>new Set(n.map(C=>C.trim().toLowerCase()).filter(Boolean)),[n]);h.useEffect(()=>{if(!e||!a)return;let C=!1;return o(!0),(async()=>{const[{data:k},{data:E},{data:R}]=await Promise.all([F.from("contacts").select("id, name, email").eq("user_id",a.id).order("name"),F.from("contact_lists").select("id, name, color").eq("user_id",a.id).order("name"),F.from("contact_list_members").select("list_id, contact_id")]);if(C)return;const T=new Map;(R||[]).forEach(D=>
1272{const A=T.get(D.contact_id)||[];A.push(D.list_id),T.set(D.contact_id,A)}),c((k||[]).map(D=>({id:D.id,name:D.name,email:D.email,listIds:T.get(D.id)||[]}))),u(E||[]),v(new Set),f(""),x("all"),o(!1)})(),()=>{C=!0}},[e,a]);const b=h.useMemo(()=>{const C=m.trim().toLowerCase();return l.filter(k=>p!=="all"&&!k.listIds.includes(p)?!1:C?k.name.toLowerCase().includes(C)||k.email.toLowerCase().includes(C):!0)},[l,m,p]),w=b.length>0&&b.every(C=>g.has(C.id)),S=C=>{v(k=>{const E=new Set(k);return E.has(C)?E.delete(C):E.add(C),E})},j=()=>{v(C=>{const k=new Set(C);return w?b.forEach(E=>k.delete(E.id)):b.forEach(E=>k.add(E.id)),k})},N=()=>{const C=l.filter(k=>g.has(k.id)).map(k=>k.email).filter(k=>k&&!y.has(k.trim().toLowerCase()));s(C),t(!1)},_=h.useMemo(()=>{const C=new Map;return d.forEach(k=>C.set(k.id,k)),C},[d]);return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-2xl max-h-[85vh] flex flex-col p-0",children:[r.jsx(Lt,{className:"px-6 py-4 border-b",children:r.jsxs(Mt,{className:"flex items-center gap-2 text-lg",children:[r.jsx(jr,{className:"w-5 h-5"}),"Select from Contacts"]})}),r.jsxs("div",{className:"px-6 py-3 border-b space-y-3",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Fl,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx(He,{placeholder:"Search by name or email...",value:m,onChange:C=>f(C.target.value),className:"pl-9 h-9"})]}),d.length>0&&r.jsxs(kn,{value:p,onValueChange:x,children:[r.jsx(wn,{className:"w-48 h-9",children:r.jsx(En,{placeholder:"All contacts"})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"all",children:"All contacts"}),d.map(C=>r.jsx(_t,{value:C.id,children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block",style:{backgroundColor:C.color}}),C.name]})},C.id))]})]})]}),b.length>0&&r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ci,{checked:w,onCheckedChange:j}),r.jsxs("span",{className:"text-muted-foreground",children:["Select all ",b.length," ",b.length===1?"contact":"contacts"]})]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2 min-h-[200px]",children:i?r.jsxs("div",{className:"flex items-center justify-center h-40 text-muted-foreground",children:[r.jsx(Me,{className:"w-5 h-5 animate-spin mr-2"}),"Loading contacts..."]}):l.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center px-6",children:[r.jsx(jr,{className:"w-8 h-8 text-muted-foreground mb-2"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"You don't have any contacts yet."}),r.jsx(Cr,{to:"/contacts",className:"text-sm text-primary hover:underline",children:"Add contacts →"})]}):b.length===0?r.jsx("div",{className:"flex items-center justify-center h-40 text-sm text-muted-foreground",children:"No contacts match your search."}):r.jsx("ul",{className:"divide-y divide-border",children:b.map(C=>{const k=g.has(C.id),E=y.has(C.email.trim().toLowerCase());return r.jsx("li",{children:r.jsxs("label",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-muted/50 cursor-pointer",children:[r.jsx(ci,{checked:k,onCheckedChange:()=>S(C.id)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-medium truncate",children:C.name}),E&&r.jsx(Se,{variant:"outline",className:"text-[10px] py-0",children:"Added"})]}),r.jsx("div",{className:"text-xs text-muted-foreground truncate",children:C.email})]}),C.listIds.length>0&&r.jsx("div",{className:"hidden sm:flex items-center gap-1 flex-shrink-0",children:C.listIds.slice(0,3).map(R=>{const T=_.get(R);return T?r.jsx("span",{title:T.name,className:"w-2 h-2 rounded-full",style:{backgroundColor:T.color}},R):null})})]})},C.id)})})}),r.jsxs(Fr,{className:"px-6 py-3 border-t bg-muted/30 gap-2 sm:gap-2 flex sm:justify-between items-center",children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:[g.size," selected"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r.jsxs(P,{onClick:N,disabled:g.size===0,children:["Add ",g.size>0?`${g.size} `:"",g.size===1?"recipient":"recipients"]})]})]})]})})},Ly=[{id:"default",name:"Standard",greeting:"Hi {recipientName},",message:"{senderName}
1272 sent you a video message. Click below to watch!",closing:""},{id:"professional",name:"Professional",greeting:"Hello {recipientName},",message:"I wanted to share this video with you. I believe you'll find it valuable and would love to hear your thoughts.",closing:`Best regards,
1273{senderName}`},{id:"friendly",name:"Friendly",greeting:"Hey {recipientName}! 👋",message:"Check out this video I made for you! I think you're going to love it.",closing:`Talk soon!
1274{senderName}`},{id:"sales",name:"Sales Outreach",greeting:"Hi {recipientName},",message:"I put together this quick video to show you how we can help. It's personalized just for you and covers the key points we discussed.",closing:`Looking forward to connecting!
1275{senderName}`},{id:"followup",name:"Follow-up",greeting:"Hi {recipientName},",message:"Following up on our conversation - I recorded this video to give you more details and answer some questions. Let me know if you have any feedback!",closing:`Thanks for your time,
1276{senderName}`},{id:"custom",name:"Custom Message",greeting:"",message:"",closing:""}],fnt=[{id:"vidareo",name:"Send via Vidareo",description:"Beautiful HTML email with tracking",icon:r.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-primary to-blue-500 flex items-center justify-center shadow-lg",children:r.jsx(zr,{className:"w-6 h-6 text-white"})}),recommended:!0}
1276,{id:"gmail",name:"Gmail",icon:r.jsx("div",{className:"w-12 h-12 rounded-full bg-white shadow-md flex items-center justify-center border border-gray-100",children:r.jsx("svg",{viewBox:"0 0 24 24",className:"w-7 h-7",children:r.jsx("path",{fill:"#EA4335",d:"M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z"})})})},{id:"apple",name:"Apple Mail",icon:r.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 shadow-md flex items-center justify-center",children:r.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:r.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"})})})},{id:"outlook",name:"Outlook",icon:r.jsx("div",{className:"w-12 h-12 rounded-full bg-white shadow-md flex items-center justify-center border border-gray-100",children:r.jsx("svg",{viewBox:"0 0 24 24",className:"w-7 h-7",children:r.jsx("path",{fill:"#0078D4",d:"M24 7.387v10.478c0 .23-.08.424-.238.576a.788.788 0 0 1-.574.234h-8.313v-6.09l1.58 1.177a.39.39 0 0 0 .478-.004l5.908-4.46a.392.392 0 0 0 .159-.32V7.387zM24 5.39v.727a.393.393 0 0 1-.16.316l-6.064 4.575a.392.392 0 0 1-.472.004l-1.617-1.21v-3.8h7.526c.232 0 .424.078.576.23a.788.788 0 0 1 .211.158zM13.313 6.001v13.06c0 .315-.165.54-.496.68a.855.855 0 0 1-.337.068H0V6.682c0-.315.165-.542.496-.68a.855.855 0 0 1 .337-.068l12.48.067zM9.25 9.156a3.566 3.566 0 0 0-2.774 1.19 4.27 4.27 0 0 0-1.076 2.969 4.107 4.107 0 0 0 1.062 2.89 3.544 3.544 0 0 0 2.732 1.156 3.603 3.603 0 0 0 2.794-1.183 4.257 4.257 0 0 0 1.069-2.982 4.097 4.097 0 0 0-1.055-2.87 3.57 3.57 0 0 0-2.752-1.17zm-.048 1.548c.72 0 1.295.282 1.727.845.432.564.648 1.283.648 2.159 0 .895-.218 1.627-.654 2.196-.436.57-1.008.854-1.717.854-.72 0-1.298-.279-1.733-.838-.436-.559-.654-1.282-.654-2.17 0-.895.218-1.627.654-2.196.436-.57 1.009-.85 1.73-.85z"})})})},{id:"other",name:"Other Email App",icon:r.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-100 shadow-md flex items-center justify-center border border-gray-200",children:r.jsx(zr,{className:"w-6 h-6 text-gray-500"})})}],pnt=({open:e,onOpenChange:t,recipientEmail:n,recipientName:s,subject:a,shareLink:i,videoTitle:o,password:l,senderName:c,customMessage:d,onSendViaVidareo:u,isSending:m,isAtLimit:f,subscriptionTier:p})=>{const x=()=>{let y=d||`Hi${s?` ${s}`:""},
1277
1278${c||"Someone"} sent you a video message.
1279
1280Click below to watch:`;return y+=`
1281
1282🎬 ${o}
1283${i}`,l&&(y+=`
1284
1285🔒 Password: ${l}`),y},g=y=>{if(y==="vidareo"){u();return}const b=encodeURIComponent(x()),w=encodeURIComponent(a),S=n.trim()?encodeURIComponent(n.trim()):"";let j="";switch(y){case"gmail":j=`https://mail.google.com/mail/?view=cm&fs=1&to=${S}&su=${w}&body=${b}`;break;case"outlook":j=`https://outlook.live.com/mail/0/deeplink/compose?to=${S}&subject=${w}&body=${b}`;break;case"apple":case"other":default:j=`mailto:${S}?subject=${w}&body=${b}`;break}window.open(j,"_blank"),t(!1)},v=n.trim()&&!(p==="starter"&&f);return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsxs(Lt,{className:"text-center pb-2",children:[r.jsx(Mt,{className:"text-xl",children:"Select email provider"}),r.jsx($r,{className:"sr-only",children:"Choose how you want to send this email"})]}),r.jsx("div",{className:"grid grid-cols-2 gap-4 py-4",children:fnt.map(y=>{const b=y.id==="vidareo",w=b&&!v;return r.jsxs("button",{onClick:()=>!w&&g(y.id),disabled:w||b&&m,className:`
1286                  relative flex flex-col items-center gap-2 p-4 rounded-xl transition-all
1287                  ${b?"col-span-2 bg-gradient-to-r from-primary/10 to-blue-500/10 border-2 border-primary/30 hover:border-primary/50":"bg-muted/30 hover:bg-muted border border-transparent hover:border-border"}
1288                  ${w?"opacity-50 cursor-not-allowed":"cursor-pointer hover:scale-[1.02]"}
1289                `,children:[y.recommended&&r.jsxs("span",{className:"absolute -top-2 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-primary text-primary-foreground text-[10px] font-medium rounded-full flex items-center gap-1",children:[r.jsx(nt,{className:"w-3 h-3"}),"Recommended"]}),r.jsx("div",{className:"mt-1",children:b&&m?r.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-primary to-blue-500 flex items-center justify-center shadow-lg",children:r.jsx(Me,{className:"w-6 h-6 text-white animate-spin"})}):y.icon}),r.jsx("span",{className:`text-sm font-medium ${b?"text-primary":""}`,children:y.name}),y.description&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:y.description}),b&&!n.trim()&&r.jsx("span",{className:"text-[10px] text-amber-600",children:"Enter email above for tracking"})]},y.id)})}),r.jsx("p",{className:"text-[10px] text-muted-foreground text-center",children:"Other apps will open with a plain-text version of your message"})]})})},mie=({open:e,onOpenChange:t,recipientEmail:n,recipientName:s,videoTitle:a,videoDescription:i,shareLink:o,thumbnailUrl:l,password:c,senderName:d,customMessage:u,customSubject:m,onSend:f,isSending:p,signatureEnabled:x,showLogoInEmail:g=!0,customSignature:v})=>{const y=s?`Hi ${s},`:"Hi,",b=d||"Someone",w=m||`${b} sent you a video: ${a}`,S=u?u.split(`
1290
1291`).filter(Boolean):null,j=g&&(v==null?void 0:v.logoUrl),N=x&&v&&(v.businessName||v.jobTitle),_=v==null?void 0:v.headerSubtitle,C=j?v.logoUrl:"https://vidareo.com/vidareo-email-logo.png";return r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-2xl max-h-[90vh] overflow-hidden p-0",children:[r.jsxs(Lt,{className:"px-6 py-4 border-b",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wr,{className:"w-5 h-5"}),r.jsx(Mt,{className:"text-lg",children:"Email Preview"})]}),r.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[r.jsx("strong",{children:"To:"})," ",n]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.jsx("strong",{children:"Subject:"})," ",w]})]}),r.jsx("div",{className:"overflow-y-auto max-h-[60vh]",children:r.jsx("div",{style:{backgroundColor:"#f4f4f5",padding:"24px 16px"},children:r.jsxs("div",{style:{maxWidth:"600px",margin:"0 auto",backgroundColor:"#ffffff",borderRadius:"12px",overflow:"hidden",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[r.jsxs("div",{style:{background:"linear-gradient(135deg, #f4f4f5 0%, #e5e7eb 100%)",padding:"40px 30px",textAlign:"center"},children:[r.jsx("img",{src:C,alt:"Logo",style:{display:"block",maxWidth:"280px",height:"auto",objectFit:"contain",marginBottom:"16px",marginLeft:"auto",marginRight:"auto"}}),j?v!=null&&v.headerSubtitle?r.jsx("p",{style:{margin:0,fontSize:"16px",letterSpacing:"1px",color:"#71717a"},children:v.headerSubtitle}):null:_&&(v!=null&&v.headerSubtitle)?r.jsx("p",{style:{margin:0,fontSize:"16px",letterSpacing:"1px",color:"#71717a"},children:v.headerSubtitle}):r.jsxs("p",{style:{margin:0,fontSize:"16px",letterSpacing:"1px"},children:[r.jsx("span",{style:{color:"#ef4444",fontWeight:600},children:"Record"}),r.jsx("span",{style:{color:"#71717a"},children:" • "}),r.jsx("span",{style:{color:"#3b82f6",fontWeight:600},children:"Share"}),r.jsx("span",{style:{color:"#71717a"},children:" • "}),r.jsx("span",{style:{color:"#22c55e",fontWeight:600},children:"Connect."})]})]}),r.jsxs("div",{style:{padding:"40px 30px"},children:[S&&S.length>0?S.map((k,E)=>r.jsx("p",{style:{margin:"0 0 16px 0",color:"#3f3f46",fontSize:"16px",lineHeight:1.6,whiteSpace:"pre-wrap"},children:k},E)):r.jsxs(r.Fragment,{children:[r.jsx("p",{style:{margin:"0 0 20px 0",color:"#3f3f46",fontSize:"16px",lineHeight:1.6},children:y}),r.jsxs("p",{style:{margin:"0 0 20px 0",color:"#3f3f46",fontSize:"16px",lineHeight:1.6},children:[b," sent you a video message:"]})]}),r.jsxs("h2",{style:{margin:"0 0 8px 0",color:"#18181b",fontSize:"20px",fontWeight:600},children:["🎬 ",a]}),i&&r.jsx("p",{style:{margin:"0 0 20px 0",color:"#71717a",fontSize:"14px",lineHeight:1.5},children:i}),l&&!l.startsWith("data:")&&r.jsx("div",{style:{margin:"20px 0",textAlign:"center"},children:r.jsx("img",{src:l,alt:a,style:{maxWidth:"100%",width:"480px",height:"auto",borderRadius:"12px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"}})}),c&&r.jsx("div",{style:{backgroundColor:"#fef3c7",border:"1px solid #fcd34d",borderRadius:"8px",padding:"16px",margin:"20px 0"},children:r.jsxs("p",{style:{margin:0,color:"#92400e",fontSize:"14px"},children:["🔒 ",r.jsx("strong",{children:"This video is password protected"}),r.jsx("br",{}),"Password: ",r.jsx("code",{style:{background:"#ffffff",padding:"2px 8px",borderRadius:"4px",fontFamily:"monospace"},children:c})]})}),r.jsx("div",{style:{textAlign:"center",margin:"30px 0"},children:r.jsx("span",{style:{display:"inline-block",background:"linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%)",color:"#ffffff",padding:"16px 40px",borderRadius:"8px",fontWeight:600,fontSize:"16px"},children:"▶️ Watch Video"})}),r.jsxs("p",{style:{margin:"20px 0 0 0",color:"#71717a",fontSize:"14px",textAlign:"center"},children:["Or copy this link: ",r.jsx("span",{style:{color:"#0ea5e9",wordBreak:"break-all"},children:o})]}),N&&v&&r.jsx("div",{style:{marginTop:"28px",borderTop:"1px solid #e5e7eb",paddingTop:"28px"},children:r.jsx("table",{width:"100%",cellPadding:0,cellSpacing:0,children:r.jsx("tbody",{children:r.jsxs("tr",{children:[v.avatarUrl&&r.jsx("td",{style:{verticalAlign:"top",width:"56px"},children:r.jsx("img",{src:v.avatarUrl,alt:"Profile",style:{width:"48px",height:"48px",borderRadius:"50%",objectFit:"cover"}})}),r.jsxs("td",{style:{verticalAlign:"top",paddingLeft:v.avatarUrl?"12px":"0"},children:[v.fullName&&r.jsx("p",{style:{margin:"0 0 4px 0",fontWeight:600,color:"#18181b",fontSize:"16px"},children:v.fullName}),v.jobTitle&&r.jsx("p",{style:{margin:"0 0 4px 0",color:"#71717a",fontSize:"14px"},children:v.jobTitle}),v.businessName&&r.jsx("p",{style:{margin:"0 0 8px 0",color:"#71717a",fontSize:"14px",fontWeight:500},children:v.businessName}),v.customText&&r.jsx("p",{style:{margin:"0 0 8px 0",color:"#71717a",fontSize:"13px",fontStyle:"italic"},children:v.customText}),(v.phone||v.email)&&r.jsxs("p",{style:{margin:0,color:"#71717a",fontSize:"13px"},children:[v.phone&&`📞 ${v.phone}`,v.phone&&v.email&&"  |  ",v.email&&`✉️ ${v.email}`]})]})]})})})})]}),r.jsx("div",{style:{backgroundColor:"#f9fafb",padding:"25px 30px",textAlign:"center",borderTop:"1px solid #e5e7eb"},children:j||N?r.jsxs("p",{style:{margin:0,color:"#9ca3af",fontSize:"11px"},children:["Powered by ",r.jsx("span",{style:{color:"#0ea5e9"},children:"VIDAREO"})]}):r.jsxs("p",{style:{margin:0,color:"#9ca3af",fontSize:"12px"},children:["© ",new Date().getFullYear()," VIDAREO. All rights reserved."]})})]})})}),r.jsxs(Fr,{className:"px-6 py-4 border-t bg-muted/30 gap-2 sm:gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r.jsx(P,{onClick:f,disabled:p,children:p?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"w-4 h-4 mr-2"}),"Send Email"]})})]})]})})},xnt=({recipientName:e,setRecipientName:t,recipientEmail:n,setRecipientEmail:s,recipientEmailError:a,videoTitle:i,videoDescription:o,shareLink:l,thumbnailUrl:c,password:d,senderName:u,selectedTemplateId:m,setSelectedTemplateId:f,customEmailMessage:p,setCustomEmailMessage:x,customSubjectLine:g,setCustomSubjectLine:v,onSendViaVidareo:y,isSending:b,isAtLimit:w,subscriptionTier:S,signatureEnabled:j,showLogoInEmail:N,customSignature:_})=>{const{user:C}
1291=nr(),[k,E]=h.useState(!1),[R,T]=h.useState(!1),[D,A]=h.useState(!1);h.useState(!1);const[V,U]=h.useState(null),[O,M]=h.useState([]),[$,I]=h.useState(!1);h.useEffect(()=>{if(!C)return;(async()=>{const{data:Ne}=await F.from("user_email_templates").select("id, name, greeting, message, closing, is_default").eq("user_id",C.id).order("created_at",{ascending:!1});Ne&&M(Ne)})()},[C]);const B=a||V,K=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Z=n.split(/[\s,;]+/).map(ue=>ue.trim()).filter(Boolean),q=Array.from(new Set(Z.map(ue=>ue.toLowerCase()))),H=q.filter(ue=>K.test(ue)),X=q.filter(ue=>!K.test(ue)),G=H.length,ee=G>1,re=ue=>{const Ne=new Set,Qe=[];return ue.split(/[\s,;]+/).forEach(J=>{const de=J.trim();if(!de)return;const ve=de.toLowerCase();Ne.has(ve)||(Ne.add(ve),Qe.push(de))}),Qe.join(", ")};h.useEffect(()=>{n.trim()&&U(null)},[n]);const W=`${u||"Someone"} sent you a video: ${i}`,Q=g.trim()||W,L=p.replace(/\{recipientName\}/g,e.trim()||"there").replace(/\{senderName\}/g,u||"Someone").replace(/\{videoTitle\}/g,i),te=Q.replace(/\{recipientName\}/g,e.trim()||"there").replace(/\{senderName\}/g,u||"Someone").replace(/\{videoTitle\}/g,i),ae=()=>{const ue=Ly.find(Qe=>Qe.id===m)||Ly[0],Ne=`${ue.greeting}
1292
1293${ue.message}
1294
1295${ue.closing}`;x(Ne),v(""),E(!1)};h.useEffect(()=>{p||ae()},[m]);const ne=ue=>{f(ue);const Ne=Ly.find(J=>J.id===ue);if(Ne){const J=`${Ne.greeting}
1296
1297${Ne.message}
1298
1299${Ne.closing}`;x(J);return}const Qe=O.find(J=>`user_${J.id}`===ue);if(Qe){const J=[Qe.greeting,Qe.message,Qe.closing].filter(Boolean);x(J.join(`
1300
1301`))}},se=G>0&&X.length===0&&!a;return r.jsxs("div",{className:"space-y-4 border border-border rounded-lg p-4 bg-card",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(zr,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"font-medium text-sm",children:"Send with embedded preview"})]}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx("button",{className:"text-muted-foreground hover:text-foreground",children:r.jsx(ql,{className:"w-4 h-4"})})}),r.jsx(yt,{side:"left",className:"max-w-[250px] text-xs",children:r.jsx("p",{children:"When you provide the recipient's email, you'll be able to track when they view the video."})})]})})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{htmlFor:"recipient-name",className:"text-xs",children:"Recipient Name"}),r.jsx(He,{id:"recipient-name",placeholder:"e.g., John",value:e,onChange:ue=>t(ue.target.value),className:"h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(ye,{htmlFor:"recipient-email",className:"text-xs",children:["Recipient Email",ee?"s":"(s)"]}),r.jsxs("button",{type:"button",onClick:()=>I(!0),className:"text-[11px] font-medium text-primary hover:underline flex items-center gap-1",children:[r.jsx(jr,{className:"w-3 h-3"}),"From contacts"]})]}),r.jsx(He,{id:"recipient-email",type:"text",placeholder:"[email protected], [email protected]",value:n,onChange:ue=>s(ue.target.value),onBlur:()=>{const ue=re(n);ue!==n&&s(ue)},className:`h-9 ${B||X.length>0?"border-destructive":""}`}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Separate multiple emails with commas"}),G>1&&r.jsxs("span",{className:"text-[10px] font-medium text-primary bg-primary/10 px-1.5 py-0.5 rounded",children:[G," recipients"]})]}),B&&r.jsx("p",{className:"text-[10px] text-destructive",children:B}),X.length>0&&!B&&r.jsxs("p",{className:"text-[10px] text-destructive",children:["Invalid: ",X.join(", ")]})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{htmlFor:"subject-line",className:"text-xs",children:"Subject Line (optional)"}),r.jsx(He,{id:"subject-line",placeholder:W,value:g,onChange:ue=>v(ue.target.value),className:"h-9"}),r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Use ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"{videoTitle}"})," for the video name"]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(_n,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"text-sm font-medium",children:"Email Template"})]}),r.jsxs(kn,{value:m,onValueChange:ne,children:[r.jsx(wn,{className:"h-9",children:r.jsx(En,{placeholder:"Select template"})}),r.jsxs(jn,{children:[r.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Built-in"}),Ly.map(ue=>r.jsx(_t,{value:ue.id,children:ue.name},ue.id)),O.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground mt-2",children:"Your Templates"}),O.map(ue=>r.jsx(_t,{value:`user_${ue.id}`,children:r.jsxs("span",{className:"flex items-center gap-1",children:[ue.name,ue.is_default&&r.jsx(Ib,{className:"w-3 h-3 text-yellow-500 fill-yellow-500"})]})},`user_${ue.id}`))]})]})]}),r.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[r.jsx("span",{children:"Preview (click Edit to customize)"}),r.jsxs("button",{onClick:()=>E(!k),className:"flex items-center gap-1 text-primary hover:underline",children:[r.jsx(ZH,{className:"w-3 h-3"}),k?"Done":"Edit"]}),r.jsxs("button",{onClick:ae,className:"flex items-center gap-1 hover:text-foreground",children:[r.jsx(Wd,{className:"w-3 h-3"}),"Reset"]})]}),k?r.jsx($s,{value:p,onChange:ue=>x(ue.target.value),className:"min-h-[120px] text-sm",placeholder:"Write your message..."}):r.jsx("div",{className:"bg-muted/50 rounded-lg p-3 min-h-[80px] text-sm text-muted-foreground whitespace-pre-wrap",children:L||"No message content"}),r.jsxs("p",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:["💡 Tip: Use ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"{recipientName}"})," and"," ",r.jsx("code",{className:"bg-muted px-1 rounded",children:"{senderName}"})," for personalization"]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",className:"flex-1",onClick:()=>A(!0),children:[r.jsx(wr,{className:"w-4 h-4 mr-2"}),"Preview"]}),r.jsx(P,{className:"flex-1 bg-gradient-to-r from-primary to-blue-500 hover:from-primary/90 hover:to-blue-500/90",onClick:()=>
1301{if(!n.trim()){U("Recipient email is required");return}if(se)y();else return},disabled:b||S==="starter"&&w,children:b?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"w-4 h-4 mr-2"}),ee?`Send to ${G} recipients`:"Send"]})})]}),r.jsx("p",{className:"text-[10px] text-muted-foreground text-center",children:"Sends a beautiful email with thumbnail preview"}),r.jsx(pnt,{open:R,onOpenChange:T,recipientEmail:n,recipientName:e,subject:te,shareLink:l,videoTitle:i,password:d,senderName:u,customMessage:L,onSendViaVidareo:()=>{T(!1),y()},isSending:b,isAtLimit:w,subscriptionTier:S}),r.jsx(mie,{open:D,onOpenChange:A,recipientEmail:n||"[email protected]",recipientName:e,videoTitle:i,videoDescription:o,shareLink:l,thumbnailUrl:c,password:d,senderName:u,customMessage:L,customSubject:te,onSend:()=>{A(!1),y()},isSending:b,signatureEnabled:j,showLogoInEmail:N,customSignature:_}),r.jsx(hnt,{open:$,onOpenChange:I,existingEmails:Z,onConfirm:ue=>{if(ue.length===0)return;const Ne=n.trim(),Qe=Ne?`${Ne.replace(/[,;\s]+$/,"")}, ${ue.join(", ")}`:ue.join(", ");s(re(Qe))}})]})},gnt=({greeting:e,message:t,closing:n,branding:s})=>{const a=s&&(s.businessName||s.logoUrl),i=a&&(s!=null&&s.logoUrl)?s.logoUrl:"https://vidareo.com/vidareo-email-logo.png";return r.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:r.jsx("div",{style:{backgroundColor:"#f4f4f5",padding:"12px 8px"},children:r.jsxs("div",{style:{maxWidth:"500px",margin:"0 auto",backgroundColor:"#ffffff",borderRadius:"12px",overflow:"hidden",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[r.jsxs("div",{style:{background:"linear-gradient(135deg, #f4f4f5 0%, #e5e7eb 100%)",padding:"20px 16px",textAlign:"center"},children:[r.jsx("img",{src:i,alt:"Logo",style:{display:"block",maxWidth:"160px",height:"auto",objectFit:"contain",margin:"0 auto 6px"}}),a&&(s!=null&&s.headerSubtitle)?r.jsx("p",{style:{margin:0,fontSize:"11px",letterSpacing:"1px",color:"#71717a"},children:s.headerSubtitle}):r.jsxs("p",{style:{margin:0,fontSize:"11px",letterSpacing:"1px"},children:[r.jsx("span",{style:{color:"#ef4444",fontWeight:600},children:"Record"}),r.jsx("span",{style:{color:"#71717a"},children:" • "}),r.jsx("span",{style:{color:"#3b82f6",fontWeight:600},children:"Share"}),r.jsx("span",{style:{color:"#71717a"},children:" • "}),r.jsx("span",{style:{color:"#22c55e",fontWeight:600},children:"Connect."})]})]}),r.jsxs("div",{style:{padding:"20px 16px"},children:[e&&r.jsx("p",{style:{margin:"0 0 10px 0",color:"#3f3f46",fontSize:"13px",lineHeight:1.6},children:e}),r.jsx("p",{style:{margin:"0 0 10px 0",color:"#3f3f46",fontSize:"13px",lineHeight:1.6,whiteSpace:"pre-wrap"},children:t}),n&&r.jsx("p",{style:{margin:"0 0 14px 0",color:"#3f3f46",fontSize:"13px",lineHeight:1.6},children:n}),r.jsx("h2",{style:{margin:"0 0 6px 0",color:"#18181b",fontSize:"14px",fontWeight:600},children:"🎬 Sample Video Title"}),r.jsx("div",{style:{textAlign:"center",margin:"16px 0"},children:r.jsx("span",{style:{display:"inline-block",background:"linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%)",color:"#ffffff",padding:"10px 28px",borderRadius:"8px",fontWeight:600,fontSize:"13px"},children:"▶️ Watch Video"})}),a&&s&&r.jsx("div",{style:{marginTop:"20px",borderTop:"1px solid #e5e7eb",paddingTop:"20px"},children:r.jsx("table",{width:"100%",cellPadding:0,cellSpacing:0,children:r.jsx("tbody",{children:r.jsxs("tr",{children:[s.avatarUrl&&r.jsx("td",{style:{verticalAlign:"top",width:"44px"},children:r.jsx("img",{src:s.avatarUrl,alt:"Profile",style:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover"}})}),r.jsxs("td",{style:{verticalAlign:"top",paddingLeft:s.avatarUrl?"10px":"0"},children:[s.fullName&&r.jsx("p",{style:{margin:"0 0 2px 0",fontWeight:600,color:"#18181b",fontSize:"13px"},children:s.fullName}),s.jobTitle&&r.jsx("p",{style:{margin:"0 0 2px 0",color:"#71717a",fontSize:"12px"},children:s.jobTitle}),s.businessName&&r.jsx("p",{style:{margin:"0 0 4px 0",color:"#71717a",fontSize:"12px",fontWeight:500},children:s.businessName}),s.customText&&r.jsx("p",{style:{margin:"0 0 4px 0",color:"#71717a",fontSize:"11px",fontStyle:"italic"},children:s.customText}),(s.phone||s.email)&&r.jsxs("p",{style:{margin:0,color:"#71717a",fontSize:"11px"},children:[s.phone&&`📞 ${s.phone}
1301`,s.phone&&s.email&&"  |  ",s.email&&`✉️ ${s.email}`]})]})]})})})})]}),r.jsx("div",{style:{backgroundColor:"#f9fafb",padding:"12px 16px",textAlign:"center",borderTop:"1px solid #e5e7eb"},children:a?r.jsxs("p",{style:{margin:0,color:"#9ca3af",fontSize:"10px"},children:["Powered by ",r.jsx("span",{style:{color:"#0ea5e9"},children:"VIDAREO"})]}):r.jsxs("p",{style:{margin:0,color:"#9ca3af",fontSize:"10px"},children:["© ",new Date().getFullYear()," VIDAREO. All rights reserved."]})})]})})})},vnt=()=>{const{user:e}=nr(),{toast:t}=Gr(),[n,s]=h.useState([]),[a,i]=h.useState(!0),[o,l]=h.useState(null),[c,d]=h.useState(!1),[u,m]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState(!1),[v,y]=h.useState(null),[b,w]=h.useState(!1),[S,j]=h.useState(""),[N,_]=h.useState("Hi {recipientName},"),[C,k]=h.useState(""),[E,R]=h.useState("");h.useEffect(()=>{e&&(D(),T())},[e]);const T=async()=>{if(!e)return;const{data:q}=await F.from("profiles").select("full_name, job_title, business_name, phone, email, signature_enabled, subscription_tier, company_logo_url, email_header_subtitle, avatar_url, signature_custom_text").eq("user_id",e.id).single();q&&(q.subscription_tier!=="starter"&&q.signature_enabled?l({fullName:q.full_name||void 0,jobTitle:q.job_title||void 0,businessName:q.business_name||void 0,phone:q.phone||void 0,email:q.email||void 0,logoUrl:q.company_logo_url||void 0,headerSubtitle:q.email_header_subtitle||void 0,avatarUrl:q.avatar_url||void 0,customText:q.signature_custom_text||void 0}):l(null))},D=async()=>{if(!e)return;i(!0);const{data:q,error:H}=await F.from("user_email_templates").select("*").eq("user_id",e.id).order("created_at",{ascending:!1});!H&&q&&s(q),i(!1)},A=()=>{j(""),_("Hi {recipientName},"),k(""),R(""),w(!1)},V=h.useMemo(()=>{const q=H=>H.replace(/\{recipientName\}/g,"John").replace(/\{senderName\}/g,"You");return{greeting:q(N),message:q(C),closing:q(E)}},[N,C,E]),U=async()=>{if(!(!e||!S.trim()||!C.trim())){g(!0);try{const{error:q}=await F.from("user_email_templates").insert({user_id:e.id,name:S.trim(),greeting:N.trim(),message:C.trim(),closing:E.trim()});if(q)throw q;t({title:"Template created",description:`"${S}" has been saved.`}),d(!1),A(),D()}catch(q){t({title:"Error creating template",description:q.message,variant:"destructive"})}finally{g(!1)}}},O=async()=>{if(!(!e||!f||!S.trim()||!C.trim())){g(!0);try{const{error:q}=await F.from("user_email_templates").update({name:S.trim(),greeting:N.trim(),message:C.trim(),closing:E.trim()}).eq("id",f.id).eq("user_id",e.id);if(q)throw q;t({title:"Template updated",description:`"${S}" has been saved.`}),m(!1),p(null),A(),D()}catch(q){t({title:"Error updating template",description:q.message,variant:"destructive"})}finally{g(!1)}}},M=async q=>{if(e){y(q.id);try{const{error:H}=await F.from("user_email_templates").delete().eq("id",q.id).eq("user_id",e.id);if(H)throw H;t({title:"Template deleted",description:`"${q.name}" has been removed.`}),D()}catch(H){t({title:"Error deleting template",description:H.message,variant:"destructive"})}finally{y(null)}}},$=async q=>{if(e)try{await F.from("user_email_templates").update({is_default:!1}).eq("user_id",e.id);const{error:H}=await F.from("user_email_templates").update({is_default:!q.is_default}).eq("id",q.id).eq("user_id",e.id);if(H)throw H;t({title:q.is_default?"Default removed":"Default template set",description:q.is_default?"No default template selected.":`"${q.name}" will be auto-selected when composing.`}),D()}catch(H){t({title:"Error",description:H.message,variant:"destructive"})}},I=q=>{p(q),j(q.name),_(q.greeting),k(q.message),R(q.closing),w(!1),m(!0)},B=q=>{j(`${q.name} (Copy)`),_(q.greeting),k(q.message),R(q.closing),w(!1),d(!0)},K=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Template Name"}),r.jsx(He,{value:S,onChange:q=>j(q.target.value),placeholder:"e.g., Product Demo, Team Update",autoFocus:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Greeting"}),r.jsx(He,{value:N,onChange:q=>_(q.target.value),placeholder:"Hi {recipientName},"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Message Body"}),r.jsx($s,{value:C,onChange:q=>k(q.target.value),placeholder:"Write the main content of your email...",className:"min-h-[100px] resize-none"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Closing"}),r.jsx(He,{value:E,onChange:q=>R(q.target.value),placeholder:"Best regards, {senderName}"})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["💡 Use ",r.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"{recipientName}"})," and ",r.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"{senderName}"})," for personalization"]}),r.jsxs("div",{children:[r.jsxs(P,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 text-xs",onClick:()=>w(!b),disabled:!C.trim(),children:[b?r.jsx(Pb,{className:"h-3.5 w-3.5"}):r.jsx(wr,{className:"h-3.5 w-3.5"}),b?"Hide Preview":"Preview"]}),b&&C.trim()&&r.jsxs("div",{className:"mt-2",children:[r.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Preview (sample: John / You)"}),r.jsx(gnt,{greeting:V.greeting,message:V.message,closing:V.closing,branding:o})]})]})]}),Z=Ly.filter(q=>q.id!=="custom");return r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h2",{className:"font-semibold text-sm",children:"Built-in Templates"}),r.jsxs(Se,{variant:"outline",className:"text-[10px]",children:[Z.length," templates"]})]}),r.jsx("div",{className:"divide-y divide-border rounded-lg border border-border overflow-hidden",children:Z.map(q=>r.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 hover:bg-muted/30 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[r.jsx(Ni,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),r.jsx("span",{className:"text-sm font-medium truncate",children:q.name}),r.jsxs("span",{className:"text-xs text-muted-foreground truncate hidden sm:inline",children:[q.message.slice(0,50),q.message.length>50?"…":""]})]}),r.jsxs(P,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1 flex-shrink-0",onClick:()=>B(q),title:"Duplicate as custom template",children:[r.jsx(ui,{className:"h-3 w-3"}),r.jsx("span",{className:"hidden sm:inline",children:"Customize"})]})]},q.id))})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h2",{className:"font-semibold text-sm",children:"Your Templates"}),r.jsxs(P,{onClick:()=>{A(),d(!0)},size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:[r.jsx(Ns,{className:"h-3 w-3"}),"New"]})]}),a?r.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:"Loading..."}):n.length===0?r.jsxs("div",{className:"rounded-lg border border-dashed border-border p-6 text-center",children:[r.jsx(el,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground opacity-40"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"No custom templates yet"}),r.jsxs(P,{variant:"outline",size:"sm",className:"mt-3 h-7 text-xs",onClick:()=>{A(),d(!0)},children:[r.jsx(Ns,{className:"h-3 w-3 mr-1"}),"Create Template"]})]}):r.jsx("div",{className:"divide-y divide-border rounded-lg border border-border overflow-hidden",children:n.map(q=>r.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 hover:bg-muted/30 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[r.jsx("span",{className:"text-sm font-medium truncate",children:q.name}),q.is_default&&r.jsxs(Se,{variant:"secondary",className:"text-[9px] gap-0.5 px-1.5 py-0",children:[r.jsx(Ib,{className:"h-2.5 w-2.5 fill-yellow-500 text-yellow-500"}),"Default"]}),r.jsxs("span",{className:"text-xs text-muted-foreground truncate hidden sm:inline",children:[q.message.slice(0,40),q.message.length>40?"…":""]})]}),r.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>$(q),title:q.is_default?"Remove default":"Set as default",children:r.jsx(Ib,{className:`h-3.5 w-3.5 ${q.is_default?"fill-yellow-500 text-yellow-500":"text-muted-foreground"}`})}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>I(q),children:r.jsx(tl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>M(q),disabled:v===q.id,children:r.jsx(Xr,{className:"h-3.5 w-3.5 text-destructive"})})]})]},q.id))})]}),r.jsx(It,{open:c,onOpenChange:d,children:r.jsxs(Dt,{className:"sm:max-w-lg",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Create Email Template"}),r.jsx($r,{children:"Build a reusable template for your video share emails."})]}),r.jsx("div",{className:"space-y-4 py-2",children:K}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),r.jsx(P,{onClick:U,disabled:!S.trim()||!C.trim()||x,children:x?"Creating...":"Create Template"})]})]})}),r.jsx(It,{open:u,onOpenChange:m,children:r.jsxs(Dt,{className:"sm:max-w-lg",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Edit Email Template"}),r.jsx($r,{children:"Update your saved template."})]}),r.jsx("div",{className:"space-y-4 py-2",children:K}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),r.jsx(P,{onClick:O,disabled:!S.trim()||!C.trim()||x,children:x?"Saving...":"Save Changes"})]})]})})]})},ynt=({subscriptionTier:e,onBrandingUpdated:t})=>{const{user:n}=nr(),{toast:s}=Gr(),a=h.useRef(null),[i,o]=h.useState(!1),[l,c]=h.useState(!1),[d,u]=
1301h.useState(!1),[m,f]=h.useState(!0),[p,x]=h.useState(null),[g,v]=h.useState(""),[y,b]=h.useState(""),[w,S]=h.useState(""),[j,N]=h.useState(""),[_,C]=h.useState(""),[k,E]=h.useState(null),[R,T]=h.useState(!1),D=e!=="starter",A=I=>{u(I.signature_enabled??!1),f(I.show_logo_in_email??!0),x(I.company_logo_url||null),v(I.email_header_subtitle||""),b(I.job_title||""),S(I.business_name||""),N(I.phone||""),C(I.signature_custom_text||"")};h.useEffect(()=>{if(!n)return;const I=async()=>{const{data:K}=await F.from("profiles").select("job_title, business_name, phone, signature_enabled, company_logo_url, email_header_subtitle, signature_custom_text, show_logo_in_email").eq("user_id",n.id).single();K&&A(K)};I();const B=()=>{document.visibilityState==="visible"&&I()};return document.addEventListener("visibilitychange",B),()=>document.removeEventListener("visibilitychange",B)},[n]);const V=I=>{var Z;const B=(Z=I.target.files)==null?void 0:Z[0];if(!B||!n)return;if(!B.type.startsWith("image/")){s({title:"Invalid file type",description:"Please select an image file.",variant:"destructive"});return}if(B.size>2*1024*1024){s({title:"File too large",description:"Max 2MB.",variant:"destructive"});return}const K=new FileReader;K.onload=()=>{E(K.result),T(!0)},K.readAsDataURL(B),a.current&&(a.current.value="")},U=async I=>{if(n){o(!0);try{const B=`${n.id}/company-logo.png`,{error:K}=await F.storage.from("avatars").upload(B,I,{upsert:!0});if(K)throw K;const{data:Z}=F.storage.from("avatars").getPublicUrl(B),q=`${Z.publicUrl}?t=${Date.now()}`;await F.from("profiles").update({company_logo_url:q}).eq("user_id",n.id),x(q),s({title:"Logo uploaded"}),T(!1),E(null),t==null||t()}catch(B){s({title:"Upload failed",description:B.message,variant:"destructive"})}finally{o(!1)}}},O=async()=>{if(n)try{await F.from("profiles").update({company_logo_url:null}).eq("user_id",n.id),x(null),s({title:"Logo removed"}),t==null||t()}catch(I){s({title:"Delete failed",description:I.message,variant:"destructive"})}},M=async()=>{if(n){c(!0);try{const{error:I}=await F.from("profiles").update({job_title:y||null,business_name:w||null,phone:j||null,email_header_subtitle:g||null,signature_enabled:d,signature_custom_text:_||null,show_logo_in_email:m}).eq("user_id",n.id);if(I)throw I;s({title:"Branding saved"}),t==null||t()}catch(I){s({title:"Save failed",description:I.message,variant:"destructive"})}finally{c(!1)}}},$=async I=>{if(n){if(I&&!(y.trim()&&w.trim()&&j.trim())){s({title:"Complete all fields first",description:"Fill in Job Title, Business, and Phone.",variant:"destructive"});return}u(I),await F.from("profiles").update({signature_enabled:I}).eq("user_id",n.id),t==null||t()}};return D?r.jsxs("div",{className:"space-y-5",children:[r.jsxs("h2",{className:"font-semibold text-base flex items-center gap-2",children:[r.jsx(wi,{className:"h-4 w-4 text-primary"}),"Email Branding"]}),r.jsxs(Ie,{className:"p-4 space-y-3",children:[r.jsx(ye,{className:"text-sm font-medium",children:"Company Logo"}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{onClick:()=>{var I;return(I=a.current)==null?void 0:I.click()},className:"w-16 h-16 rounded-lg border-2 border-dashed border-border hover:border-primary/50 transition-colors cursor-pointer flex items-center justify-center overflow-hidden bg-muted/50 flex-shrink-0",children:i?r.jsx(Me,{className:"h-5 w-5 animate-spin text-muted-foreground"}):p?r.jsx("img",{src:p,alt:"Logo",className:"w-full h-full object-contain p-2"}):r.jsx(Nx,{className:"h-5 w-5 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(P,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>{var I;return(I=a.current)==null?void 0:I.click()},disabled:i,children:p?"Change Logo":"Upload Logo"}),p&&r.jsxs(r.Fragment,{children:[r.jsx(P,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>{p&&(E(p),T(!0))},title:"Crop logo",children:r.jsx($m,{className:"h-3.5 w-3.5"})}),r.jsx(P,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive",onClick:O,children:r.jsx(Xr,{className:"h-3.5 w-3.5"})})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG, JPG up to 2MB. Best at 200×50px"})]}),r.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:V,className:"hidden"})]})]}),r.jsx(Ie,{className:"p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-sm font-medium flex items-center gap-1.5",children:["Show Logo in Emails",r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(ql,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-foreground cursor-help"})}),r.jsx(yt,{side:"right",className:"max-w-[240px] text-xs",children:"When on, your uploaded company logo replaces the VIDAREO logo in the email header. If both the logo and signature are off, default VIDAREO branding is used."})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display your company logo in the email header"})]}),r.jsx(rr,{checked:m,onCheckedChange:async I=>{f(I),n&&(await F.from("profiles").update({show_logo_in_email:I}).eq("user_id",n.id),t==null||t())}})]})}),r.jsx(bP,{open:R,imageSrc:k,onClose:()=>{T(!1),E(null)},onCropComplete:U,isUploading:i,circularCrop:!1,freeform:!0,title:"Crop Logo"}),r.jsxs(Ie,{className:"p-4 space-y-2",children:[r.jsxs(ye,{className:"text-sm font-medium flex items-center gap-1.5",children:["Header Tagline ",r.jsx("span",{className:"text-muted-foreground font-normal text-xs",children:"(optional)"}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(ql,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-foreground cursor-help"})}),r.jsx(yt,{side:"right",className:"max-w-[240px] text-xs",children:'A short tagline shown below your logo in the email header. When empty, "Record • Share • C
1301onnect" is displayed (hidden if using a custom logo without a tagline).'})]})]}),r.jsx(He,{value:g,onChange:I=>v(I.target.value.slice(0,50)),placeholder:"e.g. Your Trusted Partner",className:"h-9"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'Replaces "Record • Share • Connect" in emails'})]}),r.jsxs(Ie,{className:"p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(ye,{className:"text-sm font-medium flex items-center gap-1.5",children:["Email Signature",r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(ql,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-foreground cursor-help"})}),r.jsx(yt,{side:"right",className:"max-w-[240px] text-xs",children:"Adds your name, job title, company, and phone number at the bottom of every email you send. Job Title, Business, and Phone are required to enable; Custom Text is optional."})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Include your signature in sent emails"})]}),r.jsx(rr,{checked:d,onCheckedChange:$})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs text-muted-foreground",children:"Job Title"}),r.jsx(He,{value:y,onChange:I=>b(I.target.value.slice(0,40)),placeholder:"e.g. Sales Manager",className:"h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs text-muted-foreground",children:"Business / Company"}),r.jsx(He,{value:w,onChange:I=>S(I.target.value.slice(0,50)),placeholder:"e.g. Acme Inc.",className:"h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ye,{className:"text-xs text-muted-foreground",children:"Phone"}),r.jsx(He,{value:j,onChange:I=>{const B=I.target.value.replace(/\D/g,"").slice(0,10);let K="";B.length>0&&(K="("+B.slice(0,3)),B.length>=3&&(K+=") "+B.slice(3,6)),B.length>=6&&(K+="-"+B.slice(6,10)),N(K)},placeholder:"(555) 123-4567",className:"h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ye,{className:"text-xs text-muted-foreground",children:["Custom Text ",r.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),r.jsx(He,{value:_,onChange:I=>C(I.target.value.slice(0,60)),placeholder:"e.g. License #12345, DRE #01234567",className:"h-9",maxLength:60}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"License number, certification, or any custom info."})]})]})]}),r.jsx(P,{onClick:M,className:"w-full",disabled:l,children:l?"Saving...":"Save Branding"})]}):r.jsxs(Ie,{className:"p-6 text-center",children:[r.jsx(wi,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground opacity-50"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:lr()?"Custom email branding is available on Professional and Team plans. This feature is not available on your current plan.":"Upgrade to Professional to customize email branding."}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Pro Feature"})]})},bnt=[{id:"compose",label:"Compose",icon:B4,tooltip:"Write and send video emails to individuals or contact lists"},{id:"templates",label:"Templates",icon:el,tooltip:"Save and reuse email templates for faster sending"},{id:"branding",label:"Branding",icon:wi,tooltip:"Customize your email appearance with logos and colors"},{id:"sent",label:"Sent History",icon:Es,tooltip:"View all sent emails and track opens, views, and engagement"}],wnt=()=>{const{user:e}=nr(),{isImpersonating:t}=th(),{toast:n}=Gr(),s=Sr(),a=ja(),[i,o]=h.useState("compose"),[l,c]=h.useState("individual"),[d,u]=h.useState(null),[m,f]=h.useState(null),[p,x]=h.useState(null),[g,v]=h.useState(!1),[y,b]=h.useState(!1),[w,S]=h.useState([]),[j,N]=h.useState(!1),[_,C]=h.useState(!1),[k,E]=h.useState([]),[R,T]=h.useState(null),[D,A]=h.useState(!0),[V,U]=h.useState(""),[O,M]=h.useState(1),[$,I]=h.useState(""),[B,K]=h.useState(""),Z=h.useRef(!1),[q,H]=h.useState(null),[X,G]=h.useState("standard"),[ee,re]=h.useState(""),[W,Q]=h.useState(""),[L,te]=h.useState(!1),[ae,ne]=h.useState(null),[se,ue]=h.useState(null),[Ne,Qe]=h.useState(""),[J,de]=h.useState(null),[ve,Le]=h.useState(""),[$e,De]=h.useState(null),[oe,xe]=h.useState(null),[Ze,it]=h.useState("starter"),[ct,Oe]=h.useState([]),[pe,le]=h.useState(!0),{isAtLimit:ke,isLoading:Ee,incrementUsage:ot}=Tw(e==null?void 0:e.id);h.useEffect(()=>{const Xe=new URLSearchParams(a.search),be=Xe.get("video"),Ue=Xe.get("to"),we=Xe.get("name");be&&(T(be),o("compose")),Ue&&(K(Ue),we&&I(we),o("compose"),Z.current=!0);const pt=a.state;pt!=null&&pt.bulkRecipients&&(pt!=null&&pt.listName)&&(u(pt.bulkRecipients),f(pt.listName),x(pt.listId||null),o("compose"),Q("{senderName}
1301 sent you a video: {videoTitle}"),re(`Hi {recipientName},
1302
1303{senderName} sent you a video message. Click below to watch!`),window.history.replaceState({},document.title))},[a.search,a.state]),h.useEffect(()=>{if(!(e!=null&&e.id))return;(async()=>{A(!0);const{data:be,error:Ue}=await F.from("videos").select("id, title, thumbnail_url, duration, created_at, description, tags").eq("user_id",e.id).is("archived_at",null).order("created_at",{ascending:!1});!Ue&&be&&E(be),A(!1)})()},[e==null?void 0:e.id]);const gt=h.useCallback(async()=>{if(!(e!=null&&e.id))return;N(!0);const{data:Xe}=await F.from("contact_lists").select("id, name, color").eq("user_id",e.id).order("name");if(Xe){const be=await Promise.all(Xe.map(async Ue=>{const{count:we}=await F.from("contact_list_members").select("id",{count:"exact",head:!0}).eq("list_id",Ue.id);return{...Ue,memberCount:we||0}}));S(be)}N(!1)},[e==null?void 0:e.id]);h.useEffect(()=>{_&&gt()},[_,gt]);const Nt=async(Xe,be)=>{const{data:Ue}=await F.from("contact_list_members").select("contact_id, contacts(name, email)").eq("list_id",Xe);if(Ue&&Ue.length>0){const we=Ue.map(pt=>{var mt,er;return{name:((mt=pt.contacts)==null?void 0:mt.name)||"",email:((er=pt.contacts)==null?void 0:er.email)||""}}).filter(pt=>pt.email);u(we),f(be),x(Xe),Q("{senderName} sent you a video: {videoTitle}"),re(`Hi {recipientName},
1304
1305{senderName} sent you a video message. Click below to watch!`),C(!1)}};h.useEffect(()=>{if(!(e!=null&&e.id))return;(async()=>{const{data:be,error:Ue}=await F.from("profiles").select("full_name, job_title, business_name, phone, email, signature_enabled, subscription_tier, email_header_subtitle, company_logo_url, avatar_url, signature_custom_text, show_logo_in_email").eq("user_id",e.id).single();if(!Ue&&be){const we=be.subscription_tier!=="starter";it(be.subscription_tier),xe({enabled:we&&(be.signature_enabled??!1),showLogoInEmail:be.show_logo_in_email??!0,fullName:be.full_name,jobTitle:be.job_title,businessName:be.business_name,phone:be.phone,email:be.email,logoUrl:be.company_logo_url,headerSubtitle:be.email_header_subtitle,avatarUrl:be.avatar_url,customText:be.signature_custom_text})}})()},[e==null?void 0:e.id]);const[Ct,dt]=h.useState(null);h.useEffect(()=>{if(!(e!=null&&e.id)||!R){ne(null),Qe(""),ue(null),Le(""),De(null),de(null),dt(null);return}(async()=>{const{data:be}=await F.from("videos").select("title, description, thumbnail_url").eq("id",R).single();be&&(Le(be.title),De(be.description),de(be.thumbnail_url));const{data:Ue}=await F.from("video_share_links").select("allow_replies, allow_comments, show_watermark, cta_url, cta_label").eq("video_id",R).eq("user_id",e.id).order("created_at",{ascending:!0}).limit(1).maybeSingle();dt(Ue||null),Qe("https://share.vidareo.com/..."),ne(null),ue(null)})()},[e==null?void 0:e.id,R]);const tt=h.useCallback(async()=>{var pt;if(!(e!=null&&e.id))return;le(!0);const[Xe,be]=await Promise.all([F.from("video_share_links").select("id, video_id, recipient_email, recipient_name, email_sent_at, email_opened_at, email_open_count, view_count, share_token, title, list_send_id, contact_list_id").eq("user_id",e.id).not("email_sent_at","is",null).is("list_send_id",null).order("email_sent_at",{ascending:!1}).limit(100),F.from("video_share_links").select("id, video_id, recipient_email, recipient_name, email_sent_at, email_opened_at, email_open_count, view_count, share_token, title, list_send_id, contact_list_id").eq("user_id",e.id).not("email_sent_at","is",null).not("list_send_id","is",null).order("email_sent_at",{ascending:!1}).limit(2e3)]),Ue=Xe.error||be.error,we=[...Xe.data||[],...be.data||[]];if(!Ue&&we.length>=0){const mt=[...new Set(we.map(_e=>_e.video_id))],er=we.map(_e=>_e.id),kt=[...new Set(we.map(_e=>_e.contact_list_id).filter(Boolean))],[at,Yt,Ft,or]=await Promise.all([F.from("videos").select("id, title").in("id",mt),er.length>0?F.from("share_link_views").select("share_link_id, watch_duration, watch_percentage, completed, viewed_at").in("share_link_id",er):Promise.resolve({data:[]}),kt.length>0?F.from("contact_lists").select("id, name").in("id",kt):Promise.resolve({data:[]}),kt.length>0?F.from("contact_list_members").select("list_id").in("list_id",kt):Prom
1305ise.resolve({data:[]})]),Ar={};(pt=at.data)==null||pt.forEach(_e=>{Ar[_e.id]=_e.title});const nn={};(Ft.data||[]).forEach(_e=>{nn[_e.id]=_e.name});const es={};(or.data||[]).forEach(_e=>{es[_e.list_id]=(es[_e.list_id]||0)+1});const An={},ie={};(Yt.data||[]).forEach(_e=>{ie[_e.share_link_id]||(ie[_e.share_link_id]=[]),ie[_e.share_link_id].push(_e)}),Object.entries(ie).forEach(([_e,ht])=>{const Dr=ht.reduce((Tn,Za)=>Tn+(Za.watch_duration||0),0),Mr=ht.filter(Tn=>Tn.watch_percentage!=null).map(Tn=>Tn.watch_percentage),Ln=Mr.length>0?Math.round(Mr.reduce((Tn,Za)=>Tn+Za,0)/Mr.length):0,Zr=ht.filter(Tn=>Tn.completed).length,zn=ht.map(Tn=>Tn.viewed_at).sort();An[_e]={totalDuration:Dr,avgPercentage:Ln,completedCount:Zr,lastViewed:zn.length>0?zn[zn.length-1]:null}}),Oe(we.map(_e=>{var ht,Dr,Mr,Ln;return{id:_e.id,video_id:_e.video_id,video_title:_e.title||Ar[_e.video_id]||"Untitled",recipient_email:_e.recipient_email,recipient_name:_e.recipient_name,email_sent_at:_e.email_sent_at,email_opened_at:_e.email_opened_at,email_open_count:_e.email_open_count||0,view_count:_e.view_count||0,share_token:_e.share_token,total_watch_duration:((ht=An[_e.id])==null?void 0:ht.totalDuration)||0,avg_watch_percentage:((Dr=An[_e.id])==null?void 0:Dr.avgPercentage)||0,completed_views:((Mr=An[_e.id])==null?void 0:Mr.completedCount)||0,last_viewed_at:((Ln=An[_e.id])==null?void 0:Ln.lastViewed)||null,list_send_id:_e.list_send_id||null,contact_list_id:_e.contact_list_id||null,list_name:_e.contact_list_id?nn[_e.contact_list_id]:void 0,list_recipient_count:_e.contact_list_id?es[_e.contact_list_id]||0:void 0}}))}le(!1)},[e==null?void 0:e.id]);h.useEffect(()=>{tt()},[tt]);const Re=Xe=>{if(K(Xe),Xe.trim()){const be=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ue=Xe.split(/[\s,;]+/).map(pt=>pt.trim()).filter(Boolean),we=Ue.length===0||Ue.some(pt=>!be.test(pt));H(we?"Invalid email format":null)}else H(null)},Fe=async(Xe,be)=>{try{if(be){const{error:Ue}=await F.from("video_share_links").delete().eq("user_id",e.id).eq("list_send_id",be);if(Ue)throw Ue;n({title:"List send deleted",description:"The list send history has been removed."})}else{const{error:Ue}=await F.from("video_share_links").delete().eq("id",Xe).eq("user_id",e.id);if(Ue)throw Ue;n({title:"Email deleted",description:"The sent email history has been removed."})}tt()}catch(Ue){n({title:"Failed to delete",description:Ue.message||"Please try again.",variant:"destructive"})}},Ae=async()=>{if(!B.trim()){H("Recipient email is required");return}if(!R||!e)return;const Xe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,be=Array.from(new Set(B.split(/[\s,;]+/).map(kt=>kt.trim().toLowerCase()).filter(Boolean))),Ue=be.filter(kt=>!Xe.test(kt)),we=be.filter(kt=>Xe.test(kt));if(we.length===0){n({title:"Invalid email",description:"Please enter at least one valid email address.",variant:"destructive"});return}if(Ue.length>0){n({title:"Some emails are invalid",description:`Fix or remove: ${Ue.join(", ")}`,variant:"destructive"});return}if(!Ee&&Ze==="starter"&&ke){n({title:"Share limit reached",description:lr()?"You've used all your shares this month.":"You've used all your shares this month. Upgrade to continue sharing.",variant:"destructive"});return}te(!0);const pt=[],mt=[];let er=!1;try{const{data:{session:kt}}=await F.auth.getSession();if(!kt)throw new Error("Not authenticated");const at=(J==null?void 0:J.startsWith("data:"))||(J==null?void 0:J.startsWith("blob:")),Yt=J&&!at?J:void 0,Ft={logoUrl:oe!=null&&oe.showLogoInEmail&&oe.logoUrl||void 0,headerSubtitle:(oe==null?void 0:oe.headerSubtitle)||void 0};oe!=null&&oe.enabled&&(Ft.fullName=oe.fullName||void 0,Ft.jobTitle=oe.jobTitle||void 0,Ft.businessName=oe.businessName||void 0,Ft.phone=oe.phone||void 0,Ft.email=oe.email||void 0,Ft.avatarUrl=oe.avatarUrl||void 0,Ft.customText=oe.customText||void 0);for(const Ar of we){if(!Ee&&Ze==="starter"&&ke){er=!0;break}try{const nn=J_(),{error:es}=await F.functions.invoke("create-share-link",{body:{videoId:R,shareToken:nn,expiresAt:null,maxViews:null,password:null,recipientEmail:Ar,recipientName:$.trim()||null,recipientPhone:null,title:ve||"Untitled",allowReplies:(Ct==null?void 0:Ct.allow_replies)??!0,allowComments:(Ct==null?void 0:Ct.allow_comments)??!0,showWatermark:(Ct==null?void 0:Ct.show_watermark)??!0,ctaUrl:(Ct==null?void 0:Ct.cta_url)||null,ctaLabel:(Ct==null?void 0:Ct.cta_label)||null}});if(es)throw new Error("Failed to create share link");const{data:An}=await F.from("video_share_links").select("id").eq("video_id",R).eq("user_id",e.id).eq("share_token",nn).single(),ie=r0(nn),_e=(An==null?void 0:An.id)||null,ht=ee.replace(/\{recipientName\}/g,$.trim()||"there").replace(/\{senderName\}/g,(oe==null?void 0:oe.fullName)||"Someone"),Dr=W.trim()?W.replace(/\{recipientName\}/g,$.trim()||"there").replace(/\{senderName\}/g,(oe==null?void 0:oe.fullName)||"Someone").replace(/\{videoTitle\}/g,ve):void 0,Mr=await F.functions.invoke("send-share-email",{body:{recipientEmail:Ar,recipientName:$.trim()||void 0,videoTitle:ve,videoDescription:$e||void 0,shareLink:ie,thumbnailUrl:Yt,senderName:(oe==null?void 0:oe.fullName)||void 0,customMessage:ht||void 0,customSubject:Dr,shareLinkId:_e||void 0,customSignature:Ft}});if(Mr.error)throw new Error(Mr.error.message||"Failed to send email");await ot(),pt.push(Ar)}catch{mt.push(Ar)}}const or=we.length;pt.length===or?(n({title:or>1?`Sent to ${or} recipients`:"Email sent!",description:or>1?`Video shared with ${or} recipients.`:`Video shared with ${pt[0]}`}),I(""),K(""),H(null),Q(""),T(null),U("")):pt.length>0?(n({title:`Sent to ${pt.length} of ${or}`,description:er?`Stopped: share limit reached. Failed: ${mt.join(", ")}`:`Failed: ${mt.join(", ")}`,variant:"destructive"}),K(mt.join(", "))):n({title:"Failed to send",description:er?"Share limit reached.":"No emails were sent. Please try again.",variant:"destructive"}),tt()}catch(kt){n({title:"Failed to send email",description:kt.message||"Please try again.",variant:"destructive"})}finally{te(!1)}},Ve=async()=>
1305{if(!(!R||!p||!e)){v(!0);try{const{data:{session:Xe}}=await F.auth.getSession();if(!Xe)throw new Error("Not authenticated");const be={logoUrl:oe!=null&&oe.showLogoInEmail&&oe.logoUrl||void 0,headerSubtitle:(oe==null?void 0:oe.headerSubtitle)||void 0};oe!=null&&oe.enabled&&(be.fullName=oe.fullName||void 0,be.jobTitle=oe.jobTitle||void 0,be.businessName=oe.businessName||void 0,be.phone=oe.phone||void 0,be.email=oe.email||void 0,be.avatarUrl=oe.avatarUrl||void 0,be.customText=oe.customText||void 0);const Ue=await F.functions.invoke("send-list-email",{body:{listId:p,videoId:R,customMessage:ee||void 0,customSubject:W.trim()||void 0,customSignature:be,shareLinkSettings:Ct?{allowReplies:Ct.allow_replies,allowComments:Ct.allow_comments,showWatermark:Ct.show_watermark,ctaUrl:Ct.cta_url,ctaLabel:Ct.cta_label}:void 0}});if(Ue.error)throw new Error(Ue.error.message||"Failed to send bulk email");const we=Ue.data;n({title:"List email sent!",description:`Sent to ${we.successCount} of ${we.totalRecipients} contacts in "${m}"${we.failCount>0?` (${we.failCount} failed)`:""}`}),u(null),f(null),x(null),Q(""),re(""),tt()}catch(Xe){n({title:"Failed to send list email",description:Xe.message||"Please try again.",variant:"destructive"})}finally{v(!1)}}};h.useMemo(()=>k.find(Xe=>Xe.id===R),[k,R]);const et=h.useMemo(()=>{const Xe=V.trim().toLowerCase();return Xe?k.filter(be=>{var Ue,we,pt;if((Ue=be.title)!=null&&Ue.toLowerCase().includes(Xe)||(we=be.description)!=null&&we.toLowerCase().includes(Xe)||(pt=be.tags)!=null&&pt.some(mt=>mt.toLowerCase().includes(Xe)))return!0;try{const mt=new Date(be.created_at);if([mt.toLocaleDateString(),mt.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),mt.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),mt.toISOString().slice(0,10)].some(kt=>kt.toLowerCase().includes(Xe)))return!0}catch{}return!1}):k},[k,V]),Ge=10,St=Math.max(1,Math.ceil(et.length/Ge));h.useEffect(()=>{M(1)},[V,k.length]);const Tt=Math.min(O,St),Zt=h.useMemo(()=>et.slice((Tt-1)*Ge,Tt*Ge),[et,Tt]),bt=Xe=>{if(!Xe)return"";const be=Math.floor(Xe/60),Ue=Xe%60;return`${be}:${Ue.toString().padStart(2,"0")}`};h.useMemo(()=>{const Xe=ct.length,be=ct.filter(er=>er.email_opened_at).length,Ue=ct.filter(er=>er.view_count>0).length,we=Xe>0?Math.round(be/Xe*100):0,pt=Xe>0?Math.round(Ue/Xe*100):0,mt=ct.reduce((er,kt)=>er+(kt.view_count||0),0);return{totalSent:Xe,openRate:we,viewRate:pt,totalViews:mt}},[ct]);const Wt=()=>{var Xe,be,Ue;switch(i){case"compose":return r.jsxs("div",{className:"space-y-6","data-tour":"mail-compose",children:[d&&m&&r.jsx(Ie,{className:"p-4 border-primary/30 bg-primary/5",children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx(jr,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("h3",{className:"font-semibold text-sm",children:["Sending to list: ",m]}),r.jsxs(Se,{variant:"secondary",className:"text-[10px]",children:[d.length," recipients"]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:[d.slice(0,3).map(we=>we.name).join(", "),d.length>3?` +${d.length-3} more`:""]})]})]}),r.jsx(P,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>{u(null),f(null),x(null),Q(""),re("")},children:"Cancel"})]})}),r.jsxs(Ie,{className:"p-5 space-y-4","data-tour":"mail-video-select",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bi,{className:"h-5 w-5 text-primary"}),r.jsx("h2",{className:"font-semibold",children:"Select Video"})]}),D?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Me,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):k.length===0?r.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[r.jsx(bi,{className:"h-10 w-10 mx-auto mb-2 opacity-50"}),r.jsx("p",{className:"text-sm",children:"No videos yet. Record or upload a video first."}),r.jsx(P,{variant:"outline",className:"mt-3",onClick:()=>s("/videos"),children:"Go to Videos"})]}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(He,{placeholder:"Search by title, description, date, or tag...",value:V,onChange:we=>U(we.target.value),className:"pl-9 h-9"})]}),r.jsxs("div",{className:"max-h-64 overflow-y-scroll scrollbar-visible space-y-1 border border-border rounded-lg p-1",children:[Zt.map(we=>r.jsxs("button",{onClick:()=>{T(we.id),!d&&!Z.current&&(I(""),K(""),H(null)),Z.current=!1},className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors ${R===we.id?"bg-primary/10 border border-primary/30":"hover:bg-muted/50"}`,children:[r.jsx("div",{className:"w-16 h-10 rounded overflow-hidden bg-muted flex-shrink-0",children:we.thumbnail_url?r.jsx("img",{src:we.thumbnail_url,alt:"",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsx(bi,{className:"h-4 w-4 text-muted-foreground"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:we.title}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[bt(we.duration)," · ",cn(new Date(we.created_at),"MMM d, yyyy")]})]}),R===we.id&&r.jsx(Lm,{className:"h-4 w-4 text-primary flex-shrink-0"})]},we.id)),et.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No matching videos"})]}),St>1&&r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsxs("span",{className:"text-xs text-muted-foreground",children:[et.length," ",et.length===1?"video":"videos"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(P,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>M(we=>Math.max(1,we-1)),disabled:Tt<=1,children:"Prev"}),r.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:["Page ",Tt," of ",St]}),r.jsx(P,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>M(we=>Math.min(St,we+1)),disabled:Tt>=St,children:"Next"})]})]})]})]}),!d&&R&&r.jsxs("div",{className:"relative",children:[r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2 h-10",onClick:()=>C(!_),children:[r.jsx(wue,{className:"h-4 w-4 text-primary"}),r.jsx("span",{className:"text-sm",children:"Send to a contact list"}),r.jsx(Qs,{className:`h-4 w-4 ml-auto text-muted-foreground transition-transform ${_?"rotate-180":""}`})]}),_&&r.jsx(Ie,{className:"mt-2 p-3 space-y-2 border-primary/20",children:j?r.jsx("div",{className:"flex items-center justify-center py-4",children:r.jsx(Me,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):w.length===0?r.jsxs("div",{className:"text-center py-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"No contact lists yet."}),r.jsx(P,{variant:"link",size:"sm",className:"mt-1 text-xs",onClick:()=>s("/contacts"),children:"Create a list in Contacts"})]}):r.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:w.map(we=>r.jsxs("button",{onClick:()=>Nt(we.id,we.name),disabled:we.memberCount===0,className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors hover:bg-muted/50 disabled:opacity-50 disabled:cursor-not-allowed",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:we.color||"#0ea5e9"}}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-sm font-medium truncate",children:we.name})}),r.jsxs(Se,{variant:"secondary",className:"text-[10px]",children:[we.memberCount," ",we.memberCount===1?"contact":"contacts"]})]},we.id))})})]}),d&&p&&R&&r.jsxs(Ie,{className:"p-5 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Es,{className:"h-5 w-5 text-primary"}),r.jsx("h2",{className:"font-semibold",children:"Compose List Email"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground block mb-1.5",children:"Subject (optional)"}),r.jsx(He,{value:W,onChange:we=>Q(we.target.value),placeholder:"{senderName}
1305 sent you a video: {videoTitle}",className:"h-9"}),r.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Use ","{recipientName}",", ","{senderName}",", ","{videoTitle}"," for personalization"]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground block mb-1.5",children:"Message (optional)"}),r.jsx("textarea",{value:ee,onChange:we=>re(we.target.value),placeholder:"Add a personal message to your list...",className:"w-full min-h-[80px] rounded-md border border-input bg-background px-3 py-2 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ring",rows:3})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",className:"flex-1",onClick:()=>b(!0),children:[r.jsx(wr,{className:"h-4 w-4 mr-2"}),"Preview"]}),r.jsx(P,{className:"flex-1",onClick:Ve,disabled:g,children:g?r.jsxs(r.Fragment,{children:[r.jsx(Me,{className:"h-4 w-4 animate-spin mr-2"}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Es,{className:"h-4 w-4 mr-2"}),"Send to ",d.length," recipients"]})})]}),r.jsx(mie,{open:y,onOpenChange:b,recipientEmail:`${d.length} recipients in "${m}"`,recipientName:((Xe=d[0])==null?void 0:Xe.name)||void 0,videoTitle:ve,videoDescription:$e,shareLink:Ne||"https://share.vidareo.com/...",thumbnailUrl:J||void 0,senderName:(oe==null?void 0:oe.fullName)||void 0,customMessage:ee?ee.replace(/\{recipientName\}/g,((be=d[0])==null?void 0:be.name)||"there").replace(/\{senderName\}/g,(oe==null?void 0:oe.fullName)||"Someone"):void 0,customSubject:W.trim()?W.replace(/\{recipientName\}/g,((Ue=d[0])==null?void 0:Ue.name)||"there").replace(/\{senderName\}/g,(oe==null?void 0:oe.fullName)||"Someone").replace(/\{videoTitle\}/g,ve):void 0,onSend:()=>{b(!1),Ve()},isSending:g,signatureEnabled:(oe==null?void 0:oe.enabled)??!1,showLogoInEmail:(oe==null?void 0:oe.showLogoInEmail)??!0,customSignature:{fullName:(oe==null?void 0:oe.fullName)||void 0,jobTitle:(oe==null?void 0:oe.jobTitle)||void 0,businessName:(oe==null?void 0:oe.businessName)||void 0,phone:(oe==null?void 0:oe.phone)||void 0,email:(oe==null?void 0:oe.email)||void 0,logoUrl:(oe==null?void 0:oe.logoUrl)||void 0,headerSubtitle:(oe==null?void 0:oe.headerSubtitle)||void 0,avatarUrl:(oe==null?void 0:oe.avatarUrl)||void 0,customText:(oe==null?void 0:oe.customText)||void 0}})]}),!d&&R&&Ne&&r.jsx(Ie,{className:"p-0 overflow-hidden","data-tour":"mail-email-composer",children:r.jsx(xnt,{recipientName:$,setRecipientName:I,recipientEmail:B,setRecipientEmail:Re,recipientEmailError:q,videoTitle:ve,videoDescription:$e,shareLink:Ne,thumbnailUrl:J||void 0,senderName:(oe==null?void 0:oe.fullName)||void 0,selectedTemplateId:X,setSelectedTemplateId:G,customEmailMessage:ee,setCustomEmailMessage:re,customSubjectLine:W,setCustomSubjectLine:Q,onSendViaVidareo:Ae,isSending:L,isAtLimit:ke,subscriptionTier:Ze,signatureEnabled:(oe==null?void 0:oe.enabled)??!1,showLogoInEmail:(oe==null?void 0:oe.showLogoInEmail)??!0,customSignature:{fullName:(oe==null?void 0:oe.fullName)||void 0,jobTitle:(oe==null?void 0:oe.jobTitle)||void 0,businessName:(oe==null?void 0:oe.businessName)||void 0,phone:(oe==null?void 0:oe.phone)||void 0,email:(oe==null?void 0:oe.email)||void 0,logoUrl:(oe==null?void 0:oe.logoUrl)||void 0,headerSubtitle:(oe==null?void 0:oe.headerSubtitle)||void 0,avatarUrl:(oe==null?void 0:oe.avatarUrl)||void 0,customText:(oe==null?void 0:oe.customText)||void 0}})}),!d&&R&&!Ne&&r.jsx(Ie,{className:"p-5",children:r.jsxs("div",{className:"flex items-center justify-center py-6",children:[r.jsx(Me,{className:"h-5 w-5 animate-spin text-muted-foreground mr-2"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Preparing share link..."})]})})]});case"templates":return r.jsx("div",{"data-tour":"mail-templates",children:r.jsx(vnt,{})});case"branding":return r.jsx("div",{"data-tour":"mail-branding",children:r.jsx(ynt,{subscriptionTier:Ze,onBrandingUpdated:()=>{e!=null&&e.id&&F.from("profiles").select("full_name, job_title, business_name, phone, email, signature_enabled, subscription_tier, email_header_subtitle, company_logo_url, avatar_url, signature_custom_text, show_logo_in_email").eq("user_id",e.id).single().then(({data:we})=>
1305{if(we){const pt=we.subscription_tier!=="starter";xe({enabled:pt&&(we.signature_enabled??!1),showLogoInEmail:we.show_logo_in_email??!0,fullName:we.full_name,jobTitle:we.job_title,businessName:we.business_name,phone:we.phone,email:we.email,logoUrl:we.company_logo_url,headerSubtitle:we.email_header_subtitle,avatarUrl:we.avatar_url,customText:we.signature_custom_text})}})}})});case"sent":{const we=ct.filter(at=>!at.list_send_id),pt=new Map;ct.filter(at=>at.list_send_id).forEach(at=>{const Yt=pt.get(at.list_send_id)||[];Yt.push(at),pt.set(at.list_send_id,Yt)});const mt=Array.from(pt.entries()).map(([at,Yt])=>({listSendId:at,listName:Yt[0].list_name||"Unknown List",videoTitle:Yt[0].video_title,recipientCount:Yt.length,sentAt:Yt[0].email_sent_at,totalOpened:Yt.filter(Ft=>Ft.email_opened_at).length,totalViewed:Yt.filter(Ft=>Ft.view_count>0).length,totalViews:Yt.reduce((Ft,or)=>Ft+(or.view_count||0),0),totalOpenCount:Yt.reduce((Ft,or)=>Ft+or.email_open_count,0),totalWatchDuration:Yt.reduce((Ft,or)=>Ft+or.total_watch_duration,0),avgWatchPercentage:Yt.length>0?Math.round(Yt.reduce((Ft,or)=>Ft+or.avg_watch_percentage,0)/Yt.length):0,completedViews:Yt.reduce((Ft,or)=>Ft+or.completed_views,0),emails:Yt})),er=l==="individual"?we:[],kt=l==="individual"?{totalSent:we.length,openRate:we.length>0?Math.round(we.filter(at=>at.email_opened_at).length/we.length*100):0,viewRate:we.length>0?Math.round(we.filter(at=>at.view_count>0).length/we.length*100):0,totalViews:we.reduce((at,Yt)=>at+(Yt.view_count||0),0)}:{totalSent:mt.length,openRate:mt.length>0?Math.round(mt.filter(at=>at.totalOpened>0).length/mt.length*100):0,viewRate:mt.length>0?Math.round(mt.filter(at=>at.totalViewed>0).length/mt.length*100):0,totalViews:mt.reduce((at,Yt)=>at+Yt.totalViews,0)};return r.jsxs("div",{className:"space-y-6","data-tour":"mail-sent",children:[r.jsxs("div",{className:"flex gap-1 bg-muted rounded-lg p-1",children:[r.jsxs("button",{onClick:()=>c("individual"),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors ${l==="individual"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[r.jsx(zr,{className:"h-4 w-4"}),"Individual",we.length>0&&r.jsx(Se,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:we.length})]}),r.jsxs("button",{onClick:()=>c("list"),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors ${l==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[r.jsx(jr,{className:"h-4 w-4"}),"List Sends",mt.length>0&&r.jsx(Se,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:mt.length})]})]}),pe?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(Me,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(l==="individual"?we.length===0:mt.length===0)?r.jsxs(Ie,{className:"p-8 text-center",children:[r.jsx(zr,{className:"h-12 w-12 mx-auto mb-3 text-muted-foreground opacity-50"}),r.jsx("h3",{className:"font-medium text-foreground",children:l==="individual"?"No individual emails sent yet":"No list emails sent yet"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l==="individual"?"Compose and send your first video email.":"Send a video to a contact list to see it here."}),r.jsxs(P,{variant:"outline",className:"mt-4",onClick:()=>o("compose"),children:[r.jsx(B4,{className:"h-4 w-4 mr-1"})," Compose Email"]})]}):r.jsxs(r.Fragment,{children:[r.jsx(ys,{children:r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-3",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Ie,{className:"p-3 sm:p-4 text-center cursor-default",children:[r.jsx("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-1.5 sm:mb-2",children:r.jsx(Es,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-primary"})}),r.jsx("p",{className:"text-xl sm:text-2xl font-bold text-foreground",children:kt.totalSent}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:l==="individual"?"Emails Sent":"List Sends"})]})}),r.jsx(yt,{children:l==="individual"?"Total individual emails you've sent":"Total bulk sends to contact lists"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Ie,{className:"p-3 sm:p-4 text-center cursor-default",children:[r.jsx("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-green-500/10 flex items-center justify-center mx-auto mb-1.5 sm:mb-2",children:r.jsx(Vh,{
1305className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-green-600"})}),r.jsxs("p",{className:"text-xl sm:text-2xl font-bold text-foreground",children:[kt.openRate,"%"]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"Open Rate"})]})}),r.jsx(yt,{children:"Percentage of recipients who opened your email"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Ie,{className:"p-3 sm:p-4 text-center cursor-default",children:[r.jsx("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-blue-500/10 flex items-center justify-center mx-auto mb-1.5 sm:mb-2",children:r.jsx(Js,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-blue-600"})}),r.jsxs("p",{className:"text-xl sm:text-2xl font-bold text-foreground",children:[kt.viewRate,"%"]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"View Rate"})]})}),r.jsx(yt,{children:"Percentage of recipients who clicked through and watched the video"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(Ie,{className:"p-3 sm:p-4 text-center cursor-default",children:[r.jsx("div",{className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-amber-500/10 flex items-center justify-center mx-auto mb-1.5 sm:mb-2",children:r.jsx(wr,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-amber-600"})}),r.jsx("p",{className:"text-xl sm:text-2xl font-bold text-foreground",children:kt.totalViews}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"Total Views"})]})}),r.jsx(yt,{children:"Total number of video plays across all sent emails"})]})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("h3",{className:"font-semibold text-sm text-foreground flex items-center gap-2",children:[r.jsx(qd,{className:"h-4 w-4 text-primary"}),l==="individual"?"Email History":"List Send History"]}),l==="individual"?r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:er.map(at=>{const Yt=!!at.email_opened_at,Ft=at.view_count>0,or=Ar=>{if(Ar<60)return`${Ar}s`;const nn=Math.floor(Ar/60),es=Ar%60;return es>0?`${nn}m ${es}s`:`${nn}m`};return r.jsxs(Ie,{className:"p-3 sm:p-4 group relative",children:[r.jsx("button",{onClick:()=>Fe(at.id),className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded-md hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete",children:r.jsx(Xr,{className:"h-3.5 w-3.5"})}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center flex-shrink-0 ${Ft?"bg-green-500/10":Yt?"bg-blue-500/10":"bg-muted"}`,children:Ft?r.jsx(Js,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-green-600"}):Yt?r.jsx(Vh,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-blue-600"}):r.jsx(zr,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:at.recipient_name||at.recipient_email||"Unknown recipient"}),r.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:cn(new Date(at.email_sent_at),"MMM d, h:mm a")})]}),at.recipient_name&&at.recipient_email&&r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:at.recipient_email}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:["📹 ",at.video_title]}),r.jsxs("div",{className:"flex items-center gap-1.5 mt-2 flex-wrap",children:[r.jsxs(Se,{variant:"secondary",className:"text-[10px] gap-1 px-2 py-0.5",children:[r.jsx(Es,{className:"h-3 w-3"}),"Sent"]}),Yt?r.jsxs(Se,{className:"text-[10px] gap-1 px-2 py-0.5 bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-0",children:[r.jsx(Vh,{className:"h-3 w-3"}),"Opened",at.email_open_count>1?` ${at.email_open_count}×`:""]}):r.jsxs(Se,{variant:"outline",className:"text-[10px] gap-1 px-2 py-0.5 text-muted-foreground",children:[r.jsx(fr,{className:"h-3 w-3"}),"Not Opened"]}),Ft?r.jsxs(Se,{className:"text-[10px] gap-1 px-2 py-0.5 bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-0",children:[r.jsx(wr,{className:"h-3 w-3"}),at.view_count," view",at.view_count!==1?"s":""]}):r.jsxs(Se,{variant:"outline",className:"text-[10px] gap-1 px-2 py-0.5 text-muted-foreground",children:[r.jsx(wr,{className:"h-3 w-3"}),"Not Viewed"]})]}),Ft&&r.jsxs("div",{className:"flex items-center gap-3 mt-2 pt-2 border-t border-border flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(OL,{className:"h-3 w-3 text-muted-foreground"}),r.jsx("span",{className:"text-[11px] text-muted-foreground",children:r.jsx("span",{className:"font-medium text-foreground",children:or(at.total_watch_duration)})})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Po,{className:"h-3 w-3 text-muted-foreground"}),r.jsx("span",{className:"text-[11px] text-muted-foreground",children:r.jsxs("span",{className:"font-medium text-foreground",children:[at.avg_watch_percentage,"%"]})})]}),at.completed_views>0&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(cl,{className:"h-3 w-3 text-green-600"}),r.jsxs("span",{className:"text-[11px] text-foreground font-medium",children:[at.completed_views," done"]})]})]}),at.last_viewed_at&&r.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Last viewed ",cn(new Date(at.last_viewed_at),"MMM d, h:mm a")]})]})]})]},at.id)})}):r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:mt.map(at=>{const Yt=Ft=>{if(Ft<60)return`${Ft}s`;const or=Math.floor(Ft/60),Ar=Ft%60;return Ar>0?`${or}m ${Ar}s`:`${or}m`};return r.jsxs(Ie,{className:"p-3 sm:p-4 border-sky-500/20 group relative",children:[r.jsx("button",{onClick:()=>Fe(at.emails[0].id,at.listSendId),className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded-md hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete",children:r.jsx(Xr,{className:"h-3.5 w-3.5"})}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full bg-sky-500/10 flex items-center justify-center flex-shrink-0",children:r.jsx(jr,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 text-sky-600"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("p",{className:"text-sm font-medium truncate",children:["📋 ",at.listName]}),r.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:cn(new Date(at.sentAt),"MMM d, h:mm a")})]}),r.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Sent to ",at.recipientCount," recipients"]}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:["📹 ",at.videoTitle]}),r.jsxs("div",{className:"flex items-center gap-1.5 mt-2 flex-wrap",children:[r.jsxs(Se,{className:"text-[10px] gap-1 px-2 py-0.5 bg-sky-500/15 text-sky-700 dark:text-sky-400 hover:bg-sky-500/20 border-0",children:[r.jsx(jr,{className:"h-3 w-3"}),at.recipientCount," sent"]}),at.totalOpened>0&&r.jsxs(Se,{className:"text-[10px] gap-1 px-2 py-0.5 bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-0",children:[r.jsx(Vh,{
1305className:"h-3 w-3"}),at.totalOpened," opened"]}),at.totalViewed>0&&r.jsxs(Se,{className:"text-[10px] gap-1 px-2 py-0.5 bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-0",children:[r.jsx(wr,{className:"h-3 w-3"}),at.totalViews," views"]})]}),at.totalViewed>0&&r.jsxs("div",{className:"flex items-center gap-3 mt-2 pt-2 border-t border-border flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(OL,{className:"h-3 w-3 text-muted-foreground"}),r.jsx("span",{className:"text-[11px] text-muted-foreground",children:r.jsx("span",{className:"font-medium text-foreground",children:Yt(at.totalWatchDuration)})})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Po,{className:"h-3 w-3 text-muted-foreground"}),r.jsx("span",{className:"text-[11px] text-muted-foreground",children:r.jsxs("span",{className:"font-medium text-foreground",children:[at.avgWatchPercentage,"%"]})})]}),at.completedViews>0&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(cl,{className:"h-3 w-3 text-green-600"}),r.jsxs("span",{className:"text-[11px] text-foreground font-medium",children:[at.completedViews," done"]})]})]}),r.jsxs("div",{className:"mt-3 pt-2 border-t border-border space-y-1.5",children:[r.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Recipients"}),at.emails.map(Ft=>{const or=!!Ft.email_opened_at,Ar=Ft.view_count>0;return r.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[r.jsx("div",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${Ar?"bg-green-500":or?"bg-blue-500":"bg-muted-foreground/30"}`}),r.jsx("span",{className:"truncate flex-1 min-w-0 text-foreground",children:Ft.recipient_name||Ft.recipient_email||"Unknown"}),r.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[or&&r.jsx(Vh,{className:"h-3 w-3 text-blue-500"}),Ar&&r.jsxs("span",{className:"text-[10px] text-green-600 font-medium flex items-center gap-0.5",children:[r.jsx(wr,{className:"h-3 w-3"}),Ft.view_count]}),Ft.avg_watch_percentage>0&&r.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[Ft.avg_watch_percentage,"%"]})]})]},Ft.id)})]})]})]})]},at.listSendId)})})]})]})]})}}};return r.jsxs("div",{className:`min-h-screen bg-background ${t?"pt-12":""}`,children:[r.jsx(pn,{}),r.jsx("main",{className:"container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl pt-24 pb-6",children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-4 md:gap-6",children:[r.jsx("aside",{className:"md:w-48 lg:w-56 flex-shrink-0","data-tour":"mail-sidebar",children:r.jsxs("div",{className:"md:sticky md:top-24 space-y-1",children:[r.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider px-3 mb-3 hidden md:block",children:"Email"}),r.jsx(ys,{children:bnt.map(Xe=>{const be=Xe.icon,Ue=i===Xe.id;return r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("button",{onClick:()=>o(Xe.id),className:`w-full flex items-center gap-2 md:gap-3 px-3 py-2 md:py-2.5 rounded-lg text-sm font-medium transition-colors ${Ue?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[r.jsx(be,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:Xe.label}),Xe.id==="sent"&&ct.length>0&&r.jsx(Se,{variant:"secondary",className:"ml-auto text-[10px] px-1.5 py-0",children:ct.length})]})}),r.jsx(yt,{side:"right",children:Xe.tooltip})]},Xe.id)})})]})}),r.jsx("div",{className:"flex-1 min-w-0",children:Wt()})]})})]})},jnt=({lists:e,totalContactCount:t,selectedListId:n,onListSelect:s,onCreateList:a,onEditList:i,onDeleteList:o,onEmailList:l})=>{const[c,d]=h.useState(!0);return r.jsx(ys,{children:r.jsx("aside",{className:"w-60 flex-shrink-0 border-r border-border bg-background overflow-y-auto",children:r.jsxs("nav",{className:"pt-10 pb-4 space-y-1",children:[r.jsx("div",{className:"px-4 pb-2",children:r.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Contacts"})}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("button",{onClick:()=>s(null),className:`w-full flex items-center justify-between px-4 py-2 text-sm transition-colors ${n===null?"bg-primary/10 text-primary font-medium border-r-2 border-primary":"text-foreground hover:bg-muted/50"}`,children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4"}),"All Contacts"]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:t})]})}),r.jsx(yt,{side:"right",children:"View all your saved contacts"})]}),r.jsxs(Wm,{open:c,onOpenChange:d,children:[r.jsx(Ff,{asChild:!0,children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("button",{className:"w-full flex items-center justify-between px-4 py-2 text-sm text-foreground hover:bg-muted/50 transition-colors",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ef,{className:"w-4 h-4"}),"My Lists"]}),c?r.jsx(Qs,{className:"w-3.5 h-3.5 text-muted-foreground"}):r.jsx(Hl,{className:"w-3.5 h-3.5 text-muted-foreground"})]})}),r.jsx(yt,{side:"right",children:"Organize contacts into groups for bulk emailing"})]})}),r.jsx(Ym,{children:r.jsxs("div",{className:"space-y-0.5 pl-4",children:[e.map(u=>r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{onClick:()=>s(u.id),className:`flex-1 flex items-center justify-between px-4 py-1.5 text-sm transition-colors rounded-l ${n===u.id?"bg-primary/10 text-primary font-medium":"text-foreground hover:bg-muted/50"}`,children:[r.jsxs("span",{className:"flex items-center gap-2 truncate",children:[r.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:u.color}}),r.jsx("span",{className:"truncate",children:u.name})]}),r.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:u.member_count||0})]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx("button",{className:"p-1 o
1305pacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:r.jsx(dm,{className:"w-3.5 h-3.5"})})}),r.jsxs(So,{align:"end",className:"w-36",children:[r.jsxs(tr,{onClick:()=>l(u),children:[r.jsx(Es,{className:"w-3.5 h-3.5 mr-2"}),"Email List"]}),r.jsxs(tr,{onClick:()=>i(u),children:[r.jsx(tl,{className:"w-3.5 h-3.5 mr-2"}),"Edit"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>o(u.id),className:"text-destructive",children:[r.jsx(Xr,{className:"w-3.5 h-3.5 mr-2"}),"Delete"]})]})]})]},u.id)),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs("button",{onClick:a,className:"w-full flex items-center gap-2 px-4 py-1.5 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors rounded",children:[r.jsx(Ns,{className:"w-3.5 h-3.5"}),"New List"]})}),r.jsx(yt,{side:"right",children:"Create a new contact list for organizing and bulk emailing"})]})]})})]})]})})})},Zj=["#0ea5e9","#ec4899","#f59e0b","#10b981","#3b82f6","#06b6d4","#ef4444","#14b8a6","#f97316","#38bdf8"],Nnt=()=>{const{user:e}=nr(),{toast:t}=Gr(),n=Sr(),{isPremium:s,isLoading:a,createCheckout:i}=Jl(),o=h.useRef(null),[l,c]=h.useState("contacts"),[d,u]=h.useState(null),[m,f]=h.useState([]),[p,x]=h.useState([]),[g,v]=h.useState({}),[y,b]=h.useState(!0),[w,S]=h.useState(""),[j,N]=h.useState(null),[_,C]=h.useState(!1),[k,E]=h.useState({name:"",email:"",company:"",notes:""}
1305),[R,T]=h.useState(""),[D,A]=h.useState(!1),[V,U]=h.useState(null),[O,M]=h.useState(!1),[$,I]=h.useState(null),[B,K]=h.useState(!1),[Z,q]=h.useState({name:"",description:"",color:Zj[0]}),[H,X]=h.useState(!1),[G,ee]=h.useState(null),[re,W]=h.useState(!1),[Q,L]=h.useState(new Set),[te,ae]=h.useState(!1),[ne,se]=h.useState(!1),[ue,Ne]=h.useState(""),[Qe,J]=h.useState(null),[de,ve]=h.useState(!1),[Le,$e]=h.useState([]),[De,oe]=h.useState(!1),[xe,Ze]=h.useState({}),[it,ct]=h.useState(""),[Oe,pe]=h.useState(!1),[le,ke]=h.useState(null),[Ee,ot]=h.useState([]),[gt,Nt]=h.useState("");h.useState(null);const Ct=h.useCallback(async()=>{if(!e)return;const{data:ie}=await F.from("contacts").select("*").eq("user_id",e.id).order("name",{ascending:!0});f(ie||[])},[e]),dt=h.useCallback(async()=>{if(!e)return;const{data:ie}=await F.from("contact_lists").select("*").eq("user_id",e.id).order("name",{ascending:!0});if(ie){const{data:_e}=await F.from("contact_list_members").select("list_id, contact_id").in("list_id",ie.map(Mr=>Mr.id)),ht={},Dr={};(_e||[]).forEach(Mr=>{ht[Mr.list_id]||(ht[Mr.list_id]=[]),ht[Mr.list_id].push(Mr.contact_id),Dr[Mr.list_id]=(Dr[Mr.list_id]||0)+1}),v(ht),x(ie.map(Mr=>({...Mr,member_count:Dr[Mr.id]||0})))}},[e]);h.useEffect(()=>{(async()=>{b(!0),await Promise.all([Ct(),dt()]),b(!1)})()},[Ct,dt]);const[tt,Re]=h.useState(1),Fe=25,Ae=h.useMemo(()=>{if(!w)return m;const ie=w.toLowerCase();return m.filter(_e=>{var ht;return _e.name.toLowerCase().includes(ie)||_e.email.toLowerCase().includes(ie)||((ht=_e.company)==null?void 0:ht.toLowerCase().includes(ie))})},[m,w]);h.useEffect(()=>{Re(1)},[w]);const Ve=Math.max(1,Math.ceil(Ae.length/Fe)),et=h.useMemo(()=>{const ie=(tt-1)*Fe;return Ae.slice(ie,ie+Fe)},[Ae,tt]),Ge=()=>{N(null),E({name:"",email:"",company:"",notes:""}),T(""),C(!0)},St=ie=>{N(ie),E({name:ie.name,email:ie.email,company:ie.company||"",notes:ie.notes||""}),C(!0)},Tt=async()=>{if(!(!e||!k.name.trim()||!k.email.trim())){A(!0);try{const ie={user_id:e.id,name:k.name.trim(),email:k.email.trim().toLowerCase(),company:k.company.trim()||null,notes:k.notes.trim()||null};if(j){const{error:_e}=await F.from("contacts").update(ie).eq("id",j.id);if(_e)throw _e;t({title:"Contact updated"})}else{const{data:_e,error:ht}=await F.from("contacts").insert(ie).select("id").single();if(ht){if(ht.code==="23505"){t({title:"Duplicate",description:"A contact with this email already exists.",variant:"destructive"});return}throw ht}R&&R!=="none"&&_e&&(await F.from("contact_list_members").upsert({list_id:R,contact_id:_e.id},{onConflict:"list_id,contact_id",ignoreDuplicates:!0}),dt()),t({title:"Contact added"})}C(!1),Ct()}catch(ie){t({title:"Error",description:ie.message,variant:"destructive"})}finally{A(!1)}}},Zt=async()=>{if(V){M(!0);try{const{error:ie}=await F.from("contacts").delete().eq("id",V);if(ie)throw ie;f(_e=>_e.filter(ht=>
1305ht.id!==V)),t({title:"Contact deleted"})}catch(ie){t({title:"Error",description:ie.message,variant:"destructive"})}finally{M(!1),U(null)}}},bt=async()=>{if(!(!e||Q.size===0)){M(!0);try{const{error:ie}=await F.from("contacts").delete().in("id",Array.from(Q));if(ie)throw ie;f(_e=>_e.filter(ht=>!Q.has(ht.id))),L(new Set),W(!1),t({title:`${Q.size} contact(s) deleted`})}catch(ie){t({title:"Error",description:ie.message,variant:"destructive"})}finally{M(!1),ae(!1)}}},Wt=async()=>{if(!ue)return;const ie=Qe?[Qe]:Array.from(Q);if(ie.length!==0){A(!0);try{const _e=ie.map(Dr=>({list_id:ue,contact_id:Dr})),{error:ht}=await F.from("contact_list_members").upsert(_e,{onConflict:"list_id,contact_id",ignoreDuplicates:!0});if(ht)throw ht;t({title:`Added ${ie.length} contact(s) to list`}),se(!1),J(null),L(new Set),W(!1),dt()}catch(_e){t({title:"Error",description:_e.message,variant:"destructive"})}finally{A(!1)}}},Xe=ie=>{J(ie),Ne(""),se(!0)},be=()=>{I(null),q({name:"",description:"",color:Zj[Math.floor(Math.random()*Zj.length)]}),K(!0)},Ue=ie=>{I(ie),q({name:ie.name,description:ie.description||"",color:ie.color}),K(!0)},we=async()=>{if(!(!e||!Z.name.trim())){X(!0);try{const ie={user_id:e.id,name:Z.name.trim(),description:Z.description.trim()||null,color:Z.color};if($){const{error:_e}=await F.from("contact_lists").update(ie).eq("id",$.id);if(_e)throw _e;t({title:"List updated"})}else{const{error:_e}=await F.from("contact_lists").insert(ie);if(_e)throw _e;t({title:"List created"})}K(!1),dt()}catch(ie){t({title:"Error",description:ie.message,variant:"destructive"})}finally{X(!1)}}},pt=async()=>{if(G){M(!0);try{const{error:ie}=await F.from("contact_lists").delete().eq("id",G);if(ie)throw ie;x(_e=>_e.filter(ht=>
1305ht.id!==G)),t({title:"List deleted"})}catch(ie){t({title:"Error",description:ie.message,variant:"destructive"})}finally{M(!1),ee(null)}}},mt=ie=>{var Dr,Mr;const _e=[],ht=ie.split("BEGIN:VCARD").filter(Boolean);for(const Ln of ht){if(!Ln.includes("END:VCARD"))continue;let Zr="",zn="",Tn="";const Na=Ln.replace(/\r?\n[ \t]/g,"").split(/\r?\n/);for(const la of Na){const qn=la.toUpperCase();if(qn.startsWith("FN"))Zr=la.substring(la.indexOf(":")+1).trim();else if(qn.startsWith("N:")||qn.startsWith("N;")){if(!Zr){const Hn=la.substring(la.indexOf(":")+1).split(";"),Qr=((Dr=Hn[0])==null?void 0:Dr.trim())||"";Zr=`${((Mr=Hn[1])==null?void 0:Mr.trim())||""} ${Qr}`.trim()}}else qn.startsWith("EMAIL")||/^ITEM\d+\.EMAIL/i.test(qn)?zn||(zn=la.substring(la.indexOf(":")+1).trim().toLowerCase()):qn.startsWith("ORG")&&(Tn=la.substring(la.indexOf(":")+1).split(";")[0].trim())}zn&&zn.includes("@")&&_e.push({name:Zr||zn.split("@")[0],email:zn,company:Tn})}return _e},er=ie=>{var Dr;const _e=(Dr=ie.target.files)==null?void 0:Dr[0];if(!_e)return;const ht=new FileReader;ht.onload=Mr=>{var la,qn,Hn;const Ln=(la=Mr.target)==null?void 0:la.result;if(_e.name.toLowerCase().endsWith(".vcf")||Ln.trimStart().startsWith("BEGIN:VCARD")){const Qr=mt(Ln);if(Qr.length===0){t({title:"No valid contacts",description:"No contacts with email addresses found in vCard.",variant:"destructive"});return}$e(Qr.map(dn=>({name:dn.name,email:dn.email}))),Ze(Qr.reduce((dn,Os)=>(Os.company&&(dn[Os.email]=Os.company),dn),{})),oe(!0);return}const Zr=Ln.split(`
1306`).map(Qr=>Qr.trim()).filter(Boolean);if(Zr.length<2){t({title:"Invalid CSV",description:"File must have a header row and at least one data row.",variant:"destructive"});return}const zn=Zr[0].toLowerCase().split(",").map(Qr=>Qr.trim().replace(/"/g,"")),Tn=zn.findIndex(Qr=>Qr==="name"||Qr==="full name"||Qr==="first name"),Za=zn.findIndex(Qr=>Qr==="email"||Qr==="email address"||Qr==="e-mail");if(Za===-1){t({title:"Missing email column",description:"CSV must have an 'email' column.",variant:"destructive"});return}const Na=[];for(let Qr=1;Qr<Zr.length;Qr++){const dn=Zr[Qr].split(",").map(Be=>Be.trim().replace(/"/g,"")),Os=(qn=dn[Za])==null?void 0:qn.toLowerCase().trim();if(!Os||!Os.includes("@"))continue;const Qa=Tn>=0&&((Hn=dn[Tn])==null?void 0:Hn.trim())||Os.split("@")[0];Na.push({name:Qa,email:Os})}if(Na.length===0){t({title:"No valid contacts",description:"No valid email addresses found in CSV.",variant:"destructive"});return}$e(Na),oe(!0)},ht.readAsText(_e),o.current&&(o.current.value="")},kt=async()=>{if(!(!e||Le.length===0)){ve(!0);try{const ie=new Set,_e=[],ht=Le.filter(Zr=>{const zn=Zr.email.toLowerCase().trim();return ie.has(zn)?(_e.push(Zr.name||Zr.email),!1):(ie.add(zn),!0)}),Dr=ht.map(Zr=>({user_id:e.id,name:Zr.name,email:Zr.email,...xe[Zr.email]?{company:xe[Zr.email]}:{}})),{data:Mr,error:Ln}=await F.from("contacts").upsert(Dr,{onConflict:"user_id,email",ignoreDuplicates:!1}).select("id, email");if(Ln)throw Ln;if(it&&it!=="none"&&Mr&&Mr.length>0){if(Oe){const{error:qn}=await F.from("contact_list_members").delete().eq("list_id",it);if(qn)throw qn}const zn=Array.from(new Map(Mr.map(qn=>[qn.id,qn])).values()).map(qn=>({list_id:it,contact_id:qn.id})),{error:Tn}=await F.from("contact_list_members").upsert(zn,{onConflict:"list_id,contact_id",ignoreDuplicates:!0});if(Tn)throw Tn;const Za=p.find(qn=>qn.id===it),Na=Oe?"Replaced":"Imported",la=_e.length>0?`Skipped duplicates: ${_e.join(", ")}`:void 0;t({title:`${Na} ${ht.length} contact(s) in ${(Za==null?void 0:Za.name)||"list"}`,description:la})}else{const Zr=_e.length>0?`Skipped duplicates: ${_e.join(", ")}`:void 0;t({title:`Imported ${ht.length} contact(s)`,description:Zr})}oe(!1),$e([]),Ze({}),ct(""),pe(!1),await Promise.all([Ct(),dt()])}catch(ie){t({title:"Import failed",description:ie.message,variant:"destructive"})}finally{ve(!1)}}},at=ie=>{const _e=ie||m;if(_e.length===0){t({title:"Nothing to export",variant:"destructive"});return}const ht=["Name,Email,Company,Notes",..._e.map(Zr=>`"${Zr.name}","${Zr.email}","${Zr.company||""}","${(Zr.notes||"").replace(/"/g,'""')}"`)].join(`
1307`),Dr=new Blob([ht],{type:"text/csv"}),Mr=URL.createObjectURL(Dr),Ln=document.createElement("a");Ln.href=Mr,Ln.download=`contacts-${new Date().toISOString().split("T")[0]}.csv`,Ln.click(),URL.revokeObjectURL(Mr),t({title:"Contacts exported"})},Yt=async ie=>{ke(ie),Nt("");const _e=g[ie.id]||[];
1307if(_e.length>0){const ht=m.filter(Dr=>_e.includes(Dr.id));ot(ht)}else ot([])},Ft=async ie=>{if(le)try{const{error:_e}=await F.from("contact_list_members").delete().eq("list_id",le.id).eq("contact_id",ie);if(_e)throw _e;ot(ht=>ht.filter(Dr=>Dr.id!==ie)),dt(),t({title:"Removed from list"})}catch(_e){t({title:"Error",description:_e.message,variant:"destructive"})}},or=ie=>{const _e=g[ie.id]||[],ht=m.filter(Dr=>_e.includes(Dr.id)).map(Dr=>({name:Dr.name,email:Dr.email}));if(ht.length===0){t({title:"Empty list",description:"Add contacts to this list first.",variant:"destructive"});return}n("/mail",{state:{bulkRecipients:ht,listName:ie.name,listId:ie.id}})},Ar=ie=>{L(_e=>{const ht=new Set(_e);return ht.has(ie)?ht.delete(ie):ht.add(ie),ht})},nn=ie=>ie.split(" ").map(_e=>_e[0]).join("").toUpperCase().slice(0,2),es=h.useCallback(ie=>p.filter(_e=>{var ht;return(ht=g[_e.id])==null?void 0:ht.includes(ie)}),[p,g]),An=h.useMemo(()=>{if(!gt)return Ee;const ie=gt.toLowerCase();return Ee.filter(_e=>{var ht;return _e.name.toLowerCase().includes(ie)||_e.email.toLowerCase().includes(ie)||((ht=_e.company)==null?void 0:ht.toLowerCase().includes(ie))})},[Ee,gt]);return!a&&!s?r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-24 md:pt-28 max-w-lg",children:r.jsxs(Ie,{className:"border-primary/30 bg-primary/5",children:[r.jsx(Ot,{className:"pb-3",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-5 h-5 text-primary"}),r.jsx($t,{className:"text-lg",children:"Contact Management"})]})}),r.jsxs(lt,{className:"space-y-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your contacts, create lists, and send bulk video emails with the Professional or Team plan."}),r.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[r.jsx("li",{className:"flex items-center gap-2",children:"✓ Import contacts from CSV & vCard"}),r.jsx("li",{className:"flex items-center gap-2",children:"✓ Organize contacts into lists"}),r.jsx("li",{className:"flex items-center gap-2",children:"✓ Send bulk video emails"}),r.jsx("li",{className:"flex items-center gap-2",children:"✓ Track email opens & views"})]}),lr()?r.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"This feature is not available on your current plan."}):r.jsx(P,{className:"w-full",onClick:()=>n("/pricing"),children:"Upgrade to Unlock"})]})]})})]}):r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 pt-16 md:pt-16",children:r.jsxs("div",{className:"flex w-full",children:[e&&r.jsx("div",{className:"hidden md:block sticky top-16 h-[calc(100vh-4rem)] overflow-y-auto flex-shrink-0",children:r.jsx(jnt,{lists:p,totalContactCount:m.length,selectedListId:d,onListSelect:ie=>{if(u(ie),ie){const _e=p.find(ht=>ht.id===ie);_e&&Yt(_e)}else ke(null)},onCreateList:be,onEditList:Ue,onDeleteList:ie=>ee(ie),onEmailList:or})}),r.jsx("div",{"data-tour":"contacts-area",className:"flex-1 min-w-0",children:r.jsxs("main",{className:"px-1 sm:px-6 lg:px-8 py-4 sm:py-8",children:[r.jsxs("div",{className:"hidden sm:flex items-center justify-between mb-6",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:d&&le?le.name:"Contacts"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:d&&le?`${Ee.length} contact${Ee.length!==1?"s":""} in this list`:`${m.length} contact${m.length!==1?"s":""} · ${p.length} list${p.length!==1?"s":""}`})]}),r.jsx(ys,{children:r.jsx("div",{className:"flex items-center gap-2",children:d&&le?r.jsxs(r.Fragment,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{size:"sm",onClick:()=>or(le),children:[r.jsx(Es,{className:"w-3.5 h-3.5 mr-1.5"}),"Email List"]})}),r.jsx(yt,{children:"Send a video email to everyone in this list"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>at(Ee),children:[r.jsx(ey,{className:"w-3.5 h-3.5 mr-1.5"}),"Export"]})}),r.jsx(yt,{children:"Download this list's contacts as a CSV file"})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{var ie;return(ie=o.current)==null?void 0:ie.click()},children:[r.jsx(lj,{className:"w-4 h-4 mr-2"}),"Import"]})}),r.jsx(yt,{className:"max-w-[240px]",children:"Import contacts from a CSV or vCard (.vcf) file. Re-importing an updated file will automatically update existing contacts - no duplicates."})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>at(),children:[r.jsx(ey,{className:"w-4 h-4 mr-2"}),"Export"]})}),r.jsx(yt,{children:"Download all contacts as a CSV file"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{size:"sm",onClick:Ge,children:[r.jsx(yk,{className:"w-4 h-4 mr-2"}),"Add Contact"]})}),r.jsx(yt,{children:"Manually add a new contact with name and email"})]})]})})})]}),r.jsx("input",{ref:o,type:"file",accept:".csv,.vcf",className:"hidden",onChange:er}),r.jsx("div",{className:"hidden lg:block",children:d&&le?Ee.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(jr,{className:"w-10 h-10 mx-auto mb-2 opacity-40"}),r.jsx("p",{className:"text-sm",children:"No contacts in this list yet."}),r.jsx("p",{className:"text-xs mt-1",children:'Select contacts and use "Add to List" to populate.'})]}):r.jsxs(r.Fragment,{children:[Ee.length>3&&r.jsxs("div",{className:"relative mb-3",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}
1307),r.jsx(He,{value:gt,onChange:ie=>Nt(ie.target.value),placeholder:"Search in list...",className:"pl-10 pr-8 h-9"}),gt&&r.jsx("button",{onClick:()=>Nt(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"divide-y divide-border",children:An.map(ie=>r.jsxs("div",{className:"flex items-center gap-3 py-2.5 group",children:[r.jsx(an,{className:"h-8 w-8 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:nn(ie.name)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:ie.name}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ie.email}),ie.company&&r.jsx("p",{className:"text-[10px] text-muted-foreground/70 truncate",children:ie.company}),(()=>{const _e=es(ie.id);return _e.length>0?r.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:_e.map(ht=>r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:ht.color}}),ht.name]},ht.id))}):null})()]}),r.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx(dm,{className:"h-3.5 w-3.5"})})}),r.jsxs(So,{align:"end",className:"w-48",children:[r.jsxs(tr,{onClick:()=>n(`/mail?to=${encodeURIComponent(ie.email)}&name=${encodeURIComponent(ie.name)}`),children:[r.jsx(zr,{className:"w-4 h-4 mr-2"}),"Send Email"]}),r.jsxs(tr,{onClick:()=>Xe(ie.id),children:[r.jsx(ty,{className:"w-4 h-4 mr-2"}),"Move to List"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>Ft(ie.id),className:"text-destructive focus:text-destructive",children:[r.jsx(zt,{className:"w-4 h-4 mr-2"}),"Remove from List"]})]})]})})]},ie.id))})]}):r.jsxs(r.Fragment,{children:[m.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(He,{value:w,onChange:ie=>S(ie.target.value),placeholder:"Search contacts...",className:"pl-10 pr-8 h-9"}),w&&r.jsx("button",{onClick:()=>S(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsx(ys,{children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:re?"default":"outline",size:"sm",className:"h-9 text-xs",onClick:()=>{W(!re),L(new Set)},children:[re?r.jsx(fT,{className:"w-3.5 h-3.5 mr-1"}):r.jsx(Um,{className:"w-3.5 h-3.5 mr-1"}),re?"Cancel":"Select"]})}),r.jsx(yt,{children:re?"Exit selection mode":"Select multiple contacts for bulk actions"})]})})]}),re&&r.jsxs(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-4 p-3 bg-muted rounded-lg flex items-center justify-between gap-2 flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-xs font-medium",children:[Q.size," selected"]}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs h-7",onClick:()=>L(new Set(Ae.map(ie=>ie.id))),children:"All"}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs h-7",onClick:()=>L(new Set),children:"None"})]}),r.jsx(ys,{children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[p.length>0&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:Q.size===0,onClick:()=>se(!0),children:[r.jsx(ty,{className:"w-3.5 h-3.5 mr-1"}),"Add to List"]})}),r.jsx(yt,{children:"Add selected contacts to a contact list"})]}),r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{variant:"destructive",size:"sm",className:"h-7 text-xs",disabled:Q.size===0,onClick:()=>ae(!0),children:[r.jsx(Xr,{className:"w-3.5 h-3.5 mr-1"}),"Delete"]})}),r.jsx(yt,{children:"Permanently delete selected contacts"})]})]})})]}),y?r.jsx("div",{className:"flex items-center justify-center py-16",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):m.length===0?r.jsxs(fe.div,{initial:{opacity:0,y:20}
1307,animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-muted/50 flex items-center justify-center mb-4",children:r.jsx(jr,{className:"w-8 h-8 text-muted-foreground"})}),r.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No contacts yet"}),r.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mb-4",children:"Add contacts manually or import a CSV file to get started."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{var ie;return(ie=o.current)==null?void 0:ie.click()},children:[r.jsx(lj,{className:"w-4 h-4 mr-2"}),"Import"]}),r.jsxs(P,{size:"sm",onClick:Ge,children:[r.jsx(yk,{className:"w-4 h-4 mr-2"}),"Add Contact"]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"divide-y divide-border",children:et.map(ie=>r.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-3 py-2.5 sm:py-3 group",children:[re&&r.jsx(ci,{checked:Q.has(ie.id),onCheckedChange:()=>Ar(ie.id),className:"h-4 w-4"}),r.jsx(an,{className:"h-8 w-8 sm:h-9 sm:w-9 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:nn(ie.name)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:ie.name}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ie.email}),ie.company&&r.jsx("p",{className:"text-[10px] text-muted-foreground/70 truncate",children:ie.company}),(()=>{const _e=es(ie.id);return _e.length>0?r.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:_e.map(ht=>r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:ht.color}}),ht.name]},ht.id))}):null})()]}),r.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>St(ie),children:r.jsx(tl,{className:"h-3.5 w-3.5"})}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",children:r.jsx(dm,{className:"h-3.5 w-3.5"})})}),r.jsxs(So,{align:"end",className:"w-44",children:[r.jsxs(tr,{onClick:()=>n(`/mail?to=${encodeURIComponent(ie.email)}&name=${encodeURIComponent(ie.name)}`),children:[r.jsx(zr,{className:"w-4 h-4 mr-2"}),"Send Email"]}),p.length>0&&r.jsxs(tr,{onClick:()=>Xe(ie.id),children:[r.jsx(ty,{className:"w-4 h-4 mr-2"}),"Add to List"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>U(ie.id),className:"text-destructive focus:text-destructive",children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})]},ie.id))}),Ve>1&&r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-border mt-2",children:[r.jsxs("span",{className:"text-xs text-muted-foreground",children:[(tt-1)*Fe+1,"–",Math.min(tt*Fe,Ae.length)," of ",Ae.length]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:tt<=1,onClick:()=>Re(ie=>ie-1),children:"Previous"}),r.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:tt>=Ve,onClick:()=>Re(ie=>ie+1),children:"Next"})]})]})]})]})}),r.jsx("div",{className:"lg:hidden",children:r.jsxs(ec,{value:l,onValueChange:ie=>c(ie),className:"w-full",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-4",children:[r.jsxs(pl,{className:"grid grid-cols-2 w-full max-w-[280px]",children:[r.jsxs(tn,{value:"contacts",className:"text-xs sm:text-sm",children:[r.jsx(jr,{className:"w-3.5 h-3.5 mr-1.5"}),"Contacts"]}),r.jsxs(tn,{value:"lists",className:"text-xs sm:text-sm",children:[r.jsx(Ef,{className:"w-3.5 h-3.5 mr-1.5"}),"Lists"]})]}),r.jsxs("div",{className:"flex sm:hidden items-center gap-1",children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{var ie;return(ie=o.current)==null?void 0:ie.click()},children:r.jsx(lj,{className:"w-4 h-4"})}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>at(),children:r.jsx(ey,{className:"w-4 h-4"})})]})]}),r.jsxs(Fn,{value:"contacts",className:"mt-0",children:[m.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(He,{value:w,onChange:ie=>S(ie.target.value),placeholder:"Search contacts...",className:"pl-10 pr-8 h-9"}),w&&r.jsx("button",{onClick:()=>S(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsxs(P,{variant:re?"default":"outline",size:"sm",className:"h-9 text-xs",onClick:()=>{W(!re),L(new Set)},children:[re?r.jsx(fT,{className:"w-3.5 h-3.5 mr-1"}):r.jsx(Um,{className:"w-3.5 h-3.5 mr-1"}),re?"Cancel":"Select"]})]}),re&&r.jsxs(fe.div,{initial:{opacity:0,y:-10}
1307,animate:{opacity:1,y:0},className:"mb-4 p-3 bg-muted rounded-lg flex items-center justify-between gap-2 flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-xs font-medium",children:[Q.size," selected"]}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs h-7",onClick:()=>L(new Set(Ae.map(ie=>ie.id))),children:"All"}),r.jsx(P,{variant:"link",size:"sm",className:"text-xs h-7",onClick:()=>L(new Set),children:"None"})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[p.length>0&&r.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:Q.size===0,onClick:()=>se(!0),children:[r.jsx(ty,{className:"w-3.5 h-3.5 mr-1"}),"Add to List"]}),r.jsxs(P,{variant:"destructive",size:"sm",className:"h-7 text-xs",disabled:Q.size===0,onClick:()=>ae(!0),children:[r.jsx(Xr,{className:"w-3.5 h-3.5 mr-1"}),"Delete"]})]})]}),y?r.jsx("div",{className:"flex items-center justify-center py-16",children:r.jsx(Me,{className:"w-8 h-8 animate-spin text-primary"})}):m.length===0?r.jsxs(fe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-muted/50 flex items-center justify-center mb-4",children:r.jsx(jr,{className:"w-8 h-8 text-muted-foreground"})}),r.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No contacts yet"}),r.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mb-4",children:"Add contacts manually or import a CSV file to get started."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{var ie;return(ie=o.current)==null?void 0:ie.click()},children:[r.jsx(lj,{className:"w-4 h-4 mr-2"}),"Import"]}),r.jsxs(P,{size:"sm",onClick:Ge,children:[r.jsx(yk,{className:"w-4 h-4 mr-2"}),"Add Contact"]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"divide-y divide-border",children:et.map(ie=>r.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-3 py-2.5 sm:py-3 group",children:[re&&r.jsx(ci,{checked:Q.has(ie.id),onCheckedChange:()=>Ar(ie.id),className:"h-4 w-4"}),r.jsx(an,{className:"h-8 w-8 sm:h-9 sm:w-9 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:nn(ie.name)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:ie.name}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ie.email}),ie.company&&r.jsx("p",{className:"text-[10px] text-muted-foreground/70 truncate",children:ie.company}),(()=>{const _e=es(ie.id);return _e.length>0?r.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:_e.map(ht=>r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:ht.color}}),ht.name]},ht.id))}):null})()]}),r.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 hidden sm:flex",onClick:()=>St(ie),children:r.jsx(tl,{className:"h-3.5 w-3.5"})}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",children:r.jsx(dm,{className:"h-3.5 w-3.5"})})}),r.jsxs(So,{align:"end",className:"w-44",children:[r.jsxs(tr,{className:"sm:hidden",onClick:()=>St(ie),children:[r.jsx(tl,{className:"w-4 h-4 mr-2"}),"Edit"]}),r.jsxs(tr,{onClick:()=>n(`/mail?to=${encodeURIComponent(ie.email)}&name=${encodeURIComponent(ie.name)}`),children:[r.jsx(zr,{className:"w-4 h-4 mr-2"}),"Send Email"]}),p.length>0&&r.jsxs(tr,{onClick:()=>Xe(ie.id),children:[r.jsx(ty,{className:"w-4 h-4 mr-2"}),"Add to List"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>U(ie.id),className:"text-destructive focus:text-destructive",children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})]},ie.id))}),Ve>1&&r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-border mt-2",children:[r.jsxs("span",{className:"text-xs text-muted-foreground",children:[(tt-1)*Fe+1,"–",Math.min(tt*Fe,Ae.length)," of ",Ae.length]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:tt<=1,onClick:()=>Re(ie=>ie-1),children:"Previous"}),r.jsx(P,{variant:"outline",size:"sm",className:"h-7 text-xs",disabled:tt>=Ve,onClick:()=>Re(ie=>ie+1),children:"Next"})]})]})]})]}),r.jsx(Fn,{value:"lists",className:"mt-0",children:le?r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>ke(null),children:"← Back"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:le.color}}),r.jsx("h2",{className:"text-lg font-semibold truncate",children:le.name})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ee.length," contact",Ee.length!==1?"s":""]})]}),r.jsxs(P,{size:"sm",onClick:()=>or(le),children:[r.jsx(Es,{className:"w-3.5 h-3.5 mr-1.5"}),"Email List"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>at(Ee),children:[r.jsx(ey,{className:"w-3.5 h-3.5 mr-1.5"}),"Export"]})]}),Ee.length===0?r.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[r.jsx(jr,{className:"w-10 h-10 mx-auto mb-2 opacity-40"}),r.jsx("p",{className:"text-sm",children:"No contacts in this list yet."}),r.jsx("p",{className:"text-xs mt-1",children:'Select contacts and use "Add to List" to populate.'})]}):r.jsxs(r.Fragment,{children:[Ee.length>3&&r.jsxs("div",{className:"relative mb-3",children:[r.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}
1307),r.jsx(He,{value:gt,onChange:ie=>Nt(ie.target.value),placeholder:"Search in list...",className:"pl-10 pr-8 h-9"}),gt&&r.jsx("button",{onClick:()=>Nt(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"divide-y divide-border",children:An.map(ie=>r.jsxs("div",{className:"flex items-center gap-3 py-2.5",children:[r.jsx(an,{className:"h-8 w-8 flex-shrink-0",children:r.jsx(on,{className:"bg-primary/10 text-primary text-xs",children:nn(ie.name)})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium truncate",children:ie.name}),r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ie.email})]}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Ft(ie.id),children:r.jsx(zt,{className:"h-3.5 w-3.5"})})]},ie.id))})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.length," list",p.length!==1?"s":""]}),r.jsxs(P,{size:"sm",onClick:be,children:[r.jsx(Ns,{className:"w-3.5 h-3.5 mr-1.5"}),"New List"]})]}),p.length===0?r.jsxs("div",{className:"text-center py-16",children:[r.jsx(Ef,{className:"w-10 h-10 mx-auto mb-3 text-muted-foreground/40"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"No lists yet. Create one to organize contacts."}),r.jsxs(P,{size:"sm",onClick:be,children:[r.jsx(Ns,{className:"w-4 h-4 mr-2"}),"Create List"]})]}):r.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:p.map(ie=>r.jsx(Ie,{className:"cursor-pointer hover:border-primary/30 transition-colors",onClick:()=>Yt(ie),children:r.jsxs(lt,{className:"p-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:ie.color}}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("h3",{className:"font-medium text-sm truncate",children:ie.name}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[ie.member_count," contact",ie.member_count!==1?"s":""]})]})]}),r.jsx(ys,{children:r.jsxs("div",{className:"flex items-center gap-0.5",onClick:_e=>_e.stopPropagation(),children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>or(ie),children:r.jsx(Es,{className:"h-3.5 w-3.5"})})}),r.jsx(yt,{children:"Send a video email to this entire list"})]}),r.jsxs(sl,{children:[r.jsx(al,{asChild:!0,children:r.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",children:r.jsx(dm,{className:"h-3.5 w-3.5"})})}),r.jsxs(So,{align:"end",children:[r.jsxs(tr,{onClick:()=>Ue(ie),children:[r.jsx(tl,{className:"w-4 h-4 mr-2"}),"Edit"]}),r.jsxs(tr,{onClick:()=>at(m.filter(_e=>(g[ie.id]||[]).includes(_e.id))),children:[r.jsx(ey,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),r.jsx(bc,{}),r.jsxs(tr,{onClick:()=>ee(ie.id),className:"text-destructive",children:[r.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})})]}),ie.description&&r.jsx("p",{className:"text-xs text-muted-foreground mt-2 line-clamp-1",children:ie.description})]})},ie.id))})]})})]})})]})})]})}),r.jsx(It,{open:_,onOpenChange:C,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:j?"Edit Contact":"Add Contact"})}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Name *"}),r.jsx(He,{value:k.name,onChange:ie=>E(_e=>({..._e,name:ie.target.value})),placeholder:"John Doe",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Email *"}),r.jsx(He,{value:k.email,onChange:ie=>E(_e=>({..._e,email:ie.target.value})),placeholder:"[email protected]",type:"email",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Company"}),r.jsx(He,{value:k.company,onChange:ie=>E(_e=>({..._e,company:ie.target.value})),placeholder:"Acme Corp",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Notes"}),r.jsx($s,{value:k.notes,onChange:ie=>E(_e=>({..._e,notes:ie.target.value})),placeholder:"Optional notes...",className:"mt-1",rows:2})]}),!j&&p.length>0&&r.jsxs("div",{children:[r.jsx(ye,{children:"Add to List"}),r.jsxs(kn,{value:R,onValueChange:T,children:[r.jsx(wn,{className:"mt-1",children:r.jsx(En,{placeholder:"None"})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:"None"}),p.map(ie=>r.jsx(_t,{value:ie.id,children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2 h-2 rounded-full inline-block flex-shrink-0",style:{backgroundColor:ie.color}}),ie.name]})},ie.id))]})]})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),r.jsxs(P,{onClick:Tt,disabled:D||!k.name.trim()||!k.email.trim(),children:[D?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,j?"Save":"Add"]})]})]})}),r.jsx(It,{open:B,onOpenChange:K,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:$?"Edit List":"New List"})}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{children:[r.jsx(ye,{children:"Name *"}),r.jsx(He,{value:Z.name,onChange:ie=>q(_e=>({..._e,name:ie.target.value})),placeholder:"Prospects",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Description"}),r.jsx(He,{value:Z.description,onChange:ie=>q(_e=>({..._e,description:ie.target.value})),placeholder:"Optional description",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(ye,{children:"Color"}),r.jsx("div",{className:"flex flex-wrap gap-2 mt-1.5",children:Zj.map(ie=>r.jsx("button",{className:`w-7 h-7 rounded-full border-2 transition-transform ${Z.color===ie?"border-foreground scale-110":"border-transparent"}`,style:{backgroundColor:ie},onClick:()=>q(_e=>({..._e,color:ie}))},ie))})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>K(!1),children:"Cancel"}),r.jsxs(P,{onClick:we,disabled:H||!Z.name.trim(),children:[H?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,$?"Save":"Create"]})]})]})}),r.jsx(cs,{open:!!V,onOpenChange:ie=>!ie&&U(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete contact?"}),r.jsx(Jn,{children:"This contact will be permanently removed from all lists."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{disabled:O,children:"Cancel"}),r.jsx(bs,{onClick:Zt,disabled:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:O?"Deleting...":"Delete"})]})]})}),r.jsx(cs,{open:!!G,onOpenChange:ie=>!ie&&ee(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete list?"}),r.jsx(Jn,{children:"The list will be deleted. Contacts in this list won't be removed."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),r.jsx(cs,{open:te,onOpenChange:ae,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsxs(Qn,{children:["Delete ",Q.size," contact(s)?"]}),r.jsx(Jn,{children:"These contacts will be permanently removed from all lists."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{disabled:O,children:"Cancel"}),r.jsx(bs,{onClick:bt,disabled:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:O?"Deleting...":"Delete All"})]})]})}),r.jsx(It,{open:ne,onOpenChange:ie=>{se(ie),ie||J(null)},children:r.jsxs(Dt,{className:"max-w-sm",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Add to List"})}),r.jsx("div",{className:"py-2",children:r.jsxs(kn,{value:ue,onValueChange:Ne,children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"Select a list"})}),r.jsx(jn,{children:p.map(ie=>r.jsx(_t,{value:ie.id,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:ie.color}}),ie.name]})},ie.id))})]})}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>{se(!1),J(null)},children:"Cancel"}),r.jsxs(P,{onClick:Wt,disabled:!ue||D,children:[D?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Add ",Qe?"1":Q.size," Contact(s)"]})]})]})}),r.jsx(It,{open:De,onOpenChange:ie=>{oe(ie),ie||(ct(""),pe(!1))},children:r.jsxs(Dt,{className:"max-w-md max-h-[80vh] overflow-y-auto",children:[r.jsx(Lt,{children:r.jsxs(Mt,{children:["Import ",Le.length," Contact(s)"]})}),r.jsxs("div",{className:"py-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Contacts are saved to All Contacts. Existing contacts with the same email will be updated automatically - no duplicates created."}),r.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Tip: You can re-import an updated list anytime to keep your Vidareo contacts in sync."}),p.length>0&&r.jsxs("div",{className:"mb-3",children:[r.jsx(ye,{className:"text-sm font-medium mb-1.5 block",children:"Add to list (optional)"}),r.jsxs(kn,{value:it,onValueChange:ie=>{ct(ie),(ie==="none"||ie==="")&&pe(!1)},children:[r.jsx(wn,{children:r.jsx(En,{placeholder:"No list - All Contacts only"})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:"No list - All Contacts only"}),p.map(ie=>r.jsx(_t,{value:ie.id,children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:ie.color}}),ie.name]})},ie.id))]})]})]}),it&&it!=="none"&&r.jsxs("div",{className:"mb-3 p-3 border rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(ye,{htmlFor:"import-replace",className:"text-sm font-medium cursor-pointer",children:"Replace existing list members"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:Oe?"Current members will be removed. The list will only contain the imported contacts.":"Imported contacts will be added alongside existing members."})]}),r.jsx(rr,{id:"import-replace",checked:Oe,onCheckedChange:pe})]}),Oe&&r.jsxs("div",{className:"flex items-start gap-2 mt-2 text-xs text-destructive",children:[r.jsx(wa,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r.jsx("span",{children:"All contacts currently in this list will be removed first."})]})]}),r.jsxs("div",{className:"max-h-[300px] overflow-y-auto divide-y divide-border border rounded-lg",children:[Le.slice(0,50).map((ie,_e)=>r.jsxs("div",{className:"flex items-center gap-2 p-2 text-sm",children:[r.jsx("span",{className:"font-medium truncate flex-1",children:ie.name}),r.jsx("span",{className:"text-xs text-muted-foreground truncate",children:ie.email})]},_e)),Le.length>50&&r.jsxs("div",{className:"p-2 text-xs text-muted-foreground text-center",children:["...and ",Le.length-50," more"]})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(P,{variant:"outline",onClick:()=>{oe(!1),ct(""),pe(!1)},children:"Cancel"}),r.jsxs(P,{onClick:kt,disabled:de,children:[de?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):r.jsx(na,{className:"w-4 h-4 mr-2"}),"Import"]})]})]})})]})},Snt="/assets/meet-hero-Cab1wjf3.png";var yr=function(){return yr=Object.assign||function(t){for(var n,s=1,a=arguments.length;s<a;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},yr.apply(this,arguments)};function _nt(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(n[s[a]]=e[s[a]]);return n}function hie(e,t,n){for(var s=0,a=t.length,i;s<a;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function Lw(e){return e.mode==="multiple"}function $w(e){return e.mode==="range"}function wC(e){return e.mode==="single"}var Cnt={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:"rd
1307p-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 knt(e,t){return cn(e,"LLLL y",t)}function Ent(e,t){return cn(e,"d",t)}function Ant(e,t){return cn(e,"LLLL",t)}function Tnt(e){return"".concat(e)}function Rnt(e,t){return cn(e,"cccccc",t)}function Ont(e,t){return cn(e,"yyyy",t)}var Pnt=Object.freeze({__proto__:null,formatCaption:knt,formatDay:Ent,formatMonthCaption:Ant,formatWeekNumber:Tnt,formatWeekdayName:Rnt,formatYearCaption:Ont}),Dnt=function(e,t,n){return cn(e,"do MMMM (EEEE)",n)},Mnt=function(){return"Month: "},Int=function(){return"Go to next month"},Lnt=function(){return"Go to previous month"},$nt=function(e,t){return cn(e,"cccc",t)},Vnt=function(e){return"Week n. ".concat(e)},Unt=function(){return"Year: "},Fnt=Object.freeze({__proto__:null,labelDay:Dnt,labelMonthDropdown:Mnt,labelNext:Int,labelPrevious:Lnt,labelWeekNumber:Vnt,labelWeekday:$nt,labelYearDropdown:Unt});function Bnt(){var e="buttons",t=Cnt,n=FD,s={},a={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:Pnt,labels:Fnt,locale:n,modifiersClassNames:s,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function znt(e){var t=e.fromYear,n=e.toYear,s=e.fromMonth,a=e.toMonth,i=e.fromDate,o=e.toDate;return s?i=ro(s):t&&(i=new Date(t,0,1)),a?o=v2(a):n&&(o=new Date(n,11,31)),{fromDate:i?Zd(i):void 0,toDate:o?Zd(o):void 0}}var fie=h.createContext(void 0);function qnt(e){var t,n=e.initialProps,s=Bnt(),a=znt(n),i=a.fromDate,o=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:s.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(wC(n)||Lw(n)||$w(n))&&(c=n.onSelect);var d=yr(yr(yr({},s),n),{captionLayout:l,classNames:yr(yr({},s.classNames),n.classNames),components:yr({},n.components),formatters:yr(yr({},s.formatters),n.formatters),fromDate:i,labels:yr(yr({},s.labels),n.labels),mode:n.mode||s.mode,modifiers:yr(yr({},s.modifiers),n.modifiers),modifiersClassNames:yr(yr({},s.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:yr(yr({},s.styles),n.styles),toDate:o});return r.jsx(fie.Provider,{value:d,children:e.children})}function us(){var e=h.useContext(fie);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function pie(e){var t=us(),n=t.locale,s=t.classNames,a=t.styles,i=t.formatters.formatCaption;return r.jsx("div",{className:s.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Hnt(e){return r.jsx("svg",yr({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:r.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 xie(e){var t,n,s=e.onChange,a=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,d=us(),u=(n=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Hnt;return r.jsxs("div",{className:l,style:c,children:[r.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),r.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:s,children:i}),r.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,r.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Wnt(e){var t,n=us(),s=n.fromDate,a=n.toDate,i=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!s)return r.jsx(r.Fragment,{});if(!a)return r.jsx(r.Fragment,{});var m=[];
1307if(vRe(s,a))for(var f=ro(s),p=s.getMonth();p<=a.getMonth();p++)m.push(vE(f,p));else for(var f=ro(new Date),p=0;p<=11;p++)m.push(vE(f,p));var x=function(v){var y=Number(v.target.value),b=vE(ro(e.displayMonth),y);e.onChange(b)},g=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:xie;return r.jsx(g,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:x,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:m.map(function(v){return r.jsx("option",{value:v.getMonth(),children:l(v,{locale:o})},v.getMonth())})})}function Ynt(e){var t,n=e.displayMonth,s=us(),a=s.fromDate,i=s.toDate,o=s.locale,l=s.styles,c=s.classNames,d=s.components,u=s.formatters.formatYearCaption,m=s.labels.labelYearDropdown,f=[];if(!a)return r.jsx(r.Fragment,{});if(!i)return r.jsx(r.Fragment,{});for(var p=a.getFullYear(),x=i.getFullYear(),g=p;g<=x;g++)f.push(YV(Mee(new Date),g));var v=function(b){var w=YV(ro(n),Number(b.target.value));e.onChange(w)},y=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:xie;return r.jsx(y,{name:"years","aria-label":m(),className:c.dropdown_year,style:l.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:o}),children:f.map(function(b){return r.jsx("option",{value:b.getFullYear(),children:u(b,{locale:o})},b.getFullYear())})})}function Gnt(e,t){var n=h.useState(e),s=n[0],a=n[1],i=t===void 0?s:t;return[i,a]}function Knt(e){var t=e.month,n=e.defaultMonth,s=e.today,a=t||n||s||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&wg(i,a)<0){var d=-1*(c-1);a=Do(i,d)}return o&&wg(a,o)<0&&(a=o),ro(a)}function Xnt(){var e=us(),t=Knt(e),n=Gnt(t,e.month),s=n[0],a=n[1],i=function(o){var l;if(!e.disableNavigation){var c=ro(o);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[s,i]}function Znt(e,t){for(var n=t.reverseMonths,s=t.numberOfMonths,a=ro(e),i=ro(Do(a,s)),o=wg(i,a),l=[],c=0;c<o;c++){var d=Do(a,c);l.push(d)}return n&&(l=l.reverse()),l}function Qnt(e,t){if(!t.disableNavigation){var n=t.toDate,s=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=s?i:1,l=ro(e);if(!n)return Do(l,o);var c=wg(n,e);if(!(c<i))return Do(l,o)}}function Jnt(e,t){if(!t.disableNavigation){var n=t.fromDate,s=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=s?i:1,l=ro(e);if(!n)return Do(l,-o);var c=wg(l,n);if(!(c<=0))return Do(l,-o)}}var gie=h.createContext(void 0);function est(e){var t=us(),n=Xnt(),s=n[0],a=n[1],i=Znt(s,t),o=Qnt(s,t),l=Jnt(s,t),c=function(m){return i.some(function(f){return BD(m,f)})},d=function(m,f){c(m)||(f&&Fee(m,f)?a(Do(m,1+t.numberOfMonths*-1)):a(m))},u={currentMonth:s,displayMonths:i,goToMonth:a,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:c};return r.jsx(gie.Provider,{value:u,children:e.children})}function Vw(){var e=h.useContext(gie);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function Hz(e){var t,n=us(),s=n.classNames,a=n.styles,i=n.components,o=Vw().goToMonth,l=function(u){o(Do(u,e.displayIndex?-e.dis
1307playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:pie,d=r.jsx(c,{id:e.id,displayMonth:e.displayMonth});return r.jsxs("div",{className:s.caption_dropdowns,style:a.caption_dropdowns,children:[r.jsx("div",{className:s.vhidden,children:d}),r.jsx(Wnt,{onChange:l,displayMonth:e.displayMonth}),r.jsx(Ynt,{onChange:l,displayMonth:e.displayMonth})]})}function tst(e){return r.jsx("svg",yr({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:r.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 rst(e){return r.jsx("svg",yr({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:r.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 a_=h.forwardRef(function(e,t){var n=us(),s=n.classNames,a=n.styles,i=[s.button_reset,s.button];e.className&&i.push(e.className);var o=i.join(" "),l=yr(yr({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),r.jsx("button",yr({},e,{ref:t,type:"button",className:o,style:l}))});function nst(e){var t,n,s=us(),a=s.dir,i=s.locale,o=s.classNames,l=s.styles,c=s.labels,d=c.labelPrevious,u=c.labelNext,m=s.components;if(!e.nextMonth&&!e.previousMonth)return r.jsx(r.Fragment,{});var f=d(e.previousMonth,{locale:i}),p=[o.nav_button,o.nav_button_previous].join(" "),x=u(e.nextMonth,{locale:i}),g=[o.nav_button,o.nav_button_next].join(" "),v=(t=m==null?void 0:m.IconRight)!==null&&t!==void 0?t:rst,y=(n=m==null?void 0:m.IconLeft)!==null&&n!==void 0?n:tst;return r.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&r.jsx(a_,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?r.jsx(v,{className:o.nav_icon,style:l.nav_icon}):r.jsx(y,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&r.jsx(a_,{name:"next-month","aria-label":x,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?r.jsx(y,{className:o.nav_icon,style:l.nav_icon}):r.jsx(v,{className:o.nav_icon,style:l.nav_icon})})]})}function Wz(e){var t=us().numberOfMonths,n=Vw(),s=n.previousMonth,a=n.nextMonth,i=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(x){return BD(e.displayMonth,x)}),c=l===0,d=l===o.length-1,u=t>1&&(c||!d),m=t>1&&(d||!c),f=function(){s&&i(s)},p=function(){a&&i(a)};return r.jsx(nst,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:m,nextMonth:a,previousMonth:s,onPreviousClick:f,onNextClick:p})}function sst(e){var t,n=us(),s=n.classNames,a=n.disableNavigation,i=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:pie,d;return a?d=r.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=r.jsx(Hz,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=r.jsxs(r.Fragment,{children:[r.jsx(Hz,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),r.jsx(Wz,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=r.jsxs(r.Fragment,{children:[r.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),r.jsx(Wz,{displayMonth:e.displayMonth,id:e.id})]}),r.jsx("div",{className:s.caption,style:i.caption,children:d})}function ast(e){var t=us(),n=t.footer,s=t.styles,a=t.classNames.tfoot;return n?r.jsx("tfoot",{className:a,style:s.tfoot,children:r.jsx("tr",{children:r.jsx("td",{colSpan:8,children:n})})}):r.jsx(r.Fragment,{})}function ist(e,t,n){for(var s=n?$f(new Date):$c(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=ta(s,i);a.push(o)}return a}function ost(){var e=us(),t=e.classNames,n=e.styles,s=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=ist(a,i,o);return r.jsxs("tr",{style:n.head_row,className:t.head_row,children:[s&&r.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(u,m){return r.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(u,{locale:a}),children:l(u,{locale:a})},m)})]})}function lst(){var e,t=us(),n=t.classNames,s=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:ost;return r.jsx("thead",{style:s.head,className:n.head,children:r.jsx(i,{})})}function cst(e){var t=us(),n=t.locale,s=t.formatters.formatDay;return r.jsx(r.Fragment,{children:s(e.date,{locale:n})})}var p3=h.createContext(void 0);function dst(e){if(!Lw(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return r.jsx(p3.Provider,{value:t,children:e.children})}return r.jsx(ust,{initialProps:e.initialProps,children:e.children})}function ust(e){var t=e.initialProps,n=e.children,s=t.selected,a=t.min,i=t.max,o=function(d,u,m){var f,p;(f=t.onDayClick)===null||f===void 0||f.call(t,d,u,m);var x=!!(u.selected&&a&&(s==null?void 0:s.length)===a);if(!x){var g=!!(!u.selected&&i&&(s==null?void 0:s.length)===i);if(!g){var v=s?hie([],s):[];if(u.selected){var y=v.findIndex(function(b){return Ji(d,b)});v.splice(y,1)}else v.push(d);(p=t.onSelect)===null||p===void 0||p.call(t,v,d,u,m)}}},l={disabled:[]};s&&l.disabled.push(function(d){var u=i&&s.length>i-1,m=s.some(function(f){return Ji(f,d)});return!!(u&&!m)});
1307var c={selected:s,onDayClick:o,modifiers:l};return r.jsx(p3.Provider,{value:c,children:n})}function x3(){var e=h.useContext(p3);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function mst(e,t){var n=t||{},s=n.from,a=n.to;return s&&a?Ji(a,e)&&Ji(s,e)?void 0:Ji(a,e)?{from:a,to:void 0}:Ji(s,e)?void 0:qR(s,e)?{from:e,to:a}:{from:s,to:e}:a?qR(e,a)?{from:a,to:e}:{from:e,to:a}:s?Fee(e,s)?{from:e,to:s}:{from:s,to:e}:{from:e,to:void 0}}var g3=h.createContext(void 0);function hst(e){if(!$w(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return r.jsx(g3.Provider,{value:t,children:e.children})}return r.jsx(fst,{initialProps:e.initialProps,children:e.children})}function fst(e){var t=e.initialProps,n=e.children,s=t.selected,a=s||{},i=a.from,o=a.to,l=t.min,c=t.max,d=function(p,x,g){var v,y;(v=t.onDayClick)===null||v===void 0||v.call(t,p,x,g);var b=mst(p,s);(y=t.onSelect)===null||y===void 0||y.call(t,b,p,x,g)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],o?(u.range_end=[o],Ji(i,o)||(u.range_middle=[{after:i,before:o}])):u.range_end=[i]):o&&(u.range_start=[o],u.range_end=[o]),l&&(i&&!o&&u.disabled.push({after:vf(i,l-1),before:ta(i,l-1)}),i&&o&&u.disabled.push({after:i,before:ta(i,l-1)}),!i&&o&&u.disabled.push({after:vf(o,l-1),before:ta(o,l-1)})),c){if(i&&!o&&(u.disabled.push({before:ta(i,-c+1)}),u.disabled.push({after:ta(i,c-1)})),i&&o){var m=wc(o,i)+1,f=c-m;u.disabled.push({before:vf(i,f)}),u.disabled.push({after:ta(o,f)})}!i&&o&&(u.disabled.push({before:ta(o,-c+1)}),u.disabled.push({after:ta(o,c-1)}))}return r.jsx(g3.Provider,{value:{selected:s,onDayClick:d,modifiers:u},children:n})}function v3(){var e=h.useContext(g3);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function P1(e){return Array.isArray(e)?hie([],e):e!==void 0?[e]:[]}function pst(e){var t={};return Object.entries(e).forEach(function(n){var s=n[0],a=n[1];t[s]=P1(a)}),t}var Xl;(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"})(Xl||(Xl={}));var xst=Xl.Selected,md=Xl.Disabled,gst=Xl.Hidden,vst=Xl.Today,tA=Xl.RangeEnd,rA=Xl.RangeMiddle,nA=Xl.RangeStart,yst=Xl.Outside;function bst(e,t,n){var s,a=(s={},s[xst]=P1(e.selected),s[md]=P1(e.disabled),s[gst]=P1(e.hidden),s[vst]=[e.today],s[tA]=[],s[rA]=[],s[nA]=[],s[yst]=[],s);return e.fromDate&&a[md].push({before:e.fromDate}),e.toDate&&a[md].push({after:e.toDate}),Lw(e)?a[md]=a[md].concat(t.modifiers[md]):$w(e)&&(a[md]=a[md].concat(n.modifiers[md]),a[nA]=n.modifiers[nA],a[rA]=n.modifiers[rA],a[tA]=n.modifiers[tA]),a}var vie=h.createContext(void 0);function wst(e){var t=us(),n=x3(),s=v3(),a=bst(t,n,s),i=pst(t.modifiers),o=yr(yr({},a),i);return r.jsx(vie.Provider,{value:o,children:e.children})}function yie(){var e=h.useContext(vie);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function jst(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Nst(e){return!!(e&&typeof e=="object"&&"from"in e)}function Sst(e){return!!(e&&typeof e=="object"&&"after"in e)}function _st(e){return!!(e&&typeof e=="object"&&"before"in e)}function Cst(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function kst(e,t){var n,s=t.from,a=t.to;if(s&&a){var i=wc(a,s)<0;i&&(n=[a,s],s=n[0],a=n[1]);var o=wc(e,s)>=0&&wc(a,e)>=0;return o}return a?Ji(a,e):s?Ji(s,e):!1}function Est(e){return VD(e)}function Ast(e){return Array.isArray(e)&&e.every(VD)}function Tst(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Est(n))return Ji(e,n);if(Ast(n))return n.includes(e);if(Nst(n))return kst(e,n);if(Cst(n))return n.dayOfWeek.includes(e.getDay());if(jst(n)){var s=wc(n.before,e),a=wc(n.after,e),i=s>0,o=a<0,l=qR(n.before,n.after);return l?o&&i:i||o}return Sst(n)?wc(e,n.after)>0:_st(n)?wc(n.before,e)>0:typeof n=="function"?n(e):!1})}function y3(e,t,n){var s=Object.keys(t).reduce(function(i,o){var l=t[o];return Tst(e,l)&&i.push(o),i},[]),a={};
1307return s.forEach(function(i){return a[i]=!0}),n&&!BD(e,n)&&(a.outside=!0),a}function Rst(e,t){for(var n=ro(e[0]),s=v2(e[e.length-1]),a,i,o=n;o<=s;){var l=y3(o,t),c=!l.disabled&&!l.hidden;if(!c){o=ta(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=ta(o,1)}return i||a}var Ost=365;function bie(e,t){var n=t.moveBy,s=t.direction,a=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=a.weekStartsOn,d=a.fromDate,u=a.toDate,m=a.locale,f={day:ta,week:Vf,month:Do,year:iTe,startOfWeek:function(v){return a.ISOWeek?$f(v):$c(v,{locale:m,weekStartsOn:c})},endOfWeek:function(v){return a.ISOWeek?Iee(v):UD(v,{locale:m,weekStartsOn:c})}},p=f[n](e,s==="after"?1:-1);s==="before"&&d?p=oTe([d,p]):s==="after"&&u&&(p=lTe([u,p]));var x=!0;if(i){var g=y3(p,i);x=!g.disabled&&!g.hidden}return x?p:l.count>Ost?l.lastFocused:bie(p,{moveBy:n,direction:s,context:a,modifiers:i,retry:yr(yr({},l),{count:l.count+1})})}var wie=h.createContext(void 0);function Pst(e){var t=Vw(),n=yie(),s=h.useState(),a=s[0],i=s[1],o=h.useState(),l=o[0],c=o[1],d=Rst(t.displayMonths,n),u=a??(l&&t.isDateDisplayed(l))?l:d,m=function(){c(a),i(void 0)},f=function(v){i(v)},p=us(),x=function(v,y){if(a){var b=bie(a,{moveBy:v,direction:y,context:p,modifiers:n});Ji(a,b)||(t.goToDate(b,a),f(b))}},g={focusedDay:a,focusTarget:u,blur:m,focus:f,focusDayAfter:function(){return x("day","after")},focusDayBefore:function(){return x("day","before")},focusWeekAfter:function(){return x("week","after")},focusWeekBefore:function(){return x("week","before")},focusMonthBefore:function(){return x("month","before")},focusMonthAfter:function(){return x("month","after")},focusYearBefore:function(){return x("year","before")},focusYearAfter:function(){return x("year","after")},focusStartOfWeek:function(){return x("startOfWeek","before")},focusEndOfWeek:function(){return x("endOfWeek","after")}};return r.jsx(wie.Provider,{value:g,children:e.children})}function b3(){var e=h.useContext(wie);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Dst(e,t){var n=yie(),s=y3(e,n,t);return s}var w3=h.createContext(void 0);function Mst(e){if(!wC(e.initialProps)){var t={selected:void 0};return r.jsx(w3.Provider,{value:t,children:e.children})}return r.jsx(Ist,{initialProps:e.initialProps,children:e.children})}function Ist(e){var t=e.initialProps,n=e.children,s=function(i,o,l){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,l);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,o,l)},a={selected:t.selected,onDayClick:s};return r.jsx(w3.Provider,{value:a,children:n})}function jie(){var e=h.useContext(w3);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Lst(e,t){var n=us(),s=jie(),a=x3(),i=v3(),o=b3(),l=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,u=o.focusWeekBefore,m=o.blur,f=o.focus,p=o.focusMonthBefore,x=o.focusMonthAfter,g=o.focusYearBefore,v=o.focusYearAfter,y=o.focusStartOfWeek,b=o.focusEndOfWeek,w=function(O){var M,$,I,B;wC(n)?(M=s.onDayClick)===null||M===void 0||M.call(s,e,t,O):Lw(n)?($=a.onDayClick)===null||$===void 0||$.call(a,e,t,O):$w(n)?(I=i.onDayClick)===null||I===void 0||I.call(i,e,t,O):(B=n.onDayClick)===null||B===void 0||B.call(n,e,t,O)},S=function(O){var M;f(e),(M=n.onDayFocus)===null||M===void 0||M.call(n,e,t,O)},j=function(O){var M;m(),(M=n.onDayBlur)===null||M===void 0||M.call(n,e,t,O)},N=function(O){var M;(M=n.onDayMouseEnter)===null||M===void 0||M.call(n,e,t,O)},_=function(O){var M;(M=n.onDayMouseLeave)===null||M===void 0||M.call(n,e,t,O)},C=function(O){var M;(M=n.onDayPointerEnter)===null||M===void 0||M.call(n,e,t,O)},k=function(O){var M;(M=n.onDayPointerLeave)===null||M===void 0||M.call(n,e,t,O)},E=function(O){var M;(M=n.onDayTouchCancel)===null||M===void 0||M.call(n,e,t,O)},R=function(O){var M;(M=n.onDayTouchEnd)===null||M===void 0||M.call(n,e,t,O)},T=function(O){var M;(M=n.onDayTouchMove)===null||M===void 0||M.call(n,e,t,O)},D=function(O){var M;(M=n.onDayTouchStart)===null||M===void 0||M.call(n,e,t,O)},A=function(O){var M;(M=n.onDayKeyUp)===null||M===void 0||M.call(n,e,t,O)},V=function(O){var M;switch(O.key){case"ArrowLeft":O.preventDefault(),O.stopPropagation(),n.dir==="rtl"?l(
1307):c();break;case"ArrowRight":O.preventDefault(),O.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":O.preventDefault(),O.stopPropagation(),d();break;case"ArrowUp":O.preventDefault(),O.stopPropagation(),u();break;case"PageUp":O.preventDefault(),O.stopPropagation(),O.shiftKey?g():p();break;case"PageDown":O.preventDefault(),O.stopPropagation(),O.shiftKey?v():x();break;case"Home":O.preventDefault(),O.stopPropagation(),y();break;case"End":O.preventDefault(),O.stopPropagation(),b();break}(M=n.onDayKeyDown)===null||M===void 0||M.call(n,e,t,O)},U={onClick:w,onFocus:S,onBlur:j,onKeyDown:V,onKeyUp:A,onMouseEnter:N,onMouseLeave:_,onPointerEnter:C,onPointerLeave:k,onTouchCancel:E,onTouchEnd:R,onTouchMove:T,onTouchStart:D};return U}function $st(){var e=us(),t=jie(),n=x3(),s=v3(),a=wC(e)?t.selected:Lw(e)?n.selected:$w(e)?s.selected:void 0;return a}function Vst(e){return Object.values(Xl).includes(e)}function Ust(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(s){var a=e.modifiersClassNames[s];if(a)n.push(a);else if(Vst(s)){var i=e.classNames["day_".concat(s)];i&&n.push(i)}}),n}function Fst(e,t){var n=yr({},e.styles.day);return Object.keys(t).forEach(function(s){var a;n=yr(yr({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[s])}),n}function Bst(e,t,n){var s,a,i,o=us(),l=b3(),c=Dst(e,t),d=Lst(e,c),u=$st(),m=!!(o.onDayCl
1307ick||o.mode!=="default");h.useEffect(function(){var N;c.outside||l.focusedDay&&m&&Ji(l.focusedDay,e)&&((N=n.current)===null||N===void 0||N.focus())},[l.focusedDay,e,n,m,c.outside]);var f=Ust(o,c).join(" "),p=Fst(o,c),x=!!(c.outside&&!o.showOutsideDays||c.hidden),g=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:cst,v=r.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),y={style:p,className:f,children:v,role:"gridcell"},b=l.focusTarget&&Ji(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&Ji(l.focusedDay,e),S=yr(yr(yr({},y),(s={disabled:c.disabled,role:"gridcell"},s["aria-selected"]=c.selected,s.tabIndex=w||b?0:-1,s)),d),j={isButton:m,isHidden:x,activeModifiers:c,selectedDays:u,buttonProps:S,divProps:y};return j}function zst(e){var t=h.useRef(null),n=Bst(e.date,e.displayMonth,t);return n.isHidden?r.jsx("div",{role:"gridcell"}):n.isButton?r.jsx(a_,yr({name:"day",ref:t},n.buttonProps)):r.jsx("div",yr({},n.divProps))}function qst(e){var t=e.number,n=e.dates,s=us(),a=s.onWeekNumberClick,i=s.styles,o=s.classNames,l=s.locale,c=s.labels.labelWeekNumber,d=s.formatters.formatWeekNumber,u=d(Number(t),{locale:l});if(!a)return r.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:u});var m=c(Number(t),{locale:l}),f=function(p){a(t,n,p)};return r.jsx(a_,{name:"week-number","aria-label":m,className:o.weeknumber,style:i.weeknumber,onClick:f,children:u})}function Hst(e){var t,n,s=us(),a=s.styles,i=s.classNames,o=s.showWeekNumber,l=s.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:zst,d=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:qst,u;return o&&(u=r.jsx("td",{className:i.cell,style:a.cell,children:r.jsx(d,{number:e.weekNumber,dates:e.dates})})),r.jsxs("tr",{className:i.row,style:a.row,children:[u,e.dates.map(function(m){return r.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:r.jsx(c,{displayMonth:e.displayMonth,date:m})},pRe(m))})]})}function Yz(e,t,n){for(var s=n!=null&&n.ISOWeek?Iee(t):UD(t,n),a=n!=null&&n.ISOWeek?$f(e):$c(e,n),i=wc(s,a),o=[],l=0;l<=i;l++)o.push(ta(a,l));var c=o.reduce(function(d,u){var m=n!=null&&n.ISOWeek?Lee(u):Vee(u,n),f=d.find(function(p){return p.weekNumber===m});return f?(f.dates.push(u),d):(d.push({weekNumber:m,dates:[u]}),d)},[]);return c}function Wst(e,t){var n=Yz(ro(e),v2(e),t);if(t!=null&&t.useFixedWeeks){var s=gRe(e,t);if(s<6){var a=n[n.length-1],i=a.dates[a.dates.length-1],o=Vf(i,6-s),l=Yz(Vf(i,1),o,t);n.push.apply(n,l)}}return n}function Yst(e){var t,n,s,a=us(),i=a.locale,o=a.classNames,l=a.styles,c=a.hideHead,d=a.fixedWeeks,u=a.components,m=a.weekStartsOn,f=a.firstWeekContainsDate,p=a.ISOWeek,x=Wst(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:p,locale:i,weekStartsOn:m,firstWeekContainsDate:f}),g=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:lst,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Hst,y=(s=u==null?void 0:u.Footer)!==null&&s!==void 0?s:ast;return r.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&r.jsx(g,{}),r.jsx("tbody",{className:o.tbody,style:l.tbody,children:x.map(function(b){return r.jsx(v,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),r.jsx(y,{displayMonth:e.displayMonth})]})}function Gst(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Kst=Gst()?h.useLayoutEffect:h.useEffect,sA=!1,Xst=0;function Gz(){return"react-day-picker-".concat(++Xst)}function Zst(e){var t,n=e??(sA?Gz():null),s=h.useState(n),a=s[0],i=s[1];return Kst(function(){a===null&&i(Gz())},[]),h.useEffect(function(){sA===!1&&(sA=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function Qst(e){var t,n,s=us(),a=s.dir,i=s.classNames,o=s.styles,l=s.components,c=Vw().displayMonths,d=Zst(s.id?"".concat(s.id,"-").concat(e.displayIndex):void 0),u=s.id?"".concat(s.id,"-grid-").concat(e.displayIndex):void 0,m=[i.month],f=o.month,p=e.displayIndex===0,x=e.displayIndex===c.length-1,g=!p&&!x;a==="rtl"&&(t=[p,x],x=t[0],p=t[1]),p&&(m.push(i.caption_start),f=yr(yr({},f),o.caption_start)),x&&(m.push(i.caption_end),f=yr(yr({}
1307,f),o.caption_end)),g&&(m.push(i.caption_between),f=yr(yr({},f),o.caption_between));var v=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:sst;return r.jsxs("div",{className:m.join(" "),style:f,children:[r.jsx(v,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),r.jsx(Yst,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function Jst(e){var t=us(),n=t.classNames,s=t.styles;return r.jsx("div",{className:n.months,style:s.months,children:e.children})}function eat(e){var t,n,s=e.initialProps,a=us(),i=b3(),o=Vw(),l=h.useState(!1),c=l[0],d=l[1];h.useEffect(function(){a.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[a.initialFocus,c,i.focus,i.focusTarget,i]);var u=[a.classNames.root,a.className];a.numberOfMonths>1&&u.push(a.classNames.multiple_months),a.showWeekNumber&&u.push(a.classNames.with_weeknumber);var m=yr(yr({},a.styles.root),a.style),f=Object.keys(s).filter(function(x){return x.startsWith("data-")}).reduce(function(x,g){var v;return yr(yr({},x),(v={},v[g]=s[g],v))},{}),p=(n=(t=s.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Jst;return r.jsx("div",yr({className:u.join(" "),style:m,dir:a.dir,id:a.id,nonce:s.nonce,title:s.title,lang:s.lang},f,{children:r.jsx(p,{children:o.displayMonths.map(function(x,g){return r.jsx(Qst,{displayIndex:g,displayMonth:x},g)})})}))}function tat(e){var t=e.children,n=_nt(e,["children"]);return r.jsx(qnt,{initialProps:n,children:r.jsx(est,{children:r.jsx(Mst,{initialProps:n,children:r.jsx(dst,{initialProps:n,children:r.jsx(hst,{initialProps:n,children:r.jsx(wst,{children:r.jsx(Pst,{children:t})})})})})})})}function rat(e){return r.jsx(tat,yr({},e,{children:r.jsx(eat,{initialProps:e})}))}function H0({className:e,classNames:t,showOutsideDays:n=!0,...s}){return r.jsx(rat,{showOutsideDays:n,className:ge("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:ge(Kb({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:ge(Kb({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:"border border-primary text-accent-foreground aria-selected:bg-primary aria-selected:text-primary-foreground aria-selected:border-transparent",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})=>r.jsx(L4,{className:"h-4 w-4"}),IconRight:({...a})=>r.jsx(Hl,{className:"h-4 w-4"})},...s})}H0.displayName="Calendar";function Kz(e,t){return new Date(e.getTime()+t*6e4)}function Xz(e,t,n,s){return e<Kz(n,s)&&n<Kz(e,t)}async function Nie({userId:e,personalCode:t,occurrences:n,excludeMeetingIds:s=[]}){const a=[...n].sort((d,u)=>d.startsAt.getTime()-u.startsAt.getTime());for(let d=0;d<a.length;d+=1)for(let u=d+1;u<a.length;u+=1){const m=a[d],f=a[u];if(Xz(m.startsAt,m.durationMinutes,f.startsAt,f.durationMinutes))return{hasConflict:!0,conflictingStart:f.startsAt}}const{data:i,error:o}=await F.from("scheduled_meetings").select("id, scheduled_at, duration_minutes, status").eq("created_by",e).eq("room_code",t).neq("status","cancelled");if(o)throw o;const c=(i??[]).filter(d=>!s.includes(d.id));for(const d of a)for(const u of c){const m=new Date(u.scheduled_at);if(Xz(d.startsAt,d.durationMinutes,m,u.duration_minutes))return{hasConflict:!0,conflictingStart:m}}return{hasConflict:!1,conflictingStart:null}}function aA(e){return e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}function Sie(e){const{title:t,startDate:n,durationMinutes:s,description:a,url:i}=e,o=new Date(n.getTime()+s*60*1e3);return["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//VIDAREO//Video Call//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH","BEGIN:VEVENT",`DTSTART:${aA(n)}`,`DTEND:${aA(o)}
1307`,`SUMMARY:${t}`,`DESCRIPTION:${a}`,`URL:${i}`,`UID:${crypto.randomUUID()}@vidareo.com`,`DTSTAMP:${aA(new Date)}`,"END:VEVENT","END:VCALENDAR"].join(`\r
1308`)}function _ie(e,t){const n=new Blob([e],{type:"text/calendar;charset=utf-8"}),s=URL.createObjectURL(n),a=document.createElement("a");a.href=s,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)}function Cie(e){const{title:t,startDate:n,durationMinutes:s,description:a}=e,i=new Date(n.getTime()+s*60*1e3),o=c=>c.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"");return`https://calendar.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:t,dates:`${o(n)}/${o(i)}`,details:a}).toString()}`}function nat(e){const{title:t,startDate:n,durationMinutes:s,description:a}=e,i=new Date(n.getTime()+s*60*1e3);return`https://outlook.live.com/calendar/0/deeplink/compose?${new URLSearchParams({path:"/calendar/action/compose",rru:"addevent",subject:t,startdt:n.toISOString(),enddt:i.toISOString(),body:a}).toString()}`}const iA=3;function sat(e,t,n,s,a){const i=[e],o=a||52;let l=e;const c=d=>{switch(t){case"daily":return ta(d,1);case"weekly":return Vf(d,1);case"biweekly":return Vf(d,2);case"monthly":return Do(d,1);default:return d}};for(let d=1;d<o&&(l=c(l),!(n==="date"&&s&&l>s||n==="count"&&i.length>=(a||1)));d++)i.push(l);return i}function aat({userId:e,onScheduled:t}){const[n,s]=h.useState(""),[a,i]=h.useState(),[o,l]=h.useState("10:00"),[c,d]=h.useState("30"),[u,m]=h.useState([{name:"",email:""}]),[f,p]=h.useState(!1),[x,g]=h.useState(!0),[v,y]=h.useState(null),[b,w]=h.useState("generate"),[S,j]=h.useState(null),[N,_]=h.useState(!0),[C,k]=h.useState([]),[E,R]=h.useState(""),[T,D]=h.useState(!1),[A,V]=h.useState(0),[U,O]=h.useState("none"),[M,$]=h.useState("count"),[I,B]=h.useState("4"),[K,Z]=h.useState();h.useEffect(()=>{(async()=>{var ne;const[L,te]=await Promise.all([F.from("profiles").select("personal_room_code").eq("user_id",e).maybeSingle(),F.from("contacts").select("id, name, email, company").eq("user_id",e).order("name")]),ae=((ne=L.data)==null?void 0:ne.personal_room_code)??null;j(ae),_(!1),te.data&&k(te.data)})()},[e]);const q=h.useMemo(()=>{if(!E.trim())return C;const L=E.toLowerCase();return C.filter(te=>te.name.toLowerCase().includes(L)||te.email.toLowerCase().includes(L)||te.company&&te.company.toLowerCase().includes(L))},[C,E]),H=(L,te,ae)=>{m(ne=>ne.map((se,ue)=>ue===L?{...se,[te]:ae,contactId:void 0}:se))},X=(L,te)=>{m(ae=>ae.map((ne,se)=>se===te?{name:L.name,email:L.email,contactId:L.id}:ne)),D(!1),R("")},G=()=>{u.length<iA&&m(L=>[...L,{name:"",email:""}])},ee=L=>{u.length<=1?m([{name:"",email:""}]):m(te=>te.filter((ae,ne)=>ne!==L))},re=u.some(L=>L.email.trim()),W=async()=>{const L=n.trim();if(!L){Rt({title:"Title required",description:"Please enter a meeting title.",variant:"destructive"});return}if(!a){Rt({title:"Date required",description:"Please select a date.",variant:"destructive"});return}const te=u.find(ne=>ne.email.trim())||u[0],ae=u.filter(ne=>ne.email.trim());p(!0);try{const[ne,se]=o.split(":").map(Number),ue=new Date(a);if(ue.setHours(ne,se,0,0),ue<=new Date){Rt({title:"Invalid time",description:"Please select a future date and time.",variant:"destructive"}),p(!1);return}const Ne=parseInt(c,10),Qe=U!=="none"?crypto.randomUUID():null,J=U!=="none"?sat(ue,U,M,K,M==="count"?parseInt(I,10):void 0):[ue];if(b==="personal"&&S){const{hasConflict:oe,conflictingStart:xe}=await Nie({userId:e,personalCode:S,occurrences:J.map(Ze=>({startsAt:Ze,durationMinutes:Ne}))});if(oe){Rt({title:"Time already booked",description:`Your personal meeting link is already booked for ${cn(xe??ue,"PPP 'at' p")}.`,variant:"destructive"});return}}const de=J.map(oe=>{const xe=b==="personal"&&S?S:P5();return{created_by:e,room_code:xe,title:L,scheduled_at:oe.toISOString(),duration_minutes:Ne,invitee_name:te.name||null,invitee_email:te.email||null,recurrence_type:U,recurrence_end_type:U!=="none"?M:null,recurrence_end_date:U!=="none"&&M==="date"&&K?K.toISOString():null,recurrence_count:U!=="none"&&M==="count"?parseInt(I,10):null,series_id:Qe}}),{data:ve,error:Le}=await F.from("scheduled_meetings").insert(de).select("id, room_code, scheduled_at");if(Le)throw Le;if(ve&&ae.length>0){const oe=ve.flatMap(xe=>ae.map(Ze=>({meeting_id:xe.id,email:Ze.email.trim().toLowerCase(),name:Ze.name||null})));oe.length>0&&await F.from("meeting_participants").insert(oe)}if(x&&(ve!=null&&ve.length)&&ae.length>0){const oe=ve[0];await F.functions.invoke("send-meeting-invite",{body:{meetingId:oe.id,roomCode:oe.room_code,title:L,scheduledAt:oe.scheduled_at,durationMinutes:Ne,participants:ae.map(xe=>({name:xe.name||null,email:xe.email})),isRecurring:U!=="none",totalOccurrences:J.length}})}const $e=J.length,De=ve==null?void 0:ve[0];Rt({title:"Call scheduled!",description:$e>1?`${$e} recurring calls have been scheduled.`:"Your video call has been scheduled."}),De&&y({title:L,startDate:new Date(De.scheduled_at),durationMinutes:Ne,roomCode:De.room_code}),s(""),i(void 0),l("10:00"),d("30"),m([{name:"",email:""}]),O("none"),B("4"),Z(void 0),t()}catch(ne){Rt({title:"Error",description:ne.message,variant:"destructive"})}finally{p(!1)}},Q=[];for(let L=0;L<24;L++)for(let te=0;te<60;te+=15){const ae=`${String(L).padStart(2,"0")}
1308:${String(te).padStart(2,"0")}`,ne=L<12?"AM":"PM",ue=`${L===0?12:L>12?L-12:L}:${String(te).padStart(2,"0")} ${ne}`;Q.push({value:ae,label:ue})}return r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-lg",children:"Schedule a call"}),r.jsx(xr,{children:"Set up a future video call and send calendar invites."})]}),r.jsxs(lt,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"meeting-title",children:"Title"}),r.jsx(He,{id:"meeting-title",placeholder:"e.g. Weekly check-in",value:n,onChange:L=>s(L.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Room link"}),r.jsxs(Lf,{value:b,onValueChange:L=>w(L),className:"flex gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"generate",id:"room-generate"}),r.jsxs(ye,{htmlFor:"room-generate",className:"flex items-center gap-1.5 text-sm font-normal cursor-pointer",children:[r.jsx($ue,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Auto-generate"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"personal",id:"room-personal",disabled:!S}),r.jsxs(ye,{htmlFor:"room-personal",className:ge("flex items-center gap-1.5 text-sm font-normal cursor-pointer",!S&&"text-muted-foreground/50 cursor-not-allowed"),children:[r.jsx(Wl,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Personal link",!N&&!S&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"(not set)"})]})]})]}),b==="personal"&&S&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Will use ",r.jsxs("span",{className:"font-mono",children:["meet.vidareo.com/",S]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Date"}),r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:ge("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),a?cn(a,"PPP"):"Pick a date"]})}),r.jsx(Tc,{className:"w-auto p-0",align:"start",children:r.jsx(H0,{mode:"single",selected:a,onSelect:i,disabled:L=>L<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0,className:ge("p-3 pointer-events-auto")})})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Time"}),r.jsxs(kn,{value:o,onValueChange:l,children:[r.jsxs(wn,{children:[r.jsx(fr,{className:"w-4 h-4 mr-2"}),r.jsx(En,{})]}),r.jsx(jn,{children:Q.map(L=>r.jsx(_t,{value:L.value,children:L.label},L.value))})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Duration"}),r.jsxs(kn,{value:c,onValueChange:d,children:[r.jsx(wn,{children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"15",children:"15 minutes"}),r.jsx(_t,{value:"30",children:"30 minutes"}),r.jsx(_t,{value:"45",children:"45 minutes"}),r.jsx(_t,{value:"60",children:"1 hour"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(ye,{className:"flex items-center gap-1.5",children:[r.jsx(F4,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Repeat"]}),r.jsxs(kn,{value:U,onValueChange:O,children:[r.jsx(wn,{children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:"Does not repeat"}),r.jsx(_t,{value:"daily",children:"Daily"}),r.jsx(_t,{value:"weekly",children:"Weekly"}),r.jsx(_t,{value:"biweekly",children:"Every 2 weeks"}),r.jsx(_t,{value:"monthly",children:"Monthly"})]})]})]}),U!=="none"&&r.jsxs("div",{className:"space-y-3 rounded-lg border border-border p-3 bg-muted/30",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm",children:"Ends"}),r.jsxs(Lf,{value:M,onValueChange:$,className:"flex gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"count",id:"end-count"}),r.jsx(ye,{htmlFor:"end-count",className:"text-sm font-normal cursor-pointer",children:"After"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"date",id:"end-date"}),r.jsx(ye,{htmlFor:"end-date",className:"text-sm font-normal cursor-pointer",children:"On date"})]})]})]}),M==="count"&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{type:"number",min:"2",max:"52",value:I,onChange:L=>B(L.target.value),className:"w-20"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"occurrences"})]}),M==="date"&&r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:ge("w-full justify-start text-left font-normal",!K&&"text-muted-foreground"),children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),K?cn(K,"PPP"):"Pick end date"]})}),r.jsx(Tc,{className:"w-auto p-0",align:"start",children:r.jsx(H0,{mode:"single",selected:K,onSelect:Z,disabled:L=>L<(a||new Date),initialFocus:!0,className:ge("p-3 pointer-events-auto")})})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs(ye,{children:["Invite participants ",r.jsxs("span",{className:"text-xs text-muted-foreground font-normal",children:["(",u.length,"/",iA,")"]})]})}),u.map((L,te)=>r.jsxs("div",{className:"space-y-2 rounded-lg border border-border p-3 bg-muted/20 relative",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Participant ",te+1]}),r.jsxs("div",{className:"flex items-center gap-1",children:[C.length>0&&r.jsxs(P,{variant:"ghost",size:"sm",className:"h-6 text-[10px] gap-1 px-2",onClick:()=>{V(te),D(!0)},children:[r.jsx(jr,{className:"w-3 h-3"}),"Contacts"]}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>ee(te),children:r.jsx(zt,{className:"w-3.5 h-3.5"})})]})]}),L.contactId&&r.jsx("div",{className:"flex items-center gap-2 rounded-md bg-accent/50 px-2.5 py-1.5",children:r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:L.name}),r.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:L.email})]})}),!L.contactId&&r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx(He,{placeholder:"Name",value:L.name,onChange:ae=>H(te,"name",ae.target.value),className:"h-8 text-sm"}),r.jsx(He,{type:"email",placeholder:"Email",value:L.email,onChange:ae=>H(te,"email",ae.target.value),className:"h-8 text-sm"})]})]},te)),u.length<iA&&r.jsxs(P,{variant:"outline",size:"sm",className:"w-full gap-1.5 text-xs",onClick:G,children:[r.jsx(Ns,{className:"w-3.5 h-3.5"}),"Add another participant"]})]}),r.jsxs(Ad,{open:T,onOpenChange:D,children:[r.jsx(Td,{asChild:!0,children:r.jsx("span",{})}),r.jsxs(Tc,{className:"w-72 p-0",align:"end",children:[r.jsx("div",{className:"p-2 border-b border-border",children:r.jsxs("div",{className:"relative",children:[r.jsx(Fl,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),r.jsx(He,{placeholder:"Search contacts...",value:E,onChange:L=>R(L.target.value),className:"pl-8 h-8 text-sm",autoFocus:!0})]})}),r.jsx(Io,{className:"max-h-52",children:q.length===0?r.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No contacts found"}):r.jsx("div",{className:"p-1",children:q.map(L=>{const te=u.some(ae=>ae.contactId===L.id);return r.jsxs("button",{onClick:()=>!te&&X(L,A),disabled:te,className:ge("w-full text-left px-2.5 py-2 rounded-md transition-colors flex flex-col gap-0.5",te?"opacity-40 cursor-not-allowed":"hover:bg-accent"),children:[r.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:L.name}),r.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[L.email,te?" (added)":""]})]},L.id)})})})]})]}),re&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"send-email",checked:x,onCheckedChange:L=>g(L===!0)}),r.jsxs(ye,{htmlFor:"send-email",className:"text-sm font-normal cursor-pointer flex items-center gap-1.5",children:[r.jsx(zr,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Send calendar invite emails"]})]}),r.jsxs(P,{className:"w-full",onClick:W,disabled:f||!a||!n.trim(),children:[r.jsx(cr,{className:"w-4 h-4"}),f?"Scheduling...":"Schedule call"]})]})]}),r.jsx(It,{open:!!v,onOpenChange:L=>!L&&y(null),children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsxs(Mt,{className:"flex items-center gap-2",children:[r.jsx(Lm,{className:"w-5 h-5 text-emerald-500"}),"Call Scheduled"]}),r.jsx($r,{children:"Add this call to your calendar so you don't miss it."})]}),v&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border p-3 bg-muted/30 space-y-1",children:[r.jsx("p",{className:"font-medium text-sm",children:v.title}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[cn(v.startDate,"PPP p")," · ",v.durationMinutes,"min"]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>
1308{const L=`https://meet.vidareo.com/${v.roomCode}`,te=Cie({title:v.title,startDate:v.startDate,durationMinutes:v.durationMinutes,description:`Join at ${L}`});window.open(te,"_blank")},children:[r.jsx(bn,{className:"w-4 h-4"}),"Google Calendar"]}),r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{const L=`https://meet.vidareo.com/${v.roomCode}`,te=nat({title:v.title,startDate:v.startDate,durationMinutes:v.durationMinutes,description:`Join at ${L}`});window.open(te,"_blank")},children:[r.jsx(bn,{className:"w-4 h-4"}),"Outlook Calendar"]}),r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{const L=`https://meet.vidareo.com/${v.roomCode}`,te=Sie({title:v.title,startDate:v.startDate,durationMinutes:v.durationMinutes,description:`Join at ${L}`,url:L});_ie(te,`${v.title.replace(/\s+/g,"-")}.ics`)},children:[r.jsx(lv,{className:"w-4 h-4"}),"Download .ics file"]})]})]}),r.jsx(Fr,{children:r.jsx(P,{variant:"secondary",onClick:()=>y(null),children:"Done"})})]})})]})}function iat({userId:e}){const t=Sr(),[n,s]=h.useState(null),[a,i]=h.useState(!1),[o,l]=h.useState(!0);h.useEffect(()=>{(async()=>{const{data:u}=await F.from("profiles").select("personal_room_code").eq("user_id",e).maybeSingle();s((u==null?void 0:u.personal_room_code)??null),l(!1)})()},[e]);const c=n?`https://meet.vidareo.com/${n}`:null,d=async()=>{c&&(await navigator.clipboard.writeText(c),i(!0),Rt({title:"Link copied!"}),setTimeout(()=>i(!1),2e3))};return o?null:r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(Wl,{className:"w-5 h-5"}),"Personal Meeting Link"]}),r.jsx(xr,{children:n?"Share your personal link - it stays the same for every call.":"Set up a reusable personal meeting link in your profile."})]}),r.jsx(lt,{children:n?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2 bg-muted/50 rounded-lg px-4 py-3",children:r.jsxs("span",{className:"text-sm font-mono text-foreground flex-1 truncate",children:["meet.vidareo.com/",n]})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{className:"flex-1",size:"sm",onClick:d,children:[a?r.jsx(nt,{className:"w-4 h-4"}):r.jsx(ui,{className:"w-4 h-4"}),a?"Copied!":"Copy link"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>t(`/meet/${n}`),children:[r.jsx(bn,{className:"w-4 h-4"}),"Open room"]})]})]}):r.jsx(P,{variant:"outline",className:"w-full",onClick:()=>t("/profile"),children:"Set up personal link"})})]})}const kie=[];for(let e=0;e<24;e++)for(let t=0;t<60;t+=15){const n=`${String(e).padStart(2,"0")}:${String(t).padStart(2,"0")}`,s=e<12?"AM":"PM",i=`${e===0?12:e>12?e-12:e}:${String(t).padStart(2,"0")} ${s}`;kie.push({value:n,label:i})}function oat(e,t,n,s,a){const i=[e],o=a||52;let l=e;const c=d=>{switch(t){case"daily":return ta(d,1);case"weekly":return Vf(d,1);case"biweekly":return Vf(d,2);case"monthly":return Do(d,1);default:return d}};for(let d=1;d<o&&(l=c(l),!(n==="date"&&s&&l>s||n==="count"&&i.length>=(a||1)));d++)i.push(l);return i}function Eie({meeting:e,open:t,onOpenChange:n,onSaved:s}){const[a,i]=h.useState(""),[o,l]=h.useState(),[c,d]=h.useState("10:00"),[u,m]=h.useState("30"),[f,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(!0),[b,w]=h.useState(!1),[S,j]=h.useState("none"),[N,_]=h.useState("count"),[C,k]=h.useState("4"),[E,R]=h.useState(),[T,D]=h.useState(!1);h.useEffect(()=>{if(e){const V=new Date(e.scheduled_at);i(e.title),l(V),d(`${String(V.getHours()).padStart(2,"0")}:${String(V.getMinutes()).padStart(2,"0")}`),m(String(e.duration_minutes)),p(e.invitee_name||""),g(e.invitee_email||""),y(!!e.invitee_email);const U=e.recurrence_type||"none";j(U),D(U!=="none"),_(e.recurrence_end_type||"count"),k(e.recurrence_count?String(e.recurrence_count):"4"),R(e.recurrence_end_date?new Date(e.recurrence_end_date):void 0)}},[e]);const A=async()=>{if(!(!e||!o||!a.trim())){w(!0);try{const[V,U]=c.split(":").map(Number),O=new Date(o);if(O.setHours(V,U,0,0),O<=new Date){Rt({title:"Invalid time",description:"Please select a future date and time.",variant:"destructive"});return}const M=parseInt(u,10),$=S!=="none",I=$&&!T,B=I?oat(O,S,N,E,N==="count"?parseInt(C,10):void 0):[O],{data:K,error:Z}=await F.from("profiles").select("personal_room_code").eq("user_id",e.created_by).maybeSingle();if(Z)throw Z;const q=(K==null?void 0:K.personal_room_code)??null,H=!!q&&e.room_code===q;if(H&&q){const{hasConflict:re,conflictingStart:W}=await Nie({userId:e.created_by,personalCode:q,occurrences:B.map(Q=>({startsAt:Q,durationMinutes:M})),excludeMeetingIds:[e.id]});if(re){Rt({title:"Time already booked",description:`This personal meeting link is already booked for ${cn(W??O,"PPP 'at' p")}.`,variant:"destructive"});return}}const X={title:a.trim(),scheduled_at:O.toISOString(),duration_minutes:M,invitee_name:f||null,invitee_email:x||null,recurrence_type:S,recurrence_end_type:$?N:null,recurrence_end_date:$&&N==="date"&&E?E.toISOString():null,recurrence_count:$&&N==="count"?parseInt(C,10):null,series_id:$?e.series_id||e.id:null},{error:G}=await F.from("scheduled_meetings").update(X).eq("id",e.id);if(G)throw G;if(I){const re=e.series_id||e.id,W=B.slice(1);if(W.length>0){const Q=W.map(te=>
1308({created_by:e.created_by,room_code:H&&q?q:P5(),title:a.trim(),scheduled_at:te.toISOString(),duration_minutes:M,invitee_name:f||null,invitee_email:x||null,recurrence_type:S,recurrence_end_type:N,recurrence_end_date:N==="date"&&E?E.toISOString():null,recurrence_count:N==="count"?parseInt(C,10):null,series_id:re})),{error:L}=await F.from("scheduled_meetings").insert(Q);if(L)throw L}}v&&x.trim()&&await F.functions.invoke("send-meeting-invite",{body:{meetingId:e.id,roomCode:e.room_code,title:a.trim(),scheduledAt:O.toISOString(),durationMinutes:M,inviteeName:f||null,inviteeEmail:x.trim(),isRecurring:$}});const ee=I?`Recurring series created with ${B.length} occurrences.`:v&&x.trim()?"Updated invite sent to invitee.":void 0;Rt({title:"Meeting updated",description:ee}),s(),n(!1)}catch(V){console.error("Edit error:",V),Rt({title:"Failed to update",description:"Please try again.",variant:"destructive"})}finally{w(!1)}}};return r.jsx(It,{open:t,onOpenChange:n,children:r.jsxs(Dt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[r.jsx(Lt,{children:r.jsx(Mt,{children:"Edit meeting"})}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Title"}),r.jsx(He,{value:a,onChange:V=>i(V.target.value)})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Date"}),r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:ge("w-full justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),o?cn(o,"PPP"):"Pick a date"]})}),r.jsx(Tc,{className:"w-auto p-0",align:"start",children:r.jsx(H0,{mode:"single",selected:o,onSelect:l,disabled:V=>V<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0,className:ge("p-3 pointer-events-auto")})})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Time"}),r.jsxs(kn,{value:c,onValueChange:d,children:[r.jsxs(wn,{children:[r.jsx(fr,{className:"w-4 h-4 mr-2"}),r.jsx(En,{})]}),r.jsx(jn,{children:kie.map(V=>r.jsx(_t,{value:V.value,children:V.label},V.value))})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Duration"}),r.jsxs(kn,{value:u,onValueChange:m,children:[r.jsx(wn,{children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"15",children:"15 minutes"}),r.jsx(_t,{value:"30",children:"30 minutes"}),r.jsx(_t,{value:"45",children:"45 minutes"}),r.jsx(_t,{value:"60",children:"1 hour"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(ye,{className:"flex items-center gap-1.5",children:[r.jsx(F4,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Repeat"]}),r.jsxs(kn,{value:S,onValueChange:j,children:[r.jsx(wn,{children:r.jsx(En,{})}),r.jsxs(jn,{children:[r.jsx(_t,{value:"none",children:"Does not repeat"}),r.jsx(_t,{value:"daily",children:"Daily"}),r.jsx(_t,{value:"weekly",children:"Weekly"}),r.jsx(_t,{value:"biweekly",children:"Every 2 weeks"}),r.jsx(_t,{value:"monthly",children:"Monthly"})]})]})]}),S!=="none"&&r.jsxs("div",{className:"space-y-3 rounded-lg border border-border p-3 bg-muted/30",children:[T&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"This meeting is already part of a recurring series. Changing recurrence settings will only affect this occurrence."}),!T&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{className:"text-sm",children:"Ends"}),r.jsxs(Lf,{value:N,onValueChange:_,className:"flex gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"count",id:"edit-end-count"}),r.jsx(ye,{htmlFor:"edit-end-count",className:"text-sm font-normal cursor-pointer",children:"After"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{value:"date",id:"edit-end-date"}),r.jsx(ye,{htmlFor:"edit-end-date",className:"text-sm font-normal cursor-pointer",children:"On date"})]})]})]}),N==="count"&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{type:"number",min:"2",max:"52",value:C,onChange:V=>k(V.target.value),className:"w-20"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"occurrences"})]}),N==="date"&&r.jsxs(Ad,{children:[r.jsx(Td,{asChild:!0,children:r.jsxs(P,{variant:"outline",className:ge("w-full justify-start text-left font-normal",!E&&"text-muted-foreground"),children:[r.jsx(Ga,{className:"w-4 h-4 mr-2"}),E?cn(E,"PPP"):"Pick end date"]})}),r.jsx(Tc,{className:"w-auto p-0",align:"start",children:r.jsx(H0,{mode:"single",selected:E,onSelect:R,disabled:V=>V<(o||new Date),initialFocus:!0,className:ge("p-3 pointer-events-auto")})})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Invitee name"}),r.jsx(He,{placeholder:"Optional",value:f,onChange:V=>p(V.target.value)})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{children:"Invitee email"}),r.jsx(He,{type:"email",placeholder:"Optional",value:x,onChange:V=>g(V.target.value)})]})]}),x.trim()&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{id:"send-update",checked:v,onCheckedChange:V=>y(V===!0)}),r.jsx(ye,{htmlFor:"send-update",className:"text-sm font-normal cursor-pointer",children:"Send updated calendar invite to invitee"})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>n(!1),disabled:b,children:"Cancel"}),r.jsxs(P,{onClick:A,disabled:b||!a.trim()||!o,children:[b&&r.jsx(Me,{className:"w-4 h-4 animate-spin mr-1"}),"Save changes"]})]})]})})}function lat(e){switch(e){case"daily":return"Daily";case"weekly":return"Weekly";case"biweekly":return"Bi-weekly";case"monthly":return"Monthly";default:return"Recurring"}}function cat({p:e}
1308){const n={accepted:{icon:r.jsx(nt,{className:"w-2.5 h-2.5"}),label:"Accepted",className:"border-emerald-500/40 text-emerald-700 dark:text-emerald-400 bg-emerald-500/10"},maybe:{icon:r.jsx(ff,{className:"w-2.5 h-2.5"}),label:"Maybe",className:"border-amber-500/40 text-amber-700 dark:text-amber-400 bg-amber-500/10"},declined:{icon:r.jsx(zt,{className:"w-2.5 h-2.5"}),label:"Declined",className:"border-destructive/40 text-destructive bg-destructive/10"},pending:{icon:e.email_opened_at?r.jsx(wr,{className:"w-2.5 h-2.5"}):r.jsx(fr,{className:"w-2.5 h-2.5"}),label:e.email_opened_at?"Opened, no reply":"No response",className:"border-border text-muted-foreground bg-muted/40"}}[e.rsvp_status],s=e.name||e.email;return r.jsxs("span",{title:e.email+(e.responded_at?` · responded ${dh(new Date(e.responded_at),{addSuffix:!0})}`:""),className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] border ${n.className}`,children:[n.icon,r.jsx("span",{className:"truncate max-w-[120px]",children:s}),r.jsx("span",{className:"opacity-60",children:"·"}),r.jsx("span",{children:n.label})]})}function oA({meeting:e,participants:t,copiedId:n,resendingId:s,syncingId:a,onCopy:i,onEdit:o,onCancel:l,onDownloadICS:c,onGoogleCalendar:d,onResendInvite:u,onSyncGoogle:m,onJoin:f,hasGoogleConnection:p}){const x=t.filter(y=>y.meeting_id===e.id),g=x.filter(y=>y.rsvp_status==="accepted").length,v=x.filter(y=>y.rsvp_status==="pending").length;return r.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"font-medium text-foreground text-sm",children:e.title}),r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),cn(new Date(e.scheduled_at),"PPP p")," · ",e.duration_minutes,"min"]}),r.jsxs("p",{className:"text-xs text-muted-foreground font-mono tracking-wide mt-0.5",children:["Room: ",e.room_code]}),e.invite_sent_at&&x.length>0&&r.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Invite sent ",dh(new Date(e.invite_sent_at),{addSuffix:!0}),x.length>0&&` · ${g}/${x.length} accepted${v>0?` · ${v}
1308 pending`:""}`]})]}),r.jsx(Se,{variant:"secondary",className:"text-xs shrink-0",children:"Scheduled"})]}),x.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 pt-1",children:x.map(y=>r.jsx(cat,{p:y},y.id))}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>o(e),children:[r.jsx(tl,{className:"w-3 h-3"}),"Edit"]}),r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>i(e),children:[n===e.id?r.jsx(nt,{className:"w-3 h-3"}):r.jsx(ui,{className:"w-3 h-3"}),n===e.id?"Copied":"Copy link"]}),r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>c(e),children:[r.jsx(lv,{className:"w-3 h-3"}),".ics"]}),r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>d(e),children:[r.jsx(bn,{className:"w-3 h-3"}),"Google"]}),x.length>0&&r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>u(e),disabled:s===e.id,children:[s===e.id?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsx(Es,{className:"w-3 h-3"}),"Resend invite"]}),p&&e.google_event_id&&r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>m(e),disabled:a===e.id,title:"Pull latest RSVPs from Google Calendar",children:[a===e.id?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsx(vs,{className:"w-3 h-3"}),"Sync RSVPs"]}),r.jsx(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>f(e),children:"Join"}),r.jsxs(P,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive",onClick:()=>l(e),children:[r.jsx(zt,{className:"w-3 h-3"}),"Cancel"]})]})]})}function dat({userId:e,refreshKey:t}){const n=Sr(),[s,a]=h.useState([]),[i,o]=h.useState([]),[l,c]=h.useState(null),[d,u]=h.useState(null),[m,f]=h.useState(!1),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,b]=h.useState(null),[w,S]=h.useState(!1),[j,N]=h.useState(new Set),_=async()=>{const{data:O}=await F.from("scheduled_meetings").select("*").eq("created_by",e).eq("status","scheduled").gte("scheduled_at",new Date().toISOString()).order("scheduled_at",{ascending:!0}),M=O??[];if(a(M),M.length>0){const $=M.map(B=>B.id),{data:I}=await F.from("meeting_participants").select("id, meeting_id, name, email, rsvp_status, responded_at, email_opened_at").in("meeting_id",$);o(I??[])}else o([])};h.useEffect(()=>{(async()=>{const{data:O}=await F.from("scheduler_integrations").select("id").eq("user_id",e).eq("provider","google_calendar").maybeSingle();S(!!O)})()},[e,t]),h.useEffect(()=>{_()},[e,t]);const C=(()=>{var I;const O=new Map,M=[];for(const B of s)if(B.series_id){const K=O.get(B.series_id)||[];K.push(B),O.set(B.series_id,K)}else M.push(B);const $=[];for(const B of M)$.push({key:B.id,isRecurring:!1,recurrenceType:null,meetings:[B]});for(const[B,K]of O)$.push({key:B,isRecurring:!0,recurrenceType:((I=K[0])==null?void 0:I.recurrence_type)??null,meetings:K});return $.sort((B,K)=>new Date(B.meetings[0].scheduled_at).getTime()-new Date(K.meetings[0].scheduled_at).getTime()),$})(),k=O=>{N(M=>{const $=new Set(M);return $.has(O)?$.delete(O):$.add(O),$})},E=async O=>{const M=`https://meet.vidareo.com/${O.room_code}`;await navigator.clipboard.writeText(M),c(O.id),Rt({title:"Link copied!"}),setTimeout(()=>c(null),2e3)},R=async O=>{if(d){f(!0);try{await F.from("scheduled_meetings").update({status:"cancelled"}).eq("id",d.id),O&&d.invitee_email&&await F.functions.invoke("send-meeting-cancellation",{body:{meetingId:d.id,title:d.title,scheduledAt:d.scheduled_at,durationMinutes:d.duration_minutes,roomCode:d.room_code,inviteeName:d.invitee_name,inviteeEmail:d.invitee_email}}),Rt({title:"Meeting cancelled",description:O&&d.invitee_email?`Cancellation email sent to ${d.invitee_email}`:void 0}),_()}catch(M){console.error("Cancel error:",M),Rt({title:"Failed to cancel",description:"Please try again.",variant:"destructive"})}finally{f(!1),u(null)}}},U={participants:i,copiedId:l,resendingId:g,syncingId:y,hasGoogleConnection:w,onCopy:E,onEdit:x,onCancel:u,onDownloadICS:O=>{const M=`https://meet.vidareo.com/${O.room_code}`,$=Sie({title:O.title,startDate:new Date(O.scheduled_at),durationMinutes:O.duration_minutes,description:`Join at ${M}`,url:M});_ie($,`${O.title.replace(/\s+/g,"-")}.ics`)},onGoogleCalendar:O=>
1308{const M=`https://meet.vidareo.com/${O.room_code}`,$=Cie({title:O.title,startDate:new Date(O.scheduled_at),durationMinutes:O.duration_minutes,description:`Join at ${M}`});window.open($,"_blank")},onResendInvite:async O=>{const M=i.filter($=>$.meeting_id===O.id);if(M.length!==0){v(O.id);try{await F.functions.invoke("send-meeting-invite",{body:{meetingId:O.id,roomCode:O.room_code,title:O.title,scheduledAt:O.scheduled_at,durationMinutes:O.duration_minutes,participants:M.map($=>({name:$.name,email:$.email}))}}),Rt({title:"Invites resent",description:`Sent to ${M.length} ${M.length===1?"recipient":"recipients"}`}),_()}catch($){console.error("Resend error:",$),Rt({title:"Failed to resend",description:"Please try again.",variant:"destructive"})}finally{v(null)}}},onSyncGoogle:async O=>{b(O.id);try{const{error:M}=await F.functions.invoke("google-calendar-sync",{body:{meetingId:O.id}});if(M)throw M;Rt({title:"Synced",description:"Latest RSVPs pulled from Google Calendar."}),_()}catch(M){Rt({title:"Sync failed",description:M.message,variant:"destructive"})}finally{b(null)}},onJoin:O=>n(`/meet/${O.room_code}`)};return s.length===0?null:r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{children:[r.jsx(Ot,{children:r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(Ga,{className:"w-5 h-5"}),"Upcoming Calls"]})}),r.jsx(lt,{className:"space-y-3",children:C.map(O=>{if(!O.isRecurring||O.meetings.length===1)return r.jsx(oA,{meeting:O.meetings[0],...U},O.key);const M=O.meetings[0],$=O.meetings.slice(1),I=j.has(O.key);return r.jsx("div",{className:"space-y-0",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs(Se,{variant:"outline",className:"text-[10px] h-5 gap-1",children:[r.jsx(F4,{className:"w-2.5 h-2.5"}),lat(O.recurrenceType)," series"]})}),r.jsx(oA,{meeting:M,...U}),$.length>0&&r.jsxs(Wm,{open:I,onOpenChange:()=>k(O.key),children:[r.jsx(Ff,{asChild:!0,children:r.jsxs(P,{variant:"ghost",size:"sm",className:"w-full h-8 text-xs text-muted-foreground hover:text-foreground mt-1",children:[I?r.jsx(Mm,{className:"w-3.5 h-3.5 mr-1"}):r.jsx(Qs,{className:"w-3.5 h-3.5 mr-1"}),$.length," more upcoming ",$.length===1?"call":"calls"]})}),r.jsx(Ym,{className:"space-y-2 mt-2",children:$.map(B=>r.jsx(oA,{meeting:B,...U},B.id))})]})]})},O.key)})})]}),r.jsx(Eie,{meeting:p,open:!!p,onOpenChange:O=>!O&&x(null),onSaved:_}),r.jsx(cs,{open:!!d,onOpenChange:O=>!O&&u(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Cancel this meeting?"}),r.jsx(Jn,{children:d&&r.jsxs("span",{className:"block space-y-1",children:[r.jsx("span",{className:"font-medium text-foreground block",children:d.title}),r.jsx("span",{className:"block",children:cn(new Date(d.scheduled_at),"PPP p")}),d.invitee_name&&r.jsxs("span",{className:"block",children:["with ",d.invitee_name]})]})})]}),r.jsxs(Zn,{className:"flex-col gap-2 sm:flex-col",children:[d!=null&&d.invitee_email?r.jsxs(r.Fragment,{children:[r.jsxs(P,{variant:"destructive",className:"w-full",onClick:()=>R(!0),disabled:m,children:[m?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(zr,{className:"w-4 h-4"}),"Cancel & notify invitee"]}),r.jsx(P,{variant:"outline",className:"w-full",onClick:()=>R(!1),disabled:m,children:"Cancel without notifying"})]}):r.jsx(P,{variant:"destructive",className:"w-full",onClick:()=>R(!1),disabled:m,children:"Cancel meeting"}),r.jsx(ds,{className:"w-full",disabled:m,children:"Keep meeting"})]})]})})]})}function uat({userId:e,refreshKey:t}){const[n,s]=h.useState([]),[a,i]=h.useState(!1),[o,l]=h.useState(null),[c,d]=h.useState(!1),[u,m]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState(null),[v,y]=h.useState(new Set),b=n.length>0&&v.size===n.length,w=()=>{y(b?new Set:new Set(n.map(E=>`${E.source}-${E.id}`)))},S=E=>{const R=`${E.source}-${E.id}`;y(T=>{const D=new Set(T);return D.has(R)?D.delete(R):D.add(R),D})},j=h.useCallback(async()=>{const E=new Date().toISOString(),[R,T]=await Promise.all([F.from("scheduled_meetings").select("*").eq("created_by",e).or(`status.eq.cancelled,scheduled_at.lt.${E}`).order("scheduled_at",{ascending:!1}).limit(50),F.from("meeting_rooms").select("id, room_code, status, created_at, ended_at, created_by").eq("created_by",e).eq("status","ended").order("ended_at",{ascending:!1}).limit(50)]),D=(R.data??[]).map(O=>({...O,source:"scheduled"})),A=new Set(D.map(O=>O.room_code)),V=(T.data??[]).filter(O=>!A.has(O.room_code)).map(O=>{const M=O.created_at,$=O.ended_at??O.created_at,I=Math.max(1,mTe(new Date($),new Date(M)));
1308return{id:O.id,room_code:O.room_code,title:"Instant call",scheduled_at:M,duration_minutes:I,invitee_name:null,invitee_email:null,status:"completed",recurrence_type:null,recurrence_end_type:null,recurrence_end_date:null,recurrence_count:null,series_id:null,created_by:O.created_by,source:"instant"}}),U=[...D,...V].sort((O,M)=>new Date(M.scheduled_at).getTime()-new Date(O.scheduled_at).getTime());s(U)},[e]);h.useEffect(()=>{j()},[j,t]);const N=async()=>{if(o)try{const E=o.source==="instant"?"meeting_rooms":"scheduled_meetings",{error:R}=await F.from(E).delete().eq("id",o.id);if(R)throw R;Rt({title:"Meeting deleted"}),j()}catch(E){Rt({title:"Failed to delete",description:E.message,variant:"destructive"})}finally{l(null)}},_=async E=>{g(E.id);try{const{error:R}=await F.from("scheduled_meetings").update({status:"scheduled"}).eq("id",E.id);if(R)throw R;Rt({title:"Meeting reactivated",description:"The meeting is back in your upcoming calls."}),j()}catch(R){Rt({title:"Failed to reactivate",description:R.message,variant:"destructive"})}finally{g(null)}},C=async()=>{try{const E=n.filter(D=>D.source==="scheduled").map(D=>D.id),R=n.filter(D=>D.source==="instant").map(D=>D.id),T=[];
1308if(E.length){const{error:D}=await F.from("scheduled_meetings").delete().in("id",E);D&&T.push(D.message)}if(R.length){const{error:D}=await F.from("meeting_rooms").delete().in("id",R);D&&T.push(D.message)}if(T.length)throw new Error(T.join("; "));Rt({title:"All past events deleted"}),d(!1),j()}catch(E){Rt({title:"Failed to delete",description:E.message,variant:"destructive"})}},k=async()=>{if(v.size!==0)try{const E=n.filter(A=>v.has(`${A.source}-${A.id}`)),R=E.filter(A=>A.source==="scheduled").map(A=>A.id),T=E.filter(A=>A.source==="instant").map(A=>A.id),D=[];if(R.length){const{error:A}=await F.from("scheduled_meetings").delete().in("id",R);A&&D.push(A.message)}if(T.length){const{error:A}=await F.from("meeting_rooms").delete().in("id",T);A&&D.push(A.message)}if(D.length)throw new Error(D.join("; "));Rt({title:`${E.length} event${E.length>1?"s":""} deleted`}),m(!1),y(new Set),j()}catch(E){Rt({title:"Failed to delete",description:E.message,variant:"destructive"})}};return n.length===0?null:r.jsxs(r.Fragment,{children:[r.jsx(Ie,{children:r.jsxs(Wm,{open:a,onOpenChange:i,children:[r.jsx(Ot,{className:"pb-0",children:r.jsx(Ff,{asChild:!0,children:r.jsxs(P,{variant:"ghost",className:"w-full justify-between p-0 h-auto hover:bg-transparent",children:[r.jsxs($t,{className:"text-lg flex items-center gap-2",children:[r.jsx(Cf,{className:"w-5 h-5"}),"Past Events",r.jsx(Se,{variant:"secondary",className:"text-xs ml-1",children:n.length})]}),a?r.jsx(Mm,{className:"w-4 h-4 text-muted-foreground"}):r.jsx(Qs,{className:"w-4 h-4 text-muted-foreground"})]})})}),r.jsx(Ym,{children:r.jsxs(lt,{className:"space-y-2 pt-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ci,{checked:b,onCheckedChange:w,"aria-label":"Select all"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Select all"})]}),v.size>0?r.jsxs(P,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive",onClick:()=>m(!0),children:[r.jsx(Xr,{className:"w-3 h-3"}),"Delete selected (",v.size,")"]}):r.jsxs(P,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive",onClick:()=>d(!0),children:[r.jsx(Xr,{className:"w-3 h-3"}),"Delete all"]})]}),n.map(E=>{const R=E.status==="cancelled",T=E.source==="instant",D=v.has(`${E.source}-${E.id}`);return r.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[r.jsx(ci,{checked:D,onCheckedChange:()=>S(E),"aria-label":`Select ${E.title}`,className:"mt-0.5"}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("p",{className:"font-medium text-foreground text-sm flex items-center gap-1.5 truncate",children:[T&&r.jsx(cr,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),E.title]}),r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),cn(new Date(E.scheduled_at),"PPP p")," · ",E.duration_minutes,"min"]}),(E.invitee_name||E.invitee_email)&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[r.jsx(zr,{className:"w-3 h-3"}),"with ",E.invitee_name||E.invitee_email]})]})]}),r.jsx(Se,{variant:R?"destructive":"outline",className:"text-xs shrink-0",children:R?"Cancelled":T?"Instant":"Completed"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1.5 pl-6",children:[!T&&r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>p(E),children:[r.jsx(vs,{className:"w-3 h-3"}),"Reschedule"]}),R&&!T&&r.jsxs(P,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>_(E),disabled:x===E.id,children:[r.jsx(Wd,{className:"w-3 h-3"}),x===E.id?"Reactivating...":"Reactivate"]}),r.jsxs(P,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive",onClick:()=>l(E),children:[r.jsx(Xr,{className:"w-3 h-3"}),"Delete"]})]})]},`${E.source}-${E.id}`)})]})})]})}),r.jsx(Eie,{meeting:f,open:!!f,onOpenChange:E=>!E&&p(null),onSaved:j}),r.jsx(cs,{open:!!o,onOpenChange:E=>!E&&l(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete meeting?"}),r.jsxs(Jn,{children:['This will permanently remove "',o==null?void 0:o.title,'" from your history. This action cannot be undone.']})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Keep it"}),r.jsx(bs,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),r.jsx(cs,{open:c,onOpenChange:d,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Delete all past events?"}),r.jsxs(Jn,{children:["This will permanently remove all ",n.length," past events from your history. This action cannot be undone."]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete all"})]})]})}),r.jsx(cs,{open:u,onOpenChange:m,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsxs(Qn,{children:["Delete ",v.size," selected event",v.size>1?"s":"","?"]}),r.jsx(Jn,{children:"This will permanently remove the selected events from your history. This action cannot be undone."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete selected"})]})]})})]})}const mat=({open:e,onOpenChange:t,onConnected:n})=>{const[s,a]=h.useState(""),[i,o]=h.useState(!1),[l,c]=h.useState(!1),d=async()=>
1308{if(s.trim()){o(!0);try{const{data:u,error:m}=await F.functions.invoke("calendly-connect",{body:{personal_access_token:s.trim()}});if(m)throw m;const f=u;if((f==null?void 0:f.code)==="calendly_upgrade_required"){c(!0);return}if(f!=null&&f.error)throw new Error(f.error);Rt({title:"Calendly connected",description:`Linked to ${(f==null?void 0:f.calendly_email)??"your account"}.`}),a(""),n(),t(!1)}catch(u){Rt({title:"Could not connect",description:u.message??"Please try again.",variant:"destructive"})}finally{o(!1)}}};return r.jsxs(r.Fragment,{children:[r.jsx(It,{open:e,onOpenChange:t,children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Connect Calendly"}),r.jsx($r,{children:"Paste your Calendly Personal Access Token. We'll auto-create a VIDAREO room every time someone books a meeting with you."})]}),r.jsxs(Md,{className:"border-destructive/40 bg-destructive/5",children:[r.jsx(wa,{className:"h-4 w-4 text-destructive"}),r.jsxs(Id,{className:"text-xs",children:[r.jsx("strong",{children:"Requires a paid Calendly plan"})," (Standard or higher). Auto-provisioning uses Calendly webhooks, which aren't available on the free plan. On free Calendly, use the ",r.jsx("strong",{children:'"Use as meeting location"'})," option below instead."]})]}),r.jsx(Md,{children:r.jsxs(Id,{className:"text-xs space-y-2",children:[r.jsx("div",{className:"font-semibold",children:"How to get a token:"}),r.jsxs("ol",{className:"list-decimal pl-4 space-y-1",children:[r.jsx("li",{children:"Open Calendly → Integrations → API & Webhooks"}),r.jsxs("li",{children:["Click ",r.jsx("strong",{children:"Personal Access Tokens"})," → Create new token"]}),r.jsxs("li",{children:["Name it ",r.jsx("strong",{children:'"VIDAREO"'})]}),r.jsxs("li",{children:["Under ",r.jsx("strong",{children:"Scopes"}),", check ALL boxes in:",r.jsxs("ul",{className:"list-disc pl-4 mt-1 space-y-0.5",children:[r.jsxs("li",{children:[r.jsx("strong",{children:"Scheduling"})," (all 10)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"Webhooks"})," (all 2)"]}),r.jsxs("li",{children:[r.jsx("strong",{children:"User management"})," (all) - required to identify your account"]})]}),"Security & Compliance can be left unchecked."]}),r.jsx("li",{children:"Click Next, then copy the token"})]}),r.jsxs("a",{href:"https://calendly.com/integrations/api_webhooks",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Calendly API page ",r.jsx(bn,{className:"w-3 h-3"})]})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"pat",children:"Personal Access Token"}),r.jsx(He,{id:"pat",type:"password",placeholder:"eyJraWQiOi...",value:s,onChange:u=>a(u.target.value),autoComplete:"off"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored securely. Used only to register a webhook and provision rooms for new bookings."})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>t(!1),disabled:i,children:"Cancel"}),r.jsxs(P,{onClick:d,disabled:i||!s.trim(),children:[i&&r.jsx(Me,{className:"w-4 h-4 mr-2 animate-spin"}),"Connect Calendly"]})]})]})}),r.jsx(cs,{open:l,onOpenChange:c,children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsxs(Qn,{className:"flex items-center gap-2",children:[r.jsx(wa,{className:"w-5 h-5 text-destructive"}),"Calendly paid plan required"]}),r.jsxs(Jn,{className:"space-y-3",children:[r.jsxs("p",{children:["Auto-provisioning VIDAREO rooms uses Calendly ",r.jsx("strong",{children:"webhooks"}),", which are only available on Calendly's ",r.jsx("strong",{children:"Standard plan or higher"}),". Your current Calendly account is on the free plan."]}),r.jsxs("p",{className:"text-sm",children:[r.jsx("strong",{children:"Good news:"})," you can still use VIDAREO with free Calendly. Just close this and use the ",r.jsx("strong",{children:'"Use as meeting location"'})," section - paste your VIDAREO personal link as the Custom location for any event type. No webhook required."]}),r.jsxs("a",{href:"https://calendly.com/pricing",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline text-sm",children:["See Calendly pricing ",r.jsx(bn,{className:"w-3 h-3"})]})]})]}),r.jsx(Zn,{children:r.jsx(bs,{onClick:()=>{c(!1),t(!1)},children:"Got it"})})]})})]})},hat=({userId:e,personalRoomCode:t,onChanged:n})=>{const[s,a]=h.useState(null),[i,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=
1308h.useState(!1),[m,f]=h.useState(!1),p=t?`https://meet.vidareo.com/${t}`:null,x=async()=>{o(!0);const{data:y}=await F.from("scheduler_integrations").select("id, provider, provider_email, created_at").eq("user_id",e).eq("provider","calendly").maybeSingle();a(y??null),o(!1)};h.useEffect(()=>{x()},[e]);const g=async()=>{p&&(await navigator.clipboard.writeText(p),f(!0),Rt({title:"Link copied",description:"Paste it as the Location for your scheduling event."}),setTimeout(()=>f(!1),2e3))},v=async()=>{c(!0);try{const{error:y}=await F.functions.invoke("calendly-disconnect");if(y)throw y;Rt({title:"Calendly disconnected"}),await x(),n==null||n()}catch(y){Rt({title:"Could not disconnect",description:y.message,variant:"destructive"})}finally{c(!1)}};return r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"text-base flex items-center gap-2",children:[r.jsx(AL,{className:"w-4 h-4 text-primary"}),"Scheduler integrations"]}),r.jsx(xr,{className:"text-xs",children:"Use VIDAREO as the meeting room for Calendly, Cal.com, and other booking tools."})]}),r.jsx(lt,{children:r.jsxs(ec,{defaultValue:"calendly",children:[r.jsxs(pl,{className:"grid grid-cols-3 w-full h-9",children:[r.jsx(tn,{value:"calendly",className:"text-xs",children:"Calendly"}),r.jsx(tn,{value:"calcom",className:"text-xs",children:"Cal.com"}),r.jsx(tn,{value:"other",className:"text-xs",children:"Other"})]}),r.jsxs(Fn,{value:"calendly",className:"space-y-4 pt-4",children:[r.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-2",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-sm font-semibold flex items-center gap-2",children:[r.jsx(ya,{className:"w-3.5 h-3.5 text-primary"}),"Auto-provision rooms"]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Every Calendly booking creates a unique VIDAREO room and shows up in Upcoming Calls."})]}),s&&r.jsxs(Se,{variant:"outline",className:"border-primary/40 text-primary shrink-0",children:[r.jsx(nt,{className:"w-3 h-3 mr-1"})," Connected"]})]}),i?r.jsxs("div",{className:"flex items-center text-xs text-muted-foreground",children:[r.jsx(Me,{className:"w-3 h-3 mr-2 animate-spin"})," Checking…"]}):s?r.jsxs("div",{className:"space-y-2",children:[s.provider_email&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected as ",r.jsx("span",{className:"font-medium text-foreground",children:s.provider_email})]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:v,disabled:l,className:"w-full",children:[l?r.jsx(Me,{className:"w-3.5 h-3.5 animate-spin"}):r.jsx(que,{className:"w-3.5 h-3.5"}),"Disconnect"]})]}):r.jsxs(P,{size:"sm",className:"w-full",onClick:()=>u(!0),children:[r.jsx(AL,{className:"w-3.5 h-3.5"}),"Connect Calendly"]})]}),r.jsx(lA,{provider:"Calendly",personalLink:p,copied:m,onCopy:g,steps:["In Calendly, edit any event type",'Open the Location step and choose "Custom"',"Paste your VIDAREO link below"]})]}),r.jsx(Fn,{value:"calcom",className:"space-y-4 pt-4",children:r.jsx(lA,{provider:"Cal.com",personalLink:p,copied:m,onCopy:g,steps:["In Cal.com, open Event Types → choose your event",'Under Locations, click "Add a location" → Link meeting',"Paste your VIDAREO link below"]})}),r.jsx(Fn,{value:"other",className:"space-y-4 pt-4",children:r.jsx(lA,{provider:"any scheduler",personalLink:p,copied:m,onCopy:g,steps:["Open your scheduler (SavvyCal, TidyCal, Acuity, etc.)","Edit your event and find the Location / Conference setting",'Choose "Custom" or "External link" and paste your VIDAREO link']})})]})})]}),r.jsx(mat,{open:d,onOpenChange:u,onConnected:()=>{x(),n==null||n()}})]})},lA=({provider:e,personalLink:t,copied:n,onCopy:s,steps:a})=>r.jsxs("div",{className:"rounded-lg border p-3 space-y-2.5",children:[r.jsxs("div",{className:"text-sm font-semibold flex items-center gap-2",children:[r.jsx(yue,{className:"w-3.5 h-3.5 text-primary"}),"Use as meeting location"]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paste your personal VIDAREO link as the Location in ",e,". Every booking automatically includes it - zero setup required."]}),t?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 bg-muted/50 rounded px-2.5 py-2",children:[r.jsx(Ga,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),r.jsx("code",{className:"text-xs font-mono flex-1 truncate text-foreground",children:t}),r.jsx(P,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:s,children:n?r.jsx(nt,{className:"w-3 h-3"}):r.jsx(ui,{className:"w-3 h-3"})})]}),r.jsx("ol",{className:"list-decimal pl-5 text-xs text-muted-foreground space-y-1",children:a.map((i,o)=>r.jsx("li",{children:i},o))})]}):r.jsx(Md,{children:r.jsx(Id,{className:"text-xs",children:"Set your personal room code in the Personal Link card above to enable this option."})})]}),fat=()=>{const{user:e}=nr(),{isPremium:t,isLoading:n,createCheckout:s}
1308=Jl(),a=Sr(),[i,o]=h.useState(""),[l,c]=h.useState(!1),[d,u]=h.useState(null),[m,f]=h.useState(!1),[p,x]=h.useState(0),[g,v]=h.useState(null),y=ih(),b=_r()&&y;h.useEffect(()=>{if(!e)return;let E=!0;return(async()=>{const{data:T}=await F.from("profiles").select("personal_room_code").eq("user_id",e.id).maybeSingle();E&&v((T==null?void 0:T.personal_room_code)??null)})(),()=>{E=!1}},[e,p]);const w=d?`https://meet.vidareo.com/${d}`:"",S=async()=>{if(e){c(!0);try{const E=P5(),{error:R}=await F.from("meeting_rooms").insert({created_by:e.id,room_code:E,status:"waiting"});if(R)throw R;u(E)}catch(E){Rt({title:"Error",description:E.message,variant:"destructive"})}finally{c(!1)}}},j=()=>{const E=i.trim().toLowerCase();E&&a(`/meet/${E}`)},N=async()=>{await navigator.clipboard.writeText(w),f(!0),Rt({title:"Link copied!",description:"Share it with someone to join your call."}),setTimeout(()=>f(!1),2e3)},_=()=>{const E=encodeURIComponent("Join my video call on Vidareo"),R=encodeURIComponent(`Hey!
1309
1310I'd like to have a video call with you. Click the link below to join:
1311
1312${w}
1313
1314Or use this room code: ${d}
1315
1316See you there!`);window.open(`mailto:?subject=${E}&body=${R}`,"_self")},C=()=>{d&&a(`/meet/${d}`)},k=!n&&t;return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(pn,{}),r.jsxs("div",{className:"container mx-auto px-4 md:px-8 pt-24 pb-12 max-w-6xl",children:[r.jsxs("div",{"data-tour":"meet-hero",className:ge("grid lg:grid-cols-2 gap-8 lg:gap-12 items-center mb-12",b&&"lg:grid-cols-1"),children:[!b&&r.jsx("div",{className:"order-2 lg:order-1",children:r.jsx("img",{src:Snt,alt:"Two people on a video call",className:"w-full max-w-md mx-auto rounded-2xl shadow-xl"})}),r.jsxs("div",{className:"order-1 lg:order-2 space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"mx-auto lg:mx-0 w-12 h-12 rounded-2xl gradient-primary flex items-center justify-center",children:r.jsx(cr,{className:"w-6 h-6 text-primary-foreground"})}),r.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground text-center lg:text-left",children:"Video Calls"}),r.jsx("p",{className:"text-muted-foreground text-center lg:text-left text-sm",children:"Start a video call with up to 4 people, schedule one for later, or join with a code. No downloads needed."})]}),!n&&!t&&r.jsxs(Ie,{className:"border-primary/30 bg-primary/5",children:[r.jsxs(Ot,{className:"pb-3",children:[r.jsxs($t,{className:"text-base flex items-center gap-2",children:[r.jsx(Ni,{className:"w-4 h-4 text-primary"}),"Premium Feature"]}),r.jsx(xr,{className:"text-xs",children:"Available on Professional and Team plans."})]}),r.jsx(lt,{className:"space-y-2 pt-0",children:lr()?r.jsx("p",{className:"text-xs text-muted-foreground",children:"This feature is not available on your current plan."}):r.jsxs(r.Fragment,{children:[r.jsx(P,{className:"w-full",size:"sm",onClick:()=>s("professional"),children:"Upgrade to Professional"}),r.jsx(P,{variant:"outline",className:"w-full",size:"sm",onClick:()=>a("/pricing"),children:"Compare plans"})]})})]}),k&&d&&r.jsxs(Ie,{variant:"gradient",className:"border-primary/30",children:[r.jsxs(Ot,{className:"pb-3",children:[r.jsx($t,{className:"text-base",children:"Your room is ready!"}),r.jsx(xr,{className:"text-xs",children:"Share the link or code below to invite someone."})]}),r.jsxs(lt,{className:"space-y-3 pt-0",children:[r.jsx("div",{className:"flex items-center bg-muted/50 rounded-lg px-4 py-2.5",children:r.jsx("span",{className:"text-xl font-mono font-bold text-foreground tracking-widest flex-1 text-center",children:d})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{size:"sm",className:"flex-1",onClick:N,children:[m?r.jsx(nt,{className:"w-3.5 h-3.5"}):r.jsx(ui,{className:"w-3.5 h-3.5"}),m?"Copied!":"Copy link"]}),r.jsxs(P,{variant:"outline",size:"sm",className:"flex-1",onClick:_,children:[r.jsx(zr,{className:"w-3.5 h-3.5"}),"Email"]})]}),r.jsxs(P,{variant:"hero",className:"w-full",size:"sm",onClick:C,children:[r.jsx(cr,{className:"w-3.5 h-3.5"}),"Enter room"]})]})]}),k&&!d&&r.jsxs("div",{"data-tour":"meet-actions",className:"grid grid-cols-2 gap-3",children:[r.jsxs(Ie,{className:"flex flex-col",children:[r.jsxs(Ot,{className:"pb-2 flex-1",children:[r.jsx($t,{className:"text-sm",children:"Start a call"}),r.jsx(xr,{className:"text-xs",children:"Create a new room."})]}),r.jsx(lt,{className:"pt-0",children:r.jsxs(P,{className:"w-full",size:"sm",onClick:S,disabled:l,children:[r.jsx(cr,{className:"w-3.5 h-3.5"}),l?"Creating...":"Start"]})})]}),r.jsxs(Ie,{className:"flex flex-col",children:[r.jsxs(Ot,{className:"pb-2 flex-1",children:[r.jsx($t,{className:"text-sm",children:"Join a call"}),r.jsx(xr,{className:"text-xs",children:"Enter a room code."})]}),r.jsx(lt,{className:"pt-0",children:r.jsxs("div",{className:"flex gap-1.5",children:[r.jsx(He,{placeholder:"Code",value:i,onChange:E=>o(E.target.value),onKeyDown:E=>
1316E.key==="Enter"&&j(),className:"h-9 text-xs"}),r.jsx(P,{size:"sm",onClick:j,disabled:!i.trim(),className:"px-2.5",children:r.jsx(Ya,{className:"w-3.5 h-3.5"})})]})})]})]})]})]}),k&&e&&r.jsxs("div",{className:"grid md:grid-cols-2 gap-6 mb-12",children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{"data-tour":"meet-personal-link",children:r.jsx(iat,{userId:e.id})}),r.jsx("div",{"data-tour":"meet-upcoming",children:r.jsx(dat,{userId:e.id,refreshKey:p})}),r.jsx(uat,{userId:e.id,refreshKey:p})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{"data-tour":"meet-schedule",children:r.jsx(aat,{userId:e.id,onScheduled:()=>x(E=>E+1)})}),r.jsx(hat,{userId:e.id,personalRoomCode:g,onChanged:()=>x(E=>E+1)})]})]}),!b&&r.jsxs("div",{className:"grid sm:grid-cols-4 gap-6 mb-12",children:[r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(mi,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Peer-to-Peer"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Direct connection - no middleman server."})]}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(ya,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Instant"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"No downloads or installs required."})]}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(Vs,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Screen Sharing"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Share your screen mid-call on desktop."})]}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(cr,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Any Device"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Desktop browsers & native mobile app."})]})]}),!b&&r.jsxs("div",{className:"max-w-2xl mx-auto",children:[r.jsx("h2",{className:"text-xl font-bold text-foreground mb-4 text-center",children:"How It Works"}),r.jsxs(u3,{type:"single",collapsible:!0,className:"w-full",children:[r.jsxs(cc,{value:"start",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"1"}),"How do I start a call?"]})}),r.jsxs(uc,{className:"text-sm",children:["Click ",r.jsx("strong",{children:'"Start"'})," to create a private room, or use your ",r.jsx("strong",{children:"personal meeting link"})," for a permanent URL you can share anytime. No sign-ups or downloads needed - everything runs in the browser."]})]}),r.jsxs(cc,{value:"invite",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"2"}),"How do I invite someone?"]})}),r.jsxs(uc,{className:"text-sm",children:[r.jsx("strong",{children:"Copy the invite link"}),", ",r.jsx("strong",{children:"send an email invite"}),", or ",r.jsx("strong",{children:"share your personal room code"}),". Guests just click the link or enter the code - no account required."]})]}),r.jsxs(cc,{value:"screen-share",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"3"}),"Can I share my screen during a call?"]})}),r.jsxs(uc,{className:"text-sm",children:["Yes - on ",r.jsx("strong",{children:"desktop browsers"}),`, click the screen share button in the call controls to share your entire screen, a window, or a tab. Your camera stays visible in a floating preview. Stop sharing anytime via the button or your browser's built-in "Stop sharing" prompt. Screen sharing is not available on mobile devices.`]})]}),r.jsxs(cc,{value:"schedule",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"4"}),"Can I schedule a call for later?"]})}),r.jsxs(uc,{className:"text-sm",children:["Absolutely. Use the ",r.jsx("strong",{children:"Schedule a Call"})," card to pick a date, time, and duration. An email invite with a calendar attachment is sent to your guest automatically."]})]}),r.jsxs(cc,{value:"private",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"5"}),"Is my call private?"]})}),r.jsxs(uc,{className:"text-sm",children:["Yes - calls are ",r.jsx("strong",{children:"peer-to-peer"}),". Video, audio, and screen shares stream directly between browsers with no middleman. Room codes are random and unique."]})]}),r.jsxs(cc,{value:"duration",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"6"}
1316),"Is there a time limit on calls?"]})}),r.jsxs(uc,{className:"text-sm",children:["Video calls have a ",r.jsx("strong",{children:"60-minute maximum duration"}),". You'll see an on-screen timer and receive warnings at 5 minutes and 1 minute remaining. After the limit, the call ends automatically."]})]}),r.jsxs(cc,{value:"requirements",children:[r.jsx(dc,{className:"text-sm",children:r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-7 h-7 rounded-full gradient-primary flex items-center justify-center text-[11px] font-bold text-primary-foreground shrink-0",children:"7"}),"What do I need?"]})}),r.jsxs(uc,{className:"text-sm",children:["A ",r.jsx("strong",{children:"modern browser"})," (Chrome, Edge, Firefox, Safari) and a camera/microphone. No plugins or installs. Works on desktop and our ",r.jsx("strong",{children:"native iOS & Android app"}),". Screen sharing is available on desktop browsers."]})]})]})]})]})]})},pat={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun1.l.google.com:19302"}]},Zz=3;function xat({roomCode:e,userId:t,isCreator:n,userName:s="Guest",avatarUrl:a=null,isAuthenticated:i=!1,initialCameraOn:o=!0,initialMicOn:l=!0,onKicked:c}){const[d,u]=h.useState(null),[m,f]=h.useState({}),[p,x]=h.useState(!l),[g,v]=h.useState(o),[y,b]=h.useState(!1),[w,S]=h.useState(null),[j,N]=h.useState({}),_=h.useRef(null),C=h.useRef(new Map),k=h.useRef(new Map),E=h.useRef(null),R=h.useRef(null),T=h.useRef(new Map),D=h.useRef(c);D.current=c;const A=Object.keys(m).length,V=Object.values(j).some(H=>H.isRecording),U=h.useCallback(H=>{var X;(X=E.current)==null||X.send({type:"broadcast",event:"signal",payload:{...H,senderId:t}})},[t]),O=h.useCallback(H=>{if(C.current.size>=Zz)return null;if(C.current.has(H))return C.current.get(H);const X=new RTCPeerConnection(pat);return X.onicecandidate=G=>{G.candidate&&U({type:"ice-candidate",candidate:G.candidate.toJSON(),targetId:H})},X.ontrack=G=>{const ee=G.streams[0];ee&&f(re=>({...re,[H]:ee}))},X.onconnectionstatechange=()=>{(X.connectionState==="failed"||X.connectionState==="closed")&&M(H)},R.current&&R.current.getTracks().forEach(G=>{const ee=X.addTrack(G,R.current);G.kind==="video"&&k.current.set(H,ee)}),C.current.set(H,X),N(G=>({...G,[H]:{cameraOn:!0,isRecording:!1,isScreenSharing:!1}})),X},[U]),M=h.useCallback(H=>{const X=C.current.get(H);X&&(X.close(),C.current.delete(H)),k.current.delete(H),T.current.delete(H),f(G=>{const ee={...G};return delete ee[H],ee}),N(G=>{const ee={...G};return delete ee[H],ee})},[]);h.useEffect(()=>{let H=!1;return(async()=>{try{const X=await navigator.mediaDevices.getUserMedia({video:!0,audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googNoiseSuppression:!0,googAutoGainControl:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0}});if(H){X.getTracks().forEach(G=>G.stop());return}o||X.getVideoTracks().forEach(G=>{G.stop(),X.removeTrack(G)}),l||X.getAudioTracks().forEach(G=>{G.enabled=!1}),R.current=X,u(X)}catch(X){console.error("Failed to get media devices",X)}})(),()=>{var X;H=!0,(X=R.current)==null||X.getTracks().forEach(G=>G.stop()),C.current.forEach(G=>G.close()),C.current.clear(),k.current.clear(),R.current=null}},[]),h.useEffect(()=>{if(!d)return;const H=F.channel(`meeting-${e}`,{config:{broadcast:{self:!1},presence:{key:t}}});return E.current=H,H.on("broadcast",{event:"signal"},async({payload:X})=>{var re,W,Q;if(!X||X.senderId===t)return;const G=X,ee=G.senderId;if(!("targetId"in G&&G.targetId!=="*"&&G.targetId!==t))switch(G.type){case"peer-joined":{if(C.current.size>=Zz)break;G.userName&&N(te=>({...te,[ee]:{...te[ee],cameraOn:!0,isRecording:!1,isScreenSharing:!1,userName:G.userName,avatarUrl:G.avatarUrl??null,isAuthenticated:G.isAuthenticated??!1}}));const L=O(ee);if(!L)break;try{const te=await L.createOffer();await L.setLocalDescription(te),U({type:"offer",sdp:te,targetId:ee}),U({type:"peer-name",targetId:"*",userName:s,avatarUrl:a,isAuthenticated:i})}catch(te){console.error("Failed to create offer for",ee,te)}break}case"offer":{let L=C.current.get(ee);if(!L&&(L=O(ee),!L))break;try{await L.setRemoteDescription(new RTCSessionDescription(G.sdp));const te=T.current.get(ee)||[];for(const ne of te)await L.addIceCandidate(new RTCIceCandidate(ne)).catch(()=>{});T.current.delete(ee);const ae=await L.createAnswer();await L.setLocalDescription(ae),U({type:"answer",sdp:ae,targetId:ee})}catch(te){console.error("Failed to handle offer from",ee,te)}break}case"answer":{const L=C.current.get(ee);if(L)try{await L.setRemoteDescription(new RTCSessionDescription(G.sdp));const te=T.current.get(ee)||[];for(const ae of te)await L.addIceCandidate(new RTCIceCandidate(ae)).catch(()=>{});T.current.delete(ee)}catch(te){console.error("Failed to handle answer from",ee,te)}break}case"ice-candidate":{const L=C.current.get(ee);if(L&&L.remoteDescription)try{await L.addIceCandidate(new RTCIceCandidate(G.candidate))}catch{}else{const te=T.current.get(ee)||[];te.push(G.candidate),T.current.set(ee,te)}break}case"peer-left":{M(ee);break}case"camera-on":{N(L=>({...L,[ee]:{...L[ee],cameraOn:!0}}));break}case"camera-off":{N(L=>({...L,[ee]:{...L[ee],cameraOn:!1}}));break}case"recording-started":{N(L=>({...L,[ee]:{...L[ee],isRecording:!0}}));break}case"recording-stopped":{N(L=>({...L,[ee]:{...L[ee],isRecording:!1}}));break}case"screen-share-started":{N(L=>({...L,[ee]:{...L[ee],isScreenSharing:!0}}));break}case"screen-share-stopped":{N(L=>({...L,[ee]:{...L[ee],isScreenSharing:!1}}));break}case"peer-name":{"userName"in G&&N(L=>{var te,ae;return{...L,[ee]:{...L[ee],userName:G.userName,avatarUrl:G.avatarUrl??((te=L[ee])==null?void 0:te.avatarUrl)??null,isAuthenticated:G.isAuthenticated??((ae=L[ee])==null?void 0:ae.isAuthenticated)??!1}}});break}case"kick-peer":{G.targetId===t&&((re=_.current)==null||re.getTracks().forEac
1316h(L=>L.stop()),_.current=null,C.current.forEach(L=>L.close()),C.current.clear(),T.current.clear(),(W=R.current)==null||W.getTracks().forEach(L=>L.stop()),R.current=null,u(null),f({}),N({}),b(!1),S(null),(Q=D.current)==null||Q.call(D));break}}}).subscribe(async X=>{X==="SUBSCRIBED"&&(await H.track({userId:t,joinedAt:Date.now()}),U({type:"peer-joined",targetId:"*",userName:s,avatarUrl:a,isAuthenticated:i}))}),()=>{F.removeChannel(H)}},[d,e,t,s,a,i,n,O,U,M]);const $=h.useCallback(()=>{var H;(H=R.current)==null||H.getAudioTracks().forEach(X=>{X.enabled=!X.enabled}),x(X=>!X)},[]),I=h.useCallback(async()=>{const H=!g,X=R.current;if(X)if(!H)X.getVideoTracks().forEach(G=>{G.stop(),X.removeTrack(G)}),k.current.forEach(G=>{try{G.replaceTrack(null)}catch{}}),u(X),v(!1),U({type:"camera-off",targetId:"*"});else try{const ee=(await navigator.mediaDevices.getUserMedia({video:!0,audio:!1})).getVideoTracks()[0];if(!ee)return;X.addTrack(ee),y||C.current.forEach((re,W)=>{const Q=k.current.get(W);if(Q)Q.replaceTrack(ee);else{const L=re.addTrack(ee,X);k.current.set(W,L)}}),u(X),v(!0),U({type:"camera-on",targetId:"*"})}catch(G){console.error("Failed to re-enable camera",G)}},[g,y,U]),B=h.useCallback(async()=>{var H,X;if(y){(H=_.current)==null||H.getTracks().forEach(ee=>ee.stop()),_.current=null,S(null);const G=((X=R.current)==null?void 0:X.getVideoTracks()[0])??null;k.current.forEach(ee=>{try{ee.replaceTrack(G)}catch{}}),b(!1),U({type:"screen-share-stopped",targetId:"*"})}else try{const G=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1});_.current=G,S(G);const ee=G.getVideoTracks()[0];C.current.forEach((re,W)=>{const Q=k.current.get(W);if(Q)Q.replaceTrack(ee);else{const L=re.addTrack(ee,G);k.current.set(W,L)}}),ee.onended=()=>{var W;const re=((W=R.current)==null?void 0:W.getVideoTracks()[0])??null;k.current.forEach(Q=>{try{Q.replaceTrack(re)}catch{}}),_.current=null,S(null),b(!1),U({type:"screen-share-stopped",targetId:"*"})},b(!0),U({type:"screen-share-started",targetId:"*"})}catch(G){console.log("Screen share cancelled",G)}},[y,U]),K=h.useCallback(()=>{var H,X;U({type:"peer-left",targetId:"*"}),(H=_.current)==null||H.getTracks().forEach(G=>G.stop()),_.current=null,S(null),C.current.forEach(G=>G.close()),C.current.clear(),k.current.clear(),T.current.clear(),(X=R.current)==null||X.getTracks().forEach(G=>G.stop()),R.current=null,u(null),f({}),N({}),b(!1),F.from("meeting_rooms").update({status:"ended",ended_at:new Date().toISOString()}).eq("room_code",e).then()},[U,e]),Z=h.useCallback(H=>{U({type:H?"recording-started":"recording-stopped",targetId:"*"})},[U]),q=h.useCallback(H=>{U({type:"kick-peer",targetId:H}),M(H)},[U,M]);return{localStream:d,screenStream:w,remoteStreams:m,isMuted:p,isCameraOn:g,isScreenSharing:y,peerStates:j,peerCount:A,anyRemoteRecording:V,toggleMute:$,toggleCamera:I,toggleScreenShare:B,endCall:K,broadcastRecordingState:Z,kickPeer:q}}const gat=({onTimeUp:e})=>{const[t,n]=h.useState(0),s=h.useRef(Date.now()),a=h.useRef(!1),i=h.useRef(!1),o=is.VIDEO_CALL_MAX_DURATION_SECONDS,l=is.VIDEO_CALL_WARNING_5_MIN,c=is.VIDEO_CALL_WARNING_1_MIN;h.useEffect(()=>{const g=setInterval(()=>{const v=Math.floor((Date.now()-s.current)/1e3);n(v),v>=l&&!a.current&&(a.current=!0,Rt({title:"5 minutes remaining",description:"Your call will end in 5 minutes."})),v>=c&&!i.current&&(i.current=!0,Rt({title:"1 minute remaining",description:"Your call will end in 1 minute.",variant:"destructive"})),v>=o&&(clearInterval(g),e())},1e3);return()=>clearInterval(g)},[o,l,c,e]);const d=o-t,u=Math.floor(t/60),m=t%60,f=`${u}:${m.toString().padStart(2,"0")}`,p=d<=300&&d>60,x=d<=60;return r.jsxs("div",{className:ge("absolute top-4 right-4 z-20 flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-mono font-medium backdrop-blur-sm border transition-colors",x?"bg-destructive/20 text-destructive border-destructive/40":p?"bg-yellow-500/20 text-yellow-400 border-yellow-500/40":"bg-secondary-foreground/10 text-secondary-foreground/70 border-secondary-foreground/20"),children:[r.jsx(fr,{className:"w-3 h-3"}),f]})};function vat({getSources:e,width:t=1280,height:n=720,fps:s=30,maxDurationSeconds:a,onMaxDurationReached:i}){const[o,l]=h.useState(!1),[c,d]=h.useState(!1),[u,m]=h.useState(0),[f,p]=h.useState(null),[x,g]=h.useState(null),v=h.useRef(null),y=h.useRef(null),b=h.useRef([]),w=h.useRef(null),S=h.useRef(null),j=h.useRef(null),N=h.useRef(new Map),_=h.useRef(new Map),C=h.useRef(0),k=h.useRef(0),E=h.useRef(0),R=h.useRef(null),T=h.useRef(null),D=h.useRef(!1),A=h.useRef(a),V=h.useRef(i);h.useEffect(()=>{A.current=a},[a]),h.useEffect(()=>{V.current=i},[i]);const U=h.useCallback((X,G)=>{if(!G)return null;let ee=_.current.get(X);return ee?ee.srcObject!==G&&(ee.srcObject=G,ee.play().catch(()=>{})):(ee=document.createElement("video"),ee.autoplay=!0,ee.muted=!0,ee.playsInl
1316ine=!0,ee.srcObject=G,ee.play().catch(()=>{}),_.current.set(X,ee)),ee},[]),O=h.useCallback((X,G)=>{if(!(!G||!S.current||!j.current)&&!N.current.has(X)&&G.getAudioTracks().length!==0)try{const ee=S.current.createMediaStreamSource(G);ee.connect(j.current),N.current.set(X,ee)}catch{}},[]),M=(X,G,ee,re,W,Q)=>{if(G.videoWidth===0||G.videoHeight===0)return;const L=G.videoWidth/G.videoHeight,te=W/Q;let ae=G.videoWidth,ne=G.videoHeight,se=0,ue=0;L>te?(ae=G.videoHeight*te,se=(G.videoWidth-ae)/2):(ne=G.videoWidth/te,ue=(G.videoHeight-ne)/2);try{X.drawImage(G,se,ue,ae,ne,ee,re,W,Q)}catch{}},$=(X,G,ee,re,W,Q)=>{if(G.videoWidth===0||G.videoHeight===0)return;const L=G.videoWidth/G.videoHeight,te=W/Q;let ae=W,ne=Q;L>te?ne=W/L:ae=Q*L;const se=ee+(W-ae)/2,ue=re+(Q-ne)/2;try{X.drawImage(G,se,ue,ae,ne)}catch{}},I=h.useCallback(()=>{const X=v.current;if(!X)return;const G=X.getContext("2d");if(!G)return;const ee=e(),re=U("local-camera",ee.localCamera),W=U("screen",ee.screen),Q=[],L=new Set(["local-camera","screen"]);ee.remotes.forEach((ne,se)=>{const ue=`remote-${ne.id||se}`;L.add(ue);const Ne=U(ue,ne);Ne&&Q.push(Ne)});for(const[ne,se]of _.current.entries())if(!L.has(ne)){try{se.pause(),se.srcObject=null}catch{}_.current.delete(ne)}O("local-mic",ee.localMic??ee.localCamera??null),O("screen",ee.screen),ee.remotes.forEach((ne,se)=>O(`remote-${ne.id||se}`,ne));const te=new Set(["local-mic","screen"]);ee.remotes.forEach((ne,se)=>te.add(`remote-${ne.id||se}`));for(const[ne,se]of N.current.entries())if(!te.has(ne)){try{se.disconnect()}catch{}N.current.delete(ne)}G.fillStyle="#0a0a0a",G.fillRect(0,0,X.width,X.height);const ae=[];if(re&&ae.push(re),ae.push(...Q),W&&W.videoWidth>0){const ne=ae.length>0?Math.round(X.height*.22):0,se=ae.length>0?8:0;if(ae.length>0){const Qe=ne-se*2,J=Math.round(Qe*(16/9)),de=ae.length*J+(ae.length-1)*se;let ve=Math.round((X.width-de)/2);const Le=se;ae.forEach($e=>{G.fillStyle="#000",G.fillRect(ve,Le,J,Qe),M(G,$e,ve,Le,J,Qe),ve+=J+se})}const ue=ne,Ne=X.height-ne;G.fillStyle="#000",G.fillRect(0,ue,X.width,Ne),$(G,W,0,ue,X.width,Ne)}else if(ae.length>0){const ne=ae.length,se=Math.ceil(Math.sqrt(ne)),ue=Math.ceil(ne/se),Ne=X.width/se,Qe=X.height/ue;ae.forEach((J,de)=>{const ve=de%se,Le=Math.floor(de/se);M(G,J,ve*Ne,Le*Qe,Ne,Qe)})}w.current=requestAnimationFrame(I)},[e,U,O]),B=h.useCallback(async()=>{if(!o){g(null),p(null),b.current=[];try{const X=document.createElement("canvas");X.width=t,X.height=n,v.current=X;const G=window.AudioContext||window.webkitAudioContext,ee=new G;S.current=ee,j.current=ee.createMediaStreamDestination(),I();const re=X.captureStream(s);j.current.stream.getAudioTracks().forEach(L=>re.addTrack(L));const W=MediaRecorder.isTypeSupported("video/webm;codecs=vp9,opus")?"video/webm;codecs=vp9,opus":MediaRecorder.isTypeSupported("video/webm;codecs=vp8,opus")?"video/webm;codecs=vp8,opus":"video/webm",Q=new MediaRecorder(re,{mimeType:W,videoBitsPerSecond:35e5,audioBitsPerSecond:192e3});Q.ondataavailable=L=>{L.data&&L.data.size>0&&b.current.push(L.data)},Q.start(1e3),y.current=Q,C.current=Date.now(),k.current=0,m(0),l(!0),d(!1),D.current=!1,R.current=setInterval(()=>{var L;if(y.current&&y.current.state==="recording"){const te=Math.floor((Date.now()-C.current-k.current)/1e3);m(te);const ae=A.current;if(ae&&!D.current&&te>=ae){D.current=!0;try{(L=V.current)==null||L.call(V)}catch{}}}},500)}catch(X){console.error("Failed to start call recording:",X),g((X==null?void 0:X.message)||"Failed to start recording"),l(!1)}}},[o,t,n,s,I]),K=h.useCallback(()=>new Promise(X=>{const G=y.current;if(!G||G.state==="inactive"){X(null);return}G.onstop=()=>{var re;const ee=new Blob(b.current,{type:"video/webm"});p(ee),l(!1),d(!1),w.current&&cancelAnimationFrame(w.current),w.current=null,R.current&&clearInterval(R.current),R.current=null,T.current&&clearInterval(T.current),T.current=null,N.current.forEach(W=>{try{W.disconnect()}catch{}}),N.current.clear(),(re=S.current)==null||re.close().catch(()=>{}),S.current=null,j.current=null,_.current.forEach(W=>{try{W.pause(),W.srcObject=null}catch{}}),_.current.clear(),y.current=null,X(ee)};try{G.stop()}catch{X(null)}}),[]),Z=h.useCallback(()=>{const X=y.current;X&&X.state==="recording"&&(X.pause(),E.current=Date.now(),d(!0))},[]),q=h.useCallback(()=>{const X=y.current;X&&X.state==="paused"&&(k.current+=Date.now()-E.current,X.resume(),d(!1))},[]),H=h.useCallback(()=>{p(null),m(0),g(null)},[]);return h.useEffect(()=>()=>{var X,G;try{(X=y.current)==null||X.stop()}catch{}w.current&&cancelAnimationFrame(w.current),R.current&&clearInterval(R.current),T.current&&clearInterval(T.current),N.current.forEach(ee=>{try{ee.disconnect()}catch{}}),(G=S.current)==null||G.close().catch(()=>{}),_.current.forEach(ee=>{try{ee.pause(),ee.srcObject=null}catch{}}),_.current.clear()},[]),{isRecording:o,isPaused:c,duration:u,recordedBlob:f,start:B,stop:K,pause:Z,resume:q,reset:H,error:x}}const yat=e=>new Promise(t=>{const n=URL.createObjectURL(e),s=document.createElement("video");
1316s.muted=!0,s.playsInline=!0,s.preload="auto";const a=()=>{try{URL.revokeObjectURL(n)}catch{}try{s.remove()}catch{}},i=setTimeout(()=>{a(),t(null)},1e4);s.onloadeddata=()=>{try{s.currentTime=Math.min(1,(s.duration||2)*.1)}catch{}},s.onseeked=()=>{const o=document.createElement("canvas");o.width=s.videoWidth||1280,o.height=s.videoHeight||720;const l=o.getContext("2d");if(!l){clearTimeout(i),a(),t(null);return}l.drawImage(s,0,0,o.width,o.height),o.toBlob(c=>{clearTimeout(i),a(),t(c)},"image/jpeg",.8)},s.onerror=()=>{clearTimeout(i),a(),t(null)},s.src=n,s.load()}),bat=({open:e,blob:t,duration:n,onClose:s})=>{const{user:a}=nr(),i=Sr(),[o,l]=h.useState(`Call recording – ${new Date().toLocaleString()}`),[c,d]=h.useState(""),[u,m]=h.useState(!1),[f,p]=h.useState(0),x=(t==null?void 0:t.size)??0,g=t?oR(x):!0,v=Jwe(n),y=!!t&&g&&v,b=()=>{u||s()},w=async()=>{if(!a||!t){Rt({title:"Sign in required",description:"Please sign in to save call recordings.",variant:"destructive"});return}if(!y){g?v||Rt({title:"Recording too long",description:`Exceeds the ${is.PRO_MAX_DURATION_MINUTES} minute limit.`,variant:"destructive"}):Rt({title:"File too large",description:`Recording exceeds the ${is.MAX_FILE_SIZE_MB}MB limit (${nb(x)}).`,variant:"destructive"});return}m(!0),p(10);try{const S=Date.now(),j=`${a.id}/${S}-call.webm`,N=`${a.id}/${S}-call-thumb.jpg`;p(20);const _=await yat(t);let C=null;if(_){const{error:A}=await F.storage.from("videos").upload(N,_,{contentType:"image/jpeg",upsert:!1});A||(C=F.storage.from("videos").getPublicUrl(N).data.publicUrl)}p(40);const{error:k}=await F.storage.from("videos").upload(j,t,{contentType:"video/webm",upsert:!1});if(k)throw k;p(80);const E=F.storage.from("videos").getPublicUrl(j).data.publicUrl,R=o.trim()||`Call recording – ${new Date().toLocaleString()}`,{data:T,error:D}=await F.from("videos").insert({user_id:a.id,title:R,description:c.trim()||null,video_url:E,thumbnail_url:C,duration:Math.round(n),file_size:t.size,moderation_status:"pending"}).select("id").single();if(D)throw D;if(T!=null&&T.id){const A=J_();F.functions.invoke("create-share-link",{body:{videoId:T.id,shareToken:A,expiresAt:null,maxViews:null,password:null,recipientEmail:null,recipientName:null,recipientPhone:null,title:R}}).catch(V=>console.warn("share link failed",V)),F.functions.invoke("moderate-video",{body:{videoId:T.id,videoTitle:R,videoDescription:c.trim(),userId:a.id}}).catch(V=>console.warn("moderation failed",V))}p(100),Rt({title:"Call recording saved",description:"Your recording is in your video library."}),s(),i("/videos",{state:{highlightVideoId:T==null?void 0:T.id}})}catch(S){console.error("Save call recording failed:",S),Rt({title:"Save failed",description:(S==null?void 0:S.message)||"Could not save the recording.",variant:"destructive"})}finally{m(!1)}};return r.jsx(It,{open:e,onOpenChange:S=>!S&&b(),children:r.jsxs(Dt,{className:"max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Save call recording"}),r.jsxs($r,{children:[n>0?`${Math.floor(n/60)}m ${n%60}s`:"Recording"," · ",nb(x)]})]}),!g&&r.jsxs("div",{className:"text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md p-2",children:["Recording exceeds the ",is.MAX_FILE_SIZE_MB,"MB limit."]}),!v&&r.jsxs("div",{className:"text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md p-2",children:["Recording exceeds the ",is.PRO_MAX_DURATION_MINUTES," minute limit."]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"rec-title",className:"text-sm",children:"Title"}),r.jsx(He,{id:"rec-title",value:o,onChange:S=>l(S.target.value),maxLength:100,disabled:u})]}),r.jsxs("div",{children:[r.jsx(ye,{htmlFor:"rec-desc",className:"text-sm",children:"Description (optional)"}),r.jsx($s,{id:"rec-desc",value:c,onChange:S=>d(S.target.value),maxLength:500,rows:2,disabled:u})]})]}),u&&r.jsxs("div",{className:"space-y-1",children:[r.jsx(Lc,{value:f,className:"h-2"}),r.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Uploading… ",f,"%"]})]}),r.jsxs(Fr,{children:[r.jsxs(P,{variant:"ghost",onClick:b,disabled:u,children:[r.jsx(Xr,{className:"w-4 h-4"}),"Discard"]}),r.jsxs(P,{onClick:w,disabled:u||!y,children:[u?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(Db,{className:"w-4 h-4"}),"Save to Library"]})]})]})})},wat=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Qz=/https?:\/\/[^\s]+/g,jat=({text:e})=>{const t=e.split(Qz),n=e.match(Qz)||[];if(n.length===0)return r.jsx("span",{children:e});const s=[];return t.forEach((a,i)=>{a&&s.push(r.jsx("span",{children:a},`t-${i}`)),n[i]&&s.push(r.jsxs("a",{href:n[i],target:"_blank",rel:"noopener noreferrer",className:"underline text-primary-foreground
1316/90 hover:text-primary-foreground inline-flex items-center gap-0.5",children:[r.jsx(Wl,{className:"w-3 h-3 inline shrink-0"}),n[i].length>40?n[i].slice(0,40)+"…":n[i]]},`u-${i}`))}),r.jsx(r.Fragment,{children:s})},Nat=({roomCode:e,userId:t,userName:n,isOpen:s,onClose:a,onNewMessage:i})=>{const[o,l]=h.useState([]),[c,d]=h.useState(""),u=h.useRef(null),m=h.useRef(null);h.useEffect(()=>{if(u.current){const x=u.current.querySelector("[data-radix-scroll-area-viewport]");x&&(x.scrollTop=x.scrollHeight)}},[o]),h.useEffect(()=>{const x=F.channel(`meeting-chat-${e}`,{config:{broadcast:{self:!1}}});return m.current=x,x.on("broadcast",{event:"chat-message"},({payload:g})=>{if(!g)return;const v={id:g.id,senderId:g.senderId,senderName:g.senderName,text:g.text,timestamp:g.timestamp};l(y=>[...y,v]),i()}).subscribe(),()=>{F.removeChannel(x)}},[e,i]);const f=h.useCallback(()=>{var v;const x=c.trim();if(!x)return;const g={id:crypto.randomUUID(),senderId:t,senderName:n,text:x,timestamp:Date.now()};l(y=>[...y,g]),(v=m.current)==null||v.send({type:"broadcast",event:"chat-message",payload:g}),d("")},[c,t,n]),p=x=>
1316{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),f())};return s?r.jsxs("div",{className:"absolute top-0 right-0 bottom-0 w-80 md:w-96 bg-background/95 backdrop-blur-md border-l border-border flex flex-col z-20 shadow-2xl",children:[r.jsxs("div",{className:"shrink-0 flex items-center justify-between px-4 py-3 border-b border-border",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"In-call messages"}),r.jsx(P,{variant:"ghost",size:"icon",onClick:a,className:"h-8 w-8",children:r.jsx(zt,{className:"w-4 h-4"})})]}),r.jsx(Io,{ref:u,className:"flex-1 min-h-0",children:r.jsxs("div",{className:"p-4 space-y-3",children:[o.length===0&&r.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"Messages are only visible during this call and won't be saved."}),o.map(x=>{const g=x.senderId===t;return r.jsxs("div",{className:ge("flex flex-col gap-0.5",g?"items-end":"items-start"),children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:g?"You":x.senderName}),r.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:wat(x.timestamp)})]}),r.jsx("div",{className:ge("rounded-xl px-3 py-2 text-sm max-w-[85%] break-words",g?"bg-primary text-primary-foreground rounded-br-sm":"bg-muted text-foreground rounded-bl-sm"),children:r.jsx(jat,{text:x.text})})]},x.id)})]})}),r.jsx("div",{className:"shrink-0 p-3 border-t border-border",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(He,{value:c,onChange:x=>d(x.target.value),onKeyDown:p,placeholder:"Send a message…",className:"flex-1 text-sm",autoFocus:!0}),r.jsx(P,{size:"icon",onClick:f,disabled:!c.trim(),className:"shrink-0",children:r.jsx(Es,{className:"w-4 h-4"})})]})})]}):null},Sat=({roomCode:e,userId:t,isCreator:n,creatorName:s,creatorAvatarUrl:a,userAvatarUrl:i,userName:o="Guest",isAuthenticated:l=!1,initialCameraOn:c=!0,initialMicOn:d=!0})=>{const u=Sr(),m=h.useRef(null),f=h.useRef(null),p=h.useRef(null),x=h.useRef(new Map),[g,v]=h.useState(!1),[y,b]=h.useState(!1),[w,S]=h.useState(0),[j,N]=h.useState(null),_=_r(),C=ih(),k=!_&&!C,E=h.useCallback(()=>{Rt({title:"Removed from call",description:"The host removed you from this call.",variant:"destructive"}),u("/meet")},[u]),{localStream:R,screenStream:T,remoteStreams:D,isMuted:A,isCameraOn:V,isScreenSharing:U,peerStates:O,peerCount:M,anyRemoteRecording:$,toggleMute:I,toggleCamera:B,toggleScreenShare:K,endCall:Z,broadcastRecordingState:q,kickPeer:H}=xat({roomCode:e,userId:t,isCreator:n,userName:o,avatarUrl:i,isAuthenticated:l,initialCameraOn:c,initialMicOn:d,onKicked:E}),[X,G]=h.useState(!1),[ee,re]=h.useState(null),[W,Q]=h.useState(0),L=h.useRef(!1),te=h.useRef(!1),ae=h.useRef(null),ne=vat({getSources:h.useCallback(()=>{const Oe=Object.keys(O).find(Ee=>{var ot;return(ot=O[Ee])==null?void 0:ot.isScreenSharing}),pe=Oe?D[Oe]:null,le=T||pe||null,ke=Object.entries(D).filter(([Ee])=>Ee!==Oe).map(([,Ee])=>Ee);return{localCamera:R,localMic:R,screen:le,remotes:ke}},[R,T,D,O]),maxDurationSeconds:is.BROWSER_CALL_RECORDING_MAX_SECONDS,onMaxDurationReached:h.useCallback(()=>{var Oe;(Oe=ae.current)==null||Oe.call(ae)},[])}),se=h.useCallback(async()=>{window.confirm(`Start recording this call?
1317
1318Browser recording is limited to ${is.BROWSER_CALL_RECORDING_MAX_MINUTES} minutes - for longer sessions, install the Chrome extension.
1319
1320All participants will see a "This call is being recorded" notice.`)&&(L.current=!1,te.current=!1,await ne.start(),ne.error||(q(!0),Rt({title:"Recording started",description:"Participants have been notified."})))},[ne,q]),ue=h.useCallback(async()=>{const Oe=ne.duration,pe=await ne.stop();q(!1),pe&&pe.size>0?(re(pe),Q(Oe),Rt({title:"Recording stopped",description:"It will be saved when the call ends."})):Rt({title:"Recording empty",description:"No content was captured.",variant:"destructive"})},[ne,q]);h.useEffect(()=>{ae.current=()=>{Rt({title:"Browser recording limit reached",description:`${is.BROWSER_CALL_RECORDING_MAX_MINUTES}-minute browser limit hit. Recording is ready to save when you end the call.`,variant:"destructive"}),ue()}},[ue]),h.useEffect(()=>{if(!ne.isRecording)return;const Oe=ne.duration;Oe>=is.BROWSER_CALL_RECORDING_WARN_5_MIN&&!L.current&&(L.current=!0,Rt({title:"5 minutes left on browser recording",description:`Recording auto-stops at ${is.BROWSER_CALL_RECORDING_MAX_MINUTES} min. Install the Chrome extension to record longer sessions.`})),Oe>=is.BROWSER_CALL_RECORDING_WARN_1_MIN&&!te.current&&(te.current=!0,Rt({title:"Recording auto-stops in 1 minute",description:"Browser recording length limit is about to be reached.",variant:"destructive"}))},[ne.duration,ne.isRecording]),h.useEffect(()=>{R&&(m.current&&(m.current.srcObject=R),f.current&&(f.current.srcObject=R))},[R,M,U]),h.useEffect(()=>{p.current&&T&&(p.current.srcObject=T)},[T]),h.useEffect(()=>
1320{Object.entries(D).forEach(([Oe,pe])=>{const le=x.current.get(Oe);le&&le.srcObject!==pe&&(le.srcObject=pe)})},[D]),h.useEffect(()=>{y&&S(0)},[y]);const Ne=h.useCallback(()=>{y||S(Oe=>Oe+1)},[y]),Qe=h.useCallback(async()=>{let Oe=ee,pe=W;ne.isRecording&&(pe=ne.duration,Oe=await ne.stop(),q(!1),Oe&&Oe.size>0&&(re(Oe),Q(pe))),Z(),Oe&&Oe.size>0?G(!0):u("/meet")},[ne,q,Z,u,ee,W]),J=h.useCallback(()=>{Rt({title:"Call ended",description:"Your call has reached the 2-hour time limit."}),Qe()},[Qe]),de=`https://meet.vidareo.com/${e}`,ve=async()=>{await navigator.clipboard.writeText(de),v(!0),Rt({title:"Link copied",description:"Share it with others to join your call."}),setTimeout(()=>v(!1),2e3)},Le=s?s.split(" ").map(Oe=>Oe[0]).join("").toUpperCase().slice(0,2):"?",$e=o&&o.split(" ").map(Oe=>Oe[0]).join("").toUpperCase().slice(0,2)||"?",De=i??(n?a:null),oe=h.useCallback((Oe,pe)=>{if(pe){x.current.set(Oe,pe);const le=D[Oe];le&&pe.srcObject!==le&&(pe.srcObject=le)}else x.current.delete(Oe)},[D]),xe=Object.keys(D),Ze=M+1,it=()=>M===0?"":M===1?"grid grid-cols-1 grid-rows-1":C?M===1?"grid grid-cols-1 grid-rows-2":M===2?"grid grid-cols-1 grid-rows-3":"grid grid-cols-2 grid-rows-2":"grid grid-cols-2 grid-rows-2",ct=(Oe,pe,le,ke)=>{var gt,Nt;const Ee=le?o:((gt=O[Oe])==null?void 0:gt.userName)||"Participant",ot=Ee.split(" ").map(Ct=>Ct[0]).join("").toUpperCase().slice(0,2)||"?";return r.jsxs("div",{className:"group relative w-full h-full min-h-0 rounded-2xl overflow-hidden bg-black",children:[le?r.jsx("video",{ref:m,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover"}):r.jsx("video",{ref:Ct=>oe(Oe,Ct),autoPlay:!0,playsInline:!0,className:"w-full h-full object-contain bg-black"}),!ke&&r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-secondary/90",children:[r.jsxs(an,{className:"w-16 h-16",children:[le&&De?r.jsx(gn,{src:De,alt:o}):!le&&((Nt=O[Oe])!=null&&Nt.avatarUrl)?r.jsx(gn,{src:O[Oe].avatarUrl,alt:Ee}):!le&&a&&!n?r.jsx(gn,{src:a,alt:"Peer"}):null,r.jsx(on,{className:"text-xl bg-muted/30 text-secondary-foreground",children:ot})]}),r.jsx("p",{className:"mt-2 text-xs text-secondary-foreground/70",children:"Camera off"})]}),r.jsx("div",{className:"absolute bottom-2 left-2 bg-black/60 text-white text-xs px-2 py-1 rounded-md",children:Ee}),!le&&n&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"destructive",size:"icon",className:"absolute top-2 right-2 w-7 h-7 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N({peerId:Oe,peerName:Ee}),children:r.jsx(eb,{className:"w-3.5 h-3.5"})})}),r.jsx(yt,{side:"top",children:"Remove participant"})]})]},Oe)};return r.jsxs("div",{className:"fixed inset-0 bg-secondary flex flex-col z-50",children:[$&&r.jsx("div",{className:"shrink-0 flex items-center justify-center gap-4 py-2 bg-primary/90 text-primary-foreground text-sm font-medium",children:r.jsx("span",{className:"flex items-center gap-1.5",children:"This call is being recorded"})}),M>0&&r.jsxs("div",{className:"absolute top-3 left-3 z-20 flex items-center gap-1.5 bg-black/60 text-white text-xs px-2.5 py-1.5 rounded-full",children:[r.jsx(jr,{className:"w-3.5 h-3.5"}),Ze]}),r.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden relative flex items-center justify-center p-4",children:[r.jsx(gat,{onTimeUp:J}),(()=>{var ke;const Oe=xe.find(Ee=>{var ot;return(ot=O[Ee])==null?void 0:ot.isScreenSharing});if(!(U&&!!T||!!Oe))return null;const le=U?o:((ke=O[Oe])==null?void 0:ke.userName)||"Participant";return le.split(" ").map(Ee=>Ee[0]).join("").toUpperCase().slice(0,2),r.jsxs("div",{className:"w-full h-full flex flex-col gap-2",children:[r.jsxs("div",{className:"shrink-0 flex gap-2 justify-center flex-wrap",children:[r.jsxs("div",{className:"relative w-32 h-24 md:w-44 md:h-32 rounded-xl overflow-hidden bg-black border-2 border-primary/50 shadow-lg",children:[r.jsx("video",{ref:f,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover"}),!V&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-secondary/90",children:r.jsxs(an,{className:"w-8 h-8",children:[De?r.jsx(gn,{src:De,alt:o}):null,r.jsx(on,{className:"text-xs bg-muted/30 text-secondary-foreground",children:$e})]})}),r.jsx("div",{className:"absolute bottom-1 left-1 bg-black/60 text-white text-[10px] px-1.5 py-0.5 rounded",children:o})]}),xe.map(Ee=>{var dt,tt,Re,Fe;const ot=Ee===Oe,gt=((dt=O[Ee])==null?void 0:dt.userName)||"Participant",Nt=gt.split(" ").map(Ae=>Ae[0]).join("").toUpperCase().slice(0,2)||"?",Ct=((tt=O[Ee])==null?void 0:tt.cameraOn)??!0;return r.jsxs("div",{className:"group relative w-32 h-24 md:w-44 md:h-32 rounded-xl overflow-hidden bg-black border-2 border-secondary-foreground
1320/20 shadow-lg",children:[ot?r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-secondary/90",children:[r.jsxs(an,{className:"w-8 h-8",children:[(Re=O[Ee])!=null&&Re.avatarUrl?r.jsx(gn,{src:O[Ee].avatarUrl,alt:gt}):null,r.jsx(on,{className:"text-xs bg-muted/30 text-secondary-foreground",children:Nt})]}),r.jsx("p",{className:"mt-1 text-[10px] text-secondary-foreground/70",children:"Sharing screen"})]}):r.jsxs(r.Fragment,{children:[r.jsx("video",{ref:Ae=>oe(Ee,Ae),autoPlay:!0,playsInline:!0,className:"w-full h-full object-cover"}),!Ct&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-secondary/90",children:r.jsxs(an,{className:"w-8 h-8",children:[(Fe=O[Ee])!=null&&Fe.avatarUrl?r.jsx(gn,{src:O[Ee].avatarUrl,alt:gt}):null,r.jsx(on,{className:"text-xs bg-muted/30 text-secondary-foreground",children:Nt})]})})]}),r.jsx("div",{className:"absolute bottom-1 left-1 bg-black/60 text-white text-[10px] px-1.5 py-0.5 rounded",children:gt}),n&&r.jsx(P,{variant:"destructive",size:"icon",className:"absolute top-1 right-1 w-5 h-5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N({peerId:Ee,peerName:gt}),children:r.jsx(eb,{className:"w-3 h-3"})})]},Ee)})]}),r.jsxs("div",{className:"flex-1 min-h-0 relative rounded-2xl overflow-hidden bg-black",children:[U?r.jsx("video",{ref:p,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-contain"}):r.jsx("video",{ref:Ee=>oe(Oe,Ee),autoPlay:!0,playsInline:!0,className:"w-full h-full object-contain"}),r.jsxs("div",{className:"absolute top-2 left-2 bg-primary/80 text-primary-foreground text-xs px-2 py-1 rounded-md flex items-center gap-1.5",children:[r.jsx(CL,{className:"w-3.5 h-3.5"}),U?"You're sharing your screen":`${le} is sharing their screen`]})]})]})})()||(M===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-secondary-foreground",children:[r.jsxs(an,{className:"w-20 h-20",children:[a?r.jsx(gn,{src:a,alt:s||"Creator"}):null,r.jsx(on,{className:"text-2xl bg-muted/40 text-secondary-foreground",children:Le})]}),r.jsx("p",{className:"text-lg font-medium text-center text-secondary-foreground",children:n?"Waiting for participants to join…":s?`Waiting for ${s} to join…`:"Waiting for the host to join…"}),!n&&r.jsx("p",{className:"text-sm text-secondary-foreground/80 text-center",children:"You'll be connected automatically when they arrive."}),n&&r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs(P,{variant:"outline",size:"sm",onClick:ve,className:"border-secondary-foreground/50 text-secondary-foreground hover:bg-secondary-foreground/10",children:[g?r.jsx(nt,{className:"w-4 h-4"}):r.jsx(ui,{className:"w-4 h-4"}),g?"Copied!":"Copy invite link"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{const Oe=encodeURIComponent("Join my video call"),pe=encodeURIComponent(`Join my video call:
1321${de}`);window.open(`mailto:?subject=${Oe}&body=${pe}`,"_self")},className:"border-secondary-foreground/50 text-secondary-foreground hover:bg-secondary-foreground/10",children:[r.jsx(zr,{className:"w-4 h-4"}),"Email invite"]})]}),R&&r.jsxs("div",{className:"relative mt-4 w-64 h-44 rounded-xl overflow-hidden bg-black border-2 border-secondary-foreground/20",children:[r.jsx("video",{ref:m,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover"}),!V&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-secondary/90",children:r.jsxs(an,{className:"w-10 h-10",children:[De?r.jsx(gn,{src:De,alt:o}):null,r.jsx(on,{className:"text-sm bg-muted/30 text-secondary-foreground",children:$e})]})})]})]}):M===1?r.jsxs(r.Fragment,{children:[xe.map(Oe=>{var pe,le,ke,Ee,ot;return r.jsxs("div",{className:"group relative w-full h-full max-h-full",children:[r.jsx("video",{ref:gt=>oe(Oe,gt),autoPlay:!0,playsInline:!0,className:ge("w-full h-full max-h-full rounded-2xl bg-black",C?"object-cover":"object-contain")}),O[Oe]&&!O[Oe].cameraOn&&r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-secondary/90 rounded-2xl",children:[r.jsxs(an,{className:"w-20 h-20",children:[(pe=O[Oe])!=null&&pe.avatarUrl?r.jsx(gn,{src:O[Oe].avatarUrl,alt:((le=O[Oe])==null?void 0:le.userName)||"Peer"}):a&&!n?r.jsx(gn,{src:a,alt:"Peer"}):null,r.jsx(on,{className:"text-2xl bg-muted/30 text-secondary-foreground",children:(((ke=O[Oe])==null?void 0:ke.userName)||(n?"?":s||"?")).split(" ").map(gt=>gt[0]).join("").toUpperCase().slice(0,2)||"?"})]}
1321),r.jsx("p",{className:"mt-3 text-sm text-secondary-foreground/70",children:"Camera is off"}),r.jsx("p",{className:"mt-1 text-xs text-secondary-foreground/50",children:((Ee=O[Oe])==null?void 0:Ee.userName)||"Participant"})]}),r.jsx("div",{className:"absolute bottom-3 left-3 bg-black/60 text-white text-xs px-2 py-1 rounded-md",children:((ot=O[Oe])==null?void 0:ot.userName)||(s??"Participant")}),n&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{variant:"destructive",size:"icon",className:"absolute top-3 right-3 w-8 h-8 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{var gt;return N({peerId:Oe,peerName:((gt=O[Oe])==null?void 0:gt.userName)||"Participant"})},children:r.jsx(eb,{className:"w-4 h-4"})})}),r.jsx(yt,{side:"top",children:"Remove participant"})]})]},Oe)}),R&&r.jsxs("div",{className:ge("absolute rounded-xl overflow-hidden bg-black border-2 border-secondary-foreground/20 shadow-xl z-10 transition-all",C?"top-4 right-4 w-24 h-32":"bottom-4 w-40 h-28 md:w-56 md:h-40",!C&&(y?"right-[calc(24rem+1rem)]":"right-4")),children:[r.jsx("video",{ref:f,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover"}),!V&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-secondary/90",children:r.jsxs(an,{className:"w-10 h-10",children:[De?r.jsx(gn,{src:De,alt:o}):null,r.jsx(on,{className:"text-sm bg-muted/30 text-secondary-foreground",children:$e})]})}),r.jsx("div",{className:"absolute bottom-1 left-1 bg-black/60 text-white text-[10px] px-1.5 py-0.5 rounded",children:o})]})]}):r.jsxs("div",{className:ge("w-full h-full gap-2",it()),children:[xe.map(Oe=>{var pe;return ct(Oe,D[Oe],!1,((pe=O[Oe])==null?void 0:pe.cameraOn)??!0)}),ct("self",R,!0,V)]})),r.jsx(Nat,{roomCode:e,userId:t,userName:o,isOpen:y,onClose:()=>b(!1),onNewMessage:Ne})]}),r.jsx("div",{className:ge("shrink-0 z-10 flex items-end justify-center pt-2",C?"pb-[max(1rem,env(safe-area-inset-bottom))] px-3":"pb-6"),children:r.jsxs("div",{className:ge("flex items-end justify-center",C?"gap-2 w-full max-w-md rounded-3xl bg-background/70 backdrop-blur-xl border border-border/40 shadow-2xl px-3 py-3":"gap-3"),children:[r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{"aria-label":A?"Unmute microphone":"Mute microphone","aria-pressed":A,variant:A?"destructive":"secondary",size:"icon",onClick:I,className:ge("rounded-full",C?"w-12 h-12":"w-14 h-14"),children:A?r.jsx(cv,{className:"w-6 h-6"}):r.jsx(Hd,{className:"w-6 h-6"})})}),r.jsx(yt,{side:"top",children:A?"Unmute":"Mute"})]}),C&&r.jsx("span",{className:"text-[10px] font-medium text-foreground/80",children:A?"Unmute":"Mute"})]}),r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{"aria-label":V?"Turn camera off":"Turn camera on","aria-pressed":!V,variant:V?"secondary":"destructive",size:"icon",onClick:B,className:ge("rounded-full",C?"w-12 h-12":"w-14 h-14"),children:V?r.jsx(cr,{className:"w-6 h-6"}):r.jsx(q4,{className:"w-6 h-6"})})}),r.jsx(yt,{side:"top",children:V?"Turn off camera":"Turn on camera"})]}),C&&r.jsx("span",{className:"text-[10px] font-medium text-foreground/80",children:V?"Camera":"Start cam"})]}),k&&r.jsx("div",{className:"flex flex-col items-center gap-1",children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsx(P,{"aria-label":U?"Stop sharing screen":"Share screen","aria-pressed":U,variant:U?"default":"secondary",size:"icon",onClick:K,className:ge("rounded-full w-14 h-14",U&&"ring-2 ring-primary/50 ring-offset-2 ring-offset-secondary"),children:U?r.jsx(Eue,{className:"w-6 h-6"}):r.jsx(CL,{className:"w-6 h-6"})})}),r.jsx(yt,{side:"top",children:U?"Stop sharing":"Share screen"})]})}),r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{"aria-label":y?"Close chat":"Open chat","aria-pressed":y,variant:y?"default":"secondary",size:"icon",onClick:()=>b(Oe=>!Oe),className:ge("rounded-full relative",C?"w-12 h-12":"w-14 h-14"),children:[r.jsx(Wa,{className:"w-6 h-6"}),w>0&&r.jsx("span",{className:"absolute -top-1 -right-1 bg-destructive text-destructive-foreground text-[10px] font-bold rounded-full w-5 h-5 flex items-center justify-center",children:w>9?"9+":w})]})}),r.jsx(yt,{side:"top",children:y?"Close chat":"Chat"})]}),C&&r.jsx("span",{className:"text-[10px] font-medium text-foreground
1321/80",children:"Chat"})]}),n&&!C&&r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{"aria-label":ne.isRecording?"Stop recording":"Start recording",variant:ne.isRecording?"destructive":"secondary",size:"icon",onClick:ne.isRecording?ue:se,className:ge("rounded-full w-14 h-14 relative",ne.isRecording&&"ring-2 ring-destructive/60 ring-offset-2 ring-offset-secondary"),children:[ne.isRecording?r.jsx(Um,{className:"w-5 h-5 fill-current"}):r.jsx(Ob,{className:"w-5 h-5 fill-destructive text-destructive"}),ne.isRecording&&r.jsxs("span",{className:ge("absolute -top-1 -right-1 text-[10px] font-mono px-1.5 py-0.5 rounded-full whitespace-nowrap",ne.duration>=is.BROWSER_CALL_RECORDING_WARN_5_MIN?"bg-yellow-500 text-black":"bg-destructive text-destructive-foreground"),children:[Math.floor(ne.duration/60),":",String(ne.duration%60).padStart(2,"0")]})]})}),r.jsx(yt,{side:"top",children:ne.isRecording?"Stop recording":`Record call (browser limit: ${is.BROWSER_CALL_RECORDING_MAX_MINUTES} min - use Chrome extension for longer)`})]}),r.jsx("div",{className:"flex flex-col items-center gap-1",children:r.jsxs(wt,{children:[r.jsx(vt,{asChild:!0,children:r.jsxs(P,{"aria-label":"Leave call",variant:"destructive",onClick:Qe,className:ge("rounded-full",C?"h-12 px-5 gap-2":"w-14 h-14 p-0"),children:[r.jsx(Due,{className:ge(C?"w-5 h-5":"w-6 h-6")}),C&&r.jsx("span",{className:"text-sm font-semibold",children:"Leave"})]})}),r.jsx(yt,{side:"top",children:"End call"})]})})]})}),r.jsx(bat,{open:X,blob:ee,duration:W,onClose:()=>{G(!1),re(null),Q(0),ne.reset(),u("/meet")}}),r.jsx(cs,{open:!!j,onOpenChange:Oe=>{Oe||N(null)},children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Remove participant?"}),r.jsxs(Jn,{children:["Are you sure? This will remove ",(j==null?void 0:j.peerName)??"this participant"," from your meeting."]})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsx(bs,{onClick:()=>{j&&(H(j.peerId),Rt({title:"Participant removed",description:`${j.peerName} has been removed from the call.`})),N(null)},children:"Remove"})]})]})})]})},_at=({creatorName:e,creatorAvatarUrl:t,userAvatarUrl:n,userName:s,isCreator:a,onJoin:i,onLeave:o})=>{const l=h.useRef(null),c=h.useRef(null),[d,u]=h.useState(!0),[m,f]=h.useState(!0),[p,x]=h.useState(!0),[g,v]=h.useState(s),[y,b]=h.useState(!1),w=g?g.split(" ").map(j=>j[0]).join("").toUpperCase().slice(0,2):"?";h.useEffect(()=>{let j=!1;return(async()=>{try{const N=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"user"}},audio:!0});if(j){N.getTracks().forEach(_=>_.stop());return}c.current=N}catch{u(!1),f(!1)}finally{j||x(!1)}})(),()=>{var N;j=!0,(N=c.current)==null||N.getTracks().forEach(_=>_.stop()),c.current=null}},[]),h.useEffect(()=>{!p&&d&&c.current&&l.current&&(l.current.srcObject=c.current,l.current.play().catch(()=>{}))},[p,d]),h.useEffect(()=>{const j=c.current;j&&(j.getVideoTracks().forEach(N=>{N.enabled=d}),d&&l.current&&(l.current.srcObject=j,l.current.play().catch(()=>{})))},[d]),h.useEffect(()=>{const j=c.current;j&&j.getAudioTracks().forEach(N=>{N.enabled=m})},[m]);const S=()=>{var j;(j=c.current)==null||j.getTracks().forEach(N=>N.stop()),c.current=null,i(d,m,g.trim()||"Guest")};return r.jsx("div",{className:"fixed inset-0 bg-secondary z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"w-full max-w-lg flex flex-col items-center gap-6",children:[r.jsxs("div",{className:"text-center space-y-2 flex flex-col items-center",children:[!a&&e&&r.jsxs(an,{className:"w-14 h-14 mb-1",children:[t?r.jsx(gn,{src:t,alt:e}):null,r.jsx(on,{className:"bg-muted/30 text-secondary-foreground",children:e.split(" ").map(j=>j[0]).join("").toUpperCase().slice(0,2)})]}),r.jsx("h1",{className:"text-xl font-semibold text-secondary-foreground",children:a?"Your meeting room":e?`Joining ${e}'s call`:"Ready to join?"}),!a&&e&&r.jsx("p",{className:"text-xs text-secondary-foreground/60",children:"You'll join as"}),r.jsx("div",{className:"flex items-center justify-center gap-2",children:y?r.jsx(He,{value:g,onChange:j=>v(j.target.value),onBlur:()=>b(!1),onKeyDown:j=>{j.key==="Enter"&&b(!1)},autoFocus:!0,className:"max-w-[200px] text-center text-sm h-8",placeholder:"Enter your name"}):r.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1.5 text-sm text-secondary-foreground
1321/80 hover:text-secondary-foreground transition-colors",children:[r.jsx("span",{className:"font-medium",children:g}),r.jsx(tl,{className:"w-3.5 h-3.5"})]})})]}),r.jsx("div",{className:"relative w-full aspect-video rounded-2xl overflow-hidden bg-black border-2 border-secondary-foreground/10",children:p?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):d?r.jsx("video",{ref:l,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover mirror",style:{transform:"scaleX(-1)"}}):r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-secondary/90",children:[r.jsxs(an,{className:"w-20 h-20",children:[n?r.jsx(gn,{src:n,alt:s}):a&&t?r.jsx(gn,{src:t,alt:"You"}):null,r.jsx(on,{className:"text-2xl bg-muted/30 text-secondary-foreground",children:w})]}),r.jsx("p",{className:"mt-3 text-sm font-medium text-secondary-foreground",children:g}),r.jsx("p",{className:"text-xs text-secondary-foreground/60",children:"Camera is off"})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(P,{variant:m?"secondary":"destructive",size:"icon",onClick:()=>f(j=>!j),className:"rounded-full w-14 h-14",children:m?r.jsx(Hd,{className:"w-6 h-6"}):r.jsx(cv,{className:"w-6 h-6"})}),r.jsx(P,{variant:d?"secondary":"destructive",size:"icon",onClick:()=>u(j=>!j),className:"rounded-full w-14 h-14",children:d?r.jsx(cr,{className:"w-6 h-6"}):r.jsx(q4,{className:"w-6 h-6"})})]}),r.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs",children:[r.jsxs(P,{variant:"outline",size:"lg",onClick:o,className:"rounded-full flex-1 text-base gap-2",children:[r.jsx(aa,{className:"w-5 h-5"}),"Leave"]}),r.jsxs(P,{size:"lg",onClick:S,disabled:p,className:"rounded-full flex-[2] text-base gap-2",children:[r.jsx(og,{className:"w-5 h-5"}),"Join call"]})]})]})})};function Cat(){return"guest-"+crypto.randomUUID()}const kat=()=>{var R;const{roomCode:e}=eh(),{user:t}=nr(),n=Sr(),[s,a]=h.useState(!1),[i,o]=h.useState(!1),[l,c]=h.useState(!1),[d,u]=h.useState(!1),[m,f]=h.useState(null),[p,x]=h.useState(null),g=t?((R=t.user_metadata)==null?void 0:R.full_name)||(t.email?t.email.split("@")[0]:"Guest"):"Guest",[v,y]=h.useState(g),[b,w]=h.useState(null),[S,j]=h.useState(!0),[N,_]=h.useState(!0);h.useEffect(()=>{t!=null&&t.id&&F.from("profiles").select("full_name, avatar_url").eq("user_id",t.id).single().then(({data:T})=>{var A;const D=(T==null?void 0:T.full_name)||((A=t.user_metadata)==null?void 0:A.full_name)||(t.email?t.email.split("@")[0]:null);D&&y(D),T!=null&&T.avatar_url&&w(T.avatar_url)})},[t==null?void 0:t.id]);const C=h.useMemo(()=>(t==null?void 0:t.id)??Cat(),[t==null?void 0:t.id]);h.useEffect(()=>{e&&(async()=>{let{data:T,error:D}=await F.rpc("get_meeting_room_by_code",{p_room_code:e}),A=T&&T.length>0?T[0]:null;if(!A||A.status==="ended"){const{data:M,error:$}=await F.rpc("get_or_create_scheduled_room",{p_room_code:e});!$&&M&&M.length>0&&(A=M[0],D=null)}if(!A||A.status==="ended"){const{data:M,error:$}=await F.rpc("get_or_create_personal_room",{p_room_code:e});!$&&M&&M.length>0&&(A=M[0],D=null)}if(D||!A){Rt({title:"Room not found",description:"This room code is invalid or has expired.",variant:"destructive"}),n("/join");return}if(A.status==="ended"){Rt({title:"Call ended",description:"This call has already ended.",variant:"destructive"}),n("/join");return}const{data:V}=await F.rpc("get_or_create_personal_room",{p_room_code:e}),U=!!(V&&V.length>0),O=t?A.created_by===t.id:!1;a(O),o(U),f(A.creator_name??null),x(A.creator_avatar_url??null),c(!0)})()},[e,t,n]),h.useEffect(()=>{!l||!e||!i||s||F.functions.invoke("notify-personal-room-visit",{body:{room_code:e,visitor_name:v}}).catch(T=>console.warn("personal room notify failed",T))},[l,i,s,e]);const k=h.useCallback(async(T,D,A)=>{const V=F.channel(`meeting-${e}`,{config:{presence:{key:`probe-${C}`}}});if(await new Promise(O=>{let M=!1;const $=I=>{M||(M=!0,F.removeChannel(V),O(I))};V.subscribe(async I=>{I==="SUBSCRIBED"&&setTimeout(()=>{const B=V.presenceState();$(Object.keys(B).length)},600)}),setTimeout(()=>$(0),2e3)})>=4){Rt({title:"Room is full",description:"This call already has 4 participants (the maximum).",variant:"destructive"});return}j(T),_(D),y(A),u(!0)},[e,C]),E=h.useCallback(()=>{n(t?"/meet":"/")},[n,t]);return!l||!e?r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):d?r.jsx(Sat,{roomCode:e,userId:C,isCreator:s,creatorName:m,creatorAvatarUrl:p,userAvatarUrl:b,userName:v,isAuthenticated:!!t,initialCameraOn:S,initialMicOn:N}):r.jsx(_at,{creatorName:m,creatorAvatarUrl:p,userAvatarUrl:b,userName:v,isCreator:s,onJoin:k,onLeave:E})},Eat=/^[abcdefghjkmnpqrstuvwxyz23456789]+$/,Aat=Bl().trim().toLowerCase().min(4,{message:"Code is too short."}).max(20,{message:"Code is too long."}).regex(Eat,{message:"Use only letters and numbers (no spaces)."});function Tat(e){const t=e.trim();if(!t)return"";try{if(/^https?:\/\//i.test(t)||t.includes("/")){const s=(t.startsWith("http")?new URL(t):new URL(`https://${t}
1321`)).pathname.split("/").filter(Boolean).pop();if(s)return s.toLowerCase()}}catch{}return t.toLowerCase()}const Rat=()=>{var x;const e=Sr(),[t]=iu(),[n,s]=h.useState(""),[a,i]=h.useState(!1),o=_r(),l=ih(),c=o&&l;h.useEffect(()=>{document.title="Join a Video Call | VIDAREO - Free Video Meetings";const g=document.querySelector('meta[name="description"]');return g&&g.setAttribute("content","Join a VIDAREO video call instantly - no downloads or sign-ups required. Enter your meeting code and connect face-to-face in seconds."),()=>{document.title="VIDAREO | Screen Recorder with Teleprompter for Sales Teams"}},[]),h.useEffect(()=>{var v;const g=(v=t.get("room"))==null?void 0:v.trim().toLowerCase();g&&e(`/meet/${g}`,{replace:!0})},[t,e]);const d=h.useMemo(()=>Tat(n),[n]),u=h.useMemo(()=>Aat.safeParse(d),[d]),m=a&&!u.success?(x=u.error.issues[0])==null?void 0:x.message:null,f=()=>{var g;if(i(!0),!u.success){Rt({title:"Invalid room code",description:((g=u.error.issues[0])==null?void 0:g.message)??"Please check the code and try again.",variant:"destructive"});return}e(`/meet/${u.data}`)},p=async()=>{try{const g=await navigator.clipboard.readText();if(!g){Rt({title:"Clipboard is empty",description:"Copy a room code or invite link first."});return}s(g),i(!0)}catch{Rt({title:"Couldn't read clipboard",description:"Paste manually into the field instead.",variant:"destructive"})}};return r.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[!c&&r.jsx(pn,{}),r.jsx("div",{className:ge("container mx-auto px-4 pb-12 flex-1",c?"pt-8":"pt-24"),children:r.jsxs("div",{className:"max-w-md mx-auto space-y-8",children:[r.jsxs("div",{className:"text-center space-y-3",children:[r.jsx("div",{className:"mx-auto w-16 h-16 rounded-2xl gradient-primary flex items-center justify-center",children:r.jsx(cr,{className:"w-8 h-8 text-primary-foreground"})}),r.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Join a Video Call"}),r.jsx("p",{className:"text-muted-foreground",children:"Enter the room code or paste an invite link to join the call."})]}),r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsx($t,{className:"text-lg",children:"Enter room code"}),r.jsx(xr,{children:"Paste the code or full invite link shared with you."})]}),r.jsxs(lt,{className:"space-y-3",children:[r.jsxs("div",{className:"relative",children:[r.jsx(He,{placeholder:"e.g. abc12345",value:n,onChange:g=>s(g.target.value),onBlur:()=>i(!0),onKeyDown:g=>g.key==="Enter"&&f(),className:ge("text-center text-lg font-mono tracking-widest pr-10 h-14",m&&"border-destructive focus-visible:ring-destructive"),maxLength:200,autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,inputMode:"text","aria-invalid":!!m,"aria-describedby":m?"join-code-error":void 0}),n&&r.jsx("button",{type:"button",onClick:()=>{s(""),i(!1)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted touch-manipulation","aria-label":"Clear",children:r.jsx(zt,{className:"w-4 h-4"})})]}),m&&r.jsx("p",{id:"join-code-error",className:"text-xs text-destructive text-center",children:m}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(P,{type:"button",variant:"outline",className:"flex-1",onClick:p,size:"lg",children:[r.jsx(nue,{className:"w-4 h-4"}),"Paste"]}),r.jsxs(P,{className:"flex-[2]",onClick:f,disabled:!u.success,size:"lg",children:["Join Call",r.jsx(Ya,{className:"w-4 h-4"})]})]}),d&&u.success&&r.jsxs("p",{className:"text-[11px] text-muted-foreground text-center",children:["Joining room ",r.jsx("span",{className:"font-mono font-semibold text-foreground",children:u.data})]})]})]}),!c&&r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(mi,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-xs",children:"Peer-to-Peer"}),r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Direct & private"})]}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(ya,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-xs",children:"No Downloads"}),r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Runs in browser"})]}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mx-auto",children:r.jsx(Vs,{className:"w-5 h-5 text-primary"})}),r.jsx("h3",{className:"font-semibold text-foreground text-xs",children:"Any Device"}),r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Desktop & mobile"})]})]})]})}),!c&&r.jsx(Ka,{})]})},Oat=()=>{const[e]=iu();return h.useEffect(()=>{const t=e.get("token"),n=e.get("response");if(!t)return;const a=`https://lmytxuxvkybtzkbdljha.supabase.co/functions/v1/meeting-rsvp?token=${encodeURIComponent(t)}${n?`&response=${encodeURIComponent(n)}`:""}`;window.location.replace(a)},[e]),r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsxs("div",{className:"text-center space-y-3",children:[r.jsx(Me,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Recording your response..."})]})})},Pat=({onRedeemed:e})=>{const[t,n]=h.useState(""),[s,a]=h.useState(!1),{toast:i}=Gr(),o=async()=>
1321{if(t.trim()){a(!0);try{const{data:l,error:c}=await F.functions.invoke("redeem-gift-code",{body:{code:t.trim()}});if(c)throw c;if(!(l!=null&&l.success)){i({title:"Could not redeem code",description:(l==null?void 0:l.error)||"Invalid gift code",variant:"destructive"});return}n(""),i({title:"Gift code redeemed",description:"Your free Pro account is now active."}),e==null||e()}catch(l){console.error("Gift redemption failed",l),i({title:"Something went wrong",description:"Please try again in a moment.",variant:"destructive"})}finally{a(!1)}}};return r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(mT,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx($t,{className:"text-base",children:"Have a gift code?"}),r.jsx(xr,{className:"text-sm",children:"Redeem a gifted Pro account - no credit card required."})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsx(He,{value:t,onChange:l=>n(l.target.value.toUpperCase()),onKeyDown:l=>l.key==="Enter"&&o(),placeholder:"Enter gift code",className:"font-mono uppercase",disabled:s}),r.jsxs(P,{onClick:o,disabled:!t.trim()||s,className:"gap-2",children:[s?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(mT,{className:"w-4 h-4"}),"Redeem"]})]})})]})},Dat=({pendingSku:e,onPurchase:t})=>{const n=N2(),{prices:s}=_te();return r.jsxs("div",{className:"space-y-3 rounded-xl border border-primary/30 bg-gradient-to-br from-primary/10 to-primary/5 p-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ms,{className:"w-5 h-5 text-primary"}),r.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Upgrade to Pro"})]}),r.jsxs("ul",{className:"space-y-1.5 text-sm text-muted-foreground",children:[r.jsxs("li",{className:"flex items-center gap-2",children:[r.jsx(_n,{className:"w-3.5 h-3.5 text-primary"})," Unlimited video sends"]}),r.jsxs("li",{className:"flex items-center gap-2",children:[r.jsx(_n,{className:"w-3.5 h-3.5 text-primary"})," 10-minute recordings in 1080p HD"]}),r.jsxs("li",{className:"flex items-center gap-2",children:[r.jsx(_n,{className:"w-3.5 h-3.5 text-primary"})," Custom branding & analytics"]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx(P,{onClick:()=>t("pro_monthly"),disabled:n.loading,className:"w-full",children:e==="pro_monthly"?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):s.pro_monthly?`Monthly · ${s.pro_monthly}`:"Monthly"}),r.jsx(P,{onClick:()=>t("pro_annual"),disabled:n.loading,variant:"outline",className:"w-full",children:e==="pro_annual"?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):s.pro_annual?`Annual · ${s.pro_annual}`:"Annual · Save 33%"})]}),r.jsx(P,{variant:"ghost",size:"sm",onClick:()=>n.restore(),className:"w-full",children:"Restore Purchases"}),r.jsx("p",{className:"text-[11px] text-muted-foreground text-center",children:"Subscriptions auto-renew. Cancel anytime in Apple ID settings."})]})},Mat=({pendingSku:e,onPurchase:t})=>{const n=N2(),{prices:s}=_te(),{hasExtendedVideo30:a,hasExtendedVideo60:i}=np();return r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:r.jsx(fr,{className:"h-5 w-5 text-accent"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Extended Recording Add-ons"}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Add-ons"})]}),r.jsx(xr,{className:"text-sm",children:"Purchased via Apple - managed in your Ap
1321ple ID settings."})]})]})}),r.jsxs(lt,{className:"space-y-3",children:[i?r.jsxs("div",{className:"p-3 rounded-lg bg-emerald-500/10 border border-emerald-500/20 flex items-center gap-2",children:[r.jsx(nt,{className:"w-4 h-4 text-emerald-600"}),r.jsx("p",{className:"text-sm text-foreground",children:"60 min recording add-on active"})]}):r.jsxs(r.Fragment,{children:[a?r.jsxs("div",{className:"p-3 rounded-lg bg-emerald-500/10 border border-emerald-500/20 flex items-center gap-2",children:[r.jsx(nt,{className:"w-4 h-4 text-emerald-600"}),r.jsx("p",{className:"text-sm text-foreground",children:"30 min add-on active"})]}):r.jsxs(P,{type:"button",variant:"outline",className:"w-full justify-between h-auto py-3",disabled:n.loading,onClick:()=>t("addon_extended_video_30"),children:[r.jsxs("span",{className:"flex flex-col items-start",children:[r.jsx("span",{className:"text-sm font-semibold",children:"30 min recordings"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Add longer videos"})]}),e==="addon_extended_video_30"?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx("span",{className:"text-sm text-primary font-semibold",children:s.addon_extended_video_30??"Add"})]}),r.jsxs(P,{type:"button",variant:"outline",className:"w-full justify-between h-auto py-3",disabled:n.loading,onClick:()=>t("addon_extended_video_60"),children:[r.jsxs("span",{className:"flex flex-col items-start",children:[r.jsx("span",{className:"text-sm font-semibold",children:"60 min recordings"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:a?"Upgrade from 30 min":"Maximum length"})]}),e==="addon_extended_video_60"?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx("span",{className:"text-sm text-primary font-semibold",children:s.addon_extended_video_60??(a?"Upgrade":"Add")})]})]}),r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsx("button",{type:"button",onClick:()=>n.restore(),disabled:n.loading,className:"text-xs text-muted-foreground underline-offset-2 hover:underline",children:"Restore Purchases"}),r.jsx("button",{type:"button",onClick:n.manageSubscription,className:"text-xs text-primary font-medium",children:"Manage Subscription"})]})]})]})},Iat=()=>{const{goBack:e,navigate:t}=pae("/dashboard"),[n]=iu(),{user:s}=nr(),{isImpersonating:a}=th(),{toast:i}=Gr(),{subscriptionTier:o,isPremium:l,subscriptionEnd:c,trialEnd:d,isTrial:u,openCustomerPortal:m,isGiftedAccount:f,checkSubscription:p}=Jl(),{hasExtendedVideo:x,hasExtendedVideo30:g,hasExtendedVideo60:v,maxVideoDurationMinutes:y,refetchAddons:b}=np(),w=N2(),[S,j]=h.useState(!1),[N,_]=h.useState(!1),[C,k]=h.useState(!1),[E,R]=h.useState(null),[T,D]=h.useState(null),A=h.useRef(!1),V=async K=>{D(K);const Z=await w.purchase(K);D(null),Z.success&&(p(),b())};h.useEffect(()=>{if(!_r()||A.current)return;const K=localStorage.getItem("signup_iap_pending");if(K!=="pro_monthly"&&K!=="pro_annual"||o!=="starter")return;A.current=!0,localStorage.removeItem("signup_iap_pending");const Z=localStorage.getItem("signup_iap_addon");localStorage.removeItem("signup_iap_addon"),(async()=>(await V(K),(Z==="addon_extended_video_30"||Z==="addon_extended_video_60")&&await V(Z)))()},[o]),h.useEffect(()=>{(async()=>{if(!s)return;const{data:Z}=await F.from("team_members").select("team_id").eq("user_id",s.id).limit(1).maybeSingle();if(Z){const{data:q}=await F.from("teams").select("id, owner_id").eq("id",Z.team_id).single();if(q){const{data:H}=await F.from("profiles").select("full_name").eq("user_id",q.owner_id).single();R({teamId:q.id,ownerId:q.owner_id,ownerName:(H==null?void 0:H.full_name)||null,isOwner:q.owner_id===s.id})}}})()},[s]),h.useEffect(()=>{const K=n.get("addon");K==="success"?(i({title:"Add-on activated!",description:"Extended video length has been added to your account."}),b()):K==="cancelled"&&i({title:"Add-on cancelled",description:"You can add extended video length anytime.",variant:"destructive"})},[n,i]);const U=async()=>{if(a){i({title:"View-only mode",description:"Cannot manage billing while viewing as another user.",variant:"destructive"});return}j(!0);try{await m()}catch(K){i({title:"Error",description:K.message||"Failed to open billing portal.",variant:"destructive"})}finally{j(!1)}},O=async K=>{if(!(!s||a)){_(!0);try{const{data:{session:Z}}=await F.auth.getSession();if(!(Z!=null&&Z.access_token))throw new Error("Not authenticated");const{data:q,error:H}
1321=await F.functions.invoke("purchase-addon",{body:{addonType:K},headers:{Authorization:`Bearer ${Z.access_token}`}});if(H)throw H;q!=null&&q.url&&window.open(q.url,"_blank")}catch(Z){i({title:"Error",description:Z.message||"Failed to start checkout.",variant:"destructive"})}finally{_(!1)}}},M=async K=>{if(!(!s||!E||a)){k(!0);try{const Z=K==="extended_video_60"?"60-minute":"30-minute",{data:q}=await F.from("profiles").select("full_name, email").eq("user_id",s.id).single(),H=(q==null?void 0:q.full_name)||(q==null?void 0:q.email)||"A team member",{error:X}=await F.from("notifications").insert({user_id:E.ownerId,type:"addon_request",title:"Extended Video Request",message:`${H} is requesting the ${Z} extended video add-on. You can enable it from Team Management.`,data:{requester_id:s.id,requester_name:H,addon_type:K,team_id:E.teamId}});if(X)throw X;i({title:"Request sent!",description:`Your request for ${Z} video has been sent to your team admin.`})}catch(Z){i({title:"Error",description:Z.message||"Failed to send request.",variant:"destructive"})}finally{k(!1)}}},$=async()=>{if(!(!s||a)){_(!0);try{const{data:{session:K}}=await F.auth.getSession();if(!(K!=null&&K.access_token))throw new Error("Not authenticated");const{data:Z,error:q}=await F.functions.invoke("customer-portal",{headers:{Authorization:`Bearer ${K.access_token}`}});if(q)throw q;Z!=null&&Z.url&&window.open(Z.url,"_blank")}catch(K){i({title:"Error",description:K.message||"Failed to open subscription management.",variant:"destructive"})}finally{_(!1)}}},I=xi[o]||xi.starter,B=lr();return r.jsxs("div",{className:`min-h-screen bg-background ${a?"pt-12":""}`,children:[r.jsx(pn,{}),r.jsxs("div",{className:"px-4 sm:px-6 md:px-8 lg:px-8 py-6 pt-24 space-y-6 max-w-4xl mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Billing"}),u&&d&&r.jsxs("div",{className:"rounded-xl border border-primary/30 bg-primary/10 p-4 flex items-start gap-3",children:[r.jsx(fr,{className:"h-5 w-5 text-primary mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"You're on a 14-day free trial"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your card will be charged on ",new Date(d).toLocaleDateString()," unless you cancel before then."]})]})]}),r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:r.jsx(vi,{className:"h-5 w-5 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Current Plan"}),l&&r.jsx(Se,{variant:"default",className:"text-xs capitalize",children:o}),f&&r.jsx(Se,{variant:"outline",className:"text-xs",children:"Gifted"})]}),r.jsx(xr,{className:"text-sm",children:l?u&&d?`${I.name} plan · Trial ends ${new Date(d).toLocaleDateString()}`:`${I.name} plan${c?` · Renews ${new Date(c).toLocaleDateString()}`:""}`:"Free Starter plan"})]})]})}),r.jsxs(lt,{className:"space-y-3",children:[r.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 pb-2",children:[I.features.slice(0,4).map((K,Z)=>r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500 shrink-0"}),K]},Z)),x&&r.jsxs("p",{className:"flex items-center gap-1.5",children:[r.jsx(nt,{className:"w-3 h-3 text-green-500 shrink-0"}),y," min per video",r.jsx(Se,{variant:"outline",className:"text-[9px] px-1 py-0 ml-1",children:"Add-on"})]})]}),B&&l&&o!=="team"&&!f&&r.jsx(Mat,{pendingSku:T,onPurchase:V}),B&&l&&o==="team"&&r.jsx("div",{className:"text-sm text-muted-foreground bg-muted/50 rounded-lg p-3",children:"Your team plan is managed by your team admin."}),B&&!l&&r.jsx(Dat,{pendingSku:T,onPurchase:V}),!B&&l&&!f&&!(E&&!E.isOwner)&&r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-3",onClick:U,disabled:S,children:[S?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):r.jsx(vi,{className:"h-4 w-4"}),"Manage Billing & Invoices"]}),E&&!E.isOwner&&l&&r.jsxs("div",{className:"text-sm text-muted-foreground bg-muted/50 rounded-lg p-3 flex items-start gap-2",children:[r.jsx(Wa,{className:"w-4 h-4 mt-0.5 shrink-0"}),r.jsxs("span",{children:["Your subscription is managed by your team admin",E.ownerName?` (${E.ownerName})`:"",". Contact them for billing changes."]})]}),(!l||o==="starter")&&!f&&!B&&!(E&&!E.isOwner)&&r.jsxs(P,{className:"w-full justify-between gap-3",onClick:()=>t("/pricing"),children:[r.jsxs("span",{className:"flex items-center gap-3",children:[r.jsx(cT,{className:"h-4 w-4"}),"Upgrade Plan"]}),r.jsx(Se,{variant:"secondary",className:"text-xs bg-primary/20 text-primary border-0",children:"Save more"})]}),o==="professional"&&!f&&!B&&!(E&&!E.isOwner)&&r.jsxs(P,{variant:"outline",className:"w-full justify-start gap-3",onClick:()=>t("/pricing"),children:[r.jsx(cT,{className:"h-4 w-4"}),"Upgrade to Team Plan"]}),l&&o!=="starter"&&!f&&!B&&!(E&&!E.isOwner)&&r.jsxs(P,{variant:"ghost",className:"w-full justify-start gap-3 text-muted-foreground hover:text-foreground",onClick:U,disabled:S,children:[S?r.jsx(Me,{className:"h-4 w-4 animate-spin"}):r.jsx(NL,{className:"h-4 w-4"}),"Change Plan"]})]})]}),!B&&l&&(o==="professional"||o==="team")&&r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:r.jsx(fr,{className:"h-5 w-5 text-accent"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($t,{className:"text-base",children:"Extended Video Length"}),r.jsx(Se,{variant:"secondary",className:"text-xs",children:"Add-ons"})]}),r.jsxs(xr,{className:"text-sm",children:["Current limit: ",y," minutes per video"]})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:`p-4 rounded-lg border ${g&&!v?"border-green-500 bg-green-500/5":"border-border bg-muted/30"}`,children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fr,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"font-medium text-foreground",children:"30 Minute Videos"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-lg font-bold text-foreground",children:"$20"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Extend from 10 to 30 minutes per video"}),g&&!v?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Se,{variant:"default",className:"bg-green-600 hover:bg-green-600 text-white gap-1.5 px-3 py-1.5",children:[r.jsx(nt,{className:"w-4 h-4"}),"Active"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:$,disabled:N,className:"gap-1.5",children:[N?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(bn,{className:"w-4 h-4"}),"Manage / Remove"]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Removing will apply a pro-rated credit to your next invoice."})]}):v?r.jsx(Se,{variant:"outline",className:"text-muted-foreground",children:"Included in 60-min plan"}):E&&!E.isOwner?r.jsxs(P,{size:"sm",variant:"secondary",onClick:()=>M("extended_video_30"),disabled:C,className:"gap-2",children:[C?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(Es,{className:"w-4 h-4"}),"Request from Admin"]}):r.jsxs(P,{size:"sm",onClick:()=>O("extended_video_30"),disabled:N,className:"gap-2",children:[N?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(ya,{className:"w-4 h-4"}),"Add to Plan"]})]}),r.jsxs("div",{className:`p-4 rounded-lg border ${v?"border-green-500 bg-green-500/5":"border-primary/30 bg-primary/5"}`,children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fr,{className:"w-4 h-4 text-primary"}),r.jsx("span",{className:"font-medium text-foreground",children:"60 Minute Videos"}),!v&&r.jsx(Se,{variant:"default",className:"text-xs bg-primary/20 text-primary border-0",children:"Best Value"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-lg font-bold text-foreground",children:"$30"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Extend from 10 to 60 minutes per video"}),v?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Se,{variant:"default",className:"bg-green-600 hover:bg-green-600 text-white gap-1.5 px-3 py-1.5",children:[r.jsx(nt,{className:"w-4 h-4"}),"Active"]}),r.jsxs(P,{variant:"outline",size:"sm",onClick:$,disabled:N,className:"gap-1.5",children:[N?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(bn,{className:"w-4 h-4"}),"Manage / Remove"]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Removing will apply a pro-rated credit to your next invoice."})]}):E&&!E.isOwner?r.jsxs(P,{size:"sm",variant:"secondary",onClick:()=>M("extended_video_60"),disabled:C,className:"gap-2",children:[C?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(Es,{className:"w-4 h-4"}),"Request from Admin"]}):r.jsxs(P,{size:"sm",onClick:()=>O("extended_video_60"),disabled:N,className:"gap-2",children:[N?r.jsx(Me,{className:"w-4 h-4 animate-spin"}):r.jsx(ya,{className:"w-4 h-4"}),"Add to Plan"]})]})]})})]}),!B&&!f&&r.jsx(Pat,{onRedeemed:()=>p()}),l&&!f&&r.jsxs(Ie,{className:"bg-card border-border",children:[r.jsx(Ot,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-muted",children:r.jsx(ql,{className:"h-5 w-5 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx($t,{className:"text-base",children:"Billing & Refund Information"}),r.jsx(xr,{className:"text-sm",children:"How changes to your plan are handled"})]})]})}),r.jsx(lt,{children:r.jsxs("div",{className:"space-y-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("h4",{className:"font-medium text-foreground flex items-center gap-2",children:[r.jsx(vs,{className:"w-4 h-4"}),"Prorations"]}),r.jsxs("ul",{className:"list-disc pl-6 space-y-1",children:[r.jsxs("li",{children:["When you ",r.jsx("strong",{children:"upgrade"})," your plan or add an add-on, you're charged a pro-rated amount for the remainder of your current billing period."]}),r.jsxs("li",{children:["When you ",r.jsx("strong",{children:"downgrade"})," or remove an add-on, you receive a pro-rated credit applied to your next invoice."]}),r.jsx("li",{children:"Changes take effect immediately - you don't have to wait until the next billing cycle."})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("h4",{className:"font-medium text-foreground flex items-center gap-2",children:[r.jsx(vi,{className:"w-4 h-4"}),"Refunds"]}),r.jsxs("ul",{className:"list-disc pl-6 space-y-1",children:[r.jsx("li",{children:"Cancellations are pro-rated - you'll receive a refund for the unused portion of your billing period."}),r.jsx("li",{children:"Annual subscriptions are refunded based on remaining unused months."}),r.jsx("li",{children:"Add-on cancellations are also eligible for pro-rated refunds."}),r.jsx("li",{children:"Refunds are processed within 5–10 business days to your original payment method."})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("h4",{className:"font-medium text-foreground flex items-center gap-2",children:[r.jsx(NL,{className:"w-4 h-4"}),"Account Deletion"]}),r.jsx("p",{children:"If you delete your account, any active subscription and add-ons will be cancelled. You'll receive a pro-rated refund for the remaining time on your plan. All videos and data will be permanently deleted within 30 days."})]}),r.jsxs("p",{className:"text-xs pt-2 border-t border-border",children:["For billing questions or disputes, contact ",r.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]})]})})]})]})]})},Lat=Bl().trim().min(1,"Email is required").email("Please enter a valid email address").max(255,"Email must be less than 255 characters"),$at=()=>{const{user:e,session:t}=nr(),{toast:n}=Gr(),[s,a]=h.useState(null),[i,o]=h.useState([]),[l,c]=h.useState({}
1321),[d,u]=h.useState([]),[m,f]=h.useState(!0),[p,x]=h.useState(!1),[g,v]=h.useState(""),[y,b]=h.useState(null),[w,S]=h.useState(!1),[j,N]=h.useState(!1),[_,C]=h.useState(""),[k,E]=h.useState(!1),[R,T]=h.useState(null),[D,A]=h.useState(!1),[V,U]=h.useState(null),[O,M]=h.useState(null),[$,I]=h.useState(null),[B,K]=h.useState(null),[Z,q]=h.useState("extended_video_30"),[H,X]=h.useState(!1),[G,ee]=h.useState(""),[re,W]=h.useState(!1),Q=(s==null?void 0:s.owner_id)===(e==null?void 0:e.id);h.useEffect(()=>{e&&L()},[e]);const L=async()=>{if(e){f(!0);try{let{data:xe}=await F.from("teams").select("*").eq("owner_id",e.id).single();if(!xe){const{data:Ze}=await F.from("team_members").select("team_id").eq("user_id",e.id).single();if(Ze){const{data:it}=await F.from("teams").select("*").eq("id",Ze.team_id).single();xe=it}}xe&&(a(xe),await te(xe.id),await ae(xe.id),await ne(xe.id))}catch(xe){console.error("Failed to fetch team data:",xe)}finally{f(!1)}}},te=async xe=>{const{data:Ze}=await F.from("team_members").select("*").eq("team_id",xe);if(Ze){const{data:it}=await F.from("profiles").select("user_id, full_name, email, avatar_url, last_active").eq("user_id",e.id).maybeSingle(),{data:ct}=await F.rpc("get_teammate_profiles",{p_user_id:e.id}),Oe=Ze.map(pe=>{let le;if(pe.user_id===e.id)le=it;else{const ke=ct==null?void 0:ct.find(Ee=>Ee.user_id===pe.user_id);le=ke?{...ke,email:null,last_active:ke.last_active??null}:void 0}return{...pe,profile:le}});o(Oe)}},ae=async xe=>{const{data:Ze}=await F.from("team_invitations").select("*").eq("team_id",xe).order("created_at",{ascending:!1});Ze&&u(Ze)},ne=async xe=>{const{data:Ze}=await F.from("team_member_addons").select("user_id, is_active, addon_type").eq("team_id",xe).eq("is_active",!0);if(Ze){const it={};Ze.forEach(ct=>{it[ct.user_id]={is_active:ct.is_active,addon_type:ct.addon_type}}),c(it)}},se=async(xe,Ze)=>{if(!(!s||!(t!=null&&t.access_token))){U(Ze);try{const{data:it,error:ct}=await F.functions.invoke("create-team-addon-checkout",{body:{teamId:s.id,memberUserId:Ze,addonType:Z},headers:{Authorization:`Bearer ${t.access_token}`}});if(ct)throw ct;if(it!=null&&it.error)throw new Error(it.error);it!=null&&it.url&&window.open(it.url,"_blank")}catch(it){n({title:"Error",description:it.message||"Failed to start checkout",variant:"destructive"})}finally{U(null)}}},ue=async()=>{if(!(!s||!$||!(t!=null&&t.access_token))){M($);try{const xe=l[$],{data:Ze,error:it}=await F.functions.invoke("deactivate-team-addon",{body:{teamId:s.id,memberUserId:$,addonType:(xe==null?void 0:xe.addon_type)||void 0},headers:{Authorization:`Bearer ${t.access_token}`}});if(it)throw it;if(Ze!=null&&Ze.error)throw new Error(Ze.error);c(ct=>{const Oe={...ct};return delete Oe[$],Oe}),n({title:"Add-on removed",description:"Extended video add-on has been cancelled and deactivated."})}catch(xe){n({title:"Error",description:xe.message||"Failed to remove add-on",variant:"destructive"})}finally{M(null),I(null)}}},Ne=async()=>{if(!(!e||!_.trim())){E(!0);try{const{data:xe,error:Ze}=await F.from("teams").insert({name:_.trim(),owner_id:e.id}).select().single();if(Ze)throw Ze;await F.from("team_members").insert({team_id:xe.id,user_id:e.id,role:"admin"}),a(xe),N(!1),C(""),n({title:"Team created!",description:"You can now invite team members."}),await te(xe.id)}catch(xe){n({title:"Error",description:xe.message||"Failed to create team",variant:"destructive"})}finally{E(!1)}}},Qe=xe=>{try{return Lat.parse(xe),b(null),!0}catch(Ze){return Ze instanceof Fc&&b(Ze.errors[0].message),!1}},J=xe=>{v(xe),y&&b(null)},de=async()=>{var ct;if(!s||!(t!=null&&t.access_token)||!Qe(g))return;const xe=g.trim().toLowerCase();if(i.find(Oe=>{var pe,le;return((le=(pe=Oe.profile)==null?void 0:pe.email)==null?void 0:le.toLowerCase())===xe})){b("This user is already a team member");return}if(d.find(Oe=>Oe.email.toLowerCase()===xe&&Oe.status==="pending")){b("An invitation has already been sent to this email");return}if(((ct=e==null?void 0:e.email)==null?void 0:ct.toLowerCase())===xe){b("You cannot invite yourself");return}S(!0);try{const{data:Oe,error:pe}=await F.functions.invoke("send-team-invite",{body:{email:xe,teamId:s.id,teamName:s.name},headers:{Authorization:`Bearer ${t.access_token}`}});if(pe)throw pe;if(Oe!=null&&Oe.error)throw new Error(Oe.error);n({title:"Invitation sent!",description:`An invitation has been sent to ${g}`}),x(!1),v(""),b(null),await ae(s.id)}catch(Oe){n({title:"Error",description:Oe.message||"Failed to send invitation",variant:"destructive"})}finally{S(!1)}},ve=async()=>
1321{if(!(!R||!s)){A(!0);try{const xe=i.find(ct=>ct.id===R),{error:Ze}=await F.from("team_members").delete().eq("id",R);if(Ze)throw Ze;const it=i.length-1;if(o(ct=>ct.filter(Oe=>Oe.id!==R)),xe&&l[xe.user_id]&&(c(ct=>{const Oe={...ct};return delete Oe[xe.user_id],Oe}),t!=null&&t.access_token))try{await F.functions.invoke("deactivate-team-addon",{body:{teamId:s.id,memberUserId:xe.user_id},headers:{Authorization:`Bearer ${t.access_token}`}})}catch(ct){console.error("Failed to deactivate addon for removed member:",ct)}if(t!=null&&t.access_token)try{const{data:ct,error:Oe}=await F.functions.invoke("update-team-seats",{body:{teamId:s.id,newQuantity:it},headers:{Authorization:`Bearer ${t.access_token}`}});(Oe||ct!=null&&ct.error)&&(console.error("Failed to update seat count:",Oe||(ct==null?void 0:ct.error)),n({title:"Billing update issue",description:"Member removed but billing may not have been adjusted. Please check your billing settings.",variant:"destructive"}))}catch(ct){console.error("Failed to update seat count:",ct),n({title:"Billing update issue",description:"Member removed but billing may not have been adjusted. Please check your billing settings.",variant:"destructive"})}n({title:"Member removed",description:"Team member has been removed and billing adjusted."})}catch(xe){n({title:"Error",description:xe.message||"Failed to remove member",variant:"destructive"})}finally{A(!1),T(null)}}},Le=async xe=>{try{const{error:Ze}=await F.from("team_invitations").delete().eq("id",xe);if(Ze)throw Ze;u(it=>it.filter(ct=>ct.id!==xe)),n({title:"Invitation cancelled",description:"The invitation has been cancelled."})}catch(Ze){n({title:"Error",description:Ze.message||"Failed to cancel invitation",variant:"destructive"})}},$e=(xe,Ze)=>xe?xe.split(" ").map(it=>it[0]).join("").toUpperCase().slice(0,2):Ze?Ze[0].toUpperCase():"?";if(m)return r.jsx(Ie,{children:r.jsx(lt,{className:"py-12 flex items-center justify-center",children:r.jsx(Me,{className:"w-6 h-6 animate-spin text-primary"})})});if(!s)return r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-5 h-5"}),"Team Management"]}),r.jsx(xr,{children:"Create a team to collaborate with others"})]}),r.jsx(lt,{children:r.jsxs("div",{className:"text-center py-8",children:[r.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-4",children:r.jsx(jr,{className:"w-8 h-8 text-muted-foreground"})}),r.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"No team yet"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Create a team to invite members and collaborate together"}),r.jsxs(P,{onClick:()=>N(!0),children:[r.jsx(Ns,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})}),r.jsx(It,{open:j,onOpenChange:N,children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Create a Team"}),r.jsx($r,{children:"Give your team a name to get started"})]}),r.jsx("div",{className:"space-y-4 py-4",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"teamName",children:"Team Name"}),r.jsx(He,{id:"teamName",placeholder:"e.g., Sales Team",value:_,onChange:xe=>C(xe.target.value)})]})}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),r.jsxs(P,{onClick:Ne,disabled:!_.trim()||k,children:[k?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Create Team"]})]})]})})]});const De=async()=>{if(!s||!G.trim()||G.trim()===s.name){X(!1);return}W(!0);try{const{error:xe}=await F.from("teams").update({name:G.trim()}).eq("id",s.id);if(xe)throw xe;a(Ze=>Ze&&{...Ze,name:G.trim()}),n({title:"Team name updated",description:"Your team name has been saved."})}catch(xe){n({title:"Error",description:xe.message||"Failed to update team name",variant:"destructive"})}finally{W(!1),X(!1)}},oe=d.filter(xe=>xe.status==="pending");return r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{children:[r.jsxs(Ot,{className:"flex flex-row items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-5 h-5"}),H?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(He,{value:G,onChange:xe=>ee(xe.target.value),onKeyDown:xe=>{xe.key==="Enter"&&De(),xe.key==="Escape"&&X(!1)},onBlur:De,autoFocus:!0,className:"h-8 text-base font-semibold w-48",disabled:re}),re&&r.jsx(Me,{className:"w-4 h-4 animate-spin"})]}):r.jsx("span",{className:Q?"cursor-pointer hover:underline decoration-muted-foreground
1321/50":"",onClick:()=>{Q&&(ee(s.name),X(!0))},title:Q?"Click to edit team name":void 0,children:s.name})]}),r.jsxs(xr,{children:[i.length," member",i.length!==1?"s":""," • ",oe.length," pending invitation",oe.length!==1?"s":""]})]}),Q&&r.jsxs(P,{onClick:()=>x(!0),children:[r.jsx(Ns,{className:"w-4 h-4 mr-2"}),"Invite Member"]})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-foreground mb-3",children:"Team Members"}),r.jsx("div",{className:"space-y-2",children:r.jsx(Ts,{children:i.map(xe=>{var Ze,it,ct,Oe,pe,le,ke,Ee,ot,gt;return r.jsxs(fe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:((Ze=xe.profile)==null?void 0:Ze.avatar_url)||void 0}),r.jsx(on,{children:$e((it=xe.profile)==null?void 0:it.full_name,(ct=xe.profile)==null?void 0:ct.email)})]}),r.jsx("span",{className:`absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-background ${xj(((Oe=xe.profile)==null?void 0:Oe.last_active)??null)==="online"?"bg-green-500":xj(((pe=xe.profile)==null?void 0:pe.last_active)??null)==="recent"?"bg-yellow-500":xj(((le=xe.profile)==null?void 0:le.last_active)??null)==="away"?"bg-orange-500":"bg-muted-foreground/50"}`})]}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium text-foreground",children:((ke=xe.profile)==null?void 0:ke.full_name)||((Ee=xe.profile)==null?void 0:Ee.email)||"Unknown"}),r.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1.5",children:[r.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${xj(((ot=xe.profile)==null?void 0:ot.last_active)??null)==="online"?"bg-green-500":"bg-transparent"}`}),Cbe(((gt=xe.profile)==null?void 0:gt.last_active)??null)]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[l[xe.user_id]?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs(Se,{variant:"outline",className:"gap-1 border-primary/50 text-primary",children:[r.jsx(ya,{className:"w-3 h-3"}),"+",l[xe.user_id].addon_type==="extended_video_60"?"60":"30","min"]}),Q&&xe.user_id!==(e==null?void 0:e.id)&&r.jsx(P,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(xe.user_id),disabled:O===xe.user_id,children:O===xe.user_id?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsx(sg,{className:"w-3 h-3"})})]}):Q&&xe.user_id!==(e==null?void 0:e.id)?r.jsxs(P,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>{K(xe.user_id),q("extended_video_30")},disabled:V===xe.user_id,children:[V===xe.user_id?r.jsx(Me,{className:"w-3 h-3 animate-spin"}):r.jsx(ya,{className:"w-3 h-3"}),"Extend Video"]}):null,xe.role==="admin"&&r.jsxs(Se,{variant:"secondary",className:"gap-1",children:[r.jsx(Ms,{className:"w-3 h-3"}),"Admin"]}),Q&&xe.user_id!==(e==null?void 0:e.id)&&r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>T(xe.id),children:r.jsx(eb,{className:"w-4 h-4"})})]})]},xe.id)})})})]}),oe.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-foreground mb-3",children:"Pending Invitations"}),r.jsx("div",{className:"space-y-2",children:oe.map(xe=>r.jsxs("div",{className:"flex items-center justify-between p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/20 flex items-center justify-center",children:r.jsx(zr,{className:"w-5 h-5 text-amber-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium text-foreground",children:xe.email}),r.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[r.jsx(fr,{className:"w-3 h-3"}),"Expires ",new Date(xe.expires_at).toLocaleDateString()]})]})]}),Q&&r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>Le(xe.id),children:r.jsx(sg,{className:"w-4 h-4"})})]},xe.id))})]})]})]}),r.jsx(It,{open:p,onOpenChange:xe=>{x(xe),xe||(v(""),b(null))},children:r.jsxs(Dt,{children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Invite Team Member"}),r.jsx($r,{children:"Send an invitation email to add a new member to your team"})]}),r.jsx("div",{className:"space-y-4 py-4",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(ye,{htmlFor:"email",children:"Email Address"}),r.jsx(He,{id:"email",type:"email",placeholder:"[email protected]",value:g,onChange:xe=>J(xe.target.value),className:y?"border-destructive focus-visible:ring-destructive":""}),y&&r.jsxs("p",{className:"text-sm text-destructive flex items-center gap-1",children:[r.jsx(Im,{className:"w-3 h-3"}),y]})]})}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>{x(!1),v(""),b(null)},children:"Cancel"}),r.jsxs(P,{onClick:de,disabled:!g.trim()||w,children:[w?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):r.jsx(Es,{className:"w-4 h-4 mr-2"}),"Send Invitation"]})]})]})}),r.jsx(cs,{open:!!R,onOpenChange:()=>T(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Remove Team Member?"}),r.jsx(Jn,{children:"This will remove the member from your team. They will lose access to team resources."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsxs(bs,{onClick:ve,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[D?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Remove Member"]})]})]})}),r.jsx(cs,{open:!!$,onOpenChange:()=>I(null),children:r.jsxs(Kn,{children:[r.jsxs(Xn,{children:[r.jsx(Qn,{children:"Remove E
1321xtended Video Add-on?"}),r.jsx(Jn,{children:"This will disable the extended video length for this team member. They will return to the standard 10-minute video length limit."})]}),r.jsxs(Zn,{children:[r.jsx(ds,{children:"Cancel"}),r.jsxs(bs,{onClick:ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[O?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Remove Add-on"]})]})]})}),r.jsx(It,{open:!!B,onOpenChange:xe=>{xe||K(null)},children:r.jsxs(Dt,{className:"sm:max-w-md",children:[r.jsxs(Lt,{children:[r.jsx(Mt,{children:"Extend Video Length"}),r.jsx($r,{children:"Choose the extended video duration for this team member."})]}),r.jsxs("div",{className:"space-y-3 py-4",children:[r.jsxs("button",{type:"button",onClick:()=>q("extended_video_30"),className:`w-full flex items-center justify-between p-4 rounded-lg border-2 transition-colors ${Z==="extended_video_30"?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ya,{className:"w-5 h-5 text-primary"}),r.jsxs("div",{className:"text-left",children:[r.jsx("p",{className:"font-medium text-foreground",children:"30 Minutes"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Extended recording length"})]})]}),r.jsx("span",{className:"font-semibold text-foreground",children:"+$20/mo"})]}),r.jsxs("button",{type:"button",onClick:()=>q("extended_video_60"),className:`w-full flex items-center justify-between p-4 rounded-lg border-2 transition-colors ${Z==="extended_video_60"?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(ya,{className:"w-5 h-5 text-primary"}),r.jsxs("div",{className:"text-left",children:[r.jsx("p",{className:"font-medium text-foreground",children:"60 Minutes"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Maximum recording length"})]})]}),r.jsx("span",{className:"font-semibold text-foreground",children:"+$30/mo"})]})]}),r.jsxs(Fr,{children:[r.jsx(P,{variant:"outline",onClick:()=>K(null),children:"Cancel"}),r.jsxs(P,{onClick:()=>{B&&(se("",B),K(null))},disabled:V===B,children:[V===B?r.jsx(Me,{className:"w-4 h-4 animate-spin mr-2"}):null,"Add to Plan"]})]})]})})]})},Vat=()=>{const{user:e}=nr(),[t,n]=h.useState(!0),[s,a]=h.useState(null),[i,o]=h.useState("");h.useEffect(()=>{e&&l()},[e]);const l=async()=>{if(e){n(!0);try{let m=null;const{data:f}=await F.from("teams").select("id, name").eq("owner_id",e.id).maybeSingle();if(f)m=f.id,o(f.name);else{const{data:j}=await F.from("team_members").select("team_id").eq("user_id",e.id).maybeSingle();if(j){const{data:N}=await F.from("teams").select("id, name").eq("id",j.team_id).maybeSingle();N&&(m=N.id,o(N.name))}}if(!m){n(!1);return}const{data:p}=await F.from("team_members").select("user_id").eq("team_id",m);if(!p||p.length===0){n(!1);return}const x=p.map(j=>j.user_id),{data:g}=await F.from("profiles").select("user_id, full_name, email, avatar_url").eq("user_id",e.id).maybeSingle(),{data:v}=await F.rpc("get_teammate_profiles",{p_user_id:e.id}),y=[];let b=0,w=0,S=0;for(const j of x){let N;if(j===e.id?N=g:N=(v==null?void 0:v.find(C=>C.user_id===j))||null,j===e.id){const{data:_}=await F.from("videos").select("view_count, duration").eq("user_id",j),C=(_==null?void 0:_.length)||0,k=(_==null?void 0:_.reduce((R,T)=>R+(T.view_count||0),0))||0,E=(_==null?void 0:_.reduce((R,T)=>R+(T.duration||0),0))||0;b+=C,w+=k,S+=E,y.push({userId:j,fullName:(N==null?void 0:N.full_name)||null,email:(N==null?void 0:N.email)||null,avatarUrl:(N==null?void 0:N.avatar_url)||null,totalVideos:C,totalViews:k,totalDuration:E})}else y.push({userId:j,fullName:(N==null?void 0:N.full_name)||null,email:null,avatarUrl:(N==null?void 0:N.avatar_url)||null,totalVideos:0,totalViews:0,totalDuration:0})}a({totalVideos:b,totalViews:w,totalDuration:S,avgViewsPerVideo:b>0?Math.round(w/b):0,memberStats:y})}catch(m){console.error("Failed to fetch team analytics:",m)}finally{n(!1)}}},c=m=>{if(m<60)return`${m}s`;if(m<3600)return`${Math.floor(m/60)}m`;const f=Math.floor(m/3600),p=Math.floor(m%3600/60);return`${f}h ${p}m`},d=(m,f)=>m?m.split(" ").map(p=>p[0]).join("").toUpperCase().slice(0,2):f?f[0].toUpperCase():"?",u=h.useMemo(()=>s?Math.max(...s.memberStats.map(m=>m.totalViews),1):0,[s]);return t?r.jsx(Ie,{children:r.jsx(lt,{className:"py-12 flex items-center justify-center",children:r.jsx(Me,{className:"w-6 h-6 animate-spin text-primary"})})}):s?r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(qd,{className:"w-5 h-5"}),"Team Analytics"]}),r.jsxs(xr,{children:["Combined video performance for ",i]})]}),r.jsxs(lt,{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[r.jsx(fe.div,{initial:{opacity:0,y:10}
1321,animate:{opacity:1,y:0},transition:{delay:.1},children:r.jsx(Ie,{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/20",children:r.jsx(lt,{className:"pt-4 pb-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-primary/20",children:r.jsx(bi,{className:"w-5 h-5 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.totalVideos}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Videos"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2},children:r.jsx(Ie,{className:"bg-gradient-to-br from-accent/10 to-accent/5 border-accent/20",children:r.jsx(lt,{className:"pt-4 pb-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-accent/20",children:r.jsx(wr,{className:"w-5 h-5 text-accent-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.totalViews}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Views"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:r.jsx(Ie,{className:"bg-gradient-to-br from-secondary/20 to-secondary/10 border-secondary/30",children:r.jsx(lt,{className:"pt-4 pb-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-secondary/30",children:r.jsx(Po,{className:"w-5 h-5 text-secondary-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.avgViewsPerVideo}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg. Views"})]})]})})})}),r.jsx(fe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4},children:r.jsx(Ie,{className:"bg-gradient-to-br from-muted to-muted/50 border-muted-foreground/20",children:r.jsx(lt,{className:"pt-4 pb-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-muted-foreground/20",children:r.jsx(fr,{className:"w-5 h-5 text-muted-foreground"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-bold text-foreground",children:c(s.totalDuration)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Duration"})]})]})})})})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(jr,{className:"w-4 h-4"}),"Member Performance"]}),r.jsx("div",{className:"space-y-3",children:s.memberStats.map((m,f)=>r.jsxs(fe.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.1},className:"flex items-center gap-4 p-3 bg-muted/30 rounded-lg",children:[r.jsxs(an,{className:"h-10 w-10",children:[r.jsx(gn,{src:m.avatarUrl||void 0}),r.jsx(on,{children:d(m.fullName,m.email)})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("p",{className:"font-medium text-foreground truncate",children:[m.fullName||m.email||"No activity yet",m.userId===(e==null?void 0:e.id)&&r.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:"(you)"})]}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(bi,{className:"w-3 h-3"}),m.totalVideos]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(wr,{className:"w-3 h-3"}),m.totalViews]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Js,{className:"w-3 h-3"}),c(m.totalDuration)]})]})]}),r.jsx(Lc,{value:m.totalViews/u*100,className:"h-2"})]})]},m.userId))})]}),s.memberStats.some(m=>m.userId!==(e==null?void 0:e.id)&&m.totalVideos===0)&&r.jsx("p",{className:"text-xs text-muted-foreground text-center pt-2",children:"Note: Full team statistics require admin access. Currently showing your personal stats."})]})]}):r.jsx(Ie,{children:r.jsxs(lt,{className:"py-12 text-center",children:[r.jsx(jr,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"No team found. Create or join a team to see analytics."})]})})},Uat=()=>{const{isImpersonating:e}=th(),t=lr();return r.jsxs("div",{className:`min-h-screen bg-background ${e?"pt-12":""}`,children:[r.jsx(pn,{}),r.jsxs("div",{className:"px-4 sm:px-6 md:px-8 lg:px-8 py-6 pt-24 space-y-6 max-w-4xl mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Team Management"}),t?r.jsxs(Ie,{children:[r.jsxs(Ot,{children:[r.jsxs($t,{className:"flex items-center gap-2",children:[r.jsx(jr,{className:"w-5 h-5"}),"Team plans are managed on the web"]}),r.jsx(xr,{children:"VIDAREO Team is an enterprise service sold directly to organizations. Team membership and shared content are managed outside the app."})]}),r.jsx(lt,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Once your organization's administrator has added you to a team, your team membership and shared content will automatically appear in this app."})})]}):r.jsxs(r.Fragment,{children:[r.jsx($at,{}),r.jsx(Vat,{})]})]})]})},Fat=()=>{const{pathname:e}=ja();return h.useEffect(()=>{window.scrollTo(0,0)},[e]),null},Bat=new Npe,zat=({children:e})=>{_be(),Ebe();const{showWarning:t,secondsLeft:n,continueSession:s}=Rbe();return r.jsxs(r.Fragment,{children:[e,r.jsx(D0e,{open:t,secondsLeft:n,onContinue:s})]})},qat=({children:e})=>(I0e(),V0e(),B0e(),z0e(),q0e(),H0e(),W0e(),r.jsx(r.Fragment,{children:e})),Hat={"/dashboard":"dashboard","/videos":"videos","/analytics":"analytics","/meet":"meet","/contacts":"contacts","/settings":"settings","/profile":"profile","/mail":"mail"},Wat=()=>{const e=ja(),t=Hat[e.pathname]||null;return r.jsx(SCe,{tourId:t,autoStart:!0})},Yat=()=>r.jsx(Epe,{client:Bat,children:r.jsx(Pme,{attribute:"class",defaultTheme:"light",enableSystem:!1,children:r.jsx(Bye,{children:r.jsx(zye,{children:r.jsx(qye,{children:r.jsx(abe,{children:r.jsx(zat,{children:r.jsxs(ys,{children:[r.jsx(wbe,{}),r.jsx(Ame,{}),r.jsx(mhe,{}),r.jsx(jbe,{}),r.jsx(Lxe,{children:r.jsxs(CCe,{children:[r.jsx(Fat,{}),r.jsxs(qat,{children:[r.jsx(tCe,{}),r.jsx(Wat,{}),r.jsx(_Ce,{}),r.jsxs(Exe,{children:[r.jsx(dr,{path:"/",element:r.jsx(DAe,{})}),r.jsx(dr,{path:"/auth",element:r.jsx(wet,{})}),r.jsx(dr,{path:"/reset-password",element:r.jsx(jet,{})}),r.jsx(dr,{path:"/dashboard",element:r.jsx(qi,{children:r.jsx(mnt,{})})}),r.jsx(dr,{path:"/camera-test",element:r.jsx(qi,{children:r.jsx(UAe,{})})}),r.jsx(dr,{path:"/videos",element:r.jsx(qi,{children:r.jsx(xJe,{})})}),r.jsx(dr,{path:"/record",element:r.jsx(qi,{children:r.jsx(gJe,{})})}),r.jsx(dr,{path:"/analytics",element:r.jsx(qi,{children:r.jsx(vJe,{})})}),r.jsx(dr,{path:"/mail",element:r.jsx(qi,{children:r.jsx(wnt,{})})}),r.jsx(dr,{path:"/contacts",element:r.jsx(qi,{children:r.jsx(Nnt,{})})}),r.jsx(dr,{path:"/profile",element:r.jsx(qi,{children:r.jsx(UJe,{})})}),r.jsx(dr,{path:"/settings",element:r.jsx($Je,{})}),r.jsx(dr,{path:"/billing",element:r.jsx(qi,{children:r.jsx(Iat,{})})}),r.jsx(dr,{path:"/team",element:r.jsx(qi,{children:r.jsx(Uat,{})})}),r.jsx(dr,{path:"/v/:token",element:r.jsx(Ret,{})}),r.jsx(dr,{path:"/share/:token",element:r.jsx(bz,{})}),r.jsx(dr,{path:"/watch/:token",element:r.jsx(bz,{})}
1321),r.jsx(dr,{path:"/watch-ended",element:r.jsx(Tet,{})}),r.jsx(dr,{path:"/embed/:token",element:r.jsx(Crt,{})}),r.jsx(dr,{path:"/invite/:token",element:r.jsx(Oet,{})}),r.jsx(dr,{path:"/terms",element:r.jsx(xtt,{})}),r.jsx(dr,{path:"/privacy",element:r.jsx(gtt,{})}),r.jsx(dr,{path:"/contact",element:r.jsx(qtt,{})}),r.jsx(dr,{path:"/pricing",element:r.jsx(Wtt,{})}),r.jsx(dr,{path:"/features",element:r.jsx(Qtt,{})}),r.jsx(dr,{path:"/how-it-works",element:r.jsx(art,{})}),r.jsx(dr,{path:"/faq",element:r.jsx(brt,{})}),r.jsx(dr,{path:"/about",element:r.jsx(Irt,{})}),r.jsx(dr,{path:"/accessibility",element:r.jsx(Lrt,{})}),r.jsx(dr,{path:"/delete-account",element:r.jsx(Vrt,{})}),r.jsx(dr,{path:"/store-assets",element:r.jsx(qi,{children:r.jsx(Frt,{})})}),r.jsx(dr,{path:"/editor/:videoId",element:r.jsx(qi,{children:r.jsx(Xrt,{})})}),r.jsx(dr,{path:"/use-cases",element:r.jsx(wrt,{})}),r.jsx(dr,{path:"/use-cases/:slug",element:r.jsx(jrt,{})}),r.jsx(dr,{path:"/products",element:r.jsx(Srt,{})}),r.jsx(dr,{path:"/products/:slug",element:r.jsx(_rt,{})}),r.jsx(dr,{path:"/loom-alternative",element:r.jsx(kh,{})}
1321),r.jsx(dr,{path:"/vidareo-vs-bombbomb",element:r.jsx(kh,{})}),r.jsx(dr,{path:"/vidareo-vs-vidyard",element:r.jsx(kh,{})}),r.jsx(dr,{path:"/vidareo-vs-sendspark",element:r.jsx(kh,{})}),r.jsx(dr,{path:"/async-video-messaging",element:r.jsx(kh,{})}),r.jsx(dr,{path:"/screen-recorder-with-teleprompter",element:r.jsx(kh,{})}),r.jsx(dr,{path:"/personalized-video-messaging",element:r.jsx(kh,{})}),!_r()&&r.jsxs(r.Fragment,{children:[r.jsx(dr,{path:"/meet",element:r.jsx(qi,{children:r.jsx(fat,{})})}),r.jsx(dr,{path:"/meet/:roomCode",element:r.jsx(kat,{})}),r.jsx(dr,{path:"/join",element:r.jsx(Rat,{})}),r.jsx(dr,{path:"/rsvp",element:r.jsx(Oat,{})})]}),r.jsx(dr,{path:"/admin",element:r.jsx(qi,{children:r.jsx(ptt,{})})}),r.jsx(dr,{path:"*",element:r.jsx(krt,{})})]})]})]})})]})})})})})})})}),Jz=e=>{if(e==null)return"No error object was provided to the error boundary.";if(e instanceof Error)return`${e.name}: ${e.message}
1322
1323${e.stack??"No stack available"}`;try{return`Non-Error thrown:
1324${JSON.stringify(e,Object.getOwnPropertyNames(e),2)}`}catch{return`Non-Error thrown:
1325${String(e)}`}};class Gat extends Y.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",Jz(t),n)}render(){return this.state.hasError?r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background text-foreground p-8",children:[r.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Something went wrong"}),r.jsx("p",{className:"text-muted-foreground mb-4 text-center max-w-md",children:"An unexpected error occurred. Please try refreshing the page."}),r.jsx("div",{className:"mb-3 rounded-lg border border-primary/20 bg-primary/10 px-3 py-2 text-xs font-medium text-primary",children:"Native debug build: 2026-05-06-B"}),r.jsx("pre",{className:"text-xs text-left bg-muted p-3 rounded-lg max-w-md overflow-auto mb-6 whitespace-pre-wrap break-words max-h-64",children:Jz(this.state.error)}),r.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Refresh Page"})]}):this.props.children}}const Eh=typeof window<"u"?window:void 0;var d9,u9;if(Eh&&(!!(Eh.androidBridge||(u9=(d9=Eh.webkit)==null?void 0:d9.messageHandlers)!=null&&u9.bridge)||Eh.Capacitor)){const t=Eh.Capacitor??(Eh.Capacitor={});typeof t.createEvent!="function"&&(t.createEvent=(n,s={})=>{const a=document.createEvent("Events");return a.initEvent(n,!1,!1),Object.entries(s).forEach(([i,o])=>{try{Object.defineProperty(a,i,{value:o,configurable:!0})}catch{}}),a}),typeof t.triggerEvent!="function"&&(t.triggerEvent=(n,s,a={})=>{var l;const i=(l=t.createEvent)==null?void 0:l.call(t,n,a);if(!i)return!1;if(s==="document")return document.dispatchEvent(i);if(s==="window")return Eh.dispatchEvent(i);const o=document.querySelector(s);return o?o.dispatchEvent(i):!1})}const j3=()=>{var n,s,a,i,o;const e=window,t=e.Capacitor;return!!(((n=t==null?void 0:t.isNativePlatform)==null?void 0:n.call(t))===!0||((s=t==null?void 0:t.getPlatform)==null?void 0:s.call(t))==="ios"||((a=t==null?void 0:t.getPlatform)==null?void 0:a.call(t))==="android"||window.location.protocol==="capacitor:"||e.androidBridge||(o=(i=e.webkit)==null?void 0:i.messageHandlers)!=null&&o.bridge)};if(typeof window<"u"&&!j3()&&window.location.hostname==="www.vidareo.com"){const e=`https://vidareo.com${window.location.pathname}${window.location.search}${window.location.hash}`;window.location.replace(e)}j3()&&"caches"in window&&caches.keys().then(e=>e.forEach(t=>caches.delete(t)));window.addEventListener("unhandledrejection",e=>{console.error("Unhandled promise rejection:",e.reason),e.preventDefault()});!j3()&&"serviceWorker"in navigator&&navigator.serviceWorker.register("/push-sw.js").then(e=>console.log("Push SW registered:",e.scope)).catch(e=>console.error("Push SW registration failed:",e));nde.createRoot(document.getElementById("root")).render(r.jsx(h.StrictMode,{children:r.jsx(Gat,{children:r.jsx(Yat,{})})}));export{s5 as W,Si as _,eit as a,pc as b,zw as c,qxe as d,tit as e,Hxe as f,Mn as g,xw as r};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.