PageSourceSearch

https://socialmonkey.ai/assets/index-X8H9l-on.js

js socialmonkey.ai collected 2026-10-05 15:07:51 UTC 1,381,052 bytes, 655 lines download raw bytes

vendor: 6,204 bytes, lines 1-9
1var cM=Object.defineProperty;var Ib=e=>{throw TypeError(e)};var dM=(e,s,r)=>s in e?cM(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r;var V=(e,s,r)=>dM(e,typeof s!="symbol"?s+"":s,r),Vf=(e,s,r)=>s.has(e)||Ib("Cannot "+r);var z=(e,s,r)=>(Vf(e,s,"read from private field"),r?r.call(e):s.get(e)),Je=(e,s,r)=>s.has(e)?Ib("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,r),ze=(e,s,r,n)=>(Vf(e,s,"write to private field"),n?n.call(e,r):s.set(e,r),r),ht=(e,s,r)=>(Vf(e,s,"access private method"),r);var bm=(e,s,r,n)=>({set _(a){ze(e,s,a,r)},get _(){return z(e,s,n)}});function uM(e,s){for(var r=0;r<s.length;r++){const n=s[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(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"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function qk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wk={exports:{}},Mp={},Kk={exports:{}},vt={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Wu=Symbol.for("react.element"),mM=Symbol.for("react.portal"),hM=Symbol.for("react.fragment"),pM=Symbol.for("react.strict_mode"),fM=Symbol.for("react.profiler"),xM=Symbol.for("react.provider"),gM=Symbol.for("react.context"),yM=Symbol.for("react.forward_ref"),vM=Symbol.for("react.suspense"),bM=Symbol.for("react.memo"),jM=Symbol.for("react.lazy"),Mb=Symbol.iterator;function wM(e){return e===null||typeof e!="object"?null:(e=Mb&&e[Mb]||e["@@iterator"],typeof e=="function"?e:null)}var Gk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hk=Object.assign,Qk={};function Wc(e,s,r){this.props=e,this.context=s,this.refs=Qk,this.updater=r||Gk}Wc.prototype.isReactComponent={};Wc.prototype.setState=function(e,s){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,s,"setState")};Wc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yk(){}Yk.prototype=Wc.prototype;function qy(e,s,r){this.props=e,this.context=s,this.refs=Qk,this.updater=r||Gk}var Wy=qy.prototype=new Yk;Wy.constructor=qy;Hk(Wy,Wc.prototype);Wy.isPureReactComponent=!0;var Rb=Array.isArray,Xk=Object.prototype.hasOwnProperty,Ky={current:null},Zk={key:!0,ref:!0,__self:!0,__source:!0};function Jk(e,s,r){var n,a={},i=null,o=null;if(s!=null)for(n in s.ref!==void 0&&(o=s.ref),s.key!==void 0&&(i=""+s.key),s)Xk.call(s,n)&&!Zk.hasOwnProperty(n)&&(a[n]=s[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Wu,type:e,key:i,ref:o,props:a,_owner:Ky.current}}function NM(e,s){return{$$typeof:Wu,type:e.type,key:s,ref:e.ref,props:e.props,_owner:e._owner}}function Gy(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wu}function kM(e){var s={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return s[r]})}var Fb=/\/+/g;function Bf(e,s){return typeof e=="object"&&e!==null&&e.key!=null?kM(""+e.key):s.toString(36)}function Jm(e,s,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Wu:case mM:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+Bf(o,0):n,Rb(a)?(r="",e!=null&&(r=e.replace(Fb,"$&/")+"/"),Jm(a,s,r,"",function(d){return d})):a!=null&&(Gy(a)&&(a=NM(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Fb,"$&/")+"/")+e)),s.push(a)),1;if(o=0,n=n===""?".":n+":",Rb(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Bf(i,l);o+=Jm(i,s,r,c,a)}else if(c=wM(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Bf(i,l++),o+=Jm(i,s,r,c,a);else if(i==="object")throw s=String(e),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.");return o}function jm(e,s,r){if(e==null)return e;var n=[],a=0;return Jm(e,n,"","",function(i){return s.call(r,i,a++)}),n}function SM(e){if(e._status===-1){var s=e._result;s=s(),s.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=s)}if(e._status===1)return e._result.default;throw e._result}var vr={current:null},eh={transition:null},CM={ReactCurrentDispatcher:vr,ReactCurrentBatchConfig:eh,ReactCurrentOwner:Ky};function eS(){throw Error("act(...) is not supported in production builds of React.")}vt.Children={map:jm,forEach:function(e,s,r){jm(e,function(){s.apply(this,arguments)},r)},count:function(e){var s=0;return jm(e,function(){s++}),s},toArray:function(e){return jm(e,function(s){return s})||[]},only:function(e){if(!Gy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};vt.Component=Wc;
vendor: 4,986 bytes, lines 9-25
9vt.Fragment=hM;vt.Profiler=fM;vt.PureComponent=qy;vt.StrictMode=pM;vt.Suspense=vM;vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CM;vt.act=eS;vt.cloneElement=function(e,s,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Hk({},e.props),a=e.key,i=e.ref,o=e._owner;if(s!=null){if(s.ref!==void 0&&(i=s.ref,o=Ky.current),s.key!==void 0&&(a=""+s.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in s)Xk.call(s,c)&&!Zk.hasOwnProperty(c)&&(n[c]=s[c]===void 0&&l!==void 0?l[c]:s[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:Wu,type:e.type,key:a,ref:i,props:n,_owner:o}};vt.createContext=function(e){return e={$$typeof:gM,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xM,_context:e},e.Consumer=e};vt.createElement=Jk;vt.createFactory=function(e){var s=Jk.bind(null,e);return s.type=e,s};vt.createRef=function(){return{current:null}};vt.forwardRef=function(e){return{$$typeof:yM,render:e}};vt.isValidElement=Gy;vt.lazy=function(e){return{$$typeof:jM,_payload:{_status:-1,_result:e},_init:SM}};vt.memo=function(e,s){return{$$typeof:bM,type:e,compare:s===void 0?null:s}};vt.startTransition=function(e){var s=eh.transition;eh.transition={};try{e()}finally{eh.transition=s}};vt.unstable_act=eS;vt.useCallback=function(e,s){return vr.current.useCallback(e,s)};vt.useContext=function(e){return vr.current.useContext(e)};vt.useDebugValue=function(){};vt.useDeferredValue=function(e){return vr.current.useDeferredValue(e)};vt.useEffect=function(e,s){return vr.current.useEffect(e,s)};vt.useId=function(){return vr.current.useId()};vt.useImperativeHandle=function(e,s,r){return vr.current.useImperativeHandle(e,s,r)};vt.useInsertionEffect=function(e,s){return vr.current.useInsertionEffect(e,s)};vt.useLayoutEffect=function(e,s){return vr.current.useLayoutEffect(e,s)};vt.useMemo=function(e,s){return vr.current.useMemo(e,s)};vt.useReducer=function(e,s,r){return vr.current.useReducer(e,s,r)};vt.useRef=function(e){return vr.current.useRef(e)};vt.useState=function(e){return vr.current.useState(e)};vt.useSyncExternalStore=function(e,s,r){return vr.current.useSyncExternalStore(e,s,r)};vt.useTransition=function(){return vr.current.useTransition()};vt.version="18.3.1";Kk.exports=vt;var m=Kk.exports;const Ve=qk(m),tS=uM({__proto__:null,default:Ve},[m]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var PM=m,TM=Symbol.for("react.element"),AM=Symbol.for("react.fragment"),_M=Object.prototype.hasOwnProperty,EM=PM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IM={key:!0,ref:!0,__self:!0,__source:!0};function sS(e,s,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),s.key!==void 0&&(i=""+s.key),s.ref!==void 0&&(o=s.ref);for(n in s)_M.call(s,n)&&!IM.hasOwnProperty(n)&&(a[n]=s[n]);if(e&&e.defaultProps)for(n in s=e.defaultProps,s)a[n]===void 0&&(a[n]=s[n]);return{$$typeof:TM,type:e,key:i,ref:o,props:a,_owner:EM.current}}Mp.Fragment=AM;Mp.jsx=sS;Mp.jsxs=sS;Wk.exports=Mp;var t=Wk.exports,rS={exports:{}},tn={},nS={exports:{}},aS={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function s(I,F){var E=I.length;I.push(F);e:for(;0<E;){var ne=E-1>>>1,U=I[ne];if(0<a(U,F))I[ne]=F,I[E]=U,E=ne;else break e}}function r(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var F=I[0],E=I.pop();if(E!==F){I[0]=E;e:for(var ne=0,U=I.length,Ae=U>>>1;ne<Ae;){var G=2*(ne+1)-1,Q=I[G],ye=G+1,le=I[ye];if(0>a(Q,E))ye<U&&0>a(le,Q)?(I[ne]=le,I[ye]=E,ne=ye):(I[ne]=Q,I[G]=E,ne=G);else if(ye<U&&0>a(le,E))I[ne]=le,I[ye]=E,ne=ye;else break e}}return F}function a(I,F){var E=I.sortIndex-F.sortIndex;return E!==0?E:I.id-F.id}if(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,h=null,p=3,x=!1,v=!1,f=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(I){for(var F=r(d);F!==null;){if(F.callback===null)n(d);else if(F.startTime<=I)n(d),F.sortIndex=F.expirationTime,s(c,F);else break;F=r(d)}}function N(I){if(f=!1,j(I),!v)if(r(c)!==null)v=!0,W(w);else{var F=r(d);
vendor: 9,331 bytes, lines 25-34
25F!==null&&q(N,F.startTime-I)}}function w(I,F){v=!1,f&&(f=!1,y(P),P=-1),x=!0;var E=p;try{for(j(F),h=r(c);h!==null&&(!(h.expirationTime>F)||I&&!_());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,p=h.priorityLevel;var U=ne(h.expirationTime<=F);F=e.unstable_now(),typeof U=="function"?h.callback=U:h===r(c)&&n(c),j(F)}else n(c);h=r(c)}if(h!==null)var Ae=!0;else{var G=r(d);G!==null&&q(N,G.startTime-F),Ae=!1}return Ae}finally{h=null,p=E,x=!1}}var S=!1,k=null,P=-1,A=5,$=-1;function _(){return!(e.unstable_now()-$<A)}function O(){if(k!==null){var I=e.unstable_now();$=I;var F=!0;try{F=k(!0,I)}finally{F?M():(S=!1,k=null)}}else S=!1}var M;if(typeof g=="function")M=function(){g(O)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,L=C.port2;C.port1.onmessage=O,M=function(){L.postMessage(null)}}else M=function(){b(O,0)};function W(I){k=I,S||(S=!0,M())}function q(I,F){P=b(function(){I(e.unstable_now())},F)}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(I){I.callback=null},e.unstable_continueExecution=function(){v||x||(v=!0,W(w))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(I){switch(p){case 1:case 2:case 3:var F=3;break;default:F=p}var E=p;p=F;try{return I()}finally{p=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,F){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var E=p;p=I;try{return F()}finally{p=E}},e.unstable_scheduleCallback=function(I,F,E){var ne=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?ne+E:ne):E=ne,I){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=E+U,I={id:u++,callback:F,priorityLevel:I,startTime:E,expirationTime:U,sortIndex:-1},E>ne?(I.sortIndex=E,s(d,I),r(c)===null&&I===r(d)&&(f?(y(P),P=-1):f=!0,q(N,E-ne))):(I.sortIndex=U,s(c,I),v||x||(v=!0,W(w))),I},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(I){var F=p;return function(){var E=p;p=F;try{return I.apply(this,arguments)}finally{p=E}}}})(aS);nS.exports=aS;var MM=nS.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var RM=m,en=MM;function Ne(e){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)s+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var iS=new Set,Gd={};function il(e,s){kc(e,s),kc(e+"Capture",s)}function kc(e,s){for(Gd[e]=s,e=0;e<s.length;e++)iS.add(s[e])}var Ja=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jx=Object.prototype.hasOwnProperty,FM=/^[: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]*$/,Db={},Lb={};function DM(e){return Jx.call(Lb,e)?!0:Jx.call(Db,e)?!1:FM.test(e)?Lb[e]=!0:(Db[e]=!0,!1)}function LM(e,s,r,n){if(r!==null&&r.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function OM(e,s,r,n){if(s===null||typeof s>"u"||LM(e,s,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function br(e,s,r,n,a,i,o){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=s,this.sanitizeURL=i,this.removeEmptyString=o}var er={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){er[e]=new br(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var s=e[0];er[s]=new br(s,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){er[e]=new br(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){er[e]=new br(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){er[e]=new br(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){er[e]=new br(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){er[e]=new br(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){er[e]=new br(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){er[e]=new br(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hy=/[\-:]([a-z])/g;function Qy(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var s=e.replace(Hy,Qy);er[s]=new br(s,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var s=e.replace(Hy,Qy);er[s]=new br(s,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var s=e.replace(Hy,Qy);er[s]=new br(s,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){er[e]=new br(e,1,!1,e.toLowerCase(),null,!1,!1)});er.xlinkHref=new br("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){er[e]=new br(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yy(e,s,r,n){var a=er.hasOwnProperty(s)?er[s]:null;(a!==null?a.type!==0:n||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(OM(s,r,a,n)&&(r=null),n||a===null?DM(s)&&(r===null?e.removeAttribute(s):e.setAttribute(s,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(s=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(s):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,s,r):e.setAttribute(s,r))))}var ui=RM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wm=Symbol.for("react.element"),Pl=Symbol.for("react.portal"),Tl=Symbol.for("react.fragment"),Xy=Symbol.for("react.strict_mode"),eg=Symbol.for("react.profiler"),oS=Symbol.for("react.provider"),lS=Symbol.for("react.context"),Zy=Symbol.for("react.forward_ref"),tg=Symbol.for("react.suspense"),sg=Symbol.for("react.suspense_list"),Jy=Symbol.for("react.memo"),Ni=Symbol.for("react.lazy"),cS=Symbol.for("react.offscreen"),Ob=Symbol.iterator;function dd(e){return e===null||typeof e!="object"?null:(e=Ob&&e[Ob]||e["@@iterator"],typeof e=="function"?e:null)}var ls=Object.assign,qf;function Sd(e){if(qf===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);qf=s&&s[1]||""}return`
34`+qf+e}var Wf=!1;function Kf(e,s){if(!e||Wf)return"";Wf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(d){var n=d}Reflect.construct(e,[],s)}else{try{s.call()}catch(d){n=d}e.call(s.prototype)}else{try{throw Error()}catch(d){n=d}e()}}
vendor: 14,106 bytes, lines 34-37
34catch(d){if(d&&n&&typeof d.stack=="string"){for(var a=d.stack.split(`
35`),i=n.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Wf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Sd(e):""}function $M(e){switch(e.tag){case 5:return Sd(e.type);case 16:return Sd("Lazy");case 13:return Sd("Suspense");case 19:return Sd("SuspenseList");case 0:case 2:case 15:return e=Kf(e.type,!1),e;case 11:return e=Kf(e.type.render,!1),e;case 1:return e=Kf(e.type,!0),e;default:return""}}function rg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tl:return"Fragment";case Pl:return"Portal";case eg:return"Profiler";case Xy:return"StrictMode";case tg:return"Suspense";case sg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lS:return(e.displayName||"Context")+".Consumer";case oS:return(e._context.displayName||"Context")+".Provider";case Zy:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jy:return s=e.displayName||null,s!==null?s:rg(e.type)||"Memo";case Ni:s=e._payload,e=e._init;try{return rg(e(s))}catch{}}return null}function zM(e){var s=e.type;switch(e.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=s.render,e=e.displayName||e.name||"",s.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rg(s);case 8:return s===Xy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Qi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var s=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function UM(e){var s=dS(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,s),n=""+e[s];if(!e.hasOwnProperty(s)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,s,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,s,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[s]}}}}function Nm(e){e._valueTracker||(e._valueTracker=UM(e))}function uS(e){if(!e)return!1;var s=e._valueTracker;if(!s)return!0;var r=s.getValue(),n="";return e&&(n=dS(e)?e.checked?"true":"false":e.value),e=n,e!==r?(s.setValue(e),!0):!1}function Nh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ng(e,s){var r=s.checked;return ls({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function $b(e,s){var r=s.defaultValue==null?"":s.defaultValue,n=s.checked!=null?s.checked:s.defaultChecked;r=Qi(s.value!=null?s.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function mS(e,s){s=s.checked,s!=null&&Yy(e,"checked",s,!1)}function ag(e,s){mS(e,s);var r=Qi(s.value),n=s.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}s.hasOwnProperty("value")?ig(e,s.type,r):s.hasOwnProperty("defaultValue")&&ig(e,s.type,Qi(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(e.defaultChecked=!!s.defaultChecked)}function zb(e,s,r){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var n=s.type;if(!(n!=="submit"&&n!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+e._wrapperState.initialValue,r||s===e.value||(e.value=s),e.defaultValue=s}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ig(e,s,r){(s!=="number"||Nh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Cd=Array.isArray;function Ul(e,s,r,n){if(e=e.options,s){s={};for(var a=0;a<r.length;a++)s["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=s.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Qi(r),s=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}s!==null||e[a].disabled||(s=e[a])}s!==null&&(s.selected=!0)}}function og(e,s){if(s.dangerouslySetInnerHTML!=null)throw Error(Ne(91));return ls({},s,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ub(e,s){var r=s.value;if(r==null){if(r=s.children,s=s.defaultValue,r!=null){if(s!=null)throw Error(Ne(92));if(Cd(r)){if(1<r.length)throw Error(Ne(93));r=r[0]}s=r}s==null&&(s=""),r=s}e._wrapperState={initialValue:Qi(r)}}function hS(e,s){var r=Qi(s.value),n=Qi(s.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),s.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Vb(e){var s=e.textContent;s===e._wrapperState.initialValue&&s!==""&&s!==null&&(e.value=s)}function pS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lg(e,s){return e==null||e==="http://www.w3.org/1999/xhtml"?pS(s):e==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var km,fS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(s,r,n,a)})}:e}(function(e,s){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=s;else{for(km=km||document.createElement("div"),km.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=km.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;s.firstChild;)e.appendChild(s.firstChild)}});function Hd(e,s){if(s){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=s;return}}e.textContent=s}var Md={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},VM=["Webkit","ms","Moz","O"];Object.keys(Md).forEach(function(e){VM.forEach(function(s){s=s+e.charAt(0).toUpperCase()+e.substring(1),Md[s]=Md[e]})});function xS(e,s,r){return s==null||typeof s=="boolean"||s===""?"":r||typeof s!="number"||s===0||Md.hasOwnProperty(e)&&Md[e]?(""+s).trim():s+"px"}function gS(e,s){e=e.style;for(var r in s)if(s.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=xS(r,s[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var BM=ls({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cg(e,s){if(s){if(BM[e]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(Ne(137,e));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(Ne(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(Ne(61))}if(s.style!=null&&typeof s.style!="object")throw Error(Ne(62))}}function dg(e,s){if(e.indexOf("-")===-1)return typeof s.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ug=null;function e0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mg=null,Vl=null,Bl=null;function Bb(e){if(e=Hu(e)){if(typeof mg!="function")throw Error(Ne(280));var s=e.stateNode;s&&(s=Op(s),mg(e.stateNode,e.type,s))}}function yS(e){Vl?Bl?Bl.push(e):Bl=[e]:Vl=e}function vS(){if(Vl){var e=Vl,s=Bl;if(Bl=Vl=null,Bb(e),s)for(e=0;e<s.length;e++)Bb(s[e])}}function bS(e,s){return e(s)}function jS(){}var Gf=!1;function wS(e,s,r){if(Gf)return e(s,r);Gf=!0;try{return bS(e,s,r)}finally{Gf=!1,(Vl!==null||Bl!==null)&&(jS(),vS())}}function Qd(e,s){var r=e.stateNode;if(r===null)return null;var n=Op(r);if(n===null)return null;r=n[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Ne(231,s,typeof r));return r}var hg=!1;if(Ja)try{var ud={};Object.defineProperty(ud,"passive",{get:function(){hg=!0}}),window.addEventListener("test",ud,ud),window.removeEventListener("test",ud,ud)}catch{hg=!1}function qM(e,s,r,n,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{s.apply(r,d)}catch(u){this.onError(u)}}var Rd=!1,kh=null,Sh=!1,pg=null,WM={onError:function(e){Rd=!0,kh=e}};function KM(e,s,r,n,a,i,o,l,c){Rd=!1,kh=null,qM.apply(WM,arguments)}function GM(e,s,r,n,a,i,o,l,c){if(KM.apply(this,arguments),Rd){if(Rd){var d=kh;Rd=!1,kh=null}else throw Error(Ne(198));Sh||(Sh=!0,pg=d)}}function ol(e){var s=e,r=e;if(e.alternate)for(;s.return;)s=s.return;else{e=s;do s=e,s.flags&4098&&(r=s.return),e=s.return;while(e)}return s.tag===3?r:null}function NS(e){if(e.tag===13){var s=e.memoizedState;if(s===null&&(e=e.alternate,e!==null&&(s=e.memoizedState)),s!==null)return s.dehydrated}return null}function qb(e){if(ol(e)!==e)throw Error(Ne(188))}function HM(e){var s=e.alternate;if(!s){if(s=ol(e),s===null)throw Error(Ne(188));return s!==e?null:e}for(var r=e,n=s;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return qb(a),e;if(i===n)return qb(a),s;i=i.sibling}throw Error(Ne(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(Ne(189))}}if(r.alternate!==n)throw Error(Ne(190))}if(r.tag!==3)throw Error(Ne(188));return r.stateNode.current===r?e:s}function kS(e){return e=HM(e),e!==null?SS(e):null}function SS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var s=SS(e);if(s!==null)return s;e=e.sibling}return null}var CS=en.unstable_scheduleCallback,Wb=en.unstable_cancelCallback,QM=en.unstable_shouldYield,YM=en.unstable_requestPaint,bs=en.unstable_now,XM=en.unstable_getCurrentPriorityLevel,t0=en.unstable_ImmediatePriority,PS=en.unstable_UserBlockingPriority,Ch=en.unstable_NormalPriority,ZM=en.unstable_LowPriority,TS=en.unstable_IdlePriority,Rp=null,ba=null;function JM(e){if(ba&&typeof ba.onCommitFiberRoot=="function")try{ba.onCommitFiberRoot(Rp,e,void 0,(e.current.flags&128)===128)}catch{}}var Vn=Math.clz32?Math.clz32:s8,e8=Math.log,t8=Math.LN2;function s8(e){return e>>>=0,e===0?32:31-(e8(e)/t8|0)|0}var Sm=64,Cm=4194304;function Pd(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ph(e,s){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=Pd(l):(i&=o,i!==0&&(n=Pd(i)))}else o=r&~a,o!==0?n=Pd(o):i!==0&&(n=Pd(i));if(n===0)return 0;if(s!==0&&s!==n&&!(s&a)&&(a=n&-n,i=s&-s,a>=i||a===16&&(i&4194240)!==0))return s;if(n&4&&(n|=r&16),s=e.entangledLanes,s!==0)for(e=e.entanglements,s&=n;0<s;)r=31-Vn(s),a=1<<r,n|=e[r],s&=~a;return n}function r8(e,s){switch(e){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function n8(e,s){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Vn(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=r8(l,s)):c<=s&&(e.expiredLanes|=l),i&=~l}}function fg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function AS(){var e=Sm;return Sm<<=1,!(Sm&4194240)&&(Sm=64),e}function Hf(e){for(var s=[],r=0;31>r;r++)s.push(e);return s}
vendor: 4,087 bytes, line 37
37function Ku(e,s,r){e.pendingLanes|=s,s!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,s=31-Vn(s),e[s]=r}function a8(e,s){var r=e.pendingLanes&~s;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=s,e.mutableReadLanes&=s,e.entangledLanes&=s,s=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-Vn(r),i=1<<a;s[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function s0(e,s){var r=e.entangledLanes|=s;for(e=e.entanglements;r;){var n=31-Vn(r),a=1<<n;a&s|e[n]&s&&(e[n]|=s),r&=~a}}var Ot=0;function _S(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ES,r0,IS,MS,RS,xg=!1,Pm=[],zi=null,Ui=null,Vi=null,Yd=new Map,Xd=new Map,Si=[],i8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Kb(e,s){switch(e){case"focusin":case"focusout":zi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":Yd.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xd.delete(s.pointerId)}}function md(e,s,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:s,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},s!==null&&(s=Hu(s),s!==null&&r0(s)),e):(e.eventSystemFlags|=n,s=e.targetContainers,a!==null&&s.indexOf(a)===-1&&s.push(a),e)}function o8(e,s,r,n,a){switch(s){case"focusin":return zi=md(zi,e,s,r,n,a),!0;case"dragenter":return Ui=md(Ui,e,s,r,n,a),!0;case"mouseover":return Vi=md(Vi,e,s,r,n,a),!0;case"pointerover":var i=a.pointerId;return Yd.set(i,md(Yd.get(i)||null,e,s,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,Xd.set(i,md(Xd.get(i)||null,e,s,r,n,a)),!0}return!1}function FS(e){var s=Po(e.target);if(s!==null){var r=ol(s);if(r!==null){if(s=r.tag,s===13){if(s=NS(r),s!==null){e.blockedOn=s,RS(e.priority,function(){IS(r)});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function th(e){if(e.blockedOn!==null)return!1;for(var s=e.targetContainers;0<s.length;){var r=gg(e.domEventName,e.eventSystemFlags,s[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);ug=n,r.target.dispatchEvent(n),ug=null}else return s=Hu(r),s!==null&&r0(s),e.blockedOn=r,!1;s.shift()}return!0}function Gb(e,s,r){th(e)&&r.delete(s)}function l8(){xg=!1,zi!==null&&th(zi)&&(zi=null),Ui!==null&&th(Ui)&&(Ui=null),Vi!==null&&th(Vi)&&(Vi=null),Yd.forEach(Gb),Xd.forEach(Gb)}function hd(e,s){e.blockedOn===s&&(e.blockedOn=null,xg||(xg=!0,en.unstable_scheduleCallback(en.unstable_NormalPriority,l8)))}function Zd(e){function s(a){return hd(a,e)}if(0<Pm.length){hd(Pm[0],e);for(var r=1;r<Pm.length;r++){var n=Pm[r];n.blockedOn===e&&(n.blockedOn=null)}}for(zi!==null&&hd(zi,e),Ui!==null&&hd(Ui,e),Vi!==null&&hd(Vi,e),Yd.forEach(s),Xd.forEach(s),r=0;r<Si.length;r++)n=Si[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Si.length&&(r=Si[0],r.blockedOn===null);)FS(r),r.blockedOn===null&&Si.shift()}var ql=ui.ReactCurrentBatchConfig,Th=!0;function c8(e,s,r,n){var a=Ot,i=ql.transition;ql.transition=null;try{Ot=1,n0(e,s,r,n)}finally{Ot=a,ql.transition=i}}function d8(e,s,r,n){var a=Ot,i=ql.transition;ql.transition=null;try{Ot=4,n0(e,s,r,n)}finally{Ot=a,ql.transition=i}}function n0(e,s,r,n){if(Th){var a=gg(e,s,r,n);if(a===null)nx(e,s,n,Ah,r),Kb(e,n);else if(o8(a,e,s,r,n))n.stopPropagation();else if(Kb(e,n),s&4&&-1<i8.indexOf(e)){for(;a!==null;){var i=Hu(a);if(i!==null&&ES(i),i=gg(e,s,r,n),i===null&&nx(e,s,n,Ah,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else nx(e,s,n,null,r)}}var Ah=null;function gg(e,s,r,n){if(Ah=null,e=e0(n),e=Po(e),e!==null)if(s=ol(e),s===null)e=null;else if(r=s.tag,r===13){if(e=NS(s),e!==null)return e;e=null}else if(r===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;e=null}else s!==e&&(e=null);return Ah=e,null}
vendor: 10,401 bytes, line 37
37function DS(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(XM()){case t0:return 1;case PS:return 4;case Ch:case ZM:return 16;case TS:return 536870912;default:return 16}default:return 16}}var Li=null,a0=null,sh=null;function LS(){if(sh)return sh;var e,s=a0,r=s.length,n,a="value"in Li?Li.value:Li.textContent,i=a.length;for(e=0;e<r&&s[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&s[r-n]===a[i-n];n++);return sh=a.slice(e,1<n?1-n:void 0)}function rh(e){var s=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&s===13&&(e=13)):e=s,e===10&&(e=13),32<=e||e===13?e:0}function Tm(){return!0}function Hb(){return!1}function sn(e){function s(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Tm:Hb,this.isPropagationStopped=Hb,this}return ls(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Tm)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Tm)},persist:function(){},isPersistent:Tm}),s}var Kc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},i0=sn(Kc),Gu=ls({},Kc,{view:0,detail:0}),u8=sn(Gu),Qf,Yf,pd,Fp=ls({},Gu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,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!==pd&&(pd&&e.type==="mousemove"?(Qf=e.screenX-pd.screenX,Yf=e.screenY-pd.screenY):Yf=Qf=0,pd=e),Qf)},movementY:function(e){return"movementY"in e?e.movementY:Yf}}),Qb=sn(Fp),m8=ls({},Fp,{dataTransfer:0}),h8=sn(m8),p8=ls({},Gu,{relatedTarget:0}),Xf=sn(p8),f8=ls({},Kc,{animationName:0,elapsedTime:0,pseudoElement:0}),x8=sn(f8),g8=ls({},Kc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),y8=sn(g8),v8=ls({},Kc,{data:0}),Yb=sn(v8),b8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j8={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"},w8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N8(e){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(e):(e=w8[e])?!!s[e]:!1}function o0(){return N8}var k8=ls({},Gu,{key:function(e){if(e.key){var s=b8[e.key]||e.key;if(s!=="Unidentified")return s}return e.type==="keypress"?(e=rh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j8[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(e){return e.type==="keypress"?rh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S8=sn(k8),C8=ls({},Fp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xb=sn(C8),P8=ls({},Gu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),T8=sn(P8),A8=ls({},Kc,{propertyName:0,elapsedTime:0,pseudoElement:0}),_8=sn(A8),E8=ls({},Fp,{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}),I8=sn(E8),M8=[9,13,27,32],l0=Ja&&"CompositionEvent"in window,Fd=null;Ja&&"documentMode"in document&&(Fd=document.documentMode);var R8=Ja&&"TextEvent"in window&&!Fd,OS=Ja&&(!l0||Fd&&8<Fd&&11>=Fd),Zb=" ",Jb=!1;function $S(e,s){switch(e){case"keyup":return M8.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function F8(e,s){switch(e){case"compositionend":return zS(s);case"keypress":return s.which!==32?null:(Jb=!0,Zb);case"textInput":return e=s.data,e===Zb&&Jb?null:e;default:return null}}function D8(e,s){if(Al)return e==="compositionend"||!l0&&$S(e,s)?(e=LS(),sh=a0=Li=null,Al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return OS&&s.locale!=="ko"?null:s.data;default:return null}}var L8={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 ej(e){var s=e&&e.nodeName&&e.nodeName.toLowerCase();return s==="input"?!!L8[e.type]:s==="textarea"}function US(e,s,r,n){yS(n),s=_h(s,"onChange"),0<s.length&&(r=new i0("onChange","change",null,r,n),e.push({event:r,listeners:s}))}var Dd=null,Jd=null;function O8(e){ZS(e,0)}function Dp(e){var s=Il(e);if(uS(s))return e}function $8(e,s){if(e==="change")return s}var VS=!1;if(Ja){var Zf;if(Ja){var Jf="oninput"in document;if(!Jf){var tj=document.createElement("div");tj.setAttribute("oninput","return;"),Jf=typeof tj.oninput=="function"}Zf=Jf}else Zf=!1;VS=Zf&&(!document.documentMode||9<document.documentMode)}function sj(){Dd&&(Dd.detachEvent("onpropertychange",BS),Jd=Dd=null)}function BS(e){if(e.propertyName==="value"&&Dp(Jd)){var s=[];US(s,Jd,e,e0(e)),wS(O8,s)}}function z8(e,s,r){e==="focusin"?(sj(),Dd=s,Jd=r,Dd.attachEvent("onpropertychange",BS)):e==="focusout"&&sj()}function U8(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dp(Jd)}function V8(e,s){if(e==="click")return Dp(s)}function B8(e,s){if(e==="input"||e==="change")return Dp(s)}function q8(e,s){return e===s&&(e!==0||1/e===1/s)||e!==e&&s!==s}var Gn=typeof Object.is=="function"?Object.is:q8;function eu(e,s){if(Gn(e,s))return!0;if(typeof e!="object"||e===null||typeof s!="object"||s===null)return!1;var r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!Jx.call(s,a)||!Gn(e[a],s[a]))return!1}return!0}function rj(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nj(e,s){var r=rj(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=s&&n>=s)return{node:r,offset:s-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rj(r)}}function qS(e,s){return e&&s?e===s?!0:e&&e.nodeType===3?!1:s&&s.nodeType===3?qS(e,s.parentNode):"contains"in e?e.contains(s):e.compareDocumentPosition?!!(e.compareDocumentPosition(s)&16):!1:!1}function WS(){for(var e=window,s=Nh();s instanceof e.HTMLIFrameElement;){try{var r=typeof s.contentWindow.location.href=="string"}catch{r=!1}if(r)e=s.contentWindow;else break;s=Nh(e.document)}return s}function c0(e){var s=e&&e.nodeName&&e.nodeName.toLowerCase();return s&&(s==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||s==="textarea"||e.contentEditable==="true")}function W8(e){var s=WS(),r=e.focusedElem,n=e.selectionRange;if(s!==r&&r&&r.ownerDocument&&qS(r.ownerDocument.documentElement,r)){if(n!==null&&c0(r)){if(s=n.start,e=n.end,e===void 0&&(e=s),"selectionStart"in r)r.selectionStart=s,r.selectionEnd=Math.min(e,r.value.length);else if(e=(s=r.ownerDocument||document)&&s.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=nj(r,i);var o=nj(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(s=s.createRange(),s.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(s),e.extend(o.node,o.offset)):(s.setEnd(o.node,o.offset),e.addRange(s)))}}for(s=[],e=r;e=e.parentNode;)e.nodeType===1&&s.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<s.length;r++)e=s[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var K8=Ja&&"documentMode"in document&&11>=document.documentMode,_l=null,yg=null,Ld=null,vg=!1;function aj(e,s,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vg||_l==null||_l!==Nh(n)||(n=_l,"selectionStart"in n&&c0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Ld&&eu(Ld,n)||(Ld=n,n=_h(yg,"onSelect"),0<n.length&&(s=new i0("onSelect","select",null,s,r),e.push({event:s,listeners:n}),s.target=_l)))}function Am(e,s){var r={};return r[e.toLowerCase()]=s.toLowerCase(),r["Webkit"+e]="webkit"+s,r["Moz"+e]="moz"+s,r}var El={animationend:Am("Animation","AnimationEnd"),animationiteration:Am("Animation","AnimationIteration"),animationstart:Am("Animation","AnimationStart"),transitionend:Am("Transition","TransitionEnd")},ex={},KS={};Ja&&(KS=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Lp(e){if(ex[e])return ex[e];if(!El[e])return e;var s=El[e],r;for(r in s)if(s.hasOwnProperty(r)&&r in KS)return ex[e]=s[r];return e}var GS=Lp("animationend"),HS=Lp("animationiteration"),QS=Lp("animationstart"),YS=Lp("transitionend"),XS=new Map,ij="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function lo(e,s){XS.set(e,s),il(s,[e])}for(var tx=0;tx<ij.length;tx++){var sx=ij[tx],G8=sx.toLowerCase(),H8=sx[0].toUpperCase()+sx.slice(1);lo(G8,"on"+H8)}lo(GS,"onAnimationEnd");lo(HS,"onAnimationIteration");lo(QS,"onAnimationStart");lo("dblclick","onDoubleClick");lo("focusin","onFocus");lo("focusout","onBlur");lo(YS,"onTransitionEnd");kc("onMouseEnter",["mouseout","mouseover"]);kc("onMouseLeave",["mouseout","mouseover"]);kc("onPointerEnter",["pointerout","pointerover"]);kc("onPointerLeave",["pointerout","pointerover"]);il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));il("onBeforeInput",["compositionend","keypress","textInput","paste"]);il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Td="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(" "),Q8=new Set("cancel close invalid load scroll toggle".split(" ").concat(Td));function oj(e,s,r){var n=e.type||"unknown-event";e.currentTarget=r,GM(n,s,void 0,e),e.currentTarget=null}function ZS(e,s){s=(s&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(s)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;oj(a,l,d),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;oj(a,l,d),i=c}}}if(Sh)throw e=pg,Sh=!1,pg=null,e}function qt(e,s){var r=s[kg];r===void 0&&(r=s[kg]=new Set);var n=e+"__bubble";r.has(n)||(JS(s,e,2,!1),r.add(n))}function rx(e,s,r){var n=0;s&&(n|=4),JS(r,e,n,s)}var _m="_reactListening"+Math.random().toString(36).slice(2);function tu(e){if(!e[_m]){e[_m]=!0,iS.forEach(function(r){r!=="selectionchange"&&(Q8.has(r)||rx(r,!1,e),rx(r,!0,e))});var s=e.nodeType===9?e:e.ownerDocument;s===null||s[_m]||(s[_m]=!0,rx("selectionchange",!1,s))}}function JS(e,s,r,n){switch(DS(s)){case 1:var a=c8;break;case 4:a=d8;break;default:a=n0}r=a.bind(null,s,r,e),a=void 0,!hg||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(s,r,{capture:!0,passive:a}):e.addEventListener(s,r,!0):a!==void 0?e.addEventListener(s,r,{passive:a}):e.addEventListener(s,r,!1)}function nx(e,s,r,n,a){var i=n;
vendor: 2,645 bytes, line 37
37if(!(s&1)&&!(s&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Po(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}wS(function(){var d=i,u=e0(r),h=[];e:{var p=XS.get(e);if(p!==void 0){var x=i0,v=e;switch(e){case"keypress":if(rh(r)===0)break e;case"keydown":case"keyup":x=S8;break;case"focusin":v="focus",x=Xf;break;case"focusout":v="blur",x=Xf;break;case"beforeblur":case"afterblur":x=Xf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Qb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=h8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=T8;break;case GS:case HS:case QS:x=x8;break;case YS:x=_8;break;case"scroll":x=u8;break;case"wheel":x=I8;break;case"copy":case"cut":case"paste":x=y8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Xb}var f=(s&4)!==0,b=!f&&e==="scroll",y=f?p!==null?p+"Capture":null:p;f=[];for(var g=d,j;g!==null;){j=g;var N=j.stateNode;if(j.tag===5&&N!==null&&(j=N,y!==null&&(N=Qd(g,y),N!=null&&f.push(su(g,N,j)))),b)break;g=g.return}0<f.length&&(p=new x(p,v,null,r,u),h.push({event:p,listeners:f}))}}if(!(s&7)){e:{if(p=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",p&&r!==ug&&(v=r.relatedTarget||r.fromElement)&&(Po(v)||v[ei]))break e;if((x||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,x?(v=r.relatedTarget||r.toElement,x=d,v=v?Po(v):null,v!==null&&(b=ol(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=d),x!==v)){if(f=Qb,N="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(f=Xb,N="onPointerLeave",y="onPointerEnter",g="pointer"),b=x==null?p:Il(x),j=v==null?p:Il(v),p=new f(N,g+"leave",x,r,u),p.target=b,p.relatedTarget=j,N=null,Po(u)===d&&(f=new f(y,g+"enter",v,r,u),f.target=j,f.relatedTarget=b,N=f),b=N,x&&v)t:{for(f=x,y=v,g=0,j=f;j;j=gl(j))g++;for(j=0,N=y;N;N=gl(N))j++;for(;0<g-j;)f=gl(f),g--;for(;0<j-g;)y=gl(y),j--;for(;g--;){if(f===y||y!==null&&f===y.alternate)break t;f=gl(f),y=gl(y)}f=null}else f=null;x!==null&&lj(h,p,x,f,!1),v!==null&&b!==null&&lj(h,b,v,f,!0)}}
vendor: 4,576 bytes, lines 37-38
37e:{if(p=d?Il(d):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var w=$8;else if(ej(p))if(VS)w=B8;else{w=U8;var S=z8}else(x=p.nodeName)&&x.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=V8);if(w&&(w=w(e,d))){US(h,w,r,u);break e}S&&S(e,p,d),e==="focusout"&&(S=p._wrapperState)&&S.controlled&&p.type==="number"&&ig(p,"number",p.value)}switch(S=d?Il(d):window,e){case"focusin":(ej(S)||S.contentEditable==="true")&&(_l=S,yg=d,Ld=null);break;case"focusout":Ld=yg=_l=null;break;case"mousedown":vg=!0;break;case"contextmenu":case"mouseup":case"dragend":vg=!1,aj(h,r,u);break;case"selectionchange":if(K8)break;case"keydown":case"keyup":aj(h,r,u)}var k;if(l0)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Al?$S(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(OS&&r.locale!=="ko"&&(Al||P!=="onCompositionStart"?P==="onCompositionEnd"&&Al&&(k=LS()):(Li=u,a0="value"in Li?Li.value:Li.textContent,Al=!0)),S=_h(d,P),0<S.length&&(P=new Yb(P,e,null,r,u),h.push({event:P,listeners:S}),k?P.data=k:(k=zS(r),k!==null&&(P.data=k)))),(k=R8?F8(e,r):D8(e,r))&&(d=_h(d,"onBeforeInput"),0<d.length&&(u=new Yb("onBeforeInput","beforeinput",null,r,u),h.push({event:u,listeners:d}),u.data=k))}ZS(h,s)})}function su(e,s,r){return{instance:e,listener:s,currentTarget:r}}function _h(e,s){for(var r=s+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Qd(e,r),i!=null&&n.unshift(su(e,i,a)),i=Qd(e,s),i!=null&&n.push(su(e,i,a))),e=e.return}return n}function gl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function lj(e,s,r,n,a){for(var i=s._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,a?(c=Qd(r,i),c!=null&&o.unshift(su(r,c,l))):a||(c=Qd(r,i),c!=null&&o.push(su(r,c,l)))),r=r.return}o.length!==0&&e.push({event:s,listeners:o})}var Y8=/\r\n?/g,X8=/\u0000|\uFFFD/g;function cj(e){return(typeof e=="string"?e:""+e).replace(Y8,`
38`).replace(X8,"")}function Em(e,s,r){if(s=cj(s),cj(e)!==s&&r)throw Error(Ne(425))}function Eh(){}var bg=null,jg=null;function wg(e,s){return e==="textarea"||e==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Ng=typeof setTimeout=="function"?setTimeout:void 0,Z8=typeof clearTimeout=="function"?clearTimeout:void 0,dj=typeof Promise=="function"?Promise:void 0,J8=typeof queueMicrotask=="function"?queueMicrotask:typeof dj<"u"?function(e){return dj.resolve(null).then(e).catch(eR)}:Ng;function eR(e){setTimeout(function(){throw e})}function ax(e,s){var r=s,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),Zd(s);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);Zd(s)}function Bi(e){for(;e!=null;e=e.nextSibling){var s=e.nodeType;if(s===1||s===3)break;if(s===8){if(s=e.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return e}function uj(e){e=e.previousSibling;for(var s=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(s===0)return e;s--}else r==="/$"&&s++}e=e.previousSibling}return null}var Gc=Math.random().toString(36).slice(2),fa="__reactFiber$"+Gc,ru="__reactProps$"+Gc,ei="__reactContainer$"+Gc,kg="__reactEvents$"+Gc,tR="__reactListeners$"+Gc,sR="__reactHandles$"+Gc;function Po(e){var s=e[fa];if(s)return s;for(var r=e.parentNode;r;){if(s=r[ei]||r[fa]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(e=uj(e);e!==null;){if(r=e[fa])return r;e=uj(e)}return s}e=r,r=e.parentNode}return null}function Hu(e){return e=e[fa]||e[ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Il(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ne(33))}function Op(e){return e[ru]||null}var Sg=[],Ml=-1;function co(e){return{current:e}}function Gt(e){0>Ml||(e.current=Sg[Ml],Sg[Ml]=null,Ml--)}function zt(e,s){Ml++,Sg[Ml]=e.current,e.current=s}var Yi={},ir=co(Yi),Dr=co(!1),Uo=Yi;function Sc(e,s){var r=e.type.contextTypes;if(!r)return Yi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===s)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=s[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a
vendor: 15,538 bytes, line 38
38),a}function Lr(e){return e=e.childContextTypes,e!=null}function Ih(){Gt(Dr),Gt(ir)}function mj(e,s,r){if(ir.current!==Yi)throw Error(Ne(168));zt(ir,s),zt(Dr,r)}function eC(e,s,r){var n=e.stateNode;if(s=s.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in s))throw Error(Ne(108,zM(e)||"Unknown",a));return ls({},r,n)}function Mh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yi,Uo=ir.current,zt(ir,e),zt(Dr,Dr.current),!0}function hj(e,s,r){var n=e.stateNode;if(!n)throw Error(Ne(169));r?(e=eC(e,s,Uo),n.__reactInternalMemoizedMergedChildContext=e,Gt(Dr),Gt(ir),zt(ir,e)):Gt(Dr),zt(Dr,r)}var qa=null,$p=!1,ix=!1;function tC(e){qa===null?qa=[e]:qa.push(e)}function rR(e){$p=!0,tC(e)}function uo(){if(!ix&&qa!==null){ix=!0;var e=0,s=Ot;try{var r=qa;for(Ot=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}qa=null,$p=!1}catch(a){throw qa!==null&&(qa=qa.slice(e+1)),CS(t0,uo),a}finally{Ot=s,ix=!1}}return null}var Rl=[],Fl=0,Rh=null,Fh=0,un=[],mn=0,Vo=null,Ga=1,Ha="";function wo(e,s){Rl[Fl++]=Fh,Rl[Fl++]=Rh,Rh=e,Fh=s}function sC(e,s,r){un[mn++]=Ga,un[mn++]=Ha,un[mn++]=Vo,Vo=e;var n=Ga;e=Ha;var a=32-Vn(n)-1;n&=~(1<<a),r+=1;var i=32-Vn(s)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,Ga=1<<32-Vn(s)+a|r<<a|n,Ha=i+e}else Ga=1<<i|r<<a|n,Ha=e}function d0(e){e.return!==null&&(wo(e,1),sC(e,1,0))}function u0(e){for(;e===Rh;)Rh=Rl[--Fl],Rl[Fl]=null,Fh=Rl[--Fl],Rl[Fl]=null;for(;e===Vo;)Vo=un[--mn],un[mn]=null,Ha=un[--mn],un[mn]=null,Ga=un[--mn],un[mn]=null}var Yr=null,Hr=null,Yt=!1,On=null;function rC(e,s){var r=pn(5,null,null,0);r.elementType="DELETED",r.stateNode=s,r.return=e,s=e.deletions,s===null?(e.deletions=[r],e.flags|=16):s.push(r)}function pj(e,s){switch(e.tag){case 5:var r=e.type;return s=s.nodeType!==1||r.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(e.stateNode=s,Yr=e,Hr=Bi(s.firstChild),!0):!1;case 6:return s=e.pendingProps===""||s.nodeType!==3?null:s,s!==null?(e.stateNode=s,Yr=e,Hr=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(r=Vo!==null?{id:Ga,overflow:Ha}:null,e.memoizedState={dehydrated:s,treeContext:r,retryLane:1073741824},r=pn(18,null,null,0),r.stateNode=s,r.return=e,e.child=r,Yr=e,Hr=null,!0):!1;default:return!1}}function Cg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pg(e){if(Yt){var s=Hr;if(s){var r=s;if(!pj(e,s)){if(Cg(e))throw Error(Ne(418));s=Bi(r.nextSibling);var n=Yr;s&&pj(e,s)?rC(n,r):(e.flags=e.flags&-4097|2,Yt=!1,Yr=e)}}else{if(Cg(e))throw Error(Ne(418));e.flags=e.flags&-4097|2,Yt=!1,Yr=e}}}function fj(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yr=e}function Im(e){if(e!==Yr)return!1;if(!Yt)return fj(e),Yt=!0,!1;var s;if((s=e.tag!==3)&&!(s=e.tag!==5)&&(s=e.type,s=s!=="head"&&s!=="body"&&!wg(e.type,e.memoizedProps)),s&&(s=Hr)){if(Cg(e))throw nC(),Error(Ne(418));for(;s;)rC(e,s),s=Bi(s.nextSibling)}if(fj(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ne(317));e:{for(e=e.nextSibling,s=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(s===0){Hr=Bi(e.nextSibling);break e}s--}else r!=="$"&&r!=="$!"&&r!=="$?"||s++}e=e.nextSibling}Hr=null}}else Hr=Yr?Bi(e.stateNode.nextSibling):null;return!0}function nC(){for(var e=Hr;e;)e=Bi(e.nextSibling)}function Cc(){Hr=Yr=null,Yt=!1}function m0(e){On===null?On=[e]:On.push(e)}var nR=ui.ReactCurrentBatchConfig;function fd(e,s,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Ne(309));var n=r.stateNode}if(!n)throw Error(Ne(147,e));var a=n,i=""+e;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===i?s.ref:(s=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},s._stringRef=i,s)}if(typeof e!="string")throw Error(Ne(284));if(!r._owner)throw Error(Ne(290,e))}return e}function Mm(e,s){throw e=Object.prototype.toString.call(s),Error(Ne(31,e==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":e))}function xj(e){var s=e._init;return s(e._payload)}function aC(e){function s(y,g){if(e){var j=y.deletions;j===null?(y.deletions=[g],y.flags|=16):j.push(g)}}function r(y,g){if(!e)return null;for(;g!==null;)s(y,g),g=g.sibling;return null}function n(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function a(y,g){return y=Gi(y,g),y.index=0,y.sibling=null,y}function i(y,g,j){return y.index=j,e?(j=y.alternate,j!==null?(j=j.index,j<g?(y.flags|=2,g):j):(y.flags|=2,g)):(y.flags|=1048576,g)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,g,j,N){return g===null||g.tag!==6?(g=hx(j,y.mode,N),g.return=y,g):(g=a(g,j),g.return=y,g)}function c(y,g,j,N){var w=j.type;return w===Tl?u(y,g,j.props.children,N,j.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ni&&xj(w)===g.type)?(N=a(g,j.props),N.ref=fd(y,g,j),N.return=y,N):(N=dh(j.type,j.key,j.props,null,y.mode,N),N.ref=fd(y,g,j),N.return=y,N)}function d(y,g,j,N){return g===null||g.tag!==4||g.stateNode.containerInfo!==j.containerInfo||g.stateNode.implementation!==j.implementation?(g=px(j,y.mode,N),g.return=y,g):(g=a(g,j.children||[]),g.return=y,g)}function u(y,g,j,N,w){return g===null||g.tag!==7?(g=$o(j,y.mode,N,w),g.return=y,g):(g=a(g,j),g.return=y,g)}function h(y,g,j){if(typeof g=="string"&&g!==""||typeof g=="number")return g=hx(""+g,y.mode,j),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case wm:return j=dh(g.type,g.key,g.props,null,y.mode,j),j.ref=fd(y,null,g),j.return=y,j;case Pl:return g=px(g,y.mode,j),g.return=y,g;case Ni:var N=g._init;return h(y,N(g._payload),j)}if(Cd(g)||dd(g))return g=$o(g,y.mode,j,null),g.return=y,g;Mm(y,g)}return null}function p(y,g,j,N){var w=g!==null?g.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return w!==null?null:l(y,g,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case wm:return j.key===w?c(y,g,j,N):null;case Pl:return j.key===w?d(y,g,j,N):null;case Ni:return w=j._init,p(y,g,w(j._payload),N)}if(Cd(j)||dd(j))return w!==null?null:u(y,g,j,N,null);Mm(y,j)}return null}function x(y,g,j,N,w){if(typeof N=="string"&&N!==""||typeof N=="number")return y=y.get(j)||null,l(g,y,""+N,w);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case wm:return y=y.get(N.key===null?j:N.key)||null,c(g,y,N,w);case Pl:return y=y.get(N.key===null?j:N.key)||null,d(g,y,N,w);case Ni:var S=N._init;return x(y,g,j,S(N._payload),w)}if(Cd(N)||dd(N))return y=y.get(j)||null,u(g,y,N,w,null);Mm(g,N)}return null}function v(y,g,j,N){for(var w=null,S=null,k=g,P=g=0,A=null;k!==null&&P<j.length;P++){k.index>P?(A=k,k=null):A=k.sibling;var $=p(y,k,j[P],N);if($===null){k===null&&(k=A);break}e&&k&&$.alternate===null&&s(y,k),g=i($,g,P),S===null?w=$:S.sibling=$,S=$,k=A}if(P===j.length)return r(y,k),Yt&&wo(y,P),w;if(k===null){for(;P<j.length;P++)k=h(y,j[P],N),k!==null&&(g=i(k,g,P),S===null?w=k:S.sibling=k,S=k);return Yt&&wo(y,P),w}for(k=n(y,k);P<j.length;P++)A=x(k,y,P,j[P],N),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?P:A.key),g=i(A,g,P),S===null?w=A:S.sibling=A,S=A);return e&&k.forEach(function(_){return s(y,_)}),Yt&&wo(y,P),w}function f(y,g,j,N){var w=dd(j);if(typeof w!="function")throw Error(Ne(150));if(j=w.call(j),j==null)throw Error(Ne(151));for(var S=w=null,k=g,P=g=0,A=null,$=j.next();k!==null&&!$.done;P++,$=j.next()){k.index>P?(A=k,k=null):A=k.sibling;var _=p(y,k,$.value,N);if(_===null){k===null&&(k=A);break}e&&k&&_.alternate===null&&s(y,k),g=i(_,g,P),S===null?w=_:S.sibling=_,S=_,k=A}if($.done)return r(y,k),Yt&&wo(y,P),w;if(k===null){for(;!$.done;P++,$=j.next())$=h(y,$.value,N),$!==null&&(g=i($,g,P),S===null?w=$:S.sibling=$,S=$);return Yt&&wo(y,P),w}for(k=n(y,k);!$.done;P++,$=j.next())$=x(k,y,P,$.value,N),$!==null&&(e&&$.alternate!==null&&k.delete($.key===null?P:$.key),g=i($,g,P),S===null?w=$:S.sibling=$,S=$);return e&&k.forEach(function(O){return s(y,O)}),Yt&&wo(y,P),w}function b(y,g,j,N){if(typeof j=="object"&&j!==null&&j.type===Tl&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case wm:e:{for(var w=j.key,S=g;S!==null;){if(S.key===w){if(w=j.type,w===Tl){if(S.tag===7){r(y,S.sibling),g=a(S,j.props.children),g.return=y,y=g;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ni&&xj(w)===S.type){r(y,S.sibling),g=a(S,j.props),g.ref=fd(y,S,j),g.return=y,y=g;break e}r(y,S);break}else s(y,S);S=S.sibling}j.type===Tl?(g=$o(j.props.children,y.mode,N,j.key),g.return=y,y=g):(N=dh(j.type,j.key,j.props,null,y.mode,N),N.ref=fd(y,g,j),N.return=y,y=N)}return o(y);case Pl:e:{for(S=j.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===j.containerInfo&&g.stateNode.implementation===j.implementation){r(y,g.sibling),g=a(g,j.children||[]),g.return=y,y=g;break e}else{r(y,g);break}else s(y,g);g=g.sibling}g=px(j,y.mode,N),g.return=y,y=g}return o(y);case Ni:return S=j._init,b(y,g,S(j._payload),N)}if(Cd(j))return v(y,g,j,N);if(dd(j))return f(y,g,j,N);Mm(y,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,g!==null&&g.tag===6?(r(y,g.sibling),g=a(g,j),g.return=y,y=g):(r(y,g),g=hx(j,y.mode,N),g.return=y,y=g),o(y)):r(y,g)}return b}var Pc=aC(!0),iC=aC(!1),Dh=co(null),Lh=null,Dl=null,h0=null;function p0(){h0=Dl=Lh=null}function f0(e){var s=Dh.current;Gt(Dh),e._currentValue=s}function Tg(e,s,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&s)!==s?(e.childLanes|=s,n!==null&&(n.childLanes|=s)):n!==null&&(n.childLanes&s)!==s&&(n.childLanes|=s),e===r)break;e=e.return}}function Wl(e,s){Lh=e,h0=Dl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&s&&(Mr=!0),e.firstContext=null)}function yn(e){var s=e._currentValue;if(h0!==e)if(e={context:e,memoizedValue:s,next:null},Dl===null){if(Lh===null)throw Error(Ne(308));Dl=e,Lh.dependencies={lanes:0,firstContext:e}}else Dl=Dl.next=e;return s}var To=null;function x0(e){To===null?To=[e]:To.push(e)}function oC(e,s,r,n){var a=s.interleaved;return a===null?(r.next=r,x0(s)):(r.next=a.next,a.next=r),s.interleaved=r,ti(e,n)}function ti(e,s){e.lanes|=s;var r=e.alternate;for(r!==null&&(r.lanes|=s),r=e,e=e.return;e!==null;)e.childLanes|=s,r=e.alternate,r!==null&&(r.childLanes|=s),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ki=!1;function g0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lC(e,s){e=e.updateQueue,s.updateQueue===e&&(s.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ya(e,s){return{eventTime:e,lane:s,tag:0,payload:null,callback:null,next:null}}function qi(e,s,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,At&2){var a=n.pending;return a===null?s.next=s:(s.next=a.next,a.next=s),n.pending=s,ti(e,r)}return a=n.interleaved,a===null?(s.next=s,x0(n)):(s.next=a.next,a.next=s),n.interleaved=s,ti(e,r)}function nh(e,s,r){if(s=s.updateQueue,s!==null&&(s=s.shared,(r&4194240)!==0)){var n=s.lanes;n&=e.pendingLanes,r|=n,s.lanes=r,s0(e,r)}}function gj(e,s){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=s:i=i.next=s}else a=i=s;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=s:e.next=s,r.lastBaseUpdate=s}function Oh(e,s,r,n){var a=e.updateQueue;ki=!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 h=a.baseState;o=0,u=d=c=null,l=i;do{var p=l.lane,x=l.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,f=l;switch(p=s,x=r,f.tag){case 1:if(v=f.payload,typeof v=="function"){h=v.call(x,h,p);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=f.payload,p=typeof v=="function"?v.call(x,h,p):v,p==null)break e;h=ls({},h,p);break e;case 2:ki=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[l]:p.push(l))}else x={eventTime:x,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=x,c=h):u=u.next=x,o|=p;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);if(u===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,s=a.shared.interleaved,s!==null){a=s;do o|=a.lane,a=a.next;while(a!==s)}else i===null&&(a.shared.lanes=0);qo|=o,e.lanes=o,e.memoizedState=h}}function yj(e,s,r){if(e=s.effects,s.effects=null,e!==null)for(s=0;s<e.length;s++){var n=e[s],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(Ne(191,a));a.call(n)}}}var Qu={},ja=co(Qu),nu=co(Qu),au=co(Qu);function Ao(e){if(e===Qu)throw Error(Ne(174));return e}function y0(e,s){switch(zt(au,s),zt(nu,e),zt(ja,Qu),e=s.nodeType,e){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:lg(null,"");break;default:e=e===8?s.parentNode:s,s=e.namespaceURI||null,e=e.tagName,s=lg(s,e)}Gt(ja),zt(ja,s)}function Tc(){Gt(ja),Gt(nu),Gt(au)}function cC(e){Ao(au.current);var s=Ao(ja.current),r=lg(s,e.type);s!==r&&(zt(nu,e),zt(ja,r))}function v0(e){nu.current===e&&(Gt(ja),Gt(nu))}var rs=co(0);function $h(e){for(var s=e;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ox=[];function b0(){for(var e=0;e<ox.length;e++)ox[e]._workInProgressVersionPrimary=null;ox.length=0}var ah=ui.ReactCurrentDispatcher,lx=ui.ReactCurrentBatchConfig,Bo=0,is=null,Ms=null,Vs=null,zh=!1,Od=!1,iu=0,aR=0;function tr(){throw Error(Ne(321))}function j0(e,s){if(s===null)return!1;for(var r=0;r<s.length&&r<e.length;r++)if(!Gn(e[r],s[r]))return!1;return!0}function w0(e,s,r,n,a,i){if(Bo=i,is=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,ah.current=e===null||e.memoizedState===null?cR:dR,e=r(n,a),Od){i=0;do{if(Od=!1,iu=0,25<=i)throw Error(Ne(301));i+=1,Vs=Ms=null,s.updateQueue=null,ah.current=uR,e=r(n,a)}while(Od)}if(ah.current=Uh,s=Ms!==null&&Ms.next!==null,Bo=0,Vs=Ms=is=null,zh=!1,s)throw Error(Ne(300));return e}function N0(){var e=iu!==0;return iu=0,e}function da(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vs===null?is.memoizedState=Vs=e:Vs=Vs.next=e,Vs}function vn(){if(Ms===null){var e=is.alternate;e=e!==null?e.memoizedState:null}else e=Ms.next;var s=Vs===null?is.memoizedState:Vs.next;if(s!==null)Vs=s,Ms=e;else{if(e===null)throw Error(Ne(310));Ms=e,e={memoizedState:Ms.memoizedState,baseState:Ms.baseState,baseQueue:Ms.baseQueue,queue:Ms.queue,next:null},Vs===null?is.memoizedState=Vs=e:Vs=Vs.next=e}return Vs}function ou(e,s){return typeof s=="function"?s(e):s}function cx(e){var s=vn(),r=s.queue;if(r===null)throw Error(Ne(311));r.lastRenderedReducer=e;
vendor: 5,690 bytes, line 38
38var n=Ms,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((Bo&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,is.lanes|=u,qo|=u}d=d.next}while(d!==null&&d!==i);c===null?o=n:c.next=l,Gn(n,s.memoizedState)||(Mr=!0),s.memoizedState=n,s.baseState=o,s.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,is.lanes|=i,qo|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[s.memoizedState,r.dispatch]}function dx(e){var s=vn(),r=s.queue;if(r===null)throw Error(Ne(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=s.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Gn(i,s.memoizedState)||(Mr=!0),s.memoizedState=i,s.baseQueue===null&&(s.baseState=i),r.lastRenderedState=i}return[i,n]}function dC(){}function uC(e,s){var r=is,n=vn(),a=s(),i=!Gn(n.memoizedState,a);if(i&&(n.memoizedState=a,Mr=!0),n=n.queue,k0(pC.bind(null,r,n,e),[e]),n.getSnapshot!==s||i||Vs!==null&&Vs.memoizedState.tag&1){if(r.flags|=2048,lu(9,hC.bind(null,r,n,a,s),void 0,null),Bs===null)throw Error(Ne(349));Bo&30||mC(r,s,a)}return a}function mC(e,s,r){e.flags|=16384,e={getSnapshot:s,value:r},s=is.updateQueue,s===null?(s={lastEffect:null,stores:null},is.updateQueue=s,s.stores=[e]):(r=s.stores,r===null?s.stores=[e]:r.push(e))}function hC(e,s,r,n){s.value=r,s.getSnapshot=n,fC(s)&&xC(e)}function pC(e,s,r){return r(function(){fC(s)&&xC(e)})}function fC(e){var s=e.getSnapshot;e=e.value;try{var r=s();return!Gn(e,r)}catch{return!0}}function xC(e){var s=ti(e,1);s!==null&&Bn(s,e,1,-1)}function vj(e){var s=da();return typeof e=="function"&&(e=e()),s.memoizedState=s.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ou,lastRenderedState:e},s.queue=e,e=e.dispatch=lR.bind(null,is,e),[s.memoizedState,e]}function lu(e,s,r,n){return e={tag:e,create:s,destroy:r,deps:n,next:null},s=is.updateQueue,s===null?(s={lastEffect:null,stores:null},is.updateQueue=s,s.lastEffect=e.next=e):(r=s.lastEffect,r===null?s.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,s.lastEffect=e)),e}function gC(){return vn().memoizedState}function ih(e,s,r,n){var a=da();is.flags|=e,a.memoizedState=lu(1|s,r,void 0,n===void 0?null:n)}function zp(e,s,r,n){var a=vn();n=n===void 0?null:n;var i=void 0;if(Ms!==null){var o=Ms.memoizedState;if(i=o.destroy,n!==null&&j0(n,o.deps)){a.memoizedState=lu(s,r,i,n);return}}is.flags|=e,a.memoizedState=lu(1|s,r,i,n)}function bj(e,s){return ih(8390656,8,e,s)}function k0(e,s){return zp(2048,8,e,s)}function yC(e,s){return zp(4,2,e,s)}function vC(e,s){return zp(4,4,e,s)}function bC(e,s){if(typeof s=="function")return e=e(),s(e),function(){s(null)};if(s!=null)return e=e(),s.current=e,function(){s.current=null}}function jC(e,s,r){return r=r!=null?r.concat([e]):null,zp(4,4,bC.bind(null,s,e),r)}function S0(){}function wC(e,s){var r=vn();s=s===void 0?null:s;var n=r.memoizedState;return n!==null&&s!==null&&j0(s,n[1])?n[0]:(r.memoizedState=[e,s],e)}function NC(e,s){var r=vn();s=s===void 0?null:s;var n=r.memoizedState;return n!==null&&s!==null&&j0(s,n[1])?n[0]:(e=e(),r.memoizedState=[e,s],e)}function kC(e,s,r){return Bo&21?(Gn(r,s)||(r=AS(),is.lanes|=r,qo|=r,e.baseState=!0),s):(e.baseState&&(e.baseState=!1,Mr=!0),e.memoizedState=r)}function iR(e,s){var r=Ot;Ot=r!==0&&4>r?r:4,e(!0);var n=lx.transition;lx.transition={};try{e(!1),s()}finally{Ot=r,lx.transition=n}}function SC(){return vn().memoizedState}function oR(e,s,r){var n=Ki(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},CC(e))PC(s,r);else if(r=oC(e,s,r,n),r!==null){var a=pr();Bn(r,e,n,a),TC(r,s,n)}}function lR(e,s,r){var n=Ki(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(CC(e))PC(s,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=s.lastRenderedReducer,i!==null))try{var o=s.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,Gn(l,o)){var c=s.interleaved;c===null?(a.next=a,x0(s)):(a.next=c.next,c.next=a),s.interleaved=a;return}}catch{}finally{}r=oC(e,s,a,n),r!==null&&(a=pr(),Bn(r,e,n,a),TC(r,s,n))}}function CC(e){var s=e.alternate;return e===is||s!==null&&s===is}function PC(e,s){Od=zh=!0;var r=e.pending;r===null?s.next=s:(s.next=r.next,r.next=s),e.pending=s}function TC(e,s,r){if(r&4194240){var n=s.lanes;n&=e.pendingLanes,r|=n,s.lanes=r,s0(e,r)}}var Uh={readContext:yn,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},cR={readContext:yn,useCallback:function(e,s){return da().memoizedState=[e,s===void 0?null:s],e},useContext:yn,useEffect:bj,useImperativeHandle:function(e,s,r){return r=r!=null?r.concat([e]):null,ih(4194308,4,bC.bind(null,s,e),r)},useLayoutEffect:function(e,s){return ih(4194308,4,e,s)},useInsertionEffect:function(e,s){return ih(4,2,e,s)},useMemo:function(e,s){var r=da();return s=s===void 0?null:s,e=e(),r.memoizedState=[e,s],e},useReducer:function(e,s,r){var n=da();return s=r!==void 0?r(s):s,n.memoizedState=n.baseState=s,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=oR.bind(null,is,e),[n.memoizedState,e]}
vendor: 7,433 bytes, lines 38-40
38,useRef:function(e){var s=da();return e={current:e},s.memoizedState=e},useState:vj,useDebugValue:S0,useDeferredValue:function(e){return da().memoizedState=e},useTransition:function(){var e=vj(!1),s=e[0];return e=iR.bind(null,e[1]),da().memoizedState=e,[s,e]},useMutableSource:function(){},useSyncExternalStore:function(e,s,r){var n=is,a=da();if(Yt){if(r===void 0)throw Error(Ne(407));r=r()}else{if(r=s(),Bs===null)throw Error(Ne(349));Bo&30||mC(n,s,r)}a.memoizedState=r;var i={value:r,getSnapshot:s};return a.queue=i,bj(pC.bind(null,n,i,e),[e]),n.flags|=2048,lu(9,hC.bind(null,n,i,r,s),void 0,null),r},useId:function(){var e=da(),s=Bs.identifierPrefix;if(Yt){var r=Ha,n=Ga;r=(n&~(1<<32-Vn(n)-1)).toString(32)+r,s=":"+s+"R"+r,r=iu++,0<r&&(s+="H"+r.toString(32)),s+=":"}else r=aR++,s=":"+s+"r"+r.toString(32)+":";return e.memoizedState=s},unstable_isNewReconciler:!1},dR={readContext:yn,useCallback:wC,useContext:yn,useEffect:k0,useImperativeHandle:jC,useInsertionEffect:yC,useLayoutEffect:vC,useMemo:NC,useReducer:cx,useRef:gC,useState:function(){return cx(ou)},useDebugValue:S0,useDeferredValue:function(e){var s=vn();return kC(s,Ms.memoizedState,e)},useTransition:function(){var e=cx(ou)[0],s=vn().memoizedState;return[e,s]},useMutableSource:dC,useSyncExternalStore:uC,useId:SC,unstable_isNewReconciler:!1},uR={readContext:yn,useCallback:wC,useContext:yn,useEffect:k0,useImperativeHandle:jC,useInsertionEffect:yC,useLayoutEffect:vC,useMemo:NC,useReducer:dx,useRef:gC,useState:function(){return dx(ou)},useDebugValue:S0,useDeferredValue:function(e){var s=vn();return Ms===null?s.memoizedState=e:kC(s,Ms.memoizedState,e)},useTransition:function(){var e=dx(ou)[0],s=vn().memoizedState;return[e,s]},useMutableSource:dC,useSyncExternalStore:uC,useId:SC,unstable_isNewReconciler:!1};function Fn(e,s){if(e&&e.defaultProps){s=ls({},s),e=e.defaultProps;for(var r in e)s[r]===void 0&&(s[r]=e[r]);return s}return s}function Ag(e,s,r,n){s=e.memoizedState,r=r(n,s),r=r==null?s:ls({},s,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Up={isMounted:function(e){return(e=e._reactInternals)?ol(e)===e:!1},enqueueSetState:function(e,s,r){e=e._reactInternals;var n=pr(),a=Ki(e),i=Ya(n,a);i.payload=s,r!=null&&(i.callback=r),s=qi(e,i,a),s!==null&&(Bn(s,e,a,n),nh(s,e,a))},enqueueReplaceState:function(e,s,r){e=e._reactInternals;var n=pr(),a=Ki(e),i=Ya(n,a);i.tag=1,i.payload=s,r!=null&&(i.callback=r),s=qi(e,i,a),s!==null&&(Bn(s,e,a,n),nh(s,e,a))},enqueueForceUpdate:function(e,s){e=e._reactInternals;var r=pr(),n=Ki(e),a=Ya(r,n);a.tag=2,s!=null&&(a.callback=s),s=qi(e,a,n),s!==null&&(Bn(s,e,n,r),nh(s,e,n))}};function jj(e,s,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):s.prototype&&s.prototype.isPureReactComponent?!eu(r,n)||!eu(a,i):!0}function AC(e,s,r){var n=!1,a=Yi,i=s.contextType;return typeof i=="object"&&i!==null?i=yn(i):(a=Lr(s)?Uo:ir.current,n=s.contextTypes,i=(n=n!=null)?Sc(e,a):Yi),s=new s(r,i),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Up,e.stateNode=s,s._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),s}function wj(e,s,r,n){e=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(r,n),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(r,n),s.state!==e&&Up.enqueueReplaceState(s,s.state,null)}function _g(e,s,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},g0(e);var i=s.contextType;typeof i=="object"&&i!==null?a.context=yn(i):(i=Lr(s)?Uo:ir.current,a.context=Sc(e,i)),a.state=e.memoizedState,i=s.getDerivedStateFromProps,typeof i=="function"&&(Ag(e,s,i,r),a.state=e.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&Up.enqueueReplaceState(a,a.state,null),Oh(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ac(e,s){try{var r="",n=s;do r+=$M(n),n=n.return;while(n);var a=r}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:s,stack:a,digest:null}}function ux(e,s,r){return{value:e,source:null,stack:r??null,digest:s??null}}function Eg(e,s){try{console.error(s.value)}catch(r){setTimeout(function(){throw r})}}var mR=typeof WeakMap=="function"?WeakMap:Map;function _C(e,s,r){r=Ya(-1,r),r.tag=3,r.payload={element:null};var n=s.value;return r.callback=function(){Bh||(Bh=!0,Ug=n),Eg(e,s)},r}function EC(e,s,r){r=Ya(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=s.value;r.payload=function(){return n(a)},r.callback=function(){Eg(e,s)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Eg(e,s),typeof n!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var o=s.stack;this.componentDidCatch(s.value,{componentStack:o!==null?o:""})}),r}function Nj(e,s,r){var n=e.pingCache;if(n===null){n=e.pingCache=new mR;var a=new Set;n.set(s,a)}else a=n.get(s),a===void 0&&(a=new Set,n.set(s,a));a.has(r)||(a.add(r),e=CR.bind(null,e,s,r),s.then(e,e))}function kj(e){do{var s;if((s=e.tag===13)&&(s=e.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return e;e=e.return}while(e!==null);return null}function Sj(e,s,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===s?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(s=Ya(-1,1),s.tag=2,qi(r,s,1))),r.lanes|=1),e)}var hR=ui.ReactCurrentOwner,Mr=!1;function ur(e,s,r,n){s.child=e===null?iC(s,null,r,n):Pc(s,e.child,r,n)}function Cj(e,s,r,n,a){r=r.render;var i=s.ref;return Wl(s,a),n=w0(e,s,r,n,i,a),r=N0(),e!==null&&!Mr?(s.updateQueue=e.updateQueue,s.flags&=-2053,e.lanes&=~a,si(e,s,a)):(Yt&&r&&d0(s),s.flags|=1,ur(e,s,n,a),s.child)}function Pj(e,s,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!M0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(s.tag=15,s.type=i,IC(e,s,i,n,a)):(e=dh(r.type,null,n,s,s.mode,a),e.ref=s.ref,e.return=s,s.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:eu,r(o,n)&&e.ref===s.ref)return si(e,s,a)}return s.flags|=1,e=Gi(i,n),e.ref=s.ref,e.return=s,s.child=e}function IC(e,s,r,n,a){if(e!==null){var i=e.memoizedProps;if(eu(i,n)&&e.ref===s.ref)if(Mr=!1,s.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(Mr=!0);else return s.lanes=e.lanes,si(e,s,a)}return Ig(e,s,r,n,a)}function MC(e,s,r){var n=s.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(s.mode&1))s.memoizedState={baseLanes:0,cachePool:null,transitions:null},zt(Ol,Ur),Ur|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:e,cachePool:null,transitions:null},s.updateQueue=null,zt(Ol,Ur),Ur|=e,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,zt(Ol,Ur),Ur|=n}else i!==null?(n=i.baseLanes|r,s.memoizedState=null):n=r,zt(Ol,Ur),Ur|=n;return ur(e,s,a,r),s.child}function RC(e,s){var r=s.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(s.flags|=512,s.flags|=2097152)}
vendor: 4,497 bytes, line 40
40function Ig(e,s,r,n,a){var i=Lr(r)?Uo:ir.current;return i=Sc(s,i),Wl(s,a),r=w0(e,s,r,n,i,a),n=N0(),e!==null&&!Mr?(s.updateQueue=e.updateQueue,s.flags&=-2053,e.lanes&=~a,si(e,s,a)):(Yt&&n&&d0(s),s.flags|=1,ur(e,s,r,a),s.child)}function Tj(e,s,r,n,a){if(Lr(r)){var i=!0;Mh(s)}else i=!1;if(Wl(s,a),s.stateNode===null)oh(e,s),AC(s,r,n),_g(s,r,n,a),n=!0;else if(e===null){var o=s.stateNode,l=s.memoizedProps;o.props=l;var c=o.context,d=r.contextType;typeof d=="object"&&d!==null?d=yn(d):(d=Lr(r)?Uo:ir.current,d=Sc(s,d));var u=r.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==d)&&wj(s,o,n,d),ki=!1;var p=s.memoizedState;o.state=p,Oh(s,n,o,a),c=s.memoizedState,l!==n||p!==c||Dr.current||ki?(typeof u=="function"&&(Ag(s,r,u,n),c=s.memoizedState),(l=ki||jj(s,r,l,n,p,c,d))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(s.flags|=4194308)):(typeof o.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=n,s.memoizedState=c),o.props=n,o.state=c,o.context=d,n=l):(typeof o.componentDidMount=="function"&&(s.flags|=4194308),n=!1)}else{o=s.stateNode,lC(e,s),l=s.memoizedProps,d=s.type===s.elementType?l:Fn(s.type,l),o.props=d,h=s.pendingProps,p=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=yn(c):(c=Lr(r)?Uo:ir.current,c=Sc(s,c));var x=r.getDerivedStateFromProps;(u=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||p!==c)&&wj(s,o,n,c),ki=!1,p=s.memoizedState,o.state=p,Oh(s,n,o,a);var v=s.memoizedState;l!==h||p!==v||Dr.current||ki?(typeof x=="function"&&(Ag(s,r,x,n),v=s.memoizedState),(d=ki||jj(s,r,d,n,p,v,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,c)),typeof o.componentDidUpdate=="function"&&(s.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(s.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(s.flags|=1024),s.memoizedProps=n,s.memoizedState=v),o.props=n,o.state=v,o.context=c,n=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(s.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(s.flags|=1024),n=!1)}return Mg(e,s,r,n,i,a)}function Mg(e,s,r,n,a,i){RC(e,s);var o=(s.flags&128)!==0;if(!n&&!o)return a&&hj(s,r,!1),si(e,s,i);n=s.stateNode,hR.current=s;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return s.flags|=1,e!==null&&o?(s.child=Pc(s,e.child,null,i),s.child=Pc(s,null,l,i)):ur(e,s,l,i),s.memoizedState=n.state,a&&hj(s,r,!0),s.child}function FC(e){var s=e.stateNode;s.pendingContext?mj(e,s.pendingContext,s.pendingContext!==s.context):s.context&&mj(e,s.context,!1),y0(e,s.containerInfo)}function Aj(e,s,r,n,a){return Cc(),m0(a),s.flags|=256,ur(e,s,r,n),s.child}var Rg={dehydrated:null,treeContext:null,retryLane:0};function Fg(e){return{baseLanes:e,cachePool:null,transitions:null}}function DC(e,s,r){var n=s.pendingProps,a=rs.current,i=!1,o=(s.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,s.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),zt(rs,a&1),e===null)return Pg(s),e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(s.mode&1?e.data==="$!"?s.lanes=8:s.lanes=1073741824:s.lanes=1,null):(o=n.children,e=n.fallback,i?(n=s.mode,i=s.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=qp(o,n,0,null),e=$o(e,n,r,null),i.return=s,e.return=s,i.sibling=e,s.child=i,s.child.memoizedState=Fg(r),s.memoizedState=Rg,e):C0(s,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return pR(e,s,o,n,l,a,r);if(i){i=n.fallback,o=s.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&s.child!==a?(n=s.child,n.childLanes=0,n.pendingProps=c,s.deleti
vendor: 9,137 bytes, line 40
40ons=null):(n=Gi(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Gi(l,i):(i=$o(i,o,r,null),i.flags|=2),i.return=s,n.return=s,n.sibling=i,s.child=n,n=i,i=s.child,o=e.child.memoizedState,o=o===null?Fg(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,s.memoizedState=Rg,n}return i=e.child,e=i.sibling,n=Gi(i,{mode:"visible",children:n.children}),!(s.mode&1)&&(n.lanes=r),n.return=s,n.sibling=null,e!==null&&(r=s.deletions,r===null?(s.deletions=[e],s.flags|=16):r.push(e)),s.child=n,s.memoizedState=null,n}function C0(e,s){return s=qp({mode:"visible",children:s},e.mode,0,null),s.return=e,e.child=s}function Rm(e,s,r,n){return n!==null&&m0(n),Pc(s,e.child,null,r),e=C0(s,s.pendingProps.children),e.flags|=2,s.memoizedState=null,e}function pR(e,s,r,n,a,i,o){if(r)return s.flags&256?(s.flags&=-257,n=ux(Error(Ne(422))),Rm(e,s,o,n)):s.memoizedState!==null?(s.child=e.child,s.flags|=128,null):(i=n.fallback,a=s.mode,n=qp({mode:"visible",children:n.children},a,0,null),i=$o(i,a,o,null),i.flags|=2,n.return=s,i.return=s,n.sibling=i,s.child=n,s.mode&1&&Pc(s,e.child,null,o),s.child.memoizedState=Fg(o),s.memoizedState=Rg,i);if(!(s.mode&1))return Rm(e,s,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(Ne(419)),n=ux(i,n,void 0),Rm(e,s,o,n)}if(l=(o&e.childLanes)!==0,Mr||l){if(n=Bs,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,ti(e,a),Bn(n,e,a,-1))}return I0(),n=ux(Error(Ne(421))),Rm(e,s,o,n)}return a.data==="$?"?(s.flags|=128,s.child=e.child,s=PR.bind(null,e),a._reactRetry=s,null):(e=i.treeContext,Hr=Bi(a.nextSibling),Yr=s,Yt=!0,On=null,e!==null&&(un[mn++]=Ga,un[mn++]=Ha,un[mn++]=Vo,Ga=e.id,Ha=e.overflow,Vo=s),s=C0(s,n.children),s.flags|=4096,s)}function _j(e,s,r){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s),Tg(e.return,s,r)}function mx(e,s,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=s,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function LC(e,s,r){var n=s.pendingProps,a=n.revealOrder,i=n.tail;if(ur(e,s,n.children,r),n=rs.current,n&2)n=n&1|2,s.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=s.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_j(e,r,s);else if(e.tag===19)_j(e,r,s);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===s)break e;for(;e.sibling===null;){if(e.return===null||e.return===s)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(zt(rs,n),!(s.mode&1))s.memoizedState=null;else switch(a){case"forwards":for(r=s.child,a=null;r!==null;)e=r.alternate,e!==null&&$h(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=s.child,s.child=null):(a=r.sibling,r.sibling=null),mx(s,!1,a,r,i);break;case"backwards":for(r=null,a=s.child,s.child=null;a!==null;){if(e=a.alternate,e!==null&&$h(e)===null){s.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}mx(s,!0,r,null,i);break;case"together":mx(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function oh(e,s){!(s.mode&1)&&e!==null&&(e.alternate=null,s.alternate=null,s.flags|=2)}function si(e,s,r){if(e!==null&&(s.dependencies=e.dependencies),qo|=s.lanes,!(r&s.childLanes))return null;if(e!==null&&s.child!==e.child)throw Error(Ne(153));if(s.child!==null){for(e=s.child,r=Gi(e,e.pendingProps),s.child=r,r.return=s;e.sibling!==null;)e=e.sibling,r=r.sibling=Gi(e,e.pendingProps),r.return=s;r.sibling=null}return s.child}function fR(e,s,r){switch(s.tag){case 3:FC(s),Cc();break;case 5:cC(s);break;case 1:Lr(s.type)&&Mh(s);break;case 4:y0(s,s.stateNode.containerInfo);break;case 10:var n=s.type._context,a=s.memoizedProps.value;zt(Dh,n._currentValue),n._currentValue=a;break;case 13:if(n=s.memoizedState,n!==null)return n.dehydrated!==null?(zt(rs,rs.current&1),s.flags|=128,null):r&s.child.childLanes?DC(e,s,r):(zt(rs,rs.current&1),e=si(e,s,r),e!==null?e.sibling:null);zt(rs,rs.current&1);break;case 19:if(n=(r&s.childLanes)!==0,e.flags&128){if(n)return LC(e,s,r);s.flags|=128}if(a=s.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),zt(rs,rs.current),n)break;return null;case 22:case 23:return s.lanes=0,MC(e,s,r)}return si(e,s,r)}var OC,Dg,$C,zC;OC=function(e,s){for(var r=s.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Dg=function(){};$C=function(e,s,r,n){var a=e.memoizedProps;if(a!==n){e=s.stateNode,Ao(ja.current);var i=null;switch(r){case"input":a=ng(e,a),n=ng(e,n),i=[];break;case"select":a=ls({},a,{value:void 0}),n=ls({},n,{value:void 0}),i=[];break;case"textarea":a=og(e,a),n=og(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Eh)}cg(r,n);var o;r=null;for(d in a)if(!n.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Gd.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in n){var c=n[d];if(l=a!=null?a[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Gd.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&qt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}r&&(i=i||[]).push("style",r);var d=i;(s.updateQueue=d)&&(s.flags|=4)}};zC=function(e,s,r,n){r!==n&&(s.flags|=4)};function xd(e,s){if(!Yt)switch(e.tailMode){case"hidden":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?s||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function sr(e){var s=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(s)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,s}function xR(e,s,r){var n=s.pendingProps;switch(u0(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sr(s),null;case 1:return Lr(s.type)&&Ih(),sr(s),null;case 3:return n=s.stateNode,Tc(),Gt(Dr),Gt(ir),b0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Im(s)?s.flags|=4:e===null||e.memoizedState.isDehydrated&&!(s.flags&256)||(s.flags|=1024,On!==null&&(qg(On),On=null))),Dg(e,s),sr(s),null;case 5:v0(s);var a=Ao(au.current);if(r=s.type,e!==null&&s.stateNode!=null)$C(e,s,r,n,a),e.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!n){if(s.stateNode===null)throw Error(Ne(166));return sr(s),null}if(e=Ao(ja.current),Im(s)){n=s.stateNode,r=s.type;var i=s.memoizedProps;switch(n[fa]=s,n[ru]=i,e=(s.mode&1)!==0,r){case"dialog":qt("cancel",n),qt("close",n);break;case"iframe":case"object":case"embed":qt("load",n);break;case"video":case"audio":for(a=0;a<Td.length;a++)qt(Td[a],n);break;case"source":qt("error",n);break;case"img":case"image":case"link":qt("error",n),qt("load",n);break;case"details":qt("toggle",n);break;case"input":$b(n,i),qt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},qt("invalid",n);break;case"textarea":Ub(n,i),qt("invalid",n)}cg(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Em(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Em(n.textContent,l,e),a=["children",""+l]):Gd.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&qt("scroll",n)}switch(r){case"input":Nm(n),zb(n,i,!0);break;case"textarea":Nm(n),Vb(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Eh)}n=a,s.updateQueue=n,n!==null&&(s.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pS(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[fa]=s,e[ru]=n,OC(e,s,!1,!1),s.stateNode=e;e:{switch(o=dg(r,n),r){case"dialog":qt("cancel",e),qt("close",e),a=n;break;case"iframe":case"object":case"embed":qt("load",e),a=n;break;case"video":case"audio":for(a=0;a<Td.length;a++)qt(Td[a],e);a=n;break;case"source":qt("error",e),a=n;break;case"img":case"image":case"link":qt("error",e),qt("load",e),a=n;break;case"details":qt("toggle",e),a=n;break;case"input":$b(e,n),a=ng(e,n),qt("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=ls({},n,{value:void 0}),qt("invalid",e);break;case"textarea":Ub(e,n),a=og(e,n),qt("invalid",e);break;default:a=n}cg(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?gS(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&fS(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Hd(e,c):typeof c=="number"&&Hd(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Gd.hasOwnProperty(i)?c!=null&&i==="onScroll"&&qt("scroll",e):c!=null&&Yy(e,i,c,o))}switch(r){case"input":Nm(e),zb(e,n,!1);break;case"textarea":Nm(e),Vb(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Qi(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Ul(e,!!n.multiple,i,!1):n.defaultValue!=null&&Ul(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Eh)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return sr(s),null;case 6:if(e&&s.stateNode!=null)zC(e,s,e.memoizedProps,n);else{if(typeof n!="string"&&s.stateNode===null)throw Error(Ne(166));if(r=Ao(au.current),Ao(ja.current),Im(s)){if(n=s.stateNode,r=s.memoizedProps,n[fa]=s,(i=n.nodeValue!==r)&&(e=Yr,e!==null))switch(e.tag){case 3:Em(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Em(n.nodeValue,r,(e.mode&1)!==0)}i&&(s.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[fa]=s,s.stateNode=n}return sr(s),null;case 13:if(Gt(rs),n=s.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Yt&&Hr!==null&&s.mode&1&&!(s.flags&128))nC(),Cc(),s.flags|=98560,i=!1;else if(i=Im(s),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(Ne(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Ne(317));i[fa]=s}else Cc(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;sr(s),i=!1}else On!==null&&(qg(On),On=null),i=!0;if(!i)return s.flags&65536?s:null}return s.flags&128?(s.lanes=r,s):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(s.child.flags|=8192,s.mode&1&&(e===null||rs.current&1?Fs===0&&(Fs=3):I0())),s.updateQueue!==null&&(s.flags|=4),sr(s),null);case 4:return Tc(),Dg(e,s),e===null&&tu(s.stateNode.containerInfo),sr(s),null;case 10:return f0(s.type._context),sr(s),null;case 17:return Lr(s.type)&&Ih(),sr(s),null;case 19:if(Gt(rs),i=s.memoizedState,i===null)return sr(s),null;if(n=(s.flags&128)!==0,o=i.rendering,o===null)if(n)xd(i,!1);else{if(Fs!==0||e!==null&&e.flags&128)for(e=s.child;e!==null;){if(o=$h(e),o!==null){for(s.flags|=128,xd(i,!1),n=o.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),s.subtreeFlags=0,n=r,r=s.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return zt(rs,rs.current&1|2),s.child}e=e.sibling}i.tail!==null&&bs()>_c&&(s.flags|=128,n=!0,xd(i,!1),s.lanes=4194304)}else{if(!n)if(e=$h(o),e!==null){if(s.flags|=128,n=!0,r=e.updateQueue,r!==null&&(s.updateQueue=r,s.flags|=4),xd(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Yt)return sr(s),null}else 2*bs()-i.renderingStartTime>_c&&r!==1073741824&&(s.flags|=128,n=!0,xd(i,!1),s.lanes=4194304);i.isBackwards?(o.sibling=s.child,s.child=o):(r=i.last,r!==null?r.sibling=o:s.child=o,i.last=o)}return i.tail!==null?(s=i.tail,i.rendering=s,i.tail=s.sibling,i.renderingStartTime=bs(),s.sibling=null,r=rs.current,zt(rs,n?r&1|2:r&1),s):(sr
vendor: 13,918 bytes, line 40
40(s),null);case 22:case 23:return E0(),n=s.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(s.flags|=8192),n&&s.mode&1?Ur&1073741824&&(sr(s),s.subtreeFlags&6&&(s.flags|=8192)):sr(s),null;case 24:return null;case 25:return null}throw Error(Ne(156,s.tag))}function gR(e,s){switch(u0(s),s.tag){case 1:return Lr(s.type)&&Ih(),e=s.flags,e&65536?(s.flags=e&-65537|128,s):null;case 3:return Tc(),Gt(Dr),Gt(ir),b0(),e=s.flags,e&65536&&!(e&128)?(s.flags=e&-65537|128,s):null;case 5:return v0(s),null;case 13:if(Gt(rs),e=s.memoizedState,e!==null&&e.dehydrated!==null){if(s.alternate===null)throw Error(Ne(340));Cc()}return e=s.flags,e&65536?(s.flags=e&-65537|128,s):null;case 19:return Gt(rs),null;case 4:return Tc(),null;case 10:return f0(s.type._context),null;case 22:case 23:return E0(),null;case 24:return null;default:return null}}var Fm=!1,ar=!1,yR=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Ll(e,s){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ms(e,s,n)}else r.current=null}function Lg(e,s,r){try{r()}catch(n){ms(e,s,n)}}var Ej=!1;function vR(e,s){if(bg=Th,e=WS(),c0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var x;h!==r||a!==0&&h.nodeType!==3||(l=o+a),h!==i||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(x=h.firstChild)!==null;)p=h,h=x;for(;;){if(h===e)break t;if(p===r&&++d===a&&(l=o),p===i&&++u===n&&(c=o),(x=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=x}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(jg={focusedElem:e,selectionRange:r},Th=!1,Be=s;Be!==null;)if(s=Be,e=s.child,(s.subtreeFlags&1028)!==0&&e!==null)e.return=s,Be=e;else for(;Be!==null;){s=Be;try{var v=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var f=v.memoizedProps,b=v.memoizedState,y=s.stateNode,g=y.getSnapshotBeforeUpdate(s.elementType===s.type?f:Fn(s.type,f),b);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var j=s.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ne(163))}}catch(N){ms(s,s.return,N)}if(e=s.sibling,e!==null){e.return=s.return,Be=e;break}Be=s.return}return v=Ej,Ej=!1,v}function $d(e,s,r){var n=s.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Lg(s,r,i)}a=a.next}while(a!==n)}}function Vp(e,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==s)}}function Og(e){var s=e.ref;if(s!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof s=="function"?s(e):s.current=e}}function UC(e){var s=e.alternate;s!==null&&(e.alternate=null,UC(s)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(s=e.stateNode,s!==null&&(delete s[fa],delete s[ru],delete s[kg],delete s[tR],delete s[sR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function VC(e){return e.tag===5||e.tag===3||e.tag===4}function Ij(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||VC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $g(e,s,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,s?r.nodeType===8?r.parentNode.insertBefore(e,s):r.insertBefore(e,s):(r.nodeType===8?(s=r.parentNode,s.insertBefore(e,r)):(s=r,s.appendChild(e)),r=r._reactRootContainer,r!=null||s.onclick!==null||(s.onclick=Eh));else if(n!==4&&(e=e.child,e!==null))for($g(e,s,r),e=e.sibling;e!==null;)$g(e,s,r),e=e.sibling}function zg(e,s,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,s?r.insertBefore(e,s):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(zg(e,s,r),e=e.sibling;e!==null;)zg(e,s,r),e=e.sibling}var Xs=null,Ln=!1;function xi(e,s,r){for(r=r.child;r!==null;)BC(e,s,r),r=r.sibling}function BC(e,s,r){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(Rp,r)}catch{}switch(r.tag){case 5:ar||Ll(r,s);case 6:var n=Xs,a=Ln;Xs=null,xi(e,s,r),Xs=n,Ln=a,Xs!==null&&(Ln?(e=Xs,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xs.removeChild(r.stateNode));break;case 18:Xs!==null&&(Ln?(e=Xs,r=r.stateNode,e.nodeType===8?ax(e.parentNode,r):e.nodeType===1&&ax(e,r),Zd(e)):ax(Xs,r.stateNode));break;case 4:n=Xs,a=Ln,Xs=r.stateNode.containerInfo,Ln=!0,xi(e,s,r),Xs=n,Ln=a;break;case 0:case 11:case 14:case 15:if(!ar&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Lg(r,s,o),a=a.next}while(a!==n)}xi(e,s,r);break;case 1:if(!ar&&(Ll(r,s),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){ms(r,s,l)}xi(e,s,r);break;case 21:xi(e,s,r);break;case 22:r.mode&1?(ar=(n=ar)||r.memoizedState!==null,xi(e,s,r),ar=n):xi(e,s,r);break;default:xi(e,s,r)}}function Mj(e){var s=e.updateQueue;if(s!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yR),s.forEach(function(n){var a=TR.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Mn(e,s){var r=s.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=s,l=o;e:for(;l!==null;){switch(l.tag){case 5:Xs=l.stateNode,Ln=!1;break e;case 3:Xs=l.stateNode.containerInfo,Ln=!0;break e;case 4:Xs=l.stateNode.containerInfo,Ln=!0;break e}l=l.return}if(Xs===null)throw Error(Ne(160));BC(i,o,a),Xs=null,Ln=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){ms(a,s,d)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)qC(s,e),s=s.sibling}function qC(e,s){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mn(s,e),ca(e),n&4){try{$d(3,e,e.return),Vp(3,e)}catch(f){ms(e,e.return,f)}try{$d(5,e,e.return)}catch(f){ms(e,e.return,f)}}break;case 1:Mn(s,e),ca(e),n&512&&r!==null&&Ll(r,r.return);break;case 5:if(Mn(s,e),ca(e),n&512&&r!==null&&Ll(r,r.return),e.flags&32){var a=e.stateNode;try{Hd(a,"")}catch(f){ms(e,e.return,f)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&mS(a,i),dg(l,o);var d=dg(l,i);for(o=0;o<c.length;o+=2){var u=c[o],h=c[o+1];u==="style"?gS(a,h):u==="dangerouslySetInnerHTML"?fS(a,h):u==="children"?Hd(a,h):Yy(a,u,h,d)}switch(l){case"input":ag(a,i);break;case"textarea":hS(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var x=i.value;x!=null?Ul(a,!!i.multiple,x,!1):p!==!!i.multiple&&(i.defaultValue!=null?Ul(a,!!i.multiple,i.defaultValue,!0):Ul(a,!!i.multiple,i.multiple?[]:"",!1))}a[ru]=i}catch(f){ms(e,e.return,f)}}break;case 6:if(Mn(s,e),ca(e),n&4){if(e.stateNode===null)throw Error(Ne(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(f){ms(e,e.return,f)}}break;case 3:if(Mn(s,e),ca(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Zd(s.containerInfo)}catch(f){ms(e,e.return,f)}break;case 4:Mn(s,e),ca(e);break;case 13:Mn(s,e),ca(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(A0=bs())),n&4&&Mj(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(ar=(d=ar)||u,Mn(s,e),ar=d):Mn(s,e),ca(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(Be=e,u=e.child;u!==null;){for(h=Be=u;Be!==null;){switch(p=Be,x=p.child,p.tag){case 0:case 11:case 14:case 15:$d(4,p,p.return);break;case 1:Ll(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){n=p,r=p.return;try{s=n,v.props=s.memoizedProps,v.state=s.memoizedState,v.componentWillUnmount()}catch(f){ms(n,r,f)}}break;case 5:Ll(p,p.return);break;case 22:if(p.memoizedState!==null){Fj(h);continue}}x!==null?(x.return=p,Be=x):Fj(h)}u=u.sibling}e:for(u=null,h=e;;){if(h.tag===5){if(u===null){u=h;try{a=h.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=xS("display",o))}catch(f){ms(e,e.return,f)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(f){ms(e,e.return,f)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Mn(s,e),ca(e),n&4&&Mj(e);break;case 21:break;default:Mn(s,e),ca(e)}}function ca(e){var s=e.flags;if(s&2){try{e:{for(var r=e.return;r!==null;){if(VC(r)){var n=r;break e}r=r.return}throw Error(Ne(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(Hd(a,""),n.flags&=-33);var i=Ij(e);zg(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Ij(e);$g(e,l,o);break;default:throw Error(Ne(161))}}catch(c){ms(e,e.return,c)}e.flags&=-3}s&4096&&(e.flags&=-4097)}function bR(e,s,r){Be=e,WC(e)}function WC(e,s,r){for(var n=(e.mode&1)!==0;Be!==null;){var a=Be,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||Fm;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||ar;l=Fm;var d=ar;if(Fm=o,(ar=c)&&!d)for(Be=a;Be!==null;)o=Be,c=o.child,o.tag===22&&o.memoizedState!==null?Dj(a):c!==null?(c.return=o,Be=c):Dj(a);for(;i!==null;)Be=i,WC(i),i=i.sibling;Be=a,Fm=l,ar=d}Rj(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Be=i):Rj(e)}}function Rj(e){for(;Be!==null;){var s=Be;if(s.flags&8772){var r=s.alternate;try{if(s.flags&8772)switch(s.tag){case 0:case 11:case 15:ar||Vp(5,s);break;case 1:var n=s.stateNode;if(s.flags&4&&!ar)if(r===null)n.componentDidMount();else{var a=s.elementType===s.type?r.memoizedProps:Fn(s.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=s.updateQueue;i!==null&&yj(s,i,n);break;case 3:var o=s.updateQueue;if(o!==null){if(r=null,s.child!==null)switch(s.child.tag){case 5:r=s.child.stateNode;break;case 1:r=s.child.stateNode}yj(s,o,r)}break;case 5:var l=s.stateNode;if(r===null&&s.flags&4){r=l;var c=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var d=s.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&Zd(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ne(163))}ar||s.flags&512&&Og(s)}catch(p){ms(s,s.return,p)}}if(s===e){Be=null;break}if(r=s.sibling,r!==null){r.return=s.return,Be=r;break}Be=s.return}}function Fj(e){for(;Be!==null;){var s=Be;if(s===e){Be=null;break}var r=s.sibling;if(r!==null){r.return=s.return,Be=r;break}Be=s.return}}function Dj(e){for(;Be!==null;){var s=Be;try{switch(s.tag){case 0:case 11:case 15:var r=s.return;try{Vp(4,s)}catch(c){ms(s,r,c)}break;case 1:var n=s.stateNode;if(typeof n.componentDidMount=="function"){var a=s.return;try{n.componentDidMount()}catch(c){ms(s,a,c)}}var i=s.return;try{Og(s)}catch(c){ms(s,i,c)}break;case 5:var o=s.return;try{Og(s)}catch(c){ms(s,o,c)}}}catch(c){ms(s,s.return,c)}if(s===e){Be=null;break}var l=s.sibling;if(l!==null){l.return=s.return,Be=l;break}Be=s.return}}var jR=Math.ceil,Vh=ui.ReactCurrentDispatcher,P0=ui.ReactCurrentOwner,fn=ui.ReactCurrentBatchConfig,At=0,Bs=null,_s=null,Zs=0,Ur=0,Ol=co(0),Fs=0,cu=null,qo=0,Bp=0,T0=0,zd=null,Er=null,A0=0,_c=1/0,Va=null,Bh=!1,Ug=null,Wi=null,Dm=!1,Oi=null,qh=0,Ud=0,Vg=null,lh=-1,ch=0;function pr(){return At&6?bs():lh!==-1?lh:lh=bs()}function Ki(e){return e.mode&1?At&2&&Zs!==0?Zs&-Zs:nR.transition!==null?(ch===0&&(ch=AS()),ch):(e=Ot,e!==0||(e=window.event,e=e===void 0?16:DS(e.type)),e):1}function Bn(e,s,r,n){if(50<Ud)throw Ud=0,Vg=null,Error(Ne(185));Ku(e,r,n),(!(At&2)||e!==Bs)&&(e===Bs&&(!(At&2)&&(Bp|=r),Fs===4&&Ci(e,Zs)),Or(e,n),r===1&&At===0&&!(s.mode&1)&&(_c=bs()+500,$p&&uo()))}function Or(e,s){var r=e.callbackNode;n8(e,s);var n=Ph(e,e===Bs?Zs:0);if(n===0)r!==null&&Wb(r),e.callbackNode=null,e.callbackPriority=0;else if(s=n&-n,e.callbackPriority!==s){if(r!=null&&Wb(r),s===1)e.tag===0?rR(Lj.bind(null,e)):tC(Lj.bind(null,e)),J8(function(){!(At&6)&&uo()}),r=null;else{switch(_S(n)){case 1:r=t0;break;case 4:r=PS;break;case 16:r=Ch;break;case 536870912:r=TS;break;default:r=Ch}r=JC(r,KC.bind(null,e))}e.callbackPriority=s,e.callbackNode=r}}function KC(e,s){if(lh=-1,ch=0,At&6)throw Error(Ne(327));var r=e.callbackNode;if(Kl()&&e.callbackNode!==r)return null;var n=Ph(e,e===Bs?Zs:0);if(n===0)return null;if(n&30||n&e.expiredLanes||s)s=Wh(e,n);else{s=n;var a=At;At|=2;var i=HC();(Bs!==e||Zs!==s)&&(Va=null,_c=bs()+500,Oo(e,s));do try{kR();break}catch(l){GC(e,l)}while(!0);p0(),Vh.current=i,At=a,_s!==null?s=0:(Bs=null,Zs=0,s=Fs)}if(s!==0){if(s===2&&(a=fg(e),a!==0&&(n=a,s=Bg(e,a))),s===1)throw r=cu,Oo(e,0),Ci(e,n),Or(e,bs()),r;if(s===6)Ci(e,n);else{if(a=e.current.alternate,!(n&30)&&!wR(a)&&(s=Wh(e,n),s===2&&(i=fg(e),i!==0&&(n=i,s=Bg(e,i))),s===1))throw r=cu,Oo(e,0),Ci(e,n),Or(e,bs()),r;switch(e.finishedWork=a,e.finishedLanes=n,s){case 0:case 1:throw Error(Ne(345));case 2:No(e,Er,Va);break;case 3:if(Ci(e,n),(n&130023424)===n&&(s=A0+500-bs(),10<s)){if(Ph(e,0)!==0)break;
vendor: 1,628 bytes, line 40
40if(a=e.suspendedLanes,(a&n)!==n){pr(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ng(No.bind(null,e,Er,Va),s);break}No(e,Er,Va);break;case 4:if(Ci(e,n),(n&4194240)===n)break;for(s=e.eventTimes,a=-1;0<n;){var o=31-Vn(n);i=1<<o,o=s[o],o>a&&(a=o),n&=~i}if(n=a,n=bs()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jR(n/1960))-n,10<n){e.timeoutHandle=Ng(No.bind(null,e,Er,Va),n);break}No(e,Er,Va);break;case 5:No(e,Er,Va);break;default:throw Error(Ne(329))}}}return Or(e,bs()),e.callbackNode===r?KC.bind(null,e):null}function Bg(e,s){var r=zd;return e.current.memoizedState.isDehydrated&&(Oo(e,s).flags|=256),e=Wh(e,s),e!==2&&(s=Er,Er=r,s!==null&&qg(s)),e}function qg(e){Er===null?Er=e:Er.push.apply(Er,e)}function wR(e){for(var s=e;;){if(s.flags&16384){var r=s.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!Gn(i(),a))return!1}catch{return!1}}}if(r=s.child,s.subtreeFlags&16384&&r!==null)r.return=s,s=r;else{if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ci(e,s){for(s&=~T0,s&=~Bp,e.suspendedLanes|=s,e.pingedLanes&=~s,e=e.expirationTimes;0<s;){var r=31-Vn(s),n=1<<r;e[r]=-1,s&=~n}}function Lj(e){if(At&6)throw Error(Ne(327));Kl();var s=Ph(e,0);if(!(s&1))return Or(e,bs()),null;var r=Wh(e,s);if(e.tag!==0&&r===2){var n=fg(e);n!==0&&(s=n,r=Bg(e,n))}if(r===1)throw r=cu,Oo(e,0),Ci(e,s),Or(e,bs()),r;if(r===6)throw Error(Ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=s,No(e,Er,Va),Or(e,bs()),null}
vendor: 10,869 bytes, line 40
40function _0(e,s){var r=At;At|=1;try{return e(s)}finally{At=r,At===0&&(_c=bs()+500,$p&&uo())}}function Wo(e){Oi!==null&&Oi.tag===0&&!(At&6)&&Kl();var s=At;At|=1;var r=fn.transition,n=Ot;try{if(fn.transition=null,Ot=1,e)return e()}finally{Ot=n,fn.transition=r,At=s,!(At&6)&&uo()}}function E0(){Ur=Ol.current,Gt(Ol)}function Oo(e,s){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Z8(r)),_s!==null)for(r=_s.return;r!==null;){var n=r;switch(u0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ih();break;case 3:Tc(),Gt(Dr),Gt(ir),b0();break;case 5:v0(n);break;case 4:Tc();break;case 13:Gt(rs);break;case 19:Gt(rs);break;case 10:f0(n.type._context);break;case 22:case 23:E0()}r=r.return}if(Bs=e,_s=e=Gi(e.current,null),Zs=Ur=s,Fs=0,cu=null,T0=Bp=qo=0,Er=zd=null,To!==null){for(s=0;s<To.length;s++)if(r=To[s],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}To=null}return e}function GC(e,s){do{var r=_s;try{if(p0(),ah.current=Uh,zh){for(var n=is.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}zh=!1}if(Bo=0,Vs=Ms=is=null,Od=!1,iu=0,P0.current=null,r===null||r.return===null){Fs=1,cu=s,_s=null;break}e:{var i=e,o=r.return,l=r,c=s;if(s=Zs,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var x=kj(o);if(x!==null){x.flags&=-257,Sj(x,o,l,i,s),x.mode&1&&Nj(i,d,s),s=x,c=d;var v=s.updateQueue;if(v===null){var f=new Set;f.add(c),s.updateQueue=f}else v.add(c);break e}else{if(!(s&1)){Nj(i,d,s),I0();break e}c=Error(Ne(426))}}else if(Yt&&l.mode&1){var b=kj(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Sj(b,o,l,i,s),m0(Ac(c,l));break e}}i=c=Ac(c,l),Fs!==4&&(Fs=2),zd===null?zd=[i]:zd.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,s&=-s,i.lanes|=s;var y=_C(i,c,s);gj(i,y);break e;case 1:l=c;var g=i.type,j=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Wi===null||!Wi.has(j)))){i.flags|=65536,s&=-s,i.lanes|=s;var N=EC(i,l,s);gj(i,N);break e}}i=i.return}while(i!==null)}YC(r)}catch(w){s=w,_s===r&&r!==null&&(_s=r=r.return);continue}break}while(!0)}function HC(){var e=Vh.current;return Vh.current=Uh,e===null?Uh:e}function I0(){(Fs===0||Fs===3||Fs===2)&&(Fs=4),Bs===null||!(qo&268435455)&&!(Bp&268435455)||Ci(Bs,Zs)}function Wh(e,s){var r=At;At|=2;var n=HC();(Bs!==e||Zs!==s)&&(Va=null,Oo(e,s));do try{NR();break}catch(a){GC(e,a)}while(!0);if(p0(),At=r,Vh.current=n,_s!==null)throw Error(Ne(261));return Bs=null,Zs=0,Fs}function NR(){for(;_s!==null;)QC(_s)}function kR(){for(;_s!==null&&!QM();)QC(_s)}function QC(e){var s=ZC(e.alternate,e,Ur);e.memoizedProps=e.pendingProps,s===null?YC(e):_s=s,P0.current=null}function YC(e){var s=e;do{var r=s.alternate;if(e=s.return,s.flags&32768){if(r=gR(r,s),r!==null){r.flags&=32767,_s=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fs=6,_s=null;return}}else if(r=xR(r,s,Ur),r!==null){_s=r;return}if(s=s.sibling,s!==null){_s=s;return}_s=s=e}while(s!==null);Fs===0&&(Fs=5)}function No(e,s,r){var n=Ot,a=fn.transition;try{fn.transition=null,Ot=1,SR(e,s,r,n)}finally{fn.transition=a,Ot=n}return null}function SR(e,s,r,n){do Kl();while(Oi!==null);if(At&6)throw Error(Ne(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Ne(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(a8(e,i),e===Bs&&(_s=Bs=null,Zs=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Dm||(Dm=!0,JC(Ch,function(){return Kl(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=fn.transition,fn.transition=null;var o=Ot;Ot=1;var l=At;At|=4,P0.current=null,vR(e,r),qC(r,e),W8(jg),Th=!!bg,jg=bg=null,e.current=r,bR(r),YM(),At=l,Ot=o,fn.transition=i}else e.current=r;if(Dm&&(Dm=!1,Oi=e,qh=a),i=e.pendingLanes,i===0&&(Wi=null),JM(r.stateNode),Or(e,bs()),s!==null)for(n=e.onRecoverableError,r=0;r<s.length;r++)a=s[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Bh)throw Bh=!1,e=Ug,Ug=null,e;return qh&1&&e.tag!==0&&Kl(),i=e.pendingLanes,i&1?e===Vg?Ud++:(Ud=0,Vg=e):Ud=0,uo(),null}function Kl(){if(Oi!==null){var e=_S(qh),s=fn.transition,r=Ot;try{if(fn.transition=null,Ot=16>e?16:e,Oi===null)var n=!1;else{if(e=Oi,Oi=null,qh=0,At&6)throw Error(Ne(331));var a=At;for(At|=4,Be=e.current;Be!==null;){var i=Be,o=i.child;if(Be.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Be=d;Be!==null;){var u=Be;switch(u.tag){case 0:case 11:case 15:$d(8,u,i)}var h=u.child;if(h!==null)h.return=u,Be=h;else for(;Be!==null;){u=Be;var p=u.sibling,x=u.return;if(UC(u),u===d){Be=null;break}if(p!==null){p.return=x,Be=p;break}Be=x}}}var v=i.alternate;if(v!==null){var f=v.child;if(f!==null){v.child=null;do{var b=f.sibling;f.sibling=null,f=b}while(f!==null)}}Be=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Be=o;else e:for(;Be!==null;){if(i=Be,i.flags&2048)switch(i.tag){case 0:case 11:case 15:$d(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Be=y;break e}Be=i.return}}var g=e.current;for(Be=g;Be!==null;){o=Be;var j=o.child;if(o.subtreeFlags&2064&&j!==null)j.return=o,Be=j;else e:for(o=g;Be!==null;){if(l=Be,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Vp(9,l)}}catch(w){ms(l,l.return,w)}if(l===o){Be=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,Be=N;break e}Be=l.return}}if(At=a,uo(),ba&&typeof ba.onPostCommitFiberRoot=="function")try{ba.onPostCommitFiberRoot(Rp,e)}catch{}n=!0}return n}finally{Ot=r,fn.transition=s}}return!1}function Oj(e,s,r){s=Ac(r,s),s=_C(e,s,1),e=qi(e,s,1),s=pr(),e!==null&&(Ku(e,1,s),Or(e,s))}function ms(e,s,r){if(e.tag===3)Oj(e,e,r);else for(;s!==null;){if(s.tag===3){Oj(s,e,r);break}else if(s.tag===1){var n=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Wi===null||!Wi.has(n))){e=Ac(r,e),e=EC(s,e,1),s=qi(s,e,1),e=pr(),s!==null&&(Ku(s,1,e),Or(s,e));break}}s=s.return}}function CR(e,s,r){var n=e.pingCache;n!==null&&n.delete(s),s=pr(),e.pingedLanes|=e.suspendedLanes&r,Bs===e&&(Zs&r)===r&&(Fs===4||Fs===3&&(Zs&130023424)===Zs&&500>bs()-A0?Oo(e,0):T0|=r),Or(e,s)}function XC(e,s){s===0&&(e.mode&1?(s=Cm,Cm<<=1,!(Cm&130023424)&&(Cm=4194304)):s=1);var r=pr();e=ti(e,s),e!==null&&(Ku(e,s,r),Or(e,r))}function PR(e){var s=e.memoizedState,r=0;s!==null&&(r=s.retryLane),XC(e,r)}function TR(e,s){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Ne(314))}n!==null&&n.delete(s),XC(e,r)}var ZC;ZC=function(e,s,r){if(e!==null)if(e.memoizedProps!==s.pendingProps||Dr.current)Mr=!0;else{if(!(e.lanes&r)&&!(s.flags&128))return Mr=!1,fR(e,s,r);Mr=!!(e.flags&131072)}else Mr=!1,Yt&&s.flags&1048576&&sC(s,Fh,s.index);switch(s.lanes=0,s.tag){case 2:var n=s.type;oh(e,s),e=s.pendingProps;var a=Sc(s,ir.current);Wl(s,r),a=w0(null,s,n,e,a,r);var i=N0();return s.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Lr(n)?(i=!0,Mh(s)):i=!1,s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,g0(s),a.updater=Up,s.stateNode=a,a._reactInternals=s,_g(s,n,e,r),s=Mg(null,s,n,!0,i,r)):(s.tag=0,Yt&&i&&d0(s),ur(null,s,a,r),s=s.child),s;case 16:n=s.elementType;e:{switch(oh(e,s),e=s.pendingProps,a=n._init,n=a(n._payload),s.type=n,a=s.tag=_R(n),e=Fn(n,e),a){case 0:s=Ig(null,s,n,e,r);break e;case 1:s=Tj(null,s,n,e,r);break e;case 11:s=Cj(null,s,n,e,r);break e;case 14:s=Pj(null,s,n,Fn(n.type,e),r);break e}throw Error(Ne(306,n,""))}return s;case 0:return n=s.type,a=s.pendingProps,a=s.elementType===n?a:Fn(n,a),Ig(e,s,n,a,r);case 1:return n=s.type,a=s.pendingProps,a=s.elementType===n?a:Fn(n,a),Tj(e,s,n,a,r);case 3:e:{if(FC(s),e===null)throw Error(Ne(387));n=s.pendingProps,i=s.memoizedState,a=i.element,lC(e,s),Oh(s,n,null,r);var o=s.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},s.updateQueue.baseState=i,s.memoizedState=i,s.flags&256){a=Ac(Error(Ne(423)),s),s=Aj(e,s,n,r,a);break e}else if(n!==a){a=Ac(Error(Ne(424)),s),s=Aj(e,s,n,r,a);break e}else for(Hr=Bi(s.stateNode.containerInfo.firstChild),Yr=s,Yt=!0,On=null,r=iC(s,null,n,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Cc(),n===a){s=si(e,s,r);break e}ur(e,s,n,r)}s=s.child}return s;case 5:return cC(s),e===null&&Pg(s),n=s.type,a=s.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,wg(n,a)?o=null:i!==null&&wg(n,i)&&(s.flags|=32),RC(e,s),ur(e,s,o,r),s.child;case 6:return e===null&&Pg(s),null;case 13:return DC(e,s,r);case 4:return y0(s,s.stateNode.containerInfo),n=s.pendingProps,e===null?s.child=Pc(s,null,n,r):ur(e,s,n,r),s.child;case 11:return n=s.type,a=s.pendingProps,a=s.elementType===n?a:Fn(n,a),Cj(e,s,n,a,r);case 7:return ur(e,s,s.pendingProps,r),s.child;case 8:return ur(e,s,s.pendingProps.children,r),s.child;case 12:return ur(e,s,s.pendingProps.children,r),s.child;case 10:e:{if(n=s.type._context,a=s.pendingProps,i=s.memoizedProps,o=a.value,zt(Dh,n._currentValue),n._currentValue=o,i!==null)if(Gn(i.value,o)){if(i.children===a.children&&!Dr.current){s=si(e,s,r);break e}}else for(i=s.child,i!==null&&(i.return=s);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Ya(-1,r&-r),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Tg(i.return,r,s),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===s.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Ne(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Tg(o,r,s),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===s){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ur(e,s,a.children,r),s=s.child}return s;case 9:return a=s.type,n=s.pendingProps.children,Wl(s,r),a=yn(a),n=n(a),s.flags|=1,ur(e,s,n,r),s.child;case 14:return n=s.type,a=Fn(n,s.pendingProps),a=Fn(n.type,a),Pj(e,s,n,a,r);case 15:return IC(e,s,s.type,s.pendingProps,r);case 17:return n=s.type,a=s.pendingProps,a=s.elementType===n?a:Fn(n,a),oh(e,s),s.tag=1,Lr(n)?(e=!0,Mh(s)):e=!1,Wl(s,r),AC(s,n,a),_g(s,n,a,r),Mg(null,s,n,!0,e,r);case 19:return LC(e,s,r);case 22:return MC(e,s,r)}throw Error(Ne(156,s.tag))};function JC(e,s){return CS(e,s)}function AR(e,s,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 4,098 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,s,r,n){return new AR(e,s,r,n)}function M0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _R(e){if(typeof e=="function")return M0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zy)return 11;if(e===Jy)return 14}return 2}function Gi(e,s){var r=e.alternate;return r===null?(r=pn(e.tag,s,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=s,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,s=e.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function dh(e,s,r,n,a,i){var o=2;if(n=e,typeof e=="function")M0(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Tl:return $o(r.children,a,i,s);case Xy:o=8,a|=8;break;case eg:return e=pn(12,r,s,a|2),e.elementType=eg,e.lanes=i,e;case tg:return e=pn(13,r,s,a),e.elementType=tg,e.lanes=i,e;case sg:return e=pn(19,r,s,a),e.elementType=sg,e.lanes=i,e;case cS:return qp(r,a,i,s);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oS:o=10;break e;case lS:o=9;break e;case Zy:o=11;break e;case Jy:o=14;break e;case Ni:o=16,n=null;break e}throw Error(Ne(130,e==null?e:typeof e,""))}return s=pn(o,r,s,a),s.elementType=e,s.type=n,s.lanes=i,s}function $o(e,s,r,n){return e=pn(7,e,n,s),e.lanes=r,e}function qp(e,s,r,n){return e=pn(22,e,n,s),e.elementType=cS,e.lanes=r,e.stateNode={isHidden:!1},e}function hx(e,s,r){return e=pn(6,e,null,s),e.lanes=r,e}function px(e,s,r){return s=pn(4,e.children!==null?e.children:[],e.key,s),s.lanes=r,s.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},s}function ER(e,s,r,n,a){this.tag=s,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hf(0),this.expirationTimes=Hf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hf(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function R0(e,s,r,n,a,i,o,l,c){return e=new ER(e,s,r,l,c),s===1?(s=1,i===!0&&(s|=8)):s=0,i=pn(3,null,null,s),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},g0(i),e}function IR(e,s,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pl,key:n==null?null:""+n,children:e,containerInfo:s,implementation:r}}function e3(e){if(!e)return Yi;e=e._reactInternals;e:{if(ol(e)!==e||e.tag!==1)throw Error(Ne(170));var s=e;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Lr(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(Ne(171))}if(e.tag===1){var r=e.type;if(Lr(r))return eC(e,r,s)}return s}function t3(e,s,r,n,a,i,o,l,c){return e=R0(r,n,!0,e,a,i,o,l,c),e.context=e3(null),r=e.current,n=pr(),a=Ki(r),i=Ya(n,a),i.callback=s??null,qi(r,i,a),e.current.lanes=a,Ku(e,a,n),Or(e,n),e}function Wp(e,s,r,n){var a=s.current,i=pr(),o=Ki(a);return r=e3(r),s.context===null?s.context=r:s.pendingContext=r,s=Ya(i,o),s.payload={element:e},n=n===void 0?null:n,n!==null&&(s.callback=n),e=qi(a,s,o),e!==null&&(Bn(e,a,o,i),nh(e,a,o)),o}function Kh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $j(e,s){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<s?r:s}}
vendor: 4,845 bytes, line 40
40function F0(e,s){$j(e,s),(e=e.alternate)&&$j(e,s)}function MR(){return null}var s3=typeof reportError=="function"?reportError:function(e){console.error(e)};function D0(e){this._internalRoot=e}Kp.prototype.render=D0.prototype.render=function(e){var s=this._internalRoot;if(s===null)throw Error(Ne(409));Wp(e,s,null,null)};Kp.prototype.unmount=D0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var s=e.containerInfo;Wo(function(){Wp(null,e,null,null)}),s[ei]=null}};function Kp(e){this._internalRoot=e}Kp.prototype.unstable_scheduleHydration=function(e){if(e){var s=MS();e={blockedOn:null,target:e,priority:s};for(var r=0;r<Si.length&&s!==0&&s<Si[r].priority;r++);Si.splice(r,0,e),r===0&&FS(e)}};function L0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Gp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zj(){}function RR(e,s,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var d=Kh(o);i.call(d)}}var o=t3(s,n,e,0,null,!1,!1,"",zj);return e._reactRootContainer=o,e[ei]=o.current,tu(e.nodeType===8?e.parentNode:e),Wo(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var d=Kh(c);l.call(d)}}var c=R0(e,0,!1,null,null,!1,!1,"",zj);return e._reactRootContainer=c,e[ei]=c.current,tu(e.nodeType===8?e.parentNode:e),Wo(function(){Wp(s,c,r,n)}),c}function Hp(e,s,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Kh(o);l.call(c)}}Wp(s,o,e,a)}else o=RR(r,s,e,a,n);return Kh(o)}ES=function(e){switch(e.tag){case 3:var s=e.stateNode;if(s.current.memoizedState.isDehydrated){var r=Pd(s.pendingLanes);r!==0&&(s0(s,r|1),Or(s,bs()),!(At&6)&&(_c=bs()+500,uo()))}break;case 13:Wo(function(){var n=ti(e,1);if(n!==null){var a=pr();Bn(n,e,1,a)}}),F0(e,1)}};r0=function(e){if(e.tag===13){var s=ti(e,134217728);if(s!==null){var r=pr();Bn(s,e,134217728,r)}F0(e,134217728)}};IS=function(e){if(e.tag===13){var s=Ki(e),r=ti(e,s);if(r!==null){var n=pr();Bn(r,e,s,n)}F0(e,s)}};MS=function(){return Ot};RS=function(e,s){var r=Ot;try{return Ot=e,s()}finally{Ot=r}};mg=function(e,s,r){switch(s){case"input":if(ag(e,r),s=r.name,r.type==="radio"&&s!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<r.length;s++){var n=r[s];if(n!==e&&n.form===e.form){var a=Op(n);if(!a)throw Error(Ne(90));uS(n),ag(n,a)}}}break;case"textarea":hS(e,r);break;case"select":s=r.value,s!=null&&Ul(e,!!r.multiple,s,!1)}};bS=_0;jS=Wo;var FR={usingClientEntryPoint:!1,Events:[Hu,Il,Op,yS,vS,_0]},gd={findFiberByHostInstance:Po,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},DR={bundleType:gd.bundleType,version:gd.version,rendererPackageName:gd.rendererPackageName,rendererConfig:gd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=kS(e),e===null?null:e.stateNode},findFiberByHostInstance:gd.findFiberByHostInstance||MR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lm.isDisabled&&Lm.supportsFiber)try{Rp=Lm.inject(DR),ba=Lm}catch{}}tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FR;tn.createPortal=function(e,s){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!L0(s))throw Error(Ne(200));return IR(e,s,null,r)};tn.createRoot=function(e,s){if(!L0(e))throw Error(Ne(299));var r=!1,n="",a=s3;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(n=s.identifierPrefix),s.onRecoverableError!==void 0&&(a=s.onRecoverableError)),s=R0(e,1,!1,null,null,r,!1,n,a),e[ei]=s.current,tu(e.nodeType===8?e.parentNode:e),new D0(s)};tn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var s=e._reactInternals;if(s===void 0)throw typeof e.render=="function"?Error(Ne(188)):(e=Object.keys(e).join(","),Error(Ne(268,e)));return e=kS(s),e=e===null?null:e.stateNode,e};tn.flushSync=function(e){return Wo(e)};tn.hydrate=function(e,s,r){if(!Gp(s))throw Error(Ne(200));return Hp(null,e,s,!0,r)};tn.hydrateRoot=function(e,s,r){if(!L0(e))throw Error(Ne(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=s3;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),s=t3(s,null,e,1,r??null,a,
40!1,i,o),e[ei]=s.current,tu(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[r,a]:s.mutableSourceEagerHydrationData.push(r,a);return new Kp(s)};tn.render=function(e,s,r){if(!Gp(s))throw Error(Ne(200));return Hp(null,e,s,!1,r)};tn.unmountComponentAtNode=function(e){if(!Gp(e))throw Error(Ne(40));return e._reactRootContainer?(Wo(function(){Hp(null,null,e,!1,function(){e._reactRootContainer=null,e[ei]=null})}),!0):!1};tn.unstable_batchedUpdates=_0;tn.unstable_renderSubtreeIntoContainer=function(e,s,r,n){if(!Gp(r))throw Error(Ne(200));if(e==null||e._reactInternals===void 0)throw Error(Ne(38));return Hp(e,s,r,!1,n)};tn.version="18.3.1-next-f1338f8080-20240426";function r3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r3)}catch(e){console.error(e)}}r3(),rS.exports=tn;var ll=rS.exports;const LR=qk(ll);var n3,Uj=ll;n3=Uj.createRoot,Uj.hydrateRoot;function OR(e,s){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,a,i,o=[],l="",c=e.split("/");for(c[0]||c.shift();a=c.shift();)r=a[0],r==="*"?(o.push(r),l+=a[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=a.indexOf("?",1),i=a.indexOf(".",1),o.push(a.substring(1,~n?n:~i?i:a.length)),l+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(l+=(~n?"?":"")+"\\"+a.substring(i))):l+="/"+a;return{keys:o,pattern:new RegExp("^"+l+(s?"(?=$|/)":"/?$"),"i")}}var a3={exports:{}},i3={};/**
41 * @license React
42 * use-sync-external-store-shim.production.min.js
43 *
44 * Copyright (c) Facebook, Inc. and its affiliates.
45 *
46 * This source code is licensed under the MIT license found in the
47 * LICENSE file in the root directory of this source tree.
48 */var Ec=m;function $R(e,s){return e===s&&(e!==0||1/e===1/s)||e!==e&&s!==s}var zR=typeof Object.is=="function"?Object.is:$R,UR=Ec.useState,VR=Ec.useEffect,BR=Ec.useLayoutEffect,qR=Ec.useDebugValue;function WR(e,s){var r=s(),n=UR({inst:{value:r,getSnapshot:s}}),a=n[0].inst,i=n[1];return BR(function(){a.value=r,a.getSnapshot=s,fx(a)&&i({inst:a})},[e,r,s]),VR(function(){return fx(a)&&i({inst:a}),e(function(){fx(a)&&i({inst:a})})},[e]),qR(r),r}function fx(e){var s=e.getSnapshot;e=e.value;try{var r=s();return!zR(e,r)}catch{return!0}}function KR(e,s){return s()}var GR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?KR:WR;i3.useSyncExternalStore=Ec.useSyncExternalStore!==void 0?Ec.useSyncExternalStore:GR;a3.exports=i3;var HR=a3.exports;const QR=tS.useInsertionEffect,YR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",o3=YR?m.useLayoutEffect:m.useEffect,XR=QR||o3,O0=e=>{const s=m.useRef([e,(...r)=>s[0](...r)]).current;return XR(()=>{s[0]=e}),s[1]},ZR="popstate",$0="pushState",z0="replaceState",JR="hashchange",Vj=[ZR,$0,z0,JR],eF=e=>{for(const s of Vj)addEventListener(s,e);return()=>{for(const s of Vj)removeEventListener(s,e)}},l3=(e,s)=>HR.useSyncExternalStore(eF,e,s),tF=()=>location.search,sF=({ssrSearch:e=""}={})=>l3(tF,()=>e),Bj=()=>location.pathname,rF=({ssrPath:e}={})=>l3(Bj,e?()=>e:Bj),nF=(e,{replace:s=!1,state:r=null}={})=>history[s?z0:$0](r,"",e),aF=(e={})=>[rF(e),nF],qj=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[qj]>"u"){for(const e of[$0,z0]){const s=history[e];history[e]=function(){const r=s.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,qj,{value:!0})}const iF=(e,s)=>s.toLowerCase().indexOf(e.toLowerCase())?"~"+s:s.slice(e.length)||"/",c3=(e="")=>e==="/"?"":e,oF=(e,s)=>e[0]==="~"?e.slice(1):c3(s)+e,lF=(e="",s)=>iF(Wj(c3(e)),Wj(s)),Wj=e=>{try{return decodeURI(e)}catch{return e}},d3={hook:aF,searchHook:sF,parser:OR,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},u3=m.createContext(d3),Yu=()=>m.useContext(u3),m3={},h3=m.createContext(m3),cF=()=>m.useContext(h3),Qp=e=>{const[s,r]=e.hook(e);return[lF(e.base,s),O0((n,a)=>r(oF(n,e.base),a))]},Ma=()=>Qp(Yu()),p3=(e,s,r,n)=>{const{pattern:a,keys:i}=s instanceof RegExp?{keys:!1,pattern:s}:e(s||"*",n),o=a.exec(r)||[],[l,...c]=o;return l!==void 0?[!0,(()=>{const d=i!==!1?Object.fromEntries(i.map((h,p)=>
48[h,c[p]])):o.groups;let u={...c};return d&&Object.assign(u,d),u})(),...n?[l]:[]]:[!1,null]},dF=({children:e,...s})=>{var u,h;const r=Yu(),n=s.hook?d3:r;let a=n;const[i,o]=((u=s.ssrPath)==null?void 0:u.split("?"))??[];o&&(s.ssrSearch=o,s.ssrPath=i),s.hrefs=s.hrefs??((h=s.hook)==null?void 0:h.hrefs);let l=m.useRef({}),c=l.current,d=c;for(let p in n){const x=p==="base"?n[p]+(s[p]||""):s[p]||n[p];c===d&&x!==d[p]&&(l.current=d={...d}),d[p]=x,x!==n[p]&&(a=d)}return m.createElement(u3.Provider,{value:a,children:e})},Kj=({children:e,component:s},r)=>s?m.createElement(s,{params:r}):typeof e=="function"?e(r):e,uF=e=>{let s=m.useRef(m3),r=s.current;for(const n in e)e[n]!==r[n]&&(r=e);return Object.keys(e).length===0&&(r=e),s.current=r},Dt=({path:e,nest:s,match:r,...n})=>{const a=Yu(),[i]=Qp(a),[o,l,c]=r??p3(a.parser,e,i,s),d=uF({...cF(),...l});if(!o)return null;const u=c?m.createElement(dF,{base:c},Kj(n,d)):Kj(n,d);return m.createElement(h3.Provider,{value:d,children:u})},me=m.forwardRef((e,s)=>{const r=Yu(),[n,a]=Qp(r),{to:i="",href:o=i,onClick:l,asChild:c,children:d,className:u,replace:h,state:p,...x}=e,v=O0(b=>{b.ctrlKey||b.metaKey||b.altKey||b.shiftKey||b.button!==0||(l==null||l(b),b.defaultPrevented||(b.preventDefault(),a(o,e)))}),f=r.hrefs(o[0]==="~"?o.slice(1):r.base+o,r);return c&&m.isValidElement(d)?m.cloneElement(d,{onClick:v,href:f}):m.createElement("a",{...x,onClick:v,href:f,className:u!=null&&u.call?u(n===o):u,children:d,ref:s})}),f3=e=>Array.isArray(e)?e.flatMap(s=>f3(s&&s.type===m.Fragment?s.props.children:s)):[e],mF=({children:e,location:s})=>{const r=Yu(),[n]=Qp(r);for(const a of f3(e)){let i=0;if(m.isValidElement(a)&&(i=p3(r.parser,a.props.path,s||n,a.props.nest))[0])return m.cloneElement(a,{match:i})}return null},du=e=>{const{to:s,href:r=s}=e,[,n]=Ma(),a=O0(()=>n(s||r,e));return o3(()=>{a()},[]),null};var Hc=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(){}},Ko=typeof window>"u"||"Deno"in globalThis;function ln(){}function hF(e,s){return typeof e=="function"?e(s):e}function Wg(e){return typeof e=="number"&&e>=0&&e!==1/0}function x3(e,s){return Math.max(e+(s||0)-Date.now(),0)}function Gl(e,s){return typeof e=="function"?e(s):e}function $n(e,s){return typeof e=="function"?e(s):e}function Gj(e,s){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(s.queryHash!==U0(o,s.options))return!1}else if(!uu(s.queryKey,o))return!1}if(r!=="all"){const c=s.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&s.isStale()!==l||a&&a!==s.state.fetchStatus||i&&!i(s))}function Hj(e,s){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!s.options.mutationKey)return!1;if(r){if(Go(s.options.mutationKey)!==Go(i))return!1}else if(!uu(s.options.mutationKey,i))return!1}return!(n&&s.state.status!==n||a&&!a(s))}function U0(e,s){return((s==null?void 0:s.queryKeyHashFn)||Go)(e)}function Go(e){return JSON.stringify(e,(s,r)=>Kg(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function uu(e,s){return e===s?!0:typeof e!=typeof s?!1:e&&s&&typeof e=="object"&&typeof s=="object"?!Object.keys(s).some(r=>!uu(e[r],s[r])):!1}function g3(e,s){if(e===s)return e;const r=Qj(e)&&Qj(s);if(r||Kg(e)&&Kg(s)){const n=r?e:Object.keys(e),a=n.length,i=r?s:Object.keys(s),o=i.length,l=r?[]:{};let c=0;for(let d=0;d<o;d++){const u=r?d:i[d];(!r&&n.includes(u)||r)&&e[u]===void 0&&s[u]===void 0?(l[u]=void 0,c++):(l[u]=g3(e[u],s[u]),l[u]===e[u]&&e[u]!==void 0&&c++)}return a===o&&c===a?e:l}return s}function Gh(e,s){if(!s||Object.keys(e).length!==Object.keys(s).length)return!1;for(const r in e)if(e[r]!==s[r])return!1;return!0}function Qj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kg(e){if(!Yj(e))return!1;const s=e.constructor;if(s===void 0)return!0;const r=s.prototype;return!(!Yj(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Yj(e){return Object.prototype.toString.call(e)==="[object Object]"}function pF(e){return new Promise(s=>{setTimeout(s,e)})}function Gg(e,s,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,s):r.structuralSharing!==!1?g3(e,s):s}function fF(e,s,r=0){const n=[...e,s];return r&&n.length>r?n.slice(1):n}function xF(e,s,r=0){const n=[s,...e];return r&&n.length>r?n.slice(0,-1):n}var V0=Symbol();function y3(e,s){return!e.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!e.queryFn||e.queryFn===V0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Eo,Ti,uc,UN,gF=(UN=class extends Hc{constructor(){super();Je(this,Eo);Je(this,Ti);Je(this,uc);ze(this,uc,s=>{if(!Ko&&window.addEventListener){const r=()=>s();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){z(this,Ti)||this.setEventListener(z(this,uc))}onUnsubscribe(){var s;this.hasListeners()||((s=z(this,Ti))==null||s.call(this),ze(this,Ti,void 0))}setEventListener(s){var r;ze(this,uc,s),(r=z(this,Ti))==null||r.call(this),ze(this,Ti,s(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(s){z(this,Eo)!==s&&(ze(this,Eo,s),this.onFocus())}onFocus(){const s=this.isFocused();
vendor: 34,555 bytes, line 48
48this.listeners.forEach(r=>{r(s)})}isFocused(){var s;return typeof z(this,Eo)=="boolean"?z(this,Eo):((s=globalThis.document)==null?void 0:s.visibilityState)!=="hidden"}},Eo=new WeakMap,Ti=new WeakMap,uc=new WeakMap,UN),B0=new gF,mc,Ai,hc,VN,yF=(VN=class extends Hc{constructor(){super();Je(this,mc,!0);Je(this,Ai);Je(this,hc);ze(this,hc,s=>{if(!Ko&&window.addEventListener){const r=()=>s(!0),n=()=>s(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){z(this,Ai)||this.setEventListener(z(this,hc))}onUnsubscribe(){var s;this.hasListeners()||((s=z(this,Ai))==null||s.call(this),ze(this,Ai,void 0))}setEventListener(s){var r;ze(this,hc,s),(r=z(this,Ai))==null||r.call(this),ze(this,Ai,s(this.setOnline.bind(this)))}setOnline(s){z(this,mc)!==s&&(ze(this,mc,s),this.listeners.forEach(n=>{n(s)}))}isOnline(){return z(this,mc)}},mc=new WeakMap,Ai=new WeakMap,hc=new WeakMap,VN),Hh=new yF;function Hg(){let e,s;const r=new Promise((a,i)=>{e=a,s=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),s(a)},r}function vF(e){return Math.min(1e3*2**e,3e4)}function v3(e){return(e??"online")==="online"?Hh.isOnline():!0}var b3=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function xx(e){return e instanceof b3}function j3(e){let s=!1,r=0,n=!1,a;const i=Hg(),o=f=>{var b;n||(p(new b3(f)),(b=e.abort)==null||b.call(e))},l=()=>{s=!0},c=()=>{s=!1},d=()=>B0.isFocused()&&(e.networkMode==="always"||Hh.isOnline())&&e.canRun(),u=()=>v3(e.networkMode)&&e.canRun(),h=f=>{var b;n||(n=!0,(b=e.onSuccess)==null||b.call(e,f),a==null||a(),i.resolve(f))},p=f=>{var b;n||(n=!0,(b=e.onError)==null||b.call(e,f),a==null||a(),i.reject(f))},x=()=>new Promise(f=>{var b;a=y=>{(n||d())&&f(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var f;a=void 0,n||(f=e.onContinue)==null||f.call(e)}),v=()=>{if(n)return;let f;const b=r===0?e.initialPromise:void 0;try{f=b??e.fn()}catch(y){f=Promise.reject(y)}Promise.resolve(f).then(h).catch(y=>{var S;if(n)return;const g=e.retry??(Ko?0:3),j=e.retryDelay??vF,N=typeof j=="function"?j(r,y):j,w=g===!0||typeof g=="number"&&r<g||typeof g=="function"&&g(r,y);if(s||!w){p(y);return}r++,(S=e.onFail)==null||S.call(e,r,y),pF(N).then(()=>d()?void 0:x()).then(()=>{s?p(y):v()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?v():x().then(v),i)}}function bF(){let e=[],s=0,r=l=>{l()},n=l=>{l()},a=l=>setTimeout(l,0);const i=l=>{s?e.push(l):a(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;s++;try{c=l()}finally{s--,s||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Rs=bF(),Io,BN,w3=(BN=class{constructor(){Je(this,Io)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wg(this.gcTime)&&ze(this,Io,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ko?1/0:5*60*1e3))}clearGcTimeout(){z(this,Io)&&(clearTimeout(z(this,Io)),ze(this,Io,void 0))}},Io=new WeakMap,BN),pc,fc,on,rr,Uu,Mo,Dn,za,qN,jF=(qN=class extends w3{constructor(s){super();Je(this,Dn);Je(this,pc);Je(this,fc);Je(this,on);Je(this,rr);Je(this,Uu);Je(this,Mo);ze(this,Mo,!1),ze(this,Uu,s.defaultOptions),this.setOptions(s.options),this.observers=[],ze(this,on,s.cache),this.queryKey=s.queryKey,this.queryHash=s.queryHash,ze(this,pc,wF(this.options)),this.state=s.state??z(this,pc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var s;return(s=z(this,rr))==null?void 0:s.promise}setOptions(s){this.options={...z(this,Uu),...s},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,on).remove(this)}setData(s,r){const n=Gg(this.state.data,s,this.options);return ht(this,Dn,za).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(s,r){ht(this,Dn,za).call(this,{type:"setState",state:s,setStateOptions:r})}cancel(s){var n,a;const r=(n=z(this,rr))==null?void 0:n.promise;return(a=z(this,rr))==null||a.cancel(s),r?r.then(ln).catch(ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(z(this,pc))}isActive(){return this.observers.some(s=>$n(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(s=0){return this.state.isInvalidated||this.state.data===void 0||!x3(this.state.dataUpdatedAt,s)}onFocus(){var r;const s=this.observers.find(n=>n.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(r=z(this,rr))==null||r.continue()}onOnline(){var r;const s=this.observers.find(n=>n.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(r=z(this,rr))==null||r.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),z(this,on).notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(r=>r!==s),this.observers.length||(z(this,rr)&&(z(this,Mo)?z(this,rr).cancel({revert:!0}):z(this,rr).cancelRetry()),this.scheduleGc()),z(this,on).notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ht(this,Dn,za).call(this,{type:"invalidate"})}fetch(s,r){var c,d,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(z(this,rr))return z(this,rr).continueRetry(),z(this,rr).promise}if(s&&this.setOptions(s),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ze(this,Mo,!0),n.signal)})},i=()=>{const h=y3(this.options,r),p={queryKey:this.queryKey,meta:this.meta};return a(p),ze(this,Mo,!1),this.options.persister?this.options.persister(h,p,this):h(p)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};a(o),(c=this.options.behavior)==null||c.onFetch(o,this),ze(this,fc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&ht(this,Dn,za).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const l=h=>{var p,x,v,f;xx(h)&&h.silent||ht(this,Dn,za).call(this,{type:"error",error:h}),xx(h)||((x=(p=z(this,on).config).onError)==null||x.call(p,h,this),(f=(v=z(this,on).config).onSettled)==null||f.call(v,this.state.data,h,this)),this.scheduleGc()};return ze(this,rr,j3({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var p,x,v,f;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){l(b);return}(x=(p=z(this,on).config).onSuccess)==null||x.call(p,h,this),(f=(v=z(this,on).config).onSettled)==null||f.call(v,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,p)=>{ht(this,Dn,za).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{ht(this,Dn,za).call(this,{type:"pause"})},onContinue:()=>{ht(this,Dn,za).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),z(this,rr).start()}},pc=new WeakMap,fc=new WeakMap,on=new WeakMap,rr=new WeakMap,Uu=new WeakMap,Mo=new WeakMap,Dn=new WeakSet,za=function(s){const r=n=>{switch(s.type){case"failed":return{...n,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...N3(n.data,this.options),fetchMeta:s.meta??null};case"success":return{...n,data:s.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:s.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=s.error;return xx(a)&&a.revert&&z(this,fc)?{...z(this,fc),fetchStatus:"idle"}:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...s.state}}};this.state=r(this.state),Rs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),z(this,on).notify({query:this,type:"updated",action:s})})},qN);function N3(e,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:v3(s.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wF(e){const s=typeof e.initialData=="function"?e.initialData():e.initialData,r=s!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ua,WN,NF=(WN=class extends Hc{constructor(s={}){super();Je(this,ua);this.config=s,ze(this,ua,new Map)}build(s,r,n){const a=r.queryKey,i=r.queryHash??U0(a,r);let o=this.get(i);return o||(o=new jF({cache:this,queryKey:a,queryHash:i,options:s.defaultQueryOptions(r),state:n,defaultOptions:s.getQueryDefaults(a)}),this.add(o)),o}add(s){z(this,ua).has(s.queryHash)||(z(this,ua).set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const r=z(this,ua).get(s.queryHash);r&&(s.destroy(),r===s&&z(this,ua).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Rs.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return z(this,ua).get(s)}getAll(){return[...z(this,ua).values()]}find(s){const r={exact:!0,...s};return this.getAll().find(n=>Gj(r,n))}findAll(s={}){const r=this.getAll();return Object.keys(s).length>0?r.filter(n=>Gj(s,n)):r}notify(s){Rs.batch(()=>{this.listeners.forEach(r=>{r(s)})})}onFocus(){Rs.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Rs.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},ua=new WeakMap,WN),ma,cr,Ro,ha,ji,KN,kF=(KN=class extends w3{constructor(s){super();Je(this,ha);Je(this,ma);Je(this,cr);Je(this,Ro);this.mutationId=s.mutationId,ze(this,cr,s.mutationCache),ze(this,ma,[]),this.state=s.state||k3(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){z(this,ma).includes(s)||(z(this,ma).push(s),this.clearGcTimeout(),z(this,cr).notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){ze(this,ma,z(this,ma).filter(r=>r!==s)),this.scheduleGc(),z(this,cr).notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){z(this,ma).length||(this.state.status==="pending"?this.scheduleGc():z(this,cr).remove(this))}continue(){var s;return((s=z(this,Ro))==null?void 0:s.continue())??this.execute(this.state.variables)}async execute(s){var a,i,o,l,c,d,u,h,p,x,v,f,b,y,g,j,N,w,S,k;ze(this,Ro,j3({fn:()=>this.options.mutationFn?this.options.mutationFn(s):Promise.reject(new Error("No mutationFn found")),onFail:(P,A)=>{ht(this,ha,ji).call(this,{type:"failed",failureCount:P,error:A})},onPause:()=>{ht(this,ha,ji).call(this,{type:"pause"})},onContinue:()=>{ht(this,ha,ji).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,cr).canRun(this)}));const r=this.state.status==="pending",n=!z(this,Ro).canStart();try{if(!r){ht(this,ha,ji).call(this,{type:"pending",variables:s,isPaused:n}),await((i=(a=z(this,cr).config).onMutate)==null?void 0:i.call(a,s,this));const A=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,s));A!==this.state.context&&ht(this,ha,ji).call(this,{type:"pending",context:A,variables:s,isPaused:n})}const P=await z(this,Ro).start();return await((d=(c=z(this,cr).config).onSuccess)==null?void 0:d.call(c,P,s,this.state.context,this)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,P,s,this.state.context)),await((x=(p=z(this,cr).config).onSettled)==null?void 0:x.call(p,P,null,this.state.variables,this.state.context,this)),await((f=(v=this.options).onSettled)==null?void 0:f.call(v,P,null,s,this.state.context)),ht(this,ha,ji).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(b=z(this,cr).config).onError)==null?void 0:y.call(b,P,s,this.state.context,this)),await((j=(g=this.options).onError)==null?void 0:j.call(g,P,s,this.state.context)),await((w=(N=z(this,cr).config).onSettled)==null?void 0:w.call(N,void 0,P,this.state.variables,this.state.context,this)),await((k=(S=this.options).onSettled)==null?void 0:k.call(S,void 0,P,s,this.state.context)),P}finally{ht(this,ha,ji).call(this,{type:"error",error:P})}}finally{z(this,cr).runNext(this)}}},ma=new WeakMap,cr=new WeakMap,Ro=new WeakMap,ha=new WeakSet,ji=function(s){const r=n=>{switch(s.type){case"failed":return{...n,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...n,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:s.error,failureCount:n.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Rs.batch(()=>{z(this,ma).forEach(n=>{n.onMutationUpdate(s)}),z(this,cr).notify({mutation:this,type:"updated",action:s})})},KN);function k3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zr,Vu,GN,SF=(GN=class extends Hc{constructor(s={}){super();Je(this,zr);Je(this,Vu);this.config=s,ze(this,zr,new Map),ze(this,Vu,Date.now())}build(s,r,n){const a=new kF({mutationCache:this,mutationId:++bm(this,Vu)._,options:s.defaultMutationOptions(r),state:n});return this.add(a),a}add(s){const r=Om(s),n=z(this,zr).get(r)??[];n.push(s),z(this,zr).set(r,n),this.notify({type:"added",mutation:s})}remove(s){var n;const r=Om(s);if(z(this,zr).has(r)){const a=(n=z(this,zr).get(r))==null?void 0:n.filter(i=>i!==s);a&&(a.length===0?z(this,zr).delete(r):z(this,zr).set(r,a))}this.notify({type:"removed",mutation:s})}canRun(s){var n;const r=(n=z(this,zr).get(Om(s)))==null?void 0:n.find(a=>a.state.status==="pending");return!r||r===s}runNext(s){var n;const r=(n=z(this,zr).get(Om(s)))==null?void 0:n.find(a=>a!==s&&a.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){Rs.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}getAll(){return[...z(this,zr).values()].flat()}find(s){const r={exact:!0,...s};return this.getAll().find(n=>Hj(r,n))}findAll(s={}){return this.getAll().filter(r=>Hj(s,r))}notify(s){Rs.batch(()=>{this.listeners.forEach(r=>{r(s)})})}resumePausedMutations(){const s=this.getAll().filter(r=>r.state.isPaused);return Rs.batch(()=>Promise.all(s.map(r=>r.continue().catch(ln))))}},zr=new WeakMap,Vu=new WeakMap,GN);function Om(e){var s;return((s=e.options.scope)==null?void 0:s.id)??String(e.mutationId)}function Xj(e){return{onFetch:(s,r)=>{var u,h,p,x,v;const n=s.options,a=(p=(h=(u=s.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,i=((x=s.state.data)==null?void 0:x.pages)||[],o=((v=s.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let f=!1;const b=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(s.signal.aborted?f=!0:s.signal.addEventListener("abort",()=>{f=!0}),s.signal)})},y=y3(s.options,s.fetchOptions),g=async(j,N,w)=>{if(f)return Promise.reject();if(N==null&&j.pages.length)return Promise.resolve(j);const S={queryKey:s.queryKey,pageParam:N,direction:w?"backward":"forward",meta:s.options.meta};b(S);const k=await y(S),{maxPages:P}=s.options,A=w?xF:fF;return{pages:A(j.pages,k,P),pageParams:A(j.pageParams,N,P)}};if(a&&i.length){const j=a==="backward",N=j?CF:Zj,w={pages:i,pageParams:o},S=N(n,w);l=await g(w,S,j)}else{const j=e??i.length;do{const N=c===0?o[0]??n.initialPageParam:Zj(n,l);if(c>0&&N==null)break;l=await g(l,N),c++}while(c<j)}return l};s.options.persister?s.fetchFn=()=>{var f,b;return(b=(f=s.options).persister)==null?void 0:b.call(f,d,{queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},r)}:s.fetchFn=d}}}function Zj(e,{pages:s,pageParams:r}){const n=s.length-1;return s.length>0?e.getNextPageParam(s[n],s,r[n],r):void 0}function CF(e,{pages:s,pageParams:r}){var n;return s.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,s[0],s,r[0],r):void 0}var us,_i,Ei,xc,gc,Ii,yc,vc,HN,PF=(HN=class{constructor(e={}){Je(this,us);Je(this,_i);Je(this,Ei);Je(this,xc);Je(this,gc);Je(this,Ii);Je(this,yc);Je(this,vc);ze(this,us,e.queryCache||new NF),ze(this,_i,e.mutationCache||new SF),ze(this,Ei,e.defaultOptions||{}),ze(this,xc,new Map),ze(this,gc,new Map),ze(this,Ii,0)}mount(){bm(this,Ii)._++,z(this,Ii)===1&&(ze(this,yc,B0.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,us).onFocus())})),ze(this,vc,Hh.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,us).onOnline())})))}unmount(){var e,s;bm(this,Ii)._--,z(this,Ii)===0&&((e=z(this,yc))==null||e.call(this),ze(this,yc,void 0),(s=z(this,vc))==null||s.call(this),ze(this,vc,void 0))}isFetching(e){return z(this,us).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,_i).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const s=this.defaultQueryOptions({queryKey:e});return(r=z(this,us).get(s.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const s=this.getQueryData(e.queryKey);if(s===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=z(this,us).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(Gl(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(s)}}getQueriesData(e){return z(this,us).findAll(e).map(({queryKey:s,state:r})=>{const n=r.data;return[s,n]})}setQueryData(e,s,r){const n=this.defaultQueryOptions({queryKey:e}),a=z(this,us).get(n.queryHash),i=a==null?void 0:a.state.data,o=hF(s,i);if(o!==void 0)return z(this,us).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,s,r){return Rs.batch(()=>z(this,us).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,s,r)]))}getQueryState(e){var r;const s=this.defaultQueryOptions({queryKey:e});return(r=z(this,us).get(s.queryHash))==null?void 0:r.state}removeQueries(e){const s=z(this,us);Rs.batch(()=>{s.findAll(e).forEach(r=>{s.remove(r)})})}resetQueries(e,s){const r=z(this,us),n={type:"active",...e};return Rs.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(n,s)))}cancelQueries(e={},s={}){const r={revert:!0,...s},n=Rs.batch(()=>z(this,us).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(ln).catch(ln)}invalidateQueries(e={},s={}){return Rs.batch(()=>{if(z(this,us).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,s)})}refetchQueries(e={},s){const r={...s,cancelRefetch:(s==null?void 0:s.cancelRefetch)??!0},n=Rs.batch(()=>z(this,us).findAll(e).filter(a=>!a.isDisabled()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(ln)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(ln)}fetchQuery(e){const s=this.defaultQueryOptions(e);s.retry===void 0&&(s.retry=!1);const r=z(this,us).build(this,s);return r.isStaleByTime(Gl(s.staleTime,r))?r.fetch(s):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ln).catch(ln)}fetchInfiniteQuery(e){return e.behavior=Xj(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e.behavior=Xj(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hh.isOnline()?z(this,_i).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,us)}getMutationCache(){return z(this,_i)}getDefaultOptions(){return z(this,Ei)}setDefaultOptions(e){ze(this,Ei,e)}setQueryDefaults(e,s){z(this,xc).set(Go(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){const s=[...z(this,xc).values()];let r={};return s.forEach(n=>{uu(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,s){z(this,gc).set(Go(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){const s=[...z(this,gc).values()];let r={};return s.forEach(n=>{uu(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const s={...z(this,Ei).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=U0(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.enabled!==!0&&s.queryFn===V0&&(s.enabled=!1),s}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,Ei).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,us).clear(),z(this,_i).clear()}},us=new WeakMap,_i=new WeakMap,Ei=new WeakMap,xc=new WeakMap,gc=new WeakMap,Ii=new WeakMap,yc=new WeakMap,vc=new WeakMap,HN),Pr,St,Bu,dr,Fo,bc,Mi,pa,qu,jc,wc,Do,Lo,Ri,Nc,Rt,Ad,Qg,Yg,Xg,Zg,Jg,ey,ty,S3,QN,TF=(QN=class extends Hc{constructor(s,r){super();Je(this,Rt);Je(this,Pr);Je(this,St);Je(this,Bu);Je(this,dr);Je(this,Fo);Je(this,bc);Je(this,Mi);Je(this,pa);Je(this,qu);Je(this,jc);Je(this,wc);Je(this,Do);Je(this,Lo);Je(this,Ri);Je(this,Nc,new Set);this.options=r,ze(this,Pr,s),ze(this,pa,null),ze(this,Mi,Hg()),this.options.experimental_prefetchInRender||z(this,Mi).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,St).addObserver(this),Jj(z(this,St),this.options)?ht(this,Rt,Ad).call(this):this.updateResult(),ht(this,Rt,Zg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sy(z(this,St),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sy(z(this,St),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ht(this,Rt,Jg).call(this),ht(this,Rt,ey).call(this),z(this,St).removeObserver(this)}setOptions(s,r){const n=this.options,a=z(this,St);if(this.options=z(this,Pr).defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $n(this.options.enabled,z(this,St))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ht(this,Rt,ty).call(this),z(this,St).setOptions(this.options),n._defaulted&&!Gh(this.options,n)&&z(this,Pr).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,St),observer:this});const i=this.hasListeners();i&&ew(z(this,St),a,this.options,n)&&ht(this,Rt,Ad).call(this),this.updateResult(r),i&&(z(this,St)!==a||$n(this.options.enabled,z(this,St))!==$n(n.enabled,z(this,St))||Gl(this.options.staleTime,z(this,St))!==Gl(n.staleTime,z(this,St)))&&ht(this,Rt,Qg).call(this);const o=ht(this,Rt,Yg).call(this);i&&(z(this,St)!==a||$n(this.options.enabled,z(this,St))!==$n(n.enabled,z(this,St))||o!==z(this,Ri))&&ht(this,Rt,Xg).call(this,o)}getOptimisticResult(s){const r=z(this,Pr).getQueryCache().build(z(this,Pr),s),n=this.createResult(r,s);return _F(this,n)&&(ze(this,dr,n),ze(this,bc,this.options),ze(this,Fo,z(this,St).state)),n}getCurrentResult(){return z(this,dr)}trackResult(s,r){const n={};return Object.keys(s).forEach(a=>{Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(a),r==null||r(a),s[a])})}),n}trackProp(s){z(this,Nc).add(s)}getCurrentQuery(){return z(this,St)}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const r=z(this,Pr).defaultQueryOptions(s),n=z(this,Pr).getQueryCache().build(z(this,Pr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(s){return ht(this,Rt,Ad).call(this,{...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,dr)))}createResult(s,r){var P;const n=z(this,St),a=this.options,i=z(this,dr),o=z(this,Fo),l=z(this,bc),d=s!==n?s.state:z(this,Bu),{state:u}=s;let h={...u},p=!1,x;if(r._optimisticResults){const A=this.hasListeners(),$=!A&&Jj(s,r),_=A&&ew(s,n,r,a);($||_)&&(h={...h,...N3(u.data,s.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:f,status:b}=h;if(r.select&&h.data!==void 0)if(i&&h.data===(o==null?void 0:o.data)&&r.select===z(this,qu))x=z(this,jc);else try{ze(this,qu,r.select),x=r.select(h.data),x=Gg(i==null?void 0:i.data,x,r),ze(this,jc,x),ze(this,pa,null)}catch(A){ze(this,pa,A)}else x=h.data;if(r.placeholderData!==void 0&&x===void 0&&b==="pending"){let A;if(i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData))A=i.data;else if(A=typeof r.placeholderData=="function"?r.placeholderData((P=z(this,wc))==null?void 0:P.state.data,z(this,wc)):r.placeholderData,r.select&&A!==void 0)try{A=r.select(A),ze(this,pa,null)}catch($){ze(this,pa,$)}A!==void 0&&(b="success",x=Gg(i==null?void 0:i.data,A,r),p=!0)}z(this,pa)&&(v=z(this,pa),x=z(this,jc),f=Date.now(),b="error");const y=h.fetchStatus==="fetching",g=b==="pending",j=b==="error",N=g&&y,w=x!==void 0,k={status:b,fetchStatus:h.fetchStatus,isPending:g,isSuccess:b==="success",isError:j,isInitialLoading:N,isLoading:N,data:x,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:f,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!g,isLoadingError:j&&!w,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:j&&w,isStale:q0(s,r),refetch:this.refetch,promise:z(this,Mi)};if(this.options.experimental_prefetchInRender){const A=O=>{k.status==="error"?O.reject(k.error):k.data!==void 0&&O.resolve(k.data)},$=()=>{const O=ze(this,Mi,k.promise=Hg());A(O)},_=z(this,Mi);switch(_.status){case"pending":s.queryHash===n.queryHash&&A(_);break;case"fulfilled":(k.status==="error"||k.data!==_.value)&&$();break;case"rejected":(k.status!=="error"||k.error!==_.reason)&&$();break}}return k}updateResult(s){const r=z(this,dr),n=this.createResult(z(this,St),this.options);if(ze(this,Fo,z(this,St).state),ze(this,bc,this.options),z(this,Fo).data!==void 0&&ze(this,wc,z(this,St)),Gh(n,r))return;ze(this,dr,n);const a={},i=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!z(this,Nc).size)return!0;const c=new Set(l??z(this,Nc));return this.options.throwOnError&&c.add("error"),Object.keys(z(this,dr)).some(d=>{const u=d;return z(this,dr)[u]!==r[u]&&c.has(u)})};(s==null?void 0:s.listeners)!==!1&&i()&&(a.listeners=!0),ht(this,Rt,S3).call(this,{...a,...s})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ht(this,Rt,Zg).call(this)}},Pr=new WeakMap,St=new WeakMap,Bu=new WeakMap,dr=new WeakMap,Fo=new WeakMap,bc=new WeakMap,Mi=new WeakMap,pa=new WeakMap,qu=new WeakMap,jc=new WeakMap,wc=new WeakMap,Do=new WeakMap,Lo=new WeakMap,Ri=new WeakMap,Nc=new WeakMap,Rt=new WeakSet,Ad=function(s){ht(this,Rt,ty).call(this);let r=z(this,St).fetch(this.options,s);return s!=null&&s.throwOnError||(r=r.catch(ln)),r},Qg=function(){ht(this,Rt,Jg).call(this);const s=Gl(this.options.staleTime,z(this,St));if(Ko||z(this,dr).isStale||!Wg(s))return;const n=x3(z(this,dr).dataUpdatedAt,s)+1;ze(this,Do,setTimeout(()=>{z(this,dr).isStale||this.updateResult()},n))},Yg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,St)):this.options.refetchInterval)??!1},Xg=function(s){ht(this,Rt,ey).call(this),ze(this,Ri,s),!(Ko||$n(this.options.enabled,z(this,St))===!1||!Wg(z(this,Ri))||z(this,Ri)===0)&&ze(this,Lo,setInterval(()=>{(this.options.refetchIntervalInBackground||B0.isFocused())&&ht(this,Rt,Ad).call(this)},z(this,Ri)))},Zg=function(){ht(this,Rt,Qg).call(this),ht(this,Rt,Xg).call(this,ht(this,Rt,Yg).call(this))},Jg=function(){z(this,Do)&&(clearTimeout(z(this,Do)),ze(this,Do,void 0))},ey=function(){z(this,Lo)&&(clearInterval(z(this,Lo)),ze(this,Lo,void 0))},ty=function(){const s=z(this,Pr).getQueryCache().build(z(this,Pr),this.options);if(s===z(this,St))return;const r=z(this,St);ze(this,St,s),ze(this,Bu,s.state),this.hasListeners()&&(r==null||r.removeObserver(this),s.addObserver(this))},S3=function(s){Rs.batch(()=>{s.listeners&&this.listeners.forEach(r=>{r(z(this,dr))}),z(this,Pr).getQueryCache().notify({query:z(this,St),type:"observerResultsUpdated"})})},QN);function AF(e,s){return $n(s.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&s.retryOnMount===!1)}function Jj(e,s){return AF(e,s)||e.state.data!==void 0&&sy(e,s,s.refetchOnMount)}function sy(e,s,r){if($n(s.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&q0(e,s)}return!1}function ew(e,s,r,n){return(e!==s||$n(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&q0(e,r)}function q0(e,s){return $n(s.enabled,e)!==!1&&e.isStaleByTime(Gl(s.staleTime,e))}function _F(e,s){return!Gh(e.getCurrentResult(),s)}var Fi,Di,Tr,Ka,Za,uh,ry,YN,EF=(YN=class extends Hc{constructor(r,n){super();Je(this,Za);Je(this,Fi);Je(this,Di);Je(this,Tr);Je(this,Ka);ze(this,Fi,r),this.setOptions(n),this.bindMethods(),ht(this,Za,uh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=z(this,Fi).defaultMutationOptions(r),Gh(this.options,n)||z(this,Fi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,Tr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Go(n.mutationKey)!==Go(this.options.mutationKey)?this.reset():((a=z(this,Tr))==null?void 0:a.state.status)==="pending"&&z(this,Tr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=z(this,Tr))==null||r.removeObserver(this)}onMutationUpdate(r){ht(this,Za,uh).call(this),ht(this,Za,ry).call(this,r)}getCurrentResult(){return z(this,Di)}reset(){var r;(r=z(this,Tr))==null||r.removeObserver(this),ze(this,Tr,void 0),ht(this,Za,uh).call(this),ht(this,Za,ry).call(this)}mutate(r,n){var a;return ze(this,Ka,n),(a=z(this,Tr))==null||a.removeObserver(this),ze(this,Tr,z(this,Fi).getMutationCache().build(z(this,Fi),this.options)),z(this,Tr).addObserver(this),z(this,Tr).execute(r)}},Fi=new WeakMap,Di=new WeakMap,Tr=new WeakMap,Ka=new WeakMap,Za=new WeakSet,uh=function(){var n;const r=((n=z(this,Tr))==null?void 0:n.state)??k3();ze(this,Di,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},ry=function(r){Rs.batch(()=>{var n,a,i,o,l,c,d,u;if(z(this,Ka)&&this.hasListeners()){const h=z(this,Di).variables,p=z(this,Di).context;(r==null?void 0:r.type)==="success"?((a=(n=z(this,Ka)).onSuccess)==null||a.call(n,r.data,h,p),(o=(i=z(this,Ka)).onSettled)==null||o.call(i,r.data,null,h,p)):(r==null?void 0:r.type)==="error"&&((c=(l=z(this,Ka)).onError)==null||c.call(l,r.error,h,p),(u=(d=z(this,Ka)).onSettled)==null||u.call(d,void 0,r.error,h,p))}this.listeners.forEach(h=>{h(z(this,Di))})})},YN),C3=m.createContext(void 0),P3=e=>{const s=m.useContext(C3);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},IF=({client:e,children:s})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),t.jsx(C3.Provider,{value:e,children:s})),T3=m.createContext(!1),MF=()=>m.useContext(T3);T3.Provider;function RF(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var FF=m.createContext(RF()),DF=()=>m.useContext(FF);function A3(e,s){return typeof e=="function"?e(...s):!!e}function ny(){}var LF=(e,s)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(s.isReset()||(e.retryOnMount=!1))},OF=e=>{m.useEffect(()=>{e.clearReset()},[e])},$F=({result:e,errorResetBoundary:s,throwOnError:r,query:n})=>e.isError&&!s.isReset()&&!e.isFetching&&n&&A3(r,[e.error,n]),zF=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},UF=(e,s)=>e.isLoading&&e.isFetching&&!s,VF=(e,s)=>(e==null?void 0:e.suspense)&&s.isPending,tw=(e,s,r)=>s.fetchOptimistic(e).catch(()=>{r.clearReset()});function BF(e,s,r){var u,h,p,x,v;const n=P3(),a=MF(),i=DF(),o=n.defaultQueryOptions(e);(h=(u=n.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||h.call(u,o),o._optimisticResults=a?"isRestoring":"optimistic",zF(o),LF(o,i),OF(i);const l=!n.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new s(n,o)),d=c.getOptimisticResult(o);if(m.useSyncExternalStore(m.useCallback(f=>{const b=a?ny:c.subscribe(Rs.batchCalls(f));return c.updateResult(),b},[c,a]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o,{listeners:!1})},[o,c]),VF(o,d))throw tw(o,c,i);if($F({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash)}))throw d.error;if((x=(p=n.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||x.call(p,o,d),o.experimental_prefetchInRender&&!Ko&&UF(d,a)){const f=l?tw(o,c,i):(v=n.getQueryCache().get(o.queryHash))==null?void 0:v.promise;f==null||f.catch(ny).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function Ee(e,s){return BF(e,TF)}
48function ke(e,s){const r=P3(),[n]=m.useState(()=>new EF(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const a=m.useSyncExternalStore(m.useCallback(o=>n.subscribe(Rs.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=m.useCallback((o,l)=>{n.mutate(o,l).catch(ny)},[n]);if(a.error&&A3(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}async function _3(e){if(!e.ok){const s=await e.text()||e.statusText;throw new Error(`${e.status}: ${s}`)}}function Qh(e){const s=e.message.match(/^\d{3}: ([\s\S]*)$/);if(s)try{const r=JSON.parse(s[1]);if(typeof r.message=="string")return r.message;if(typeof r.error=="string")return r.error}catch{}return e.message}async function Fe(e,s,r){const n=await fetch(s,{method:e,headers:r?{"Content-Type":"application/json"}:{},body:r?JSON.stringify(r):void 0,credentials:"include"});return await _3(n),n}const E3=({on401:e})=>async({queryKey:s})=>{const r=await fetch(s.join("/"),{credentials:"include"});return e==="returnNull"&&r.status===401?null:(await _3(r),await r.json())},ee=new PF({defaultOptions:{queries:{queryFn:E3({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,retry:!1},mutations:{retry:!1}}}),qF=1,WF=1e6;let gx=0;function KF(){return gx=(gx+1)%Number.MAX_SAFE_INTEGER,gx.toString()}const yx=new Map,sw=e=>{if(yx.has(e))return;const s=setTimeout(()=>{yx.delete(e),Vd({type:"REMOVE_TOAST",toastId:e})},WF);yx.set(e,s)},GF=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,qF)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===s.toast.id?{...r,...s.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=s;return r?sw(r):e.toasts.forEach(n=>{sw(n.id)}),{...e,toasts:e.toasts.map(n=>
vendor: 9,752 bytes, line 48
48n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return s.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==s.toastId)}}},mh=[];let hh={toasts:[]};function Vd(e){hh=GF(hh,e),mh.forEach(s=>{s(hh)})}function HF({...e}){const s=KF(),r=a=>Vd({type:"UPDATE_TOAST",toast:{...a,id:s}}),n=()=>Vd({type:"DISMISS_TOAST",toastId:s});return Vd({type:"ADD_TOAST",toast:{...e,id:s,open:!0,onOpenChange:a=>{a||n()}}}),{id:s,dismiss:n,update:r}}function bt(){const[e,s]=m.useState(hh);return m.useEffect(()=>(mh.push(s),()=>{const r=mh.indexOf(s);r>-1&&mh.splice(r,1)}),[e]),{...e,toast:HF,dismiss:r=>Vd({type:"DISMISS_TOAST",toastId:r})}}function Ce(e,s,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return s==null?void 0:s(a)}}function rw(e,s){if(typeof e=="function")return e(s);e!=null&&(e.current=s)}function Yp(...e){return s=>{let r=!1;const n=e.map(a=>{const i=rw(a,s);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():rw(e[a],null)}}}}function lt(...e){return m.useCallback(Yp(...e),e)}function QF(e,s){const r=m.createContext(s),n=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return t.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=m.useContext(r);if(o)return o;if(s!==void 0)return s;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function Ws(e,s=[]){let r=[];function n(i,o){const l=m.createContext(o),c=r.length;r=[...r,o];const d=h=>{var y;const{scope:p,children:x,...v}=h,f=((y=p==null?void 0:p[e])==null?void 0:y[c])||l,b=m.useMemo(()=>v,Object.values(v));return t.jsx(f.Provider,{value:b,children:x})};d.displayName=i+"Provider";function u(h,p){var f;const x=((f=p==null?void 0:p[e])==null?void 0:f[c])||l,v=m.useContext(x);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=r.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,YF(a,...s)]}function YF(...e){const s=e[0];if(e.length===1)return s;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${s.scopeName}`]:o}),[o])}};return r.scopeName=s.scopeName,r}function Ho(e){const s=XF(e),r=m.forwardRef((n,a)=>{const{children:i,...o}=n,l=m.Children.toArray(i),c=l.find(ZF);if(c){const d=c.props.children,u=l.map(h=>h===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:h);return t.jsx(s,{...o,ref:a,children:m.isValidElement(d)?m.cloneElement(d,void 0,u):null})}return t.jsx(s,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}var Xp=Ho("Slot");function XF(e){const s=m.forwardRef((r,n)=>{const{children:a,...i}=r;if(m.isValidElement(a)){const o=eD(a),l=JF(i,a.props);return a.type!==m.Fragment&&(l.ref=n?Yp(n,o):o),m.cloneElement(a,l)}return m.Children.count(a)>1?m.Children.only(null):null});return s.displayName=`${e}.SlotClone`,s}var I3=Symbol("radix.slottable");function M3(e){const s=({children:r})=>t.jsx(t.Fragment,{children:r});return s.displayName=`${e}.Slottable`,s.__radixId=I3,s}function ZF(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===I3}function JF(e,s){const r={...s};for(const n in s){const a=e[n],i=s[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{i(...l),a(...l)}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function eD(e){var n,a;let s=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?e.ref:(s=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Zp(e){const s=e+"CollectionProvider",[r,n]=Ws(s),[a,i]=r(s,{collectionRef:{current:null},itemMap:new Map}),o=f=>{const{scope:b,children:y}=f,g=Ve.useRef(null),j=Ve.useRef(new Map).current;return t.jsx(a,{scope:b,itemMap:j,collectionRef:g,children:y})};o.displayName=s;const l=e+"CollectionSlot",c=Ho(l),d=Ve.forwardRef((f,b)=>{const{scope:y,children:g}=f,j=i(l,y),N=lt(b,j.collectionRef);return t.jsx(c,{ref:N,children:g})});d.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Ho(u),x=Ve.forwardRef((f,b)=>{const{scope:y,children:g,...j}=f,N=Ve.useRef(null),w=lt(b,N),S=i(u,y);return Ve.useEffect(()=>(S.itemMap.set(N,{ref:N,...j}),()=>void S.itemMap.delete(N))),t.jsx(p,{[h]:"",ref:w,children:g})});x.displayName=u;function v(f){const b=i(e+"CollectionConsumer",f);return Ve.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const j=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((S,k)=>j.indexOf(S.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:d,ItemSlot:x},v,n]}var tD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ge=tD.reduce((e,s)=>{const r=Ho(`Primitive.${s}`),n=m.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${s}`,{...e,[s]:n}},{});function W0(e,s){e&&ll.flushSync(()=>e.dispatchEvent(s))}function ns(e){const s=m.useRef(e);return m.useEffect(()=>{s.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=s.current)==null?void 0:n.call(s,...r)},[])}function sD(e,s=globalThis==null?void 0:globalThis.document){const r=ns(e);m.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return s.addEventListener("keydown",n,{capture:!0}),()=>s.removeEventListener("keydown",n,{capture:!0})},[r,s])}var rD="DismissableLayer",ay="dismissableLayer.update",nD="dismissableLayer.pointerDownOutside",aD="dismissableLayer.focusOutside",nw,R3=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=m.forwardRef((e,s)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=m.useContext(R3),[u,h]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),v=lt(s,k=>h(k)),f=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(b),g=u?f.indexOf(u):-1,j=d.layersWithOutsidePointerEventsDisabled.size>0,N=g>=y,w=oD(k=>{const P=k.target,A=[...d.branches].some($=>$.contains(P));!N||A||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},p),S=lD(k=>{const P=k.target;[...d.branches].some($=>$.contains(P))||(i==null||i(k),o==null||o(k),k.defaultPrevented||l==null||l())},p);return sD(k=>{g===d.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},p),m.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(nw=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),aw(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=nw)}},[u,p,r,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),aw())},[u,d]),m.useEffect(()=>{const k=()=>x({});return document.addEventListener(ay,k),()=>document.removeEventListener(ay,k)},[]),t.jsx(Ge.div,{...c,ref:v,style:{pointerEvents:j?N?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,w.onPointerDownCapture)})});Qc.displayName=rD;var iD="DismissableLayerBranch",F3=m.forwardRef((e,s)=>{const r=m.useContext(R3),n=m.useRef(null),a=lt(s,n);return m.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),t.jsx(Ge.div,{...e,ref:a})});F3.displayName=iD;function oD(e,s=globalThis==null?void 0:globalThis.document){const r=ns(e),n=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){D3(nD,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(s.removeEventListener("click",a.current),a.current=c,s.addEventListener("click",a.current,{once:!0})):c()}else s.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{s.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),s.removeEventListener("pointerdown",i),s.removeEventListener("click",a.current)}},[s,r]),{onPointerDownCapture:()=>n.current=!0}}function lD(e,s=globalThis==null?void 0:globalThis.document){const r=ns(e),n=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!n.current&&D3(aD,r,{originalEvent:i},{discrete:!1})};return s.addEventListener("focusin",a),()=>s.removeEventListener("focusin",a)},[s,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function aw(){const e=new CustomEvent(ay);document.dispatchEvent(e)}function D3(e,s,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});s&&a.addEventListener(e,s,{once:!0}),n?W0(a,i):a.dispatchEvent(i)}var cD=Qc,dD=F3,qs=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},uD="Portal",Xu=m.forwardRef((e,s)=>{var l;const{container:r,...n}=e,[a,i]=m.useState(!1);qs(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?LR.createPortal(t.jsx(Ge.div,{...n,ref:s}),o):null});
48Xu.displayName=uD;function mD(e,s){return m.useReducer((r,n)=>s[r][n]??r,e)}var Ks=e=>{const{present:s,children:r}=e,n=hD(s),a=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),i=lt(n.ref,pD(a));return typeof r=="function"||n.isPresent?m.cloneElement(a,{ref:i}):null};Ks.displayName="Presence";function hD(e){const[s,r]=m.useState(),n=m.useRef({}),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=mD(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=$m(n.current);i.current=l==="mounted"?d:"none"},[l]),qs(()=>{const d=n.current,u=a.current;if(u!==e){const p=i.current,x=$m(d);e?c("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),qs(()=>{if(s){let d;const u=s.ownerDocument.defaultView??window,h=x=>{const f=$m(n.current).includes(x.animationName);if(x.target===s&&f&&(c("ANIMATION_END"),!a.current)){const b=s.style.animationFillMode;s.style.animationFillMode="forwards",d=u.setTimeout(()=>{s.style.animationFillMode==="forwards"&&(s.style.animationFillMode=b)})}},p=x=>{x.target===s&&(i.current=$m(n.current))};return s.addEventListener("animationstart",p),s.addEventListener("animationcancel",h),s.addEventListener("animationend",h),()=>{u.clearTimeout(d),s.removeEventListener("animationstart",p),s.removeEventListener("animationcancel",h),s.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[s,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(d=>{d&&(n.current=getComputedStyle(d)),r(d)},[])}}function $m(e){return(e==null?void 0:e.animationName)||"none"}function pD(e){var n,a;let s=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?e.ref:(s=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function bn({prop:e,defaultProp:s,onChange:r=()=>{}}){const[n,a]=fD({defaultProp:s,onChange:r}),i=e!==void 0,o=i?e:n,l=ns(r),c=m.useCallback(d=>{if(i){const h=typeof d=="function"?d(e):d;h!==e&&l(h)}else a(d)},[i,e,a,l]);return[o,c]}function fD({defaultProp:e,onChange:s}){const r=m.useState(e),[n]=r,a=m.useRef(n),i=ns(s);return m.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}var xD="VisuallyHidden",Zu=m.forwardRef((e,s)=>t.jsx(Ge.span,{...e,ref:s,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Zu.displayName=xD;var gD=Zu,K0="ToastProvider",[G0,yD,vD]=Zp("Toast"),[L3,zQ]=Ws("Toast",[vD]),[bD,Jp]=L3(K0),O3=e=>{const{__scopeToast:s,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),p=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${K0}\`. Expected non-empty \`string\`.`),t.jsx(G0.Provider,{scope:s,children:t.jsx(bD,{scope:s,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:m.useCallback(()=>u(x=>x+1),[]),onToastRemove:m.useCallback(()=>u(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:o})})};O3.displayName=K0;var $3="ToastViewport",jD=["F8"],iy="toast.viewportPause",oy="toast.viewportResume",z3=m.forwardRef((e,s)=>{const{__scopeToast:r,hotkey:n=jD,label:a="Notifications ({hotkey})",...i}=e,o=Jp($3,r),l=yD(r),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),p=lt(s,h,o.onViewportChange),x=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;m.useEffect(()=>{const b=y=>{var j;n.length!==0&&n.every(N=>y[N]||y.code===N)&&((j=h.current)==null||j.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),m.useEffect(()=>{const b=c.current,y=h.current;if(v&&b&&y){const g=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(iy);
48y.dispatchEvent(S),o.isClosePausedRef.current=!0}},j=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(oy);y.dispatchEvent(S),o.isClosePausedRef.current=!1}},N=S=>{!b.contains(S.relatedTarget)&&j()},w=()=>{b.contains(document.activeElement)||j()};return b.addEventListener("focusin",g),b.addEventListener("focusout",N),b.addEventListener("pointermove",g),b.addEventListener("pointerleave",w),window.addEventListener("blur",g),window.addEventListener("focus",j),()=>{b.removeEventListener("focusin",g),b.removeEventListener("focusout",N),b.removeEventListener("pointermove",g),b.removeEventListener("pointerleave",w),window.removeEventListener("blur",g),window.removeEventListener("focus",j)}}},[v,o.isClosePausedRef]);const f=m.useCallback(({tabbingDirection:b})=>{const g=l().map(j=>{const N=j.ref.current,w=[N,...RD(N)];return b==="forwards"?w:w.reverse()});return(b==="forwards"?g.reverse():g).flat()},[l]);return m.useEffect(()=>{const b=h.current;if(b){const y=g=>{var w,S,k;const j=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!j){const P=document.activeElement,A=g.shiftKey;if(g.target===b&&A){(w=d.current)==null||w.focus();return}const O=f({tabbingDirection:A?"backwards":"forwards"}),M=O.findIndex(C=>C===P);vx(O.slice(M+1))?g.preventDefault():A?(S=d.current)==null||S.focus():(k=u.current)==null||k.focus()}};return b.addEventListener("keydown",y),()=>b.removeEventListener("keydown",y)}},[l,f]),t.jsxs(dD,{ref:c,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&t.jsx(ly,{ref:d,onFocusFromOutsideViewport:()=>{const b=f({tabbingDirection:"forwards"});vx(b)}}),t.jsx(G0.Slot,{scope:r,children:t.jsx(Ge.ol,{tabIndex:-1,...i,ref:p})}),v&&t.jsx(ly,{ref:u,onFocusFromOutsideViewport:()=>{const b=f({tabbingDirection:"backwards"});vx(b)}})]})});z3.displayName=$3;var U3="ToastFocusProxy",ly=m.forwardRef((e,s)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,i=Jp(U3,r);return t.jsx(Zu,{"aria-hidden":!0,tabIndex:0,...a,ref:s,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&n()}})});ly.displayName=U3;var ef="Toast",wD="toast.swipeStart",ND="toast.swipeMove",kD="toast.swipeCancel",SD="toast.swipeEnd",V3=m.forwardRef((e,s)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=e,[l=!0,c]=bn({prop:n,defaultProp:a,onChange:i});return t.jsx(Ks,{present:r||l,children:t.jsx(TD,{open:l,...o,ref:s,onClose:()=>c(!1),onPause:ns(e.onPause),onResume:ns(e.onResume),onSwipeStart:Ce(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ce(e.onSwipeMove,d=>{const{x:u,y:h}=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",`${h}px`)}),onSwipeCancel:Ce(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:Ce(e.onSwipeEnd,d=>{const{x:u,y:h}=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",`${h}px`),c(!1)})})})});V3.displayName=ef;var[CD,PD]=L3(ef,{onClose(){}}),TD=m.forwardRef((e,s)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:x,...v}=e,f=Jp(ef,r),[b,y]=m.useState(null),g=lt(s,C=>y(C)),j=m.useRef(null),N=m.useRef(null),w=a||f.duration,S=m.useRef(0),k=m.useRef(w),P=m.useRef(0),{onToastAdd:A,onToastRemove:$}=f,_=ns(()=>{var L;(b==null?void 0:b.contains(document.activeElement))&&((L=f.viewport)==null||L.focus()),o()}),O=m.useCallback(C=>
vendor: 4,528 bytes, line 48
48{!C||C===1/0||(window.clearTimeout(P.current),S.current=new Date().getTime(),P.current=window.setTimeout(_,C))},[_]);m.useEffect(()=>{const C=f.viewport;if(C){const L=()=>{O(k.current),d==null||d()},W=()=>{const q=new Date().getTime()-S.current;k.current=k.current-q,window.clearTimeout(P.current),c==null||c()};return C.addEventListener(iy,W),C.addEventListener(oy,L),()=>{C.removeEventListener(iy,W),C.removeEventListener(oy,L)}}},[f.viewport,w,c,d,O]),m.useEffect(()=>{i&&!f.isClosePausedRef.current&&O(w)},[i,w,f.isClosePausedRef,O]),m.useEffect(()=>(A(),()=>$()),[A,$]);const M=m.useMemo(()=>b?Q3(b):null,[b]);return f.viewport?t.jsxs(t.Fragment,{children:[M&&t.jsx(AD,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:M}),t.jsx(CD,{scope:r,onClose:_,children:ll.createPortal(t.jsx(G0.ItemSlot,{scope:r,children:t.jsx(cD,{asChild:!0,onEscapeKeyDown:Ce(l,()=>{f.isFocusedToastEscapeKeyDownRef.current||_(),f.isFocusedToastEscapeKeyDownRef.current=!1}),children:t.jsx(Ge.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":f.swipeDirection,...v,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ce(e.onKeyDown,C=>{C.key==="Escape"&&(l==null||l(C.nativeEvent),C.nativeEvent.defaultPrevented||(f.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:Ce(e.onPointerDown,C=>{C.button===0&&(j.current={x:C.clientX,y:C.clientY})}),onPointerMove:Ce(e.onPointerMove,C=>{if(!j.current)return;const L=C.clientX-j.current.x,W=C.clientY-j.current.y,q=!!N.current,I=["left","right"].includes(f.swipeDirection),F=["left","up"].includes(f.swipeDirection)?Math.min:Math.max,E=I?F(0,L):0,ne=I?0:F(0,W),U=C.pointerType==="touch"?10:2,Ae={x:E,y:ne},G={originalEvent:C,delta:Ae};q?(N.current=Ae,zm(ND,h,G,{discrete:!1})):iw(Ae,f.swipeDirection,U)?(N.current=Ae,zm(wD,u,G,{discrete:!1}),C.target.setPointerCapture(C.pointerId)):(Math.abs(L)>U||Math.abs(W)>U)&&(j.current=null)}),onPointerUp:Ce(e.onPointerUp,C=>{const L=N.current,W=C.target;if(W.hasPointerCapture(C.pointerId)&&W.releasePointerCapture(C.pointerId),N.current=null,j.current=null,L){const q=C.currentTarget,I={originalEvent:C,delta:L};iw(L,f.swipeDirection,f.swipeThreshold)?zm(SD,x,I,{discrete:!0}):zm(kD,p,I,{discrete:!0}),q.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),f.viewport)})]}):null}),AD=e=>{const{__scopeToast:s,children:r,...n}=e,a=Jp(ef,s),[i,o]=m.useState(!1),[l,c]=m.useState(!1);return ID(()=>o(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:t.jsx(Xu,{asChild:!0,children:t.jsx(Zu,{...n,children:i&&t.jsxs(t.Fragment,{children:[a.label," ",r]})})})},_D="ToastTitle",B3=m.forwardRef((e,s)=>{const{__scopeToast:r,...n}=e;return t.jsx(Ge.div,{...n,ref:s})});B3.displayName=_D;var ED="ToastDescription",q3=m.forwardRef((e,s)=>{const{__scopeToast:r,...n}=e;return t.jsx(Ge.div,{...n,ref:s})});q3.displayName=ED;var W3="ToastAction",K3=m.forwardRef((e,s)=>{const{altText:r,...n}=e;return r.trim()?t.jsx(H3,{altText:r,asChild:!0,children:t.jsx(H0,{...n,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${W3}\`. Expected non-empty \`string\`.`),null)});K3.displayName=W3;var G3="ToastClose",H0=m.forwardRef((e,s)=>{const{__scopeToast:r,...n}=e,a=PD(G3,r);return t.jsx(H3,{asChild:!0,children:t.jsx(Ge.button,{type:"button",...n,ref:s,onClick:Ce(e.onClick,a.onClose)})})});H0.displayName=G3;var H3=m.forwardRef((e,s)=>{const{__scopeToast:r,altText:n,...a}=e;return t.jsx(Ge.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:s})});function Q3(e){const s=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&s.push(n.textContent),MD(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&s.push(o)}else s.push(...Q3(n))}}),s}function zm(e,s,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});s&&a.addEventListener(e,s,{once:!0}),n?W0(a,i):a.dispatchEvent(i)}var iw=(e,s,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),i=n>a;return s==="left"||s==="right"?i&&n>r:!i&&a>r};function ID(e=()=>{}){const s=ns(e);qs(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[s])}
vendor: 7,060 bytes, lines 48-118
48function MD(e){return e.nodeType===e.ELEMENT_NODE}function RD(e){const s=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function vx(e){const s=document.activeElement;return e.some(r=>r===s?!0:(r.focus(),document.activeElement!==s))}var FD=O3,Y3=z3,X3=V3,Z3=B3,J3=q3,eP=K3,tP=H0;function sP(e){var s,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(s=0;s<a;s++)e[s]&&(r=sP(e[s]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function rP(){for(var e,s,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(s=sP(e))&&(n&&(n+=" "),n+=s);return n}const ow=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lw=rP,cl=(e,s)=>r=>{var n;if((s==null?void 0:s.variants)==null)return lw(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=s,o=Object.keys(a).map(d=>{const u=r==null?void 0:r[d],h=i==null?void 0:i[d];if(u===null)return null;const p=ow(u)||ow(h);return a[d][p]}),l=r&&Object.entries(r).reduce((d,u)=>{let[h,p]=u;return p===void 0||(d[h]=p),d},{}),c=s==null||(n=s.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:p,...x}=u;return Object.entries(x).every(v=>{let[f,b]=v;return Array.isArray(b)?b.includes({...i,...l}[f]):{...i,...l}[f]===b})?[...d,h,p]:d},[]);return lw(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
49 * @license lucide-react v0.453.0 - ISC
50 *
51 * This source code is licensed under the ISC license.
52 * See the LICENSE file in the root directory of this source tree.
53 */const DD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nP=(...e)=>e.filter((s,r,n)=>!!s&&n.indexOf(s)===r).join(" ");/**
54 * @license lucide-react v0.453.0 - ISC
55 *
56 * This source code is licensed under the ISC license.
57 * See the LICENSE file in the root directory of this source tree.
58 */var LD={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"};/**
59 * @license lucide-react v0.453.0 - ISC
60 *
61 * This source code is licensed under the ISC license.
62 * See the LICENSE file in the root directory of this source tree.
63 */const OD=m.forwardRef(({color:e="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>m.createElement("svg",{ref:c,...LD,width:s,height:s,stroke:e,strokeWidth:n?Number(r)*24/Number(s):r,className:nP("lucide",a),...l},[...o.map(([d,u])=>m.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
64 * @license lucide-react v0.453.0 - ISC
65 *
66 * This source code is licensed under the ISC license.
67 * See the LICENSE file in the root directory of this source tree.
68 */const ge=(e,s)=>{const r=m.forwardRef(({className:n,...a},i)=>m.createElement(OD,{ref:i,iconNode:s,className:nP(`lucide-${DD(e)}`,n),...a}));return r.displayName=`${e}`,r};/**
69 * @license lucide-react v0.453.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const Q0=ge("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
74 * @license lucide-react v0.453.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */const $D=ge("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
79 * @license lucide-react v0.453.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const Ic=ge("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
84 * @license lucide-react v0.453.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const Rr=ge("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
89 * @license lucide-react v0.453.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const aP=ge("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
94 * @license lucide-react v0.453.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const zD=ge("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
99 * @license lucide-react v0.453.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const Yh=ge("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
104 * @license lucide-react v0.453.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const UD=ge("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"}]]);/**
109 * @license lucide-react v0.453.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const iP=ge("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"}]]);/**
114 * @license lucide-react v0.453.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const VD=ge("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"}
118],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
119 * @license lucide-react v0.453.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const BD=ge("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
124 * @license lucide-react v0.453.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const qD=ge("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
129 * @license lucide-react v0.453.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const cw=ge("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/**
134 * @license lucide-react v0.453.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const WD=ge("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
139 * @license lucide-react v0.453.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const Ca=ge("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
144 * @license lucide-react v0.453.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const Mc=ge("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
149 * @license lucide-react v0.453.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const Xt=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
154 * @license lucide-react v0.453.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const Pa=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
159 * @license lucide-react v0.453.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const Qo=ge("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
164 * @license lucide-react v0.453.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const Xi=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
169 * @license lucide-react v0.453.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const oP=ge("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
174 * @license lucide-react v0.453.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const hr=ge("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
179 * @license lucide-react v0.453.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const dw=ge("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"}]]);/**
184 * @license lucide-react v0.453.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const ot=ge("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
189 * @license lucide-react v0.453.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const Ir=ge("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
194 * @license lucide-react v0.453.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const lP=ge("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"}]]);/**
199 * @license lucide-react v0.453.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const KD=ge("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
204 * @license lucide-react v0.453.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const Qr=ge("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"}]]);/**
209 * @license lucide-react v0.453.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const cP=ge("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
214 * @license lucide-react v0.453.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const ws=ge("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
219 * @license lucide-react v0.453.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const ko=ge("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
224 * @license lucide-react v0.453.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const xa=ge("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"}]]);/**
229 * @license lucide-react v0.453.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const Y0=ge("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"}]]);/**
234 * @license lucide-react v0.453.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const tf=ge("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"}]]);/**
239 * @license lucide-react v0.453.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const GD=ge("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"}]]);/**
244 * @license lucide-react v0.453.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const X0=ge("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"}]]);/**
249 * @license lucide-react v0.453.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const HD=ge("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"}]]);/**
254 * @license lucide-react v0.453.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const wa=ge("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"}]]);/**
259 * @license lucide-react v0.453.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const Ju=ge("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"}]]);/**
264 * @license lucide-react v0.453.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const mi=ge("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"}]]);/**
269 * @license lucide-react v0.453.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const uw=ge("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
274 * @license lucide-react v0.453.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const mw=ge("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
279 * @license lucide-react v0.453.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const cy=ge("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"}]]);/**
284 * @license lucide-react v0.453.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const mu=ge("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"}]]);/**
289 * @license lucide-react v0.453.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const jn=ge("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"}]]);/**
294 * @license lucide-react v0.453.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const QD=ge("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"}]]);/**
299 * @license lucide-react v0.453.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const dP=ge("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/**
304 * @license lucide-react v0.453.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const YD=ge("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"}]]);/**
309 * @license lucide-react v0.453.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const XD=ge("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"}]]);/**
314 * @license lucide-react v0.453.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const Ft=ge("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"}]]);/**
319 * @license lucide-react v0.453.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const ZD=ge("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"}]]);/**
324 * @license lucide-react v0.453.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const dy=ge("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
329 * @license lucide-react v0.453.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const Bd=ge("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
334 * @license lucide-react v0.453.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const JD=ge("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"}]]);/**
339 * @license lucide-react v0.453.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const Yo=ge("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
344 * @license lucide-react v0.453.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const uP=ge("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"}]]);/**
349 * @license lucide-react v0.453.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const e7=ge("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"}]]);/**
354 * @license lucide-react v0.453.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const t7=ge("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"}]]);/**
359 * @license lucide-react v0.453.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const s7=ge("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"}]]);/**
364 * @license lucide-react v0.453.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const Qe=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
369 * @license lucide-react v0.453.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const mP=ge("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"}]]);/**
374 * @license lucide-react v0.453.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const ri=ge("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"}]]);/**
379 * @license lucide-react v0.453.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const r7=ge("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
384 * @license lucide-react v0.453.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const Ta=ge("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"}]]);/**
389 * @license lucide-react v0.453.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const hP=ge("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"}]]);/**
394 * @license lucide-react v0.453.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const hu=ge("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
399 * @license lucide-react v0.453.0 - ISC
400 *
401 * This source code is licensed under the ISC license.
402 * See the LICENSE file in the root directory of this source tree.
403 */const pu=ge("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
404 * @license lucide-react v0.453.0 - ISC
405 *
406 * This source code is licensed under the ISC license.
407 * See the LICENSE file in the root directory of this source tree.
408 */const n7=ge("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/**
409 * @license lucide-react v0.453.0 - ISC
410 *
411 * This source code is licensed under the ISC license.
412 * See the LICENSE file in the root directory of this source tree.
413 */const a7=ge("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
414 * @license lucide-react v0.453.0 - ISC
415 *
416 * This source code is licensed under the ISC license.
417 * See the LICENSE file in the root directory of this source tree.
418 */const i7=ge("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"}]]);/**
419 * @license lucide-react v0.453.0 - ISC
420 *
421 * This source code is licensed under the ISC license.
422 * See the LICENSE file in the root directory of this source tree.
423 */const o7=ge("PenTool",[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);/**
424 * @license lucide-react v0.453.0 - ISC
425 *
426 * This source code is licensed under the ISC license.
427 * See the LICENSE file in the root directory of this source tree.
428 */const sf=ge("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"}]]);/**
429 * @license lucide-react v0.453.0 - ISC
430 *
431 * This source code is licensed under the ISC license.
432 * See the LICENSE file in the root directory of this source tree.
433 */const Z0=ge("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"}]]);/**
434 * @license lucide-react v0.453.0 - ISC
435 *
436 * This source code is licensed under the ISC license.
437 * See the LICENSE file in the root directory of this source tree.
438 */const Ds=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
439 * @license lucide-react v0.453.0 - ISC
440 *
441 * This source code is licensed under the ISC license.
442 * See the LICENSE file in the root directory of this source tree.
443 */const pP=ge("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
444 * @license lucide-react v0.453.0 - ISC
445 *
446 * This source code is licensed under the ISC license.
447 * See the LICENSE file in the root directory of this source tree.
448 */const l7=ge("Repeat2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);/**
449 * @license lucide-react v0.453.0 - ISC
450 *
451 * This source code is licensed under the ISC license.
452 * See the LICENSE file in the root directory of this source tree.
453 */const Xh=ge("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
453],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
454 * @license lucide-react v0.453.0 - ISC
455 *
456 * This source code is licensed under the ISC license.
457 * See the LICENSE file in the root directory of this source tree.
458 */const fP=ge("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"}]]);/**
459 * @license lucide-react v0.453.0 - ISC
460 *
461 * This source code is licensed under the ISC license.
462 * See the LICENSE file in the root directory of this source tree.
463 */const J0=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
464 * @license lucide-react v0.453.0 - ISC
465 *
466 * This source code is licensed under the ISC license.
467 * See the LICENSE file in the root directory of this source tree.
468 */const qn=ge("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"}]]);/**
469 * @license lucide-react v0.453.0 - ISC
470 *
471 * This source code is licensed under the ISC license.
472 * See the LICENSE file in the root directory of this source tree.
473 */const c7=ge("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"}]]);/**
474 * @license lucide-react v0.453.0 - ISC
475 *
476 * This source code is licensed under the ISC license.
477 * See the LICENSE file in the root directory of this source tree.
478 */const Rc=ge("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"}]]);/**
479 * @license lucide-react v0.453.0 - ISC
480 *
481 * This source code is licensed under the ISC license.
482 * See the LICENSE file in the root directory of this source tree.
483 */const xP=ge("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
484 * @license lucide-react v0.453.0 - ISC
485 *
486 * This source code is licensed under the ISC license.
487 * See the LICENSE file in the root directory of this source tree.
488 */const Et=ge("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"}]]);/**
489 * @license lucide-react v0.453.0 - ISC
490 *
491 * This source code is licensed under the ISC license.
492 * See the LICENSE file in the root directory of this source tree.
493 */const d7=ge("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"}]]);/**
494 * @license lucide-react v0.453.0 - ISC
495 *
496 * This source code is licensed under the ISC license.
497 * See the LICENSE file in the root directory of this source tree.
498 */const gP=ge("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
499 * @license lucide-react v0.453.0 - ISC
500 *
501 * This source code is licensed under the ISC license.
502 * See the LICENSE file in the root directory of this source tree.
503 */const fu=ge("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
504 * @license lucide-react v0.453.0 - ISC
505 *
506 * This source code is licensed under the ISC license.
507 * See the LICENSE file in the root directory of this source tree.
508 */const yP=ge("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"}]]);/**
509 * @license lucide-react v0.453.0 - ISC
510 *
511 * This source code is licensed under the ISC license.
512 * See the LICENSE file in the root directory of this source tree.
513 */const ev=ge("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"}]]);/**
514 * @license lucide-react v0.453.0 - ISC
515 *
516 * This source code is licensed under the ISC license.
517 * See the LICENSE file in the root directory of this source tree.
518 */const u7=ge("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
519 * @license lucide-react v0.453.0 - ISC
520 *
521 * This source code is licensed under the ISC license.
522 * See the LICENSE file in the root directory of this source tree.
523 */const ni=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
523],["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"}]]);/**
524 * @license lucide-react v0.453.0 - ISC
525 *
526 * This source code is licensed under the ISC license.
527 * See the LICENSE file in the root directory of this source tree.
528 */const rf=ge("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"}]]);/**
529 * @license lucide-react v0.453.0 - ISC
530 *
531 * This source code is licensed under the ISC license.
532 * See the LICENSE file in the root directory of this source tree.
533 */const Zh=ge("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"}]]);/**
534 * @license lucide-react v0.453.0 - ISC
535 *
536 * This source code is licensed under the ISC license.
537 * See the LICENSE file in the root directory of this source tree.
538 */const m7=ge("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/**
539 * @license lucide-react v0.453.0 - ISC
540 *
541 * This source code is licensed under the ISC license.
542 * See the LICENSE file in the root directory of this source tree.
543 */const Js=ge("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"}]]);/**
544 * @license lucide-react v0.453.0 - ISC
545 *
546 * This source code is licensed under the ISC license.
547 * See the LICENSE file in the root directory of this source tree.
548 */const h7=ge("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
549 * @license lucide-react v0.453.0 - ISC
550 *
551 * This source code is licensed under the ISC license.
552 * See the LICENSE file in the root directory of this source tree.
553 */const fr=ge("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"}]]);/**
554 * @license lucide-react v0.453.0 - ISC
555 *
556 * This source code is licensed under the ISC license.
557 * See the LICENSE file in the root directory of this source tree.
558 */const Hn=ge("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"}]]);/**
559 * @license lucide-react v0.453.0 - ISC
560 *
561 * This source code is licensed under the ISC license.
562 * See the LICENSE file in the root directory of this source tree.
563 */const Xr=ge("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"}]]);/**
564 * @license lucide-react v0.453.0 - ISC
565 *
566 * This source code is licensed under the ISC license.
567 * See the LICENSE file in the root directory of this source tree.
568 */const p7=ge("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"}]]);/**
569 * @license lucide-react v0.453.0 - ISC
570 *
571 * This source code is licensed under the ISC license.
572 * See the LICENSE file in the root directory of this source tree.
573 */const f7=ge("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"}]]);/**
574 * @license lucide-react v0.453.0 - ISC
575 *
576 * This source code is licensed under the ISC license.
577 * See the LICENSE file in the root directory of this source tree.
578 */const tv=ge("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
579 * @license lucide-react v0.453.0 - ISC
580 *
581 * This source code is licensed under the ISC license.
582 * See the LICENSE file in the root directory of this source tree.
583 */const xr=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,641 bytes, lines 583-588
583],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
584 * @license lucide-react v0.453.0 - ISC
585 *
586 * This source code is licensed under the ISC license.
587 * See the LICENSE file in the root directory of this source tree.
588 */const Aa=ge("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"}]]),sv="-",x7=e=>{const s=y7(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(sv);return l[0]===""&&l.length!==1&&l.shift(),vP(l,s)||g7(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},vP=(e,s)=>{var o;if(e.length===0)return s.classGroupId;const r=e[0],n=s.nextPart.get(r),a=n?vP(e.slice(1),n):void 0;if(a)return a;if(s.validators.length===0)return;const i=e.join(sv);return(o=s.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},hw=/^\[(.+)\]$/,g7=e=>{if(hw.test(e)){const s=hw.exec(e)[1],r=s==null?void 0:s.substring(0,s.indexOf(":"));if(r)return"arbitrary.."+r}},y7=e=>{const{theme:s,prefix:r}=e,n={nextPart:new Map,validators:[]};return b7(Object.entries(e.classGroups),r).forEach(([i,o])=>{uy(o,n,i,s)}),n},uy=(e,s,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?s:pw(s,a);i.classGroupId=r;return}if(typeof a=="function"){if(v7(a)){uy(a(n),s,r,n);return}s.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{uy(o,pw(s,i),r,n)})})},pw=(e,s)=>{let r=e;return s.split(sv).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},v7=e=>e.isThemeGetter,b7=(e,s)=>s?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?s+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[s+o,l])):i);return[r,a]}):e,j7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let s=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),s++,s>e&&(s=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},bP="!",w7=e=>{const{separator:s,experimentalParseClassName:r}=e,n=s.length===1,a=s[0],i=s.length,o=l=>{const c=[];let d=0,u=0,h;for(let b=0;b<l.length;b++){let y=l[b];if(d===0){if(y===a&&(n||l.slice(b,b+i)===s)){c.push(l.slice(u,b)),u=b+i;continue}if(y==="/"){h=b;continue}}y==="["?d++:y==="]"&&d--}const p=c.length===0?l:l.substring(u),x=p.startsWith(bP),v=x?p.substring(1):p,f=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:f}};return r?l=>r({className:l,parseClassName:o}):o},N7=e=>{if(e.length<=1)return e;const s=[];let r=[];return e.forEach(n=>{n[0]==="["?(s.push(...r.sort(),n),r=[]):r.push(n)}),s.push(...r.sort()),s},k7=e=>({cache:j7(e.cacheSize),parseClassName:w7(e),...x7(e)}),S7=/\s+/,C7=(e,s)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=s,i=[],o=e.trim().split(S7);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:x}=r(d);let v=!!x,f=n(v?p.substring(0,x):p);if(!f){if(!v){l=d+(l.length>0?" "+l:l);continue}if(f=n(p),!f){l=d+(l.length>0?" "+l:l);continue}v=!1}const b=N7(u).join(":"),y=h?b+bP:b,g=y+f;if(i.includes(g))continue;i.push(g);const j=a(f,v);for(let N=0;N<j.length;++N){const w=j[N];i.push(y+w)}l=d+(l.length>0?" "+l:l)}return l};function P7(){let e=0,s,r,n="";for(;e<arguments.length;)(s=arguments[e++])&&(r=jP(s))&&(n&&(n+=" "),n+=r);return n}const jP=e=>{if(typeof e=="string")return e;let s,r="";for(let n=0;n<e.length;n++)e[n]&&(s=jP(e[n]))&&(r&&(r+=" "),r+=s);return r};function T7(e,...s){let r,n,a,i=o;function o(c){const d=s.reduce((u,h)=>h(u),e());return r=k7(d),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=C7(c,r);return a(c,u),u}return function(){return i(P7.apply(null,arguments))}}const Bt=e=>{const s=r=>r[e]||[];return s.isThemeGetter=!0,s},wP=/^\[(?:([a-z-]+):)?(.+)\]$/i,A7=/^\d+\/\d+$/,_7=new Set(["px","full","screen"]),E7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I7=/\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$/,M7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oa=e=>Hl(e)||_7.has(e)||A7.test(e),gi=e=>Yc(e,"length",B7),Hl=e=>!!e&&!Number.isNaN(Number(e)),bx=e=>Yc(e,"number",Hl),yd=e=>!!e&&Number.isInteger(Number(e)),D7=e=>e.endsWith("%")&&Hl(e.slice(0,-1)),mt=e=>wP.test(e),yi=e=>E7.test(e),L7=new Set(["length","size","percentage"]),O7=e=>Yc(e,L7,NP),$7=e=>Yc(e,"position",NP),z7=new Set(["image","url"]),U7=e=>Yc(e,z7,W7),V7=e=>Yc(e,"",q7),vd=()=>!0,Yc=(e,s,r)=>{const n=wP.exec(e);return n?n[1]?typeof s=="string"?n[1]===s:s.has(n[1]):r(n[2]):!1},B7=e=>I7.test(e)&&!M7.test(e),NP=()=>!1,q7=e=>R7.test(e),W7=e=>F7.test(e),K7=()=>{const e=Bt("colors"),s=Bt("spacing"),r=Bt("blur"),n=Bt("brightness"),a=Bt("borderColor"),i=Bt("borderRadius"),o=Bt("borderSpacing"),l=Bt("borderWidth"),c=Bt("contrast"),d=Bt("grayscale"),u=Bt("hueRotate"),h=Bt("invert"),p=Bt("gap"),x=Bt("gradientColorStops"),v=Bt("gradientColorStopPositions"),f=Bt("inset"),b=Bt("margin"),y=Bt("opacity"),g=Bt("padding"),j=Bt("saturate"),N=Bt("scale"),w=Bt("sepia"),S=Bt("skew"),k=Bt("space"),P=Bt("translate"),A=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",mt,s],O=()=>[mt,s],M=()=>["",Oa,gi],C=()=>["auto",Hl,mt],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",mt],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ne=()=>[Hl,mt];return{cacheSize:500,separator:":",theme:{colors:[vd],spacing:[Oa,gi],blur:["none","",yi,mt],brightness:ne(),borderColor:[e],borderRadius:["none","","full",yi,mt],borderSpacing:O(),borderWidth:M(),contrast:ne(),grayscale:F(),hueRotate:ne(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[D7,gi],inset:_(),margin:_(),opacity:ne(),padding:O(),saturate:ne(),scale:ne(),sepia:F(),skew:ne(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",mt]}],container:["container"],columns:[{columns:[yi]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),mt]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yd,mt]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",mt]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",yd,mt]}],"grid-cols":[{"grid-cols":[vd]}],"col-start-end":[{col:["auto",{span:["full",yd,mt]},mt]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[vd]}],"row-start-end":[{row:["auto",{span:[yd,mt]},mt]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",mt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",mt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",mt,s]}],"min-w":[{"min-w":[mt,s,"min","max","fit"]}],"max-w":[{"max-w":[mt,s,"none","full","min","max","fit","prose",{screen:[yi]},yi]}],h:[{h:[mt,s,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[mt,s,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[mt,s,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[mt,s,"auto","min","max","fit"]}],"font-size":[{text:["base",yi,gi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bx]}],"font-family":[{font:[vd]}],"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",mt]}],"line-clamp":[{"line-clamp":["none",Hl,bx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Oa,mt]}],"list-image":[{"list-image":["none",mt]}],"list-style-type":[{list:["none","disc","decimal",mt]}],"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:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Oa,gi]}],"underline-offset":[{"underline-offset":["auto",Oa,mt]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt]}],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",mt]}],"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:[...L(),$7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",O7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}
588],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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:[...W(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,469 bytes, line 588
588],"divide-style":[{divide:W()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Oa,mt]}],"outline-w":[{outline:[Oa,gi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Oa,gi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",yi,V7]}],"shadow-color":[{shadow:[vd]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",yi,mt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[j]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",mt]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",mt]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",mt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[yd,mt]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",mt]}],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",mt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",mt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Oa,gi,bx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
588none"]}]},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"]}}},G7=T7(K7);function je(...e){return G7(rP(e))}const H7=FD,kP=m.forwardRef(({className:e,...s},r)=>t.jsx(Y3,{ref:r,className:je("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),...s}));kP.displayName=Y3.displayName;const Q7=cl("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"}}),SP=m.forwardRef(({className:e,variant:s,...r},n)=>t.jsx(X3,{ref:n,className:je(Q7({variant:s}),e),...r}));SP.displayName=X3.displayName;const Y7=m.forwardRef(({className:e,...s},r)=>t.jsx(eP,{ref:r,className:je("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...s}));Y7.displayName=eP.displayName;const CP=m.forwardRef(({className:e,...s},r)=>t.jsx(tP,{ref:r,className:je("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 4,170 bytes, line 588
588/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...s,children:t.jsx(xr,{className:"h-4 w-4"})}));CP.displayName=tP.displayName;const PP=m.forwardRef(({className:e,...s},r)=>t.jsx(Z3,{ref:r,className:je("text-sm font-semibold",e),...s}));PP.displayName=Z3.displayName;const TP=m.forwardRef(({className:e,...s},r)=>t.jsx(J3,{ref:r,className:je("text-sm opacity-90",e),...s}));TP.displayName=J3.displayName;function X7(){const{toasts:e}=bt();return t.jsxs(H7,{children:[e.map(function({id:s,title:r,description:n,action:a,...i}){return t.jsxs(SP,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[r&&t.jsx(PP,{children:r}),n&&t.jsx(TP,{children:n})]}),a,t.jsx(CP,{})]},s)}),t.jsx(kP,{})]})}var Z7=tS[" useId ".trim().toString()]||(()=>{}),J7=0;function xn(e){const[s,r]=m.useState(Z7());return qs(()=>{e||r(n=>n??String(J7++))},[e]),e||(s?`radix-${s}`:"")}const e9=["top","right","bottom","left"],Zi=Math.min,qr=Math.max,Jh=Math.round,Um=Math.floor,Na=e=>({x:e,y:e}),t9={left:"right",right:"left",bottom:"top",top:"bottom"},s9={start:"end",end:"start"};function my(e,s,r){return qr(e,Zi(s,r))}function ai(e,s){return typeof e=="function"?e(s):e}function ii(e){return e.split("-")[0]}function Xc(e){return e.split("-")[1]}function rv(e){return e==="x"?"y":"x"}function nv(e){return e==="y"?"height":"width"}function Ji(e){return["top","bottom"].includes(ii(e))?"y":"x"}function av(e){return rv(Ji(e))}function r9(e,s,r){r===void 0&&(r=!1);const n=Xc(e),a=av(e),i=nv(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return s.reference[i]>s.floating[i]&&(o=ep(o)),[o,ep(o)]}function n9(e){const s=ep(e);return[hy(e),s,hy(s)]}function hy(e){return e.replace(/start|end/g,s=>s9[s])}function a9(e,s,r){const n=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?s?a:n:s?n:a;case"left":case"right":return s?i:o;default:return[]}}function i9(e,s,r,n){const a=Xc(e);let i=a9(ii(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),s&&(i=i.concat(i.map(hy)))),i}function ep(e){return e.replace(/left|right|bottom|top/g,s=>t9[s])}function o9(e){return{top:0,right:0,bottom:0,left:0,...e}}function AP(e){return typeof e!="number"?o9(e):{top:e,right:e,bottom:e,left:e}}function tp(e){const{x:s,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:s,right:s+n,bottom:r+a,x:s,y:r}}function fw(e,s,r){let{reference:n,floating:a}=e;const i=Ji(s),o=av(s),l=nv(o),c=ii(s),d=i==="y",u=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2,p=n[l]/2-a[l]/2;let x;switch(c){case"top":x={x:u,y:n.y-a.height};break;case"bottom":x={x:u,y:n.y+n.height};break;case"right":x={x:n.x+n.width,y:h};break;case"left":x={x:n.x-a.width,y:h};break;default:x={x:n.x,y:n.y}}switch(Xc(s)){case"start":x[o]-=p*(r&&d?-1:1);break;case"end":x[o]+=p*(r&&d?-1:1);break}return x}const l9=async(e,s,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(s));let d=await o.getElementRects({reference:e,floating:s,strategy:a}),{x:u,y:h}=fw(d,n,c),p=n,x={},v=0;for(let f=0;f<l.length;f++){const{name:b,fn:y}=l[f],{x:g,y:j,data:N,reset:w}=await y({x:u,y:h,initialPlacement:n,placement:p,strategy:a,middlewareData:x,rects:d,platform:o,elements:{reference:e,floating:s}});u=g??u,h=j??h,x={...x,[b]:{...x[b],...N}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(d=w.rects===!0?await o.getElementRects({reference:e,floating:s,strategy:a}):w.rects),{x:u,y:h}=fw(d,p,c)),f=-1)}return{x:u,y:h,placement:p,strategy:a,middlewareData:x}};async function xu(e,s){var r;s===void 0&&(s={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:x=0}=ai(s,e),v=AP(x),b=l[p?h==="floating"?"reference":"floating":h],y=tp(await i.getClippingRect
vendor: 9,253 bytes, line 588
588({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),g=h==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),N=await(i.isElement==null?void 0:i.isElement(j))?await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1}:{x:1,y:1},w=tp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:j,strategy:c}):g);return{top:(y.top-w.top+v.top)/N.y,bottom:(w.bottom-y.bottom+v.bottom)/N.y,left:(y.left-w.left+v.left)/N.x,right:(w.right-y.right+v.right)/N.x}}const c9=e=>({name:"arrow",options:e,async fn(s){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=s,{element:d,padding:u=0}=ai(e,s)||{};if(d==null)return{};const h=AP(u),p={x:r,y:n},x=av(a),v=nv(x),f=await o.getDimensions(d),b=x==="y",y=b?"top":"left",g=b?"bottom":"right",j=b?"clientHeight":"clientWidth",N=i.reference[v]+i.reference[x]-p[x]-i.floating[v],w=p[x]-i.reference[x],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let k=S?S[j]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=l.floating[j]||i.floating[v]);const P=N/2-w/2,A=k/2-f[v]/2-1,$=Zi(h[y],A),_=Zi(h[g],A),O=$,M=k-f[v]-_,C=k/2-f[v]/2+P,L=my(O,C,M),W=!c.arrow&&Xc(a)!=null&&C!==L&&i.reference[v]/2-(C<O?$:_)-f[v]/2<0,q=W?C<O?C-O:C-M:0;return{[x]:p[x]+q,data:{[x]:L,centerOffset:C-L-q,...W&&{alignmentOffset:q}},reset:W}}}),d9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(s){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=s,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...b}=ai(e,s);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=ii(a),g=Ji(l),j=ii(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),w=p||(j||!f?[ep(l)]:n9(l)),S=v!=="none";!p&&S&&w.push(...i9(l,f,v,N));const k=[l,...w],P=await xu(s,b),A=[];let $=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&A.push(P[y]),h){const C=r9(a,o,N);A.push(P[C[0]],P[C[1]])}if($=[...$,{placement:a,overflows:A}],!A.every(C=>C<=0)){var _,O;const C=(((_=i.flip)==null?void 0:_.index)||0)+1,L=k[C];if(L)return{data:{index:C,overflows:$},reset:{placement:L}};let W=(O=$.filter(q=>q.overflows[0]<=0).sort((q,I)=>q.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(x){case"bestFit":{var M;const q=(M=$.filter(I=>{if(S){const F=Ji(I.placement);return F===g||F==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,E)=>F+E,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:M[0];q&&(W=q);break}case"initialPlacement":W=l;break}if(a!==W)return{reset:{placement:W}}}return{}}}};function xw(e,s){return{top:e.top-s.height,right:e.right-s.width,bottom:e.bottom-s.height,left:e.left-s.width}}function gw(e){return e9.some(s=>e[s]>=0)}const u9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(s){const{rects:r}=s,{strategy:n="referenceHidden",...a}=ai(e,s);switch(n){case"referenceHidden":{const i=await xu(s,{...a,elementContext:"reference"}),o=xw(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:gw(o)}}}case"escaped":{const i=await xu(s,{...a,altBoundary:!0}),o=xw(i,r.floating);return{data:{escapedOffsets:o,escaped:gw(o)}}}default:return{}}}}};async function m9(e,s){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=ii(r),l=Xc(r),c=Ji(r)==="y",d=["left","top"].includes(o)?-1:1,u=i&&c?-1:1,h=ai(s,e);let{mainAxis:p,crossAxis:x,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof v=="number"&&(x=l==="end"?v*-1:v),c?{x:x*u,y:p*d}:{x:p*d,y:x*u}}const h9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(s){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=s,c=await m9(s,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},p9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(s){const{x:r,y:n,placement:a}=s,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:y,y:g}=b;return{x:y,y:g}}},...c}=ai(e,s),d={x:r,y:n},u=await xu(s,c),h=Ji(ii(a)),p=rv(h);let x=d[p],v=d[h];if(i){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",g=x+u[b],j=x-u[y];x=my(g,x,j)}if(o){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",g=v+u[b],j=v-u[y];v=my(g,v,j)}const f=l.fn({...s,[p]:x,[h]:v});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[p]:i,[h]:o}}}}}},f9=function(e){return e===void 0&&(e={}),{options:e,fn(s){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=s,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=ai(e,s),u={x:r,y:n},h=Ji(a),p=rv(h);let x=u[p],v=u[h];const f=ai(l,s),b=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const j=p==="y"?"height":"width",N=i.reference[p]-i.floating[j]+b.mainAxis,w=i.reference[p]+i.reference[j]-b.mainAxis;x<N?x=N:x>w&&(x=w)}if(d){var y,g;const j=p==="y"?"width":"height",N=["top","left"].includes(ii(a)),w=i.reference[h]-i.floating[j]+(N&&((y=o.offset)==null?void 0:y[h])||0)+(N?0:b.crossAxis),S=i.reference[h]+i.reference[j]+(N?0:((g=o.offset)==null?void 0:g[h])||0)-(N?b.crossAxis:0);v<w?v=w:v>S&&(v=S)}return{[p]:x,[h]:v}}}},x9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(s){var r,n;const{placement:a,rects:i,platform:o,elements:l}=s,{apply:c=()=>{},...d}=ai(e,s),u=await xu(s,d),h=ii(a),p=Xc(a),x=Ji(a)==="y",{width:v,height:f}=i.floating;let b,y;h==="top"||h==="bottom"?(b=h,y=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=h,b=p==="end"?"top":"bottom");const g=f-u.top-u.bottom,j=v-u.left-u.right,N=Zi(f-u[b],g),w=Zi(v-u[y],j),S=!s.middlewareData.shift;let k=N,P=w;if((r=s.middlewareData.shift)!=null&&r.enabled.x&&(P=j),(n=s.middlewareData.shift)!=null&&n.enabled.y&&(k=g),S&&!p){const $=qr(u.left,0),_=qr(u.right,0),O=qr(u.top,0),M=qr(u.bottom,0);x?P=v-2*($!==0||_!==0?$+_:qr(u.left,u.right)):k=f-2*(O!==0||M!==0?O+M:qr(u.top,u.bottom))}await c({...s,availableWidth:P,availableHeight:k});const A=await o.getDimensions(l.floating);return v!==A.width||f!==A.height?{reset:{rects:!0}}:{}}}};function nf(){return typeof window<"u"}function Zc(e){return _P(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var s;return(e==null||(s=e.ownerDocument)==null?void 0:s.defaultView)||window}function Ra(e){var s;return(s=(_P(e)?e.ownerDocument:e.document)||window.document)==null?void 0:s.documentElement}function _P(e){return nf()?e instanceof Node||e instanceof Zr(e).Node:!1}function Qn(e){return nf()?e instanceof Element||e instanceof Zr(e).Element:!1}function _a(e){return nf()?e instanceof HTMLElement||e instanceof Zr(e).HTMLElement:!1}function yw(e){return!nf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}function em(e){const{overflow:s,overflowX:r,overflowY:n,display:a}=Yn(e);return/auto|scroll|overlay|hidden|clip/.test(s+n+r)&&!["inline","contents"].includes(a)}function g9(e){return["table","td","th"].includes(Zc(e))}function af(e){return[":popover-open",":modal"].some(s=>{try{return e.matches(s)}catch{return!1}})}function iv(e){const s=ov(),r=Qn(e)?Yn(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!s&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!s&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function y9(e){let s=eo(e);for(;_a(s)&&!Fc(s);){if(iv(s))return s;if(af(s))return null;s=eo(s)}return null}function ov(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fc(e){return["html","body","#document"].includes(Zc(e))}function Yn(e){return Zr(e).getComputedStyle(e)}function of(e){return Qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eo(e){if(Zc(e)==="html")return e;const s=e.assignedSlot||e.parentNode||yw(e)&&e.host||Ra(e);return yw(s)?s.host:s}function EP(e){const s=eo(e);return Fc(s)?e.ownerDocument?e.ownerDocument.body:e.body:_a(s)&&em(s)?s:EP(s)}function gu(e,s,r){var n;s===void 0&&(s=[]),r===void 0&&(r=!0);const a=EP(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=Zr(a);if(i){const l=py(o);return s.concat(o,o.visualViewport||[],em(a)?a:[],l&&r?gu(l):[])}return s.concat(a,gu(a,[],r))}function py(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IP(e){const s=Yn(e);let r=parseFloat(s.width)||0,n=parseFloat(s.height)||0;const a=_a(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=Jh(r)!==i||Jh(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function lv(e){return Qn(e)?e:e.contextElement}function Ql(e){const s=lv(e);
vendor: 4,088 bytes, line 588
588if(!_a(s))return Na(1);const r=s.getBoundingClientRect(),{width:n,height:a,$:i}=IP(s);let o=(i?Jh(r.width):r.width)/n,l=(i?Jh(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const v9=Na(0);function MP(e){const s=Zr(e);return!ov()||!s.visualViewport?v9:{x:s.visualViewport.offsetLeft,y:s.visualViewport.offsetTop}}function b9(e,s,r){return s===void 0&&(s=!1),!r||s&&r!==Zr(e)?!1:s}function Xo(e,s,r,n){s===void 0&&(s=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=lv(e);let o=Na(1);s&&(n?Qn(n)&&(o=Ql(n)):o=Ql(e));const l=b9(i,r,n)?MP(i):Na(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,h=a.height/o.y;if(i){const p=Zr(i),x=n&&Qn(n)?Zr(n):n;let v=p,f=py(v);for(;f&&n&&x!==v;){const b=Ql(f),y=f.getBoundingClientRect(),g=Yn(f),j=y.left+(f.clientLeft+parseFloat(g.paddingLeft))*b.x,N=y.top+(f.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,d*=b.y,u*=b.x,h*=b.y,c+=j,d+=N,v=Zr(f),f=py(v)}}return tp({width:u,height:h,x:c,y:d})}function cv(e,s){const r=of(e).scrollLeft;return s?s.left+r:Xo(Ra(e)).left+r}function RP(e,s,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+s.scrollLeft-(r?0:cv(e,n)),i=n.top+s.scrollTop;return{x:a,y:i}}function j9(e){let{elements:s,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=Ra(n),l=s?af(s.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Na(1);const u=Na(0),h=_a(n);if((h||!h&&!i)&&((Zc(n)!=="body"||em(o))&&(c=of(n)),_a(n))){const x=Xo(n);d=Ql(n),u.x=x.x+n.clientLeft,u.y=x.y+n.clientTop}const p=o&&!h&&!i?RP(o,c,!0):Na(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+p.x,y:r.y*d.y-c.scrollTop*d.y+u.y+p.y}}function w9(e){return Array.from(e.getClientRects())}function N9(e){const s=Ra(e),r=of(e),n=e.ownerDocument.body,a=qr(s.scrollWidth,s.clientWidth,n.scrollWidth,n.clientWidth),i=qr(s.scrollHeight,s.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+cv(e);const l=-r.scrollTop;return Yn(n).direction==="rtl"&&(o+=qr(s.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}function k9(e,s){const r=Zr(e),n=Ra(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=ov();(!d||d&&s==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}function S9(e,s){const r=Xo(e,!0,s==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=_a(e)?Ql(e):Na(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=n*i.y;return{width:o,height:l,x:c,y:d}}function vw(e,s,r){let n;if(s==="viewport")n=k9(e,r);else if(s==="document")n=N9(Ra(e));else if(Qn(s))n=S9(s,r);else{const a=MP(e);n={x:s.x-a.x,y:s.y-a.y,width:s.width,height:s.height}}return tp(n)}function FP(e,s){const r=eo(e);return r===s||!Qn(r)||Fc(r)?!1:Yn(r).position==="fixed"||FP(r,s)}function C9(e,s){const r=s.get(e);if(r)return r;let n=gu(e,[],!1).filter(l=>Qn(l)&&Zc(l)!=="body"),a=null;const i=Yn(e).position==="fixed";let o=i?eo(e):e;for(;Qn(o)&&!Fc(o);){const l=Yn(o),c=iv(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||em(o)&&!c&&FP(e,o))?n=n.filter(u=>u!==o):a=l,o=eo(o)}return s.set(e,n),n}function P9(e){let{element:s,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?af(s)?[]:C9(s,this._c):[].concat(r),n],l=o[0],c=o.reduce((d,u)=>{const h=vw(s,u,a);return d.top=qr(h.top,d.top),d.right=Zi(h.right,d.right),d.bottom=Zi(h.bottom,d.bottom),d.left=qr(h.left,d.left),d},vw(s,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function T9(e){const{width:s,height:r}=IP(e);return{width:s,height:r}}function A9(e,s,r){const n=_a(s),a=Ra(s),i=r==="fixed",o=Xo(e,!0,i,s);let l={scrollLeft:0,scrollTop:0};const c=Na(0);if(n||!n&&!i)if((Zc(s)!=="body"||em(a))&&(l=of(s)),n){const p=Xo(s,!0,i,s);c.x=p.x+s.clientLeft,c.y=p.y+s.clientTop}else a&&(c.x=cv(a));const d=a&&!n&&!i?RP(a,l):Na(0),u=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:u,y:h,width:o.width,height:o.height}}function jx(e){return Yn(e).position==="static"}
vendor: 9,296 bytes, line 588
588function bw(e,s){if(!_a(e)||Yn(e).position==="fixed")return null;if(s)return s(e);let r=e.offsetParent;return Ra(e)===r&&(r=r.ownerDocument.body),r}function DP(e,s){const r=Zr(e);if(af(e))return r;if(!_a(e)){let a=eo(e);for(;a&&!Fc(a);){if(Qn(a)&&!jx(a))return a;a=eo(a)}return r}let n=bw(e,s);for(;n&&g9(n)&&jx(n);)n=bw(n,s);return n&&Fc(n)&&jx(n)&&!iv(n)?r:n||y9(e)||r}const _9=async function(e){const s=this.getOffsetParent||DP,r=this.getDimensions,n=await r(e.floating);return{reference:A9(e.reference,await s(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function E9(e){return Yn(e).direction==="rtl"}const I9={convertOffsetParentRelativeRectToViewportRelativeRect:j9,getDocumentElement:Ra,getClippingRect:P9,getOffsetParent:DP,getElementRects:_9,getClientRects:w9,getDimensions:T9,getScale:Ql,isElement:Qn,isRTL:E9};function LP(e,s){return e.x===s.x&&e.y===s.y&&e.width===s.width&&e.height===s.height}function M9(e,s){let r=null,n;const a=Ra(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:h,width:p,height:x}=d;if(l||s(),!p||!x)return;const v=Um(h),f=Um(a.clientWidth-(u+p)),b=Um(a.clientHeight-(h+x)),y=Um(u),j={rootMargin:-v+"px "+-f+"px "+-b+"px "+-y+"px",threshold:qr(0,Zi(1,c))||1};let N=!0;function w(S){const k=S[0].intersectionRatio;if(k!==c){if(!N)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!LP(d,e.getBoundingClientRect())&&o(),N=!1}try{r=new IntersectionObserver(w,{...j,root:a.ownerDocument})}catch{r=new IntersectionObserver(w,j)}r.observe(e)}return o(!0),i}function R9(e,s,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=lv(e),u=a||i?[...d?gu(d):[],...gu(s)]:[];u.forEach(y=>{a&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const h=d&&l?M9(d,r):null;let p=-1,x=null;o&&(x=new ResizeObserver(y=>{let[g]=y;g&&g.target===d&&x&&(x.unobserve(s),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var j;(j=x)==null||j.observe(s)})),r()}),d&&!c&&x.observe(d),x.observe(s));let v,f=c?Xo(e):null;c&&b();function b(){const y=Xo(e);f&&!LP(f,y)&&r(),f=y,v=requestAnimationFrame(b)}return r(),()=>{var y;u.forEach(g=>{a&&g.removeEventListener("scroll",r),i&&g.removeEventListener("resize",r)}),h==null||h(),(y=x)==null||y.disconnect(),x=null,c&&cancelAnimationFrame(v)}}const F9=h9,D9=p9,L9=d9,O9=x9,$9=u9,jw=c9,z9=f9,U9=(e,s,r)=>{const n=new Map,a={platform:I9,...r},i={...a.platform,_c:n};return l9(e,s,{...a,platform:i})};var ph=typeof document<"u"?m.useLayoutEffect:m.useEffect;function sp(e,s){if(e===s)return!0;if(typeof e!=typeof s)return!1;if(typeof e=="function"&&e.toString()===s.toString())return!0;let r,n,a;if(e&&s&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==s.length)return!1;for(n=r;n--!==0;)if(!sp(e[n],s[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(s).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(s,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!sp(e[i],s[i]))return!1}return!0}return e!==e&&s!==s}function OP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ww(e,s){const r=OP(e);return Math.round(s*r)/r}function wx(e){const s=m.useRef(e);return ph(()=>{s.current=e}),s}function V9(e){e===void 0&&(e={});const{placement:s="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:r,placement:s,middlewareData:{},isPositioned:!1}),[p,x]=m.useState(n);sp(p,n)||x(n);const[v,f]=m.useState(null),[b,y]=m.useState(null),g=m.useCallback(I=>{I!==S.current&&(S.current=I,f(I))},[]),j=m.useCallback(I=>{I!==k.current&&(k.current=I,y(I))},[]),N=i||v,w=o||b,S=m.useRef(null),k=m.useRef(null),P=m.useRef(u),A=c!=null,$=wx(c),_=wx(a),O=wx(d),M=m.useCallback(()=>{if(!S.current||!k.current)return;const I={placement:s,strategy:r,middleware:p};_.current&&(I.platform=_.current),U9(S.current,k.current,I).then(F=>{const E={...F,isPositioned:O.current!==!1};C.current&&!sp(P.current,E)&&(P.current=E,ll.flushSync(()=>{h(E)}))})},[p,s,r,_,O]);ph(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(I=>({...I,isPositioned:!1})))},[d]);const C=m.useRef(!1);ph(()=>(C.current=!0,()=>{C.current=!1}),[]),ph(()=>{if(N&&(S.current=N),w&&(k.current=w),N&&w){if($.current)return $.current(N,w,M);M()}},[N,w,M,$,A]);const L=m.useMemo(()=>({reference:S,floating:k,setReference:g,setFloating:j}),[g,j]),W=m.useMemo(()=>({reference:N,floating:w}),[N,w]),q=m.useMemo(()=>{const I={position:r,left:0,top:0};if(!W.floating)return I;const F=ww(W.floating,u.x),E=ww(W.floating,u.y);return l?{...I,transform:"translate("+F+"px, "+E+"px)",...OP(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:E}},[r,l,W.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:M,refs:L,elements:W,floatingStyles:q}),[u,M,L,W,q])}const B9=e=>{function s(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&s(n)?n.current!=null?jw({element:n.current,padding:a}).fn(r):{}:n?jw({element:n,padding:a}).fn(r):{}}}},q9=(e,s)=>({...F9(e),options:[e,s]}),W9=(e,s)=>({...D9(e),options:[e,s]}),K9=(e,s)=>({...z9(e),options:[e,s]}),G9=(e,s)=>({...L9(e),options:[e,s]}),H9=(e,s)=>({...O9(e),options:[e,s]}),Q9=(e,s)=>({...$9(e),options:[e,s]}),Y9=(e,s)=>({...B9(e),options:[e,s]});var X9="Arrow",$P=m.forwardRef((e,s)=>{const{children:r,width:n=10,height:a=5,...i}=e;return t.jsx(Ge.svg,{...i,ref:s,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});$P.displayName=X9;var Z9=$P;function lf(e){const[s,r]=m.useState(void 0);return qs(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=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;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),s}var dv="Popper",[zP,Jc]=Ws(dv),[J9,UP]=zP(dv),VP=e=>{const{__scopePopper:s,children:r}=e,[n,a]=m.useState(null);return t.jsx(J9,{scope:s,anchor:n,onAnchorChange:a,children:r})};VP.displayName=dv;var BP="PopperAnchor",qP=m.forwardRef((e,s)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=UP(BP,r),o=m.useRef(null),l=lt(s,o);return m.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:t.jsx(Ge.div,{...a,ref:l})});qP.displayName=BP;var uv="PopperContent",[eL,tL]=zP(uv),WP=m.forwardRef((e,s)=>{var le,J,X,se,te,R;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:v,...f}=e,b=UP(uv,r),[y,g]=m.useState(null),j=lt(s,K=>g(K)),[N,w]=m.useState(null),S=lf(N),k=(S==null?void 0:S.width)??0,P=(S==null?void 0:S.height)??0,A=n+(i!=="center"?"-"+i:""),$=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(d)?d:[d],O=_.length>0,M={padding:$,boundary:_.filter(rL),altBoundary:O},{refs:C,floatingStyles:L,placement:W,isPositioned:q,middlewareData:I}=V9({strategy:"fixed",placement:A,whileElementsMounted:(...K)=>R9(...K,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[q9({mainAxis:a+P,alignmentAxis:o}),c&&W9({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?K9():void 0,...M}),c&&G9({...M}),H9({...M,apply:({elements:K,rects:ve,availableWidth:Ie,availableHeight:dt})=>{const{width:jt,height:Ss}=ve.reference,Mt=K.floating.style;Mt.setProperty("--radix-popper-available-width",`${Ie}px`),Mt.setProperty("--radix-popper-available-height",`${dt}px`),Mt.setProperty("--radix-popper-anchor-width",`${jt}px`),Mt.setProperty("--radix-popper-anchor-height",`${Ss}px`)}}),N&&Y9({element:N,padding:l}),nL({arrowWidth:k,arrowHeight:P}),p&&Q9({strategy:"referenceHidden",...M})]}),[F,E]=HP(W),ne=ns(v);qs(()=>{q&&(ne==null||ne())},[q,ne]);const U=(le=I.arrow)==null?void 0:le.x,Ae=(J=I.arrow)==null?void 0:J.y,G=((X=I.arrow)==null?void 0:X.centerOffset)!==0,[Q,ye]=m.useState();return qs(()=>{y&&ye(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:q?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(se=I.transformOrigin)==null?void 0:se.x,(te=I.transformOrigin)==null?void 0:te.y].join(" "),...((R=I.hide)==null?void 0:R.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(eL,{scope:r,placedSide:F,onArrowChange:w,arrowX:U,arrowY:Ae,shouldHideArrow:G,children:t.jsx(Ge.div,{"data-side":F,"data-align":E,...f,ref:j,style:{...f.style,animation:q?void 0:"none"}})})})});WP.displayName=uv;var KP="PopperArrow",sL={top:"bottom",right:"left",bottom:"top",left:"r
588ight"},GP=m.forwardRef(function(s,r){const{__scopePopper:n,...a}=s,i=tL(KP,n),o=sL[i.placedSide];return t.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:t.jsx(Z9,{...a,ref:r,style:{...a.style,display:"block"}})})});GP.displayName=KP;function rL(e){return e!==null}var nL=e=>({name:"transformOrigin",options:e,fn(s){var b,y,g;const{placement:r,rects:n,middlewareData:a}=s,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=HP(r),h={start:"0%",center:"50%",end:"100%"}[u],p=(((y=a.arrow)==null?void 0:y.x)??0)+l/2,x=(((g=a.arrow)==null?void 0:g.y)??0)+c/2;let v="",f="";return d==="bottom"?(v=o?h:`${p}px`,f=`${-c}px`):d==="top"?(v=o?h:`${p}px`,f=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,f=o?h:`${x}px`):d==="left"&&(v=`${n.floating.width+c}px`,f=o?h:`${x}px`),{data:{x:v,y:f}}}});function HP(e){const[s,r="center"]=e.split("-");return[s,r]}var mv=VP,hv=qP,pv=WP,fv=GP,[cf,UQ]=Ws("Tooltip",[Jc]),df=Jc(),QP="TooltipProvider",aL=700,fy="tooltip.open",[iL,xv]=cf(QP),YP=e=>{const{__scopeTooltip:s,delayDuration:r=aL,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),t.jsx(iL,{scope:s,isOpenDelayedRef:o,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};YP.displayName=QP;var uf="Tooltip",[oL,mf]=cf(uf),XP=e=>{const{__scopeTooltip:s,children:r,open:n,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=xv(uf,e.__scopeTooltip),d=df(s),[u,h]=m.useState(null),p=xn(),x=m.useRef(0),v=o??c.disableHoverableContent,f=l??c.delayDuration,b=m.useRef(!1),[y=!1,g]=bn({prop:n,defaultProp:a,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(fy))):c.onClose(),i==null||i(k)}}),j=m.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),N=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b.current=!1,g(!0)},[g]),w=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,g(!1)},[g]),S=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{b.current=!0,g(!0),x.current=0},f)},[f,g]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),t.jsx(mv,{...d,children:t.jsx(oL,{scope:s,contentId:p,open:y,stateAttribute:j,trigger:u,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?S():N()},[c.isOpenDelayedRef,S,N]),onTriggerLeave:m.useCallback(()=>{v?w():(window.clearTimeout(x.current),x.current=0)},[w,v]),onOpen:N,onClose:w,disableHoverableContent:v,children:r})})};XP.displayName=uf;var xy="TooltipTrigger",ZP=m.forwardRef((e,s)=>{const{__scopeTooltip:r,...n}=e,a=mf(xy,r),i=xv(xy,r),o=df(r),l=m.useRef(null),c=lt(s,l,a.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),t.jsx(hv,{asChild:!0,...o,children:t.jsx(Ge.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:c,onPointerMove:Ce(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ce(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Ce(e.onBlur,a.onClose),onClick:Ce(e.onClick,a.onClose)})})});ZP.displayName=xy;var lL="TooltipPortal",[VQ,cL]=cf(lL,{forceMount:void 0}),Dc="TooltipContent",JP=m.forwardRef((e,s)=>{const r=cL(Dc,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=mf(Dc,e.__scopeTooltip);return t.jsx(Ks,{present:n||o.open,children:o.disableHoverableContent?t.jsx(e5,{side:a,...i,ref:s}):t.jsx(dL,{side:a,...i,ref:s})})}),dL=m.forwardRef((e,s)=>{const r=mf(Dc,e.__scopeTooltip),n=xv(Dc,e.__scopeTooltip),a=m.useRef(null),i=lt(s,a),[o,l]=m.useState(null),{trigger:c,onClose:d}=r,u=a.current,{onPointerInTransitChange:h}=n,p=m.useCallback(()=>
vendor: 4,194 bytes, line 588
588{l(null),h(!1)},[h]),x=m.useCallback((v,f)=>{const b=v.currentTarget,y={x:v.clientX,y:v.clientY},g=fL(y,b.getBoundingClientRect()),j=xL(y,g),N=gL(f.getBoundingClientRect()),w=vL([...j,...N]);l(w),h(!0)},[h]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(c&&u){const v=b=>x(b,u),f=b=>x(b,c);return c.addEventListener("pointerleave",v),u.addEventListener("pointerleave",f),()=>{c.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",f)}}},[c,u,x,p]),m.useEffect(()=>{if(o){const v=f=>{const b=f.target,y={x:f.clientX,y:f.clientY},g=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),j=!yL(y,o);g?p():j&&(p(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,u,o,d,p]),t.jsx(e5,{...e,ref:i})}),[uL,mL]=cf(uf,{isInside:!1}),hL=M3("TooltipContent"),e5=m.forwardRef((e,s)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=mf(Dc,r),d=df(r),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(fy,u),()=>document.removeEventListener(fy,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=p=>{const x=p.target;x!=null&&x.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),t.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:t.jsxs(pv,{"data-state":c.stateAttribute,...d,...l,ref:s,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:[t.jsx(hL,{children:n}),t.jsx(uL,{scope:r,isInside:!0,children:t.jsx(gD,{id:c.contentId,role:"tooltip",children:a||n})})]})})});JP.displayName=Dc;var t5="TooltipArrow",pL=m.forwardRef((e,s)=>{const{__scopeTooltip:r,...n}=e,a=df(r);return mL(t5,r).isInside?null:t.jsx(fv,{...a,...n,ref:s})});pL.displayName=t5;function fL(e,s){const r=Math.abs(s.top-e.y),n=Math.abs(s.bottom-e.y),a=Math.abs(s.right-e.x),i=Math.abs(s.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function xL(e,s,r=5){const n=[];switch(s){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function gL(e){const{top:s,right:r,bottom:n,left:a}=e;return[{x:a,y:s},{x:r,y:s},{x:r,y:n},{x:a,y:n}]}function yL(e,s){const{x:r,y:n}=e;let a=!1;for(let i=0,o=s.length-1;i<s.length;o=i++){const l=s[i].x,c=s[i].y,d=s[o].x,u=s[o].y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(a=!a)}return a}function vL(e){const s=e.slice();return s.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),bL(s)}function bL(e){if(e.length<=1)return e.slice();const s=[];for(let n=0;n<e.length;n++){const a=e[n];for(;s.length>=2;){const i=s[s.length-1],o=s[s.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))s.pop();else break}s.push(a)}s.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),s.length===1&&r.length===1&&s[0].x===r[0].x&&s[0].y===r[0].y?s:s.concat(r)}var jL=YP,wL=XP,NL=ZP,s5=JP;const r5=jL,yu=wL,vu=NL,Lc=m.forwardRef(({className:e,sideOffset:s=4,...r},n)=>t.jsx(s5,{ref:n,sideOffset:s,className:je("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
588de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r}));Lc.displayName=s5.displayName;const n5=m.createContext(void 0);function kL({children:e}){const[s,r]=m.useState(()=>localStorage.getItem("theme")||"light");m.useEffect(()=>{const a=document.documentElement;a.classList.remove("light","dark"),a.classList.add(s),localStorage.setItem("theme",s)},[s]);const n=()=>{r(a=>a==="light"?"dark":"light")};return t.jsx(n5.Provider,{value:{theme:s,toggleTheme:n},children:e})}function a5(){const e=m.useContext(n5);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Nx=768;function SL(){const[e,s]=m.useState(void 0);return m.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Nx-1}px)`),n=()=>{s(window.innerWidth<Nx)};return r.addEventListener("change",n),s(window.innerWidth<Nx),()=>r.removeEventListener("change",n)},[]),!!e}const gv=cl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover-elevate active-elevate-2",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary-border",destructive:"bg-destructive text-destructive-foreground border border-destructive-border",outline:" border [border-color:var(--button-outline)]  shadow-xs active:shadow-none ",secondary:"border bg-secondary text-secondary-foreground border border-secondary-border ",ghost:"border border-transparent"},size:{default:"min-h-9 px-4 py-2",sm:"min-h-8 rounded-md px-3 text-xs",lg:"min-h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),T=m.forwardRef(({className:e,variant:s,size:r,asChild:n=!1,...a},i)=>{const o=n?Xp:"button";return t.jsx(o,{className:je(gv({variant:s,size:r,className:e})),ref:i,...a})});T.displayName="Button";const Ke=m.forwardRef(({className:e,type:s,...r},n)=>t.jsx("input",{type:s,className:je("flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Ke.displayName="Input";var CL="Separator",Nw="horizontal",PL=["horizontal","vertical"],i5=m.forwardRef((e,s)=>{const{decorative:r,orientation:n=Nw,...a}=e,i=TL(n)?n:Nw,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return t.jsx(Ge.div,{"data-orientation":i,...l,...a,ref:s})});i5.displayName=CL;function TL(e){return PL.includes(e)}var o5=i5;const rp=m.forwardRef(({className:e,orientation:s="horizontal",decorative:r=!0,...n},a)=>t.jsx(o5,{ref:a,decorative:r,orientation:s,className:je("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));rp.displayName=o5.displayName;var kx="focusScope.autoFocusOnMount",Sx="focusScope.autoFocusOnUnmount",kw={bubbles:!1,cancelable:!0},AL="FocusScope",hf=m.forwardRef((e,s)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),d=ns(a),u=ns(i),h=m.useRef(null),p=lt(s,f=>c(f)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let f=function(j){if(x.paused||!l)return;const N=j.target;l.contains(N)?h.current=N:wi(h.current,{select:!0})},b=function(j){if(x.paused||!l)return;const N=j.relatedTarget;N!==null&&(l.contains(N)||wi(h.current,{select:!0}))},y=function(j){if(document.activeElement===document.body)for(const w of j)w.removedNodes.length>0&&wi(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",b);const g=new MutationObserver(y);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",b),g.disconnect()}}},[n,l,x.paused]),m.useEffect(()=>{if(l){Cw.add(x);const f=document.activeElement;if(!l.contains(f)){const y=new CustomEvent(kx,kw);l.addEventListener(kx,d),l.dispatchEvent(y),y.defaultPrevented||(_L(FL(l5(l)),{select:!0}),document.activeElement===f&&wi(l))}return()=>{l.removeEventListener(kx,d),setTimeout(()=>{const y=new CustomEvent(Sx,kw);l.addEventListener(Sx,u),l.dispatchEvent(y),y.defaultPrevented||wi(f??document.body,{select:!0}),l.removeEventListener(Sx,u),Cw.remove(x)},0)}}},[l,d,u,x]);const v=m.useCallback(f=>{if(!r&&!n||x.paused)return;const b=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(b&&y){const g=f.currentTarget,[j,N]=EL(g);j&&N?!f.shiftKey&&y===N?(f.preventDefault(),r&&wi(j,{select:!0})):f.shiftKey&&y===j&&(f.preventDefault(),r&&wi(N,{select:!0})):y===g&&f.preventDefault()}},[r,n,x.paused]);return t.jsx(Ge.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});hf.displayName=AL;function _L(e,{select:s=!1}={}){const r=document.activeElement;for(const n of e)if(wi(n,{select:s}),document.activeElement!==r)return}function EL(e){const s=l5(e),r=Sw(s,e),n=Sw(s.reverse(),e);return[r,n]}function l5(e){const s=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function Sw(e,s){for(const r of e)if(!IL(r,{upTo:s}))return r}function IL(e,{upTo:s}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(s!==void 0&&e===s)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ML(e){return e instanceof HTMLInputElement&&"select"in e}function wi(e,{select:s=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ML(e)&&s&&e.select()}}var Cw=RL();function RL(){let e=[];return{add(s){const r=e[0];s!==r&&(r==null||r.pause()),e=Pw(e,s),e.unshift(s)},remove(s){var r;e=Pw(e,s),(r=e[0])==null||r.resume()}}}function Pw(e,s){const r=[...e],n=r.indexOf(s);return n!==-1&&r.splice(n,1),r}function FL(e){return e.filter(s=>s.tagName!=="A")}var Cx=0;function yv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Tw()),document.body.insertAdjacentElement("beforeend",e[1]??Tw()),Cx++,()=>{Cx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>
vendor: 5,795 bytes, lines 588-603
588s.remove()),Cx--}},[])}function Tw(){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 ga=function(){return ga=Object.assign||function(s){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},ga.apply(this,arguments)};function c5(e,s){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&s.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)s.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function DL(e,s,r){if(r||arguments.length===2)for(var n=0,a=s.length,i;n<a;n++)(i||!(n in s))&&(i||(i=Array.prototype.slice.call(s,0,n)),i[n]=s[n]);return e.concat(i||Array.prototype.slice.call(s))}var fh="right-scroll-bar-position",xh="width-before-scroll-bar",LL="with-scroll-bars-hidden",OL="--removed-body-scroll-bar-size";function Px(e,s){return typeof e=="function"?e(s):e&&(e.current=s),e}function $L(e,s){var r=m.useState(function(){return{value:e,callback:s,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=s,r.facade}var zL=typeof window<"u"?m.useLayoutEffect:m.useEffect,Aw=new WeakMap;function UL(e,s){var r=$L(null,function(n){return e.forEach(function(a){return Px(a,n)})});return zL(function(){var n=Aw.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||Px(l,null)}),i.forEach(function(l){a.has(l)||Px(l,o)})}Aw.set(r,e)},[e]),r}function VL(e){return e}function BL(e,s){s===void 0&&(s=VL);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=s(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),r}}}};return a}function qL(e){e===void 0&&(e={});var s=BL(null);return s.options=ga({async:!0,ssr:!1},e),s}var d5=function(e){var s=e.sideCar,r=c5(e,["sideCar"]);if(!s)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=s.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,ga({},r))};d5.isSideCarExport=!0;function WL(e,s){return e.useMedium(s),d5}var u5=qL(),Tx=function(){},pf=m.forwardRef(function(e,s){var r=m.useRef(null),n=m.useState({onScrollCapture:Tx,onWheelCapture:Tx,onTouchMoveCapture:Tx}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,x=e.noIsolation,v=e.inert,f=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,g=e.gapMode,j=c5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,w=UL([r,s]),S=ga(ga({},j),a);return m.createElement(m.Fragment,null,u&&m.createElement(N,{sideCar:u5,removeScrollBar:d,shards:h,noIsolation:x,inert:v,setCallbacks:i,allowPinchZoom:!!f,lockRef:r,gapMode:g}),o?m.cloneElement(m.Children.only(l),ga(ga({},S),{ref:w})):m.createElement(y,ga({},S,{className:c,ref:w}),l))});pf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pf.classNames={fullWidth:xh,zeroRight:fh};var KL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var s=KL();return s&&e.setAttribute("nonce",s),e}function HL(e,s){e.styleSheet?e.styleSheet.cssText=s:e.appendChild(document.createTextNode(s))}function QL(e){var s=document.head||document.getElementsByTagName("head")[0];s.appendChild(e)}var YL=function(){var e=0,s=null;return{add:function(r){e==0&&(s=GL())&&(HL(s,r),QL(s)),e++},remove:function(){e--,!e&&s&&(s.parentNode&&s.parentNode.removeChild(s),s=null)}}},XL=function(){var e=YL();return function(s,r){m.useEffect(function(){return e.add(s),function(){e.remove()}},[s&&r])}},m5=function(){var e=XL(),s=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return s},ZL={left:0,top:0,right:0,gap:0},Ax=function(e){return parseInt(e||"",10)||0},JL=function(e){var s=window.getComputedStyle(document.body),r=s[e==="padding"?"paddingLeft":"marginLeft"],n=s[e==="padding"?"paddingTop":"marginTop"],a=s[e==="padding"?"paddingRight":"marginRight"];return[Ax(r),Ax(n),Ax(a)]},eO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZL;var s=JL(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,n-r+s[2]-s[0])}},tO=m5(),Yl="data-scroll-locked",sO=function(e,s,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
589  .`.concat(LL,` {
590   overflow: hidden `).concat(n,`;
591   padding-right: `).concat(l,"px ").concat(n,`;
592  }
593  body[`).concat(Yl,`] {
594    overflow: hidden `).concat(n,`;
595    overscroll-behavior: contain;
596    `).concat([s&&"position: relative ".concat(n,";"),r==="margin"&&`
597    padding-left: `.concat(a,`px;
598    padding-top: `).concat(i,`px;
599    padding-right: `).concat(o,`px;
600    margin-left:0;
601    margin-top:0;
602    margin-right: `).concat(l,"px ").concat(n,`;
603    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
603")].filter(Boolean).join(""),`
604  }
605  
606  .`).concat(fh,` {
607    right: `).concat(l,"px ").concat(n,`;
608  }
609  
610  .`).concat(xh,` {
611    margin-right: `).concat(l,"px ").concat(n,`;
612  }
613  
614  .`).concat(fh," .").concat(fh,` {
615    right: 0 `).concat(n,`;
616  }
617  
618  .`).concat(xh," .").concat(xh,` {
619    margin-right: 0 `).concat(n,`;
620  }
621  
622  body[`).concat(Yl,`] {
623    `).concat(OL,": ").concat(l,`px;
624  }
625`)},_w=function(){var e=parseInt(document.body.getAttribute(Yl)||"0",10);return isFinite(e)?e:0},rO=function(){m.useEffect(function(){return document.body.setAttribute(Yl,(_w()+1).toString()),function(){var e=_w()-1;e<=0?document.body.removeAttribute(Yl):document.body.setAttribute(Yl,e.toString())}},[])},nO=function(e){var s=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;rO();var i=m.useMemo(function(){return eO(a)},[a]);return m.createElement(tO,{styles:sO(i,!s,a,r?"":"!important")})},gy=!1;if(typeof window<"u")try{var Vm=Object.defineProperty({},"passive",{get:function(){return gy=!0,!0}});window.addEventListener("test",Vm,Vm),window.removeEventListener("test",Vm,Vm)}catch{gy=!1}var yl=gy?{passive:!1}:!1,aO=function(e){return e.tagName==="TEXTAREA"},h5=function(e,s){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[s]!=="hidden"&&!(r.overflowY===r.overflowX&&!aO(e)&&r[s]==="visible")},iO=function(e){return h5(e,"overflowY")},oO=function(e){return h5(e,"overflowX")},Ew=function(e,s){var r=s.ownerDocument,n=s;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=p5(e,n);if(a){var i=f5(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},lO=function(e){var s=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[s,r,n]},cO=function(e){var s=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[s,r,n]},p5=function(e,s){return e==="v"?iO(s):oO(s)},f5=function(e,s){return e==="v"?lO(s):cO(s)},dO=function(e,s){return e==="h"&&s==="rtl"?-1:1},uO=function(e,s,r,n,a){var i=dO(e,window.getComputedStyle(s).direction),o=i*n,l=r.target,c=s.contains(l),d=!1,u=o>0,h=0,p=0;do{var x=f5(e,l),v=x[0],f=x[1],b=x[2],y=f-b-i*v;(v||y)&&p5(e,l)&&(h+=y,p+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(s.contains(l)||s===l));return(u&&(Math.abs(h)<1||!a)||!u&&(Math.abs(p)<1||!a))&&(d=!0),d},Bm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Iw=function(e){return[e.deltaX,e.deltaY]},Mw=function(e){return e&&"current"in e?e.current:e},mO=function(e,s){return e[0]===s[0]&&e[1]===s[1]},hO=function(e){return`
626  .block-interactivity-`.concat(e,` {pointer-events: none;}
627  .allow-interactivity-`).concat(e,` {pointer-events: all;}
628`)},pO=0,vl=[];function fO(e){var s=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),a=m.useState(pO++)[0],i=m.useState(m5)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var f=DL([e.lockRef.current],(e.shards||[]).map(Mw),!0).filter(Boolean);return f.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),f.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(f,b){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!o.current.allowPinchZoom;var y=Bm(f),g=r.current,j="deltaX"in f?f.deltaX:g[0]-y[0],N="deltaY"in f?f.deltaY:g[1]-y[1],w,S=f.target,k=Math.abs(j)>Math.abs(N)?"h":"v";if("touches"in f&&k==="h"&&S.type==="range")return!1;var P=Ew(k,S);if(!P)return!0;if(P?w=k:(w=k==="v"?"h":"v",P=Ew(k,S)),!P)return!1;if(!n.current&&"changedTouches"in f&&(j||N)&&(n.current=w),!w)return!0;var A=n.current||w;return uO(A,b,f,A==="h"?j:N,!0)},[]),c=m.useCallback(function(f){var b=f;if(!(!vl.length||vl[vl.length-1]!==i)){var y="deltaY"in b?Iw(b):Bm(b),g=s.current.filter(function(w){return w.name===b.type&&(w.target===b.target||b.target===w.shadowParent)&&mO(w.delta,y)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}
vendor: 9,273 bytes, lines 628-632
628if(!g){var j=(o.current.shards||[]).map(Mw).filter(Boolean).filter(function(w){return w.contains(b.target)}),N=j.length>0?l(b,j[0]):!o.current.noIsolation;N&&b.cancelable&&b.preventDefault()}}},[]),d=m.useCallback(function(f,b,y,g){var j={name:f,delta:b,target:y,should:g,shadowParent:xO(y)};s.current.push(j),setTimeout(function(){s.current=s.current.filter(function(N){return N!==j})},1)},[]),u=m.useCallback(function(f){r.current=Bm(f),n.current=void 0},[]),h=m.useCallback(function(f){d(f.type,Iw(f),f.target,l(f,e.lockRef.current))},[]),p=m.useCallback(function(f){d(f.type,Bm(f),f.target,l(f,e.lockRef.current))},[]);m.useEffect(function(){return vl.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,yl),document.addEventListener("touchmove",c,yl),document.addEventListener("touchstart",u,yl),function(){vl=vl.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,yl),document.removeEventListener("touchmove",c,yl),document.removeEventListener("touchstart",u,yl)}},[]);var x=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(i,{styles:hO(a)}):null,x?m.createElement(nO,{gapMode:e.gapMode}):null)}function xO(e){for(var s=null;e!==null;)e instanceof ShadowRoot&&(s=e.host,e=e.host),e=e.parentNode;return s}const gO=WL(u5,fO);var ff=m.forwardRef(function(e,s){return m.createElement(pf,ga({},e,{ref:s,sideCar:gO}))});ff.classNames=pf.classNames;var yO=function(e){if(typeof document>"u")return null;var s=Array.isArray(e)?e[0]:e;return s.ownerDocument.body},bl=new WeakMap,qm=new WeakMap,Wm={},_x=0,x5=function(e){return e&&(e.host||x5(e.parentNode))},vO=function(e,s){return s.map(function(r){if(e.contains(r))return r;var n=x5(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},bO=function(e,s,r,n){var a=vO(s,Array.isArray(e)?e:[e]);Wm[r]||(Wm[r]=new WeakMap);var i=Wm[r],o=[],l=new Set,c=new Set(a),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};a.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(l.has(p))u(p);else try{var x=p.getAttribute(n),v=x!==null&&x!=="false",f=(bl.get(p)||0)+1,b=(i.get(p)||0)+1;bl.set(p,f),i.set(p,b),o.push(p),f===1&&v&&qm.set(p,!0),b===1&&p.setAttribute(r,"true"),v||p.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return u(s),l.clear(),_x++,function(){o.forEach(function(h){var p=bl.get(h)-1,x=i.get(h)-1;bl.set(h,p),i.set(h,x),p||(qm.has(h)||h.removeAttribute(n),qm.delete(h)),x||h.removeAttribute(r)}),_x--,_x||(bl=new WeakMap,bl=new WeakMap,qm=new WeakMap,Wm={})}},vv=function(e,s,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=yO(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),bO(n,a,r,"aria-hidden")):function(){return null}},bv="Dialog",[g5,y5]=Ws(bv),[jO,ta]=g5(bv),v5=e=>{const{__scopeDialog:s,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[d=!1,u]=bn({prop:n,defaultProp:a,onChange:i});return t.jsx(jO,{scope:s,triggerRef:l,contentRef:c,contentId:xn(),titleId:xn(),descriptionId:xn(),open:d,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(h=>!h),[u]),modal:o,children:r})};v5.displayName=bv;var b5="DialogTrigger",j5=m.forwardRef((e,s)=>{const{__scopeDialog:r,...n}=e,a=ta(b5,r),i=lt(s,a.triggerRef);return t.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Nv(a.open),...n,ref:i,onClick:Ce(e.onClick,a.onOpenToggle)})});j5.displayName=b5;var jv="DialogPortal",[wO,w5]=g5(jv,{forceMount:void 0}),N5=e=>{const{__scopeDialog:s,forceMount:r,children:n,container:a}=e,i=ta(jv,s);return t.jsx(wO,{scope:s,forceMount:r,children:m.Children.map(n,o=>t.jsx(Ks,{present:r||i.open,children:t.jsx(Xu,{asChild:!0,container:a,children:o})}))})};N5.displayName=jv;var np="DialogOverlay",k5=m.forwardRef((e,s)=>{const r=w5(np,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=ta(np,e.__scopeDialog);return i.modal?t.jsx(Ks,{present:n||i.open,children:t.jsx(kO,{...a,ref:s})}):null});k5.displayName=np;var NO=Ho("DialogOverlay.RemoveScroll"),kO=m.forwardRef((e,s)=>{const{__scopeDialog:r,...n}=e,a=ta(np,r);return t.jsx(ff,{as:NO,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(Ge.div,{"data-state":Nv(a.open),...n,ref:s,style:{pointerEvents:"auto",...n.style}})})}),Zo="DialogContent",S5=m.forwardRef((e,s)=>{const r=w5(Zo,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=ta(Zo,e.__scopeDialog);return t.jsx(Ks,{present:n||i.open,children:i.modal?t.jsx(SO,{...a,ref:s}):t.jsx(CO,{...a,ref:s})})});S5.displayName=Zo;var SO=m.forwardRef((e,s)=>{const r=ta(Zo,e.__scopeDialog),n=m.useRef(null),a=lt(s,r.contentRef,n);return m.useEffect(()=>{const i=n.current;if(i)return vv(i)},[]),t.jsx(C5,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,i=>i.preventDefault())})}),CO=m.forwardRef((e,s)=>{const r=ta(Zo,e.__scopeDialog),n=m.useRef(!1),a=m.useRef(!1);return t.jsx(C5,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),C5=m.forwardRef((e,s)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=ta(Zo,r),c=m.useRef(null),d=lt(s,c);return yv(),t.jsxs(t.Fragment,{children:[t.jsx(hf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Qc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Nv(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(TO,{titleId:l.titleId}),t.jsx(_O,{contentRef:c,descriptionId:l.descriptionId})]})]})}),wv="DialogTitle",P5=m.forwardRef((e,s)=>{const{__scopeDialog:r,...n}=e,a=ta(wv,r);return t.jsx(Ge.h2,{id:a.titleId,...n,ref:s})});P5.displayName=wv;var T5="DialogDescription",A5=m.forwardRef((e,s)=>{const{__scopeDialog:r,...n}=e,a=ta(T5,r);return t.jsx(Ge.p,{id:a.descriptionId,...n,ref:s})});A5.displayName=T5;var _5="DialogClose",E5=m.forwardRef((e,s)=>{const{__scopeDialog:r,...n}=e,a=ta(_5,r);return t.jsx(Ge.button,{type:"button",...n,ref:s,onClick:Ce(e.onClick,()=>a.onOpenChange(!1))})});E5.displayName=_5;function Nv(e){return e?"open":"closed"}var I5="DialogTitleWarning",[PO,M5]=QF(I5,{contentName:Zo,titleName:wv,docsSlug:"dialog"}),TO=({titleId:e})=>{const s=M5(I5),r=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
629
630If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
631
632For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},AO="DialogDescriptionWarning",_O=({contentRef:e,descriptionId:s})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${M5(AO).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");s&&a&&(document.getElementById(s)||console.warn(n))},[n,e,s]),null},kv=v5,R5=j5,Sv=N5,tm=k5,sm=S5,rm=P5,nm=A5,xf=E5;const EO=kv,IO=Sv,F5=m.forwardRef(({className:e,...s},r)=>t.jsx(tm,{className:je("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),...s,ref:r}));F5.displayName=tm.displayName;const MO=cl("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),D5=m.forwardRef(({side:e="right",className:s,children:r,...n},a)=>t.jsxs(IO,{children:[t.jsx(F5,{}),t.jsxs(sm,{ref:a,className:je(MO({side:e}),s),...n,children:[r,t.jsxs(xf,{className:"absolute right-4 top-4 roun
632ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[t.jsx(xr,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));D5.displayName=sm.displayName;const L5=({className:e,...s})=>t.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...s});L5.displayName="SheetHeader";const O5=m.forwardRef(({className:e,...s},r)=>t.jsx(rm,{ref:r,className:je("text-lg font-semibold text-foreground",e),...s}));O5.displayName=rm.displayName;const $5=m.forwardRef(({className:e,...s},r)=>t.jsx(nm,{ref:r,className:je("text-sm text-muted-foreground",e),...s}));$5.displayName=nm.displayName;function cn({className:e,...s}){return t.jsx("div",{className:je("animate-pulse rounded-md bg-muted",e),...s})}const RO="sidebar_state",FO=60*60*24*7,DO="16rem",LO="18rem",OO="3rem",$O="b",z5=m.createContext(null);function gf(){const e=m.useContext(z5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function wr({defaultOpen:e=!0,open:s,onOpenChange:r,className:n,style:a,children:i,...o}){const l=SL(),[c,d]=m.useState(!1),[u,h]=m.useState(e),p=s??u,x=m.useCallback(y=>{const g=typeof y=="function"?y(p):y;r?r(g):h(g),document.cookie=`${RO}=${g}; path=/; max-age=${FO}`},[r,p]),v=m.useCallback(()=>l?d(y=>!y):x(y=>!y),[l,x,d]);m.useEffect(()=>{const y=g=>{g.key===$O&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),v())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[v]);const f=p?"expanded":"collapsed",b=m.useMemo(()=>({state:f,open:p,setOpen:x,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:v}),[f,p,x,l,c,d,v]);return t.jsx(z5.Provider,{value:b,children:t.jsx(r5,{delayDuration:0,children:t.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":DO,"--sidebar-width-icon":OO,...a},className:je("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...o,children:i})})})}function zO({side:e="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:a,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=gf();return r==="none"?t.jsx("div",{"data-slot":"sidebar",className:je("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:a}):o?t.jsx(EO,{open:c,onOpenChange:d,...i,children:t.jsxs(D5,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden",style:{"--sidebar-width":LO},side:e,children:[t.jsxs(L5,{className:"sr-only",children:[t.jsx(O5,{children:"Sidebar"}),t.jsx($5,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):t.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":s,"data-side":e,"data-slot":"sidebar",children:[t.jsx("div",{"data-slot":"sidebar-gap",className:je("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+var(--spacing-4))]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),t.jsx("div",{"data-slot":"sidebar-container",className:je("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+var(--spacing-4)+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:t.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function Nr({className:e,onClick:s,...r}){const{toggleSidebar:n}=gf();return t.jsxs(T,{"data-sidebar":"trigger","data-slot":"sidebar-tr
632igger",variant:"ghost",size:"icon",className:je("h-7 w-7",e),onClick:a=>{s==null||s(a),n()},...r,children:[t.jsx(a7,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function UO({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:je("flex flex-col gap-2 p-2",e),...s})}function VO({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:je("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...s})}function BO({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:je("relative flex w-full min-w-0 flex-col p-2",e),...s})}function qO({className:e,asChild:s=!1,...r}){const n=s?Xp:"div";return t.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:je("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function WO({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:je("w-full text-sm",e),...s})}function KO({className:e,...s}){return t.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:je("flex w-full min-w-0 flex-col gap-1",e),...s})}function Rw({className:e,...s}){return t.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:je("group/menu-item relative",e),...s})}const GO=cl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:w-8! group-data-[collapsible=icon]:h-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Fw({asChild:e=!1,isActive:s=!1,variant:r="default",size:n="default",tooltip:a,className:i,...o}){const l=e?Xp:"button",{isMobile:c,state:d}=gf(),u=t.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":s,className:je(GO({variant:r,size:n}),i),...o});return a?(typeof a=="string"&&(a={children:a}),t.jsxs(yu,{children:[t.jsx(vu,{asChild:!0,children:u}),t.jsx(Lc,{side:"right",align:"center",hidden:d!=="collapsed"||c,...a})]})):u}var U5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Dw=Ve.createContext&&Ve.createContext(U5),HO=["attr","size","title"];function QO(e,s){if(e==null)return{};var r=YO(e,s),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(s.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YO(e,s){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(s.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];
vendor: 4,913 bytes, line 632
632for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ap.apply(this,arguments)}function Lw(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ip(e){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Lw(Object(r),!0).forEach(function(n){XO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XO(e,s,r){return s=ZO(s),s in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}function ZO(e){var s=JO(e,"string");return typeof s=="symbol"?s:s+""}function JO(e,s){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,s||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(e)}function V5(e){return e&&e.map((s,r)=>Ve.createElement(s.tag,ip({key:r},s.attr),V5(s.child)))}function Gs(e){return s=>Ve.createElement(e$,ap({attr:ip({},e.attr)},s),V5(e.child))}function e$(e){var s=r=>{var{attr:n,size:a,title:i}=e,o=QO(e,HO),l=a||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),Ve.createElement("svg",ap({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:c,style:ip(ip({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&Ve.createElement("title",null,i),e.children)};return Dw!==void 0?Ve.createElement(Dw.Consumer,null,r=>s(r)):s(U5)}function B5(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},child:[]}]})(e)}function wn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},child:[]}]})(e)}function Nn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.00
6327-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},child:[]}]})(e)}function kn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},child:[]}]})(e)}function Xn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},child:[]}]})(e)}function Cv(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.206.793c.99 0 4.347.276 5.93 3.821.529 1.193.403 3.219.299 4.847l-.003.06c-.012.18-.022.345-.03.51.075.045.203.09.401.09.3-.016.659-.12 1.033-.301.165-.088.344-.104.464-.104.182 0 .359.029.509.09.45.149.734.479.734.838.015.449-.39.839-1.213 1.168-.089.029-.209.075-.344.119-.45.135-1.139.36-1.333.81-.09.224-.061.524.12.868l.015.015c.06.136 1.526 3.475 4.791 4.014.255.044.435.27.42.509 0 .075-.015.149-.045.225-.24.569-1.273.988-3.146 1.271-.059.091-.12.375-.164.57-.029.179-.074.36-.134.553-.076.271-.27.405-.555.405h-.03c-.135 0-.313-.031-.538-.074-.36-.075-.765-.135-1.273-.135-.3 0-.599.015-.913.074-.6.104-1.123.464-1.723.884-.853.599-1.826 1.288-3.294 1.288-.06 0-.119-.015-.18-.015h-.149c-1.468 0-2.427-.675-3.279-1.288-.599-.42-1.107-.779-1.707-.884-.314-.045-.629-.074-.928-.074-.54 0-.958.089-1.272.149-.211.043-.391.074-.54.074-.374 0-.523-.224-.583-.42-.061-.192-.09-.389-.135-.567-.046-.181-.105-.494-.166-.57-1.918-.222-2.95-.642-3.189-1.226-.031-.063-.052-.15-.055-.225-.015-.243.165-.465.42-.509 3.264-.54 4.73-3.879 4.791-4.02l.016-.029c.18-.345.224-.645.119-.869-.195-.434-.884-.658-1.332-.809-.121-.029-.24-.074-.346-.119-1.107-.435-1.257-.93-1.197-1.273.09-.479.674-.793 1.168-.793.146 0 .27.029.383.074.42.194.789.3 1.104.3.234 0 .384-.06.465-.105l-.046-.569c-.098-1.626-.225-3.651.307-4.837C7.392 1.077 10.739.807 11.727.807l.419-.015h.06z"},child:[]}]})(e)}function Zn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08
632-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},child:[]}]})(e)}function gr(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},child:[]}]})(e)}function Sn(e){return Gs({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},child:[]}]})(e)}const q5=m.createContext(null);function t$({children:e}){const{toast:s}=bt(),{data:r,error:n,isLoading:a}=Ee({queryKey:["/api/user"],queryFn:E3({on401:"returnNull"})}),i=ke({mutationFn:async l=>{const c=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),credentials:"include"}),d=await c.json();if(c.status===403&&d.requiresVerification)throw new Error(`VERIFICATION_REQUIRED:${d.email}`);if(!c.ok)throw new Error(d.message||c.statusText);return d},onSuccess:l=>{ee.setQueryData(["/api/user"],l)},onError:l=>{if(l.message.startsWith("VERIFICATION_REQUIRED:")){const c=l.message.split(":")[1];window.location.href=`/verify?email=${encodeURIComponent(c)}`}else s({title:"Login failed",description:l.message,variant:"destructive"})}}),o=ke({mutationFn:async()=>{await Fe("POST","/api/logout")},onSuccess:()=>{ee.setQueryData(["/api/user"],null),window.location.href="/"},onError:l=>{s({title:"Logout failed",description:l.message,variant:"destructive"})}});return t.jsx(q5.Provider,{value:{user:r??null,isLoading:a,error:n,loginMutation:i,logoutMutation:o},children:e})}function hi(){const e=m.useContext(q5);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function W5(){const{data:e,isLoading:s}=Ee({queryKey:["/api/user/is-admin"],retry:!1});return{isAdmin:(e==null?void 0:e.isAdmin)??!1,isLoading:s}}const s$=cl("whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover-elevate ",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-xs",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-xs",outline:" border [border-color:var(--badge-outline)] shadow-xs"}},defaultVariants:{variant:"default"}});function xe({className:e,variant:s,...r}){return t.jsx("div",{className:je(s$({variant:s}),e),...r})}function op({membershipLevel:e,size:s="sm"}){const r=e==null?void 0:e.toLowerCase();return r==="professional"?t.jsxs(xe,{variant:"outline",className:`bg-amber-500/10 text-amber-500 border-amber-500/30 ${s==="sm"?"text-[10px] px-1.5 py-0 h-4":"text-xs px-2 py-0.5 h-5"}`,"data-testid":"badge-membership-pro",children:[t.jsx(tf,{className:s==="sm"?"h-2.5 w-2.5 mr-0.5":"h-3 w-3 mr-1"}),"Pro"]}):r==="starter"?t.jsxs(xe,{variant:"outline",className:`bg-blue-500/10 text-blue-500 border-blue-500/30 ${s==="sm"?"text-[10px] px-1.5 py-0 h-4":"text-xs px-2 py-0.5 h-5"}`,"data-testid":"badge-membership-starter",children:[t.jsx(Aa,{className:s==="sm"?"h-2.5 w-2.5 mr-0.5":"h-3 w-3 mr-1"}),"Starter"]}):r==="trial"?t.jsxs(xe,{variant:"outline",className:`bg-muted text-muted-foreground border-muted-foreground/30 ${s==="sm"?"text-[10px] px-1.5 py-0 h-4":"text-xs px-2 py-0.5 h-5"}`,"data-testid":"badge-membership-trial",children:[t.jsx(ws,{className:s==="sm"?"h-2.5 w-2.5 mr-0.5":"h-3 w-3 mr-1"}),"Trial"]}
632):null}function r$({className:e}){return t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:e,fill:"currentColor",children:t.jsx("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})})}const n$=[{title:"Dashboard",url:"/",icon:XD,testId:"nav-dashboard"},{title:"Create Post",url:"/create-post",icon:d7,testId:"nav-manual-post"},{title:"Media Library",url:"/videos",icon:Ft,testId:"nav-videos"},{title:"Inspirations",url:"/inspirations",icon:r$,testId:"nav-inspirations"},{title:"Analytics",url:"/analytics",icon:Mc,testId:"nav-analytics"},{title:"Configuration",url:"/x-config",icon:gr,testId:"nav-x-config"},{title:"Post Settings",url:"/settings",icon:qn,testId:"nav-settings"}];function kr(){const[e]=Ma(),{setOpenMobile:s}=gf(),{user:r,logoutMutation:n}=hi(),{isAdmin:a}=W5(),i=()=>{n.mutate()};return t.jsxs(zO,{children:[t.jsx(VO,{children:t.jsxs(BO,{children:[t.jsx(qO,{children:"Navigation"}),t.jsx(WO,{children:t.jsxs(KO,{children:[n$.map(o=>t.jsx(Rw,{children:t.jsx(Fw,{asChild:!0,isActive:e===o.url,children:t.jsxs(me,{href:o.url,"data-testid":o.testId,onClick:()=>s(!1),children:[t.jsx(o.icon,{className:"h-4 w-4"}),t.jsx("span",{children:o.title})]})})},o.title)),a&&t.jsx(Rw,{children:t.jsx(Fw,{asChild:!0,isActive:e==="/admin",children:t.jsxs(me,{href:"/admin","data-testid":"nav-admin",onClick:()=>s(!1),children:[t.jsx(Rc,{className:"h-4 w-4"}),t.jsx("span",{children:"Admin"})]})})})]})})]})}),t.jsxs(UO,{children:[t.jsx("div",{className:"px-4 pb-2",children:t.jsxs("a",{href:"https://discord.gg/3M87xDmVnm",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors rounded-md hover:bg-sidebar-accent","data-testid":"link-discord-support",children:[t.jsx(B5,{className:"h-4 w-4"}),t.jsx("span",{children:"Discord Support"})]})}),t.jsxs("div",{className:"p-4 border-t border-sidebar-border space-y-2",children:[r&&t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/profile",onClick:()=>s(!1),children:t.jsxs(T,{variant:"ghost",className:"w-full justify-start gap-2","data-testid":"button-sidebar-profile",children:[t.jsx(fr,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:r.username}),t.jsx(op,{membershipLevel:r.membershipLevel,size:"sm"})]})}),(r.membershipLevel.toLowerCase()==="trial"||r.membershipLevel.toLowerCase()==="starter")&&t.jsx(me,{href:"/upgrade",onClick:()=>s(!1),children:t.jsxs(T,{variant:"ghost",className:"w-full justify-start gap-2","data-testid":"button-sidebar-upgrade",children:[t.jsx("span",{className:"flex-shrink-0 px-1.5 py-0.5 text-[10px] font-bold bg-gradient-to-r from-amber-500 to-orange-500 text-white rounded",children:"PRO"}),t.jsx("span",{className:"text-muted-foreground text-sm",children:"Upgrade"})]})})]}),t.jsxs(T,{variant:"ghost",className:"w-full justify-start",onClick:i,disabled:n.isPending,"data-testid":"button-logout",children:[t.jsx(mP,{className:"mr-2 h-4 w-4"}),n.isPending?"Logging out...":"Log Out"]})]})]})]})}function bu(){const{theme:e,toggleTheme:s}=a5();return t.jsx(T,{variant:"ghost",size:"icon",onClick:s,"data-testid":"button-theme-toggle",className:"toggle-elevate","data-state":e,children:e==="dark"?t.jsx(fu,{className:"h-5 w-5"}):t.jsx(hu,{className:"h-5 w-5"})})}function Sr(){const{user:e}=hi();return e?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(op,{membershipLevel:e.membershipLevel,size:"md"}),t.jsx(me,{href:"/profile",children:t.jsx(T,{variant:"ghost",size:"icon","data-testid":"button-user-profile",title:`Profile - ${e.username}`,children:t.jsx(fr,{className:"h-5 w-5"})})}),t.jsx(bu,{})]}):t.jsx(bu,{})}function Cr({children:e}){const{user:s,isLoading:r}=hi();return r?t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-border"})}):s?t.jsx(t.Fragment,{children:e}):t.jsx(du,{to:"/auth"})}function a$({children:e}){const{user:s,isLoading:r}=hi(),{isAdmin:n,isLoading:a}=W5();return r||a?t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-border"})}):s?n?t.jsx(t.Fragment,{children:e}):t.jsx(du,{to:"/dashboard"}):t.jsx(du,{to:"/auth"})}const re=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("shadcn-card rounded-xl border bg-card border-card-border text-card-foreground shadow-sm",e),...s}));
vendor: 7,276 bytes, line 632
632re.displayName="Card";const he=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("flex flex-col space-y-1.5 p-6",e),...s}));he.displayName="CardHeader";const pe=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("text-2xl font-semibold leading-none tracking-tight",e),...s}));pe.displayName="CardTitle";const Ze=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("text-sm text-muted-foreground",e),...s}));Ze.displayName="CardDescription";const de=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("p-6 pt-0",e),...s}));de.displayName="CardContent";const Pv=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("flex items-center p-6 pt-0",e),...s}));Pv.displayName="CardFooter";function i$(){return t.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:t.jsx(re,{className:"w-full max-w-md mx-4",children:t.jsxs(de,{className:"pt-6",children:[t.jsxs("div",{className:"flex mb-4 gap-2",children:[t.jsx(hr,{className:"h-8 w-8 text-red-500"}),t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),t.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}var o$="Label",K5=m.forwardRef((e,s)=>t.jsx(Ge.label,{...e,ref:s,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));K5.displayName=o$;var G5=K5;const l$=cl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ae=m.forwardRef(({className:e,...s},r)=>t.jsx(G5,{ref:r,className:je(l$(),e),...s}));ae.displayName=G5.displayName;var c$=m.createContext(void 0);function ed(e){const s=m.useContext(c$);return e||s||"ltr"}var Ex="rovingFocusGroup.onEntryFocus",d$={bubbles:!1,cancelable:!0},yf="RovingFocusGroup",[yy,H5,u$]=Zp(yf),[m$,td]=Ws(yf,[u$]),[h$,p$]=m$(yf),Q5=m.forwardRef((e,s)=>t.jsx(yy.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(yy.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(f$,{...e,ref:s})})}));Q5.displayName=yf;var f$=m.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,p=m.useRef(null),x=lt(s,p),v=ed(i),[f=null,b]=bn({prop:o,defaultProp:l,onChange:c}),[y,g]=m.useState(!1),j=ns(d),N=H5(r),w=m.useRef(!1),[S,k]=m.useState(0);return m.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Ex,j),()=>P.removeEventListener(Ex,j)},[j]),t.jsx(h$,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:f,onItemFocus:m.useCallback(P=>b(P),[b]),onItemShiftTab:m.useCallback(()=>g(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>k(P=>P-1),[]),children:t.jsx(Ge.div,{tabIndex:y||S===0?-1:0,"data-orientation":n,...h,ref:x,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{w.current=!0}),onFocus:Ce(e.onFocus,P=>{const A=!w.current;if(P.target===P.currentTarget&&A&&!y){const $=new CustomEvent(Ex,d$);if(P.currentTarget.dispatchEvent($),!$.defaultPrevented){const _=N().filter(W=>W.focusable),O=_.find(W=>W.active),M=_.find(W=>W.id===f),L=[O,M,..._].filter(Boolean).map(W=>W.ref.current);Z5(L,u)}}w.current=!1}),onBlur:Ce(e.onBlur,()=>g(!1))})})}),Y5="RovingFocusGroupItem",X5=m.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,...o}=e,l=xn(),c=i||l,d=p$(Y5,r),u=d.currentTabStopId===c,h=H5(r),{onFocusableItemAdd:p,onFocusableItemRemove:x}=d;return m.useEffect(()=>{if(n)return p(),()=>x()},[n,p,x]),t.jsx(yy.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:t.jsx(Ge.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...o,ref:s,onMouseDown:Ce(e.onMouseDown,v=>{n?d.onItemFocus(c):v.preventDefault()}),onFocus:Ce(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Ce(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const f=y$(v,d.orientation,d.dir);if(f!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=h().filter(g=>g.focusable).map(g=>g.ref.current);if(f==="last")y.reverse();else if(f==="prev"||f==="next"){f==="prev"&&y.reverse();const g=y.indexOf(v.currentTarget);y=d.loop?v$(y,g+1):y.slice(g+1)}setTimeout(()=>Z5(y))}})})})});X5.displayName=Y5;var x$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function g$(e,s){return s!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function y$(e,s,r){const n=g$(e.key,r);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return x$[n]}function Z5(e,s=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:s}),document.activeElement!==r))return}function v$(e,s){return e.map((r,n)=>e[(s+n)%e.length])}var Tv=Q5,Av=X5,_v="Tabs",[b$,BQ]=Ws(_v,[td]),J5=td(),[j$,Ev]=b$(_v),eT=m.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=ed(l),[h,p]=bn({prop:n,onChange:a,defaultProp:i});return t.jsx(j$,{scope:r,baseId:xn(),value:h,onValueChange:p,orientation:o,dir:u,activationMode:c,children:t.jsx(Ge.div,{dir:u,"data-orientation":o,...d,ref:s})})});eT.displayName=_v;var tT="TabsList",sT=m.forwardRef((e,s)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,i=Ev(tT,r),o=J5(r);return t.jsx(Tv,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:t.jsx(Ge.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:s})})});sT.displayName=tT;var rT="TabsTrigger",nT=m.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=e,o=Ev(rT,r),l=J5(r),c=oT(o.baseId,n),d=lT(o.baseId,n),u=n===o.value;return t.jsx(Av,{asChild:!0,...l,focusable:!a,active:u,children:t.jsx(Ge.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:s,onMouseDown:Ce(e.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:Ce(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:Ce(e.onFocus,()=>{const h=o.activationMode!=="manual";!u&&!a&&h&&o.onValueChange(n)})})})});nT.displayName=rT;var aT="TabsContent",iT=m.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=e,l=Ev(aT,r),c=oT(l.baseId,n),d=lT(l.baseId,n),u=n===l.value,h=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),t.jsx(Ks,{present:a||u,children:({present:p})=>t.jsx(Ge.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...o,ref:s,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});iT.displayName=aT;function oT(e,s){return`${e}-trigger-${s}`}function lT(e,s){return`${e}-content-${s}`}var w$=eT,cT=sT,dT=nT,uT=iT;const sd=w$,dl=m.forwardRef(({className:e,...s},r)=>
632t.jsx(cT,{ref:r,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...s}));dl.displayName=cT.displayName;const hs=m.forwardRef(({className:e,...s},r)=>t.jsx(dT,{ref:r,className:je("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...s}));hs.displayName=dT.displayName;const ps=m.forwardRef(({className:e,...s},r)=>t.jsx(uT,{ref:r,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));ps.displayName=uT.displayName;function vf(e){const s=m.useRef({value:e,previous:e});return m.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}var Iv="Checkbox",[N$,qQ]=Ws(Iv),[k$,S$]=N$(Iv),mT=m.forwardRef((e,s)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...h}=e,[p,x]=m.useState(null),v=lt(s,N=>x(N)),f=m.useRef(!1),b=p?u||!!p.closest("form"):!0,[y=!1,g]=bn({prop:a,defaultProp:i,onChange:d}),j=m.useRef(y);return m.useEffect(()=>{const N=p==null?void 0:p.form;if(N){const w=()=>g(j.current);return N.addEventListener("reset",w),()=>N.removeEventListener("reset",w)}},[p,g]),t.jsxs(k$,{scope:r,state:y,disabled:l,children:[t.jsx(Ge.button,{type:"button",role:"checkbox","aria-checked":Hi(y)?"mixed":y,"aria-required":o,"data-state":fT(y),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:v,onKeyDown:Ce(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Ce(e.onClick,N=>{g(w=>Hi(w)?!0:!w),b&&(f.current=N.isPropagationStopped(),f.current||N.stopPropagation())})}),b&&t.jsx(C$,{control:p,bubbles:!f.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Hi(i)?!1:i})]})});mT.displayName=Iv;var hT="CheckboxIndicator",pT=m.forwardRef((e,s)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=S$(hT,r);return t.jsx(Ks,{present:n||Hi(i.state)||i.state===!0,children:t.jsx(Ge.span,{"data-state":fT(i.state),"data-disabled":i.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...e.style}})})});pT.displayName=hT;var C$=e=>{const{control:s,checked:r,bubbles:n=!0,defaultChecked:a,...i}=e,o=m.useRef(null),l=vf(r),c=lf(s);m.useEffect(()=>{const u=o.current,h=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==r&&x){const v=new Event("click",{bubbles:n});u.indeterminate=Hi(r),x.call(u,Hi(r)?!1:r),u.dispatchEvent(v)}},[l,r,n]);const d=m.useRef(Hi(r)?!1:r);return t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...i,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Hi(e){return e==="indeterminate"}function fT(e){return Hi(e)?"indeterminate":e?"checked":"unchecked"}var xT=mT,P$=pT;const ka=m.forwardRef(({className:e,...s},r)=>t.jsx(xT,{ref:r,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...s,children:t.jsx(P$,{className:je("flex items-center justify-center text-current"),children:t.jsx(Xt,{className:"h-4 w-4"})})}));ka.displayName=xT.displayName;const Wt="/assets/logo-LixZ3Jsz.svg";function T$(){const{user:e,loginMutation:s,isLoading:r}=hi(),[,n]=Ma(),{toast:a}=bt(),[i,o]=m.useState({username:"",password:""}),[l,c]=m.useState({username:"",email:"",password:"",confirmPassword:"",referralCode:"",termsAccepted:!1}),[d,u]=m.useState(()=>new URLSearchParams(window.location.search).get("tab")==="register"?"register":"login");m.useEffect(()=>{const f=new URLSearchParams(window.location.search).get("referral");f&&c(b=>({...b,referralCode:f}))},[]),m.useEffect(()=>{if(e){const f=new URLSearchParams(window.location.search).get("redirect");f&&f.startsWith("/")&&!f.startsWith("//")?["/extension/","/api/"].some(g=>f.startsWith(g))?window.location.href=f:n(f):n("/")}},[e,n]);const h=v=>{v.preventDefault(),s.mutate(i)},p=ke({mutationFn:async v=>
632(await Fe("POST","/api/auth/register",v)).json(),onSuccess:v=>{a({title:"Registration successful!",description:"Please check your email for a verification code."}),setTimeout(()=>{n(`/verify?email=${encodeURIComponent(v.email)}`)},1e3)},onError:v=>{a({variant:"destructive",title:"Registration failed",description:v.message||"Please try again"})}}),x=v=>{if(v.preventDefault(),!l.termsAccepted){a({variant:"destructive",title:"Terms required",description:"Please accept the Terms of Service and Privacy Policy to continue"});return}if(l.password!==l.confirmPassword){a({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match"});return}if(l.password.length<8){a({variant:"destructive",title:"Password too short",description:"Password must be at least 8 characters"});return}if(!/^[a-zA-Z0-9.$]+$/.test(l.username)){a({variant:"destructive",title:"Invalid username",description:"Username can only contain letters, numbers, periods, and dollar signs (no spaces)"});return}const b={username:l.username,email:l.email,password:l.password};l.referralCode.trim()&&(b.referralCode=l.referralCode.trim()),p.mutate(b)};return r?t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-primary"})}):t.jsxs("div",{className:"min-h-screen grid lg:grid-cols-2",children:[t.jsx("div",{className:"flex items-center justify-center p-8",children:t.jsxs("div",{className:"w-full max-w-md 
632space-y-8",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-10 w-auto"}),t.jsx("span",{className:"font-bold text-2xl",children:"SocialMonkey.app"})]}),t.jsx(bu,{})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(pe,{children:"Welcome to SocialMonkey"}),t.jsx(Ze,{children:"Sign in or create a new account to get started"})]}),t.jsx(de,{children:t.jsxs(sd,{value:d,onValueChange:u,className:"w-full",children:[t.jsxs(dl,{className:"grid w-full grid-cols-2",children:[t.jsx(hs,{value:"login","data-testid":"tab-login",children:"Login"}),t.jsx(hs,{value:"register","data-testid":"tab-register",children:"Register"})]}),t.jsx(ps,{value:"login",children:t.jsxs("form",{onSubmit:h,className:"space-y-4 mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"login-username",children:"Username"}),t.jsx(Ke,{id:"login-username",type:"text",value:i.username,onChange:v=>o({...i,username:v.target.value}),required:!0,"data-testid":"input-login-username"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"login-password",children:"Password"}),t.jsx(Ke,{id:"login-password",type:"password",value:i.password,onChange:v=>o({...i,password:v.target.value}),required:!0,"data-testid":"input-login-password"})]}),t.jsx(T,{type:"submit",className:"w-full",disabled:s.isPending,"data-testid":"button-login-submit",children:s.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Logging in..."]}):"Log In"}),t.jsx("div",{className:"text-center mt-3",children:t.jsx("a",{href:"/forgot-password",className:"text-sm text-muted-foreground hover:text-primary transition-colors","data-testid":"link-forgot-password",children:"Forgot your password?"})})]})}),t.jsxs(ps,{value:"register",children:[t.jsxs("div",{className:"flex items-center gap-2 p-3 mt-4 mb-4 bg-primary/10 rounded-md border border-primary/20","data-testid":"trial-notice",children:[t.jsx(mu,{className:"h-5 w-5 text-primary flex-shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"14-Day Free Trial — No Credit Card Required"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Start using all features immediately. Cancel anytime."})]})]}),t.jsxs("form",{onSubmit:x,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"register-username",children:"Username"}),t.jsx(Ke,{id:"register-username",type:"text",value:l.username,onChange:v=>c({...l,username:v.target.value}),required:!0,minLength:3,maxLength:50,"data-testid":"input-register-username"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"register-email",children:"Email"}),t.jsx(Ke,{id:"register-email",type:"email",value:l.email,onChange:v=>c({...l,email:v.target.value}),required:!0,"data-testid":"input-register-email"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"register-password",children:"Password"}),t.jsx(Ke,{id:"register-password",type:"password",value:l.password,onChange:v=>c({...l,password:v.target.value}),required:!0,minLength:8,"data-testid":"input-register-password"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Must be at least 8 characters"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"register-confirm-password",children:"Confirm Password"}),t.jsx(Ke,{id:"register-confirm-password",type:"password",value:l.confirmPassword,onChange:v=>c({...l,confirmPassword:v.target.value}),required:!0,minLength:8,"data-testid":"input-register-confirm-password"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"register-referral-code",children:"Referral Code (Optional)"}),t.jsx(Ke,{id:"register-referral-code",type:"text",value:l.referralCode,onChange:v=>c({...l,referralCode:v.target.value.toUpperCase()}),placeholder:"Enter referral code",maxLength:6,"data-testid":"input-register-referral-code"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Have a referral code? Enter it here to earn bonus credits"})]}),t.jsxs("div",{className:"flex items-start space-x-2",children:[t.jsx(ka,{id:"register-terms",checked:l.termsAccepted,onCheckedChange:v=>c({...l,termsAccepted:v===!0}),"data-testid":"checkbox-terms"}),t.jsxs("label",{htmlFor:"register-terms",className:"text-sm text-muted-foreground leading-tight cursor-pointer",children:["I agree to the"," ",t.jsx(me,{href:"/terms",className:"text-primary hover:underline",target:"_blank",children:"Terms of Service"})," ","and"," ",t.jsx(me,{href:"/privacy",className:"text-primary hover:underline",target:"_blank",children:"Privacy Policy"})]})]}),t.jsx(T,{type:"submit",className:"w-full",disabled:p.isPending,"data-testid":"button-register-submit",children:p.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Create Account"})]})]})]})})]})]})}),t.jsx("div",{className:"hidden lg:flex items-center justify-center bg-muted p-12",children:t.jsxs("div",{className:"max-w-lg space-y-6",children:[t.jsx("h1",{className:"text-4xl font-bold",children:"Scheduling & Workflow for Social Media"}),t.jsx("p",{className:"text-lg text-muted-foreground",children:"SocialMonkey streamlines your social media workflow across 7 platforms. Schedule posts, manage approvals, and publish content on your terms."}),t.jsxs("ul",{className:"space-y-3 text-muted-foreground",children:[t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"✓"})}),t.jsx("span",{children:"Schedule and manage posts across multiple platforms"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"✓"})}),t.jsx("span",{children:"Customizable approval workflows by content type"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"✓"})}),t.jsx("span",{children:"Post to YouTube, X, TikTok, Instagram, Facebook, LinkedIn, and Reddit"})]})]})]})})]})}const Ut=kv,Xl=R5,A$=Sv,gT=m.forwardRef(({className:e,...s},r)=>t.jsx(tm,{ref:r,className:je("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),...s}));gT.displayName=tm.displayName;const Ht=m.forwardRef(({className:e,children:s,...r},n)=>t.jsxs(A$,{children:[t.jsx(gT,{}),t.jsxs(sm,{ref:n,className:je("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
632nded-lg",e),...r,children:[s,t.jsxs(xf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(xr,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ht.displayName=sm.displayName;const xs=({className:e,...s})=>t.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...s});xs.displayName="DialogHeader";const rd=({className:e,...s})=>t.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});rd.displayName="DialogFooter";const gs=m.forwardRef(({className:e,...s},r)=>t.jsx(rm,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...s}));gs.displayName=rm.displayName;const Ns=m.forwardRef(({className:e,...s},r)=>t.jsx(nm,{ref:r,className:je("text-sm text-muted-foreground",e),...s}));Ns.displayName=nm.displayName;const os=m.forwardRef(({className:e,...s},r)=>t.jsx("textarea",{className:je("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...s}));os.displayName="Textarea";function vy(e,[s,r]){return Math.min(r,Math.max(s,e))}var _$=[" ","Enter","ArrowUp","ArrowDown"],E$=[" ","Enter"],am="Select",[bf,jf,I$]=Zp(am),[nd,WQ]=Ws(am,[I$,Jc]),wf=Jc(),[M$,mo]=nd(am),[R$,F$]=nd(am),yT=e=>{const{__scopeSelect:s,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:p,required:x,form:v}=e,f=wf(s),[b,y]=m.useState(null),[g,j]=m.useState(null),[N,w]=m.useState(!1),S=ed(d),[k=!1,P]=bn({prop:n,defaultProp:a,onChange:i}),[A,$]=bn({prop:o,defaultProp:l,onChange:c}),_=m.useRef(null),O=b?v||!!b.closest("form"):!0,[M,C]=m.useState(new Set),L=Array.from(M).map(W=>W.props.value).join(";");return t.jsx(mv,{...f,children:t.jsxs(M$,{required:x,scope:s,trigger:b,onTriggerChange:y,valueNode:g,onValueNodeChange:j,valueNodeHasChildren:N,onValueNodeHasChildrenChange:w,contentId:xn(),value:A,onValueChange:$,open:k,onOpenChange:P,dir:S,triggerPointerDownPosRef:_,disabled:p,children:[t.jsx(bf.Provider,{scope:s,children:t.jsx(R$,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(W=>{C(q=>new Set(q).add(W))},[]),onNativeOptionRemove:m.useCallback(W=>{C(q=>{const I=new Set(q);return I.delete(W),I})},[]),children:r})}),O?t.jsxs(BT,{"aria-hidden":!0,required:x,tabIndex:-1,name:u,autoComplete:h,value:A,onChange:W=>$(W.target.value),disabled:p,form:v,children:[A===void 0?t.jsx("option",{value:""}):null,Array.from(M)]},L):null]})})};yT.displayName=am;var vT="SelectTrigger",bT=m.forwardRef((e,s)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=wf(r),o=mo(vT,r),l=o.disabled||n,c=lt(s,o.onTriggerChange),d=jf(r),u=m.useRef("touch"),[h,p,x]=qT(f=>{const b=d().filter(j=>!j.disabled),y=b.find(j=>j.value===o.value),g=WT(b,f,y);g!==void 0&&o.onValueChange(g.value)}),v=f=>{l||(o.onOpenChange(!0),x()),f&&(o.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return t.jsx(hv,{asChild:!0,...i,children:t.jsx(Ge.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":VT(o.value)?"":void 0,...a,ref:c,onClick:Ce(a.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&v(f)}),onPointerDown:Ce(a.onPointerDown,f=>{u.current=f.pointerType;const b=f.target;b.hasPointerCapture(f.pointerId)&&b.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(v(f),f.preventDefault())}),onKeyDown:Ce(a.onKeyDown,f=>{const b=h.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&p(f.key),!(b&&f.key===" ")&&_$.includes(f.key)&&(v(),f.preventDefault())})})})});bT.displayName=vT;var jT="SelectValue",wT=m.forwardRef((e,s)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=e,c=mo(jT,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,h=lt(s,c.onValueNodeChange);return qs(()=>{d(u)},[d,u]),t.jsx(Ge.span,{...l,ref:h,style:{pointerEvents:"none"},children:VT(c.value)?t.jsx(t.Fragment,{children:o}):i})});wT.displayName=jT;var D$="SelectIcon",NT=m.forwardRef((e,s)=>{const{__scopeSelect:r,children:n,...a}=e;return t.jsx(Ge.span,{"aria-hidden":!0,...a,ref:s,children:n||"▼"})});NT.displayName=D$;var L$="SelectPortal",kT=e=>t.jsx(Xu,{asChild:!0,...e});kT.displayName=L$;var Jo="SelectContent",ST=m.forwardRef((e,s)=>{const r=mo(Jo,e.__scopeSelect),[n,a]=m.useState();if(qs(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?ll.createPortal(t.jsx(CT,{scope:e.__scopeSelect,children:t.jsx(bf.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),i):null}return t.jsx(PT,{...e,ref:s})});ST.displayName=Jo;var Rn=10,[CT,ho]=nd(Jo),O$="SelectContentImpl",$$=Ho("SelectContent.RemoveScroll"),PT=m.forwardRef((e,s)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:x,sticky:v,hideWhenDetached:f,avoidCollisions:b,...y}=e,g=mo(Jo,r),[j,N]=m.useState(null),[w,S]=m.useState(null),k=lt(s,le=>N(le)),[P,A]=m.useState(null),[$,_]=m.useState(null),O=jf(r),[M,C]=m.useState(!1),L=m.useRef(!1);m.useEffect(()=>{if(j)return vv(j)},[j]),yv();const W=m.useCallback(le=>{const[J,...X]=O().map(R=>R.ref.current),[se]=X.slice(-1),te=document.activeElement;for(const R of le)if(R===te||(R==null||R.scrollIntoView({block:"nearest"}),R===J&&w&&(w.scrollTop=0),R===se&&w&&(w.scrollTop=w.scrollHeight),R==null||R.focus(),document.activeElement!==te))return},[O,w]),q=m.useCallback(()=>W([P,j]),[W,P,j]);m.useEffect(()=>{M&&q()},[M,q]);const{onOpenChange:I,triggerPointerDownPosRef:F}=g;m.useEffect(()=>{if(j){let le={x:0,y:0};const J=se=>{var te,R;le={x:Math.abs(Math.round(se.pageX)-(((te=F.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(se.pageY)-(((R=F.current)==null?void 0:R.y)??0))}},X=se=>{le.x<=10&&le.y<=10?se.preventDefault():j.contains(se.target)||I(!1),document.removeEventListener("pointermove",J),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",X,{capture:!0})}}},[j,I,F]),m.useEffect(()=>{const le=()=>I(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[I]);const[E,ne]=qT(le=>{const J=O().filter(te=>!te.disabled),X=J.find(te=>te.ref.current===document.activeElement),se=WT(J,le,X);se&&setTimeout(()=>se.ref.current.focus())}),U=m.useCallback((le,J,X)=>{const se=!L.current&&!X;(g.value!==void 0&&g.value===J||se)&&(A(le),se&&(L.current=!0))},[g.value]),Ae=m.useCallback(()=>j==null?void 0:j.focus(),[j]),G=m.useCallback((le,J,X)=>{const se=!L.current&&!X;(g.value!==void 0&&g.value===J||se)&&_(le)},[g.value]),Q=n==="popper"?by:TT,ye=Q===by?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:x,sticky:v,hideWhenDetached:f,avoidCollisions:b}:{};return t.jsx(CT,{scope:r,content:j,viewport:w,onViewportChange:S,itemRefCallback:U,selectedItem:P,onItemLeave:Ae,itemTextRefCallback:G,focusSelectedItem:q,selectedItemText:$,position:n,isPositioned:M,searchRef:E,children:t.jsx(ff,{as:$$,allowPinchZoom:!0,children:t.jsx(hf,{asChild:!0,trapped:g.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Ce(a,le=>{var J;(J=g.trigger)==null||J.focus({preventScroll:!0}),le.preventDefault()}),children:t.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:t.jsx(Q,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:le=>le.preventDefault(),...y,...ye,onPlaced:()=>C(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,le=>{const J=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!J&&le.key.length===1&&ne(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let se=O().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(le.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const te=le.target,R=se.indexOf(te);se=se.slice(R+1)}setTimeout(()=>W(se)),le.preventDefault()}})})})})})})});PT.displayName=O$;var z$="SelectItemAlignedPosition",TT=m.forwardRef((e,s)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=mo(Jo,r),o=ho(Jo,r),[l,c]=m.useState(null),[d,u]=m.useState(null),h=lt(s,k=>u(k)),p=jf(r),x=m.useRef(!1),v=m.useRef(!0),{viewport:f,selectedItem:b,selectedItemText:y,focusSelectedItem:g}=o,j=m.useCallback(()=>
vendor: 10,420 bytes, line 632
632{if(i.trigger&&i.valueNode&&l&&d&&f&&b&&y){const k=i.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),A=i.valueNode.getBoundingClientRect(),$=y.getBoundingClientRect();if(i.dir!=="rtl"){const te=$.left-P.left,R=A.left-te,K=k.left-R,ve=k.width+K,Ie=Math.max(ve,P.width),dt=window.innerWidth-Rn,jt=vy(R,[Rn,Math.max(Rn,dt-Ie)]);l.style.minWidth=ve+"px",l.style.left=jt+"px"}else{const te=P.right-$.right,R=window.innerWidth-A.right-te,K=window.innerWidth-k.right-R,ve=k.width+K,Ie=Math.max(ve,P.width),dt=window.innerWidth-Rn,jt=vy(R,[Rn,Math.max(Rn,dt-Ie)]);l.style.minWidth=ve+"px",l.style.right=jt+"px"}const _=p(),O=window.innerHeight-Rn*2,M=f.scrollHeight,C=window.getComputedStyle(d),L=parseInt(C.borderTopWidth,10),W=parseInt(C.paddingTop,10),q=parseInt(C.borderBottomWidth,10),I=parseInt(C.paddingBottom,10),F=L+W+M+I+q,E=Math.min(b.offsetHeight*5,F),ne=window.getComputedStyle(f),U=parseInt(ne.paddingTop,10),Ae=parseInt(ne.paddingBottom,10),G=k.top+k.height/2-Rn,Q=O-G,ye=b.offsetHeight/2,le=b.offsetTop+ye,J=L+W+le,X=F-J;if(J<=G){const te=_.length>0&&b===_[_.length-1].ref.current;l.style.bottom="0px";const R=d.clientHeight-f.offsetTop-f.offsetHeight,K=Math.max(Q,ye+(te?Ae:0)+R+q),ve=J+K;l.style.height=ve+"px"}else{const te=_.length>0&&b===_[0].ref.current;l.style.top="0px";const K=Math.max(G,L+f.offsetTop+(te?U:0)+ye)+X;l.style.height=K+"px",f.scrollTop=J-G+f.offsetTop}l.style.margin=`${Rn}px 0`,l.style.minHeight=E+"px",l.style.maxHeight=O+"px",n==null||n(),requestAnimationFrame(()=>x.current=!0)}},[p,i.trigger,i.valueNode,l,d,f,b,y,i.dir,n]);qs(()=>j(),[j]);const[N,w]=m.useState();qs(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);const S=m.useCallback(k=>{k&&v.current===!0&&(j(),g==null||g(),v.current=!1)},[j,g]);return t.jsx(V$,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:S,children:t.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:t.jsx(Ge.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});TT.displayName=z$;var U$="SelectPopperPosition",by=m.forwardRef((e,s)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Rn,...i}=e,o=wf(r);return t.jsx(pv,{...o,...i,ref:s,align:n,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)"}})});by.displayName=U$;var[V$,Mv]=nd(Jo,{}),jy="SelectViewport",AT=m.forwardRef((e,s)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=ho(jy,r),o=Mv(jy,r),l=lt(s,i.onViewportChange),c=m.useRef(0);return t.jsxs(t.Fragment,{children:[t.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:n}),t.jsx(bf.Slot,{scope:r,children:t.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ce(a.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&h){const x=Math.abs(c.current-u.scrollTop);if(x>0){const v=window.innerHeight-Rn*2,f=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),y=Math.max(f,b);if(y<v){const g=y+x,j=Math.min(v,g),N=g-j;h.style.height=j+"px",h.style.bottom==="0px"&&(u.scrollTop=N>0?N:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});AT.displayName=jy;var _T="SelectGroup",[B$,q$]=nd(_T),W$=m.forwardRef((e,s)=>{const{__scopeSelect:r,...n}=e,a=xn();return t.jsx(B$,{scope:r,id:a,children:t.jsx(Ge.div,{role:"group","aria-labelledby":a,...n,ref:s})})});W$.displayName=_T;var ET="SelectLabel",IT=m.forwardRef((e,s)=>{const{__scopeSelect:r,...n}=e,a=q$(ET,r);return t.jsx(Ge.div,{id:a.id,...n,ref:s})});IT.displayName=ET;var lp="SelectItem",[K$,MT]=nd(lp),RT=m.forwardRef((e,s)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,l=mo(lp,r),c=ho(lp,r),d=l.value===n,[u,h]=m.useState(i??""),[p,x]=m.useState(!1),v=lt(s,g=>{var j;return(j=c.itemRefCallback)==null?void 0:j.call(c,g,n,a)}),f=xn(),b=m.useRef("touch"),y=()=>{a||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")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 t.jsx(K$,{scope:r,value:n,disabled:a,textId:f,isSelected:d,onItemTextChange:m.useCallback(g=>{h(j=>j||((g==null?void 0:g.textContent)??"").trim())},[]),children:t.jsx(bf.ItemSlot,{scope:r,value:n,disabled:a,textValue:u,children:t.jsx(Ge.div,{role:"option","aria-labelledby":f,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:v,onFocus:Ce(o.onFocus,()=>x(!0)),onBlur:Ce(o.onBlur,()=>x(!1)),onClick:Ce(o.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:Ce(o.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:Ce(o.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:Ce(o.onPointerMove,g=>{var j;b.current=g.pointerType,a?(j=c.onItemLeave)==null||j.call(c):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(o.onPointerLeave,g=>{var j;g.currentTarget===document.activeElement&&((j=c.onItemLeave)==null||j.call(c))}),onKeyDown:Ce(o.onKeyDown,g=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&g.key===" "||(E$.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});RT.displayName=lp;var _d="SelectItemText",FT=m.forwardRef((e,s)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=mo(_d,r),l=ho(_d,r),c=MT(_d,r),d=F$(_d,r),[u,h]=m.useState(null),p=lt(s,y=>h(y),c.onItemTextChange,y=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,y,c.value,c.disabled)}),x=u==null?void 0:u.textContent,v=m.useMemo(()=>t.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:f,onNativeOptionRemove:b}=d;return qs(()=>(f(v),()=>b(v)),[f,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Ge.span,{id:c.textId,...i,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ll.createPortal(i.children,o.valueNode):null]})});FT.displayName=_d;var DT="SelectItemIndicator",LT=m.forwardRef((e,s)=>{const{__scopeSelect:r,...n}=e;return MT(DT,r).isSelected?t.jsx(Ge.span,{"aria-hidden":!0,...n,ref:s}):null});LT.displayName=DT;var wy="SelectScrollUpButton",OT=m.forwardRef((e,s)=>{const r=ho(wy,e.__scopeSelect),n=Mv(wy,e.__scopeSelect),[a,i]=m.useState(!1),o=lt(s,n.onScrollButtonChange);return qs(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?t.jsx(zT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});OT.displayName=wy;var Ny="SelectScrollDownButton",$T=m.forwardRef((e,s)=>{const r=ho(Ny,e.__scopeSelect),n=Mv(Ny,e.__scopeSelect),[a,i]=m.useState(!1),o=lt(s,n.onScrollButtonChange);return qs(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?t.jsx(zT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});$T.displayName=Ny;var zT=m.forwardRef((e,s)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=ho("SelectScrollButton",r),o=m.useRef(null),l=jf(r),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),qs(()=>{var u;const d=l().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),t.jsx(Ge.div,{"aria-hidden":!0,...a,ref:s,style:{flexShrink:0,...a.style},onPointerDown:Ce(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Ce(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Ce(a.onPointerLeave,()=>{c()})})}),G$="SelectSeparator",UT=m.forwardRef((e,s)=>{const{__scopeSelect:r,...n}=e;return t.jsx(Ge.div,{"aria-hidden":!0,...n,ref:s})});UT.displayName=G$;var ky="SelectArrow",H$=m.forwardRef((e,s)=>{const{__scopeSelect:r,...n}=e,a=wf(r),i=mo(ky,r),o=ho(ky,r);return i.open&&o.position==="popper"?t.jsx(fv,{...a,...n,ref:s}):null});H$.displayName=ky;function VT(e){return e===""||e===void 0}var BT=m.forwardRef((e,s)=>{const{value:r,...n}=e,a=m.useRef(null),i=lt(s,a),o=vf(r);return m.useEffect(()=>{const l=a.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const h=new Event("change",{bubbles:!0});u.call(l,r),l.dispatchEvent(h)}},[o,r]),t.jsx(Zu,{asChild:!0,children:t.jsx("select",{...n,ref:i,defaultValue:r})})});BT.displayName="BubbleSelect";function qT(e){const s=ns(e),r=m.useRef(""),n=m.useRef(0),a=m.useCallback(o=>{const l=r.current+o;s(l),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[s]),i=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function WT(e,s,r){const a=s.length>1&&Array.from(s).every(d=>d===s[0])?s[0]:s,i=r?e.indexOf(r):-1;let o=Q$(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==r));const c=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function Q$(e,s){return e.map((r,n)=>e[(s+n)%e.length])}var Y$=yT,KT=bT,X$=wT,Z$=NT,J$=kT,GT=ST,ez=AT,HT=IT,QT=RT,tz=FT,sz=LT,YT=OT,XT=$T,ZT=UT;const Nt=Y$,kt=X$,gt=m.forwardRef(({className:e,children:s,...r},n)=>t.jsxs(KT,{ref:n,className:je("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
632ing-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[s,t.jsx(Z$,{asChild:!0,children:t.jsx(Pa,{className:"h-4 w-4 opacity-50"})})]}));gt.displayName=KT.displayName;const JT=m.forwardRef(({className:e,...s},r)=>t.jsx(YT,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(oP,{className:"h-4 w-4"})}));JT.displayName=YT.displayName;const e6=m.forwardRef(({className:e,...s},r)=>t.jsx(XT,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(Pa,{className:"h-4 w-4"})}));e6.displayName=XT.displayName;const yt=m.forwardRef(({className:e,children:s,position:r="popper",...n},a)=>t.jsx(J$,{children:t.jsxs(GT,{ref:a,className:je("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",r==="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:r,...n,children:[t.jsx(JT,{}),t.jsx(ez,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),t.jsx(e6,{})]})}));yt.displayName=GT.displayName;const rz=m.forwardRef(({className:e,...s},r)=>t.jsx(HT,{ref:r,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...s}));rz.displayName=HT.displayName;const Se=m.forwardRef(({className:e,children:s,...r},n)=>t.jsxs(QT,{ref:n,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(sz,{children:t.jsx(Xt,{className:"h-4 w-4"})})}),t.jsx(tz,{children:s})]}));
632Se.displayName=QT.displayName;const nz=m.forwardRef(({className:e,...s},r)=>t.jsx(ZT,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...s}));nz.displayName=ZT.displayName;const az=[{value:"google",label:"Google Search"},{value:"twitter",label:"X (Twitter)"},{value:"facebook",label:"Facebook"},{value:"instagram",label:"Instagram"},{value:"linkedin",label:"LinkedIn"},{value:"youtube",label:"YouTube"},{value:"friend",label:"Friend / Colleague"},{value:"podcast",label:"Podcast"},{value:"blog",label:"Blog / Article"},{value:"other",label:"Other"}];function iz({open:e,onComplete:s}){const{toast:r}=bt(),[n,a]=m.useState(""),[i,o]=m.useState(""),[l,c]=m.useState(""),d=ke({mutationFn:async p=>(await Fe("POST","/api/user-onboarding",p)).json(),onSuccess:()=>{s()},onError:p=>{r({variant:"destructive",title:"Failed to save",description:p.message||"Please try again or skip for now."})}}),u=p=>{p.preventDefault(),d.mutate({websiteUrl:n.trim(),promotionText:i.trim(),referralSource:l})},h=()=>{s()};return t.jsx(Ut,{open:e,onOpenChange:()=>{},children:t.jsx(Ht,{className:"max-w-md max-h-[90vh] overflow-y-auto p-0","data-testid":"dialog-welcome-onboarding",onPointerDownOutside:p=>p.preventDefault(),onEscapeKeyDown:p=>p.preventDefault(),children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex items-center justify-between p-4 pb-0",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"h-5 w-5 text-primary"}),t.jsx("h2",{className:"text-lg font-semibold",children:"Welcome to SocialMonkey!"})]})}),t.jsx("div",{className:"px-4 text-sm text-muted-foreground",children:"Help us personalize your experience by telling us a bit about yourself."}),t.jsxs("form",{onSubmit:u,className:"px-4 pb-4 space-y-4",children:[t.jsxs("div",{className:"p-3 rounded-lg border bg-card/50 space-y-3",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"website-url",className:"flex items-center gap-2 text-sm",children:[t.jsx(jn,{className:"h-4 w-4 text-muted-foreground"}),"Website URL"]}),t.jsx(Ke,{id:"website-url",type:"url",placeholder:"https://yourwebsite.com",value:n,onChange:p=>a(p.target.value),className:"bg-background","data-testid":"input-onboarding-website"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Your website or portfolio (optional)"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"promotion-text",className:"flex items-center gap-2 text-sm",children:[t.jsx(Ta,{className:"h-4 w-4 text-muted-foreground"}),"What is your channel about?"]}),t.jsx(os,{id:"promotion-text",placeholder:"I create content about fitness and healthy living...",value:i,onChange:p=>o(p.target.value),className:"min-h-[80px] resize-none bg-background","data-testid":"textarea-onboarding-about"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This helps our AI create better content for you"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"referral-source",className:"flex items-center gap-2 text-sm",children:[t.jsx(Hn,{className:"h-4 w-4 text-muted-foreground"}),"How did you hear about us?"]}),t.jsxs(Nt,{value:l,onValueChange:c,children:[t.jsx(gt,{id:"referral-source",className:"bg-background","data-testid":"select-onboarding-referral",children:t.jsx(kt,{placeholder:"Select an option..."})}),t.jsx(yt,{children:az.map(p=>t.jsx(Se,{value:p.value,"data-testid":`option-referral-${p.value}`,children:p.label},p.value))})]})]})]}),t.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[t.jsx(T,{type:"button",variant:"ghost",onClick:h,disabled:d.isPending,"data-testid":"button-onboarding-skip",children:"Skip for now"}),t.jsx(T,{type:"submit",disabled:d.isPending,"data-testid":"button-onboarding-submit",children:d.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Get Started"})]})]})]})})})}function oz(){const[,e]=Ma(),{toast:s}=bt(),[r,n]=m.useState(""),[a,i]=m.useState(""),[o,l]=m.useState(""),[c,d]=m.useState(""),[u,h]=m.useState(!1),[p,x]=m.useState(null),[v,f]=m.useState(!1),[b,y]=m.useState(""),[g,j]=m.useState(!1);m.useEffect(()=>{const M=new URLSearchParams(window.location.search),C=M.get("email"),L=M.get("code");if(C&&i(C),L){const W=L.replace(/\D/g,"").slice(0,6);n(W)}},[]),m.useEffect(()=>{const C=setTimeout(async()=>
632{if(!a||!a.includes("@")){x(null);return}f(!0);try{const W=await(await Fe("POST","/api/auth/check-email-status",{email:a})).json();x(W)}catch(L){console.error("Failed to check email status:",L),x(null)}finally{f(!1)}},500);return()=>clearTimeout(C)},[a]),m.useEffect(()=>{if(!o&&!c){y("");return}o.length>0&&o.length<8?y("Password must be at least 8 characters"):o.includes(" ")?y("Password cannot contain spaces"):y(c&&o!==c?"Passwords do not match":"")},[o,c]);const N=ke({mutationFn:async M=>(await Fe("POST","/api/auth/verify",M)).json(),onSuccess:M=>{M.user&&ee.setQueryData(["/api/user"],M.user),s({title:"Email verified!",description:"Welcome to SocialMonkey!"}),h(!0)},onError:M=>{s({variant:"destructive",title:"Verification failed",description:M.message||"Invalid or expired code. Please try again."})}}),w=ke({mutationFn:async M=>(await Fe("POST","/api/auth/resend-verification",M)).json(),onSuccess:()=>{s({title:"Verification email sent!",description:"Please check your inbox for a new verification code."})},onError:M=>{s({variant:"destructive",title:"Failed to send email",description:M.message||"Please try again later."})}}),S=M=>{if(M.preventDefault(),!a||!r){s({variant:"destructive",title:"Missing information",description:"Please enter your email and verification code"});return}if(p&&!p.hasPassword){if(!o){s({variant:"destructive",title:"Password required",description:"Please create a password for your account"});return}if(o.length<8){s({variant:"destructive",title:"Password too short",description:"Password must be at least 8 characters"});return}if(o.includes(" ")){s({variant:"destructive",title:"Invalid password",description:"Password cannot contain spaces"});return}if(o!==c){s({variant:"destructive",title:"Passwords don't match",description:"Please make sure both passwords match"});return}N.mutate({email:a,code:r,password:o})}else N.mutate({email:a,code:r})},k=()=>{if(!a){s({variant:"destructive",title:"Email required",description:"Please enter your email address"});return}w.mutate({email:a})},P=()=>{h(!1),window.location.href="/"},A=p&&!p.exists,$=p&&p.exists&&p.verified,_=p&&p.exists&&!p.verified&&!p.hasPassword,O=!p||p.exists&&!p.verified;return t.jsxs(t.Fragment,{children:[t.jsx(iz,{open:u,onComplete:P}),t.jsxs("div",{className:"min-h-screen grid lg:grid-cols-2",children:[t.jsx("div",{className:"flex items-center justify-center p-8",children:t.jsxs("div",{className:"w-full max-w-md 
632space-y-8",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-10 w-auto"}),t.jsx("span",{className:"font-bold text-2xl",children:"SocialMonkey.app"})]}),t.jsx(bu,{})]}),A&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"h-16 w-16 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(hr,{className:"h-8 w-8 text-destructive"})})}),t.jsx(pe,{className:"text-center",children:"Email Not Found"}),t.jsxs(Ze,{className:"text-center",children:["We couldn't find an account with ",t.jsx("strong",{children:a}),". Perhaps you used a different email address to register?"]})]}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"email",children:"Try a different email"}),t.jsx(Ke,{id:"email",type:"email",value:a,onChange:M=>i(M.target.value),placeholder:"[email protected]","data-testid":"input-verification-email"})]}),t.jsx(T,{variant:"outline",className:"w-full",onClick:()=>e("/auth"),"data-testid":"button-go-to-register",children:"Create a New Account"}),t.jsx(T,{variant:"ghost",className:"w-full",onClick:()=>e("/auth"),"data-testid":"button-back-to-login",children:"Back to Login"})]})]}),$&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"h-16 w-16 rounded-full bg-green-500/10 flex items-center justify-center",children:t.jsx(Ir,{className:"h-8 w-8 text-green-500"})})}),t.jsx(pe,{className:"text-center",children:"Already Verified"}),t.jsxs(Ze,{className:"text-center",children:["Your email ",t.jsx("strong",{children:a})," is already verified. You can log in or reset your password if needed."]})]}),t.jsxs(de,{className:"space-y-4",children:[t.jsx(T,{className:"w-full",onClick:()=>e("/auth"),"data-testid":"button-go-to-login",children:"Go to Login"}),t.jsx(T,{variant:"outline",className:"w-full",onClick:()=>e("/auth?tab=forgot"),"data-testid":"button-reset-password",children:"Reset Password"})]})]}),O&&!A&&!$&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:_?t.jsx(dy,{className:"h-8 w-8 text-primary"}):t.jsx(ri,{className:"h-8 w-8 text-primary"})})}),t.jsx(pe,{className:"text-center",children:_?"Complete Your Account":"Verify Your Email"}),t.jsx(Ze,{className:"text-center",children:_?"Enter the verification code and create a password for your account":"We've sent a 6-digit verification code to your email address"})]}),t.jsx(de,{children:t.jsxs("form",{onSubmit:S,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"email",children:"Email Address"}),t.jsxs("div",{className:"relative",children:[t.jsx(Ke,{id:"email",type:"email",value:a,onChange:M=>i(M.target.value),placeholder:"[email protected]",required:!0,"data-testid":"input-verification-email"}),v&&t.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:t.jsx(Qe,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"code",children:"Verification Code"}),t.jsx(Ke,{id:"code",type:"text",value:r,onChange:M=>n(M.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",required:!0,maxLength:6,className:"text-center text-2xl tracking-wider font-mono","data-testid":"input-verification-code"}),t.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Enter the 6-digit code from your email"})]}),_&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"password",children:"Create Password"}),t.jsx(Ke,{id:"password",type:"password",value:o,onChange:M=>l(M.target.value),placeholder:"At least 8 characters, no spaces",required:!0,"data-testid":"input-create-password"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"confirmPassword",children:"Confirm Password"}),t.jsx(Ke,{id:"confirmPassword",type:"password",value:c,onChange:M=>d(M.target.value),placeholder:"Re-enter your password",required:!0,"data-testid":"input-confirm-password"})]}),b&&t.jsx("p",{className:"text-sm text-destructive","data-testid":"text-password-error",children:b}),t.jsxs("div",{className:"flex items-start space-x-3 pt-2",children:[t.jsx(ka,{id:"terms",checked:g,onCheckedChange:M=>j(M===!0),"data-testid":"checkbox-terms"}),t.jsxs("label",{htmlFor:"terms",className:"text-sm text-muted-foreground leading-relaxed cursor-pointer",children:["I agree to the"," ",t.jsx("a",{href:"/terms",target:"_blank",className:"text-primary hover:underline",onClick:M=>M.stopPropagation(),children:"Terms of Service"})," ","and"," ",t.jsx("a",{href:"/privacy",target:"_blank",className:"text-primary hover:underline",onClick:M=>M.stopPropagation(),children:"Privacy Policy"})]})]})]}),t.jsx(T,{type:"submit",className:"w-full",disabled:N.isPending||r.length!==6||!!_&&(!!b||!o||!c||!g),"data-testid":"button-verify-submit",children:N.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ir,{className:"mr-2 h-4 w-4"}),_?"Complete Registration":"Verify Email"]})}),t.jsxs("div",{className:"text-center space-y-2",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"Didn't receive the code?"}),t.jsx(T,{type:"button",variant:"outline",onClick:k,disabled:w.isPending,className:"w-full","data-testid":"button-resend-code",children:w.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Resend Verification Code"})]}),t.jsx("div",{className:"text-center",children:t.jsx(T,{type:"button",variant:"ghost",onClick:()=>e("/auth"),className:"text-sm","data-testid":"button-back-to-login",children:"Back to Login"})})]})})]})]})}),t.jsx("div",{className:"hidden lg:flex items-center justify-center bg-muted p-12",children:t.jsxs("div",{className:"max-w-lg space-y-6",children:[t.jsx("div",{className:"flex justify-center mb-6",children:t.jsx("div",{className:"h-24 w-24 rounded-full bg-primary/20 flex items-center justify-center",children:t.jsx(ri,{className:"h-12 w-12 text-primary"})})}),t.jsx("h1",{className:"text-4xl font-bold text-center",children:"Check Your Inbox"}),t.jsx("p",{className:"text-lg text-muted-foreground text-center",children:"We've sent a verification code to your email address. This helps us keep your account secure and ensures you can recover access if needed."}),t.jsxs("ul",{className:"space-y-3 text-muted-foreground",children:[t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx(Ir,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{children:"Code valid for 10 minutes"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx(Ir,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{children:"Check your spam folder if you don't see it"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx(Ir,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{children:"Request a new code if the current one expires"})]})]})]})})]})]})}function lz(){const[,e]=Ma(),{toast:s}=bt(),[r,n]=m.useState("request"),[a,i]=m.useState(""),[o,l]=m.useState(""),[c,d]=m.useState(""),[u,h]=m.useState(""),[p,x]=m.useState(""),v=ke({mutationFn:async j=>
632(await Fe("POST","/api/auth/forgot-password",j)).json(),onSuccess:j=>{l(j.email),n("reset"),s({title:"Reset code sent!",description:"Please check your email for the password reset code."})},onError:j=>{s({variant:"destructive",title:"Request failed",description:j.message||"Unable to send reset code. Please try again."})}}),f=ke({mutationFn:async j=>(await Fe("POST","/api/auth/reset-password",j)).json(),onSuccess:()=>{s({title:"Password reset successful!",description:"You can now log in with your new password."}),setTimeout(()=>{e("/auth")},1500)},onError:j=>{s({variant:"destructive",title:"Reset failed",description:j.message||"Invalid or expired code. Please try again."})}}),b=j=>{if(j.preventDefault(),!a.trim()){s({variant:"destructive",title:"Required field",description:"Please enter your username or email"});return}v.mutate({usernameOrEmail:a.trim()})},y=j=>{if(j.preventDefault(),u!==p){s({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match"});return}if(u.length<8){s({variant:"destructive",title:"Password too short",description:"Password must be at least 8 characters"});return}f.mutate({email:o,code:c.trim(),newPassword:u})},g=()=>{if(!o){s({variant:"destructive",title:"Email required",description:"Please go back and enter your username or email again"});return}v.mutate({usernameOrEmail:o})};return t.jsxs("div",{className:"min-h-screen grid lg:grid-cols-2",children:[t.jsx("div",{className:"flex items-center justify-center p-8",children:t.jsxs("div",{className:"w-full max-w-md 
632space-y-8",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-10 w-auto"}),t.jsx("span",{className:"font-bold text-2xl",children:"SocialMonkey.app"})]}),t.jsx(bu,{})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx(dy,{className:"h-8 w-8 text-primary"})})}),t.jsx(pe,{className:"text-center",children:r==="request"?"Reset Your Password":"Enter Reset Code"}),t.jsx(Ze,{className:"text-center",children:r==="request"?"Enter your username or email to receive a reset code":"Enter the 6-digit code sent to your email"})]}),t.jsx(de,{children:r==="request"?t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"usernameOrEmail",children:"Username or Email"}),t.jsx(Ke,{id:"usernameOrEmail",type:"text",value:a,onChange:j=>i(j.target.value),placeholder:"Enter your username or email",required:!0,"data-testid":"input-forgot-username-email"})]}),t.jsx(T,{type:"submit",className:"w-full",disabled:v.isPending,"data-testid":"button-send-reset-code",children:v.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Reset Code"}),t.jsx("div",{className:"text-center",children:t.jsxs(T,{type:"button",variant:"ghost",onClick:()=>e("/auth"),className:"text-sm","data-testid":"button-back-to-login",children:[t.jsx(Ic,{className:"mr-2 h-4 w-4"}),"Back to Login"]})})]}):t.jsxs("form",{onSubmit:y,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"code",children:"Reset Code"}),t.jsx(Ke,{id:"code",type:"text",value:c,onChange:j=>d(j.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",required:!0,maxLength:6,className:"text-center text-2xl tracking-wider font-mono","data-testid":"input-reset-code"}),t.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Enter the 6-digit code from your email"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"newPassword",children:"New Password"}),t.jsx(Ke,{id:"newPassword",type:"password",value:u,onChange:j=>h(j.target.value),placeholder:"Enter new password",required:!0,minLength:8,"data-testid":"input-new-password"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Must be at least 8 characters"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"confirmPassword",children:"Confirm Password"}),t.jsx(Ke,{id:"confirmPassword",type:"password",value:p,onChange:j=>x(j.target.value),placeholder:"Confirm new password",required:!0,minLength:8,"data-testid":"input-confirm-new-password"})]}),t.jsx(T,{type:"submit",className:"w-full",disabled:f.isPending||c.length!==6,"data-testid":"button-reset-password",children:f.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Resetting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Reset Password"]})}),t.jsxs("div",{className:"text-center space-y-2",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"Didn't receive the code?"}),t.jsx(T,{type:"button",variant:"outline",onClick:g,disabled:v.isPending,className:"w-full","data-testid":"button-resend-reset-code",children:v.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Resend Code"})]}),t.jsx("div",{className:"text-center",children:t.jsxs(T,{type:"button",variant:"ghost",onClick:()=>{n("request"),d(""),h(""),x("")},className:"text-sm","data-testid":"button-back-to-request",children:[t.jsx(Ic,{className:"mr-2 h-4 w-4"}),"Start Over"]})})]})})]})]})}),t.jsx("div",{className:"hidden lg:flex items-center justify-center bg-muted p-12",children:t.jsxs("div",{className:"max-w-lg space-y-6",children:[t.jsx("div",{className:"flex justify-center mb-6",children:t.jsx("div",{className:"h-24 w-24 rounded-full bg-primary/20 flex items-center justify-center",children:t.jsx(dy,{className:"h-12 w-12 text-primary"})})}),t.jsx("h1",{className:"text-4xl font-bold text-center",children:r==="request"?"Forgot Your Password?":"Almost There!"}),t.jsx("p",{className:"text-lg text-muted-foreground text-center",children:r==="request"?"No worries! Enter your username or email and we'll send you a reset code.":"Enter the code we sent to your email along with your new password."}),t.jsxs("ul",{className:"space-y-3 text-muted-foreground",children:[t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"1"})}),t.jsx("span",{children:"Enter your username or email address"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"2"})}),t.jsx("span",{children:"Check your inbox for the 6-digit code"})]}),t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("span",{className:"text-primary text-sm",children:"3"})}),t.jsx("span",{children:"Create a new secure password"})]})]})]})})]})}const po="/assets/social-monkey-footer-BGnxYEfw.svg",cz="/assets/upscaled_brightened_hero_img_1767111748036-EfEU_VsJ.jpeg",dz="/assets/content_cycle_1765137064156-DdCJFUuT.jpeg",uz="/assets/calendar_1765136865612-DffquXh3.jpeg",mz="SocialMonkey";function hz(){const[e,s]=m.useState(!1),[r,n]=m.useState({}),a=l=>{n(c=>({...c,[l]:!c[l]}))},{data:i}=Ee({queryKey:["/api/auth/me"]});m.useEffect(()=>{document.title="SocialMonkey - AI-Assisted Social Media Scheduling with Approval Workflow";const l=document.querySelector('meta[name="description"]'),c="SocialMonkey helps you create, review, and schedule social media content with AI assistance. Review AI-generated posts before publishing to X, YouTube, Instagram, Facebook, TikTok, LinkedIn, and Reddit.";if(l)l.setAttribute("content",c);else{const v=document.createElement("meta");v.name="description",v.content=c,document.head.appendChild(v)}[{property:"og:title",content:"SocialMonkey - AI-Assisted Social Media Scheduling"},{property:"og:description",content:"Create and schedule social media content with AI assistance. Review and approve posts before publishing to 8 platforms."},{property:"og:type",content:"website"},{property:"og:site_name",content:"SocialMonkey"},{property:"og:url",content:"https://socialmonkey.ai"}
632].forEach(({property:v,content:f})=>{let b=document.querySelector(`meta[property="${v}"]`);b?b.setAttribute("content",f):(b=document.createElement("meta"),b.setAttribute("property",v),b.setAttribute("content",f),document.head.appendChild(b))}),[{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:"SocialMonkey - AI-Assisted Social Media Scheduling"},{name:"twitter:description",content:"Create and schedule social media content with AI assistance. Review posts before publishing."},{name:"twitter:site",content:"@socialmonkeyai"}].forEach(({name:v,content:f})=>{let b=document.querySelector(`meta[name="${v}"]`);b?b.setAttribute("content",f):(b=document.createElement("meta"),b.setAttribute("name",v),b.setAttribute("content",f),document.head.appendChild(b))});let h=document.querySelector('link[rel="canonical"]');h?h.setAttribute("href","https://socialmonkey.ai"):(h=document.createElement("link"),h.setAttribute("rel","canonical"),h.setAttribute("href","https://socialmonkey.ai"),document.head.appendChild(h));const p=document.querySelector('script[type="application/ld+json"]'),x={"@context":"https://schema.org","@type":"SoftwareApplication",name:"SocialMonkey",applicationCategory:"Social Media Management",operatingSystem:"Web",description:"AI-assisted social media scheduling platform with approval workflow. Create content, review, and publish to 8 platforms.",offers:{"@type":"Offer",price:"0",priceCurrency:"USD",description:"Free trial available"},featureList:["AI Content Suggestions","Multi-Platform Scheduling","AI Image Generation","AI Video Generation","Approval Workflow","8 Platform Support"]};if(p)p.textContent=JSON.stringify(x);else{const v=document.createElement("script");v.type="application/ld+json",v.textContent=JSON.stringify(x),document.head.appendChild(v)}return()=>{document.title="SocialMonkey"}},[]);const o=[{name:"X",icon:gr,color:"x-logo",status:"approved",glowBg:"bg-gray-400/30",glowShadow:"drop-shadow-[0_0_8px_rgba(100,100,100,0.6)]"},{name:"YouTube",icon:Sn,color:"text-red-600",status:"approved",glowBg:"bg-red-500/25",glowShadow:"drop-shadow-[0_0_8px_rgba(220,38,38,0.6)]"},{name:"Instagram",icon:Nn,color:"text-pink-600",status:"approved",glowBg:"bg-fuchsia-500/25",glowShadow:"drop-shadow-[0_0_8px_rgba(219,39,119,0.6)]"},{name:"Facebook",icon:wn,color:"text-blue-600",status:"approved",glowBg:"bg-blue-500/25",glowShadow:"drop-shadow-[0_0_8px_rgba(37,99,235,0.6)]"},{name:"TikTok",icon:Zn,color:"tiktok-logo",status:"approved",glowBg:"bg-cyan-500/25",glowShadow:"drop-shadow-[0_0_8px_rgba(0,255,255,0.5)]"},{name:"LinkedIn",icon:kn,color:"text-blue-700",status:"approved",glowBg:"bg-blue-600/25",glowShadow:"drop-shadow-[0_0_8px_rgba(29,78,216,0.6)]"},{name:"Reddit",icon:Xn,color:"text-orange-600",status:"pending",glowBg:"bg-orange-500/25",glowShadow:"drop-shadow-[0_0_8px_rgba(234,88,12,0.6)]"},{name:"Snapchat",icon:Cv,color:"text-yellow-400",status:"coming-soon",glowBg:"bg-yellow-400/25",glowShadow:"drop-shadow-[0_0_8px_rgba(250,204,21,0.6)]"}];return t.jsxs("div",{className:`min-h-screen overflow-x-hidden ${e?"bg-white text-gray-900":"bg-black text-white"} transition-colors duration-300`,children:[t.jsx("header",{className:`sticky top-0 z-50 ${e?"bg-white/95 border-gray-200":"bg-black/95 border-gray-800/50"} backdrop-blur-md border-b transition-colors duration-300`,children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsxs(me,{href:"/",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"flex items-center gap-1.5 sm:gap-2 cursor-pointer flex-shrink-0",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-7 sm:h-10 w-auto"}),t.jsx("span",{className:`font-bold text-sm sm:text-lg ${e?"text-gray-900":"text-white"}`,children:"SocialMonkey"})]}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-3 flex-shrink-0",children:[t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>s(!e),className:`h-8 w-8 sm:h-9 sm:w-9 ${e?"text-gray-700 hover:text-gray-900 hover:bg-gray-200":"text-gray-300 hover:text-white"}`,"data-testid":"button-theme-toggle",children:e?t.jsx(hu,{className:"h-4 w-4 sm:h-5 sm:w-5"}):t.jsx(fu,{className:"h-4 w-4 sm:h-5 sm:w-5"})}),t.jsx(me,{href:"/pricing",onClick:()=>window.scrollTo(0,0),className:"hidden sm:block",children:t.jsx(T,{variant:"ghost",size:"sm",className:`text-xs sm:text-sm ${e?"text-gray-700 hover:text-gray-900":"text-gray-300 hover:text-white"}`,"data-testid":"link-pricing",children:"Pricing"})}),i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:`hidden md:flex items-center gap-2 text-sm ${e?"text-gray-600":"text-gray-400"}`,children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{children:i.username})]}),t.jsx(me,{href:"/",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-[10px] sm:text-sm px-2 sm:px-3","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:`text-[10px] sm:text-sm px-2 sm:px-3 ${e?"text-gray-700 hover:text-gray-900":"text-gray-300 hover:text-white"}`,"data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-[10px] sm:text-sm px-2 sm:px-3 whitespace-nowrap","data-testid":"button-start-trial",children:[t.jsx("span",{className:"hidden sm:inline",children:"Start Your Free Trial"}),t.jsx("span",{className:"sm:hidden",children:"Free Trial"})]})})]})]})]})})}),t.jsx("div",{className:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 text-white py-2 px-4 text-center",children:t.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs sm:text-sm",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsxs("span",{className:"relative flex h-2 w-2",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-400"})]}),t.jsx("span",{className:"font-semibold",children:"Beta Access Open"})]}),t.jsx("span",{className:"hidden sm:inline text-blue-100",children:"—"}),t.jsx("span",{className:"hidden sm:inline text-blue-100",children:"Be among the first to try social media scheduling & workflow tool"}),t.jsx(me,{href:"/auth?tab=register",className:"ml-2",children:t.jsxs(T,{size:"sm",className:"bg-white text-blue-600 hover:bg-blue-50 font-semibold px-4 py-1 h-7 text-xs rounded-full shadow-md",children:["Join the Beta",t.jsx(Rr,{className:"ml-1 h-3 w-3"})]})})]})}),t.jsxs("section",{className:"relative py-8 sm:py-12 lg:py-16 overflow-hidden",children:[t.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[800px] h-[600px] bg-gradient-to-r from-blue-600/20 via-purple-600/20 to-pink-600/20 blur-[120px] rounded-full pointer-events-none"}),t.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-6 sm:mb-10",children:[t.jsxs("h1",{className:`text-3xl sm:text-4xl md:text-4xl lg:text-5xl font-bold ${e?"text-gray-900":"text-white"} mb-4 sm:mb-5 px-2`,children:[t.jsx("span",{children:"SocialMonkey — Post Once. "}),t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600",children:"Reach Everywhere."})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-3 sm:gap-4 px-4 mb-6 sm:mb-8",children:[t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-base sm:text-lg px-6 sm:px-8 py-3 text-white","data-testid":"button-hero-cta",children:["Start Your Free Trial",t.jsx(Rr,{className:"ml-2 h-4 w-4 sm:h-5 sm:w-5"})]})}),t.jsx(me,{href:"/pricing",children:t.jsx(T,{size:"lg",variant:"outline",className:`w-full sm:w-auto text-base sm:text-lg px-6 sm:px-8 py-3 ${e?"border-purple-300 text-purple-700 hover:bg-purple-50":"border-gray-600 text-white hover:bg-gray-800"}`,"data-testid":"button-learn-more",children:"See Plans & Pricing"})})]}),t.jsx("div",{className:"relative max-w-5xl mx-auto px-4 mb-8 sm:mb-12",children:t.jsx("img",{src:cz,alt:"AI-Assisted Content Creation and Scheduling for social media platforms",className:"w-full h-auto rounded-xl shadow-2xl","data-testid":"img-hero"})})]}),t.jsxs("div",{className:"w-full px-4 lg:-mt-16 relative z-10",children:[t.jsx("div",{className:"hidden lg:flex justify-between items-start max-w-6xl mx-auto",children:o.map((l,c)=>{const d=l.icon,u=l.status==="approved",h=["-translate-y-12","-translate-y-4","translate-y-6","translate-y-12","translate-y-12","translate-y-6","-translate-y-4","-translate-y-12"];return t.jsx(re,{className:`text-center hover:shadow-xl hover:scale-105 transition-all duration-300 ${e?"bg-white/90 border-purple-200 shadow-purple-100":"bg-gray-900/90 border-gray-800/50"} backdrop-blur-sm shadow-lg group ${h[c]}`,children:t.jsxs(de,{className:"p-5",children:[t.jsxs("div",{className:"relative flex items-center justify-center",children:[t.jsx("div",{className:`absolute w-14 h-14 ${l.glowBg} rounded-full blur-md`}),t.jsx(d,{className:`relative h-12 w-12 ${l.color==="x-logo"||l.color==="tiktok-logo"?e?"text-gray-800":"text-white":l.color} mx-auto mb-2 transition-all duration-500 group-hover:scale-110 ${l.glowShadow}`})]}),t.jsx("h3",{className:`font-semibold text-base mb-1 ${e?"text-gray-900":"text-white"}`,children:l.name}),t.jsx("div",{className:"flex items-center justify-center gap-1",children:u?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-3.5 w-3.5 text-green-600"}),t.jsx("span",{className:"text-xs text-green-600 font-medium",children:"Approved"})]}):t.jsxs(t.Fragment,{children:[t.jsx(ws,{className:"h-3.5 w-3.5 text-yellow-600"}),t.jsx("span",{className:"text-xs text-yellow-600 font-medium",children:l.status==="coming-soon"?"Coming soon":"Pending"})]})})]})},c)})}),t.jsx("div",{className:"lg:hidden grid grid-cols-2 sm:grid-cols-4 gap-3",children:o.map((l,c)=>{const d=l.icon,u=l.status==="approved";return t.jsx(re,{className:`text-center hover:shadow-md transition-all duration-300 ${e?"bg-white/90 border-purple-200":"bg-gray-900/90 border-gray-800/50"} backdrop-blur-sm group`,children:t.jsxs(de,{className:"p-4",children:[t.jsxs("div",{className:"relative flex items-center justify-center",children:[t.jsx("div",{className:`absolute w-10 h-10 sm:w-12 sm:h-12 ${l.glowBg} rounded-full blur-md`}),t.jsx(d,{className:`relative h-8 w-8 sm:h-10 sm:w-10 ${l.color==="x-logo"||l.color==="tiktok-logo"?e?"text-gray-800":"text-white":l.color} mx-auto mb-2 transition-transform duration-300 group-hover:scale-110 ${l.glowShadow}`})]}),t.jsx("h3",{className:`font-medium text-xs sm:text-sm ${e?"text-gray-900":"text-white"}`,children:l.name}),t.jsx("div",{className:"flex items-center justify-center gap-1 mt-1",children:u?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-3 w-3 text-green-600"}),t.jsx("span",{className:"text-xs text-green-600 font-medium",children:"Approved"})]}):t.jsxs(t.Fragment,{children:[t.jsx(ws,{className:"h-3 w-3 text-yellow-600"}),t.jsx("span",{className:"text-xs text-yellow-600 font-medium",children:l.status==="coming-soon"?"Coming soon":"Pending"})]})})]})},c)})}),t.jsx("p",{className:`text-center text-sm sm:text-base ${e?"text-gray-700":"text-white"} mt-24 max-w-3xl mx-auto`,children:"Each integration is officially verified and certified to meet the strict connectivity, security, and content delivery standards established by X, Google, Meta, LinkedIn, and Reddit."}),t.jsx("div",{className:"text-center mt-8 sm:mt-12",children:t.jsxs("p",{className:`text-sm sm:text-base font-medium ${e?"text-gray-600":"text-gray-400"}`,children:["Powered by ",t.jsx("span",{className:`${e?"text-purple-600":"text-purple-400"} font-semibold`,children:"Nano Banana"})," & ",t.jsx("span",{className:`${e?"text-purple-600":"text-purple-400"} font-semibold`,children:"Veo 3"})]})})]})]})]}),t.jsxs("section",{className:`pt-6 sm:pt-8 pb-12 sm:pb-16 ${e?"bg-gray-50":"bg-black"} relative overflow-hidden transition-colors duration-300`,children:[t.jsx("div",{className:`absolute top-0 right-0 w-96 h-96 bg-gradient-to-bl ${e?"from-purple-200/40":"from-purple-900/20"}
632 to-transparent rounded-full blur-3xl`}),t.jsx("div",{className:`absolute bottom-0 left-0 w-96 h-96 bg-gradient-to-tr ${e?"from-purple-200/40":"from-purple-900/20"} to-transparent rounded-full blur-3xl`}),t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative",children:[t.jsx("div",{className:"text-center mb-8",children:t.jsxs("h2",{className:`text-2xl sm:text-3xl md:text-4xl font-bold ${e?"text-gray-900":"text-white"}`,children:["How ",t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-purple-500",children:"SocialMonkey"})," Works"]})}),t.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 mb-8",children:[t.jsx("div",{className:"relative cursor-pointer h-[420px] sm:h-[400px]",style:{perspective:"1000px"},onClick:()=>a("scheduler"),"data-testid":"flip-card-scheduler",children:t.jsxs("div",{className:"relative w-full h-full transition-transform duration-700",style:{transformStyle:"preserve-3d",transform:r.scheduler?"rotateY(180deg)":"rotateY(0deg)"},children:[t.jsxs(re,{className:`absolute inset-0 overflow-hidden border ${e?"border-purple-200 bg-white":"border-gray-800 bg-gray-900/80"}`,style:{backfaceVisibility:"hidden"},children:[t.jsx("div",{className:`absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl ${e?"from-purple-200/50":"from-purple-900/30"} to-transparent rounded-bl-full flex items-start justify-end p-4`,children:t.jsx("div",{className:`px-3 py-1 rounded-full text-xs font-medium ${e?"bg-purple-100 text-purple-600 shadow-[0_0_10px_rgba(147,51,234,0.3)]":"bg-purple-900/60 text-purple-200 shadow-[0_0_12px_rgba(168,85,247,0.4)]"}`,children:"Click to flip"})}),t.jsxs(he,{className:"pb-4",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("div",{className:"p-3 bg-purple-600 rounded-xl",children:t.jsx(Ca,{className:"h-6 w-6 text-white"})}),t.jsx("div",{className:"text-purple-500 text-sm font-semibold",children:"CORE FEATURE"})]}),t.jsx(pe,{className:`text-2xl sm:text-3xl ${e?"text-gray-900":"text-white"}`,children:"Schedule Once, Post Everywhere"})]}),t.jsxs(de,{children:[t.jsx("p",{className:`${e?"text-gray-600":"text-gray-300"} mb-6 text-base sm:text-lg`,children:"One dashboard. Eight platforms. Plan your schedule, review your content, and publish consistently across all your social accounts — without juggling multiple apps."}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"X, YouTube, Instagram, Facebook, TikTok, LinkedIn & Reddit"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"Stay consistent with planned, user-controlled scheduling"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"Save 10+ hours every week"})]})]})]})]}),t.jsx(re,{className:`absolute inset-0 overflow-hidden border ${e?"border-purple-200 bg-white":"border-gray-800 bg-gray-900/80"}`,style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},children:t.jsxs("div",{className:"relative w-full h-full",children:[t.jsx("img",{src:uz,alt:"Weekly Content Calendar",className:"w-full h-full object-cover"}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent"}),t.jsxs("div",{className:"absolute bottom-4 left-4 right-4",children:[t.jsx("p",{className:"text-white text-sm font-medium",children:"Weekly Content Calendar"}),t.jsx("p",{className:"text-gray-300 text-xs",children:"Click to flip back"})]})]})})]})}),t.jsx("div",{className:"relative cursor-pointer h-[420px] sm:h-[400px]",style:{perspective:"1000px"},onClick:()=>a("automation"),"data-testid":"flip-card-automation",children:t.jsxs("div",{className:"relative w-full h-full transition-transform duration-700",style:{transformStyle:"preserve-3d",transform:r.automation?"rotateY(180deg)":"rotateY(0deg)"},children:[t.jsxs(re,{className:`absolute inset-0 overflow-hidden border ${e?"border-purple-200 bg-white":"border-gray-800 bg-gray-900/80"}`,style:{backfaceVisibility:"hidden"},children:[t.jsx("div",{className:`absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl ${e?"from-purple-200/50":"from-purple-900/30"}
632 to-transparent rounded-bl-full flex items-start justify-end p-4`,children:t.jsx("div",{className:`px-3 py-1 rounded-full text-xs font-medium ${e?"bg-purple-100 text-purple-600 shadow-[0_0_10px_rgba(147,51,234,0.3)]":"bg-purple-900/60 text-purple-200 shadow-[0_0_12px_rgba(168,85,247,0.4)]"}`,children:"Click to flip"})}),t.jsxs(he,{className:"pb-4",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("div",{className:"p-3 bg-purple-600 rounded-xl",children:t.jsx(Yh,{className:"h-6 w-6 text-white"})}),t.jsx("div",{className:"text-purple-500 text-sm font-semibold",children:"AI-ASSISTED SCHEDULING"})]}),t.jsx(pe,{className:`text-2xl sm:text-3xl ${e?"text-gray-900":"text-white"}`,children:"AI Suggests, You Approve"})]}),t.jsxs(de,{children:[t.jsx("p",{className:`${e?"text-gray-600":"text-gray-300"} mb-6 text-base sm:text-lg`,children:"Use AI-assisted tools to draft your content, but nothing goes live without your approval. You stay in control while saving hours of work."}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"AI suggests posts, polls, tips & threads"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"Preview, edit, or regenerate before posting"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-purple-500 flex-shrink-0"}),t.jsx("span",{className:`text-sm sm:text-base ${e?"text-gray-600":"text-gray-300"}`,children:"100% approval workflow — you're always in control"})]})]})]})]}),t.jsx(re,{className:`absolute inset-0 overflow-hidden border ${e?"border-purple-200 bg-white":"border-gray-800 bg-gray-900/80"}`,style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},children:t.jsxs("div",{className:"relative w-full h-full",children:[t.jsx("img",{src:dz,alt:"AI Optimized Engagement Cycle",className:"w-full h-full object-cover"}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
632parent to-transparent"}),t.jsxs("div",{className:"absolute bottom-4 left-4 right-4",children:[t.jsx("p",{className:"text-white text-sm font-medium",children:"Optimized Engagement Cycle"}),t.jsx("p",{className:"text-gray-300 text-xs",children:"Click to flip back"})]})]})})]})})]}),t.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[t.jsxs(re,{className:`hover:shadow-lg transition-all hover:-translate-y-1 duration-300 ${e?"bg-white border-purple-200":"bg-gray-900/80 border-gray-800"}`,children:[t.jsxs(he,{className:"pb-3",children:[t.jsx("div",{className:`p-2.5 ${e?"bg-purple-100":"bg-purple-900/50"} rounded-lg w-fit mb-3`,children:t.jsx(ws,{className:"h-6 w-6 text-purple-500"})}),t.jsx(pe,{className:`text-lg ${e?"text-gray-900":"text-white"}`,children:"Smart Timing"})]}),t.jsxs(de,{className:"pt-0",children:[t.jsx("p",{className:`${e?"text-gray-600":"text-gray-400"} text-sm mb-3`,children:"Get timing recommendations based on audience activity so you can schedule posts for optimal reach — without guessing."}),t.jsx("div",{className:"text-purple-500 text-sm font-semibold",children:"2x higher engagement rates"})]})]}),t.jsxs(re,{className:`hover:shadow-lg transition-all hover:-translate-y-1 duration-300 ${e?"bg-white border-purple-200":"bg-gray-900/80 border-gray-800"}`,children:[t.jsxs(he,{className:"pb-3",children:[t.jsx("div",{className:`p-2.5 ${e?"bg-purple-100":"bg-purple-900/50"} rounded-lg w-fit mb-3`,children:t.jsx(Ft,{className:"h-6 w-6 text-purple-500"})}),t.jsx(pe,{className:`text-lg ${e?"text-gray-900":"text-white"}`,children:"Studio-Quality Video & Images"})]}),t.jsxs(de,{className:"pt-0",children:[t.jsx("p",{className:`${e?"text-gray-600":"text-gray-400"} text-sm mb-3`,children:"Create studio-quality images and videos using Nano Banana and Veo 3 through VidMonkey integration."}),t.jsx("div",{className:"text-purple-500 text-sm font-semibold",children:"Powered by Veo 3 & Nano Banana"})]})]}),t.jsxs(re,{className:`hover:shadow-lg transition-all hover:-translate-y-1 duration-300 ${e?"bg-white border-purple-200":"bg-gray-900/80 border-gray-800"} sm:col-span-2 lg:col-span-1`,children:[t.jsxs(he,{className:"pb-3",children:[t.jsx("div",{className:`p-2.5 ${e?"bg-purple-100":"bg-purple-900/50"} rounded-lg w-fit mb-3`,children:t.jsx(Aa,{className:"h-6 w-6 text-purple-500"})}),t.jsx(pe,{className:`text-lg ${e?"text-gray-900":"text-white"}`,children:"Built for Growth"})]}),t.jsxs(de,{className:"pt-0",children:[t.jsx("p",{className:`${e?"text-gray-600":"text-gray-400"} text-sm mb-3`,children:"Whether you're a solo creator, small business, or marketing team — scale your social presence without scaling your workload."}),t.jsx("div",{className:"text-purple-500 text-sm font-semibold",children:"For creators, businesses & teams"})]})]})]}),t.jsxs("div",{className:"mt-12 text-center",children:[t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-lg px-8 py-6 text-white","data-testid":"button-features-cta",children:["Start Your Free Trial",t.jsx(Rr,{className:"ml-2 h-5 w-5"})]})}),t.jsx("p",{className:`text-sm ${e?"text-gray-500":"text-gray-400"} mt-3`,children:"No credit card required. Cancel anytime."})]})]})]}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-r from-black via-purple-950/50 to-black text-white",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Your Social Media Life, Transformed"}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-300 max-w-2xl mx-auto px-4",children:"See what changes when you stop managing everything manually"})]}),t.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 sm:gap-8",children:[t.jsxs(re,{className:"bg-red-950/40 backdrop-blur-sm border-red-500/30 text-white overflow-hidden",children:[t.jsx(he,{className:"pb-4 border-b border-red-500/20",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 bg-red-500/20 rounded-lg",children:t.jsx(ws,{className:"h-6 w-6 text-red-400"})}),t.jsxs("div",{children:[t.jsx("div",{className:"text-red-400 text-sm font-semibold uppercase tracking-wide",children:"Before"}),t.jsx(pe,{className:"text-xl sm:text-2xl text-white",children:"Without SocialMonkey"})]})]})}),t.jsx(de,{className:"pt-6",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-red-400 text-lg",children:"✗"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Hours lost every week"}),t.jsx("div",{className:"text-sm text-red-200/70",children:"Logging into 8 different apps, copying and pasting content"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-red-400 text-lg",children:"✗"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Inconsistent posting"}),t.jsx("div",{className:"text-sm text-red-200/70",children:"Life gets busy, you forget to post, your audience forgets you"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-red-400 text-lg",children:"✗"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Creative burnout"}),t.jsx("div",{className:"text-sm text-red-200/70",children:"Staring at a blank screen, wondering what to post today"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-red-400 text-lg",children:"✗"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Missed opportunities"}),t.jsx("div",{className:"text-sm text-red-200/70",children:"Posting at the wrong times when nobody's online"})]})]})]})})]}),t.jsxs(re,{className:"bg-green-950/40 backdrop-blur-sm border-green-500/30 text-white overflow-hidden",children:[t.jsx(he,{className:"pb-4 border-b border-green-500/20",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 bg-green-500/20 rounded-lg",children:t.jsx(Aa,{className:"h-6 w-6 text-green-400"})}),t.jsxs("div",{children:[t.jsx("div",{className:"text-green-400 text-sm font-semibold uppercase tracking-wide",children:"After"}),t.jsx(pe,{className:"text-xl sm:text-2xl text-white",children:"With SocialMonkey"})]})]})}),t.jsx(de,{className:"pt-6",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-green-400 text-lg",children:"✓"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"10+ hours s
632aved weekly"}),t.jsx("div",{className:"text-sm text-green-200/70",children:"One dashboard for everything — schedule once, post everywhere"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-green-400 text-lg",children:"✓"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Always-on presence"}),t.jsx("div",{className:"text-sm text-green-200/70",children:"Approved posts publish on schedule, even while you sleep"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-green-400 text-lg",children:"✓"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Endless content ideas"}),t.jsx("div",{className:"text-sm text-green-200/70",children:"AI generates posts, polls, tips & visuals — you just approve"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 text-green-400 text-lg",children:"✓"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-white",children:"Peak engagement"}),t.jsx("div",{className:"text-sm text-green-200/70",children:"Smart timing posts when your audience is most active"})]})]})]})})]})]})]})}),t.jsx("section",{className:`py-12 sm:py-20 ${e?"bg-white":"bg-black"} transition-colors duration-300`,children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[t.jsxs("div",{className:"inline-flex items-center justify-center gap-3 mb-4",children:[t.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full flex items-center justify-center",children:t.jsx("span",{className:"text-xl sm:text-2xl",children:"⚡"})}),t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-400 via-purple-400 to-pink-400 bg-clip-text text-transparent",children:"Key Differentiators — SocialMonkey.ai vs. Traditional Tools"})]}),t.jsx("p",{className:`${e?"text-gray-500":"text-gray-400"} text-sm sm:text-base max-w-3xl mx-auto`,children:"See why leading creators choose SocialMonkey.ai over legacy platforms"})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsx("div",{className:"inline-block min-w-full align-middle",children:t.jsx("div",{className:`overflow-hidden rounded-xl border ${e?"border-purple-200":"border-gray-800"} shadow-2xl`,children:t.jsxs("table",{className:"min-w-full",children:[t.jsx("thead",{children:t.jsxs("tr",{className:`${e?"bg-purple-50":"bg-gray-900"} border-b border-purple-500/30`,children:[t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-bold ${e?"text-gray-900":"text-white"} w-1/6 uppercase tracking-wider`,children:"Feature"}),t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-bold w-1/6 ${e?"bg-purple-100":"bg-gradient-to-r from-blue-600/20 to-purple-600/20"}`,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`uppercase tracking-wider ${e?"text-purple-700 font-bold":"text-transparent bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text"}`,children:"SocialMonkey.ai"}),t.jsx("span",{className:"text-yellow-500",children:"⭐"})]})}),t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold ${e?"text-gray-600":"text-gray-300"} w-1/6 uppercase tracking-wider`,children:"Hootsuite"}),t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold ${e?"text-gray-600":"text-gray-300"} w-1/6 uppercase tracking-wider`,children:"Sprout Social"}),t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold ${e?"text-gray-600":"text-gray-300"} w-1/6 uppercase tracking-wider`,children:"Buffer"}),t.jsx("th",{scope:"col",className:`px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold ${e?"text-gray-600":"text-gray-300"} w-1/6 uppercase tracking-wider`,children:"SocialPilot"})]})}),t.jsxs("tbody",{className:`${e?"bg-white":"bg-gray-950/80"} backdrop-blur-sm`,children:[t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Engagement"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Reads and classifies comments and provides brand-aware reply suggestions for user approval."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsxs("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:["Real-Time News & Facts",t.jsx("div",{className:"text-xs text-gray-500 font-normal mt-1",children:"(News Integration)"})]}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Integrates curated news and research sources to support fact-based content and response drafting."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Cross-Platform Monitoring"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Monitors supported social platforms to surface relevant conversations and engagement opportunities."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X, TikTok."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Content Rotation System"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Supports scheduled engagement formats through user-controlled workflows."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Dynamic Content Generation System"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Uses reusable topic lists and AI-assisted prompts to help users plan and schedule consistent content."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic generation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic generation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-green-400 font-medium",children:"✅ Limited AI assist."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic generation."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Veo3 Video Creation"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Connects with VidMonkey.app to help users create and manage short-form video content."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."})]}),t.jsxs("tr",{className:`border-b ${e?"border-gray-200 hover:bg-purple-50":"border-gray-800/50 hover:bg-gray-800/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Claim & Sentiment Detection"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Detects political, brand, or factual context to assist users in selecting an appropriate response tone."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Basic keyword filters only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-green-400 font-medium",children:"✅ Basic sentiment tagging."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ None."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ None."})]}),t.jsxs("tr",{className:`${e?"hover:bg-purple-50":"hover:bg-gray-700/30"} transition-colors`,children:[t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold ${e?"text-purple-700":"text-purple-300"}`,children:"Affordability & Accessibility"}),t.jsx("td",{className:`px-4 sm:px-6 py-4 text-xs sm:text-sm ${e?"text-gray-900 bg-purple-50":"text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500"}`,children:"Built for creators and small teams with flexible plans."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$$ Enterprise pricing."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$$ Enterprise pricing."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$ Mid-tier."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$ Mid-tier."})]})]})]})})})}),t.jsx("div",{className:"mt-8 sm:mt-12",children:t.jsxs("div",{className:"relative bg-gradient-to-r from-gray-900 via-purple-950/60 to-gray-900 rounded-xl p-6 sm:p-8 border border-purple-500/30 backdrop-blur-sm shadow-xl",children:[t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-900/10 to-purple-900/10 rounded-xl"}),t.jsxs("div",{className:"relative flex items-start gap-3 sm:gap-4",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full flex items-center justify-center shadow-lg",children:t.jsx("span",{className:"text-2xl",children:"💡"})})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg sm:text-xl font-bold text-white mb-2 sm:mb-3",children:"Summary"}),t.jsx("p",{className:"text-sm sm:text-base text-gray-200 leading-relaxed",children:"SocialMonkey.ai is a social media workflow and scheduling platform that helps creators, agencies, and brands stay organized, informed, and consistent across platforms. It provides AI-assisted insights, curated news, and content planning tools that support smarter engagement — with users in full control of what gets published."})]})]})]})})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-r from-black via-purple-900/60 to-black text-white",children:t.jsxs("div",{className:"max-w-4xl mx-auto text-center px-4 sm:px-6 lg:px-8",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Your First Post Goes Live This Week"}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-300 mb-6 sm:mb-8",children:"Connect your accounts, use AI-assisted tools to draft content, review it, and schedule posts — all in minutes."}),t.jsx("div",{className:"bg-gray-900/60 backdrop-blur-sm rounded-lg p-4 sm:p-6 mb-6 sm:mb-8 border border-gray-800",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 sm:gap-6 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"2 Minutes"}),t.jsx("div",{className:"text-xs sm:text-sm text-gray-400",children:"To connect your first account"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"5 Minutes"}),t.jsx("div",{className:"text-xs sm:text-sm text-gray-400",children:"To generate your first week of posts"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"100% Free"}),t.jsx("div",{className:"text-xs sm:text-sm text-gray-400",children:"No credit card required"})]})]})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-white text-blue-600 hover:bg-gray-100 text-base sm:text-lg md:text-xl px-8 sm:px-12 py-3 sm:py-4","data-testid":"button-cta-bottom",children:["Try It Free — See Results This Week",t.jsx(Rr,{className:"ml-2 h-5 w-5 sm:h-6 sm:w-6"})]})})]})}),t.jsx("footer",{className:`${e?"bg-gray-50 text-gray-900 border-gray-200":"bg-black text-white border-gray-800/50"} py-8 sm:py-12 border-t transition-colors duration-300`,children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"data-testid":"footer-logo-scroll-top"})}),t.jsx("p",{className:`text-xs sm:text-sm ${e?"text-gray-500":"text-gray-4
63200"} mb-3`,children:"A social media scheduling and workflow platform designed to help you save time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"X/Twitter","data-testid":"footer-social-twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"YouTube","data-testid":"footer-social-youtube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"LinkedIn","data-testid":"footer-social-linkedin",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Facebook","data-testid":"footer-social-facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Instagram","data-testid":"footer-social-instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"TikTok","data-testid":"footer-social-tiktok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Reddit","data-testid":"footer-social-reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Product"}),t.jsxs("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:[t.jsx("li",{children:t.jsx(me,{href:"/features",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Legal"}),t.jsxs("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Privacy Policy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Terms of Service"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Connect"}),t.jsx("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:t.jsx("li",{children:t.jsx("a",{href:"mailto:[email protected]",className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"[email protected]"})})})]})]}),t.jsx("div",{className:`border-t ${e?"border-gray-200":"border-gray-800"} pt-6 sm:pt-8 text-center text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:t.jsxs("p",{children:["© 2025 ",mz,". All rights reserved."]})})]})})]})}
632const pz="/assets/Social_Media_Automation_Auto_post_1762896852069-JbssF3NU.jpg",fz="/assets/Screenshot%202025-11-24%20182754_1764030507661-DYjca-Fb.png",Ix="SocialMonkey",xz="SocialMonkey";function gz(){const[e,s]=m.useState(0),{data:r}=Ee({queryKey:["/api/auth/me"]}),n=[{icon:t.jsx(Yh,{className:"h-6 w-6 sm:h-8 sm:w-8 text-blue-600"}),title:"AI Content Generation",description:"Automatically generates engaging posts, tips, polls, and images tailored to your brand and audience."},{icon:t.jsx(Ca,{className:"h-6 w-6 sm:h-8 sm:w-8 text-green-600"}),title:"Smart Scheduling",description:"Schedule posts across all platforms with intelligent timing for maximum engagement."},{icon:t.jsx(Ft,{className:"h-6 w-6 sm:h-8 sm:w-8 text-purple-600"}),title:"AI Image Creation",description:"Generate stunning visuals with DALL-E integration for eye-catching social media posts."},{icon:t.jsx(Mc,{className:"h-6 w-6 sm:h-8 sm:w-8 text-orange-600"}),title:"Approval Workflow",description:"Review and approve AI-generated content before it goes live to maintain quality control."},{icon:t.jsx(Rc,{className:"h-6 w-6 sm:h-8 sm:w-8 text-red-600"}),title:"Multi-Platform Support",description:"Post to YouTube, X, Instagram, Facebook, TikTok, LinkedIn, and Reddit simultaneously."},{icon:t.jsx(Aa,{className:"h-6 w-6 sm:h-8 sm:w-8 text-yellow-600"}),title:"Auto-Posting",description:"Set your preferences and let AI handle the content creation and posting automatically."}],a=[{name:"X",icon:gr,color:"text-black dark:text-white",status:"approved"},{name:"YouTube",icon:Sn,color:"text-red-600",status:"pending"},{name:"Instagram",icon:Nn,color:"text-pink-600",status:"approved"},{name:"Facebook",icon:wn,color:"text-blue-600",status:"approved"},{name:"TikTok",icon:Zn,color:"text-black dark:text-white",status:"pending"},{name:"LinkedIn",icon:kn,color:"text-blue-700",status:"approved"},{name:"Reddit",icon:Xn,color:"text-orange-600",status:"pending"},{name:"Snapchat",icon:Cv,color:"text-yellow-400",status:"coming-soon"}],i=[{name:"Sarah Chen",role:"Content Creator",company:"Lifestyle Brand",content:"SocialMonkey saves me 10+ hours a week. The AI-generated content is surprisingly on-brand and engaging!",rating:5},{name:"Marcus Rodriguez",role:"Social Media Manager",company:"Tech Startup",content:"Finally, a tool that actually automates social media without sacrificing quality. Game changer!",rating:5},{name:"Emily Watson",role:"Entrepreneur",company:"E-commerce Business",content:"The approval workflow gives me control while the AI does the heavy lifting. Perfect balance!",rating:5}],o=[{title:"Content Creators",description:"Maintain consistent posting schedule while focusing on creating premium content",metrics:"10+ hours saved weekly"},{title:"Small Businesses",description:"Professional social media presence without hiring a full-time social media manager",metrics:"70% cost savings"},{title:"Marketing Teams",description:"Scale content production and manage multiple brand accounts effortlessly",metrics:"3x more content output"},{title:"Personal Brands",description:"Stay top-of-mind with your audience through consistent, quality posts",metrics:"Daily engagement boost"}];return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-gray-900 dark:text-white",children:"SocialMonkey"})]}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{children:r.username})]}),t.jsx(me,{href:"/",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Your Free Trial"})})]})})]})})}),t.jsx("section",{className:"relative py-12 sm:py-20 lg:py-32",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-16",children:[t.jsxs("h1",{className:"text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 dark:text-white mb-4 sm:mb-6 px-2",children:[t.jsx("span",{className:"block sm:inline",children:"Social Media Scheduling & "}),t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600",children:"Automation with AI"})]}),t.jsx("div",{className:"mb-6 sm:mb-8 max-w-5xl mx-auto px-4",children:t.jsx("img",{src:pz,alt:"AI Powered Content - Scheduled Automation across social media platforms",className:"w-full h-auto rounded-lg shadow-2xl","data-testid":"img-hero"})}),t.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-3 sm:gap-4 px-4",children:[t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-base sm:text-lg px-6 sm:px-8 py-3","data-testid":"button-hero-cta",children:["Start Your Free Trial",t.jsx(Rr,{className:"ml-2 h-4 w-4 sm:h-5 sm:w-5"})]})}),t.jsx(me,{href:"/referral",children:t.jsx(T,{size:"lg",variant:"outline",className:"w-full sm:w-auto text-base sm:text-lg px-6 sm:px-8 py-3","data-testid":"button-learn-more",children:"Learn More"})})]})]}
632),t.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-3 sm:gap-4 max-w-6xl mx-auto px-4",children:a.map((l,c)=>{const d=l.icon,u=l.status==="approved";return t.jsx(re,{className:"text-center hover:shadow-md transition-shadow",children:t.jsxs(de,{className:"p-4 sm:p-6",children:[t.jsx(d,{className:`h-6 w-6 sm:h-8 sm:w-8 ${l.color} mx-auto mb-2 sm:mb-3`}),t.jsx("h3",{className:"font-medium text-xs sm:text-sm",children:l.name}),t.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:u?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-3.5 w-3.5 text-green-600"}),t.jsx("span",{className:"text-xs text-green-600 font-medium",children:"Approved"})]}):t.jsxs(t.Fragment,{children:[t.jsx(ws,{className:"h-3.5 w-3.5 text-yellow-600"}),t.jsx("span",{className:"text-xs text-yellow-600 font-medium",children:l.status==="coming-soon"?"Coming soon":"Pending"})]})})]})},c)})}),t.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 sm:gap-4 max-w-4xl mx-auto px-4",children:[t.jsx("p",{className:"text-center text-xs sm:text-sm text-muted-foreground",children:"Each integration is officially verified and certified to meet the strict connectivity, security, and content delivery standards established by X, Google, Meta, LinkedIn, and Reddit."}),t.jsx("img",{src:fz,alt:"Trust - Secure & Reliable",className:"h-12 sm:h-14 w-auto"})]})]})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-white dark:bg-gray-800",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-16",children:[t.jsxs("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mb-3 sm:mb-4",children:["How ",Ix," Works"]}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-600 dark:text-gray-300 max-w-2xl mx-auto px-4",children:"Four simple steps to automate your social media"})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6 lg:gap-8",children:[{step:"1",title:"Connect Platforms",description:"Link your social accounts - YouTube, X, Instagram, Facebook, TikTok, LinkedIn, and Reddit",icon:t.jsx(Hn,{className:"h-6 w-6 sm:h-8 sm:w-8"})},{step:"2",title:"Configure AI",description:"Set your brand voice, topics, posting frequency, and approval preferences",icon:t.jsx(Yh,{className:"h-6 w-6 sm:h-8 sm:w-8"})},{step:"3",title:"Review & Approve",description:"AI generates content for your review. Approve, edit, or regenerate with one click",icon:t.jsx(u7,{className:"h-6 w-6 sm:h-8 sm:w-8"})},{step:"4",title:"Auto-Post",description:"Approved content posts automatically at optimal times. Sit back and grow!",icon:t.jsx(rf,{className:"h-6 w-6 sm:h-8 sm:w-8"})}].map((l,c)=>t.jsxs(re,{className:"relative text-center border-2 hover:border-blue-200 dark:hover:border-blue-800 transition-colors",children:[t.jsxs(he,{className:"pb-3 sm:pb-4",children:[t.jsx("div",{className:"mx-auto w-12 h-12 sm:w-16 sm:h-16 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full flex items-center justify-center text-white mb-3 sm:mb-4",children:l.icon}),t.jsx("div",{className:"absolute -top-2 -right-2 sm:-top-3 sm:-right-3 w-6 h-6 sm:w-8 sm:h-8 bg-orange-500 text-white rounded-full flex items-center justify-center font-bold text-sm sm:text-base",children:l.step}),t.jsx(pe,{className:"text-base sm:text-lg md:text-xl",children:l.title})]}),t.jsx(de,{className:"pt-0",children:t.jsx(Ze,{className:"text-xs sm:text-sm md:text-base",children:l.description})})]},c))})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gray-50 dark:bg-gray-900",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-16",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mb-3 sm:mb-4",children:"Social Media AI Features"}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-600 dark:text-gray-300 max-w-2xl mx-auto px-4",children:"AI-powered tools to automate your social media posting"})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 lg:gap-8",children:n.map((l,c)=>t.jsxs(re,{className:"h-full hover:shadow-lg transition-shadow",children:[t.jsxs(he,{className:"pb-3 sm:pb-4",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:l.icon}),t.jsx(pe,{className:"text-base sm:text-lg md:text-xl",children:l.title})]}),t.jsx(de,{className:"pt-0",children:t.jsx(Ze,{className:"text-xs sm:text-sm md:text-base",children:l.description})})]},c))})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-r from-blue-900 to-purple-900 text-white",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-16",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Perfect for Every Creator"}),t.jsxs("p",{className:"text-base sm:text-lg md:text-xl text-blue-100 max-w-2xl mx-auto px-4",children:["See how different users save time with ",Ix]})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6 lg:gap-8",children:o.map((l,c)=>t.jsxs(re,{className:"bg-white/10 backdrop-blur-sm border-white/20 text-white",children:[t.jsx(he,{className:"pb-3 sm:pb-4",children:t.jsx(pe,{className:"text-base sm:text-lg md:text-xl",children:l.title})}),t.jsxs(de,{className:"pt-0",children:[t.jsx(Ze,{className:"text-blue-100 text-xs sm:text-sm md:text-base mb-3 sm:mb-4",children:l.description}),t.jsx("div",{className:"text-yellow-300 font-semibold text-xs sm:text-sm",children:l.metrics})]})]},c))})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-br from-blue-50 to-purple-50 dark:from-gray-900 dark:to-gray-800",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-gray-900 dark:text-white mb-4",children:"Social Media Scheduling for Every Platform"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300 max-w-3xl mx-auto",children:"Schedule and automate posts across all your social media accounts with AI-powered content generation"})]}),t.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:[t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(gr,{className:"h-8 w-8 mb-2"}),t.jsx(pe,{className:"text-lg",children:"Twitter Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• Twitter automation"}),t.jsx("li",{children:"• Twitter posting"}),t.jsx("li",{children:"• Post to Twitter accounts"}),t.jsx("li",{children:"• X.com monitoring & replies"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(wn,{className:"h-8 w-8 mb-2 text-blue-600"}),t.jsx(pe,{className:"text-lg",children:"Facebook Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• Facebook automation"}),t.jsx("li",{children:"• Facebook posting"}),t.jsx("li",{children:"• Post to Facebook accounts"}),t.jsx("li",{children:"• Multi-page support"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(Nn,{className:"h-8 w-8 mb-2 text-pink-600"}),t.jsx(pe,{className:"text-lg",children:"Instagram Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• Instagram automation"}),t.jsx("li",{children:"• Instagram posting"}),t.jsx("li",{children:"• Post to Instagram accounts"}),t.jsx("li",{children:"• AI image generation"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(Zn,{className:"h-8 w-8 mb-2"}),t.jsx(pe,{className:"text-lg",children:"TikTok Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• TikTok automation"}),t.jsx("li",{children:"• TikTok posting"}),t.jsx("li",{children:"• Post to TikTok accounts"}),t.jsx("li",{children:"• Video optimization"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(kn,{className:"h-8 w-8 mb-2 text-blue-700"}),t.jsx(pe,{className:"text-lg",children:"LinkedIn Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• LinkedIn automation"}),t.jsx("li",{children:"• LinkedIn posting"}),t.jsx("li",{children:"• Post to LinkedIn accounts"}),t.jsx("li",{children:"• Professional content"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(Sn,{className:"h-8 w-8 mb-2 text-red-600"}),t.jsx(pe,{className:"text-lg",children:"YouTube Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• YouTube automation"}),t.jsx("li",{children:"• YouTube posting"}),t.jsx("li",{children:"• Post to YouTube accounts"}),t.jsx("li",{children:"• Video scheduling"})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(Xn,{className:"h-8 w-8 mb-2 text-orange-600"}),t.jsx(pe,{className:"text-lg",children:"Reddit Scheduling"})]}),t.jsx(de,{children:t.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-300 space-y-2",children:[t.jsx("li",{children:"• Reddit automation"}),t.jsx("li",{children:"• Reddit posting"}),t.jsx("li",{children:"• Post to Reddit accounts"}),t.jsx("li",{children:"• Subreddit targeting"})]})})]})]}),t.jsxs("div",{className:"mt-12 text-center",children:[t.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Post to all social media accounts from one dashboard"}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"lg",className:"bg-gradient-to-r from-blue-600 to-purple-600",children:"Start Managing All 8 Platforms"})})]})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-white dark:bg-gray-800",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-gray-900 dark:text-white mb-4",children:"The Smarter Alternative to Traditional Social Media Tools"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"AI-powered automation at a fraction of the cost"})]}),t.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{className:"text-2xl",children:"Alternative to Hootsuite"})}),t.jsxs(de,{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"AI content generation included"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"70% lower cost than Hootsuite"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Simpler interface, faster setup"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Automated approval workflow"})]})]})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{className:"text-2xl",children:"Alternative to Sprout Social"})}),t.jsxs(de,{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Built-in AI, no add-ons needed"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"More affordable than Sprout Social"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"All features in one platform"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Real-time X.com monitoring"})]})]})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{className:"text-2xl",children:"Alternative to Buffer"})}),t.jsxs(de,{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"AI writes your posts for you"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"More platforms than Buffer"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Smarter scheduling algorithms"})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm",children:"Better value for teams"})]})]})]})]}),t.jsxs("div",{className:"mt-12 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-gray-700 dark:to-gray-600 rounded-lg p-8 text-center",children:[t.jsx("h3",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-4",children:"Why Choose SocialMonkey?"}),t.jsxs("div",{className:"grid sm:grid-cols-3 gap-6 mt-6",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-3xl font-bold text-blue-600 mb-2",children:"8 Platforms"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"More than any competitor"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-3xl font-bold text-purple-600 mb-2",children:"AI-Powered"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Content that converts"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-3xl font-bold text-green-600 mb-2",children:"70% Savings"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Compared to enterprise tools"})]})]})]})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-br from-blue-50 to-purple-50 dark:from-gray-900 dark:to-gray-800",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-16",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-white mb-3 sm:mb-4",children:"Loved by Creators"}),t.jsxs("p",{className:"text-base sm:text-lg md:text-xl text-gray-600 dark:text-gray-300 max-w-2xl mx-auto px-4",children:["See what users are saying about ",Ix]})]}),t.jsxs("div",{className:"max-w-4xl mx-auto",children:[t.jsx(re,{className:"p-4 sm:p-6 md:p-8",children:t.jsxs(de,{className:"text-center p-0",children:[t.jsx("div",{className:"flex justify-center mb-3 sm:mb-4",children:[...Array(i[e].rating)].map((l,c)=>t.jsx(gP,{className:"h-4 w-4 sm:h-5 sm:w-5 text-yellow-400 fill-current"},c))}),t.jsxs("blockquote",{className:"text-base sm:text-lg md:text-xl text-gray-900 dark:text-white mb-4 sm:mb-6 px-2",children:['"',i[e].content,'"']}),t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold text-sm sm:text-base text-gray-900 dark:text-white",children:i[e].name}),t.jsxs("div",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400",children:[i[e].role," at ",i[e].company]})]})]})}),t.jsx("div",{className:"flex justify-center mt-4 sm:mt-6 gap-2",children:i.map((l,c)=>t.jsx("button",{onClick:()=>s(c),className:`w-2 h-2 sm:w-3 sm:h-3 rounded-full transition-colors ${c===e?"bg-blue-600":"bg-gray-300 dark:bg-gray-600"}`,"aria-label":`View testimonial ${c+1}`,"data-testid":`button-testimonial-${c}`},c))})]})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900",children:t.jsxs("div",{className:"max-
632w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[t.jsxs("div",{className:"inline-flex items-center justify-center gap-3 mb-4",children:[t.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full flex items-center justify-center",children:t.jsx("span",{className:"text-xl sm:text-2xl",children:"⚡"})}),t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-400 via-purple-400 to-pink-400 bg-clip-text text-transparent",children:"Key Differentiators — SocialMonkey.ai vs. Traditional Tools"})]}),t.jsx("p",{className:"text-gray-400 text-sm sm:text-base max-w-3xl mx-auto",children:"See why leading creators choose SocialMonkey.ai over legacy platforms"})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsx("div",{className:"inline-block min-w-full align-middle",children:t.jsx("div",{className:"overflow-hidden rounded-xl border border-gray-700 shadow-2xl",children:t.jsxs("table",{className:"min-w-full",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-gradient-to-r from-gray-800 via-gray-750 to-gray-800 border-b-2 border-blue-500/30",children:[t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-bold text-white w-1/6 uppercase tracking-wider",children:"Feature"}),t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-bold bg-gradient-to-r from-blue-600/20 to-purple-600/20 w-1/6",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-transparent bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text uppercase tracking-wider",children:"SocialMonkey.ai"}),t.jsx("span",{className:"text-yellow-400",children:"⭐"})]})}),t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold text-gray-300 w-1/6 uppercase tracking-wider",children:"Hootsuite"}),t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold text-gray-300 w-1/6 uppercase tracking-wider",children:"Sprout Social"}),t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold text-gray-300 w-1/6 uppercase tracking-wider",children:"Buffer"}),t.jsx("th",{scope:"col",className:"px-4 sm:px-6 py-4 text-left text-xs sm:text-sm font-semibold text-gray-300 w-1/6 uppercase tracking-wider",children:"SocialPilot"})]})}),t.jsxs("tbody",{className:"bg-gray-800/50 backdrop-blur-sm",children:[t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"AI-Powered Engagement"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Reads, classifies, and replies to comments automatically with brand-aware tone."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Manual engagement only."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsxs("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:["Real-Time News & Facts",t.jsx("div",{className:"text-xs text-gray-500 font-normal mt-1",children:"(News Integration)"})]}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Uses News AI to generate factual, data-driven replies referencing the latest news or research."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No factual integration."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"Cross-Platform Monitoring"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Scans Twitter/X, YouTube, Reddit, Instagram, and more."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X, TikTok."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"FB, IG, LinkedIn, X."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"Automated Response Rotation"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Engages automatically with polls, tips, image posts, or video replies via PostMonkey integration."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"Limited automation."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"Dynamic Content Generation System"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Four prompt types (Poll, Tip, Image, X/Twitter Reply) plus Item Lists that automatically cycle through predefined topics for endless, diverse content."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic AI generation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic AI generation."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-green-400 font-medium",children:"✅ Limited AI assist."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ No dynamic AI generation."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"AI Video Creation"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Connects to VidMonkey.app for AI-generated videos and clips."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Not available."})]}),t.jsxs("tr",{className:"border-b border-gray-700/50 hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"Claim & Sentiment Detection"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Detects political, brand, or factual claims and adjusts response tone accordingly."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ Basic keyword filters only."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-green-400 font-medium",children:"✅ Basic sentiment tagging."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ None."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-red-400 font-medium",children:"❌ None."})]}),t.jsxs("tr",{className:"hover:bg-gray-700/30 transition-colors",children:[t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm font-semibold text-blue-300",children:"Affordability & Accessibility"}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-white bg-gradient-to-r from-blue-900/20 to-purple-900/20 border-l-2 border-blue-500",children:"Built for creators and small teams with flexible plans."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$$ Enterprise pricing."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$$ Enterprise pricing."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$ Mid-tier."}),t.jsx("td",{className:"px-4 sm:px-6 py-4 text-xs sm:text-sm text-gray-400",children:"$$ Mid-tier."})]})]})]})})})}),t.jsx("div",{className:"mt-8 sm:mt-12",children:t.jsxs("div",{className:"relative bg-gradient-to-r from-blue-900/40 via-purple-900/40 to-pink-900/40 rounded-xl p-6 sm:p-8 border border-blue-500/30 backdrop-blur-sm shadow-xl",children:[t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-600/10 to-purple-600/10 rounded-xl"}),t.jsxs("div",{className:"relative flex items-start gap-3 sm:gap-4",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full flex items-center justify-center shadow-lg",children:t.jsx("span",{className:"text-2xl",children:"💡"})})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg sm:text-xl font-bold text-white mb-2 sm:mb-3",children:"Summary"}),t.jsx("p",{className:"text-sm sm:text-base text-gray-200 leading-relaxed",children:"SocialMonkey.ai is the AI-driven evolution of social management platforms — combining real-time intelligence (via News), cross-platform automation, and video-powered engagement to help creators, agencies, and brands grow faster and smarter."})]})]})]})})]})}),t.jsx("section",{className:"py-12 sm:py-20 bg-gradient-to-r from-blue-600 to-purple-600 text-white",children:t.jsxs("div",{className:"max-w-4xl mx-auto text-center px-4 sm:px-6 lg:px-8",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4",children:"Start Automating Today"}),t.jsx("p",{className:"text-base sm:text-lg md:text-xl text-blue-100 mb-6 sm:mb-8",children:"Join creators who are saving 10+ hours a week with AI-powered social media automation."}),t.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-lg p-4 sm:p-6 mb-6 sm:mb-8",children:t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 sm:gap-6 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"Free to Start"}),t.jsx("div",{className:"text-xs sm:text-sm text-blue-100",children:"No credit card needed"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"8 Platforms"}),t.jsx("div",{className:"text-xs sm:text-sm text-blue-100",children:"All major social networks"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xl sm:text-2xl font-bold mb-1 sm:mb-2",children:"AI Powered"}),t.jsx("div",{className:"text-xs sm:text-sm text-blue-100",children:"Content that converts"})]})]})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-white text-blue-600 hover:bg-gray-100 text-base sm:text-lg md:text-xl px-8 sm:px-12 py-3 sm:py-4","data-testid":"button-cta-bottom",children:["Start Your Free Trial",t.jsx(Rr,{className:"ml-2 h-5 w-5 sm:h-6 sm:w-6"})]})})]})}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400",children:"AI-powered social media scheduling that saves you time."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/features",onClick:()=>window.scrollTo(0,0),className:"hover:text-white transition-colors",children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",onClick:()=>window.scrollTo(0,0),className:"hover:text-white transition-colors",children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",onClick:()=>window.scrollTo(0,0),className:"hover:text-white transition-colors",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Support"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Help Center"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Contact"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Documentation"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",xz,". All rights reserved."]})})]})})]})}const yz="/assets/Screenshot_2025-12-09_231550_1765343772760-9m1b-_4y.png",vz="/assets/image_1765343857788-D-OaxFNu.png",bz="/assets/video-bGbxKPEU_1765344030061-Ce_Hh2JM.mp4",jz="/assets/Batman_saying_automate_202509141509_c5i3k_1765344302425-BIcRYBlf.mp4",wz="/assets/image_1765344396968-LZCGcm1n.png",Nz="/assets/image_1765344466082-CdBThSrn.png",kz="/assets/image_1765344549184-BreL77Cp.png",Sz="/assets/image_1765344628737-CTPtKpQP.png",Ow="SocialMonkey",Cz="SocialMonkey",Pz=[{name:"X",icon:gr,color:"text-black dark:text-white"},{name:"YouTube",icon:Sn,color:"text-red-600"},{name:"Instagram",icon:Nn,color:"text-pink-600"},{name:"Facebook",icon:wn,color:"text-blue-600"},{name:"TikTok",icon:Zn,color:"text-black dark:text-white"},{name:"LinkedIn",icon:kn,color:"text-blue-700"},{name:"Reddit",icon:Xn,color:"text-orange-600"},{name:"Snapchat",icon:Cv,color:"text-yellow-400",comingSoon:!0}];function Tz(){const[e,s]=m.useState(!1),[r,n]=m.useState({}),a=m.
632useRef({}),{data:i}=Ee({queryKey:["/api/auth/me"]}),o=d=>r[d]!==!1,l=d=>{const u=a.current[d];if(u){const h=!o(d);u.muted=h,n(p=>({...p,[d]:h}))}};m.useEffect(()=>{document.title="Features - SocialMonkey | AI-Assisted Social Media Scheduling";const d=document.querySelector('meta[name="description"]');return d&&d.setAttribute("content","Discover SocialMonkey's powerful features: AI content generation with approval workflow, scheduling calendar, video creation, and multi-platform publishing."),()=>{document.title="SocialMonkey"}},[]);const c=[{id:"calendar",icon:t.jsx(Ca,{className:"h-10 w-10 text-blue-600"}),title:"Visual Content Calendar",subtitle:"See your entire content strategy at a glance",description:"Our intuitive calendar gives you complete visibility into your scheduled posts across all platforms. See available slots based on your posting frequency preferences, plan weeks ahead, and make quick adjustments to optimize your content distribution.",benefits:["Available time slots based on your posting preferences","Weekly, monthly, and agenda views","Color-coded posts by platform and content type","Quick edit and reschedule with one click","Visualize posting gaps and optimize your schedule"],screenshot:yz},{id:"ai-content",icon:t.jsx(Yh,{className:"h-10 w-10 text-purple-600"}),title:"AI-Assisted Content Generation",subtitle:"Let AI create engaging posts tailored to your brand",description:"Our advanced AI understands your brand voice and creates compelling content automatically. Generate tips, polls, educational content, and engaging posts that resonate with your audience — all without lifting a finger.",benefits:["Brand voice learning and consistency","Multiple content types: tips, polls, quotes, educational","Platform-optimized formatting and hashtags","Customizable prompts per content type","Auto-approval option available when you're ready"],screenshot:vz},{id:"reels",icon:t.jsx(Xr,{className:"h-10 w-10 text-pink-600"}),title:"Reels & Short-Form Video",subtitle:"Automatic video content for Instagram, TikTok, and YouTube Shorts",description:"Create and schedule Reels and short-form videos across all major platforms. Our system automatically detects video content and optimizes it for each platform's requirements, ensuring your videos look perfect everywhere.",benefits:["Auto-detection of Reels-format content","Cross-platform video optimization","Support for Instagram Reels, TikTok, and YouTube Shorts","Video thumbnail selection","Automatic aspect ratio adjustment"],video:bz},{id:"vidmonkey",icon:t.jsx(Et,{className:"h-10 w-10 text-orange-600"}),title:"Dynamic Video Generation with VidMonkey",subtitle:"AI-powered video creation from your prompts",description:"Transform simple text prompts into stunning videos with our VidMonkey integration. Generate professional-quality video content automatically — perfect for product showcases, tutorials, and engaging social content.",benefits:["Text-to-vi
632deo generation","Professional templates and styles","Automatic caption generation","Music and voiceover options","Direct scheduling to all video platforms"],video:jz},{id:"twitter-follow",icon:t.jsx(Hn,{className:"h-10 w-10 text-cyan-600"}),title:"Follow Twitter Users with Fast Replies",subtitle:"Monitor and engage with key accounts in your niche",description:"Build a list of Twitter users you want to engage with and let our AI craft thoughtful, rapid responses to their posts. Be among the first to reply with relevant, engaging content that gets noticed.",benefits:["Monitor unlimited Twitter accounts","AI-crafted personalized replies","Fast response times (beat the crowd)","Tone and style customization","Priority-based engagement queues"],screenshot:wz},{id:"news-replies",icon:t.jsx(n7,{className:"h-10 w-10 text-green-600"}),title:"News-Relevant AI Replies",subtitle:"Stay current with real-time news integration",description:"Our AI monitors breaking news and trending topics relevant to your niche, enabling you to create timely, informed responses. Engage with conversations while they're hot with intelligent, news-aware content.",benefits:["Real-time news monitoring via Tavily","Automatic topic relevance scoring","Trending topic detection","News-informed reply generation","Industry-specific news feeds"],screenshot:Nz},{id:"content-lists",icon:t.jsx(t7,{className:"h-10 w-10 text-indigo-600"}),title:"Curated Content Lists & Dynamic Images",subtitle:"Organize prompts for targeted content generation",description:"Create organized lists of prompts, themes, and topics for your AI to draw from. Each list can target specific platforms and accounts, enabling highly curated content streams with AI-generated images.",benefits:["Multiple prompt lists per account","Platform-specific targeting","AI image generation with FAL.ai","Reference image support for consistent styles","Rotation through prompt variations"],screenshot:kz},{id:"media-library",icon:t.jsx(cy,{className:"h-10 w-10 text-amber-600"}),title:"Centralized Media Library",subtitle:"All your assets in one organized place",description:"Upload, organize, and reuse your media assets across all your scheduled content. Our cloud-based media library with AWS S3 integration ensures your images and videos are always accessible and optimized.",benefits:["Cloud storage for all media","Easy search and filtering","Automatic image optimization","Reuse assets across multiple posts","Bulk upload support"],screenshot:Sz}];return t.jsxs("div",{className:`min-h-screen overflow-x-hidden ${e?"bg-white text-gray-900":"bg-black text-white"} transition-colors duration-300`,children:[t.jsx("header",{className:`sticky top-0 z-50 ${e?"bg-white/95 border-gray-200":"bg-black/95 border-gray-800/50"} backdrop-blur-md border-b transition-colors duration-300`,children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsxs(me,{href:"/",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"flex items-center gap-1.5 sm:gap-2 cursor-pointer flex-shrink-0",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-7 sm:h-10 w-auto"}),t.jsx("span",{className:`font-bold text-sm sm:text-lg ${e?"text-gray-900":"text-white"}`,children:"SocialMonkey"})]}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-3 flex-shrink-0",children:[t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>s(!e),className:`h-8 w-8 sm:h-9 sm:w-9 ${e?"text-gray-700 hover:text-gray-900 hover:bg-gray-200":"text-gray-300 hover:text-white"}`,"data-testid":"button-theme-toggle",children:e?t.jsx(hu,{className:"h-4 w-4 sm:h-5 sm:w-5"}):t.jsx(fu,{className:"h-4 w-4 sm:h-5 sm:w-5"})}),t.jsx(me,{href:"/pricing",onClick:()=>window.scrollTo(0,0),className:"hidden sm:block",children:t.jsx(T,{variant:"ghost",size:"sm",className:`text-xs sm:text-sm ${e?"text-gray-700 hover:text-gray-900":"text-gray-300 hover:text-white"}`,"data-testid":"link-pricing",children:"Pricing"})}),i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:`hidden md:flex items-center gap-2 text-sm ${e?"text-gray-600":"text-gray-400"}`,children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{children:i.username})]}),t.jsx(me,{href:"/",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-[10px] sm:text-sm px-2 sm:px-3","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:`text-[10px] sm:text-sm px-2 sm:px-3 ${e?"text-gray-700 hover:text-gray-900":"text-gray-300 hover:text-white"}`,"data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-[10px] sm:text-sm px-2 sm:px-3 whitespace-nowrap","data-testid":"button-start-trial",children:[t.jsx("span",{className:"hidden sm:inline",children:"Start Your Free Trial"}),t.jsx("span",{className:"sm:hidden",children:"Free Trial"})]})})]})]})]})})}),t.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 sm:py-16",children:[t.jsxs("div",{className:"text-center mb-16 sm:mb-20",children:[t.jsx(xe,{className:`mb-4 ${e?"bg-blue-100 text-blue-800":"bg-blue-900/50 text-blue-300 border-blue-700"}`,children:"Product Features"}),t.jsxs("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-6",children:["Powerful Tools That Set Us"," ",t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600",children:"Apart"})]}),t.jsxs("p",{className:`text-lg sm:text-xl max-w-3xl mx-auto mb-8 ${e?"text-gray-600":"text-gray-300"}`,children:["Discover the features that make ",Ow," the most comprehensive AI-powered social media platform. From intelligent content generation to dynamic video creation, we've built everything you need to dominate social media."]}),t.jsxs("div",{className:"flex flex-wrap justify-center gap-3",children:[t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700","data-testid":"button-hero-cta",children:["Start Free Trial",t.jsx(Rr,{className:"ml-2 h-5 w-5"})]})}),t.jsx(me,{href:"/pricing",children:t.jsx(T,{size:"lg",variant:"outline",className:e?"":"border-gray-700 text-white hover:bg-gray-800","data-testid":"button-view-pricing",children:"View Pricing"})})]})]}),t.jsxs("section",{className:`${e?"bg-gray-50":"bg-gray-900/50"} rounded-2xl p-6 sm:p-8 mb-16 sm:mb-20`,children:[t.jsxs("div",{className:"text-center mb-8",children:[t.jsx(xe,{className:`mb-4 ${e?"bg-green-100 text-green-800":"bg-green-900/50 text-green-300 border-green-700"}`,children:"8 Platforms Supported"}),t.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-4",children:"Post Everywhere Your Audience Lives"}),t.jsx("p",{className:`${e?"text-gray-600":"text-gray-400"}`,children:"One dashboard to manage all your social media accounts"})]}),t.jsx("div",{className:"grid grid-cols-4 md:grid-cols-8 gap-4",children:Pz.map((d,u)=>{const h=d.icon;return t.jsxs("div",{className:`flex flex-col items-center p-4 rounded-xl transition-all hover:scale-105 ${e?"bg-white shadow-sm hover:shadow-md":"bg-gray-800/50 hover:bg-gray-800"}`,children:[t.jsx(h,{className:`h-8 w-8 ${d.color} mb-2`}),t.jsx("span",{className:`text-xs font-medium ${e?"text-gray-700":"text-gray-300"}`,children:d.name}),d.comingSoon&&t.jsx("span",{className:"text-xs font-semibold text-yellow-600",children:"Coming soon"})]},u)})})]}),c.map((d,u)=>t.jsx("section",{id:d.id,className:`mb-16 sm:mb-24 ${u%2===0,""}`,children:t.jsxs("div",{className:`grid lg:grid-cols-2 gap-8 lg:gap-12 items-center ${u%2===1?"lg:grid-flow-dense":""}`,children:[t.jsxs("div",{className:u%2===1?"lg:col-start-2":"",children:[t.jsx("div",{className:`inline-flex items-center justify-center w-16 h-16 rounded-2xl mb-6 ${e?"bg-gray-100":"bg-gray-800"}`,children:d.icon}),t.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-3",children:d.title}),t.jsx("p",{className:`text-lg font-medium mb-4 ${e?"text-blue-600":"text-blue-400"}`,children:d.subtitle}),t.jsx("p",{className:`text-base sm:text-lg mb-6 ${e?"text-gray-600":"text-gray-300"}`,children:d.description}
632),t.jsx("ul",{className:"space-y-3",children:d.benefits.map((h,p)=>t.jsxs("li",{className:"flex items-start gap-3",children:[t.jsx(ot,{className:"h-5 w-5 text-green-500 flex-shrink-0 mt-0.5"}),t.jsx("span",{className:e?"text-gray-700":"text-gray-300",children:h})]},p))})]}),t.jsx("div",{className:u%2===1?"lg:col-start-1 lg:row-start-1":"",children:t.jsxs("div",{className:`relative rounded-2xl overflow-hidden ${e?"bg-gradient-to-br from-gray-100 to-gray-200":"bg-gradient-to-br from-gray-800 to-gray-900"} border ${e?"border-gray-200":"border-gray-700"} shadow-xl`,children:[d.video?t.jsxs("div",{className:"relative",children:[t.jsx("video",{ref:h=>{a.current[d.id]=h},src:d.video,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"w-full h-auto"}),t.jsx("button",{onClick:()=>l(d.id),className:"absolute bottom-4 right-4 bg-black/60 hover:bg-black/80 text-white p-2 rounded-full transition-colors","data-testid":`button-video-mute-toggle-${d.id}`,"aria-label":o(d.id)?"Unmute video":"Mute video",children:o(d.id)?t.jsx(f7,{className:"h-5 w-5"}):t.jsx(p7,{className:"h-5 w-5"})})]}):d.screenshot?t.jsx("img",{src:d.screenshot,alt:`${d.title} screenshot`,className:"w-full h-auto"}):t.jsxs("div",{className:"aspect-video flex flex-col items-center justify-center p-6",children:[t.jsx("div",{className:`w-16 h-16 rounded-xl mb-4 flex items-center justify-center ${e?"bg-gray-200":"bg-gray-700"}`,children:t.jsx(Ft,{className:`h-8 w-8 ${e?"text-gray-400":"text-gray-500"}`})}),t.jsx("p",{className:`text-sm font-medium ${e?"text-gray-500":"text-gray-400"}`,children:"Feature preview coming soon"})]}),t.jsxs("div",{className:"absolute top-4 right-4 flex gap-1.5",children:[t.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500/60"}),t.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500/60"}),t.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500/60"})]})]})})]})},d.id)),t.jsxs("section",{className:`${e?"bg-gradient-to-r from-blue-50 to-purple-50":"bg-gradient-to-r from-blue-950/30 to-purple-950/30"} rounded-2xl p-8 sm:p-12 mb-16`,children:[t.jsxs("div",{className:"text-center mb-10",children:[t.jsxs("h2",{className:"text-2xl sm:text-3xl font-bold mb-4",children:["Why Creators Choose ",Ow]}),t.jsx("p",{className:`${e?"text-gray-600":"text-gray-400"}`,children:"Join thousands of content creators saving time with AI automation"})]}),t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:`text-3xl sm:text-4xl font-bold mb-2 ${e?"text-blue-600":"text-blue-400"}`,children:"10+"}),t.jsx("div",{className:`text-sm ${e?"text-gray-600":"text-gray-400"}`,children:"Hours saved weekly"})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:`text-3xl sm:text-4xl font-bold mb-2 ${e?"text-purple-600":"text-purple-400"}`,children:"8"}),t.jsx("div",{className:`text-sm ${e?"text-gray-600":"text-gray-400"}`,children:"Platforms supported"})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:`text-3xl sm:text-4xl font-bold mb-2 ${e?"text-green-600":"text-green-400"}`,children:"24/7"}),t.jsx("div",{className:`text-sm ${e?"text-gray-600":"text-gray-400"}`,children:"Automated posting"})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:`text-3xl sm:text-4xl font-bold mb-2 ${e?"text-orange-600":"text-orange-400"}`,children:"100%"}),t.jsx("div",{className:`text-sm ${e?"text-gray-600":"text-gray-400"}`,children:"AI-generated content"})]})]})]}),t.jsxs("section",{className:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 rounded-2xl p-8 sm:p-12 text-white text-center",children:[t.jsx(Aa,{className:"h-12 w-12 mx-auto mb-6 text-yellow-300"}),t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-4",children:"Ready to Transform Your Social Media?"}),t.jsx("p",{className:"text-lg text-blue-100 mb-8 max-w-2xl mx-auto",children:"Start your 14-day free trial today. No credit card required. See how AI can revolutionize your content strategy."}),t.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[t.jsx(me,{href:"/auth?tab=register",children:t.jsxs(T,{size:"lg",className:"bg-white text-blue-600 hover:bg-gray-100","data-testid":"button-cta-bottom",children:["Start Your Free Trial",t.jsx(Rr,{className:"ml-2 h-5 w-5"})]})}),t.jsx(me,{href:"/pricing",children:t.jsx(T,{size:"lg",variant:"outline",className:"border-white text-white hover:bg-white/10","data-testid":"button-cta-pricing",children:"Compare Plans"})})]})]})]}),t.jsx("footer",{className:`${e?"bg-gray-50 text-gray-900 border-gray-200":"bg-black text-white border-gray-800/50"} py-8 sm:py-12 border-t transition-colors duration-300`,children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"data-testid":"footer-logo-scroll-top"})}),t.jsx("p",{className:`text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"} mb-3`,children:"AI-powered social media scheduling that saves you time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"X/Twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"YouTube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"LinkedIn",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"TikTok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:`${e?"text-gray-500 hover:text-gray-900":"text-gray-400 hover:text-white"} transition-colors`,"aria-label":"Reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Product"}),t.jsxs("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:[t.jsx("li",{children:t.jsx(me,{href:"/features",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Legal"}),t.jsxs("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Privacy Policy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",onClick:()=>window.scrollTo(0,0),className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"Terms of Service"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:`font-semibold mb-3 sm:mb-4 text-sm sm:text-base ${e?"text-gray-900":"text-white"}`,children:"Connect"}),t.jsx("ul",{className:`space-y-1 sm:space-y-2 text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:t.jsx("li",{children:t.jsx("a",{href:"mailto:[email protected]",className:`${e?"hover:text-gray-900":"hover:text-white"} transition-colors`,children:"[email protected]"})})})]})]}),t.jsx("div",{className:`border-t ${e?"border-gray-200":"border-gray-800"} pt-6 sm:pt-8 text-center text-xs sm:text-sm ${e?"text-gray-500":"text-gray-400"}`,children:t.jsxs("p",{children:["© 2025 ",Cz,". All rights reserved."]})})]})})]})}const Az={name:"Starter",price:{monthly:79.99,yearly:60}
632,originalPrice:{monthly:99.99,yearly:99.99},yearlyDiscount:"25%",description:"Perfect for small businesses and solopreneurs",features:["1 account per platform (up to 8 platforms)","Unlimited post scheduling","AI content generation assistant","VidMonkey video generation ($29/mo value)","Manual review & approve workflow","Basic analytics dashboard","Schedule posts up to 14 days in advance","12 image generations per day for scheduling"]},_z={name:"Professional",price:{monthly:154.99,yearly:120},originalPrice:{monthly:184.99,yearly:184.99},yearlyDiscount:"22%",description:"Ideal for growing businesses and marketing teams",isPopular:!0,baseFeatures:"Everything in Starter, PLUS:",features:["Unlimited accounts per platform","AI builds your entire posting schedule automatically","Smart content rotation for best engagement","Auto-approve or manual review workflows","VidMonkey Pro video generation ($79/mo value)","Advanced analytics & reporting","Schedule posts up to 60 days in advance","Priority support + live chat","20 image generations per day for scheduling"]},Ez={name:"Enterprise",price:"Custom",description:"For large organizations with advanced needs",baseFeatures:"Everything in Professional, PLUS:",features:["We set up and manage everything for you","Account creation and configuration included","Dedicated account manager","Custom AI content strategies","White-glove onboarding","Enterprise-grade support SLA","Custom integrations via API","Unlimited image generations per day for scheduling"],maximizePerformance:!0},Iz={duration:14,availablePlans:["starter"],description:"Try SocialMonkey free for 14 days during our beta. No credit card required.",isBeta:!0},Ba={starter:Az,professional:_z,enterprise:Ez,trialInfo:Iz};var Rv="Switch",[Mz,KQ]=Ws(Rv),[Rz,Fz]=Mz(Rv),t6=m.forwardRef((e,s)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...h}=e,[p,x]=m.useState(null),v=lt(s,j=>x(j)),f=m.useRef(!1),b=p?u||!!p.closest("form"):!0,[y=!1,g]=bn({prop:a,defaultProp:i,onChange:d});return t.jsxs(Rz,{scope:r,checked:y,disabled:l,children:[t.jsx(Ge.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":n6(y),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:v,onClick:Ce(e.onClick,j=>{g(N=>!N),b&&(f.current=j.isPropagationStopped(),f.current||j.stopPropagation())})}),b&&t.jsx(Dz,{control:p,bubbles:!f.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});t6.displayName=Rv;var s6="SwitchThumb",r6=m.forwardRef((e,s)=>{const{__scopeSwitch:r,...n}=e,a=Fz(s6,r);return t.jsx(Ge.span,{"data-state":n6(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:s})});r6.displayName=s6;var Dz=e=>{const{control:s,checked:r,bubbles:n=!0,...a}=e,i=m.useRef(null),o=vf(r),l=lf(s);return m.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==r&&h){const p=new Event("click",{bubbles:n});h.call(c,r),c.dispatchEvent(p)}},[o,r,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function n6(e){return e?"checked":"unchecked"}var a6=t6,Lz=r6;const ul=m.forwardRef(({className:e,...s},r)=>t.jsx(a6,{className:je("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...s,ref:r,children:t.jsx(Lz,{className:je("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")})}));ul.displayName=a6.displayName;var im=e=>e.type==="checkbox",_o=e=>e instanceof Date,mr=e=>e==null;const i6=e=>typeof e=="object";var ks=e=>!mr(e)&&!Array.isArray(e)&&i6(e)&&!_o(e),o6=e=>ks(e)&&e.target?im(e.target)?e.target.checked:e.target.value:e,Oz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,l6=(e,s)=>e.has(Oz(s)),$z=e=>{const s=e.constructor&&e.constructor.prototype;return ks(s)&&s.hasOwnProperty("isPrototypeOf")},Fv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function es(e){let s;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Fv&&(e instanceof Blob||n))&&(r||ks(e)))if(s=r?[]:{},!r&&!$z(e))s=e;else for(const a in e)e.hasOwnProperty(a)&&(s[a]=es(e[a]));else return e;return s}var om=e=>Array.isArray(e)?e.filter(Boolean):[],Kt=e=>e===void 0,Me=(e,s,r)=>{if(!s||!ks(e))return r;const n=om(s.split(/[,[\].]+?/)).reduce((a,i)=>mr(a)?a:a[i],e);return Kt(n)||n===e?Kt(e[s])?r:e[s]:n},Vr=e=>typeof e=="boolean",Dv=e=>
vendor: 11,532 bytes, line 632
632/^\w*$/.test(e),c6=e=>om(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_t=(e,s,r)=>{let n=-1;const a=Dv(s)?[s]:c6(s),i=a.length,o=i-1;for(;++n<i;){const l=a[n];let c=r;if(n!==o){const d=e[l];c=ks(d)||Array.isArray(d)?d:isNaN(+a[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const cp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},hn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$a={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},d6=Ve.createContext(null),lm=()=>Ve.useContext(d6),zz=e=>{const{children:s,...r}=e;return Ve.createElement(d6.Provider,{value:r},s)};var u6=(e,s,r,n=!0)=>{const a={defaultValues:s._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return s._proxyFormState[o]!==hn.all&&(s._proxyFormState[o]=!n||hn.all),r&&(r[o]=!0),e[o]}});return a};function Uz(e){const s=lm(),{control:r=s.control,disabled:n,name:a,exact:i}=e||{},[o,l]=Ve.useState(r._formState),c=Ve.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Ve.useRef(a);return d.current=a,Ve.useEffect(()=>r._subscribe({name:d.current,formState:c.current,exact:i,callback:u=>{!n&&l({...r._formState,...u})}}),[r,n,i]),Ve.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Ve.useMemo(()=>u6(o,r,c.current,!1),[o,r])}var ya=e=>typeof e=="string",m6=(e,s,r,n,a)=>ya(e)?(n&&s.watch.add(e),Me(r,e,a)):Array.isArray(e)?e.map(i=>(n&&s.watch.add(i),Me(r,i))):(n&&(s.watchAll=!0),r);function Vz(e){const s=lm(),{control:r=s.control,name:n,defaultValue:a,disabled:i,exact:o}=e||{},l=Ve.useRef(n),c=Ve.useRef(a);l.current=n,Ve.useEffect(()=>r._subscribe({name:l.current,formState:{values:!0},exact:o,callback:h=>!i&&u(m6(l.current,r._names,h.values||r._formValues,!1,c.current))}),[r,i,o]);const[d,u]=Ve.useState(r._getWatch(n,a));return Ve.useEffect(()=>r._removeUnmounted()),d}function Bz(e){const s=lm(),{name:r,disabled:n,control:a=s.control,shouldUnregister:i}=e,o=l6(a._names.array,r),l=Vz({control:a,name:r,defaultValue:Me(a._formValues,r,Me(a._defaultValues,r,e.defaultValue)),exact:!0}),c=Uz({control:a,name:r,exact:!0}),d=Ve.useRef(e),u=Ve.useRef(a.register(r,{...e.rules,value:l,...Vr(e.disabled)?{disabled:e.disabled}:{}})),h=Ve.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Me(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!Me(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Me(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Me(c.validatingFields,r)},error:{enumerable:!0,get:()=>Me(c.errors,r)}}),[c,r]),p=Ve.useCallback(b=>u.current.onChange({target:{value:o6(b),name:r},type:cp.CHANGE}),[r]),x=Ve.useCallback(()=>u.current.onBlur({target:{value:Me(a._formValues,r),name:r},type:cp.BLUR}),[r,a._formValues]),v=Ve.useCallback(b=>{const y=Me(a._fields,r);y&&b&&(y._f.ref={focus:()=>b.focus(),select:()=>b.select(),setCustomValidity:g=>b.setCustomValidity(g),reportValidity:()=>b.reportValidity()})},[a._fields,r]),f=Ve.useMemo(()=>({name:r,value:l,...Vr(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:p,onBlur:x,ref:v}),[r,n,c.disabled,p,x,v,l]);return Ve.useEffect(()=>{const b=a._options.shouldUnregister||i;a.register(r,{...d.current.rules,...Vr(d.current.disabled)?{disabled:d.current.disabled}:{}});const y=(g,j)=>{const N=Me(a._fields,g);N&&N._f&&(N._f.mount=j)};if(y(r,!0),b){const g=es(Me(a._options.defaultValues,r));_t(a._defaultValues,r,g),Kt(Me(a._formValues,r))&&_t(a._formValues,r,g)}return!o&&a.register(r),()=>{(o?b&&!a._state.action:b)?a.unregister(r):y(r,!1)}},[r,a,o,i]),Ve.useEffect(()=>{a._setDisabledField({disabled:n,name:r})},[n,r,a]),Ve.useMemo(()=>({field:f,formState:c,fieldState:h}),[f,c,h])}const qz=e=>e.render(Bz(e));var h6=(e,s,r,n,a)=>s?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Fr=e=>Array.isArray(e)?e:[e],$w=()=>{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=[]}}},Sy=e=>mr(e)||!i6(e);function Pi(e,s){if(Sy(e)||Sy(s))return e===s;if(_o(e)&&_o(s))return e.getTime()===s.getTime();const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length)return!1;for(const a of r){const i=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const o=s[a];if(_o(i)&&_o(o)||ks(i)&&ks(o)||Array.isArray(i)&&Array.isArray(o)?!Pi(i,o):i!==o)return!1}}return!0}var nr=e=>ks(e)&&!Object.keys(e).length,Lv=e=>e.type==="file",zn=e=>typeof e=="function",dp=e=>{if(!Fv)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},p6=e=>e.type==="select-multiple",Ov=e=>e.type==="radio",Wz=e=>Ov(e)||im(e),Mx=e=>dp(e)&&e.isConnected;function Kz(e,s){const r=s.slice(0,-1).length;let n=0;for(;n<r;)e=Kt(e)?n++:e[s[n++]];return e}function Gz(e){for(const s in e)if(e.hasOwnProperty(s)&&!Kt(e[s]))return!1;return!0}function Ts(e,s){const r=Array.isArray(s)?s:Dv(s)?[s]:c6(s),n=r.length===1?e:Kz(e,r),a=r.length-1,i=r[a];return n&&delete n[i],a!==0&&(ks(n)&&nr(n)||Array.isArray(n)&&Gz(n))&&Ts(e,r.slice(0,-1)),e}var f6=e=>{for(const s in e)if(zn(e[s]))return!0;return!1};function up(e,s={}){const r=Array.isArray(e);if(ks(e)||r)for(const n in e)Array.isArray(e[n])||ks(e[n])&&!f6(e[n])?(s[n]=Array.isArray(e[n])?[]:{},up(e[n],s[n])):mr(e[n])||(s[n]=!0);return s}function x6(e,s,r){const n=Array.isArray(e);if(ks(e)||n)for(const a in e)Array.isArray(e[a])||ks(e[a])&&!f6(e[a])?Kt(s)||Sy(r[a])?r[a]=Array.isArray(e[a])?up(e[a],[]):{...up(e[a])}:x6(e[a],mr(s)?{}:s[a],r[a]):r[a]=!Pi(e[a],s[a]);return r}var bd=(e,s)=>x6(e,s,up(s));const zw={value:!1,isValid:!1},Uw={value:!0,isValid:!0};var g6=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Kt(e[0].attributes.value)?Kt(e[0].value)||e[0].value===""?Uw:{value:e[0].value,isValid:!0}:Uw:zw}return zw},y6=(e,{valueAsNumber:s,valueAsDate:r,setValueAs:n})=>Kt(e)?e:s?e===""?NaN:e&&+e:r&&ya(e)?new Date(e):n?n(e):e;const Vw={isValid:!1,value:null};var v6=e=>Array.isArray(e)?e.reduce((s,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:s,Vw):Vw;function Bw(e){const s=e.ref;return Lv(s)?s.files:Ov(s)?v6(e.refs).value:p6(s)?[...s.selectedOptions].map(({value:r})=>r):im(s)?g6(e.refs).value:y6(Kt(s.value)?e.ref.value:s.value,e)}var Hz=(e,s,r,n)=>{const a={};for(const i of e){const o=Me(s,i);o&&_t(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},mp=e=>e instanceof RegExp,jd=e=>Kt(e)?e:mp(e)?e.source:ks(e)?mp(e.value)?e.value.source:e.value:e,$l=e=>({isOnSubmit:!e||e===hn.onSubmit,isOnBlur:e===hn.onBlur,isOnChange:e===hn.onChange,isOnAll:e===hn.all,isOnTouch:e===hn.onTouched});const qw="AsyncFunction";var Qz=e=>!!e&&!!e.validate&&!!(zn(e.validate)&&e.validate.constructor.name===qw||ks(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===qw)),Yz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Cy=(e,s,r)=>!r&&(s.watchAll||s.watch.has(e)||[...s.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Zl=(e,s,r,n)=>{for(const a of r||Object.keys(e)){const i=Me(e,a);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],a)&&!n)return!0;if(o.ref&&s(o.ref,o.name)&&!n)return!0;if(Zl(l,s))break}else if(ks(l)&&Zl(l,s))break}}};function Ww(e,s,r){const n=Me(e,r);if(n||Dv(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=Me(s,i),l=Me(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};a.pop()}return{name:r}}var Xz=(e,s,r,n)=>{r(e);const{name:a,...i}=e;return nr(i)||Object.keys(i).length>=Object.keys(s).length||Object.keys(i).find(o=>s[o]===(!n||hn.all))},Zz=(e,s,r)=>!e||!s||e===s||Fr(e).some(n=>n&&(r?n===s:n.startsWith(s)||s.startsWith(n))),Jz=(e,s,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(s||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,eU=(e,s)=>!om(Me(e,s)).length&&Ts(e,s),b6=(e,s,r)=>{const n=Fr(Me(e,r));return _t(n,"root",s[r]),_t(e,r,n),e},gh=e=>ya(e);function Kw(e,s,r="validate"){if(gh(e)||Array.isArray(e)&&e.every(gh)||Vr(e)&&!e)return{type:r,message:gh(e)?e:"",ref:s}}var jl=e=>ks(e)&&!mp(e)?e:{value:e,message:""},Py=async(e,s,r,n,a,i)=>{const{ref:o,refs:l,required:c,maxLength:d,minLength:u,min:h,max:p,pattern:x,validate:v,name:f,valueAsNumber:b,mount:y}=e._f,g=Me(r,f);if(!y||s.has(f))return{};const j=l?l[0]:o,N=O=>{a&&j.reportValidity&&(j.setCustomValidity(Vr(O)?"":O||""),j.reportValidity())},w={},S=Ov(o),k=im(o),P=S||k,A=(b||Lv(o))&&Kt(o.value)&&Kt(g)||dp(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,$=h6.bind(null,f,n,w),_=(O,M,C,L=$a.maxLength,W=$a.minLength)=>{const q=O?M:C;w[f]={type:O?L:W,message:q,ref:o,...$(O?L:W,q)}};if(i?!Array.isArray(g)||!g.length:c&&(!P&&(A||mr(g))||Vr(g)&&!g||k&&!g6(l).isValid||S&&!v6(l).isValid)){const{value:O,message:M}=gh(c)?{value:!!c,message:c}:jl(c);if(O&&(w[f]={type:$a.required,message:M,ref:j,...$($a.required,M)},!n))return N(M),w}if(!A&&(!mr(h)||!mr(p))){let O,M;const C=jl(p),L=jl(h);if(!mr(g)&&!isNaN(g)){const W=o.valueAsNumber||g&&+g;mr(C.value)||(O=W>C.value),mr(L.value)||(M=W<L.value)}else{const W=o.valueAsDate||new Date(g),q=E=>new Date(new Date().toDateString()+" "+E),I=o.type=="time",F=o.type=="week";ya(C.value)&&g&&(O=I?q(g)>q(C.value):F?g>C.value:W>new Date(C.value)),ya(L.value)&&g&&(M=I?q(g)<q(L.value):F?g<L.value:W<new Date(L.value))}if((O||M)&&(_(!!O,C.message,L.message,$a.max,$a.min),!n))return N(w[f].message),w}if((d||u)&&!A&&(ya(g)||i&&Array.isArray(g))){const O=jl(d),M=jl(u),C=!mr(O.value)&&g.length>+O.value,L=!mr(M.value)&&g.length<+M.value;if((C||L)&&(_(C,O.message,M.message),!n))return N(w[f].message),w}if(x&&!A&&ya(g)){const{value:O,message:M}=jl(x);if(mp(O)&&!g.match(O)&&(w[f]={type:$a.pattern,message:M,ref:o,...$($a.pattern,M)},!n))return N(M),w}if(v){if(zn(v)){const O=await v(g,r),M=Kw(O,j);if(M&&(w[f]={...M,...$($a.validate,M.message)},!n))return N(M.message),w}else if(ks(v)){let O={};for(const M in v){if(!nr(O)&&!n)break;const C=Kw(await v[M](g,r),j,M);C&&(O={...C,...$(M,C.message)},N(C.message),n&&(w[f]=O))}if(!nr(O)&&(w[f]={ref:j,...O},!n))return w}}return N(!0),w};const tU={mode:hn.onSubmit,reValidateMode:hn.onChange,shouldFocusError:!0};function sU(e={}){let s={...tU,...e},r={submitCount:0,isDirty:!1,isLoading:zn(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const n={};let a=ks(s.defaultValues)||ks(s.values)?es(s.values||s.defaultValues)||{}:{},i=s.shouldUnregister?{}:es(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 h={...u};const p={array:$w(),state:$w()},x=$l(s.mode),v=$l(s.reValidateMode),f=s.criteriaMode===hn.all,b=D=>Z=>{clearTimeout(d),d=setTimeout(D,Z)},y=async D=>{if(!s.disabled&&(u.isValid||h.isValid||D)){const Z=s.resolver?nr((await A()).errors):await _(n,!0);Z!==r.isValid&&p.state.next({isValid:Z})}},g=(D,Z)=>{!s.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((D||Array.from(l.mount)).forEac
vendor: 11,762 bytes, line 632
632h(ie=>{ie&&(Z?_t(r.validatingFields,ie,Z):Ts(r.validatingFields,ie))}),p.state.next({validatingFields:r.validatingFields,isValidating:!nr(r.validatingFields)}))},j=(D,Z=[],ie,Re,Pe=!0,fe=!0)=>{if(Re&&ie&&!s.disabled){if(o.action=!0,fe&&Array.isArray(Me(n,D))){const De=ie(Me(n,D),Re.argA,Re.argB);Pe&&_t(n,D,De)}if(fe&&Array.isArray(Me(r.errors,D))){const De=ie(Me(r.errors,D),Re.argA,Re.argB);Pe&&_t(r.errors,D,De),eU(r.errors,D)}if((u.touchedFields||h.touchedFields)&&fe&&Array.isArray(Me(r.touchedFields,D))){const De=ie(Me(r.touchedFields,D),Re.argA,Re.argB);Pe&&_t(r.touchedFields,D,De)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=bd(a,i)),p.state.next({name:D,isDirty:M(D,Z),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else _t(i,D,Z)},N=(D,Z)=>{_t(r.errors,D,Z),p.state.next({errors:r.errors})},w=D=>{r.errors=D,p.state.next({errors:r.errors,isValid:!1})},S=(D,Z,ie,Re)=>{const Pe=Me(n,D);if(Pe){const fe=Me(i,D,Kt(ie)?Me(a,D):ie);Kt(fe)||Re&&Re.defaultChecked||Z?_t(i,D,Z?fe:Bw(Pe._f)):W(D,fe),o.mount&&y()}},k=(D,Z,ie,Re,Pe)=>{let fe=!1,De=!1;const ce={name:D};if(!s.disabled){if(!ie||Re){(u.isDirty||h.isDirty)&&(De=r.isDirty,r.isDirty=ce.isDirty=M(),fe=De!==ce.isDirty);const $e=Pi(Me(a,D),Z);De=!!Me(r.dirtyFields,D),$e?Ts(r.dirtyFields,D):_t(r.dirtyFields,D,!0),ce.dirtyFields=r.dirtyFields,fe=fe||(u.dirtyFields||h.dirtyFields)&&De!==!$e}if(ie){const $e=Me(r.touchedFields,D);$e||(_t(r.touchedFields,D,ie),ce.touchedFields=r.touchedFields,fe=fe||(u.touchedFields||h.touchedFields)&&$e!==ie)}fe&&Pe&&p.state.next(ce)}return fe?ce:{}},P=(D,Z,ie,Re)=>{const Pe=Me(r.errors,D),fe=(u.isValid||h.isValid)&&Vr(Z)&&r.isValid!==Z;if(s.delayError&&ie?(c=b(()=>N(D,ie)),c(s.delayError)):(clearTimeout(d),c=null,ie?_t(r.errors,D,ie):Ts(r.errors,D)),(ie?!Pi(Pe,ie):Pe)||!nr(Re)||fe){const De={...Re,...fe&&Vr(Z)?{isValid:Z}:{},errors:r.errors,name:D};r={...r,...De},p.state.next(De)}},A=async D=>{g(D,!0);const Z=await s.resolver(i,s.context,Hz(D||l.mount,n,s.criteriaMode,s.shouldUseNativeValidation));return g(D),Z},$=async D=>{const{errors:Z}=await A(D);if(D)for(const ie of D){const Re=Me(Z,ie);Re?_t(r.errors,ie,Re):Ts(r.errors,ie)}else r.errors=Z;return Z},_=async(D,Z,ie={valid:!0})=>{for(const Re in D){const Pe=D[Re];if(Pe){const{_f:fe,...De}=Pe;if(fe){const ce=l.array.has(fe.name),$e=Pe._f&&Qz(Pe._f);$e&&u.validatingFields&&g([Re],!0);const qe=await Py(Pe,l.disabled,i,f,s.shouldUseNativeValidation&&!Z,ce);if($e&&u.validatingFields&&g([Re]),qe[fe.name]&&(ie.valid=!1,Z))break;!Z&&(Me(qe,fe.name)?ce?b6(r.errors,qe,fe.name):_t(r.errors,fe.name,qe[fe.name]):Ts(r.errors,fe.name))}!nr(De)&&await _(De,Z,ie)}}return ie.valid},O=()=>{for(const D of l.unMount){const Z=Me(n,D);Z&&(Z._f.refs?Z._f.refs.every(ie=>!Mx(ie)):!Mx(Z._f.ref))&&X(D)}l.unMount=new Set},M=(D,Z)=>!s.disabled&&(D&&Z&&_t(i,D,Z),!Pi(U(),a)),C=(D,Z,ie)=>m6(D,l,{...o.mount?i:Kt(Z)?a:ya(D)?{[D]:Z}:Z},ie,Z),L=D=>om(Me(o.mount?i:a,D,s.shouldUnregister?Me(a,D,[]):[])),W=(D,Z,ie={})=>{const Re=Me(n,D);let Pe=Z;if(Re){const fe=Re._f;fe&&(!fe.disabled&&_t(i,D,y6(Z,fe)),Pe=dp(fe.ref)&&mr(Z)?"":Z,p6(fe.ref)?[...fe.ref.options].forEach(De=>De.selected=Pe.includes(De.value)):fe.refs?im(fe.ref)?fe.refs.length>1?fe.refs.forEach(De=>(!De.defaultChecked||!De.disabled)&&(De.checked=Array.isArray(Pe)?!!Pe.find(ce=>ce===De.value):Pe===De.value)):fe.refs[0]&&(fe.refs[0].checked=!!Pe):fe.refs.forEach(De=>De.checked=De.value===Pe):Lv(fe.ref)?fe.ref.value="":(fe.ref.value=Pe,fe.ref.type||p.state.next({name:D,values:es(i)})))}(ie.shouldDirty||ie.shouldTouch)&&k(D,Pe,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&ne(D)},q=(D,Z,ie)=>{for(const Re in Z){const Pe=Z[Re],fe=`${D}.${Re}`,De=Me(n,fe);(l.array.has(D)||ks(Pe)||De&&!De._f)&&!_o(Pe)?q(fe,Pe,ie):W(fe,Pe,ie)}},I=(D,Z,ie={})=>{const Re=Me(n,D),Pe=l.array.has(D),fe=es(Z);_t(i,D,fe),Pe?(p.array.next({name:D,values:es(i)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&ie.shouldDirty&&p.state.next({name:D,dirtyFields:bd(a,i),isDirty:M(D,fe)})):Re&&!Re._f&&!mr(fe)?q(D,fe,ie):W(D,fe,ie),Cy(D,l)&&p.state.next({...r}),p.state.next({name:o.mount?D:void 0,values:es(i)})},F=async D=>{o.mount=!0;const Z=D.target;let ie=Z.name,Re=!0;const Pe=Me(n,ie),fe=De=>{Re=Number.isNaN(De)||_o(De)&&isNaN(De.getTime())||Pi(De,Me(i,ie,De))};if(Pe){let De,ce;const $e=Z.type?Bw(Pe._f):o6(D),qe=D.type===cp.BLUR||D.type===cp.FOCUS_OUT,wt=!Yz(Pe._f)&&!s.resolver&&!Me(r.errors,ie)&&!Pe._f.deps||Jz(qe,Me(r.touchedFields,ie),r.isSubmitted,v,x),Y=Cy(ie,l,qe);_t(i,ie,$e),qe?(Pe._f.onBlur&&Pe._f.onBlur(D),c&&c(0)):Pe._f.onChange&&Pe._f.onChange(D);const xt=k(ie,$e,qe),ys=!nr(xt)||Y;if(!qe&&p.state.next({name:ie,type:D.type,values:es(i)}),wt)return(u.isValid||h.isValid)&&(s.mode==="onBlur"?qe&&y():qe||y()),ys&&p.state.next({name:ie,...Y?{}:xt});if(!qe&&Y&&p.state.next({...r}),s.resolver){const{errors:Qs}=await A([ie]);if(fe($e),Re){const Tn=Ww(r.errors,n,ie),An=Ww(Qs,n,Tn.name||ie);De=An.error,ie=An.name,ce=nr(Qs)}}else g([ie],!0),De=(await Py(Pe,l.disabled,i,f,s.shouldUseNativeValidation))[ie],g([ie]),fe($e),Re&&(De?ce=!1:(u.isValid||h.isValid)&&(ce=await _(n,!0)));Re&&(Pe._f.deps&&ne(Pe._f.deps),P(ie,ce,De,xt))}},E=(D,Z)=>{if(Me(r.errors,Z)&&D.focus)return D.focus(),1},ne=async(D,Z={})=>{let ie,Re;const Pe=Fr(D);if(s.resolver){const fe=await $(Kt(D)?D:Pe);ie=nr(fe),Re=D?!Pe.some(De=>Me(fe,De)):ie}else D?(Re=(await Promise.all(Pe.map(async fe=>{const De=Me(n,fe);return await _(De&&De._f?{[fe]:De}:De)}))).every(Boolean),!(!Re&&!r.isValid)&&y()):Re=ie=await _(n);return p.state.next({...!ya(D)||(u.isValid||h.isValid)&&ie!==r.isValid?{}:{name:D},...s.resolver||!D?{isValid:ie}:{},errors:r.errors}),Z.shouldFocus&&!Re&&Zl(n,E,D?Pe:l.mount),Re},U=D=>{const Z={...o.mount?i:a};return Kt(D)?Z:ya(D)?Me(Z,D):D.map(ie=>Me(Z,ie))},Ae=(D,Z)=>({invalid:!!Me((Z||r).errors,D),isDirty:!!Me((Z||r).dirtyFields,D),error:Me((Z||r).errors,D),isValidating:!!Me(r.validatingFields,D),isTouched:!!Me((Z||r).touchedFields,D)}),G=D=>{D&&Fr(D).forEach(Z=>Ts(r.errors,Z)),p.state.next({errors:D?r.errors:{}})},Q=(D,Z,ie)=>{const Re=(Me(n,D,{_f:{}})._f||{}).ref,Pe=Me(r.errors,D)||{},{ref:fe,message:De,type:ce,...$e}=Pe;_t(r.errors,D,{...$e,...Z,ref:Re}),p.state.next({name:D,errors:r.errors,isValid:!1}),ie&&ie.shouldFocus&&Re&&Re.focus&&Re.focus()},ye=(D,Z)=>zn(D)?p.state.subscribe({next:ie=>D(C(void 0,Z),ie)}):C(D,Z,!0),le=D=>p.state.subscribe({next:Z=>{Zz(D.name,Z.name,D.exact)&&Xz(Z,D.formState||u,Mt,D.reRenderRoot)&&D.callback({values:{...i},...r,...Z})}}).unsubscribe,J=D=>(o.mount=!0,h={...h,...D.formState},le({...D,formState:h})),X=(D,Z={})=>{for(const ie of D?Fr(D):l.mount)l.mount.delete(ie),l.array.delete(ie),Z.keepValue||(Ts(n,ie),Ts(i,ie)),!Z.keepError&&Ts(r.errors,ie),!Z.keepDirty&&Ts(r.dirtyFields,ie),!Z.keepTouched&&Ts(r.touchedFields,ie),!Z.keepIsValidating&&Ts(r.validatingFields,ie),!s.shouldUnregister&&!Z.keepDefaultValue&&Ts(a,ie);p.state.next({values:es(i)}),p.state.next({...r,...Z.keepDirty?{isDirty:M()}:{}}),!Z.keepIsValid&&y()},se=({disabled:D,name:Z})=>{(Vr(D)&&o.mount||D||l.disabled.has(Z))&&(D?l.disabled.add(Z):l.disabled.delete(Z))},te=(D,Z={})=>{let ie=Me(n,D);const Re=Vr(Z.disabled)||Vr(s.disabled);return _t(n,D,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:D}},name:D,mount:!0,...Z}}),l.mount.add(D),ie?se({disabled:Vr(Z.disabled)?Z.disabled:s.disabled,name:D}):S(D,!0,Z.value),{...Re?{disabled:Z.disabled||s.disabled}:{},...s.progressive?{required:!!Z.required,min:jd(Z.min),max:jd(Z.max),minLength:jd(Z.minLength),maxLength:jd(Z.maxLength),pattern:jd(Z.pattern)}:{},name:D,onChange:F,onBlur:F,ref:Pe=>{if(Pe){te(D,Z),ie=Me(n,D);const fe=Kt(Pe.value)&&Pe.querySelectorAll&&Pe.querySelectorAll("input,select,textarea")[0]||Pe,De=Wz(fe),ce=ie._f.refs||[];if(De?ce.find($e=>$e===fe):fe===ie._f.ref)return;_t(n,D,{_f:{...ie._f,...De?{refs:[...ce.filter(Mx),fe,...Array.isArray(Me(a,D))?[{}]:[]],ref:{type:fe.type,name:D}}:{ref:fe}}}),S(D,!1,void 0,fe)}else ie=Me(n,D,{}),ie._f&&(ie._f.mount=!1),(s.shouldUnregister||Z.shouldUnregister)&&!(l6(l.array,D)&&o.action)&&l.unMount.add(D)}}},R=()=>s.shouldFocusError&&Zl(n,E,l.mount),K=D=>{Vr(D)&&(p.state.next({disabled:D}),Zl(n,(Z,ie)=>{const Re=Me(n,ie);Re&&(Z.disabled=Re._f.disabled||D,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Pe=>{Pe.disabled=Re._f.disabled||D}))},0,!1))},ve=(D,Z)=>async ie=>{let Re;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let Pe=es(i);if(p.state.next({isSubmitting:!0}),s.resolver){const{errors:fe,values:De}=await A();r.errors=fe,Pe=De}else await _(n);if(l.disabled.size)for(const fe of l.disabled)_t(Pe,fe,void 0);if(Ts(r.errors,"root"),nr(r.errors)){p.state.next({errors:{}});try{await D(Pe,ie)}catch(fe){Re=fe}}else Z&&await Z({...r.errors},ie),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nr(r.errors)&&!Re,submitCount:r.submitCount+1,errors:r.errors}),Re)throw Re},Ie=(D,Z={})=>{Me(n,D)&&(Kt(Z.defaultValue)?I(D,es(Me(a,D))):(I(D,Z.defaultValue),_t(a,D,es(Z.defaultValue))),Z.keepTouched||Ts(r.touchedFields,D),Z.keepDirty||(Ts(r.dirtyFields,D),r.isDirty=Z.defaultValue?M(D,es(Me(a,D))):M()),Z.keepError||(Ts(r.errors,D),u.isValid&&y()),p.state.next({...r}))},dt=(D,Z={})=>{const ie=D?es(D):a,Re=es(ie),Pe=nr(D),fe=Pe?a:Re;if(Z.keepDefaultValues||(a=ie),!Z.keepValues){if(Z.keepDirtyValues){const De=new Set([...l.mount,...Object.keys(bd(a,i))]);for(const ce of Array.from(De))Me(r.dirtyFields,ce)?_t(fe,ce,Me(i,ce)):I(ce,Me(fe,ce))}else{if(Fv&&Kt(D))for(const De of l.mount){const ce=Me(n,De);if(ce&&ce._f){const $e=Array.isArray(ce._f.refs)?ce._f.refs[0]:ce._f.ref;if(dp($e)){const qe=$e.closest("form");if(qe){qe.reset();break}}}}for(const De of l.mount)I(De,Me(fe,De))}i=es(fe),p.array.next({values:{...fe}}),p.state.next({values:{...fe}})}l={mount:Z.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!Z.keepIsValid||!!Z.keepDirtyValues,o.watch=!!s.shouldUnregister,p.state.next({submitCount:Z.keepSubmitCount?r.submitCount:0,isDirty:Pe?!1:Z.keepDirty?r.isDirty:!!(Z.keepDefaultValues&&!Pi(D,a)),isSubmitted:Z.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Pe?{}:Z.keepDirtyValues?Z.keepDefaultValues&&i?bd(a,i):r.dirtyFields:Z.keepDefaultValues&&D?bd(a,D):Z.keepDirty?r.dirtyFields:{},touchedFields:Z.keepTouched?r.touchedFields:{},errors:Z.keepErrors?r.errors:{},isSubmitSuccessful:Z.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},jt=(D,Z)=>dt(zn(D)?D(i):D,Z),Ss=(D,Z={})=>{const ie=Me(n,D),Re=ie&&ie._f;if(Re){const Pe=Re.refs?Re.refs[0]:Re.ref;Pe.focus&&(Pe.focus(),Z.shouldSelect&&zn(Pe.select)&&Pe.select())}},Mt=D=>{r={...r,...D}},Zt={control:{register:te,unregister:X,getFieldState:Ae,handleSubmit:ve,setError:Q,_subscribe:le,_runSchema:A,_getWatch:C,_getDirty:M,_setValid:y,_setFieldArray:j,_setDisabledField:se,_setErrors:w,_getFieldArray:L,_reset:dt,_resetDefaultValues:()=>zn(s.defaultValues)&&s.defaultValues().then(D=>{jt(D,s.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:K,_subjects:p,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(D){o=D},get _defaultValues(){return a},get _names(){return l},set _names(D){l=D},get _formState(){return r},get _options(){return s},set _options(D){s={...s,...D}}},subscribe:J,trigger:ne,register:te,handleSubmit:ve,watch:ye,setValue:I,getValues:U,reset:jt,resetField:Ie,clearErrors:G,unregister:X,setError:Q,setFocus:Ss,getFieldState:Ae};return{...Zt,formControl:Zt}}var vi=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const r=(Math.random()*16+e)%16|0;return(s=="x"?r:r&3|8).toString(16)})},Rx=(e,s,r={})=>
632r.shouldFocus||Kt(r.shouldFocus)?r.focusName||`${e}.${Kt(r.focusIndex)?s:r.focusIndex}.`:"",Fx=(e,s)=>[...e,...Fr(s)],Dx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Lx(e,s,r){return[...e.slice(0,s),...Fr(r),...e.slice(s)]}var Ox=(e,s,r)=>Array.isArray(e)?(Kt(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(s,1)[0]),e):[],$x=(e,s)=>[...Fr(s),...Fr(e)];function rU(e,s){let r=0;const n=[...e];for(const a of s)n.splice(a-r,1),r++;return om(n).length?n:[]}var zx=(e,s)=>Kt(s)?[]:rU(e,Fr(s).sort((r,n)=>r-n)),Ux=(e,s,r)=>{[e[s],e[r]]=[e[r],e[s]]},Gw=(e,s,r)=>(e[s]=r,e);function nU(e){const s=lm(),{control:r=s.control,name:n,keyName:a="id",shouldUnregister:i,rules:o}=e,[l,c]=Ve.useState(r._getFieldArray(n)),d=Ve.useRef(r._getFieldArray(n).map(vi)),u=Ve.useRef(l),h=Ve.useRef(n),p=Ve.useRef(!1);h.current=n,u.current=l,r._names.array.add(n),o&&r.register(n,o),Ve.useEffect(()=>r._subjects.array.subscribe({next:({values:S,name:k})=>{if(k===h.current||!k){const P=Me(S,h.current);Array.isArray(P)&&(c(P),d.current=P.map(vi))}}}).unsubscribe,[r]);const x=Ve.useCallback(S=>{p.current=!0,r._setFieldArray(n,S)},[r,n]),v=(S,k)=>{const P=Fr(es(S)),A=Fx(r._getFieldArray(n),P);r._names.focus=Rx(n,A.length-1,k),d.current=Fx(d.current,P.map(vi)),x(A),c(A),r._setFieldArray(n,A,Fx,{argA:Dx(S)})},f=(S,k)=>{const P=Fr(es(S)),A=$x(r._getFieldArray(n),P);r._names.focus=Rx(n,0,k),d.current=$x(d.current,P.map(vi)),x(A),c(A),r._setFieldArray(n,A,$x,{argA:Dx(S)})},b=S=>{const k=zx(r._getFieldArray(n),S);d.current=zx(d.current,S),x(k),c(k),!Array.isArray(Me(r._fields,n))&&_t(r._fields,n,void 0),r._setFieldArray(n,k,zx,{argA:S})},y=(S,k,P)=>{const A=Fr(es(k)),$=Lx(r._getFieldArray(n),S,A);r._names.focus=Rx(n,S,P),d.current=Lx(d.current,S,A.map(vi)),x($),c($),r._setFieldArray(n,$,Lx,{argA:S,argB:Dx(k)})},g=(S,k)=>{const P=r._getFieldArray(n);Ux(P,S,k),Ux(d.current,S,k),x(P),c(P),r._setFieldArray(n,P,Ux,{argA:S,argB:k},!1)},j=(S,k)=>{const P=r._getFieldArray(n);Ox(P,S,k),Ox(d.current,S,k),x(P),c(P),r._setFieldArray(n,P,Ox,{argA:S,argB:k},!1)},N=(S,k)=>{const P=es(k),A=Gw(r._getFieldArray(n),S,P);d.current=[...A].map(($,_)=>!$||_===S?vi():d.current[_]),x(A),c([...A]),r._setFieldArray(n,A,Gw,{argA:S,argB:P},!0,!1)},w=S=>{const k=Fr(es(S));d.current=k.map(vi),x([...k]),c([...k]),r._setFieldArray(n,[...k],P=>P,{},!0,!1)};return Ve.useEffect(()=>{if(r._state.action=!1,Cy(n,r._names)&&r._subjects.state.next({...r._formState}),p.current&&(!$l(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!$l(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{const k=Me(S.errors,n),P=Me(r._formState.errors,n);(P?!k&&P.type||k&&(P.type!==k.type||P.message!==k.message):k&&k.type)&&(k?_t(r._formState.errors,n,k):Ts(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=Me(r._fields,n);S&&S._f&&!($l(r._options.reValidateMode).isOnSubmit&&$l(r._options.mode).isOnSubmit)&&Py(S,r._names.disabled,r._formValues,r._options.criteriaMode===hn.all,r._options.shouldUseNativeValidation,!0).then(k=>!nr(k)&&r._subjects.state.next({errors:b6(r._formState.errors,k,n)}))}r._subjects.state.next({name:n,values:es(r._formValues)}),r._names.focus&&Zl(r._fields,(S,k)=>{if(r._names.focus&&k.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),p.current=!1},[l,n,r]),Ve.useEffect(()=>(!Me(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(k,P)=>{const A=Me(r._fields,k);A&&A._f&&(A._f.mount=P)};r._options.shouldUnregister||i?r.unregister(n):S(n,!1)}),[n,r,a,i]),{swap:Ve.useCallback(g,[x,n,r]),move:Ve.useCallback(j,[x,n,r]),prepend:Ve.useCallback(f,[x,n,r]),append:Ve.useCallback(v,[x,n,r]),remove:Ve.useCallback(b,[x,n,r]),insert:Ve.useCallback(y,[x,n,r]),update:Ve.useCallback(N,[x,n,r]),replace:Ve.useCallback(w,[x,n,r]),fields:Ve.useMemo(()=>l.map((S,k)=>({...S,[a]:d.current[k]||vi()})),[l,a])}}function Nf(e={}){const s=Ve.useRef(void 0),r=Ve.useRef(void 0),[n,a]=Ve.useState({isDirty:!1,isValidating:!1,isLoading:zn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:zn(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...e.formControl?e.formControl:sU(e),formState:n},e.formControl&&e.defaultValues&&!zn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const i=s.current.control;return i._options=e,Ve.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}
vendor: 4,085 bytes, line 632
632),reRenderRoot:!0}),[i]),Ve.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Ve.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),Ve.useEffect(()=>{e.values&&!Pi(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,a(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),Ve.useEffect(()=>{e.errors&&!nr(e.errors)&&i._setErrors(e.errors)},[e.errors,i]),Ve.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()}),Ve.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[e.shouldUnregister,i]),s.current.formState=u6(n,i),s.current}const Hw=(e,s,r)=>{if(e&&"reportValidity"in e){const n=Me(r,s);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},j6=(e,s)=>{for(const r in s.fields){const n=s.fields[r];n&&n.ref&&"reportValidity"in n.ref?Hw(n.ref,r,e):n.refs&&n.refs.forEach(a=>Hw(a,r,e))}},aU=(e,s)=>{s.shouldUseNativeValidation&&j6(e,s);const r={};for(const n in e){const a=Me(s.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(iU(s.names||Object.keys(e),n)){const o=Object.assign({},Me(r,n));_t(o,"root",i),_t(r,n,o)}else _t(r,n,i)}return r},iU=(e,s)=>e.some(r=>r.startsWith(s+"."));var oU=function(e,s){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[o]={message:l.message,type:l.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),s){var c=r[o].types,d=c&&c[n.code];r[o]=h6(o,s,r,a,d?[].concat(d,n.message):n.message)}e.shift()}return r},kf=function(e,s,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,s)).then(function(d){return i.shouldUseNativeValidation&&j6({},i),{errors:{},values:r.raw?n: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:aU(oU(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Tt;(function(e){e.assertEqual=a=>{};function s(a){}e.assertIs=s;function r(a){throw new Error}e.assertNever=r,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 n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Tt||(Tt={}));var Ty;(function(e){e.mergeShapes=(s,r)=>({...s,...r})})(Ty||(Ty={}));const Ue=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wa=e=>{switch(typeof e){case"undefined":return Ue.undefined;case"string":return Ue.string;case"number":return Number.isNaN(e)?Ue.nan:Ue.number;case"boolean":return Ue.boolean;case"function":return Ue.function;case"bigint":return Ue.bigint;case"symbol":return Ue.symbol;case"object":return Array.isArray(e)?Ue.array:e===null?Ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ue.promise:typeof Map<"u"&&e instanceof Map?Ue.map:typeof Set<"u"&&e instanceof Set?Ue.set:typeof Date<"u"&&e instanceof Date?Ue.date:Ue.object;default:return Ue.unknown}}
vendor: 4,439 bytes, line 632
632,be=Tt.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"]),lU=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Jr extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=s}format(s){const r=s||function(i){return i.message},n={_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)n._errors.push(r(o));else{let l=n,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(r(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return a(this),n}static assert(s){if(!(s instanceof Jr))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(s=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(s(a))}else n.push(s(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Jr.create=e=>new Jr(e);const Oc=(e,s)=>{let r;switch(e.code){case be.invalid_type:e.received===Ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case be.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Tt.jsonStringifyReplacer)}`;break;case be.unrecognized_keys:r=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case be.invalid_union:r="Invalid input";break;case be.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case be.invalid_enum_value:r=`Invalid enum value. Expected ${Tt.joinValues(e.options)}, received '${e.received}'`;break;case be.invalid_arguments:r="Invalid function arguments";break;case be.invalid_return_type:r="Invalid function return type";break;case be.invalid_date:r="Invalid date";break;case be.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Tt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case be.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case be.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case be.custom:r="Invalid input";break;
vendor: 5,050 bytes, line 632
632case be.invalid_intersection_types:r="Intersection results could not be merged";break;case be.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case be.not_finite:r="Number must be finite";break;default:r=s.defaultError,Tt.assertNever(e)}return{message:r}};let w6=Oc;function cU(e){w6=e}function hp(){return w6}const pp=e=>{const{data:s,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:s,defaultError:l}).message;return{...a,path:i,message:l}},dU=[];function Le(e,s){const r=hp(),n=pp({issueData:s,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Oc?void 0:Oc].filter(a=>!!a)});e.common.issues.push(n)}class or{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(s,r){const n=[];for(const a of r){if(a.status==="aborted")return tt;a.status==="dirty"&&s.dirty(),n.push(a.value)}return{status:s.value,value:n}}static async mergeObjectAsync(s,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return or.mergeObjectSync(s,n)}static mergeObjectSync(s,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return tt;i.status==="dirty"&&s.dirty(),o.status==="dirty"&&s.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:s.value,value:n}}}const tt=Object.freeze({status:"aborted"}),zl=e=>({status:"dirty",value:e}),yr=e=>({status:"valid",value:e}),Ay=e=>e.status==="aborted",_y=e=>e.status==="dirty",el=e=>e.status==="valid",ju=e=>typeof Promise<"u"&&e instanceof Promise;var He;(function(e){e.errToObj=s=>typeof s=="string"?{message:s}:s||{},e.toString=s=>typeof s=="string"?s:s==null?void 0:s.message})(He||(He={}));class Ea{constructor(s,r,n,a){this._cachedPath=[],this.parent=s,this.data=r,this._path=n,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 Qw=(e,s)=>{if(el(s))return{success:!0,data:s.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 r=new Jr(e.common.issues);return this._error=r,this._error}}};function ut(e){if(!e)return{};const{errorMap:s,invalid_type_error:r,required_error:n,description:a}=e;if(s&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return s?{errorMap:s,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??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:a}}class pt{get description(){return this._def.description}_getType(s){return Wa(s.data)}_getOrReturnCtx(s,r){return r||{common:s.parent.common,data:s.data,parsedType:Wa(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}_processInputParams(s){return{status:new or,ctx:{common:s.parent.common,data:s.data,parsedType:Wa(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}}_parseSync(s){const r=this._parse(s);if(ju(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(s){const r=this._parse(s);return Promise.resolve(r)}parse(s,r){const n=this.safeParse(s,r);if(n.success)return n.data;throw n.error}safeParse(s,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Wa(s)},a=this._parseSync({data:s,path:n.path,parent:n});return Qw(n,a)}"~validate"(s){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Wa(s)};if(!this["~standard"].async)try{const i=this._parseSync({data:s,path:[],parent:r});return el(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:s,path:[],parent:r}).then(i=>el(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(s,r){const n=await this.safeParseAsync(s,r);if(n.success)return n.data;throw n.error}async safeParseAsync(s,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Wa(s)},a=this._parse({data:s,path:n.path,parent:n}),i=await(ju(a)?a:Promise.resolve(a));return Qw(n,i)}refine(s,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}
vendor: 6,204 bytes, line 632
632:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=s(a),l=()=>i.addIssue({code:be.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(s,r){return this._refinement((n,a)=>s(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(s){return new Jn({schema:this,typeName:st.ZodEffects,effect:{type:"refinement",refinement:s}})}superRefine(s){return this._refinement(s)}constructor(s){this.spa=this.safeParseAsync,this._def=s,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:r=>this["~validate"](r)}}optional(){return Sa.create(this,this._def)}nullable(){return no.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wn.create(this)}promise(){return zc.create(this,this._def)}or(s){return Su.create([this,s],this._def)}and(s){return Cu.create(this,s,this._def)}transform(s){return new Jn({...ut(this._def),schema:this,typeName:st.ZodEffects,effect:{type:"transform",transform:s}})}default(s){const r=typeof s=="function"?s:()=>s;return new Eu({...ut(this._def),innerType:this,defaultValue:r,typeName:st.ZodDefault})}brand(){return new $v({typeName:st.ZodBranded,type:this,...ut(this._def)})}catch(s){const r=typeof s=="function"?s:()=>s;return new Iu({...ut(this._def),innerType:this,catchValue:r,typeName:st.ZodCatch})}describe(s){const r=this.constructor;return new r({...this._def,description:s})}pipe(s){return cm.create(this,s)}readonly(){return Mu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uU=/^c[^\s-]{8,}$/i,mU=/^[0-9a-z]+$/,hU=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pU=/^[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,fU=/^[a-z0-9_-]{21}$/i,xU=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,gU=/^[-+]?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)?)??$/,yU=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vx;const bU=/^(?:(?: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])$/,jU=/^(?:(?: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])$/,wU=/^(([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]))$/,NU=/^(([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])$/,kU=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SU=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,N6="((\\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])))",CU=new RegExp(`^${N6}$`);function k6(e){let s="[0-5]\\d";e.precision?s=`${s}\\.\\d{${e.precision}}`:e.precision==null&&(s=`${s}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${s})${r}`}function PU(e){return new RegExp(`^${k6(e)}$`)}function S6(e){let s=`${N6}T${k6(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),s=`${s}(${r.join("|")})`,new RegExp(`^${s}$`)}function TU(e,s){return!!((s==="v4"||!s)&&bU.test(e)||(s==="v6"||!s)&&wU.test(e))}function AU(e,s){if(!xU.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||s&&a.alg!==s)}catch{return!1}}function _U(e,s){return!!((s==="v4"||!s)&&jU.test(e)||(s==="v6"||!s)&&NU.test(e))}class Un extends pt{_parse(s){if(this._def.coerce&&(s.data=String(s.data)),this._getType(s)!==Ue.string){const i=this._getOrReturnCtx(s);
vendor: 19,317 bytes, line 632
632return Le(i,{code:be.invalid_type,expected:Ue.string,received:i.parsedType}),tt}const n=new or;let a;for(const i of this._def.checks)if(i.kind==="min")s.data.length<i.value&&(a=this._getOrReturnCtx(s,a),Le(a,{code:be.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")s.data.length>i.value&&(a=this._getOrReturnCtx(s,a),Le(a,{code:be.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=s.data.length>i.value,l=s.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(s,a),o?Le(a,{code:be.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Le(a,{code:be.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")yU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"email",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Vx||(Vx=new RegExp(vU,"u")),Vx.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"emoji",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")pU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"uuid",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")fU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"nanoid",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")uU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"cuid",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")mU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"cuid2",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")hU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"ulid",code:be.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(s.data)}catch{a=this._getOrReturnCtx(s,a),Le(a,{validation:"url",code:be.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"regex",code:be.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?s.data=s.data.trim():i.kind==="includes"?s.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?s.data=s.data.toLowerCase():i.kind==="toUpperCase"?s.data=s.data.toUpperCase():i.kind==="startsWith"?s.data.startsWith(i.value)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?s.data.endsWith(i.value)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?S6(i).test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?CU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?PU(i).test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{code:be.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?gU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"duration",code:be.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?TU(s.data,i.version)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"ip",code:be.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?AU(s.data,i.alg)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"jwt",code:be.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?_U(s.data,i.version)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"cidr",code:be.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?kU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"base64",code:be.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?SU.test(s.data)||(a=this._getOrReturnCtx(s,a),Le(a,{validation:"base64url",code:be.invalid_string,message:i.message}),n.dirty()):Tt.assertNever(i);return{status:n.value,value:s.data}}_regex(s,r,n){return this.refinement(a=>s.test(a),{validation:r,code:be.invalid_string,...He.errToObj(n)})}_addCheck(s){return new Un({...this._def,checks:[...this._def.checks,s]})}email(s){return this._addCheck({kind:"email",...He.errToObj(s)})}url(s){return this._addCheck({kind:"url",...He.errToObj(s)})}emoji(s){return this._addCheck({kind:"emoji",...He.errToObj(s)})}uuid(s){return this._addCheck({kind:"uuid",...He.errToObj(s)})}nanoid(s){return this._addCheck({kind:"nanoid",...He.errToObj(s)})}cuid(s){return this._addCheck({kind:"cuid",...He.errToObj(s)})}cuid2(s){return this._addCheck({kind:"cuid2",...He.errToObj(s)})}ulid(s){return this._addCheck({kind:"ulid",...He.errToObj(s)})}base64(s){return this._addCheck({kind:"base64",...He.errToObj(s)})}base64url(s){return this._addCheck({kind:"base64url",...He.errToObj(s)})}jwt(s){return this._addCheck({kind:"jwt",...He.errToObj(s)})}ip(s){return this._addCheck({kind:"ip",...He.errToObj(s)})}cidr(s){return this._addCheck({kind:"cidr",...He.errToObj(s)})}datetime(s){return typeof s=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:s}):this._addCheck({kind:"datetime",precision:typeof(s==null?void 0:s.precision)>"u"?null:s==null?void 0:s.precision,offset:(s==null?void 0:s.offset)??!1,local:(s==null?void 0:s.local)??!1,...He.errToObj(s==null?void 0:s.message)})}date(s){return this._addCheck({kind:"date",message:s})}time(s){return typeof s=="string"?this._addCheck({kind:"time",precision:null,message:s}):this._addCheck({kind:"time",precision:typeof(s==null?void 0:s.precision)>"u"?null:s==null?void 0:s.precision,...He.errToObj(s==null?void 0:s.message)})}duration(s){return this._addCheck({kind:"duration",...He.errToObj(s)})}regex(s,r){return this._addCheck({kind:"regex",regex:s,...He.errToObj(r)})}includes(s,r){return this._addCheck({kind:"includes",value:s,position:r==null?void 0:r.position,...He.errToObj(r==null?void 0:r.message)})}startsWith(s,r){return this._addCheck({kind:"startsWith",value:s,...He.errToObj(r)})}endsWith(s,r){return this._addCheck({kind:"endsWith",value:s,...He.errToObj(r)})}min(s,r){return this._addCheck({kind:"min",value:s,...He.errToObj(r)})}max(s,r){return this._addCheck({kind:"max",value:s,...He.errToObj(r)})}length(s,r){return this._addCheck({kind:"length",value:s,...He.errToObj(r)})}nonempty(s){return this.min(1,He.errToObj(s))}trim(){return new Un({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Un({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Un({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(s=>s.kind==="datetime")}get isDate(){return!!this._def.checks.find(s=>s.kind==="date")}get isTime(){return!!this._def.checks.find(s=>s.kind==="time")}get isDuration(){return!!this._def.checks.find(s=>s.kind==="duration")}get isEmail(){return!!this._def.checks.find(s=>s.kind==="email")}get isURL(){return!!this._def.checks.find(s=>s.kind==="url")}get isEmoji(){return!!this._def.checks.find(s=>s.kind==="emoji")}get isUUID(){return!!this._def.checks.find(s=>s.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(s=>s.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(s=>s.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(s=>s.kind==="cuid2")}get isULID(){return!!this._def.checks.find(s=>s.kind==="ulid")}get isIP(){return!!this._def.checks.find(s=>s.kind==="ip")}get isCIDR(){return!!this._def.checks.find(s=>s.kind==="cidr")}get isBase64(){return!!this._def.checks.find(s=>s.kind==="base64")}get isBase64url(){return!!this._def.checks.find(s=>s.kind==="base64url")}get minLength(){let s=null;for(const r of this._def.checks)r.kind==="min"&&(s===null||r.value>s)&&(s=r.value);return s}get maxLength(){let s=null;for(const r of this._def.checks)r.kind==="max"&&(s===null||r.value<s)&&(s=r.value);return s}}Un.create=e=>new Un({checks:[],typeName:st.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ut(e)});function EU(e,s){const r=(e.toString().split(".")[1]||"").length,n=(s.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(s.toFixed(a).replace(".",""));return i%o/10**a}class to extends pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(s){if(this._def.coerce&&(s.data=Number(s.data)),this._getType(s)!==Ue.number){const i=this._getOrReturnCtx(s);return Le(i,{code:be.invalid_type,expected:Ue.number,received:i.parsedType}),tt}let n;const a=new or;for(const i of this._def.checks)i.kind==="int"?Tt.isInteger(s.data)||(n=this._getOrReturnCtx(s,n),Le(n,{code:be.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?s.data<i.value:s.data<=i.value)&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?s.data>i.value:s.data>=i.value)&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?EU(s.data,i.value)!==0&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(s.data)||(n=this._getOrReturnCtx(s,n),Le(n,{code:be.not_finite,message:i.message}),a.dirty()):Tt.assertNever(i);return{status:a.value,value:s.data}}gte(s,r){return this.setLimit("min",s,!0,He.toString(r))}gt(s,r){return this.setLimit("min",s,!1,He.toString(r))}lte(s,r){return this.setLimit("max",s,!0,He.toString(r))}lt(s,r){return this.setLimit("max",s,!1,He.toString(r))}setLimit(s,r,n,a){return new to({...this._def,checks:[...this._def.checks,{kind:s,value:r,inclusive:n,message:He.toString(a)}]})}_addCheck(s){return new to({...this._def,checks:[...this._def.checks,s]})}int(s){return this._addCheck({kind:"int",message:He.toString(s)})}positive(s){return this._addCheck({kind:"min",value:0,inclusive:!1,message:He.toString(s)})}negative(s){return this._addCheck({kind:"max",value:0,inclusive:!1,message:He.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:0,inclusive:!0,message:He.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:0,inclusive:!0,message:He.toString(s)})}multipleOf(s,r){return this._addCheck({kind:"multipleOf",value:s,message:He.toString(r)})}finite(s){return this._addCheck({kind:"finite",message:He.toString(s)})}safe(s){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:He.toString(s)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:He.toString(s)})}get minValue(){let s=null;for(const r of this._def.checks)r.kind==="min"&&(s===null||r.value>s)&&(s=r.value);return s}get maxValue(){let s=null;for(const r of this._def.checks)r.kind==="max"&&(s===null||r.value<s)&&(s=r.value);return s}get isInt(){return!!this._def.checks.find(s=>s.kind==="int"||s.kind==="multipleOf"&&Tt.isInteger(s.value))}get isFinite(){let s=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(s===null||n.value<s)&&(s=n.value)}return Number.isFinite(r)&&Number.isFinite(s)}}to.create=e=>new to({checks:[],typeName:st.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ut(e)});class so extends pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(s){if(this._def.coerce)try{s.data=BigInt(s.data)}catch{return this._getInvalidInput(s)}if(this._getType(s)!==Ue.bigint)return this._getInvalidInput(s);let n;const a=new or;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?s.data<i.value:s.data<=i.value)&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?s.data>i.value:s.data>=i.value)&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?s.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(s,n),Le(n,{code:be.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Tt.assertNever(i);return{status:a.value,value:s.data}}_getInvalidInput(s){const r=this._getOrReturnCtx(s);return Le(r,{code:be.invalid_type,expected:Ue.bigint,received:r.parsedType}),tt}gte(s,r){return this.setLimit("min",s,!0,He.toString(r))}gt(s,r){return this.setLimit("min",s,!1,He.toString(r))}lte(s,r){return this.setLimit("max",s,!0,He.toString(r))}lt(s,r){return this.setLimit("max",s,!1,He.toString(r))}setLimit(s,r,n,a){return new so({...this._def,checks:[...this._def.checks,{kind:s,value:r,inclusive:n,message:He.toString(a)}]})}_addCheck(s){return new so({...this._def,checks:[...this._def.checks,s]})}positive(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:He.toString(s)})}negative(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:He.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:He.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:He.toString(s)})}multipleOf(s,r){return this._addCheck({kind:"multipleOf",value:s,message:He.toString(r)})}get minValue(){let s=null;for(const r of this._def.checks)r.kind==="min"&&(s===null||r.value>s)&&(s=r.value);return s}get maxValue(){let s=null;for(const r of this._def.checks)r.kind==="max"&&(s===null||r.value<s)&&(s=r.value);return s}}so.create=e=>new so({checks:[],typeName:st.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ut(e)});class wu extends pt{_parse(s){if(this._def.coerce&&(s.data=!!s.data),this._getType(s)!==Ue.boolean){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.boolean,received:n.parsedType}),tt}return yr(s.data)}}wu.create=e=>new wu({typeName:st.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ut(e)});class tl extends pt{_parse(s){if(this._def.coerce&&(s.data=new Date(s.data)),this._getType(s)!==Ue.date){const i=this._getOrReturnCtx(s);return Le(i,{code:be.invalid_type,expected:Ue.date,received:i.parsedType}),tt}if(Number.isNaN(s.data.getTime())){const i=this._getOrReturnCtx(s);return Le(i,{code:be.invalid_date}),tt}const n=new or;let a;for(const i of this._def.checks)i.kind==="min"?s.data.getTime()<i.value&&(a=this._getOrReturnCtx(s,a),Le(a,{code:be.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?s.data.getTime()>i.value&&(a=this._getOrReturnCtx(s,a),Le(a,{code:be.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Tt.assertNever(i);return{status:n.value,value:new Date(s.data.getTime())}}_addCheck(s){return new tl({...this._def,checks:[...this._def.checks,s]})}min(s,r){return this._addCheck({kind:"min",value:s.getTime(),message:He.toString(r)})}max(s,r){return this._addCheck({kind:"max",value:s.getTime(),message:He.toString(r)})}get minDate(){let s=null;for(const r of this._def.checks)r.kind==="min"&&(s===null||r.value>s)&&(s=r.value);return s!=null?new Date(s):null}get maxDate(){let s=null;for(const r of this._def.checks)r.kind==="max"&&(s===null||r.value<s)&&(s=r.value);return s!=null?new Date(s):null}}tl.create=e=>new tl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:st.ZodDate,...ut(e)});class fp extends pt{_parse(s){if(this._getType(s)!==Ue.symbol){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.symbol,received:n.parsedType}),tt}return yr(s.data)}}fp.create=e=>new fp({typeName:st.ZodSymbol,...ut(e)});class Nu extends pt{_parse(s){if(this._getType(s)!==Ue.undefined){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.undefined,received:n.parsedType}),tt}return yr(s.data)}}Nu.create=e=>new Nu({typeName:st.ZodUndefined,...ut(e)});class ku extends pt{_parse(s){if(this._getType(s)!==Ue.null){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.null,received:n.parsedType}),tt}return yr(s.data)}}ku.create=e=>new ku({typeName:st.ZodNull,...ut(e)});class $c extends pt{constructor(){super(...arguments),this._any=!0}_parse(s){return yr(s.data)}}$c.create=e=>new $c({typeName:st.ZodAny,...ut(e)});class zo extends pt{constructor(){super(...arguments),this._unknown=!0}_parse(s){return yr(s.data)}}zo.create=e=>new zo({typeName:st.ZodUnknown,...ut(e)});class oi extends pt{_parse(s){const r=this._getOrReturnCtx(s);return Le(r,{code:be.invalid_type,expected:Ue.never,received:r.parsedType}),tt}}oi.create=e=>new oi({typeName:st.ZodNever,...ut(e)});class xp extends pt{_parse(s){if(this._getType(s)!==Ue.undefined){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.void,received:n.parsedType}),tt}return yr(s.data)}}xp.create=e=>new xp({typeName:st.ZodVoid,...ut(e)});class Wn extends pt{_parse(s){const{ctx:r,status:n}=this._processInputParams(s),a=this._def;if(r.parsedType!==Ue.array)return Le(r,{code:be.invalid_type,expected:Ue.array,received:r.parsedType}),tt;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(o||l)&&(Le(r,{code:o?be.too_big:be.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}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(Le(r,{code:be.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(Le(r,{code:be.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>a.type._parseAsync(new Ea(r,o,r.path,l)))).then(o=>or.mergeArray(n,o));const i=[...r.data].map((o,l)=>a.type._parseSync(new Ea(r,o,r.path,l)));return or.mergeArray(n,i)}get element(){return this._def.type}min(s,r){return new Wn({...this._def,minLength:{value:s,message:He.toString(r)}})}max(s,r){return new Wn({...this._def,maxLength:{value:s,message:He.toString(r)}})}length(s,r){return new Wn({...this._def,exactLength:{value:s,message:He.toString(r)}})}nonempty(s){return this.min(1,s)}}Wn.create=(e,s)=>new Wn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:st.ZodArray,...ut(s)});function kl(e){if(e instanceof ss){const s={};for(const r in e.shape){const n=e.shape[r];s[r]=Sa.create(kl(n))}return new ss({...e._def,shape:()=>s})}else return e instanceof Wn?new Wn({...e._def,type:kl(e.element)}):e instanceof Sa?Sa.create(kl(e.unwrap())):e instanceof no?no.create(kl(e.unwrap())):e instanceof Ia?Ia.create(e.items.map(s=>kl(s))):e}class ss extends pt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;
vendor: 4,147 bytes, line 632
632const s=this._def.shape(),r=Tt.objectKeys(s);return this._cached={shape:s,keys:r},this._cached}_parse(s){if(this._getType(s)!==Ue.object){const d=this._getOrReturnCtx(s);return Le(d,{code:be.invalid_type,expected:Ue.object,received:d.parsedType}),tt}const{status:n,ctx:a}=this._processInputParams(s),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof oi&&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],h=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ea(a,h,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof oi){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&&(Le(a,{code:be.unrecognized_keys,keys:l}),n.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 h=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ea(a,h,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,p=await u.value;d.push({key:h,value:p,alwaysSet:u.alwaysSet})}return d}).then(d=>or.mergeObjectSync(n,d)):or.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(s){return He.errToObj,new ss({...this._def,unknownKeys:"strict",...s!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:He.errToObj(s).message??a}:{message:a}}}:{}})}strip(){return new ss({...this._def,unknownKeys:"strip"})}passthrough(){return new ss({...this._def,unknownKeys:"passthrough"})}extend(s){return new ss({...this._def,shape:()=>({...this._def.shape(),...s})})}merge(s){return new ss({unknownKeys:s._def.unknownKeys,catchall:s._def.catchall,shape:()=>({...this._def.shape(),...s._def.shape()}),typeName:st.ZodObject})}setKey(s,r){return this.augment({[s]:r})}catchall(s){return new ss({...this._def,catchall:s})}pick(s){const r={};for(const n of Tt.objectKeys(s))s[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ss({...this._def,shape:()=>r})}omit(s){const r={};for(const n of Tt.objectKeys(this.shape))s[n]||(r[n]=this.shape[n]);return new ss({...this._def,shape:()=>r})}deepPartial(){return kl(this)}partial(s){const r={};for(const n of Tt.objectKeys(this.shape)){const a=this.shape[n];s&&!s[n]?r[n]=a:r[n]=a.optional()}return new ss({...this._def,shape:()=>r})}required(s){const r={};for(const n of Tt.objectKeys(this.shape))if(s&&!s[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Sa;)i=i._def.innerType;r[n]=i}return new ss({...this._def,shape:()=>r})}keyof(){return C6(Tt.objectKeys(this.shape))}}ss.create=(e,s)=>new ss({shape:()=>e,unknownKeys:"strip",catchall:oi.create(),typeName:st.ZodObject,...ut(s)});ss.strictCreate=(e,s)=>new ss({shape:()=>e,unknownKeys:"strict",catchall:oi.create(),typeName:st.ZodObject,...ut(s)});ss.lazycreate=(e,s)=>new ss({shape:e,unknownKeys:"strip",catchall:oi.create(),typeName:st.ZodObject,...ut(s)});class Su extends pt{_parse(s){const{ctx:r}=this._processInputParams(s),n=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 r.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Jr(l.ctx.common.issues));return Le(r,{code:be.invalid_union,unionErrors:o}),tt}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.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 r.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Jr(c));
vendor: 8,771 bytes, line 632
632return Le(r,{code:be.invalid_union,unionErrors:l}),tt}}get options(){return this._def.options}}Su.create=(e,s)=>new Su({options:e,typeName:st.ZodUnion,...ut(s)});const Ua=e=>e instanceof Tu?Ua(e.schema):e instanceof Jn?Ua(e.innerType()):e instanceof Au?[e.value]:e instanceof ro?e.options:e instanceof _u?Tt.objectValues(e.enum):e instanceof Eu?Ua(e._def.innerType):e instanceof Nu?[void 0]:e instanceof ku?[null]:e instanceof Sa?[void 0,...Ua(e.unwrap())]:e instanceof no?[null,...Ua(e.unwrap())]:e instanceof $v||e instanceof Mu?Ua(e.unwrap()):e instanceof Iu?Ua(e._def.innerType):[];class Sf extends pt{_parse(s){const{ctx:r}=this._processInputParams(s);if(r.parsedType!==Ue.object)return Le(r,{code:be.invalid_type,expected:Ue.object,received:r.parsedType}),tt;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(Le(r,{code:be.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),tt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(s,r,n){const a=new Map;for(const i of r){const o=Ua(i.shape[s]);if(!o.length)throw new Error(`A discriminator value for key \`${s}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(s)} has duplicate value ${String(l)}`);a.set(l,i)}}return new Sf({typeName:st.ZodDiscriminatedUnion,discriminator:s,options:r,optionsMap:a,...ut(n)})}}function Ey(e,s){const r=Wa(e),n=Wa(s);if(e===s)return{valid:!0,data:e};if(r===Ue.object&&n===Ue.object){const a=Tt.objectKeys(s),i=Tt.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...s};for(const l of i){const c=Ey(e[l],s[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===Ue.array&&n===Ue.array){if(e.length!==s.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=s[i],c=Ey(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===Ue.date&&n===Ue.date&&+e==+s?{valid:!0,data:e}:{valid:!1}}class Cu extends pt{_parse(s){const{status:r,ctx:n}=this._processInputParams(s),a=(i,o)=>{if(Ay(i)||Ay(o))return tt;const l=Ey(i.value,o.value);return l.valid?((_y(i)||_y(o))&&r.dirty(),{status:r.value,value:l.data}):(Le(n,{code:be.invalid_intersection_types}),tt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Cu.create=(e,s,r)=>new Cu({left:e,right:s,typeName:st.ZodIntersection,...ut(r)});class Ia extends pt{_parse(s){const{status:r,ctx:n}=this._processInputParams(s);if(n.parsedType!==Ue.array)return Le(n,{code:be.invalid_type,expected:Ue.array,received:n.parsedType}),tt;if(n.data.length<this._def.items.length)return Le(n,{code:be.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&n.data.length>this._def.items.length&&(Le(n,{code:be.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ea(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>or.mergeArray(r,o)):or.mergeArray(r,i)}get items(){return this._def.items}rest(s){return new Ia({...this._def,rest:s})}}Ia.create=(e,s)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ia({items:e,typeName:st.ZodTuple,rest:null,...ut(s)})};class Pu extends pt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){const{status:r,ctx:n}=this._processInputParams(s);if(n.parsedType!==Ue.object)return Le(n,{code:be.invalid_type,expected:Ue.object,received:n.parsedType}),tt;const a=[],i=this._def.keyType,o=this._def.valueType;for(const l in n.data)a.push({key:i._parse(new Ea(n,l,n.path,l)),value:o._parse(new Ea(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?or.mergeObjectAsync(r,a):or.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(s,r,n){return r instanceof pt?new Pu({keyType:s,valueType:r,typeName:st.ZodRecord,...ut(n)}):new Pu({keyType:Un.create(),valueType:s,typeName:st.ZodRecord,...ut(r)})}}class gp extends pt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){const{status:r,ctx:n}=this._processInputParams(s);if(n.parsedType!==Ue.map)return Le(n,{code:be.invalid_type,expected:Ue.map,received:n.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,c],d)=>({key:a._parse(new Ea(n,l,n.path,[d,"key"])),value:i._parse(new Ea(n,c,n.path,[d,"value"]))}));if(n.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 tt;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),l.set(d.value,u.value)}return{status:r.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 tt;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),l.set(d.value,u.value)}return{status:r.value,value:l}}}}gp.create=(e,s,r)=>new gp({valueType:s,keyType:e,typeName:st.ZodMap,...ut(r)});class sl extends pt{_parse(s){const{status:r,ctx:n}=this._processInputParams(s);if(n.parsedType!==Ue.set)return Le(n,{code:be.invalid_type,expected:Ue.set,received:n.parsedType}),tt;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(Le(n,{code:be.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(Le(n,{code:be.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const d=new Set;for(const u of c){if(u.status==="aborted")return tt;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const l=[...n.data.values()].map((c,d)=>i._parse(new Ea(n,c,n.path,d)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(s,r){return new sl({...this._def,minSize:{value:s,message:He.toString(r)}})}max(s,r){return new sl({...this._def,maxSize:{value:s,message:He.toString(r)}})}size(s,r){return this.min(s,r).max(s,r)}nonempty(s){return this.min(1,s)}}sl.create=(e,s)=>new sl({valueType:e,minSize:null,maxSize:null,typeName:st.ZodSet,...ut(s)});class Jl extends pt{constructor(){super(...arguments),this.validate=this.implement}_parse(s){const{ctx:r}=this._processInputParams(s);if(r.parsedType!==Ue.function)return Le(r,{code:be.invalid_type,expected:Ue.function,received:r.parsedType}),tt;function n(l,c){return pp({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hp(),Oc].filter(d=>!!d),issueData:{code:be.invalid_arguments,argumentsError:c}})}function a(l,c){return pp({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hp(),Oc].filter(d=>!!d),issueData:{code:be.invalid_return_type,returnTypeError:c}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof zc){const l=this;return yr(async function(...c){const d=new Jr([]),u=await l._def.args.parseAsync(c,i).catch(x=>{throw d.addIssue(n(c,x)),d}),h=await Reflect.apply(o,this,u);return await l._def.returns._def.type.parseAsync(h,i).catch(x=>{throw d.addIssue(a(h,x)),d})})}else{const l=this;return yr(function(...c){const d=l._def.args.safeParse(c,i);if(!d.success)throw new Jr([n(c,d.error)]);const u=Reflect.apply(o,this,d.data),h=l._def.returns.safeParse(u,i);if(!h.success)throw new Jr([a(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...s){return new Jl({...this._def,args:Ia.create(s).rest(zo.create())})}returns(s){return new Jl({...this._def,returns:s})}implement(s){return this.parse(s)}strictImplement(s){return this.parse(s)}static create(s,r,n){return new Jl({args:s||Ia.create([]).rest(zo.create()),returns:r||zo.create(),typeName:st.ZodFunction,...ut(n)})}}class Tu extends pt{get schema(){return this._def.getter()}_parse(s){const{ctx:r}=this._processInputParams(s);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Tu.create=(e,s)=>new Tu({getter:e,typeName:st.ZodLazy,...ut(s)});class Au extends pt{_parse(s){if(s.data!==this._def.value){const r=this._getOrReturnCtx(s);
vendor: 4,664 bytes, line 632
632return Le(r,{received:r.data,code:be.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:s.data}}get value(){return this._def.value}}Au.create=(e,s)=>new Au({value:e,typeName:st.ZodLiteral,...ut(s)});function C6(e,s){return new ro({values:e,typeName:st.ZodEnum,...ut(s)})}class ro extends pt{_parse(s){if(typeof s.data!="string"){const r=this._getOrReturnCtx(s),n=this._def.values;return Le(r,{expected:Tt.joinValues(n),received:r.parsedType,code:be.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(s.data)){const r=this._getOrReturnCtx(s),n=this._def.values;return Le(r,{received:r.data,code:be.invalid_enum_value,options:n}),tt}return yr(s.data)}get options(){return this._def.values}get enum(){const s={};for(const r of this._def.values)s[r]=r;return s}get Values(){const s={};for(const r of this._def.values)s[r]=r;return s}get Enum(){const s={};for(const r of this._def.values)s[r]=r;return s}extract(s,r=this._def){return ro.create(s,{...this._def,...r})}exclude(s,r=this._def){return ro.create(this.options.filter(n=>!s.includes(n)),{...this._def,...r})}}ro.create=C6;class _u extends pt{_parse(s){const r=Tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(s);if(n.parsedType!==Ue.string&&n.parsedType!==Ue.number){const a=Tt.objectValues(r);return Le(n,{expected:Tt.joinValues(a),received:n.parsedType,code:be.invalid_type}),tt}if(this._cache||(this._cache=new Set(Tt.getValidEnumValues(this._def.values))),!this._cache.has(s.data)){const a=Tt.objectValues(r);return Le(n,{received:n.data,code:be.invalid_enum_value,options:a}),tt}return yr(s.data)}get enum(){return this._def.values}}_u.create=(e,s)=>new _u({values:e,typeName:st.ZodNativeEnum,...ut(s)});class zc extends pt{unwrap(){return this._def.type}_parse(s){const{ctx:r}=this._processInputParams(s);if(r.parsedType!==Ue.promise&&r.common.async===!1)return Le(r,{code:be.invalid_type,expected:Ue.promise,received:r.parsedType}),tt;const n=r.parsedType===Ue.promise?r.data:Promise.resolve(r.data);return yr(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}zc.create=(e,s)=>new zc({type:e,typeName:st.ZodPromise,...ut(s)});class Jn extends pt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===st.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(s){const{status:r,ctx:n}=this._processInputParams(s),a=this._def.effect||null,i={addIssue:o=>{Le(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return tt;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?tt:c.status==="dirty"||r.value==="dirty"?zl(c.value):c});{if(r.value==="aborted")return tt;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?tt:l.status==="dirty"||r.value==="dirty"?zl(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(n.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(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?tt:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?tt:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!el(o))return tt;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:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>el(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:r.value,value:l})):tt);Tt.assertNever(a)}}Jn.create=(e,s,r)=>new Jn({schema:e,typeName:st.ZodEffects,effect:s,...ut(r)});Jn.createWithPreprocess=(e,s,r)=>new Jn({schema:s,effect:{type:"preprocess",transform:e},typeName:st.ZodEffects,...ut(r)});class Sa extends pt{_parse(s){return this._getType(s)===Ue.undefined?yr(void 0):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}Sa.create=(e,s)=>new Sa({innerType:e,typeName:st.ZodOptional,...ut(s)});
vendor: 6,120 bytes, line 632
632class no extends pt{_parse(s){return this._getType(s)===Ue.null?yr(null):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}no.create=(e,s)=>new no({innerType:e,typeName:st.ZodNullable,...ut(s)});class Eu extends pt{_parse(s){const{ctx:r}=this._processInputParams(s);let n=r.data;return r.parsedType===Ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Eu.create=(e,s)=>new Eu({innerType:e,typeName:st.ZodDefault,defaultValue:typeof s.default=="function"?s.default:()=>s.default,...ut(s)});class Iu extends pt{_parse(s){const{ctx:r}=this._processInputParams(s),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ju(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Jr(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Jr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Iu.create=(e,s)=>new Iu({innerType:e,typeName:st.ZodCatch,catchValue:typeof s.catch=="function"?s.catch:()=>s.catch,...ut(s)});class yp extends pt{_parse(s){if(this._getType(s)!==Ue.nan){const n=this._getOrReturnCtx(s);return Le(n,{code:be.invalid_type,expected:Ue.nan,received:n.parsedType}),tt}return{status:"valid",value:s.data}}}yp.create=e=>new yp({typeName:st.ZodNaN,...ut(e)});const IU=Symbol("zod_brand");class $v extends pt{_parse(s){const{ctx:r}=this._processInputParams(s),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class cm extends pt{_parse(s){const{status:r,ctx:n}=this._processInputParams(s);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?tt:i.status==="dirty"?(r.dirty(),zl(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?tt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(s,r){return new cm({in:s,out:r,typeName:st.ZodPipeline})}}class Mu extends pt{_parse(s){const r=this._def.innerType._parse(s),n=a=>(el(a)&&(a.value=Object.freeze(a.value)),a);return ju(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Mu.create=(e,s)=>new Mu({innerType:e,typeName:st.ZodReadonly,...ut(s)});function Yw(e,s){const r=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function zv(e,s={},r){return e?$c.create().superRefine((n,a)=>{const i=e(n);if(i instanceof Promise)return i.then(o=>{if(!o){const l=Yw(s,n),c=l.fatal??r??!0;a.addIssue({code:"custom",...l,fatal:c})}});if(!i){const o=Yw(s,n),l=o.fatal??r??!0;a.addIssue({code:"custom",...o,fatal:l})}}):$c.create()}const MU={object:ss.lazycreate};var st;(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"})(st||(st={}));const RU=(e,s={message:`Input not instance of ${e.name}`})=>zv(r=>r instanceof e,s),Pt=Un.create,dm=to.create,FU=yp.create,DU=so.create,$i=wu.create,LU=tl.create,OU=fp.create,$U=Nu.create,P6=ku.create,Uc=$c.create,zU=zo.create,UU=oi.create,VU=xp.create,Cf=Wn.create,Cn=ss.create,BU=ss.strictCreate,Uv=Su.create,qU=Sf.create,WU=Cu.create,KU=Ia.create,T6=Pu.create,GU=gp.create,HU=sl.create,QU=Jl.create,YU=Tu.create,XU=Au.create,Vv=ro.create,ZU=_u.create,JU=zc.create,Xw=Jn.create,eV=Sa.create,tV=no.create,sV=Jn.createWithPreprocess,rV=cm.create,nV=()=>Pt().optional(),aV=()=>dm().optional(),iV=()=>$i().optional(),oV={string:e=>Un.create({...e,coerce:!0}),number:e=>to.create({...e,coerce:!0}),boolean:e=>wu.create({...e,coerce:!0}),bigint:e=>so.create({...e,coerce:!0}),date:e=>tl.create({...e,coerce:!0})},lV=tt,cV=Object.freeze(Object.defineProperty({__proto__:null,BRAND:IU,DIRTY:zl,EMPTY_PATH:dU,INVALID:tt,NEVER:lV,OK:yr,ParseStatus:or,Schema:pt,ZodAny:$c,ZodArray:Wn,ZodBigInt:so,ZodBoolean:wu,ZodBranded:$v,ZodCatch:Iu,ZodDate:tl,ZodDefault:Eu,ZodDiscriminatedUnion:Sf,ZodEffects:Jn,ZodEnum:ro,ZodError:Jr,get ZodFirstPartyTypeKind(){return st},ZodFunction:Jl,ZodIntersection:Cu,ZodIssueCode:be,ZodLazy:Tu,ZodLiteral:Au,ZodMap:gp,ZodNaN:yp,ZodNativeEnum:_u,ZodNever:oi,ZodNull:ku,ZodNullable:no,ZodNumber:to,ZodObject:ss,ZodOptional:Sa,ZodParsedType:Ue,ZodPipeline:cm,ZodPromise:zc,ZodReadonly:Mu,ZodRecord:Pu,ZodSchema:pt,ZodSet:sl,ZodString:Un,ZodSymbol:fp,ZodTransformer:Jn,ZodTuple:Ia,ZodType:pt,ZodUndefined:Nu,ZodUnion:Su,ZodUnknown:zo,ZodVoid:xp,addIssueToContext:Le,any:Uc,array:Cf,bigint:DU,boolean:$i,coerce:oV,custom:zv,date:LU,datetimeRegex:S6,defaultErrorMap:Oc,discriminatedUnion:qU,effect:Xw,enum:Vv,function:QU,getErrorMap:hp,getParsedType:Wa,instanceof:RU,intersection:WU,isAborted:Ay,isAsync:ju,isDirty:_y,isValid:el,late:MU,lazy:YU,literal:XU,makeIssue:pp,map:GU,nan:FU,nativeEnum:ZU,never:UU,null:P6,nullable:tV,number:dm,object:Cn,get objectUtil(){return Ty},oboolean:iV,onumber:aV,optional:eV,ostring:nV,pipeline:rV,preprocess:sV,promise:JU,quotelessJson:lU,record:T6,set:HU,setErrorMap:cU,strictObject:BU,string:Pt,symbol
632:OU,transformer:Xw,tuple:KU,undefined:$U,union:Uv,unknown:zU,get util(){return Tt},void:VU},Symbol.toStringTag,{value:"Module"})),Bv=zz,A6=m.createContext({}),Br=({...e})=>t.jsx(A6.Provider,{value:{name:e.name},children:t.jsx(qz,{...e})}),Pf=()=>{const e=m.useContext(A6),s=m.useContext(_6),{getFieldState:r,formState:n}=lm(),a=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},_6=m.createContext({}),Ar=m.forwardRef(({className:e,...s},r)=>{const n=m.useId();return t.jsx(_6.Provider,{value:{id:n},children:t.jsx("div",{ref:r,className:je("space-y-2",e),...s})})});Ar.displayName="FormItem";const _r=m.forwardRef(({className:e,...s},r)=>{const{error:n,formItemId:a}=Pf();return t.jsx(ae,{ref:r,className:je(n&&"text-destructive",e),htmlFor:a,...s})});_r.displayName="FormLabel";const Wr=m.forwardRef(({...e},s)=>{const{error:r,formItemId:n,formDescriptionId:a,formMessageId:i}=Pf();return t.jsx(Xp,{ref:s,id:n,"aria-describedby":r?`${a} ${i}`:`${a}`,"aria-invalid":!!r,...e})});Wr.displayName="FormControl";const dV=m.forwardRef(({className:e,...s},r)=>{const{formDescriptionId:n}=Pf();return t.jsx("p",{ref:r,id:n,className:je("text-sm text-muted-foreground",e),...s})});dV.displayName="FormDescription";const Kr=m.forwardRef(({className:e,children:s,...r},n)=>{const{error:a,formMessageId:i}=Pf(),o=a?String((a==null?void 0:a.message)??""):s;return o?t.jsx("p",{ref:n,id:i,className:je("text-sm font-medium text-destructive",e),...r,children:o}):null});Kr.displayName="FormMessage";const uV=[{id:"multi-account",label:"Multi-account management"},{id:"team-collaboration",label:"Team collaboration"},{id:"custom-integrations",label:"Custom integrations"},{id:"advanced-analytics",label:"Advanced analytics"},{id:"dedicated-support",label:"Dedicated support"},{id:"sla-guarantees",label:"SLA guarantees"},{id:"custom-ai-training",label:"Custom AI training"},{id:"white-label",label:"White-label solution"}],mV=Cn({email:Pt().email("Please enter a valid email address"),contactMethod:Pt().min(1,"Please select a contact method"),contactValue:Pt().optional(),interestAreas:Cf(Pt()).min(1,"Please select at least one area of interest"),existingTools:Pt().optional(),message:Pt().optional()}).refine(e=>e.contactMethod==="phone"?e.contactValue&&e.contactValue.trim().length>0:!0,{message:"Phone number is required when phone is selected as contact method",path:["contactValue"]});function hV({open:e,onOpenChange:s,userEmail:r}){const{toast:n}=bt(),a=Nf({resolver:kf(mV),defaultValues:{email:r||"",contactMethod:"email",contactValue:"",interestAreas:[],existingTools:"",message:""}}),i=ke({mutationFn:async c=>(await Fe("POST","/api/enterprise-inquiries",c)).json(),onSuccess:()=>{n({title:"Request Submitted",description:"We'll be in touch soon to discuss your enterprise needs."}),a.reset(),s(!1)},onError:c=>{n({title:"Submission Failed",description:c.message||"Please try again later.",variant:"destructive"})}}),o=c=>{i.mutate(c)},l=a.watch("contactMethod");return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsx(gs,{"data-testid":"text-dialog-title",children:"Request Enterprise Information"}),t.jsx(Ns,{children:"Tell us about your needs and we'll get back to you with a customized solution."})]}),t.jsx(Bv,{...a,children:t.jsxs("form",{onSubmit:a.handleSubmit(o),className:"space-y-4",children:[t.jsx(Br,{control:a.control,name:"email",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Email"}),t.jsx(Wr,{children:t.jsx(Ke,{placeholder:"[email protected]",...c,"data-testid":"input-email"})}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:a.control,name:"contactMethod",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Preferred Contact Method"}),t.jsxs(Nt,{onValueChange:c.onChange,defaultValue:c.value,children:[t.jsx(Wr,{children:t.jsx(gt,{"data-testid":"select-contact-method",children:t.jsx(kt,{placeholder:"Select contact method"})})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"email",children:"Email"}),t.jsx(Se,{value:"phone",children:"Phone Call"}),t.jsx(Se,{value:"video_call",children:"Video Call"})]})]}),t.jsx(Kr,{})]})}),l==="phone"&&t.jsx(Br,{control:a.control,name:"contactValue",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Phone Number"}),t.jsx(Wr,{children:t.jsx(Ke,{placeholder:"+1 (555) 123-4567",...c,"data-testid":"input-phone"})}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:a.control,name:"interestAreas",render:()=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"What aspects of Enterprise are you most interested in?"}),t.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:uV.map(c=>t.jsx(Br,{control:a.control,name:"interestAreas",render:({field:d})=>{var u;return t.jsxs(Ar,{className:"flex items-center space-x-2 space-y-0",children:[t.jsx(Wr,{children:t.jsx(ka,{checked:(u=d.value)==null?void 0:u.includes(c.id),onCheckedChange:h=>{var p;return h?d.onChange([...d.value,c.id]):d.onChange((p=d.value)==null?void 0:p.filter(x=>x!==c.id))},"data-testid":`checkbox-interest-${c.id}`})}),t.jsx(_r,{className:"text-sm font-normal cursor-pointer",children:c.label})]},c.id)}},c.id))}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:a.control,name:"existingTools",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"What tools do you currently use for social media management?"}),t.jsx(Wr,{children:t.jsx(os,{placeholder:"e.g., Hootsuite, Buffer, Sprout Social, etc.",className:"resize-none",...c,"data-testid":"textarea-existing-tools"})}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:a.control,name:"message",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Anything else you'd like us to know?"}),t.jsx(Wr,{children:t.jsx(os,{placeholder:"Tell us about your specific needs, team size, or any questions...",className:"resize-none",...c,"data-testid":"textarea-message"})}),t.jsx(Kr,{})]})}),t.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[t.jsx(T,{type:"button",variant:"outline",onClick:()=>s(!1),"data-testid":"button-cancel",children:"Cancel"}),t.jsx(T,{type:"submit",disabled:i.isPending,"data-testid":"button-submit",children:i.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting..."]}):"Submit Request"})]})]})})]})})}
632const pV=["trial","starter","professional","enterprise"],Zw=e=>{const s=e.toLowerCase(),r=pV.indexOf(s);return r===-1?0:r};function E6({userId:e,membershipLevel:s,userEmail:r,onUpgrade:n,onDowngrade:a}){const[i,o]=m.useState(!1),[l,c]=m.useState("monthly"),d=!!e,u=(s==null?void 0:s.toLowerCase())||"trial",h=Zw(u),p=w=>({Starter:t.jsx(Hn,{className:"h-6 w-6"}),Professional:t.jsx(BD,{className:"h-6 w-6"}),Enterprise:t.jsx(tf,{className:"h-6 w-6"})})[w]||t.jsx(Hn,{className:"h-6 w-6"}),x=[{...Ba.starter,tier:"starter",icon:p(Ba.starter.name),cta:"Start Free Beta Trial"},{...Ba.professional,tier:"professional",icon:p(Ba.professional.name),cta:"Get Started"},{...Ba.enterprise,tier:"enterprise",icon:p(Ba.enterprise.name),cta:"Contact Sales"}],v=.7,f=w=>typeof w.price=="string"?w.price:l==="yearly"?`$${w.price.yearly}`:`$${(w.price.monthly*(1-v)).toFixed(2)}`,b=w=>typeof w.price=="string"?null:l==="yearly"&&w.originalPrice?`$${w.originalPrice.yearly}`:l==="monthly"?`$${w.price.monthly}`:null,y=w=>typeof w.price=="string"?"pricing":l==="monthly"?"/1st mo":"/mo",g=w=>typeof w.price=="string"?null:l==="yearly"?`$${w.price.yearly*12} billed annually`:`Renews at $${w.price.monthly}/mo`,j=w=>{const S=Zw(w.tier),k=w.tier===u;return w.tier==="enterprise"?{text:"Contact Sales",variant:"default",icon:t.jsx(Ta,{className:"h-4 w-4 mr-2"}),action:"enterprise"}:d?k?{text:"Current Level",variant:"secondary",icon:t.jsx(Xt,{className:"h-4 w-4 mr-2"}),action:"current"}:S>h?{text:"Upgrade",variant:"default",icon:t.jsx(zD,{className:"h-4 w-4 mr-2"}),action:"upgrade"}:{text:"Downgrade",variant:"outline",icon:t.jsx($D,{className:"h-4 w-4 mr-2"}),action:"downgrade"}:{text:w.cta,variant:"default",icon:t.jsx(Et,{className:"h-4 w-4 mr-2"}),action:"signup"}},N=(w,S)=>{S==="enterprise"?o(!0):S==="upgrade"&&n?n(w.tier,l):S==="downgrade"&&a&&a(w.tier)};return t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:t.jsxs(xe,{className:"bg-gradient-to-r from-purple-600 to-blue-600 text-white px-4 py-2 text-sm",children:[t.jsx(Et,{className:"h-4 w-4 mr-2"}),"BETA - Limited Time Pricing"]})}),t.jsxs("div",{className:"flex items-center justify-center gap-4 mb-8",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ae,{htmlFor:"billing-toggle",className:`text-sm font-medium cursor-pointer ${l==="monthly"?"text-foreground":"text-muted-foreground"}`,children:"Monthly"})}),t.jsx(ul,{id:"billing-toggle",checked:l==="yearly",onCheckedChange:w=>c(w?"yearly":"monthly"),"data-testid":"switch-billing-interval"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ae,{htmlFor:"billing-toggle",className:`text-sm font-medium cursor-pointer ${l==="yearly"?"text-foreground":"text-muted-foreground"}`,children:"Yearly"}),l==="monthly"?t.jsx(xe,{className:"bg-gradient-to-r from-orange-500 to-red-500 text-white text-xs px-2 py-0.5 animate-pulse",children:"70% OFF 1st Month!"}):t.jsx(xe,{className:"bg-green-600 text-white text-xs px-2 py-0.5",children:"Save up to 25%"})]})]}),t.jsx("div",{className:"grid md:grid-cols-3 gap-6 sm:gap-8 mb-8",children:x.map((w,S)=>{const k=j(w),P=k.action==="current",A=b(w),$=g(w);return t.jsxs(re,{className:`relative h-full ${w.isPopular?"border-purple-500 border-2 shadow-lg":"border-gray-200 dark:border-gray-700"} ${P?"ring-2 ring-primary ring-offset-2 dark:ring-offset-gray-900":""} dark:bg-gray-800`,"data-testid":`card-pricing-${w.tier}`,children:[w.isPopular&&t.jsx("div",{className:"absolute -top-4 left-1/2 transform -translate-x-1/2",children:t.jsx(xe,{className:"bg-gradient-to-r from-purple-600 to-blue-600 text-white px-4 py-1",children:"Most popular"})}),P&&d&&t.jsx("div",{className:"absolute -top-4 right-4",children:t.jsxs(xe,{className:"bg-primary text-primary-foreground px-3 py-1",children:[t.jsx(Xt,{className:"h-3 w-3 mr-1"}),"Current"]})}),A&&w.yearlyDiscount&&t.jsx("div",{className:"absolute -top-3 left-4",children:t.jsx(xe,{className:"bg-green-600 text-white px-2 py-0.5 text-xs",children:"BETA PRICING"})}),t.jsxs(he,{className:"text-center pb-2 pt-6",children:[t.jsx(pe,{className:"text-xl sm:text-2xl dark:text-white mb-2",children:w.name}),t.jsxs("div",{className:"text-center mb-2",children:[A&&t.jsx("span",{className:"text-lg text-gray-400 line-through mr-2",children:A}),t.jsx("span",{className:"text-3xl sm:text-4xl font-bold text-gray-900 dark:text-white",children:f(w)}),t.jsx("span",{className:"text-gray-600 dark:text-gray-400 ml-1 text-sm sm:text-base",children:y(w)})]}),$&&t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:$}),d?t.jsxs(T,{className:`w-full ${P?"bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-300 cursor-default":w.isPopular?"bg-gray-900 hover:bg-gray-800 text-white dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100":"bg-gray-900 hover:bg-gray-800 text-white dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600"}`,disabled:P,onClick:()=>N(w,k.action),"data-testid":`button-${w.tier}-${k.action}`,children:[k.icon,k.text]}):t.jsx(T,{className:`w-full ${w.isPopular?"bg-gray-900 hover:bg-gray-800 text-white dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100":"bg-gray-900 hover:bg-gray-800 text-white dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600"}`,asChild:!0,"data-testid":`button-${w.tier}-signup`,children:t.jsxs(me,{href:"/auth",children:[k.icon,w.cta]})})]}),t.jsx(de,{className:"space-y-4",children:t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 dark:text-white text-sm sm:text-base",children:w.baseFeatures||"Features included:"}),t.jsx("ul",{className:"space-y-2 sm:space-y-3",children:w.features.map((_,O)=>t.jsxs("li",{className:"flex items-start text-xs sm:text-sm",children:[t.jsx(Xt,{className:"h-4 w-4 text-green-500 mr-2 flex-shrink-0 mt-0.5"}),t.jsx("span",{className:"dark:text-gray-300",children:_})]},O))})]})})]},S)})}),t.jsx("div",{className:"text-center mb-4",children:t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(Et,{className:"h-4 w-4 inline mr-1"}),t.jsxs("strong",{children:[Ba.trialInfo.duration,"-day free beta access"]})," with Starter features. No credit card required."]})}),t.jsx("p",{className:"text-center text-xs text-gray-500 dark:text-gray-400",children:"*Prices displayed in USD. Limited-time beta pricing - rates may increase after launch."}),t.jsx(hV,{open:i,onOpenChange:o,userEmail:r})]})}const fV="SocialMonkey";function xV(){const{data:e}=Ee({queryKey:["/api/auth/me"]});return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsx(me,{href:"/",children:t.jsxs("div",{className:"flex items-center gap-2 cursor-pointer","data-testid":"link-home",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-gray-900 dark:text-white",children:"SocialMonkey"})]})}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{children:e.username})]}),t.jsx(me,{href:"/",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Your Free Trial"})})]})})]})})}),t.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsx("div",{className:"text-center mb-8",children:t.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6",children:"Manage all of your social media in one place."})}),t.jsx("div",{className:"mb-16",children:t.jsx(E6,{})}),t.jsxs("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 rounded-2xl p-8 text-center text-white mb-12",children:[t.jsx(gP,{className:"h-12 w-12 mx-auto mb-4"}),t.jsxs("h2",{className:"text-2xl font-bold mb-4",children:["Start Your ",Ba.trialInfo.duration,"-Day Free Trial"]}),t.jsx("p",{className:"text-lg text-blue-100 mb-6",children:Ba.trialInfo.description}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"lg",className:"bg-white text-blue-600 hover:bg-gray-100","data-testid":"button-trial-cta",children:"Start Your Free Trial"})})]}),t.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-2xl p-8 mb-16",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"Frequently Asked Questions"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"Everything you need to know about our pricing"})]}),t.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-4xl mx-auto",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"What happens after my free trial?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"After your 30-day free trial, you can choose to continue with any of our paid plans or cancel anytime. No hidden fees or commitments."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"Can I change plans anytime?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"Yes, you can upgrade or downgrade your plan at any time. Changes take effect immediately, and we'll prorate any billing differences."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"What platforms do you support?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"We support YouTube, Twitter/X, Instagram, Facebook, TikTok, LinkedIn, and Reddit. All platforms are available on Professional and Enterprise plans."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"Is there a free trial?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"Yes! All new users get a 30-day free trial of the Starter or Professional plan. No credit card required."})]})]})]}),t.jsxs("div",{className:"text-center bg-gradient-to-r from-blue-600 to-purple-600 rounded-2xl p-12 text-white",children:[t.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Ready to Get Started?"}),t.jsx("p",{className:"text-xl text-blue-100 mb-8 max-w-2xl mx-auto",children:"Join thousands of businesses managing their social media with AI-assisted scheduling."}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"lg",className:"bg-white text-blue-600 hover:bg-gray-100 text-lg px-12 py-4","data-testid":"button-cta-bottom",children:"Start Your Free Trial"})})]})]}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12 mt-16",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400 mb-3",children:"AI-powered social media scheduling that saves you time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"X/Twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"YouTube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"LinkedIn",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"TikTok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/features",className:"hover:text-white transition-colors",children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",className:"hover:text-white transition-colors",children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",className:"hover:text-white transition-colors",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Support"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Help Center"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Contact"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Documentation"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",fV,". All rights reserved."]})})]})})]})}const gV="SocialMonkey";function yV(){const{toast:e}=bt(),[s,r]=m.useState(!1),{data:n}=Ee({queryKey:["/api/auth/me"]}),a=n!=null&&n.referralCode?`${window.location.origin}/auth?referral=${n.referralCode}`:null,i=()=>{a&&(navigator.clipboard.writeText(a),r(!0),e({title:"Copied!",description:"Referral link copied to clipboard"}),setTimeout(()=>r(!1),2e3))},o=[{icon:t.jsx(GD,{className:"h-8 w-8 text-green-600"}),title:"Earn 25% Commission",description:"Get 25% recurring commission for every paying customer you refer",highlight:"Cash back via PayPal every month"},{icon:t.jsx(Hn,{className:"h-8 w-8 text-blue-600"}),title:"Your Friends Save 25%",description:"Everyone who uses your referral link gets 25% off their first month",highlight:"Win-win for everyone"},{icon:t.jsx(rf,{classNa
632me:"h-8 w-8 text-purple-600"}),title:"No Limits",description:"Refer unlimited users and build passive income with no caps",highlight:"The more you share, the more you earn"}],l=[{number:1,title:"Start Your Free Trial",description:"Create your free SocialMonkey account to get your unique referral link"},{number:2,title:"Share Your Link",description:"Share your referral link with friends, followers, or your community"},{number:3,title:"Earn Commission",description:"Get 25% recurring commission via PayPal when they become paying customers"}];return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsx(me,{href:"/",children:t.jsxs("div",{className:"flex items-center gap-2 cursor-pointer","data-testid":"link-home",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-gray-900 dark:text-white",children:"SocialMonkey"})]})}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{children:n.username})]}),t.jsx(me,{href:"/",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Your Free Trial"})})]})})]})})}),t.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsxs("div",{className:"text-center mb-16",children:[t.jsx(xe,{className:"mb-4 bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",children:"Referral Program"}),t.jsxs("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6",children:["Share SocialMonkey, ",t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600",children:"Earn Commission"})]}),t.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-300 max-w-3xl mx-auto mb-8",children:"Earn 25% recurring commission for every customer you refer. Help your friends manage their social media with AI-assisted scheduling while building passive income with cash back via PayPal."})]}),n&&a&&t.jsxs("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 rounded-2xl p-8 text-center text-white mb-12",children:[t.jsx(c7,{className:"h-12 w-12 mx-auto mb-4"}),t.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Your Referral Link"}),t.jsx("p",{className:"text-lg text-blue-100 mb-6",children:"Share this link to earn 25% commission on all referrals"}),t.jsxs("div",{className:"flex gap-2 max-w-2xl mx-auto",children:[t.jsx(Ke,{value:a,readOnly:!0,className:"bg-white text-gray-900 text-center font-mono text-sm","data-testid":"input-referral-link"}),t.jsx(T,{onClick:i,className:"bg-white text-blue-600 hover:bg-gray-100","data-testid":"button-copy-link",children:s?t.jsx(ot,{className:"h-5 w-5"}):t.jsx(xa,{className:"h-5 w-5"})})]})]}),t.jsx("div",{className:"grid md:grid-cols-3 gap-8 mb-16",children:o.map((c,d)=>t.jsxs(re,{className:"text-center hover:shadow-lg transition-shadow dark:bg-gray-800",children:[t.jsxs(he,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:c.icon}),t.jsx(pe,{className:"text-xl dark:text-white",children:c.title}),t.jsx(Ze,{className:"text-gray-600 dark:text-gray-300 mt-2",children:c.description})]}),t.jsx(de,{children:t.jsx(xe,{className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",children:c.highlight})})]},d))}),t.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-2xl p-8 mb-16",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"How It Works"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"Start earning in three simple steps"})]}),t.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-4xl mx-auto",children:l.map((c,d)=>t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"w-16 h-16 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-full flex items-center justify-center text-2xl font-bold mx-auto mb-4",children:c.number}),t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:c.title}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:c.description})]},d))})]}),t.jsxs("section",{className:"bg-gradient-to-r from-green-50 to-blue-50 dark:from-gray-800 dark:to-gray-700 rounded-2xl p-8 mb-16",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"Potential Earnings"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"See how much you could earn with our 25% recurring commission via PayPal"})]}),t.jsxs("div",{className:"grid md:grid-cols-3 gap-6 max-w-4xl mx-auto",children:[t.jsxs(re,{className:"text-center dark:bg-gray-800",children:[t.jsxs(he,{children:[t.jsx(pe,{className:"text-2xl dark:text-white",children:"5 Referrals"}
632),t.jsx(Ze,{className:"text-xs dark:text-gray-400 mt-2",children:"2 Starter + 3 Professional"})]}),t.jsxs(de,{children:[t.jsx("div",{className:"text-4xl font-bold text-green-600 mb-2",children:"$96/mo"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Cash back via PayPal"})]})]}),t.jsxs(re,{className:"text-center border-2 border-blue-500 dark:bg-gray-800",children:[t.jsxs(he,{children:[t.jsx(xe,{className:"mb-2 bg-blue-600 text-white",children:"Most Common"}),t.jsx(pe,{className:"text-2xl dark:text-white",children:"10 Referrals"}),t.jsx(Ze,{className:"text-xs dark:text-gray-400 mt-2",children:"4 Starter + 6 Professional"})]}),t.jsxs(de,{children:[t.jsx("div",{className:"text-4xl font-bold text-green-600 mb-2",children:"$192/mo"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Cash back via PayPal"})]})]}),t.jsxs(re,{className:"text-center dark:bg-gray-800",children:[t.jsxs(he,{children:[t.jsx(pe,{className:"text-2xl dark:text-white",children:"25 Referrals"}),t.jsx(Ze,{className:"text-xs dark:text-gray-400 mt-2",children:"10 Starter + 15 Professional"})]}),t.jsxs(de,{children:[t.jsx("div",{className:"text-4xl font-bold text-green-600 mb-2",children:"$480/mo"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Cash back via PayPal"})]})]})]}),t.jsx("p",{className:"text-center text-sm text-gray-600 dark:text-gray-400 mt-6",children:"* Based on realistic mix of Starter ($49/yr, $74/mo) and Professional ($99/yr, $149/mo) plans with 25% commission"})]}),t.jsxs("section",{className:"bg-white dark:bg-gray-800 rounded-2xl p-8 mb-16",children:[t.jsx("div",{className:"text-center mb-12",children:t.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-4",children:"Frequently Asked Questions"})}),t.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-4xl mx-auto",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"How do I get paid?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"Commissions are paid monthly via PayPal or direct deposit. You'll receive payment within 30 days of the end of each month."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"Is there a minimum payout?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"Yes, the minimum payout threshold is $50. If you don't reach this amount, it will roll over to the next month."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"How long do I earn commission?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"You earn 25% recurring commission for as long as your referral remains a paying customer. This means lifetime passive income via PayPal!"})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-lg mb-2 dark:text-white",children:"Can I refer myself?"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"No, self-referrals are not permitted. The referral program is designed to reward you for bringing new customers to SocialMonkey."})]})]})]}),t.jsxs("div",{className:"text-center bg-gradient-to-r from-blue-600 to-purple-600 rounded-2xl p-12 text-white",children:[t.jsx(mu,{className:"h-16 w-16 mx-auto mb-4"}),t.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Ready to Start Earning?"}),t.jsx("p",{className:"text-xl text-blue-100 mb-8 max-w-2xl mx-auto",children:n?"Share your referral link and start earning 25% commission via PayPal today!":"Start your free trial to get your referral link and start earning passive income via PayPal."}),n?t.jsx(T,{onClick:i,size:"lg",className:"bg-white text-blue-600 hover:bg-gray-100 text-lg px-12 py-4","data-testid":"button-copy-cta",children:s?"Copied!":"Copy Your Referral Link"}):t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"lg",className:"bg-white text-blue-600 hover:bg-gray-100 text-lg px-12 py-4","data-testid":"button-signup-cta",children:"Start Your Free Trial"})})]})]}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12 mt-16",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400 mb-3",children:"AI-powered social media scheduling that saves you time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"X/Twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"YouTube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"LinkedIn",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"TikTok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/features",className:"hover:text-white transition-colors",children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",className:"hover:text-white transition-colors",children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",className:"hover:text-white transition-colors",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Support"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Help Center"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Contact"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Documentation"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",gV,". All rights reserved."]})})]})})]})}const vV="SocialMonkey",bV="SocialMonkey";function Jw(){const{data:e}=Ee({queryKey:["/api/auth/me"]});return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-gray-900 dark:text-white",children:"SocialMonkey"})]}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{"data-testid":"text-username",children:e.username})]}),t.jsx(me,{href:"/dashboard",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/",children:t.jsxs(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-back-home",children:[t.jsx(Ic,{className:"h-4 w-4 mr-1"}),"Home"]})}),t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Your Free Trial"})})]})})]})})}),t.jsxs("main",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6",children:"Privacy Policy"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"How we collect, use, and protect your information"}),t.jsxs("div",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:[t.jsx("p",{children:"Effective Date: January 31, 2025"}),t.jsx("p",{children:"Last Updated: January 31, 2025"})]})]}),t.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm p-8 prose prose-lg max-w-none dark:prose-invert",children:[t.jsx("h2",{children:"1. Introduction"}),t.jsxs("p",{children:["This Privacy Policy describes how ",vV,' ("we," "our," or "us") collects, uses, and protects your information when you use our AI-powered social media scheduling platform (the "Service").']}),t.jsx("h2",{children:"2. Information We Collect"}),t.jsx("h3",{children:"2.1 Account Information"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Email address and password for account creation"}),t.jsx("li",{children:"Profile information you provide"}),t.jsx("li",{children:"Platform configuration settings and preferences"})]}),t.jsx("h3",{children:"2.2 Social Media Platform Data"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Authentication credentials (API keys, OAuth tokens)"}),t.jsx("li",{children:"Content from connected social media platforms (posts, comments, videos)"}),t.jsx("li",{children:"Engagement data (likes, shares, comment counts)"}),t.jsx("li",{children:"Channel/profile information from connected accounts"})]}),t.jsx("h3",{children:"2.3 Usage Data"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Service activity logs and analytics"}),t.jsx("li",{children:"AI analysis results and generated content"}),t.jsx("li",{children:"Performance metrics and engagement statistics"}),t.jsx("li",{children:"System logs for troubleshooting and optimization"})]}),t.jsx("h3",{children:"2.4 Technical Data"}),t.jsxs("ul",{children:[t.jsx("li",{children:"IP address and browser information"}),t.jsx("li",{children:"Device and operating system details"}),t.jsx("li",{children:"Session data and cookies"}),t.jsx("li",{children:"Error logs and diagnostic information"})]}),t.jsx("h2",{children:"3. How We Use Your Information"}),t.jsx("h3",{children:"3.1 Primary Service Functions"}
632),t.jsxs("ul",{children:[t.jsx("li",{children:"Generate AI-powered content tailored to your brand"}),t.jsx("li",{children:"Schedule and publish posts across social media platforms"}),t.jsx("li",{children:"Analyze engagement and provide performance insights"}),t.jsx("li",{children:"Enable approval workflows for AI-generated content"}),t.jsx("li",{children:"Track performance and provide analytics"})]}),t.jsx("h3",{children:"3.2 Service Improvement"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Enhance AI algorithms and content quality"}),t.jsx("li",{children:"Optimize platform performance and reliability"}),t.jsx("li",{children:"Develop new features and capabilities"}),t.jsx("li",{children:"Conduct analytics to improve user experience"})]}),t.jsx("h3",{children:"3.3 Account Management"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Authenticate and manage your account"}),t.jsx("li",{children:"Provide customer support and technical assistance"}),t.jsx("li",{children:"Send service-related communications"}),t.jsx("li",{children:"Process billing and subscription management"})]}),t.jsx("h2",{children:"4. Information Sharing and Disclosure"}),t.jsx("h3",{children:"4.1 Third-Party Platforms"}),t.jsxs("ul",{children:[t.jsx("li",{children:"We access social media platforms on your behalf using your provided credentials"}),t.jsx("li",{children:"Content and posts are published to platforms under your account"}),t.jsx("li",{children:"Platform APIs may retain logs of our service interactions"})]}),t.jsx("h3",{children:"4.2 AI Service Providers"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Content may be processed by AI providers (OpenAI, Google, etc.)"}),t.jsx("li",{children:"Personal information is not included in AI processing requests"}),t.jsx("li",{children:"AI providers process data according to their respective privacy policies"})]}),t.jsx("h3",{children:"4.3 Legal Requirements"}),t.jsxs("ul",{children:[t.jsx("li",{children:"We may disclose information to comply with legal obligations"}),t.jsx("li",{children:"Respond to valid legal requests from authorities"}),t.jsx("li",{children:"Protect our rights, property, or safety of our users"})]}),t.jsx("h2",{children:"5. Data Security"}
632),t.jsx("h3",{children:"5.1 Security Measures"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Industry-standard encryption for data transmission and storage"}),t.jsx("li",{children:"Secure authentication and session management"}),t.jsx("li",{children:"Regular security audits and vulnerability assessments"}),t.jsx("li",{children:"Access controls limiting data access to authorized personnel"})]}),t.jsx("h3",{children:"5.2 Platform Credentials"}),t.jsxs("ul",{children:[t.jsx("li",{children:"API keys and authentication tokens are encrypted in our database"}),t.jsx("li",{children:"OAuth tokens are securely stored and refreshed automatically"}),t.jsx("li",{children:"Credentials are isolated per user account"})]}),t.jsx("h2",{children:"6. Your Rights and Choices"}),t.jsx("h3",{children:"6.1 Access and Control"}),t.jsxs("ul",{children:[t.jsx("li",{children:"View and update your account information and preferences"}),t.jsx("li",{children:"Download your data through account export features"}),t.jsx("li",{children:"Disconnect social media platform integrations at any time"})]}),t.jsx("h3",{children:"6.2 Data Subject Rights (GDPR/CCPA)"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Right to access your personal information"}),t.jsx("li",{children:"Right to correct inaccurate data"}),t.jsx("li",{children:"Right to delete your data (subject to legal requirements)"}),t.jsx("li",{children:"Right to data portability"}),t.jsx("li",{children:"Right to object to processing"})]}),t.jsx("h2",{children:"7. Contact Information"}),t.jsx("p",{children:"For questions about this Privacy Policy or our data practices:"}),t.jsxs("ul",{children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Email:"})," [email protected]"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Support:"})," Through your account dashboard"]})]}),t.jsx("h2",{children:"8. Changes to This Policy"}),t.jsxs("ul",{children:[t.jsx("li",{children:"We may update this Privacy Policy to reflect service changes"}),t.jsx("li",{children:"Material changes will be communicated through email or service notifications"}),t.jsx("li",{children:"Continued use of the service constitutes acceptance of policy updates"})]})]})]}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12 mt-12",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400 mb-3",children:"AI-powered social media scheduling that saves you time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"X/Twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"YouTube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"LinkedIn",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"TikTok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/features",className:"hover:text-white transition-colors",children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",className:"hover:text-white transition-colors",children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",className:"hover:text-white transition-colors",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Support"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Help Center"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Contact"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Documentation"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",bV,". All rights reserved."]})})]})})]})}const eN="SocialMonkey",jV="SocialMonkey";function tN(){const{data:e}=Ee({queryKey:["/api/auth/me"]});return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-gray-900 dark:text-white",children:"SocialMonkey"})]}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{"data-testid":"text-username",children:e.username})]}),t.jsx(me,{href:"/dashboard",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(me,{href:"/",children:t.jsxs(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-back-home",children:[t.jsx(Ic,{className:"h-4 w-4 mr-1"}),"Home"]})}),t.jsx(me,{href:"/auth",children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm","data-testid":"button-login",children:"Login"})}),t.jsx(me,{href:"/auth?tab=register",children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Your Free Trial"})})]})})]})})}),t.jsxs("main",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6",children:"Terms of Service"}),t.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"Legal terms and conditions for using our platform"}),t.jsxs("div",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:[t.jsx("p",{children:"Effective Date: January 31, 2025"}),t.jsx("p",{children:"Last Updated: January 31, 2025"})]})]}),t.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm p-8 prose prose-lg max-w-none dark:prose-invert",children:[t.jsx("h2",{children:"1. Acceptance of Terms"}),t.jsxs("p",{children:["By accessing or using ",eN,' (the "Service"), you agree to be bound by these Terms of Service ("Terms"). If you do not agree to these Terms, do not use the Service.']}),t.jsx("h2",{children:"2. Description of Service"}),t.jsxs("p",{children:[eN," is an AI-powered social media scheduling platform that:"]}),t.jsxs("ul",{children:[t.jsx("li",{children:"Generates AI-powered content tailored to your brand"}),t.jsx("li",{children:"Schedules and publishes posts across multiple social media platforms with user approval"}),t.jsx("li",{children:"Provides approval workflows for AI-generated content"}
632),t.jsx("li",{children:"Tracks performance and provides analytics"}),t.jsx("li",{children:"Supports platforms including YouTube, X/Twitter, Instagram, Facebook, TikTok, LinkedIn, and Reddit"})]}),t.jsx("h2",{children:"3. User Accounts and Registration"}),t.jsx("h3",{children:"3.1 Account Creation"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You must provide accurate and complete registration information"}),t.jsx("li",{children:"You are responsible for maintaining the confidentiality of your account credentials"}),t.jsx("li",{children:"You must notify us immediately of any unauthorized account access"}),t.jsx("li",{children:"One person or entity may not maintain multiple accounts"})]}),t.jsx("h3",{children:"3.2 Account Responsibility"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You are fully responsible for all activities under your account"}),t.jsx("li",{children:"You must ensure your use complies with all applicable laws and regulations"}),t.jsx("li",{children:"You are responsible for all content posted through the Service"})]}),t.jsx("h2",{children:"4. Platform Integration and Authentication"}),t.jsx("h3",{children:"4.1 Social Media Credentials"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You grant us permission to access your connected social media accounts"}),t.jsx("li",{children:"You are responsible for maintaining valid authentication credentials"}),t.jsx("li",{children:"You may revoke platform access at any time through account settings"}),t.jsx("li",{children:"We are not responsible for changes to third-party platform APIs or policies"})]}),t.jsx("h3",{children:"4.2 Platform Compliance"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Your use must comply with all connected platform terms of service"}),t.jsx("li",{children:"You are responsible for any violations of platform policies"}),t.jsx("li",{children:"We may suspend service if platform violations are detected"}),t.jsx("li",{children:"Platform-specific rate limits and restrictions apply"})]}),t.jsx("h2",{children:"5. Acceptable Use Policy"}
632),t.jsx("h3",{children:"5.1 Permitted Uses"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Professional business engagement and networking"}),t.jsx("li",{children:"Educational content sharing and discussion"}),t.jsx("li",{children:"Legitimate marketing and promotional activities"}),t.jsx("li",{children:"Community building and audience development"})]}),t.jsx("h3",{children:"5.2 Prohibited Uses"}),t.jsx("p",{children:"You may not use the Service to:"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Post spam, harassment, or abusive content"}),t.jsx("li",{children:"Engage in misleading or deceptive practices"}),t.jsx("li",{children:"Violate intellectual property rights"}),t.jsx("li",{children:"Distribute malware or malicious content"}),t.jsx("li",{children:"Impersonate others or create fake accounts"}),t.jsx("li",{children:"Engage in illegal activities or promote illegal content"}),t.jsx("li",{children:"Manipulate platform algorithms through artificial engagement"}),t.jsx("li",{children:"Collect user data without proper authorization"})]}),t.jsx("h2",{children:"6. AI-Generated Content"}),t.jsx("h3",{children:"6.1 AI Assistance"}),t.jsxs("ul",{children:[t.jsx("li",{children:"The Service uses AI to generate suggested content and posts"}),t.jsx("li",{children:"AI suggestions are provided as assistance, not professional advice"}),t.jsx("li",{children:"You are responsible for reviewing and approving all AI-generated content"}),t.jsx("li",{children:"AI-generated content may require human oversight for accuracy and appropriateness"})]}),t.jsx("h3",{children:"6.2 Content Responsibility"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You maintain full responsibility for all c
632ontent posted through the Service"}),t.jsx("li",{children:"Review all AI-generated content before publication"}),t.jsx("li",{children:"Ensure content aligns with your brand values and messaging"}),t.jsx("li",{children:"Monitor published content for platform compliance"})]}),t.jsx("h2",{children:"7. Intellectual Property"}),t.jsx("h3",{children:"7.1 Service Ownership"}),t.jsxs("ul",{children:[t.jsx("li",{children:"The Service, including software, algorithms, and documentation, is our property"}),t.jsx("li",{children:"You receive a limited, non-exclusive license to use the Service"}),t.jsx("li",{children:"You may not reverse engineer, copy, or create derivative works"}),t.jsx("li",{children:"All trademarks and service marks are the property of their respective owners"})]}),t.jsx("h3",{children:"7.2 User Content"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You retain ownership of content you create or provide"}),t.jsx("li",{children:"You grant us a license to process and analyze your content for service provision"}),t.jsx("li",{children:"You represent that you have rights to all content you provide"}),t.jsx("li",{children:"We may use anonymized, aggregated data for service improvement"})]}),t.jsx("h2",{children:"8. Payment Terms"}),t.jsx("h3",{children:"8.1 Subscription Fees"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Service fees are charged according to your selected subscription plan"}),t.jsx("li",{children:"Fees are billed in advance on a recurring basis"}),t.jsx("li",{children:"All fees are non-refundable except as required by applicable law"}),t.jsx("li",{children:"We may change pricing with 30 days' notice"})]}),t.jsx("h3",{children:"8.2 Free Trial"}),t.jsxs("ul",{children:[t.jsx("li",{children:"New accounts receive a 30-day free trial period"}),t.jsx("li",{children:"No credit card is required to start your free trial"}),t.jsx("li",{children:"Full access to all features during the trial period"}),t.jsx("li",{children:"Cancel anytime during the trial with no charges"})]}),t.jsx("h2",{children:"9. Limitation of Liability"}),t.jsx("h3",{children:"9.1 Disclaimer of Warranties"}),t.jsxs("ul",{children:[t.jsx("li",{children:'The Service is provided "as is" without warranties of any kind'}),t.jsx("li",{children:"We disclaim all warranties, express or implied, including fitness for a particular purpose"}),t.jsx("li",{children:"We do not warrant that the Service will be error-free or uninterrupted"}),t.jsx("li",{children:"AI-generated content may contain errors or inaccuracies"})]}),t.jsx("h3",{children:"9.2 Limitation of Damages"}),t.jsxs("ul",{children:[t.jsx("li",{children:"Our liability is limited to the maximum extent permitted by law"}),t.jsx("li",{children:"We are not liable for indirect, incidental, or consequential damages"}),t.jsx("li",{children:"Total liability shall not exceed the fees paid for the Service in the 12 months preceding the claim"})]}),t.jsx("h2",{children:"10. Termination"}),t.jsx("h3",{children:"10.1 Termination by You"}),t.jsxs("ul",{children:[t.jsx("li",{children:"You may terminate your account at any time through account settings"}),t.jsx("li",{children:"Termination does not relieve you of payment obligations for services already provided"}),t.jsx("li",{children:"Some data may be retained as required by law or legitimate business purposes"})]}),t.jsx("h3",{children:"10.2 Termination by Us"}),t.jsxs("ul",{children:[t.jsx("li",{children:"We may suspend or terminate accounts for Terms violations"}),t.jsx("li",{children:"We may terminate accounts with notice for business reasons"}),t.jsx("li",{children:"Repeated platform policy violations may result in permanent termination"})]}),t.jsx("h2",{children:"11. Contact Information"}),t.jsx("p",{children:"For questions about these Terms of Service:"}),t.jsxs("ul",{children:[t.jsxs("li",{children:[t.jsx("strong",{children:"Email:"})," [email protected]"]}),t.jsxs("li",{children:[t.jsx("strong",{children:"Support:"})," Through your account dashboard"]})]}),t.jsx("h2",{children:"12. Updates to Terms"}),t.jsxs("ul",{children:[t.jsx("li",{children:"We may update these Terms to reflect changes in law or service features"}),t.jsx("li",{children:"Material changes will be communicated through email or service notifications"}),t.jsx("li",{children:"Changes take effect 30 days after notification unless otherwise specified"}),t.jsx("li",{children:"Continued use constitutes acceptance of updated Terms"})]})]})]}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12 mt-12",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400 mb-3",children:"AI-powered social media scheduling that saves you time."}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("a",{href:"https://twitter.com/socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"X/Twitter",children:t.jsx(gr,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://youtube.com/@socialmonkeyai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"YouTube",children:t.jsx(Sn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.linkedin.com/company/social-monkey-ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"LinkedIn",children:t.jsx(kn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.facebook.com/profile.php?id=61584136253849",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Facebook",children:t.jsx(wn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.instagram.com/socialmonkey.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Instagram",children:t.jsx(Nn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.tiktok.com/@socialmonkey.ai",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"TikTok",children:t.jsx(Zn,{className:"h-4 w-4"})}),t.jsx("a",{href:"https://www.reddit.com/user/socialmonkey_ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":"Reddit",children:t.jsx(Xn,{className:"h-4 w-4"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/features",className:"hover:text-white transition-colors",children:"Features"})}),t.jsx("li",{children:t.jsx(me,{href:"/pricing",className:"hover:text-white transition-colors",children:"Pricing"})}),t.jsx("li",{children:t.jsx(me,{href:"/referral",className:"hover:text-white transition-colors",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Support"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Help Center"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Contact"})}),t.jsx("li",{children:t.jsx(me,{href:"/auth",className:"hover:text-white transition-colors",children:"Documentation"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"})}),t.jsx("li",{children:t.jsx(me,{href:"/terms",className:"hover:text-white transition-colors",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",jV,". All rights reserved."]})})]})})]})}const wV="SocialMonkey",an="https://socialmonkey.ai",sN=[{id:"master",name:"Master Extension",platform:"All Platforms",icon:t.jsx(JD,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-gradient-to-br from-blue-600 via-purple-600 to-pink-600",borderColor:"border-purple-500",description:"One extension to rule them all. Get AI-powered engagement across every social platform in a single, unified experience.",features:["Unified dashboard for all platforms","Cross-platform analytics","Single sign-on for all extensions","Priority support & updates"],status:"coming-soon"},{id:"x",name:"X Extension",platform:"X / Twitter",icon:t.jsx(gr,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-black",borderColor:"border-gray-600",description:"Turn your timeline into a growth engine with AI-powered engagement, follower glow, and smart reply suggestions.",features:["Follower Glow & New Follower detection","AI Reply Starters","High-impact post scoring","Save tweets for inspiration"],status:"available",link:"/x"},{id:"facebook",name:"Facebook Extension",platform:"Facebook",icon:t.jsx(wn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-[#1877F2]",borderColor:"border-blue-400",description:"Maximize your Facebook presence with AI-assisted engagement and smart community management tools.",features:["Group engagement optimizer","AI comment suggestions","Page performance insights","Viral content detection"],status:"coming-soon"},{id:"instagram",name:"Instagram Extension",platform:"Instagram",icon:t.jsx(Nn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-gradient-to-br from-purple-600 via-pink-600 to-orange-500",borderColor:"border-pink-400",description:"Grow your Instagram following with AI-powered hashtag suggestions, engagement timing, and content inspiration.",features:["Optimal posting time alerts","Hashtag performance analysis","Story engagement prompts","Reel trend detection"],status:"coming-soon"},{id:"linkedin",name:"LinkedIn Extension",platform:"LinkedIn",icon:t.jsx(kn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-[#0A66C2]",borderColor:"border-blue-400",description:"Build your professional brand with AI-assisted networking and thought leadership content suggestions.",features:["Connection request optimizer","Professional reply starters","Industry trend detection","Engagement opportunity alerts"],status:"coming-soon"}
632,{id:"tiktok",name:"TikTok Extension",platform:"TikTok",icon:t.jsx(Zn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-black",borderColor:"border-pink-500",description:"Ride the viral wave with trend detection, duet suggestions, and AI-powered comment engagement.",features:["Trending sound alerts","Duet opportunity finder","AI comment generator","Creator collaboration match"],status:"coming-soon"},{id:"youtube",name:"YouTube Extension",platform:"YouTube",icon:t.jsx(Sn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-[#FF0000]",borderColor:"border-red-400",description:"Grow your channel with smart comment engagement, community tab ideas, and subscriber interaction tools.",features:["Comment engagement optimizer","Community post suggestions","Subscriber milestone alerts","Collaboration opportunity finder"],status:"coming-soon"},{id:"reddit",name:"Reddit Extension",platform:"Reddit",icon:t.jsx(Xn,{className:"h-8 w-8"}),color:"text-white",bgColor:"bg-[#FF4500]",borderColor:"border-orange-400",description:"Master the front page with subreddit timing, karma optimization, and AI-powered comment suggestions.",features:["Subreddit timing optimizer","Karma-building strategies","AMA opportunity alerts","Cross-post suggestions"],status:"coming-soon"}],NV=[{icon:t.jsx(ws,{className:"h-8 w-8 text-blue-500"}),title:"5 Minutes Across All Platforms",description:"Stop wasting hours jumping between apps. Our extensions compress your daily engagement across all platforms into a focused 5-minute session with higher ROI than an hour of random scrolling."},{icon:t.jsx(UD,{className:"h-8 w-8 text-purple-500"}),title:"AI That Learns Your Voice",description:"Each extension learns your unique communication style. Whether you're professional on LinkedIn or casual on TikTok, the AI adapts to suggest responses that sound authentically you."},{icon:t.jsx(ev,{className:"h-8 w-8 text-green-500"}),title:"Strategic Engagement Scoring",description:"Not all engagement is equal. Our AI scores every post and interaction opportunity, highlighting where your comment will have the most impact for growth and visibility."},{icon:t.jsx(Rc,{className:"h-8 w-8 text-orange-500"}),title:"Privacy-First Design",description:"Your data stays yours. We never store your passwords, and all AI processing happens securely. Each extension connects directly to SocialMonkey's encrypted infrastructure."},{icon:t.jsx(Aa,{className:"h-8 w-8 text-yellow-500"}),title:"Real-Time Intelligence",description:"Get instant visual cues as you scroll: who follows you, what's trending, which posts deserve your attention, and exactly what action to take. No more guessing."},{icon:t.jsx(jn,{className:"h-8 w-8 text-cyan-500"}),title:"Unified Analytics Dashboard",description:"Track your growth across every platform in one place. See which platforms are performing best, where to focus your energy, and how your overall social presence is evolving."}];function kV(){const{data:e}=Ee({queryKey:["/api/auth/me"]}),s=sN.filter(n=>n.status==="available"),r=sN.filter(n=>n.status==="coming-soon");return t.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-black text-white",children:[t.jsx("header",{className:"sticky top-0 z-50 bg-gray-900/80 backdrop-blur-md border-b border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex justify-between items-center h-14 sm:h-16",children:[t.jsx("a",{href:an,children:t.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",children:[t.jsx("img",{src:Wt,alt:"SocialMonkey",className:"h-8 sm:h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"font-bold text-base sm:text-lg text-white",children:"SocialMonkey"})]})}),t.jsx("div",{className:"flex items-center gap-2 sm:gap-4",children:e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-sm text-gray-400",children:[t.jsx(fr,{className:"h-4 w-4"}),t.jsx("span",{"data-testid":"text-username",children:e.username})]}),t.jsx("a",{href:`${an}/dashboard`,children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-dashboard",children:"Dashboard"})})]}):t.jsxs(t.Fragment,{children:[t.jsx("a",{href:an,children:t.jsxs(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm text-gray-300 hover:text-white","data-testid":"button-back-home",children:[t.jsx(Ic,{className:"h-4 w-4 mr-1"}),"Home"]})}),t.jsx("a",{href:`${an}/auth`,children:t.jsx(T,{variant:"ghost",size:"sm",className:"text-xs sm:text-sm text-gray-300 hover:text-white","data-testid":"button-login",children:"Login"})}),t.jsx("a",{href:`${an}/auth?tab=register`,children:t.jsx(T,{size:"sm",className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-xs sm:text-sm","data-testid":"button-start-trial",children:"Start Free Trial"})})]})})]})})}),t.jsxs("section",{className:"relative py-16 sm:py-24 overflow-hidden",children:[t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-600/20 via-purple-600/20 to-pink-600/20"}),t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative",children:t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("div",{className:"flex items-center justify-center gap-3 mb-6",children:t.jsxs("div",{className:"flex -sp
632ace-x-2",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-black flex items-center justify-center border-2 border-gray-700",children:t.jsx(gr,{className:"h-5 w-5"})}),t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#1877F2] flex items-center justify-center border-2 border-gray-700",children:t.jsx(wn,{className:"h-5 w-5"})}),t.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-purple-600 to-pink-600 flex items-center justify-center border-2 border-gray-700",children:t.jsx(Nn,{className:"h-5 w-5"})}),t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#0A66C2] flex items-center justify-center border-2 border-gray-700",children:t.jsx(kn,{className:"h-5 w-5"})}),t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#FF0000] flex items-center justify-center border-2 border-gray-700",children:t.jsx(Sn,{className:"h-5 w-5"})})]})}),t.jsxs("h1",{className:"text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold mb-6 px-2",children:[t.jsx("span",{className:"block",children:"Browser Extensions for"}),t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-purple-400 to-pink-400",children:"Every Platform"})]}),t.jsx("p",{className:"text-lg sm:text-xl md:text-2xl text-gray-300 max-w-3xl mx-auto mb-8 px-4",children:"AI-powered Chrome extensions that transform how you engage on social media. One extension per platform, or get them all with our Master Extension."}),t.jsx("p",{className:"text-base sm:text-lg text-gray-400 max-w-2xl mx-auto mb-10 px-4",children:"Stop scrolling aimlessly. Start engaging strategically."}),t.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-4 px-4",children:[t.jsx("a",{href:`${an}/auth?tab=register`,children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600 hover:from-blue-700 hover:via-purple-700 hover:to-pink-700 text-lg px-8 py-4","data-testid":"button-hero-cta",children:["Get Started Free",t.jsx(Rr,{className:"ml-2 h-5 w-5"})]})}),t.jsx("a",{href:"#extensions",children:t.jsx(T,{size:"lg",variant:"outline",className:"w-full sm:w-auto text-lg px-8 py-4 border-gray-600 text-gray-300 hover:bg-gray-800","data-testid":"button-view-extensions",children:"View All Extensions"})})]})]})})]}),t.jsx("section",{className:"py-8 bg-gray-800/50 border-y border-gray-700",children:t.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"flex flex-wrap justify-center items-center gap-8 sm:gap-16",children:[t.jsxs("div",{className:"text-center","data-testid":"stat-extensions-count",children:[t.jsx("div",{className:"text-3xl sm:text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-400",children:"9"}),t.jsx("div",{className:"text-sm text-gray-400",children:"Extensions"})]}),t.jsxs("div",{className:"text-center","data-testid":"stat-platforms-count",children:[t.jsx("div",{className:"text-3xl sm:text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-400",children:"8"}),t.jsx("div",{className:"text-sm text-gray-400",children:"Platforms"})]}),t.jsxs("div",{className:"text-center","data-testid":"stat-master-count",children:[t.jsx("div",{className:"text-3xl sm:text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-pink-400 to-orange-400",children:"1"}),t.jsx("div",{className:"text-sm text-gray-400",children:"Master Extension"})]}),t.jsxs("div",{className:"text-center","data-testid":"stat-daily-time",children:[t.jsx("div",{className:"text-3xl sm:text-4xl font-bold text-green-400",children:"5 min"}),t.jsx("div",{className:"text-sm text-gray-400",children:"Daily Engagement"})]})]})})}),t.jsx("section",{id:"extensions",className:"py-16 sm:py-24",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-12 sm:mb-16",children:[t.jsxs("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-4",children:["Choose Your ",t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-400",children:"Extensions"})]}),t.jsx("p",{className:"text-gray-400 max-w-2xl mx-auto text-base sm:text-lg",children:"Each extension is purpose-built for its platform, with features designed specifically for how that platform works"})]}),s.length>0&&t.jsxs("div",{className:"mb-12",children:[t.jsxs("h3",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-500"}),"Available Now"]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map(n=>t.jsxs(re,{className:`bg-gray-800/50 border-2 ${n.borderColor} hover:border-opacity-100 border-opacity-50 transition-all hover:scale-[1.02] cursor-pointer`,"data-testid":`card-extension-${n.id}`,children:[t.jsxs(he,{className:"pb-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsx("div",{className:`w-14 h-14 ${n.bgColor} rounded-xl flex items-center justify-center ${n.color}`,children:n.icon}),t.jsx(xe,{className:"bg-green-500/20 text-green-400 border-green-500/30","data-testid":`badge-status-${n.id}`,children:"Available"})]}),t.jsx(pe,{className:"text-xl text-white mt-4",children:n.name}),t.jsx("p",{className:"text-sm text-gray-400",children:n.platform})]}),t.jsxs(de,{children:[t.jsx("p",{className:"text-gray-300 text-sm mb-4",children:n.description}),t.jsx("ul",{className:"space-y-2 mb-6",children:n.features.map((a,i)=>t.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-400",children:[t.jsx(ot,{className:"h-4 w-4 text-green-500 flex-shrink-0"}),a]},i))}),n.link&&t.jsx(me,{href:n.link,children:t.jsxs(T,{className:"w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700","data-testid":`button-get-${n.id}`,children:["Get Extension",t.jsx(Rr,{className:"ml-2 h-4 w-4"})]})})]})]},n.id))})]}),t.jsxs("div",{children:[t.jsxs("h3",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[t.jsx(Et,{className:"h-5 w-5 text-yellow-500"}),"Coming Soon"]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.map(n=>t.jsxs(re,{className:`bg-gray-800/30 border ${n.borderColor} border-opacity-30 transition-all opacity-80`,"data-testid":`card-extension-${n.id}`,children:[t.jsxs(he,{className:"pb-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsx("div",{className:`w-14 h-14 ${n.bgColor} rounded-xl flex items-center justify-center ${n.color} opacity-80`,children:n.icon}),t.jsx(xe,{variant:"outline",className:"text-yellow-400 border-yellow-500/30","data-testid":`badge-status-${n.id}`,children:"Coming Soon"})]}),t.jsx(pe,{className:"text-xl text-white mt-4",children:n.name}),t.jsx("p",{className:"text-sm text-gray-400",children:n.platform})]}),t.jsxs(de,{children:[t.jsx("p",{className:"text-gray-400 text-sm mb-4",children:n.description}),t.jsx("ul",{className:"space-y-2 mb-6",children:n.features.map((a,i)=>t.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-500",children:[t.jsx(ot,{className:"h-4 w-4 text-gray-600 flex-shrink-0"}),a]},i))}),t.jsx(T,{variant:"outline",className:"w-full border-gray-600 text-gray-400",disabled:!0,"data-testid":`button-notify-${n.id}`,children:"Notify Me"})]})]},n.id))})]})]})}),t.jsx("section",{className:"py-16 sm:py-24 bg-gray-800/30",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-12 sm:mb-16",children:[t.jsxs("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-4",children:["Why ",t.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-400",children:"SocialMonkey"})," Extensions?"]}),t.jsx("p",{className:"text-gray-400 max-w-2xl mx-auto text-base sm:text-lg",children:"Every extension is built with the same core principles"})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8",children:NV.map((n,a)=>t.jsxs(re,{className:"bg-gray-800/50 border-gray-700 hover:border-gray-600 transition-colors","data-testid":`card-benefit-${a}`,children:[t.jsxs(he,{className:"pb-4",children:[t.jsx("div",{className:"mb-4",children:n.icon}),t.jsx(pe,{className:"text-lg sm:text-xl text-white",children:n.title})]}),t.jsx(de,{children:t.jsx("p",{className:"text-gray-400 text-sm sm:text-base leading-relaxed",children:n.description})})]},a))})]})}),t.jsx("section",{className:"py-16 sm:py-24",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"text-center mb-12",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-4",children:"How It Works"}),t.jsx("p",{className:"text-gray-400 max-w-2xl mx-auto",children:"Get started in under 2 minutes"})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 max-w-4xl mx-auto",children:[{step:"1",title:"Install E
632xtension",description:"Add your chosen extension(s) from the Chrome Web Store. One click install."},{step:"2",title:"Connect Account",description:"Sign in with your SocialMonkey account to sync your preferences and AI settings."},{step:"3",title:"Start Engaging",description:"Open your favorite platform and watch as AI insights appear right in your feed."}].map((n,a)=>t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"w-16 h-16 bg-gradient-to-r from-blue-600 to-purple-600 rounded-full mx-auto mb-6 flex items-center justify-center text-2xl font-bold",children:n.step}),t.jsx("h3",{className:"text-xl font-semibold mb-3",children:n.title}),t.jsx("p",{className:"text-gray-400",children:n.description})]},a))})]})}),t.jsx("section",{className:"py-16 sm:py-24 bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",children:t.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[t.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-6",children:"Ready to Transform Your Social Media Game?"}),t.jsx("p",{className:"text-lg sm:text-xl text-blue-100 mb-8 max-w-2xl mx-auto",children:"Join thousands of creators who are growing faster with AI-powered engagement across every platform."}),t.jsx("div",{className:"flex flex-col sm:flex-row justify-center gap-4",children:t.jsx("a",{href:`${an}/auth?tab=register`,children:t.jsxs(T,{size:"lg",className:"w-full sm:w-auto bg-white text-purple-600 hover:bg-gray-100 text-lg px-8 py-4","data-testid":"button-cta-bottom",children:["Get Started Free",t.jsx(Rr,{className:"ml-2 h-5 w-5"})]})})})]})}),t.jsx("footer",{className:"bg-gray-900 text-white py-8 sm:py-12",children:t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 sm:gap-8 mb-6 sm:mb-8",children:[t.jsxs("div",{className:"col-span-2 sm:col-span-1",children:[t.jsx("div",{className:"mb-3 sm:mb-4",children:t.jsx("img",{src:po,alt:"SocialMonkey",className:"h-20 w-auto","data-testid":"img-footer-logo"})}),t.jsx("p",{className:"text-xs sm:text-sm text-gray-400",children:"AI-powered browser extensions for every social platform."})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Product"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx("a",{href:`${an}/features`,className:"hover:text-white transition-colors","data-testid":"link-footer-features",children:"Features"})}),t.jsx("li",{children:t.jsx("a",{href:`${an}/pricing`,className:"hover:text-white transition-colors","data-testid":"link-footer-pricing",children:"Pricing"})}),t.jsx("li",{children:t.jsx("a",{href:`${an}/referral`,className:"hover:text-white transition-colors","data-testid":"link-footer-referral",children:"Referral Program"})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Extensions"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx(me,{href:"/x",className:"hover:text-white transition-colors text-blue-400","data-testid":"link-footer-extension-x",children:"X / Twitter"})}),t.jsx("li",{children:t.jsx("span",{className:"text-gray-500",children:"Facebook (Soon)"})}),t.jsx("li",{children:t.jsx("span",{className:"text-gray-500",children:"Instagram (Soon)"})}),t.jsx("li",{children:t.jsx("span",{className:"text-gray-500",children:"LinkedIn (Soon)"})}),t.jsx("li",{children:t.jsx("span",{className:"text-gray-500",children:"More..."})})]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3 sm:mb-4 text-sm sm:text-base",children:"Legal"}),t.jsxs("ul",{className:"space-y-1 sm:space-y-2 text-xs sm:text-sm text-gray-400",children:[t.jsx("li",{children:t.jsx("a",{href:`${an}/privacy`,className:"hover:text-white transition-colors","data-testid":"link-footer-privacy",children:"Privacy"})}),t.jsx("li",{children:t.jsx("a",{href:`${an}/terms`,className:"hover:text-white transition-colors","data-testid":"link-footer-terms",children:"Terms"})})]})]})]}),t.jsx("div",{className:"border-t border-gray-800 pt-6 sm:pt-8 text-center text-xs sm:text-sm text-gray-400",children:t.jsxs("p",{children:["© 2025 ",wV,". All rights reserved."]})})]})})]})}var Iy=["Enter"," "],SV=["ArrowDown","PageUp","Home"],I6=["ArrowUp","PageDown","End"],CV=[...SV,...I6],PV={ltr:[...Iy,"ArrowRight"],rtl:[...Iy,"ArrowLeft"]},TV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},um="Menu",[Ru,AV,_V]=Zp(um),[ml,M6]=Ws(um,[_V,Jc,td]),Tf=Jc(),R6=td(),[EV,hl]=ml(um),[IV,mm]=ml(um),F6=e=>{const{__scopeMenu:s,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,l=Tf(s),[c,d]=m.useState(null),u=m.useRef(!1),h=ns(i),p=ed(a);return m.useEffect(()=>{const x=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),t.jsx(mv,{...l,children:t.jsx(EV,{scope:s,open:r,onOpenChange:h,content:c,onContentChange:d,children:t.jsx(IV,{scope:s,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:u,dir:p,modal:o,children:n})})})};F6.displayName=um;var MV="MenuAnchor",qv=m.forwardRef((e,s)=>{const{__scopeMenu:r,...n}=e,a=Tf(r);return t.jsx(hv,{...a,...n,ref:s})});qv.displayName=MV;var Wv="MenuPortal",[RV,D6]=ml(Wv,{forceMount:void 0}),L6=e=>{const{__scopeMenu:s,forceMount:r,children:n,container:a}=e,i=hl(Wv,s);return t.jsx(RV,{scope:s,forceMount:r,children:t.jsx(Ks,{present:r||i.open,children:t.jsx(Xu,{asChild:!0,container:a,children:n})})})};L6.displayName=Wv;var gn="MenuContent",[FV,Kv]=ml(gn),O6=m.forwardRef((e,s)=>{const r=D6(gn,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=hl(gn,e.__scopeMenu),o=mm(gn,e.__scopeMenu);return t.jsx(Ru.Provider,{scope:e.__scopeMenu,children:t.jsx(Ks,{present:n||i.open,children:t.jsx(Ru.Slot,{scope:e.__scopeMenu,children:o.modal?t.jsx(DV,{...a,ref:s}):t.jsx(LV,{...a,ref:s})})})})}),DV=m.forwardRef((e,s)=>{const r=hl(gn,e.__scopeMenu),n=m.useRef(null),a=lt(s,n);return m.useEffect(()=>{const i=n.current;if(i)return vv(i)},[]),t.jsx(Gv,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),LV=m.forwardRef((e,s)=>{const r=hl(gn,e.__scopeMenu);return t.jsx(Gv,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),OV=Ho("MenuContent.ScrollLock"),Gv=m.forwardRef((e,s)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:p,onDismiss:x,disableOutsideScroll:v,...f}=e,b=hl(gn,r),y=mm(gn,r),g=Tf(r),j=R6(r),N=AV(r),[w,S]=m.useState(null),k=m.useRef(null),P=lt(s,k,b.onContentChange),A=m.useRef(0),$=m.useRef(""),_=m.useRef(0),O=m.useRef(null),M=m.useRef("right"),C=m.useRef(0),L=v?ff:m.Fragment,W=v?{as:OV,allowPinchZoom:!0}:void 0,q=F=>{var le,J;const E=$.current+F,ne=N().filter(X=>!X.disabled),U=document.activeElement,Ae=(le=ne.find(X=>X.ref.current===U))==null?void 0:le.textValue,G=ne.map(X=>X.textValue),Q=YV(G,E,Ae),ye=(J=ne.find(X=>X.textValue===Q))==null?void 0:J.ref.current;(function X(se){$.current=se,window.clearTimeout(A.current),se!==""&&(A.current=window.setTimeout(()=>X(""),1e3))})(E),ye&&setTimeout(()=>ye.focus())};m.useEffect(()=>()=>window.clearTimeout(A.current),[]),yv();const I=m.useCallback(F=>{var ne,U;return M.current===((ne=O.current)==null?void 0:ne.side)&&ZV(F,(U=O.current)==null?void 0:U.area)},[]);return t.jsx(FV,{scope:r,searchRef:$,onItemEnter:m.useCallback(F=>{I(F)&&F.preventDefault()},[I]),onItemLeave:m.useCallback(F=>{var E;I(F)||((E=k.current)==null||E.focus(),S(null))},[I]),onTriggerLeave:m.useCallback(F=>{I(F)&&F.preventDefault()},[I]),pointerGraceTimerRef:_,onPointerGraceIntentChange:m.useCallback(F=>{O.current=F},[]),children:t.jsx(L,{...W,children:t.jsx(hf,{asChild:!0,trapped:a,onMountAutoFocus:Ce(i,F=>{var E;F.preventDefault(),(E=k.current)==null||E.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:t.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:p,onDismiss:x,children:t.jsx(Tv,{asChild:!0,...j,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:w,onCurrentTabStopIdChange:S,onEntryFocus:Ce(c,F=>{y.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(pv,{role:"menu","aria-orientation":"vertical","data-state":eA(b.open),"data-radix-menu-content":"",dir:y.dir,...g,...f,ref:P,style:{outline:"none",...f.style},onKeyDown:Ce(f.onKeyDown,F=>{const ne=F.target.closest("[data-radix-menu-content]")===F.currentTarget,U=F.ctrlKey||F.altKey||F.metaKey,Ae=F.key.length===1;ne&&(F.key==="Tab"&&F.preventDefault(),!U&&Ae&&q(F.key));const G=k.current;if(F.target!==G||!CV.includes(F.key))return;F.preventDefault();const ye=N().filter(le=>!le.disabled).map(le=>le.ref.current);I6.includes(F.key)&&ye.reverse(),HV(ye)}),onBlur:Ce(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(A.current),$.current="")}),onPointerMove:Ce(e.onPointerMove,Fu(F=>{const E=F.target,ne=C.current!==F.clientX;if(F.currentTarget.contains(E)&&ne){const U=F.clientX>C.current?"right":"left";M.current=U,C.current=F.clientX}}))})})})})})})});O6.displayName=gn;var $V="MenuGroup",Hv=m.forwardRef((e,s)=>{const{__scopeMenu:r,...n}=e;return t.jsx(Ge.div,{role:"group",...n,ref:s})});Hv.displayName=$V;var zV="MenuLabel",$6=m.forwardRef((e,s)=>{const{__scopeMenu:r,...n}=e;return t.jsx(Ge.div,{...n,ref:s})});$6.displayName=zV;var vp="MenuItem",rN="menu.itemSelect",Af=m.forwardRef((e,s)=>{const{disabled:r=!1,onSelect:n,...a}=e,i=m.useRef(null),o=mm(vp,e.__scopeMenu),l=Kv(vp,e.__scopeMenu),c=lt(s,i),d=m.useRef(!1),u=()=>{const h=i.current;if(!r&&h){const p=new CustomEvent(rN,{bubbles:!0,cancelable:!0});h.addEventListener(rN,x=>n==null?void 0:n(x),{once:!0}),W0(h,p),p.defaultPrevented?d.current=!1:o.onClose()}};return t.jsx(z6,{...a,ref:c,disabled:r,onClick:Ce(e.onClick,u),onPointerDown:h=>{var p;(p=e.onPointerDown)==null||p.call(e,h),d.current=!0},onPointerUp:Ce(e.onPointerUp,h=>{var p;d.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:Ce(e.onKeyDown,h=>{const p=l.searchRef.current!=="";r||p&&h.key===" "||Iy.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Af.displayName=vp;var z6=m.forwardRef((e,s)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}
vendor: 7,563 bytes, line 632
632=e,o=Kv(vp,r),l=R6(r),c=m.useRef(null),d=lt(s,c),[u,h]=m.useState(!1),[p,x]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&x((v.textContent??"").trim())},[i.children]),t.jsx(Ru.ItemSlot,{scope:r,disabled:n,textValue:a??p,children:t.jsx(Av,{asChild:!0,...l,focusable:!n,children:t.jsx(Ge.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:Ce(e.onPointerMove,Fu(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,Fu(v=>o.onItemLeave(v))),onFocus:Ce(e.onFocus,()=>h(!0)),onBlur:Ce(e.onBlur,()=>h(!1))})})})}),UV="MenuCheckboxItem",U6=m.forwardRef((e,s)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return t.jsx(K6,{scope:e.__scopeMenu,checked:r,children:t.jsx(Af,{role:"menuitemcheckbox","aria-checked":bp(r)?"mixed":r,...a,ref:s,"data-state":Yv(r),onSelect:Ce(a.onSelect,()=>n==null?void 0:n(bp(r)?!0:!r),{checkForDefaultPrevented:!1})})})});U6.displayName=UV;var V6="MenuRadioGroup",[VV,BV]=ml(V6,{value:void 0,onValueChange:()=>{}}),B6=m.forwardRef((e,s)=>{const{value:r,onValueChange:n,...a}=e,i=ns(n);return t.jsx(VV,{scope:e.__scopeMenu,value:r,onValueChange:i,children:t.jsx(Hv,{...a,ref:s})})});B6.displayName=V6;var q6="MenuRadioItem",W6=m.forwardRef((e,s)=>{const{value:r,...n}=e,a=BV(q6,e.__scopeMenu),i=r===a.value;return t.jsx(K6,{scope:e.__scopeMenu,checked:i,children:t.jsx(Af,{role:"menuitemradio","aria-checked":i,...n,ref:s,"data-state":Yv(i),onSelect:Ce(n.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,r)},{checkForDefaultPrevented:!1})})})});W6.displayName=q6;var Qv="MenuItemIndicator",[K6,qV]=ml(Qv,{checked:!1}),G6=m.forwardRef((e,s)=>{const{__scopeMenu:r,forceMount:n,...a}=e,i=qV(Qv,r);return t.jsx(Ks,{present:n||bp(i.checked)||i.checked===!0,children:t.jsx(Ge.span,{...a,ref:s,"data-state":Yv(i.checked)})})});G6.displayName=Qv;var WV="MenuSeparator",H6=m.forwardRef((e,s)=>{const{__scopeMenu:r,...n}=e;return t.jsx(Ge.div,{role:"separator","aria-orientation":"horizontal",...n,ref:s})});H6.displayName=WV;var KV="MenuArrow",Q6=m.forwardRef((e,s)=>{const{__scopeMenu:r,...n}=e,a=Tf(r);return t.jsx(fv,{...a,...n,ref:s})});Q6.displayName=KV;var GV="MenuSub",[GQ,Y6]=ml(GV),Ed="MenuSubTrigger",X6=m.forwardRef((e,s)=>{const r=hl(Ed,e.__scopeMenu),n=mm(Ed,e.__scopeMenu),a=Y6(Ed,e.__scopeMenu),i=Kv(Ed,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),t.jsx(qv,{asChild:!0,...d,children:t.jsx(z6,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":eA(r.open),...e,ref:Yp(s,a.onTriggerChange),onClick:h=>{var p;(p=e.onClick)==null||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,Fu(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Ce(e.onPointerLeave,Fu(h=>{var x,v;u();const p=(x=r.content)==null?void 0:x.getBoundingClientRect();if(p){const f=(v=r.content)==null?void 0:v.dataset.side,b=f==="right",y=b?-5:5,g=p[b?"left":"right"],j=p[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+y,y:h.clientY},{x:g,y:p.top},{x:j,y:p.top},{x:j,y:p.bottom},{x:g,y:p.bottom}],side:f}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,h=>{var x;const p=i.searchRef.current!=="";e.disabled||p&&h.key===" "||PV[n.dir].includes(h.key)&&(r.onOpenChange(!0),(x=r.content)==null||x.focus(),h.preventDefault())})})})});X6.displayName=Ed;var Z6="MenuSubContent",J6=m.forwardRef((e,s)=>{const r=D6(gn,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=hl(gn,e.__scopeMenu),o=mm(gn,e.__scopeMenu),l=Y6(Z6,e.__scopeMenu),c=m.useRef(null),d=lt(s,c);return t.jsx(Ru.Provider,{scope:e.__scopeMenu,children:t.jsx(Ks,{present:n||i.open,children:t.jsx(Ru.Slot,{scope:e.__scopeMenu,children:t.jsx(Gv,{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 h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:Ce(e.onKeyDown,u=>{var x;const h=u.currentTarget.contains(u.target),p=TV[o.dir].includes(u.key);h&&p&&(i.onOpenChange(!1),(x=l.trigger)==null||x.focus(),u.preventDefault())})})})})})});J6.displayName=Z6;function eA(e){return e?"open":"closed"}function bp(e){return e==="indeterminate"}function Yv(e){return bp(e)?"indeterminate":e?"checked":"unchecked"}function HV(e){const s=document.activeElement;for(const r of e)if(r===s||(r.focus(),document.activeElement!==s))return}function QV(e,s){return e.map((r,n)=>e[(s+n)%e.length])}function YV(e,s,r){const a=s.length>1&&Array.from(s).every(d=>d===s[0])?s[0]:s,i=r?e.indexOf(r):-1;let o=QV(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==r));const c=o.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function XV(e,s){const{x:r,y:n}=e;let a=!1;for(let i=0,o=s.length-1;i<s.length;o=i++){const l=s[i].x,c=s[i].y,d=s[o].x,u=s[o].y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(a=!a)}return a}function ZV(e,s){if(!s)return!1;const r={x:e.clientX,y:e.clientY};return XV(r,s)}function Fu(e){return s=>s.pointerType==="mouse"?e(s):void 0}var JV=F6,eB=qv,tB=L6,sB=O6,rB=Hv,nB=$6,aB=Af,iB=U6,oB=B6,lB=W6,cB=G6,dB=H6,uB=Q6,mB=X6,hB=J6,Xv="DropdownMenu",[pB,HQ]=Ws(Xv,[M6]),jr=M6(),[fB,tA]=pB(Xv),sA=e=>{const{__scopeDropdownMenu:s,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=jr(s),d=m.useRef(null),[u=!1,h]=bn({prop:a,defaultProp:i,onChange:o});return t.jsx(fB,{scope:s,triggerId:xn(),triggerRef:d,contentId:xn(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:l,children:t.jsx(JV,{...c,open:u,onOpenChange:h,dir:n,modal:l,children:r})})};sA.displayName=Xv;var rA="DropdownMenuTrigger",nA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=tA(rA,r),o=jr(r);return t.jsx(eB,{asChild:!0,...o,children:t.jsx(Ge.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":n?"":void 0,disabled:n,...a,ref:Yp(s,i.triggerRef),onPointerDown:Ce(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:Ce(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});nA.displayName=rA;var xB="DropdownMenuPortal",aA=e=>{const{__scopeDropdownMenu:s,...r}=e,n=jr(s);return t.jsx(tB,{...n,...r})};aA.displayName=xB;var iA="DropdownMenuContent",oA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=tA(iA,r),i=jr(r),o=m.useRef(!1);
632return t.jsx(sB,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:s,onCloseAutoFocus:Ce(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ce(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)"}})});oA.displayName=iA;var gB="DropdownMenuGroup",yB=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(rB,{...a,...n,ref:s})});yB.displayName=gB;var vB="DropdownMenuLabel",lA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(nB,{...a,...n,ref:s})});lA.displayName=vB;var bB="DropdownMenuItem",cA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(aB,{...a,...n,ref:s})});cA.displayName=bB;var jB="DropdownMenuCheckboxItem",dA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(iB,{...a,...n,ref:s})});dA.displayName=jB;var wB="DropdownMenuRadioGroup",NB=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(oB,{...a,...n,ref:s})});NB.displayName=wB;var kB="DropdownMenuRadioItem",uA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(lB,{...a,...n,ref:s})});uA.displayName=kB;var SB="DropdownMenuItemIndicator",mA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(cB,{...a,...n,ref:s})});mA.displayName=SB;var CB="DropdownMenuSeparator",hA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(dB,{...a,...n,ref:s})});hA.displayName=CB;var PB="DropdownMenuArrow",TB=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(uB,{...a,...n,ref:s})});TB.displayName=PB;var AB="DropdownMenuSubTrigger",pA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(mB,{...a,...n,ref:s})});pA.displayName=AB;var _B="DropdownMenuSubContent",fA=m.forwardRef((e,s)=>{const{__scopeDropdownMenu:r,...n}=e,a=jr(r);return t.jsx(hB,{...a,...n,ref:s,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)"}})});fA.displayName=_B;var EB=sA,IB=nA,MB=aA,xA=oA,gA=lA,yA=cA,vA=dA,bA=uA,jA=mA,wA=hA,NA=pA,kA=fA;const rl=EB,nl=IB,RB=m.forwardRef(({className:e,inset:s,children:r,...n},a)=>t.jsxs(NA,{ref:a,className:je("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",e),...n,children:[r,t.jsx(Xi,{className:"ml-auto"})]}));RB.displayName=NA.displayName;const FB=m.forwardRef(({className:e,...s},r)=>t.jsx(kA,{ref:r,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...s}));FB.displayName=kA.displayName;const ao=m.forwardRef(({className:e,sideOffset:s=4,...r},n)=>t.jsx(MB,{children:t.jsx(xA,{ref:n,sideOffset:s,className:je("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
632de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));ao.displayName=xA.displayName;const Es=m.forwardRef(({className:e,inset:s,...r},n)=>t.jsx(yA,{ref:n,className:je("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",e),...r}));Es.displayName=yA.displayName;const DB=m.forwardRef(({className:e,children:s,checked:r,...n},a)=>t.jsxs(vA,{ref:a,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(jA,{children:t.jsx(Xt,{className:"h-4 w-4"})})}),s]}));DB.displayName=vA.displayName;const LB=m.forwardRef(({className:e,children:s,...r},n)=>t.jsxs(bA,{ref:n,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(jA,{children:t.jsx(cP,{className:"h-2 w-2 fill-current"})})}),s]}));LB.displayName=bA.displayName;const Qa=m.forwardRef(({className:e,inset:s,...r},n)=>t.jsx(gA,{ref:n,className:je("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",e),...r}));Qa.displayName=gA.displayName;const va=m.forwardRef(({className:e,...s},r)=>t.jsx(wA,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...s}));va.displayName=wA.displayName;function sa(e){return Gs({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"},child:[]}]})(e)}function ra(e){return Gs({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"},child:[]}]})(e)}function na(e){return Gs({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"},child:[]}]})(e)}function aa(e){return Gs({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6 0-13.8 11.1-24.9 24.9-24.9 13.6 0 24.6 11.
6321 24.6 24.9 0 13.6-11.1 24.6-24.6 24.6zM504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-132.3-41.2c-9.4 0-17.7 3.9-23.8 10-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3 55.4 12.5c0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8-6.1-6.4-14.7-10.2-24.1-10.2-34.9 0-46.3 46.9-14.4 62.8-1.1 5-1.7 10.2-1.7 15.5 0 52.6 59.2 95.2 132 95.2 73.1 0 132.3-42.6 132.3-95.2 0-5.3-.6-10.8-1.9-15.8 31.3-16 19.8-62.5-14.9-62.5zM302.8 331c-18.2 18.2-76.1 17.9-93.6 0-2.2-2.2-6.1-2.2-8.3 0-2.5 2.5-2.5 6.4 0 8.6 22.8 22.8 87.3 22.8 110.2 0 2.5-2.2 2.5-6.1 0-8.6-2.2-2.2-6.1-2.2-8.3 0zm7.7-75c-13.6 0-24.6 11.1-24.6 24.9 0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.1 24.9-24.6 0-13.8-11-24.9-24.9-24.9z"},child:[]}]})(e)}function _f(e){return Gs({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm169.5 338.9c-3.5 8.1-18.1 14-44.8 18.2-1.4 1.9-2.5 9.8-4.3 15.9-1.1 3.7-3.7 5.9-8.1 5.9h-.2c-6.2 0-12.8-2.9-25.8-2.9-17.6 0-23.7 4-37.4 13.7-14.5 10.3-28.4 19.1-49.2 18.2-21 1.6-38.6-11.2-48.5-18.2-13.8-9.7-19.8-13.7-37.4-13.7-12.5 0-20.4 3.1-25.8 3.1-5.4 0-7.5-3.3-8.3-6-1.8-6.1-2.9-14.1-4.3-16-13.8-2.1-44.8-7.5-45.5-21.4-.2-3.6 2.3-6.8 5.9-7.4 46.3-7.6 67.1-55.1 68-57.1 0-.1.1-.2.2-.3 2.5-5 3-9.2 1.6-12.5-3.4-7.9-17.9-10.7-24-13.2-15.8-6.2-18-13.4-17-18.3 1.6-8.5 14.4-13.8 21.9-10.3 5.9 2.8 11.2 4.2 15.7 4.2 3.3 0 5.5-.8 6.6-1.4-1.4-23.9-4.7-58 3.8-77.1C183.1 100 230.7 96 244.7 96c.6 0 6.1-.1 6.7-.1 34.7 0 68 17.8 84.3 54.3 8.5 19.1 5.2 53.1 3.8 77.1 1.1.6 2.9 1.3 5.7 1.4 4.3-.2 9.2-1.6 14.7-4.2 4-1.9 9.6-1.6 13.6 0 6.3 2.3 10.3 6.8 10.4 11.9.1 6.5-5.7 12.1-17.2 16.6-1.4.6-3.1 1.1-4.9 1.7-6.5 2.1-16.4 5.2-19 11.5-1.4 3.3-.8 7.5 1.6 12.5.1.1.1.2.2.3.9 2 21.7 49.5 68 57.1 4 1 7.1 5.5 4.9 10.8z"},child:[]}]})(e)}function ia(e){return Gs({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"},child:[]}]})(e)}function oa(e){return Gs({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function OB(e){return Gs({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496.926,366.6c-3.373-9.176-9.8-14.086-17.112-18.153-1.376-.806-2.641-1.451-3.72-1.947-2.182-1.128-4.414-2.22-6.634-3.373-22.8-12.09-40.609-27.341-52.959-45.42a102.889,102.889,0,0,1-9.089-16.12c-1.054-3.013-1-4.724-.248-6.287a10.221,10.221,0,0,1,2.914-3.038c3.918-2.591,7.96-5.22,10.7-6.993,4.885-3.162,8.754-5.667,11.246-7.44,9.362-6.547,15.909-13.5,20-21.278a42.371,42.371,0,0,0,2.1-35.191c-6.2-16.318-21.613-26.449-40.287-26.449a55.543,55.543,0,0,0-11.718,1.24c-1.029.224-2.059.459-3.063.72.174-11.16-.074-22.94-1.066-34.534-3.522-40.758-17.794-62.123-32.674-79.16A130.167,130.167,0,0,0,332.1,36.443C309.515,23.547,283.91,17,256,17S202.6,23.547,180,36.443a129.735,129.735,0,0,0-33.281,26.783c-14.88,17.038-29.152,38.44-32.673,79.161-.992,11.594-1.24,23.435-1.079,34.533-1-.26-2.021-.5-3.051-.719a55.461,55.461,0,0,0-11.717-1.24c-18.687,0-34.125,10.131-40.3,26.449a42.423,42.423,0,0,0,2.046,35.228c4.105,7.774,10.652,14.731,20.014,21.278,2.48,1.736,6.361,4.24,11.246,7.44,2.641,1.711,6.5,4.216,10.28,6.72a11.054,11.054,0,0,1,3.3,3.311c.794,1.624.818,3.373-.36,6.6a102.02,102.02,0,0,1-8.94,15.785c-12.077,17.669-29.363,32.648-51.434,44.639C32.355,348.608,20.2,352.75,15.069,366.7c-3.868,10.528-1.339,22.506,8.494,32.6a49.137,49.137,0,0,0,12.4,9.387,134.337,134.337,0,0,0,30.342,12.139,20.024,20.024,0,0,1,6.126,2.741c3.583,3.137,3.075,7.861,7.849,14.78a34.468,34.468,0,0,0,8.977,9.127c10.019,6.919,21.278,7.353,33.207,7.811,10.776.41,22.989.881,36.939,5.481,5.778,1.91,11.78,5.605,18.736,9.92C194.842,480.951,217.707,495,255.973,495s61.292-14.123,78.118-24.428c6.907-4.24,12.872-7.9,18.489-9.758,13.949-4.613,26.163-5.072,36.939-5.481,11.928-.459,23.187-.893,33.206-7.812a34.584,34.584,0,0,0,10.218-11.16c3.434-5.84,3.348-9.919,6.572-12.771a18.971,18.971,0,0,1,5.753-2.629A134.893,134.893,0,0,0,476.02,408.71a48.344,48.344,0,0,0,13.019-10.193l.124-.149C498.389,388.5,500.708,376.867,496.926,366.6Zm-34.013,18.277c-20.745,11.458-34.533,10.23-45.259,17.137-9.114,5.865-3.72,18.513-10.342,23.076-8.134,5.617-32.177-.4-63.239,9.858-25.618,8.469-41.961,32.822-88.038,32.822s-62.036-24.3-88.076-32.884c-31-10.255-55.092-4.241-63.239-9.858-6.609-4.563-1.24-17.211-10.341-23.076-10.739-6.907-24.527-5.679-45.26-17.075-13.206-7.291-5.716-11.8-1.314-13.937,75.143-36.381,87.133-92.552,87.666-96.719.645-5.046,1.364-9.014-4.191-14.148-5.369-4.96-29.189-19.7-35.8-24.316-10.937-7.638-15.748-15.264-12.2-24.638,2.48-6.485,8.531-8.928,14.879-8.928a27.643,27.643,0,0,1,5.965.67c12,2.6,23.659,8.617,30.392,10.242a10.749,10.749,0,0,0,2.48.335c3.6,0,4.86-1.811,4.612-5.927-.768-13.132-2.628-38.725-.558-62.644,2.84-32.909,13.442-49.215,26.04-63.636,6.051-6.932,34.484-36.976,88.857-36.976s82.88,29.92,88.931,36.827c12.611,14.421,23.225,30.727,26.04,63.636,2.071,23.919.285,49.525-.558,62.644-.285,4.327,1.017,5.927,4.613,5.927a10.648,10.648,0,0,0,2.48-.335c6.745-1.624,18.4-7.638,30.4-10.242a27.641,27.641,0,0,1,5.964-.67c6.386,0,12.4,2.48,14.88,8.928,3.546,9.374-1.24,17-12.189,24.639-6.609,4.612-30.429,19.343-35.8,24.315-5.568,5.134-4.836,9.1-4.191,14.149.533,4.228,12.511,60.4,87.666,96.718C468.629,373.011,476.119,377.524,462.913,384.877Z"},child:[]}]})(e)}function js(e){return Gs({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(e)}const $B=[{name:"High Growth",emoji:"🚀",description:"6-8 hours: Maximum visibility and engagement"},{name:"Keep Followers Engaged",emoji:"💬",description:"8-12 hours: Consistent presence without overwhelming"},{name:"Maintain Account",emoji:"✅",description:"12 hours - 1 week: Stay active with minimal effort"}],zB={categories:$B},UB="/assets/image_1764258457517-CMDbW2RB.png",VB="/assets/image_1764258500821-BpXeDNgp.png",BB="/assets/image_1764258562474-DTDLGrDm.png",qB="/assets/image_1764258615226-CCeqjnP1.png",WB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAA1CAYAAAD4bU3WAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAw1SURBVGhD7Zp7cFVFnsc/3QHyjoJ5EMIzQ5yxSKKUMYlLdrZ8gOsA4aFTM1XjYFkyDguza9WqM2UCCMGpga0t/5m1Bkcsa4CR2bUGkojOgDxcJppEWBETxprwCJDwyI2IbkJy87jnt3/0ua9zz01uIChV6yfVdW+6+5zu/p7fr/vXfa4SEeEbAmhnxv93vhHEwTeCOPhGEAdqJJNqzBVvEpQzIwZiFkTsBkIrnzl7lv8+VEd9fQMtLX/jy
632pUv6OvvC6mh7AuupWvRiY+P57bbJpCbm0vZnL+jbM4ccnOngUsfR9pyTIJYIiilEEAEampq2Lp1K+fa2hA0vd5QEZz4RRl9tFYkJsSjBCblTOLxx5exZEl5oNwvxkhEiUkQAXyWcPDgQTZt+je6urrp6upGKY0lgqhhmhy2hdjRWmFZ5oYK0ApAEBFSU1NITk7k5z//BXPnPmiX3SBBKlav4cD+gwEhREy+iPh7FZ1hW4gdsa0VWxwlRgyTb+qkpaVy3/338eKGKrS6TkFCGwS41OHhqRUrONfWRl9fv1mYJKQJJcOM98a5jNtARSyUViQmJpCTnc1rW35LZka6XRY+NjciBAmlw+PhR48t48KFi4gCQdkDDLXFqJfb3DhB3NABaxUUQk52Ftu2/o6srCxHTXciBPGrKCIsXfooJ06exrLdwxJBaR0c4NBiB/kKBYFgv5RYaHzcnjeTXbt2OWu5EhGY+VeTytVraGs/b4thLEOpEDHcELdkW1UE0fJHAbttM89p2tsv8HxFpbOWKxGCCLBn7z72HXiPq16vWUVEAp9OxLLs5FYeOuBYvo8uSmkETXePl/0HDrJn77uBsoiu2oS5jHELmPfQw5w/fwG0jqHDIf4T0UioFfhNZqj80UdrhVgWiI+cnEns2/tnZ5UwIiykurqG7q5ulFbBYGyIdENNf9Qw7t7d1c3OndXOwjAiBNm2dRvd3d1RXGBolAJlz+4jSQFNb0QClDb/dHV1s337GwF3cRtemCCtp8/Q1taOiPE/rXTE/Z0piAAW1dU7Od58lA8bPmBx+QIUxlxLS4rYv/9d/tp8lP3791JaUgRYoIL25o86QYyZR9hjZIrMCU+WCGJJoMdtbe20tp61xxg2AHAKUl/fEGIVdojsbCE0ubBp40Y8ns9ISUmkvHyhsQIF35v/PbIy0+kf9FFTvYvGxkZjHSJgWSjEBFW21WiN+QyxutDvyu6Ay5iGQGFZFvX1Da5iECqICNS9X0d/f3+wcLiQPEwf0836xgbq6v6CAAWFBcxfMJ+SkmL+vqwMpeDI4SP8+tf/AZglXvsTCixBCWjM/6F5SkB8VuC7P+Fite4WbOj1enm/rg6xnCWGgCBKwYmWE8bE7Dz/JmokiAXvvPNnPJ7PSE5KYOmSJSxYMJ+MjHS6r/ZQW1uLVop//tnP+PjoUZqajtLc/DGNjQ0sWlSOiIXWihdeWBsoa27+mI8++oinn/6XkJbMcEM8LjKFYLIErTUtJ06gImZPQ9BCgMtXriBRtXUn/GkolNY0fHiYQ3XvYwGzZ9/FPz40D6Wg6ZMmdu9+m3Xr1rNixXKOHDlMQf6dPP98JZb4WLOmkvLyhaxcuYJFi8s5deo0+fmFPPnkT7hy5TJPPPEEq1atCuyyY+tn0JzEnlM+v3KFaM9aG91M/NHXZ841XAR2x/lEBEQUlsC6des5deoMY8eOITExkavdPbz11luICIV3FjI44OPjo/8DCLvf3s2lixdISIin6J4i0jMyGDsmziz9CIcPf8iDc+dy11138fLLL8e0SQtF7D+jn6Kvr3/4OWQ00XZr+/btY3DQZ6yjqYna2loWLlxA9sQsxoyN46crnqK5+ROaPjnGzJkzARBLOHL4CD09veTOmEFzcxP1H3zA/PkLQOvAdGpaiOmxjYiAIFqZo7nrRWuFZYf6ra2t9A8MIALnL14M1BEl9PRcpaKigvz8QmbNKiA/v4CCgkLWrVtHbW0txcUlFOQXcvLkKVJSkvnVr17kwP4DlJSUQGCNuTbi4+NdYxAA7V9mFTB+woQRB2PR0CoY6aKM76I1ns86uXq1h8SkZIruKUbsKHJ9VRXrq6oQgdLSe9m2bRslpaUsXryEWfmFnD7VyoQJt1JcXGScQGk7RbH9KCilGD9+fHSXUUqhAJ9AXl5emG/Gsuw68fnMemYmPYPCBHqgaGw8zKG/1AFQVvZdSktLKS29l7I5ZTyydAlVVRuoqKhk9uw7Wb58OQKUlBSTmppKn7ePM61nAve9lkcnIuTdnufMDqD9O1mtoGzOnDC3uZZlN3C8Z5+p4J9v7VXB5xPWr9/A5le2MH78bby25RW2bNlMUlIyFRVrWLt2LYsWLeKPO6spKSmmqekTXnttC7feOp7fv7GD3e+8E5hBzFw1sj7Gx8dTNqcs6vqkRCz/9MvJ02f5/g9+GDhF9x8UjbBNex4xUWec1uYeSuOzLL//2Pseg4hlt2XZluTHLJdKaTuQ0nZXjBAq5MDZFUWIYCagSEpI4s3/+k9yZ0wJr2ujQ9fyb+VOY+qUySjb50PNfiQEYwSNzydYlt/aTFvGioJBOCou5NOcYdjBOkIclqXwegf44osv+d8vuxjoHwD/1mIYlNIBdwWYMjmb6dOnIFHOdyKW3R//+DFSUpJR9qR4TYhJxrjsgdt5RN0eBXcoYf+LQqk4vN4+tm//Pa/+9lV6e3udLUZFQuaz1JQUHnvsR2ZPFGV8UQ+I2i5cNOr6C75GtNJ0XOqg41Ibgz7IzZ1J2i1pocbtjgJst1eWxeScbN7d+6chL4uwEK3gueee4Za01Otc7UcPf2Sq42BMHPT397s+XVfEArFITU3huWefDcQfluVz1gQ3QSwR5s19kAfvv4+kxISAKG7+9nWg44IrmbNPzjBBKwWWRXJiPA/cfx/z5j0QiD+0jgur6yfiNYQl5uREBJY+8igtLadsXzbVYn4yo4hC0enpxOM5B0Bm5lTGxY9DaUhISDR1lCIubowjjgLxDZCXN5Pq6p3GgwKl7kRYiFYK7NeCv/nNZiZmZwdM9usQIxovvfQSGzduwtvbx7RpM8iZNJne3l58Ph+Dg4NmFfJZTMrJ4ZVXNsckBm4W4h+8f4L1dH7OU0/9lPb2drxer+ttb7QzGQvx4PG0IRZMzJ7GpY6zAGRlTaP1zBk+v3yZoqIi7rjjOyilaG8/zx13fJstr24mM+M2tAqObSgiLMR/gbIn2ImZE6jZ9SYPPzSX1JQkFJY5+7R19Ovp9OfRJXhvE7cFT21SU5JJTlRMmZwOYvH22zXs2LGN/r5eaqrfJCvTiEGM7h4hSCimURPWv1i1nl9uqCJnUjYpKcmABLb5xNiYO7EZc/gr9RCBQi5NSUkmOSmezIx0vN7eYX+U4MaQgmAf/IpY6DjF3LkPsGfPn/jFc89ye963GDduDAkJ13NkENrj4Xvvl2HsWNNtEcjISA9cqbXJ19qUxRDIRhAxh4Rjn4QH9hfBTlsCZ8+1cehQHR/U19PS0mJ+UmWful0fkeJ4PB46PeYVyaWLHUyaZN7mf/llN7fekoIA771Xx3f/oQytICtrKh0d51zuNAwyLJad3PGXjlbyWSJv7d4jjzz6Q8mZPEPWVW2UHq8lGZmTxeczdZw472GJSHp6jnvlYRjGZYju47Zd+UuvLQV3MP48reB3r7/Oqn9ayfHjzfT3eZkxfbppMrAvDyfyvu71YiEGQVwYwslGhr/b4d3vH+gjPn4caWlJ/PLFF9jxhzeYNn0q7sGljGaHYnGZr55dO2ukoGC2XLp0OeACFzs6ndVCiPSNjBvnMl89i5eU8/iyx1n+5JMM9A8CkJVpfifmTriF9fUNMG7cuLC8WLkpBQF45pmnmT17NpWVq0c8J3g8HjIy0kd2kc1NKwgKqjasZXDAYtvWP0R9F+tEBBoaGiktLXYWxYbTh242jh37VKZOnSmffnpSLJ+z1J2HH14o9fUfOrNj4ua1EJvCwu+wZnUlK1euoqvLHB0OtX96/fXtzJqVT2npPc6i2HAq9NUT21KwYcMmufvue+XYseNi2Zf4P0VE+vt9snHjv8vEiVPk+PG/BQtGyDCh+40mtOmhZ0CxYPv2HVSuXsOyZctYuHABaWlpdHZ20tzUzM5du7in6G6eefZfSU8f779q2Ps6+T+ni21c7F7xDQAAAABJRU5ErkJggg==",KB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAAAvCAYAAAB5ez3+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAzFSURBVHhe7Zp7lFXVfcc/v33uax4MkRlmGAwCRhgwJumytraxImo1yCP2kVK1q6ldaUsFjBrTskwb26jR/hGNMRjbuvJP1kqWPLpsQ1CBBBZD4kqMy0dlDIIOy
632DDiMAyPkXncO/fsX/84Z9977mPu3AkPma58WMO955z9+O3v/u3ffpwrqqr8hjOOjFfYwsT5K4n8P5EZTYzxtswU36hEeVEV0PBqNLMmBpWsr/SsHFV7bFTGcndkQvjs6NaVtq8Ql3P0Ego5DWELr/IVV1Xch0Blacq3L0/l3KWcprCFnL+iOirLUsn6syqshJ/FGVxlNnxgwhvu+nzCSGCXs5Eiu20oh0ihhGddWBt+uu+OffveYceOHbS376Kjo4O+vj6GhoYiKT58RIRkMklTUxNt89q4/rrrWbhwIXPmXIwqOC2dJFFxz6qwxd9VYf36jaxdu5b9+w8gYhgcGMR441psnDOiTVWr1NbVYoxh1qxZrFjxd9x663JAS7yVsy2shuszCzz/wjbuu+8rfNDfT39/PyCImALjzzesKkYk9xm9f8FHJtPQUM/XHvgXli5ZilWLZ/IOclaEdQnc0F+16m42P/ccA6dOjaOqiYBSP6mexTctYu3aJ/Ak33YJPT7a2nKe7RhTWA17VEToPtzL8uW3cPDguwwOnl/x80ySqkkye9ZMNqxfR+u05twuyp4pYTWM6AIcOvw+ixcv42BXd9BzIhULnogEUigiICgzL7qITT/6IdNbpwUh8EwKqwgicPU117K7Yw8i5+fEdCZwDmNtlpjnIShtbXPZtWtnsGqgemErquQyrl59F53v7MczJueplQqdqLg2GRNDFXyrHDhwkFWr7grXvfm2j9X+isICPLd5C5s3P086nfl/NlGNhQDC8PAwW7ZsZdOm53Pr3GqoHAosXH7F73LoUHewO5HCTWuFrBMeAVRtzpVmXjSDl1/+BUYqhwDHqB6rwDPrNnDi+Al8a0u2sWOhGCwJLIlgCIUrYcFiyGIYCRdw4y05IPCncoz+ZDwoYIyX+ztxsp+NG/8rt+V1E91o9pf1WLeX/vRV17B339v41kIVk5ZrjgKWBCPUYwzEbT+eZFAEtRnikgGUjCbASxLY6A4e8yWpBCtnUVd3YKrkDimDc+B8A6Kiau5
632QqKSBOdyTwvKj5G1S2uZewos/a8/VXUhhZ5ZVSwT2vt1J16FDwXCoQtQoAigxknXN7D/wBsd73+XokU56e7rpOdLLe719/M+PNpMyPgl/GPxsJKyM5W1OvGLPLMwXiB90wOglujqLRcoT7bju97rZu+/t8Cpo5Wh5CxQLlldBlu3bt2NtIKpVW1U8LUwRY8SvxTOA7eOJB1bT2jSJC5qns2Hrz/mtKxfQ9as3aGuuJ4lPzHhFEiiigmi+Aa4ZpX/R2B8siYolD65d6uhzV0r0SKk81rds3749vKqsR1lX9BV27tzJ0NAgqhYjwTKrGlx1igFJohZgmBovjSGLlQS3fn4lP3+ji9iUJjb997PUoiStAjEUD48RYqQxpDEM4zGESpYhL86QF8eKBXz80KSkZkhoBl8gYwxZAR9BNYaoR0yzJDRDUn3iajGhlYXijs3A4CDt7e1VpS4Q1onnCbz55ptVi1lM4EFCsL0gaIIqGFATA9PApm2/ICM1TL54DvNnzKDet9TUTOa1jj0cPdJFb88++nr38dSTD5H0+vEZ5Mbbbqfj/f3s7dzHo48+QveRQ/Qc6aanex+XzZxKGhiMJVlyy3L2Hz5IT+8Bjh45SM/hg3zioqnU+xlSWR8TGX05+yoEDIcRoaOjo/h2WUb12L6+Y8W3q8YNrpypqqBhqLECNsG3nvwuJ0ZAvTh3fmk1qRrL22+9xvTmGv7toa8xo/VCXt39Dp9b/nn+/bFvkMJnROJkgZb6Wm646vdobL2EZ7fshJiw8ZnvkyDOmnvW8PQTj/L6Ky8ztWkOs2d+EtIZtr30IpfMbCQhp0BHsMFQChlbVMexvj5UFWsrh46SGCuhxw4NDUYfVYXrd+ev0S2gAAYPgwEVsMHqY0SEEzUj/OU9f0FtzXF6Ol/n8W9/h5P+FB75j62c8utYdsPnmN84jbgPtQDpQf72j/6YjE3ygy3tZCRGfVMrcz4yk9uvXUK9P8xLWzcQ4wQnh4/xSmcXxJJ88R/+CjHDCMMQcYBqEREGh4ZQVUzkSLEcJaFAQ48dL6WDKeKz4UfOIMmydNlnqEtAVrN07D/ItYsXA0Mc73k3ENzUs3HziwyNALUX0BBLEMfgAfg+KWvBSzAsCYbE4BOjsWYK82a3gk3zj2vu5Gjfe/T0HqLtk5eSRkgbw4gBK3kXGA9uAg/OE6LvUkopK7sRSKVSBcus8cVbN4NLsGNTxaIY4+GTBTPMjNlNxBkhheWHz7ajdiqQqLD6iNRvFSMGfBtsD1GsgpIIkvnDLPudT3Fh0xQaW1ponN7I5NZmvnD3w5zSetTUjypIJUSEutpaRCjy2NKyygoL0NjYiEbi0FgxJY+CuJ4N51+Nk9VYKHIGvEE+e+OnSeHzv798hYPv9LJly0vAZKZMm4URiNtT/Oni36c2Dgwco38kjYZHmISHQUQORMQoGTvE8EnAS7H63n8GGyfmC1/98r089fjjqCawksKqRN4OBLvCUmlK8a1lSmNjuDp2DlA+Z4mwEu68LrvssoL7Y8WUgDBqaVCOqqICSD1qJgGGhKZ55unHWPDxi0kf6+OO2+8g7nt8+1vf5cRwgmmzP8U9d65ksneM+1bcSJ03wKZtG9lz9DAZye/dXX2u862MMOT38tT3n8Z6k7ly6RdobvoYzfEG7rrldv76z5bzn998kDgfhNvpfKgKBvTY4hoR5s1rg0hYGI2SySt4HwRXXfUHJJNJRAy+9aPJyqLhP4eQxegHQQVeHau+8nUOHzlG35Ee/mTRjbz60ou0zf047/f0YQSGhwa4eO4VvNc7wJp/+ipdhw9x+ScuYeP673HHvV8mbWLENUNMAfEYMnE8RkjZDGKDE4i0HeThxx7mb764hnhDA6/u+SV73t1L/ZRmrv3tK7n37i+VEc95X2WhIAiPCxcuDJaRY4TGkrMCDT22s/MA1113PacGBhDxqqhWI7sXgxInSwqDJU4/QhYljsWgAqJKXC2CwSeOLyZ8te4TI42QDUqTILL4EicttXgKk/xBBOj3asgKJHUYTy1G4ygmt3HwFDwsolkQi+JjRcLDocj8EdqtRQNYw4NvwnmnJpXgJz/Zxtw5H4PcVr+8wCXCuvdbVmHBgoW89da+cGIYi2ivB4MLQMN4C4TbUyLbBvctSJMfjC6PRspyeaLp8+RTBATWBClcPa6EYLorTh08iyIi+ZUAyrx5c9jVvhMj0dyFeRwlgdOJKgKrVq2itq62aDE9GtFjDwAbHBFqIKioiUgUPHNdoZgib3Ge4MpykmhuVOSljYoWEC03Wk6wso6myls0mkCEmjQ0NLBy5Uq8XLJot5ZS4LHO9V2VvsLll19B16Hu4GhvjFMuV2d+sRXcdaK5ZuV+9CnB++V8ZzhT3HU+tAR3naiF6aPd6UR16QLJ3KQXWJCfC1x7RhdJ1eIZj+nTp/H6ay+H5TmF3GcpBUq5eOKyGIEHH/hXJk+qRYJjjZK0UfKNkjDOmlCEfIflnwsSrh4K5YheB+ncdeBx0XrzzYz+5Z8W5iuuvzRHIWqzeAINk+p45OGvQ87eyqJSLGwUV/Vnly1l8U2LqKutQSToQRh7uVHKeNOPj8oSjf28GEHxjCGZTLJo0SJuuukzJSkqUTJ5RYnOiguuWUjHr94i69twUT76jFiO6ERw/pMfG5deOp+dO7cHPlr006RKjOqxhGIQFrh+/TpaW6cR87zgNXik8uqqmhjkgwZ89KMXsm7dul+rfRWFdYgILS0tbN3yAvPnt1FTk0TVhm8x8+KacHuZmwRVc156vnurZwyoDderKS6dP48tL7zAtJapufaNR+CqhHW0tLTQvnMHy5YuZXLDJEwk5gqQ9f0CUScCQVgTsn4Wzxjq6mq5+eab2dW+g+bmptwPlMfbnIoxNopL5D43bXqO+++/nxPHTzIwGJxREv5EMpfHLa6rjEvnmujoaphUT0PDJB568EGWLFkE4bl0lOicMxZVC+vwIwHcKqx7ZgNPPvkdurq6GPGzpNNpIDjZsuEZQ7XGnGtSqRpEhFmzZvL3K1Zw221/nhNTw1EY+ktw72wKG00sbhmj0NnZyY+3/Zif/uyn7N69m76+Y7/WW4izTTKZZOrUqbS1zeOGG/6Qq6++mrlz5xQnG1c8Lce4hS0mGlOr7c0Pm3Nh67gmr2ImoqjnitPy2LEmp9Mo+qzg7BzL7jPBaQn7G0bn/wAlLs7ihfTE8gAAAABJRU5ErkJggg==",GB="/assets/image_1764259591324-ChWeOsv9.png",HB="/assets/image_1764259858846-CkFoXa0H.png",nN="/assets/image_1764259897892-BR7fFqqL.png",QB="/assets/image_1764259937308-BWz85BaJ.png",aN="/assets/image_1764260020459-D9mbUIXz.png",Bx=[{id:1,label:"Welcome"},{id:2,label:"Account"},{id:3,label:"Authentication"},{id:4,label:"Keys & Tokens"},{id:5,label:"Verify"},{id:6,label:"Success"}],YB=[{value:"6 hours",label:"Every 6 Hours"},{value:"8 hours",label:"Every 8 Hours"},{value:"12 hours",label:"Every 12 Hours"},{value:"1 day",label:"Once Daily"},{value:"1 week",label:"Once Weekly"},{value:"paused",label:"Paused"}];function SA({open:e,onOpenChange:s,onComplete:r,existingConfig:n,reconnectConfigId:a}){const{toast:i}=bt(),[,o]=Ma(),l=!!n,[c,d]=m.useState(l?4:1),[u,h]=m.useState({channelUrl:"",apiKey:(n==null?void 0:n.apiKey)||"",apiSecret:(n==null?void 0:n.apiSecret)||"",accessToken:(n==null?void 0:n.accessToken)||"",accessTokenSecret:(n==null?void 0:n.accessTokenSecret)||""});m.useEffect(()=>{e&&(n?(h({channelUrl:"",apiKey:n.apiKey,apiSecret:n.apiSecret,accessToken:n.accessToken,accessTokenSecret:n.accessTokenSecret}),d(4),w(n.configId)):(h({channelUrl:"",apiKey:"",apiSecret:"",accessToken:"",accessTokenSecret:""}),d(1),w(null)),x("idle"),f(null),y(null),j(!1),k("12 hours"))},[e,n]);const[p,x]=m.useState("idle"),[v,f]=m.useState(null),[b,y]=m.useState(null),[g,j]=m.useState(!1),[N,w]=m.useState((n==null?void 0:n.configId)||null),[S,k]=m.useState("12 hours"),P=ke({mutationFn:async E=>
632(await Fe("POST","/api/x-config/credentials",E)).json(),onSuccess:E=>{ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),E.configId&&w(E.configId),j(!0),d(5)},onError:E=>{i({title:"Error",description:"Failed to save credentials. Please try again.",variant:"destructive"})}}),A=ke({mutationFn:async E=>(await Fe("PATCH",`/api/x-config/credentials/${E.configId}`,E)).json(),onSuccess:E=>{ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),j(!0),d(5)},onError:E=>{i({title:"Error",description:"Failed to update credentials. Please try again.",variant:"destructive"})}}),$=ke({mutationFn:async E=>(await Fe("POST","/api/x-verify",E)).json(),onSuccess:E=>{E.success&&E.account?(ee.invalidateQueries({queryKey:["/api/x-config"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),y(E.account),x("success"),d(6)):(x("error"),f(E.message||"Failed to verify credentials. Please check your API keys and try again."))},onError:async E=>{x("error");let ne="Failed to verify credentials. Please check your API keys and try again.";if(E.response)try{const U=await E.response.json();U.message&&(ne=U.message)}catch{}else E.message&&(ne=E.message);f(ne)}}),_=()=>{if(!N){x("error"),f("No config ID available. Please go back and try again.");return}x("verifying"),f(null),$.mutate({...u,configId:N})},O=ke({mutationFn:async E=>(await Fe("PATCH",`/api/platform-configs/${E.configId}/frequency`,{postFrequency:E.postFrequency})).json(),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]})}}),M=async()=>{if(N&&S)try{await O.mutateAsync({configId:N,postFrequency:S})}catch(E){console.error("Failed to save frequency:",E)}s(!1),r==null||r(),d(1),h({channelUrl:"",apiKey:"",apiSecret:"",accessToken:"",accessTokenSecret:""}),x("idle"),f(null),y(null),j(!1),w(null),k("12 hours")},C=()=>{M(),o("/x-config")},L=()=>{c<6&&(c===4?l&&n?A.mutate({...u,configId:n.configId}):P.mutate({...u,reconnectConfigId:a}):d(c+1))},W=()=>{c>1&&(d(c-1),p==="error"&&(x("idle"),f(null)))},q=!0,I=u.apiKey.trim().length>0&&u.apiSecret.trim().length>0&&u.accessToken.trim().length>0&&u.accessTokenSecret.trim().length>0,F=Bx.length;return m.useEffect(()=>{c===5&&g&&p==="idle"&&(_(),j(!1))},[c,g]),t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:l?`Update X Account${n!=null&&n.username?` (@${n.username})`:""}`:"Connect to X (Twitter)"}),t.jsx(Ns,{className:"sr-only",children:l?"Update your X (Twitter) API credentials":"Set up your X (Twitter) API credentials to enable posting"})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"flex items-center gap-2",children:Bx.map((E,ne)=>t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:`flex-1 h-2 rounded-full ${E.id<=c?"bg-primary":"bg-muted"}`}),ne<F-1&&t.jsx(Xi,{className:"w-4 h-4 text-muted-foreground"})]},E.id))}),t.jsx("div",{className:"flex justify-between text-xs text-muted-foreground",children:Bx.map(E=>t.jsx("span",{children:E.label},E.id))}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Step ",c," of ",F]})]}),t.jsxs("div",{className:"min-h-[400px]",children:[c===1&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"How would you like to proceed?"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Due to rate limits and posting frequency requirements, we use API keys for X/Twitter integration. The setup takes about 5 minutes."}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("button",{onClick:()=>d(2),className:"p-8 border rounded-lg text-left space-y-3 hover-elevate","data-testid":"option-ready-to-connect",children:[t.jsx("div",{className:"w-14 h-14 roun
632ded-lg bg-primary/10 flex items-center justify-center",children:t.jsx(Aa,{className:"w-7 h-7 text-primary"})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold text-base",children:"I'm ready to connect my account"}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Start the setup process now"})]})]}),t.jsxs("button",{disabled:!0,className:"p-8 border rounded-lg text-left space-y-3 opacity-50 cursor-not-allowed","data-testid":"option-watch-video",children:[t.jsx("div",{className:"w-14 h-14 rounded-lg bg-muted flex items-center justify-center",children:t.jsx(KD,{className:"w-7 h-7 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"font-semibold text-base flex items-center gap-2",children:["Watch a quick video guide",t.jsx(xe,{variant:"secondary",className:"text-xs",children:"Coming Soon"})]}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"A step-by-step walkthrough"})]})]})]})]}),c===2&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Set Up Your Developer Account"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete these two tasks to get your free X Developer account"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"1"}),"Developer Account"]})}),t.jsxs(de,{className:"text-sm space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:"Follow these steps to create your free developer account:"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-muted-foreground",children:[t.jsx("li",{children:"Click the button below to open the X Developer Portal"}),t.jsxs("li",{children:["Click ",t.jsx("strong",{children:'"Developer Portal"'})," in the navigation"]}),t.jsx("li",{children:"Scroll to the bottom of the page"}),t.jsxs("li",{children:["Click ",t.jsx("strong",{children:'"Sign up for a Free Account"'})]})]}),t.jsxs(T,{variant:"outline",className:"mt-2",onClick:()=>window.open("https://developer.x.com","_blank"),"data-testid":"link-developer-portal",children:[t.jsx(wa,{className:"w-4 h-4 mr-2"}),"Open X Developer Portal"]})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"2"}),"Developer Agreement & Policy"]})}),t.jsxs(de,{className:"text-sm space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:"When asked to describe your use case, copy and paste the text below:"}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"p-3 bg-muted rounded-lg text-xs text-muted-foreground max-h-32 overflow-y-auto",children:"I am requesting access to the X API so that I can reliably manage and schedule content for my account. My primary goal is to maintain a consistent posting cadence without needing to manually log in throughout the day. I produce a steady stream of posts, replies, and updates, and having API access allows me to draft content ahead of time and schedule it to publish at optimal engagement times. Using the API also allows me to organize my content workflow more efficiently. Instead of posting everything manually, I can queue posts, avoid duplication, monitor which posts have already been published, and ensure that my account remains active even when I am unavailable. This is especially helpful when planning ahead for busy periods, travel, or days when I cannot be online. Additionally, API access will help me streamline basic account maintenance, such as managing drafts, coordinating replies, and ensuring that planned posts are delivered reliably and on time. I am not using the API for any bulk automated actions or spam-related activity — only to support legitimate scheduling, publishing, and account management for my own profile. Overall, API access enables me to maintain a professional posting workflow, stay consistent with my content strategy, and keep my account active in a responsible and compliant way."}),t.jsxs(T,{variant:"secondary",size:"sm",className:"absolute top-2 right-2",onClick:()=>{navigator.clipboard.writeText(`I am requesting access to the X API so that I can reliably manage and schedule content for my account. My primary goal is to maintain a consistent posting cadence without needing to manually log in throughout the day. I produce a steady stream of posts, replies, and updates, and having API access allows me to draft content ahead of time and schedule it to publish at optimal engagement times.
633
634Using the API also allows me to organize my content workflow more efficiently. Instead of posting everything manually, I can queue posts, avoid duplication, monitor which posts have already been published, and ensure that my account remains active even when I am unavailable. This is especially helpful when planning ahead for busy periods, travel, or days when I cannot be online.
635
636Additionally, API access will help me streamline basic account maintenance, such as managing drafts, coordinating replies, and ensuring that planned posts are delivered reliably and on time. I am not using the API for any bulk automated actions or spam-related activity — only to support legitimate scheduling, publishing, and account management for my own profile.
637
638Overall, API access enables me to maintain a professional posting workflow, stay consistent with my content strategy, and keep my account active in a responsible and compliant way.`),i({title:"Copied to clipboard",description:"The text has been copied. Paste it in the Developer Portal."})}
638,"data-testid":"button-copy-agreement",children:[t.jsx(xa,{className:"w-3 h-3 mr-1"}),"Copy"]})]}),t.jsx("div",{className:"p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:t.jsxs("p",{className:"flex items-start gap-2 text-amber-600 dark:text-amber-400",children:[t.jsx(hr,{className:"w-4 h-4 mt-0.5 shrink-0"}),t.jsxs("span",{children:["After pasting, check all 3 agreement boxes if you agree, then click ",t.jsx("strong",{children:"Submit"}),"."]})]})})]})]})]})]}),c===3&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Configure User Authentication"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up your app's authentication settings in the Developer Portal"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"1"}),"Open App Settings"]})}),t.jsxs(de,{className:"text-sm space-y-3",children:[t.jsxs("p",{className:"text-muted-foreground",children:["Find your default project app and click the ",t.jsx("strong",{children:"gear icon"})," to open settings:"]}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white",children:t.jsx("img",{src:UB,alt:"Click the gear icon next to your project app",className:"w-full h-auto"})})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"2"}),"Set Up User Authentication"]})}),t.jsxs(de,{className:"text-sm space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"text-muted-foreground",children:["Click the ",t.jsx("strong",{children:'"Set up"'}),' button next to "User authentication settings":']}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:VB,alt:"Click the Set up button",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-muted-foreground font-medium",children:"Then configure these settings:"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(Xt,{className:"w-4 h-4 mt-0.5 text-primary shrink-0"}),t.jsx("span",{className:"text-muted-foreground",children:"Select this permission:"})]}),t.jsx("div",{className:"ml-6 rounded-lg border overflow-hidden bg-white",children:t.jsx("img",{src:BB,alt:"Select Read and write and Direct message",className:"w-full max-w-md h-auto"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(Xt,{className:"w-4 h-4 mt-0.5 text-primary shrink-0"}),t.jsx("span",{className:"text-muted-foreground",children:"Select this app type:"})]}),t.jsx("div",{className:"ml-6 rounded-lg border overflow-hidden bg-white",children:t.jsx("img",{src:qB,alt:"Select Web App, Automated App or Bot",className:"w-full max-w-sm h-auto"})})]})]})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"3"}),"Enter App Info"]})}),t.jsxs(de,{className:"text-sm space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:"Copy and paste these URLs into the corresponding fields:"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-lg",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Callback URI / Redirect URL"}),t.jsx("p",{className:"text-xs font-mono truncate",children:"https://www.socialmonkey.ai/api/auth/twitter/callback"})]}),t.jsx(T,{variant:"ghost",size:"sm",className:"shrink-0 ml-2",onClick:()=>{navigator.clipboard.writeText("https://www.socialmonkey.ai/api/auth/twitter/callback"),i({title:"Copied!",description:"Callback URI copied to clipboard"})}
638,"data-testid":"button-copy-callback",children:t.jsx(xa,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-lg",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Website URL"}),t.jsx("p",{className:"text-xs font-mono truncate",children:"https://www.socialmonkey.ai"})]}),t.jsx(T,{variant:"ghost",size:"sm",className:"shrink-0 ml-2",onClick:()=>{navigator.clipboard.writeText("https://www.socialmonkey.ai"),i({title:"Copied!",description:"Website URL copied to clipboard"})},"data-testid":"button-copy-website",children:t.jsx(xa,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-lg",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Terms of Service"}),t.jsx("p",{className:"text-xs font-mono truncate",children:"https://www.socialmonkey.ai/terms"})]}),t.jsx(T,{variant:"ghost",size:"sm",className:"shrink-0 ml-2",onClick:()=>{navigator.clipboard.writeText("https://www.socialmonkey.ai/terms"),i({title:"Copied!",description:"Terms of Service URL copied to clipboard"})},"data-testid":"button-copy-terms",children:t.jsx(xa,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-lg",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Privacy Policy"}),t.jsx("p",{className:"text-xs font-mono truncate",children:"https://www.socialmonkey.ai/privacy"})]}),t.jsx(T,{variant:"ghost",size:"sm",className:"shrink-0 ml-2",onClick:()=>{navigator.clipboard.writeText("https://www.socialmonkey.ai/privacy"),i({title:"Copied!",description:"Privacy Policy URL copied to clipboard"})},"data-testid":"button-copy-privacy",children:t.jsx(xa,{className:"w-3 h-3"})})]})]}),t.jsx("div",{className:"p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:t.jsxs("p",{className:"flex items-start gap-2 text-amber-600 dark:text-amber-400 text-xs",children:[t.jsx(hr,{className:"w-4 h-4 mt-0.5 shrink-0"}),t.jsxs("span",{children:["After entering all URLs, click ",t.jsx("strong",{children:"Save"})," to continue."]})]})})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"4"}),"Complete the Setup"]})}),t.jsxs(de,{className:"text-sm space-y-4",children:[t.jsx("p",{className:"text-muted-foreground",children:"You may see these confirmation dialogs. Click through them:"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:"If asked about changing permissions, click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:WB,alt:"Click Yes to confirm permission changes",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:"You'll see your OAuth 2.0 Client ID and Secret. You don't need these keys - just click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:KB,alt:"Click Done to continue",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:"When asked to save your OAuth 2.0 Client Secret, click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:GB,alt:"Click Yes, I saved it to continue",className:"h-auto max-h-12"})})]})]}),t.jsx("div",{className:"p-3 bg-muted rounded-lg",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.jsx("strong",{children:"Note:"})," We only need the API Keys and Access Tokens from the next step, not the OAuth 2.0 credentials shown in these dialogs."]})})]})]})]})]}),c===4&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:l?"Update Your API Credentials":"Get Your API Credentials"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:l?"Enter your updated API credentials below":"Generate and copy your keys and tokens from the Developer Portal"}),t.jsx("div",{className:"p-4 bg-muted/50 rounded-lg text-sm",children:t.jsxs("p",{className:"flex items-start gap-2",children:[t.jsx(Rc,{className:"w-4 h-4 mt-0.5 text-primary shrink-0"}),t.jsx("span",{children:"Your credentials are encrypted and stored securely. We never share them with third parties."})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"1"}),"Open Keys and Tokens"]})}),t.jsxs(de,{className:"text-sm space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:"Click on the tab near the top middle of the page:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:HB,alt:"Click Keys and tokens tab",className:"h-auto max-h-10"})})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"2"}),"Generate API Key & Secret"]}
638)}),t.jsxs(de,{className:"text-sm space-y-4",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:'Click next to "API Key and Secret":'}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:nN,alt:"Click Regenerate button",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:"When asked if you want to regenerate, click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:QB,alt:"Click Yes, regenerate",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"p-3 bg-muted rounded-lg space-y-3",children:[t.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:l?"Enter your new API credentials:":"Copy the keys shown and paste them below:"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"apiKey",className:"text-xs",children:"API Key"}),t.jsx(Ke,{id:"apiKey",type:"password",placeholder:l?"••••••••••••••••":"Paste your API Key",value:u.apiKey,onChange:E=>h({...u,apiKey:E.target.value}),"data-testid":"input-api-key"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"apiSecret",className:"text-xs",children:"API Key Secret"}),t.jsx(Ke,{id:"apiSecret",type:"password",placeholder:l?"••••••••••••••••":"Paste your API Key Secret",value:u.apiSecret,onChange:E=>h({...u,apiSecret:E.target.value}),"data-testid":"input-api-secret"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:"After copying both keys, click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:aN,alt:"Click Yes, I saved them",className:"h-auto max-h-12"})})]})]})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-base flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold",children:"3"}),"Generate Access Token & Secret"]})}),t.jsxs(de,{className:"text-sm space-y-4",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsx("p",{className:"text-muted-foreground",children:'Now do the same for "Access Token and Secret". Click:'}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:nN,alt:"Click Generate button",className:"h-auto max-h-12"})})]}),t.jsxs("div",{className:"p-3 bg-muted rounded-lg space-y-3",children:[t.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:l?"Enter your access tokens:":"Copy the tokens shown and paste them below:"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"accessToken",className:"text-xs",children:"Access Token"}),t.jsx(Ke,{id:"accessToken",type:"password",placeholder:l?"••••••••••••••••":"Paste your Access Token",value:u.accessToken,onChange:E=>h({...u,accessToken:E.target.value}),"data-testid":"input-access-token"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"accessTokenSecret",className:"text-xs",children:"Access Token Secret"}),t.jsx(Ke,{id:"accessTokenSecret",type:"password",placeholder:l?"••••••••••••••••":"Paste your Access Token Secret",value:u.accessTokenSecret,onChange:E=>h({...u,accessTokenSecret:E.target.value}),"data-testid":"input-access-token-secret"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:"After copying both tokens, click:"}),t.jsx("div",{className:"rounded-lg border overflow-hidden bg-white inline-block",children:t.jsx("img",{src:aN,alt:"Click Yes, I saved them",className:"h-auto max-h-12"})})]})]})]})]}),t.jsxs(T,{variant:"ghost",className:"p-0 h-auto text-primary text-sm hover:text-primary/80 hover:bg-transparent",onClick:()=>window.open("https://developer.x.com/en/portal/projects-and-apps","_blank"),children:[t.jsx(wa,{className:"w-4 h-4 mr-1"}),"Open Developer Portal"]})]}),c===5&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:p==="verifying"?t.jsx(Qe,{className:"w-6 h-6 text-primary animate-spin"}):p==="error"?t.jsx(hr,{className:"w-6 h-6 text-destructive"}):t.jsx(Rc,{className:"w-6 h-6 text-primary"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold",children:p==="verifying"?"Verifying Connection...":p==="error"?"Verification Failed":"Verify Your Connection"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:p==="verifying"?"Connecting to X (Twitter) to validate your credentials":p==="error"?"There was a problem with your credentials":"Let's make sure everything is set up correctly"})]})]}),p==="verifying"&&t.jsx(re,{children:t.jsx(de,{className:"py-12",children:t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx(js,{className:"w-8 h-8"})}),t.jsx("div",{className:"absolute -bottom-1 -right-1 w-6 h-6 rounded-full bg-background border-2 border-primary flex items-center justify-center",children:t.jsx(Qe,{className:"w-3 h-3 text-primary animate-spin"})})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"font-medium",children:"Connecting to X (Twitter)..."}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"This may take a few seconds"})]})]})})}),p==="error"&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(hr,{className:"w-5 h-5 text-destructive shrink-0 mt-0.5"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"font-medium text-destructive",children:"Verification Failed"}),t.jsx("p",{className:"text-sm text-destructive/80",children:v})]})]})}),t.jsxs(re,{children:[t.jsxs(he,{className:"pb-2",children:[t.jsx(pe,{className:"text-base",children:"Your Credentials"}),t.jsx(Ze,{className:"text-xs",children:"Review the credentials you entered"})]}),t.jsx(de,{children:t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-muted-foreground",children:"API Key"}),t.jsx("span",{className:"font-mono text-xs",children:u.apiKey?`${u.apiKey.slice(0,12)}...`:"Not set"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-muted-foreground",children:"API Secret"}),t.jsx("span",{className:"font-mono text-xs",children:u.apiSecret?`${u.apiSecret.slice(0,12)}...`:"Not set"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-muted-foreground",children:"Access Token"}),t.jsx("span",{className:"font-mono text-xs",children:u.accessToken?`${u.accessToken.slice(0,12)}...`:"Not set"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-muted-foreground",children:"Access Token Secret"}),t.jsx("span",{className:"font-mono text-xs",children:u.accessTokenSecret?`${u.accessTokenSecret.slice(0,12)}...`:"Not set"})]})]})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{variant:"outline",className:"flex-1",onClick:()=>{x("idle"),f(null),d(4)},"data-testid":"button-go-back-to-keys",children:[t.jsx(Qo,{className:"w-4 h-4 mr-1"}),"Fix Credentials"]}),t.jsxs(T,{className:"flex-1",onClick:_,"data-testid":"button-retry-verify",children:[t.jsx(Aa,{className:"w-4 h-4 mr-1"}),"Try Again"]})]})]})]}),c===6&&b&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"text-center space-y-4",children:[t.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-emerald-500/20 flex items-center justify-center",children:t.jsx(i7,{className:"w-8 h-8 text-emerald-500"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-2xl font-bold text-emerald-600 dark:text-emerald-400",children:"Successfully Connected!"}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Your X (Twitter) account is now connected and ready to use."})]})]}),t.jsx(re,{className:"border-emerald-500/20 bg-emerald-500/5",children:t.jsx(de,{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-4",children:[b!=null&&b.profileImageUrl?t.jsx("img",{src:b.profileImageUrl,alt:b.name||"Profile",className:"w-14 h-14 roun
638ded-full border-2 border-emerald-500/30"}):t.jsx("div",{className:"w-14 h-14 rounded-full bg-muted flex items-center justify-center border-2 border-emerald-500/30",children:t.jsx(js,{className:"w-7 h-7 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"font-semibold text-lg truncate",children:(b==null?void 0:b.name)||"Connected Account"}),(b==null?void 0:b.verified)&&t.jsxs(xe,{variant:"secondary",className:"shrink-0",children:[t.jsx(Ir,{className:"w-3 h-3 mr-1"}),"Verified"]})]}),t.jsxs("p",{className:"text-primary font-medium",children:["@",(b==null?void 0:b.username)||"unknown"]}),(b==null?void 0:b.description)&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:b.description})]}),t.jsx(Ir,{className:"w-6 h-6 text-emerald-500 shrink-0"})]})})}),t.jsxs("div",{className:"space-y-3",children:[t.jsx(ae,{htmlFor:"frequency",className:"text-base font-semibold",children:"How often would you like to post on X?"}),t.jsx("div",{className:"space-y-4 text-sm text-muted-foreground bg-muted/50 p-4 rounded-md",children:zB.categories.map(E=>t.jsxs("div",{children:[t.jsxs("span",{className:"font-medium text-foreground",children:[E.emoji," ",E.name]}),t.jsx("p",{className:"ml-5",children:E.description})]},E.name))}),t.jsxs(Nt,{value:S,onValueChange:E=>k(E),children:[t.jsx(gt,{id:"frequency",className:"w-full","data-testid":"select-posting-frequency",children:t.jsx(kt,{})}),t.jsx(yt,{children:YB.map(E=>t.jsx(Se,{value:E.value,"data-testid":`option-frequency-${E.value}`,children:E.label},E.value))})]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[t.jsxs(T,{variant:"outline",className:"flex-1",onClick:C,"data-testid":"button-go-to-settings",children:[t.jsx(qn,{className:"w-4 h-4 mr-2"}),"Advanced Settings"]}),t.jsx(T,{className:"flex-1",onClick:M,disabled:O.isPending,"data-testid":"button-done",children:O.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{className:"w-4 h-4 mr-2"}),"Done"]})})]})]})]}),c!==6&&t.jsxs("div",{className:"flex items-center justify-between pt-6 border-t",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{variant:"outline",onClick:W,disabled:c===1||p==="verifying","data-testid":"button-wizard-prev",children:[t.jsx(Qo,{className:"w-4 h-4 mr-1"}),"Previous"]}),t.jsx(T,{variant:"outline",onClick:()=>s(!1),"data-testid":"button-wizard-cancel",children:"Cancel"})]}),t.jsx("div",{className:"flex gap-2",children:c<5?t.jsx(T,{onClick:L,disabled:c===3&&!q||c===4&&!I||P.isPending||A.isPending,"data-testid":"button-wizard-next",children:c===4&&(P.isPending||A.isPending)?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-1 animate-spin"}),l?"Updating...":"Saving..."]}):t.jsxs(t.Fragment,{children:["Next",t.jsx(Xi,{className:"w-4 h-4 ml-1"})]})}):t.jsx(T,{onClick:_,disabled:p==="verifying","data-testid":"button-verify",children:p==="verifying"?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):p==="error"?t.jsxs(t.Fragment,{children:[t.jsx(hr,{className:"w-4 h-4 mr-2"}),"Try Again"]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{className:"w-4 h-4 mr-1"}),"Verify & Connect"]})})})]})]})]})})}const XB={youtube:{icon:oa,displayName:"YouTube",color:"text-red-600"},x:{icon:js,displayName:"X (Twitter)",color:"text-foreground"},twitter:{icon:js,displayName:"X (Twitter)",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-foreground"},instagram:{icon:ra,displayName:"Instagram",color:"text-pink-500"},facebook:{icon:sa,displayName:"Facebook",color:"text-blue-600"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-blue-700"},reddit:{icon:aa,displayName:"Reddit",color:"text-orange-500"},snapchat:{icon:_f,displayName:"Snapchat",color:"text-yellow-400"}},wd=e=>XB[e]||{icon:jn,displayName:e.charAt(0).toUpperCase()+e.slice(1),color:"text-muted-foreground"};function iN({selectedConfigIds:e,onConfigToggle:s,onSelectAll:r,highlightMode:n=!1,buttonVariant:a="outline"}){const{toast:i}=bt(),[o,l]=m.useState(!1),[,c]=Ma(),[d,u]=m.useState(!1),[h,p]=m.useState(void 0),{data:x}=Ee({queryKey:["/api/platform-status"],refetchOnMount:"always",gcTime:3e4}),v=(x==null?void 0:x.platforms)||[],b=((x==null?void 0:x.membershipLevel)||"starter").trim().toLowerCase(),y=["professional","pro","enterprise"].includes(b),g=C=>{C.stopPropagation(),l(!1),c("/upgrade")},j=ke({mutationFn:async({platform:C,configId:L})=>{const W=L?`/api/oauth/${C}/connect?configId=${L}`:`/api/oauth/${C}/connect`,I=await(await fetch(W,{credentials:"include"})).json();return I.authUrl&&(window.location.href=I.authUrl),I},onError:()=>{i({title:"Error",description:"Failed to initiate connection",variant:"destructive"})}}),N=["reddit"],w=[],S=[],k=[];v.forEach(C=>{N.includes(C.name.toLowerCase())||(C.hasVerifiedAccounts?(S.push(C),C.verifiedAccounts.forEac
638h(L=>{w.push({platform:C,account:L})})):k.push(C))});const P=(C,L,W)=>{L.stopPropagation(),C==="x"||C==="twitter"?(l(!1),p(W),u(!0)):j.mutate({platform:C,configId:W})},A=()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]})},$=()=>{if(e.length===0)return"All Platforms";if(e.length===1){const C=w.find(L=>L.account.configId===e[0]);return C?C.account.accountName:"1 Platform"}return`${e.length} Accounts`},O=(()=>{if(e.length===1){const C=w.find(L=>L.account.configId===e[0]);if(C){const L=wd(C.platform.name);return{Icon:L.icon,color:L.color}}}return null})(),M=e.length===0;return t.jsxs(t.Fragment,{children:[t.jsxs(rl,{open:o,onOpenChange:l,children:[t.jsx(nl,{asChild:!0,children:t.jsxs("div",{className:`relative w-full ${n?"z-10":""}`,children:[n&&t.jsx("div",{className:"absolute -inset-2 rounded-xl opacity-75",style:{background:"linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)",filter:"blur(12px)"}}),t.jsxs(T,{variant:a,className:`gap-2 relative w-full ${n?"bg-purple-600 hover:bg-purple-700 border-purple-600 text-white":""}`,"data-testid":"button-platform-filter",children:[O&&t.jsx(O.Icon,{className:`h-4 w-4 ${O.color}`}),n?"Connect":$(),t.jsx(Pa,{className:"h-4 w-4"})]})]})}),t.jsxs(ao,{align:"start",className:"w-[280px]",children:[t.jsx(Es,{onClick:C=>{C.preventDefault(),r(),l(!1)},className:"cursor-pointer","data-testid":"menu-item-all-platforms",children:t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{children:"All Platforms"}),M&&t.jsx(Xt,{className:"h-4 w-4"})]})}),w.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsx(Qa,{className:"text-xs text-muted-foreground uppercase",children:"Connected Accounts"}),w.map(({platform:C,account:L})=>{const W=wd(C.name),q=W.icon,I=e.includes(L.configId);return t.jsx(Es,{onClick:F=>{F.preventDefault(),s(L.configId)},className:"cursor-pointer","data-testid":`menu-item-config-${L.configId}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),t.jsx(q,{className:`h-4 w-4 ${W.color}`}),t.jsx("span",{className:"flex-1 truncate",children:L.accountName}),t.jsx(ka,{checked:I,className:"h-4 w-4","data-testid":`checkbox-config-${L.configId}`})]})},L.configId)})]}),v.some(C=>C.disconnectedWithPendingPosts&&C.disconnectedWithPendingPosts.length>0)&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsxs(Qa,{className:"text-xs uppercase flex items-center gap-2 text-purple-400",children:[t.jsx(Zh,{className:"h-3 w-3"}),"Needs Reconnection"]}),v.map(C=>{var L;return(L=C.disconnectedWithPendingPosts)==null?void 0:L.map(W=>{const q=wd(C.name),I=q.icon;return t.jsx(Es,{className:"cursor-pointer",onSelect:F=>F.preventDefault(),"data-testid":`menu-item-reconnect-${W.configId}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-purple-500"}),t.jsx(I,{className:`h-4 w-4 ${q.color}`}),t.jsxs("div",{className:"flex-1",children:[t.jsx("span",{className:"truncate",children:W.accountName}),t.jsxs("span",{className:"text-xs text-purple-400 ml-1",children:["(",W.pendingPostCount," pending)"]})]}),t.jsx(T,{size:"sm",onClick:F=>P(C.name,F,W.configId),disabled:j.isPending,className:"h-7 px-3 text-xs bg-purple-600 hover:bg-purple-700","data-testid":`button-reconnect-${W.configId}`,children:"Re-Connect"})]})},`reconnect-${W.configId}`)})})]}),S.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsxs(Qa,{className:"text-xs text-muted-foreground uppercase flex items-center gap-2",children:["Add Another Account",!y&&t.jsxs(xe,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 bg-amber-500/10 text-amber-500 border-amber-500/30",children:[t.jsx(tf,{className:"h-2.5 w-2.5 mr-0.5"}),"Pro"]})]}),S.map(C=>{const L=wd(C.name),W=L.icon;return t.jsx(Es,{className:`cursor-pointer ${y?"":"opacity-50"}`,onSelect:q=>q.preventDefault(),"data-testid":`menu-item-add-${C.name}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx(Ds,{className:"h-3 w-3 text-muted-foreground"}),t.jsx(W,{className:`h-4 w-4 ${L.color}`}),t.jsxs("span",{className:"flex-1",children:["Add ",C.displayName]}),y?t.jsx(T,{size:"sm",onClick:q=>P(C.name,q),disabled:j.isPending,className:"h-7 px-3 text-xs","data-testid":`button-add-${C.name}`,children:"Add"}):t.jsx(T,{size:"sm",onClick:g,className:"h-7 px-3 text-xs","data-testid":`button-upgrade-${C.name}`,children:"Upgrade"})]})},`add-${C.name}`)})]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsx(Qa,{className:"text-xs text-muted-foreground uppercase",children:"Available Platforms"}),k.map(C=>{const L=wd(C.name),W=L.icon;return t.jsx(Es,{className:"cursor-pointer",onSelect:q=>q.preventDefault(),"data-testid":`menu-item-available-${C.name}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx(W,{className:`h-4 w-4 ${L.color}`}),t.jsx("span",{className:"flex-1",children:C.displayName}),t.jsx(T,{size:"sm",onClick:q=>P(C.name,q),disabled:j.isPending,className:"h-7 px-3 text-xs","data-testid":`button-connect-${C.name}`,children:"Connect"})]})},C.platformId)})]})]})]}),t.jsx(SA,{open:d,onOpenChange:C=>{u(C),C||p(void 0)},onComplete:A,reconnectConfigId:h})]})}const ZB=new Set(["extensions.socialmonkey.ai","socialmonkey.ai","www.socialmonkey.ai","socialmonkey.replit.app"]),JB=/^b97bdf83-839c-4546-95ce-99da2e78b918-[a-z0-9-]+(?:\.[a-z0-9-]+)*\.replit\.dev$/,eq=/^app_media\/p
638ost_(?:images|videos|audio)\/[A-Za-z0-9_-]+\.(?:jpg|png|gif|webp|mp4|webm|mov|avi|mkv|mp3|wav|ogg|aac|m4a|flac)$/;function tq(e){if(/[\\%]/.test(e)||e.includes("/../")||e.includes("/./"))return null;let s=e;if(!e.startsWith("/api/media-proxy/"))try{const n=new URL(e);if(n.protocol!=="https:"||n.username||n.password||n.port||n.search||n.hash||!ZB.has(n.hostname)&&!JB.test(n.hostname))return null;s=n.pathname}catch{return null}const r="/api/media-proxy/";return s.startsWith(r)&&eq.test(s.slice(r.length))?s:null}function ft(e){return tq(e)??e}var Zv="Radio",[sq,CA]=Ws(Zv),[rq,nq]=sq(Zv),PA=m.forwardRef((e,s)=>{const{__scopeRadio:r,name:n,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:d,...u}=e,[h,p]=m.useState(null),x=lt(s,b=>p(b)),v=m.useRef(!1),f=h?d||!!h.closest("form"):!0;return t.jsxs(rq,{scope:r,checked:a,disabled:o,children:[t.jsx(Ge.button,{type:"button",role:"radio","aria-checked":a,"data-state":_A(a),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:x,onClick:Ce(e.onClick,b=>{a||c==null||c(),f&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),f&&t.jsx(aq,{control:h,bubbles:!v.current,name:n,value:l,checked:a,required:i,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});PA.displayName=Zv;var TA="RadioIndicator",AA=m.forwardRef((e,s)=>{const{__scopeRadio:r,forceMount:n,...a}=e,i=nq(TA,r);return t.jsx(Ks,{present:n||i.checked,children:t.jsx(Ge.span,{"data-state":_A(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:s})})});AA.displayName=TA;var aq=e=>{const{control:s,checked:r,bubbles:n=!0,...a}=e,i=m.useRef(null),o=vf(r),l=lf(s);return m.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==r&&h){const p=new Event("click",{bubbles:n});h.call(c,r),c.dispatchEvent(p)}},[o,r,n]),t.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function _A(e){return e?"checked":"unchecked"}var iq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Jv="RadioGroup",[oq,QQ]=Ws(Jv,[td,CA]),EA=td(),IA=CA(),[lq,cq]=oq(Jv),MA=m.forwardRef((e,s)=>{const{__scopeRadioGroup:r,name:n,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:h,...p}=e,x=EA(r),v=ed(d),[f,b]=bn({prop:i,defaultProp:a,onChange:h});return t.jsx(lq,{scope:r,name:n,required:o,disabled:l,value:f,onValueChange:b,children:t.jsx(Tv,{asChild:!0,...x,orientation:c,dir:v,loop:u,children:t.jsx(Ge.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...p,ref:s})})})});MA.displayName=Jv;var RA="RadioGroupItem",FA=m.forwardRef((e,s)=>{const{__scopeRadioGroup:r,disabled:n,...a}=e,i=cq(RA,r),o=i.disabled||n,l=EA(r),c=IA(r),d=m.useRef(null),u=lt(s,d),h=i.value===a.value,p=m.useRef(!1);return m.useEffect(()=>{const x=f=>{iq.includes(f.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",x),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",x),document.removeEventListener("keyup",v)}},[]),t.jsx(Av,{asChild:!0,...l,focusable:!o,active:h,children:t.jsx(PA,{disabled:o,required:i.required,
638checked:h,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:Ce(x=>{x.key==="Enter"&&x.preventDefault()}),onFocus:Ce(a.onFocus,()=>{var x;p.current&&((x=d.current)==null||x.click())})})})});FA.displayName=RA;var dq="RadioGroupIndicator",DA=m.forwardRef((e,s)=>{const{__scopeRadioGroup:r,...n}=e,a=IA(r);return t.jsx(AA,{...a,...n,ref:s})});DA.displayName=dq;var LA=MA,OA=FA,uq=DA;const My=m.forwardRef(({className:e,...s},r)=>t.jsx(LA,{className:je("grid gap-2",e),...s,ref:r}));My.displayName=LA.displayName;const Ry=m.forwardRef(({className:e,...s},r)=>t.jsx(OA,{ref:r,className:je("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),...s,children:t.jsx(uq,{className:"flex items-center justify-center",children:t.jsx(cP,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ry.displayName=OA.displayName;function $A(e,s){var d,u,h;const r=e.successful,n=e.results.filter(p=>p.status==="failed"),a=e.results.filter(p=>p.status==="posting"),i=e.results.filter(p=>p.status==="not_eligible"),o=e.results.filter(p=>p.status==="posted"&&p.attempted===!1).length,l=p=>(s==null?void 0:s(p.platformConfigId,p.platform))||`${p.platform}${p.platformConfigId?` (account #${p.platformConfigId})`:""}`,c=[r?`Posted: ${e.results.filter(p=>p.status==="posted"&&p.attempted!==!1).map(l).join(", ")}`:"",o>0?`${o} already posted`:"",n.length?`Failed: ${n.map(p=>`${l(p)}${p.errorReason?` — ${p.errorReason.slice(0,100)}`:""}`).join("; ")}`:"",a.length?`Status pending confirmation: ${a.map(l).join(", ")}`:"",i.length?`Not sent: ${i.map(l).join(", ")}`:"",(d=e.errors)!=null&&d.some(p=>p.startsWith("Fatal:"))?"Could not confirm every delivery; check the calendar before trying again":"",n.length?"Open Needs attention on the dashboard to review and retry failed accounts. Posted accounts will not be resent":"",a.length?"Check status before trying again; pending confirmation is not safe to retry":"",r&&!n.length&&!a.length?"See published posts in Recent on the dashboard":""].filter(Boolean).join(". ");return{title:(u=e.errors)!=null&&u.some(p=>p.startsWith("Fatal:"))?"Posting status unavailable":n.length?r?"Partially posted":"Post failed":a.length?"Posting in progress":r?"Posted successfully":o>0?"Already posted":"Nothing was posted",description:c||"No eligible accounts were posted. Check the dashboard before trying again.",variant:n.length||(h=e.errors)!=null&&h.length?"destructive":void 0}}function jp(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function io(e){return e.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}function wp(e){return e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})}function mq(e){var s;return((s=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts(e).find(r=>r.type==="timeZoneName"))==null?void 0:s.value)||Intl.DateTimeFormat().resolvedOptions().timeZone||"local time"}function ec(e){return`${io(e)} at ${wp(e)} ${mq(e)}`}function Vc(e=0){const s=new Date;return new Date(s.getFullYear(),s.getMonth(),s.getDate()+e,12)}function Xa(e){return e.includes("failed")?{label:"Failed · retry in details",className:"border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-400"}:e.includes("posting")?{label:"Status pending",className:"border-blue-500/40 bg-blue-500/10 text-blue-600 dark:text-blue-400"}:e.includes("pending")?{label:"Needs review",className:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-400"}:e.includes("approved")?{label:"Scheduled",className:"border-green-500/40 bg-green-500/10 text-green-700 dark:text-green-400"}:{label:"Not scheduled",className:"border-border bg-muted text-muted-foreground"}}function hq(e,s,r){const n=e.map(o=>`${r(o.platformConfigId,o.platform)} — ${ec(new Date(o.scheduledTime))}`),a=new Set(e.map(o=>o.platformConfigId)),i=s.filter(o=>!a.has(o));return{title:i.length?"Some accounts were not scheduled":"Post scheduled",description:[n.length?`Scheduled (not yet published): ${n.join("; ")}.`:"No accounts were scheduled.",i.length?`${i.map(o=>r(o,"account")).join(", ")} not scheduled; check the connection before trying again.`:"","Find your post in Scheduled on the dashboard."].filter(
638Boolean).join(" "),variant:i.length?"destructive":void 0}}function eb(e,s){if(!e||!s)return null;const r=new Date(`${e}T${s}`);if(Number.isNaN(r.getTime()))return null;const n=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`,a=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return n===e&&a===s?r:null}function Km(e,s){var a,i;if(!Number.isFinite(e.getTime()))throw new Error("Invalid current time");const r=new Intl.DateTimeFormat("en-US",{timeZone:s,minute:"2-digit",second:"2-digit"}),n=Math.floor(e.getTime()/6e4)*6e4+6e4;for(let o=0;o<180;o++){const l=new Date(n+o*6e4),c=r.formatToParts(l);if(((a=c.find(d=>d.type==="minute"))==null?void 0:a.value)==="00"&&((i=c.find(d=>d.type==="second"))==null?void 0:i.value)==="00")return l}throw new Error("Unable to find the next clock hour in this timezone")}function pq(e,s,r,n,a,i=new Date){if(e==="custom"){const o=eb(s,r);if(!o||o<=i)throw new Error("Choose a valid future time in your local timezone. Times skipped by daylight saving cannot be scheduled.");return o.toISOString()}if(e==="next-hour"&&a){if(n<=i)throw new Error("The previewed hour has passed. Refresh next hour and review the new time.");return n.toISOString()}}const zA="YouTube requires a video (including Shorts). Image and text-only Community posts are not supported here.",fq="YouTube requires a video. Attach a video or remove YouTube from this image or text post before scheduling.";function UA(e){if(typeof e!="string"||!e.trim())return!1;let s;try{s=new URL(e).pathname}catch{s=e.split(/[?#]/)[0]}return/\.(mp4|mov|avi|webm|m4v|mkv)$/i.test(s)}function VA(e,s){return e.some(r=>r.toLowerCase()==="youtube")&&!UA(s)?fq:null}function xq(e,s){return m.useReducer((r,n)=>s[r][n]??r,e)}var tb="ScrollArea",[BA,YQ]=Ws(tb),[gq,Pn]=BA(tb),qA=m.forwardRef((e,s)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=e,[l,c]=m.useState(null),[d,u]=m.useState(null),[h,p]=m.useState(null),[x,v]=m.useState(null),[f,b]=m.useState(null),[y,g]=m.useState(0),[j,N]=m.useState(0),[w,S]=m.useState(!1),[k,P]=m.useState(!1),A=lt(s,_=>c(_)),$=ed(a);return t.jsx(gq,{scope:r,type:n,dir:$,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:h,onContentChange:p,scrollbarX:x,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:S,scrollbarY:f,onScrollbarYChange:b,scrollbarYEnabled:k,onScrollbarYEnabledChange:P,onCornerWidthChange:g,onCornerHeightChange:N,children:t.jsx(Ge.div,{dir:$,...o,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});qA.displayName=tb;var WA="ScrollAreaViewport",KA=m.forwardRef((e,s)=>{const{__scopeScrollArea:r,children:n,nonce:a,...i}=e,o=Pn(WA,r),l=m.useRef(null),c=lt(s,l,o.onViewportChange);return t.jsxs(t.Fragment,{children:[t.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}),t.jsx(Ge.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});KA.displayName=WA;var Fa="ScrollAreaScrollbar",sb=m.forwardRef((e,s)=>{const{forceMount:r,...n}=e,a=Pn(Fa,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=e.orientation==="horizontal";return m.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?t.jsx(yq,{...n,ref:s,forceMount:r}):a.type==="scroll"?t.jsx(vq,{...n,ref:s,forceMount:r}):a.type==="auto"?t.jsx(GA,{...n,ref:s,forceMount:r}):a.type==="always"?t.jsx(rb,{...n,ref:s}):null});sb.displayName=Fa;var yq=m.forwardRef((e,s)=>{const{forceMount:r,...n}=e,a=Pn(Fa,e.__scopeScrollArea),[i,o]=m.useState(!1);return m.useEffect(()=>{const l=a.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),o(!0)},u=()=>{c=window.setTimeout(()=>
vendor: 2,680 bytes, line 638
638o(!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]),t.jsx(Ks,{present:r||i,children:t.jsx(GA,{"data-state":i?"visible":"hidden",...n,ref:s})})}),vq=m.forwardRef((e,s)=>{const{forceMount:r,...n}=e,a=Pn(Fa,e.__scopeScrollArea),i=e.orientation==="horizontal",o=If(()=>c("SCROLL_END"),100),[l,c]=xq("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 m.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,c]),m.useEffect(()=>{const d=a.viewport,u=i?"scrollLeft":"scrollTop";if(d){let h=d[u];const p=()=>{const x=d[u];h!==x&&(c("SCROLL"),o()),h=x};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[a.viewport,i,c,o]),t.jsx(Ks,{present:r||l!=="hidden",children:t.jsx(rb,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:s,onPointerEnter:Ce(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),GA=m.forwardRef((e,s)=>{const r=Pn(Fa,e.__scopeScrollArea),{forceMount:n,...a}=e,[i,o]=m.useState(!1),l=e.orientation==="horizontal",c=If(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;o(l?d:u)}},10);return Bc(r.viewport,c),Bc(r.content,c),t.jsx(Ks,{present:n||i,children:t.jsx(rb,{"data-state":i?"visible":"hidden",...a,ref:s})})}),rb=m.forwardRef((e,s)=>{const{orientation:r="vertical",...n}=e,a=Pn(Fa,e.__scopeScrollArea),i=m.useRef(null),o=m.useRef(0),[l,c]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ZA(l.viewport,l.content),u={...n,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function h(p,x){return Sq(p,o.current,l,x)}return r==="horizontal"?t.jsx(bq,{...u,ref:s,onThumbPositionChange:()=>{if(a.viewport&&i.current){const p=a.viewport.scrollLeft,x=oN(p,l,a.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:p=>{a.viewport&&(a.viewport.scrollLeft=p)},onDragScroll:p=>{a.viewport&&(a.viewport.scrollLeft=h(p,a.dir))}}):r==="vertical"?t.jsx(jq,{...u,ref:s,onThumbPositionChange:()=>{if(a.viewport&&i.current){const p=a.viewport.scrollTop,x=oN(p,l);i.current.style.transform=`translate3d(0, ${x}
638px, 0)`}},onWheelScroll:p=>{a.viewport&&(a.viewport.scrollTop=p)},onDragScroll:p=>{a.viewport&&(a.viewport.scrollTop=h(p))}}):null}),bq=m.forwardRef((e,s)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Pn(Fa,e.__scopeScrollArea),[o,l]=m.useState(),c=m.useRef(null),d=lt(s,c,i.onScrollbarXChange);return m.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),t.jsx(QA,{"data-orientation":"horizontal",...a,ref:d,sizes:r,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":Ef(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),e_(p,h)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:kp(o.paddingLeft),paddingEnd:kp(o.paddingRight)}})}})}),jq=m.forwardRef((e,s)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Pn(Fa,e.__scopeScrollArea),[o,l]=m.useState(),c=m.useRef(null),d=lt(s,c,i.onScrollbarYChange);return m.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),t.jsx(QA,{"data-orientation":"vertical",...a,ref:d,sizes:r,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":Ef(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),e_(p,h)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:kp(o.paddingTop),paddingEnd:kp(o.paddingBottom)}})}})}),[wq,HA]=BA(Fa),QA=m.forwardRef((e,s)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:h,...p}=e,x=Pn(Fa,r),[v,f]=m.useState(null),b=lt(s,A=>f(A)),y=m.useRef(null),g=m.useRef(""),j=x.viewport,N=n.content-n.viewport,w=ns(u),S=ns(c),k=If(h,10);function P(A){if(y.current){const $=A.clientX-y.current.left,_=A.clientY-y.current.top;d({x:$,y:_})}}return m.useEffect(()=>{const A=$=>{const _=$.target;(v==null?void 0:v.contains(_))&&w($,N)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,v,N,w]),m.useEffect(S,[n,S]),Bc(v,k),Bc(x.content,k),t.jsx(wq,{scope:r,scrollbar:v,hasThumb:a,onThumbChange:ns(i),onThumbPointerUp:ns(o),onThumbPositionChange:S,onThumbPointerDown:ns(l),children:t.jsx(Ge.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:Ce(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),y.current=v.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),P(A))}),onPointerMove:Ce(e.onPointerMove,P),onPointerUp:Ce(e.onPointerUp,A=>{const $=A.target;$.hasPointerCapture(A.pointerId)&&$.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=g.current,x.viewport&&(x.viewport.style.scrollBehavior=""),y.current=null})})})}),Np="ScrollAreaThumb",YA=m.forwardRef((e,s)=>{const{forceMount:r,...n}=e,a=HA(Np,e.__scopeScrollArea);return t.jsx(Ks,{present:r||a.hasThumb,children:t.jsx(Nq,{ref:s,...n})})}),Nq=m.forwardRef((e,s)=>{const{__scopeScrollArea:r,style:n,...a}=e,i=Pn(Np,r),o=HA(Np,r),{onThumbPositionChange:l}=o,c=lt(s,h=>o.onThumbChange(h)),d=m.useRef(void 0),u=If(()=>{d.current&&(d.current(),d.current=void 0)},100);return m.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(u(),!d.current){const x=Cq(h,l);d.current=x,l()}};return l(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,u,l]),t.jsx(Ge.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)",...n},onPointerDownCapture:Ce(e.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),v=h.clientX-x.left,f=h.clientY-x.top;o.onThumbPointerDown({x:v,y:f})}),onPointerUp:Ce(e.onPointerUp,o.onThumbPointerUp)})});YA.displayName=Np;var nb="ScrollAreaCorner",XA=m.forwardRef((e,s)=>{const r=Pn(nb,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?t.jsx(kq,{...e,ref:s}):null});
638XA.displayName=nb;var kq=m.forwardRef((e,s)=>{const{__scopeScrollArea:r,...n}=e,a=Pn(nb,r),[i,o]=m.useState(0),[l,c]=m.useState(0),d=!!(i&&l);return Bc(a.scrollbarX,()=>{var h;const u=((h=a.scrollbarX)==null?void 0:h.offsetHeight)||0;a.onCornerHeightChange(u),c(u)}),Bc(a.scrollbarY,()=>{var h;const u=((h=a.scrollbarY)==null?void 0:h.offsetWidth)||0;a.onCornerWidthChange(u),o(u)}),d?t.jsx(Ge.div,{...n,ref:s,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 kp(e){return e?parseInt(e,10):0}function ZA(e,s){const r=e/s;return isNaN(r)?0:r}function Ef(e){const s=ZA(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*s;return Math.max(n,18)}function Sq(e,s,r,n="ltr"){const a=Ef(r),i=a/2,o=s||i,l=a-o,c=r.scrollbar.paddingStart+o,d=r.scrollbar.size-r.scrollbar.paddingEnd-l,u=r.content-r.viewport,h=n==="ltr"?[0,u]:[u*-1,0];return JA([c,d],h)(e)}function oN(e,s,r="ltr"){const n=Ef(s),a=s.scrollbar.paddingStart+s.scrollbar.paddingEnd,i=s.scrollbar.size-a,o=s.content-s.viewport,l=i-n,c=r==="ltr"?[0,o]:[o*-1,0],d=vy(e,c);return JA([0,o],[0,l])(d)}function JA(e,s){return r=>{if(e[0]===e[1]||s[0]===s[1])return s[0];const n=(s[1]-s[0])/(e[1]-e[0]);return s[0]+n*(r-e[0])}}function e_(e,s){return e>0&&e<s}var Cq=(e,s=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&s(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function If(e,s){const r=ns(e),n=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),m.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,s)},[r,s])}function Bc(e,s){const r=ns(s);qs(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,r])}var t_=qA,Pq=KA,Tq=XA;const ab=m.forwardRef(({className:e,children:s,...r},n)=>t.jsxs(t_,{ref:n,className:je("relative overflow-hidden",e),...r,children:[t.jsx(Pq,{className:"h-full w-full rounded-[inherit]",children:s}),t.jsx(s_,{}),t.jsx(Tq,{})]}));ab.displayName=t_.displayName;const s_=m.forwardRef(({className:e,orientation:s="vertical",...r},n)=>t.jsx(sb,{ref:n,orientation:s,className:je("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:t.jsx(YA,{className:"relative flex-1 rounded-full bg-border"})}));s_.displayName=sb.displayName;function Aq(e){var r;const s=((r=e.split(".").pop())==null?void 0:r.toLowerCase())||"";return["mp4","webm","ogv","mov","avi","mkv","m4v"].includes(s)?"Video":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(s)?"Image":["mp3","wav","ogg","oga","aac","m4a","flac","weba"].includes(s)?"Audio":"Video"}const lN={Video:{icon:Xr,label:"Video",color:"text-blue-600 dark:text-blue-400"},Image:{icon:Ft,label:"Image",color:"text-green-600 dark:text-green-400"},Audio:{icon:pu,label:"Audio",color:"text-purple-600 dark:text-purple-400"}};function cN({open:e,onOpenChange:s,onSelect:r,allowedTypes:n=["image","video"]}){const[a,i]=m.useState(""),[o,l]=m.useState(null),{data:c=[],isLoading:d}=Ee({queryKey:["/api/vidmonkey/videos"],enabled:e}),u=m.useMemo(()=>c.map(x=>({...x,media_type:x.content_type||Aq(x.media_url)})),[c]),h=m.useMemo(()=>{let x=u;if(n.length>0&&(x=x.filter(v=>{var b;const f=(b=v.media_type)==null?void 0:b.toLowerCase();return n.includes(f)})),a.trim()){const v=a.toLowerCase();x=x.filter(f=>{var b,y;return((b=f.generated_title)==null?void 0:b.toLowerCase().includes(v))||((y=f.generated_description)==null?void 0:y.toLowerCase().includes(v))})}return x},[u,n,a]),p=()=>{var b;if(o===null)return;const x=u.find(y=>y.id===o);if(!x)return;const v=((b=x.media_type)==null?void 0:b.toLowerCase())==="video"?"video":"image",f=v==="video"&&x.aspect_ratio?x.aspect_ratio:void 0;r(x.media_url,v,f),s(!1),l(null),i("")};return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-4xl max-h-[80vh]",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Select from Media Library"}),t.jsxs(Ns,{children:["Choose an ",n.join(" or ")," from your media library"]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx(J0,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t.jsx(Ke,{placeholder:"Search by title or description...",value:a,onChange:x=>i(x.target.value),className:"pl-9","data-testid":"input-media-search"})]}),t.jsx(ab,{className:"h-[400px]",children:d?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("p",{className:"text-muted-foreground",children:"Loading media library..."})}):h.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("p",{className:"text-muted-foreground",children:a?"No media found matching your search":"No media in your library yet"})}):t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 pr-4",children:h.map(x=>{const v=lN[x.media_type||"Image"].icon,f=o===x.id,b=x.media_type==="Video";return t.jsxs("button",{onClick:()=>l(x.id),className:`relative group rounded-lg overflow-hidden border-2 transition-all hover-elevate ${f?"border-primary ring-2 ring-primary":"border-transparent"}`,"data-testid":`button-media-${x.id}`,children:[t.jsxs("div",{className:"aspect-video bg-muted relative",children:[b?t.jsx("video",{src:ft(x.media_url),className:"w-full h-full object-cover",muted:!0}
638):t.jsx("img",{src:ft(x.media_url),alt:x.generated_title,className:"w-full h-full object-cover"}),f&&t.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:t.jsx(Xt,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"p-3 bg-card",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(v,{className:`h-4 w-4 ${lN[x.media_type||"Image"].color}`}),t.jsx(xe,{variant:"secondary",className:"text-xs",children:x.media_type})]}),t.jsx("p",{className:"text-sm font-medium line-clamp-1",children:x.generated_title||"Untitled"}),x.generated_description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:x.generated_description})]})]},x.id)})})}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[t.jsx(T,{variant:"outline",onClick:()=>{s(!1),l(null),i("")},"data-testid":"button-cancel",children:"Cancel"}),t.jsx(T,{onClick:p,disabled:o===null,"data-testid":"button-select-media",children:"Select Media"})]})]})]})})}const ue=Symbol.for("drizzle:entityKind");function As(e,s){if(!e||typeof e!="object")return!1;if(e instanceof s)return!0;if(!Object.prototype.hasOwnProperty.call(s,ue))throw new Error(`Class "${s.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let r=Object.getPrototypeOf(e).constructor;if(r)for(;r;){if(ue in r&&r[ue]===s[ue])return!0;r=Object.getPrototypeOf(r)}return!1}var XN;XN=ue;class qc{constructor(s,r){V(this,"name");V(this,"keyAsName");V(this,"primary");V(this,"notNull");V(this,"default");V(this,"defaultFn");V(this,"onUpdateFn");V(this,"hasDefault");V(this,"isUnique");V(this,"uniqueName");V(this,"uniqueType");V(this,"dataType");V(this,"columnType");V(this,"enumValues");V(this,"generated");V(this,"generatedIdentity");V(this,"config");this.table=s,this.config=r,this.name=r.name,this.keyAsName=r.keyAsName,this.notNull=r.notNull,this.default=r.default,this.defaultFn=r.defaultFn,this.onUpdateFn=r.onUpdateFn,this.hasDefault=r.hasDefault,this.primary=r.primaryKey,this.isUnique=r.isUnique,this.uniqueName=r.uniqueName,this.uniqueType=r.uniqueType,this.dataType=r.dataType,this.columnType=r.columnType,this.generated=r.generated,this.generatedIdentity=r.generatedIdentity}mapFromDriverValue(s){return s}mapToDriverValue(s){return s}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}V(qc,XN,"Column");var ZN;ZN=ue;class r_{constructor(s,r,n){V(this,"config");V(this,"$default",this.$defaultFn);V(this,"$onUpdate",this.$onUpdateFn);this.config={name:s,keyAsName:s==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:r,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(s){return this.config.default=s,this.config.hasDefault=!0,this}$defaultFn(s){return this.config.defaultFn=s,this.config.hasDefault=!0,this}$onUpdateFn(s){return this.config.onUpdateFn=s,this.config.hasDefault=!0,this}primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(s){this.config.name===""&&(this.config.name=s)}}V(r_,ZN,"ColumnBuilder");const tc=Symbol.for("drizzle:Name");var JN;JN=ue;class n_{constructor(s,r){V(this,"reference");V(this,"_onUpdate","no action");V(this,"_onDelete","no action");this.reference=()=>{const{name:n,columns:a,foreignColumns:i}=s();return{name:n,columns:a,foreignTable:i[0].table,foreignColumns:i}},r&&(this._onUpdate=r.onUpdate,this._onDelete=r.onDelete)}onUpdate(s){return this._onUpdate=s===void 0?"no action":s,this}onDelete(s){return this._onDelete=s===void 0?"no action":s,this}build(s){return new a_(s,this)}}V(n_,JN,"PgForeignKeyBuilder");var e1;e1=ue;class a_{constructor(s,r){V(this,"reference");V(this,"onUpdate");V(this,"onDelete");this.table=s,this.reference=r.reference,this.onUpdate=r._onUpdate,this.onDelete=r._onDelete}getName(){const{name:s,columns:r,foreignColumns:n}=this.reference(),a=r.map(l=>l.name),i=n.map(l=>l.name),o=[this.table[tc],...a,n[0].table[tc],...i];return s??`${o.join("_")}_fk`}}V(a_,e1,"PgForeignKey");function _q(e,...s){return e(...s)}function Mf(e){return new l_(e)}function i_(e,s){return`${e[tc]}_${s.join("_")}_unique`}var t1;t1=ue;class o_{constructor(s,r){V(this,"columns");V(this,"nullsNotDistinctConfig",!1);this.name=r,this.columns=s}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(s){return new c_(s,this.columns,this.nullsNotDistinctConfig,this.name)}}V(o_,t1,"PgUniqueConstraintBuilder");var s1;s1=ue;class l_{constructor(s){V(this,"name");this.name=s}on(...s){return new o_(s,this.name)}}V(l_,s1,"PgUniqueOnConstraintBuilder");var r1;r1=ue;class c_{constructor(s,r,n,a){V(this,"columns");V(this,"name");V(this,"nullsNotDistinct",!1);this.table=s,this.columns=r,this.name=a??i_(this.table,this.columns.map(i=>i.name)),this.nullsNotDistinct=n}getName(){return this.name}}V(c_,r1,"PgUniqueConstraint");function dN(e,s,r){for(let n=s;n<e.length;n++){const a=e[n];if(a==="\\"){n++;continue}if(a==='"')return[e.slice(s,n).replace(/\\/g,""),n+1];if(!r&&(a===","||a==="}"))return[e.slice(s,n).replace(/\\/g,""),n]}return[e.slice(s).replace(/\\/g,""),e.length]}function d_(e,s=0){const r=[];let n=s,a=!1;for(;n<e.length;){const i=e[n];if(i===","){(a||n===s)&&r.push(""),a=!0,n++;continue}if(a=!1,i==="\\"){n+=2;continue}if(i==='"'){const[c,d]=dN(e,n+1,!0);r.push(c),n=d;continue}if(i==="}")return[r,n+1];if(i==="{"){const[c,d]=d_(e,n+1);
638r.push(c),n=d;continue}const[o,l]=dN(e,n,!1);r.push(o),n=l}return[r,n]}function Eq(e){const[s]=d_(e,1);return s}function u_(e){return`{${e.map(s=>Array.isArray(s)?u_(s):typeof s=="string"?`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${s}`).join(",")}}`}var n1,a1;class Ct extends(a1=r_,n1=ue,a1){constructor(){super(...arguments);V(this,"foreignKeyConfigs",[])}array(r){return new h_(this.config.name,this,r)}references(r,n={}){return this.foreignKeyConfigs.push({ref:r,actions:n}),this}unique(r,n){return this.config.isUnique=!0,this.config.uniqueName=r,this.config.uniqueType=n==null?void 0:n.nulls,this}generatedAlwaysAs(r){return this.config.generated={as:r,type:"always",mode:"stored"},this}buildForeignKeys(r,n){return this.foreignKeyConfigs.map(({ref:a,actions:i})=>_q((o,l)=>{const c=new n_(()=>{const d=o();return{columns:[r],foreignColumns:[d]}});return l.onUpdate&&c.onUpdate(l.onUpdate),l.onDelete&&c.onDelete(l.onDelete),c.build(n)},a,i))}buildExtraConfigColumn(r){return new m_(r,this.config)}}V(Ct,n1,"PgColumnBuilder");var i1,o1;class ct extends(o1=qc,i1=ue,o1){constructor(s,r){r.uniqueName||(r.uniqueName=i_(s,[r.name])),super(s,r),this.table=s}}V(ct,i1,"PgColumn");var l1,c1;class m_ extends(c1=ct,l1=ue,c1){constructor(){super(...arguments);V(this,"indexConfig",{order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass});V(this,"defaultConfig",{order:"asc",nulls:"last",opClass:void 0})}getSQLType(){return this.getSQLType()}asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(r){return this.indexConfig.opClass=r,this}}V(m_,l1,"ExtraConfigColumn");var d1;d1=ue;class yh{constructor(s,r,n,a){V(this,"name");V(this,"keyAsName");V(this,"type");V(this,"indexConfig");this.name=s,this.keyAsName=r,this.type=n,this.indexConfig=a}}V(yh,d1,"IndexedColumn");var u1,m1;class h_ extends(m1=Ct,u1=ue,m1){constructor(s,r,n){super(s,"array","PgArray"),this.config.baseBuilder=r,this.config.size=n}build(s){const r=this.config.baseBuilder.build(s);return new Fy(s,this.config,r)}}V(h_,u1,"PgArrayBuilder");var h1,p1;const Ip=class Ip extends(p1=ct,h1=ue,p1){constructor(r,n,a,i){super(r,n);V(this,"size");this.baseColumn=a,this.range=i,this.size=n.size}getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(r){return typeof r=="string"&&(r=Eq(r)),r.map(n=>this.baseColumn.mapFromDriverValue(n))}mapToDriverValue(r,n=!1){const a=r.map(i=>i===null?null:As(this.baseColumn,Ip)?this.baseColumn.mapToDriverValue(i,!0):this.baseColumn.mapToDriverValue(i));return n?a:u_(a)}};V(Ip,h1,"PgArray");let Fy=Ip;const Dy=Symbol.for("drizzle:isPgEnum");function Iq(e){return!!e&&typeof e=="function"&&Dy in e&&e[Dy]===!0}var f1,x1;class p_ extends(x1=Ct,f1=ue,x1){constructor(s,r){super(s,"string","PgEnumColumn"),this.config.enum=r}build(s){return new f_(s,this.config)}}V(p_,f1,"PgEnumColumnBuilder");var g1,y1;class f_ extends(y1=ct,g1=ue,y1){constructor(r,n){super(r,n);V(this,"enum",this.config.enum);V(this,"enumValues",this.config.enum.enumValues);this.enum=n.enum}getSQLType(){return this.enum.enumName}}V(f_,g1,"PgEnumColumn");function Mq(e,s){return Rq(e,s,void 0)}function Rq(e,s,r){const n=Object.assign(a=>new p_(a??"",n),{enumName:e,enumValues:s,schema:r,[Dy]:!0});return n}var v1;v1=ue;class ib{constructor(s,r,n,a=!1){this._={brand:"Subquery",sql:s,selectedFields:r,alias:n,isWith:a}}}V(ib,v1,"Subquery");const Fq={startActiveSpan(e,s){return s()}},sc=Symbol.for("drizzle:ViewBaseConfig"),qx=Symbol.for("drizzle:Schema"),uN=Symbol.for("drizzle:Columns"),mN=Symbol.for("drizzle:ExtraConfigColumns"),Wx=Symbol.for("drizzle:OriginalName"),Kx=Symbol.for("drizzle:BaseName"),Sp=Symbol.for("drizzle:IsAlias"),hN=Symbol.for("drizzle:ExtraConfigBuilder"),x_=Symbol.for("drizzle:IsDrizzleTable");var b1,j1,w1,N1,k1,S1,C1,P1,T1,A1,Zm;let Gr=(A1=ue,T1=tc,P1=Wx,C1=qx,S1=uN,k1=mN,N1=Kx,w1=Sp,j1=x_,b1=hN,Zm=class{constructor(s,r,n){V(this,T1);V(this,P1);V(this,C1);V(this,S1);V(this,k1);V(this,N1);V(this,w1,!1);V(this,j1,!0);V(this,b1);this[tc]=this[Wx]=s,this[qx]=r,this[Kx]=n}},V(Zm,A1,"Table"),V(Zm,"Symbol",{Name:tc,Schema:qx,OriginalName:Wx,Columns:uN,ExtraConfigColumns:mN,BaseName:Kx,IsAlias:Sp,ExtraConfigBuilder:hN}),Zm);function g_(e){return typeof e=="object"&&e!==null&&x_ in e}function Dq(e){return e!=null&&typeof e.getSQL=="function"}function Lq(e){var r;const s={sql:"",params:[]};for(const n of e)s.sql+=n.sql,s.params.push(...n.params),(r=n.typings)!=null&&r.length&&(s.typings||(s.typings=[]),s.typings.push(...n.typings));return s}var _1;_1=ue;class dn{constructor(s){V(this,"value");this.value=Array.isArray(s)?s:[s]}getSQL(){return new fs([this])}}V(dn,_1,"StringChunk");var E1;E1=ue;const Co=class Co{constructor(s){V(this,"decoder",y_);V(this,"shouldInlineParams",!1);this.queryChunks=s}append(s){return this.queryChunks.push(...s.queryChunks),this}toQuery(s){return Fq.startActiveSpan("drizzle.buildSQL",r=>{const n=this.buildQueryFromSourceParams(this.queryChunks,s);return r==null||r.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(s,r){const n=Object.assign({},r,{inlineParams:r.inlineParams||this.shouldInlineParams,paramStartIndex:r.paramStartIndex||{value:0}}),{casing:a,escapeName:i,escapeParam:o,prepareTyping:l,inlineParams:c,paramStartIndex:d}=n;return Lq(s.map(u=>{var h;if(As(u,dn))return{sql:u.value.join(""),params:[]};if(As(u,Cp))return{sql:i(u.value),params:[]};if(u===void 0)return{sql:"",params:[]};if(Array.isArray(u)){const p=[new dn("(")];for(const[x,v]of u.entries())p.push(v),x<u.length-1&&p.push(new dn(", "));return p.push(new dn(")")),this.buildQueryFromSourceParams(p,n)}if(As(u,Co))return this.buildQueryFromSourceParams(u.queryChunks,{...n,inlineParams:c||u.shouldInlineParams});if(As(u,Gr)){const p=u[Gr.Symbol.Schema],x=u[Gr.Symbol.Name];return{sql:p===void 0||u[Sp]?i(x):i(p)+"."+i(x),params:[]}}if(As(u,qc)){const p=a.getColumnCasing(u);
638if(r.invokeSource==="indexes")return{sql:i(p),params:[]};const x=u.table[Gr.Symbol.Schema];return{sql:u.table[Sp]||x===void 0?i(u.table[Gr.Symbol.Name])+"."+i(p):i(x)+"."+i(u.table[Gr.Symbol.Name])+"."+i(p),params:[]}}if(As(u,j_)){const p=u[sc].schema,x=u[sc].name;return{sql:p===void 0||u[sc].isAlias?i(x):i(p)+"."+i(x),params:[]}}if(As(u,ob)){if(As(u.value,Pp))return{sql:o(d.value++,u),params:[u],typings:["none"]};const p=u.value===null?null:u.encoder.mapToDriverValue(u.value);if(As(p,Co))return this.buildQueryFromSourceParams([p],n);if(c)return{sql:this.mapInlineParam(p,n),params:[]};let x=["none"];return l&&(x=[l(u.encoder)]),{sql:o(d.value++,p),params:[p],typings:x}}return As(u,Pp)?{sql:o(d.value++,u),params:[u],typings:["none"]}:As(u,Co.Aliased)&&u.fieldAlias!==void 0?{sql:i(u.fieldAlias),params:[]}:As(u,ib)?u._.isWith?{sql:i(u._.alias),params:[]}:this.buildQueryFromSourceParams([new dn("("),u._.sql,new dn(") "),new Cp(u._.alias)],n):Iq(u)?u.schema?{sql:i(u.schema)+"."+i(u.enumName),params:[]}:{sql:i(u.enumName),params:[]}:Dq(u)?(h=u.shouldOmitSQLParens)!=null&&h.call(u)?this.buildQueryFromSourceParams([u.getSQL()],n):this.buildQueryFromSourceParams([new dn("("),u.getSQL(),new dn(")")],n):c?{sql:this.mapInlineParam(u,n),params:[]}:{sql:o(d.value++,u),params:[u],typings:["none"]}}))}mapInlineParam(s,{escapeString:r}){if(s===null)return"null";if(typeof s=="number"||typeof s=="boolean")return s.toString();if(typeof s=="string")return r(s);if(typeof s=="object"){const n=s.toString();return r(n==="[object Object]"?JSON.stringify(s):n)}throw new Error("Unexpected param value: "+s)}getSQL(){return this}as(s){return s===void 0?this:new Co.Aliased(this,s)}mapWith(s){return this.decoder=typeof s=="function"?{mapFromDriverValue:s}:s,this}inlineParams(){return this.shouldInlineParams=!0,this}if(s){return s?this:void 0}};V(Co,E1,"SQL");let fs=Co;var I1;I1=ue;class Cp{constructor(s){V(this,"brand");this.value=s}getSQL(){return new fs([this])}}V(Cp,I1,"Name");const y_={mapFromDriverValue:e=>e},v_={mapToDriverValue:e=>e};({...y_,...v_});var M1;M1=ue;class ob{constructor(s,r=v_){V(this,"brand");this.value=s,this.encoder=r}getSQL(){return new fs([this])}}V(ob,M1,"Param");function ea(e,...s){const r=[];(s.length>0||e.length>0&&e[0]!=="")&&r.push(new dn(e[0]));for(const[n,a]of s.entries())r.push(a,new dn(e[n+1]));return new fs(r)}(e=>{function s(){return new fs([])}e.empty=s;function r(c){return new fs(c)}e.fromList=r;function n(c){return new fs([new dn(c)])}e.raw=n;function a(c,d){const u=[];for(const[h,p]of c.entries())h>0&&d!==void 0&&u.push(d),u.push(p);return new fs(u)}e.join=a;function i(c){return new Cp(c)}e.identifier=i;function o(c){return new Pp(c)}e.placeholder=o;function l(c,d){return new ob(c,d)}e.param=l})(ea||(ea={}));(e=>{var r;r=ue;const n=class n{constructor(i,o){V(this,"isSelectionField",!1);this.sql=i,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};V(n,r,"SQL.Aliased");let s=n;e.Aliased=s})(fs||(fs={}));var R1;R1=ue;class Pp{constructor(s){this.name=s}getSQL(){return new fs([this])}}V(Pp,R1,"Placeholder");const b_=Symbol.for("drizzle:IsDrizzleView");var F1,D1,L1;L1=ue,D1=sc,F1=b_;class j_{constructor({name:s,schema:r,selectedFields:n,query:a}){V(this,D1);V(this,F1,!0);this[sc]={name:s,originalName:s,schema:r,selectedFields:n,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new fs([this])}}V(j_,L1,"View");function Oq(e){return typeof e=="object"&&e!==null&&b_ in e}qc.prototype.getSQL=function(){return new fs([this])};Gr.prototype.getSQL=function(){return new fs([this])};ib.prototype.getSQL=function(){return new fs([this])};function $q(e){return e[Gr.Symbol.Columns]}function zq(e){return e[sc].selectedFields}function Hs(e,s){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:s}}var O1,$1;class hm extends($1=Ct,O1=ue,$1){generatedAlwaysAsIdentity(s){if(s){const{name:r,...n}=s;this.config.generatedIdentity={type:"always",sequenceName:r,sequenceOptions:n}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(s){if(s){const{name:r,...n}=s;this.config.generatedIdentity={type:"byDefault",sequenceName:r,sequenceOptions:n}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}V(hm,O1,"PgIntColumnBaseBuilder");var z1,U1;class w_ extends(U1=hm,z1=ue,U1){constructor(s){super(s,"number","PgBigInt53")}build(s){return new N_(s,this.config)}}V(w_,z1,"PgBigInt53Builder");var V1,B1;class N_ extends(B1=ct,V1=ue,B1){getSQLType(){return"bigint"}mapFromDriverValue(s){return typeof s=="number"?s:Number(s)}}V(N_,V1,"PgBigInt53");var q1,W1;class k_ extends(W1=hm,q1=ue,W1){constructor(s){super(s,"bigint","PgBigInt64")}build(s){return new S_(s,this.config)}}V(k_,q1,"PgBigInt64Builder");var K1,G1;class S_ extends(G1=ct,K1=ue,G1){getSQLType(){return"bigint"}mapFromDriverValue(s){return BigInt(s)}}V(S_,K1,"PgBigInt64");function Uq(e,s){const{name:r,config:n}=Hs(e,s);return n.mode==="number"?new w_(r):new k_(r)}var H1,Q1;class C_ extends(Q1=Ct,H1=ue,Q1){constructor(s){super(s,"number","PgBigSeri
638al53"),this.config.hasDefault=!0,this.config.notNull=!0}build(s){return new P_(s,this.config)}}V(C_,H1,"PgBigSerial53Builder");var Y1,X1;class P_ extends(X1=ct,Y1=ue,X1){getSQLType(){return"bigserial"}mapFromDriverValue(s){return typeof s=="number"?s:Number(s)}}V(P_,Y1,"PgBigSerial53");var Z1,J1;class T_ extends(J1=Ct,Z1=ue,J1){constructor(s){super(s,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(s){return new A_(s,this.config)}}V(T_,Z1,"PgBigSerial64Builder");var e2,t2;class A_ extends(t2=ct,e2=ue,t2){getSQLType(){return"bigserial"}mapFromDriverValue(s){return BigInt(s)}}V(A_,e2,"PgBigSerial64");function Vq(e,s){const{name:r,config:n}=Hs(e,s);return n.mode==="number"?new C_(r):new T_(r)}var s2,r2;class __ extends(r2=Ct,s2=ue,r2){constructor(s){super(s,"boolean","PgBoolean")}build(s){return new E_(s,this.config)}}V(__,s2,"PgBooleanBuilder");var n2,a2;class E_ extends(a2=ct,n2=ue,a2){getSQLType(){return"boolean"}}V(E_,n2,"PgBoolean");function Vt(e){return new __(e??"")}var i2,o2;class I_ extends(o2=Ct,i2=ue,o2){constructor(s,r){super(s,"string","PgChar"),this.config.length=r.length,this.config.enumValues=r.enum}build(s){return new M_(s,this.config)}}V(I_,i2,"PgCharBuilder");var l2,c2;class M_ extends(c2=ct,l2=ue,c2){constructor(){super(...arguments);V(this,"length",this.config.length);V(this,"enumValues",this.config.enumValues)}getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}V(M_,l2,"PgChar");function Bq(e,s={}){const{name:r,config:n}=Hs(e,s);return new I_(r,n)}var d2,u2;class R_ extends(u2=Ct,d2=ue,u2){constructor(s){super(s,"string","PgCidr")}build(s){return new F_(s,this.config)}}V(R_,d2,"PgCidrBuilder");var m2,h2;class F_ extends(h2=ct,m2=ue,h2){getSQLType(){return"cidr"}}V(F_,m2,"PgCidr");function qq(e){return new R_(e??"")}var p2,f2;class D_ extends(f2=Ct,p2=ue,f2){constructor(s,r,n){super(s,"custom","PgCustomColumn"),this.config.fieldConfig=r,this.config.customTypeParams=n}build(s){return new L_(s,this.config)}}V(D_,p2,"PgCustomColumnBuilder");var x2,g2;class L_ extends(g2=ct,x2=ue,g2){constructor(r,n){super(r,n);V(this,"sqlName");V(this,"mapTo");V(this,"mapFrom");this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(r){return typeof this.mapFrom=="function"?this.mapFrom(r):r}mapToDriverValue(r){return typeof this.mapTo=="function"?this.mapTo(r):r}}V(L_,x2,"PgCustomColumn");function Wq(e){return(s,r)=>{const{name:n,config:a}=Hs(s,r);return new D_(n,a,e)}}var y2,v2;class ad extends(v2=Ct,y2=ue,v2){defaultNow(){return this.default(ea`now()`)}}V(ad,y2,"PgDateColumnBaseBuilder");var b2,j2;class O_ extends(j2=ad,b2=ue,j2){constructor(s){super(s,"date","PgDate")}build(s){return new $_(s,this.config)}}V(O_,b2,"PgDateBuilder");var w2,N2;class $_ extends(N2=ct,w2=ue,N2){getSQLType(){return"date"}mapFromDriverValue(s){return new Date(s)}mapToDriverValue(s){return s.toISOString()}}V($_,w2,"PgDate");var k2,S2;class z_ extends(S2=ad,k2=ue,S2){constructor(s){super(s,"string","PgDateString")}build(s){return new U_(s,this.config)}}V(z_,k2,"PgDateStringBuilder");var C2,P2;class U_ extends(P2=ct,C2=ue,P2){getSQLType(){return"date"}}V(U_,C2,"PgDateString");function Kq(e,s){const{name:r,config:n}=Hs(e,s);return(n==null?void 0:n.mode)==="date"?new O_(r):new z_(r)}var T2,A2;class V_ extends(A2=Ct,T2=ue,A2){constructor(s){super(s,"number","PgDoublePrecision")}build(s){return new B_(s,this.config)}}V(V_,T2,"PgDoublePrecisionBuilder");var _2,E2;class B_ extends(E2=ct,_2=ue,E2){getSQLType(){return"double precision"}mapFromDriverValue(s){return typeof s=="string"?Number.parseFloat(s):s}}V(B_,_2,"PgDoublePrecision");function Gq(e){return new V_(e??"")}var I2,M2;class q_ extends(M2=Ct,I2=ue,M2){constructor(s){super(s,"string","PgInet")}build(s){return new W_(s,this.config)}}V(q_,I2,"PgInetBuilder");var R2,F2;class W_ extends(F2=ct,R2=ue,F2){getSQLType(){return"inet"}}V(W_,R2,"PgInet");function Hq(e){return new q_(e??"")}var D2,L2;class K_ extends(L2=hm,D2=ue,L2){constructor(s){super(s,"number","PgInteger")}build(s){return new G_(s,this.config)}}V(K_,D2,"PgIntegerBuilder");var O2,$2;class G_ extends($2=ct,O2=ue,$2){getSQLType(){return"integer"}mapFromDriverValue(s){return typeof s=="string"?Number.parseInt(s):s}}V(G_,O2,"PgInteger");function Xe(e){return new K_(e??"")}var z2,U2;class H_ extends(U2=Ct,z2=ue,U2){constructor(s,r){super(s,"string","PgInterval"),this.config.intervalConfig=r}build(s){return new Q_(s,this.config)}}V(H_,z2,"PgIntervalBuilder");var V2,B2;class Q_ extends(B2=ct,V2=ue,B2){constructor(){super(...arguments);V(this,"fields",this.config.intervalConfig.fields);V(this,"precision",this.config.intervalConfig.precision)}getSQLType(){const r=this.fields?` ${this.fields}`:"",n=this.precision?`(${this.precision})`:"";return`interval${r}${n}`}}V(Q_,V2,"PgInterval");function Qq(e,s={}){const{name:r,config:n}=Hs(e,s);return new H_(r,n)}var q2,W2;class Y_ extends(W2=Ct,q2=ue,W2){constructor(s){super(s,"json","PgJson")}build(s){return new X_(s,this.config)}}V(Y_,q2,"PgJsonBuilder");var K2,G2;class X_ extends(G2=ct,K2=ue,G2){constructor(s,r){super(s,r)}getSQLType(){return"json"}mapToDriverValue(s){return JSON.stringify(s)}mapFromDriverValue(s){if(typeof s=="string")try{return JSON.parse(s)}catch{return s}return s}}V(X_,K2,"PgJson");function Yq(e){return new Y_(e??"")}var H2,Q2;class Z_ extends(Q2=Ct,H2=ue,Q2){constructor(s){super(s,"json","PgJsonb")}build(s){return new J_(s,this.config)}}V(Z_,H2,"PgJsonbBuilder");var Y2,X2;class J_ extends(X2=ct,Y2=ue,X2){constructor(s,r){super(s,r)}getSQLType(){return"jsonb"}mapToDriverValue(s){return JSON.stringify(s)}mapFromDriverValue(s){if(typeof s=="string")try{return JSON.parse(s)}catch{return s}return s}}V(J_,Y2,"PgJsonb");function pl(e){return new Z_(e??"")}var Z2,J2;class eE extends(J2=Ct,Z2=ue,J2){constructor(s){super(s,"array","PgLine")}build(s){return new tE(s,this.config)}}
638V(eE,Z2,"PgLineBuilder");var e4,t4;class tE extends(t4=ct,e4=ue,t4){getSQLType(){return"line"}mapFromDriverValue(s){const[r,n,a]=s.slice(1,-1).split(",");return[Number.parseFloat(r),Number.parseFloat(n),Number.parseFloat(a)]}mapToDriverValue(s){return`{${s[0]},${s[1]},${s[2]}}`}}V(tE,e4,"PgLine");var s4,r4;class sE extends(r4=Ct,s4=ue,r4){constructor(s){super(s,"json","PgLineABC")}build(s){return new rE(s,this.config)}}V(sE,s4,"PgLineABCBuilder");var n4,a4;class rE extends(a4=ct,n4=ue,a4){getSQLType(){return"line"}mapFromDriverValue(s){const[r,n,a]=s.slice(1,-1).split(",");return{a:Number.parseFloat(r),b:Number.parseFloat(n),c:Number.parseFloat(a)}}mapToDriverValue(s){return`{${s.a},${s.b},${s.c}}`}}V(rE,n4,"PgLineABC");function Xq(e,s){const{name:r,config:n}=Hs(e,s);return!(n!=null&&n.mode)||n.mode==="tuple"?new eE(r):new sE(r)}var i4,o4;class nE extends(o4=Ct,i4=ue,o4){constructor(s){super(s,"string","PgMacaddr")}build(s){return new aE(s,this.config)}}V(nE,i4,"PgMacaddrBuilder");var l4,c4;class aE extends(c4=ct,l4=ue,c4){getSQLType(){return"macaddr"}}V(aE,l4,"PgMacaddr");function Zq(e){return new nE(e??"")}var d4,u4;class iE extends(u4=Ct,d4=ue,u4){constructor(s){super(s,"string","PgMacaddr8")}build(s){return new oE(s,this.config)}}V(iE,d4,"PgMacaddr8Builder");var m4,h4;class oE extends(h4=ct,m4=ue,h4){getSQLType(){return"macaddr8"}}V(oE,m4,"PgMacaddr8");function Jq(e){return new iE(e??"")}var p4,f4;class lE extends(f4=Ct,p4=ue,f4){constructor(s,r,n){super(s,"string","PgNumeric"),this.config.precision=r,this.config.scale=n}build(s){return new cE(s,this.config)}}V(lE,p4,"PgNumericBuilder");var x4,g4;class cE extends(g4=ct,x4=ue,g4){constructor(r,n){super(r,n);V(this,"precision");V(this,"scale");this.precision=n.precision,this.scale=n.scale}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}V(cE,x4,"PgNumeric");function dE(e,s){const{name:r,config:n}=Hs(e,s);return new lE(r,n==null?void 0:n.precision,n==null?void 0:n.scale)}var y4,v4;class uE extends(v4=Ct,y4=ue,v4){constructor(s){super(s,"array","PgPointTuple")}build(s){return new mE(s,this.config)}}V(uE,y4,"PgPointTupleBuilder");var b4,j4;class mE extends(j4=ct,b4=ue,j4){getSQLType(){return"point"}mapFromDriverValue(s){if(typeof s=="string"){const[r,n]=s.slice(1,-1).split(",");return[Number.parseFloat(r),Number.parseFloat(n)]}return[s.x,s.y]}mapToDriverValue(s){return`(${s[0]},${s[1]})`}}V(mE,b4,"PgPointTuple");var w4,N4;class hE extends(N4=Ct,w4=ue,N4){constructor(s){super(s,"json","PgPointObject")}build(s){return new pE(s,this.config)}}V(hE,w4,"PgPointObjectBuilder");var k4,S4;class pE extends(S4=ct,k4=ue,S4){getSQLType(){return"point"}mapFromDriverValue(s){if(typeof s=="string"){const[r,n]=s.slice(1,-1).split(",");return{x:Number.parseFloat(r),y:Number.parseFloat(n)}}return s}mapToDriverValue(s){return`(${s.x},${s.y})`}}V(pE,k4,"PgPointObject");function eW(e,s){const{name:r,config:n}=Hs(e,s);return!(n!=null&&n.mode)||n.mode==="tuple"?new uE(r):new hE(r)}function tW(e){const s=[];for(let r=0;r<e.length;r+=2)s.push(Number.parseInt(e.slice(r,r+2),16));return new Uint8Array(s)}function pN(e,s){const r=new ArrayBuffer(8),n=new DataView(r);for(let a=0;a<8;a++)n.setUint8(a,e[s+a]);return n.getFloat64(0,!0)}function fE(e){const s=tW(e);let r=0;const n=s[r];r+=1;const a=new DataView(s.buffer),i=a.getUint32(r,n===1);if(r+=4,i&536870912&&(a.getUint32(r,n===1),r+=4),(i&65535)===1){const o=pN(s,r);r+=8;const l=pN(s,r);return r+=8,[o,l]}throw new Error("Unsupported geometry type")}var C4,P4;class xE extends(P4=Ct,C4=ue,P4){constructor(s){super(s,"array","PgGeometry")}build(s){return new gE(s,this.config)}}V(xE,C4,"PgGeometryBuilder");var T4,A4;class gE extends(A4=ct,T4=ue,A4){getSQLType(){return"geometry(point)"}mapFromDriverValue(s){return fE(s)}mapToDriverValue(s){return`point(${s[0]} ${s[1]})`}}V(gE,T4,"PgGeometry");var _4,E4;class yE extends(E4=Ct,_4=ue,E4){constructor(s){super(s,"json","PgGeometryObject")}build(s){return new vE(s,this.config)}}V(yE,_4,"PgGeometryObjectBuilder");var I4,M4;class vE extends(M4=ct,I4=ue,M4){getSQLType(){return"geometry(point)"}mapFromDriverValue(s){const r=fE(s);return{x:r[0],y:r[1]}}mapToDriverValue(s){return`point(${s.x} ${s.y})`}}V(vE,I4,"PgGeometryObject");function sW(e,s){const{name:r,config:n}=Hs(e,s);return!(n!=null&&n.mode)||n.mode==="tuple"?new xE(r):new yE(r)}var R4,F4;class bE extends(F4=Ct,R4=ue,F4){constructor(s,r){super(s,"number","PgReal"),this.config.length=r}build(s){return new jE(s,this.config)}}V(bE,R4,"PgRealBuilder");var D4,L4;class jE extends(L4=ct,D4=ue,L4){constructor(r,n){super(r,n);V(this,"mapFromDriverValue",r=>typeof r=="string"?Number.parseFloat(r):r)}getSQLType(){return"real"}}V(jE,D4,"PgReal");function rW(e){return new bE(e??"")}var O4,$4;class wE extends($4=Ct,O4=ue,$4){constructor(s){super(s,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(s){return new NE(s,this.config)}}V(wE,O4,"PgSerialBuilder");var z4,U4;
638class NE extends(U4=ct,z4=ue,U4){getSQLType(){return"serial"}}V(NE,z4,"PgSerial");function Is(e){return new wE(e??"")}var V4,B4;class kE extends(B4=hm,V4=ue,B4){constructor(s){super(s,"number","PgSmallInt")}build(s){return new SE(s,this.config)}}V(kE,V4,"PgSmallIntBuilder");var q4,W4;class SE extends(W4=ct,q4=ue,W4){constructor(){super(...arguments);V(this,"mapFromDriverValue",r=>typeof r=="string"?Number(r):r)}getSQLType(){return"smallint"}}V(SE,q4,"PgSmallInt");function nW(e){return new kE(e??"")}var K4,G4;class CE extends(G4=Ct,K4=ue,G4){constructor(s){super(s,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(s){return new PE(s,this.config)}}V(CE,K4,"PgSmallSerialBuilder");var H4,Q4;class PE extends(Q4=ct,H4=ue,Q4){getSQLType(){return"smallserial"}}V(PE,H4,"PgSmallSerial");function aW(e){return new CE(e??"")}var Y4,X4;class TE extends(X4=Ct,Y4=ue,X4){constructor(s,r){super(s,"string","PgText"),this.config.enumValues=r.enum}build(s){return new AE(s,this.config)}}V(TE,Y4,"PgTextBuilder");var Z4,J4;class AE extends(J4=ct,Z4=ue,J4){constructor(){super(...arguments);V(this,"enumValues",this.config.enumValues)}getSQLType(){return"text"}}V(AE,Z4,"PgText");function oe(e,s={}){const{name:r,config:n}=Hs(e,s);return new TE(r,n)}var ek,tk;class _E extends(tk=ad,ek=ue,tk){constructor(s,r,n){super(s,"string","PgTime"),this.withTimezone=r,this.precision=n,this.config.withTimezone=r,this.config.precision=n}build(s){return new EE(s,this.config)}}V(_E,ek,"PgTimeBuilder");var sk,rk;class EE extends(rk=ct,sk=ue,rk){constructor(r,n){super(r,n);V(this,"withTimezone");V(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}V(EE,sk,"PgTime");function iW(e,s={}){const{name:r,config:n}=Hs(e,s);return new _E(r,n.withTimezone??!1,n.precision)}var nk,ak;class IE extends(ak=ad,nk=ue,ak){constructor(s,r,n){super(s,"date","PgTimestamp"),this.config.withTimezone=r,this.config.precision=n}build(s){return new ME(s,this.config)}}V(IE,nk,"PgTimestampBuilder");var ik,ok;class ME extends(ok=ct,ik=ue,ok){constructor(r,n){super(r,n);V(this,"withTimezone");V(this,"precision");V(this,"mapFromDriverValue",r=>new Date(this.withTimezone?r:r+"+0000"));V(this,"mapToDriverValue",r=>r.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}V(ME,ik,"PgTimestamp");var lk,ck;class RE extends(ck=ad,lk=ue,ck){constructor(s,r,n){super(s,"string","PgTimestampString"),this.config.withTimezone=r,this.config.precision=n}build(s){return new FE(s,this.config)}}V(RE,lk,"PgTimestampStringBuilder");var dk,uk;class FE extends(uk=ct,dk=ue,uk){constructor(r,n){super(r,n);V(this,"withTimezone");V(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}V(FE,dk,"PgTimestampString");function et(e,s={}){const{name:r,config:n}=Hs(e,s);return(n==null?void 0:n.mode)==="string"?new RE(r,n.withTimezone??!1,n.precision):new IE(r,(n==null?void 0:n.withTimezone)??!1,n==null?void 0:n.precision)}var mk,hk;class DE extends(hk=Ct,mk=ue,hk){constructor(s){super(s,"string","PgUUID")}defaultRandom(){return this.default(ea`gen_random_uuid()`)}build(s){return new LE(s,this.config)}}V(DE,mk,"PgUUIDBuilder");var pk,fk;class LE extends(fk=ct,pk=ue,fk){getSQLType(){return"uuid"}}V(LE,pk,"PgUUID");function oW(e){return new DE(e??"")}var xk,gk;class OE extends(gk=Ct,xk=ue,gk){constructor(s,r){super(s,"string","PgVarchar"),this.config.length=r.length,this.config.enumValues=r.enum}build(s){return new $E(s,this.config)}}V(OE,xk,"PgVarcharBuilder");var yk,vk;class $E extends(vk=ct,yk=ue,vk){constructor(){super(...arguments);V(this,"length",this.config.length);V(this,"enumValues",this.config.enumValues)}getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}V($E,yk,"PgVarchar");function It(e,s={}){const{name:r,config:n}=Hs(e,s);return new OE(r,n)}var bk,jk;class zE extends(jk=Ct,bk=ue,jk){constructor(s,r){super(s,"string","PgBinaryVector"),this.config.dimensions=r.dimensions}build(s){return new UE(s,this.config)}}V(zE,bk,"PgBinaryVectorBuilder");var wk,Nk;class UE extends(Nk=ct,wk=ue,Nk){constructor(){super(...arguments);V(this,"dimensions",this.config.dimensions)}getSQLType(){return`bit(${this.dimensions})`}}
638V(UE,wk,"PgBinaryVector");function lW(e,s){const{name:r,config:n}=Hs(e,s);return new zE(r,n)}var kk,Sk;class VE extends(Sk=Ct,kk=ue,Sk){constructor(s,r){super(s,"array","PgHalfVector"),this.config.dimensions=r.dimensions}build(s){return new BE(s,this.config)}}V(VE,kk,"PgHalfVectorBuilder");var Ck,Pk;class BE extends(Pk=ct,Ck=ue,Pk){constructor(){super(...arguments);V(this,"dimensions",this.config.dimensions)}getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(r){return JSON.stringify(r)}mapFromDriverValue(r){return r.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}}V(BE,Ck,"PgHalfVector");function cW(e,s){const{name:r,config:n}=Hs(e,s);return new VE(r,n)}var Tk,Ak;class qE extends(Ak=Ct,Tk=ue,Ak){constructor(s,r){super(s,"string","PgSparseVector"),this.config.dimensions=r.dimensions}build(s){return new WE(s,this.config)}}V(qE,Tk,"PgSparseVectorBuilder");var _k,Ek;class WE extends(Ek=ct,_k=ue,Ek){constructor(){super(...arguments);V(this,"dimensions",this.config.dimensions)}getSQLType(){return`sparsevec(${this.dimensions})`}}V(WE,_k,"PgSparseVector");function dW(e,s){const{name:r,config:n}=Hs(e,s);return new qE(r,n)}var Ik,Mk;class KE extends(Mk=Ct,Ik=ue,Mk){constructor(s,r){super(s,"array","PgVector"),this.config.dimensions=r.dimensions}build(s){return new GE(s,this.config)}}V(KE,Ik,"PgVectorBuilder");var Rk,Fk;class GE extends(Fk=ct,Rk=ue,Fk){constructor(){super(...arguments);V(this,"dimensions",this.config.dimensions)}getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(r){return JSON.stringify(r)}mapFromDriverValue(r){return r.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}}V(GE,Rk,"PgVector");function uW(e,s){const{name:r,config:n}=Hs(e,s);return new KE(r,n)}function mW(){return{bigint:Uq,bigserial:Vq,boolean:Vt,char:Bq,cidr:qq,customType:Wq,date:Kq,doublePrecision:Gq,inet:Hq,integer:Xe,interval:Qq,json:Yq,jsonb:pl,line:Xq,macaddr:Zq,macaddr8:Jq,numeric:dE,point:eW,geometry:sW,real:rW,serial:Is,smallint:nW,smallserial:aW,text:oe,time:iW,timestamp:et,uuid:oW,varchar:It,bit:lW,halfvec:cW,sparsevec:dW,vector:uW}}const Ly=Symbol.for("drizzle:PgInlineForeignKeys"),fN=Symbol.for("drizzle:EnableRLS");var Dk,Lk,Ok,$k,zk;class qd extends(zk=Gr,$k=ue,Ok=Ly,Lk=fN,Dk=Gr.Symbol.ExtraConfigBuilder,zk){constructor(){super(...arguments);V(this,Ok,[]);V(this,Lk,!1);V(this,Dk)}}V(qd,$k,"PgTable"),V(qd,"Symbol",Object.assign({},Gr.Symbol,{InlineForeignKeys:Ly,EnableRLS:fN}));function hW(e,s,r,n,a=e){const i=new qd(e,n,a),o=typeof s=="function"?s(mW()):s,l=Object.fromEntries(Object.entries(o).map(([u,h])=>{const p=h;p.setName(u);const x=p.build(i);return i[Ly].push(...p.buildForeignKeys(x,i)),[u,x]})),c=Object.fromEntries(Object.entries(o).map(([u,h])=>{const p=h;p.setName(u);const x=p.buildExtraConfigColumn(i);return[u,x]})),d=Object.assign(i,l);return d[Gr.Symbol.Columns]=l,d[Gr.Symbol.ExtraConfigColumns]=c,r&&(d[qd.Symbol.ExtraConfigBuilder]=r),Object.assign(d,{enableRLS:()=>(d[qd.Symbol.EnableRLS]=!0,d)})}const Qt=(e,s,r)=>hW(e,s,r,void 0);var Uk;Uk=ue;class lb{constructor(s,r){this.unique=s,this.name=r}on(...s){return new vh(s.map(r=>{if(As(r,fs))return r;r=r;const n=new yh(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),n}),this.unique,!1,this.name)}onOnly(...s){return new vh(s.map(r=>{if(As(r,fs))return r;r=r;const n=new yh(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=r.defaultConfig,n}),this.unique,!0,this.name)}using(s,...r){return new vh(r.map(n=>{if(As(n,fs))return n;n=n;const a=new yh(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),a}),this.unique,!0,this.name,s)}}V(lb,Uk,"PgIndexBuilderOn");var Vk;Vk=ue;class vh{constructor(s,r,n,a,i="btree"){V(this,"config");this.config={name:a,columns:s,unique:r,only:n,method:i}}concurrently(){return this.config.concurrently=!0,this}with(s){return this.config.with=s,this}where(s){return this.config.where=s,this}build(s){return new HE(this.config,s)}}V(vh,Vk,"PgIndexBuilder");var Bk;Bk=ue;class HE{constructor(s,r){V(this,"config");this.config={...s,table:r}}}V(HE,Bk,"PgIndex");function Ls(e){return new lb(!1,e)}function xN(e){return new lb(!0,e)}const ts={INT8_MIN:-128,INT8_MAX:127,INT8_UNSIGNED_MAX:255,INT16_MIN:-32768,INT16_MAX:32767,INT16_UNSIGNED_MAX:65535,INT24_MIN:-8388608,INT24_MAX:8388607,INT24_UNSIGNED_MAX:16777215,INT32_MIN:-2147483648,INT32_MAX:2147483647,INT32_UNSIGNED_MAX:4294967295,INT48_MIN:-0x800000000000,INT48_MAX:0x7fffffffffff,INT48_UNSIGNED_MAX:0xffffffffffff,INT64_MIN:-9223372036854775808n,INT64_MAX:9223372036854775807n,INT64_UNSIGNED_MAX:18446744073709551615n};function vs(e,s){return s.includes(e.columnType)}function pW(e){return"enumValues"in e&&Array.isArray(e.enumValues)&&e.enumValues.length>0}const fW=Uv([Pt(),dm(),$i(),P6()]),xW=Uv([fW,T6(Uc()),Cf(Uc())]),gW=zv(e=>e instanceof Buffer);function QE(e,s){const r=(s==null?void 0:s.zodInstance)??cV,n=(s==null?void 0:s.coerce)??{};let a;return pW(e)&&(a=e.enumValues.length?r.enum(e.enumValues):r.string()),a||(vs(e,["PgGeometry","PgPointTuple"])?a=r.tuple([r.number(),r.number()]):vs(e,["PgGeometryObject","PgPointObject"])?a=r.object({x:r.number(),y:r.number()}):vs(e,["PgHalfVector","PgVector"])?(a=r.array(r.number()),a=e.dimensions?a.length(e.dimensions):a):vs(e,["PgLine"])?a=r.tuple([r.number(),r.number(),r.number()]):vs(e,["PgLineABC"])?a=r.object({a:r.number(),b:r.number(),c:r.number()}):vs(e,["PgArray"])?(a=r.array(QE(e.baseColumn,r)),a=e.size?a.length(e.size):a):e.dataType==="array"?a=r.array(r.any()):e.dataType==="number"?a=yW(e,r,n):e.dataType==="bigint"?a=vW(e,r,n):e.dataType==="boolean"?a=n===!0||n.boolean?r.coerce.boolean():r.boolean():e.dataType==="date"?a=n===!0||n.date?r.coerce.date():r.date():e.dataType==="string"?a=bW(e,r,n):e.dataType==="json"?a=xW:e.dataType==="custom"?a=r.any():e.dataType==="buffer"&&(a=gW)),a||(a=r.any()),a}function yW(e,s,r){let n=e.getSQLType().includes("unsigned"),a,i,o=!1;vs(e,["MySqlTinyInt","SingleStoreTinyInt"])?(a=n?0:ts.INT8_MIN,i=n?ts.INT8_UNSIGNED_MAX:ts.INT8_MAX,o=!0):vs(e,["PgSmallInt","PgSmallSerial","MySqlSmallInt","SingleStoreSmallInt"])?(a=n?0:ts.INT16_MIN,i=n?ts.INT16_UNSIGNED_MAX:ts.INT16_MAX,o=!0):vs(e,["PgReal","MySqlFloat","MySqlMediumInt","SingleStoreMediumInt","SingleStoreFloat"])?(a=n?0:ts.INT24_MIN,i=n?ts.INT24_UNSIGNED_MAX:ts.INT24_MAX,o=vs(e,["MySqlMediumInt","SingleStoreMediumInt"])):vs(e,["PgInteger","PgSerial","MySqlInt","SingleStoreInt"])?(a=n?0:ts.INT32_MIN,i=n?ts.INT32_UNSIGNED_MAX:ts.INT32_MAX,o=!0):vs(e,["PgDoublePrecision","MySqlReal","MySqlDouble","SingleStoreReal","SingleStoreDouble","SQLiteReal"])?(a=n?0:ts.INT48_MIN,i=n?ts.INT48_UNSIGNED_MAX:ts.INT48_MAX):vs(e,["PgBigInt53","PgBigSeri
638al53","MySqlBigInt53","MySqlSerial","SingleStoreBigInt53","SingleStoreSerial","SQLiteInteger"])?(n=n||vs(e,["MySqlSerial","SingleStoreSerial"]),a=n?0:Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=!0):vs(e,["MySqlYear","SingleStoreYear"])?(a=1901,i=2155,o=!0):(a=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER);let l=r===!0||r!=null&&r.number?s.coerce.number():s.number();return l=l.min(a).max(i),o?l.int():l}function vW(e,s,r){const n=e.getSQLType().includes("unsigned"),a=n?0n:ts.INT64_MIN,i=n?ts.INT64_UNSIGNED_MAX:ts.INT64_MAX;return(r===!0||r!=null&&r.bigint?s.coerce.bigint():s.bigint()).min(a).max(i)}function bW(e,s,r){if(vs(e,["PgUUID"]))return s.string().uuid();let n,a,i=!1;vs(e,["PgVarchar","SQLiteText"])?n=e.length:vs(e,["MySqlVarChar","SingleStoreVarChar"])?n=e.length??ts.INT16_UNSIGNED_MAX:vs(e,["MySqlText","SingleStoreText"])&&(e.textType==="longtext"?n=ts.INT32_UNSIGNED_MAX:e.textType==="mediumtext"?n=ts.INT24_UNSIGNED_MAX:e.textType==="text"?n=ts.INT16_UNSIGNED_MAX:n=ts.INT8_UNSIGNED_MAX),vs(e,["PgChar","MySqlChar","SingleStoreChar"])&&(n=e.length,i=!0),vs(e,["PgBinaryVector"])&&(a=/^[01]+$/,n=e.dimensions);let o=r===!0||r!=null&&r.string?s.coerce.string():s.string();return o=a?o.regex(a):o,n&&i?o.length(n):n?o.max(n):o}function YE(e){return g_(e)?$q(e):zq(e)}function XE(e,s,r,n){const a={};for(const[i,o]of Object.entries(e)){if(!As(o,qc)&&!As(o,fs)&&!As(o,fs.Aliased)&&typeof o=="object"){const h=g_(o)||Oq(o)?YE(o):o;a[i]=XE(h,s[i]??{},r,n);continue}const l=s[i];if(l!==void 0&&typeof l!="function"){a[i]=l;continue}const c=As(o,qc)?o:void 0,d=c?QE(c,n):Uc(),u=typeof l=="function"?l(d):d;r.never(c)||(a[i]=u,c&&(r.nullable(c)&&(a[i]=a[i].nullable()),r.optional(c)&&(a[i]=a[i].optional())))}return Cn(a)}const jW={never:e=>{var s,r;return((s=e==null?void 0:e.generated)==null?void 0:s.type)==="always"||((r=e==null?void 0:e.generatedIdentity)==null?void 0:r.type)==="always"},optional:e=>!e.notNull||e.notNull&&e.hasDefault,nullable:e=>!e.notNull},cs=(e,s)=>{const r=YE(e);return XE(r,{},jW)},fo=Qt("users",{id:Is("id").primaryKey(),username:oe("username").notNull().unique(),password:oe("password").notNull(),email:oe("email").notNull().unique(),createdAt:et("created_at").notNull().defaultNow(),membershipLevel:oe("membership_level").notNull().default("Free"),referralCode:oe("referral_code").unique(),referredBy:Xe("referred_by"),emailVerified:Vt("email_verified").notNull().default(!1),verificationToken:oe("verification_token"),verificationTokenExpiry:et("verification_token_expiry"),trialStartedAt:et("trial_started_at"),trialEndsAt:et("trial_ends_at"),stripeCustomerId:oe("stripe_customer_id"),stripeSubscriptionId:oe("stripe_subscription_id"),subscriptionStatus:oe("subscription_status"),subscriptionCurrentPeriodEnd:et("subscription_current_period_end"),lastActivityAt:et("last_activity_at"),isAffiliate:Vt("is_affiliate").notNull().default(!1),affiliateCode:oe("affiliate_code"),firstAccountBonusAt:et("first_account_bonus_at"),firstPostBonusAt:et("first_post_bonus_at"),bonusCreditsRemaining:Xe("bonus_credits_remaining").notNull().default(0),hideWelcomePopup:Vt("hide_welcome_popup").notNull().default(!1)});cs(fo).omit({id:!0,createdAt:!0,referralCode:!0,referredBy:!0,emailVerified:!0,verificationToken:!0,verificationTokenExpiry:!0,trialStartedAt:!0,trialEndsAt:!0,stripeCustomerId:!0,stripeSubscriptionId:!0,subscriptionStatus:!0,subscriptionCurrentPeriodEnd:!0,isAffiliate:!0,affiliateCode:!0,firstAccountBonusAt:!0,firstPostBonusAt:!0,bonusCreditsRemaining:!0,hideWelcomePopup:!0});Qt("platforms",{platformId:Is("platform_id").primaryKey(),name:oe("name").notNull(),displayName:oe("display_name").notNull(),apiUrl:oe("api_url"),authType:oe("auth_type"),rateLimit:Xe("rate_limit"),supportedFeatures:pl("supported_features"),isActive:Vt("is_active").default(!0),dailyEngagements:Xe("daily_engagements").default(0),lastActivity:et("last_activity")});function wW(e){return e==="text-to-text"?"text":e==="text-to-image"||e==="image-to-image"?"image":e==="image-reel"?"video":e==="carousel"?"carousel":"image"}const NW={youtube:["video"],tiktok:["video","image"],instagram:["image","video","carousel"],x:["text","image","video"],facebook:["text","image","video","carousel"],linkedin:["text","image","video","carousel"],reddit:["text","image","video"],snapchat:[],tbd:[]};function Gx(e,s){const r=wW(s);return NW[e].includes(r)}Cn({pollPrompt:Pt().max(5e3),tipPrompt:Pt().max(5e3),imagePrompt:Pt().max(5e3),responsePrompt:Pt().max(5e3),pollModel:Pt(),tipModel:Pt(),imageModel:Pt(),responseModel:Pt(),imageGenerationMode:Vv(["text-to-image","image-to-image","image-reel"]),numImages:dm().optional(),audioListId:Pt().nullable().optional()});const ZE=Vv(["Video","Image","Audio"]).nullable(),kW=Qt("music_tracks",{id:Is("id").primaryKey(),userId:Xe("user_id").references(()=>
638fo.id,{onDelete:"cascade"}),filePath:oe("file_path"),title:oe("title").notNull(),genre:oe("genre"),mood:oe("mood"),artist:oe("artist"),artistUrl:oe("artist_url"),duration:Xe("duration"),dateAdded:oe("date_added"),downloadFilename:oe("download_filename"),downloadStatus:oe("download_status"),scrapedAt:et("scraped_at"),dateCreated:et("date_created").notNull().defaultNow(),dateModified:et("date_modified").notNull().defaultNow()},e=>({userIdx:Ls("music_tracks_user_idx").on(e.userId),genreIdx:Ls("music_tracks_genre_idx").on(e.genre),moodIdx:Ls("music_tracks_mood_idx").on(e.mood)}));cs(kW).omit({id:!0,dateCreated:!0,dateModified:!0});Cn({name:Pt().min(1,"Name is required").max(100),items:Pt().max(5e3),mediaType:ZE.optional()});Cn({title:Pt().min(1,"Title is required").max(200),description:Pt().max(1e3),sourceUrl:Pt().min(1,"Video URL is required"),duration:Pt().optional(),thumbnailUrl:Pt().optional()});const JE=Qt("user_post_content_prompts",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:It("user_id").notNull().references(()=>fo.id),pollPrompt:oe("poll_prompt").notNull().default(""),tipPrompt:oe("tip_prompt").notNull().default(""),imagePrompt:oe("image_prompt").notNull().default(""),responsePrompt:oe("response_prompt").notNull().default(""),pollModel:oe("poll_model").notNull().default("openrouter/openai/gpt-4o-mini"),tipModel:oe("tip_model").notNull().default("openrouter/openai/gpt-4o-mini"),imageModel:oe("image_model").notNull().default("openrouter/google/gemini-2.5-flash-image-preview"),responseModel:oe("response_model").notNull().default("openrouter/openai/gpt-4o-mini"),imageGenerationMode:oe("image_generation_mode").notNull().default("text-to-image"),numImages:Xe("num_images"),audioListId:It("audio_list_id").references(()=>db.id),dateCreated:et("date_created").notNull().defaultNow(),dateModified:et("date_modified").notNull().defaultNow()});cs(JE).omit({id:!0,dateCreated:!0,dateModified:!0});const SW=Qt("prompt_images",{id:Is("id").primaryKey(),promptId:It("prompt_id").references(()=>JE.id,{onDelete:"cascade"}),promptIdNew:It("prompt_id_new").references(()=>cb.id,{onDelete:"cascade"}),imageUrl:oe("image_url").notNull(),displayOrder:Xe("display_order").notNull().default(0),dateCreated:et("date_created").notNull().defaultNow()});cs(SW).omit({id:!0,dateCreated:!0});const CW=Mq("prompt_type",["poll","tip","image","response","monitoring"]),cb=Qt("user_prompts",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:Xe("user_id").notNull().references(()=>fo.id,{onDelete:"cascade"}),promptType:CW("prompt_type").notNull(),promptText:oe("prompt_text").notNull().default(""),descriptionText:oe("description_text"),textModel:oe("text_model"),enabled:Vt("enabled").notNull().default(!1),autoApproval:Vt("auto_approval").notNull().default(!0),imageEnabled:Vt("image_enabled").notNull().default(!1),imageModel:oe("image_model"),generationMode:oe("generation_mode").notNull().default("text-to-text"),numImages:Xe("num_images"),audioSource:oe("audio_source"),audioListId:It("audio_list_id").references(()=>db.id),freeLibraryGenre:oe("free_library_genre"),freeLibraryMood:oe("free_library_mood"),freeLibraryDuration:Xe("free_library_duration"),captionPrompt:oe("caption_prompt"),enableNewsSearch:Vt("enable_news_search").notNull().default(!1),tavilyApiKey:oe("tavily_api_key"),displayOrder:Xe("display_order").notNull().default(0),metadata:pl("metadata"),dateCreated:et("date_created").notNull().defaultNow(),dateModified:et("date_modified").notNull().defaultNow()},e=>({userTypeOrder:Mf().on(e.userId,e.promptType,e.displayOrder),userIdx:Ls("user_prompts_user_idx").on(e.userId)}));cs(cb).omit({id:!0,dateCreated:!0,dateModified:!0});const PW=Qt("prompts_platform_configs",{id:Is("id").primaryKey(),userPromptId:It("user_prompt_id").notNull().references(()=>cb.id,{onDelete:"cascade"}),platformConfigId:Xe("platform_config_id").notNull().references(()=>eI.id,{onDelete:"cascade"}),createdAt:et("created_at").notNull().defaultNow()},e=>({uniquePromptConfig:Mf().on(e.userPromptId,e.platformConfigId),promptIdx:Ls("prompts_platform_configs_prompt_idx").on(e.userPromptId),configIdx:Ls("prompts_platform_configs_config_idx").on(e.platformConfigId)}));cs(PW).omit({id:!0,createdAt:!0});const db=Qt("post_item_lists",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:It
638("user_id").notNull().references(()=>fo.id),name:oe("name").notNull(),items:oe("items").notNull().default(""),lastUsedIndex:Xe("last_used_index").notNull().default(0),mediaType:oe("media_type"),dateCreated:et("date_created").notNull().defaultNow(),dateModified:et("date_modified").notNull().defaultNow()});cs(db).omit({id:!0,userId:!0,lastUsedIndex:!0,dateCreated:!0,dateModified:!0}).extend({items:Pt(),mediaType:ZE.optional()});const eI=Qt("platform_configs",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),platformName:oe("platform_name").notNull(),postFrequency:It("post_frequency",{length:20}).default("paused"),tipContentAutomation:Vt("tip_content_automation").notNull().default(!1),imageContentAutomation:Vt("image_content_automation").notNull().default(!1),pollContentAutomation:Vt("poll_content_automation").notNull().default(!1),videoContentAutomation:Vt("video_content_automation").notNull().default(!1),oauthCredentials:pl("oauth_credentials").$type(),apiKey:oe("api_key"),apiSecret:oe("api_secret"),realAccessToken:oe("real_access_token"),accessTokenSecret:oe("access_token_secret"),subreddit:oe("subreddit"),channelUrl:oe("channel_url"),postCreationPrompt:oe("post_creation_prompt"),connectionStatus:oe("connection_status").default("offline"),isActive:Vt("is_active").notNull().default(!1),createdAt:et("created_at").notNull().defaultNow()});Cn({platformName:Pt(),postFrequency:Pt(),tipContentAutomation:$i().optional(),imageContentAutomation:$i().optional(),pollContentAutomation:$i().optional(),videoContentAutomation:$i().optional()});const TW=Qt("user_configs",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),maxEngagementsPerDay:Xe("max_engagements_per_day").notNull().default(50),promotionText:oe("promotion_text"),websiteUrl:oe("website_url"),referralSource:oe("referral_source"),updatedAt:et("updated_at").notNull().defaultNow(),businessType:oe("business_type").default("trading"),responseGenerationPrompt:oe("response_generation_prompt"),masterAnalysisPrompt:oe("master_analysis_prompt"),maxDailyRequests:Xe("max_daily_requests").notNull().default(800),aiAnalysisBatchSize:Xe("ai_analysis_batch_size").notNull().default(20),aiResponseBatchSize:Xe("ai_response_batch_size").default(25),analysisResponsePrompt:oe("analysis_response_prompt"),nicheKeywords:oe("niche_keywords"),targetAudience:oe("target_audience")});cs(TW).omit({id:!0,updatedAt:!0});const AW=Qt("scheduled_posts",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:It("user_id").notNull(),contentGroupId:It("content_group_id").notNull(),scheduledTime:et("scheduled_time").notNull(),contentType:It("content_type",{length:20}).notNull(),contentText:oe("content_text").notNull(),contentTitle:It("content_title",{length:200}),platform:It("platform",{length:20}).notNull(),platformConfigId:Xe("platform_config_id").references(()=>eI.id),status:It("status",{length:20}).notNull().default("pending"),mediaUrl:It("media_url",{length:500}),postedLink:It("posted_link",{length:500}),errorReason:oe("error_reason"),aiGeneratedAt:et("ai_generated_at").notNull().defaultNow(),approvedAt:et("approved_at"),postedAt:et("posted_at"),aspectRatio:It("aspect_ratio",{length:20}),deliveryMethod:It("delivery_method",{length:20})},e=>({uniqueTimeSlot:xN("scheduled_posts_unique_time_slot").on(e.userId,e.platformConfigId,e.scheduledTime),legacyUniqueTimeSlot:xN("scheduled_posts_unique_legacy_time_slot").on(e.userId,e.platform,e.scheduledTime).where(ea`${e.platformConfigId} IS NULL AND ${e.platform} <> 'draft'`),platformConfigIdx:Ls("scheduled_posts_platform_config_idx").on(e.platformConfigId)}));cs(AW).omit({id:!0,userId:!0,aiGeneratedAt:!0,approvedAt:!0,postedAt:!0});const _W=Qt("user_settings",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:It("user_id").notNull().unique(),scheduleBufferHours:Xe("schedule_buffer_hours").notNull().default(24),scheduleBufferDays:Xe("schedule_buffer_days").notNull().default(2),showDailyReminders:Vt("show_daily_reminders").notNull().default(!0),dateCreated:et("date_created").notNull().defaultNow(),dateModified:et("date_modified").notNull().defaultNow()});cs(_W).omit({id:!0,userId:!0,dateCreated:!0,dateModified:!0});Cn({scheduleBufferDays:dm().int().min(1).max(60).optional(),showDailyReminders:$i().optional()}).strict();const EW=Qt("post_activity_log",{id:It("id").primaryKey().default(ea`gen_random_uuid()`),userId:It
638("user_id"),activityType:It("activity_type",{length:50}).notNull(),contentType:It("content_type",{length:20}),platform:It("platform",{length:20}),scheduledPostId:It("scheduled_post_id"),details:oe("details"),timestamp:et("timestamp").notNull().defaultNow()});cs(EW).omit({id:!0,timestamp:!0});const IW=Qt("campaigns",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),platformConfigId:Xe("platform_config_id").notNull(),name:oe("name").notNull(),responsePrompt:oe("response_prompt").notNull(),priority:Xe("priority").notNull(),isActive:Vt("is_active").notNull().default(!0),monitorType:oe("monitor_type").notNull(),createdAt:et("created_at").notNull().defaultNow(),updatedAt:et("updated_at").notNull().defaultNow()});cs(IW).omit({id:!0,createdAt:!0,updatedAt:!0});const MW=Qt("keywords",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),campaignId:Xe("campaign_id"),term:oe("term").notNull(),isActive:Vt("is_active").notNull().default(!0),priority:Xe("priority").notNull().default(1),type:oe("type").notNull().default("search"),createdAt:et("created_at").notNull().defaultNow()});cs(MW).omit({id:!0,createdAt:!0});const RW=Qt("following_users",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),platformConfigId:Xe("platform_config_id"),platform:oe("platform").notNull(),username:oe("username").notNull(),displayName:oe("display_name"),followerCount:Xe("follower_count").default(0),followingCount:Xe("following_count").default(0),keywordHitCount:Xe("keyword_hit_count").default(0),totalEngagement:Xe("total_engagement").default(0),avgEngagementPerPost:Xe("avg_engagement_per_post").default(0),qualityScore:Xe("quality_score").default(0),isFollowing:Vt("is_following").default(!1),isInfluencer:Vt("is_influencer").default(!1),monitored:Vt("monitored").default(!1),lastPostAt:et("last_post_at"),lastCheckedAt:et("last_checked_at"),profileImageUrl:oe("profile_image_url"),bio:oe("bio"),verified:Vt("verified").default(!1),location:oe("location"),createdAt:et("created_at").notNull().defaultNow(),updatedAt:et("updated_at").notNull().defaultNow()});cs(RW).omit({id:!0,createdAt:!0,updatedAt:!0});const FW=Qt("twitter_monitor_webhooks",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull(),eventType:oe("event_type").notNull(),ruleId:oe("rule_id").notNull(),ruleTag:oe("rule_tag").notNull(),tweetId:oe("tweet_id").notNull(),tweetText:oe("tweet_text").notNull(),authorId:oe("author_id"),authorUsername:oe("author_username").notNull(),authorName:oe("author_name").notNull(),tweetCreatedAt:et("tweet_created_at").notNull(),retweetCount:Xe("retweet_count").default(0),likeCount:Xe("like_count").default(0),replyCount:Xe("reply_count").default(0),webhookPayload:pl("webhook_payload"),suggestedResponse:oe("suggested_response"),responseSubmitted:Vt("response_submitted").notNull().default(!1),responsePostedAt:et("response_posted_at"),submissionError:oe("submission_error"),webhookReceivedAt:et("webhook_received_at").notNull().defaultNow(),processingCompletedAt:et("processing_completed_at"),replyTweetId:oe("reply_tweet_id"),platformConfigId:Xe("platform_config_id")},e=>({uniqueUserTweet:Mf("unique_user_tweet").on(e.userId,e.tweetId)}));cs(FW).omit({id:!0,webhookReceivedAt:!0});const DW=Qt("ai_providers",{id:Is("id").primaryKey(),name:oe("name").notNull(),displayName:oe("display_name").notNull(),apiUrl:oe("api_url").notNull(),authType:oe("auth_type").notNull(),modelFormat:oe("model_format"),defaultModel:oe("default_model"),rateLimit:Xe("rate_limit"),supportedFeatures:pl("supported_features"),isActive:Vt("is_active").notNull().default(!0)});cs(DW).omit({id:!0});const LW=Qt("ai_models",{id:Is("id").primaryKey(),modelId:oe("model_id").notNull().unique(),displayName:oe("display_name").notNull(),providerName:oe("provider_name").notNull().default("openrouter"),isFree:Vt("is_free").notNull().default(!0),costPerMillionTokens:dE("cost_per_million_tokens",{precision:10,scale:4}),category:oe("category").notNull().default("text"),isActive:Vt("is_active").notNull().default(!0),sortOrder:Xe("sort_order").notNull().default(0),createdAt:et("created_at").notNull().defaultNow()});cs(LW).omit({id:!0,createdAt:!0});const OW=Qt("logs",{id:Is("id").primaryKey(),timestamp:et("timestamp").notNull().defaultNow(),level:oe("level").notNull(),message:oe("message").notNull(),tag:oe("tag"),sourceFile:oe("source_file"),environment:oe("environment").notNull(),metadata:pl("metadata")},e=>({timestampIdx:Ls("logs_timestamp_idx").on(e.timestamp),levelIdx:Ls("logs_level_idx").on(e.level),tagIdx:Ls("logs_tag_idx").on(e.tag),environmentIdx:Ls("logs_environment_idx").on(e.environment)}));cs(OW).omit({id:!0,timestamp:!0});const $W=Qt("enterprise_inquiries",{id:Is("id").primaryKey(),userId:Xe("user_id").references(()=>
638fo.id),email:oe("email").notNull(),contactMethod:oe("contact_method").notNull(),contactValue:oe("contact_value"),interestAreas:oe("interest_areas").array(),existingTools:oe("existing_tools"),message:oe("message"),status:oe("status").notNull().default("new"),createdAt:et("created_at").notNull().defaultNow()});cs($W).omit({id:!0,status:!0,createdAt:!0});const zW=Qt("twitter_users",{id:Is("id").primaryKey(),userId:oe("user_id").notNull().unique(),username:oe("username").notNull(),name:oe("name"),bio:oe("bio"),location:oe("location"),url:oe("url"),profileImageUrl:oe("profile_image_url"),followersCount:Xe("followers_count").default(0),followingCount:Xe("following_count").default(0),tweetCount:Xe("tweet_count").default(0),listedCount:Xe("listed_count").default(0),verified:Vt("verified").default(!1),createdAt:et("created_at"),collectedAt:et("collected_at").defaultNow()},e=>({userIdIdx:Ls("idx_twitter_users_user_id").on(e.userId),usernameIdx:Ls("idx_twitter_users_username").on(e.username)}));cs(zW).omit({id:!0,collectedAt:!0});const UW=Qt("twitter_followers",{id:Is("id").primaryKey(),ownerUserId:oe("owner_user_id").notNull(),followerUserId:oe("follower_user_id").notNull(),firstSeenAt:et("first_seen_at").notNull().defaultNow(),lastSeenAt:et("last_seen_at").notNull().defaultNow(),source:oe("source").notNull().default("twitterapi")},e=>({ownerFollowerUnique:Mf("twitter_followers_owner_follower_unique").on(e.ownerUserId,e.followerUserId),ownerIdx:Ls("idx_twitter_followers_owner").on(e.ownerUserId),followerIdx:Ls("idx_twitter_followers_follower").on(e.followerUserId),firstSeenIdx:Ls("idx_twitter_followers_first_seen").on(e.firstSeenAt)}));cs(UW).omit({id:!0,firstSeenAt:!0,lastSeenAt:!0});const VW=Qt("affiliate_applications",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull().references(()=>fo.id),website:oe("website"),promotionPlan:oe("promotion_plan").notNull(),status:oe("status").notNull().default("pending"),submittedAt:et("submitted_at").notNull().defaultNow(),reviewedAt:et("reviewed_at"),adminNotes:oe("admin_notes")});cs(VW).omit({id:!0,status:!0,submittedAt:!0,reviewedAt:!0,adminNotes:!0});const BW=Qt("image_generations",{id:Is("id").primaryKey(),userId:Xe("user_id").notNull().references(()=>fo.id),imageUrl:oe("image_url"),model:oe("model").notNull(),generationMode:oe("generation_mode").notNull(),source:oe("source").notNull(),creditType:oe("credit_type").notNull().default("base"),createdAt:et("created_at").notNull().defaultNow()},e=>({userIdx:Ls("idx_image_generations_user").on(e.userId),createdAtIdx:Ls("idx_image_generations_created_at").on(e.createdAt),sourceIdx:Ls("idx_image_generations_source").on(e.source)}));cs(BW).omit({id:!0,createdAt:!0});const qW=cl("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"}}),tI=m.forwardRef(({className:e,variant:s,...r},n)=>t.jsx("div",{ref:n,role:"alert",className:je(qW({variant:s}),e),...r}));tI.displayName="Alert";const WW=m.forwardRef(({className:e,...s},r)=>t.jsx("h5",{ref:r,className:je("mb-1 font-medium leading-none tracking-tight",e),...s}));WW.displayName="AlertTitle";const sI=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{ref:r,className:je("text-sm [&_p]:leading-relaxed",e),...s}));sI.displayName="AlertDescription";const KW={youtube:{icon:oa,displayName:"YouTube",color:"text-red-600"},x:{icon:js,displayName:"X",color:"text-foreground"},twitter:{icon:js,displayName:"X",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-foreground"},instagram:{icon:ra,displayName:"Instagram",color:"text-pink-500"},facebook:{icon:sa,displayName:"Facebook",color:"text-blue-600"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-blue-700"},reddit:{icon:aa,displayName:"Reddit",color:"text-orange-500"},snapchat:{icon:_f,displayName:"Snapchat",color:"text-yellow-400"}},Sl=e=>KW[e]||{icon:jn,displayName:e.charAt(0).toUpperCase()+e.slice(1),color:"text-muted-foreground"},Cl=e=>{const s=e.oauthCredentials;return s!=null&&s.selectedPageName?s.selectedPageName:s!=null&&s.username?`@${s.username}`:e.subreddit?`r/${e.subreddit}`:Sl(e.platformName).displayName};function Du({platformConfigs:e,selectedConfigIds:s,onSelectionChange:r,generationMode:n,disabled:a=!1,reservedConfigIds:i=[],showValidationError:o=!0,singleSelection:l=!1}){const[c,d]=m.useState(!1),u=e.filter(N=>N.oauthCredentials&&Object.keys(N.oauthCredentials).length>0&&N.connectionStatus!=="disconnected"),h=u.filter(N=>(n?Gx(N.platformName,n):!0)&&!i.includes(N.id)),p=u.filter(N=>(n?Gx(N.platformName,n):!0)&&i.includes(N.id)),x=n?u.filter(N=>!Gx(N.platformName,n)):[],v=h.length>0&&h.every(N=>s.includes(N.id)),f=()=>{const N=h.map(w=>w.id);r(N),d(!1)},b=N=>{l?(s.includes(N)?r([]):r([N]),d(!1)):s.includes(N)?r(s.filter(w=>w!==N)):r([...s,N])},y=()=>
638{if(s.length===0)return l?"Select Account":"Select Platforms";if(s.length===1){const N=e.find(w=>w.id===s[0]);if(N)return Cl(N)}return`${s.length} Platforms`},j=(()=>{if(s.length===1){const N=e.find(w=>w.id===s[0]);if(N)return Sl(N.platformName)}return null})();return u.length===0?t.jsx("div",{className:"text-sm text-muted-foreground p-3 border border-dashed rounded-md text-center",children:"No accounts connected yet. You can still preview your content!"}):h.length===0?t.jsxs(tI,{variant:"destructive",className:"bg-destructive/10",children:[t.jsx(hr,{className:"h-4 w-4"}),t.jsxs(sI,{children:["None of your connected platforms support this content type (",n,"). Try connecting a platform that supports this format."]})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsxs(rl,{open:c,onOpenChange:d,children:[t.jsx(nl,{asChild:!0,children:t.jsxs(T,{variant:"outline",className:"w-full justify-center sm:justify-between gap-2",disabled:a,"data-testid":"button-prompt-platform-selector",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[j&&t.jsx(j.icon,{className:`h-4 w-4 ${j.color}`}),y()]}),t.jsx(Pa,{className:"h-4 w-4 hidden sm:block"})]})}),t.jsxs(ao,{align:"center",className:"w-[280px] sm:w-[320px]",children:[!l&&t.jsxs(t.Fragment,{children:[t.jsx(Es,{onClick:N=>{N.preventDefault(),f()},className:"cursor-pointer","data-testid":"menu-item-select-all-compatible",children:t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"font-medium",children:"Select All Compatible"}),v&&t.jsx(Xt,{className:"h-4 w-4"})]})}),t.jsx(va,{})]}),t.jsxs(Qa,{className:"text-xs text-muted-foreground uppercase",children:["Compatible Platforms (",h.length,")"]}),h.map(N=>{const w=Sl(N.platformName),S=w.icon,k=Cl(N),P=s.includes(N.id);return t.jsx(Es,{onClick:A=>{A.preventDefault(),b(N.id)},className:"cursor-pointer","data-testid":`menu-item-platform-${N.id}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),t.jsx(S,{className:`h-4 w-4 ${w.color}`}),t.jsx("span",{className:"flex-1 truncate",children:k}),t.jsx(ka,{checked:P,className:"h-4 w-4","data-testid":`checkbox-platform-${N.id}`})]})},N.id)}),p.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsxs(Qa,{className:"text-xs text-muted-foreground uppercase",children:["Already Assigned (",p.length,")"]}),p.map(N=>{const S=Sl(N.platformName).icon,k=Cl(N);return t.jsx(Es,{disabled:!0,className:"opacity-50 cursor-not-allowed","data-testid":`menu-item-platform-reserved-${N.id}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-yellow-500"}),t.jsx(S,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:k}),t.jsx("span",{className:"text-xs text-yellow-600",children:"In use"})]})},N.id)})]}),x.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(va,{}),t.jsxs(Qa,{className:"text-xs text-muted-foreground uppercase",children:["Incompatible (",x.length,")"]}),x.map(N=>{const S=Sl(N.platformName).icon,k=Cl(N);return t.jsx(Es,{disabled:!0,className:"opacity-50 cursor-not-allowed","data-testid":`menu-item-platform-disabled-${N.id}`,children:t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2 w-2 rounded-full bg-muted"}),t.jsx(S,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:k}),N.platformName==="youtube"&&t.jsx("span",{className:"text-xs font-medium",children:"Video required"})]})},N.id)})]})]})]}),u.some(N=>N.platformName==="youtube")&&t.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"youtube-video-only-notice",children:zA}),s.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(N=>{const w=e.find(P=>P.id===N);if(!w)return null;const S=Sl(w.platformName),k=S.icon;return t.jsxs(xe,{variant:"secondary",className:"flex items-center gap-1.5 pr-1","data-testid":`badge-selected-platform-${N}`,children:[t.jsx(k,{className:`h-3 w-3 ${S.color}`}),t.jsx("span",{className:"text-xs",children:Cl(w)}),t.jsxs(T,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:()=>b(N),"data-testid":`button-remove-platform-${N}`,children:[t.jsx("span",{className:"sr-only",children:"Remove"}),t.jsx("span",{className:"text-muted-foreground hover:text-foreground",children:"×"})]})]},N)})}),o&&s.length===0&&t.jsx("p",{className:"text-sm text-destructive",children:l?"Please select an account.":"Please select at least one platform."})]})}function GW(e){const r=e.toLowerCase().split("?")[0],n=[".mp4",".mov",".webm",".avi",".mkv",".m4v"],a=[".jpg",".jpeg",".png",".gif",".webp",".bmp",".svg"];return n.some(i=>r.endsWith(i))?"video":a.some(i=>r.endsWith(i))?"image":"unknown"}const gN={manual:{icon:o7,label:"Create Your Own Post",description:"Upload your own text, images, or videos",color:"text-blue-500",bgColor:"bg-blue-500/10"},"ai-assisted":{icon:tv,label:"AI-Assisted Content",description:"Let AI generate content for you",color:"text-purple-500",bgColor:"bg-purple-500/10"}},yN={"text-post":{icon:mi,label:"Text Post",description:"Generate text-only social media posts",color:"text-blue-500",bgColor:"bg-blue-500/10",contentType:"tip"},"text-to-image":{icon:Et,label:"Text to Image",description:"Create images from text descriptions",color:"text-purple-500",bgColor:"bg-purple-500/10",contentType:"image"},"image-to-image":{icon:Ft,label:"Image to Image",description:"Transform reference images with AI",color:"text-green-500",bgColor:"bg-green-500/10",contentType:"image"},"image-reel":{icon:Ju,label:"Image Reel",description:"Create video reels from images",color:"text-orange-500",bgColor:"bg-orange-500/10",contentType:"video"},carousel:{icon:qn,label:"Carousel",description:"Multi-image carousel posts (Coming Soon)",color:"text-pink-500",bgColor:"bg-pink-500/10",contentType:"image"}},vN={now:{icon:Aa,label:"Post Immediately",description:"Publish to selected platforms now and show the result"},"next-hour":{icon:ws,label:"Schedule Next Hour",description:"Use the next clock hour in your local timezone, without moving to a later slot"},custom:{icon:Ca,label:"Schedule for Specific Time",description:"Choose a specific date and time for your post"}},HW={manual:[{id:1,label:"Type"},{id:2,label:"Create & Schedule"}],"ai-assisted":[{id:1,label:"Type"},{id:2,label:"Method"},{id:3,label:"Settings"},{id:4,label:"Preview"},{id:5,label:"Schedule"}]},QW=e=>HW[e||"manual"],Ye={header:{title:"Create Post"},progressLabels:{step1:"Type",step2:"Method",step3:"Settings",step4:"Content",step5:"Schedule"},navigation:{previous:"Previous",next:"Next",cancel:"Cancel",generate:"Generate",schedule:"Schedule Post"},screen1:{creationType:{heading:"How would you like to create your post?"}},screen2_ai:{methodSelection:{heading:"What would you like to generate?"}},screen2_manual:{heading:"Create Your Post",description:"Add your text and upload one image or video",textLabel:"Post Text",textPlaceholder:"Write your post content...",mediaLabel:"Media (Optional)",mediaDescription:"Upload one image or video file",uploadButton:"Upload Media",platformsLabel:"Select Platforms"},screen2:{header:{title:"Configure Settings",description:"Choose your AI models and generation options"},textModel:{cardTitle:"Text AI Model",label:"AI Model"},imageConfig:{cardTitle:"Image Configuration",imageModelLabel:"Image AI Model",numImagesLabel:"Number of Images"},audioConfig:{cardTitle:"Audio Configuration",cardDescription:"Select audio source for your video reel. Your audio length determines your reel length for your final video.",audioSourceLabel:"Audio Source *",userListOption:"My Audio Lists",mediaLibraryOption:"My Media Library",freeLibraryOption:"Free Music Library",userListSelectLabel:"Select Audio List *",mediaLibrarySelectLabel:"Select Audio File *",genreLabel:"Genre",moodLabel:"Mood",durationLabel:"Duration (seconds)",durationDefault:8}},screen3:{header:{title:"Write Your Content",description:"Create the prompt that AI will use to generate content"},aiPrompt:{label:e=>{switch(e){case"text-post":return"Text Prompt *";case"text-to-image":return"Image Description *";
638case"image-to-image":return"Transformation Prompt *";default:return"AI Prompt *"}},insertButtonLabel:"Insert Item List",noItemsAvailable:"No item lists available",placeholder:e=>{switch(e){case"text-post":return"Write your prompt here. Use {ItemListName} to insert items from your lists.";case"text-to-image":return"Describe the image you want to generate. Use {ItemListName} to add variety from your item lists.";case"image-to-image":return"Describe how to transform the reference image. Use {ItemListName} for creative variations.";default:return"Write your prompt here. Use {ItemListName} to insert items from your lists."}},helpText:e=>e==="text-post"?'The AI will use this prompt to generate your content. Click "Insert Item List" to add placeholders from your item lists.':'The AI will use this prompt to generate images. Click "Insert Item List" to add placeholders that rotate through your lists for variety.'},captionPrompt:{cardTitle:"Caption Prompt",cardTitleOptional:"(Optional)",cardDescription:"Add an optional caption to your image post",label:"Caption Prompt",insertButtonLabel:"Insert Item List",noItemsAvailable:"No item lists available",placeholder:"Enter a caption for your image post...",helpText:"Enter a prompt to generate captions with AI, or click 'Insert Item List' to add placeholders from your item lists"}},screen4:{header:{title:"Generate & Schedule",description:"Generate your content and choose when to post"},generate:{buttonGenerate:"Generate Content",buttonRegenerate:"Regenerate",generatingText:"Generating...",previewTitle:"Content Preview"},schedule:{heading:"When would you like to post?",platformsLabel:"Select Platforms"}}};function Rf({onComplete:e,onCancel:s,prefilledPlatform:r,prefilledScheduledTime:n,prefilledPlatforms:a,prefilledPlatformConfigIds:i,prefilledMediaUrl:o,prefilledMediaType:l,prefilledAspectRatio:c,startAtManualStep:d}){const{toast:u}=bt(),[h,p]=m.useState(d?2:1),[x,v]=m.useState(d?"manual":null),[f,b]=m.useState(null),[y,g]=m.useState(""),[j,N]=m.useState(""),[w,S]=m.useState([]),[k,P]=m.useState(o?[o]:[]),[A,$]=m.useState(c||null),[_,O]=m.useState(!1),[M,C]=m.useState(!1),[L,W]=m.useState(!1),[q,I]=m.useState(""),[F,E]=m.useState("openrouter/meta-llama/llama-3.3-70b-instruct:free"),[ne,U]=m.useState("fal-ai/nano-banana"),[Ae,G]=m.useState(""),[Q,ye]=m.useState([]),[le,J]=m.useState(!1),[X,se]=m.useState(1),[te,R]=m.useState("media_library"),[K,ve]=m.useState(null),[Ie,dt]=m.useState(null),[jt,Ss]=m.useState(null),[Mt,Cs]=m.useState(null),[Zt,D]=m.useState(8),[Z,ie]=m.useState(!1),[Re,Pe]=m.useState(!1),[fe,De]=m.useState(""),[ce,$e]=m.useState(""),[qe,wt]=m.useState(""),[Y,xt]=m.useState(n?"custom":"next-hour"),ys=Intl.DateTimeFormat().resolvedOptions().timeZone,[Qs,Tn]=m.useState(()=>Km(new Date,ys)),[An,fi]=m.useState(()=>Date.now());m.useEffect(()=>{const B=setInterval(()=>fi(Date.now()),1e3);return()=>clearInterval(B)},[]);const rn=B=>{B==="next-hour"&&Y!=="next-hour"&&Tn(Km(new Date,ys)),xt(B)},la=Qs.getTime()<=An,Da=Y==="next-hour"&&t.jsxs("div",{className:"mt-3 p-3 border rounded-md text-sm space-y-2","data-testid":"next-hour-preview",children:[t.jsxs("p",{children:["Schedule for ",t.jsx("strong",{children:ec(Qs)})," (",ys,")."]}),t.jsx("p",{className:"text-muted-foreground",children:"This exact time is used for all selected accounts. Nothing publishes now. A conflict will be reported, not moved to another hour."}),la&&t.jsx("p",{role:"alert",className:"text-destructive",children:"This time has passed. Refresh the time and review it before scheduling."}),t.jsx(T,{type:"button",variant:"outline",size:"sm",onClick:()=>{Tn(Km(new Date,ys)),fi(Date.now())},children:"Refresh next hour"})]}),[nn,fl]=m.useState(n?`${n.getFullYear()}-${(n.getMonth()+1).toString().padStart(2,"0")}-${n.getDate().toString().padStart(2,"0")}`:""),[La,xo]=m.useState(n?`${n.getHours().toString().padStart(2,"0")}:${n.getMinutes().toString().padStart(2,"0")}`:"12:00"),[$s,go]=m.useState([]),id=(B,we)=>{const Oe=_n.find(rt=>rt.id===B);return`${Oe?Cl(Oe):we}${B?` (account #${B})`:""}`},[xm,xl]=m.useState(!1),{data:H=[]}=Ee({queryKey:["/api/ai-models"]}
638),_e=H.filter(B=>B.category==="text"),Te=H.filter(B=>B.category==="image"),{data:at=[]}=Ee({queryKey:["/api/item-lists"]}),{data:ds=[]}=Ee({queryKey:["/api/vidmonkey/videos"],enabled:f==="image-reel"}),Jt=ds.filter(B=>{var Oe,rt;if(((Oe=B.content_type)==null?void 0:Oe.toLowerCase())==="audio")return!0;const we=((rt=B.media_url.split(".").pop())==null?void 0:rt.toLowerCase())||"";return["mp3","wav","ogg","oga","aac","m4a","flac","weba"].includes(we)}),yo=B=>{if(!B)return"";if(B<60)return` - ${Math.round(B)} sec`;const we=Math.floor(B/60),Oe=Math.round(B%60);return` - ${we}:${Oe.toString().padStart(2,"0")}`},{data:_n=[]}=Ee({queryKey:["/api/platform-configs"]}),vo=_n.filter(B=>$s.includes(B.id)).map(B=>B.platformName),bo=vo.includes("youtube")||vo.includes("tiktok");m.useEffect(()=>{if(xm||_n.length===0)return;if(i&&i.length>0){const Oe=i.filter(rt=>_n.some(Ps=>Ps.id===rt&&Ps.oauthCredentials&&Object.keys(Ps.oauthCredentials).length>0&&Ps.connectionStatus!=="disconnected"));Oe.length>0&&go(Oe),xl(!0);return}const B=[];if(r&&B.push(r),a&&B.push(...a),B.length===0){xl(!0);return}const we=_n.filter(Oe=>B.includes(Oe.platformName)&&Oe.oauthCredentials&&Object.keys(Oe.oauthCredentials).length>0&&Oe.connectionStatus!=="disconnected").map(Oe=>Oe.id);we.length>0&&go(we),xl(!0)},[_n,r,a,i,xm]),m.useEffect(()=>{f&&(f==="text-to-image"||f==="carousel"?U("fal-ai/nano-banana"):f==="image-to-image"?U("fal-ai/nano-banana/edit"):f==="image-reel"&&(Q.length>0?U("fal-ai/nano-banana/edit"):U("fal-ai/nano-banana")))},[f,Te,Q.length]),m.useEffect(()=>{if(f!=="image-reel")return;const B=ne.includes("/edit"),we=Q.length>0;!we&&B?U("fal-ai/nano-banana"):we&&!B&&U("fal-ai/nano-banana/edit")},[f,Q.length,ne]),m.useEffect(()=>{d||x&&h!==1&&p(1)},[x,d]);const jo=(B=>{if(!B)return{imageEnabled:!1,generationMode:"text-to-text"};switch(B){case"text-post":return{imageEnabled:!1,generationMode:"text-to-text"};case"text-to-image":return{imageEnabled:!0,generationMode:"text-to-image"};case"image-to-image":return{imageEnabled:!0,generationMode:"image-to-image"};case"image-reel":return{imageEnabled:!0,generationMode:"image-reel"};case"carousel":return{imageEnabled:!0,generationMode:"carousel"};default:return{imageEnabled:!1,generationMode:"text-to-text"}}})(f),kb=l==="video"||w.some(B=>B.type.startsWith("video/"))||k.some(UA)?"image-reel":k.length>0?"text-to-image":"text-to-text",zs=VA(vo,x==="manual"?k[0]:f==="image-reel"?qe:ce),gm=B=>{const we=`{${B}}`;I(Oe=>{const rt=document.getElementById("prompt-text");if(!rt)return Oe+" "+we;const Ps=rt.selectionStart,In=rt.selectionEnd,Us=Oe.substring(0,Ps)+we+Oe.substring(In);return setTimeout(()=>{rt.selectionStart=rt.selectionEnd=Ps+we.length,rt.focus()},0),Us})},Ys=B=>{const we=`{${B}}`;G(Oe=>{const rt=document.getElementById("caption-prompt");if(!rt)return Oe+" "+we;const Ps=rt.selectionStart,In=rt.selectionEnd,Us=Oe.substring(0,Ps)+we+Oe.substring(In);return setTimeout(()=>{rt.selectionStart=rt.selectionEnd=Ps+we.length,rt.focus()},0),Us})},od=async B=>{var Oe;const we=(Oe=B.target.files)==null?void 0:Oe[0];if(we){if(!we.type.startsWith("image/")){u({title:"Invalid file",description:"Please upload an image file (JPG, PNG, etc.)",variant:"destructive"}),B.target.value="";return}if(we.size>10*1024*1024){u({title:"File too large",description:"Image must be less than 10MB",variant:"destructive"}),B.target.value="";return}J(!0);try{const rt=new FormData;rt.append("image",we);const Ps=await fetch("/api/upload-temp-image",{method:"POST",body:rt,credentials:"include"});if(!Ps.ok){const Us=await Ps.json();throw new Error(Us.error||"Failed to upload image")}const In=await Ps.json();ye(Us=>[...Us,In.imageUrl]),u({title:"Image uploaded",description:"Reference image has been added successfully."}),B.target.value=""}catch(rt){u({title:"Upload failed",description:rt.message||"Failed to upload image. Please try again.",variant:"destructive"})}finally{J(!1)}}},ld=B=>{ye(we=>we.filter((Oe,rt)=>rt!==B))},lr=B=>new Promise(we=>{const Oe=document.createElement("video");Oe.preload="metadata",Oe.onloadedmetadata=()=>{URL.revokeObjectURL(Oe.src);const rt=Oe.videoHeight>Oe.videoWidth?"portrait":"landscape";we(rt)},Oe.onerror=()=>{URL.revokeObjectURL(Oe.src),we("landscape")},Oe.src=URL.createObjectURL(B)}),Sb=async B=>{var In;const we=(In=B.target.files)==null?void 0:In[0];if(!we)return;const Oe=we.type.startsWith("video/");if(!we.type.startsWith("image/")&&!Oe){u({title:"Invalid file",description:"Please upload an image or video file",variant:"destructive"}),B.target.value="";return}const Ps=Oe?50*1024*1024:10*1024*1024;if(we.size>Ps){u({title:"File too large",description:`File must be less than ${Oe?"50MB":"10MB"}`,variant:"destructive"}),B.target.value="";return}O(!0);try{let Us=null;Oe?(Us=await lr(we),$(Us)):$(null);const vm=new FormData;let $f,zf;
638Oe?($f="/api/videos/upload",zf="media"):($f="/api/upload-temp-image",zf="image"),vm.append(zf,we);const Uf=await fetch($f,{method:"POST",body:vm,credentials:"include"});if(!Uf.ok){const Eb=await Uf.json();throw new Error(Eb.error||Eb.message||"Failed to upload file")}const _b=await Uf.json();S([we]);const lM=_b.imageUrl||_b.media_url;P([lM]),u({title:"Media uploaded",description:`${Oe?"Video":"Image"} uploaded successfully${Us==="portrait"?" (Portrait - will post as Short/Reel)":""}`}),B.target.value=""}catch(Us){u({title:"Upload failed",description:Us.message||"Failed to upload media. Please try again.",variant:"destructive"})}finally{O(!1)}},ym=B=>{S(we=>we.filter((Oe,rt)=>rt!==B)),P(we=>we.filter((Oe,rt)=>rt!==B)),$(null)},Df=(B,we,Oe)=>{P([B]);const rt=new File([],B,{type:we==="video"?"video/mp4":"image/jpeg"});S([rt]),$(we==="video"&&Oe?Oe:null),u({title:"Media selected",description:`${we==="video"?"Video":"Image"} has been added from your library.${Oe==="portrait"?" (Portrait - will post as Short/Reel)":""}`})},HI=(B,we)=>{if(we!=="image"){u({title:"Invalid selection",description:"Please select an image file for reference images.",variant:"destructive"});return}ye(Oe=>[...Oe,B]),u({title:"Reference image added",description:"Image has been added from your library."})},QI=ke({mutationFn:async()=>{if(!f)throw new Error("No generation method selected");return(await Fe("POST","/api/test-prompt",{promptType:f==="text-post"?"tip":"image",prompt:q,model:f==="text-post"?F:ne,generationMode:f,captionPrompt:f!=="text-post"?Ae:void 0,referenceImageUrls:f==="image-to-image"||f==="image-reel"?Q:void 0,numImages:f==="image-reel"?X:void 0,audioSource:f==="image-reel"?te:void 0,audioListId:f==="image-reel"&&te==="user_list"?K:void 0,mediaLibraryAudioId:f==="image-reel"&&te==="media_library"?Ie:void 0,freeLibraryGenre:f==="image-reel"&&te==="free_library"?jt:void 0,freeLibraryMood:f==="image-reel"&&te==="free_library"?Mt:void 0,freeLibraryDuration:f==="image-reel"&&te==="free_library"?Zt:void 0})).json()},onSuccess:B=>{Pe(!0),ie(!1),f==="text-post"?(De(B.content||""),$e(""),wt("")):f==="image-reel"?(wt(B.videoUrl||""),De(B.content||""),$e("")):($e(B.imageUrl||""),De(
638B.content||""),wt("")),u({title:"Content generated",description:"Your content has been generated successfully"})},onError:B=>{ie(!1),u({title:"Generation failed",description:B.message||"Failed to generate content",variant:"destructive"})}}),Cb=async()=>{if(f&&["text-to-image","image-to-image","image-reel","carousel"].includes(f))try{const we=await fetch("/api/user/daily-image-count",{credentials:"include"});if(we.ok){const Oe=await we.json();if(Oe.imagesGeneratedLast24h>=Oe.dailyLimit){const rt=Oe.messages||{},Ps=rt.limit_reached_title||"Daily image limit reached",In=(rt.limit_reached_description||"You've used {used} of {limit} images today. Upgrade your plan for more daily image generations, or wait for your limit to reset.").replace("{used}",Oe.imagesGeneratedLast24h).replace("{limit}",Oe.dailyLimit),Us=In.split("Upgrade"),vm=Us.length>1?t.jsxs("span",{children:[Us[0],t.jsx(me,{href:"/upgrade",className:"underline font-medium hover:text-white",children:"Upgrade"}),Us[1]]}):In;u({title:Ps,description:vm,variant:"destructive"});return}}}catch(we){console.error("Failed to check image usage:",we)}ie(!0),QI.mutate()},Lf=ke({mutationFn:async()=>{if(zs)throw new Error(zs);const B=pq(Y,nn,La,Qs,$s.length>0);if(x==="manual")return(await Fe("POST","/api/manual-post/schedule",{contentType:"manual",content:y,contentTitle:bo&&j.trim()?j.trim():void 0,imageUrl:k.length>0?k[0]:void 0,aspectRatio:A||void 0,platformConfigIds:$s,scheduleType:Y,scheduledTime:B,timezone:ys,timezoneOffset:new Date().getTimezoneOffset()})).json();{if(!f)throw new Error("No generation method selected");const we=yN[f].contentType;let Oe;return bo&&fe&&(Oe=fe.trim().split(/\s+/).slice(0,5).join(" ")+(fe.trim().split(/\s+/).length>5?"...":"")),(await Fe("POST","/api/manual-post/schedule",{contentType:we,content:fe,contentTitle:Oe,imageUrl:f==="image-reel"?qe:ce,platformConfigIds:$s,scheduleType:Y,scheduledTime:B,timezone:ys,timezoneOffset:new Date().getTimezoneOffset()})).json()}},onSuccess:B=>{const we=(B==null?void 0:B.isDraft)===!0;u(B!=null&&B.delivery?$A(B.delivery,id):we?{title:"Post saved as draft",description:"Nothing was published. Find it in Drafts on the dashboard; connect an account before scheduling."}:hq(B.posts||[],$s,id)),ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/draft-posts"]}),ee.invalidateQueries({queryKey:["/api/recent-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),p(1),v(null),b(null),I(""),G(""),Pe(!1),De(""),$e(""),wt(""),g(""),N(""),S([]),P([]),$(null),go([]),xt("next-hour"),Tn(Km(new Date,ys)),ye([]),e==null||e()},onError:B=>{u({title:Y==="now"?"Posting request failed":"Scheduling failed",description:Y==="now"?"The request could not be confirmed. Check Recent and Needs attention on the dashboard before trying again.":Qh(B)||"Failed to submit post",variant:"destructive"})}}),YI=()=>{Lf.mutate()},Pb=x!==null,XI=y.trim().length>0,ZI=f!==null,JI=(f==="text-post"?F:!0)&&(!jo.imageEnabled||ne),eM=q.trim().length>0,tM=!Z&&q.trim().length>0,cd=Y==="custom"?eb(nn,La):null,Tb=Y==="next-hour"?$s.length===0||!la:Y!=="custom"||!!cd&&cd.getTime()>An,sM=Re&&Tb&&!zs,rM=!zs&&y.trim().length>0&&Tb,nM=B=>{v(B),Object.keys(gN).length===2&&setTimeout(()=>{p(2)},150)},aM=()=>
638{if(h===1&&!Pb){u({title:"Selection Required",description:"Please choose how you'd like to create your post",variant:"destructive"});return}if(x==="manual"){if(h===2&&!XI){u({title:"Content Required",description:"Please add some text content for your post",variant:"destructive"});return}h<2&&p(h+1)}if(x==="ai-assisted"){if(h===3&&f==="image-to-image"&&Q.length===0){u({title:"Reference Image Required",description:"Image-to-Image mode requires at least one reference image. Please upload a reference image to continue.",variant:"destructive"});return}h<5&&p(h+1)}},iM=()=>{h>1&&p(h-1)},oM=B=>{b(B)},Of=QW(x),Ab=Of.length;return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("h2",{className:"text-2xl font-bold",children:Ye.header.title}),t.jsx("div",{className:"flex items-center gap-2",children:Of.map((B,we)=>t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:`flex-1 h-2 rounded-full ${B.id<=h?"bg-primary":"bg-muted"}`}),we<Ab-1&&t.jsx(Xi,{className:"w-4 h-4 text-muted-foreground"})]},B.id))}),t.jsx("div",{className:"flex justify-between text-xs text-muted-foreground",children:Of.map(B=>t.jsx("span",{children:B.label},B.id))}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Step ",h," of ",Ab]})]}),t.jsxs("div",{className:"min-h-[400px]",children:[h===1&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:Ye.screen1.creationType.heading}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(gN).map(([B,we])=>{const Oe=we.icon;return t.jsxs("button",{onClick:()=>nM(B),className:`p-8 border rounded-lg text-left space-y-3 hover-elevate ${x===B?"border-primary ring-2 ring-primary":""}`,"data-testid":`button-creation-type-${B}`,children:[t.jsx("div",{className:`w-14 h-14 rounded-lg ${we.bgColor} flex items-center justify-center`,children:t.jsx(Oe,{className:`w-7 h-7 ${we.color}`})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold text-base",children:we.label}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:we.description})]})]},B)})})]}),h===2&&x==="ai-assisted"&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold",children:Ye.screen2_ai.methodSelection.heading}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(yN).map(([B,we])=>{const Oe=we.icon,rt=B==="carousel";return t.jsxs("button",{onClick:()=>!rt&&oM(B),disabled:rt,className:`p-6 border rounded-lg text-left space-y-2 hover-elevate ${f===B?"border-primary ring-2 ring-primary":""} ${rt?"opacity-50 cursor-not-allowed":""}`,"data-testid":`button-method-${B}`,children:[t.jsx("div",{className:`w-12 h-12 rounded-lg ${we.bgColor} flex items-center justify-center`,children:t.jsx(Oe,{className:`w-6 h-6 ${we.color}`})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-semibold",children:we.label}),t.jsx("div",{className:"text-sm text-muted-foreground",children:we.description})]})]},B)})})]}),h===2&&x==="manual"&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold",children:Ye.screen2_manual.heading}),t.jsx("p",{className:"text-sm text-muted-foreground",children:Ye.screen2_manual.description})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{className:"text-sm",children:Ye.screen2_manual.textLabel})}),t.jsx(de,{children:t.jsx(os,{placeholder:Ye.screen2_manual.textPlaceholder,value:y,onChange:B=>g(B.target.value),rows:6,className:"resize-none","data-testid":"textarea-manual-content"})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(pe,{className:"text-sm",children:Ye.screen2_manual.mediaLabel}),t.jsx(Ze,{children:Ye.screen2_manual.mediaDescription})]}),t.jsx(de,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs font-medium mb-2 block text-muted-foreground",children:"Upload New Media"}),t.jsxs("label",{htmlFor:"file-upload",className:`flex items-center justify-center gap-2 w-full h-10 px-4 border-2 border-dashed rounded-md cursor-pointer transition-colors hover:border-primary hover:bg-primary/5 ${_||k.length>0?"opacity-50 cursor-not-allowed":""}`,children:[_?t.jsx(Qe,{className:"h-4 w-4 text-primary animate-spin"}):t.jsx(Js,{className:"h-4 w-4 text-muted-foreground"}
638),t.jsx("span",{className:"text-sm font-medium",children:_?"Uploading...":"Choose File"})]}),t.jsx("input",{id:"file-upload",type:"file",accept:"image/*,video/*",onChange:Sb,disabled:_||k.length>0,className:"sr-only","data-testid":"input-manual-media"})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs font-medium mb-2 block text-muted-foreground",children:"Or Select from Library"}),t.jsxs(T,{type:"button",variant:"outline",onClick:()=>C(!0),disabled:_||k.length>0,className:"w-full","data-testid":"button-open-media-library",children:[t.jsx(cy,{className:"h-4 w-4 mr-2"}),"Choose from Library"]})]})]}),k.length===0&&!_&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload a new file or choose from your existing media library"}),k.length>0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"Media selected. Remove it below to choose a different file."}),_&&t.jsx("div",{className:"flex items-center justify-center p-8 border-2 border-dashed border-primary/30 rounded-lg bg-primary/5",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"w-16 h-16 rounded-full border-4 border-primary/20 border-t-primary animate-spin"}),t.jsx(Js,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-6 h-6 text-primary"})]}),t.jsx("p",{className:"text-sm font-medium text-primary",children:"Uploading your media..."}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This may take a moment for larger files"})]})}),k.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:k.map((B,we)=>{const Oe=w[we],rt=Oe?Oe.type.startsWith("video/"):GW(B)==="video";return t.jsxs("div",{className:"relative group",children:[rt?t.jsx("video",{src:ft(B),controls:!0,className:"w-full h-32 object-cover rounded-md"}):t.jsx("img",{src:ft(B),alt:`Upload ${we+1}`,className:"w-full h-32 object-cover rounded-md"}),t.jsx("button",{onClick:()=>ym(we),className:"absolute top-1 right-1 p-1 bg-destructive text-destructive-foreground rounded-full opacity-0 group-hover:opacity-100 transition-opacity","data-testid":`button-remove-media-${we}`,children:t.jsx(xr,{className:"w-4 h-4"})}),rt&&A&&t.jsx(xe,{variant:"outline",className:"absolute bottom-1 right-1 bg-background/80 backdrop-blur-sm","data-testid":`badge-aspect-${we}`,children:A==="portrait"?t.jsxs(t.Fragment,{children:[t.jsx(xP,{className:"w-3 h-3 mr-1"}),"Short"]}):t.jsxs(t.Fragment,{children:[t.jsx(hP,{className:"w-3 h-3 mr-1"}),"Wide"]})})]},we)})})]})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"text-sm flex items-center gap-2",children:[Ye.screen2_manual.platformsLabel,t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(Ze,{children:"Select one or more accounts to post to"})]}),t.jsx(de,{children:t.jsx(Du,{platformConfigs:_n,selectedConfigIds:$s,onSelectionChange:go,generationMode:kb,showValidationError:!1})})]}),bo&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(pe,{className:"text-sm flex items-center gap-2",children:"Video/Image Title"}),t.jsx(Ze,{children:"Title for YouTube and TikTok posts (max 200 characters)"})]}),t.jsxs(de,{children:[t.jsx(Ke,{placeholder:"Enter a title for your video or image...",value:j,onChange:B=>N(B.target.value.slice(0,200)),maxLength:200,"data-testid":"input-manual-title"}),t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[j.length,"/200 characters"]})]})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(pe,{className:"text-sm",children:"Schedule"}),t.jsx(Ze,{children:"Choose when to publish your post"})]}),t.jsx(de,{children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Schedule Type"}),t.jsx(My,{value:Y,onValueChange:rn,children:Object.entries(vN).map(([B,we])=>{const Oe=we.icon;return t.jsxs("div",{className:"flex items-center space-x-2 p-3 border rounded-md hover-elevate",children:[t.jsx(Ry,{value:B,id:`schedule-${B}`,"data-testid":`radio-schedule-${B}`}),t.jsxs("label",{htmlFor:`schedule-${B}`,className:"flex-1 flex items-start gap-3 cursor-pointer",children:[t.jsx(Oe,{className:"w-5 h-5 mt-0.5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:we.label}),t.jsx("div",{className:"text-sm text-muted-foreground",children:we.description})]})]})]},B)})}),Da,Y==="custom"&&t.jsxs("div",{className:"mt-4 p-4 border rounded-lg space-y-3 bg-muted/30",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"custom-date",children:"Select Date"}),t.jsx(Ke,{id:"custom-date",type:"date",value:nn,onChange:B=>fl(B.target.value),min:jp(new Date),className:"[color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-custom-date"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"custom-time",children:"Select Time"}),t.jsx(Ke,{id:"custom-time",type:"time",value:La,onChange:B=>xo(B.target.value),className:"[color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-custom-time"})]})]})]})})]})]}),h===3&&x==="ai-assisted"&&f&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(qn,{
638className:"w-5 h-5"}),Ye.screen2.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:Ye.screen2.header.description})]}),f==="text-post"&&t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsx(pe,{className:"text-sm",children:Ye.screen2.textModel.cardTitle})}),t.jsx(de,{children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"text-model",children:Ye.screen2.textModel.label}),t.jsxs(Nt,{value:F,onValueChange:E,children:[t.jsx(gt,{id:"text-model","data-testid":"select-text-model",children:t.jsx(kt,{})}),t.jsx(yt,{children:_e.map(B=>t.jsxs(Se,{value:B.modelId,children:[B.displayName,B.isFree&&t.jsx("span",{className:"ml-2 text-xs text-green-600",children:"(Free)"})]},B.id))})]})]})})]}),f!=="text-post"&&t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsx(pe,{className:"text-sm",children:Ye.screen2.imageConfig.cardTitle})}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"image-model",children:Ye.screen2.imageConfig.imageModelLabel}),t.jsxs(Nt,{value:ne,onValueChange:U,children:[t.jsx(gt,{id:"image-model","data-testid":"select-image-model",children:t.jsx(kt,{})}),t.jsx(yt,{children:Te.map(B=>t.jsxs(Se,{value:B.modelId,children:[B.displayName,B.isFree&&t.jsx("span",{className:"ml-2 text-xs text-green-600",children:"(Free)"})]},B.id))})]})]}),(f==="image-to-image"||f==="image-reel")&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs(ae,{children:["Reference Images ",f==="image-to-image"&&t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:f==="image-to-image"?"Upload a reference image that AI will transform based on your prompt":"Optionally add reference images to guide the AI style (or leave empty for text-based generation)"}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs font-medium mb-2 block text-muted-foreground",children:"Upload New Image"}),t.jsxs("label",{htmlFor:"reference-images",className:`flex items-center justify-center gap-2 w-full h-10 px-4 border-2 border-dashed rounded-md cursor-pointer transition-colors hover:border-primary hover:bg-primary/5 ${le?"opacity-50 cursor-not-allowed":""}`,children:[t.jsx(Js,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:le?"Uploading...":"Choose File"})]}),t.jsx("input",{id:"reference-images",type:"file",accept:"image/*",onChange:od,disabled:le,className:"sr-only","data-testid":"input-reference-image"})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs font-medium mb-2 block text-muted-foreground",children:"Or Select from Library"}),t.jsxs(T,{type:"button",variant:"outline",onClick:()=>W(!0),disabled:le,className:"w-full","data-testid":"button-open-reference-library",children:[t.jsx(cy,{className:"h-4 w-4 mr-2"}),"Choose from Library"]})]})]}),Q.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2 mt-3",children:Q.map((B,we)=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:ft(B),alt:`Reference ${we+1}`,className:"w-full h-32 object-cover rounded-lg border"}),t.jsx("button",{onClick:()=>ld(we),className:"absolute top-1 right-1 bg-destructive text-destructive-foreground rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity","data-testid":`button-remove-ref-${we}`,children:t.jsx(xr,{className:"w-4 h-4"})})]},we))})]}),f==="image-reel"&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"num-images",children:Ye.screen2.imageConfig.numImagesLabel}),t.jsx(Ke,{id:"num-images",type:"number",min:"1",max:"10",value:X,onChange:B=>se(parseInt(B.target.value)||1),"data-testid":"input-num-images"})]})]})]}),f==="image-reel"&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsx(pe,{className:"text-sm",children:Ye.screen2.audioConfig.cardTitle}),t.jsx(Ze,{className:"text-xs",children:Ye.screen2.audioConfig.cardDescription})]}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"audio-source",children:Ye.screen2.audioConfig.audioSourceLabel}),t.jsxs(Nt,{value:te,onValueChange:B=>R(B),children:[t.jsx(gt,{id:"audio-source","data-testid":"select-audio-source",children:t.jsx(kt,{})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"media_library",children:Ye.screen2.audioConfig.mediaLibraryOption}),t.jsx(Se,{value:"user_list",children:Ye.screen2.audioConfig.userListOption}),t.jsx(Se,{value:"free_library",children:Ye.screen2.audioConfig.freeLibraryOption})]})]})]}),te==="media_library"&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"media-library-audio",children:Ye.screen2.audioConfig.mediaLibrarySelectLabel}),t.jsxs(Nt,{value:Ie||"",onValueChange:B=>
638dt(B||null),children:[t.jsx(gt,{id:"media-library-audio","data-testid":"select-media-library-audio",children:t.jsx(kt,{placeholder:"Select an audio file"})}),t.jsx(yt,{children:Jt.length===0?t.jsx(Se,{value:"_none",disabled:!0,children:"No audio files in your library"}):Jt.map(B=>t.jsxs(Se,{value:B.id.toString(),children:[B.generated_title,yo(B.duration)]},B.id))})]}),Jt.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload audio files in the Media Library to use them here."})]}),te==="user_list"&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"audio-list",children:Ye.screen2.audioConfig.userListSelectLabel}),t.jsxs(Nt,{value:K||"",onValueChange:B=>ve(B||null),children:[t.jsx(gt,{id:"audio-list","data-testid":"select-audio-list",children:t.jsx(kt,{placeholder:"Select an audio list"})}),t.jsx(yt,{children:at.filter(B=>B.mediaType==="Audio").map(B=>t.jsx(Se,{value:B.id.toString(),children:B.name},B.id))})]})]}),te==="free_library"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"free-genre",children:Ye.screen2.audioConfig.genreLabel}),t.jsxs(Nt,{value:jt||"",onValueChange:B=>
638Ss(B||null),children:[t.jsx(gt,{id:"free-genre","data-testid":"select-free-genre",children:t.jsx(kt,{placeholder:"Any Genre"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"pop",children:"Pop"}),t.jsx(Se,{value:"rock",children:"Rock"}),t.jsx(Se,{value:"electronic",children:"Electronic"}),t.jsx(Se,{value:"jazz",children:"Jazz"}),t.jsx(Se,{value:"classical",children:"Classical"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"free-mood",children:Ye.screen2.audioConfig.moodLabel}),t.jsxs(Nt,{value:Mt||"",onValueChange:B=>Cs(B||null),children:[t.jsx(gt,{id:"free-mood","data-testid":"select-free-mood",children:t.jsx(kt,{placeholder:"Any Mood"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"energetic",children:"Energetic"}),t.jsx(Se,{value:"uplifting",children:"Uplifting"}),t.jsx(Se,{value:"calm",children:"Calm"}),t.jsx(Se,{value:"dark",children:"Dark"}),t.jsx(Se,{value:"romantic",children:"Romantic"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"free-duration",children:Ye.screen2.audioConfig.durationLabel}),t.jsx(Ke,{id:"free-duration",type:"number",min:"3",max:"12",value:Zt,onChange:B=>D(parseInt(B.target.value)||8),"data-testid":"input-free-duration"})]})]})]})]})]}),h===4&&x==="ai-assisted"&&f&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(mi,{className:"w-5 h-5"}),Ye.screen3.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:Ye.screen3.header.description})]}),t.jsx(re,{children:t.jsx(de,{className:"p-4 space-y-4",children:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(ae,{htmlFor:"prompt-text",children:Ye.screen3.aiPrompt.label(f)}),t.jsxs(rl,{children:[t.jsx(nl,{asChild:!0,children:t.jsxs(T,{type:"button",size:"sm",variant:"outline","data-testid":"button-insert-item",children:[Ye.screen3.aiPrompt.insertButtonLabel,t.jsx(Pa,{className:"ml-2 h-4 w-4"})]})}),t.jsx(ao,{align:"end",className:"w-56",children:at.length===0?t.jsx(Es,{disabled:!0,children:Ye.screen3.aiPrompt.noItemsAvailable}):at.map(B=>t.jsxs(Es,{onClick:()=>gm(B.name),"data-testid":`menu-item-${B.name}`,children:[t.jsx("span",{className:"font-mono text-xs mr-2",children:`{${B.name}}`}),t.jsx("span",{className:"flex-1",children:B.name})]},B.id))})]})]}),t.jsx(os,{id:"prompt-text",placeholder:Ye.screen3.aiPrompt.placeholder(f),value:q,onChange:B=>I(B.target.value),rows:9,"data-testid":"input-prompt-text"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Ye.screen3.aiPrompt.helpText(f)})]})})}),f!=="text-post"&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsxs(pe,{className:"text-sm",children:[Ye.screen3.captionPrompt.cardTitle," ",t.jsx("span",{className:"text-muted-foreground",children:Ye.screen3.captionPrompt.cardTitleOptional})]}),t.jsx(Ze,{className:"text-xs",children:Ye.screen3.captionPrompt.cardDescription})]}),t.jsx(de,{className:"pt-3",children:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(ae,{htmlFor:"caption-prompt",children:Ye.screen3.captionPrompt.label}),t.jsxs(rl,{children:[t.jsx(nl,{asChild:!0,children:t.jsxs(T,{type:"button",size:"sm",variant:"outline","data-testid":"button-insert-caption-item",children:[Ye.screen3.captionPrompt.insertButtonLabel,t.jsx(Pa,{className:"ml-2 h-4 w-4"})]})}),t.jsx(ao,{align:"end",className:"w-56",children:at.length===0?t.jsx(Es,{disabled:!0,children:Ye.screen3.captionPrompt.noItemsAvailable}):at.map(B=>t.jsxs(Es,{onClick:()=>Ys(B.name),"data-testid":`menu-caption-item-${B.name}`,children:[t.jsx("span",{className:"font-mono text-xs mr-2",children:`{${B.name}}`}),t.jsx("span",{className:"flex-1",children:B.name})]},B.id))})]})]}),t.jsx(os,{id:"caption-prompt",placeholder:Ye.screen3.captionPrompt.placeholder,value:Ae,onChange:B=>G(B.target.value),rows:3,"data-testid":"input-caption-prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Ye.screen3.captionPrompt.helpText})]})})]})]}),h===5&&x==="ai-assisted"&&f&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(Ju,{className:"w-5 h-5"}),Ye.screen4.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:Ye.screen4.header.description})]}),!Re&&t.jsx("div",{className:"flex justify-center",children:t.jsx(T,{onClick:Cb,disabled:!tM,size:"lg","data-testid":"button-generate",children:Z?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),Ye.screen4.generate.generatingText]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),Ye.screen4.generate.buttonGenerate]})})}),Re&&t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(pe,{className:"text-sm",children:Ye.screen4.generate.previewTitle}),t.jsxs(T,{variant:"outline",size:"sm",onClick:Cb,disabled:Z,"data-testid":"button-regenerate",children:[Z?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):t.jsx(Et,{className:"w-4 h-4 mr-2"}),Ye.screen4.generate.buttonRegenerate]})]})}),t.jsxs(de,{className:"pt-3",children:[qe&&t.jsx("div",{className:"mb-4",children:t.jsx("video",{src:ft(qe),controls:!0,className:"w-full rounded-lg max-h-96","data-testid":"video-generated"})}),ce&&t.jsx("div",{className:"mb-4",children:t.jsx("img",{src:ft(ce),alt:"Generated content",className:"w-full rounded-lg max-h-96 object-contain","data-testid":"img-generated"})}),fe&&t.jsx("div",{className:"p-3 bg-muted rounded-lg",children:t.jsx("p",{className:"whitespace-pre-wrap","data-testid":"text-generated-content",children:fe})})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("h4",{className:"font-semibold",children:Ye.screen4.schedule.heading}),t.jsx(My,{value:Y,onValueChange:rn,children:Object.entries(vN).map(([B,we])=>{const Oe=we.icon;return t.jsxs("div",{className:"flex items-center space-x-3 p-4 border rounded-lg hover-elevate",children:[t.jsx(Ry,{value:B,id:B,"data-testid":`radio-${B}`}),t.jsxs(ae,{htmlFor:B,className:"flex items-center gap-3 flex-1 cursor-pointer",children:[t.jsx(Oe,{className:"w-5 h-5"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium",children:we.label}),t.jsx("div",{className:"text-sm text-muted-foreground",children:we.description})]})]})]},B)})}),Da,Y==="custom"&&t.jsxs("div",{className:"mt-4 p-4 border rounded-lg space-y-3 bg-muted/30",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"ai-custom-date",children:"Select Date"}),t.jsx(Ke,{id:"ai-custom-date",type:"date",value:nn,onChange:B=>fl(B.target.value),min:jp(new Date),className:"[color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-ai-custom-date"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"ai-custom-time",children:"Select Time"}),t.jsx(Ke,{id:"ai-custom-time",type:"time",value:La,onChange:B=>xo(B.target.value),className:"[color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-ai-custom-time"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:Ye.screen4.schedule.platformsLabel}),t.jsx(Du,{platformConfigs:_n,selectedConfigIds:$s,onSelectionChange:go,generationMode:jo.generationMode,showValidationError:!1})]})]})]})]})]}),(x==="manual"&&h===2||x==="ai-assisted"&&h===5&&Re)&&t.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 text-sm space-y-1","data-testid":"schedule-confirmation-preview",children:[t.jsx("p",{className:"font-semibold",children:$s.length===0?"Save as draft":Y==="now"?"Publish now":"Schedule post"}),t.jsx("p",{className:"text-muted-foreground",children:$s.length===0?"N
638o account selected. This saves a draft; nothing will be published.":`Selected accounts: ${$s.map(B=>id(B,"account")).join(", ")}.`}),$s.length>0&&t.jsx("p",{className:"text-muted-foreground",children:Y==="now"?"We'll try to publish to these accounts now and show the result.":Y==="custom"?cd&&cd>new Date?`Scheduled for ${ec(cd)}. This is your local time, not a publishing confirmation.`:"Choose a valid future local date and time; times skipped by daylight saving cannot be scheduled.":la?"The previewed hour has passed. Refresh next hour and review the new time.":`Scheduled for ${ec(Qs)} on all selected accounts. Nothing publishes now; conflicts will not move this time.`})]}),zs&&t.jsx("p",{role:"alert",className:"text-sm text-destructive","data-testid":"youtube-video-required",children:zs}),t.jsxs("div",{className:"flex items-center justify-between pt-6 border-t",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{variant:"outline",onClick:iM,disabled:h===1,"data-testid":"button-wizard-prev",children:[t.jsx(Qo,{className:"w-4 h-4 mr-1"}),Ye.navigation.previous]}),s&&t.jsx(T,{variant:"outline",onClick:s,"data-testid":"button-wizard-cancel",children:Ye.navigation.cancel})]}),t.jsx("div",{className:"flex gap-2",children:h===1||x==="ai-assisted"&&h<5?t.jsxs(T,{onClick:aM,disabled:h===1&&!Pb||h===2&&x==="ai-assisted"&&!ZI||h===3&&x==="ai-assisted"&&!JI||h===4&&x==="ai-assisted"&&!eM,"data-testid":"button-wizard-next",children:[Ye.navigation.next,t.jsx(Xi,{className:"w-4 h-4 ml-1"})]}):t.jsx(T,{onClick:YI,disabled:x==="manual"&&!rM||x==="ai-assisted"&&!sM||Lf.isPending,"data-testid":"button-wizard-schedule",children:Lf.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),$s.length===0?"Saving...":Y==="now"?"Posting...":"Scheduling..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Xt,{className:"w-4 h-4 mr-1"}),$s.length===0?"Save as Draft":Y==="now"?"Post Now":Ye.navigation.schedule]})})})]}),t.jsx(cN,{open:M,onOpenChange:C,onSelect:Df,allowedTypes:["image","video"]}),t.jsx(cN,{open:L,onOpenChange:W,onSelect:HI,allowedTypes:["image"]})]})}function Hx({trigger:e,prefilledPlatform:s,prefilledScheduledTime:r,open:n,onOpenChange:a}){const[i,o]=m.useState(!1),l=n!==void 0?n:i,c=a||o,d=()=>{c(!1)},u=()=>{c(!1)};return t.jsxs(Ut,{open:l,onOpenChange:c,children:[t.jsx(Xl,{asChild:!0,children:e||t.jsxs(T,{"data-testid":"button-new-post",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"New Post"]})}),t.jsxs(Ht,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsx(xs,{children:t.jsx(gs,{children:"Create New Post"})}),t.jsx(Rf,{onComplete:d,onCancel:u,prefilledPlatform:s,prefilledScheduledTime:r})]})]})}const YW=Cn({title:Pt().min(1,"Title is required").max(200),description:Pt().max(1e3),media:Uc().refine(e=>(e==null?void 0:e.length)>0,"Media file is required")});function XW({trigger:e}){const[s,r]=m.useState(!1),{toast:n}=bt(),[,a]=Ma(),i=Nf({resolver:kf(YW),defaultValues:{title:"",description:"",media:void 0}}),o=ke({mutationFn:async c=>{const d=new FormData;d.append("title",c.title),d.append("description",c.description),d.append("video",c.media[0]);const u=await fetch("/api/vidmonkey/upload",{method:"POST",body:d,credentials:"include"});if(!u.ok){const h=await u.json();throw new Error(h.message||"Upload failed")}return u.json()},onSuccess:()=>{r(!1),i.reset(),n({title:"Success",description:"Media uploaded successfully"}),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]}),a("/videos")},onError:c=>{n({title:"Upload failed",description:c.message||"Could not upload media",variant:"destructive"})}}),l=c=>{o.mutate(c)};return t.jsxs(Ut,{open:s,onOpenChange:r,children:[t.jsx(Xl,{asChild:!0,children:e||t.jsxs(T,{"data-testid":"button-upload-media",children:[t.jsx(Js,{className:"w-4 h-4 mr-2"}),"Upload Media"]})}),t.jsxs(Ht,{children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Upload Media"}),t.jsx(Ns,{children:"Add images, videos, or audio to your library with title and description"})]}),t.jsx(Bv,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(l),className:"space-y-4",children:[t.jsx(Br,{control:i.control,name:"title",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Title"}),t.jsx(Wr,{children:t.jsx(Ke,{placeholder:"Enter media title",...c,"data-testid":"input-media-title"})}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:i.control,name:"description",render:({field:c})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Description"}),t.jsx(Wr,{children:t.jsx(os,{placeholder:"Enter media description",rows:3,...c,"data-testid":"input-media-description"})}),t.jsx(Kr,{})]})}
638),t.jsx(Br,{control:i.control,name:"media",render:({field:{onChange:c,value:d,...u}})=>t.jsxs(Ar,{children:[t.jsx("div",{className:"text-sm text-muted-foreground mb-3",children:"Upload one image, video, or music file"}),t.jsx(_r,{className:"text-xs font-medium text-muted-foreground",children:"Upload New Media"}),t.jsx(Wr,{children:t.jsxs("div",{className:"mt-1",children:[o.isPending?t.jsx("div",{className:"flex items-center justify-center p-8 border-2 border-dashed border-primary/30 rounded-md bg-primary/5",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"w-12 h-12 rounded-full border-4 border-primary/20 border-t-primary animate-spin"}),t.jsx(Js,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-5 h-5 text-primary"})]}),t.jsx("p",{className:"text-sm font-medium text-primary",children:"Uploading your media..."}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This may take a moment for larger files"})]})}):t.jsxs("label",{htmlFor:"upload-dialog-media-file",className:"flex items-center justify-center gap-2 w-full h-12 px-4 border-2 border-dashed rounded-md cursor-pointer transition-colors hover:border-primary hover:bg-primary/5",children:[t.jsx(Js,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Choose File"})]}),t.jsx("input",{id:"upload-dialog-media-file",type:"file",accept:"image/*,video/*,audio/*",onChange:h=>c(h.target.files),...u,className:"sr-only","data-testid":"input-media-file"}),d&&d[0]&&!o.isPending&&t.jsxs("p",{className:"mt-3 text-sm truncate",children:[t.jsx("span",{className:"font-semibold",children:"Selected:"})," ",d[0].name]})]})}),t.jsx(Kr,{})]})}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsx(T,{type:"button",variant:"outline",onClick:()=>r(!1),className:"flex-1","data-testid":"button-cancel-upload",children:"Cancel"}),t.jsx(T,{type:"submit",className:"flex-1",disabled:o.isPending,"data-testid":"button-submit-upload",children:o.isPending?"Uploading...":"Upload"})]})]})})]})]})}function $t(e){const s=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&s==="[object Date]"?new e.constructor(+e):typeof e=="number"||s==="[object Number]"||typeof e=="string"||s==="[object String]"?new Date(e):new Date(NaN)}function oo(e,s){return e instanceof Date?new e.constructor(s):new Date(s)}const rI=6048e5,ZW=864e5,Gm=43200,bN=1440;let JW={};function pm(){return JW}function Lu(e,s){var l,c,d,u;const r=pm(),n=(s==null?void 0:s.weekStartsOn)??((c=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=$t(e),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Tp(e){return Lu(e,{weekStartsOn:1})}function nI(e){const s=$t(e),r=s.getFullYear(),n=oo(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=Tp(n),i=oo(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=Tp(i);return s.getTime()>=a.getTime()?r+1:s.getTime()>=o.getTime()?r:r-1}function jN(e){const s=$t(e);return s.setHours(0,0,0,0),s}function Ap(e){const s=$t(e),r=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return r.setUTCFullYear(s.getFullYear()),+e-+r}function eK(e,s){const r=jN(e),n=jN(s),a=+r-Ap(r),i=+n-Ap(n);return Math.round((a-i)/ZW)}function tK(e){const s=nI(e),r=oo(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Tp(r)}function bh(e,s){const r=$t(e),n=$t(s),a=r.getTime()-n.getTime();return a<0?-1:a>0?1:a}function sK(e){return oo(e,Date.now())}function rK(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nK(e){if(!rK(e)&&typeof e!="number")return!1;const s=$t(e);return!isNaN(Number(s))}function aK(e,s){const r=$t(e),n=$t(s),a=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return a*12+i}function iK(e){return s=>{const n=(e?Math[e]:Math.trunc)(s);return n===0?0:n}}function oK(e,s){return+$t(e)-+$t(s)}function lK(e){const s=$t(e);return s.setHours(23,59,59,999),s}function cK(e){const s=$t(e),r=s.getMonth();return s.setFullYear(s.getFullYear(),r+1,0),s.setHours(23,59,59,999),s}function dK(e){const s=$t(e);return+lK(s)==+cK(s)}function uK(e,s){const r=$t(e),n=$t(s),a=bh(r,n),i=Math.abs(aK(r,n));let o;if(i<1)o=0;else{r.getMonth()===1&&r.getDate()>
vendor: 8,599 bytes, line 638
63827&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let l=bh(r,n)===-a;dK($t(e))&&i===1&&bh(e,n)===1&&(l=!1),o=a*(i-Number(l))}return o===0?0:o}function mK(e,s,r){const n=oK(e,s)/1e3;return iK(r==null?void 0:r.roundingMethod)(n)}function hK(e){const s=$t(e),r=oo(e,0);return r.setFullYear(s.getFullYear(),0,1),r.setHours(0,0,0,0),r}const pK={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"}},fK=(e,s,r)=>{let n;const a=pK[e];return typeof a=="string"?n=a:s===1?n=a.one:n=a.other.replace("{{count}}",s.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Qx(e){return(s={})=>{const r=s.width?String(s.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const xK={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},gK={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yK={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vK={date:Qx({formats:xK,defaultWidth:"full"}),time:Qx({formats:gK,defaultWidth:"full"}),dateTime:Qx({formats:yK,defaultWidth:"full"})},bK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jK=(e,s,r,n)=>bK[e];function Nd(e){return(s,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(s):s;return a[i]}}const wK={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},NK={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kK={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"]},SK={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"]},CK={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"}},PK={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"}},TK=(e,s)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},AK={ordinalNumber:TK,era:Nd({values:wK,defaultWidth:"wide"}),quarter:Nd({values:NK,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nd({values:kK,defaultWidth:"wide"}),day:Nd({values:SK,defaultWidth:"wide"}),dayPeriod:Nd({values:CK,defaultWidth:"wide",formattingValues:PK,defaultFormattingWidth:"wide"})};function kd(e){return(s,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=s.match(a);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?EK(l,h=>h.test(o)):_K(l,h=>h.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=s.slice(o.length);return{value:d,rest:u}}}function _K(e,s){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&s(e[r]))return r}function EK(e,s){for(let r=0;r<e.length;r++)if(s(e[r]))return r}function IK(e){return(s,r={})=>{const n=s.match(e.matchPattern);if(!n)return null;const a=n[0],i=s.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=s.slice(a.length);return{value:o,rest:l}}}const MK=/^(\d+)(th|st|nd|rd)?/i,RK=/\d+/i,FK={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},DK={any:[/^b/i,/^(a|c)/i]},LK={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OK={any:[/1/i,/2/i,/3/i,/4/i]},$K={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},zK={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]},UK={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},VK={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]},BK={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},qK={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}},WK={ordinalNumber:IK({matchPattern:MK,parsePattern:RK,valueCallback:e=>parseInt(e,10)}),era:kd({matchPatterns:FK,defaultMatchWidth:"wide",parsePatterns:DK,defaultParseWidth:"any"}),quarter:kd({matchPatterns:LK,defaultMatchWidth:"wide",parsePatterns:OK,defaultParseWidth:"any",valueCallback:e=>e+1}),month:kd({matchPatterns:$K,defaultMatchWidth:"wide",parsePatterns:zK,defaultParseWidth:"any"}),day:kd({matchPatterns:UK,defaultMatchWidth:"wide",parsePatterns:VK,defaultParseWidth:"any"}),dayPeriod:kd({matchPatterns:BK,defaultMatchWidth:"any",parsePatterns:qK,defaultParseWidth:"any"})},aI={code:"en-US",formatDistance:fK,formatLong:vK,formatRelative:jK,localize:AK,match:WK,options:{weekStartsOn:0,firstWeekContainsDate:1}};function KK(e){const s=$t(e);return eK(s,hK(s))+1}function GK(e){const s=$t(e),r=+Tp(s)-+tK(s);return Math.round(r/rI)+1}function iI(e,s){var u,h,p,x;const r=$t(e),n=r.getFullYear(),a=pm(),i=(s==null?void 0:s.firstWeekContainsDate)??((h=(u=s==null?void 0:s.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((x=(p=a.locale)==null?void 0:p.options)==null?void 0:x.firstWeekContainsDate)??1,o=oo(e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Lu(o,s),c=oo(e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Lu(c,s);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function HK(e,s){var l,c,d,u;const r=pm(),n=(s==null?void 0:s.firstWeekContainsDate)??((c=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=iI(e,s),i=oo(e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Lu(i,s)}function QK(e,s){const r=$t(e),n=+Lu(r,s)-+HK(r,s);return Math.round(n/rI)+1}function Lt(e,s){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(s,"0");return r+n}
vendor: 5,448 bytes, line 638
638const bi={y(e,s){const r=e.getFullYear(),n=r>0?r:1-r;return Lt(s==="yy"?n%100:n,s.length)},M(e,s){const r=e.getMonth();return s==="M"?String(r+1):Lt(r+1,2)},d(e,s){return Lt(e.getDate(),s.length)},a(e,s){const r=e.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,s){return Lt(e.getHours()%12||12,s.length)},H(e,s){return Lt(e.getHours(),s.length)},m(e,s){return Lt(e.getMinutes(),s.length)},s(e,s){return Lt(e.getSeconds(),s.length)},S(e,s){const r=s.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return Lt(a,s.length)}},wl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wN={G:function(e,s,r){const n=e.getFullYear()>0?1:0;switch(s){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,s,r){if(s==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return bi.y(e,s)},Y:function(e,s,r,n){const a=iI(e,n),i=a>0?a:1-a;if(s==="YY"){const o=i%100;return Lt(o,2)}return s==="Yo"?r.ordinalNumber(i,{unit:"year"}):Lt(i,s.length)},R:function(e,s){const r=nI(e);return Lt(r,s.length)},u:function(e,s){const r=e.getFullYear();return Lt(r,s.length)},Q:function(e,s,r){const n=Math.ceil((e.getMonth()+1)/3);switch(s){case"Q":return String(n);case"QQ":return Lt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,s,r){const n=Math.ceil((e.getMonth()+1)/3);switch(s){case"q":return String(n);case"qq":return Lt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,s,r){const n=e.getMonth();switch(s){case"M":case"MM":return bi.M(e,s);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,s,r){const n=e.getMonth();switch(s){case"L":return String(n+1);case"LL":return Lt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,s,r,n){const a=QK(e,n);return s==="wo"?r.ordinalNumber(a,{unit:"week"}):Lt(a,s.length)},I:function(e,s,r){const n=GK(e);return s==="Io"?r.ordinalNumber(n,{unit:"week"}):Lt(n,s.length)},d:function(e,s,r){return s==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):bi.d(e,s)},D:function(e,s,r){const n=KK(e);return s==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Lt(n,s.length)},E:function(e,s,r){const n=e.getDay();switch(s){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,s,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(s){case"e":return String(i);case"ee":return Lt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,s,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(s){case"c":return String(i);case"cc":return Lt(i,s.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,s,r){const n=e.getDay(),a=n===0?7:n;switch(s){case"i":return String(a);case"ii":return Lt(a,s.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,s,r){const a=e.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,s,r){const n=e.getHours();let a;switch(n===12?a=wl.noon:n===0?a=wl.midnight:a=n/12>
vendor: 4,133 bytes, line 638
638=1?"pm":"am",s){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,s,r){const n=e.getHours();let a;switch(n>=17?a=wl.evening:n>=12?a=wl.afternoon:n>=4?a=wl.morning:a=wl.night,s){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,s,r){if(s==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return bi.h(e,s)},H:function(e,s,r){return s==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):bi.H(e,s)},K:function(e,s,r){const n=e.getHours()%12;return s==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Lt(n,s.length)},k:function(e,s,r){let n=e.getHours();return n===0&&(n=24),s==="ko"?r.ordinalNumber(n,{unit:"hour"}):Lt(n,s.length)},m:function(e,s,r){return s==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):bi.m(e,s)},s:function(e,s,r){return s==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):bi.s(e,s)},S:function(e,s){return bi.S(e,s)},X:function(e,s,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(s){case"X":return kN(n);case"XXXX":case"XX":return So(n);case"XXXXX":case"XXX":default:return So(n,":")}},x:function(e,s,r){const n=e.getTimezoneOffset();switch(s){case"x":return kN(n);case"xxxx":case"xx":return So(n);case"xxxxx":case"xxx":default:return So(n,":")}},O:function(e,s,r){const n=e.getTimezoneOffset();switch(s){case"O":case"OO":case"OOO":return"GMT"+NN(n,":");case"OOOO":default:return"GMT"+So(n,":")}},z:function(e,s,r){const n=e.getTimezoneOffset();switch(s){case"z":case"zz":case"zzz":return"GMT"+NN(n,":");case"zzzz":default:return"GMT"+So(n,":")}},t:function(e,s,r){const n=Math.trunc(e.getTime()/1e3);return Lt(n,s.length)},T:function(e,s,r){const n=e.getTime();return Lt(n,s.length)}};function NN(e,s=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+s+Lt(i,2)}function kN(e,s){return e%60===0?(e>0?"-":"+")+Lt(Math.abs(e)/60,2):So(e,s)}function So(e,s=""){const r=e>0?"-":"+",n=Math.abs(e),a=Lt(Math.trunc(n/60),2),i=Lt(n%60,2);return r+a+s+i}const SN=(e,s)=>{switch(e){case"P":return s.date({width:"short"});case"PP":return s.date({width:"medium"});case"PPP":return s.date({width:"long"});case"PPPP":default:return s.date({width:"full"})}},oI=(e,s)=>{switch(e){case"p":return s.time({width:"short"});case"pp":return s.time({width:"medium"});case"ppp":return s.time({width:"long"});case"pppp":default:return s.time({width:"full"})}},YK=(e,s)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return SN(e,s);let i;switch(n){case"P":i=s.dateTime({width:"short"});break;case"PP":i=s.dateTime({width:"medium"});break;case"PPP":i=s.dateTime({width:"long"});break;case"PPPP":default:i=s.dateTime({width:"full"});break}return i.replace("{{date}}",SN(n,s)).replace("{{time}}",oI(a,s))},XK={p:oI,P:YK},ZK=/^D+$/,JK=/^Y+$/,eG=["D","DD","YY","YYYY"];function tG(e){return ZK.test(e)}function sG(e){return JK.test(e)}function rG(e,s,r){const n=nG(e,s,r);if(console.warn(n),eG.includes(e))throw new RangeError(n)}function nG(e,s,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${s}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const aG=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iG=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,oG=/^'([^]*?)'?$/,lG=/''/g,cG=/[a-zA-Z]/;function $r(e,s,r){var u,h,p,x;const n=pm(),a=n.locale??aI,i=n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((x=(p=n.locale)==null?void 0:p.options)==null?void 0:x.weekStartsOn)??0,l=$t(e);if(!nK(l))throw new RangeError("Invalid time value");
638let c=s.match(iG).map(v=>{const f=v[0];if(f==="p"||f==="P"){const b=XK[f];return b(v,a.formatLong)}return v}).join("").match(aG).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const f=v[0];if(f==="'")return{isToken:!1,value:dG(v)};if(wN[f])return{isToken:!0,value:v};if(f.match(cG))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:v}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(v=>{if(!v.isToken)return v.value;const f=v.value;(sG(f)||tG(f))&&rG(f,s,String(e));const b=wN[f[0]];return b(l,f,a.localize,d)}).join("")}function dG(e){const s=e.match(oG);return s?s[1].replace(lG,"'"):e}function uG(e,s,r){const n=pm(),a=(r==null?void 0:r.locale)??n.locale??aI,i=2520,o=bh(e,s);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o});let c,d;o>0?(c=$t(s),d=$t(e)):(c=$t(e),d=$t(s));const u=mK(d,c),h=(Ap(d)-Ap(c))/1e3,p=Math.round((u-h)/60);let x;if(p<2)return r!=null&&r.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):p===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",p,l);if(p<45)return a.formatDistance("xMinutes",p,l);if(p<90)return a.formatDistance("aboutXHours",1,l);if(p<bN){const v=Math.round(p/60);return a.formatDistance("aboutXHours",v,l)}else{if(p<i)return a.formatDistance("xDays",1,l);if(p<Gm){const v=Math.round(p/bN);return a.formatDistance("xDays",v,l)}else if(p<Gm*2)return x=Math.round(p/Gm),a.formatDistance("aboutXMonths",x,l)}if(x=uK(d,c),x<12){const v=Math.round(p/Gm);return a.formatDistance("xMonths",v,l)}else{const v=x%12,f=Math.trunc(x/12);return v<3?a.formatDistance("aboutXYears",f,l):v<9?a.formatDistance("overXYears",f,l):a.formatDistance("almostXYears",f+1,l)}}function Oy(e,s){return uG(e,sK(e),s)}const CN={youtube:"bg-red-500",x:"bg-black",tiktok:"bg-pink-500",instagram:"bg-purple-500",facebook:"bg-blue-600",linkedin:"bg-blue-700",reddit:"bg-orange-500",snapchat:"bg-yellow-400"},PN=e=>{if(!e)return!1;const s=[".mp4",".mov",".webm",".avi",".mkv",".flv",".m4v"],r=e.toLowerCase();return s.some(n=>r.includes(n))};function lI({post:e,viewType:s,channelName:r,icon:n,iconColor:a,accountName:i}){const o=s==="compact";if(o&&e.postType==="reply"){const l=e.postedLink?"a":"div",c=e.postedLink?{href:e.postedLink,target:"_blank",rel:"noopener noreferrer"}:{};return t.jsx(l,{...c,className:"block","data-testid":`card-recent-post-${e.id}`,children:t.jsxs(re,{className:"p-3 space-y-3 cursor-pointer hover-elevate",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[n&&t.jsx(n,{className:`w-3 h-3 ${a}`}),t.jsx("span",{className:"font-medium",children:r}),t.jsxs(xe,{variant:"outline",className:"ml-1 h-4 px-1 text-[10px] gap-0.5 bg-blue-500/10 text-blue-600 border-blue-500/20","data-testid":`badge-reply-${e.id}`,children:[t.jsx(Xh,{className:"w-2.5 h-2.5"}),"Reply"]})]}),t.jsx("span",{className:"text-muted-foreground",children:e.postedAt?$r(new Date(e.postedAt),"M/d h:mm a"):"N/A"})]}),t.jsxs("div",{className:"border-l-2 border-muted-foreground/30 pl-3 py-2 bg-muted/30 rounded-r",children:[t.jsxs("p",{className:"text-[10px] text-muted-foreground mb-1",children:["Replying to @",e.originalTweetAuthor]}),t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3",children:e.originalTweetText})]}),t.jsx("p",{className:"text-xs line-clamp-4",children:e.contentText})]})})}if(!o&&e.postType==="reply")return t.jsxs(re,{"data-testid":`card-post-${e.id}`,children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[t.jsx(xe,{className:`${CN[e.platform]} text-white`,"data-testid":`badge-platform-${e.id}`,children:e.platform}),i&&t.jsx("span",{className:"text-sm text-muted-foreground","data-testid":`text-account-${e.id}`,children:i}),t.jsxs(xe,{variant:"outline",className:"bg-blue-500/10 text-blue-600 border-blue-500/20","data-testid":`badge-reply-${e.id}`,children:[t.jsx(Xh,{className:"h-3 w-3 mr-1"}),"Reply"]}),e.status==="posted"&&t.jsxs(xe,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20","data-testid":`badge-status-${e.id}`,children:[t.jsx(ot,{className:"h-3 w-3 mr-1"}),"Posted"]}),e.status==="failed"&&(e.errorReason?t.jsxs(yu,{children:[t.jsx(vu,{asChild:!0,children:t.jsxs(xe,{variant:"outline",className:"bg-red-500/10 text-red-600 border-red-500/20 cursor-help","data-testid":`badge-status-${e.id}`,children:[t.jsx(Qr,{className:"h-3 w-3 mr-1"}),"Failed"]})}),t.jsx(Lc,{className:"max-w-xs",children:t.jsx("p",{className:"text-sm",children:e.errorReason})})]}):t.jsxs(xe,{variant:"outline",className:"bg-red-500/10 text-red-600 border-red-500/20","data-testid":`badge-status-${e.id}`,children:[t.jsx(Qr,{className:"h-3 w-3 mr-1"}),"Failed"]}))]}),t.jsx(pe,{className:"text-base",children:e.postedAt&&t.jsxs("span",{className:"text-sm text-muted-foreground font-normal","data-testid":`text-posted-time-${e.id}`,children:[e.status==="posted"?"Posted":"Attempted"," ",Oy(new Date(e.postedAt),{addSuffix:!0}
638)," on ",new Date(e.postedAt).toLocaleString()]})})]}),e.postedLink&&t.jsx(T,{variant:"outline",size:"sm",asChild:!0,"data-testid":`button-view-post-${e.id}`,children:t.jsxs("a",{href:e.postedLink,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(wa,{className:"h-4 w-4 mr-2"}),"View Post"]})})]})}),t.jsxs(de,{className:"space-y-4",children:[e.status==="failed"&&e.errorReason&&t.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded p-3",children:[t.jsx("p",{className:"text-sm text-red-600 font-medium mb-1",children:"Submission Failed"}),t.jsx("p",{className:"text-xs text-red-600/80","data-testid":`text-error-${e.id}`,children:e.errorReason})]}),t.jsxs("div",{className:"border-l-2 border-muted-foreground/30 pl-4 py-3 bg-muted/30 rounded-r",children:[t.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Replying to @",e.originalTweetAuthor]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:e.originalTweetText})]}),t.jsx("p",{className:"text-sm whitespace-pre-wrap","data-testid":`text-content-${e.id}`,children:e.contentText})]})]});if(o){const l=e.postedLink?"a":"div",c=e.postedLink?{href:e.postedLink,target:"_blank",rel:"noopener noreferrer"}:{};return t.jsx(l,{...c,className:"block","data-testid":`card-recent-post-${e.id}`,children:t.jsxs(re,{className:"p-2 space-y-2 cursor-pointer hover-elevate",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[n&&t.jsx(n,{className:`w-3 h-3 ${a}`}),t.jsx("span",{className:"font-medium",children:r}),t.jsx(xe,{variant:"outline",className:"ml-1 h-4 px-1 text-[10px] bg-green-500/10 text-green-600 border-green-500/20","data-testid":`badge-post-${e.id}`,children:"Post"})]}),t.jsx("span",{className:"text-muted-foreground",children:e.postedAt?$r(new Date(e.postedAt),"M/d h:mm a"):"N/A"})]}),e.mediaUrl?t.jsx("div",{className:"rounded overflow-hidden bg-muted/30",children:PN(e.mediaUrl)?t.jsx("video",{src:ft(e.mediaUrl),className:"w-full h-24 object-cover","data-testid":`video-${e.id}`}):t.jsx("img",{src:ft(e.mediaUrl),alt:"Content preview",className:"w-full h-24 object-cover","data-testid":`image-${e.id}`})}):t.jsx("div",{className:"h-24 flex items-center justify-center rounded bg-muted/30 px-2",children:t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-4 text-center",children:e.contentText||"No caption"})}),e.mediaUrl&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:e.contentText||"No caption"})]})})}return t.jsxs(re,{"data-testid":`card-post-${e.id}`,children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[t.jsx(xe,{className:`${CN[e.platform]} text-white`,"data-testid":`badge-platform-${e.id}`,children:e.platform}),i&&t.jsx("span",{className:"text-sm text-muted-foreground","data-testid":`text-account-${e.id}`,children:i}),t.jsx(xe,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20","data-testid":`badge-post-${e.id}`,children:"Post"}),e.status==="posted"&&t.jsxs(xe,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20","data-testid":`badge-status-${e.id}`,children:[t.jsx(ot,{className:"h-3 w-3 mr-1"}),"Posted"]}),e.status==="failed"&&(e.errorReason?t.jsxs(yu,{children:[t.jsx(vu,{asChild:!0,children:t.jsxs(xe,{variant:"outline",className:"bg-red-500/10 text-red-600 border-red-500/20 cursor-help","data-testid":`badge-status-${e.id}`,children:[t.jsx(Qr,{className:"h-3 w-3 mr-1"}),"Failed"]})}),t.jsx(Lc,{className:"max-w-xs",children:t.jsx("p",{className:"text-sm",children:e.errorReason})})]}):t.jsxs(xe,{variant:"outline",className:"bg-red-500/10 text-red-600 border-red-500/20","data-testid":`badge-status-${e.id}`,children:[t.jsx(Qr,{className:"h-3 w-3 mr-1"}),"Failed"]}))]}),t.jsx(pe,{className:"text-base",children:e.postedAt&&t.jsxs("span",{className:"text-sm text-muted-foreground font-normal","data-testid":`text-posted-time-${e.id}`,children:["Posted ",Oy(new Date(e.postedAt),{addSuffix:!0}
638)," on ",new Date(e.postedAt).toLocaleString()]})})]}),e.postedLink&&t.jsx(T,{variant:"outline",size:"sm",asChild:!0,"data-testid":`button-view-post-${e.id}`,children:t.jsxs("a",{href:e.postedLink,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(wa,{className:"h-4 w-4 mr-2"}),"View Post"]})})]})}),t.jsxs(de,{className:"space-y-4",children:[e.status==="failed"&&e.errorReason&&t.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded p-3",children:[t.jsx("p",{className:"text-sm text-red-600 font-medium mb-1",children:"Submission Failed"}),t.jsx("p",{className:"text-xs text-red-600/80","data-testid":`text-error-${e.id}`,children:e.errorReason})]}),e.mediaUrl&&t.jsx("div",{className:"rounded-lg overflow-hidden bg-muted/30",children:PN(e.mediaUrl)?t.jsx("video",{src:ft(e.mediaUrl),controls:!0,className:"w-full h-auto object-cover max-h-80","data-testid":`video-${e.id}`}):t.jsx("img",{src:ft(e.mediaUrl),alt:"Post content",className:"w-full h-auto object-cover max-h-80","data-testid":`image-${e.id}`})}),t.jsx("p",{className:"text-sm whitespace-pre-wrap","data-testid":`text-content-${e.id}`,children:e.contentText})]})]})}function TN(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function cI(e,s){const r=TN(e),n=TN(s);return n.setDate(n.getDate()+1),{start:r,end:n}}function AN(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function _N(e,s){if(!e)return!1;const r=new Date(e).getTime();if(!Number.isFinite(r))return!1;const{start:n,end:a}=cI(s,s);return r>=n.getTime()&&r<a.getTime()}function mG(e,s){return s.some(r=>r.status==="posted"&&_N(r.postedAt,e))?"posted":s.some(r=>r.status==="approved"&&_N(r.scheduledTime,e))?"planned":"unfulfilled"}function hG(e,s=new Date){return AN(e)<AN(s)}function ub({date:e,entries:s=[],loading:r=!1,error:n=!1,onCreatePost:a,compact:i=!1}){const o=r||n,l=o?null:mG(e,s),c=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(!o&&l==="unfulfilled"&&hG(e))return null;const d=t.jsxs(T,{type:"button",size:i?"sm":"default",variant:i?"outline":"default",className:i?"h-auto min-h-7 w-full min-w-0 shrink-0 justify-center gap-1 whitespace-normal px-1 py-1 text-[10px] leading-tight [&_svg]:size-3":"w-full sm:w-auto",onClick:()=>a(e),"data-testid":`button-create-post-reminder-${c}`,children:[t.jsx(cw,{className:`shrink-0 ${i?"h-3 w-3":"mr-1.5 h-4 w-4"}`}),t.jsx("span",{className:i?"min-w-0 break-words":void 0,children:"Create Post"})]});if(l==="posted"||l==="planned")return t.jsxs("div",{className:`flex min-w-0 items-center gap-1.5 text-xs font-medium ${l==="posted"?"text-green-700 dark:text-green-400":"text-muted-foreground"}`,"aria-label":l==="posted"?"Posted":"Post planned","data-testid":`daily-reminder-${l}-${c}`,children:[t.jsx(Ir,{className:"h-3.5 w-3.5 shrink-0"}),t.jsx("span",{className:"min-w-0 break-words",children:l==="posted"?"Posted":"Post planned"})]});const u=e.getFullYear()===new Date().getFullYear()&&e.getMonth()===new Date().getMonth()&&e.getDate()===new Date().getDate();return t.jsxs("div",{className:`flex min-w-0 shrink-0 justify-between gap-2 rounded-md border border-dashed p-2 ${i?"w-full flex-col items-stretch":"items-center flex-col sm:flex-row"}`,"data-testid":`daily-reminder-${o?"unavailable":"unfulfilled"}-${c}`,children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-xs",children:[o?t.jsx(lP,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):t.jsx(cw,{className:"h-4 w-4 shrink-0 text-primary"}),t.jsx("span",{className:"min-w-0 break-words leading-snug",children:o?"Reminder status unavailable":`Plan a post for ${u?"today":"this day"}`})]}),d]})}const pG={youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]"},x:{icon:js,displayName:"Twitter",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]"},instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]"},snapchat:{icon:null,displayName:"Snapchat",color:"text-yellow-400"},tbd:{icon:null,displayName:"TBD",color:"text-muted-foreground"}},fG={video:{icon:Xr,displayName:"Video",color:"text-primary"},poll:{icon:Ta,displayName:"Poll",color:"text-primary"},tip:{icon:Yo,displayName:"Tip",color:"text-chart-2"},image:{icon:Ft,displayName:"Image",color:"text-chart-2"},manual:{icon:sf,displayName:"Manual",color:"text-muted-foreground"}};function xG({items:e,dayOffset:s,reminderEntries:r=[],remindersEnabled:n=!1,reminderLoading:a=!1,reminderError:i=!1,onCreatePost:o,onItemClick:l}){const{toast:c}=bt(),[d,u]=m.useState(null),[h,p]=m.useState(""),[x,v]=m.useState(""),f=Vc(s),b=io(f),y=e.filter(F=>F.scheduledDate===b),g=F=>{if(!F||typeof F!="string")return 0;const E=F.match(/(\d+):(\d+)\s*(AM|PM)/i);if(!E)return 0;const ne=parseInt(E[1],10),U=parseInt(E[2],10);if(isNaN(ne)||isNaN(U)||ne<1||ne>12||U<0||U>59)return 0;let Ae=ne;E[3].toUpperCase()==="AM"?ne===12&&(Ae=0):ne!==12&&(Ae=ne+12);const Q=Ae*60+U;return isNaN(Q)?0:Q},j=y.map(F=>({item:F,sortTime:g(F.scheduledTime),time:F.scheduledTime}));j.sort((F,E)=>F.sortTime-E.sortTime);const N=j.reduce((F,E)=>{const ne=E.time;return F[ne]||(F[ne]=[]),F[ne].push(E),F},{}),w=ke({mutationFn:async({itemId:F,platform:E})=>Fe(`/api/posts/${F}/approve/${E}`,"POST"),onSuccess:()=>
638{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),c({title:"Post approved",description:"The post will be published at the scheduled time"})},onError:()=>{c({title:"Error",description:"Failed to approve post",variant:"destructive"})}}),S=ke({mutationFn:async({itemId:F,platform:E})=>Fe(`/api/posts/${F}/reject/${E}`,"POST"),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),c({title:"Post rejected",description:"The post will not be published"})},onError:()=>{c({title:"Error",description:"Failed to reject post",variant:"destructive"})}}),k=ke({mutationFn:async F=>Fe(`/api/posts/${F}`,"DELETE"),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),c({title:"Post deleted",description:"The post has been removed from the queue"})},onError:()=>{c({title:"Error",description:"Failed to delete post",variant:"destructive"})}}),P=ke({mutationFn:async({itemId:F,caption:E,imageUrl:ne})=>Fe(`/api/posts/${F}`,"PATCH",{caption:E,imageUrl:ne}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),u(null),c({title:"Post updated",description:"Changes saved successfully"})},onError:()=>{c({title:"Error",description:"Failed to update post",variant:"destructive"})}}),A=(F,E)=>{w.mutate({itemId:F,platform:E})},$=(F,E)=>{S.mutate({itemId:F,platform:E})},_=F=>{confirm("Are you sure you want to delete this post?")&&k.mutate(F)},O=(F,E,ne)=>{u(F),p(E),v(ne||"")},M=F=>{P.mutate({itemId:F,caption:h,imageUrl:x||void 0})},C=()=>{u(null),p(""),v("")},L=io(Vc()),W=b===L,q=y.length,I=n&&o?t.jsx(ub,{date:f,entries:r,loading:a,error:i,onCreatePost:o}):null;return j.length===0?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ca,{className:"w-5 h-5 text-primary"}),t.jsxs("h2",{className:"text-lg font-semibold",children:[W?"Today - ":"",b," (0)"]}),W&&t.jsx(xe,{variant:"default",className:"uppercase ml-2",children:"Today"})]}),I,t.jsx("div",{className:"text-center py-12",children:t.jsx("p",{className:"text-muted-foreground",children:"No posts scheduled for this day."})})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ca,{className:"w-5 h-5 text-primary"}),t.jsxs("h2",{className:"text-lg font-semibold",children:[W?"Today - ":"",b," (",q,")"]}),W&&t.jsx(xe,{variant:"default",className:"uppercase ml-2",children:"Today"})]}),I,t.jsx("div",{className:"space-y-2",children:Object.entries(N).map(([F,E])=>t.jsxs("div",{className:"relative",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(ws,{className:"w-4 h-4 text-primary flex-shrink-0"}),t.jsx("div",{className:"flex-1 h-px bg-border"}),t.jsx("span",{className:"text-sm font-semibold text-primary whitespace-nowrap",children:F}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),t.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 ml-0 md:ml-6",children:E.map(ne=>{const U=ne.item,Ae=fG[U.contentType],G=Ae.icon;return t.jsxs(re,{className:`p-4 flex flex-col ${U.isAutoPublishing?"bg-[var(--auto-approved-bg)] border-[var(--auto-approved-border)]":"bg-background border-border"}`,"data-testid":`post-card-${U.id}`,children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[t.jsx(G,{className:`w-5 h-5 ${Ae.color}`}),t.jsx(xe,{variant:"outline",className:"text-xs",children:Ae.displayName}),t.jsx(xe,{variant:"outline",className:`ml-auto text-xs ${Xa(U.platformApprovals.map(Q=>Q.status)).className}`,children:Xa(U.platformApprovals.map(Q=>Q.status)).label}),l&&t.jsx(T,{size:"sm",variant:"outline",onClick:()=>l(U),children:"Details"}),t.jsx(T,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>O(`${U.id}-${U.scheduledTimestamp}`,U.caption,U.imageUrl),"data-testid":`edit-post-${U.id}`,children:t.jsx(sf,{className:"w-4 h-4 text-muted-foreground"})}),t.jsx(T,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>_(U.id),"data-testid":`delete-post-${U.id}`,children:t.jsx(ni,{className:"w-4 h-4 text-muted-foreground"})})]}),d===`${U.id}-${U.scheduledTimestamp}`?t.jsxs("div",{className:"mb-4 space-y-3",children:[(U.deliveryMethod==="text-to-image"||U.deliveryMethod==="image-to-image"||U.deliveryMethod==="carousel")&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"relative rounded-lg overflow-hidden bg-muted/30 aspect-video flex items-center justify-center w-1/2 mx-auto",children:x?t.jsx("img",{src:ft(x),alt:"Preview",className:"w-full h-full object-cover"}):t.jsx(Ft,{className:"w-12 h-12 text-muted-foreground"})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:x,onChange:Q=>v(Q.target.value),placeholder:"Image URL",className:"flex-1 px-3 py-2 text-sm rounded-md border border-input bg-background","data-testid":`input-image-url-${U.id}`}),t.jsx(T,{size:"icon",variant:"outline",className:"h-9 w-9","data-testid":`upload-image-${U.id}`,children:t.jsx(Js,{className:"w-4 h-4"})})]})]}),(U.deliveryMethod==="image-reel"||U.deliveryMethod==="video")&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"relative rounded-lg overflow-hidden bg-black aspect-video flex items-center justify-center w-1/2 mx-auto",children:x?t.jsx("video",{src:ft(x),controls:!0,className:"w-full h-full object-contain"}):t.jsx(Xr,{className:"w-12 h-12 text-muted-foreground"})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:x,onChange:Q=>v(Q.target.value),placeholder:"Video URL",className:"flex-1 px-3 py-2 text-sm rounded-md border border-input bg-background","data-testid":`input-video-url-${U.id}`}),t.jsx(T,{size:"icon",variant:"outline",className:"h-9 w-9","data-testid":`upload-video-${U.id}`,children:t.jsx(Js,{className:"w-4 h-4"})})]})]}),t.jsx("textarea",{value:h,onChange:Q=>p(Q.target.value),className:"w-full px-3 py-2 text-sm rounded-md border border-input bg-background min-h-[100px] resize-y","data-testid":`textarea-caption-${U.id}`}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{size:"sm",onClick:()=>M(U.id),"data-testid":`save-edit-${U.id}`,children:[t.jsx(fP,{className:"w-4 h-4 mr-2"}),"Save"]}),t.jsxs(T,{size:"sm",variant:"outline",onClick:C,"data-testid":`cancel-edit-${U.id}`,children:[t.jsx(Qr,{className:"w-4 h-4 mr-2"}),"Cancel"]})]})]}):t.jsx(t.Fragment,{children:U.imageUrl?t.jsxs(t.Fragment,{children:[t.jsxs(yu,{children:[t.jsx(vu,{asChild:!0,children:t.jsx("div",{className:"mb-3 rounded-lg overflow-hidden bg-muted/30 w-1/2 mx-auto cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary",tabIndex:0,children:U.deliveryMethod==="image-reel"||U.deliveryMethod==="video"?t.jsx("video",{src:ft(U.imageUrl),controls:!0,className:"w-full object-contain bg-black",style:{height:"246px"},"data-testid":`video-${U.id}`,children:"Your browser does not support the video tag."}):t.jsx("img",{src:ft(U.imageUrl),alt:"AI generated content",className:"w-full h-auto object-cover","data-testid":`image-${U.id}`})})}),t.jsx(Lc,{className:"max-w-md hidden md:block",children:t.jsx("p",{className:"text-sm",children:U.caption})})]}),t.jsx("p",{className:"md:hidden text-sm mb-4 line-clamp-3",children:U.caption})]}):t.jsx("p",{className:"text-sm mb-4 line-clamp-3",children:U.caption})}),t.jsx("div",{className:"space-y-2 mb-4",children:U.platformApprovals.map(Q=>{const ye=pG[Q.platform],le=ye.icon,J=Q.status==="approved"&&!U.isAutoPublishing,X=U.isAutoPublishing||J;return t.jsxs("div",{className:`flex items-center justify-between p-2 rounded text-sm ${X?"bg-[var(--auto-approved-bg)] border border-[var(--auto-approved-border)]":"bg-muted/30"}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[le&&t.jsx(le,{className:`w-4 h-4 ${ye.color}`}),t.jsx("span",{className:"font-medium text-xs",children:ye.displayName})]}),X?t.jsx(xe,{className:"bg-[var(--auto-approved)] text-[var(--auto-approved-foreground)] text-xs",children:"APPROVED"}):t.jsx("div",{className:"flex items-center gap-1",children:Q.status==="pending"?t.jsxs(t.Fragment,{children:[t.jsx(xe,{variant:"secondary",className:"text-xs",children:"PENDING"}),t.jsx(T,{size:"icon",variant:"default",className:"h-6 w-6",onClick:()=>A(U.id,Q.platform),"data-testid":`approve-${U.id}-${Q.platform}`,children:t.jsx(Xt,{className:"w-3 h-3"})}),t.jsx(T,{size:"icon",variant:"destructive",className:"h-6 w-6",onClick:()=>$(U.id,Q.platform),"data-testid":`reject-${U.id}-${Q.platform}`,children:t.jsx(xr,{className:"w-3 h-3"})})]}):Q.status==="rejected"?t.jsxs(xe,{variant:"destructive",className:"text-xs",children:[t.jsx(xr,{className:"w-3 h-3 mr-1"}),"REJECTED"]}):Q.status==="failed"?t.jsx(xe,{variant:"destructive",className:"text-xs",children:"FAILED — CLICK TO RETRY"}):Q.status==="posting"?t.jsx(xe,{variant:"secondary",className:"text-xs",children:"POSTING"}):null})]},Q.postId||`${U.id}-${Q.platform}`)})})]},`${U.id}-${U.scheduledTimestamp}`)})})]},F))})]})}function gG(e){return Object.prototype.toString.call(e)==="[object Object]"}function EN(e){return gG(e)||Array.isArray(e)}function yG(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function mb(e,s){const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length)return!1;const a=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(s.breakpoints||{}));return a!==i?!1:r.every(o=>{const l=e[o],c=s[o];return typeof l=="function"?`${l}`==`${c}`:!EN(l)||!EN(c)?l===c:mb(l,c)})}function IN(e){return e.concat().sort((s,r)=>s.name>r.name?1:-1).map(s=>s.options)}function vG(e,s){if(e.length!==s.length)return!1;const r=IN(e),n=IN(s);return r.every((a,i)=>{const o=n[i];return mb(a,o)})}function hb(e){return typeof e=="number"}function $y(e){return typeof e=="string"}function Ff(e){return typeof e=="boolean"}function MN(e){return Object.prototype.toString.call(e)==="[object Object]"}function as(e){return Math.abs(e)}function pb(e){return Math.sign(e)}function Wd(e,s){return as(e-s)}function bG(e,s){if(e===0||s===0||as(e)<=as(s))return 0;const r=Wd(as(e),as(s));return as(r/e)}function jG(e){return Math.round(e*100)/100}function Ou(e){return $u(e).map(Number)}function Kn(e){return e[fm(e)]}function fm(e){return Math.max(0,e.length-1)}function fb(e,s){return s===fm(e)}function RN(e,s=0){return Array.from(Array(e),(r,n)=>s+n)}function $u(e){return Object.keys(e)}function dI(e,s){return[e,s].reduce((r,n)=>
vendor: 15,382 bytes, line 638
638($u(n).forEach(a=>{const i=r[a],o=n[a],l=MN(i)&&MN(o);r[a]=l?dI(i,o):o}),r),{})}function zy(e,s){return typeof s.MouseEvent<"u"&&e instanceof s.MouseEvent}function wG(e,s){const r={start:n,center:a,end:i};function n(){return 0}function a(c){return i(c)/2}function i(c){return s-c}function o(c,d){return $y(e)?r[e](c):e(s,c,d)}return{measure:o}}function zu(){let e=[];function s(a,i,o,l={passive:!0}){let c;if("addEventListener"in a)a.addEventListener(i,o,l),c=()=>a.removeEventListener(i,o,l);else{const d=a;d.addListener(o),c=()=>d.removeListener(o)}return e.push(c),n}function r(){e=e.filter(a=>a())}const n={add:s,clear:r};return n}function NG(e,s,r,n){const a=zu(),i=1e3/60;let o=null,l=0,c=0;function d(){a.add(e,"visibilitychange",()=>{e.hidden&&v()})}function u(){x(),a.clear()}function h(b){if(!c)return;o||(o=b,r(),r());const y=b-o;for(o=b,l+=y;l>=i;)r(),l-=i;const g=l/i;n(g),c&&(c=s.requestAnimationFrame(h))}function p(){c||(c=s.requestAnimationFrame(h))}function x(){s.cancelAnimationFrame(c),o=null,l=0,c=0}function v(){o=null,l=0}return{init:d,destroy:u,start:p,stop:x,update:r,render:n}}function kG(e,s){const r=s==="rtl",n=e==="y",a=n?"y":"x",i=n?"x":"y",o=!n&&r?-1:1,l=u(),c=h();function d(v){const{height:f,width:b}=v;return n?f:b}function u(){return n?"top":r?"right":"left"}function h(){return n?"bottom":r?"left":"right"}function p(v){return v*o}return{scroll:a,cross:i,startEdge:l,endEdge:c,measureSize:d,direction:p}}function al(e=0,s=0){const r=as(e-s);function n(d){return d<e}function a(d){return d>s}function i(d){return n(d)||a(d)}function o(d){return i(d)?n(d)?e:s:d}function l(d){return r?d-r*Math.ceil((d-s)/r):d}return{length:r,max:s,min:e,constrain:o,reachedAny:i,reachedMax:a,reachedMin:n,removeOffset:l}}function uI(e,s,r){const{constrain:n}=al(0,e),a=e+1;let i=o(s);function o(p){return r?as((a+p)%a):n(p)}function l(){return i}function c(p){return i=o(p),h}function d(p){return u().set(l()+p)}function u(){return uI(e,l(),r)}const h={get:l,set:c,add:d,clone:u};return h}function SG(e,s,r,n,a,i,o,l,c,d,u,h,p,x,v,f,b,y,g){const{cross:j,direction:N}=e,w=["INPUT","SELECT","TEXTAREA"],S={passive:!1},k=zu(),P=zu(),A=al(50,225).constrain(x.measure(20)),$={mouse:300,touch:400},_={mouse:500,touch:600},O=v?43:25;let M=!1,C=0,L=0,W=!1,q=!1,I=!1,F=!1;function E(R){if(!g)return;function K(Ie){(Ff(g)||g(R,Ie))&&ye(Ie)}const ve=s;k.add(ve,"dragstart",Ie=>Ie.preventDefault(),S).add(ve,"touchmove",()=>{},S).add(ve,"touchend",()=>{}).add(ve,"touchstart",K).add(ve,"mousedown",K).add(ve,"touchcancel",J).add(ve,"contextmenu",J).add(ve,"click",X,!0)}function ne(){k.clear(),P.clear()}function U(){const R=F?r:s;P.add(R,"touchmove",le,S).add(R,"touchend",J).add(R,"mousemove",le,S).add(R,"mouseup",J)}function Ae(R){const K=R.nodeName||"";return w.includes(K)}function G(){return(v?_:$)[F?"mouse":"touch"]}function Q(R,K){const ve=h.add(pb(R)*-1),Ie=u.byDistance(R,!v).distance;return v||as(R)<A?Ie:b&&K?Ie*.5:u.byIndex(ve.get(),0).distance}function ye(R){const K=zy(R,n);F=K,I=v&&K&&!R.buttons&&M,M=Wd(a.get(),o.get())>=2,!(K&&R.button!==0)&&(Ae(R.target)||(W=!0,i.pointerDown(R),d.useFriction(0).useDuration(0),a.set(o),U(),C=i.readPoint(R),L=i.readPoint(R,j),p.emit("pointerDown")))}function le(R){if(!zy(R,n)&&R.touches.length>=2)return J(R);const ve=i.readPoint(R),Ie=i.readPoint(R,j),dt=Wd(ve,C),jt=Wd(Ie,L);if(!q&&!F&&(!R.cancelable||(q=dt>jt,!q)))return J(R);const Ss=i.pointerMove(R);dt>f&&(I=!0),d.useFriction(.3).useDuration(.75),l.start(),a.add(N(Ss)),R.preventDefault()}function J(R){const ve=u.byDistance(0,!1).index!==h.get(),Ie=i.pointerUp(R)*G(),dt=Q(N(Ie),ve),jt=bG(Ie,dt),Ss=O-10*jt,Mt=y+jt/50;q=!1,W=!1,P.clear(),d.useDuration(Ss).useFriction(Mt),c.distance(dt,!v),F=!1,p.emit("pointerUp")}function X(R){I&&(R.stopPropagation(),R.preventDefault(),I=!1)}function se(){return W}return{init:E,destroy:ne,pointerDown:se}}function CG(e,s){let n,a;function i(h){return h.timeStamp}function o(h,p){const v=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(zy(h,s)?h:h.touches[0])[v]}function l(h){return n=h,a=h,o(h)}function c(h){const p=o(h)-o(a),x=i(h)-i(n)>170;return a=h,x&&(n=h),p}function d(h){if(!n||!a)return 0;const p=o(a)-o(n),x=i(h)-i(n),v=i(h)-i(a)>170,f=p/x;return x&&!v&&as(f)>.1?f:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:o}}function PG(){function e(r){const{offsetTop:n,offsetLeft:a,offsetWidth:i,offsetHeight:o}=r;return{top:n,right:a+i,bottom:n+o,left:a,width:i,height:o}}return{measure:e}}function TG(e){function s(n){return e*(n/100)}return{measure:s}}function AG(e,s,r,n,a,i,o){const l=[e].concat(n);let c,d,u=[],h=!1;function p(b){return a.measureSize(o.measure(b))}function x(b){if(!i)return;d=p(e),u=n.map(p);function y(g){for(const j of g){if(h)return;const N=j.target===e,w=n.indexOf(j.target),S=N?d:u[w],k=p(N?e:n[w]);if(as(k-S)>=.5){b.reInit(),s.emit("resize");break}}}c=new ResizeObserver(g=>{(Ff(i)||i(b,g))&&y(g)}),r.requestAnimationFrame(()=>{l.forEach(g=>c.observe(g))})}function v(){h=!0,c&&c.disconnect()}return{init:x,destroy:v}}function _G(e,s,r,n,a,i){let o=0,l=0,c=a,d=i,u=e.get(),h=0;function p(){const S=n.get()-e.get(),k=!c;let P=0;return k?(o=0,r.set(n),e.set(n),P=S):(r.set(e),o+=S/c,o*=d,u+=o,e.add(o),P=u-h),l=pb(P),h=u,w}function x(){const S=n.get()-s.get();return as(S)<.001}function v(){return c}function f(){return l}function b(){return o}function y(){return j(a)}function g(){return N(i)}function j(S){return c=S,w}function N(S){return d=S,w}const w={direction:f,duration:v,velocity:b,seek:p,settled:x,useBaseFriction:g,useBaseDuration:y,useFriction:N,useDuration:j};return w}function EG(e,s,r,n,a){const i=a.measure(10),o=a.measure(50),l=al(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(r.get())||!e.reachedAny(s.get()))}function u(x){if(!d())return;const v=e.reachedMin(s.get())?"min":"max",f=as(e[v]-s.get()),b=r.get()-s.get(),y=l.constrain(f/o);r.subtract(b*y),!x&&as(b)<i&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function h(x){c=!x}return{shouldConstrain:d,constrain:u,toggleActive:h}}function IG(e,s,r,n,a){const i=al(-s+e,0),o=h(),l=u(),c=p();function d(v,f){return Wd(v,f)<=1}function u(){const v=o[0],f=Kn(o),b=o.lastIndexOf(v),y=o.indexOf(f)+1;return al(b,y)}function h(){return r.map((v,f)=>{const{min:b,max:y}=i,g=i.constrain(v),j=!f,N=fb(r,f);return j?y:N||d(b,g)?b:d(y,g)?y:g}).map(v=>parseFloat(v.toFixed(3)))}function p(){if(s<=e+a)return[i.max];if(n==="keepSnaps")return o;const{min:v,max:f}=l;return o.slice(v,f)}return{snapsContained:c,scrollContainLimit:l}}function MG(e,s,r){const n=s[0],a=r?n-e:Kn(s);return{limit:al(a,n)}}function RG(e,s,r,n){const i=s.min+.1,o=s.max+.1,{reachedMin:l,reachedMax:c}=al(i,o);function d(p){return p===1?c(r.get()):p===-1?l(r.get()):!1}function u(p){if(!d(p))return;const x=e*(p*-1);n.forEach(v=>v.add(x))}return{loop:u}}function FG(e){const{max:s,length:r}=e;function n(i){const o=i-s;return r?o/-r:0}return{get:n}}function DG(e,s,r,n,a){const{startEdge:i,endEdge:o}=e,{groupSlides:l}=a,c=h().map(s.measure),d=p(),u=x();function h(){return l(n).map(f=>Kn(f)[o]-f[0][i]).map(as)}function p(){return n.map(f=>r[i]-f[i]).map(f=>-as(f))}function x(){return l(d).map(f=>f[0]).map((f,b)=>f+c[b])}return{snaps:d,snapsAligned:u}}function LG(e,s,r,n,a,i){const{groupSlides:o}=a,{min:l,max:c}=n,d=u();function u(){const p=o(i),x=!e||s==="keepSnaps";return r.length===1?[i]:x?p:p.slice(l,c).map((v,f,b)=>{const y=!f,g=fb(b,f);if(y){const j=Kn(b[0])+1;return RN(j)}if(g){const j=fm(i)-Kn(b)[0]+1;return RN(j,Kn(b)[0])}return v})}return{slideRegistry:d}}function OG(e,s,r,n,a){const{reachedAny:i,removeOffset:o,constrain:l}=n;function c(v){return v.concat().sort((f,b)=>as(f)-as(b))[0]}function d(v){const f=e?o(v):l(v),b=s.map((g,j)=>({diff:u(g-f,0),index:j})).sort((g,j)=>as(g.diff)-as(j.diff)),{index:y}=b[0];return{index:y,distance:f}}function u(v,f){const b=[v,v+r,v-r];if(!e)return v;if(!f)return c(b);const y=b.filter(g=>pb(g)===f);return y.length?c(y):Kn(b)-r}function h(v,f){const b=s[v]-a.get(),y=u(b,f);return{index:v,distance:y}}function p(v,f){const b=a.get()+v,{index:y,distance:g}=d(b),j=!e&&i(b);if(!f||j)return{index:y,distance:v};const N=s[y]-g,w=v+u(N,0);return{index:y,distance:w}}return{byDistance:p,byIndex:h,shortcut:u}}function $G(e,s,r,n,a,i,o){function l(h){const p=h.distance,x=h.index!==s.get();i.add(p),p&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),x&&(r.set(s.get()),s.set(h.index),o.emit("select"))}function c(h,p){const x=a.byDistance(h,p);l(x)}function d(h,p){const x=s.clone().set(h),v=a.byIndex(x.get(),p);l(v)}return{distance:c,index:d}}function zG(e,s,r,n,a,i,o,l){const c={passive:!0,capture:!0};let d=0;function u(x){if(!l)return;function v(f){if(new Date().getTime()-d>10)return;o.emit("slideFocusStart"),e.scrollLeft=0;const g=r.findIndex(j=>j.includes(f));hb(g)&&(a.useDuration(0),n.index(g,0),o.emit("slideFocus"))}i.add(document,"keydown",h,!1),s.forEach((f,b)=>{i.add(f,"focus",y=>{(Ff(l)||l(x,y))&&v(b)},c)})}function h(x){x.code==="Tab"&&(d=new Date().getTime())}return{init:u}}function Id(e){let s=e;function r(){return s}function n(c){s=o(c)}function a(c){s+=o(c)}function i(c){s-=o(c)}function o(c){return hb(c)?c:c.get()}return{get:r,set:n,add:a,subtract:i}}function mI(e,s){const r=e.scroll==="x"?o:l,n=s.style;let a=null,i=!1;function o(p){return`translate3d(${p}px,0px,0px)`}function l(p){return`translate3d(0px,${p}px,0px)`}function c(p){if(i)return;const x=jG(e.direction(p));x!==a&&(n.transform=r(x),a=x)}function d(p){i=!p}function u(){i||(n.transform="",s.getAttribute("style")||s.removeAttribute("style"))}return{clear:u,to:c,toggleActive:d}}function UG(e,s,r,n,a,i,o,l,c){const u=Ou(a),h=Ou(a).reverse(),p=y().concat(g());function x(k,P){return k.reduce((A,$)=>A-a[$],P)}function v(k,P){return k.reduce((A,$)=>x(A,P)>0?A.concat([$]):A,[])}function f(k){return i.map((P,A)=>({start:P-n[A]+.5+k,end:P+s-.5+k}))}function b(k,P,A){const $=f(P);return k.map(_=>{const O=A?0:-r,M=A?r:0,C=A?"end":"start",L=$[_][C];return{index:_,loopPoint:L,slideLocation:Id(-1),translate:mI(e,c[_]),target:()=>l.get()>L?O:M}})}function y(){const k=o[0],P=v(h,k);return b(P,r,!1)}function g(){const k=s-o[0]-1,P=v(u,k);return b(P,-r,!0)}function j(){return p.every(({index:k})=>{const P=u.filter(A=>A!==k);return x(P,s)<=.1})}function N(){p.forEach(k=>{const{target:P,translate:A,slideLocation:$}=k,_=P();_!==$.get()&&(A.to(_),$.set(_))})}function w(){p.forEach(k=>k.translate.clear())}return{canLoop:j,clear:w,loop:N,loopPoints:p}}function VG(e,s,r){let n,a=!1;function i(c){if(!r)return;function d(u){for(const h of u)if(h.type==="childList"){c.reInit(),s.emit("slidesChanged");break}}n=new MutationObserver(u=>{a||(Ff(r)||r(c,u))&&d(u)}),n.observe(e,{childList:!0})}function o(){n&&n.disconnect(),a=!0}return{init:i,destroy:o}}function BG(e,s,r,n){const a={};let i=null,o=null,l,c=!1;function d(){l=new IntersectionObserver(v=>{c||(v.forEach(f=>{const b=s.indexOf(f.target);a[b]=f}),i=null,o=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),s.forEach(v=>l.observe(v))}function u(){l&&l.disconnect(),c=!0}function h(v){return $u(a).reduce((f,b)=>{const y=parseInt(b),{isIntersecting:g}=a[y];return(v&&g||!v&&!g)&&f.push(y),f},[])}function p(v=!0){if(v&&i)return i;if(!v&&o)return o;const f=h(v);return v&&(i=f),v||(o=f),f}return{init:d,destroy:u,get:p}}function qG(e,s,r,n,a,i){const{measureSize:o,startEdge:l,endEdge:c}=e,d=r[0]&&a,u=v(),h=f(),p=r.map(o),x=b();function v(){if(!d)return 0;const g=r[0];return as(s[l]-g[l])}function f(){if(!d)return 0;const g=i.getComputedStyle(Kn(n));return parseFloat(g.getPropertyValue(`margin-${c}`))}function b(){return r.map((g,j,N)=>{const w=!j,S=fb(N,j);return w?p[j]+u:S?p[j]+h:N[j+1][l]-g[l]}).map(as)}return{slideSizes:p,slideSizesWithGaps:x,startGap:u,endGap:h}}function WG(e,s,r,n,a,i,o,l,c){const{startEdge:d,endEdge:u,direction:h}=e,p=hb(r);function x(y,g){return Ou(y).filter(j=>j%g===0).map(j=>y.slice(j,j+g))}function v(y){return y.length?Ou(y).reduce((g,j,N)=>{const w=Kn(g)||0,S=w===0,k=j===fm(y),P=a[d]-i[w][d],A=a[d]-i[j][u],$=!n&&S?h(o):0,_=!n&&k?h(l):0,O=as(A-_-(P+$));return N&&O>s+c&&g.push(j),k&&g.push(y.length),g},[]).map((g,j,N)=>{const w=Math.max(N[j-1]||0);return y.slice(w,g)}):[]}function f(y){return p?x(y,r):v(y)}return{groupSlides:f}}function KG(e,s,r,n,a,i,o){const{align:l,axis:c,direction:d,startIndex:u,loop:h,duration:p,dragFree:x,dragThreshold:v,inViewThreshold:f,slidesToScroll:b,skipSnaps:y,containScroll:g,watchResize:j,watchSlides:N,watchDrag:w,watchFocus:S}=i,k=2,P=PG(),A=P.measure(s),$=r.map(P.measure),_=kG(c,d),O=_.measureSize(A),M=TG(O),C=wG(l,O),L=!h&&!!g,W=h||!!g,{slideSizes:q,slideSizesWithGaps:I,startGap:F,endGap:E}=qG(_,A,$,r,W,a),ne=WG(_,O,b,h,A,$,F,E,k),{snaps:U,snapsAligned:Ae}=DG(_,C,A,$,ne),G=-Kn(U)+Kn(I),{snapsContained:Q,scrollContainLimit:ye}=IG(O,G,Ae,g,k),le=L?Q:Ae,{limit:J}=MG(G,le,h),X=uI(fm(le),u,h),se=X.clone(),te=Ou(r),R=({dragHandler:$e,scrollBody:qe,scrollBounds:wt,options:{loop:Y}})=>{Y||wt.constrain($e.pointerDown()),qe.seek()},K=({scrollBody:$e,translate:qe,location:wt,offsetLocation:Y,previousLocation:xt,scrollLooper:ys,slideLooper:Qs,dragHandler:Tn,animation:An,eventHandler:fi,scrollBounds:rn,options:{loop:la}},Da)=>{const nn=$e.settled(),fl=!rn.shouldConstrain(),La=la?nn:nn&&fl,xo=La&&!Tn.pointerDown();xo&&An.stop();const $s=wt.get()*Da+xt.get()*(1-Da);Y.set($s),la&&(ys.loop($e.direction()),Qs.loop()),qe.to(Y.get()),xo&&fi.emit("settle"),La||fi.emit("scroll")},ve=NG(n,a,()=>R(ce),$e=>K(ce,$e)),Ie=.68,dt=le[X.get()],jt=Id(dt),Ss=Id(dt),Mt=Id(dt),Cs=Id(dt),Zt=_G(jt,Mt,Ss,Cs,p,Ie),D=OG(h,le,G,J,Cs),Z=$G(ve,X,se,Zt,D,Cs,o),ie=FG(J),Re=zu(),Pe=BG(s,r,o,f),{slideRegistry:fe}=LG(L,g,le,ye,ne,te),De=zG(e,r,fe,Z,Zt,Re,o,S),ce={ownerDocument:n,ownerWindow:a,eventHandler:o,containerRect:A,slideRects:$,animation:ve,axis:_,dragHandler:SG(_,e,n,a,Cs,CG(_,a),jt,ve,Z,Zt,D,X,o,M,x,v,y,Ie,w),eventStore:Re,percentOfView:M,index:X,indexPrevious:se,limit:J,location:jt,offsetLocation:Mt,previousLocation:Ss,options:i,resizeHandler:AG(s,o,a,r,_,j,P),scrollBody:Zt,scrollBounds:EG(J,Mt,Cs,Zt,M),scrollLooper:RG(G,J,Mt,[jt,Mt,Ss,Cs]),scrollProgress:ie,scrollSnapList:le.map(ie.get),scrollSnaps:le,scrollTarget:D,scrollTo:Z,slideLooper:UG(_,O,G,q,I,U,le,Mt,r),slideFocus:De,slidesHandler:VG(s,o,N),slidesInView:Pe,slideIndexes:te,slideRegistry:fe,slidesToScroll:ne,target:Cs,translate:mI(_,s)};return ce}function GG(){let e={},s;function r(d){s=d}function n(d){return e[d]||[]}function a(d){return n(d).forEach(u=>u(s,d)),c}function i(d,u){return e[d]=n(d).concat([u]),c}function o(d,u){return e[d]=n(d).filter(h=>h!==u),c}function l(){e={}}const c={init:r,emit:a,off:o,on:i,clear:l};return c}const HG={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function QG(e){function s(i,o){return dI(i,o||{})}function r(i){const o=i.breakpoints||{},l=$u(o).filter(c=>e.matchMedia(c).matches).map(c=>o[c]).reduce((c,d)=>s(c,d),{});return s(i,l)}function n(i){return i.map(o=>$u(o.breakpoints||{})).reduce((o,l)=>o.concat(l),[]).map(e.matchMedia)}return{mergeOptions:s,optionsAtMedia:r,optionsMediaQueries:n}}function YG(e){let s=[];function r(i,o){return s=o.filter(({options:l})=>
638e.optionsAtMedia(l).active!==!1),s.forEach(l=>l.init(i,e)),o.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function n(){s=s.filter(i=>i.destroy())}return{init:r,destroy:n}}function _p(e,s,r){const n=e.ownerDocument,a=n.defaultView,i=QG(a),o=YG(i),l=zu(),c=GG(),{mergeOptions:d,optionsAtMedia:u,optionsMediaQueries:h}=i,{on:p,off:x,emit:v}=c,f=_;let b=!1,y,g=d(HG,_p.globalOptions),j=d(g),N=[],w,S,k;function P(){const{container:te,slides:R}=j;S=($y(te)?e.querySelector(te):te)||e.children[0];const ve=$y(R)?S.querySelectorAll(R):R;k=[].slice.call(ve||S.children)}function A(te){const R=KG(e,S,k,n,a,te,c);if(te.loop&&!R.slideLooper.canLoop()){const K=Object.assign({},te,{loop:!1});return A(K)}return R}function $(te,R){b||(g=d(g,te),j=u(g),N=R||N,P(),y=A(j),h([g,...N.map(({options:K})=>K)]).forEach(K=>l.add(K,"change",_)),j.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(se),y.eventHandler.init(se),y.resizeHandler.init(se),y.slidesHandler.init(se),y.options.loop&&y.slideLooper.loop(),S.offsetParent&&k.length&&y.dragHandler.init(se),w=o.init(se,N)))}function _(te,R){const K=ne();O(),$(d({startIndex:K},te),R),c.emit("reInit")}function O(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),o.destroy(),l.clear()}function M(){b||(b=!0,l.clear(),O(),c.emit("destroy"),c.clear())}function C(te,R,K){!j.active||b||(y.scrollBody.useBaseFriction().useDuration(R===!0?0:j.duration),y.scrollTo.index(te,K||0))}function L(te){const R=y.index.add(1).get();C(R,te,-1)}function W(te){const R=y.index.add(-1).get();C(R,te,1)}function q(){return y.index.add(1).get()!==ne()}function I(){return y.index.add(-1).get()!==ne()}function F(){return y.scrollSnapList}function E(){return y.scrollProgress.get(y.offsetLocation.get())}function ne(){return y.index.get()}function U(){return y.indexPrevious.get()}function Ae(){return y.slidesInView.get()}function G(){return y.slidesInView.get(!1)}function Q(){return w}function ye(){return y}function le(){return e}function J(){return S}function X(){return k}const se={canScrollNext:q,canScrollPrev:I,containerNode:J,internalEngine:ye,destroy:M,off:x,on:p,emit:v,plugins:Q,previousScrollSnap:U,reInit:f,rootNode:le,scrollNext:L,scrollPrev:W,scrollProgress:E,scrollSnapList:F,scrollTo:C,selectedScrollSnap:ne,slideNodes:X,slidesInView:Ae,slidesNotInView:G};return $(s,r),setTimeout(()=>c.emit("init"),0),se}_p.globalOptions=void 0;function xb(e={},s=[]){const r=m.useRef(e),n=m.useRef(s),[a,i]=m.useState(),[o,l]=m.useState(),c=m.useCallback(()=>{a&&a.reInit(r.current,n.current)},[a]);return m.useEffect(()=>{mb(r.current,e)||(r.current=e,c())},[e,c]),m.useEffect(()=>{vG(n.current,s)||(n.current=s,c())},[s,c]),m.useEffect(()=>{if(yG()&&o){_p.globalOptions=xb.globalOptions;const d=_p(o,r.current,n.current);return i(d),()=>d.destroy()}else i(void 0)},[o,i]),[l,a]}xb.globalOptions=void 0;const XG={youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]"},x:{icon:js,displayName:"Twitter",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]"},instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]"},snapchat:{icon:null,displayName:"Snapchat",color:"text-yellow-400"},tbd:{icon:null,displayName:"TBD",color:"text-muted-foreground"}};function ZG({items:e,weekOffset:s,connections:r=[],userUsername:n="PostMonkey",reminderEntries:a=[],remindersEnabled:i=!1,reminderLoading:o=!1,reminderError:l=!1,onItemClick:c,onCreatePost:d,onApprovePost:u,onRejectPost:h}){const p=Vc(),[x,v]=xb({loop:!1,align:"start"}),[f,b]=m.useState(!1),[y,g]=m.useState(!1),[j,N]=m.useState(0),w=p.getDay(),S=w===0?6:w-1,k=new Date(p);k.setDate(p.getDate()-S+s*7);const P=Array.from({length:7},(C,L)=>{const W=new Date(k);W.setDate(k.getDate()+L);const q=io(W),I=W.toLocaleDateString("en-US",{weekday:"short"}),F=W.getDate();return{dateStr:q,dayName:I,dayNum:F,date:W,items:e.filter(E=>E.scheduledDate===q)}}),A=[P.slice(0,3),P.slice(3,6),P.slice(6,7)],$=m.useCallback(()=>v==null?void 0:v.scrollPrev(),[v]),_=m.useCallback(()=>v==null?void 0:v.scrollNext(),[v]),O=m.useCallback(()=>{v&&(N(v.selectedScrollSnap()),b(v.canScrollPrev()),g(v.canScrollNext()))},[v]);m.useEffect(()=>{if(!v)return;O(),v.on("select",O),v.on("reInit",O);let C=0;if(s===0){const L=p.getDay(),W=L===0?6:L-1;C=W<=2?0:W<=5?1:2}return v.scrollTo(C,!0),()=>{v.off("select",O),v.off("reInit",O)}},[v,O,s]);const M=(C,L)=>{const W=C.date,q=F=>
638{if(!F||typeof F!="string")return 0;const E=F.match(/(\d+):(\d+)\s*(AM|PM)/i);if(!E)return 0;const ne=parseInt(E[1],10),U=parseInt(E[2],10);if(isNaN(ne)||isNaN(U))return 0;const Ae=E[3].toUpperCase();if(ne<1||ne>12||U<0||U>59)return 0;let G=ne;Ae==="AM"?ne===12&&(G=0):ne!==12&&(G=ne+12);const Q=G*60+U;return isNaN(Q)?0:Q},I=C.items.map(F=>({item:F,sortTime:q(F.scheduledTime)}));return I.sort((F,E)=>F.sortTime-E.sortTime),t.jsxs("div",{className:"space-y-3 min-w-0",children:[t.jsxs("div",{className:"text-center pb-2 border-b border-border",children:[t.jsx("div",{className:"text-xs text-muted-foreground uppercase",children:C.dayName}),t.jsx("div",{className:"text-2xl font-bold",children:C.dayNum})]}),t.jsxs("div",{className:"space-y-2",children:[i&&d&&t.jsx(ub,{date:W,entries:a,loading:o,error:l,onCreatePost:d,compact:!0}),I.map(F=>{const E=F.item,ne=E.platformApprovals[0],U=XG[ne==null?void 0:ne.platform],Ae=U==null?void 0:U.icon,G=ne!=null&&ne.platformConfigId?r.find(ye=>ye.id===ne.platformConfigId):r.find(ye=>ye.platform===(ne==null?void 0:ne.platform)),Q=(G==null?void 0:G.channelName)||n;return t.jsxs(re,{className:`p-2 space-y-2 cursor-pointer hover-elevate ${E.isAutoPublishing?"bg-[var(--auto-approved-bg)] border-[var(--auto-approved-border)]":"bg-background border-border"}`,onClick:()=>c==null?void 0:c(E),"data-testid":`card-post-${E.id}`,children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[Ae&&t.jsx(Ae,{className:`w-3 h-3 ${U.color}`}),t.jsx("span",{className:"font-medium",children:Q}),E.platformApprovals.length>1&&t.jsxs("span",{className:"text-muted-foreground text-[10px]","data-testid":`badge-platform-count-${E.id}`,children:["[+",E.platformApprovals.length-1,"]"]})]}),t.jsx("span",{className:"text-muted-foreground md:ml-auto",children:E.scheduledTime}),t.jsx("span",{className:`rounded border px-1.5 py-0.5 ${Xa(E.platformApprovals.map(ye=>ye.status)).className}`,children:Xa(E.platformApprovals.map(ye=>ye.status)).label})]}),E.imageUrl&&t.jsx("div",{className:"rounded overflow-hidden bg-muted/30",children:E.contentType==="video"||E.deliveryMethod==="image-reel"||E.deliveryMethod==="video"?t.jsx("video",{src:ft(E.imageUrl),className:"w-full h-24 object-cover","data-testid":`video-${E.id}`}):t.jsx("img",{src:ft(E.imageUrl),alt:"Content preview",className:"w-full h-24 object-cover","data-testid":`image-${E.id}`})}),t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:E.caption}),u&&h&&!E.isAutoPublishing&&t.jsxs("div",{className:"flex gap-2 pt-1",onClick:ye=>ye.stopPropagation(),children:[t.jsx(T,{variant:"outline",size:"sm",className:"flex-1 h-7 border-green-500/30 hover:border-green-500/50 text-green-600 dark:text-green-500 hover:bg-green-500/10",onClick:ye=>{ye.stopPropagation(),E.platformApprovals.forEach(le=>{le.postId&&le.status==="pending"&&u(le.postId)})},"data-testid":`button-approve-${E.id}`,children:t.jsx(Xt,{className:"h-3.5 w-3.5"})}),t.jsx(T,{variant:"outline",size:"sm",className:"flex-1 h-7 border-red-500/30 hover:border-red-500/50 text-red-600 dark:text-red-500 hover:bg-red-500/10",onClick:ye=>{ye.stopPropagation(),E.platformApprovals.forEach(le=>{le.postId&&le.status==="pending"&&h(le.postId)})},"data-testid":`button-reject-${E.id}`,children:t.jsx(xr,{className:"h-3.5 w-3.5"})})]})]},`${E.id}-${E.scheduledTimestamp}`)})]})]},L)};return t.jsxs("div",{style:{containerType:"inline-size"},children:[t.jsx("div",{className:"hidden [@container(min-width:840px)]:grid grid-cols-7 gap-4",children:P.map((C,L)=>M(C,L))}),t.jsxs("div",{className:"[@container(min-width:840px)]:hidden space-y-4 -mx-2",children:[t.jsxs("div",{className:"relative w-full",children:[t.jsx("div",{className:"px-2",children:t.jsx("div",{className:"overflow-hidden",ref:x,children:t.jsx("div",{className:"flex",children:A.map((C,L)=>t.jsx("div",{className:"flex-[0_0_100%] min-w-0",children:t.jsx("div",{className:`grid gap-2 ${C.length===3?"grid-cols-3":"grid-cols-1"}`,children:C.map((W,q)=>M(W,L*3+q))})},L))})})}),t.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pt-3",children:[t.jsx(T,{variant:"outline",size:"icon",onClick:$,disabled:!f,"data-testid":"button-carousel-prev","aria-label":"Previous days",children:t.jsx(Qo,{className:"h-4 w-4"})}),t.jsx(T,{variant:"outline",size:"icon",onClick:_,disabled:!y,"data-testid":"button-carousel-next","aria-label":"Next days",children:t.jsx(Xi,{className:"h-4 w-4"})})]})]}),t.jsx("div",{className:"flex justify-center gap-2 px-2",role:"tablist","aria-label":"Calendar slides",children:A.map((C,L)=>t.jsx("button",{className:`h-2 rounded-full transition-all ${L===j?"w-8 bg-primary":"w-2 bg-muted-foreground
638/30"}`,onClick:()=>v==null?void 0:v.scrollTo(L),"aria-label":`Go to slide ${L+1}`,"aria-selected":L===j,role:"tab","data-testid":`dot-slide-${L}`},L))})]})]})}const JG={youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]"},x:{icon:js,displayName:"Twitter",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]"},instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]"},snapchat:{icon:null,displayName:"Snapchat",color:"text-yellow-400"},tbd:{icon:null,displayName:"TBD",color:"text-muted-foreground"}},eH={video:{icon:Xr,displayName:"Video",color:"text-primary"},poll:{icon:Ta,displayName:"Poll",color:"text-primary"},tip:{icon:Yo,displayName:"Tip",color:"text-chart-2"},image:{icon:Ft,displayName:"Image",color:"text-chart-2"},manual:{icon:Ft,displayName:"Manual",color:"text-muted-foreground"}};function tH({items:e,monthOffset:s,reminderEntries:r=[],remindersEnabled:n=!1,reminderLoading:a=!1,reminderError:i=!1,onCreatePost:o,onItemClick:l}){const c=Vc(),d=io(c),u=new Date(c.getFullYear(),c.getMonth()+s,1,12),h=u.getFullYear(),p=u.getMonth(),x=new Date(h,p,1),v=x.getDay(),f=new Date(h,p+1,0).getDate(),b=[];for(let g=0;g<v;g++)b.push({day:null,dateStr:""});for(let g=1;g<=f;g++){const j=new Date(h,p,g),N=io(j);b.push({day:g,dateStr:N})}const y=new Map;return e.forEach(g=>{y.has(g.scheduledDate)||y.set(g.scheduledDate,[]),y.get(g.scheduledDate).push(g)}),t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-center pb-4",children:t.jsx("h2",{className:"text-2xl font-bold",children:x.toLocaleDateString("en-US",{month:"long",year:"numeric"})})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("div",{className:"grid grid-cols-7 gap-2 min-w-[840px]",children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(g=>t.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground uppercase py-2",children:g},g)),b.map((g,j)=>{if(!g.day)return t.jsx("div",{className:"aspect-square"},`empty-${j}`);const N=y.get(g.dateStr)||[],w=g.dateStr===d,S=new Date(h,p,g.day,12);return t.jsx(re,{className:`min-w-0 min-h-[130px] p-2 ${w?"ring-2 ring-primary":""}`,children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:`text-sm font-medium ${w?"text-primary":""}`,children:g.day}),n&&o&&t.jsx(ub,{date:S,entries:r,loading:a,error:i,onCreatePost:o,compact:!0}),t.jsx("div",{className:"flex-1 flex flex-wrap gap-1 content-start",children:N.map(k=>{const P=k.platformApprovals[0],A=JG[P==null?void 0:P.platform],$=A==null?void 0:A.icon,_=eH[k.contentType],O=_==null?void 0:_.icon;return t.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(k),"aria-label":`${Xa(k.platformApprovals.map(M=>M.status)).label}: ${(A==null?void 0:A.displayName)||"Post"} at ${k.scheduledTime}. View details`,className:`flex items-center gap-0.5 rounded border px-1 py-0.5 ${Xa(k.platformApprovals.map(M=>M.status)).className}`,title:`${Xa(k.platformApprovals.map(M=>M.status)).label} · ${A==null?void 0:A.displayName} - ${_==null?void 0:_.displayName}: ${k.caption.substring(0,50)}...`,children:[$&&t.jsx($,{className:`w-2.5 h-2.5 ${A.color}`}),O&&t.jsx(O,{className:`w-2.5 h-2.5 ${_.color}`})]},`${k.id}-${k.scheduledTimestamp}`)})})]})},j)})]})})]})}function jh({view:e,items:s,filters:r={},connections:n=[],userUsername:a="PostMonkey",onItemClick:i,onNavigate:o,onCreatePost:l,onApprovePost:c,onRejectPost:d,showDailyReminders:u=!0,hasConnectedAccounts:h}){var q;const[p,x]=m.useState(0),[v,f]=m.useState(0),[b,y]=m.useState(0),g=s.filter(I=>!(r.isAutoPublishing!==void 0&&r.isAutoPublishing!==null&&I.isAutoPublishing!==r.isAutoPublishing||r.contentType&&I.contentType!==r.contentType||r.deliveryMethod&&I.deliveryMethod!==r.deliveryMethod||r.configIds&&r.configIds.length>0&&!I.platformApprovals.some(E=>E.platformConfigId&&r.configIds.includes(E.platformConfigId))||r.status&&!I.platformApprovals.some(E=>E.status===r.status)||r.statuses&&!I.platformApprovals.some(F=>r.statuses.includes(F.status)))),j=()=>
638{if(e==="daily"){const I=p-1;x(I),o==null||o(I,"daily")}else if(e==="weekly"){const I=v-1;f(I),o==null||o(I,"weekly")}else{const I=b-1;y(I),o==null||o(I,"monthly")}},N=()=>{e==="daily"?(x(0),o==null||o(0,"daily")):e==="weekly"?(f(0),o==null||o(0,"weekly")):(y(0),o==null||o(0,"monthly"))},w=()=>{if(e==="daily"){const I=p+1;x(I),o==null||o(I,"daily")}else if(e==="weekly"){const I=v+1;f(I),o==null||o(I,"weekly")}else{const I=b+1;y(I),o==null||o(I,"monthly")}},k=(e==="daily"?p:e==="weekly"?v:b)===0,P=Vc();let A=P,$=P;if(e==="daily")A=Vc(p),$=A;else if(e==="weekly"){const I=P.getDay()===0?6:P.getDay()-1;A=new Date(P.getFullYear(),P.getMonth(),P.getDate()-I+v*7,12),$=new Date(A.getFullYear(),A.getMonth(),A.getDate()+6,12)}else{const I=new Date(P.getFullYear(),P.getMonth()+b,1,12);A=new Date(I.getFullYear(),I.getMonth(),1,12),$=new Date(I.getFullYear(),I.getMonth()+1,0,12)}const _=cI(A,$),O=u&&!!l&&(h??n.some(I=>I.connected))&&r.status!=="pending"&&r.status!=="rejected"&&!(r.statuses&&r.statuses.length>0)&&!c&&!d,M=Ee({queryKey:["/api/calendar/posts",_.start.toISOString(),_.end.toISOString()],queryFn:async()=>{const I=new URLSearchParams({startDate:_.start.toISOString(),endDate:_.end.toISOString()}),F=await fetch(`/api/calendar/posts?${I.toString()}`);if(!F.ok)throw new Error(`Calendar reminder lookup failed (${F.status})`);const E=await F.json();if(!E||typeof E!="object"||!Array.isArray(E.entries))throw new Error("Calendar reminder lookup returned an invalid response");return E},enabled:O,refetchInterval:3e4,refetchIntervalInBackground:!1}),C=((q=M.data)==null?void 0:q.entries)??[],L=O&&M.isLoading,W=O&&M.isError;return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex gap-2 justify-center",children:[t.jsx(T,{variant:"outline",size:"sm",onClick:j,"data-testid":`previous-${e}`,children:t.jsx(Qo,{className:"w-4 h-4"})}),t.jsx(T,{variant:"outline",size:"sm",onClick:N,disabled:k,"data-testid":`current-${e}`,children:e==="daily"?"Today":e==="weekly"?"This Week":"This Month"}),t.jsx(T,{variant:"outline",size:"sm",onClick:w,"data-testid":`next-${e}`,children:t.jsx(Xi,{className:"w-4 h-4"})})]}),e!=="daily"&&g.length===0&&t.jsx("p",{className:"text-center text-sm text-muted-foreground py-3",children:r.status==="pending"?"No posts waiting for review for these accounts.":r.statuses?"No failed or unconfirmed posts for these accounts.":"No scheduled posts for these accounts yet. Create a post to start filling your calendar."}),t.jsxs("div",{className:"mt-2",children:[e==="daily"&&t.jsx(xG,{items:g,dayOffset:p,reminderEntries:C,remindersEnabled:O,reminderLoading:L,reminderError:W,onCreatePost:l,onItemClick:i}),e==="weekly"&&t.jsx(ZG,{items:g,weekOffset:v,connections:n,reminderEntries:C,remindersEnabled:O,reminderLoading:L,reminderError:W,userUsername:a,onItemClick:i,onCreatePost:l,onApprovePost:c,onRejectPost:d}),e==="monthly"&&t.jsx(tH,{items:g,monthOffset:b,reminderEntries:C,remindersEnabled:O,reminderLoading:L,reminderError:W,onCreatePost:l,onItemClick:i})]})]})}const FN={youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]"},x:{icon:js,displayName:"X",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]"},instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]"},snapchat:{icon:null,displayName:"Snapchat",color:"text-yellow-400"},tbd:{icon:null,displayName:"TBD",color:"text-muted-foreground"}};function hI({item:e,open:s,onOpenChange:r,connections:n=[]}){const{toast:a}=bt(),i=m.useRef(null),o=m.useRef(null),[l,c]=m.useState(new Set),[d,u]=m.useState(!1),[h,p]=m.useState(""),[x,v]=m.useState(""),[f,b]=m.useState(""),[y,g]=m.useState(""),[j,N]=m.useState(""),[w,S]=m.useState(null),k=R=>{var ve;const K=R.platformConfigId?n.find(Ie=>Ie.id===R.platformConfigId):n.find(Ie=>Ie.platform===R.platform);if(K){if(K.selectedPageName)return K.selectedPageName;if(K.username)return`@${K.username}`;if(K.channelName)return K.channelName}return((ve=FN[R.platform])==null?void 0:ve.displayName)||R.platform};m.useEffect(()=>{s&&e?(S(e),u(!1),p(""),v(""),b(""),g(""),N("")):s||(S(null),u(!1),p(""),v(""),b(""),g(""),N(""))},[s,e]);const P=ke({mutationFn:async R=>
638(await Fe("POST",`/api/posts/${R}/approve`)).json(),onSuccess:(R,K)=>{if(w){const ve=w.platformApprovals.map(Ie=>Ie.postId===K?{...Ie,status:"approved"}:Ie);S({...w,platformApprovals:ve})}ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),a({title:"Post scheduled",description:"Approved for the scheduled time, not published yet. Check Scheduled on the dashboard."})},onError:()=>{a({title:"Error",description:"Failed to approve post. Please try again.",variant:"destructive"})}}),A=ke({mutationFn:async R=>{await Fe("DELETE",`/api/posts/${R}/reject`)},onSuccess:(R,K)=>{if(w){const ve=w.platformApprovals.map(Ie=>Ie.postId===K?{...Ie,status:"rejected"}:Ie);S({...w,platformApprovals:ve})}ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),a({title:"Post Rejected",description:"The post has been rejected."})},onError:()=>{a({title:"Error",description:"Failed to reject post. Please try again.",variant:"destructive"})}}),$=ke({mutationFn:async R=>{await Fe("DELETE",`/api/posts/${R}`)},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),a({title:"Post Deleted",description:"The post has been deleted."}),r(!1)},onError:()=>{a({title:"Error",description:"Failed to delete post. Please try again.",variant:"destructive"})}}),_=ke({mutationFn:async R=>(await Fe("PATCH",`/api/posts/group/${R}/post-now`)).json(),onSuccess:R=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),ee.invalidateQueries({queryKey:["/api/recent-posts"]}),a($A(R,(K,ve)=>{const Ie=n.find(jt=>jt.id===K),dt=(Ie==null?void 0:Ie.selectedPageName)||(Ie==null?void 0:Ie.channelName)||(Ie==null?void 0:Ie.username);return dt?`${ve} (${dt})`:`${ve}${K?` (account #${K})`:""}`})),r(!1)},onError:()=>{a({title:"Error",description:"Could not confirm delivery. Check Recent and Needs attention before trying again.",variant:"destructive"})}}),O=ke({mutationFn:async({contentGroupId:R,caption:K,contentTitle:ve,imageUrl:Ie,scheduledTime:dt})=>(await Fe("PATCH",`/api/posts/group/${R}`,{contentText:K,contentTitle:ve,mediaUrl:Ie,scheduledTime:dt})).json(),onSuccess:(R,K)=>{if(w){const ve=K.scheduledTime?new Date(K.scheduledTime).getTime():w.scheduledTimestamp,Ie=new Date(ve);S({...w,caption:K.caption,contentTitle:K.contentTitle,imageUrl:K.imageUrl,scheduledTimestamp:ve,scheduledTime:wp(Ie),scheduledDate:io(Ie)})}ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),u(!1),a({title:"Post Updated",description:"Changes saved successfully."})},onError:()=>{a({title:"Error",description:"Failed to update post. Please try again.",variant:"destructive"})}}),M=ke({mutationFn:async R=>{const K=new FormData;K.append("image",R);const ve=await fetch("/api/manual-post/upload-image",{method:"POST",body:K,credentials:"include"});if(!ve.ok){const Ie=await ve.json();throw new Error(Ie.error||"Failed to upload image")}return ve.json()},onSuccess:R=>{b(R.imageUrl),a({title:"Image uploaded",description:"Your image has been uploaded successfully"})},onError:()=>{a({title:"Upload failed",description:"Failed to upload image. Please try again.",variant:"destructive"})}}),C=R=>{var Ie;const K=(Ie=R.target.files)==null?void 0:Ie[0];if(!K)return;if(!["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(K.type)){a({title:"Invalid file type",description:"Please upload a JPEG, PNG, GIF, or WebP image",variant:"destructive"}),i.current&&(i.current.value="");return}if(K.size>10*1024*1024){a({title:"File too large",description:"Image must be less than 10MB",variant:"destructive"}),i.current&&(i.current.value="");return}M.mutate(K,{onSettled:()=>{i.current&&(i.current.value="")}})},L=()=>{var R;(R=i.current)==null||R.click()},W=ke({mutationFn:async R=>{const K=new FormData;K.append("media",R);const ve=await fetch("/api/videos/upload",{method:"POST",body:K,credentials:"include"});if(!ve.ok){const Ie=await ve.json();throw new Error(Ie.error||"Failed to upload video")}return ve.json()},onSuccess:R=>{b(R.media_url),a({title:"Video uploaded",description:"Your video has been uploaded successfully"})},onError:()=>{a({title:"Upload failed",description:"Failed to upload video. Please try again.",variant:"destructive"})}}),q=R=>{var Ie;const K=(Ie=R.target.files)==null?void 0:Ie[0];if(!K)return;if(!["video/mp4","video/quicktime","video/x-msvideo","video/x-matroska","video/webm"].includes(K.type)){a({title:"Invalid file type",description:"Please upload an MP4, MOV, AVI, MKV, or WebM video",variant:"destructive"}),o.current&&(o.current.value="");return}if(K.size>100*1024*1024){a({title:"File too large",description:"Video must be less than 100MB",variant:"destructive"}),o.current&&(o.current.value="");return}W.mutate(K,{onSettled:()=>{o.current&&(o.current.value="")}})},I=()=>{var R;(R=o.current)==null||R.click()},F=async R=>{c(K=>new Set(K).add(R)),await P.mutateAsync(R),c(K=>{const ve=new Set(K);return ve.delete(R),ve})},E=async R=>{c(K=>new Set(K).add(R)),await A.mutateAsync(R),c(K=>{const ve=new Set(K);return ve.delete(R),ve})},ne=async()=>
638{if(!w)return;const R=w.platformApprovals.filter(K=>K.status==="pending"&&K.postId);for(const K of R)K.postId&&await F(K.postId)},U=async()=>{if(!w)return;const R=w.platformApprovals.filter(K=>K.status==="pending"&&K.postId);for(const K of R)K.postId&&await E(K.postId)},Ae=()=>{var R;if(w&&confirm("Are you sure you want to delete this post?")){const K=(R=w.platformApprovals[0])==null?void 0:R.postId;K&&$.mutate(K)}},G=()=>{if(!w)return;u(!0),p(w.caption),v(w.contentTitle||""),b(w.imageUrl||"");const R=new Date(w.scheduledTimestamp);g(jp(R)),N(`${String(R.getHours()).padStart(2,"0")}:${String(R.getMinutes()).padStart(2,"0")}`)},Q=w==null?void 0:w.platformApprovals.some(R=>R.platform==="youtube"||R.platform==="tiktok"),ye=VA((w==null?void 0:w.platformApprovals.map(R=>R.platform))||[],f),le=()=>{if(!w)return;if(ye){a({title:"Video required for YouTube",description:ye,variant:"destructive"});return}let R;if(y&&j){const K=eb(y,j);if(!K){a({title:"Invalid local time",description:"This time does not exist in your timezone because of daylight saving.",variant:"destructive"});return}if(Math.floor(K.getTime()/6e4)!==Math.floor(w.scheduledTimestamp/6e4)){if(K<=new Date){a({title:"Choose a future time",description:"You can only reschedule for a future local date and time.",variant:"destructive"});return}R=K.toISOString()}}O.mutate({contentGroupId:w.id,caption:h,contentTitle:Q&&x||void 0,imageUrl:f||void 0,scheduledTime:R})},J=()=>{u(!1),p(""),v(""),b(""),g(""),N("")};if(!w)return null;const se={video:"bg-blue-500/20 text-blue-500 border-blue-500/30",poll:"bg-purple-500/20 text-purple-500 border-purple-500/30",tip:"bg-green-500/20 text-green-500 border-green-500/30",image:"bg-orange-500/20 text-orange-500 border-orange-500/30",manual:"bg-gray-500/20 text-gray-400 border-gray-500/30"}[w.contentType]||"bg-muted text-muted-foreground",te=w.platformApprovals.some(R=>R.status==="pending");return t.jsx(Ut,{open:s,onOpenChange:r,children:t.jsx(Ht,{className:"max-w-md max-h-[90vh] overflow-y-auto p-0","data-testid":"modal-post-details",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 pb-0",children:[t.jsx(xe,{variant:"outline",className:se,children:w.contentType.charAt(0).toUpperCase()+w.contentType.slice(1)}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(xe,{variant:"outline",className:Xa(w.platformApprovals.map(R=>R.status)).className,children:Xa(w.platformApprovals.map(R=>R.status)).label}),t.jsx(T,{size:"icon",variant:"ghost",onClick:G,"data-testid":"button-edit-post",children:t.jsx(Z0,{className:"w-4 h-4"})}),t.jsx(T,{size:"icon",variant:"ghost",className:"mr-6",onClick:Ae,"data-testid":"button-delete-post",children:t.jsx(ni,{className:"w-4 h-4"})})]})]}),d?t.jsxs("div",{className:"px-4 space-y-3",children:[ye&&t.jsx("p",{role:"alert",className:"text-sm text-destructive","data-testid":"youtube-edit-video-required",children:ye}),(w.deliveryMethod==="text-to-image"||w.deliveryMethod==="image-to-image"||w.deliveryMethod==="carousel")&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"relative rounded-lg overflow-hidden bg-muted/30 aspect-video flex items-center justify-center max-w-sm mx-auto",children:f?t.jsx("img",{src:ft(f),alt:"Preview",className:"w-full h-full object-cover","data-testid":"image-preview-edit"}):t.jsx(Ft,{className:"w-12 h-12 text-muted-foreground"})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:f,onChange:R=>b(R.target.value),placeholder:"Image URL",className:"flex-1 px-3 py-2 text-sm rounded-md border border-input bg-background","data-testid":"input-image-url"}),t.jsx(T,{size:"icon",variant:"outline",className:"h-9 w-9",onClick:L,disabled:M.isPending,"data-testid":"upload-image",children:t.jsx(Js,{className:"w-4 h-4"})}),t.jsx("input",{ref:i,type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",onChange:C,className:"hidden","data-testid":"file-input-image"})]})]}),(w.deliveryMethod==="image-reel"||w.deliveryMethod==="video")&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"relative rounded-lg overflow-hidden bg-black aspect-video flex items-center justify-center max-w-sm mx-auto",children:W.isPending?t.jsxs("div",{className:"flex flex-col items-center text-muted-foreground",children:[t.jsx(Qe,{className:"w-12 h-12 mb-2 animate-spin"}),t.jsx("span",{className:"text-sm",children:"Uploading video..."})]}):f?t.jsx("video",{src:ft(f),controls:!0,className:"w-full h-full object-contain","data-testid":"video-preview-edit"}):t.jsxs("div",{className:"flex flex-col items-center text-muted-foreground",children:[t.jsx(Xr,{className:"w-12 h-12 mb-2"}),t.jsx("span",{className:"text-sm",children:"No video"})]})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:f,onChange:R=>b(R.target.value),placeholder:"Video URL",className:"flex-1 px-3 py-2 text-sm rounded-md border border-input bg-background","data-testid":"input-video-url"}),t.jsx(T,{size:"icon",variant:"outline",className:"h-9 w-9",onClick:I,disabled:W.
638isPending,"data-testid":"upload-video",children:t.jsx(Js,{className:"w-4 h-4"})}),t.jsx("input",{ref:o,type:"file",accept:"video/mp4,video/quicktime,video/x-msvideo,video/x-matroska,video/webm",onChange:q,className:"hidden","data-testid":"file-input-video"})]})]}),Q&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Title (for YouTube/TikTok)"}),t.jsx("input",{type:"text",value:x,onChange:R=>v(R.target.value.slice(0,200)),maxLength:200,className:"w-full px-3 py-2 text-sm rounded-md border border-input bg-background","data-testid":"input-title",placeholder:"Enter title for YouTube/TikTok..."}),t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[x.length,"/200 characters"]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:Q?"Description":"Caption"}),t.jsx("textarea",{value:h,onChange:R=>p(R.target.value),className:"w-full px-3 py-2 text-sm rounded-md border border-input bg-background min-h-[120px] resize-y","data-testid":"textarea-caption",placeholder:Q?"Enter description...":"Enter caption..."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Select Date"}),t.jsx("input",{type:"date",value:y,onChange:R=>g(R.target.value),min:jp(new Date),className:"w-full px-3 py-2 text-sm rounded-md border border-input bg-background [color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-schedule-date"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Select Time"}),t.jsx("input",{type:"time",value:j,onChange:R=>N(R.target.value),className:"w-full px-3 py-2 text-sm rounded-md border border-input bg-background [color-scheme:light] dark:[color-scheme:dark]","data-testid":"input-schedule-time"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Times are shown in your local timezone. Changing this time reschedules every account in this post to the same time; editing only content leaves each account's time unchanged."}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{className:"flex-1",onClick:le,disabled:O.isPending||!!ye,"data-testid":"save-edit",children:[t.jsx(fP,{className:"w-4 h-4 mr-2"}),"Save"]}),t.jsxs(T,{className:"flex-1",variant:"outline",onClick:J,disabled:O.isPending,"data-testid":"cancel-edit",children:[t.jsx(Qr,{className:"w-4 h-4 mr-2"}),"Cancel"]})]})]}):t.jsxs(t.Fragment,{children:[w.imageUrl&&t.jsx("div",{className:"px-4",children:t.jsx("div",{className:"rounded-lg overflow-hidden bg-black",children:w.deliveryMethod==="image-reel"||w.deliveryMethod==="video"?t.jsx("video",{src:ft(w.imageUrl),controls:!0,className:"w-full max-h-96 object-contain","data-testid":"video-preview"}):t.jsx("img",{src:ft(w.imageUrl),alt:"Content preview",className:"w-full max-h-96 object-contain","data-testid":"image-preview"})})}),Q&&w.contentTitle&&t.jsxs("div",{className:"px-4",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Title"}),t.jsx("p",{className:"text-sm font-medium text-foreground","data-testid":"text-title",children:w.contentTitle})]}),t.jsxs("div",{className:"px-4 text-sm text-muted-foreground","data-testid":"post-local-time",children:["Selected calendar entry: ",ec(new Date(w.scheduledTimestamp)),". Each account's time and status are below."]}),t.jsxs("div",{className:"px-4",children:[Q&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Description"}),t.jsx("p",{className:"text-sm text-foreground leading-relaxed","data-testid":"text-caption",children:w.caption})]})]}),!d&&t.jsx("div",{className:"px-4 space-y-2",children:w.platformApprovals.map((R,K)=>{const ve=FN[R.platform],Ie=ve.icon,dt=R.postId?l.has(R.postId):!1,jt=k(R);return t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50","data-testid":`platform-${R.platform}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[Ie&&t.jsx(Ie,{className:`w-4 h-4 ${ve.color}`}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-sm",children:jt}),R.scheduledTimestamp&&t.jsx("p",{className:"text-xs text-muted-foreground",children:ec(new Date(R.scheduledTimestamp))})]})]}),t.jsx("div",{className:"flex items-center gap-2",children:R.status==="pending"?t.jsxs(t.Fragment,{children:[t.jsx(xe,{variant:"outline",className:"bg-yellow-500/20 text-yellow-500 border-yellow-500/30 text-xs",children:"NEEDS REVIEW"}),t.jsx(T,{size:"icon",variant:"ghost",className:"h-8 w-8 bg-green-500/20 hover:bg-green-500/30 text-green-500",onClick:()=>R.postId&&F(R.postId),disabled:dt,"data-testid":`button-approve-${R.platform}`,children:t.jsx(Xt,{className:"w-4 h-4"})}),t.jsx(T,{size:"icon",variant:"ghost",className:"h-8 w-8 bg-red-500/20 hover:bg-red-500/30 text-red-500",onClick:()=>R.postId&&E(R.postId),disabled:dt,"data-testid":`button-reject-${R.platform}`,children:t.jsx(xr,{className:"w-4 h-4"})})]}):R.status==="approved"?t.jsx(xe,{variant:"outline",className:"bg-green-500/20 text-green-500 border-green-500/30 text-xs",children:"SCHEDULED"}):R.status==="failed"?t.jsx(xe,{variant:"outline",className:"bg-red-500/20 text-red-500 border-red-500/30 text-xs",children:"FAILED — RETRY BELOW"}):R.status==="posting"?t.jsx(xe,{variant:"outline",className:"bg-blue-500/20 text-blue-500 border-blue-500/30 text-xs",children:"STATUS PENDING — DO NOT RETRY"}):t.jsx(xe,{variant:"outline",className:"bg-red-500/20 text-red-500 border-red-500/30 text-xs",children:"REJECTED"})})]},R.postId||`${R.platform}-${K}`)})}),!d&&te&&t.jsxs("div",{className:"px-4 pb-4 flex gap-2",children:[t.jsxs(T,{className:"flex-1 bg-green-500 hover:bg-green-600 text-white",onClick:ne,disabled:P.isPending||A.isPending,"data-testid":"button-approve-all",children:[t.jsx(Xt,{className:"w-4 h-4 mr-2"}),"All"]}),t.jsxs(T,{className:"flex-1 bg-red-500 hover:bg-red-600 text-white",onClick:U,disabled:P.isPending||A.isPending,"data-testid":"button-reject-all",children:[t.jsx(xr,{className:"w-4 h-4 mr-2"}),"All"]})]}),t.jsxs("div",{className:"px-4 pb-4 flex items-center justify-between text-xs text-muted-foreground",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{children:w.aiGenerated?"AI Generated":"Manual"}),t.jsx("span",{children:"•"}
638),t.jsx("span",{children:w.createdTimeAgo})]}),!d&&t.jsxs(T,{size:"sm",className:"bg-blue-500 hover:bg-blue-600 text-white",onClick:()=>_.mutate(w.id),disabled:_.isPending||!w.platformApprovals.some(R=>R.status==="approved"||R.status==="failed"),"data-testid":"button-post-now",children:[t.jsx(ws,{className:"w-3 h-3 mr-1"}),w.platformApprovals.some(R=>R.status==="approved")?w.platformApprovals.length>1?"Post Now (all eligible accounts)":"Post Now":"Retry failed accounts"]})]})]})})})}function Uy({view:e,onViewChange:s}){return t.jsxs("div",{className:"flex gap-1 bg-muted p-1 rounded-lg justify-center",children:[t.jsxs(T,{size:"sm",variant:e==="daily"?"default":"ghost",onClick:()=>s("daily"),className:"gap-2","data-testid":"view-daily",children:[t.jsx(qD,{className:"w-4 h-4"}),t.jsx("span",{children:"Daily"})]}),t.jsxs(T,{size:"sm",variant:e==="weekly"?"default":"ghost",onClick:()=>s("weekly"),className:"gap-2","data-testid":"view-weekly",children:[t.jsx(WD,{className:"w-4 h-4"}),t.jsx("span",{children:"Weekly"})]}),t.jsxs(T,{size:"sm",variant:e==="monthly"?"default":"ghost",onClick:()=>s("monthly"),className:"gap-2","data-testid":"view-monthly",children:[t.jsx(Ca,{className:"w-4 h-4"}),t.jsx("span",{children:"Monthly"})]})]})}const sH={instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]"},x:{icon:js,displayName:"Twitter/X",color:"text-foreground"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]"},youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]"},snapchat:{icon:OB,displayName:"Snapchat",color:"text-[#FFFC00]"}};function rH({platform:e,isOpen:s,onConfirm:r,onCancel:n,isStarter:a=!1,configId:i}){const[o,l]=m.useState(""),[c,d]=m.useState(""),[u,h]=m.useState(""),p=sH[e],x=p==null?void 0:p.icon,v=e==="facebook"||e==="instagram",f=e==="reddit",b=e==="youtube",{data:y,isLoading:g,error:j,refetch:N}=Ee({queryKey:["/api/platform-configs",e,"available-pages",i],queryFn:async()=>{const q=i?`/api/platform-configs/${e}/available-pages?configId=${i}`:`/api/platform-configs/${e}/available-pages`,I=await fetch(q,{credentials:"include"});if(!I.ok)throw new Error("Failed to fetch pages");return I.json()},enabled:s&&v}),{data:w,isLoading:S,error:k}=Ee({queryKey:["/api/platform-configs/youtube/channels",i],queryFn:async()=>{const q=i?`/api/platform-configs/youtube/channels?configId=${i}`:"/api/platform-configs/youtube/channels",I=await fetch(q,{credentials:"include"});if(!I.ok)throw new Error("Failed to fetch YouTube channels");return I.json()},enabled:s&&b}),P=((y==null?void 0:y.existingConfigCount)||0)>0,A=a&&P,$=(y==null?void 0:y.availablePages)||[],_=e==="instagram"?$.filter(q=>!!q.instagramId):$,O=e==="instagram"?$.filter(q=>!q.instagramId):[],M=(w==null?void 0:w.channels)||[];m.useEffect(()=>{if(e!=="instagram"){A&&(y!=null&&y.selectedPageId)?l(y.selectedPageId):_.length===1?l(_[0].pageId):A||l("");return}const q=!!(y!=null&&y.selectedPageId&&_.some(I=>I.pageId===y.selectedPageId));A&&q&&(y!=null&&y.selectedPageId)?l(y.selectedPageId):_.length===1?l(_[0].pageId):l("")},[y,_.length,A,e]),m.useEffect(()=>{w!=null&&w.selectedChannelId?h(w.selectedChannelId):M.length===1?h(M[0].channelId):h("")},[w,M.length]),m.useEffect(()=>{s||(l(""),d(""),h(""))},[s]);const C=()=>{if(v)r(o);else if(f)r(void 0,c.trim());else if(b){const q=M.find(I=>I.channelId===u);r(void 0,void 0,u,q==null?void 0:q.title,q==null?void 0:q.thumbnailUrl)}else r()},L=()=>v?o.length>0&&(e!=="instagram"||_.some(q=>q.pageId===o)):f?c.trim().length>0:b?u.length>0:!0,W=q=>e==="instagram"&&q.instagramUsername?`@${q.instagramUsername} (via ${q.pageName})`:e==="linkedin"&&q.pageType?`${q.pageName} (${q.pageType==="organization"?"Company":"Personal"})`:q.pageName;return t.jsx(Ut,{open:s,onOpenChange:()=>{},modal:!0,children:t.jsxs(Ht,{className:"sm:max-w-[500px]",onPointerDownOutside:q=>q.preventDefault(),onEscapeKeyDown:q=>q.preventDefault(),"data-testid":"dialog-platform-connection-confirmation",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-3 text-xl",children:[x&&t.jsx(x,{className:`${p.color} text-2xl`}),p==null?void 0:p.displayName," Connected!"]}),t.jsxs(Ns,{className:"text-base pt-2",children:["Great! Your ",p==null?void 0:p.displayName," account is now connected. Let's finish setting up."]})]}),t.jsxs("div",{className:"space-y-6 py-4",children:[e==="youtube"&&t.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"youtube-connection-vi
638deo-notice",children:zA}),v&&t.jsxs("div",{className:"space-y-3",children:[t.jsx(ae,{htmlFor:"page",className:"text-base font-semibold",children:e==="instagram"?"Select Instagram Account":"Select Facebook Page"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:e==="instagram"?"Choose which Instagram business account to post to.":"Choose which Facebook Page to post to."}),g?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-muted-foreground",children:[t.jsx(Qe,{className:"h-4 w-4 animate-spin"}),t.jsx("span",{children:"Loading available pages..."})]}):j?t.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-4 text-destructive",role:"alert",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(hr,{className:"h-4 w-4"}),t.jsx("span",{children:"Failed to load pages. Refresh and try again, or reconnect your account."})]}),t.jsx(T,{type:"button",variant:"outline",size:"sm",onClick:()=>N(),children:"Retry"})]}):e==="instagram"&&_.length===0?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-foreground",role:"status",children:[t.jsx(hr,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),t.jsxs("p",{children:[$.length>0?"None of these Facebook Pages has a linked Instagram account yet.":"No Facebook Pages are available for this account."," In Meta, switch your Instagram account to a professional account and link it to a Facebook Page. Then reconnect Instagram in SocialMonkey to reload your accounts."]})]}),O.length>0&&t.jsxs("div",{className:"space-y-2","aria-labelledby":"ineligible-pages-label",children:[t.jsx("h3",{id:"ineligible-pages-label",className:"text-sm font-medium",children:"Pages not eligible for Instagram publishing"}),t.jsx("ul",{className:"space-y-2",children:O.map(q=>t.jsxs("li",{"aria-disabled":"true",className:"rounded-md border border-border bg-muted/40 px-3 py-2.5 text-sm","data-testid":`ineligible-instagram-page-${q.pageId}`,children:[t.jsx("span",{className:"font-medium",children:q.pageName}),t.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:"Not selectable: no Instagram account is linked to this Page."})]},q.pageId))})]})]}):$.length===0?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-amber-500",role:"status",children:[t.jsx(hr,{className:"h-4 w-4"}),t.jsx("span",{children:"No Facebook Pages found. You need a Facebook Page to post content."})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs(Nt,{value:o,onValueChange:l,children:[t.jsx(gt,{id:"page",className:"w-full","data-testid":"select-page","aria-label":e==="instagram"?"Select a linked Instagram account":"Select a page",children:t.jsx(kt,{placeholder:e==="instagram"?"Choose an Instagram account...":"Select a page..."})}),t.jsx(yt,{children:_.map(q=>t.jsx(Se,{value:q.pageId,"data-testid":`option-page-${q.pageId}`,children:e==="instagram"?`@${q.instagramUsername||q.instagramId} via ${q.pageName}`:W(q)},q.pageId))})]}),e==="instagram"&&O.length>0&&t.jsxs("div",{className:"space-y-2","aria-labelledby":"ineligible-pages-label",children:[t.jsx("h3",{id:"ineligible-pages-label",className:"text-sm font-medium",children:"Pages not eligible for Instagram publishing"}),t.jsx("ul",{className:"space-y-2",children:O.map(q=>t.jsxs("li",{"aria-disabled":"true",className:"rounded-md border border-border bg-muted/40 px-3 py-2.5 text-sm","data-testid":`ineligible-instagram-page-${q.pageId}`,children:[t.jsx("span",{className:"font-medium",children:q.pageName}),t.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:"Not selectable: no Instagram account is linked to this Page."})]},q.pageId))})]})]})]}),f&&t.jsxs("div",{className:"space-y-3",children:[t.jsx(ae,{htmlFor:"subreddit",className:"text-base font-semibold",children:"Target Subreddit"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the subreddit where you want to post content (without the /r/ prefix)."}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-muted-foreground font-mono",children:"r/"}),t.jsx(Ke,{id:"subreddit",placeholder:"example: technology",value:c,onChange:q=>d(q.target.value.replace(/^\/r\//,"")),className:"flex-1","data-testid":"input-subreddit"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Make sure you have permission to post in this subreddit."})]}),b&&t.jsxs("div",{className:"space-y-3",children:[t.jsx(ae,{htmlFor:"channel",className:"text-base font-semibold",children:"Select YouTube Channel"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose which YouTube channel to post videos to."}),S?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-muted-foreground",children:[t.jsx(Qe,{className:"h-4 w-4 animate-spin"}),t.jsx("span",{children:"Loading your YouTube channels..."})]}):k?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-destructive",children:[t.jsx(hr,{className:"h-4 w-4"}),t.jsx("span",{children:"Failed to load channels. Please try reconnecting."})]}):M.length===0?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-amber-500",children:[t.jsx(hr,{className:"h-4 w-4"}),t.jsx("span",{children:"No YouTube channels found for this account."})]}):t.jsxs(Nt,{value:u,onValueChange:h,children:[t.jsx(gt,{id:"channel",className:"w-full","data-testid":"select-youtube-channel",children:t.jsx(kt,{placeholder:"Select a channel..."})}),t.jsx(yt,{children:M.map(q=>t.jsx(Se,{value:q.channelId,"data-testid":`option-channel-${q.channelId}`,children:t.jsxs("div",{className:"flex items-center gap-2",children:[q.thumbnailUrl&&t.jsx("img",{src:q.thumbnailUrl,alt:q.title,className:"w-6 h-6 rounded-full"}),t.jsx("span",{children:q.title})]})},q.channelId))})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatic posting is off for new accounts. You can turn it on later in Settings → Post Settings."}),e==="tiktok"&&t.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-md p-3 space-y-1","data-testid":"notice-tiktok-posting-process",children:[t.jsx("p",{className:"text-sm font-medium text-amber-600 dar
638k:text-amber-400",children:"Important: TikTok Posting Process"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Your scheduled posts will appear in the TikTok app's Notifications tab, where you can easily post them with one tap. We're currently awaiting TikTok's approval for direct posting - once approved, posts will publish automatically."})]})]}),t.jsxs(rd,{children:[n&&t.jsx(T,{type:"button",variant:"outline",onClick:n,children:e==="instagram"&&_.length===0?"Do this later":"Cancel"}),t.jsx(T,{onClick:C,className:"w-full",disabled:!L()||v&&g||b&&S,"data-testid":"button-confirm-connection",children:g||S?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):"Continue"})]})]})})}function nH({membershipLevel:e,trialEndsAt:s}){const[r,n]=m.useState(!1);if(!((e==null?void 0:e.toLowerCase())==="trial"||!e)||r)return null;let i=null,o=!1;if(s){const l=typeof s=="string"?new Date(s):s,c=new Date,d=l.getTime()-c.getTime();i=Math.ceil(d/(1e3*60*60*24)),o=i<=0}return o?t.jsx(re,{className:"relative overflow-hidden bg-gradient-to-r from-purple-700 to-violet-600 border-0 p-3 sm:p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 sm:gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[t.jsx("div",{className:"p-1.5 sm:p-2 bg-white/20 rounded-lg shrink-0",children:t.jsx(Zh,{className:"h-4 w-4 sm:h-5 sm:w-5 text-white"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("h3",{className:"text-white font-semibold text-xs sm:text-base truncate",children:"Your free trial has ended"}),t.jsx("p",{className:"text-white/80 text-xs hidden sm:block",children:"Upgrade now to continue using all features"})]})]}),t.jsx(me,{href:"/upgrade",className:"shrink-0",children:t.jsxs(T,{className:"bg-white text-purple-600 hover:bg-gray-100 whitespace-nowrap text-xs sm:text-sm px-2 sm:px-4",size:"sm","data-testid":"button-upgrade-cta",children:["Upgrade",t.jsx(Rr,{className:"h-3 w-3 sm:h-4 sm:w-4 ml-1"})]})})]})}):t.jsxs(re,{className:"relative overflow-hidden bg-gradient-to-r from-purple-600 to-blue-600 border-0 p-3 sm:p-4",children:[t.jsx("button",{onClick:()=>n(!0),className:"absolute top-2 right-2 text-white/70 hover:text-white transition-colors","aria-label":"Dismiss","data-testid":"button-dismiss-upgrade-banner",children:t.jsx(xr,{className:"h-4 w-4"})}),t.jsxs("div",{className:"flex items-center justify-between gap-2 sm:gap-3 pr-6",children:[t.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[t.jsx("div",{className:"p-1.5 sm:p-2 bg-white/20 rounded-lg shrink-0",children:t.jsx(Et,{className:"h-4 w-4 sm:h-5 sm:w-5 text-white"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("h3",{className:"text-white font-semibold text-xs sm:text-base truncate",children:i!==null?`${i} day${i!==1?"s":""} left in trial`:"You're on the free trial"}),t.jsx("p",{className:"text-white/80 text-xs hidden sm:block",children:"Upgrade to unlock unlimited accounts, AI automation, and more"})]})]}),t.jsx(me,{href:"/upgrade",className:"shrink-0",children:t.jsxs(T,{className:"bg-white text-purple-600 hover:bg-gray-100 whitespace-nowrap text-xs sm:text-sm px-2 sm:px-4",size:"sm","data-testid":"button-upgrade-cta",children:["Upgrade",t.jsx(Rr,{className:"h-3 w-3 sm:h-4 sm:w-4 ml-1"})]})})]})]})}function Vy({trigger:e,open:s,onOpenChange:r}){const[n,a]=m.useState(!1),[i,o]=m.useState(""),l="fal-ai/nano-banana",[c,d]=m.useState(null),[u,h]=m.useState(!1),{toast:p}=bt(),x=s!==void 0?s:n,v=r||a,{data:f}=Ee({queryKey:["/api/user/image-credits"]}),b=ke({mutationFn:async()=>(await Fe("POST","/api/test-prompt",{promptType:"image",prompt:i,model:l,generationMode:"text-to-image",source:"manual-generation"})).json(),onSuccess:w=>{w.imageUrl&&(d(w.imageUrl),h(!1),ee.invalidateQueries({queryKey:["/api/user/image-credits"]}),ee.invalidateQueries({queryKey:["/api/user/generated-images"]}),p({title:"Image generated!",description:"Your image is available in the AI Generated tab of your media library."}))},onError:w=>{p({variant:"destructive",title:"Generation failed",description:w.message||"Failed to generate image"})}}),y=ke({mutationFn:async()=>
638{if(!c)throw new Error("No image to save");return(await Fe("POST","/api/media-library",{mediaUrl:c,title:i.slice(0,100)||"AI Generated Image",description:`Generated with ${l}`})).json()},onSuccess:()=>{h(!0),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]}),p({title:"Saved to library!",description:"Your image has been added to the media library."})},onError:w=>{p({variant:"destructive",title:"Save failed",description:w.message||"Failed to save to library"})}}),g=()=>{if(!i.trim()){p({variant:"destructive",title:"Prompt required",description:"Please enter a description for your image."});return}b.mutate()},j=()=>{v(!1),o(""),d(null),h(!1)},N=f&&f.totalRemaining>0;return t.jsxs(Ut,{open:x,onOpenChange:w=>{w?v(!0):j()},children:[t.jsx(Xl,{asChild:!0,children:e||t.jsxs(T,{variant:"outline","data-testid":"button-generate-image",children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Generate Image"]})}),t.jsxs(Ht,{className:"max-w-2xl",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"w-5 h-5 text-purple-500"}),"Generate AI Image"]}),t.jsx(Ns,{children:"Create unique images using AI. Describe what you want to see."})]}),t.jsxs("div",{className:"space-y-4",children:[f&&t.jsxs("div",{className:"flex items-center justify-between text-sm p-2 rounded-md bg-muted",children:[t.jsx("span",{className:"text-muted-foreground",children:"Today's images:"}),t.jsxs("span",{className:`font-medium ${N?"text-green-500":"text-red-500"}`,children:[f.totalRemaining," remaining",t.jsx("span",{className:"text-muted-foreground font-normal ml-1",children:"(resets daily)"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"prompt",children:"Image Prompt"}),t.jsx(os,{id:"prompt",placeholder:"A serene mountain landscape at sunset with vibrant orange and purple sky...",value:i,onChange:w=>o(w.target.value),className:"min-h-[100px]","data-testid":"input-image-prompt"})]}),t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(Et,{className:"w-4 h-4"}),t.jsx("span",{children:"Powered by Nano Banana AI"})]}),c&&t.jsxs("div",{className:"space-y-3",children:[t.jsx(ae,{children:"Generated Image"}),t.jsx("div",{className:"relative rounded-lg overflow-hidden border bg-muted",children:t.jsx("img",{src:ft(c),alt:"Generated",className:"w-full max-h-[400px] object-contain","data-testid":"img-generated-result"})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>window.open(c,"_blank"),"data-testid":"button-download-image",children:[t.jsx(X0,{className:"w-4 h-4 mr-2"}),"Download"]}),t.jsxs(T,{variant:u?"secondary":"default",size:"sm",onClick:()=>y.mutate(),disabled:y.isPending||u,"data-testid":"button-save-to-library",children:[y.isPending?t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}):u?t.jsx(Xt,{className:"w-4 h-4 mr-2"}):t.jsx(Ft,{className:"w-4 h-4 mr-2"}),u?"Saved!":"Save to Library"]})]})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx(T,{variant:"ghost",onClick:j,"data-testid":"button-cancel-generate",children:c?"Close":"Cancel"}),t.jsx(T,{onClick:g,disabled:b.isPending||!N||!i.trim(),"data-testid":"button-submit-generate",children:b.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),c?"Generate Another":"Generate Image"]})})]})]})]})]})}function aH(e){const s=new Map;for(const r of e){const n=r.contentGroupId||r.id;s.set(n,[...s.get(n)||[],r])}return Array.from(s,([r,n])=>{const a=n.map(o=>({platform:o.platform,platformConfigId:o.platformConfigId??void 0,status:o.status,scheduledTime:wp(new Date(o.scheduledTime)),scheduledTimestamp:new Date(o.scheduledTime).getTime(),postId:o.id})),i=new Map;for(const o of n){const l=new Date(o.scheduledTime).getTime();i.set(l,[...i.get(l)||[],o])}return Array.from(i,([o,l])=>{var p;const c=l[0],d=new Date(o),u=new Set(l.map(x=>x.id)),h=a.filter(x=>u.has(x.postId));return{id:r,contentType:c.contentType||"manual",platformApprovals:h,allPlatformApprovals:a,caption:c.contentText,contentTitle:c.contentTitle||null,imageUrl:c.mediaUrl||void 0,deliveryMethod:c.deliveryMethod||void 0,aiGenerated:!0,createdAt:((p=c.aiGeneratedAt)==null?void 0:p.toString())||new Date().toISOString(),scheduledTime:wp(d),scheduledDate:io(d),scheduledTimestamp:o,isAutoPublishing:h.every(x=>x.status==="approved"),createdBy:"AI Generated",createdTimeAgo:"Recently"}})}).flat()}const iH={youtube:{icon:oa,displayName:"YouTube",color:"text-red-500"},x:{icon:js,displayName:"X",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-pink-500"},instagram:{icon:ra,displayName:"Instagram",color:"text-purple-500"},facebook:{icon:sa,displayName:"Facebook",color:"text-blue-600"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-blue-700"},reddit:{icon:aa,displayName:"Reddit",color:"text-orange-500"}};function oH(){var De;const[e,s]=m.useState([]),[r,n]=m.useState(!0),[a,i]=m.useState(!1),[o,l]=m.useState(!1),[c,d]=m.useState("scheduled"),[u,h]=m.useState("weekly"),[p,x]=m.useState(null),[v,f]=m.useState(!1),[b,y]=m.useState(null),[g,j]=m.useState(null),[N,w]=m.useState(null),[S,k]=m.useState(!1);Ma();const{toast:P}=bt();m.useEffect(()=>{const ce=new URLSearchParams(window.location.search),$e=ce.get("oauth_success"),qe=ce.get("platform"),wt=ce.get("
638configId");$e==="true"&&qe&&(ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),["facebook","instagram","reddit","youtube"].includes(qe)?(j(qe),w(wt?parseInt(wt):null),k(!0)):P({title:"Account connected",description:"You can schedule posts at any time. Automatic posting is available in Post Settings."}),window.history.replaceState({},"",window.location.pathname))},[]);const A=ce=>{x({...ce,platformApprovals:ce.allPlatformApprovals||ce.platformApprovals}),f(!0)},$=ce=>{const $e=new Date,qe=new Date(Math.floor($e.getTime()/6e4)*6e4+6e4);y(ce<=$e&&ce.toDateString()===qe.toDateString()?qe:ce)},_=ke({mutationFn:async ce=>await Fe("POST",`/api/posts/${ce}/approve`),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),ee.invalidateQueries({queryKey:["/api/posts"]}),P({title:"Success",description:"Post approved"})},onError:()=>{P({title:"Error",description:"Failed to approve post",variant:"destructive"})}}),O=ke({mutationFn:async ce=>await Fe("DELETE",`/api/posts/${ce}/reject`),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/calendar/posts"]}),ee.invalidateQueries({queryKey:["/api/posts"]}),P({title:"Success",description:"Post rejected"})},onError:()=>{P({title:"Error",description:"Failed to reject post",variant:"destructive"})}}),M=ce=>{_.mutate(ce)},C=ce=>{O.mutate(ce)},L=ke({mutationFn:async({platform:ce,pageId:$e,configId:qe})=>await Fe("POST",`/api/platform-configs/${ce}/select-page`,{pageId:$e,configId:qe}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]})},onError:ce=>{P({title:"Error",description:Qh(ce),variant:"destructive"})}}),W=ke({mutationFn:async({subreddit:ce,configId:$e})=>await Fe("POST","/api/platform-configs/reddit/set-subreddit",{subreddit:ce,configId:$e}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]})},onError:()=>{P({title:"Error",description:"Failed to save subreddit",variant:"destructive"})}}),q=async(ce,$e,qe,wt,Y)=>{if(g)try{ce&&(g==="facebook"||g==="instagram"||g==="linkedin")&&await L.mutateAsync({platform:g,pageId:ce,configId:N??void 0}),$e&&g==="reddit"&&await W.mutateAsync({subreddit:$e,configId:N??void 0}),qe&&g==="youtube"&&N&&(await Fe("POST","/api/platform-configs/youtube/select-channel",{channelId:qe,channelTitle:wt,channelThumbn
638ail:Y,configId:N}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]})),ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),k(!1),j(null),w(null),P({title:"Account connected",description:"You can schedule posts at any time. Automatic posting is available in Post Settings."})}catch(xt){P({title:"Could not finish connecting",description:Qh(xt),variant:"destructive"})}},{data:I,isLoading:F}=Ee({queryKey:["/api/platform-connections"]}),{data:E}=Ee({queryKey:["/api/user"]}),ne=ke({mutationFn:async ce=>await Fe("PATCH","/api/user/welcome-popup",{hideWelcomePopup:ce}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user"]})}}),U=()=>{a&&ne.mutate(!0),n(!1),l(!0)},Ae=(E==null?void 0:E.membershipLevel)==="starter"||!(E!=null&&E.membershipLevel),{data:G=[]}=Ee({queryKey:["/api/platform-configs"]}),{data:Q=[]}=Ee({queryKey:["/api/pending-posts"]}),{data:ye=[]}=Ee({queryKey:["/api/recent-posts"]}),{data:le=[]}=Ee({queryKey:["/api/draft-posts"]}),{data:J,isLoading:X,isError:se}=Ee({queryKey:["/api/user-settings"]}),te=ke({mutationFn:async ce=>(await Fe("POST","/api/user-settings",{showDailyReminders:ce})).json(),onSuccess:ce=>{ee.setQueryData(["/api/user-settings"],ce)},onError:()=>P({title:"Could not save daily reminder setting",description:"Your previous setting is unchanged. Please try again.",variant:"destructive"})}),R=(I==null?void 0:I.userUsername)||"PostMonkey",K=aH(Q),ve=ce=>{s($e=>$e.includes(ce)?$e.filter(qe=>qe!==ce):[...$e,ce])},Ie=()=>{s([])},dt=ce=>K.filter($e=>e.length>0&&!$e.platformApprovals.some(Y=>Y.platformConfigId&&e.includes(Y.platformConfigId))?!1:$e.platformApprovals.some(wt=>wt.status===ce)).length,jt=dt("approved"),Ss=dt("pending"),Mt=Ss,Cs=K.filter(ce=>ce.platformApprovals.some($e=>($e.status==="failed"||$e.status==="posting")&&(e.length===0||$e.platformConfigId&&e.includes($e.platformConfigId)))).length,Zt=e.length===0?ye:ye.filter(ce=>{const $e=ce.platformConfigId;return $e&&e.includes($e)}),D=Zt.length,Z=((De=I==null?void 0:I.connections)==null?void 0:De.some(ce=>ce.connected))??!1,ie=!!(E!=null&&E.firstAccountBonusAt)||Z,Re=!!(E!=null&&E.firstPostBonusAt)||Q.length>0,Pe=[ie,Re].filter(Boolean).length,fe=!F&&!(E!=null&&E.hideWelcomePopup)&&Pe<2&&r;return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Dashboard"}),t.jsx("p",{className:"text-muted-foreground",children:"Your social media command center"})]}),t.jsx(nH,{membershipLevel:E==null?void 0:E.membershipLevel,trialEndsAt:E==null?void 0:E.trialEndsAt}),fe&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4","data-testid":"modal-welcome-onboarding",children:t.jsxs("div",{className:"relative w-full max-w-md 
638sm:max-w-xl md:max-w-2xl rounded-lg border border-purple-500/50 bg-background shadow-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 pb-0",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Welcome to SocialMonkey!"}),t.jsx("button",{onClick:U,className:"w-8 h-8 rounded-md flex items-center justify-center hover:bg-muted transition-colors","data-testid":"button-close-welcome",children:t.jsx(xr,{className:"w-4 h-4 text-muted-foreground"})})]}),t.jsx("div",{className:"px-4 pt-3",children:t.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-400 bg-green-500/10 px-3 py-2 rounded-md border border-green-500/20",children:[t.jsx(Et,{className:"w-4 h-4 flex-shrink-0"}),t.jsx("span",{children:"Nothing posts without your approval. You're always in control."})]})}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Choose how you'd like to get started"}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[t.jsxs("div",{className:"p-4 rounded-lg border border-purple-500/40 bg-purple-500/5 hover-elevate cursor-pointer flex flex-col",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/20 flex items-center justify-center mb-2",children:t.jsx(uP,{className:"w-4 h-4 text-purple-400"})}),t.jsx("div",{className:"font-medium mb-1",children:"Connect account"}),t.jsx("p",{className:"text-muted-foreground text-sm mb-3 flex-1",children:"Nothing posts without your approval"}),t.jsx(iN,{selectedConfigIds:e,onConfigToggle:ve,onSelectAll:Ie,highlightMode:!0,buttonVariant:"default"})]}),t.jsxs("div",{className:"p-4 rounded-lg border border-amber-500/40 bg-amber-500/5 flex flex-col",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/20 flex items-center justify-center mb-2",children:t.jsx(Ds,{className:"w-4 h-4 text-amber-400"})}),t.jsx("div",{className:"font-medium mb-1",children:"Create a post"}),t.jsx("p",{className:"text-muted-foreground text-sm mb-3 flex-1",children:"Schedule without connecting first"}),t.jsx(Hx,{trigger:t.jsxs(T,{className:"w-full bg-amber-600 hover:bg-amber-700","data-testid":"button-welcome-create-post",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Create Post"]})})]}),t.jsxs("div",{className:"p-4 rounded-lg border border-cyan-500/40 bg-cyan-500/5 flex flex-col",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-cyan-500/20 flex items-center justify-center mb-2",children:t.jsx(Ft,{className:"w-4 h-4 text-cyan-400"})}),t.jsx("div",{className:"font-medium mb-1",children:"Generate an image"}),t.jsx("p",{className:"text-muted-foreground text-sm mb-3 flex-1",children:"Create with nano-banana AI"}),t.jsx(Vy,{trigger:t.jsxs(T,{className:"w-full bg-cyan-600 hover:bg-cyan-700","data-testid":"button-welcome-generate-image",children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"Generate"]})})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Generated images are saved to your Media Library"}),t.jsxs("div",{className:"flex items-center gap-3 py-1",children:[t.jsx("div",{className:"flex-1 h-px bg-border"}),t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"OR"}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx(T,{onClick:U,variant:"ghost",size:"sm","data-testid":"button-get-started",children:"Explore the dashboard first"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ka,{id:"dont-show-again",checked:a,onCheckedChange:ce=>i(ce===!0),"data-testid":"checkbox-dont-show-again"}),t.jsx("label",{htmlFor:"dont-show-again",className:"text-xs text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]})]})]})}),!F&&I&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(iN,{selectedConfigIds:e,onConfigToggle:ve,onSelectAll:Ie,highlightMode:o&&!Z}),t.jsx(XW,{trigger:t.jsxs(T,{"data-testid":"button-upload-media",className:"flex-1 sm:flex-none",children:[t.jsx(Js,{className:"w-4 h-4 sm:mr-2"}),t.jsx("span",{className:"hidden sm:inline",children:"Upload Media"})]})}),t.jsx(Vy,{trigger:t.jsxs(T,{"data-testid":"button-generate-image",className:"flex-1 sm:flex-none bg-cyan-600 hover:bg-cyan-700",children:[t.jsx(Et,{className:"w-4 h-4 sm:mr-2"}),t.jsx("span",{className:"hidden sm:inline",children:"AI Image"})]})}),t.jsx(Hx,{trigger:t.jsxs(T,{"data-testid":"button-new-post",className:"flex-1 sm:flex-none bg-amber-600 hover:bg-amber-700",children:[t.jsx(Ds,{className:"w-4 h-4 sm:mr-2"}),t.jsx("span",{className:"hidden sm:inline",children:"Post"})]})})]}),c!=="recent"&&c!=="saved"&&c!=="drafts"&&t.jsx("div",{className:"hidden sm:block",children:t.jsx(Uy,{view:u,onViewChange:h})})]}),c!=="recent"&&c!=="saved"&&c!=="drafts"&&t.jsx("div",{className:"sm:hidden",children:t.jsx(Uy,{view:u,onViewChange:h})})]}),!F&&I&&t.jsxs(sd,{value:c,onValueChange:d,className:"w-full",children:[t.jsxs(dl,{className:"w-full justify-start border-b roun
638ded-none h-auto p-0 bg-transparent overflow-x-auto flex-nowrap",children:[t.jsxs(hs,{value:"scheduled",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 sm:gap-2 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-scheduled",children:["Scheduled",t.jsx("span",{className:"text-xs text-muted-foreground",children:jt})]}),t.jsxs(hs,{value:"attention",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-attention",children:["Needs attention",Cs>0?t.jsx(xe,{variant:"destructive",children:Cs}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"0"})]}),t.jsxs(hs,{value:"saved",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 sm:gap-2 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-saved",children:["Saved",t.jsx("span",{className:"text-xs text-muted-foreground",children:Ss})]}),t.jsxs(hs,{value:"approvals",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 sm:gap-2 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-approvals",children:["Approvals",Mt>0?t.jsx(xe,{variant:"destructive",className:"ml-1","data-testid":"badge-approvals-count",children:Mt}):t.jsx("span",{className:"text-xs text-muted-foreground",children:Mt})]}),t.jsxs(hs,{value:"drafts",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 sm:gap-2 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-drafts",children:["Drafts",t.jsx("span",{className:"text-xs text-muted-foreground",children:le.length})]}),t.jsxs(hs,{value:"recent",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent gap-1 sm:gap-2 px-2 sm:px-3 text-sm sm:text-base whitespace-nowrap flex-shrink-0","data-testid":"tab-recent",children:["Recent",t.jsx("span",{className:"text-xs text-muted-foreground",children:D})]})]}),t.jsxs(ps,{value:"scheduled",className:"mt-6",children:[t.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["Times shown in your local timezone (",Intl.DateTimeFormat().resolvedOptions().timeZone||"local time","). Scheduled posts have not been published yet."]}),t.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[t.jsx(ul,{id:"show-daily-reminders","data-testid":"toggle-daily-reminders",checked:(J==null?void 0:J.showDailyReminders)??!0,disabled:X||se||te.isPending,onCheckedChange:ce=>te.mutate(ce)}),t.jsx("label",{htmlFor:"show-daily-reminders",className:"text-sm cursor-pointer",children:"Show daily posting reminders"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"One per day across all accounts. Hiding these keeps your posts visible."}),se&&t.jsx("span",{role:"alert",className:"text-xs text-destructive",children:"Reminder setting could not be loaded."})]}),t.jsx(jh,{view:u,items:K,showDailyReminders:!X&&!se&&((J==null?void 0:J.showDailyReminders)??!0),hasConnectedAccounts:Z,filters:{status:"approved",configIds:e},connections:I.connections,userUsername:R,onItemClick:A,onCreatePost:$})]}),t.jsx(ps,{value:"attention",className:"mt-6",children:Cs===0?t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No posts need attention. Scheduled posts are in Scheduled, and published posts are in Recent."}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["Failed accounts can be retried in post details. Status pending confirmation is not safe to retry. Times shown in ",Intl.DateTimeFormat().resolvedOptions().timeZone||"your local time","."]}),t.jsx(jh,{view:u,items:K,filters:{statuses:["failed","posting"],configIds:e},connections:I.connections,platformConfigs:G,userUsername:R,onItemClick:A})]})}),t.jsx(ps,{value:"saved",className:"mt-6",children:K.filter(ce=>e.length>0&&!ce.platformApprovals.some(wt=>wt.platformConfigId&&e.includes(wt.platformConfigId))?!1:ce.platformApprovals.some(qe=>qe.status==="pending")).length===0?t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No posts waiting for review. Create a post to get started."}):t.jsx("div",{className:"space-y-3 w-full lg:w-3/5 mx-auto",children:K.filter(ce=>e.length>0&&!ce.platformApprovals.some(wt=>wt.platformConfigId&&e.includes(wt.platformConfigId))?!1:ce.platformApprovals.some(qe=>qe.status==="pending")).map(ce=>t.jsxs("div",{className:"p-4 rounded-lg border bg-card space-y-3","data-testid":`saved-post-${ce.id}`,children:[ce.imageUrl&&t.jsx("img",{src:ft(ce.imageUrl),alt:"",className:"w-full rounded-md object-cover max-h-64"}),t.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ce.caption}),t.jsx("div",{className:"flex flex-wrap gap-2",children:ce.platformApprovals.map($e=>{const qe=iH[$e.platform],wt=qe==null?void 0:qe.icon;return t.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[wt&&t.jsx(wt,{className:`w-3 h-3 ${qe.color}`}),t.jsx("span",{children:(qe==null?void 0:qe.displayName)||$e.platform})]},$e.platform)})})]},ce.id))})}),t.jsx(ps,{value:"approvals",className:"mt-6",children:t.jsx(jh,{view:u,items:K,filters:{status:"pending",configIds:e},connections:I.connections,userUsername:R,onItemClick:A,onApprovePost:M,onRejectPost:C})}),t.jsx(ps,{value:"drafts",className:"mt-6",children:le.length===0?t.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[t.jsx("p",{children:"No drafts yet"}),t.jsx("p",{className:"text-sm mt-2",children:"Create a post without connecting an account to save it as a draft"})]}):t.jsx("div",{className:"space-y-3 w-full lg:w-3/5 mx-auto",children:le.map(ce=>t.jsxs("div",{className:"p-4 rounded-lg border bg-card space-y-3","data-testid":`draft-post-${ce.id}`,children:[ce.mediaUrl&&t.jsx("img",{src:ft(ce.mediaUrl),alt:"",className:"w-full rounded-md object-cover max-h-64"}),t.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ce.contentText}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(xe,{variant:"secondary",className:"text-xs",children:"Draft"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(ce.aiGeneratedAt||ce.scheduledTime).toLocaleDateString()})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect an account to schedule"})]})]},ce.id))})}),t.jsx(ps,{value:"recent",className:"mt-6",children:Zt.length===0?t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No published posts in the last 24 hours. Scheduled posts are in Scheduled."}):t.jsx("div",{className:"space-y-4 w-full lg:w-3/4 mx-auto",children:Zt.map(ce=>{const $e=ce.platformConfigId,qe=$e?I.connections.find(Y=>
638Y.id===$e):I.connections.find(Y=>Y.platform===ce.platform),wt=(qe==null?void 0:qe.channelName)||R;return t.jsx(lI,{post:ce,viewType:"regular",accountName:wt},ce.id)})})})]}),t.jsx(hI,{item:p,open:v,onOpenChange:f,connections:(I==null?void 0:I.connections)||[]}),b&&t.jsx(Hx,{open:!0,onOpenChange:ce=>{ce||y(null)},prefilledScheduledTime:b}),g&&t.jsx(rH,{platform:g,isOpen:S,onConfirm:q,onCancel:()=>{k(!1),j(null),w(null)},isStarter:Ae,configId:N})]})}function lH(){const[e,s]=m.useState("all"),[r,n]=m.useState("weekly"),[a,i]=m.useState(null),[o,l]=m.useState(!1),[c,d]=m.useState(!1),{data:u=[],isLoading:h}=Ee({queryKey:["/api/pending-posts"]}),{data:p}=Ee({queryKey:["/api/platform-connections"]}),x=(p==null?void 0:p.connections)||[],v=(p==null?void 0:p.userUsername)||"PostMonkey",b=[...Object.values(u.reduce((g,j)=>{var S;const N=j.contentGroupId||j.id;if(!g[N]){const k=new Date(j.scheduledTime);g[N]={id:N,contentType:j.contentType,platformApprovals:[],caption:j.contentText,contentTitle:j.contentTitle||null,imageUrl:j.mediaUrl||void 0,deliveryMethod:j.deliveryMethod||void 0,aiGenerated:!0,createdAt:((S=j.aiGeneratedAt)==null?void 0:S.toString())||new Date().toISOString(),scheduledTime:k.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:"America/Chicago"}),scheduledDate:k.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"America/Chicago"}),scheduledTimestamp:k.getTime(),isAutoPublishing:!1,createdBy:"AI Generated",createdTimeAgo:"Recently"}}g[N].platformApprovals.push({platform:j.platform,platformConfigId:j.platformConfigId,status:j.status,scheduledTime:new Date(j.scheduledTime).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:"America/Chicago"}),postId:j.id});const w=g[N].platformApprovals.every(k=>k.status==="approved");return g[N].isAutoPublishing=w,g},{}))].sort((g,j)=>g.scheduledTimestamp-j.scheduledTimestamp),y={};return e!=="all"&&e!=="needs-review"&&e!=="auto-publishing"&&(y.contentType=e),e==="needs-review"?y.isAutoPublishing=!1:e==="auto-publishing"&&(y.isAutoPublishing=!0),h?t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):t.jsxs("div",{className:"space-y-6 p-0 md:p-6",children:[t.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold",children:"Calendar"}),t.jsx("p",{className:"text-muted-foreground",children:"Review and approve scheduled posts. This scheduler will automatically start populating every hour based on your post settings and posting frequency."})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[t.jsxs(Nt,{value:e,onValueChange:g=>s(g),children:[t.jsx(gt,{className:"w-[200px]","data-testid":"filter-select",children:t.jsx(kt,{placeholder:"Filter posts"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All"}),t.jsx(Se,{value:"needs-review",children:"Needs Review"}),t.jsx(Se,{value:"auto-publishing",children:"Auto-Publishing"}),t.jsx(Se,{value:"video",children:"Videos"}),t.jsx(Se,{value:"poll",children:"Polls"}),t.jsx(Se,{value:"tip",children:"Tips"}),t.jsx(Se,{value:"image",children:"Images"})]})]}),t.jsx(Uy,{view:r,onViewChange:n})]}),t.jsx("div",{children:t.jsxs(T,{onClick:()=>d(!0),className:"gap-2","data-testid":"button-create-post",children:[t.jsx(Ds,{className:"w-4 h-4"}),"Post"]})})]}),t.jsx(jh,{view:r,items:b,filters:y,connections:x,userUsername:v,onItemClick:g=>{i(g),l(!0)}}),t.jsx(hI,{item:a,open:o,onOpenChange:l,connections:x}),t.jsx(Ut,{open:c,onOpenChange:d,children:t.jsxs(Ht,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Create Post"}),t.jsx(Ns,{children:"Create and schedule a new post with your own content or AI assistance"})]}),t.jsx(Rf,{onComplete:()=>d(!1),onCancel:()=>d(!1)})]})})]})}function cH(){return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Content Calendar"}),t.jsx("p",{className:"text-muted-foreground",children:"View and manage your scheduled posts across all platforms"})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Ca,{className:"h-5 w-5"}),"Coming Soon"]})}),t.jsx(de,{children:t.jsxs("div",{className:"text-center py-12 space-y-4",children:[t.jsx("div",{className:"text-6xl",children:"📅"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-lg font-medium mb-2",children:"Calendar View 
638Under Development"}),t.jsx("p",{className:"text-muted-foreground",children:"Interactive calendar with drag-and-drop scheduling will be available soon"})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 justify-center pt-4",children:[t.jsx(xe,{variant:"outline",children:"Week View"}),t.jsx(xe,{variant:"outline",children:"Month View"}),t.jsx(xe,{variant:"outline",children:"Drag to Reschedule"}),t.jsx(xe,{variant:"outline",children:"Multi-Platform View"})]})]})})]})]})}function dH(){return t.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:t.jsx(Rf,{})})}const uH=Cn({title:Pt().min(1,"Title is required").max(200),description:Pt().max(1e3),media:Uc().refine(e=>(e==null?void 0:e.length)>0,"Media file is required")});function mH(e){var r;const s=((r=e.split(".").pop())==null?void 0:r.toLowerCase())||"";return["mp4","webm","ogv","mov","avi","mkv","m4v"].includes(s)?"Video":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(s)?"Image":["mp3","wav","ogg","oga","aac","m4a","flac","weba"].includes(s)?"Audio":"Video"}function hH(){const[e,s]=m.useState(!1),[r,n]=m.useState(!1),[a,i]=m.useState(""),{toast:o}=bt(),[l,c]=m.useState({}),[d,u]=m.useState(!1),[h,p]=m.useState([]),[x,v]=m.useState(null),{data:f}=Ee({queryKey:["/api/user"]}),{data:b,isLoading:y}=Ee({queryKey:["/api/vidmonkey/status"]}),{data:g=[],isLoading:j}=Ee({queryKey:["/api/platform-configs"]}),{data:N=[],isLoading:w,error:S}=Ee({queryKey:["/api/vidmonkey/videos"]}),{data:k=[],isLoading:P}=Ee({queryKey:["/api/user/generated-images"]}),[A,$]=m.useState("library"),_=m.useMemo(()=>N.map(U=>({...U,media_type:U.content_type||mH(U.media_url)})),[N]),O=(U,Ae)=>{const G=U.toString();c(Q=>({...Q,[G]:Ae}))},M=Nf({resolver:kf(uH),defaultValues:{title:"",description:"",media:void 0}}),C=ke({mutationFn:async U=>{const Ae=new FormData;Ae.append("title",U.title),Ae.append("description",U.description),Ae.append("video",U.media[0]);const G=await fetch("/api/vidmonkey/upload",{method:"POST",body:Ae,credentials:"include"});if(!G.ok){const Q=await G.json();throw new Error(Q.message||"Upload failed")}return G.json()},onSuccess:()=>{s(!1),M.reset(),o({title:"Success",description:"Media uploaded successfully"}),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]})},onError:U=>{o({title:"Upload failed",description:U.message||"Could not upload media",variant:"destructive"})}}),L=ke({mutationFn:async({mediaId:U,mediaUrl:Ae,title:G,description:Q,platforms:ye,aspectRatio:le})=>(await Fe("POST","/api/vidmonkey/schedule",{videoId:U,videoUrl:Ae,title:G,description:Q,platforms:ye,aspectRatio:le})).json(),onSuccess:U=>{o({title:"Media Scheduled",description:`Scheduled to ${U.scheduledCount} platform(s) successfully`}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]})},onError:U=>{o({title:"Scheduling Failed",description:Qh(U)||"Could not schedule media",variant:"destructive"})}}),W=U=>{const Ae=l[U.id.toString()]||[];if(Ae.length===0){o({title:"No Platforms Selected",description:"Please select at least one platform to schedule this media",variant:"destructive"});return}v({mediaUrl:U.media_url,mediaType:U.media_type==="Video"?"video":"image",aspectRatio:U.aspect_ratio==="portrait"?"portrait":"landscape"}),p(Ae),u(!0)},q=U=>{const Ae=l[`gen-${U.id}`]||[];if(Ae.length===0){o({title:"No Platforms Selected",description:"Please select at least one platform to schedule this image",variant:"destructive"});return}v({mediaUrl:U.imageUrl,mediaType:"image",aspectRatio:"landscape"}),p(Ae),u(!0)},I=()=>{u(!1),p([]),v(null),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]}),o({title:"Post Scheduled",description:"Your post has been scheduled successfully"})},F=U=>{C.mutate(U)},E=ke({mutationFn:async U=>(await Fe("POST","/api/vidmonkey/link",{email:U})).json(),onSuccess:U=>{n(!1),i(""),o({title:"VidMonkey Connected",description:`Successfully linked to ${U.email}`}),ee.invalidateQueries({queryKey:["/api/vidmonkey/status"]}),ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]})},onError:U=>{o({title:"Link Failed",description:U.message||"Could not link VidMonkey account",variant:"destructive"})}}),ne=()=>{if(!a.trim()){o({title:"Email Required",description:"Please enter your VidMonkey email address",variant:"destructive"});return}E.mutate(a.trim())};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between gap-4 sm:block",children:[t.jsx("h1",{className:"text-3xl font-bold mb-0 sm:mb-2",children:"Media Library"}),t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsx(Xl,{asChild:!0,children:t.jsxs(T,{"data-testid":"button-upload-media",className:"sm:hidden",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Upload Media"]})})})]}),t.jsx("p",{className:"text-muted-foreground mt-2 sm:mt-0",children:"Upload and manage your images, videos, and audio for scheduling across platforms (max 45MB per file)"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Vy,{trigger:t.jsxs(T,{variant:"outline","data-testid":"button-generate-image",className:"hidden sm:flex",children:[t.jsx(Et,{className:"w-4 h-4 mr-2"}),"AI Image"]})}),t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsx(Xl,{asChild:!0,children:t.jsxs(T,{"data-testid":"button-upload-media-desktop",className:"hidden sm:flex",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Upload Media"]})})})]}),t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Upload Media"}),t.jsx(Ns,{children:"Add images, videos, or audio to your library with title and description"})]}),t.jsx(Bv,{...M,children:t.jsxs("form",{onSubmit:M.handleSubmit(F),className:"space-y-4",children:[t.jsx(Br,{control:M.control,name:"title",render:({field:U})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Title"}),t.jsx(Wr,{children:t.jsx(Ke,{placeholder:"Enter media title",...U,"data-testid":"input-media-title"})}),t.jsx(Kr,{})]})}),t.jsx(Br,{control:M.control,name:"description",render:({field:U})=>t.jsxs(Ar,{children:[t.jsx(_r,{children:"Description"}),t.jsx(Wr,{children:t.jsx(os,{placeholder:"Enter media description",rows:3,...U,"data-testid":"input-media-description"})}),t.jsx(Kr,{})]})}
638),t.jsx(Br,{control:M.control,name:"media",render:({field:{onChange:U,value:Ae,...G}})=>t.jsxs(Ar,{children:[t.jsx("div",{className:"text-sm text-muted-foreground mb-3",children:"Upload one image, video, or music file"}),t.jsx(_r,{className:"text-xs font-medium text-muted-foreground",children:"Upload New Media"}),t.jsx(Wr,{children:t.jsxs("div",{className:"mt-1",children:[C.isPending?t.jsx("div",{className:"flex items-center justify-center p-8 border-2 border-dashed border-primary/30 rounded-md bg-primary/5",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"w-12 h-12 rounded-full border-4 border-primary/20 border-t-primary animate-spin"}),t.jsx(Js,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-5 h-5 text-primary"})]}),t.jsx("p",{className:"text-sm font-medium text-primary",children:"Uploading your media..."}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This may take a moment for larger files"})]})}):t.jsxs("label",{htmlFor:"media-file-upload",className:"flex items-center justify-center gap-2 w-full h-12 px-4 border-2 border-dashed rounded-md cursor-pointer transition-colors hover:border-primary hover:bg-primary/5",children:[t.jsx(Js,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Choose File"})]}),t.jsx("input",{id:"media-file-upload",type:"file",accept:"image/*,video/*,audio/*",onChange:Q=>U(Q.target.files),...G,className:"sr-only","data-testid":"input-media-file"}),Ae&&Ae[0]&&!C.isPending&&t.jsxs("p",{className:"mt-3 text-sm truncate",children:[t.jsx("span",{className:"font-semibold",children:"Selected:"})," ",Ae[0].name]})]})}),t.jsx(Kr,{})]})}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsx(T,{type:"button",variant:"outline",onClick:()=>s(!1),className:"flex-1","data-testid":"button-cancel-upload",children:"Cancel"}),t.jsx(T,{type:"submit",className:"flex-1",disabled:C.isPending,"data-testid":"button-submit-upload",children:C.isPending?"Uploading...":"Upload"})]})]})})]})})]}),!y&&!(b!=null&&b.connected)&&t.jsx(re,{className:"bg-gradient-to-r from-purple-50 to-purple-100 dark:from-purple-950/20 dark:to-purple-900/20 border-purple-200 dark:border-purple-800",children:t.jsx(de,{className:"p-6",children:t.jsx("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:t.jsxs("div",{className:"flex-1",children:[t.jsxs("h3",{className:"text-lg font-semibold mb-1 flex items-center gap-2",children:[t.jsx(Xr,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}),"Connect to VidMonkey"]}),t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"VidMonkey is an AI video generation platform that allows you to create dynamic videos using Google's Veo3 Engine! This is automatically included with your SocialMonkey subscription! Link your VidMonkey account to sync your favorite AI-generated content."}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[t.jsx("a",{href:`https://vidmonkey.app${f!=null&&f.id?`?social_monkey_id=${f.id}`:""}`,target:"_blank",rel:"noopener noreferrer",children:t.jsxs(T,{className:"bg-purple-600 hover:bg-purple-700 text-white","data-testid":"button-register-vidmonkey",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Register at VidMonkey"]})}),t.jsxs(Ut,{open:r,onOpenChange:n,children:[t.jsx(Xl,{asChild:!0,children:t.jsx(T,{variant:"outline",className:"border-purple-300 dark:border-purple-700","data-testid":"button-link-account",children:"Link My Account"})}),t.jsxs(Ht,{children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Link VidMonkey Account"}),t.jsx(Ns,{children:"Enter the email address you used to register at VidMonkey"})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"vidmonkey-email",children:"VidMonkey Email"}),t.jsx(Ke,{id:"vidmonkey-email",type:"email",placeholder:"[email protected]",value:a,onChange:U=>i(U.target.value),"data-testid":"input-vidmonkey-email"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(T,{variant:"outline",onClick:()=>n(!1),className:"flex-1","data-testid":"button-cancel-link",children:"Cancel"}),t.jsx(T,{onClick:ne,disabled:E.isPending,className:"flex-1 bg-purple-600 hover:bg-purple-700","data-testid":"button-submit-link",children:E.isPending?"Linking...":"Link Account"})]})]})]})]})]})]})})})}),t.jsxs(sd,{value:A,onValueChange:$,className:"w-full",children:[t.jsxs(dl,{className:"mb-4",children:[t.jsxs(hs,{value:"library","data-testid":"tab-library",className:"gap-2",children:[t.jsx(Xr,{className:"w-4 h-4"}),"Library",_.length>0&&t.jsx(xe,{variant:"secondary",className:"ml-1 text-xs",children:_.length})]}),t.jsxs(hs,{value:"generated","data-testid":"tab-generated",className:"gap-2",children:[t.jsx(Et,{className:"w-4 h-4"}),"AI Generated",k.length>0&&t.jsx(xe,{variant:"secondary",className:"ml-1 text-xs",children:k.length})]})]}),t.jsxs(ps,{value:"library",className:"mt-0",children:[!y&&(b==null?void 0:b.connected)&&t.jsx(re,{className:"bg-gradient-to-r from-purple-50 to-purple-100 dar
638k:from-purple-950/20 dark:to-purple-900/20 border-purple-200 dark:border-purple-800 mb-4",children:t.jsx(de,{className:"p-4",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-purple-100 dark:bg-purple-900 flex items-center justify-center shrink-0",children:t.jsx(Xr,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h4",{className:"font-semibold text-sm",children:"VidMonkey Connected"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Linked to ",b.email," ",t.jsx("span",{className:"hidden sm:inline",children:"• Your favorite media will sync automatically"})]})]})]}),t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>window.open("https://vidmonkey.app","_blank"),className:"border-purple-300 dark:border-purple-700 hover:bg-purple-100 dark:hover:bg-purple-900/50 w-full sm:w-auto","data-testid":"button-launch-vidmonkey",children:[t.jsx(wa,{className:"w-4 h-4 mr-2"}),"Open VidMonkey"]})]})})}),w?t.jsx("div",{className:"grid gap-3 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:[1,2,3,4,5].map(U=>t.jsx(re,{className:"animate-pulse",children:t.jsxs(he,{className:"pb-3",children:[t.jsx("div",{className:"aspect-video bg-muted rounded-md mb-3"}),t.jsx("div",{className:"h-4 bg-muted rounded w-3/4"})]})},U))}):_.length===0?t.jsx(re,{className:"p-12",children:t.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center",children:t.jsx(Ft,{className:"w-8 h-8 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold mb-1",children:"No media yet"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Upload your first image, video, or audio file to get started"}),t.jsxs(T,{onClick:()=>s(!0),"data-testid":"button-upload-first",children:[t.jsx(Js,{className:"w-4 h-4 mr-2"}),"Upload Media"]})]})]})}):t.jsx("div",{className:"grid gap-3 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:_.map(U=>t.jsx(pH,{media:U,selectedConfigIds:l[U.id.toString()]||[],platformConfigs:g,loadingPlatforms:j,onSelectionChange:O,onSchedule:W,isScheduling:L.isPending},U.id))})]}),t.jsx(ps,{value:"generated",className:"mt-0",children:P?t.jsx("div",{className:"grid gap-3 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:[1,2,3,4,5].map(U=>t.jsx(re,{className:"animate-pulse",children:t.jsx("div",{className:"aspect-square bg-muted rounded-md"})},U))}):k.length===0?t.jsx(re,{className:"p-12",children:t.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center",children:t.jsx(Et,{className:"w-8 h-8 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold mb-1",children:"No AI-generated images yet"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Images you generate through prompts and manual posts will appear here"})]})]})}):t.jsx("div",{className:"grid gap-3 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:k.map(U=>t.jsx(fH,{image:U,selectedConfigIds:l[`gen-${U.id}`]||[],platformConfigs:g,loadingPlatforms:j,onSelectionChange:(Ae,G)=>{c(Q=>({...Q,[`gen-${Ae}`]:G}))},onSchedule:q,isScheduling:L.isPending},U.id))})})]}),t.jsx(Ut,{open:d,onOpenChange:u,children:t.jsxs(Ht,{className:"max-w-4xl max-h-[90vh] p-0",children:[t.jsxs(xs,{className:"sr-only",children:[t.jsx(gs,{children:"Schedule Post"}),t.jsx(Ns,{children:"Create and schedule your post"})]}),t.jsx(ab,{className:"max-h-[90vh]",children:t.jsx("div",{className:"p-6",children:x&&t.jsx(Rf,{onComplete:I,onCancel:()=>u(!1),prefilledPlatformConfigIds:h,prefilledMediaUrl:x.mediaUrl,prefilledMediaType:x.mediaType,prefilledAspectRatio:x.aspectRatio,startAtManualStep:!0})})})]})})]})}function pH({media:e,selectedConfigIds:s,platformConfigs:r,loadingPlatforms:n,onSelectionChange:a,onSchedule:i,isScheduling:o}){const{toast:l}=bt(),c=m.useRef(null),[d,u]=m.useState(!1),[h,p]=m.useState(""),[x,v]=m.useState(""),[f,b]=m.useState(""),[y,g]=m.useState(),j={Video:"bg-blue-500/20 text-blue-500 border-blue-500/30",Image:"bg-orange-500/20 text-orange-500 border-orange-500/30",Audio:"bg-purple-500/20 text-purple-500 border-purple-500/30"}[e.media_type],N=ke({mutationFn:async C=>{await Fe("DELETE",`/api/videos/${C}`)},onSuccess:()=>
638{ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]}),l({title:"Media Deleted",description:"The media file has been deleted successfully."})},onError:()=>{l({title:"Error",description:"Failed to delete media. Please try again.",variant:"destructive"})}}),w=ke({mutationFn:async({id:C,title:L,description:W,mediaUrl:q,contentType:I})=>(await Fe("PATCH",`/api/videos/${C}`,{title:L,description:W,...q&&{media_url:q},...I&&{content_type:I}})).json(),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/vidmonkey/videos"]}),u(!1),l({title:"Media Updated",description:"Changes saved successfully."})},onError:()=>{l({title:"Error",description:"Failed to update media. Please try again.",variant:"destructive"})}}),S=ke({mutationFn:async C=>{const L=new FormData;L.append("media",C);const W=await fetch("/api/videos/upload",{method:"POST",body:L,credentials:"include"});if(!W.ok){const q=await W.json();throw new Error(q.error||"Failed to upload media")}return W.json()},onSuccess:C=>{b(C.media_url),g(C.content_type),l({title:"Media uploaded",description:"Your media file has been uploaded successfully"})},onError:()=>{l({title:"Upload failed",description:"Failed to upload media. Please try again.",variant:"destructive"})}}),k=()=>{confirm("Are you sure you want to delete this media file?")&&N.mutate(e.id)},P=()=>{u(!0),p(e.generated_title),v(e.generated_description),b(e.media_url)},A=()=>{w.mutate({id:e.id,title:h,description:x,mediaUrl:f!==e.media_url?f:void 0,contentType:f!==e.media_url?y:void 0})},$=()=>{u(!1),p(""),v(""),b(""),g(void 0)},_=C=>{var W;const L=(W=C.target.files)==null?void 0:W[0];if(L){if(L.size>100*1024*1024){l({title:"File too large",description:"Media file must be less than 100MB",variant:"destructive"}),c.current&&(c.current.value="");return}S.mutate(L,{onSettled:()=>{c.current&&(c.current.value="")}})}},O=()=>{var C;(C=c.current)==null||C.click()},M=()=>{const C=document.createElement("a");C.href=`/api/videos/${e.id}/download`,C.download="",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return t.jsxs(re,{className:"hover-elevate overflow-hidden","data-testid":`card-media-${e.id}`,children:[t.jsxs(he,{className:"p-3 pb-0",children:[t.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3",children:[t.jsx(xe,{variant:"outline",className:`${j} text-xs shrink-0`,children:e.media_type.charAt(0).toUpperCase()+e.media_type.slice(1)}),t.jsx("div",{className:"flex items-center gap-0.5",children:!d&&t.jsxs(t.Fragment,{children:[t.jsx(T,{size:"icon",variant:"ghost",onClick:M,className:"h-7 w-7","data-testid":`button-download-${e.id}`,children:t.jsx(X0,{className:"w-3.5 h-3.5"})}),t.jsx(T,{size:"icon",variant:"ghost",onClick:P,className:"h-7 w-7","data-testid":`button-edit-${e.id}`,children:t.jsx(Z0,{className:"w-3.5 h-3.5"})}),t.jsx(T,{size:"icon",variant:"ghost",onClick:k,disabled:N.isPending,className:"h-7 w-7","data-testid":`button-delete-${e.id}`,children:t.jsx(ni,{className:"w-3.5 h-3.5"})})]})})]}),d?t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"relative rounded-lg overflow-hidden bg-muted/30 aspect-video flex items-center justify-center",children:f?t.jsxs(t.Fragment,{children:[e.media_type==="Video"&&t.jsx("video",{src:ft(f),controls:!0,className:"w-full h-full object-contain","data-testid":"video-preview-edit"}),e.media_type==="Image"&&t.jsx("img",{src:ft(f),alt:"Preview",className:"w-full h-full object-contain","data-testid":"image-preview-edit"}),e.media_type==="Audio"&&t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center p-4 bg-gradient-to-br from-purple-100 to-purple-200 dark:from-purple-900/20 dark:to-purple-800/20",children:[t.jsx(pu,{className:"w-16 h-16 mb-4 text-purple-600 dark:text-purple-400"}),t.jsx("audio",{src:ft(f),controls:!0,className:"w-full","data-testid":"audio-preview-edit"})]})]}):t.jsx(Ft,{className:"w-12 h-12 text-muted-foreground"})}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{type:"text",value:f,onChange:C=>b(C.target.value),placeholder:"Media URL",className:"flex-1","data-testid":"input-media-url"}),t.jsx(T,{size:"icon",variant:"outline",onClick:O,disabled:S.isPending,"data-testid":"upload-media",children:t.jsx(Js,{className:"w-4 h-4"})}),t.jsx("input",{ref:c,type:"file",accept:"image/*,video/*,audio/*",onChange:_,className:"hidden","data-testid":"file-input-media"})]})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs text-muted-foreground mb-1 block",children:"Title"}),t.jsx(Ke,{value:h,onChange:C=>p(C.target.value),className:"w-full","data-testid":"input-title",placeholder:"Enter title..."})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-xs text-muted-foreground mb-1 block",children:"Description"}),t.jsx(os,{value:x,onChange:C=>v(C.target.value),className:"w-full min-h-[80px] resize-y","data-testid":"textarea-description",placeholder:"Enter description..."})]}),t.jsxs("div",{className:"flex gap-2 pt-2",children:[t.jsxs(T,{className:"flex-1",onClick:A,disabled:w.isPending,"data-testid":"save-edit",children:[t.jsx(Js,{className:"w-4 h-4 mr-2"}),"Save"]}),t.jsxs(T,{className:"flex-1",variant:"outline",onClick:$,disabled:w.isPending,"data-testid":"cancel-edit",children:[t.jsx(xr,{className:"w-4 h-4 mr-2"}),"Cancel"]})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"aspect-video bg-muted rounded-md overflow-hidden mb-3",children:[e.media_type==="Video"&&t.jsx("video",{src:ft(e.media_url),className:"w-full h-full object-cover",controls:!0,preload:"metadata","data-testid":`video-player-${e.id}`}),e.media_type==="Image"&&t.jsx("img",{src:ft(e.media_url),alt:e.generated_title,className:"w-full h-full object-cover","data-testid":`image-display-${e.id}`}),e.media_type==="Audio"&&t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center p-4 bg-gradient-to-br from-purple-100 to-purple-200 dark:from-purple-900/20 dark:to-purple-800/20",children:[t.jsx(pu,{className:"w-16 h-16 mb-4 text-purple-600 dar
638k:text-purple-400"}),t.jsx("audio",{src:ft(e.media_url),controls:!0,className:"w-full","data-testid":`audio-player-${e.id}`})]})]}),t.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[t.jsx(pe,{className:"text-base line-clamp-2 flex-1",children:e.generated_title}),e.media_type==="Video"&&t.jsxs("div",{className:"flex gap-1 shrink-0",children:[e.aspect_ratio==="portrait"&&t.jsxs(xe,{variant:"outline",className:"shrink-0","data-testid":`badge-aspect-${e.id}`,children:[t.jsx(xP,{className:"w-3 h-3 mr-1"}),"Short"]}),e.aspect_ratio!=="portrait"&&t.jsxs(xe,{variant:"outline",className:"shrink-0","data-testid":`badge-aspect-${e.id}`,children:[t.jsx(hP,{className:"w-3 h-3 mr-1"}),"Wide"]})]})]})]})]}),!d&&t.jsxs(t.Fragment,{children:[t.jsxs(de,{className:"space-y-4",children:[e.generated_description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.generated_description}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Submit to Platforms"}),n?t.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading platforms..."}):t.jsx(Du,{platformConfigs:r,selectedConfigIds:s,onSelectionChange:C=>a(e.id,C),showValidationError:!1})]})]}),t.jsx(Pv,{children:t.jsx(T,{onClick:()=>i(e),disabled:o||s.length===0,className:"w-full","data-testid":`button-schedule-${e.id}`,children:o?"Scheduling...":"Schedule"})})]})]})}function fH({image:e,selectedConfigIds:s,platformConfigs:r,loadingPlatforms:n,onSelectionChange:a,onSchedule:i,isScheduling:o}){const[l,c]=m.useState(!1),d=p=>new Date(p).toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=p=>({scheduled:"Scheduled","manual-post":"Manual Post","test-prompt":"Test","reel-frame":"Reel Frame"})[p]||p,h=async()=>{try{const p=await fetch(ft(e.imageUrl));if(!p.ok)throw new Error("Image download failed");const x=await p.blob(),v=window.URL.createObjectURL(x),f=document.createElement("a");f.href=v,f.download=`generated-image-${e.id}.png`,document.body.appendChild(f),f.click(),document.body.removeChild(f),window.URL.revokeObjectURL(v)}catch(p){console.error("Download failed:",p)}};return t.jsxs(re,{className:"overflow-hidden group",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"data-testid":`card-generated-image-${e.id}`,children:[t.jsxs("div",{className:"relative aspect-square",children:[t.jsx("img",{src:ft(e.imageUrl),alt:`AI generated image - ${e.generationMode}`,className:"w-full h-full object-cover",loading:"lazy"}),l&&t.jsx("div",{className:"absolute inset-0 bg-black/60 flex items-center justify-center transition-opacity",children:t.jsx(T,{size:"icon",variant:"secondary",onClick:h,"data-testid":`button-download-${e.id}`,children:t.jsx(X0,{className:"w-4 h-4"})})}),t.jsx("div",{className:"absolute top-2 left-2",children:t.jsxs(xe,{className:"bg-purple-600/90 text-white text-xs",children:[t.jsx(Et,{className:"w-3 h-3 mr-1"}),e.generationMode]})})]}),t.jsxs(de,{className:"p-3 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[t.jsx("span",{children:u(e.source)}),t.jsx("span",{children:d(e.createdAt)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Submit to Platforms"}),n?t.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading platforms..."}):t.jsx(Du,{platformConfigs:r,selectedConfigIds:s,onSelectionChange:p=>a(e.id,p),showValidationError:!1})]})]}),t.jsx(Pv,{className:"p-3 pt-0",children:t.jsx(T,{onClick:()=>i(e),disabled:o||s.length===0,className:"w-full","data-testid":`button-schedule-gen-${e.id}`,children:o?"Scheduling...":"Schedule"})})]})}function Hm({title:e,value:s,icon:r,testId:n}){return t.jsxs(re,{children:[t.jsxs(he,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[t.jsx(pe,{className:"text-sm font-medium text-muted-foreground",children:e}),t.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center",children:r})]}),t.jsx(de,{children:t.jsx("div",{className:"text-3xl font-bold","data-testid":n,children:s})})]})}function xH({totalScheduled:e,totalPosts:s,totalReplies30d:r,timeSaved30d:n}){const a=i=>{if(i<60)return`${i} min`;const o=Math.floor(i/60),l=i%60;return l>0?`${o}h ${l}m`:`${o}h`};return t.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[t.jsx(Hm,{title:"Total Scheduled",value:e,icon:t.jsx(Ca,{className:"h-4 w-4 text-primary"}),testId:"stat-total-scheduled"}),t.jsx(Hm,{title:"Total Posts",value:s,icon:t.jsx(ot,{className:"h-4 w-4 text-primary"}),testId:"stat-total-posts"}),t.jsx(Hm,{title:"Total Replies (30d)",value:r,icon:t.jsx(Xh,{className:"h-4 w-4 text-primary"}),testId:"stat-total-replies"}),t.jsx(Hm,{title:"Time Saved (30d)",value:a(n),icon:t.jsx(ws,{className:"h-4 w-4 text-primary"}),testId:"stat-time-saved"})]})}const gH=["youtube","x","tiktok","instagram","facebook","linkedin","reddit"],yH={youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]",brandBg:"bg-[#FF0000] hover:bg-[#FF0000]/90",brandText:"text-white"},x:{icon:js,displayName:"Twitter/X",color:"text-foreground",brandBg:"bg-[#000000] hover:bg-[#000000]/90 dark:bg-[#000000] dark:hover:bg-[#1a1a1a]",brandText:"text-white"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]",brandBg:"bg-[#000000] hover:bg-[#000000]/90 dark:bg-[#FFFFFF] dark:hover:bg-[#FFFFFF]/90",brandText:"text-white dark:text-black"},instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]",brandBg:"bg-[#E4405F] hover:bg-[#
638E4405F]/90",brandText:"text-white"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]",brandBg:"bg-[#1877F2] hover:bg-[#1877F2]/90",brandText:"text-white"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]",brandBg:"bg-[#0A66C2] hover:bg-[#0A66C2]/90",brandText:"text-white"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]",brandBg:"bg-[#FF4500] hover:bg-[#FF4500]/90",brandText:"text-white"},snapchat:{icon:_f,displayName:"Snapchat",color:"text-[#FFFC00]",brandBg:"bg-[#FFFC00] hover:bg-[#FFFC00]/90",brandText:"text-black"},tbd:{icon:null,displayName:"TBD",color:"text-muted-foreground",brandBg:"bg-muted hover:bg-muted/90",brandText:"text-foreground"}};function vH(){const{toast:e}=bt(),{data:s,isLoading:r}=Ee({queryKey:["/api/dashboard/stats"]}),{data:n,isLoading:a}=Ee({queryKey:["/api/dashboard/platforms"]}),{data:i,isLoading:o}=Ee({queryKey:["/api/platform-connections"]}),l=ke({mutationFn:async u=>{const p=await(await fetch(`/api/oauth/${u}/connect`,{credentials:"include"})).json();return p.authUrl&&(window.location.href=p.authUrl),p},onError:()=>{e({title:"Error",description:"Failed to initiate connection",variant:"destructive"})}}),c=u=>i==null?void 0:i.connections.find(h=>h.platform===u),d=gH.map(u=>{const h=n==null?void 0:n.find(x=>x.platform===u),p=c(u);return{platform:u,connected:(p==null?void 0:p.connected)||!1,postsLast24Hours:(h==null?void 0:h.postsLast24Hours)||0,channelUrl:h==null?void 0:h.channelUrl,channelName:h==null?void 0:h.channelName}});return t.jsxs("div",{className:"space-y-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Analytics"}),t.jsx("p",{className:"text-muted-foreground",children:"Track performance across all your social media platforms"})]}),r?t.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(u=>t.jsxs(re,{children:[t.jsxs(he,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[t.jsx(cn,{className:"h-4 w-24"}),t.jsx(cn,{className:"h-4 w-4"})]}),t.jsxs(de,{children:[t.jsx(cn,{className:"h-8 w-16 mb-2"}),t.jsx(cn,{className:"h-3 w-32"})]})]},u))}):t.jsx(xH,{totalScheduled:(s==null?void 0:s.totalScheduled)||0,totalPosts:(s==null?void 0:s.totalPosts)||0,totalReplies30d:(s==null?void 0:s.totalReplies30d)||0,timeSaved30d:(s==null?void 0:s.timeSaved30d)||0}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Platform Activity (Last 24 Hours)"}),a||o?t.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4,5,6,7].map(u=>t.jsxs(re,{children:[t.jsx(he,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:t.jsx(cn,{className:"h-5 w-20"})}),t.jsxs(de,{children:[t.jsx(cn,{className:"h-8 w-12 mb-1"}),t.jsx(cn,{className:"h-3 w-24 mb-2"}),t.jsx(cn,{className:"h-3 w-32"})]})]},u))}):t.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:d.map(u=>{const h=yH[u.platform],p=h==null?void 0:h.icon,x=u.platform==="reddit";if(u.platform==="x"){const v=c(u.platform),f=(v==null?void 0:v.hasTwitterKeys)||!1;return t.jsxs(re,{"data-testid":`card-platform-${u.platform}`,children:[t.jsx(he,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:t.jsxs("div",{className:"flex items-center gap-2",children:[p&&t.jsx(p,{className:`w-5 h-5 ${h.color}`}),t.jsx(pe,{className:"text-sm font-medium",children:h.displayName})]})}),t.jsx(de,{children:f?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-2xl font-bold","data-testid":`text-posts-count-${u.platform}`,children:u.postsLast24Hours}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"posts published"}),u.channelUrl&&u.channelName&&t.jsx("a",{href:u.channelUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline block truncate","data-testid":`link-channel-${u.platform}`,title:u.channelName,children:u.channelName})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Configure Twitter/X in the X.com Configuration page"}),t.jsxs(T,{size:"sm",onClick:()=>window.location.href="/x-config",className:`w-full ${h.brandBg} ${h.brandText} border-0`,"data-testid":`button-configure-${u.platform}`,children:[t.jsx(p,{className:"w-4 h-4 mr-2"}),"Configure with X"]})]})})]},u.platform)}return t.jsxs(re,{"data-testid":`card-platform-${u.platform}`,children:[t.jsx(he,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:t.jsxs("div",{className:"flex items-center gap-2",children:[p&&t.jsx(p,{className:`w-5 h-5 ${h.color}`}),t.jsx(pe,{className:"text-sm font-medium",children:h.displayName})]})}),t.jsx(de,{children:u.connected?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-2xl font-bold","data-testid":`text-posts-count-${u.platform}`,children:u.postsLast24Hours}),t.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"posts published"}),u.channelUrl&&u.channelName&&t.jsx("a",{href:u.channelUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline block truncate","data-testid":`link-channel-${u.platform}`,title:u.channelName,children:u.channelName})]}):t.jsx(t.Fragment,{children:x?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2 mb-2",children:t.jsxs(xe,{variant:"secondary",className:"text-xs bg-amber-500/10 text-amber-500 border-amber-500/20",children:[t.jsx(ws,{className:"h-3 w-3 mr-1"}),"Awaiting Approval"]})}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Coming soon"}),t.jsxs(T,{size:"sm",disabled:!0,className:"w-full bg-muted text-muted-foreground border-0 cursor-not-allowed","data-testid":`button-connect-${u.platform}`,children:[t.jsx(p,{className:"w-4 h-4 mr-2"}),"Coming Soon"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Connect to start posting"}),t.jsxs(T,{size:"sm",onClick:()=>l.mutate(u.platform),disabled:l.isPending,className:`w-full ${h.brandBg} ${h.brandText} border-0`,"data-testid":`button-connect-${u.platform}`,children:[t.jsx(p,{className:"w-4 h-4 mr-2"}),"Connect with ",h.displayName]})]})})})]},u.platform)})})]})]})}var pI="AlertDialog",[bH,ZQ]=Ws(pI,[y5]),pi=y5(),fI=e=>{const{__scopeAlertDialog:s,...r}=e,n=pi(s);return t.jsx(kv,{...n,...r,modal:!0})};fI.displayName=pI;var jH="AlertDialogTrigger",wH=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,a=pi(r);return t.jsx(R5,{...a,...n,ref:s})});wH.displayName=jH;var NH="AlertDialogPortal",xI=e=>{const{__scopeAlertDialog:s,...r}=e,n=pi(s);return t.jsx(Sv,{...n,...r})};xI.displayName=NH;var kH="AlertDialogOverlay",gI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,a=pi(r);return t.jsx(tm,{...a,...n,ref:s})});gI.displayName=kH;var rc="AlertDialogContent",[SH,CH]=bH(rc),PH=M3("AlertDialogContent"),yI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,children:n,...a}=e,i=pi(r),o=m.useRef(null),l=lt(s,o),c=m.useRef(null);return t.jsx(PO,{contentName:rc,titleName:vI,docsSlug:"alert-dialog",children:t.jsx(SH,{scope:r,cancelRef:c,children:t.jsxs(sm,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:Ce(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[t.jsx(PH,{children:n}),t.jsx(AH,{contentRef:o})]})})})});yI.displayName=rc;var vI="AlertDialogTitle",bI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,a=pi(r);return t.jsx(rm,{...a,...n,ref:s})});bI.displayName=vI;var jI="AlertDialogDescription",wI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,a=pi(r);return t.jsx(nm,{...a,...n,ref:s})});wI.displayName=jI;var TH="AlertDialogAction",NI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,a=pi(r);return t.jsx(xf,{...a,...n,ref:s})});NI.displayName=TH;var kI="AlertDialogCancel",SI=m.forwardRef((e,s)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=CH(kI,r),i=pi(r),o=lt(s,a);return t.jsx(xf,{...i,...n,ref:o})});SI.displayName=kI;var AH=({contentRef:e})=>{const s=`\`${rc}\` requires a description for the component to be accessible for screen reader users.
639
640You can add a description to the \`${rc}\` by passing a \`${jI}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
641
642Alternatively, 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 \`${rc}\`. 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.
643
644For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(s)},[s,e]),null},_H=fI,EH=xI,CI=gI,PI=yI,TI=NI,AI=SI,_I=bI,EI=wI;const Kd=_H,IH=EH,II=m.forwardRef(({className:e,...s},r)=>t.jsx(CI,{className:je("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),...s,ref:r}));II.displayName=CI.displayName;const nc=m.forwardRef(({className:e,...s},r)=>t.jsxs(IH,{children:[t.jsx(II,{}),t.jsx(PI,{ref:r,className:je("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),...s})]}));nc.displayName=PI.displayName;const ac=({className:e,...s})=>t.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...s});ac.displayName="AlertDialogHeader";const ic=({className:e,...s})=>t.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});ic.displayName="AlertDialogFooter";const oc=m.forwardRef(({className:e,...s},r)=>t.jsx(_I,{ref:r,className:je("text-lg font-semibold",e),...s}));oc.displayName=_I.displayName;const lc=m.forwardRef(({className:e,...s},r)=>t.jsx(EI,{ref:r,className:je("text-sm text-muted-foreground",e),...s}));lc.displayName=EI.displayName;const cc=m.forwardRef(({className:e,...s},r)=>t.jsx(TI,{ref:r,className:je(gv(),e),...s}));cc.displayName=TI.displayName;const dc=m.forwardRef(({className:e,...s},r)=>t.jsx(AI,{ref:r,className:je(gv({variant:"outline"}),"mt-2 sm:mt-0",e),...s}));dc.displayName=AI.displayName;function MI({open:e,onOpenChange:s,promptType:r,prompt:n,model:a,generationMode:i,numImages:o,audioListId:l,promptId:c,captionPrompt:d}){const{toast:u}=bt(),[h,p]=m.useState(""),[x,v]=m.useState(""),[f,b]=m.useState(""),[y,g]=m.useState(""),[j,N]=m.useState(""),[w,S]=m.useState(!1),[k,P]=m.useState(!1);m.useEffect(()=>{e||(p(""),v(""),b(""),g(""),N(""),P(!1))},[e]);const A=async()=>{if(!r)return;if(r==="response"&&!h.trim()){u({title:"Sample tweet required",description:"Please enter a sample tweet for the AI to respond to.",variant:"destructive"});return}if(!n.trim()){u({title:"Prompt required",description:`Please configure your ${r} prompt before testing.`,variant:"destructive"});return}if(i&&["text-to-image","image-to-image","image-reel","carousel"].includes(i))try{const C=await fetch("/api/user/daily-image-count",{credentials:"include"});if(C.ok){const L=await C.json();if(L.imagesGeneratedLast24h>=L.dailyLimit){const W=L.messages||{},q=W.limit_reached_title||"Daily image limit reached",I=(W.limit_reached_description||"You've used {used} of {limit} images today. Upgrade your plan for more daily image generations, or wait for your limit to reset.").replace("{used}",L.imagesGeneratedLast24h).replace("{limit}",L.dailyLimit),F=I.split("Upgrade"),E=F.length>1?t.jsxs("span",{children:[F[0],t.jsx(me,{href:"/upgrade",className:"underline font-medium hover:text-white",children:"Upgrade"}),F[1]]}):I;u({title:q,description:E,variant:"destructive"});return}}}catch(C){console.error("Failed to check image usage:",C)}S(!0),v(""),b(""),g(""),N("");
644try{const L=await(await Fe("POST","/api/test-prompt",{promptType:r,prompt:n,model:a,sampleTweet:r==="response"?h:void 0,generationMode:i,numImages:o,audioListId:l||void 0,promptId:c,captionPrompt:d})).json();L.deliveryMethod==="image-reel"&&L.videoUrl?(g(L.videoUrl),N(L.deliveryMethod),v(L.content||"")):L.imageUrl?(b(L.imageUrl),v(L.fullPrompt||L.imagePrompt||L.content||"")):v(L.content||"No content generated"),u({title:"Test successful",description:`${O()} generated successfully`})}catch(C){u({title:"Test failed",description:C.message||"Failed to generate test content",variant:"destructive"})}finally{S(!1)}},$=async()=>{await navigator.clipboard.writeText(x),P(!0),u({title:"Copied",description:"Generated content copied to clipboard"}),setTimeout(()=>P(!1),2e3)},_=()=>{p(""),v(""),s(!1)},O=()=>{switch(r){case"poll":return"Poll";case"tip":return"Tip";case"image":return"Image";case"response":return"X/Twitter Reply";default:return""}};return t.jsx(Ut,{open:e,onOpenChange:_,children:t.jsxs(Ht,{className:"max-w-2xl max-h-[80vh] overflow-y-auto","data-testid":"dialog-test-prompt",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-2",children:["Test ",O()," Prompt"]}),t.jsxs(Ns,{children:["Generate a test ",O().toLowerCase()," to preview how your AI prompt works.",r==="response"&&" Enter a sample tweet for the AI to respond to."]})]}),t.jsxs("div",{className:"space-y-4",children:[r==="response"&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"sample-tweet",children:"Sample Tweet"}),t.jsx(os,{id:"sample-tweet",placeholder:"Enter a sample tweet for the AI to respond to...",value:h,onChange:M=>p(M.target.value),className:"min-h-[100px]","data-testid":"textarea-sample-tweet"})]}),t.jsx("div",{className:"flex justify-end",children:t.jsx(T,{onClick:A,disabled:w,className:"gap-2","data-testid":"button-generate-test",children:w?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):"Generate Test Content"})}),(x||f||y)&&t.jsx("div",{className:"space-y-4",children:i==="image-reel"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Generated Video Reel"}),y?t.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-muted/30",children:t.jsx("video",{src:ft(y),controls:!0,className:"w-full h-auto","data-testid":"video-generated-reel",preload:"metadata",children:"Your browser does not support the video tag."})}):t.jsx("div",{className:"p-4 rounded-lg border border-border bg-muted/30 text-sm text-muted-foreground",children:"Video generation failed or not yet available"})]}),x&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Video Caption"}),t.jsx("div",{className:"p-4 rounded-lg border border-border bg-muted/30 text-sm text-muted-foreground whitespace-pre-wrap max-h-[300px] overflow-y-auto",children:x})]})]}):i&&(i.includes("image")||i==="carousel")?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Generated Image"}),f?t.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-muted/30",children:t.jsx("img",{src:ft(f),alt:"Generated content",className:"w-full h-auto","data-testid":"img-generated-image"})}):t.jsx("div",{className:"p-4 rounded-lg border border-border bg-muted/30 text-sm text-muted-foreground",children:"Image generation failed or not yet available"})]}),x&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Image Prompt/Caption"}),t.jsx("div",{className:"p-4 rounded-lg border border-border bg-muted/30 text-sm text-muted-foreground whitespace-pre-wrap max-h-[300px] overflow-y-auto",children:x})]})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(ae,{children:["Generated ",O()]}),t.jsx(T,{variant:"outline",size:"sm",onClick:$,className:"gap-1.5","data-testid":"button-copy-content",children:k?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-3.5 w-3.5"}),"Copied"]}):t.jsxs(t.Fragment,{children:[t.jsx(xa,{className:"h-3.5 w-3.5"}),"Copy"]})})]}),t.jsx("div",{className:"p-4 rounded-lg border border-border bg-card shadow-sm","data-testid":"div-generated-content",children:t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx("div",{className:"whitespace-pre-wrap text-foreground",children:x})})})]})})]})]})})}const MH=Cn({name:Pt().min(1,"List name is required"),items:Cf(Cn({value:Pt().min(1,"Item cannot be empty")})).min(1,"At least one item is required")});function RH({open:e,onOpenChange:s,listName:r="",existingItems:n=[],initialMediaType:a=null,onSave:i}){const{toast:o}=bt(),[l,c]=m.useState("manual"),[d,u]=m.useState(""),[h,p]=m.useState(""),[x,v]=m.useState(!1),[f,b]=m.useState(!1),[y,g]=m.useState(null),[j,N]=m.useState(["Video","Image","Audio"]),[w,S]=m.useState(new Set),[k,P]=m.useState(null),A=Nf({resolver:kf(MH),defaultValues:{name:r,items:n.length>0?n.map(X=>({value:X})):[{value:""}]}}),{fields:$,append:_,remove:O,move:M}=nU({control:A.control,name:"items"}),{data:C=[],isLoading:L}=Ee({queryKey:["/api/vidmonkey/videos"],enabled:e&&l==="media"});m.useEffect(()=>{e&&(A.reset({name:r,items:n.length>0?n.map(X=>({value:X})):[{value:""}]}),u(""),p(""),c("manual"),a&&n.length>0?N([a]):N(["Video","Image","Audio"]),P(null),S(new Set))},[e,r,n,a,A]);const W=()=>{_({value:""})},q=X=>{$.length>1?O(X):o({title:"Cannot remove",description:"List must have at least one item",variant:"destructive"})},I=(X,se)=>{g(se),X.dataTransfer.effectAllowed="move",X.dataTransfer.setData("text/plain","")},F=(X,se)=>{X.preventDefault(),!(y===null||y===se)&&(M(y,se),g(se))},E=()=>{g(null)},ne=X=>{const se=X;if(c(se),se==="csv"){const te=A.watch("items").map(R=>R.value.trim()).filter(R=>R.length>0);if(te.length>0){const R=te.map(K=>K.includes(",")||K.includes(`
645`)||K.includes('"')?`"${K.replace(/"/g,'""')}"`:K).join(`,
646`);u(R)}else u("")}},U=X=>{if(k!==null){o({title:"Media type locked",description:`Deselect all items to change filter. Currently locked to ${k}.`,variant:"destructive"});return}N(se=>
646se.includes(X)?se.length===1?se:se.filter(te=>te!==X):[...se,X])},Ae=X=>{const se=C.find(R=>R.id===X);if(!se)return;const te=se.content_type||"Video";S(R=>{const K=new Set(R);if(K.has(X))K.delete(X),K.size===0&&(P(null),N(["Video","Image","Audio"]));else{if(k===null)P(te),N([te]);else if(te!==k)return o({title:"Mixed media types not allowed",description:`This list is locked to ${k} only. Deselect all items to change media type.`,variant:"destructive"}),R;K.add(X)}return K})},G=()=>{if(w.size===0){o({title:"No items selected",description:"Please select at least one media item",variant:"destructive"});return}const X=A.watch("items").map(te=>te.value.trim()).filter(te=>te.length>0);if(X.length>0&&!window.confirm(`This will replace your current list of ${X.length} item${X.length>1?"s":""}. Continue?`))return;const se=C.filter(te=>w.has(te.id)).map(te=>te.media_url);A.setValue("items",se.map(te=>({value:te}))),c("manual"),S(new Set)},Q=()=>{if(!d.trim()){o({title:"CSV input required",description:"Please enter comma-separated values",variant:"destructive"});return}const X=[];let se="",te=!1;for(let K=0;K<d.length;K++){const ve=d[K],Ie=d[K+1];if(ve==='"')te&&Ie==='"'?(se+='"',K++):te=!te;else if(ve===","&&!te){const dt=se.trim();dt&&X.push(dt),se=""}else if(ve===`
647`&&!te){const dt=se.trim();dt&&X.push(dt),se=""}else se+=ve}const R=se.trim();if(R&&X.push(R),X.length===0){o({title:"No items found",description:"Could not parse any items from CSV input",variant:"destructive"});return}A.setValue("items",X.map(K=>({value:K}))),c("manual")},ye=async()=>{if(!h.trim()){o({title:"Prompt required",description:"Please enter a prompt for AI to generate your list",variant:"destructive"});return}const X=A.watch("items").filter(se=>se.value.trim());if(!(X.length>0&&!window.confirm(`This will replace your current list of ${X.length} item${X.length>1?"s":""}. Continue?`))){v(!0);try{const se=await fetch("/api/item-lists/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({prompt:h})});if(!se.ok){const K=await se.json();throw new Error(K.message||"Failed to generate list")}const R=(await se.json()).items||[];if(R.length===0){o({title:"No items generated",description:"AI did not generate any items. Try rephrasing your prompt.",variant:"destructive"});return}A.setValue("items",R.map(K=>({value:K}))),o({title:"List generated",description:`Generated ${R.length} item${R.length>1?"s":""}. Review and save when ready.`}),c("manual")}catch(se){o({title:"Generation failed",description:se.message||"Failed to generate list with AI",variant:"destructive"})}finally{v(!1)}}},le=async X=>{b(!0);try{const se=X.items.map(Ie=>Ie.value.trim()).filter(Ie=>Ie.length>0);if(se.length===0){o({title:"No items to save",description:"Please add at least one item to the list",variant:"destructive"}),b(!1);return}const te={[X.name]:se},R=k||a;R&&(te.MediaType=R);const K=JSON.stringify(te,null,2);await i(X.name,K);const ve=k?` (${k})`:"";o({title:"List saved",description:`${X.name}${ve} saved with ${se.length} item${se.length>1?"s":""}`}),s(!1)}catch(se){o({title:"Save failed",description:se.message||"Failed to save list",variant:"destructive"})}finally{b(!1)}},J=()=>{s(!1)};return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-[min(100vw-1.5rem,48rem)] sm:max-w-4xl w-full h-[85vh] p-4 sm:p-6 flex flex-col","data-testid":"dialog-item-list-editor",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:r?`Edit List: ${r}`:"Create New List"}),t.jsx(Ns,{children:"Build your list using manual entry, comma-separated values, media library, or AI generation"})]}),t.jsxs("form",{onSubmit:A.handleSubmit(le),className:"flex-1 flex flex-col gap-4 sm:gap-6 min-h-0",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"list-name",children:"List Name"}),t.jsx(Ke,{id:"list-name",placeholder:"e.g., Quotes, Image_Prompts, Tips","data-testid":"input-list-name",...A.register("name")}),A.formState.errors.name&&t.jsx("p",{className:"text-sm text-destructive",children:A.formState.errors.name.message})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"input-mode",children:"Input Method"}),t.jsxs(Nt,{value:l,onValueChange:ne,children:[t.jsx(gt,{id:"input-mode","data-testid":"select-input-mode",className:"h-auto py-3",children:t.jsx(kt,{placeholder:"Select input method"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"manual","data-testid":"option-input-mode-manual",className:"py-3",children:t.jsxs("div",{className:"flex flex-col gap-0.5 items-start text-left",children:[t.jsx("div",{className:"font-medium",children:"Manual Entry"}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Add and edit items one by one"})]})}),t.jsx(Se,{value:"csv","data-testid":"option-input-mode-csv",className:"py-3",children:t.jsxs("div",{className:"flex flex-col gap-0.5 items-start text-left",children:[t.jsx("div",{className:"font-medium",children:"Comma Separated"}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Paste comma-separated values"})]})}),t.jsx(Se,{value:"media","data-testid":"option-input-mode-media",className:"py-3",children:t.jsxs("div",{className:"flex flex-col gap-0.5 items-start text-left",children:[t.jsx("div",{className:"font-medium",children:"Media Library"}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Select from uploaded media"})]})}),t.jsx(Se,{value:"ai","data-testid":"option-input-mode-ai",className:"py-3",children:t.jsxs("div",{className:"flex flex-col gap-0.5 items-start text-left",children:[t.jsx("div",{className:"font-medium",children:"AI Generated"}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Generate items with AI"})]})})]})]})]}),l==="manual"&&t.jsxs("div",{className:"flex-1 flex flex-col gap-4 min-h-0",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(ae,{children:["List Items (",$.length,")"]}),t.jsxs(T,{type:"button",size:"sm",variant:"outline",onClick:W,className:"gap-2","data-testid":"button-add-item",children:[t.jsx(Ds,{className:"h-4 w-4"}),"Add Item"]})]}),t.jsx("div",{className:"space-y-2 flex-1 overflow-y-auto border rounded-lg p-2 sm:p-4",children:$.map((X,se)=>t.jsxs("div",{className:`flex flex-wrap sm:flex-nowrap items-start gap-2 group ${y===se?"opacity-50":""}`,onDragOver:te=>F(te,se),children:[t.jsx("div",{draggable:!0,onDragStart:te=>I(te,se),onDragEnd:E,className:"cursor-move",children:t.jsx(QD,{className:"h-9 w-4 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})}),t.jsx(Ke,{placeholder:`Item ${se+1}`,className:"flex-1 min-w-0","data-testid":`input-item-${se}`,...A.register(`items.${se}.value`)}),t.jsx(T,{type:"button",size:"icon",variant:"ghost",onClick:()=>q(se),className:"shrink-0 text-destructive hover:text-destructive","data-testid":`button-remove-item-${se}`,children:t.jsx(ni,{className:"h-4 w-4"})})]},X.id))}),A.formState.errors.items&&t.jsx("p",{className:"text-sm text-destructive",children:A.formState.errors.items.message}),t.jsxs("div",{className:"flex justify-end gap-3 pt-2 border-t",children:[t.jsx(T,{type:"button",variant:"outline",onClick:J,disabled:f,"data-testid":"button-cancel",children:"Cancel"}),t.jsx(T,{type:"submit",disabled:f,"data-testid":"button-save",children:f?"
647Saving...":"Save List"})]})]}),l==="csv"&&t.jsxs("div",{className:"flex-1 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[t.jsx(ae,{htmlFor:"csv-input",children:"Enter comma-separated values"}),t.jsx(os,{id:"csv-input",placeholder:'e.g., "First item", "Second item, with comma", "Third item"',value:d,onChange:X=>u(X.target.value),className:"flex-1 font-mono text-sm resize-none","data-testid":"textarea-csv-input"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Tip: Use quotes around items that contain commas"})]}),t.jsx(T,{type:"button",onClick:Q,className:"w-full","data-testid":"button-parse-csv",children:"Update List from CSV"})]}),l==="media"&&t.jsxs("div",{className:"flex-1 flex flex-col gap-4 min-h-0",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(ae,{children:"Filter by Content Type"}),k&&t.jsxs(xe,{variant:"secondary",className:"gap-1.5",children:[t.jsx(Xt,{className:"w-3 h-3"}),"Locked to ",k]})]}),t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ka,{id:"filter-video",checked:j.includes("Video"),onCheckedChange:()=>U("Video"),"data-testid":"checkbox-filter-video"}),t.jsxs(ae,{htmlFor:"filter-video",className:"flex items-center gap-1.5 cursor-pointer font-normal",children:[t.jsx(Xr,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"}),"Video"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ka,{id:"filter-image",checked:j.includes("Image"),onCheckedChange:()=>U("Image"),"data-testid":"checkbox-filter-image"}),t.jsxs(ae,{htmlFor:"filter-image",className:"flex items-center gap-1.5 cursor-pointer font-normal",children:[t.jsx(Ft,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),"Image"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ka,{id:"filter-audio",checked:j.includes("Audio"),onCheckedChange:()=>U("Audio"),"data-testid":"checkbox-filter-audio"}),t.jsxs(ae,{htmlFor:"filter-audio",className:"flex items-center gap-1.5 cursor-pointer font-normal",children:[t.jsx(pu,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"}),"Audio"]})]})]})]}),L?t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-muted-foreground",children:"Loading media library..."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex-1 border rounded-lg p-4 overflow-y-auto",children:(()=>{const X=C.filter(se=>se.content_type&&j.includes(se.content_type));return X.length===0?t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-muted-foreground",children:"No media items found"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:C.length===0?"Upload media in the Media Library to get started":"Try adjusting your content type filters"})]})}):t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:X.map(se=>{const te=w.has(se.id);return t.jsxs("div",{className:`relative border rounded-lg overflow-hidden cursor-pointer transition-all hover-elevate ${te?"ring-2 ring-primary":""}`,onClick:()=>Ae(se.id),"data-testid":`media-item-${se.id}`,children:[t.jsxs("div",{className:"aspect-video bg-muted flex items-center justify-center relative",children:[se.content_type==="Video"&&t.jsx("video",{src:ft(se.media_url),className:"w-full h-full object-cover",preload:"metadata"}),se.content_type==="Image"&&t.jsx("img",{src:ft(se.media_url),alt:se.generated_title,className:"w-full h-full object-cover"}),se.content_type==="Audio"&&t.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-purple-100 to-purple-200 dark:from-purple-900/20 dark:to-purple-800/20",children:t.jsx(pu,{className:"w-8 h-8 text-purple-600 dark:text-purple-400"})}),te&&t.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:t.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center",children:t.jsx(Xt,{className:"w-5 h-5 text-primary-foreground"})})}),t.jsx(xe,{variant:"outline",className:`absolute top-2 right-2 text-xs ${se.content_type==="Video"?"bg-blue-500/20 text-blue-500 border-blue-500/30":se.content_type==="Image"?"bg-green-500/20 text-green-500 border-green-500/30":"bg-purple-500/20 text-purple-500 border-purple-500/30"}`,children:se.content_type})]}),t.jsx("div",{className:"p-2",children:t.jsx("p",{className:"text-xs font-medium line-clamp-2",title:se.generated_title,children:se.generated_title})})]},se.id)})})})()}),t.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:[w.size," item",w.size!==1?"s":""," selected"]}),t.jsxs(T,{type:"button",onClick:G,disabled:w.size===0,"data-testid":"button-add-selected-media",children:[t.jsx(Ds,{className:"w-4 h-4 mr-2"}),"Add Selected to List"]})]})]})]}),l==="ai"&&t.jsxs("div",{className:"flex-1 flex flex-col gap-4 min-h-0",children:[t.jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[t.jsx(ae,{htmlFor:"ai-prompt",children:"Describe what you want in the list"}),t.jsx(os,{id:"ai-prompt",placeholder:'e.g., "Give me a list of 24 colors", "Create 10 motivational quotes", "List 15 blog post ideas about AI"',value:h,onChange:X=>p(X.target.value),className:"flex-1 font-mono text-sm resize-none","data-testid":"textarea-ai-prompt"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"The AI will generate a list based on your description"})]}),t.jsx(T,{type:"button",onClick:ye,disabled:x,className:"w-full","data-testid":"button-generate-ai",children:x?"Generating...":"Generate List with AI"})]})]})]})})}var gb="Collapsible",[FH,JQ]=Ws(gb),[DH,yb]=FH(gb),RI=m.forwardRef((e,s)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c=!1,d]=bn({prop:n,defaultProp:a,onChange:o});return t.jsx(DH,{scope:r,disabled:i,contentId:xn(),open:c,onOpenToggle:m.useCallback(()=>d(u=>!u),[d]),children:t.jsx(Ge.div,{"data-state":bb(c),"data-disabled":i?"":void 0,...l,ref:s})})});RI.displayName=gb;var FI="CollapsibleTrigger",DI=m.forwardRef((e,s)=>{const{__scopeCollapsible:r,...n}=e,a=yb(FI,r);return t.jsx(Ge.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":bb(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:s,onClick:Ce(e.onClick,a.onOpenToggle)})});DI.displayName=FI;var vb="CollapsibleContent",LI=m.forwardRef((e,s)=>{const{forceMount:r,...n}=e,a=yb(vb,e.__scopeCollapsible);return t.jsx(Ks,{present:r||a.open,children:({present:i})=>t.jsx(LH,{...n,ref:s,present:i})})});LI.displayName=vb;var LH=m.forwardRef((e,s)=>{const{__scopeCollapsible:r,present:n,children:a,...i}=e,o=yb(vb,r),[l,c]=m.useState(n),d=m.useRef(null),u=lt(s,d),h=m.useRef(0),p=h.current,x=m.useRef(0),v=x.current,f=o.open||l,b=m.useRef(f),y=m.useRef(void 0);return m.useEffect(()=>{const g=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(g)},[]),qs(()=>{const g=d.current;if(g){y.current=y.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const j=g.getBoundingClientRect();h.current=j.height,x.current=j.width,b.current||(g.style.transitionDuration=y.current.transitionDuration,g.style.animationName=y.current.animationName),c(n)}},[o.open,n]),t.jsx(Ge.div,{"data-state":bb(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:f&&a})});function bb(e){return e?"open":"closed"}var OH=RI;const OI=OH,$I=DI,zI=LI,$H="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACxklEQVR4nO2Wz2scdRjGP+87s9kkqBVCKEIFIb15kSoqVKVVPAheDGT9C+zBmxcRPWx7LnrqxaOIiUxNobb0ZO2CqJF6ElQQGwLiKf420M3OfN/Hw2xrQ7KbzdJShTxzGV5m3vd533ne5zuwj338r9GW05bfbRrb0ZYj2Z0roLrrbKl8LivKZ2+NbZnICCTysQh0cCDCfR6RgE/p4EhgFr5YvZKn7POe2Xe05ZyyuL0E1lH/bg6jAuAHjHWMD3VEE5wuq7jMol4l5xeQgWmnVOMJqEXdkXEYOAzACap7r3O/W/qABge4z+fN4zValigG19k7gRvf+P2NBzA/BP4ghWYB/l7l97DsKL34mb/ijL73NymU0bJ0ewhIxhM0wOT55DNM0WSK6SxVT2MmHmWSlv3m3Tgh/DSnLPj25I6jH7Wgc0U5hbItil5QZh+lq3ZeYecVtqwVFops2/tXlO/mE3vb1ff+nMmmpx8P99dp+DE2CQRM4fTouKp3UuQrtGx91JQ7E+ivTlaUz0czf4FezGHMgR+iwQEANgkMV50kmMAxoMcG4ieIVSa55l3/OC3Y5UHrOFwDgTAC9a/dOqifSBiBeYUoSdVADxg8gUE4p5lMPBnwBhM8Rbe/jk2ckk8c3k7GVebt11FTDifQlnMM57hVW+LvqmEzfEnOkXrssaIFP3rTbCTjLM4sRocY5oTDcUP5izqYLZcvcUlNCk0A+FL1sl2U7IKUL
647ZXzAFxSc6+H0HANdMgA3HgxZvNzbPAQkEAW2vyM69GjSzdl+Rcg46uTJbaz5Y6LuptC97DYe+xmVDKQ2VmtWqEf+14/VoHdDqO6m5ZtAF9T6BFLVUvGW2BCugYEmHaz3HEJ1GjLeRgj8YeZfSNhGEKxBtRFZ8cbwWgE/lXxWsAarlobKZZxlODWI/oOQjIKbff8u4b/7E/pPvaxB/wDkjs2vYC8I98AAAAASUVORK5CYII=",zH={youtube:{icon:oa,displayName:"YouTube",color:"text-red-600"},x:{icon:js,displayName:"X",color:"text-foreground"},twitter:{icon:js,displayName:"X",color:"text-foreground"},tiktok:{icon:ia,displayName:"TikTok",color:"text-foreground"},instagram:{icon:ra,displayName:"Instagram",color:"text-pink-500"},facebook:{icon:sa,displayName:"Facebook",color:"text-blue-600"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-blue-700"},reddit:{icon:aa,displayName:"Reddit",color:"text-orange-500"},snapchat:{icon:_f,displayName:"Snapchat",color:"text-yellow-400"}},By=e=>zH[e]||{icon:jn,displayName:e.charAt(0).toUpperCase()+e.slice(1),color:"text-muted-foreground"},UH=e=>{const s=e.oauthCredentials;return s!=null&&s.selectedPageName?s.selectedPageName:s!=null&&s.username?`@${s.username}`:e.subreddit?`r/${e.subreddit}`:By(e.platformName).displayName};function VH(e){const s=[];
647switch(e){case"text-to-text":s.push({label:"Text",icon:Ta,variant:"secondary"});break;case"text-to-image":s.push({label:"Image",icon:Ft,variant:"secondary"});break;case"image-to-image":s.push({label:"Image",icon:Ft,variant:"secondary"});break;case"image-reel":s.push({label:"Video",icon:Xr,variant:"secondary"});break;case"carousel":s.push({label:"Image",icon:Ft,variant:"secondary"});break;default:s.push({label:"Text",icon:Ta,variant:"secondary"})}return s}function DN({value:e,onChange:s,leftLabel:r,rightLabel:n,testId:a}){return t.jsxs("div",{className:"inline-flex rounded-full border border-border bg-muted/30 p-0.5","data-testid":a,children:[t.jsx("button",{type:"button",onClick:()=>s(!0),className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${e?"bg-background text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":`${a}-left`,children:r}),t.jsx("button",{type:"button",onClick:()=>s(!1),className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${e?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"}`,"data-testid":`${a}-right`,children:n})]})}function wh({prompt:e,onEdit:s,onDelete:r,onToggleEnabled:n,onToggleAutoApproval:a,onTest:i,platformConfigs:o}){const[l,c]=m.useState(!1),d=VH(e.generationMode),h=e.generationMode==="text-to-text"&&e.textModel?e.textModel.split("/").pop():e.imageModel?e.imageModel.split("/").pop():null;return t.jsxs(re,{className:"hover-elevate",children:[t.jsxs(he,{className:"pb-2",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[t.jsx(pe,{className:"text-base",children:e.descriptionText||"Untitled Prompt"}),d.map((p,x)=>{const v=p.icon;return t.jsxs(xe,{variant:p.variant||"secondary",className:"gap-1",children:[t.jsx(v,{className:"h-3 w-3"}),p.label]},x)})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(T,{size:"icon",variant:"ghost",onClick:()=>i(e),"data-testid":`button-test-prompt-${e.id}`,title:"Test Prompt",children:t.jsx("img",{src:$H,alt:"Test AI",className:"h-7 w-7"})}),t.jsx(T,{size:"icon",variant:"ghost",onClick:()=>s(e),"data-testid":`button-edit-prompt-${e.id}`,children:t.jsx(sf,{className:"h-4 w-4"})}),t.jsx(T,{size:"icon",variant:"ghost",onClick:()=>r(e.id),"data-testid":`button-delete-prompt-${e.id}`,children:t.jsx(ni,{className:"h-4 w-4"})})]})]}),h&&t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-3",children:[t.jsx(DN,{value:e.enabled,onChange:p=>n(e.id,p),leftLabel:"Enabled",rightLabel:"Disabled",testId:`toggle-enabled-${e.id}`}),t.jsx(DN,{value:e.autoApproval,onChange:p=>a(e.id,p),leftLabel:"Auto Approve",rightLabel:"Manual Review",testId:`toggle-approval-${e.id}`})]})]}),t.jsxs(de,{className:"pt-0 space-y-3",children:[t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:e.promptText||"No prompt text configured"}),o&&o.length>0&&t.jsxs(OI,{open:l,onOpenChange:c,children:[t.jsx($I,{asChild:!0,children:t.jsxs(T,{variant:"ghost",size:"sm",className:"h-7 px-2 gap-1.5 text-muted-foreground hover:text-foreground","data-testid":`button-expand-platforms-${e.id}`,children:[t.jsxs("div",{className:"flex items-center gap-1",children:[o.slice(0,5).map((p,x)=>{const v=By(p.platformName),f=v.icon;return t.jsx(f,{className:`h-3.5 w-3.5 ${v.color}`,style:{marginLeft:x>0?"-4px":"0"}},p.id)}),o.length>5&&t.jsxs("span",{className:"text-xs ml-1",children:["+",o.length-5]})]}),t.jsxs("span",{className:"text-xs",children:[o.length," platform",o.length!==1?"s":""]}),l?t.jsx(oP,{className:"h-3.5 w-3.5"}):t.jsx(Pa,{className:"h-3.5 w-3.5"})]})}),t.jsx(zI,{className:"pt-2",children:t.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(p=>{const x=By(p.platformName),v=x.icon,f=UH(p);return t.jsxs(xe,{variant:"outline",className:"flex items-center gap-1.5 text-xs","data-testid":`badge-platform-${p.id}`,children:[t.jsx(v,{className:`h-3 w-3 ${x.color}`}),t.jsx("span",{children:f})]}
647,p.id)})})})]}),(!o||o.length===0)&&t.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(jn,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"All platforms"})]})]})]})}function BH({promptId:e,onRequestPromptId:s,title:r="Reference Images",description:n="Upload images to transform or use as reference for AI generation",emptyStateText:a="No reference images uploaded",emptyStateDescription:i="Upload images to use as reference for AI image generation"}){const{toast:o}=bt(),l=m.useRef(null),{data:c=[],isLoading:d}=Ee({queryKey:["/api/user-prompts",e,"images"],enabled:!!e}),u=ke({mutationFn:async f=>{let b=e;if(!b&&s&&(b=await s()),!b)throw new Error("Cannot upload: No prompt ID available");const y=new FormData;y.append("image",f);const g=await fetch(`/api/user-prompts/${b}/images`,{method:"POST",body:y,credentials:"include"});if(!g.ok){const j=await g.json();throw new Error(j.error||"Failed to upload image")}return g.json()},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts",e,"images"]}),o({title:"Image uploaded",description:"Reference image has been added successfully."}),l.current&&(l.current.value="")},onError:f=>{o({title:"Upload failed",description:f.message||"Failed to upload image. Please try again.",variant:"destructive"})}}),h=ke({mutationFn:async f=>Fe("DELETE",`/api/user-prompts/${e}/images/${f}`),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts",e,"images"]}),o({title:"Image deleted",description:"Reference image has been removed."})},onError:f=>{o({title:"Delete failed",description:f.message||"Failed to delete image. Please try again.",variant:"destructive"})}}),p=f=>{var y;const b=(y=f.target.files)==null?void 0:y[0];if(b){if(!b.type.startsWith("image/")){o({title:"Invalid file type",description:"Please upload an image file (JPG, PNG, etc.)",variant:"destructive"}),l.current&&(l.current.value="");return}if(b.size>10*1024*1024){o({title:"File too large",description:"Image must be less than 10MB",variant:"destructive"}),l.current&&(l.current.value="");return}u.mutate(b)}},x=()=>{var f;(f=l.current)==null||f.click()},v=f=>{confirm("Are you sure you want to delete this reference image?")&&h.mutate(f)};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-medium",children:r}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n})]}),t.jsxs(T,{type:"button",size:"sm",onClick:x,disabled:u.isPending,"data-testid":"button-upload-reference",children:[t.jsx(Js,{className:"w-4 h-4 mr-2"}),u.isPending?"Uploading...":"Upload Image"]}),t.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:p,className:"hidden","data-testid":"input-file-reference"})]}),d?t.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading images..."}):c.length===0?t.jsxs(re,{className:"p-8 text-center",children:[t.jsx(Ft,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:a}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i})]}):t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:c.map(f=>t.jsxs("div",{className:"relative aspect-square","data-testid":`card-reference-image-${f.id}`,style:{position:"relative"},children:[t.jsx("div",{className:"w-full h-full rounded-lg border bg-card overflow-hidden",children:t.jsx("img",{src:ft(f.imageUrl),alt:`Reference ${f.displayOrder}`,className:"w-full h-full object-cover"})}),t.jsx(T,{type:"button",size:"sm",variant:"destructive",style:{position:"absolute",top:"8px",right:"8px",padding:"4px",minHeight:"28px",height:"28px",width:"28px"},onClick:()=>v(f.id),disabled:h.isPending,"data-testid":`button-delete-reference-${f.id}`,children:t.jsx(xr,{className:"w-4 h-4"})})]},f.id))})]})}const Qm={poll:{icon:Mc,label:"Poll",description:"Create engaging polls and questions",color:"text-blue-500",bgColor:"bg-blue-500/10"},tip:{icon:Yo,label:"Tip",description:"Share helpful tips and advice",color:"text-yellow-500",bgColor:"bg-yellow-500/10"}
647,image:{icon:Ft,label:"Image",description:"Generate AI-powered images",color:"text-purple-500",bgColor:"bg-purple-500/10"},response:{icon:Ta,label:"Response",description:"Auto-reply to X.com mentions",color:"text-green-500",bgColor:"bg-green-500/10"}},Yx={"text-post":{icon:mi,label:"Text Post",description:"Generate text-only social media posts",color:"text-blue-500",bgColor:"bg-blue-500/10"},"text-to-image":{icon:Et,label:"Text to Image",description:"Create images from text descriptions",color:"text-purple-500",bgColor:"bg-purple-500/10"},"image-to-image":{icon:Ft,label:"Image to Image",description:"Transform reference images with AI",color:"text-green-500",bgColor:"bg-green-500/10"},"image-reel":{icon:Ju,label:"Image Reel",description:"Create video reels from images",color:"text-orange-500",bgColor:"bg-orange-500/10"},carousel:{icon:qn,label:"Carousel",description:"Multi-image carousel posts",color:"text-pink-500",bgColor:"bg-pink-500/10"}},We={header:{createTitle:e=>`Create ${e} Prompt`,editTitle:e=>`Edit ${e} Prompt`},progressLabels:{step1:"Type",step2:"Settings",step3:"Content",step4:"Review"},navigation:{previous:"Previous",next:"Next",cancel:"Cancel",save:"Save Prompt"},screen1:{promptTitle:{cardTitle:"Prompt Title",cardDescription:"Give this prompt a friendly name to identify it",placeholder:"e.g., 'Motivational Music Tips' or 'Daily Inspiration Posts'"},methodSelection:{heading:"What would you like to generate?"}},screen2:{header:{title:"Configure Settings",description:"Choose your AI models and generation options"},textModel:{cardTitle:"Text AI Model",label:"AI Model"},imageConfig:{cardTitle:"Image Configuration",imageModelLabel:"Image AI Model",numImagesLabel:"Number of Images"},audioConfig:{cardTitle:"Audio Configuration",cardDescription:"Select music for your image reel",audioSourceLabel:"Audio Source *",userListOption:"My Media Lists",freeLibraryOption:"Free Music Library",userListSelectLabel:"Select Audio List *",genreLabel:"Genre",genreAllOption:"All Genres",moodLabel:"Mood",moodAllOption:"All Moods",durationLabel:"Audio Duration (seconds)",durationMin:3,durationMax:12,durationDefault:8},referenceImages:{title:"Reference Images",description:"Upload images to transform or use as reference for AI generation",emptyStateText:"No reference images uploaded",emptyStateDescription:"Upload images to use as reference for AI image generation"}},screen3:{header:{title:"Write Your Content",description:"Create the prompt that AI will use to generate content"},aiPrompt:{label:e=>{switch(e){case"text-post":return"Text Prompt *";case"text-to-image":return"Image Description *";case"image-to-image":return"Transformation Prompt *";case"image-reel":return"Reel Image Prompt *";case"carousel":return"Carousel Prompt *";default:return"AI Prompt *"}},insertButtonLabel:"Insert Item List",noItemsAvailable:"No item lists available",placeholder:e=>{switch(e){case"text-post":return"Write your prompt here. Use {ItemListName} to insert items from your lists.";case"text-to-image":return"Describe the image you want to generate. Use {ItemListName} to add variety from your item lists.";case"image-to-image":return"Describe how to transform the reference image. Use {ItemListName} for creative variations.";case"image-reel":return"Describe the visual style for your reel images. Use {ItemListName} to rotate through themes.";case"carousel":return"Describe the carousel images you want. Use {ItemListName} for variety across images.";default:return"Write your prompt here. Use {ItemListName} to insert items from your lists."}},helpText:e=>e==="text-post"?'The AI will use this prompt to generate your content. Click "Insert Item List" to add placeholders from your item lists.':'The AI will use this prompt to generate images. Click "Insert Item List" to add placeholders that rotate through your lists for variety.'},captionPrompt:{cardTitle:"Caption Prompt",cardTitleOptional:"(Optional)",cardDescription:"Instructions for AI to generate captions for your images. The caption will be automatically formatted and overlaid on the image.",label:"Caption Prompt",insertButtonLabel:"Insert Item List",noItemsAvailable:"No item lists available",placeholder:`Example: {QUOTE}
648Or: Generate an inspirational quote for musicians`,helpText:"Enter a prompt to generate captions with AI, or click 'Insert Item List' to add placeholders from your item lists"}},screen4:{header:{title:"Review Your Prompt",description:"Check everything before saving"},summary:{cardTitle:"Prompt Summary",labels:{contentType:"Content Type",generationMethod:"Generation Method",textModel:"Text Model",imageModel:"Image Model",description:"Description",prompt:"Prompt"}}}};function UI({open:e,onClose:s,onSave:r,prompt:n,promptType:a,textModels:i,imageModels:o,itemLists:l,initialPromptText:c="",platformConfigs:d=[],existingPlatformConfigIds:u=[]}){var qe,wt;const[h,p]=m.useState(1),[x,v]=m.useState(null),[f,b]=m.useState(""),[y,g]=m.useState(""),[j,N]=m.useState("openrouter/meta-llama/llama-3.3-70b-instruct:free"),[w,S]=m.useState("fal-ai/flux/dev"),[k,P]=m.useState(1),[A,$]=m.useState(u),[_,O]=m.useState("user_list"),[M,C]=m.useState(null),[L,W]=m.useState(null),[q,I]=m.useState(null),[F,E]=m.useState(We.screen2.audioConfig.durationDefault),[ne,U]=m.useState(""),[Ae,G]=m.useState(!1),[Q,ye]=m.useState(""),[le,J]=m.useState(null),{data:X}=Ee({queryKey:["/api/music/genres-moods"],enabled:x==="image-reel"}),{data:se=[]}=Ee({queryKey:["/api/user-prompts/v2/reserved-platform-configs",a,n==null?void 0:n.id],queryFn:async()=>
648{if(!a)return[];const Y=n!=null&&n.id?`/api/user-prompts/v2/reserved-platform-configs/${a}?excludePromptId=${n.id}`:`/api/user-prompts/v2/reserved-platform-configs/${a}`,xt=await fetch(Y);if(!xt.ok)throw new Error("Failed to fetch reserved configs");return xt.json()},enabled:e&&!!a}),te=(n==null?void 0:n.id)||le,{data:R=[]}=Ee({queryKey:["/api/user-prompts",te,"images"],enabled:!!te&&x==="image-reel"}),K=m.useMemo(()=>R.length>0,[R]),ve=ke({mutationFn:async()=>{if(!x||!a)throw new Error("Cannot create draft: missing type or method");const Y=jt(x),Tn=(await(await fetch("/api/user-prompts/v2")).json()).filter(rn=>rn.promptType===a).reduce((rn,la)=>Math.max(rn,la.displayOrder||0),0)+1,An={promptType:a,descriptionText:f.trim()||"Draft prompt",promptText:y.trim()||"Draft",textModel:x==="text-post"?j:null,imageEnabled:Y.imageEnabled,imageModel:Y.imageEnabled?w:null,generationMode:Y.generationMode,numImages:x==="image-reel"?k:null,audioSource:x==="image-reel"?_:null,audioListId:x==="image-reel"&&_==="user_list"?M:null,freeLibraryGenre:x==="image-reel"&&_==="free_library"?L:null,freeLibraryMood:x==="image-reel"&&_==="free_library"?q:null,freeLibraryDuration:x==="image-reel"&&_==="free_library"?F:null,captionPrompt:ne.trim()||null,enabled:!1,displayOrder:Tn};return(await Fe("POST","/api/user-prompts/v2",An)).json()},onSuccess:Y=>{J(Y.id)}}),Ie=ke({mutationFn:async({id:Y,data:xt})=>(await Fe("PATCH",`/api/user-prompts/v2/${Y}`,xt)).json(),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]})}}),dt=async()=>n!=null&&n.id?n.id:le||(await ve.mutateAsync()).id,jt=Y=>{if(!Y)return{imageEnabled:!1,generationMode:"text-to-text"};switch(Y){case"text-post":return{imageEnabled:!1,generationMode:"text-to-text"};case"text-to-image":return{imageEnabled:!0,generationMode:"text-to-image"};case"image-to-image":return{imageEnabled:!0,generationMode:"image-to-image"};case"image-reel":return{imageEnabled:!0,generationMode:"image-reel"};case"carousel":return{imageEnabled:!0,generationMode:"carousel"};default:return{imageEnabled:!1,generationMode:"text-to-text"}}},Ss=Y=>Y==="text-to-text"?"text-post":Y==="text-to-image"?"text-to-image":Y==="image-to-image"?"image-to-image":Y==="image-reel"?"image-reel":Y==="carousel"?"carousel":"text-post";m.useEffect(()=>{if(e)if(n){const Y=Ss(n.generationMode||"text-to-text");v(Y),b(n.descriptionText||""),g(n.promptText||""),N(n.textModel||"openrouter/meta-llama/llama-3.3-70b-instruct:free"),S(n.imageModel||"fal-ai/flux/dev"),P(n.numImages||1),O(n.audioSource||"user_list"),C(n.audioListId||null),W(n.freeLibraryGenre||null),I(n.freeLibraryMood||null),E(n.freeLibraryDuration||We.screen2.audioConfig.durationDefault),U(n.captionPrompt||""),G(n.enableNewsSearch||!1),ye(n.tavilyApiKey||""),$(u),p(1),J(null)}else v(null),b(""),g(c),N("openrouter/meta-llama/llama-3.3-70b-instruct:free"),S("fal-ai/flux/dev"),P(1),O("user_list"),C(null),W(null),I(null),E(We.screen2.audioConfig.durationDefault),U(""),G(!1),ye(""),$(u),p(1),J(null);else J(null)},[n,e,c,u]),m.useEffect(()=>{if(x!=="image-reel")return;const Y=w.includes("/edit");!K&&Y?S("fal-ai/nano-banana"):K&&!Y&&S("fal-ai/nano-banana/edit")},[K,x,w]);const Mt=async()=>{if(!x||!a)return;const Y=jt(x),xt={promptType:a,descriptionText:f.trim()||null,promptText:y.trim(),textModel:x==="text-post"?j:null,imageEnabled:Y.imageEnabled,imageModel:Y.imageEnabled?w:null,generationMode:Y.generationMode,numImages:x==="image-reel"?k:null,audioSource:x==="image-reel"?_:null,audioListId:x==="image-reel"&&_==="user_list"?M:null,freeLibraryGenre:x==="image-reel"&&_==="free_library"?L:null,freeLibraryMood:x==="image-reel"&&_==="free_library"?q:null,freeLibraryDuration:x==="image-reel"&&_==="free_library"?F:null,captionPrompt:ne.trim()||null,enableNewsSearch:a==="response"?Ae:!1,tavilyApiKey:a==="response"&&Ae?Q.trim():null,enabled:!1,selectedPlatformConfigIds:A};le?(await Ie.mutateAsync({id:le,data:xt}),s()):(r(xt),s())},Cs=x!==null,Zt=jt(x),D=(x==="text-post"?j:!0)&&(!Zt.imageEnabled||w),Z=y.trim().length>0,ie=A.length>0,Re=Z&&ie,Pe=()=>{h<4&&p(h+1)},fe=()=>{h>1&&p(h-1)},De=Y=>{v(Y),Y==="text-to-image"?S("fal-ai/nano-banana"):Y==="image-to-image"?S("fal-ai/nano-banana/edit"):Y==="image-reel"&&S(K?"fal-ai/nano-banana/edit":"fal-ai/nano-banana")},ce=Y=>{const xt=Y?`{${Y}}`:"{ITEM}";g(ys=>ys+xt)},$e=Y=>{const xt=Y?`{${Y}}`:"{ITEM}";U(ys=>ys+xt)};return l.filter(Y=>Y.mediaType==="Audio"),t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-4xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsxs("div",{className:"px-6 pt-6 pb-4 border-b",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-4",children:n?We.header.editTitle(a?Qm[a].label:""):We.header.createTitle(a?Qm[a].label:"New")}),t.jsx("div",{className:"flex items-center justify-between",children:[1,2,3,4].map((Y,xt)=>t.jsxs("div",{className:"flex items-center flex-1",children:[t.jsxs("div",{className:"flex flex-col items-center flex-1",children:[t.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center font-semibold transition-all ${Y<h?"bg-primary text-primary-foreground":Y===h?"bg-primary text-primary-foreground ring-4 ring-primary/20":"bg-muted text-muted-foreground"}`,children:Y<h?t.jsx(Xt,{className:"w-5 h-5"}):Y}),t.jsxs("span",{className:`text-xs mt-2 font-medium ${Y===h?"text-foreground":"text-muted-foreground"}`,children:[Y===1&&We.progressLabels.step1,Y===2&&We.progressLabels.step2,Y===3&&We.progressLabels.step3,Y===4&&We.progressLabels.step4]})]}),xt<3&&t.jsx(rp,{className:`flex-1 h-0.5 mx-2 ${Y<h?"bg-primary":"bg-muted"}`})]},Y))})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:[h===1&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsx(pe,{className:"text-base",children:We.screen1.promptTitle.cardTitle}),t.jsx(Ze,{className:"text-xs",children:We.screen1.promptTitle.cardDescription})]}),t.jsx(de,{className:"pt-3",children:t.jsx(Ke,{id:"description",placeholder:We.screen1.promptTitle.placeholder,value:f,onChange:Y=>b(Y.target.value),"data-testid":"input-description"})})]}),t.jsx("div",{children:t.jsx("h3",{className:"text-lg font-semibold mb-2",children:We.screen1.methodSelection.heading})}),t.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(Yx).map(([Y,xt])=>{const ys=xt.icon,Qs=x===Y;
648return t.jsx(re,{className:`cursor-pointer transition-all hover-elevate ${Qs?"ring-2 ring-primary":""}`,onClick:()=>De(Y),"data-testid":`card-method-${Y}`,children:t.jsx(he,{className:"p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:`p-2 rounded-lg ${xt.bgColor}`,children:t.jsx(ys,{className:`w-5 h-5 ${xt.color}`})}),t.jsxs("div",{className:"flex-1",children:[t.jsx(pe,{className:"text-sm",children:xt.label}),t.jsx(Ze,{className:"text-xs mt-1",children:xt.description})]}),Qs&&t.jsx(Xt,{className:"w-4 h-4 text-primary"})]})})},Y)})})]}),h===2&&x&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(qn,{className:"w-5 h-5"}),We.screen2.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:We.screen2.header.description})]}),x==="text-post"&&t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsxs(pe,{className:"text-sm flex items-center gap-2",children:[t.jsx(Et,{className:"w-4 h-4"}),We.screen2.textModel.cardTitle]})}),t.jsx(de,{className:"pt-3 space-y-4",children:t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"text-model",children:We.screen2.textModel.label}),t.jsxs(Nt,{value:j,onValueChange:N,children:[t.jsx(gt,{id:"text-model","data-testid":"select-text-model",children:t.jsx(kt,{})}),t.jsx(yt,{children:i.map(Y=>t.jsxs(Se,{value:Y.modelId,children:[Y.displayName," ",Y.isFree&&"(Free)"]},Y.modelId))})]})]})})]}),Zt.imageEnabled&&t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsx(pe,{className:"text-sm",children:We.screen2.imageConfig.cardTitle})}),t.jsxs(de,{className:"pt-3 space-y-4",children:[t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"image-model",children:We.screen2.imageConfig.imageModelLabel}),t.jsxs(Nt,{value:w,onValueChange:S,children:[t.jsx(gt,{id:"image-model","data-testid":"select-image-model",children:t.jsx(kt,{})}),t.jsx(yt,{children:o.filter(Y=>{const xt=Y.modelId.includes("/edit");return x==="text-to-image"?Y.modelId==="fal-ai/nano-banana":x==="image-to-image"?xt:x==="image-reel"?K?xt:Y.modelId==="fal-ai/nano-banana":!0}).map(Y=>t.jsx(Se,{value:Y.modelId,children:Y.displayName},Y.modelId))})]})]}),x==="image-reel"&&t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"num-images",children:We.screen2.imageConfig.numImagesLabel}),t.jsx(Ke,{id:"num-images",type:"number",min:"1",max:"10",value:k,onChange:Y=>P(parseInt(Y.target.value)||1),"data-testid":"input-num-images"})]})]})]}),x==="image-reel"&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsx(pe,{className:"text-sm",children:We.screen2.audioConfig.cardTitle}),t.jsx(Ze,{className:"text-xs",children:We.screen2.audioConfig.cardDescription})]}),t.jsxs(de,{className:"pt-3 space-y-4",children:[t.jsxs("div",{children:[t.jsx(ae,{children:We.screen2.audioConfig.audioSourceLabel}),t.jsxs("div",{className:"flex gap-4 mt-2",children:[t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[t.jsx("input",{type:"radio",name:"audio-source",value:"user_list",checked:_==="user_list",onChange:()=>O("user_list"),"data-testid":"radio-audio-source-user-list"}),t.jsx("span",{children:We.screen2.audioConfig.userListOption})]}),t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[t.jsx("input",{type:"radio",name:"audio-source",value:"free_library",checked:_==="free_library",onChange:()=>O("free_library"),"data-testid":"radio-audio-source-free-library"}),t.jsx("span",{children:We.screen2.audioConfig.freeLibraryOption})]})]})]}),_==="user_list"&&t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"user-audio-list",children:We.screen2.audioConfig.userListSelectLabel}),t.jsxs(Nt,{value:M||"",onValueChange:Y=>C(Y||null),children:[t.jsx(gt,{id:"user-audio-list","data-testid":"select-user-audio-list",children:t.jsx(kt,{placeholder:"Select an audio list"})}),t.jsx(yt,{children:l.filter(Y=>Y.mediaType==="Audio").map(Y=>t.jsx(Se,{value:Y.id,children:Y.name},Y.id))})]})]}),_==="free_library"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"genre",children:We.screen2.audioConfig.genreLabel}),t.jsxs(Nt,{value:L||"all",onValueChange:Y=>W(Y==="all"?null:Y),children:[t.jsx(gt,{id:"genre","data-testid":"select-genre",children:t.jsx(kt,{placeholder:"All Genres"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:We.screen2.audioConfig.genreAllOption}),((X==null?void 0:X.genres)||[]).map(Y=>t.jsx(Se,{value:Y,children:Y},Y))]})]})]}),t.jsxs("div",{children:[t.jsx(ae,{htmlFor:"mood",children:We.screen2.audioConfig.moodLabel}),t.jsxs(Nt,{value:q||"all",onValueChange:Y=>I(Y==="all"?null:Y),children:[t.jsx(gt,{id:"mood","data-testid":"select-mood",children:t.jsx(kt,{placeholder:"All Moods"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:We.screen2.audioConfig.moodAllOption}),((X==null?void 0:X.moods)||[]).map(Y=>t.jsx(Se,{value:Y,children:Y},Y))]})]})]}),t.jsxs("div",{children:[t.jsxs(ae,{htmlFor:"duration",children:[We.screen2.audioConfig.durationLabel,": ",F,"s"]}),t.jsx("input",{id:"duration",type:"range",min:We.screen2.audioConfig.durationMin,max:We.screen2.audioConfig.durationMax,value:F,onChange:Y=>E(parseInt(Y.target.value)),className:"w-full","data-testid":"slider-
648duration"})]})]})]})]}),a==="response"&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsxs(pe,{className:"text-sm flex items-center gap-2",children:[t.jsx(J0,{className:"w-4 h-4"}),"News Search Settings"]}),t.jsx(Ze,{className:"text-xs",children:"Enrich AI responses with relevant news context using Tavily API"})]}),t.jsxs(de,{className:"pt-3 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx(ae,{htmlFor:"enable-news-search",children:"Enable News Search"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Use Tavily API to search for relevant news"})]}),t.jsx(ul,{id:"enable-news-search","data-testid":"switch-enable-news-search",checked:Ae,onCheckedChange:G})]}),Ae&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"tavily-api-key",children:"Tavily API Key"}),t.jsx(Ke,{id:"tavily-api-key","data-testid":"input-tavily-api-key",type:"password",placeholder:"Enter your Tavily API Key",value:Q,onChange:Y=>ye(Y.target.value)}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",t.jsx("a",{href:"https://tavily.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"tavily.com"})]})]})]})]}),(x==="image-to-image"||x==="image-reel")&&t.jsx(re,{children:t.jsx(de,{className:"pt-6",children:t.jsx(BH,{promptId:(n==null?void 0:n.id)||le,onRequestPromptId:dt,title:We.screen2.referenceImages.title,description:We.screen2.referenceImages.description,emptyStateText:We.screen2.referenceImages.emptyStateText,emptyStateDescription:We.screen2.referenceImages.emptyStateDescription})})})]}),h===3&&x&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(mi,{className:"w-5 h-5"}),We.screen3.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:We.screen3.header.description})]}),t.jsx(re,{children:t.jsx(de,{className:"p-4 space-y-4",children:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(ae,{htmlFor:"prompt-text",children:We.screen3.aiPrompt.label(x)}),t.jsxs(rl,{children:[t.jsx(nl,{asChild:!0,children:t.jsxs(T,{type:"button",size:"sm",variant:"outline","data-testid":"button-insert-item",children:[We.screen3.aiPrompt.insertButtonLabel,t.jsx(Pa,{className:"ml-2 h-4 w-4"})]})}),t.jsx(ao,{align:"end",className:"w-56",children:l.length===0?t.jsx(Es,{disabled:!0,children:We.screen3.aiPrompt.noItemsAvailable}):l.map(Y=>t.jsxs(Es,{onClick:()=>ce(Y.name),"data-testid":`menu-item-${Y.name}`,children:[t.jsx("span",{className:"font-mono text-xs mr-2",children:`{${Y.name}}`}),t.jsx("span",{className:"flex-1",children:Y.name})]},Y.id))})]})]}),t.jsx(os,{id:"prompt-text",placeholder:We.screen3.aiPrompt.placeholder(x),value:y,onChange:Y=>g(Y.target.value),rows:9,"data-testid":"input-prompt-text"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:We.screen3.aiPrompt.helpText(x)})]})})}),x!=="text-post"&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsxs(pe,{className:"text-sm",children:[We.screen3.captionPrompt.cardTitle," ",t.jsx("span",{className:"text-muted-foreground",children:We.screen3.captionPrompt.cardTitleOptional})]}),t.jsx(Ze,{className:"text-xs",children:We.screen3.captionPrompt.cardDescription})]}),t.jsx(de,{className:"pt-3",children:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(ae,{htmlFor:"caption-prompt",children:We.screen3.captionPrompt.label}),t.jsxs(rl,{children:[t.jsx(nl,{asChild:!0,children:t.jsxs(T,{type:"button",size:"sm",variant:"outline","data-testid":"button-insert-caption-item",children:[We.screen3.captionPrompt.insertButtonLabel,t.jsx(Pa,{className:"ml-2 h-4 w-4"})]})}),t.jsx(ao,{align:"end",className:"w-56",children:l.length===0?t.jsx(Es,{disabled:!0,children:We.screen3.captionPrompt.noItemsAvailable}):l.map(Y=>t.jsxs(Es,{onClick:()=>$e(Y.name),"data-testid":`menu-caption-item-${Y.name}`,children:[t.jsx("span",{className:"font-mono text-xs mr-2",children:`{${Y.name}}`}),t.jsx("span",{className:"flex-1",children:Y.name})]},Y.id))})]})]}),t.jsx(os,{id:"caption-prompt",placeholder:We.screen3.captionPrompt.placeholder,value:ne,onChange:Y=>U(Y.target.value),rows:3,"data-testid":"input-caption-prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:We.screen3.captionPrompt.helpText})]})})]})]}),h===4&&x&&a&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-lg font-semibold mb-2 flex items-center gap-2",children:[t.jsx(Ju,{className:"w-5 h-5"}),We.screen4.header.title]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:We.screen4.header.description})]}),t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsx(pe,{className:"text-sm",children:We.screen4.summary.cardTitle})}),t.jsxs(de,{className:"pt-3 space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.contentType}),t.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[(()=>{const Y=Qm[a].icon;return t.jsx(Y,{className:"w-4 h-4"})})(),t.jsx("span",{className:"font-medium",children:Qm[a].label})]})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.generationMethod}),t.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[(()=>{const Y=Yx[x].icon;return t.jsx(Y,{className:"w-4 h-4"})})(),t.jsx("span",{className:"font-medium",children:Yx[x].label})]})]}),x==="text-post"&&t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.textModel}
648),t.jsx("p",{className:"font-medium mt-1 text-sm",children:((qe=i.find(Y=>Y.modelId===j))==null?void 0:qe.displayName)||j})]}),Zt.imageEnabled&&t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.imageModel}),t.jsx("p",{className:"font-medium mt-1 text-sm",children:((wt=o.find(Y=>Y.modelId===w))==null?void 0:wt.displayName)||w})]})]}),t.jsx(rp,{}),f&&t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.description}),t.jsx("p",{className:"mt-1",children:f})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:We.screen4.summary.labels.prompt}),t.jsx("div",{className:"mt-1 p-3 bg-muted rounded-lg max-h-40 overflow-y-auto",children:t.jsx("p",{className:"text-sm whitespace-pre-wrap",children:y})})]})]})]}),d.length>0&&t.jsxs(re,{children:[t.jsxs(he,{className:"pb-3",children:[t.jsx(pe,{className:"text-sm",children:a==="response"?"Target Account":"Target Platforms"}),t.jsx(Ze,{className:"text-xs",children:a==="response"?"Select which X.com account will use this response prompt":"Select which connected accounts should receive this content"})]}),t.jsx(de,{className:"pt-3",children:t.jsx(Du,{platformConfigs:d,selectedConfigIds:A,onSelectionChange:$,generationMode:Zt.generationMode,reservedConfigIds:se,singleSelection:a==="response"})})]})]})]}),t.jsxs("div",{className:"px-6 py-4 border-t flex items-center justify-between",children:[t.jsxs(T,{variant:"outline",onClick:fe,disabled:h===1,"data-testid":"button-wizard-prev",children:[t.jsx(Qo,{className:"w-4 h-4 mr-1"}),We.navigation.previous]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(T,{variant:"outline",onClick:s,"data-testid":"button-wizard-cancel",children:We.navigation.cancel}),h<4?t.jsxs(T,{onClick:Pe,disabled:h===1&&!Cs||h===2&&!D||h===3&&!Z,"data-testid":"button-wizard-next",children:[We.navigation.next,t.jsx(Xi,{className:"w-4 h-4 ml-1"})]}):t.jsxs(T,{onClick:Mt,disabled:!Re,"data-testid":"button-wizard-save",children:[t.jsx(Xt,{className:"w-4 h-4 mr-1"}),We.navigation.save]})]})]})]})})}function qH({open:e,onOpenChange:s,platform:r,configId:n}){const{toast:a}=bt(),{data:i,isLoading:o}=Ee({queryKey:[`/api/platform-configs/${r}/available-pages`,n],queryFn:async()=>{const h=n?`/api/platform-configs/${r}/available-pages?configId=${n}`:`/api/platform-configs/${r}/available-pages`,p=await fetch(h,{credentials:"include"});if(!p.ok)throw new Error("Failed to fetch pages");return p.json()},enabled:e}),l=(i==null?void 0:i.availablePages)||[],c=i==null?void 0:i.selectedPageId,d=ke({mutationFn:async h=>await Fe("POST",`/api/platform-configs/${r}/select-page`,{pageId:h,configId:n}),onSuccess:h=>{var p;a({title:"Page selected",description:`Now posting to ${((p=h.selectedPage)==null?void 0:p.pageName)||"selected page"}`}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:[`/api/platform-configs/${r}/available-pages`]}),s(!1)},onError:h=>{a({title:"Failed to select page",description:h.message||"Please try again",variant:"destructive"})}}),u=r==="instagram"?l.filter(h=>"instagramId"in h&&h.instagramId):l;return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-2xl max-h-[80vh] overflow-y-auto","data-testid":"dialog-page-picker",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:r==="instagram"?"Select Instagram Business Account":r==="facebook"?"Select Facebook Page":"Select LinkedIn Page"}),t.jsx(Ns,{children:r==="instagram"?"Choose which Instagram Business Account to post to. Only Facebook Pages with linked Instagram accounts are shown.":r==="facebook"?"Choose which Facebook Page to post to.":"Choose whether to post to your personal profile or an organization page you manage."})]}),o?t.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"Loading available pages..."}):u.length===0?t.jsxs("div",{className:"py-8 text-center space-y-2",children:[t.jsx("p",{className:"text-muted-foreground",children:r==="instagram"?"No Facebook Pages with linked Instagram Business Accounts found.":r==="facebook"?"No Facebook Pages found.":"No LinkedIn pages found."}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r==="instagram"?"Link an Instagram Business Account to a Facebook Page in Meta Business Suite to get started.":r==="facebook"?"Create a Facebook Page in Meta Business Suite to get started.":"Make sure you have admin access to organization pages."})]}):t.jsx("div",{className:"space-y-3",children:u.map(h=>
648{const p=h.pageId===c,x=r==="linkedin",v="pageType"in h,f=v&&h.pageType==="personal",b="instagramId"in h;return t.jsx("button",{onClick:()=>d.mutate(h.pageId),disabled:d.isPending||p,className:`w-full text-left p-4 rounded-lg border-2 transition-all hover-elevate ${p?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,"data-testid":`button-select-page-${h.pageId}`,children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x?f?t.jsx(fr,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}):t.jsx(iP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}):t.jsx(VD,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),t.jsx("span",{className:"font-medium truncate",children:h.pageName}),p&&t.jsx(ot,{className:"h-4 w-4 text-primary flex-shrink-0"})]}),r==="instagram"&&b&&h.instagramUsername&&t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ZD,{className:"h-3 w-3 flex-shrink-0"}),t.jsxs("span",{className:"truncate",children:["@",h.instagramUsername]})]}),x&&v&&t.jsx("div",{className:"text-sm text-muted-foreground",children:h.pageType==="personal"?"Personal Profile":"Organization Page"})]}),!p&&t.jsx(T,{type:"button",variant:"outline",size:"sm",disabled:d.isPending,"data-testid":`button-confirm-select-${h.pageId}`,children:d.isPending?"Selecting...":"Select"})]})},h.pageId)})})]})})}const Xx={instagram:{icon:ra,displayName:"Instagram",color:"text-[#E4405F]",brandBg:"bg-gradient-to-r from-[#833AB4] via-[#E1306C] to-[#FCAF45] hover:opacity-90",brandText:"text-white"},facebook:{icon:sa,displayName:"Facebook",color:"text-[#1877F2]",brandBg:"bg-[#1877F2] hover:bg-[#1877F2]/90",brandText:"text-white"},x:{icon:js,displayName:"X (Twitter)",color:"text-foreground",brandBg:"bg-[#000000] hover:bg-[#000000]/90 dark:bg-white dark:hover:bg-white/90",brandText:"text-white dark:text-black"},linkedin:{icon:na,displayName:"LinkedIn",color:"text-[#0A66C2]",brandBg:"bg-[#0A66C2] hover:bg-[#0A66C2]/90",brandText:"text-white"},tiktok:{icon:ia,displayName:"TikTok",color:"text-[#000000] dark:text-[#FFFFFF]",brandBg:"bg-[#000000] hover:bg-[#000000]/90 dark:bg-[#FFFFFF] dark:hover:bg-[#FFFFFF]/90",brandText:"text-white dark:text-black"},youtube:{icon:oa,displayName:"YouTube",color:"text-[#FF0000]",brandBg:"bg-[#FF0000] hover:bg-[#FF0000]/90",brandText:"text-white"},reddit:{icon:aa,displayName:"Reddit",color:"text-[#FF4500]",brandBg:"bg-[#FF4500] hover:bg-[#FF4500]/90",brandText:"text-white"}},VI=[{value:"6 hours",label:"Every 6 Hours"},{value:"8 hours",label:"Every 8 Hours"},{value:"12 hours",label:"Every 12 Hours"},{value:"1 day",label:"Once Daily"},{value:"1 week",label:"Once Weekly"},{value:"paused",label:"Paused"}],WH=e=>{if(!e)return"paused";const s=e.toLowerCase().trim(),r={daily:"1 day",weekly:"1 week",hourly:"6 hours"};return r[s]?r[s]:VI.map(a=>a.value).includes(s)?s:"paused"};function KH(){const{toast:e}=bt(),[,s]=Ma(),[r,n]=m.useState(!1),[a,i]=m.useState("instagram"),[o,l]=m.useState(void 0),[c,d]=m.useState(!1),[u,h]=m.useState(""),[p,x]=m.useState({}),[v,f]=m.useState(!1),[b,y]=m.useState(void 0),[g,j]=m.useState(void 0),{data:N}=Ee({queryKey:["/api/platform-status"],refetchOnMount:"always",gcTime:3e4}),w=(N==null?void 0:N.platforms)||[],k=((N==null?void 0:N.membershipLevel)||"starter").trim().toLowerCase(),P=["professional","pro","enterprise"].includes(k),A=ke({mutationFn:async({platform:G,configId:Q})=>{const ye=Q?`/api/oauth/${G}/connect?configId=${Q}`:`/api/oauth/${G}/connect`,J=await(await fetch(ye,{credentials:"include"})).json();if(J.authUrl)window.location.href=J.authUrl;else throw new Error(J.error||J.message||"Failed to start OAuth flow")},onError:G=>{e({title:"Connection failed",description:G.message,variant:"destructive"})}}),$=ke({mutationFn:async({platform:G,configId:Q})=>{await Fe("POST",`/api/oauth/${G}/disconnect`,{configId:Q})},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}
648),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),e({title:"Disconnected",description:"Platform disconnected successfully."})},onError:G=>{e({title:"Error",description:G.message,variant:"destructive"})}}),_=ke({mutationFn:async G=>{await Fe("POST","/api/platform-configs/reddit/set-subreddit",{subreddit:G})},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),d(!1),e({title:"Subreddit updated",description:"Your Reddit subreddit has been updated."})},onError:G=>{e({title:"Error",description:G.message,variant:"destructive"})}}),O=ke({mutationFn:async G=>await Fe("PATCH",`/api/platform-configs/${G.configId}/frequency`,{postFrequency:G.postFrequency}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),e({title:"Success",description:"Posting frequency updated"})},onError:()=>{e({title:"Error",description:"Failed to update posting frequency",variant:"destructive"})}}),M=(G,Q)=>{O.mutate({configId:G,postFrequency:Q})},C=()=>{var Q;const G=w.find(ye=>ye.name==="reddit");return!G||G.verifiedAccounts.length===0?null:((Q=G.verifiedAccounts[0])==null?void 0:Q.subreddit)||null},L=(G,Q)=>{G==="x"?(y(Q),f(!0)):A.mutate({platform:G,configId:Q})},W=G=>{x(Q=>({...Q,[G]:!Q[G]}))},q=G=>({facebook:"#1877F2",x:"#000000",linkedin:"#0A66C2",tiktok:"#000000",youtube:"#FF0000",reddit:"#FF4500"})[G]||"#666",I=G=>{const Q=Xx[G.name];if(!Q)return null;const ye=Q.icon,le=G.verifiedAccounts,J=le.length,X=p[G.name]??!1;return t.jsx("div",{className:"rounded-lg border border-border overflow-hidden","data-testid":`platform-section-${G.name}`,children:t.jsxs(OI,{open:X,onOpenChange:()=>W(G.name),children:[t.jsx($I,{asChild:!0,children:t.jsxs("button",{className:"w-full flex items-center justify-between p-4 hover:bg-muted/50 transition-colors","data-testid":`trigger-${G.name}`,children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center ${G.name==="instagram"?"bg-gradient-to-r from-[#833AB4] via-[#E1306C] to-[#FCAF45]":""}`,style:G.name!=="instagram"?{backgroundColor:q(G.name)}:{},children:t.jsx(ye,{className:"w-4 h-4 text-white"})}),t.jsx("span",{className:"font-medium",children:G.displayName}),t.jsxs(xe,{variant:"secondary",className:"text-xs",children:[J," connected"]}),!1]}),t.jsx(Pa,{className:`h-5 w-5 text-muted-foreground transition-transform duration-200 ${X?"rotate-180":""}`})]})}),t.jsx(zI,{children:t.jsxs("div",{className:"border-t border-border",children:[t.jsx("div",{className:"p-4 space-y-3",children:le.map((te,R)=>t.jsxs("div",{className:"flex flex-col gap-3 p-3 rounded-md bg-muted/30","data-testid":`account-item-${G.name}-${R}`,children:[t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"font-medium text-sm truncate",children:te.accountName}),t.jsxs(xe,{variant:"outline",className:"text-emerald-600 border-emerald-600/30 bg-emerald-600/10 text-xs shrink-0",children:[t.jsx(ot,{className:"h-3 w-3 mr-1"}),"Connected"]})]}),t.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 shrink-0",children:[(G.name==="instagram"||G.name==="facebook"||G.name==="linkedin")&&t.jsxs(T,{variant:"outline",size:"icon",className:"sm:w-auto sm:px-3",onClick:K=>{K.stopPropagation(),i(G.name),l(te.configId),n(!0)},"data-testid":`button-manage-${G.name}-${R}`,children:[t.jsx(qn,{className:"h-4 w-4 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:"Manage"})]}),G.name==="reddit"&&t.jsxs(T,{variant:"outline",size:"icon",className:"sm:w-auto sm:px-3",onClick:K=>{K.stopPropagation(),h(C()||""),d(!0)},"data-testid":`button-manage-reddit-${R}`,children:[t.jsx(qn,{className:"h-4 w-4 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:"Manage"})]}),G.name==="x"&&t.jsxs(T,{variant:"outline",size:"icon",className:"sm:w-auto 
648sm:px-3",onClick:async K=>{if(K.stopPropagation(),!te.configId){window.location.href="/x-config";return}try{const Ie=await(await fetch(`/api/x-config/info/${te.configId}`,{credentials:"include"})).json();Ie.success&&Ie.info?(j({configId:Ie.info.configId,apiKey:"",apiSecret:"",accessToken:"",accessTokenSecret:"",username:Ie.info.username||te.accountName}),f(!0)):window.location.href="/x-config"}catch(ve){console.error("Failed to fetch X config info:",ve),window.location.href="/x-config"}},"data-testid":`button-manage-x-${R}`,children:[t.jsx(qn,{className:"h-4 w-4 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:"Manage"})]}),t.jsxs(T,{variant:"destructive",size:"icon",className:"sm:w-auto sm:px-3",onClick:K=>{K.stopPropagation(),$.mutate({platform:G.name,configId:te.configId})},disabled:$.isPending,"data-testid":`button-disconnect-${G.name}-${R}`,children:[t.jsx(xr,{className:"h-4 w-4 sm:mr-1"}),t.jsx("span",{className:"hidden sm:inline",children:"Disconnect"})]})]})]}),te.configId&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ws,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"Post frequency:"}),t.jsxs(Nt,{value:WH(te.postFrequency),onValueChange:K=>M(te.configId,K),disabled:O.isPending,children:[t.jsx(gt,{className:"h-8 w-[160px]","data-testid":`select-frequency-${G.name}-${R}`,children:t.jsx(kt,{})}),t.jsx(yt,{children:VI.map(K=>t.jsx(Se,{value:K.value,"data-testid":`option-${G.name}-${R}-${K.value}`,children:K.label},K.value))})]})]})]},`${G.name}-${te.configId}`))}),t.jsxs("div",{className:"p-4 pt-0 mt-2 flex items-center gap-2",children:[t.jsxs(T,{variant:"ghost",size:"sm",onClick:()=>P&&L(G.name),disabled:!P||A.isPending,"data-testid":`button-add-another-${G.name}`,className:P?"text-primary hover:text-primary/80":"text-muted-foreground",children:[t.jsx(Ds,{className:"h-3 w-3 mr-1"}),"Add another account"]}),!P&&t.jsxs("button",{onClick:()=>s("/upgrade"),className:"flex items-center gap-1 hover:opacity-80 transition-opacity","data-testid":`button-upgrade-${G.name}`,children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Upgrade to"}),t.jsxs(xe,{className:"bg-amber-500 hover:bg-amber-600 text-white text-xs cursor-pointer",children:[t.jsx(tf,{className:"h-3 w-3 mr-1"}),"Pro"]})]})]})]})})]})},G.name)},F=G=>{const Q=Xx[G.name];if(!Q)return null;const ye=Q.icon,le=!1;return t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-border ","data-testid":`platform-section-${G.name}`,children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center ${G.name==="instagram"?"bg-gradient-to-r from-[#833AB4] via-[#E1306C] to-[#FCAF45]":""}`,style:G.name!=="instagram"?{backgroundColor:q(G.name)}:{},children:t.jsx(ye,{className:"w-4 h-4 text-white"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium",children:G.displayName}),le]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"})]})]}),t.jsxs(T,{onClick:()=>L(G.name),disabled:A.isPending||le,"data-testid":`button-connect-${G.name}`,className:`${Q.brandBg} ${Q.brandText} border-0`,children:[t.jsx(ye,{className:"w-4 h-4 mr-2"}),`Connect with ${G.displayName}`]})]},G.name)},E=G=>{const Q=G.disconnectedWithPendingPosts;if(!Q||Q.length===0)return null;const ye=Xx[G.name];if(!ye)return null;const le=ye.icon;return Q.map(J=>t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border-2 border-purple-500/50 bg-purple-500/5","data-testid":`platform-reconnect-${J.configId}`,children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center ${G.name==="instagram"?"bg-gradient-to-r from-[#833AB4] via-[#E1306C] to-[#FCAF45]":""}`,style:G.name!=="instagram"?{backgroundColor:q(G.name)}:{},children:t.jsx(le,{className:"w-4 h-4 text-white"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-medium",children:J.accountName}),t.jsxs("span",{className:"text-sm text-purple-400 flex items-center gap-1",children:[t.jsx(Zh,{className:"h-3 w-3"}),J.pendingPostCount," pending posts need this connection"]})]})]}),t.jsxs(T,{onClick:()=>L(G.name,J.configId),disabled:A.isPending,"data-testid":`button-reconnect-${J.configId}`,className:"bg-purple-600 hover:bg-purple-700 text-white border-0",children:[t.jsx(le,{className:"w-4 h-4 mr-2"}),"Re-Connect"]})]},`reconnect-${J.configId}`))},ne=w.filter(G=>G.hasVerifiedAccounts),U=w.filter(G=>!G.hasVerifiedAccounts),Ae=w.filter(G=>G.disconnectedWithPendingPosts&&G.disconnectedWithPendingPosts.length>0);return t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(e7,{className:"h-5 w-5"}),"Platform Connections"]}),t.jsxs(Ze,{children:["Connect your social media accounts to enable posting.",P&&t.jsx("span",{className:"ml-1 text-amber-500",children:"Pro users can add multiple accounts per platform."})]})]}),t.jsxs(de,{className:"space-y-3",children:[Ae.length>0&&t.jsxs("div",{className:"space-y-2 mb-4",children:[t.jsxs("div",{className:"flex items-center gap-2 text-purple-400 text-sm font-medium",children:[t.jsx(Zh,{className:"h-4 w-4"}),"Needs Reconnection"]}),Ae.map(E)]}),ne.map(I),U.map(F)]})]}),t.jsx(qH,{open:r,onOpenChange:n,platform:a,configId:o}),t.jsx(Ut,{open:c,onOpenChange:d,children:t.jsxs(Ht,{children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Set Subreddit"}),t.jsx(Ns,{children:"Enter the subreddit where you want to post content (without the r/ prefix)."})]}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"subreddit",children:"Subreddit"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-muted-foreground",children:"r/"}),t.jsx(Ke,{id:"subreddit",value:u,onChange:G=>h(G.target.value),placeholder:"example","data-testid":"input-subreddit"})]})]})}),t.jsxs(rd,{children:[t.jsx(T,{variant:"outline",onClick:()=>d(!1),"data-testid":"button-cancel-subreddit",children:"Cancel"}),t.jsx(T,{onClick:()=>_.mutate(u),disabled:_.isPending||!u.trim(),"data-testid":"button-save-subreddit",children:"Save"})]})]})}),t.jsx(SA,{open:v,onOpenChange:G=>{f(G),G||(j(void 0),y(void 0))},onComplete:()=>
648{ee.invalidateQueries({queryKey:["/api/platform-status"]}),ee.invalidateQueries({queryKey:["/api/platform-connections"]}),ee.invalidateQueries({queryKey:["/api/platform-configs"]}),j(void 0),y(void 0)},existingConfig:g,reconnectConfigId:b})]})}const GH={"Auto-Approval-Matrix":{allowedTiers:["professional","enterprise"],description:"Ability to configure auto-approval settings for different content types and platforms"},"Multi-Platform-Posting":{allowedTiers:["trial","starter","professional","enterprise"],description:"Post content to multiple social media platforms"},"AI-Content-Generation":{allowedTiers:["trial","starter","professional","enterprise"],description:"Generate content using AI assistants"},"AI-Schedule-Builder":{allowedTiers:["professional","enterprise"],description:"AI automatically builds and manages your entire posting schedule with smart content rotation"},"Unlimited-Accounts":{allowedTiers:["professional","enterprise"],description:"Connect unlimited accounts per platform"},"Advanced-Analytics":{allowedTiers:["professional","enterprise"],description:"Access to advanced analytics and reporting"},"Priority-Support":{allowedTiers:["professional","enterprise"],description:"Priority customer support with live chat"},"Schedule-Buffer":{allowedTiers:["professional","enterprise"],description:"Configure how many days ahead the scheduler should automatically schedule content"},"Run-Scheduler":{allowedTiers:["professional","enterprise"],description:"Manually trigger the content scheduler to generate posts immediately"},"AI-Prompt-Configuration":{allowedTiers:["professional","enterprise"],description:"Customize AI prompts for generating Polls, Tips, and Images"},"Item-Lists":{allowedTiers:["professional","enterprise"],description:"Create and manage item lists to use in AI prompts"},"Schedule-Horizon":{limits:{trial:14,starter:14,professional:60,enterprise:365},description:"Maximum days in advance you can schedule posts"},"Accounts-Per-Platform":{limits:{trial:1,starter:1,professional:-1,enterprise:-1},description:"Number of accounts allowed per platform (-1 = unlimited)"}};function Ym(e,s){if(!e)return!1;const r=e.toLowerCase(),n=GH[s];return n?n.allowedTiers.includes(r):!1}var jb="Progress",wb=100,[HH,eY]=Ws(jb),[QH,YH]=HH(jb),BI=m.forwardRef((e,s)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=XH,...o}=e;(a||a===0)&&!LN(a)&&console.error(ZH(`${a}`,"Progress"));const l=LN(a)?a:wb;n!==null&&!ON(n,l)&&console.error(JH(`${n}`,"Progress"));const c=ON(n,l)?n:null,d=Ep(c)?i(c,l):void 0;return t.jsx(QH,{scope:r,value:c,max:l,children:t.jsx(Ge.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Ep(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":KI(c,l),"data-value":c??void 0,"data-max":l,...o,ref:s})})});BI.displayName=jb;var qI="ProgressIndicator",WI=m.forwardRef((e,s)=>{const{__scopeProgress:r,...n}=e,a=YH(qI,r);return t.jsx(Ge.div,{"data-state":KI(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:s})});WI.displayName=qI;function XH(e,s){return`${Math.round(e/s*100)}%`}function KI(e,s){return e==null?"indeterminate":e===s?"complete":"loading"}function Ep(e){return typeof e=="number"}function LN(e){return Ep(e)&&!isNaN(e)&&e>0}function ON(e,s){return Ep(e)&&!isNaN(e)&&e<=s&&e>=0}function ZH(e,s){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${s}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${wb}\`.`}function JH(e,s){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${s}\`. The \`value\` prop must be:
649  - a positive number
650  - less than the value passed to \`max\` (or ${wb} if no \`max\` prop is set)
651  - \`null\` or \`undefined\` if the progress is indeterminate.
652
653Defaulting to \`null\`.`}var GI=BI,eQ=WI;const Nb=m.forwardRef(({className:e,value:s,...r},n)=>t.jsx(GI,{ref:n,className:je("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:t.jsx(eQ,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})}));Nb.displayName=GI.displayName;const Nl=[{id:1,label:"Analyzing business for poll topics",type:"poll"},{id:2,label:"Generating poll questions",type:"poll"},{id:3,label:"Creating poll prompt",type:"poll"},{id:4,label:"Researching tips for your niche",type:"tip"},{id:5,label:"Generating tip content ideas",type:"tip"},{id:6,label:"Creating tip prompt",type:"tip"},{id:7,label:"Analyzing visual content opportunities",type:"image"},{id:8,label:"Generating image concepts",type:"image"},{id:9,label:"Creating image prompt",type:"image"}];function tQ({open:e,onOpenChange:s}){const{toast:r}=bt(),[n,a]=m.useState("business-info"),[i,o]=m.useState(""),[l,c]=m.useState(""),[d,u]=m.useState(""),[h,p]=m.useState(""),[x,v]=m.useState(0),[f,b]=m.useState(0),{data:y,isLoading:g}=Ee({queryKey:["/api/user/config"],enabled:e});m.useEffect(()=>{e&&(a("business-info"),v(0),b(0))},[e]),m.useEffect(()=>{if(y){o(y.websiteUrl||y.website_url||""),c(y.promotionText||y.promotion_text||"");const Q=y.nicheKeywords||y.niche_keywords||"";u(Q),p(y.targetAudience||y.target_audience||"")}},[y]);const j=Q=>{if(!Q.trim())return"";try{return JSON.parse(Q),Q}catch{const ye=Q.split(",").map(le=>le.trim()).filter(le=>le);return JSON.stringify(ye)}},N=Q=>{try{const ye=JSON.parse(Q);return Array.isArray(ye)?ye.join(", "):Q}catch{return Q}},w=ke({mutationFn:async Q=>Fe("PUT","/api/user/profile",{websiteUrl:Q.websiteUrl,promotionText:Q.promotionText,nicheKeywords:Q.nicheKeywords,targetAudience:Q.targetAudience}),onSuccess:()=>
653{ee.invalidateQueries({queryKey:["/api/user/config"]}),r({title:"Business info saved",description:"Your business information has been updated."}),a("generate-intro")},onError:()=>{r({title:"Error",description:"Failed to save business information.",variant:"destructive"})}}),S=ke({mutationFn:async()=>{const Q=await fetch("/api/enhance-business-description",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({websiteUrl:i,promotionText:l,nicheKeywords:d,targetAudience:h})});if(!Q.ok){const ye=await Q.json().catch(()=>({}));throw new Error(ye.message||"Failed to enhance")}return Q.json()},onSuccess:Q=>{Q.promotionText&&c(Q.promotionText),Q.nicheKeywords&&u(Q.nicheKeywords),Q.targetAudience&&p(Q.targetAudience),r({title:"Business profile enhanced",description:"AI has analyzed your business and enhanced your profile."})},onError:Q=>{r({title:"Enhancement failed",description:Q.message||"Failed to enhance business description with AI.",variant:"destructive"})}}),k=()=>{const Q=j(d);w.mutate({websiteUrl:i,promotionText:l,nicheKeywords:Q,targetAudience:h})},P=()=>{S.mutate()},[A,$]=m.useState(!1),[_,O]=m.useState(null),[M,C]=m.useState(0),L=m.useRef(null);m.useEffect(()=>{if(A&&n==="generating")return L.current=setInterval(()=>{C(Q=>Q<Nl.length-1?Q+1:Q)},4500),()=>{L.current&&clearInterval(L.current)}},[A,n]);const W=Math.max(M,f),q=async()=>{var Q;a("generating"),v(0),b(0),C(0),$(!0),O(null);try{const ye=await fetch("/api/generate-prompts",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!ye.ok)throw new Error("Failed to start prompt generation");const le=(Q=ye.body)==null?void 0:Q.getReader(),J=new TextDecoder;if(!le)throw new Error("No response body");for(;;){const{done:X,value:se}=await le.read();if(X)break;const R=J.decode(se).split(`
654`);for(const K of R)if(K.startsWith("data: "))try{const ve=JSON.parse(K.slice(6));if(ve.type==="progress")b(ve.step),v(ve.step/Nl.length*100);else if(ve.type==="complete")b(Nl.length),v(100),a("complete"),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),ee.invalidateQueries({queryKey:["/api/item-lists"]}),r({title:"Prompts generated successfully!",description:"Your AI prompts have been created and are ready to use."});else if(ve.type==="error")throw new Error(ve.error||"Generation failed")}catch{}}}catch(ye){O(ye.message||"Failed to generate prompts"),r({title:"Generation failed",description:ye.message||"Failed to generate prompts. Please try again.",variant:"destructive"})}finally{$(!1)}},I=()=>{n==="generate-intro"&&a("business-info")},F=()=>t.jsxs("div",{className:"space-y-5",children:[t.jsx("div",{className:"bg-muted/50 border border-border rounded-lg p-4",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx(hr,{className:"h-5 w-5 text-chart-4 flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{className:"font-medium text-foreground mb-1",children:"Describe your business in detail"}),t.jsx("p",{children:"Describe your business or simply enter your website and let AI figure it out."})]})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"websiteUrl",className:"flex items-center gap-2",children:[t.jsx(jn,{className:"h-4 w-4 text-muted-foreground"}),"Website URL"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{id:"websiteUrl",placeholder:"https://yourwebsite.com",value:i,onChange:Q=>o(Q.target.value),"data-testid":"input-website-url",className:"flex-1"}),t.jsxs(T,{variant:"outline",onClick:P,disabled:S.isPending,className:"gap-2 bg-gradient-to-r from-purple-500/10 to-blue-500/10 border-purple-500/30 hover:border-purple-500/50","data-testid":"button-analyze-business",children:[S.isPending?t.jsx(Qe,{className:"h-4 w-4 animate-spin"}):t.jsx(tv,{className:"h-4 w-4 text-purple-500"}),"Analyze"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"promotionText",className:"flex items-center gap-2",children:[t.jsx(mi,{className:"h-4 w-4 text-muted-foreground"}),"Business Summary"]}),t.jsx(os,{id:"promotionText",placeholder:"Describe your business, products, services, and what makes you unique...",value:l,onCh
654ange:Q=>c(Q.target.value),rows:4,className:"resize-none","data-testid":"input-promotion-text"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"A concise description of your business for social media content generation."})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"nicheKeywords",className:"flex items-center gap-2",children:[t.jsx(yP,{className:"h-4 w-4 text-muted-foreground"}),"Niche Keywords"]}),t.jsx(os,{id:"nicheKeywords",placeholder:'["keyword1", "keyword2", "keyword3"] or comma-separated: keyword1, keyword2, keyword3',value:N(d),onChange:Q=>u(Q.target.value),rows:2,className:"resize-none font-mono text-sm","data-testid":"input-niche-keywords"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Keywords and phrases for AI to target in content. JSON array or comma-separated."})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"targetAudience",className:"flex items-center gap-2",children:[t.jsx(ev,{className:"h-4 w-4 text-muted-foreground"}),"Target Audience"]}),t.jsx(os,{id:"targetAudience",placeholder:"Describe your ideal customers: demographics, interests, pain points, goals...",value:h,onChange:Q=>p(Q.target.value),rows:3,className:"resize-none","data-testid":"input-target-audience"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Who is your content for? The more specific, the better."})]})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx(T,{variant:"outline",onClick:()=>s(!1),"data-testid":"button-cancel-generate-prompts",children:"Cancel"}),t.jsx(T,{onClick:k,disabled:w.isPending,className:"gap-2","data-testid":"button-save-and-continue",children:w.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):t.jsxs(t.Fragment,{children:["Save and Continue",t.jsx(Rr,{className:"h-4 w-4"})]})})]})]}),E=()=>t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-gradient-to-br from-purple-500/10 to-blue-500/10 border border-purple-500/20 rounded-lg p-6",children:t.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[t.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-purple-500 to-blue-500 flex items-center justify-center",children:t.jsx(Aa,{className:"h-8 w-8 text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Generate AI Prompts"}),t.jsxs("p",{className:"text-sm text-muted-foreground max-w-md",children:["Clicking ",t.jsx("strong",{children:"Generate"})," will create customized prompts for all your connected platforms. These prompts will be used to automatically generate engaging social media posts for your business."]})]})]})}),t.jsx("div",{className:"bg-muted/50 border border-border rounded-lg p-4",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Et,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{className:"font-medium text-foreground mb-1",children:"You can edit and refine prompts later"}),t.jsx("p",{children:"After generation, you can review and customize each prompt to fine-tune the content for your specific needs. The AI provides a starting point that you can perfect."})]})]})}),t.jsxs("div",{className:"flex justify-between gap-2 pt-2",children:[t.jsx(T,{variant:"outline",onClick:I,"data-testid":"button-back-to-business-info",children:"Back"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(T,{variant:"outline",onClick:()=>s(!1),"data-testid":"button-cancel-generate",children:"Cancel"}),t.jsxs(T,{onClick:q,className:"gap-2 bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600","data-testid":"button-generate-prompts",children:[t.jsx(Et,{className:"h-4 w-4"}),"Generate Prompts"]})]})]})]}),ne=()=>{const Q=W/Nl.length*100;return t.jsxs("div",{className:"space-y-6 py-4",children:[t.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[t.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-purple-500 to-blue-500 flex items-center justify-center animate-pulse",children:t.jsx(Et,{className:"h-8 w-8 text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Generating Your Prompts"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait while AI creates customized prompts for your business..."})]})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-muted-foreground",children:"Progress"}),t.jsxs("span",{className:"font-medium",children:[W," / ",Nl.length]})]}),t.jsx(Nb,{value:Q,className:"h-2"})]}),t.jsx("div",{className:"space-y-2",children:Nl.map((ye,le)=>{const J=le<W,X=le===W;return t.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-md transition-colors ${X?"bg-primary/10":J?"opacity-60":"opacity-40"}`,children:[J?t.jsx(Ir,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):X?t.jsx(Qe,{className:"h-4 w-4 text-primary animate-spin flex-shrink-0"}
654):t.jsx("div",{className:"h-4 w-4 rounded-full border border-muted-foreground/30 flex-shrink-0"}),t.jsx("span",{className:`text-sm ${X?"text-foreground font-medium":"text-muted-foreground"}`,children:ye.label})]},ye.id)})})]})},U=()=>t.jsxs("div",{className:"space-y-6 py-4",children:[t.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[t.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-green-500 to-emerald-500 flex items-center justify-center",children:t.jsx(Ir,{className:"h-8 w-8 text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Prompts Generated Successfully!"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Your AI prompts are ready. You can now edit and refine them in the Prompts section."})]})]}),t.jsx("div",{className:"bg-muted/50 border border-border rounded-lg p-4",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Et,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{className:"font-medium text-foreground mb-1",children:"What was created:"}),t.jsxs("ul",{className:"list-disc list-inside space-y-1",children:[t.jsx("li",{children:"Poll prompt with 20 question ideas"}),t.jsx("li",{children:"Tip prompt with 20 helpful tips"}),t.jsx("li",{children:"Inspirational image-reel prompt with 20 topics"})]})]})]})}),t.jsx("div",{className:"flex justify-end pt-2",children:t.jsxs(T,{onClick:()=>s(!1),className:"gap-2","data-testid":"button-close-complete",children:[t.jsx(Ir,{className:"h-4 w-4"}),"Done"]})})]}),Ae=()=>{switch(n){case"business-info":return"Step 1: Business Information";case"generate-intro":return"Step 2: Generate Prompts";case"generating":return"Generating Prompts...";case"complete":return"Generation Complete";default:return"Generate AI Prompts"}},G=()=>{switch(n){case"business-info":return"Tell us about your business so AI can create tailored prompts";case"generate-intro":return"Review and start the prompt generation process";case"generating":return"AI is creating customized prompts for your platforms";case"complete":return"Your prompts have been created and are ready to use";default:return"Let AI create customized prompts tailored to your business"}};return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"h-5 w-5 text-primary"}),Ae()]}),t.jsx(Ns,{children:G()})]}),g?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.jsxs(t.Fragment,{children:[n==="business-info"&&F(),n==="generate-intro"&&E(),n==="generating"&&ne(),n==="complete"&&U()]})]})})}function sQ(){var xl;const{toast:e}=bt(),{user:s}=hi();m.useEffect(()=>{const H=new URLSearchParams(window.location.search).get("oauth_error");if(!H)return;e({title:"Connection failed",description:{not_authenticated:"Your session expired. Please sign in and try again.",invalid_state:"The OAuth session expired. Start the connection again.",no_code:"The provider did not return an authorization code. Try again.",token_exchange_failed:"The provider rejected authorization. Check permissions and try again.",oauth_failed:"Connection could not be completed. Please try again."}[H]||"Connection failed safely. Please try again.",variant:"destructive"}),window.history.replaceState({},"",window.location.pathname)},[e]);const[r,n]=m.useState({instagram:"paused",facebook:"paused",x:"paused",linkedin:"paused",tiktok:"paused",youtube:"paused",reddit:"paused"}),[a,i]=m.useState({pollPrompt:"",tipPrompt:"",imagePrompt:"",responsePrompt:"",pollModel:"openrouter/meta-llama/llama-3.3-70b-instruct:free",tipModel:"openrouter/meta-llama/llama-3.3-70b-instruct:free",imageModel:"openrouter/google/gemini-2.5-flash-image-preview",responseModel:"openrouter/meta-llama/llama-3.3-70b-instruct:free",imageGenerationMode:"text-to-image",numImages:1,audioListId:null}),[o,l]=m.useState(2),[c,d]=m.useState(!1),[u,h]=m.useState(""),[p,x]=m.useState([]),[v,f]=m.useState(null),[b,y]=m.useState(null),[g,j]=m.useState(!1),[N,w]=m.useState(null),[S,k]=m.useState(!1),[P,A]=m.useState(!1),[$,_]=m.useState("poll"),[O,M]=m.useState(null),[C,L]=m.useState(""),[W,q]=m.useState([]),[I,F]=m.useState(null),[E,ne]=m.useState(!1),{data:U,isLoading:Ae}=Ee({queryKey:["/api/user-prompts"]}),{data:G=[],isLoading:Q}=Ee({queryKey:["/api/user-prompts/v2"]}),{data:ye=[],isLoading:le}=Ee({queryKey:["/api/item-lists"]}),{data:J=[],isLoading:X}=Ee({queryKey:["/api/platform-configs"]}),{data:se={}}=Ee({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),{data:te,isLoading:R}=Ee({queryKey:["/api/user-settings"]}),{data:K=[],isLoading:ve}=Ee({queryKey:["/api/ai-models"]}),Ie=K.filter(H=>H.category==="text"),dt=K.filter(H=>H.category==="image");Ee({queryKey:["/api/prompt-images"]}),ke({mutationFn:async H=>{const _e=new FormData;_e.append("image",H);const Te=await fetch("/api/prompt-images/upload",{method:"POST",body:_e,credentials:"include"});if(!Te.ok){const at=await Te.json();throw new Error(at.error||"Failed to upload image")}return await Te.json()},onSuccess:()=>
654{ee.invalidateQueries({queryKey:["/api/prompt-images"]}),e({title:"Image uploaded",description:"Reference image uploaded successfully"})},onError:H=>{e({title:"Upload failed",description:H.message,variant:"destructive"})}}),ke({mutationFn:async H=>{if(!(await fetch(`/api/prompt-images/${H}`,{method:"DELETE",credentials:"include"})).ok)throw new Error("Failed to delete image")},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/prompt-images"]}),e({title:"Image deleted",description:"Reference image deleted successfully"})},onError:H=>{e({title:"Delete failed",description:H.message,variant:"destructive"})}});const jt=ke({mutationFn:async()=>await Fe("DELETE","/api/user-prompts/image"),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/prompt-images"]}),k(!1),e({title:"Image prompt deleted",description:"Image generation prompt has been removed"})},onError:H=>{e({title:"Delete failed",description:H.message,variant:"destructive"})}}),Ss=ke({mutationFn:async H=>(await Fe("POST","/api/user-prompts/v2",H)).json(),onMutate:async H=>{await ee.cancelQueries({queryKey:["/api/user-prompts/v2"]});const _e=ee.getQueryData(["/api/user-prompts/v2"]);return ee.setQueryData(["/api/user-prompts/v2"],(Te=[])=>[...Te,{...H,id:`temp-${Date.now()}`,dateCreated:new Date,dateModified:new Date}]),{previousPrompts:_e}},onError:(H,_e,Te)=>{Te!=null&&Te.previousPrompts&&ee.setQueryData(["/api/user-prompts/v2"],Te.previousPrompts),e({title:"Failed to create prompt",description:H.message,variant:"destructive"})},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt created",description:"New prompt added successfully"})}}),Mt=ke({mutationFn:async({id:H,data:_e})=>await Fe("PATCH",`/api/user-prompts/v2/${H}`,_e),onMutate:async({id:H,data:_e})=>{await ee.cancelQueries({queryKey:["/api/user-prompts/v2"]});const Te=ee.getQueryData(["/api/user-prompts/v2"]);return ee.setQueryData(["/api/user-prompts/v2"],(at=[])=>at.map(ds=>ds.id===H?{...ds,..._e,dateModified:new Date}:ds)),{previousPrompts:Te}},onError:(H,_e,Te)=>{Te!=null&&Te.previousPrompts&&ee.setQueryData(["/api/user-prompts/v2"],Te.previousPrompts);const at=H.message==="Prompt not found or access denied"?"Prompt no longer exists":H.message;e({title:"Failed to update prompt",description:at,variant:"destructive"})},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt updated",description:"Changes saved successfully"})}}),Cs=ke({mutationFn:async H=>await Fe("DELETE",`/api/user-prompts/v2/${H}`),onMutate:async H=>{await ee.cancelQueries({queryKey:["/api/user-prompts/v2"]});const _e=ee.getQueryData(["/api/user-prompts/v2"]);return ee.setQueryData(["/api/user-prompts/v2"],(Te=[])=>Te.filter(at=>at.id!==H)),{previousPrompts:_e}},onError:(H,_e,Te)=>{Te!=null&&Te.previousPrompts&&ee.setQueryData(["/api/user-prompts/v2"],Te.previousPrompts);const at=H.message==="Prompt not found or access denied"?"Prompt no longer exists":H.message;e({title:"Failed to delete prompt",description:at,variant:"destructive"})},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt deleted",description:"Prompt removed successfully"})}}),Zt=ke({mutationFn:async({promptId:H,platformConfigIds:_e})=>await Fe("PUT",`/api/user-prompts/v2/${H}/platform-configs`,{platformConfigIds:_e}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]})},onError:H=>{e({title:"Failed to save platform settings",description:H.message,variant:"destructive"})}}),{data:D,isLoading:Z}=Ee({queryKey:["/api/platform-connections"]});D!=null&&D.connections;const ie=m.useMemo(()=>({poll:G.filter(H=>H.promptType==="poll").sort((H,_e)=>H.displayOrder-_e.displayOrder),tip:G.filter(H=>H.promptType==="tip").sort((H,_e)=>H.displayOrder-_e.displayOrder),image:G.filter(H=>H.promptType==="image").sort((H,_e)=>H.displayOrder-_e.displayOrder),response:G.filter(H=>H.promptType==="response").sort((H,_e)=>H.displayOrder-_e.displayOrder)}),[G]),Re=m.useMemo(()=>{var H,_e,Te,at;return G.length===0&&U&&(((H=U.pollPrompt)==null?void 0:H.trim())||((_e=U.tipPrompt)==null?void 0:_e.trim())||((Te=U.imagePrompt)==null?void 0:Te.trim())||((at=U.responsePrompt)==null?void 0:at.trim()))},[G,U]);m.useEffect(()=>{U&&i(U)},[U]),m.useEffect(()=>{J.length>0&&n(H=>{const _e={...H};return J.forEach(Te=>{Te.platformName&&Te.postFrequency&&(_e[Te.platformName]=Te.postFrequency)}),_e})},[J]),m.useEffect(()=>{te&&l(te.scheduleBufferDays)},[te]),ke({mutationFn:async H=>
654await Fe("POST","/api/user-prompts",H),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts"]}),e({title:"Success",description:"AI prompts saved successfully"})},onError:()=>{e({title:"Error",description:"Failed to save AI prompts",variant:"destructive"})}});const Pe=(H,_e)=>{_(H),M(null),L(""),q([]),A(!0)},fe=async H=>{if(H.promptType!=="monitoring"){try{const _e=await fetch(`/api/user-prompts/v2/${H.id}/platform-configs`,{credentials:"include"});if(_e.ok){const Te=await _e.json();q(Te.map(at=>at.platformConfigId))}else q([])}catch{q([])}M(H),_(H.promptType),A(!0)}},De=async H=>{const{selectedPlatformConfigIds:_e,...Te}=H;if(O)Mt.mutate({id:O.id,data:Te},{onSuccess:()=>{_e&&_e.length>0&&Zt.mutate({promptId:O.id,platformConfigIds:_e})}});else{const at=ie[$],ds=at.length>0?Math.max(...at.map(Jt=>Jt.displayOrder)):-1;Ss.mutate({...Te,promptType:$,displayOrder:ds+1},{onSuccess:Jt=>{_e&&_e.length>0&&(Jt!=null&&Jt.id)&&Zt.mutate({promptId:Jt.id,platformConfigIds:_e})}})}},ce=H=>{F(H)},$e=()=>{I&&(Cs.mutate(I),F(null))},qe=async(H,_e)=>{if(!_e){Mt.mutate({id:H,data:{enabled:_e}});return}const Te=G.find(ds=>ds.id===H);if(!Te||!["text-to-image","image-to-image","image-reel"].includes(Te.generationMode)){Mt.mutate({id:H,data:{enabled:_e}});return}try{const Jt=await(await Fe("POST","/api/user-prompts/v2/validate-image-limit",{promptId:H})).json();if(!Jt.allowed){e({title:"Image Limit Exceeded",description:Jt.message||`You can only generate up to ${Jt.dailyLimit} images per day on the ${Jt.membershipLevel} tier.`,variant:"destructive"});return}Mt.mutate({id:H,data:{enabled:_e}})}catch(ds){console.error("Failed to validate image limit:",ds),e({title:"Validation Error",description:"Failed to check image generation limits. Please try again.",variant:"destructive"})}},wt=(H,_e)=>{Mt.mutate({id:H,data:{autoApproval:_e}})},Y=H=>{w(H),j(!0)},xt=ke({mutationFn:async H=>await Fe("POST","/api/user-settings",{scheduleBufferDays:H}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-settings"]}),e({title:"Success",description:"Schedule buffer updated successfully"})},onError:()=>{e({title:"Error",description:"Failed to update schedule buffer",variant:"destructive"})}}),ys=H=>{const _e=parseInt(H);!isNaN(_e)&&_e>=1&&_e<=60&&(l(_e),xt.mutate(_e))},Qs=((xl=s==null?void 0:s.membershipLevel)==null?void 0:xl.toLowerCase())||"trial",Tn=Qs==="professional"?60:7,An=Qs==="professional",fi=Qs==="starter",rn=ke({mutationFn:async()=>{const H=new AbortController,_e=setTimeout(()=>H.abort(),12e4);try{const Te=await fetch("/api/trigger-scheduler",{method:"POST",credentials:"include",signal:H.signal});if(clearTimeout(_e),!Te.ok){const at=await Te.json().catch(()=>({})),ds=new Error(at.message||`HTTP ${Te.status}`);throw ds.response=at,ds}return await Te.json()}catch(Te){throw clearTimeout(_e),Te}},onSuccess:H=>{ee.invalidateQueries({queryKey:["/api/posts"]}),ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/activity-log"]}),e({title:"Scheduler Run Complete",description:`Processed ${H.stats.processed} users, generated ${H.stats.successful} posts`})},onError:H=>{var at;let _e="Error",Te="Failed to run scheduler";H.name==="AbortError"?Te="Scheduler is taking longer than expected. Check Activity Log for results.":((at=H.response)==null?void 0:at.message)==="NO_ENABLED_PROMPTS"&&(_e="No Enabled Prompts",Te=H.response.description||"At least one AI Prompt must be enabled to generate content for the scheduler"),e({title:_e,description:Te,variant:"destructive"})}}),[la,Da]=m.useState(!1),nn=ke({mutationFn:async()=>await Fe("DELETE","/api/scheduled-posts/future"),onSuccess:async H=>{const _e=await H.json();ee.invalidateQueries({queryKey:["/api/pending-posts"]}),ee.invalidateQueries({queryKey:["/api/posts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Scheduled Posts Cleared",description:_e.message||`Successfully deleted ${_e.deletedCount} scheduled posts`}),Da(!1)},onError:H=>{e({title:"Error",description:H.message||"Failed to clear scheduled posts",variant:"destructive"})}}),fl=ke({mutationFn:async H=>
654await Fe("POST","/api/item-lists",H),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/item-lists"]}),e({title:"Success",description:"Item list created successfully"})},onError:()=>{e({title:"Error",description:"Failed to create item list",variant:"destructive"})}}),La=ke({mutationFn:async({id:H,data:_e})=>await Fe("PUT",`/api/item-lists/${H}`,_e),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/item-lists"]}),e({title:"Success",description:"Item list updated successfully"})},onError:()=>{e({title:"Error",description:"Failed to update item list",variant:"destructive"})}}),xo=ke({mutationFn:async H=>await Fe("DELETE",`/api/item-lists/${H}`),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/item-lists"]}),e({title:"Success",description:"Item list deleted successfully"})},onError:()=>{e({title:"Error",description:"Failed to delete item list",variant:"destructive"})}});ke({mutationFn:async({platform:H,postFrequency:_e})=>{const Te=J.find(ds=>ds.platformName===H),at={platform:H,postFrequency:_e,tipContentAutomation:(Te==null?void 0:Te.tipContentAutomation)??!1,imageContentAutomation:(Te==null?void 0:Te.imageContentAutomation)??!1,pollContentAutomation:(Te==null?void 0:Te.pollContentAutomation)??!1,videoContentAutomation:(Te==null?void 0:Te.videoContentAutomation)??!1};return await Fe("POST","/api/platform-configs",at)},onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/platform-configs"]}),e({title:"Success",description:"Posting frequency updated"})},onError:()=>{e({title:"Error",description:"Failed to update posting frequency",variant:"destructive"})}});const $s=H=>{const _e=H.trim();if(_e.startsWith("[")||_e.startsWith("{"))try{const Te=JSON.parse(_e);if(Array.isArray(Te))return Te.map(at=>String(at).trim()).filter(at=>at.length>0);if(typeof Te=="object"&&Te!==null){const at=Object.keys(Te);for(const ds of at){const Jt=Te[ds];if(Array.isArray(Jt))return Jt.map(yo=>String(yo).trim()).filter(yo=>yo.length>0)}}}catch{}return _e.split(",").map(Te=>Te.trim()).filter(Te=>Te.length>0)},go=()=>{f(null),h(""),x([]),y(null),d(!0)},id=H=>{f(H.id),h(H.name),x($s(H.items));let _e=H.mediaType||null;if(!_e)try{const Te=JSON.parse(H.items.trim());typeof Te=="object"&&Te!==null&&"MediaType"in Te&&(_e=Te.MediaType)}catch{}y(_e),d(!0)},xm=async(H,_e)=>{let Te;try{const at=JSON.parse(_e.trim());typeof at=="object"&&at!==null&&"MediaType"in at&&(Te=at.MediaType)}catch{}v?await La.mutateAsync({id:v,data:{name:H,items:_e,mediaType:Te}}):await fl.mutateAsync({name:H,items:_e,mediaType:Te})};return t.jsxs("div",{className:"space-y-6 max-w-full overflow-x-hidden",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Post Settings"}),t.jsx("p",{className:"text-muted-foreground",children:"Configure posting frequency and auto-approval for each platform"})]}),t.jsx(KH,{}),Ym(s==null?void 0:s.membershipLevel,"Schedule-Buffer")&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(ws,{className:"h-5 w-5"}),"Schedule Buffer"]}),t.jsx(Ze,{children:"Set how many days ahead the system should automatically schedule content. The scheduler runs every hour and fills your queue to this horizon."})]}),t.jsx(de,{children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx(ae,{htmlFor:"buffer-days",className:"text-sm font-medium",children:"Days ahead to schedule"}),t.jsxs(Nt,{value:o.toString(),onValueChange:ys,disabled:R||xt.isPending,children:[t.jsx(gt,{className:"w-48","data-testid":"select-buffer-days",children:t.jsx(kt,{})}),t.jsx(yt,{children:Array.from({length:Tn},(H,_e)=>_e+1).map(H=>t.jsxs(Se,{value:H.toString(),"data-testid":`option-buffer-${H}`,children:[H," ",H===1?"day":"days"]},H))})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:An?"Professional: 1-60 days":"Starter: 1-7 days"})]}),t.jsx("div",{className:"flex-1 rounded-lg border border-border p-4 bg-muted/30",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.jsx("strong",{className:"text-foreground",children:"Current setting:"})," System will maintain ",o," ",o===1?"day":"days"," of scheduled content ahead for each platform based on their posting frequencies."]})})]}),fi&&t.jsx("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(dw,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Need more scheduling flexibility?"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Upgrade to Professional for up to 60 days of schedule buffer, giving you greater control over your content pipeline."})]})]})})]})})]}),Ym(s==null?void 0:s.membershipLevel,"Run-Scheduler")&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"h-5 w-5"}),"Run Scheduler"]}),t.jsx(Ze,{children:"Manually run the content scheduler to generate posts immediately instead of waiting for the hourly automatic run."})]}),t.jsx(de,{children:t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(T,{onClick:()=>rn.mutate(),disabled:rn.isPending,"data-testid":"button-trigger-scheduler",variant:"default",children:rn.isPending?"Running Scheduler...":"Run Scheduler Now"}),t.jsxs(T,{onClick:()=>Da(!0),disabled:nn.isPending,"data-testid":"button-clear-scheduled-posts",variant:"destructive",children:[t.jsx(ni,{className:"w-4 h-4 mr-2"}),nn.isPending?"Clearing...":"Clear All Scheduled"]})]})})]}),t.jsx(Kd,{open:la,onOpenChange:Da,children:t.jsxs(nc,{children:[t.jsxs(ac,{children:[t.jsx(oc,{children:"Clear All Scheduled Posts?"}),t.jsx(lc,{children:"This action cannot be undone. This will permanently delete all your future scheduled posts (both pending and approved). Posts that have already been published will not be affected."})]}),t.jsxs(ic,{children:[t.jsx(dc,{"data-testid":"button-cancel-clear-posts",children:"Cancel"}),t.jsx(cc,{onClick:()=>nn.mutate(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90","data-testid":"button-confirm-clear-posts",children:nn.isPending?"Clearing...":"Yes, Delete All"})]})]})}),Ym(s==null?void 0:s.membershipLevel,"AI-Prompt-Configuration")&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"h-5 w-5"}),"AI Prompt Configuration"]}),t.jsxs(yu,{children:[t.jsx(vu,{asChild:!0,children:t.jsxs(T,{onClick:()=>ne(!0),"data-testid":"button-generate-ai-prompts",children:[t.jsx(Et,{className:"h-4 w-4 mr-2"}),"Generate AI Prompts"]})}),t.jsx(Lc,{children:t.jsx("p",{children:"Generate AI Prompts specific to your business"})})]})]}),t.jsx(Ze,{children:"Customize AI prompts for generating Polls, Tips, and Images. Each prompt c
654an be up to 5000 characters."})]}),t.jsx(de,{children:Ae||Q?t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"h-32 bg-muted/30 rounded animate-pulse"}),t.jsx("div",{className:"h-32 bg-muted/30 rounded animate-pulse"}),t.jsx("div",{className:"h-32 bg-muted/30 rounded animate-pulse"})]}):t.jsxs("div",{className:"space-y-6",children:[Re&&t.jsx("div",{className:"bg-chart-4/10 border border-chart-4/30 rounded-lg p-4","data-testid":"migration-banner",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(dw,{className:"h-5 w-5 text-chart-4 mt-0.5 flex-shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"font-semibold text-sm mb-1",children:"Migrate to New Prompts System"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"A new multi-prompt system is available. Migrate your existing prompts to take advantage of multiple prompts per type, enhanced image generation, and better organization."}),t.jsx(T,{size:"sm",variant:"default",onClick:()=>{e({title:"Migration started",description:"Your prompts are being migrated..."})},"data-testid":"button-migrate-prompts",children:"Migrate Now"})]})]})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(ae,{className:"flex items-center gap-2 text-base font-semibold",children:[t.jsx(Ta,{className:"h-4 w-4 text-primary"}),"Poll Prompts"]}),t.jsxs(T,{size:"sm",variant:"outline",onClick:()=>Pe("poll"),className:"gap-1.5","data-testid":"button-add-poll-prompt",children:[t.jsx(Ds,{className:"h-3.5 w-3.5"}),"Add Prompt"]})]}),ie.poll.length===0?t.jsxs("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx(Ta,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),t.jsx("p",{className:"text-sm font-medium",children:"No poll prompts yet"}),t.jsx("p",{className:"text-xs mt-1",children:"Create your first poll prompt to get started"})]}):t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ie.poll.map(H=>t.jsx(wh,{prompt:H,onEdit:()=>fe(H),onDelete:()=>ce(H.id),onToggleEnabled:qe,onToggleAutoApproval:wt,onTest:()=>Y(H),platformConfigs:se[H.id]},H.id))})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(ae,{className:"flex items-center gap-2 text-base font-semibold",children:[t.jsx(Yo,{className:"h-4 w-4 text-chart-4"}),"Tip Prompts"]}),t.jsxs(T,{size:"sm",variant:"outline",onClick:()=>Pe("tip"),className:"gap-1.5","data-testid":"button-add-tip-prompt",children:[t.jsx(Ds,{className:"h-3.5 w-3.5"}),"Add Prompt"]})]}),ie.tip.length===0?t.jsxs("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx(Yo,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),t.jsx("p",{className:"text-sm font-medium",children:"No tip prompts yet"}),t.jsx("p",{className:"text-xs mt-1",children:"Create your first tip prompt to get started"})]}):t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ie.tip.map(H=>t.jsx(wh,{prompt:H,onEdit:()=>fe(H),onDelete:()=>ce(H.id),onToggleEnabled:qe,onToggleAutoApproval:wt,onTest:()=>Y(H),platformConfigs:se[H.id]},H.id))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs(ae,{className:"flex items-center gap-2 text-base font-semibold",children:[t.jsx(Ft,{className:"h-4 w-4 text-chart-3"}),"Image Generation Prompts"]}),t.jsxs(T,{size:"sm",variant:"outline",onClick:()=>Pe("image"),className:"gap-1.5","data-testid":"button-add-image-prompt",children:[t.jsx(Ds,{className:"h-3.5 w-3.5"}),"Add Prompt"]})]}),ie.image.length===0?t.jsxs("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx(Ft,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),t.jsx("p",{className:"text-sm font-medium",children:"No image prompts yet"}),t.jsx("p",{className:"text-xs mt-1",children:"Create your first image prompt to get started"})]}):t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ie.image.map(H=>t.jsx(wh,{prompt:H,onEdit:()=>fe(H),onDelete:()=>ce(H.id),onToggleEnabled:qe,onToggleAutoApproval:wt,onTest:()=>Y(H),platformConfigs:se[H.id]},H.id))})]})]})})]}),Ym(s==null?void 0:s.membershipLevel,"Item-Lists")&&t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(s7,{className:"h-5 w-5"}),"Item Lists"]}),t.jsx(Ze,{children:'Create named lists to use in your AI prompts. Supports comma-separated (red, blue, green) or JSON format (["red", "blue", "green"]). Reference in prompts using the list name.'})]}),t.jsx(de,{children:le?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"h-20 bg-muted/30 rounded animate-pulse"}),t.jsx("div",{className:"h-20 bg-muted/30 rounded animate-pulse"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsxs(T,{variant:"outline",className:"w-full",onClick:go,"data-testid":"button-add-list",children:[t.jsx(Ds,{className:"h-4 w-4 mr-2"}),"Add New List"]}),ye.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t.jsx("p",{children:"No item lists yet. Create your first list to get started."})}),ye.map(H=>{const at=(En=>{const jo=En.trim();if(jo.startsWith("[")||jo.startsWith("{"))try{const zs=JSON.parse(jo);if(Array.isArray(zs))return{items:zs.map(Ys=>{if(typeof Ys=="string")return Ys.trim();if(typeof Ys=="object"&&Ys!==null){if("QUOTE"in Ys)return Ys.QUOTE;const ld=Object.values(Ys).find(lr=>typeof lr=="string");return ld?String(ld):JSON.stringify(Ys)}return String(Ys)}).filter(Ys=>Ys.length>0)};if(typeof zs=="object"&&zs!==null){const gm=Object.keys(zs).filter(Ys=>Ys!=="MediaType");for(const Ys of gm){const od=zs[Ys];if(Array.isArray(od))return{items:od.map(lr=>{if(typeof lr=="string")return lr.trim();if(typeof lr=="object"&&lr!==null){if("QUOTE"in lr)return lr.QUOTE;const ym=Object.values(lr).find(Df=>typeof Df=="string");
654return ym?String(ym):JSON.stringify(lr)}return String(lr)}).filter(lr=>lr.length>0)}}}}catch{}return{items:jo.split(",").map(zs=>zs.trim()).filter(zs=>zs.length>0)}})(H.items).items,ds=H.mediaType||(()=>{try{const En=JSON.parse(H.items.trim());if(typeof En=="object"&&En!==null&&"MediaType"in En)return En.MediaType}catch{}return null})(),Jt=at.length,yo=H.lastUsedIndex??0,_n=Jt>0?yo%Jt:0,vo=Jt>0?at[_n]:"N/A";let bo="Unknown";try{if(H.dateCreated){const En=new Date(H.dateCreated);isNaN(En.getTime())||(bo=En.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}))}}catch{bo="Unknown"}return t.jsx("div",{className:"p-4 rounded-lg border border-border space-y-3","data-testid":`item-list-${H.id}`,children:t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx("h4",{className:"font-semibold text-base",children:H.name}),ds&&t.jsx(xe,{variant:"secondary",className:"text-xs",children:ds})]}),t.jsxs("div",{className:"space-y-1.5 text-sm",children:[t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-muted-foreground",children:[t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(ws,{className:"h-3.5 w-3.5 flex-shrink-0"}),t.jsxs("span",{className:"truncate",children:["Created ",bo]})]}),t.jsxs("span",{children:["Index: ",_n," / ",Jt]})]}),t.jsxs("div",{className:"text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:"Current:"})," ",t.jsx("span",{className:"truncate inline-block max-w-full align-bottom",children:vo.length>100?vo.substring(0,100)+"...":vo})]})]})]}),t.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[t.jsx(T,{size:"icon",variant:"ghost",onClick:()=>id(H),"data-testid":`button-edit-${H.id}`,className:"h-8 w-8",children:t.jsx(sf,{className:"h-4 w-4"})}),t.jsx(T,{size:"icon",variant:"ghost",onClick:()=>xo.mutate(H.id),"data-testid":`button-delete-${H.id}`,className:"h-8 w-8",children:t.jsx(ni,{className:"h-4 w-4 text-muted-foreground"})})]})]})},H.id)})]})})]}),N&&t.jsx(MI,{open:g,onOpenChange:H=>{j(H),H||w(null)},promptType:N.promptType,prompt:N.promptText||"",model:N.generationMode&&["text-to-image","image-to-image","image-reel"].includes(N.generationMode)?N.imageModel||"":N.textModel||"",generationMode:N.generationMode||void 0,numImages:N.numImages||void 0,audioListId:N.audioListId||void 0,promptId:N.id,captionPrompt:N.captionPrompt||void 0}),t.jsx(RH,{open:c,onOpenChange:d,listName:u,existingItems:p,initialMediaType:b,onSave:xm}),t.jsx(Kd,{open:S,onOpenChange:k,children:t.jsxs(nc,{"data-testid":"dialog-delete-image-prompt",children:[t.jsxs(ac,{children:[t.jsx(oc,{children:"Delete Image Prompt?"}),t.jsx(lc,{children:"This will permanently delete your image generation prompt and all reference images. This action cannot be undone."})]}),t.jsxs(ic,{children:[t.jsx(dc,{"data-testid":"button-cancel-delete",children:"Cancel"}),t.jsx(cc,{onClick:()=>jt.mutate(),disabled:jt.isPending,"data-testid":"button-confirm-delete",className:"bg-destructive text-destructive-foreground hover-elevate",children:jt.isPending?"Deleting...":"Delete"})]})]})}),t.jsx(UI,{open:P,onClose:()=>{A(!1),L(""),q([])},promptType:$,prompt:O,onSave:De,textModels:Ie,imageModels:dt,itemLists:ye,initialPromptText:C,platformConfigs:J,existingPlatformConfigIds:W}),t.jsx(Kd,{open:!!I,onOpenChange:H=>!H&&F(null),children:t.jsxs(nc,{"data-testid":"dialog-delete-prompt-v2",children:[t.jsxs(ac,{children:[t.jsx(oc,{children:"Delete Prompt?"}),t.jsx(lc,{children:"This will permanently delete this prompt. This action cannot be undone."})]}),t.jsxs(ic,{children:[t.jsx(dc,{"data-testid":"button-cancel-delete-prompt",children:"Cancel"}),t.jsx(cc,{onClick:$e,disabled:Cs.isPending,"data-testid":"button-confirm-delete-prompt",className:"bg-destructive text-destructive-foreground hover-elevate",children:Cs.isPending?"Deleting...":"Delete"})]})]})}),t.jsx(tQ,{open:E,onOpenChange:ne})]})}function rQ(){const{data:e,isLoading:s}=Ee({queryKey:["/api/recent-posts"]}),{data:r}=Ee({queryKey:["/api/dashboard/connections"]});return s?t.jsx("div",{className:"flex items-center justify-center h-screen",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading recent posts..."})}):t.jsxs("div",{className:"container mx-auto p-6 max-w-4xl",children:[t.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[t.jsx(me,{href:"/queue",children:t.jsx(T,{variant:"ghost",size:"icon","data-testid":"button-back",children:t.jsx(Ic,{className:"h-5 w-5"})})}),t.jsx("h1",{className:"text-3xl font-bold",children:"Recent Posts"})]}),!e||e.length===0?t.jsx(re,{children:t.jsx(de,{className:"py-12",children:t.jsxs("div",{className:"text-center text-muted-foreground",children:[t.jsx(ws,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{children:"No posts have been published yet"}),t.jsx("p",{className:"text-sm mt-2",children:"Posts will appear here once they're automatically published to your platforms"})]})})}):t.jsx("div",{className:"space-y-4",children:e.map(n=>{const a=n.platformConfigId,i=a?r==null?void 0:r.connections.find(l=>l.id===a):r==null?void 0:r.connections.find(l=>l.platform===n.platform),o=(i==null?void 0:i.channelName)||(r==null?void 0:r.userUsername)||null;
654return t.jsx(lI,{post:n,viewType:"regular",accountName:o},n.id)})})]})}const nQ={scheduler_run:{label:"Scheduler Run",icon:ws,variant:"secondary"},content_generated:{label:"Content Generated",icon:ot,variant:"default"},content_generation_failed:{label:"Generation Failed",icon:Qr,variant:"destructive"},auto_approved:{label:"Auto-Approved",icon:ot,variant:"default"},manual_approved:{label:"Manually Approved",icon:ot,variant:"default"},manual_rejected:{label:"Manually Rejected",icon:Qr,variant:"outline"},post_submitted:{label:"Post Submitted",icon:ot,variant:"default"},post_failed:{label:"Post Failed",icon:hr,variant:"destructive"}};function aQ({log:e}){const s=nQ[e.activityType]||{label:e.activityType,icon:Q0,variant:"outline"},r=s.icon;return t.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg border border-border hover-elevate","data-testid":`activity-log-${e.id}`,children:[t.jsx("div",{className:"mt-1",children:t.jsx(r,{className:"h-5 w-5 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(xe,{variant:s.variant,"data-testid":`badge-activity-type-${e.id}`,children:s.label}),t.jsx("span",{className:"text-sm text-muted-foreground","data-testid":`text-timestamp-${e.id}`,children:Oy(new Date(e.timestamp),{addSuffix:!0})})]}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.contentType&&t.jsx(xe,{variant:"outline","data-testid":`badge-content-type-${e.id}`,children:e.contentType}),e.platform&&t.jsx(xe,{variant:"outline","data-testid":`badge-platform-${e.id}`,children:e.platform})]}),e.details&&t.jsx("p",{className:"text-sm text-foreground","data-testid":`text-details-${e.id}`,children:e.details})]})]})}function iQ(){return t.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((e,s)=>t.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg border border-border",children:[t.jsx(cn,{className:"h-5 w-5 rounded-full"}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(cn,{className:"h-5 w-32"}),t.jsx(cn,{className:"h-4 w-24"})]}),t.jsx(cn,{className:"h-4 w-full"})]})]},s))})}function oQ(){const{data:e,isLoading:s}=Ee({queryKey:["/api/activity-log"]});return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2","data-testid":"heading-activity-log",children:"Activity Log"}),t.jsx("p",{className:"text-muted-foreground","data-testid":"text-description",children:"Track all system activities including content generation, approvals, and posting"})]}),t.jsxs(re,{"data-testid":"card-activity-log",children:[t.jsxs(he,{children:[t.jsx(pe,{children:"Recent Activity"}),t.jsx(Ze,{children:"Latest actions and events from your PostMonkey account"})]}),t.jsx(de,{children:s?t.jsx(iQ,{}):e&&e.length>0?t.jsx("div",{className:"space-y-3",children:e.map(r=>t.jsx(aQ,{log:r},r.id))}):t.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"text-empty-state",children:[t.jsx(Q0,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{children:"No activity logged yet"}),t.jsx("p",{className:"text-sm mt-2",children:"Activities will appear here as the system runs"})]})})]})]})}function lQ({title:e="Following Users",description:s="Track and respond to specific Twitter/X users",platformConfigId:r}){const{toast:n}=bt(),[a,i]=m.useState(!1),[o,l]=m.useState(""),c=["/api/x-following-users",r],{data:d=[],isLoading:u}=Ee({queryKey:c,queryFn:async()=>{const f=await fetch(`/api/x-following-users?platformConfigId=${r}`,{credentials:"include"});if(!f.ok)throw new Error("Failed to fetch following users");return f.json()}}),h=ke({mutationFn:async f=>Fe("POST","/api/x-following-users",{username:f,platformConfigId:r}),onSuccess:()=>{ee.invalidateQueries({queryKey:c}),n({title:"User added",description:"Twitter user has been added successfully"}),i(!1),l("")},onError:f=>{n({title:"Error",description:f.message||"Failed to add user",variant:"destructive"})}}),p=ke({mutationFn:async({id:f,monitored:b})=>Fe("PATCH",`/api/x-following-users/${f}/monitored`,{monitored:b}),onSuccess:()=>
654{ee.invalidateQueries({queryKey:c})},onError:()=>{n({title:"Error",description:"Failed to update monitored status",variant:"destructive"})}}),x=ke({mutationFn:async f=>Fe("DELETE",`/api/x-following-users/${f}`,{}),onSuccess:()=>{ee.invalidateQueries({queryKey:c}),n({title:"User removed",description:"Twitter user has been removed successfully"})},onError:()=>{n({title:"Error",description:"Failed to remove user",variant:"destructive"})}}),v=()=>{if(!o.trim()){n({title:"Error",description:"Please enter a username",variant:"destructive"});return}h.mutate(o.trim())};return t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Hn,{className:"h-5 w-5"}),e]}),t.jsx(Ze,{children:s})]}),t.jsxs(T,{onClick:()=>i(!0),"data-testid":"button-add-following-user",size:"sm",children:[t.jsx(Ds,{className:"h-4 w-4 mr-2"}),"Add User"]})]})}),t.jsx(de,{children:u?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):d.length===0?t.jsxs("div",{className:"text-center py-8",children:[t.jsx(fr,{className:"h-12 w-12 mx-auto text-muted-foreground mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:'No users added yet. Click "Add User" to start tracking Twitter users.'})]}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border",children:[t.jsx("th",{className:"text-left p-3 text-sm font-semibold",children:"User"}),t.jsx("th",{className:"text-center p-3 text-sm font-semibold",children:"Verified"}),t.jsx("th",{className:"text-right p-3 text-sm font-semibold",children:"Followers"}),t.jsx("th",{className:"text-right p-3 text-sm font-semibold",children:"Following"}),t.jsx("th",{className:"text-right p-3 text-sm font-semibold",children:"Engagement"}),t.jsx("th",{className:"text-center p-3 text-sm font-semibold",children:"Quality"}),t.jsx("th",{className:"text-center p-3 text-sm font-semibold",children:"Monitored"}),t.jsx("th",{className:"text-center p-3 text-sm font-semibold",children:"Actions"})]})}),t.jsx("tbody",{children:d.map(f=>{var b,y,g;return t.jsxs("tr",{className:"border-b border-border hover-elevate","data-testid":`following-user-row-${f.id}`,children:[t.jsx("td",{className:"p-3",children:t.jsxs("div",{className:"flex items-center gap-3",children:[f.profileImageUrl?t.jsx("img",{src:f.profileImageUrl,alt:f.username,className:"w-10 h-10 rounded-full"}):t.jsx("div",{className:"w-10 h-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(fr,{className:"h-5 w-5 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-sm",children:f.displayName||f.username}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:["@",f.username]})]})]})}),t.jsx("td",{className:"p-3 text-center",children:f.verified&&t.jsx(Ir,{className:"h-4 w-4 text-primary mx-auto","data-testid":`verified-${f.id}`})}),t.jsx("td",{className:"p-3 text-right text-sm",children:((b=f.followerCount)==null?void 0:b.toLocaleString())||0}),t.jsx("td",{className:"p-3 text-right text-sm",children:((y=f.followingCount)==null?void 0:y.toLocaleString())||0}),t.jsx("td",{className:"p-3 text-right text-sm",children:((g=f.totalEngagement)==null?void 0:g.toLocaleString())||0}),t.jsx("td",{className:"p-3 text-center",children:t.jsx("span",{className:`text-sm font-medium ${(f.qualityScore||0)>=70?"text-chart-3":(f.qualityScore||0)>=40?"text-chart-4":"text-muted-foreground"}`,children:f.qualityScore||0})}),t.jsx("td",{className:"p-3 text-center",children:t.jsx("div",{className:"flex justify-center",children:t.jsx(ul,{checked:f.monitored||!1,onCheckedChange:j=>{p.mutate({id:f.id,monitored:j})},disabled:p.isPending,"data-testid":`switch-monitored-${f.id}`})})}),t.jsx("td",{className:"p-3 text-center",children:t.jsx(T,{variant:"ghost",size:"sm",onClick:()=>x.mutate(f.id),disabled:x.isPending,"data-testid":`button-delete-user-${f.id}`,children:t.jsx(ni,{className:"h-4 w-4 text-destructive"})})})]},f.id)})})]})})})]}),t.jsx(Ut,{open:a,onOpenChange:i,children:t.jsxs(Ht,{children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Add Twitter User"}),t.jsx(Ns,{children:"Enter the Twitter username (without @) to start tracking this user"})]}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"new-username",children:"Twitter Username"}
654),t.jsx(Ke,{id:"new-username","data-testid":"input-new-username",placeholder:"username",value:o,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&v()}}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The system will automatically fetch their profile information"})]})}),t.jsxs(rd,{children:[t.jsx(T,{variant:"outline",onClick:()=>{i(!1),l("")},"data-testid":"button-cancel-add-user",children:"Cancel"}),t.jsx(T,{onClick:v,disabled:h.isPending,"data-testid":"button-confirm-add-user",children:h.isPending?"Adding...":"Add User"})]})]})})]})}function Zx(e){const s=e.oauthCredentials;if(s!=null&&s.username)return`@${s.username}`;if(e.channelUrl)try{const n=new URL(e.channelUrl).pathname.split("/").filter(a=>a);if(n.length>0)return`@${n[n.length-1]}`}catch{}return`Account #${e.id}`}function cQ(){const{toast:e}=bt(),[s,r]=m.useState(!1),[n,a]=m.useState(null),[i,o]=m.useState(""),[l,c]=m.useState([]),[d,u]=m.useState(null),[h,p]=m.useState(!1),[x,v]=m.useState(null),[f,b]=m.useState(null),{data:y}=Ee({queryKey:["/api/platform-configs"]}),g=m.useMemo(()=>((y==null?void 0:y.filter(J=>{const X=J.platformName.toLowerCase().trim();return X==="x"||X==="twitter"}))||[]).filter(J=>{const X=J.oauthCredentials;return!!(X!=null&&X.accessToken||J.apiKey&&J.apiSecret)}),[y]),[j,N]=m.useState("");m.useEffect(()=>{g.length>0&&!j&&N(String(g[0].id))},[g,j]);const{data:w=[],isLoading:S}=Ee({queryKey:["/api/user-prompts/v2"]}),{data:k={}}=Ee({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),{data:P=[]}=Ee({queryKey:["/api/x-following-users"],queryFn:async()=>{const J=await fetch("/api/x-following-users",{credentials:"include"});if(!J.ok)throw new Error("Failed to fetch following users");return J.json()}}),A=m.useMemo(()=>{const J=new Map;return P.forEach(X=>{X.platformConfigId&&J.set(X.platformConfigId,(J.get(X.platformConfigId)||0)+1)}),J},[P]),{data:$=[]}=Ee({queryKey:["/api/ai-models"]}),{data:_=[]}=Ee({queryKey:["/api/item-lists"]}),O=$.filter(J=>J.category==="text"),M=$.filter(J=>J.category==="image"),C=m.useMemo(()=>w.filter(J=>J.promptType==="response").sort((J,X)=>J.displayOrder-X.displayOrder),[w]),L=J=>C.filter(X=>{const se=k[X.id];return se==null?void 0:se.some(te=>te.id===J)}),W=ke({mutationFn:async J=>await Fe("POST","/api/user-prompts/v2",J),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt created",description:"New prompt added successfully"})},onError:J=>{e({title:"Failed to create prompt",description:J.message,variant:"destructive"})}}),q=ke({mutationFn:async({id:J,data:X})=>await Fe("PATCH",`/api/user-prompts/v2/${J}`,X),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt updated",description:"Changes saved successfully"})},onError:J=>{const X=J.message==="Prompt not found or access denied"?"Prompt no longer exists":J.message;e({title:"Failed to update prompt",description:X,variant:"destructive"})}}),I=ke({mutationFn:async J=>await Fe("DELETE",`/api/user-prompts/v2/${J}`),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}),ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]}),ee.invalidateQueries({queryKey:["/api/user-prompts"]}),ee.invalidateQueries({queryKey:["/api/scheduled-posts"]}),e({title:"Prompt deleted",description:"Prompt removed successfully"})},onError:J=>{const X=J.message==="Prompt not found or access denied"?"Prompt no longer exists":J.message;e({title:"Failed to delete prompt",description:X,variant:"destructive"})}}),F=ke({mutationFn:async({promptId:J,platformConfigIds:X})=>await Fe("PUT",`/api/user-prompts/v2/${J}/platform-configs`,{platformConfigIds:X}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user-prompts/v2"]}
654),ee.invalidateQueries({queryKey:["/api/user-prompts/v2/all-platform-configs"]})},onError:J=>{e({title:"Failed to save platform settings",description:J.message,variant:"destructive"})}}),E=(J,X)=>{a(null),o(X||""),b(J),c([J]),r(!0)},ne=async J=>{try{const X=await fetch(`/api/user-prompts/v2/${J.id}/platform-configs`,{credentials:"include"});if(X.ok){const se=await X.json();c(se.map(te=>te.platformConfigId))}else c([])}catch{c([])}a(J),b(null),r(!0)},U=J=>{const{selectedPlatformConfigIds:X,...se}=J;n?q.mutate({id:n.id,data:se},{onSuccess:()=>{X!==void 0&&F.mutate({promptId:n.id,platformConfigIds:X})}}):W.mutate({...se,promptType:"response"},{onSuccess:te=>{X&&X.length>0&&(te!=null&&te.id)&&F.mutate({promptId:te.id,platformConfigIds:X})}}),r(!1),b(null)},Ae=J=>{u(J)},G=()=>{d&&(I.mutate(d),u(null))},Q=(J,X)=>{q.mutate({id:J,data:{enabled:X}})},ye=(J,X)=>{q.mutate({id:J,data:{autoApproval:X}})},le=J=>{v(J),p(!0)};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsxs("h1",{className:"text-3xl font-bold mb-2 flex items-center gap-2",children:[t.jsx(gr,{className:"h-8 w-8"}),"Configuration"]}),t.jsx("p",{className:"text-muted-foreground",children:"Configure your X.com monitoring and reply generation settings. API credentials are managed in Post Settings."})]}),g.length===0?t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(js,{className:"h-5 w-5"}),"Connect Your X Account"]}),t.jsx(Ze,{children:"Connect your X.com account to configure monitoring and AI-powered replies"})]}),t.jsx(de,{children:t.jsxs("div",{className:"text-center py-8",children:[t.jsx(js,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"No X.com accounts connected. Connect your account in Post Settings to get started."}),t.jsx(T,{asChild:!0,"data-testid":"button-connect-x-account",children:t.jsxs("a",{href:"/settings",className:"gap-2",children:[t.jsx(wa,{className:"h-4 w-4"}),"Go to Post Settings"]})})]})})]}):t.jsxs(sd,{value:j,onValueChange:N,className:"w-full",children:[t.jsx(dl,{className:"w-full justify-start overflow-x-auto","data-testid":"tabs-x-accounts",children:g.map(J=>{const X=Zx(J),se=A.get(J.id)||0;return t.jsxs(hs,{value:String(J.id),className:"gap-1","data-testid":`tab-x-account-${J.id}`,children:[t.jsx(js,{className:"h-3.5 w-3.5"}),X," (",se,")"]},J.id)})}),g.map(J=>{const X=J.id,se=L(X);return t.jsxs(ps,{value:String(X),className:"space-y-6 mt-6",children:[t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(js,{className:"h-5 w-5"}),"Reply Generation Prompts"]}),t.jsxs(Ze,{children:["AI prompts for generating automated replies from ",Zx(J)]})]}),t.jsx(de,{children:S?t.jsx("div",{className:"space-y-3",children:t.jsx("div",{className:"h-32 bg-muted/30 rounded animate-pulse"})}):t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsxs(T,{size:"sm",variant:"ghost",onClick:async()=>{try{const te=await fetch("/api/x-config/sample-prompt");if(te.ok){const R=await te.json();E(X,R.prompt),e({title:"Sample loaded",description:"Sample prompt created. Edit to customize it."})}}catch(te){console.error("Error loading sample prompt:",te),e({title:"Error",description:"Failed to load sample prompt",variant:"destructive"})}},className:"gap-1.5","data-testid":`button-load-sample-response-prompt-${X}`,children:[t.jsx(Ds,{className:"h-3.5 w-3.5"}),"Load Sample"]}),t.jsxs(T,{size:"sm",variant:"outline",onClick:()=>E(X),className:"gap-1.5","data-testid":`button-add-response-prompt-${X}`,children:[t.jsx(Ds,{className:"h-3.5 w-3.5"}),"Add Prompt"]})]}),se.length===0?t.jsxs("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx(js,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),t.jsx("p",{className:"text-sm font-medium",children:"No response prompts for this account"}),t.jsx("p",{className:"text-xs mt-1",children:"Create a prompt to start generating AI replies"})]}):t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:se.map(te=>t.jsx(wh,{prompt:te,platformConfigs:k[te.id],onEdit:()=>ne(te),onDelete:()=>Ae(te.id),onToggleEnabled:Q,onToggleAutoApproval:ye,onTest:()=>le(te)},te.id))})]})})]}),t.jsx(lQ,{title:"Follow Users",description:`Monitor X.com users and automatically reply from ${Zx(J)}`,platformConfigId:X})]},X)})]}),s&&t.jsx(UI,{open:s,onClose:()=>{r(!1),b(null)},promptType:"response",prompt:n,initialPromptText:i,onSave:U,textModels:O,imageModels:M,itemLists:_,platformConfigs:g,existingPlatformConfigIds:l}),x&&t.jsx(MI,{open:h,onOpenChange:p,promptType:x.promptType,prompt:x.promptText,model:x.textModel||"openrouter/meta-llama/llama-3.3-70b-instruct:free",generationMode:x.generationMode||void 0,numImages:x.numImages||void 0,audioListId:x.audioListId||void 0,promptId:x.id,captionPrompt:x.captionPrompt||void 0}),t.jsx(Kd,{open:d!==null,onOpenChange:()=>u(null),children:t.jsxs(nc,{children:[t.jsxs(ac,{children:[t.jsx(oc,{children:"Delete Prompt?"}),t.jsx(lc,{children:"This will permanently delete this prompt. Any scheduled posts using this prompt will no longer be generated."})]}),t.jsxs(ic,{children:[t.jsx(dc,{"data-testid":"button-cancel-delete-prompt",children:"Cancel"}),t.jsx(cc,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90","data-testid":"button-confirm-delete-prompt",children:"Delete"})]})]})})]})}const dQ=[{value:"google",label:"Google Search"},{value:"x",label:"X (Twitter)"},{value:"facebook",label:"Facebook"},{value:"instagram",label:"Instagram"},{value:"linkedin",label:"LinkedIn"},{value:"youtube",label:"YouTube"},{value:"friend",label:"Friend / Colleague"},{value:"podcast",label:"Podcast"},{value:"blog",label:"Blog / Article"},{value:"other",label:"Other"}];function uQ({open:e,onOpenChange:s,initialUsername:r,initialEmail:n}){const{toast:a}=bt(),[i,o]=m.useState(r||""),[l,c]=m.useState(n||""),[d,u]=m.useState(""),[h,p]=m.useState(""),[x,v]=m.useState(""),[f,b]=m.useState(""),[y,g]=m.useState(""),{data:j,isLoading:N}=Ee({queryKey:["/api/user/config"],enabled:e});m.useEffect(()=>{e&&(o(r||""),c(n||""))},[e,r,n]),m.useEffect(()=>{if(e&&j){u(j.websiteUrl||j.website_url||""),p(j.promotionText||j.promotion_text||"");const _=j.nicheKeywords||j.niche_keywords||"";v(_),b(j.targetAudience||j.target_audience||""),g(j.referralSource||j.referral_source||"")}},[e,j]);const w=ke({mutationFn:async _=>Fe("PUT","/api/user/profile",{username:_.username,email:_.email,websiteUrl:_.websiteUrl,promotionText:_.promotionText,nicheKeywords:_.nicheKeywords,targetAudience:_.targetAudience,referralSource:_.referralSource}),onSuccess:()=>
654{ee.invalidateQueries({queryKey:["/api/user/config"]}),ee.invalidateQueries({queryKey:["/api/user"]}),a({title:"Profile saved",description:"Your business information has been updated."}),s(!1)},onError:_=>{a({title:"Error",description:_.message||"Failed to save business information.",variant:"destructive"})}}),S=ke({mutationFn:async()=>{const _=await fetch("/api/enhance-business-description",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({websiteUrl:d,promotionText:h,nicheKeywords:x,targetAudience:f})});if(!_.ok){const O=await _.json().catch(()=>({}));throw new Error(O.message||"Failed to analyze")}return _.json()},onSuccess:_=>{_.promotionText&&p(_.promotionText),_.nicheKeywords&&v(_.nicheKeywords),_.targetAudience&&b(_.targetAudience),a({title:"Business profile analyzed",description:"AI has analyzed your business and enhanced your profile."})},onError:_=>{a({title:"Analysis failed",description:_.message||"Failed to analyze business description with AI.",variant:"destructive"})}}),k=_=>{if(!_.trim())return"";try{return JSON.parse(_),_}catch{const O=_.split(",").map(M=>M.trim()).filter(M=>M);return JSON.stringify(O)}},P=()=>{const _=k(x);w.mutate({username:i!==r?i:void 0,email:l!==n?l:void 0,websiteUrl:d,promotionText:h,nicheKeywords:_,targetAudience:f,referralSource:y})},A=()=>{S.mutate()},$=_=>{try{const O=JSON.parse(_);return Array.isArray(O)?O.join(", "):_}catch{return _}};return t.jsx(Ut,{open:e,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-2",children:[t.jsx(iP,{className:"h-5 w-5 text-primary"}),"Business Information"]}),t.jsx(Ns,{children:"Information for prompts & extensions"})]}),N?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"username",className:"flex items-center gap-2",children:[t.jsx(fr,{className:"h-4 w-4 text-muted-foreground"}),"Username"]}),t.jsx(Ke,{id:"username",placeholder:"Your username",value:i,onChange:_=>o(_.target.value),"data-testid":"input-username"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"email",className:"flex items-center gap-2",children:"Email"}),t.jsx(Ke,{id:"email",type:"email",placeholder:"[email protected]",value:l,onChange:_=>c(_.target.value),"data-testid":"input-email"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"websiteUrl",className:"flex items-center gap-2",children:[t.jsx(jn,{className:"h-4 w-4 text-muted-foreground"}),"Website URL"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{id:"websiteUrl",placeholder:"https://yourwebsite.com",value:d,onChange:_=>u(_.target.value),"data-testid":"input-website-url",className:"flex-1"}),t.jsxs(T,{variant:"outline",onClick:A,disabled:S.isPending,className:"gap-2 bg-gradient-to-r from-purple-500/10 to-blue-500/10 border-purple-500/30 hover:border-purple-500/50","data-testid":"button-analyze-business",children:[S.isPending?t.jsx(Qe,{className:"h-4 w-4 animate-spin"}):t.jsx(tv,{className:"h-4 w-4 text-purple-500"}),"Analyze"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"promotionText",className:"flex items-center gap-2",children:[t.jsx(mi,{className:"h-4 w-4 text-muted-foreground"}),"Business Summary"]}),t.jsx(os,{id:"promotionText",placeholder:"Describe your business, products, services, and what makes you unique...",value:h,onChange:_=>p(_.target.value),rows:3,className:"resize-none","data-testid":"input-promotion-text"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"nicheKeywords",className:"flex items-center gap-2",children:[t.jsx(yP,{className:"h-4 w-4 text-muted-foreground"}),"Niche Keywords"]}),t.jsx(os,{id:"nicheKeywords",placeholder:"keyword1, keyword2, keyword3",value:$(x),onChange:_=>v(_.target.value),rows:2,className:"resize-none text-sm","data-testid":"input-niche-keywords"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Keywords for AI to target in content generation."})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{htmlFor:"targetAudience",className:"flex items-center gap-2",children:[t.jsx(ev,{className:"h-4 w-4 text-muted-foreground"}),"Target Audience"]}),t.jsx(os,{id:"targetAudience",placeholder:"Describe your ideal customers: demographics, interests, pain points...",value:f,onChange:_=>b(_.target.value),rows:2,className:"resize-none","data-testid":"input-target-audience"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"referralSource",children:"How did you find us?"}),t.jsxs(Nt,{value:y,onValueChange:g,children:[t.jsx(gt,{id:"referralSource","data-testid":"select-referral-source",children:t.jsx(kt,{placeholder:"Select how you found us"})}),t.jsx(yt,{children:dQ.map(_=>t.jsx(Se,{value:_.value,children:_.label},_.value))})]})]})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx(T,{variant:"outline",onClick:()=>s(!1),"data-testid":"button-cancel-business-info",children:"Cancel"}),t.jsx(T,{onClick:P,disabled:w.isPending,"data-testid":"button-save-business-info",children:w.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):"Save Changes"})]})]})]})})}function mQ(){const{data:e,isLoading:s}=Ee({queryKey:["/api/user/image-credits"]});if(s||!e)return null;const r=e.baseDailyLimit>0?Math.min(100,e.baseUsedToday/e.baseDailyLimit*100):0,n=e.bonusCreditsRemaining>0,a=e.baseRemaining===0;return t.jsxs(re,{className:"mb-4","data-testid":"card-image-credits",children:[t.jsxs(he,{className:"pb-2",children:[t.jsxs(pe,{className:"flex items-center gap-2 text-base",children:[t.jsx(Ft,{className:"w-4 h-4"}),"Daily Image Allowance"]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Resets every 24 hours"})]}),t.jsxs(de,{className:"space-y-3",children:[t.jsx("div",{className:"flex items-center justify-between gap-2",children:t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[t.jsx("span",{className:"text-muted-foreground",children:"Images today"}),t.jsxs("span",{"data-testid":"text-daily-credits",children:[e.baseRemaining," of ",e.baseDailyLimit," remaining"]})]}),t.jsx(Nb,{value:100-r,className:"h-2","data-testid":"progress-daily-credits"})]})}),n&&t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[t.jsx(mu,{className:"w-3 h-3"}),t.jsx("span",{children:"Bonus Credits"})]}),t.jsxs(xe,{variant:"secondary","data-testid":"badge-bonus-credits",children:[e.bonusCreditsRemaining," remaining"]})]}),t.jsxs("div",{className:"flex items-center justify-between pt-1 border-t",children:[t.jsx("span",{className:"text-sm font-medium",children:"Total Available"}),t.jsx("span",{className:"text-sm font-bold","data-testid":"text-total-credits",children:e.totalRemaining})]}),a&&!n&&t.jsxs("div",{className:"pt-2 space-y-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"You've used today's allowance. Come back tomorrow for more!"}),t.jsx(me,{href:"/pricing",children:t.jsxs(T,{size:"sm",variant:"outline",className:"w-full gap-2","data-testid":"button-upgrade-credits",children:[t.jsx(Et,{className:"w-4 h-4"}),"Need more? Upgrade your plan"]})})]})]})]})}function $N(e){if(!e)return!1;const s=new Date,r=new Date(s.getFullYear(),s.getMonth(),1);return new Date(e)>=r}function hQ({hasConnectedAccount:e,hasScheduledPost:s,firstAccountBonusAt:r,firstPostBonusAt:n,onConnectAccount:a,onSchedulePost:i}){const o=$N(r),l=$N(n);if(e||s)return null;const c=o,d=l;return c&&d?null:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-4",children:[!c&&t.jsx(re,{className:"border border-purple-500/40 bg-purple-500/5","data-testid":"card-milestone-connect-account",children:t.jsxs("div",{className:"p-3 flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/20 flex items-center justify-center flex-shrink-0",children:t.jsx(uP,{className:"w-5 h-5 text-purple-400"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{className:"font-medium text-sm",children:"Connect an account"}),t.jsxs(xe,{className:"bg-purple-600 text-white text-xs px-2 py-0.5",children:[t.jsx(mu,{className:"w-3 h-3 mr-1"}),"+5 FREE images"]})]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Link a social platform to earn bonus AI 
654image generations"})]}),a&&t.jsx(T,{size:"sm",onClick:a,className:"bg-purple-600 hover:bg-purple-700 flex-shrink-0","data-testid":"button-milestone-connect",children:"Connect"})]})}),c&&!d&&t.jsx(re,{className:"border border-green-500/40 bg-green-500/5","data-testid":"card-milestone-first-completed",children:t.jsxs("div",{className:"p-3 flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-500/20 flex items-center justify-center flex-shrink-0",children:t.jsx(Ir,{className:"w-5 h-5 text-green-400"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{className:"font-medium text-sm text-green-400",children:"Account Connected!"}),t.jsxs(xe,{className:"bg-green-600 text-white text-xs px-2 py-0.5",children:[t.jsx(Ft,{className:"w-3 h-3 mr-1"}),"+5 images earned"]})]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Bonus images added to your monthly limit"})]})]})}),!d&&t.jsx(re,{className:"border border-amber-500/40 bg-amber-500/5","data-testid":"card-milestone-schedule-post",children:t.jsxs("div",{className:"p-3 flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-500/20 flex items-center justify-center flex-shrink-0",children:t.jsx(Ca,{className:"w-5 h-5 text-amber-400"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{className:"font-medium text-sm",children:"Schedule a post"}),t.jsxs(xe,{className:"bg-amber-600 text-white text-xs px-2 py-0.5",children:[t.jsx(mu,{className:"w-3 h-3 mr-1"}),"+10 FREE images"]})]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Create your first scheduled post to unlock bonus images"})]}),i&&t.jsx(T,{size:"sm",onClick:i,className:"bg-amber-600 hover:bg-amber-700 flex-shrink-0","data-testid":"button-milestone-schedule",children:"Create"})]})})]})}const pQ=[{value:"google",label:"Google Search"},{value:"x",label:"X (Twitter)"},{value:"facebook",label:"Facebook"},{value:"instagram",label:"Instagram"},{value:"linkedin",label:"LinkedIn"},{value:"youtube",label:"YouTube"},{value:"friend",label:"Friend / Colleague"},{value:"podcast",label:"Podcast"},{value:"blog",label:"Blog / Article"},{value:"other",label:"Other"}];function fQ(){var A,$,_,O;const{user:e,logoutMutation:s}=hi(),{theme:r,toggleTheme:n}=a5(),{toast:a}=bt(),[i,o]=m.useState(!1),[l,c]=m.useState(""),[d,u]=m.useState(""),{data:h,isLoading:p}=Ee({queryKey:["/api/user/config"]}),{data:x}=Ee({queryKey:["/api/dashboard/stats"]}),{data:v}=Ee({queryKey:["/api/connections"]}),f=(((A=v==null?void 0:v.connections)==null?void 0:A.length)??0)>0,{data:b}=Ee({queryKey:["/api/user"]}),y=ke({mutationFn:async M=>await Fe("PATCH","/api/user/welcome-popup",{hideWelcomePopup:M}),onSuccess:()=>{ee.invalidateQueries({queryKey:["/api/user"]}),a({title:"Preference saved",description:"Your welcome popup setting has been updated."})}}),{data:g,isLoading:j}=Ee({queryKey:["/api/affiliate/status"]}),N=ke({mutationFn:async M=>(await Fe("POST","/api/affiliate/apply",M)).json(),onSuccess:()=>{a({title:"Application submitted",description:"We'll review your application and get back to you soon!"}),c(""),u(""),ee.invalidateQueries({queryKey:["/api/affiliate/status"]})},onError:M=>
654{a({variant:"destructive",title:"Application failed",description:M.message||"Failed to submit application"})}}),w=()=>{if(!d.trim()){a({variant:"destructive",title:"Missing information",description:"Please describe how you plan to promote SocialMonkey"});return}N.mutate({website:l,promotionPlan:d})},S=M=>{if(M<60)return`${M} min`;const C=Math.floor(M/60),L=M%60;return L>0?`${C}h ${L}m`:`${C}h`};if(!e)return null;const k=()=>{s.mutate()},P=e.createdAt?$r(new Date(e.createdAt),"MMMM d, yyyy"):"N/A";return e.referralCode&&`${e.referralCode}`,t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold mb-2","data-testid":"text-profile-title",children:"Profile"}),t.jsx("p",{className:"text-muted-foreground","data-testid":"text-profile-description",children:"Manage your account settings and preferences"})]}),t.jsxs(re,{"data-testid":"card-user-info",children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx(pe,{"data-testid":"text-username",children:e.username}),t.jsx(Ze,{"data-testid":"text-email",children:e.email})]}),t.jsxs("div",{className:"text-right",children:[t.jsx(op,{membershipLevel:e.membershipLevel,size:"md"}),t.jsxs("p",{className:"text-sm text-muted-foreground mt-2","data-testid":"text-member-since",children:["Member since ",P]})]})]})}),t.jsx(de,{children:t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"space-y-2 flex-1",children:[(h==null?void 0:h.websiteUrl)&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx(jn,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("a",{href:h.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline","data-testid":"link-website",children:h.websiteUrl})]}),(h==null?void 0:h.promotionText)&&t.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[t.jsx(mi,{className:"h-4 w-4 text-muted-foreground mt-0.5 flex-shrink-0"}),t.jsx("p",{className:"text-muted-foreground line-clamp-2","data-testid":"text-about",children:h.promotionText})]}),(h==null?void 0:h.referralSource)&&t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx(fr,{className:"h-4 w-4 text-muted-foreground"}),t.jsxs("span",{className:"text-muted-foreground","data-testid":"text-referral-source",children:["Found us via: ",(($=pQ.find(M=>M.value===h.referralSource))==null?void 0:$.label)||h.referralSource]})]}),!(h!=null&&h.websiteUrl)&&!(h!=null&&h.promotionText)&&!(h!=null&&h.referralSource)&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional profile info set yet."})]}),t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>o(!0),"data-testid":"button-edit-profile",children:[t.jsx(Z0,{className:"h-4 w-4 mr-2"}),"Edit"]})]})})})]}),t.jsx(uQ,{open:i,onOpenChange:o,initialUsername:e.username,initialEmail:e.email}),t.jsxs(re,{"data-testid":"card-account-settings",children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qn,{className:"h-5 w-5"}),t.jsx(pe,{children:"Account Settings"})]})}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ri,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-account-email-label",children:"Account Email"}),t.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"text-account-email-value",children:e.email})]})]}),t.jsx(op,{membershipLevel:e.membershipLevel,size:"md"})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Y0,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-billing-label",children:"Billing Portal"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your subscription and billing"})]})]}),t.jsxs(T,{variant:"outline",size:"sm","data-testid":"button-billing-portal",onClick:()=>window.open("https://billing.stripe.com/p/login/7sYcN688J4QG5SL6JHgfu00","_blank"),children:[t.jsx(wa,{className:"h-4 w-4 mr-2"}),"Billing Portal"]})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[r==="dark"?t.jsx(hu,{className:"h-5 w-5 text-muted-foreground"}):t.jsx(fu,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-theme-label",children:"Theme"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Switch between light and dark mode"})]})]}),t.jsx(T,{variant:"outline",size:"sm",onClick:n,"data-testid":"button-theme-toggle",children:r==="dark"?t.jsxs(t.Fragment,{children:[t.jsx(fu,{className:"h-4 w-4 mr-2"}),"Light"]}):t.jsxs(t.Fragment,{children:[t.jsx(hu,{className:"h-4 w-4 mr-2"}),"Dark"]}
654)})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ta,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-welcome-popup-label",children:"Welcome Popup"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Show the getting started guide on the dashboard"})]})]}),t.jsx(ul,{checked:!(b!=null&&b.hideWelcomePopup),onCheckedChange:M=>y.mutate(!M),disabled:y.isPending,"data-testid":"switch-welcome-popup"})]}),t.jsx(rp,{}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-3","data-testid":"text-usage-stats-title",children:"Usage Statistics"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"p-3 rounded-lg bg-muted",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(ot,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Posts"})]}),t.jsx("p",{className:"text-2xl font-bold","data-testid":"text-total-posts",children:(x==null?void 0:x.totalPosts)??0})]}),t.jsxs("div",{className:"p-3 rounded-lg bg-muted",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(Xh,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Replies (30d)"})]}),t.jsx("p",{className:"text-2xl font-bold","data-testid":"text-total-replies",children:(x==null?void 0:x.totalReplies30d)??0})]}),t.jsxs("div",{className:"p-3 rounded-lg bg-muted",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(ws,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Time Saved (30d)"})]}),t.jsx("p",{className:"text-2xl font-bold","data-testid":"text-time-saved",children:S((x==null?void 0:x.timeSaved30d)??0)})]})]})]})]})]}),t.jsx(mQ,{}),e&&t.jsx(hQ,{hasConnectedAccount:f,hasScheduledPost:((x==null?void 0:x.totalScheduled)??0)>0,firstAccountBonusAt:((_=e.firstAccountBonusAt)==null?void 0:_.toString())??null,firstPostBonusAt:((O=e.firstPostBonusAt)==null?void 0:O.toString())??null}),t.jsxs(re,{"data-testid":"card-affiliate-program",children:[t.jsxs(he,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Hn,{className:"h-5 w-5"}),t.jsx(pe,{children:"Affiliate Program"})]}),t.jsx(Ze,{children:"Partner with SocialMonkey and earn commissions"})]}),t.jsx(de,{className:"space-y-4",children:j?t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Qe,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(g==null?void 0:g.status)==="approved"?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"p-4 rounded-lg bg-green-500/10 border border-green-500/20",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(ot,{className:"h-5 w-5 text-green-500"}),t.jsx("span",{className:"font-semibold text-green-500",children:"Approved Affiliate"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"You're an approved affiliate partner! Check your email for details about your arrangement."})]}),g.affiliateCode&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{children:"Your Affiliate Code"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{value:g.affiliateCode,readOnly:!0,className:"font-mono","data-testid":"input-affiliate-code"}),t.jsx(T,{variant:"outline",size:"icon",onClick:()=>{navigator.clipboard.writeText(g.affiliateCode||""),a({title:"Copied!",description:"Affiliate code copied to clipboard"})},"data-testid":"button-copy-affiliate-code",children:t.jsx(xa,{className:"h-4 w-4"})})]})]})]}):(g==null?void 0:g.status)==="pending"?t.jsxs("div",{className:"p-4 rounded-lg bg-yellow-500/10 border border-yellow-500/20",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(ws,{className:"h-5 w-5 text-yellow-500"}),t.jsx("span",{className:"font-semibold text-yellow-500",children:"Application Pending"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Your affiliate application is being reviewed. We'll reach out to you soon with more details about your arrangement!"})]}):(g==null?void 0:g.status)==="rejected"?t.jsx("div",{className:"p-4 rounded-lg bg-destructive/10 border border-destructive/20",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Your previous application was not approved at this time. Feel free to reach out on Discord if you'd like to discu
654ss partnership opportunities."})}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"Interested in becoming an affiliate partner? Fill out the form below and we'll reach out to discuss commission rates and custom arrangements."}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"affiliate-website",children:"Website / Social Media (optional)"}),t.jsx(Ke,{id:"affiliate-website",value:l,onChange:M=>c(M.target.value),placeholder:"https://yourwebsite.com or @yoursocial","data-testid":"input-affiliate-website"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"affiliate-promotion",children:"How do you plan to promote SocialMonkey?"}),t.jsx(os,{id:"affiliate-promotion",value:d,onChange:M=>u(M.target.value),placeholder:"Describe your audience and how you'd promote our product...",className:"resize-none",rows:3,"data-testid":"input-affiliate-promotion"})]}),t.jsx(T,{onClick:w,disabled:N.isPending,"data-testid":"button-submit-affiliate",children:N.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 mr-2 animate-spin"}),"Submitting..."]}):"Submit Application"})]})})]}),t.jsxs(re,{"data-testid":"card-support-help",children:[t.jsxs(he,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(lP,{className:"h-5 w-5"}),t.jsx(pe,{children:"Support & Help"})]}),t.jsx(Ze,{children:"Need help? We're here to support you every step of the way."})]}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(B5,{className:"h-5 w-5 text-[#5865F2]"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-discord-label",children:"Discord Community"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Get quick help from our community and team"})]})]}),t.jsx(T,{variant:"outline",size:"sm","data-testid":"button-join-discord",asChild:!0,children:t.jsxs("a",{href:"https://discord.gg/3M87xDmVnm",target:"_blank",rel:"noopener noreferrer",children:[t.jsx(wa,{className:"h-4 w-4 mr-2"}),"Join Discord"]})})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(qn,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium","data-testid":"text-billing-issues-label",children:"Billing & Account Issues"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Subscription, payments, and account problems"})]})]}),t.jsxs(T,{variant:"outline",size:"sm","data-testid":"button-billing-issues",onClick:()=>window.open("https://billing.stripe.com/p/login/7sYcN688J4QG5SL6JHgfu00","_blank"),children:[t.jsx(wa,{className:"h-4 w-4 mr-2"}),"Billing Portal"]})]}),t.jsx("div",{className:"text-center text-sm text-muted-foreground pt-2",children:"For urgent issues, join Discord and mention @staff for immediate assistance."})]})]}),t.jsx(re,{"data-testid":"card-logout",children:t.jsx(de,{className:"pt-6",children:t.jsxs(T,{variant:"destructive",className:"w-full",onClick:k,disabled:s.isPending,"data-testid":"button-logout",children:[t.jsx(mP,{className:"mr-2 h-4 w-4"}),s.isPending?"Logging out...":"Log Out"]})})})]})}const li=m.forwardRef(({className:e,...s},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:je("w-full caption-bottom text-sm",e),...s})}));li.displayName="Table";const ci=m.forwardRef(({className:e,...s},r)=>t.jsx("thead",{ref:r,className:je("[&_tr]:border-b",e),...s}));ci.displayName="TableHeader";const di=m.forwardRef(({className:e,...s},r)=>t.jsx("tbody",{ref:r,className:je("[&_tr:last-child]:border-0",e),...s}));di.displayName="TableBody";const xQ=m.forwardRef(({className:e,...s},r)=>t.jsx("tfoot",{ref:r,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s}));xQ.displayName="TableFooter";const Os=m.forwardRef(({className:e,...s},r)=>t.jsx("tr",{ref:r,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));Os.displayName="TableRow";const it=m.forwardRef(({className:e,...s},r)=>t.jsx("th",{ref:r,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...s}));it.displayName="TableHead";const nt=m.forwardRef(({className:e,...s},r)=>t.jsx("td",{ref:r,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...s}));nt.displayName="TableCell";const gQ=m.forwardRef(({className:e,...s},r)=>t.jsx("caption",{ref:r,className:je("mt-4 text-sm text-muted-foreground",e),...s}));gQ.displayName="TableCaption";function yQ({user:e,onClose:s,onUpdate:r}){const[n,a]=m.useState(""),[i,o]=m.useState(e.membership_level),[l,c]=m.useState(e.referral_code||""),[d,u]=m.useState(e.email_verified),[h,p]=m.useState(e.email),[x,v]=m.useState(""),{toast:f}=bt(),{data:b,isLoading:y,error:g}=Ee({queryKey:["/api/admin/users",e.id],queryFn:async()=>{const M=await fetch(`/api/admin/users/${e.id}`);if(!M.ok)throw new Error("Failed to fetch user details");return M.json()}}),{data:j=[]}=Ee({queryKey:["/api/admin/vidmonkey/users"]}),{data:N,refetch:w}=Ee({queryKey:["/api/admin/users",e.id,"vidmonkey"],queryFn:async()=>j.find(C=>C.socialmonkey_id===e.id)||null,enabled:j.length>0}),S=ke({mutationFn:async()=>
654{await Fe("POST",`/api/admin/users/${e.id}/password`,{newPassword:n})},onSuccess:()=>{f({title:"Password updated successfully"}),a("")},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),k=ke({mutationFn:async()=>{await Fe("PATCH",`/api/admin/users/${e.id}/membership`,{membershipLevel:i})},onSuccess:()=>{f({title:"Membership tier updated successfully"}),r()},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),P=ke({mutationFn:async()=>{await Fe("PATCH",`/api/admin/users/${e.id}/referral-code`,{referralCode:l})},onSuccess:()=>{f({title:"Referral code updated successfully"}),r()},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),A=ke({mutationFn:async()=>{await Fe("PATCH",`/api/admin/users/${e.id}/verification`,{emailVerified:d})},onSuccess:()=>{f({title:"Verification status updated successfully"}),r()},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),$=ke({mutationFn:async()=>{await Fe("PATCH",`/api/admin/users/${e.id}/email`,{email:h})},onSuccess:()=>{f({title:"Email updated successfully"}),r()},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),_=ke({mutationFn:async()=>{await Fe("POST",`/api/admin/users/${e.id}/vidmonkey-link`,{vidmonkeyUserId:x})},onSuccess:()=>{f({title:"VidMonkey account linked successfully"}),v(""),w(),ee.invalidateQueries({queryKey:["/api/admin/vidmonkey/users"]})},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}}),O=ke({mutationFn:async()=>{await Fe("DELETE",`/api/admin/users/${e.id}/vidmonkey-link`,{})},onSuccess:()=>{f({title:"VidMonkey account unlinked successfully"}),w(),ee.invalidateQueries({queryKey:["/api/admin/vidmonkey/users"]})},onError:M=>{f({title:"Error",description:M.message,variant:"destructive"})}});return t.jsx(Ut,{open:!0,onOpenChange:s,children:t.jsxs(Ht,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[t.jsxs(xs,{children:[t.jsxs(gs,{"data-testid":"dialog-title-user-details",children:["Manage User: ",e.username]}),t.jsxs(Ns,{children:["User ID: ",e.id," • Joined ",$r(new Date(e.created_at),"MMM d, yyyy")]})]}),y?t.jsx("div",{className:"flex items-center justify-center py-8","data-testid":"loading-user-details",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):g?t.jsx("div",{className:"text-center py-8 text-destructive","data-testid":"error-user-details",children:"Failed to load user details. Please try again."}):t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"email",children:"Email Address"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{id:"email",type:"email",value:h,onChange:M=>p(M.target.value),"data-testid":"input-user-email"}),t.jsxs(T,{onClick:()=>$.mutate(),disabled:$.isPending||h===e.email,"data-testid":"button-update-email",children:[t.jsx(ri,{className:"h-4 w-4 mr-2"}),"Update"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"newPassword",children:"Change Password"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{id:"newPassword",type:"password",placeholder:"Enter new password (min 8 characters)",value:n,onChange:M=>a(M.target.value),"data-testid":"input-new-password"}),t.jsxs(T,{onClick:()=>S.mutate(),disabled:S.isPending||n.length<8,"data-testid":"button-change-password",children:[t.jsx(Bd,{className:"h-4 w-4 mr-2"}),"Update"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"membership",children:"Membership Tier"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(Nt,{value:i,onValueChange:o,children:[t.jsx(gt,{className:"flex-1","data-testid":"select-membership-tier",children:t.jsx(kt,{})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"trial",children:"Trial"}),t.jsx(Se,{value:"starter",children:"Starter"}),t.jsx(Se,{value:"professional",children:"Professional"}),t.jsx(Se,{value:"enterprise",children:"Enterprise"})]})]}),t.jsxs(T,{onClick:()=>k.mutate(),disabled:k.isPending||i===e.membership_level,"data-testid":"button-update-membership",children:[t.jsx(Y0,{className:"h-4 w-4 mr-2"}
654),"Update"]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"referralCode",children:"Referral Code"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ke,{id:"referralCode",value:l,onChange:M=>c(M.target.value),placeholder:"Enter referral code","data-testid":"input-referral-code"}),t.jsxs(T,{onClick:()=>P.mutate(),disabled:P.isPending||l===(e.referral_code||""),"data-testid":"button-update-referral-code",children:[t.jsx(ko,{className:"h-4 w-4 mr-2"}),"Update"]})]}),e.referred_by&&t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Referred by: ",e.referred_by_username," (ID: ",e.referred_by,")"]}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.referral_count," user",e.referral_count!==1?"s":""," referred by this code"]})]}),t.jsx("div",{className:"space-y-2",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx(ae,{htmlFor:"emailVerified",children:"Email Verification Status"}),e.verification_token&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Token: ",e.verification_token]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ul,{id:"emailVerified",checked:d,onCheckedChange:u,"data-testid":"switch-email-verified"}),t.jsx(T,{size:"sm",onClick:()=>A.mutate(),disabled:A.isPending||d===e.email_verified,"data-testid":"button-update-verification",children:"Update"})]})]})}),t.jsxs("div",{className:"space-y-2 border-t pt-4",children:[t.jsxs(ae,{className:"flex items-center gap-2",children:[t.jsx(Xr,{className:"h-4 w-4 text-purple-600"}),"VidMonkey Account Connection"]}),N?t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"p-3 bg-purple-50 dark:bg-purple-950/20 border border-purple-200 dark:border-purple-800 rounded-md",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Connected to: ",N.email]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["VidMonkey User ID: ",N.id]})]}),t.jsx(T,{variant:"destructive",size:"sm",onClick:()=>O.mutate(),disabled:O.isPending,"data-testid":"button-unlink-vidmonkey",children:O.isPending?"Unlinking...":"Unlink VidMonkey Account"})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(Nt,{value:x,onValueChange:v,children:[t.jsx(gt,{className:"flex-1","data-testid":"select-vidmonkey-user",children:t.jsx(kt,{placeholder:"Select VidMonkey user..."})}),t.jsx(yt,{children:j.filter(M=>!M.socialmonkey_id).map(M=>t.jsx(Se,{value:M.id,children:M.email},M.id))})]}),t.jsxs(T,{onClick:()=>_.mutate(),disabled:_.isPending||!x,"data-testid":"button-link-vidmonkey",children:[t.jsx(Xr,{className:"h-4 w-4 mr-2"}),"Link"]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Link this SocialMonkey user to a VidMonkey account to sync videos"})]})]}),b&&b.referrals.length>0&&t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ae,{children:["Users Referred (",b.referrals.length,")"]}),t.jsx("div",{className:"border rounded-md",children:t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"Username"}),t.jsx(it,{children:"Email"}),t.jsx(it,{children:"Tier"}),t.jsx(it,{children:"Joined"})]})}),t.jsx(di,{children:b.referrals.map(M=>t.jsxs(Os,{children:[t.jsx(nt,{"data-testid":`text-referral-username-${M.id}`,children:M.username}),t.jsx(nt,{className:"text-sm text-muted-foreground",children:M.email}),t.jsx(nt,{children:t.jsx(xe,{variant:"secondary",children:M.membership_level})}),t.jsx(nt,{className:"text-sm text-muted-foreground",children:$r(new Date(M.created_at),"MMM d, yyyy")})]},M.id))})]})})]})]}),t.jsx(rd,{children:t.jsx(T,{variant:"outline",onClick:s,"data-testid":"button-close-dialog",children:"Close"})})]})})}function vQ(){var f,b,y,g,j,N,w;const[e,s]=m.useState(null),[r,n]=m.useState(!1),{data:a,isLoading:i}=Ee({queryKey:["/api/admin/funnel"]}),{data:o,isLoading:l}=Ee({queryKey:["/api/admin/funnel",e==null?void 0:e.key],enabled:!!(e!=null&&e.key)&&r}),c=S=>{s(S),n(!0)};if(i)return t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Mc,{className:"h-5 w-5"}),"User Conversion Funnel"]}),t.jsx(Ze,{children:"Track user progression through key milestones"})]}),t.jsx(de,{className:"flex items-center justify-center py-12",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-muted-foreground"})})]});const d=(a==null?void 0:a.stages)||[],u=d.length>0?Math.max(...d.map(S=>S.count)):1,h=["bg-blue-500","bg-cyan-500","bg-teal-500","bg-emerald-500","bg-green-500","bg-lime-500"],p=[t.jsx(Hn,{className:"h-4 w-4"},"signup"),t.jsx(ri,{className:"h-4 w-4"},"email"),t.jsx(jn,{className:"h-4 w-4"},"social"),t.jsx(Ft,{className:"h-4 w-4"},"image"),t.jsx(ws,{className:"h-4 w-4"},"schedule"),t.jsx(Y0,{className:"h-4 w-4"},"upgrade")],x=S=>h[S%h.length],v=S=>p[S%p.length];return t.jsxs(t.Fragment,{children:[t.jsx(Ut,{open:r,onOpenChange:n,children:t.jsxs(Ht,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[t.jsxs(xs,{children:[t.jsxs(gs,{className:"flex items-center gap-2",children:[e==null?void 0:e.name," Users",t.jsx(xe,{variant:"secondary",children:(e==null?void 0:e.count)||0})]}),t.jsx(Ns,{children:"Users at this stage of the conversion funnel"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:l?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"Username"}),t.jsx(it,{children:"Email"}),t.jsx(it,{children:"Tier"}),t.jsx(it,{children:"Verified"}),t.jsx(it,{children:"Joined"})]})}),t.jsxs(di,{children:[(f=o==null?void 0:o.users)==null?void 0:f.map(S=>t.jsxs(Os,{"data-testid":`funnel-user-row-${S.id}`,children:[t.jsx(nt,{className:"font-medium",children:S.username}),t.jsx(nt,{className:"text-muted-foreground text-sm",children:S.email}),t.jsx(nt,{children:t.jsx(xe,{variant:S.membership_level==="trial"?"secondary":"default",children:S.membership_level})}),t.jsx(nt,{children:S.email_verified?t.jsx(ot,{className:"h-4 w-4 text-green-500"}):t.jsx(Qr,{className:"h-4 w-4 text-muted-foreground"})}),t.jsx(nt,{className:"text-muted-foreground text-sm",children:S.created_at?$r(new Date(S.created_at),"MMM d, yyyy"):"-"})]},S.id)),(!(o!=null&&o.users)||o.users.length===0)&&t.jsx(Os,{children:t.jsx(nt,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No users at this stage"})})]})]})})]})}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Mc,{className:"h-5 w-5"}),"User Conversion Funnel"]}),t.jsx(Ze,{children:"Track user progression through key milestones. Click a stage to see users."})]}),t.jsxs(de,{children:[t.jsx("div",{className:"space-y-3",children:d.map((S,k)=>{var O;const P=u>0?S.count/u*100:0,A=k>0?d[k-1].count:S.count,$=A>0?(S.count/A*100).toFixed(1):"100",_=((O=d[0])==null?void 0:O.count)>0?(S.count/d[0].count*100).toFixed(1):"100";return t.jsxs("div",{className:"relative",children:[t.jsxs("div",{className:"flex items-center gap-4 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(S),"data-testid":`funnel-stage-${S.key}`,children:[t.jsxs("div",{className:"w-32 sm:w-40 flex items-center gap-2 text-sm font-medium shrink-0",children:[t.jsx("span",{className:`p-1.5 rounded ${x(k)} text-white`,children:v(k)}),t.jsx("span",{className:"truncate",children:S.name})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-10 bg-muted rounded-r-lg overflow-hidden relative",children:t.jsx("div",{className:`h-full ${x(k)} transition-all duration-500 ease-out rounded-r-lg flex items-center hover:brightness-110`,style:{width:`${Math.max(P,2)}%`,clipPath:k<d.length-1?"polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%)":void 0},children:t.jsx("span",{className:"absolute left-3 text-white font-bold text-sm drop-shadow",children:S.count.toLocaleStr
654ing()})})})}),t.jsxs("div",{className:"w-24 sm:w-32 text-right shrink-0",children:[k>0&&t.jsxs("div",{className:"text-xs space-y-0.5",children:[t.jsxs("div",{className:"text-muted-foreground",children:["Step: ",t.jsxs("span",{className:Number($)>=50?"text-green-500":Number($)>=25?"text-yellow-500":"text-red-500",children:[$,"%"]})]}),t.jsxs("div",{className:"text-muted-foreground",children:["Total: ",t.jsxs("span",{className:"font-medium",children:[_,"%"]})]})]}),k===0&&t.jsx("div",{className:"text-xs text-muted-foreground",children:"Baseline"})]})]}),k<d.length-1&&t.jsxs("div",{className:"flex items-center gap-4 py-1",children:[t.jsx("div",{className:"w-32 sm:w-40 shrink-0"}),t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(rf,{className:"h-3 w-3 text-muted-foreground rotate-90"})}),t.jsx("div",{className:"w-24 sm:w-32 shrink-0"})]})]},S.name)})}),d.length>=2&&t.jsx("div",{className:"mt-8 pt-6 border-t",children:t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[t.jsx(re,{className:"bg-muted/50",children:t.jsxs(de,{className:"pt-4 pb-3",children:[t.jsx("div",{className:"text-2xl font-bold","data-testid":"funnel-total-signups",children:((y=(b=d[0])==null?void 0:b.count)==null?void 0:y.toLocaleString())||0}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Signups"})]})}),t.jsx(re,{className:"bg-muted/50",children:t.jsxs(de,{className:"pt-4 pb-3",children:[t.jsxs("div",{className:"text-2xl font-bold text-green-500","data-testid":"funnel-overall-conversion",children:[d.length>=2&&((g=d[0])==null?void 0:g.count)>0?(d[d.length-1].count/d[0].count*100).toFixed(1):"0","%"]}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Overall Conversion"})]})}),t.jsx(re,{className:"bg-muted/50",children:t.jsxs(de,{className:"pt-4 pb-3",children:[t.jsxs("div",{className:"text-2xl font-bold","data-testid":"funnel-verified-connected",children:[d.length>=3&&((j=d[1])==null?void 0:j.count)>0?(d[2].count/d[1].count*100).toFixed(1):"0","%"]}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Verified to Connected"})]})}),t.jsx(re,{className:"bg-muted/50",children:t.jsxs(de,{className:"pt-4 pb-3",children:[t.jsxs("div",{className:"text-2xl font-bold","data-testid":"funnel-scheduled-upgraded",children:[d.length>=6&&((N=d[4])==null?void 0:N.count)>0&&((w=d[5])==null?void 0:w.count)!==void 0?(d[5].count/d[4].count*100).toFixed(1):"0","%"]}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Scheduled to Upgraded"})]})})]})}),t.jsx(bQ,{})]})]})]})}function bQ(){const{toast:e}=bt(),[s,r]=m.useState(null),[n,a]=m.useState({}),i=[{key:"unverified",label:"Unverified (Dropoffs)",description:"Signed up but never verified"},{key:"verified_inactive",label:"Verified but Inactive",description:"Verified but no account, no posts, no upgrade"}],o=[{key:"verified",label:"All Verified",description:"All users who verified their email"},{key:"connected",label:"Connected Account",description:"Has at least one social account connected"},{key:"has_posts",label:"Has Posts",description:"Has scheduled at least one post"},{key:"upgraded",label:"Paid Users",description:"Starter, Professional, or Enterprise tier"}],l=async d=>{r(d);try{const u=await fetch(`/api/admin/funnel/emails/${d}`,{credentials:"include"});if(!u.ok)throw new Error("Failed to fetch emails");const h=await u.json();if(a(x=>({...x,[d]:h.count})),h.emails.length===0){e({title:"No emails",description:"This segment has no users"});return}const p=h.emails.join(`
655`);try{await navigator.clipboard.writeText(p),e({title:"Copied to clipboard",description:`${h.count} email${h.count!==1?"s":""} copied`})}catch{const v=document.createElement("textarea");v.value=p,v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v),e({title:"Copied to clipboard",description:`${h.count} email${h.count!==1?"s":""} copied`})}}catch{e({title:"Error",description:"Failed to fetch emails",variant:"destructive"})}finally{r(null)}},c=(d,u)=>t.jsxs(T,{variant:"outline",className:`h-auto py-2 px-3 flex flex-col items-start gap-1 ${u}`,onClick:()=>l(d.key),disabled:s===d.key,"data-testid":`button-copy-emails-${d.key}`,children:[t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s===d.key?t.jsx(Qe,{className:"h-3 w-3 animate-spin"}
655):t.jsx(xa,{className:"h-3 w-3"}),t.jsx("span",{className:"font-medium text-xs",children:d.label}),n[d.key]!==void 0&&t.jsx(xe,{variant:"secondary",className:"ml-auto text-xs py-0 px-1.5",children:n[d.key]})]}),t.jsx("span",{className:"text-xs text-muted-foreground text-left leading-tight",children:d.description})]},d.key);return t.jsxs("div",{className:"mt-8 pt-6 border-t",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t.jsx(ri,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Email Segments for Outreach"})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"text-xs text-muted-foreground mb-2 flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Re-engagement (Dropoffs)"]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:i.map(d=>c(d,"border-red-500/30 hover:bg-red-500/10"))})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"text-xs text-muted-foreground mb-2 flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Active Users"]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:o.map(d=>c(d,"border-green-500/30 hover:bg-green-500/10"))})]})]})]})}function jQ(){const{toast:e}=bt(),[s,r]=m.useState(null),[n,a]=m.useState(""),[i,o]=m.useState(""),{data:l=[],isLoading:c,refetch:d}=Ee({queryKey:["/api/admin/affiliates"]}),u=ke({mutationFn:async({id:f,status:b,affiliateCode:y,adminNotes:g})=>(await Fe("PATCH",`/api/admin/affiliates/${f}`,{status:b,affiliateCode:y,adminNotes:g})).json(),onSuccess:()=>{e({title:"Success",description:"Application updated successfully"}),r(null),a(""),o(""),d()},onError:f=>{e({title:"Error",description:f.message,variant:"destructive"})}}),h=()=>{s&&u.mutate({id:s.id,status:"approved",affiliateCode:n||void 0,adminNotes:i||void 0})},p=()=>{s&&u.mutate({id:s.id,status:"rejected",adminNotes:i||void 0})},x=l.filter(f=>f.status==="pending"),v=l.filter(f=>f.status!=="pending");return t.jsxs("div",{className:"space-y-6",children:[t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(dP,{className:"h-5 w-5"}),"Affiliate Applications"]}),t.jsx(Ze,{children:"Review and manage affiliate program applications"})]}),t.jsx(de,{children:c?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin"})}):l.length===0?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No affiliate applications yet"}):t.jsxs("div",{className:"space-y-6",children:[x.length>0&&t.jsxs("div",{children:[t.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[t.jsx(ws,{className:"h-4 w-4 text-yellow-500"}),"Pending Applications (",x.length,")"]}),t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"User"}),t.jsx(it,{children:"Website"}),t.jsx(it,{children:"Promotion Plan"}),t.jsx(it,{children:"Submitted"}),t.jsx(it,{children:"Actions"})]})}),t.jsx(di,{children:x.map(f=>t.jsxs(Os,{children:[t.jsx(nt,{children:t.jsxs("div",{children:[t.jsx("p",{className:"font-medium",children:f.username||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:f.email}),t.jsx(xe,{variant:"outline",className:"mt-1 text-xs",children:f.membershipLevel||"N/A"})]})}),t.jsx(nt,{children:f.website?t.jsxs("a",{href:f.website.startsWith("http")?f.website:`https://${f.website}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[t.jsx(jn,{className:"h-3 w-3"}),f.website]}):t.jsx("span",{className:"text-muted-foreground",children:"-"})}),t.jsx(nt,{children:t.jsx("p",{className:"max-w-xs truncate",title:f.promotionPlan,children:f.promotionPlan})}),t.jsx(nt,{children:$r(new Date(f.submittedAt),"MMM d, yyyy")}),t.jsx(nt,{children:t.jsx(T,{size:"sm",onClick:()=>{r(f),a(""),o("")},"data-testid":`button-review-${f.id}`,children:"Review"})})]},f.id))})]})]}),v.length>0&&t.jsxs("div",{children:[t.jsxs("h3",{className:"font-semibold mb-3",children:["Reviewed Applications (",v.length,")"]}),t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"User"}),t.jsx(it,{children:"Status"}),t.jsx(it,{children:"Submitted"}),t.jsx(it,{children:"Reviewed"}),t.jsx(it,{children:"Notes"})]})}),t.jsx(di,{children:v.map(f=>t.jsxs(Os,{children:[t.jsx(nt,{children:t.jsxs("div",{children:[t.jsx("p",{className:"font-medium",children:f.username||"Unknown"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:f.email})]})}),t.jsx(nt,{children:t.jsx(xe,{variant:f.status==="approved"?"default":"destructive",children:f.status==="approved"?t.jsxs(t.Fragment,{children:[t.jsx(ot,{className:"h-3 w-3 mr-1"})," Approved"]}):t.jsxs(t.Fragment,{children:[t.jsx(Qr,{className:"h-3 w-3 mr-1"})," Rejected"]})})}),t.jsx(nt,{children:$r(new Date(f.submittedAt),"MMM d, yyyy")}),t.jsx(nt,{children:f.reviewedAt?$r(new Date(f.reviewedAt),"MMM d, yyyy"):"-"}),t.jsx(nt,{children:t.jsx("p",{className:"max-w-xs truncate text-muted-foreground",title:f.adminNotes||"",children:f.adminNotes||"-"})})]},f.id))})]})]})]})})]}),t.jsx(Ut,{open:s!==null,onOpenChange:()=>r(null),children:t.jsxs(Ht,{className:"max-w-lg",children:[t.jsxs(xs,{children:[t.jsx(gs,{children:"Review Affiliate Application"}),t.jsx(Ns,{children:"Review and approve or reject this affiliate application"})]}),s&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:"User"}),t.jsx("p",{className:"font-medium",children:s.username}),t.jsx("p",{className:"text-sm text-muted-foreground",children:s.email})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:"Membership"}),t.jsx("p",{children:s.membershipLevel||"N/A"})]})]}),s.website&&t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:"Website / Social"}),t.jsxs("a",{href:s.website.startsWith("http")?s.website:`https://${s.website}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[t.jsx(jn,{className:"h-3 w-3"}),s.website]})]}),t.jsxs("div",{children:[t.jsx(ae,{className:"text-muted-foreground",children:"Promotion Plan"}),t.jsx("p",{className:"text-sm bg-muted p-2 rounded-md mt-1",children:s.promotionPlan})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"affiliate-code",children:"Affiliate Code (optional)"}),t.jsx(Ke,{id:"affiliate-code",value:n,onChange:f=>a(f.target.value.toUpperCase()),placeholder:"e.g. JOHN20","data-testid":"input-affiliate-code-admin"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave blank to not assign a code, or enter a custom code for this affiliate"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"admin-notes",children:"Admin Notes (optional)"}),t.jsx(Ke,{id:"admin-notes",value:i,onChange:f=>o(f.target.value),placeholder:"Internal notes about this affiliate","data-testid":"input-admin-notes"})]})]}),t.jsxs(rd,{className:"gap-2",children:[t.jsxs(T,{variant:"destructive",onClick:p,disabled:u.isPending,"data-testid":"button-reject-affiliate",children:[u.isPending?t.jsx(Qe,{className:"h-4 w-4 animate-spin"}):t.jsx(Qr,{className:"h-4 w-4 mr-1"}),"Reject"]}),t.jsxs(T,{onClick:h,disabled:u.isPending,"data-testid":"button-approve-affiliate",children:[u.isPending?t.jsx(Qe,{className:"h-4 w-4 animate-spin"}):t.jsx(ot,{className:"h-4 w-4 mr-1"}),"Approve"]})]})]})})]})}function wQ(){const[e,s]=m.useState("welcome"),[r,n]=m.useState(""),[a,i]=m.useState(""),[o,l]=m.useState(!1),{toast:c}=bt(),d=async()=>
655{if(!r){c({title:"Error",description:"Please enter a recipient email",variant:"destructive"});return}l(!0);try{const x=await(await Fe("POST","/api/admin/send-test-email",{emailType:e,recipientEmail:r,recipientName:a||"Test User"})).json();x.success?(c({title:"Success",description:x.message}),n(""),i("")):c({title:"Failed",description:x.message||"Email send failed",variant:"destructive"})}catch(p){c({title:"Error",description:p.message||"Failed to send email",variant:"destructive"})}finally{l(!1)}},u=[{type:"welcome",name:"Welcome Email",description:"Sent after successful email verification. Includes Discord invite link and feature highlights.",subject:"Welcome to SocialMonkey - Your AI Social Media Companion!"},{type:"verification",name:"Verification Email",description:"Sent during registration with a 6-digit code that expires in 10 minutes.",subject:"Verify Your SocialMonkey Email"},{type:"password_reset",name:"Password Reset Email",description:"Sent when user requests password reset with a 6-digit code that expires in 10 minutes.",subject:"Reset Your SocialMonkey Password"}],h=u.find(p=>p.type===e);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(ri,{className:"h-5 w-5"}),"Email Templates"]}),t.jsx(Ze,{children:"Overview of automated email templates used by SocialMonkey"})]}),t.jsx(de,{children:t.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:u.map(p=>t.jsxs(re,{className:`cursor-pointer transition-colors ${e===p.type?"border-primary bg-primary/5":""}`,onClick:()=>s(p.type),children:[t.jsx(he,{className:"pb-2",children:t.jsxs(pe,{className:"text-sm flex items-center justify-between",children:[p.name,e===p.type&&t.jsx(ot,{className:"h-4 w-4 text-primary"})]})}),t.jsxs(de,{className:"space-y-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:p.description}),t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"font-medium",children:"Subject:"}),t.jsx("span",{className:"text-muted-foreground truncate",children:p.subject})]})]})]},p.type))})})]}),t.jsxs(re,{children:[t.jsxs(he,{children:[t.jsx(pe,{className:"flex items-center gap-2",children:"Send Test Email"}),t.jsxs(Ze,{children:["Send a test ",h==null?void 0:h.name.toLowerCase()," to preview how it looks"]})]}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"recipient-email",children:"Recipient Email *"}),t.jsx(Ke,{id:"recipient-email",type:"email",placeholder:"[email protected]",value:r,onChange:p=>n(p.target.value),"data-testid":"input-recipient-email"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"recipient-name",children:"Recipient Name (optional)"}),t.jsx(Ke,{id:"recipient-name",placeholder:"John Doe",value:a,onChange:p=>i(p.target.value),"data-testid":"input-recipient-name"})]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(Nt,{value:e,onValueChange:s,children:[t.jsx(gt,{className:"w-[200px]","data-testid":"select-email-type",children:t.jsx(kt,{})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"welcome",children:"Welcome Email"}),t.jsx(Se,{value:"verification",children:"Verification Email"}),t.jsx(Se,{value:"password_reset",children:"Password Reset Email"})]})]}),t.jsx(T,{onClick:d,disabled:o||!r,"data-testid":"button-send-test-email",children:o?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending..."]}):t.jsxs(t.Fragment,{children:[t.jsx(ri,{className:"h-4 w-4 mr-2"}),"Send Test Email"]})})]}),t.jsx("div",{className:"p-4 bg-muted rounded-md",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.jsx("strong",{children:"Note:"})," Test emails will be sent using the selected template. For verification and password reset emails, a random 6-digit code will be generated. The welcome email includes the Discord invite link from environment variables."]})})]})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{className:"text-sm",children:"Email Configuration"})}),t.jsx(de,{children:t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs(xe,{variant:"outline",className:"gap-1",children:[t.jsx(ot,{className:"h-3 w-3 text-green-500"}),"Resend Integration Active"]}),t.jsx(xe,{variant:"outline",className:"gap-1",children:"From: [email protected]"}),t.jsx(xe,{variant:"outline",className:"gap-1",children:"Auto Welcome: On Verification"})]})})]})]})}function NQ(){const[e,s]=m.useState("all"),[r,n]=m.useState("all"),[a,i]=m.useState(null),{toast:o}=bt(),l=new URLSearchParams;e!=="all"&&l.set("userId",e),r!=="all"&&l.set("platform",r);const{data:c,isLoading:d,isError:u,error:h,refetch:p}=Ee({queryKey:["/api/admin/platform-configs",{userFilter:e,platformFilter:r}],queryFn:async()=>{const b=`/api/admin/platform-configs${l.toString()?"?"+l.toString():""}`,y=await fetch(b);
655if(!y.ok)throw new Error("Failed to fetch platform configs");return y.json()},retry:1}),x=(b,y)=>{navigator.clipboard.writeText(b),o({title:`${y} copied to clipboard`})},v=b=>{switch(b){case"verified":return t.jsx(xe,{variant:"default",className:"bg-green-600",children:"Verified"});case"offline":return t.jsx(xe,{variant:"secondary",children:"Offline"});case"inactive":return t.jsx(xe,{variant:"outline",children:"Inactive"});case"disconnected":return t.jsx(xe,{variant:"destructive",children:"Disconnected"});default:return t.jsx(xe,{variant:"outline",children:b||"Unknown"})}},f=b=>({twitter:"X (Twitter)",facebook:"Facebook",instagram:"Instagram",linkedin:"LinkedIn",reddit:"Reddit",tiktok:"TikTok"})[b]||b;return t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Bd,{className:"h-5 w-5"}),"Platform Configurations"]}),t.jsxs(Ze,{children:[(c==null?void 0:c.configs.length)||0," platform configs found"]})]}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsxs(Nt,{value:e,onValueChange:s,children:[t.jsx(gt,{className:"w-[160px]","data-testid":"select-platform-user-filter",children:t.jsx(kt,{placeholder:"Filter by user"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All Users"}),c==null?void 0:c.users.map(b=>t.jsx(Se,{value:b.id.toString(),children:b.username},b.id))]})]}),t.jsxs(Nt,{value:r,onValueChange:n,children:[t.jsx(gt,{className:"w-[160px]","data-testid":"select-platform-filter",children:t.jsx(kt,{placeholder:"Filter by platform"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All Platforms"}),c==null?void 0:c.platforms.map(b=>t.jsx(Se,{value:b,children:f(b)},b))]})]}),t.jsx(T,{variant:"outline",size:"sm",onClick:()=>p(),"data-testid":"button-refresh-platforms",children:"Refresh"})]})]})}),t.jsx(de,{children:d?t.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[t.jsx(Qe,{className:"h-8 w-8 animate-spin mx-auto mb-2"}),"Loading platform configs..."]}):u?t.jsxs("div",{className:"text-center py-8 space-y-3",children:[t.jsx("p",{className:"text-destructive font-medium",children:"Failed to load platform configs"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:h instanceof Error?h.message:"An unknown error occurred"}),t.jsx(T,{variant:"outline",onClick:()=>p(),"data-testid":"button-retry-platforms",children:"Try Again"})]}):!(c!=null&&c.configs)||c.configs.length===0?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No platform configs found"}):t.jsx("div",{className:"border rounded-md",children:t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{className:"w-[50px]",children:"ID"}),t.jsx(it,{children:"User"}),t.jsx(it,{children:"Platform"}),t.jsx(it,{children:"Account"}),t.jsx(it,{className:"text-center",children:"Status"}),t.jsx(it,{className:"text-center",children:"Posts"}),t.jsx(it,{className:"text-center",children:"Replies"}),t.jsx(it,{className:"text-center",children:"OAuth"})]})}),t.jsx(di,{children:c.configs.map(b=>{const y=a===b.id,g=b.oauthCredentials||{},j=g.selectedPageName||g.username||g.screen_name||g.subredditName||"N/A";return t.jsxs(m.Fragment,{children:[t.jsxs(Os,{"data-testid":`row-platform-${b.id}`,className:"cursor-pointer hover-elevate",onClick:()=>i(y?null:b.id),children:[t.jsx(nt,{className:"font-mono text-sm","data-testid":`text-config-id-${b.id}`,children:b.id}),t.jsx(nt,{"data-testid":`text-config-user-${b.id}`,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-medium",children:b.username}),t.jsx("span",{className:"text-xs text-muted-foreground",children:b.email})]})}),t.jsx(nt,{"data-testid":`text-config-platform-${b.id}`,children:t.jsx(xe,{variant:"outline",children:f(b.platformName)})}),t.jsx(nt,{"data-testid":`text-config-account-${b.id}`,children:j}),t.jsx(nt,{className:"text-center",children:v(b.connectionStatus)}),t.jsx(nt,{className:"text-center font-mono","data-testid":`text-config-posts-${b.id}`,children:b.postCount}),t.jsx(nt,{className:"text-center font-mono","data-testid":`text-config-replies-${b.id}`,children:b.replyCount}),t.jsx(nt,{className:"text-center",children:t.jsx(T,{variant:"ghost",size:"icon",onClick:N=>{N.stopPropagation(),i(y?null:b.id)},"data-testid":`button-expand-${b.id}`,children:y?t.jsx(Qr,{className:"h-4 w-4"}):t.jsx(Bd,{className:"h-4 w-4"})})})]}),y&&t.jsx(Os,{className:"bg-muted/30",children:t.jsx(nt,{colSpan:8,className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("h4",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx(Bd,{className:"h-4 w-4"}),"OAuth Credentials for ",f(b.platformName)]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[g.accessToken&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Access Token"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono truncate max-w-[300px]",children:[g.accessToken.substring(0,40),"..."]}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.accessToken,"Access Token"),"data-testid":`button-copy-token-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.accessTokenSecret&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Access Token Secret"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono truncate max-w-[300px]",children:[g.accessTokenSecret.substring(0,20),"..."]}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.accessTokenSecret,"Token Secret"),"data-testid":`button-copy-secret-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.refreshToken&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Refresh Token"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono truncate max-w-[300px]",children:[g.refreshToken.substring(0,30),"..."]}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.refreshToken,"Refresh Token"),"data-testid":`button-copy-refresh-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.pageAccessToken&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Page Access Token"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono truncate max-w-[300px]",children:[g.pageAccessToken.substring(0,40),"..."]}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.pageAccessToken,"Page Token"),"data-testid":`button-copy-page-token-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.userId&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"User/Account ID"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono",children:g.userId}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.userId,"User ID"),"data-testid":`button-copy-userid-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.selectedPageId&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Selected Page ID"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono",children:g.selectedPageId}),t.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>x(g.selectedPageId,"Page ID"),"data-testid":`button-copy-pageid-${b.id}`,children:t.jsx(ko,{className:"h-3 w-3"})})]})]}),g.expiresAt&&t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Expires At"}),t.jsx("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono",children:$r(new Date(g.expiresAt),"MMM d, yyyy HH:mm")}
655)]}),g.scope&&t.jsxs("div",{className:"space-y-1 col-span-2",children:[t.jsx(ae,{className:"text-xs text-muted-foreground",children:"Scopes"}),t.jsx("code",{className:"bg-background px-2 py-1 rounded text-xs font-mono block break-all",children:g.scope})]})]}),g.availablePages&&g.availablePages.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsxs(ae,{className:"text-xs text-muted-foreground mb-2 block",children:["Available Pages (",g.availablePages.length,")"]}),t.jsx("div",{className:"flex flex-wrap gap-2",children:g.availablePages.map((N,w)=>t.jsxs(xe,{variant:N.pageId===g.selectedPageId?"default":"outline",className:"text-xs",children:[N.pageName||N.pageId,N.pageId===g.selectedPageId&&" (Selected)"]},w))})]})]})})},`${b.id}-details`)]},b.id)})})]})})})]})}function kQ(){const[e,s]=m.useState(100),{data:r,isLoading:n,isError:a,error:i,refetch:o}=Ee({queryKey:["/api/admin/extension-logs",{limit:e}],queryFn:async()=>{const d=await fetch(`/api/admin/extension-logs?limit=${e}`);if(!d.ok)throw new Error("Failed to fetch extension logs");return d.json()},retry:1,refetchInterval:3e4}),l=d=>{switch(d){case"error":return"destructive";case"warn":return"default";case"info":return"secondary";case"debug":return"outline";default:return"outline"}},c=d=>d.includes("completed")?"secondary":d.includes("Evaluating")?"outline":d.includes("failed")||d.includes("error")?"destructive":"outline";return t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(pP,{className:"h-5 w-5"}),"Chrome Extension API Requests"]}),t.jsxs(Ze,{children:[(r==null?void 0:r.returned)||0," extension requests logged"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(Nt,{value:e.toString(),onValueChange:d=>s(parseInt(d)),children:[t.jsx(gt,{className:"w-[120px]","data-testid":"select-extension-limit",children:t.jsx(kt,{})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"50",children:"50 logs"}),t.jsx(Se,{value:"100",children:"100 logs"}),t.jsx(Se,{value:"200",children:"200 logs"}),t.jsx(Se,{value:"500",children:"500 logs"})]})]}),t.jsx(T,{variant:"outline",size:"sm",onClick:()=>o(),"data-testid":"button-refresh-extension-logs",children:"Refresh"})]})]})}),t.jsx(de,{children:n?t.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[t.jsx(Qe,{className:"h-8 w-8 animate-spin mx-auto mb-2"}),"Loading extension logs..."]}):a?t.jsxs("div",{className:"text-center py-8 space-y-3",children:[t.jsx("p",{className:"text-destructive font-medium",children:"Failed to load extension logs"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:i instanceof Error?i.message:"An unknown error occurred"}),t.jsx(T,{variant:"outline",onClick:()=>o(),"data-testid":"button-retry-extension-logs",children:"Try Again"})]}):!(r!=null&&r.logs)||r.logs.length===0?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No extension requests logged yet"}):t.jsx("div",{className:"border rounded-md",children:t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"Time"}),t.jsx(it,{children:"User"}),t.jsx(it,{children:"Platform"}),t.jsx(it,{children:"Action"}),t.jsx(it,{className:"text-center",children:"Tweets"}),t.jsx(it,{children:"Status"})]})}),t.jsx(di,{children:r.logs.map(d=>t.jsxs(Os,{"data-testid":`row-extension-log-${d.id}`,children:[t.jsx(nt,{className:"whitespace-nowrap text-sm","data-testid":`text-ext-time-${d.id}`,children:$r(new Date(d.timestamp),"MMM d, HH:mm:ss")}),t.jsx(nt,{"data-testid":`text-ext-user-${d.id}`,children:d.username?t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-medium",children:d.username}),t.jsx("span",{className:"text-xs text-muted-foreground",children:d.email})]}):t.jsx("span",{className:"text-muted-foreground",children:"Unknown"})}),t.jsx(nt,{"data-testid":`text-ext-platform-${d.id}`,children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(m7,{className:"h-4 w-4"}),t.jsx("span",{children:"X"})]})}),t.jsx(nt,{"data-testid":`text-ext-action-${d.id}`,children:t.jsx(xe,{variant:c(d.message),children:d.message.includes("Evaluating")?"Evaluate":d.message.includes("completed")?"Complete":d.message.includes("mismatch")?"Mismatch":d.message})}),t.jsx(nt,{className:"text-center","data-testid":`text-ext-tweets-${d.id}`,children:d.tweetCount!==null?t.jsxs("span",{className:"font-mono",children:[d.tweetCount,d.outputCount!==null&&d.outputCount!==d.tweetCount&&t.jsxs("span",{className:"text-yellow-500 ml-1",children:["→",d.outputCount]})]}):"-"}),t.jsx(nt,{"data-testid":`text-ext-status-${d.id}`,children:t.jsx(xe,{variant:l(d.level),children:d.level.toUpperCase()})})]},d.id))})]})})})]})}function SQ(){const[e,s]=m.useState("all"),[r,n]=m.useState("all"),[a,i]=m.useState("desc"),[o,l]=m.useState(100),{data:c,isLoading:d,isError:u,error:h,refetch:p}=Ee({queryKey:["/api/logs",{level:e,tag:r,order:a,limit:o}],queryFn:async()=>{const b=new URLSearchParams({...e!=="all"&&{level:e},...r!=="all"&&{tag:r},order:a,limit:o.toString()}),y=await fetch(`/api/logs?${b}`);if(!y.ok)throw new Error("Failed to fetch logs");return y.json()},retry:1}),x=Array.from(new Set(((c==null?void 0:c.logs)||[]).map(b=>
655b.tag).filter(Boolean))).sort(),v=b=>{switch(b){case"error":return"destructive";case"warn":return"default";case"info":return"secondary";case"debug":return"outline";default:return"outline"}},f=b=>{if(!b)return null;if(typeof b=="string")try{return JSON.stringify(JSON.parse(b),null,2)}catch{return b}return JSON.stringify(b,null,2)};return t.jsxs(re,{children:[t.jsx(he,{children:t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(mi,{className:"h-5 w-5"}),"System Logs"]}),t.jsxs(Ze,{children:[(c==null?void 0:c.returned)||0," logs displayed"]})]})})}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs(Nt,{value:e,onValueChange:s,children:[t.jsxs(gt,{className:"w-[140px]","data-testid":"select-log-level",children:[t.jsx(uw,{className:"h-4 w-4 mr-2"}),t.jsx(kt,{placeholder:"All Levels"})]}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All Levels"}),t.jsx(Se,{value:"error",children:"Error"}),t.jsx(Se,{value:"warn",children:"Warn"}),t.jsx(Se,{value:"info",children:"Info"}),t.jsx(Se,{value:"debug",children:"Debug"})]})]}),t.jsxs(Nt,{value:r,onValueChange:n,children:[t.jsxs(gt,{className:"w-[160px]","data-testid":"select-log-tag",children:[t.jsx(uw,{className:"h-4 w-4 mr-2"}),t.jsx(kt,{placeholder:"All Tags"})]}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All Tags"}),x.map(b=>t.jsx(Se,{value:b,children:b},b))]})]}),t.jsxs(Nt,{value:a,onValueChange:b=>i(b),children:[t.jsxs(gt,{className:"w-[160px]","data-testid":"select-log-order",children:[t.jsx(aP,{className:"h-4 w-4 mr-2"}),t.jsx(kt,{})]}),t.jsxs(yt,{children:[t.jsx(Se,{value:"desc",children:"Newest First"}),t.jsx(Se,{value:"asc",children:"Oldest First"})]})]}),t.jsxs(Nt,{value:o.toString(),onValueChange:b=>l(parseInt(b)),children:[t.jsx(gt,{className:"w-[120px]","data-testid":"select-log-limit",children:t.jsx(kt,{})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"50",children:"50 logs"}),t.jsx(Se,{value:"100",children:"100 logs"}),t.jsx(Se,{value:"200",children:"200 logs"}),t.jsx(Se,{value:"500",children:"500 logs"})]})]}),(e!=="all"||r!=="all")&&t.jsx(T,{variant:"outline",size:"sm",onClick:()=>{s("all"),n("all")},"data-testid":"button-clear-filters",children:"Clear Filters"})]}),d?t.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[t.jsx(Qe,{className:"h-8 w-8 animate-spin mx-auto mb-2"}),"Loading logs..."]}):u?t.jsxs("div",{className:"text-center py-8 space-y-3",children:[t.jsx("p",{className:"text-destructive font-medium",children:"Failed to load logs"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:h instanceof Error?h.message:"An unknown error occurred"}),t.jsx(T,{variant:"outline",onClick:()=>p(),"data-testid":"button-retry-logs",children:"Try Again"})]}):!(c!=null&&c.logs)||c.logs.length===0?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No logs found"}):t.jsx("div",{className:"space-y-2",children:c.logs.map((b,y)=>t.jsx(re,{className:"p-4","data-testid":`log-entry-${y}`,children:t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx(xe,{variant:v(b.level),"data-testid":`badge-level-${y}`,children:b.level.toUpperCase()}),b.tag&&t.jsx(xe,{variant:"outline","data-testid":`badge-tag-${y}`,children:b.tag}),t.jsx(xe,{variant:"outline",className:"font-mono text-xs",children:b.environment})]}),t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap","data-testid":`text-timestamp-${y}`,children:$r(new Date(b.timestamp),"MMM d, yyyy HH:mm:ss")})]}),t.jsx("p",{className:"text-sm font-medium","data-testid":`text-message-${y}`,children:b.message}),b.source_file&&t.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:b.source_file}),b.metadata&&t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"View metadata"}),t.jsx("pre",{className:"mt-2 p-2 bg-muted rounded text-xs overflow-x-auto","data-testid":`metadata-${y}`,children:f(b.metadata)})]})]})},y))})]})]})}function CQ(){const[e,s]=m.useState("7d"),[r,n]=m.useState(null),{data:a=[],isLoading:i,error:o}=Ee({queryKey:["/api/admin/image-usage",{range:e}],queryFn:async()=>{const h=await fetch(`/api/admin/image-usage?range=${e}`);if(!h.ok)throw new Error("Failed to fetch image usage");return h.json()}}),{data:l,isLoading:c,error:d}=Ee({queryKey:["/api/admin/image-usage",r,{range:e}],queryFn:async()=>{const h=await fetch(`/api/admin/image-usage/${r}?range=${e}`);if(!h.ok)throw new Error("Failed to fetch user images");return h.json()},enabled:r!==null}),u=a.reduce((h,p)=>h+p.imageCount,0);return r!==null?t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(T,{variant:"ghost",size:"sm",onClick:()=>n(null),"data-testid":"button-back-to-list",children:[t.jsx(Qo,{className:"h-4 w-4 mr-1"}),"Back"]}),t.jsx(pe,{className:"text-lg",children:l?`${l.username}'s Images (${l.images.length})`:"Loading..."})]})}),t.jsx(de,{children:c?t.jsx("div",{className:"flex justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin"})}):d?t.jsx("p",{className:"text-destructive text-center py-8",children:"Failed to load images. Please try again."}):!l||l.images.length===0?t.jsx("p",{className:"text-muted-foreground text-center py-8",children:"No images found for this period"}):t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:l.images.map(h=>t.jsxs("div",{className:"space-y-2","data-testid":`image-item-${h.id}`,children:[h.imageUrl?t.jsx("a",{href:ft(h.imageUrl),target:"_blank",rel:"noopener noreferrer",className:"block",children:t.jsxs("div",{className:"aspect-square rounded-lg overflow-hidden bg-muted relative group",children:[t.jsx("img",{src:ft(h.imageUrl),alt:`Generated ${h.id}`,className:"w-full h-full object-cover",loading:"lazy"}),t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:t.jsx(wa,{className:"h-6 w-6 text-white"})})]})}):t.jsx("div",{className:"aspect-square rounded-lg bg-muted flex items-center justify-center",children:t.jsx(Ft,{className:"h-8 w-8 text-muted-foreground"})}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[t.jsx("p",{className:"truncate",children:h.model.replace("fal-ai/","")}),t.jsx("p",{children:$r(new Date(h.createdAt),"MMM d, HH:mm")}
655),t.jsx(xe,{variant:"outline",className:"text-xs mt-1",children:h.source})]})]},h.id))})})]}):t.jsxs(re,{children:[t.jsx(he,{children:t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Ft,{className:"h-5 w-5"}),"Image Generation Usage"]}),t.jsxs(Ze,{children:[u," total images generated by ",a.length," users"]})]}),t.jsxs(Nt,{value:e,onValueChange:s,children:[t.jsx(gt,{className:"w-[180px]","data-testid":"select-time-range",children:t.jsx(kt,{placeholder:"Select time range"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"24h",children:"Last 24 Hours"}),t.jsx(Se,{value:"7d",children:"Last 7 Days"}),t.jsx(Se,{value:"this-month",children:"This Month"}),t.jsx(Se,{value:"last-month",children:"Last Month"})]})]})]})}),t.jsx(de,{children:i?t.jsx("div",{className:"flex justify-center py-8",children:t.jsx(Qe,{className:"h-6 w-6 animate-spin"})}):o?t.jsx("p",{className:"text-destructive text-center py-8",children:"Failed to load image usage data. Please try again."}):a.length===0?t.jsx("p",{className:"text-muted-foreground text-center py-8",children:"No image generations found for this period"}):t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{children:"User"}),t.jsx(it,{className:"text-right",children:"Images Generated"})]})}),t.jsx(di,{children:a.map(h=>t.jsxs(Os,{className:"cursor-pointer hover-elevate",onClick:()=>n(h.userId),"data-testid":`row-user-${h.userId}`,children:[t.jsx(nt,{className:"font-medium",children:h.username||`User #${h.userId}`}),t.jsx(nt,{className:"text-right",children:t.jsx(xe,{variant:"secondary",children:h.imageCount})})]},h.userId))})]})})]})}function PQ(){var _,O,M;const[e,s]=m.useState(""),[r,n]=m.useState(null),[a,i]=m.useState(null),[o,l]=m.useState(1),[c,d]=m.useState("created_at"),[u,h]=m.useState("desc"),[p,x]=m.useState("all"),[v,f]=m.useState(new Set),{toast:b}=bt(),{data:y,isLoading:g}=Ee({queryKey:["/api/admin/analytics"],refetchInterval:3e4}),{data:j,isLoading:N,refetch:w}=Ee({queryKey:["/api/admin/users",{page:o,search:e,sortBy:c,sortOrder:u,tier:p}],queryFn:async()=>{const C=new URLSearchParams({page:o.toString(),limit:"50",sortBy:c,sortOrder:u,...e&&{search:e},...p!=="all"&&{tier:p}}),L=await fetch(`/api/admin/users?${C}`);if(!L.ok)throw new Error("Failed to fetch users");return L.json()}}),S=C=>{f(L=>{const W=new Set(L);return W.has(C)?W.delete(C):W.add(C),W})},k=()=>{j!=null&&j.users&&(v.size===j.users.length?f(new Set):f(new Set(j.users.map(C=>C.id))))},P=async()=>{if(j!=null&&j.users){const C=j.users.filter(L=>v.has(L.id)).map(L=>L.email).join(", ");try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(C),b({title:"Emails copied",description:`${v.size} email(s) copied to clipboard`});else{const L=document.createElement("textarea");L.value=C,document.body.appendChild(L),L.select(),document.execCommand("copy"),document.body.removeChild(L),b({title:"Emails copied",description:`${v.size} email(s) copied to clipboard`})}}catch{b({title:"Copy failed",description:"Could not copy emails to clipboard",variant:"destructive"})}}},A=ke({mutationFn:async C=>{const L=await fetch(`/api/admin/users/${C}`,{method:"DELETE",credentials:"include"});if(!L.ok){const W=await L.json();throw new Error(W.message||"Failed to delete user")}return L.json()},onSuccess:C=>{const L=C.summary;b({title:"✅ User deleted successfully",description:`Removed ${L.totalRecordsDeleted} records from ${L.tablesAffected} tables`}),i(null),ee.invalidateQueries({queryKey:["/api/admin/users"]})},onError:C=>{b({title:"Error",description:C.message,variant:"destructive"})}}),$=C=>{const L=C.toLowerCase();return L==="enterprise"||L==="professional"?"default":L==="starter"?"secondary":"outline"};return t.jsxs("div",{className:"space-y-6 max-w-full overflow-x-hidden",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Rc,{className:"h-8 w-8 text-primary"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl sm:text-3xl font-bold","data-testid":"text-admin-title",children:"Admin Dashboard"}),t.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Administrative controls and system management"})]})]}),t.jsxs(sd,{defaultValue:"users",className:"w-full",children:[t.jsxs(dl,{"data-testid":"tabs-admin",className:"w-full justify-start overflow-x-auto flex-nowrap h-auto",children:[t.jsxs(hs,{value:"users","data-testid":"tab-users",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(Hn,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Users"})]}),t.jsxs(hs,{value:"platforms","data-testid":"tab-platforms",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(Bd,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Platforms"})]}),t.jsxs(hs,{value:"extension","data-testid":"tab-extension",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(pP,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Extension"})]}),t.jsxs(hs,{value:"logs","data-testid":"tab-logs",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(mi,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Logs"})]}),t.jsxs(hs,{value:"email","data-testid":"tab-email",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(ri,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Email"})]}),t.jsxs(hs,{value:"affiliates","data-testid":"tab-affiliates",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(dP,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Affiliates"})]}),t.jsxs(hs,{value:"images","data-testid":"tab-images",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(Ft,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Images"})]}),t.jsxs(hs,{value:"funnel","data-testid":"tab-funnel",className:"px-2 sm:px-3 gap-1 sm:gap-2 flex-shrink-0",children:[t.jsx(Mc,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Funnel"})]})]}),t.jsxs(ps,{value:"users",className:"mt-6 space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[t.jsxs(re,{children:[t.jsxs(he,{className:"pb-2",children:[t.jsx(Ze,{children:"Total Users"}),t.jsx(pe,{className:"text-2xl",children:g?t.jsx(Qe,{className:"h-5 w-5 animate-spin"}):(y==null?void 0:y.totalUsers)??0})]}),t.jsx(de,{children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",(y==null?void 0:y.newToday)??0," today"]})})]}),t.jsxs(re,{children:[t.jsxs(he,{className:"pb-2",children:[t.jsxs(Ze,{className:"flex items-center gap-1",children:[t.jsx(Q0,{className:"h-3 w-3"})," Daily Active"]}),t.jsx(pe,{className:"text-2xl",children:g?t.jsx(Qe,{className:"h-5 w-5 animate-spin"}):((_=y==null?void 0:y.activeUsers)==null?void 0:_.daily)??0})]}),t.jsx(de,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Last 24 hours"})})]}),t.jsxs(re,{children:[t.jsxs(he,{className:"pb-2",children:[t.jsxs(Ze,{className:"flex items-center gap-1",children:[t.jsx(rf,{className:"h-3 w-3"})," Weekly Active"]}),t.jsx(pe,{className:"text-2xl",children:g?t.jsx(Qe,{className:"h-5 w-5 animate-spin"}):((O=y==null?void 0:y.activeUsers)==null?void 0:O.weekly)??0})]}),t.jsx(de,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Last 7 days"})})]}),t.jsxs(re,{children:[t.jsxs(he,{className:"pb-2",children:[t.jsxs(Ze,{className:"flex items-center gap-1",children:[t.jsx(h7,{className:"h-3 w-3"})," Monthly Active"]}),t.jsx(pe,{className:"text-2xl",children:g?t.jsx(Qe,{className:"h-5 w-5 animate-spin"}):((M=y==null?void 0:y.activeUsers)==null?void 0:M.monthly)??0})]}),t.jsx(de,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"Last 30 days"})})]})]}),(y==null?void 0:y.onlineNow)&&y.onlineNow.length>0&&t.jsxs(re,{children:[t.jsx(he,{className:"pb-3",children:t.jsxs(pe,{className:"text-sm flex items-center gap-2",children:[t.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}),"Online Now (",y.onlineNow.length,")"]})}),t.jsx(de,{children:t.jsx("div",{className:"flex flex-wrap gap-2",children:y.onlineNow.map(C=>t.jsxs(xe,{variant:"outline",className:"gap-1",children:[t.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),C.username,t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",C.membership_level,")"]})]},C.id))})})]}),t.jsxs(re,{children:[t.jsx(he,{children:t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("div",{children:[t.jsxs(pe,{className:"flex items-center gap-2",children:[t.jsx(Hn,{className:"h-5 w-5"}),"User Management"]}),t.jsxs(Ze,{children:[(j==null?void 0:j.pagination.total)||0," total users"]})]})})}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[t.jsx(J0,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t.jsx(Ke,{placeholder:"Search by username or email...",value:e,onCh
655ange:C=>{s(C.target.value),f(new Set),l(1)},className:"pl-9","data-testid":"input-search-users"})]}),t.jsxs(Nt,{value:p,onValueChange:C=>{x(C),f(new Set),l(1)},children:[t.jsx(gt,{className:"w-[140px]","data-testid":"select-tier-filter",children:t.jsx(kt,{placeholder:"All Tiers"})}),t.jsxs(yt,{children:[t.jsx(Se,{value:"all",children:"All Tiers"}),t.jsx(Se,{value:"trial",children:"Trial"}),t.jsx(Se,{value:"starter",children:"Starter"}),t.jsx(Se,{value:"professional",children:"Professional"}),t.jsx(Se,{value:"enterprise",children:"Enterprise"})]})]}),t.jsxs(Nt,{value:c,onValueChange:C=>{d(C),f(new Set),l(1)},children:[t.jsxs(gt,{className:"w-[140px]","data-testid":"select-sort-by",children:[t.jsx(aP,{className:"h-4 w-4 mr-2"}),t.jsx(kt,{})]}),t.jsxs(yt,{children:[t.jsx(Se,{value:"created_at",children:"Join Date"}),t.jsx(Se,{value:"membership_level",children:"Tier"}),t.jsx(Se,{value:"username",children:"Username"}),t.jsx(Se,{value:"last_activity_at",children:"Last Active"})]})]}),t.jsx(T,{variant:"outline",size:"icon",onClick:()=>{h(C=>C==="asc"?"desc":"asc"),f(new Set)},"data-testid":"button-toggle-sort",children:u==="asc"?"↑":"↓"}),v.size>0&&t.jsxs(T,{variant:"outline",onClick:P,"data-testid":"button-copy-emails",children:[t.jsx(xa,{className:"h-4 w-4 mr-2"}),"Copy ",v.size," Email(s)"]})]}),N?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading users..."}):!(j!=null&&j.users)||j.users.length===0?t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No users found"}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"border rounded-md",children:t.jsxs(li,{children:[t.jsx(ci,{children:t.jsxs(Os,{children:[t.jsx(it,{className:"w-[40px]",children:t.jsx("input",{type:"checkbox",checked:v.size===j.users.length&&j.users.length>0,onChange:k,className:"h-4 w-4","data-testid":"checkbox-select-all"})}),t.jsx(it,{children:"ID"}),t.jsx(it,{children:"Username"}),t.jsx(it,{children:"Email"}),t.jsx(it,{children:"Tier"}),t.jsx(it,{children:"Verified"}),t.jsx(it,{children:"Referrals"}),t.jsx(it,{children:"Joined"}),t.jsx(it,{className:"text-right",children:"Actions"})]})}),t.jsx(di,{children:j.users.map(C=>t.jsxs(Os,{"data-testid":`row-user-${C.id}`,children:[t.jsx(nt,{children:t.jsx("input",{type:"checkbox",checked:v.has(C.id),onChange:()=>S(C.id),className:"h-4 w-4","data-testid":`checkbox-user-${C.id}`})}),t.jsx(nt,{className:"font-mono text-sm","data-testid":`text-user-id-${C.id}`,children:C.id}),t.jsx(nt,{className:"font-medium","data-testid":`text-username-${C.id}`,children:C.username}),t.jsx(nt,{className:"text-sm text-muted-foreground","data-testid":`text-email-${C.id}`,children:C.email}),t.jsx(nt,{children:t.jsx(xe,{variant:$(C.membership_level),children:C.membership_level})}),t.jsx(nt,{children:C.email_verified?t.jsx(ot,{className:"h-4 w-4 text-green-500","data-testid":`icon-verified-${C.id}`}):t.jsx(Qr,{className:"h-4 w-4 text-muted-foreground","data-testid":`icon-unverified-${C.id}`})}),t.jsx(nt,{className:"text-sm","data-testid":`text-referrals-${C.id}`,children:C.referral_count}),t.jsx(nt,{className:"text-sm text-muted-foreground",children:$r(new Date(C.created_at),"MMM d, yyyy")}),t.jsx(nt,{className:"text-right",children:t.jsxs(rl,{children:[t.jsx(nl,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon","data-testid":`button-actions-${C.id}`,children:t.jsx(HD,{className:"h-4 w-4"})})}),t.jsxs(ao,{align:"end",children:[t.jsx(Qa,{children:"Actions"}),t.jsx(va,{}),t.jsx(Es,{onClick:()=>n(C),"data-testid":`menu-item-manage-${C.id}`,children:"Manage User"}),t.jsx(va,{}),t.jsxs(Es,{onClick:()=>i(C.id),className:"text-destructive","data-testid":`menu-item-delete-${C.id}`,children:[t.jsx(ni,{className:"h-4 w-4 mr-2"}),"Delete User"]})]})]})})]},C.id))})]})}),j.pagination.totalPages>1&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",j.pagination.page," of ",j.pagination.totalPages]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(T,{variant:"outline",size:"sm",onClick:()=>{f(new Set),l(C=>
655Math.max(1,C-1))},disabled:o===1,"data-testid":"button-prev-page",children:"Previous"}),t.jsx(T,{variant:"outline",size:"sm",onClick:()=>{f(new Set),l(C=>C+1)},disabled:o>=j.pagination.totalPages,"data-testid":"button-next-page",children:"Next"})]})]})]})]})]})]}),t.jsx(ps,{value:"platforms",className:"mt-6",children:t.jsx(NQ,{})}),t.jsx(ps,{value:"extension",className:"mt-6",children:t.jsx(kQ,{})}),t.jsx(ps,{value:"logs",className:"mt-6",children:t.jsx(SQ,{})}),t.jsx(ps,{value:"email",className:"mt-6",children:t.jsx(wQ,{})}),t.jsx(ps,{value:"affiliates",className:"mt-6",children:t.jsx(jQ,{})}),t.jsx(ps,{value:"images",className:"mt-6",children:t.jsx(CQ,{})}),t.jsx(ps,{value:"funnel",className:"mt-6",children:t.jsx(vQ,{})})]}),r&&t.jsx(yQ,{user:r,onClose:()=>n(null),onUpdate:()=>{w(),ee.invalidateQueries({queryKey:["/api/admin/users"]})}}),t.jsx(Kd,{open:a!==null,onOpenChange:()=>i(null),children:t.jsxs(nc,{children:[t.jsxs(ac,{children:[t.jsx(oc,{children:"⚠️ Permanently Delete User Account?"}),t.jsxs(lc,{className:"space-y-3",children:[t.jsx("p",{className:"font-semibold text-destructive",children:"This action cannot be undone and will permanently delete:"}),t.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm",children:[t.jsx("li",{children:"User account and login credentials"}),t.jsx("li",{children:"All scheduled posts (pending and approved)"}),t.jsx("li",{children:"Platform configurations and OAuth connections"}),t.jsx("li",{children:"AI prompts and content settings"}),t.jsx("li",{children:"Item lists and user preferences"}),t.jsx("li",{children:"Activity logs and webhook data"}),t.jsx("li",{children:"All other associated records (24+ database tables)"})]}),t.jsx("p",{className:"text-sm font-medium pt-2",children:"The deletion process will remove records from all dependent tables in the correct order before deleting the user account."})]})]}),t.jsxs(ic,{children:[t.jsx(dc,{"data-testid":"button-cancel-delete",disabled:A.isPending,children:"Cancel"}),t.jsx(cc,{onClick:()=>a&&A.mutate(a),disabled:A.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90","data-testid":"button-confirm-delete",children:A.isPending?t.jsxs(t.Fragment,{children:[t.jsx(Qe,{className:"h-4 w-4 mr-2 animate-spin"}),"Deleting..."]}):"Delete User Permanently"})]})]})})]})}function TQ(){const[e,s]=m.useState("3278"),[r,n]=m.useState("2025-11-24"),[a,i]=m.useState("2025-11-25"),[o,l]=m.useState(null),[c,d]=m.useState(!1),{data:u}=Ee({queryKey:["/api/platform-configs"]}),h=async()=>{d(!0),l(null);try{const p=`${r}T06:00:00Z`,x=`${a}T05:59:59Z`,f=await(await fetch(`/api/test/iterate-slots/${e}?startDate=${p}&endDate=${x}`)).json();l(f)}catch(p){console.error("Error:",p)}finally{d(!1)}};return t.jsxs("div",{className:"container mx-auto p-8 max-w-4xl",children:[t.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Test IterateSlots Method"}),t.jsxs(re,{className:"mb-6",children:[t.jsx(he,{children:t.jsx(pe,{children:"Test Configuration"})}),t.jsxs(de,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"platform-select",children:"Platform"}),u&&u.length>0?t.jsxs(Nt,{value:e,onValueChange:s,children:[t.jsx(gt,{id:"platform-select","data-testid":"select-platform",children:t.jsx(kt,{placeholder:"Select platform"})}),t.jsx(yt,{children:u.map(p=>t.jsxs(Se,{value:String(p.id),children:[p.platformName," (ID: ",p.id,") - ",p.postFrequency]},p.id))})]}):t.jsx(Ke,{id:"platform-select",type:"number",value:e,onChange:p=>s(p.target.value),placeholder:"Platform Config ID","data-testid":"input-platform-id"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"start-date",children:"Start Date"}),t.jsx(Ke,{id:"start-date",type:"date",value:r,onChange:p=>n(p.target.value),"data-testid":"input-start-date"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"end-date",children:"End Date"}),t.jsx(Ke,{id:"end-date",type:"date",value:a,onChange:p=>i(p.target.value),"data-testid":"input-end-date"})]})]}),t.jsx(T,{onClick:h,disabled:c,"data-testid":"button-test",className:"w-full",children:c?"Testing...":"Test Iterate Slots"})]})]}),o&&t.jsxs(re,{children:[t.jsx(he,{children:t.jsx(pe,{children:"Results"})}),t.jsx(de,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-semibold",children:"Platform:"})," ",o.platform]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-semibold",children:"Frequency:"})," ",o.frequencyHours,"h"]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-semibold",children:"Existing Posts:"})," ",o.existingPostsCount]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-semibold",children:"Empty Slots:"})," ",o.emptySlotCount," / ",o.totalSlotsFound]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold mb-2",children:"Full Response:"}),t.jsx("pre",{className:"text-xs overflow-auto max-h-96 bg-muted p-4 rounded",children:JSON.stringify(o,null,2)})]})]})})]})]})}function AQ(){const{user:e}=hi(),{toast:s}=bt(),[r,n]=m.useState(!1),{data:a}=Ee({queryKey:["/api/stripe/status"],enabled:!!e}),i=ke({mutationFn:async({plan:u,interval:h})=>
655(await Fe("POST","/api/stripe/create-checkout-session",{plan:u,interval:h})).json(),onSuccess:u=>{u.url&&(window.location.href=u.url)},onError:u=>{s({title:"Checkout Error",description:u.message||"Failed to start checkout. Please try again.",variant:"destructive"}),n(!1)}}),o=ke({mutationFn:async()=>(await Fe("POST","/api/stripe/create-portal-session",{})).json(),onSuccess:u=>{u.url&&(window.location.href=u.url)},onError:u=>{s({title:"Portal Error",description:u.message||"Failed to open billing portal. Please try again.",variant:"destructive"})}});if(!e)return null;const l=e.membershipLevel.charAt(0).toUpperCase()+e.membershipLevel.slice(1),c=async(u,h)=>{if(!(a!=null&&a.configured)){s({title:"Coming Soon",description:"Payment processing will be available soon. Currently enjoying beta access!"});return}n(!0),i.mutate({plan:u,interval:h})},d=async u=>{if(!(a!=null&&a.configured)){s({title:"Coming Soon",description:"Subscription management will be available soon."});return}e.stripeSubscriptionId?o.mutate():s({title:"No Active Subscription",description:"You don't have an active paid subscription to downgrade."})};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl sm:text-3xl font-bold","data-testid":"text-page-title",children:"Upgrade Your Plan"}),t.jsxs("p",{className:"text-muted-foreground text-sm sm:text-base",children:["You are currently on the ",t.jsx("span",{className:"font-semibold text-foreground",children:l})," plan"]})]}),t.jsx(E6,{userId:e.id,membershipLevel:e.membershipLevel,userEmail:e.email,onUpgrade:c,onDowngrade:d})]})}function Xm(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function _Q(e){if(!e)return"";const s=new Date(e),n=new Date().getTime()-s.getTime(),a=Math.floor(n/(1e3*60*60*24));return a===0?"Today":a===1?"1d":a<7?`${a}d`:a<30?`${Math.floor(a/7)}w`:a<365?`${Math.floor(a/30)}mo`:`${Math.floor(a/365)}y`}function EQ(e,s=120){return e.length<=s?e:e.slice(0,s).trim()+"..."}function zN({tweet:e}){const s=e.media_urls?e.media_urls.split(",").filter(Boolean):[],r=s.length>0?s[0]:null,n=`https://x.com/${e.author_username}/status/${e.tweet_id}`;return t.jsxs(re,{className:"p-3 hover-elevate cursor-pointer overflow-hidden",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),"data-testid":`card-inspiration-${e.id}`,children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:t.jsx(gr,{className:"w-4 h-4 text-muted-foreground"})}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[t.jsx("span",{className:"font-semibold truncate","data-testid":`text-author-name-${e.id}`,children:e.author_name||e.author_username}),t.jsxs("span",{className:"text-muted-foreground truncate","data-testid":`text-author-handle-${e.id}`,children:["@",e.author_username]}),t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-muted-foreground text-xs","data-testid":`text-time-${e.id}`,children:_Q(e.created_at)})]})})]}),t.jsx("p",{className:"text-sm mb-2 line-clamp-3","data-testid":`text-content-${e.id}`,children:EQ(e.text,150)}),r&&t.jsx("div",{className:"mb-2 rounded-md overflow-hidden",children:t.jsx("img",{src:r,alt:"Tweet media",className:"w-full h-32 object-cover","data-testid":`img-media-${e.id}`,onError:a=>{a.target.style.display="none"}})}),t.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[t.jsxs("div",{className:"flex items-center gap-1","data-testid":`stat-replies-${e.id}`,children:[t.jsx(r7,{className:"w-3.5 h-3.5"}),t.jsx("span",{children:Xm(e.reply_count)})]}),t.jsxs("div",{className:"flex items-center gap-1","data-testid":`stat-retweets-${e.id}`,children:[t.jsx(l7,{className:"w-3.5 h-3.5"}),t.jsx("span",{children:Xm(e.retweet_count)})]}),t.jsxs("div",{className:"flex items-center gap-1","data-testid":`stat-likes-${e.id}`,children:[t.jsx(YD,{className:"w-3.5 h-3.5"}),t.jsx("span",{children:Xm(e.like_count)})]}),t.jsxs("div",{className:"flex items-center gap-1","data-testid":`stat-views-${e.id}`,children:[t.jsx(Ju,{className:"w-3.5 h-3.5"}),t.jsx("span",{children:Xm(e.view_count)})]})]})]})}function IQ(){const[e,s]=m.useState("ideas"),{data:r=[],isLoading:n}=Ee({queryKey:["/api/inspirations"]}),a=r.filter(c=>!c.status||c.status==="idea"),i=r.filter(c=>c.status==="viral"),o=a.length,l=i.length;return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold","data-testid":"text-page-title",children:"Inspirations"}),t.jsx("p",{className:"text-muted-foreground","data-testid":"text-page-description",children:"Save and organize tweet inspirations from the Chrome extension"})]}),t.jsxs(sd,{value:e,onValueChange:s,className:"w-full",children:[t.jsxs(dl,{className:"grid w-full max-w-md grid-cols-2",children:[t.jsxs(hs,{value:"ideas",className:"flex items-center gap-2","data-testid":"tab-saved-ideas",children:[t.jsx(Yo,{className:"w-4 h-4"}),"Saved Ideas",t.jsx("span",{className:"text-xs text-muted-foreground",children:o})]}),t.jsxs(hs,{value:"viral",className:"flex items-center gap-2","data-testid":"tab-viral-posts",children:[t.jsx(mw,{className:"w-4 h-4"}),"Viral Posts",t.jsx("span",{className:"text-xs text-muted-foreground",children:l})]})]}),t.jsx(ps,{value:"ideas",className:"mt-6",children:n?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx(Qe,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):a.length===0?t.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[t.jsx(Yo,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{className:"text-lg font-medium",children:"No saved ideas yet"}),t.jsx("p",{className:"text-sm mt-1",children:"Use the Chrome extension to save tweets that inspire your content"})]}):t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:a.map(c=>t.jsx(zN,{tweet:c},c.id))})}),t.jsx(ps,{value:"viral",className:"mt-6",children:n?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx(Qe,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):i.length===0?t.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[t.jsx(mw,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),t.jsx("p",{className:"text-lg font-medium",children:"No viral posts saved"}),t.jsx("p",{className:"text-sm mt-1",children:"Use the Chrome extension to save viral tweets for inspiration"})]}):t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:i.map(c=>t.jsx(zN,{tweet:c},c.id))})})]})]})}function MQ(){return window.location.hostname.startsWith("extensions.")}function RQ(){const{user:e,isLoading:s}=hi();if(MQ())return t.jsx(kV,{});if(s)return t.jsx("div",{className:"flex items-center justify-center min-h-screen",children:t.jsx(Qe,{className:"h-8 w-8 animate-spin text-border"})});if(!e)return t.jsx(hz,{});const r=window.location.search;return t.jsx(du,{to:`/dashboard${r}`})}function FQ(){const e={"--sidebar-width":"16rem"};return t.jsxs(mF,{children:[t.jsx(Dt,{path:"/",component:RQ}),t.jsx(Dt,{path:"/auth",component:T$}),t.jsx(Dt,{path:"/verify",component:oz}),t.jsx(Dt,{path:"/forgot-password",component:lz}),t.jsx(Dt,{path:"/features",component:Tz}),t.jsx(Dt,{path:"/pricing",component:xV}),t.jsx(Dt,{path:"/referral",component:yV}),t.jsx(Dt,{path:"/privacy",component:Jw}),t.jsx(Dt,{path:"/terms",component:tN}),t.jsx(Dt,{path:"/legal/privacy-policy",component:Jw}),t.jsx(Dt,{path:"/legal/terms-of-service",component:tN}),t.jsx(Dt,{path:"/landing2",component:gz}),t.jsx(Dt,{path:"/dashboard",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(oH,{})})]})]})})})}),t.jsx(Dt,{path:"/create-post",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(dH,{})})]})]})})})}),t.jsx(Dt,{path:"/upgrade",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(AQ,{})})]})]})})})}),t.jsx(Dt,{path:"/queue",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(lH,{})})]})]})})})}),t.jsx(Dt,{path:"/recent",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(rQ,{})})]})]})})})}),t.jsx(Dt,{path:"/campaigns",children:t.jsx(du,{to:"/x-config"})}),t.jsx(Dt,{path:"/activity",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(oQ,{})})]})]})})})}),t.jsx(Dt,{path:"/calendar",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(cH,{})})]})]})})})}),t.jsx(Dt,{path:"/videos",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(hH,{})})]})]})})})}),t.jsx(Dt,{path:"/inspirations",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(IQ,{})})]})]})})})}),t.jsx(Dt,{path:"/analytics",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",chi
655ldren:t.jsx(vH,{})})]})]})})})}),t.jsx(Dt,{path:"/x-config",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(cQ,{})})]})]})})})}),t.jsx(Dt,{path:"/settings",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(sQ,{})})]})]})})})}),t.jsx(Dt,{path:"/profile",children:()=>t.jsx(Cr,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(fQ,{})})]})]})})})}),t.jsx(Dt,{path:"/admin",children:()=>t.jsx(a$,{children:t.jsx(wr,{style:e,children:t.jsxs("div",{className:"flex h-screen w-full",children:[t.jsx(kr,{}),t.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs("header",{className:"flex items-center justify-between gap-4 px-4 py-3 border-b border-border bg-background",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nr,{"data-testid":"button-sidebar-toggle"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("img",{src:Wt,alt:"Social Monkey Logo",className:"h-10 w-auto","data-testid":"img-logo"}),t.jsx("span",{className:"text-xl font-bold text-foreground","data-testid":"text-app-name",children:"Social Monkey"})]})]}),t.jsx(Sr,{})]}),t.jsx("main",{className:"flex-1 overflow-auto p-2 md:p-6",children:t.jsx(PQ,{})})]})]})})})}),t.jsx(Dt,{path:"/test-grid",children:()=>t.jsx(Cr,{children:t.jsx(TQ,{})})}),t.jsx(Dt,{component:i$})]})}function DQ(){return t.jsx(IF,{client:ee,children:t.jsx(kL,{children:t.jsx(t$,{children:t.jsxs(r5,{children:[t.jsx(X7,{}),t.jsx(FQ,{})]})})})})}n3(document.getElementById("root")).render(t.jsx(DQ,{}));

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.